mirror of
https://github.com/affaan-m/everything-claude-code.git
synced 2026-03-30 13:43:26 +08:00
feat: project-scoped instinct isolation
* feat: add project-scoped instinct isolation * fix(continuous-learning-v2): harden instinct loading and promotion safety; sync v2.1 command docs * fix(ci): make copilot-setup-steps a valid GitHub Actions workflow * fix(hooks): stabilize docs warning inline JS regex parsing
This commit is contained in:
@@ -1,112 +1,36 @@
|
||||
---
|
||||
description: Cluster instincts into skills
|
||||
description: Analyze instincts and suggest or generate evolved structures
|
||||
agent: build
|
||||
---
|
||||
|
||||
# Evolve Command
|
||||
|
||||
Cluster related instincts into structured skills: $ARGUMENTS
|
||||
Analyze and evolve instincts in continuous-learning-v2: $ARGUMENTS
|
||||
|
||||
## Your Task
|
||||
|
||||
Analyze instincts and promote clusters to skills.
|
||||
Run:
|
||||
|
||||
## Evolution Process
|
||||
|
||||
### Step 1: Analyze Instincts
|
||||
|
||||
Group instincts by:
|
||||
- Trigger similarity
|
||||
- Action patterns
|
||||
- Category tags
|
||||
- Confidence levels
|
||||
|
||||
### Step 2: Identify Clusters
|
||||
|
||||
```
|
||||
Cluster: Error Handling
|
||||
├── Instinct: Catch specific errors (0.85)
|
||||
├── Instinct: Wrap errors with context (0.82)
|
||||
├── Instinct: Log errors with stack trace (0.78)
|
||||
└── Instinct: Return meaningful error messages (0.80)
|
||||
```bash
|
||||
python3 "${CLAUDE_PLUGIN_ROOT}/skills/continuous-learning-v2/scripts/instinct-cli.py" evolve $ARGUMENTS
|
||||
```
|
||||
|
||||
### Step 3: Generate Skill
|
||||
If `CLAUDE_PLUGIN_ROOT` is unavailable, use:
|
||||
|
||||
When cluster has:
|
||||
- 3+ instincts
|
||||
- Average confidence > 0.75
|
||||
- Cohesive theme
|
||||
|
||||
Generate SKILL.md:
|
||||
|
||||
```markdown
|
||||
# Error Handling Skill
|
||||
|
||||
## Overview
|
||||
Patterns for robust error handling learned from session observations.
|
||||
|
||||
## Patterns
|
||||
|
||||
### 1. Catch Specific Errors
|
||||
**Trigger**: When catching errors with generic catch
|
||||
**Action**: Use specific error types
|
||||
|
||||
### 2. Wrap Errors with Context
|
||||
**Trigger**: When re-throwing errors
|
||||
**Action**: Add context with fmt.Errorf or Error.cause
|
||||
|
||||
### 3. Log with Stack Trace
|
||||
**Trigger**: When logging errors
|
||||
**Action**: Include stack trace for debugging
|
||||
|
||||
### 4. Meaningful Messages
|
||||
**Trigger**: When returning errors to users
|
||||
**Action**: Provide actionable error messages
|
||||
```bash
|
||||
python3 ~/.claude/skills/continuous-learning-v2/scripts/instinct-cli.py evolve $ARGUMENTS
|
||||
```
|
||||
|
||||
### Step 4: Archive Instincts
|
||||
## Supported Args (v2.1)
|
||||
|
||||
Move evolved instincts to `archived/` with reference to skill.
|
||||
- no args: analysis only
|
||||
- `--generate`: also generate files under `evolved/{skills,commands,agents}`
|
||||
|
||||
## Evolution Report
|
||||
## Behavior Notes
|
||||
|
||||
```
|
||||
Evolution Summary
|
||||
=================
|
||||
|
||||
Clusters Found: X
|
||||
|
||||
Cluster 1: Error Handling
|
||||
- Instincts: 5
|
||||
- Avg Confidence: 0.82
|
||||
- Status: ✅ Promoted to skill
|
||||
|
||||
Cluster 2: Testing Patterns
|
||||
- Instincts: 3
|
||||
- Avg Confidence: 0.71
|
||||
- Status: ⏳ Needs more confidence
|
||||
|
||||
Cluster 3: Git Workflow
|
||||
- Instincts: 2
|
||||
- Avg Confidence: 0.88
|
||||
- Status: ⏳ Needs more instincts
|
||||
|
||||
Skills Created:
|
||||
- skills/error-handling/SKILL.md
|
||||
|
||||
Instincts Archived: 5
|
||||
Remaining Instincts: 12
|
||||
```
|
||||
|
||||
## Thresholds
|
||||
|
||||
| Metric | Threshold |
|
||||
|--------|-----------|
|
||||
| Min instincts per cluster | 3 |
|
||||
| Min average confidence | 0.75 |
|
||||
| Min cluster cohesion | 0.6 |
|
||||
|
||||
---
|
||||
|
||||
**TIP**: Run `/evolve` periodically to graduate instincts to skills as confidence grows.
|
||||
- Uses project + global instincts for analysis.
|
||||
- Shows skill/command/agent candidates from trigger and domain clustering.
|
||||
- Shows project -> global promotion candidates.
|
||||
- With `--generate`, output path is:
|
||||
- project context: `~/.claude/homunculus/projects/<project-id>/evolved/`
|
||||
- global fallback: `~/.claude/homunculus/evolved/`
|
||||
|
||||
@@ -1,75 +1,29 @@
|
||||
---
|
||||
description: View learned instincts with confidence scores
|
||||
description: Show learned instincts (project + global) with confidence
|
||||
agent: build
|
||||
---
|
||||
|
||||
# Instinct Status Command
|
||||
|
||||
Display learned instincts and their confidence scores: $ARGUMENTS
|
||||
Show instinct status from continuous-learning-v2: $ARGUMENTS
|
||||
|
||||
## Your Task
|
||||
|
||||
Read and display instincts from the continuous-learning-v2 system.
|
||||
Run:
|
||||
|
||||
## Instinct Location
|
||||
|
||||
Global: `~/.claude/instincts/`
|
||||
Project: `.claude/instincts/`
|
||||
|
||||
## Status Display
|
||||
|
||||
### Instinct Summary
|
||||
|
||||
| Category | Count | Avg Confidence |
|
||||
|----------|-------|----------------|
|
||||
| Coding | X | 0.XX |
|
||||
| Testing | X | 0.XX |
|
||||
| Security | X | 0.XX |
|
||||
| Git | X | 0.XX |
|
||||
|
||||
### High Confidence Instincts (>0.8)
|
||||
|
||||
```
|
||||
[trigger] → [action] (confidence: 0.XX)
|
||||
```bash
|
||||
python3 "${CLAUDE_PLUGIN_ROOT}/skills/continuous-learning-v2/scripts/instinct-cli.py" status
|
||||
```
|
||||
|
||||
### Learning Progress
|
||||
If `CLAUDE_PLUGIN_ROOT` is unavailable, use:
|
||||
|
||||
- Total instincts: X
|
||||
- This session: X
|
||||
- Promoted to skills: X
|
||||
|
||||
### Recent Instincts
|
||||
|
||||
Last 5 instincts learned:
|
||||
|
||||
1. **[timestamp]** - [trigger] → [action]
|
||||
2. **[timestamp]** - [trigger] → [action]
|
||||
...
|
||||
|
||||
## Instinct Structure
|
||||
|
||||
```json
|
||||
{
|
||||
"id": "instinct-123",
|
||||
"trigger": "When I see a try-catch without specific error type",
|
||||
"action": "Suggest using specific error types for better handling",
|
||||
"confidence": 0.75,
|
||||
"applications": 5,
|
||||
"successes": 4,
|
||||
"source": "session-observation",
|
||||
"timestamp": "2025-01-15T10:30:00Z"
|
||||
}
|
||||
```bash
|
||||
python3 ~/.claude/skills/continuous-learning-v2/scripts/instinct-cli.py status
|
||||
```
|
||||
|
||||
## Confidence Calculation
|
||||
## Behavior Notes
|
||||
|
||||
```
|
||||
confidence = (successes + 1) / (applications + 2)
|
||||
```
|
||||
|
||||
Bayesian smoothing ensures new instincts don't have extreme confidence.
|
||||
|
||||
---
|
||||
|
||||
**TIP**: Use `/evolve` to cluster related instincts into skills when confidence is high.
|
||||
- Output includes both project-scoped and global instincts.
|
||||
- Project instincts override global instincts when IDs conflict.
|
||||
- Output is grouped by domain with confidence bars.
|
||||
- This command does not support extra filters in v2.1.
|
||||
|
||||
23
.opencode/commands/projects.md
Normal file
23
.opencode/commands/projects.md
Normal file
@@ -0,0 +1,23 @@
|
||||
---
|
||||
description: List registered projects and instinct counts
|
||||
agent: build
|
||||
---
|
||||
|
||||
# Projects Command
|
||||
|
||||
Show continuous-learning-v2 project registry and stats: $ARGUMENTS
|
||||
|
||||
## Your Task
|
||||
|
||||
Run:
|
||||
|
||||
```bash
|
||||
python3 "${CLAUDE_PLUGIN_ROOT}/skills/continuous-learning-v2/scripts/instinct-cli.py" projects
|
||||
```
|
||||
|
||||
If `CLAUDE_PLUGIN_ROOT` is unavailable, use:
|
||||
|
||||
```bash
|
||||
python3 ~/.claude/skills/continuous-learning-v2/scripts/instinct-cli.py projects
|
||||
```
|
||||
|
||||
23
.opencode/commands/promote.md
Normal file
23
.opencode/commands/promote.md
Normal file
@@ -0,0 +1,23 @@
|
||||
---
|
||||
description: Promote project instincts to global scope
|
||||
agent: build
|
||||
---
|
||||
|
||||
# Promote Command
|
||||
|
||||
Promote instincts in continuous-learning-v2: $ARGUMENTS
|
||||
|
||||
## Your Task
|
||||
|
||||
Run:
|
||||
|
||||
```bash
|
||||
python3 "${CLAUDE_PLUGIN_ROOT}/skills/continuous-learning-v2/scripts/instinct-cli.py" promote $ARGUMENTS
|
||||
```
|
||||
|
||||
If `CLAUDE_PLUGIN_ROOT` is unavailable, use:
|
||||
|
||||
```bash
|
||||
python3 ~/.claude/skills/continuous-learning-v2/scripts/instinct-cli.py promote $ARGUMENTS
|
||||
```
|
||||
|
||||
Reference in New Issue
Block a user