agentleFS
sd0xdevsd0xdev/sd0x-dev-flow/skills/portfolio/SKILL.md

portfolio

Skill196 starsChanged 56 days agoMITView on GitHub

Portfolio system knowledge base. Use when: position queries, routing strategy questions, provider integration. Not for: general code exploration (use code-explore), code review (use codex-code-review). Output: domain-specific analysis + recommendations.

  • Sends data out

25 other projects use a version of this.

Adopted by

Most recently taken up by

Used with

Projects with it also use risk and changelog.

Other files people use alongside this one.

Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
  • OlayeeeyoSkill

    risk

    评估当前整体持仓的风险敞口。当用户输入 /risk 时触发。适用场景:"我的持仓有什么风险?" "期权 assignment 风险大吗?" "持仓集中度怎样?

    Also in 3 projects that use this

  • HashiCorpSkill

    changelog

    Add a Changie change fragment (`.changes/<major>.x/unreleased/*.yaml`) for a GitHub Pull Request, commit, and push.

    Also in 3 projects that use this

The file

We split this skill into the rules it gives an agent

2 rules. 0 are common, 0 are distinctive, and 2 are very specific to this project.

  • 0

    Common

    Most of the 19 edited versions we read keep these.

  • 0

    Distinctive

    This author's own choices. Worth a look.

  • 2

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    Check if {PRIMARY_PROVIDER} supports it

    line 56
  2. Very specific:

    If custom build needed: implement PortfolioPositionExtractor + register + configure routing

    line 57

“Common” is measured: kept by at least 6 in 10 of the 19 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Portfolio Skill

Trigger

  • Keywords: Portfolio, portfolio, position, {PRIMARY_PROVIDER}, protocol, lending, staking, liquidity

When NOT to Use

  • General token queries (not Portfolio positions)
  • Transaction building (use corresponding provider)
  • Non-portfolio related API issues

Core Files

TypeFilePurpose
Controllersrc/entity/portfolio/portfolio.controller.tsREST API
Routersrc/service/portfolio/source-router/*.service.tsRouting orchestration
Clientsrc/service/portfolio/providers/{provider}/*.ts{PRIMARY_PROVIDER} integration
Aggregatorsrc/service/portfolio/aggregation/*.service.tsAggregation computation
DTOsrc/dto/portfolio/position.types.tsPosition model

API Overview

Base: /onchain/v1/portfolio

EndpointMethodPurpose
/positionsPOSTGet portfolio positions
/chainsGETSupported chains list
/protocolsGETSupported protocols list

Output

  • Domain-specific query results with code references
  • Analysis and recommendations based on current architecture

Verification

  • Position data correctly normalized
  • Cache hit/miss working properly
  • Aggregation calculations accurate

Development Guide

Add Protocol Support

  1. Check if {PRIMARY_PROVIDER} supports it
  2. If custom build needed: implement PortfolioPositionExtractor + register + configure routing

Add Data Source

  1. Implement ProviderClient + Adapter
  2. Register with SourceRouter
  3. Configure routing strategy

Debug

redis-cli keys "portfolio:{provider}:*"
redis-cli get "portfolio:{provider}:positions:0x...:v2:..."
curl -X POST /positions -d '{"isForceRefresh": true, ...}'

References

  • references/architecture.md - System architecture + cache strategy
  • references/api.md - API reference + data models
  • @docs/features/portfolio/ - Detailed documentation

Tests

TypeLocation
Unittest/unit/service/portfolio/
Integrationtest/integration/portfolio/

Examples

Input: How to query portfolio positions?
Action: Explain POST /positions API + routing strategy
Input: How does {PRIMARY_PROVIDER} integration work?
Action: Explain {PRIMARY_PROVIDER}Client + {PRIMARY_PROVIDER}Adapter flow

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.