Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
73 changes: 73 additions & 0 deletions .claude/skills/learned/SKILL.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
---
name: learned-skills-index
description: Index directory for automatically learned skills from execution feedback
type: index
---

# Learned Skills Index

This directory contains skills that have been automatically extracted from successful
execution sessions. These skills represent patterns that led to quality improvements
and are available for retrieval in future tasks.

## How Skills Are Learned

1. **Execution**: Claude Code runs a task with `--loop` enabled
2. **Feedback Collection**: Each iteration's quality scores and improvements are recorded
3. **Pattern Extraction**: Successful patterns are extracted from quality-improving iterations
4. **Skill Generation**: Patterns are compiled into a learnable skill definition
5. **Promotion Gate**: Skills must meet quality thresholds before promotion

## Skill Status

| Status | Meaning |
|--------|---------|
| **Pending** | Skill extracted but not yet promoted (needs more validation) |
| **Promoted** | Skill has been validated and can be applied to new tasks |
| **Archived** | Skill deprecated or superseded by newer learning |

## Quality Thresholds for Promotion

- Minimum quality score: 85.0
- Minimum successful applications: 2
- Minimum success rate: 70%

## Directory Structure

```
learned/
├── SKILL.md # This index file
├── learned-backend-auth/ # Example learned skill
│ ├── SKILL.md # Skill definition
│ └── metadata.json # Machine-readable metadata
└── learned-frontend-form/ # Another learned skill
├── SKILL.md
└── metadata.json
```

## Integration

Learned skills are automatically retrieved based on:
- Task description keywords
- File types being modified
- Domain context

To manually query learned skills:
```python
from core.skill_persistence import retrieve_skills_for_task

skills = retrieve_skills_for_task(
task_description="your task here",
domain="backend" # optional
)
```

## Safety

All learned skills include full provenance:
- Source session ID
- Source repository
- Timestamp of learning
- Quality progression

This enables rollback and audit of any behavioral changes from learned skills.
44 changes: 44 additions & 0 deletions .claude/skills/sc-implement/SKILL.md
Original file line number Diff line number Diff line change
Expand Up @@ -88,8 +88,52 @@ This skill requires evidence. You MUST:
/sc:implement "enterprise auth system" --orchestrate --strategy systematic --delegate
```

## Loop Mode & Learning

When using `--loop`, this skill integrates with the skill persistence layer for cross-session learning:

### How Learning Works

1. **Feedback Recording** - Each iteration's quality scores and improvements are persisted
2. **Skill Extraction** - Successful patterns are extracted when quality threshold is met
3. **Skill Retrieval** - Relevant learned skills are injected into subsequent tasks
4. **Effectiveness Tracking** - Applied skills are tracked for success rate

### Loop Flags

| Flag | Type | Default | Description |
|------|------|---------|-------------|
| `--loop` | int | 3 | Enable iterative improvement (max 5) |
| `--learn` | bool | true | Enable learning from this session |
| `--auto-promote` | bool | false | Auto-promote high-quality skills |

### Example with Learning

```bash
# Iterative implementation with learning
/sc:implement auth flow --loop 3 --learn

# View learned skills
python scripts/skill_learn.py '{"command": "stats"}'

# Retrieve relevant skills
python scripts/skill_learn.py '{"command": "retrieve", "task": "auth"}'
```

### Learned Skills Location

Promoted skills are stored in:
```
.claude/skills/learned/
├── SKILL.md # Index
├── learned-backend-auth/ # Example promoted skill
│ ├── SKILL.md
│ └── metadata.json
```

## Resources

- [PERSONAS.md](PERSONAS.md) - Available persona definitions
- [scripts/select_agent.py](scripts/select_agent.py) - Agent selection logic
- [scripts/evidence_gate.py](scripts/evidence_gate.py) - Evidence validation
- [scripts/skill_learn.py](scripts/skill_learn.py) - Skill learning management
Loading
Loading