skill-creator
npx skills add https://github.com/claudefi/claudefi --skill skill-creator
Agent 安装分布
Skill 文档
Skill Creator for Claudefi
Create effective skills that extend Claudefi’s trading capabilities with specialized knowledge, strategies, and patterns.
Why This Skill Exists
I am the skill-creator. My purpose is to enable self-improvement through experience.
Traditional trading bots are static – they execute the same strategy forever, repeating the same mistakes. Claudefi is different. Every trade teaches us something, and I’m the mechanism that captures those lessons.
The Learning Loop
âââââââââââââââââââââââââââââââââââââââââââââââââââ
â THE RALPH LOOP â
â â
â 1. OBSERVE âââ Fetch live market data â
â â â
â 2. THINK âââ Claude decides (with skills) â
â â â â
â 3. ACT âââ Execute trade â â
â â â â
â 4. LEARN âââ I create skills that feed â
â â back into THINK â
â 5. REPEAT â
âââââââââââââââââââââââââââââââââââââââââââââââââââ
What I Do
When a trade closes:
- Lost >10%? â I create a WARNING skill to prevent repeating the mistake
- Won >20%? â I create a PATTERN skill to capture the winning approach
- After 10 trades? â I create a STRATEGY skill synthesizing what works
These skills become part of Claude’s context in future decisions. The agent literally reads its own past lessons before making new trades.
Why This Matters
Without me, Claudefi would:
- Repeat the same mistakes over and over
- Succeed by accident without understanding why
- Never improve beyond its initial training
With me, Claudefi:
- Turns every loss into a guardrail
- Turns every win into a repeatable pattern
- Gets smarter with every trade
When to Create Skills
Create a skill when:
- After a significant loss (>10%): Document what went wrong
- After a significant win (>20%): Capture the winning pattern
- After 10+ trades in a domain: Synthesize learnings into strategy
- When discovering a new pattern: Document for future use
- When a mistake repeats: Create a warning skill
Skill Types
1. Warning Skills (warning-{domain}-{timestamp}.md)
Created after losses to prevent repeating mistakes.
# Warning: [Domain] [Pattern Name]
*Generated from loss on {date}*
*P&L: ${amount} ({percent}%)*
---
## Pattern to Recognize
- [What warning signs were present?]
- [What market conditions led to this?]
## What Went Wrong
- [Analysis of the failure]
- [Root cause]
## Better Approach
- [What should have been done?]
- [Alternative strategy]
## Checklist Before Similar Trades
- [ ] Check condition 1
- [ ] Check condition 2
- [ ] Verify assumption 3
2. Pattern Skills (pattern-{domain}-{timestamp}.md)
Created after wins to replicate success.
# Winning Pattern: [Domain] [Pattern Name]
*Generated from profitable trade on {date}*
*P&L: +${amount} (+{percent}%)*
---
## Pattern Identified
- [What conditions led to success?]
- [Key indicators]
## Entry Criteria
- [When to look for this pattern]
- [Required conditions]
## Execution Checklist
1. Verify condition A
2. Check indicator B
3. Confirm volume/liquidity
## Risk Management
- Position size: {recommendation}
- Stop loss: {level}
- Take profit: {targets}
3. Strategy Skills (strategy-{domain}-{timestamp}.md)
Synthesized from multiple trades in a domain.
# [Domain] Trading Strategy
*Generated from {N} trades on {date}*
*Win Rate: {rate}% | Avg Win: +{percent}% | Avg Loss: {percent}%*
---
## Key Insights
- [What distinguishes wins from losses?]
- [Common success factors]
## Optimized Entry Criteria
Based on {N} winning trades:
1. [Criterion 1]
2. [Criterion 2]
## Risk Management Rules
Based on {N} losing trades:
1. [Rule 1]
2. [Rule 2]
## Confidence Calibration
- High confidence (>80%): [conditions]
- Medium confidence (60-80%): [conditions]
- Low confidence (<60%): [avoid]
## Action Checklist
1. [ ] Step 1
2. [ ] Step 2
3. [ ] Step 3
Skill Structure
Every skill file must have:
- Clear Title: Indicates type and domain
- Metadata Block: When created, from what data
- Actionable Content: Specific, not generic advice
- Checklists: Concrete steps to follow
Best Practices
Context Efficiency
- Be concise – Claude already knows general trading concepts
- Focus on Claudefi-specific learnings
- Include only information worth its token cost
Specificity Levels
- High specificity for risk management rules (must follow exactly)
- Medium specificity for entry criteria (patterns with variation)
- Low specificity for market analysis (flexible approach)
Progressive Disclosure
- Put most critical info in the title and first section
- Use expandable details for edge cases
- Reference other skills rather than duplicating
Storage Location
Skills are stored in .claude/skills/:
.claude/skills/
âââ skill-creator/SKILL.md # This file
âââ dlmm-liquidity.md # Built-in DLMM skill
âââ perps-trading.md # Built-in perps skill
âââ polymarket-trading.md # Built-in polymarket skill
âââ spot-memecoin.md # Built-in spot skill
âââ portfolio-management.md # Built-in portfolio skill
âââ warning-perps-{ts}.md # Auto-generated warnings
âââ pattern-dlmm-{ts}.md # Auto-generated patterns
âââ strategy-spot-{ts}.md # Auto-generated strategies
Integration with Skill Creator Code
The skill-creator TypeScript module (src/skills/skill-creator.ts) provides:
generateLossSkill(decision)– Creates warning skills from lossesgenerateWinSkill(decision)– Creates pattern skills from winsgenerateStrategySkill(decisions, domain)– Creates strategy from historyprocessTradeOutcome(decision)– Auto-creates appropriate skillreviewAndGenerateStrategy(decisions, domain)– Periodic reviewgetSkillsForDomain(domain)– Load skills for prompts
Example Usage
When a trade closes:
import { processTradeOutcome } from './skills/skill-creator.js';
// After a trade closes with outcome
const outcome: DecisionOutcome = {
domain: 'perps',
action: 'open_long',
target: 'SOL',
amountUsd: 500,
reasoning: 'RSI oversold, strong support',
confidence: 0.75,
outcome: 'loss',
pnl: -75,
pnlPercent: -15,
marketConditions: { rsi: 28, support: 95, volume: 'low' },
timestamp: new Date(),
};
// This will auto-generate a warning skill if loss > 10%
const skill = await processTradeOutcome(outcome);
The generated skill is automatically saved and will be loaded into future prompts for the domain.