Agent skill

portfolio

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.

Stars 139
Forks 18

Install this agent skill to your Project

npx add-skill https://github.com/sd0xdev/sd0x-dev-flow/tree/main/skills/portfolio

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

Type File Purpose
Controller src/entity/portfolio/portfolio.controller.ts REST API
Router src/service/portfolio/source-router/*.service.ts Routing orchestration
Client src/service/portfolio/providers/{provider}/*.ts {PRIMARY_PROVIDER} integration
Aggregator src/service/portfolio/aggregation/*.service.ts Aggregation computation
DTO src/dto/portfolio/position.types.ts Position model

API Overview

Base: /onchain/v1/portfolio

Endpoint Method Purpose
/positions POST Get portfolio positions
/chains GET Supported chains list
/protocols GET Supported 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

bash
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

Type Location
Unit test/unit/service/portfolio/
Integration test/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

Expand your agent's capabilities with these related and highly-rated skills.

sd0xdev/sd0x-dev-flow

runbook

Generate and update feature release runbooks from existing docs and codebase. Use when: creating operational runbook, release handbook, deployment checklist, pre-release preparation. Not for: incident response (v2), code review (use codex-code-review), architecture design (use architecture).

139 18
Explore
sd0xdev/sd0x-dev-flow

ask

Context-aware Q&A with auto context gathering. Use when: user has a quick question about codebase, git history, rules, docs, or skills during development. Not for: code changes (use feature-dev), code review (use codex-review-fast), deep research (use deep-research), full code trace (use code-explore). Output: structured answer with source attribution.

139 18
Explore
sd0xdev/sd0x-dev-flow

project-brief

Convert a technical spec into a PM/CTO-readable executive summary. Simplify technical details, focus on business value.

139 18
Explore
sd0xdev/sd0x-dev-flow

codex-test-gen

Generate unit tests for specified functions using Codex MCP

139 18
Explore
sd0xdev/sd0x-dev-flow

bug-fix

Bug fix workflow. Use when: fixing bugs, resolving issues, regression fixes. Not for: new features (use feature-dev), understanding code (use code-explore). Output: fix + regression test + review gate.

139 18
Explore
sd0xdev/sd0x-dev-flow

skill-health-check

Validate skill quality against routing, progressive loading, and verification criteria. Use when: auditing skills, checking skill health, reviewing skill design. Not for: code review (use codex-code-review) or doc review (use doc-review). Output: health report with per-skill ratings + Gate.

139 18
Explore

Didn't find tool you were looking for?

Be as detailed as possible for better results