create-harness-vibe-coding 0.8.0 → 0.8.2

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.
Files changed (37) hide show
  1. package/README-CN.md +40 -24
  2. package/README.md +44 -20
  3. package/package.json +1 -1
  4. package/src/generator.js +1 -1
  5. package/src/index.js +211 -11
  6. package/src/prompts.js +1 -1
  7. package/templates/common/.claude/agents/tdd-guide.md +55 -0
  8. package/templates/common/.claude/settings.json +22 -0
  9. package/templates/common/.claude/skills/tdd/SKILL.md +30 -0
  10. package/templates/common/.claude/skills/wf-auto/SKILL.md +107 -0
  11. package/templates/common/.claude/skills/wf-auto-spark/SKILL.md +39 -0
  12. package/templates/common/.claude/skills/wf-max/SKILL.md +10 -2
  13. package/templates/common/.claude/skills/wf-remove/SKILL.md +12 -5
  14. package/templates/common/.claude/skills/wf-update/SKILL.md +12 -5
  15. package/templates/common/.codex/hooks.json +59 -37
  16. package/templates/common/.harness-version +48 -25
  17. package/templates/common/AGENTS.md +5 -5
  18. package/templates/common/CLAUDE.md +12 -17
  19. package/templates/common/Harness/ECC-GUIDE.md +246 -0
  20. package/templates/common/Harness/README.md +129 -130
  21. package/templates/common/Harness/TDD-GUIDE.md +83 -0
  22. package/templates/common/Harness/WF-AUTO-SPARK.md +297 -0
  23. package/templates/common/Harness/WF-AUTO.md +508 -0
  24. package/templates/common/Harness/WF-MAX.md +24 -0
  25. package/templates/common/Harness/context-loading.md +38 -1
  26. package/templates/common/Harness/dispatch.md +40 -40
  27. package/templates/common/Harness/subagents.md +7 -21
  28. package/templates/common/Harness/tasks/_template/NAMING.md +47 -0
  29. package/templates/common/MEMORY.md +73 -66
  30. package/templates/common/SETUP.md +98 -63
  31. package/templates/common/scripts/validate-harness.mjs +92 -58
  32. package/templates/common/scripts/wf-mode-hook.mjs +895 -318
  33. package/templates/common/scripts/wf-remove.mjs +301 -81
  34. package/templates/common/scripts/wf-statusline.ps1 +62 -38
  35. package/templates/common/scripts/wf-statusline.sh +67 -48
  36. package/templates/common/scripts/wf-update-check.mjs +179 -81
  37. package/templates/optional/catalog.json +5 -5
@@ -11,56 +11,36 @@ Use when work needs parallel reading, independent review, cross-layer analysis,
11
11
  - Main agent owns the final decision, integration, and verification.
12
12
  - project files are the only durable communication channel; chat/subagent transcript state is non-authoritative.
13
13
  - Important assumptions, decisions, blockers, evidence, and handoffs must be written to `Harness/tasks/<task-id>/PROGRESS.md` and `Harness/tasks/<task-id>/PLAN.md`, the current feature doc, `Harness/MEMORY.md`, or `Harness/memory/*` as appropriate.
14
- - Prefer three or fewer active agents (WF mode overrides this; see [WF.md](WF.md)).
14
+ - Agent count: default (non-WF) ≤3 active agents; `/wf` requires ≥3 distinct subagents from `.claude/agents/` before second plan; `/wf max` removes the cap entirely (governed by span formula in WF-MAX.md). See [WF.md](WF.md) and [WF-MAX.md](WF-MAX.md) for the authoritative rules.
15
15
  - Read-only agents may run in parallel.
16
16
  - Writing agents run serially unless write sets are disjoint.
17
17
  - Use a worktree when two agents may touch overlapping files or long-running branches.
18
18
  - Only summaries enter main context. Load named files directly when details are needed.
19
19
  - Subagents read task files, return findings and PLAN patch suggestions. Only the main agent commits changes to PROGRESS.md and PLAN.md.
20
20
 
21
- ## Dispatch Loop
21
+ ## Scope
22
22
 
23
- ```text
24
- Goal
25
- -> Fill task PROGRESS.md and PLAN.md
26
- -> Apply subagents.md efficiency ladder
27
- -> Run parallel read-only agents
28
- -> Main agent integrates findings
29
- -> Test Writer defines failing test or manual check
30
- -> Implementer makes bounded change
31
- -> Reviewer checks diff
32
- -> Verifier records evidence
33
- -> Main agent updates task files and closes or iterates
34
- ```
35
-
36
- ## Modes
37
-
38
- | Mode | Use When | Constraint |
39
- | --- | --- | --- |
40
- | Parallel Read | research, exploration, architecture review, docs/API check | no writes |
41
- | Serial Write | tests, implementation, docs sync | one writer at a time |
42
- | Isolated Worktree | overlapping write sets or competing approaches | merge only after review |
23
+ `agent-workflow.md` owns the build/review loop. `subagents.md` owns orchestration strategy and agent roster. This file owns the dispatch input and subagent handoff formats.
43
24
 
44
- ## Common Agents
25
+ ## Agent Roster
45
26
 
46
27
  | Agent | Mode | Purpose |
47
28
  | --- | --- | --- |
48
- | `planner` | Parallel Read | split goal into tasks, dependencies, write sets |
49
- | Explorer Pass | Parallel Read | bounded read-only exploration when no dedicated agent is needed |
50
- | `researcher` | Parallel Read | product, market, ecosystem, dependency research |
51
- | `docs-researcher` | Parallel Read | official docs, API, SDK, version, limits |
52
- | `architect` | Parallel Read | layer boundaries, ports, data flow, state impact |
53
- | `test-writer` | Serial Write | failing test or manual verification plan |
54
- | `implementer` | Serial Write | minimal change inside declared write set |
55
- | `debugger` | Serial Write | smallest fix for a reproduced failure |
56
- | `reviewer` | Parallel Read | diff review, risks, missing tests |
57
- | `verifier` | Parallel Read | run checks and record evidence |
58
- | `memory-master` | Serial Write | write/consolidate memory entries, dedup, cross-project extraction |
59
- | `context-master` | Parallel Read | analyze context usage, recommend compression, extract session knowledge |
60
- | `explore-manager` | Parallel Read | WF-MAX W0: spawn 5-10 researchers, synthesize, report to CEO |
61
- | `architect-manager` | Parallel Read | WF-MAX W1: spawn 3 architects, synthesize interface contracts |
62
- | `implement-manager` | Serial Write | WF-MAX W2: spawn implementers (one file_claim each), merge results |
63
- | `review-manager` | Parallel Read | WF-MAX W2R: spawn 3-4 reviewers, deduplicate, classify severity |
29
+ | `planner` | Read | split goal into tasks, dependencies, write sets |
30
+ | `researcher` | Read | product, market, ecosystem, dependency research |
31
+ | `docs-researcher` | Read | official docs, API, SDK, version, limits |
32
+ | `architect` | Read | layer boundaries, ports, data flow, state impact |
33
+ | `test-writer` | Write | failing test or manual verification plan |
34
+ | `implementer` | Write | minimal change inside declared write set |
35
+ | `debugger` | Write | smallest fix for a reproduced failure |
36
+ | `reviewer` | Read | diff review, risks, missing tests |
37
+ | `verifier` | Read | run checks and record evidence |
38
+ | `memory-master` | Write | write/consolidate memory entries |
39
+ | `context-master` | Read | analyze context, recommend compression |
40
+ | `explore-manager` | Read | WF-MAX W0: spawn researchers, synthesize |
41
+ | `architect-manager` | Read | WF-MAX W1: spawn architects, synthesize |
42
+ | `implement-manager` | Write | WF-MAX W2: spawn implementers |
43
+ | `review-manager` | Read | WF-MAX W2R: spawn reviewers, deduplicate |
64
44
 
65
45
  ## Dispatch Rules
66
46
 
@@ -71,7 +51,24 @@ Goal
71
51
  - If docs, tests, and code disagree, stop implementation and record the conflict in `Harness/tasks/<task-id>/PROGRESS.md`.
72
52
  - In /wf max, file claims must respect WF-MAX.md leaf condition: no split below 50 avgLines, no split when files ≤ span×2.
73
53
 
74
- ## Handoff Format
54
+ ## Dispatch Input (Controller → Subagent)
55
+
56
+ The controller MUST include these fields in the subagent's dispatch packet.
57
+ Without them, the subagent has no way to know which rules or contracts to load.
58
+
59
+ ```text
60
+ Role: <installed agent name or bounded role, e.g. planner, implementer-fe, reviewer, memory-master>
61
+ Task: <one-sentence goal>
62
+ ECC: <which ECC rules to load, e.g. web/design-quality.md, python/fastapi.md. See context-loading.md#ecc-rules-per-role>
63
+ Skills: <which skills to activate, e.g. react-review, tdd-guide>
64
+ API contract: <path to api/openapi.yaml, if frontend↔backend task. Omit if N/A>
65
+ Read set: <files and directories the subagent may read>
66
+ Write set: <files the subagent may modify. "none" = read-only>
67
+ Forbidden: <commands, paths, or patterns the subagent must not touch>
68
+ Verification: <commands to run after implementation, e.g. npm test>
69
+ ```
70
+
71
+ ## Handoff Format (Subagent → Controller)
75
72
 
76
73
  Subagents return summaries in this shape:
77
74
 
@@ -79,6 +76,9 @@ Subagents return summaries in this shape:
79
76
  Agent:
80
77
  Task:
81
78
  Mode:
79
+ ECC loaded: <which ECC rule files were actually loaded. Should match dispatch ECC field.>
80
+ Skills active: <which skills were active. Should match dispatch Skills field.>
81
+ API contract: <path to contract file used, if applicable>
82
82
  Files read:
83
83
  Files changed:
84
84
  Findings:
@@ -111,33 +111,19 @@ Use this shape for `/wf`, long tasks, multi-file changes, architecture work, mig
111
111
  /wf max orchestration shape:
112
112
  controller intake
113
113
  -> wave 0: max-parallel exploration (4-14 read-only agents)
114
- -> controller synthesis: dependency graph + write-set coloring
115
- -> wave 1: N parallel implementers (disjoint file claims)
116
- -> wave 1 review: parallel spec/code/security reviewers
117
- -> wave 2+: dependent implementers (if any)
114
+ -> E-GATE: Exploration Gate all questions answered, findings synthesized (per WF-MAX.md)
115
+ -> wave 1: architecture — 3 parallel architects boundary decisions + interface contract
116
+ -> D-GATE: Write Decomposition Gate Dispatch Table + Self-Audit for write-set (MANDATORY, per WF-MAX.md)
117
+ -> wave 2: N parallel implementers (disjoint file claims, ALL spawned in ONE message)
118
+ -> wave 2 review: parallel spec/code/security reviewers
119
+ -> wave 3+: dependent implementers (if any; re-run D-GATE if write-set changed)
118
120
  -> integration verifier
119
121
  -> closeout with evidence
120
122
  ```
121
123
 
122
124
  ## Dispatch Pack
123
125
 
124
- Every subagent dispatch must be self-contained:
125
-
126
- ```text
127
- Role:
128
- Goal:
129
- Mode: read-only | write
130
- Read set:
131
- Write set:
132
- Forbidden scope:
133
- Injected docs:
134
- Dependencies:
135
- Expected evidence:
136
- Stop condition:
137
- Return format:
138
- ```
139
-
140
- Do not make a subagent rediscover the entire project or read the whole harness. Inject only the docs selected by `Harness/README.md` and `Harness/context-loading.md`.
126
+ Use the canonical dispatch input and handoff format in `Harness/dispatch.md`. Every subagent dispatch must be self-contained — inject only the docs selected by `Harness/README.md` and `Harness/context-loading.md`.
141
127
 
142
128
  ## Parallelism Rules
143
129
 
@@ -0,0 +1,47 @@
1
+ # Task Naming Convention
2
+
3
+ ## Format
4
+
5
+ ```
6
+ task-<verb>-<noun>[-detail]
7
+ ```
8
+
9
+ All task directories MUST have the `task-` prefix. This distinguishes tasks from system directories at a glance.
10
+
11
+ ## Rules
12
+
13
+ | Rule | Example ✓ | Example ✗ |
14
+ |------|-----------|-----------|
15
+ | `task-` prefix required | `task-fix-ceo-inheritance` | `fix-ceo-inheritance` |
16
+ | kebab-case (lowercase, hyphens) | `task-fix-ceo-inheritance` | `task-fix_ceo_inheritance` |
17
+ | Verb-first after prefix | `task-add-goal-persistence` | `task-goal-persistence-add` |
18
+ | 2-5 words after prefix, ≤46 total chars | `task-refactor-hook-role` | `task-refactor-the-entire-hook-role-model` |
19
+ | No abbreviations unless domain-standard | `task-fix-auth-middleware` | `task-fx-ath-mdw` |
20
+
21
+ ## Reserved Names
22
+
23
+ | Name | Purpose |
24
+ |------|---------|
25
+ | `_template` | Task capsule template (never a real task) |
26
+ | `auto` | Auto-mode capsule (shared by `/wf-auto` and `/wf-auto-spark`) |
27
+
28
+ ## Task ID Lifecycle
29
+
30
+ 1. Created by copying `_template/` → `task-<verb>-<noun>/`
31
+ 2. Directory name IS the task ID — used in `Harness/PROGRESS.md`, hooks, dispatch packets
32
+ 3. Directory archived (not renamed) when task completes
33
+ 4. Task ID is immutable after creation (changing it breaks cross-references)
34
+ 5. Existing tasks without `task-` prefix are grandfathered — rename is optional but recommended
35
+
36
+ ## Examples
37
+
38
+ ```
39
+ task-add-dark-mode-support
40
+ task-fix-auth-token-expiry
41
+ task-update-harness-lifecycle-docs
42
+ task-remove-legacy-config-files
43
+ task-refactor-agent-dispatch-model
44
+ task-migrate-to-esm-imports
45
+ task-audit-security-headers
46
+ task-benchmark-wf-max-throughput
47
+ ```
@@ -1,30 +1,30 @@
1
- # MEMORY.md - create-harness-vibe-coding Project Resource Index
2
-
3
- > The project fact source is reached via `CLAUDE.md -> Harness/README.md`. This file persists cross-session context: resource index, user preferences, tool usage standards.
4
- > Detailed memory lives in `Harness/memory/`. Keep entries short, newest first, and free of secrets.
5
-
6
- ## Agents (Sub-agents)
7
-
8
- - [researcher](../.claude/agents/researcher.md) — product, market, open-source, dependency, pricing, policy, and ecosystem research.
9
- - [docs-researcher](../.claude/agents/docs-researcher.md) — official docs, API, SDK, config, limits, errors, and examples verification.
10
- - [planner](../.claude/agents/planner.md) — task split, dependencies, write sets, and dispatch table.
11
- - [architect](../.claude/agents/architect.md) — boundaries, ports, data-flow, and state impact.
12
- - [test-writer](../.claude/agents/test-writer.md) — failing tests or manual verification before implementation.
13
- - [implementer](../.claude/agents/implementer.md) — bounded implementation inside declared write set.
14
- - [debugger](../.claude/agents/debugger.md) — smallest fix for a reproduced failure.
15
- - [reviewer](../.claude/agents/reviewer.md) — read-only diff review and closeout risk.
16
- - [verifier](../.claude/agents/verifier.md) — verification commands and evidence.
17
- - [memory-master](../.claude/agents/memory-master.md) — memory writing, dedup, consolidation, and cross-project knowledge extraction.
18
- - [context-master](../.claude/agents/context-master.md) — context analysis, compression alerts, and session knowledge extraction for memory-master.
19
- - [explore-manager](../.claude/agents/explore-manager.md) — WF-MAX W0 exploration: spawn 5-10 read-only researchers, synthesize, report to CEO.
20
- - [architect-manager](../.claude/agents/architect-manager.md) — WF-MAX W1 architecture: spawn 3 architects, synthesize interface contracts, report to CEO.
21
- - [implement-manager](../.claude/agents/implement-manager.md) — WF-MAX W2 implementation: spawn 5-7 implementers (one file_claim each), merge, report to CEO.
22
- - [review-manager](../.claude/agents/review-manager.md) — WF-MAX W2R review: spawn 3-4 reviewers (spec/code/security/perf), deduplicate, classify severity, report to CEO.
23
-
24
- Stack-specific agents can be added after the product shape is known.
25
-
26
- ## Skills (Workflows)
27
-
1
+ # MEMORY.md - create-harness-vibe-coding Project Resource Index
2
+
3
+ > The project fact source is reached via `CLAUDE.md -> Harness/README.md`. This file persists cross-session context: resource index, user preferences, tool usage standards.
4
+ > Detailed memory lives in `Harness/memory/`. Keep entries short, newest first, and free of secrets.
5
+
6
+ ## Agents (Sub-agents)
7
+
8
+ - [researcher](../.claude/agents/researcher.md) — product, market, open-source, dependency, pricing, policy, and ecosystem research.
9
+ - [docs-researcher](../.claude/agents/docs-researcher.md) — official docs, API, SDK, config, limits, errors, and examples verification.
10
+ - [planner](../.claude/agents/planner.md) — task split, dependencies, write sets, and dispatch table.
11
+ - [architect](../.claude/agents/architect.md) — boundaries, ports, data-flow, and state impact.
12
+ - [test-writer](../.claude/agents/test-writer.md) — failing tests or manual verification before implementation.
13
+ - [implementer](../.claude/agents/implementer.md) — bounded implementation inside declared write set.
14
+ - [debugger](../.claude/agents/debugger.md) — smallest fix for a reproduced failure.
15
+ - [reviewer](../.claude/agents/reviewer.md) — read-only diff review and closeout risk.
16
+ - [verifier](../.claude/agents/verifier.md) — verification commands and evidence.
17
+ - [memory-master](../.claude/agents/memory-master.md) — memory writing, dedup, consolidation, and cross-project knowledge extraction.
18
+ - [context-master](../.claude/agents/context-master.md) — context analysis, compression alerts, and session knowledge extraction for memory-master.
19
+ - [explore-manager](../.claude/agents/explore-manager.md) — WF-MAX W0 exploration: spawn 5-10 read-only researchers, synthesize, report to CEO.
20
+ - [architect-manager](../.claude/agents/architect-manager.md) — WF-MAX W1 architecture: spawn 3 architects, synthesize interface contracts, report to CEO.
21
+ - [implement-manager](../.claude/agents/implement-manager.md) — WF-MAX W2 implementation: spawn 5-7 implementers (one file_claim each), merge, report to CEO.
22
+ - [review-manager](../.claude/agents/review-manager.md) — WF-MAX W2R review: spawn 3-4 reviewers (spec/code/security/perf), deduplicate, classify severity, report to CEO.
23
+
24
+ Stack-specific agents can be added after the product shape is known.
25
+
26
+ ## Skills (Workflows)
27
+
28
28
  - [WF Mode](WF.md) — long-task workflow: exploration, second plan, implementation, review, verification, heartbeat, and recovery loop.
29
29
  - [wf](../.claude/skills/wf/SKILL.md) — Claude Code WF skill command; mirrored for Codex at `../.agents/skills/wf/SKILL.md`.
30
30
  - [subagent-orchestrator](../.claude/skills/subagent-orchestrator/SKILL.md) — controller-led subagent orchestration, parallel read-only passes, review gates, and recovery handoffs.
@@ -33,45 +33,52 @@ Stack-specific agents can be added after the product shape is known.
33
33
  - [wf-update](../.claude/skills/wf-update/SKILL.md) — GitHub-based incremental harness update, checksum comparison, and safe in-place updates.
34
34
  - [wf-learn](../.claude/skills/wf-learn/SKILL.md) — force memory learning cycle: context-master -> memory-master -> project + global memory.
35
35
  - [wf-max](../.claude/skills/wf-max/SKILL.md) — maximum-parallelism workflow: write-set coloring, wave dispatch, parallel review per dimension.
36
+ - [wf-auto](../.claude/skills/wf-auto/SKILL.md) — perpetual auto-optimization: 8-angle internal scan, intent checkpoints, evidence ledger.
37
+ - [wf-auto-spark](../.claude/skills/wf-auto-spark/SKILL.md) — perpetual inspiration mode: external spark search, long-term roadmap with staged milestones, ≤50% deviation guard.
38
+ - [tdd](../.claude/skills/tdd/SKILL.md) — test-driven development: red-green-refactor, ≥80% coverage gate, enforces tests-first methodology.
36
39
  - [wf-remove](../.claude/skills/wf-remove/SKILL.md) — Safely remove Harness framework files (SAFE/MODIFIED/USER classes), auto-prune empty directories, backup option.
37
40
 
38
41
  Codex repo-skill mirrors live under `../.agents/skills/` with the same skill names.
39
-
40
- Stack-specific skills can be added after the product shape is known.
41
-
42
- ## Rules (Harness Constraints)
43
-
44
- Located under `.claude/rules/ecc/`, auto-loaded by the CC engine:
45
-
46
- - [common.md](../.claude/rules/ecc/common.md) — universal harness constraints for context loading, verification, subagents, and security (alwaysApply: true)
47
- - Language-specific rules pending Claude Code initialization (e.g. python.md, typescript.md, etc.)
48
-
49
- ## Harness (Runtime)
50
-
51
- - [Docs router](README.md)
52
- - [WF mode](WF.md)
53
- - [WF Max mode](WF-MAX.md)
54
- - [0-1 lifecycle](lifecycle.md)
55
- - [Research protocol](research/README.md)
56
- - [Context loading protocol](context-loading.md)
57
- - [Dispatch protocol](dispatch.md)
58
- - [Subagent orchestration](subagents.md)
59
- - [Extension contract](extension.md)
60
- - [Architecture docs](architecture.md)
61
- - [Agent workflow](agent-workflow.md)
62
- - [Harness validator](scripts/validate-harness.mjs)
63
- - [Version file](.harness-version)
64
-
65
- ## Memory Folder
66
-
67
- - [Tool usage/reflections](memory/tool-usage-reflections.md) - repeated tool failures, better command patterns, environment-specific fixes.
68
- - [User corrections/preferences](memory/user-corrections-preferences.md) - repeated user corrections, durable preferences, common-sense course corrections.
69
- - [Agent lessons/patterns](memory/agent-lessons-patterns.md) - reusable lessons from review, debugging, validation, and handoff loops.
70
-
71
- Write to the memory folder when the guidance should survive chat context loss:
72
-
73
- - Use `memory/tool-usage-reflections.md` when the same tool/use pattern fails 3+ times, a better command pattern is found, or an environment-specific fix should be reused.
74
- - Use `memory/user-corrections-preferences.md` when the user explicitly asks to remember a preference, or the user corrects the same assumption/pattern 2+ times.
75
- - Use `memory/agent-lessons-patterns.md` when a review/debug loop yields a reusable lesson or regression guard.
76
- - Use this file for the resource index and routing pointers, not long-form lessons.
77
- - Never record secrets, credentials, tokens, or private data. If a memory is ambiguous, ask before writing.
42
+
43
+ Stack-specific skills can be added after the product shape is known.
44
+
45
+ - [browser-e2e](workflows/browser-e2e.md)
46
+
47
+ Stack-specific skills can be added after the product shape is known.
48
+
49
+ ## Rules (Harness Constraints)
50
+
51
+ Located under `.claude/rules/ecc/`, auto-loaded by the CC engine:
52
+
53
+ - [common.md](../.claude/rules/ecc/common.md) — universal harness constraints for context loading, verification, subagents, and security (alwaysApply: true)
54
+ - Language-specific rules pending Claude Code initialization (e.g. python.md, typescript.md, etc.)
55
+
56
+ ## Harness (Runtime)
57
+
58
+ - [Docs router](README.md)
59
+ - [WF mode](WF.md)
60
+ - [WF Max mode](WF-MAX.md)
61
+ - [0-1 lifecycle](lifecycle.md)
62
+ - [Research protocol](research/README.md)
63
+ - [Context loading protocol](context-loading.md)
64
+ - [Dispatch protocol](dispatch.md)
65
+ - [Subagent orchestration](subagents.md)
66
+ - [Extension contract](extension.md)
67
+ - [Architecture docs](architecture.md)
68
+ - [Agent workflow](agent-workflow.md)
69
+ - [Harness validator](scripts/validate-harness.mjs)
70
+ - [Version file](.harness-version)
71
+
72
+ ## Memory Folder
73
+
74
+ - [Tool usage/reflections](memory/tool-usage-reflections.md) - repeated tool failures, better command patterns, environment-specific fixes.
75
+ - [User corrections/preferences](memory/user-corrections-preferences.md) - repeated user corrections, durable preferences, common-sense course corrections.
76
+ - [Agent lessons/patterns](memory/agent-lessons-patterns.md) - reusable lessons from review, debugging, validation, and handoff loops.
77
+
78
+ Write to the memory folder when the guidance should survive chat context loss:
79
+
80
+ - Use `memory/tool-usage-reflections.md` when the same tool/use pattern fails 3+ times, a better command pattern is found, or an environment-specific fix should be reused.
81
+ - Use `memory/user-corrections-preferences.md` when the user explicitly asks to remember a preference, or the user corrects the same assumption/pattern 2+ times.
82
+ - Use `memory/agent-lessons-patterns.md` when a review/debug loop yields a reusable lesson or regression guard.
83
+ - Use this file for the resource index and routing pointers, not long-form lessons.
84
+ - Never record secrets, credentials, tokens, or private data. If a memory is ambiguous, ask before writing.