claude-code-arcane 2.9.8 → 2.9.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +14 -0
- package/agents/business/business-ops-lead.md +1 -14
- package/agents/game/gameplay-programmer.md +3 -4
- package/agents/game/technical-artist.md +3 -4
- package/dist/cli.js +41 -6
- package/docs/USER-GUIDE.md +1 -1
- package/docs/coordination-rules.md +1 -1
- package/docs/directory-structure.md +93 -122
- package/package.json +1 -1
- package/profiles/backend-go.yaml +1 -0
- package/rules/gamedev/engine-code.md +1 -1
- package/rules/gamedev/shader-code.md +1 -2
- package/rules/gamedev/vn-code.md +3 -2
- package/rules/implementation-workflow.md +1 -1
- package/rules/{ai-code.md → llm-code.md} +5 -5
- package/skills/agent-designer/README.md +2 -1
- package/skills/agent-designer/agent_evaluator.py +0 -5
- package/skills/ai-sdk-setup/SKILL.md +4 -4
- package/skills/architecture-decision/SKILL.md +3 -4
- package/skills/architecture-review/SKILL.md +1 -1
- package/skills/asset-audit/SKILL.md +0 -1
- package/skills/balance-check/SKILL.md +1 -1
- package/skills/brainstorm/SKILL.md +3 -3
- package/skills/brainstorm/references/next-steps-pipeline.md +8 -9
- package/skills/consistency-check/SKILL.md +2 -2
- package/skills/design-system/SKILL.md +1 -1
- package/skills/design-system/references/post-design-validation.md +2 -3
- package/skills/frontend-dev/SKILL.md +27 -28
- package/skills/frontend-dev/references/asset-prompt-guide.md +1 -1
- package/skills/frontend-dev/references/motion-recipes.md +1 -1
- package/skills/help/SKILL.md +1 -2
- package/skills/hotfix/SKILL.md +2 -2
- package/skills/milestone-review/SKILL.md +1 -1
- package/skills/patch-notes/SKILL.md +1 -1
- package/skills/playtest-report/SKILL.md +2 -3
- package/skills/playwright-pro/CLAUDE.md +2 -2
- package/skills/playwright-pro/SKILL.md +13 -9
- package/skills/playwright-pro/agents/migration-planner.md +2 -2
- package/skills/playwright-pro/agents/test-architect.md +1 -2
- package/skills/playwright-pro/agents/test-debugger.md +1 -1
- package/skills/playwright-pro/hooks/detect-playwright.sh +1 -1
- package/skills/playwright-pro/skills/browserstack/SKILL.md +5 -5
- package/skills/playwright-pro/skills/migrate/SKILL.md +1 -1
- package/skills/playwright-pro/skills/report/SKILL.md +2 -2
- package/skills/playwright-pro/skills/testrail/SKILL.md +5 -5
- package/skills/playwright-pro/templates/README.md +2 -2
- package/skills/prototype/SKILL.md +1 -1
- package/skills/quick-design/SKILL.md +1 -1
- package/skills/release-checklist/SKILL.md +0 -1
- package/skills/security-audit/SKILL.md +1 -1
- package/skills/self-improving-agent/CLAUDE.md +12 -12
- package/skills/self-improving-agent/SKILL.md +16 -12
- package/skills/self-improving-agent/agents/memory-analyst.md +1 -1
- package/skills/self-improving-agent/hooks/error-capture.sh +2 -2
- package/skills/self-improving-agent/reference/memory-architecture.md +2 -2
- package/skills/self-improving-agent/reference/promotion-rules.md +3 -3
- package/skills/self-improving-agent/reference/rules-directory-patterns.md +1 -1
- package/skills/self-improving-agent/settings.json +5 -5
- package/skills/self-improving-agent/skills/extract/SKILL.md +7 -7
- package/skills/self-improving-agent/skills/promote/SKILL.md +5 -5
- package/skills/self-improving-agent/skills/remember/SKILL.md +9 -9
- package/skills/self-improving-agent/skills/review/SKILL.md +7 -7
- package/skills/self-improving-agent/skills/status/SKILL.md +8 -8
- package/skills/senior-ml-engineer/references/llm_integration_guide.md +14 -31
- package/skills/senior-prompt-engineer/SKILL.md +10 -10
- package/skills/senior-prompt-engineer/references/prompt_engineering_patterns.md +1 -1
- package/skills/senior-prompt-engineer/scripts/agent_orchestrator.py +43 -40
- package/skills/senior-prompt-engineer/scripts/prompt_optimizer.py +23 -66
- package/skills/shader-dev/reference/fluid-simulation.md +4 -4
- package/skills/shader-dev/reference/simulation-physics.md +6 -6
- package/skills/shader-dev/reference/voxel-rendering.md +1 -1
- package/skills/shader-dev/techniques/ambient-occlusion.md +1 -1
- package/skills/shader-dev/techniques/analytic-ray-tracing.md +2 -2
- package/skills/shader-dev/techniques/domain-warping.md +2 -2
- package/skills/shader-dev/techniques/fluid-simulation.md +45 -45
- package/skills/shader-dev/techniques/multipass-buffer.md +24 -24
- package/skills/shader-dev/techniques/normal-estimation.md +1 -1
- package/skills/shader-dev/techniques/particle-system.md +16 -16
- package/skills/shader-dev/techniques/polar-uv-manipulation.md +1 -1
- package/skills/shader-dev/techniques/post-processing.md +7 -7
- package/skills/shader-dev/techniques/sdf-3d.md +1 -1
- package/skills/shader-dev/techniques/simulation-physics.md +24 -24
- package/skills/shader-dev/techniques/sound-synthesis.md +2 -2
- package/skills/shader-dev/techniques/voronoi-cellular-noise.md +1 -1
- package/skills/shader-dev/techniques/voxel-rendering.md +60 -60
- package/skills/smoke-check/SKILL.md +1 -1
- package/skills/sprint-plan/SKILL.md +1 -2
- package/skills/start/SKILL.md +7 -7
- package/skills/story-done/SKILL.md +1 -1
- package/skills/test-helpers/SKILL.md +7 -2
- package/skills/test-setup/SKILL.md +1 -1
- package/skills/ue-actor-component-architecture/SKILL.md +0 -1
- package/skills/ue-ai-navigation/SKILL.md +0 -1
- package/skills/ue-animation-system/SKILL.md +0 -1
- package/skills/ue-async-threading/SKILL.md +0 -1
- package/skills/ue-audio-system/SKILL.md +0 -1
- package/skills/ue-blueprints/SKILL.md +0 -1
- package/skills/ue-character-movement/SKILL.md +0 -1
- package/skills/ue-cpp-foundations/SKILL.md +0 -1
- package/skills/ue-data-assets-tables/SKILL.md +0 -1
- package/skills/ue-editor-tools/SKILL.md +0 -1
- package/skills/ue-game-features/SKILL.md +0 -1
- package/skills/ue-gameplay-abilities/SKILL.md +0 -1
- package/skills/ue-gameplay-framework/SKILL.md +0 -1
- package/skills/ue-input-system/SKILL.md +0 -1
- package/skills/ue-mass-entity/SKILL.md +0 -1
- package/skills/ue-materials-rendering/SKILL.md +0 -1
- package/skills/ue-module-build-system/SKILL.md +0 -1
- package/skills/ue-naming-conventions/SKILL.md +0 -1
- package/skills/ue-networking-replication/SKILL.md +0 -1
- package/skills/ue-niagara-effects/SKILL.md +0 -1
- package/skills/ue-packaging/SKILL.md +0 -1
- package/skills/ue-physics-collision/SKILL.md +0 -1
- package/skills/ue-procedural-generation/SKILL.md +0 -1
- package/skills/ue-project-context/SKILL.md +0 -1
- package/skills/ue-sequencer-cinematics/SKILL.md +0 -1
- package/skills/ue-serialization-savegames/SKILL.md +0 -1
- package/skills/ue-state-trees/SKILL.md +0 -1
- package/skills/ue-testing-debugging/SKILL.md +0 -1
- package/skills/ue-ui-umg-slate/SKILL.md +0 -1
- package/skills/ue-world-level-streaming/SKILL.md +0 -1
- package/skills/ux-review/SKILL.md +1 -1
- package/docs/RELEASE-SETUP.md +0 -99
- package/docs/presentations/arcane-overview-12.pptx +0 -0
- package/docs/presentations/arcane-overview.pptx +0 -0
- package/docs/presentations/build_arcane_deck.py +0 -310
- package/docs/presentations/build_arcane_deck_12.py +0 -399
- package/docs/trusted-publishing-setup.md +0 -163
|
@@ -4,13 +4,13 @@ This plugin helps you curate Claude Code's auto-memory into durable project know
|
|
|
4
4
|
|
|
5
5
|
## Commands
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
All commands are sub-commands of `/self-improving-agent`:
|
|
8
8
|
|
|
9
|
-
- `/
|
|
10
|
-
- `/
|
|
11
|
-
- `/
|
|
12
|
-
- `/
|
|
13
|
-
- `/
|
|
9
|
+
- `/self-improving-agent review` — Analyze auto-memory health and find promotion candidates
|
|
10
|
+
- `/self-improving-agent promote <pattern>` — Graduate a learning to CLAUDE.md or `.claude/rules/`
|
|
11
|
+
- `/self-improving-agent extract <pattern>` — Create a reusable skill from a proven pattern
|
|
12
|
+
- `/self-improving-agent status` — Quick memory health dashboard
|
|
13
|
+
- `/self-improving-agent remember <knowledge>` — Explicitly save something to auto-memory
|
|
14
14
|
|
|
15
15
|
## How auto-memory works
|
|
16
16
|
|
|
@@ -22,25 +22,25 @@ This plugin reads that directory — it never creates its own storage.
|
|
|
22
22
|
|
|
23
23
|
### After completing a feature or debugging session
|
|
24
24
|
```
|
|
25
|
-
/
|
|
25
|
+
/self-improving-agent review
|
|
26
26
|
```
|
|
27
27
|
Check if anything Claude learned should become a permanent rule.
|
|
28
28
|
|
|
29
29
|
### When a pattern keeps coming up
|
|
30
30
|
```
|
|
31
|
-
/
|
|
31
|
+
/self-improving-agent promote "Always run migrations before tests in this project"
|
|
32
32
|
```
|
|
33
33
|
Moves it from MEMORY.md (background note) to CLAUDE.md (enforced rule).
|
|
34
34
|
|
|
35
35
|
### When you solved something non-obvious that could help other projects
|
|
36
36
|
```
|
|
37
|
-
/
|
|
37
|
+
/self-improving-agent extract "Docker build fix for ARM64 platform mismatch"
|
|
38
38
|
```
|
|
39
39
|
Creates a standalone skill with SKILL.md, ready to install elsewhere.
|
|
40
40
|
|
|
41
41
|
### To check memory capacity
|
|
42
42
|
```
|
|
43
|
-
/
|
|
43
|
+
/self-improving-agent status
|
|
44
44
|
```
|
|
45
45
|
Shows line counts, topic files, stale entries, and recommendations.
|
|
46
46
|
|
|
@@ -55,8 +55,8 @@ Shows line counts, topic files, stale entries, and recommendations.
|
|
|
55
55
|
|
|
56
56
|
## Agents
|
|
57
57
|
|
|
58
|
-
- **memory-analyst**: Spawned by `/
|
|
59
|
-
- **skill-extractor**: Spawned by `/
|
|
58
|
+
- **memory-analyst**: Spawned by `/self-improving-agent review` to analyze patterns across memory files
|
|
59
|
+
- **skill-extractor**: Spawned by `/self-improving-agent extract` to generate complete skill packages
|
|
60
60
|
|
|
61
61
|
## Hooks
|
|
62
62
|
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: self-improving-agent
|
|
3
3
|
description: "Curate Claude Code's auto-memory into durable project knowledge. Analyze MEMORY.md for patterns, promote proven learnings to CLAUDE.md and .claude/rules/, extract recurring solutions into reusable skills."
|
|
4
|
-
argument-hint: ""
|
|
4
|
+
argument-hint: "[extract|promote|remember|review|status] [args]"
|
|
5
5
|
category: "arcane"
|
|
6
6
|
user-invocable: true
|
|
7
7
|
allowed-tools: Read, Glob, Grep, Bash, Write, Edit
|
|
@@ -11,15 +11,19 @@ allowed-tools: Read, Glob, Grep, Bash, Write, Edit
|
|
|
11
11
|
|
|
12
12
|
Claude Code's auto-memory (v2.1.32+) automatically records project patterns, debugging insights, and your preferences in `MEMORY.md`. This skill adds the intelligence layer: it analyzes what Claude has learned, promotes proven patterns into project rules, and extracts recurring solutions into reusable skills. May write or edit CLAUDE.md, .claude/rules/ files, and new skill files during promotion and extraction.
|
|
13
13
|
|
|
14
|
+
## Sub-commands
|
|
15
|
+
|
|
16
|
+
`/self-improving-agent` with no argument shows this overview. With a sub-command as its first argument, read `skills/<sub-command>/SKILL.md` from this skill's directory and follow it, passing the remaining arguments. Sub-commands: `extract`, `promote`, `remember`, `review`, `status`.
|
|
17
|
+
|
|
14
18
|
## Quick Reference
|
|
15
19
|
|
|
16
20
|
| Command | What it does |
|
|
17
21
|
|---------|-------------|
|
|
18
|
-
| `/
|
|
19
|
-
| `/
|
|
20
|
-
| `/
|
|
21
|
-
| `/
|
|
22
|
-
| `/
|
|
22
|
+
| `/self-improving-agent review` | Analyze MEMORY.md -- find promotion candidates, stale entries, consolidation opportunities |
|
|
23
|
+
| `/self-improving-agent promote` | Graduate a pattern from MEMORY.md to CLAUDE.md or `.claude/rules/` |
|
|
24
|
+
| `/self-improving-agent extract` | Turn a proven pattern into a standalone skill |
|
|
25
|
+
| `/self-improving-agent status` | Memory health dashboard -- line counts, topic files, recommendations |
|
|
26
|
+
| `/self-improving-agent remember` | Explicitly save important knowledge to auto-memory |
|
|
23
27
|
|
|
24
28
|
## How It Fits Together
|
|
25
29
|
|
|
@@ -33,9 +37,9 @@ Claude Code's auto-memory (v2.1.32+) automatically records project patterns, deb
|
|
|
33
37
|
│ standards │ + topic files │ + continuity │
|
|
34
38
|
│ Full load │ First 200 lines│ Contextual load │
|
|
35
39
|
├─────────────┴──────────────────┴────────────────────────┤
|
|
36
|
-
│ /
|
|
40
|
+
│ /self-improving-agent promote /self-improving-agent review │
|
|
37
41
|
│ Self-Improving Agent (this skill) │
|
|
38
|
-
│ /
|
|
42
|
+
│ /self-improving-agent extract /self-improving-agent remember │
|
|
39
43
|
├─────────────────────────────────────────────────────────┤
|
|
40
44
|
│ .claude/rules/ │ New Skills │ Error Logs │
|
|
41
45
|
│ (scoped rules) │ (extracted) │ (auto-captured)│
|
|
@@ -48,18 +52,18 @@ Claude Code's auto-memory (v2.1.32+) automatically records project patterns, deb
|
|
|
48
52
|
|
|
49
53
|
| File | Who writes | Scope | Loaded |
|
|
50
54
|
|------|-----------|-------|--------|
|
|
51
|
-
| `./CLAUDE.md` | You (+ `/
|
|
55
|
+
| `./CLAUDE.md` | You (+ `/self-improving-agent promote`) | Project rules | Full file, every session |
|
|
52
56
|
| `~/.claude/CLAUDE.md` | You | Global preferences | Full file, every session |
|
|
53
57
|
| `~/.claude/projects/<path>/memory/MEMORY.md` | Claude (auto) | Project learnings | First 200 lines |
|
|
54
58
|
| `~/.claude/projects/<path>/memory/*.md` | Claude (overflow) | Topic-specific notes | On demand |
|
|
55
|
-
| `.claude/rules/*.md` | You (+ `/
|
|
59
|
+
| `.claude/rules/*.md` | You (+ `/self-improving-agent promote`) | Scoped rules | When matching files open |
|
|
56
60
|
|
|
57
61
|
### The promotion lifecycle
|
|
58
62
|
|
|
59
63
|
```
|
|
60
64
|
1. Claude discovers pattern -> auto-memory (MEMORY.md)
|
|
61
|
-
2. Pattern recurs 2-3x -> /
|
|
62
|
-
3. You approve -> /
|
|
65
|
+
2. Pattern recurs 2-3x -> /self-improving-agent review flags it as promotion candidate
|
|
66
|
+
3. You approve -> /self-improving-agent promote graduates it to CLAUDE.md or rules/
|
|
63
67
|
4. Pattern becomes an enforced rule, not just a note
|
|
64
68
|
5. MEMORY.md entry removed -> frees space for new learnings
|
|
65
69
|
```
|
|
@@ -64,7 +64,7 @@ Organize findings into:
|
|
|
64
64
|
|
|
65
65
|
## Output Format
|
|
66
66
|
|
|
67
|
-
Use the format defined in the `/
|
|
67
|
+
Use the format defined in the `/self-improving-agent review` skill. Be specific — include line numbers, exact text, and concrete suggestions.
|
|
68
68
|
|
|
69
69
|
## Constraints
|
|
70
70
|
|
|
@@ -103,8 +103,8 @@ cat << EOF
|
|
|
103
103
|
<error-detected>
|
|
104
104
|
Command error detected (pattern: "$matched_pattern").
|
|
105
105
|
If this was unexpected or required investigation to fix, save the solution:
|
|
106
|
-
/
|
|
107
|
-
Or if this is a known pattern, check: /
|
|
106
|
+
/self-improving-agent remember "explanation of what went wrong and the fix"
|
|
107
|
+
Or if this is a known pattern, check: /self-improving-agent review
|
|
108
108
|
Context: $(echo "$error_context" | head -2 | tr '\n' ' ' | cut -c1-200)
|
|
109
109
|
</error-detected>
|
|
110
110
|
EOF
|
|
@@ -103,7 +103,7 @@ When entries conflict:
|
|
|
103
103
|
```
|
|
104
104
|
Auto-memory captures → This plugin curates → CLAUDE.md enforces
|
|
105
105
|
|
|
106
|
-
MEMORY.md (raw notes) → /
|
|
106
|
+
MEMORY.md (raw notes) → /self-improving-agent review (analyze) → /self-improving-agent promote (graduate)
|
|
107
107
|
↓
|
|
108
108
|
CLAUDE.md or
|
|
109
109
|
.claude/rules/
|
|
@@ -128,4 +128,4 @@ MEMORY.md (raw notes) → /si:review (analyze) → /si:promote (graduate)
|
|
|
128
128
|
3. **Don't duplicate** — if it's in CLAUDE.md, remove it from MEMORY.md
|
|
129
129
|
4. **Scope rules** — use `.claude/rules/` with paths for file-type-specific patterns
|
|
130
130
|
5. **Review quarterly** — memory files go stale after refactors
|
|
131
|
-
6. **Use /
|
|
131
|
+
6. **Use /self-improving-agent status** — monitor capacity before it becomes a problem
|
|
@@ -74,10 +74,10 @@ When promoting, transform the learning:
|
|
|
74
74
|
## Promotion Workflow
|
|
75
75
|
|
|
76
76
|
```
|
|
77
|
-
1. /
|
|
77
|
+
1. /self-improving-agent review identifies candidate
|
|
78
78
|
2. Confirm the pattern is still valid
|
|
79
79
|
3. Distill into one-line instruction
|
|
80
|
-
4. /
|
|
80
|
+
4. /self-improving-agent promote writes to CLAUDE.md or rules/
|
|
81
81
|
5. Remove from MEMORY.md
|
|
82
|
-
6. Verify with /
|
|
82
|
+
6. Verify with /self-improving-agent status
|
|
83
83
|
```
|
|
@@ -125,7 +125,7 @@ paths:
|
|
|
125
125
|
|--------|--------|
|
|
126
126
|
| CLAUDE.md over 150 lines | Move scoped patterns to rules/ |
|
|
127
127
|
| Same instruction repeated for different file types | Create a scoped rule |
|
|
128
|
-
| `/
|
|
128
|
+
| `/self-improving-agent promote` suggests a file-type-specific pattern | Create or append to a rule file |
|
|
129
129
|
| Team adds a new convention for a specific area | New rule file |
|
|
130
130
|
|
|
131
131
|
## Organization Tips
|
|
@@ -10,11 +10,11 @@
|
|
|
10
10
|
"tags": ["memory", "auto-memory", "self-improvement", "learning", "rules", "skills"],
|
|
11
11
|
"repository": "https://github.com/alirezarezvani/claude-skills",
|
|
12
12
|
"commands": {
|
|
13
|
-
"review": "/
|
|
14
|
-
"promote": "/
|
|
15
|
-
"extract": "/
|
|
16
|
-
"status": "/
|
|
17
|
-
"remember": "/
|
|
13
|
+
"review": "/self-improving-agent review",
|
|
14
|
+
"promote": "/self-improving-agent promote",
|
|
15
|
+
"extract": "/self-improving-agent extract",
|
|
16
|
+
"status": "/self-improving-agent status",
|
|
17
|
+
"remember": "/self-improving-agent remember"
|
|
18
18
|
},
|
|
19
19
|
"hooks": {
|
|
20
20
|
"PostToolUse": {
|
|
@@ -7,17 +7,17 @@ user-invocable: false
|
|
|
7
7
|
allowed-tools: Read, Glob, Grep, Bash, Write, Edit
|
|
8
8
|
---
|
|
9
9
|
|
|
10
|
-
# /
|
|
10
|
+
# /self-improving-agent extract — Create Skills from Patterns
|
|
11
11
|
|
|
12
12
|
Transforms a recurring pattern or debugging solution into a standalone, portable skill that can be installed in any project.
|
|
13
13
|
|
|
14
14
|
## Usage
|
|
15
15
|
|
|
16
16
|
```
|
|
17
|
-
/
|
|
18
|
-
/
|
|
19
|
-
/
|
|
20
|
-
/
|
|
17
|
+
/self-improving-agent extract <pattern description> # Interactive extraction
|
|
18
|
+
/self-improving-agent extract <pattern> --name docker-m1-fixes # Specify skill name
|
|
19
|
+
/self-improving-agent extract <pattern> --output ./skills/ # Custom output directory
|
|
20
|
+
/self-improving-agent extract <pattern> --dry-run # Preview without creating files
|
|
21
21
|
```
|
|
22
22
|
|
|
23
23
|
## When to Extract
|
|
@@ -153,7 +153,7 @@ Source: MEMORY.md entries at lines {{n, m, ...}} (retained — the skill is port
|
|
|
153
153
|
### Extracting a debugging pattern
|
|
154
154
|
|
|
155
155
|
```
|
|
156
|
-
/
|
|
156
|
+
/self-improving-agent extract "Fix for Docker builds failing on Apple Silicon with platform mismatch"
|
|
157
157
|
```
|
|
158
158
|
|
|
159
159
|
Creates `docker-m1-fixes/SKILL.md` with:
|
|
@@ -165,7 +165,7 @@ Creates `docker-m1-fixes/SKILL.md` with:
|
|
|
165
165
|
### Extracting a workflow pattern
|
|
166
166
|
|
|
167
167
|
```
|
|
168
|
-
/
|
|
168
|
+
/self-improving-agent extract "Always regenerate TypeScript API client after modifying OpenAPI spec"
|
|
169
169
|
```
|
|
170
170
|
|
|
171
171
|
Creates `api-client-regen/SKILL.md` with:
|
|
@@ -7,17 +7,17 @@ user-invocable: false
|
|
|
7
7
|
allowed-tools: Read, Glob, Grep, Bash, Write, Edit
|
|
8
8
|
---
|
|
9
9
|
|
|
10
|
-
# /
|
|
10
|
+
# /self-improving-agent promote — Graduate Learnings to Rules
|
|
11
11
|
|
|
12
12
|
Moves a proven pattern from Claude's auto-memory into the project's rule system, where it becomes an enforced instruction rather than a background note.
|
|
13
13
|
|
|
14
14
|
## Usage
|
|
15
15
|
|
|
16
16
|
```
|
|
17
|
-
/
|
|
18
|
-
/
|
|
19
|
-
/
|
|
20
|
-
/
|
|
17
|
+
/self-improving-agent promote <pattern description> # Auto-detect best target
|
|
18
|
+
/self-improving-agent promote <pattern> --target claude.md # Promote to CLAUDE.md
|
|
19
|
+
/self-improving-agent promote <pattern> --target rules/testing.md # Promote to scoped rule
|
|
20
|
+
/self-improving-agent promote <pattern> --target rules/api.md --paths "src/api/**/*.ts" # Scoped with paths
|
|
21
21
|
```
|
|
22
22
|
|
|
23
23
|
## Workflow
|
|
@@ -7,17 +7,17 @@ user-invocable: false
|
|
|
7
7
|
allowed-tools: Read, Glob, Grep, Bash, Write, Edit
|
|
8
8
|
---
|
|
9
9
|
|
|
10
|
-
# /
|
|
10
|
+
# /self-improving-agent remember — Save Knowledge Explicitly
|
|
11
11
|
|
|
12
12
|
Writes an explicit entry to auto-memory when something is important enough that you don't want to rely on Claude noticing it automatically.
|
|
13
13
|
|
|
14
14
|
## Usage
|
|
15
15
|
|
|
16
16
|
```
|
|
17
|
-
/
|
|
18
|
-
/
|
|
19
|
-
/
|
|
20
|
-
/
|
|
17
|
+
/self-improving-agent remember <what to remember>
|
|
18
|
+
/self-improving-agent remember "This project's CI requires Node 20 LTS — v22 breaks the build"
|
|
19
|
+
/self-improving-agent remember "The /api/auth endpoint uses a custom JWT library, not passport"
|
|
20
|
+
/self-improving-agent remember "Reza prefers explicit error handling over try-catch-all patterns"
|
|
21
21
|
```
|
|
22
22
|
|
|
23
23
|
## When to Use
|
|
@@ -63,7 +63,7 @@ Keep entries concise — one line when possible. Auto-memory entries don't need
|
|
|
63
63
|
If MEMORY.md is over 180 lines, warn the user:
|
|
64
64
|
|
|
65
65
|
```
|
|
66
|
-
⚠️ MEMORY.md is at {{n}}/200 lines. Consider running /
|
|
66
|
+
⚠️ MEMORY.md is at {{n}}/200 lines. Consider running /self-improving-agent review to free space.
|
|
67
67
|
```
|
|
68
68
|
|
|
69
69
|
### Step 4: Suggest promotion
|
|
@@ -72,7 +72,7 @@ If the knowledge sounds like a rule (imperative, always/never, convention):
|
|
|
72
72
|
|
|
73
73
|
```
|
|
74
74
|
💡 This sounds like it could be a CLAUDE.md rule rather than a memory entry.
|
|
75
|
-
Rules are enforced with higher priority. Want to /
|
|
75
|
+
Rules are enforced with higher priority. Want to /self-improving-agent promote it instead?
|
|
76
76
|
```
|
|
77
77
|
|
|
78
78
|
### Step 5: Confirm
|
|
@@ -86,10 +86,10 @@ If the knowledge sounds like a rule (imperative, always/never, convention):
|
|
|
86
86
|
Claude will see this at the start of every session in this project.
|
|
87
87
|
```
|
|
88
88
|
|
|
89
|
-
## What NOT to use /
|
|
89
|
+
## What NOT to use /self-improving-agent remember for
|
|
90
90
|
|
|
91
91
|
- **Temporary context**: Use session memory or just tell Claude in conversation
|
|
92
|
-
- **Enforced rules**: Use `/
|
|
92
|
+
- **Enforced rules**: Use `/self-improving-agent promote` to write directly to CLAUDE.md
|
|
93
93
|
- **Cross-project knowledge**: Use `~/.claude/CLAUDE.md` for global rules
|
|
94
94
|
- **Sensitive data**: Never store credentials, tokens, or secrets in memory files
|
|
95
95
|
|
|
@@ -7,17 +7,17 @@ user-invocable: false
|
|
|
7
7
|
allowed-tools: Read, Glob, Grep, Bash
|
|
8
8
|
---
|
|
9
9
|
|
|
10
|
-
# /
|
|
10
|
+
# /self-improving-agent review — Analyze Auto-Memory
|
|
11
11
|
|
|
12
12
|
Performs a comprehensive audit of Claude Code's auto-memory and produces actionable recommendations.
|
|
13
13
|
|
|
14
14
|
## Usage
|
|
15
15
|
|
|
16
16
|
```
|
|
17
|
-
/
|
|
18
|
-
/
|
|
19
|
-
/
|
|
20
|
-
/
|
|
17
|
+
/self-improving-agent review # Full review
|
|
18
|
+
/self-improving-agent review --quick # Summary only (counts + top 3 candidates)
|
|
19
|
+
/self-improving-agent review --stale # Focus on stale/outdated entries
|
|
20
|
+
/self-improving-agent review --candidates # Show only promotion candidates
|
|
21
21
|
```
|
|
22
22
|
|
|
23
23
|
## What It Does
|
|
@@ -117,14 +117,14 @@ Memory Health:
|
|
|
117
117
|
## When to Use
|
|
118
118
|
|
|
119
119
|
- After completing a major feature or debugging session
|
|
120
|
-
- When `/
|
|
120
|
+
- When `/self-improving-agent status` shows MEMORY.md is over 150 lines
|
|
121
121
|
- Weekly during active development
|
|
122
122
|
- Before starting a new project phase
|
|
123
123
|
- After onboarding a new team member (review what Claude learned)
|
|
124
124
|
|
|
125
125
|
## Tips
|
|
126
126
|
|
|
127
|
-
- Run `/
|
|
127
|
+
- Run `/self-improving-agent review --quick` frequently (low overhead)
|
|
128
128
|
- Full review is most valuable when MEMORY.md is getting crowded
|
|
129
129
|
- Act on promotion candidates promptly — they're proven patterns
|
|
130
130
|
- Don't hesitate to delete stale entries — auto-memory will re-learn if needed
|
|
@@ -7,15 +7,15 @@ user-invocable: false
|
|
|
7
7
|
allowed-tools: Read, Glob, Grep, Bash
|
|
8
8
|
---
|
|
9
9
|
|
|
10
|
-
# /
|
|
10
|
+
# /self-improving-agent status — Memory Health Dashboard
|
|
11
11
|
|
|
12
12
|
Quick overview of your project's memory state across all memory systems.
|
|
13
13
|
|
|
14
14
|
## Usage
|
|
15
15
|
|
|
16
16
|
```
|
|
17
|
-
/
|
|
18
|
-
/
|
|
17
|
+
/self-improving-agent status # Full dashboard
|
|
18
|
+
/self-improving-agent status --brief # One-line summary
|
|
19
19
|
```
|
|
20
20
|
|
|
21
21
|
## What It Reports
|
|
@@ -88,7 +88,7 @@ done
|
|
|
88
88
|
### Brief mode
|
|
89
89
|
|
|
90
90
|
```
|
|
91
|
-
/
|
|
91
|
+
/self-improving-agent status --brief
|
|
92
92
|
```
|
|
93
93
|
|
|
94
94
|
Output: `📊 Memory: {{n}}/200 lines | {{count}} rules | {{status_emoji}} {{status_word}}`
|
|
@@ -96,12 +96,12 @@ Output: `📊 Memory: {{n}}/200 lines | {{count}} rules | {{status_emoji}} {{sta
|
|
|
96
96
|
## Interpretation
|
|
97
97
|
|
|
98
98
|
- **Green (< 60%)**: Plenty of room. Auto-memory is working well.
|
|
99
|
-
- **Yellow (60-90%)**: Getting full. Consider running `/
|
|
100
|
-
- **Red (> 90%)**: Near capacity. Auto-memory may start dropping older entries. Run `/
|
|
99
|
+
- **Yellow (60-90%)**: Getting full. Consider running `/self-improving-agent review` to promote or clean up.
|
|
100
|
+
- **Red (> 90%)**: Near capacity. Auto-memory may start dropping older entries. Run `/self-improving-agent review` now.
|
|
101
101
|
|
|
102
102
|
## Tips
|
|
103
103
|
|
|
104
|
-
- Run `/
|
|
105
|
-
- If capacity is yellow+, run `/
|
|
104
|
+
- Run `/self-improving-agent status --brief` as a quick check anytime
|
|
105
|
+
- If capacity is yellow+, run `/self-improving-agent review` to identify promotion candidates
|
|
106
106
|
- Stale entries waste space — delete references to files that no longer exist
|
|
107
107
|
- Topic files are fine — Claude creates them to keep MEMORY.md under 200 lines
|
|
@@ -47,13 +47,14 @@ class OpenAIProvider(LLMProvider):
|
|
|
47
47
|
return response.choices[0].text
|
|
48
48
|
|
|
49
49
|
class AnthropicProvider(LLMProvider):
|
|
50
|
-
def __init__(self, api_key: str, model: str = "claude-
|
|
50
|
+
def __init__(self, api_key: str, model: str = "claude-opus-5-5"):
|
|
51
51
|
self.client = Anthropic(api_key=api_key)
|
|
52
52
|
self.model = model
|
|
53
53
|
|
|
54
54
|
def chat(self, messages: List[Dict], **kwargs) -> str:
|
|
55
55
|
response = self.client.messages.create(
|
|
56
56
|
model=self.model,
|
|
57
|
+
max_tokens=kwargs.pop("max_tokens", 16000),
|
|
57
58
|
messages=messages,
|
|
58
59
|
**kwargs
|
|
59
60
|
)
|
|
@@ -97,7 +98,7 @@ def call_with_fallback(
|
|
|
97
98
|
|---------|----------|-----------|
|
|
98
99
|
| Zero-shot | Simple tasks | Task description + input |
|
|
99
100
|
| Few-shot | Complex tasks | Examples + task + input |
|
|
100
|
-
|
|
|
101
|
+
| Reasoning | Multi-step problems | On models with adaptive thinking, raise `effort` instead of asking for step-by-step text |
|
|
101
102
|
| Role-based | Specialized output | System role + task |
|
|
102
103
|
|
|
103
104
|
### Few-Shot Template
|
|
@@ -178,10 +179,8 @@ def truncate_to_token_limit(text: str, max_tokens: int, model: str = "gpt-4") ->
|
|
|
178
179
|
|
|
179
180
|
| Model | Context Window | Effective Limit |
|
|
180
181
|
|-------|----------------|-----------------|
|
|
181
|
-
|
|
|
182
|
-
|
|
|
183
|
-
| Claude 3 | 200,000 | ~180,000 |
|
|
184
|
-
| Llama 3 | 8,192 | ~6,000 |
|
|
182
|
+
| Claude Opus 5.5 / Sonnet 5.5 / Haiku 5.5 | 1,000,000 | leave room for `max_tokens` |
|
|
183
|
+
| Other providers | check the provider's model docs | context windows change every release |
|
|
185
184
|
|
|
186
185
|
### Chunking Strategy
|
|
187
186
|
|
|
@@ -206,12 +205,7 @@ def chunk_text(text: str, chunk_size: int = 1000, overlap: int = 100) -> List[st
|
|
|
206
205
|
|
|
207
206
|
### Cost Calculation
|
|
208
207
|
|
|
209
|
-
|
|
210
|
-
|----------|------------|-------------|---------------------|
|
|
211
|
-
| GPT-4 | $0.03/1K | $0.06/1K | $0.09 |
|
|
212
|
-
| GPT-3.5 | $0.0005/1K | $0.0015/1K | $0.002 |
|
|
213
|
-
| Claude 3 Opus | $0.015/1K | $0.075/1K | $0.09 |
|
|
214
|
-
| Claude 3 Haiku | $0.00025/1K | $0.00125/1K | $0.0015 |
|
|
208
|
+
Prices change with every model release, so keep them out of code: read them from config, and take the numbers from each provider's pricing page. Count tokens with the provider's response metadata (`usage`), not with a character estimate.
|
|
215
209
|
|
|
216
210
|
### Cost Tracking
|
|
217
211
|
|
|
@@ -229,30 +223,19 @@ class LLMUsage:
|
|
|
229
223
|
def calculate_cost(
|
|
230
224
|
input_tokens: int,
|
|
231
225
|
output_tokens: int,
|
|
232
|
-
|
|
226
|
+
prices: dict,
|
|
233
227
|
) -> float:
|
|
234
|
-
"""
|
|
235
|
-
|
|
236
|
-
"gpt-4": {"input": 0.03, "output": 0.06},
|
|
237
|
-
"gpt-3.5-turbo": {"input": 0.0005, "output": 0.0015},
|
|
238
|
-
"claude-3-opus": {"input": 0.015, "output": 0.075},
|
|
239
|
-
}
|
|
240
|
-
|
|
241
|
-
prices = PRICING.get(model, {"input": 0.01, "output": 0.03})
|
|
242
|
-
|
|
243
|
-
input_cost = (input_tokens / 1000) * prices["input"]
|
|
244
|
-
output_cost = (output_tokens / 1000) * prices["output"]
|
|
245
|
-
|
|
246
|
-
return input_cost + output_cost
|
|
228
|
+
"""Cost in USD. `prices` comes from config: {"input": usd_per_mtok, "output": usd_per_mtok}."""
|
|
229
|
+
return (input_tokens * prices["input"] + output_tokens * prices["output"]) / 1_000_000
|
|
247
230
|
```
|
|
248
231
|
|
|
249
232
|
### Cost Optimization Strategies
|
|
250
233
|
|
|
251
|
-
1. **Use smaller
|
|
252
|
-
2. **Cache
|
|
253
|
-
3. **Batch
|
|
254
|
-
4. **
|
|
255
|
-
5. **Set max_tokens
|
|
234
|
+
1. **Use a smaller model where it holds quality** - measure on real requests before routing a task to it
|
|
235
|
+
2. **Cache repeated context** - provider prompt caching makes a stable system prompt or document far cheaper on repeat calls
|
|
236
|
+
3. **Batch non-urgent work** - batch APIs trade latency for a lower price
|
|
237
|
+
4. **Cache common responses** - store results for repeated queries
|
|
238
|
+
5. **Set max_tokens deliberately** - high enough not to cut answers off, as a ceiling on runaway output
|
|
256
239
|
|
|
257
240
|
---
|
|
258
241
|
|
|
@@ -23,12 +23,12 @@ python scripts/agent_orchestrator.py agent_config.yaml --visualize # Visua
|
|
|
23
23
|
|
|
24
24
|
### 1. Prompt Optimizer
|
|
25
25
|
|
|
26
|
-
|
|
26
|
+
Static checks for clarity and structure, with an approximate token count (characters / 4). `--optimize` only normalizes whitespace; the real rewrite is yours.
|
|
27
27
|
|
|
28
28
|
```bash
|
|
29
29
|
python scripts/prompt_optimizer.py prompt.txt --analyze # Full analysis
|
|
30
|
-
python scripts/prompt_optimizer.py prompt.txt --optimize #
|
|
31
|
-
python scripts/prompt_optimizer.py prompt.txt --tokens
|
|
30
|
+
python scripts/prompt_optimizer.py prompt.txt --optimize # Normalize whitespace
|
|
31
|
+
python scripts/prompt_optimizer.py prompt.txt --tokens # Approximate token count
|
|
32
32
|
python scripts/prompt_optimizer.py prompt.txt --extract-examples --output examples.json
|
|
33
33
|
```
|
|
34
34
|
|
|
@@ -50,7 +50,7 @@ Parses agent definitions and visualizes execution flows. Validates tool configur
|
|
|
50
50
|
python scripts/agent_orchestrator.py agent.yaml --validate # Validate config
|
|
51
51
|
python scripts/agent_orchestrator.py agent.yaml --visualize # Show workflow (ASCII)
|
|
52
52
|
python scripts/agent_orchestrator.py agent.yaml --visualize --format mermaid # Mermaid
|
|
53
|
-
python scripts/agent_orchestrator.py agent.yaml --estimate-cost #
|
|
53
|
+
python scripts/agent_orchestrator.py agent.yaml --estimate-cost --price-in 4 --price-out 20 # Tokens; dollars with your current prices (USD/Mtok)
|
|
54
54
|
```
|
|
55
55
|
|
|
56
56
|
## Prompt Engineering Workflows
|
|
@@ -65,7 +65,7 @@ python scripts/agent_orchestrator.py agent.yaml --estimate-cost # Token estimat
|
|
|
65
65
|
|-------|---------|
|
|
66
66
|
| Ambiguous output | Add explicit format specification |
|
|
67
67
|
| Too verbose | Extract to few-shot examples |
|
|
68
|
-
| Inconsistent results | Add
|
|
68
|
+
| Inconsistent results | Add 2-3 varied examples and state the success criteria |
|
|
69
69
|
| Missing edge cases | Add constraint boundaries |
|
|
70
70
|
|
|
71
71
|
4. **Optimize**: `python scripts/prompt_optimizer.py current_prompt.txt --optimize --output optimized.txt`
|
|
@@ -77,15 +77,15 @@ python scripts/agent_orchestrator.py agent.yaml --estimate-cost # Token estimat
|
|
|
77
77
|
1. Define task clearly (input format, output format)
|
|
78
78
|
2. Select 3-5 diverse examples: simple case, edge case, complex case, negative case
|
|
79
79
|
3. Format consistently
|
|
80
|
-
4.
|
|
80
|
+
4. Check what the prompt contains: `python scripts/prompt_optimizer.py prompt_with_examples.txt --extract-examples`
|
|
81
81
|
5. Test with held-out cases
|
|
82
82
|
|
|
83
83
|
### Structured Output Design
|
|
84
84
|
|
|
85
85
|
1. Define JSON/XML schema with types, constraints, enums
|
|
86
|
-
2.
|
|
87
|
-
3.
|
|
88
|
-
4. Validate
|
|
86
|
+
2. Pass the schema through the API's structured outputs (`output_config.format` on Claude) so the response is guaranteed to match it; do not rely on "respond ONLY with valid JSON" in the prompt
|
|
87
|
+
3. Describe in the prompt what each field means, not the JSON syntax
|
|
88
|
+
4. Validate the parsed result against the schema in code before using it
|
|
89
89
|
|
|
90
90
|
## Reference Documentation
|
|
91
91
|
|
|
@@ -103,6 +103,6 @@ python scripts/agent_orchestrator.py agent.yaml --estimate-cost # Token estimat
|
|
|
103
103
|
|---------|-------------|---------|
|
|
104
104
|
| **Zero-shot** | Simple, well-defined tasks | "Classify this email as spam or not spam" |
|
|
105
105
|
| **Few-shot** | Complex tasks, consistent format | Provide 3-5 examples before task |
|
|
106
|
-
| **
|
|
106
|
+
| **Reasoning depth** | Reasoning, math, multi-step | Models with adaptive thinking: raise `effort`. Models without it: "Think step by step..." |
|
|
107
107
|
| **Role Prompting** | Expertise, specific perspective | "You are an expert tax accountant..." |
|
|
108
108
|
| **Structured Output** | Need parseable JSON/XML | Include schema + format enforcement |
|
|
@@ -164,7 +164,7 @@ The 7 apples cost $11.20
|
|
|
164
164
|
| Reasoning chain | "Explain your reasoning" | Justification needed |
|
|
165
165
|
|
|
166
166
|
**Zero-shot CoT:**
|
|
167
|
-
|
|
167
|
+
Append "Let's think step by step." only on models without built-in thinking. On models with adaptive thinking, control depth with `effort`; asking for the reasoning in the output can be declined as reasoning extraction.
|
|
168
168
|
|
|
169
169
|
---
|
|
170
170
|
|