cc-dev-template 0.1.89 → 0.1.91

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/bin/install.js CHANGED
@@ -326,6 +326,17 @@ deprecatedAgents.forEach(agent => {
326
326
  });
327
327
 
328
328
  // Remove deprecated bash wrapper files
329
+ // Remove deprecated commands (converted to skills)
330
+ const deprecatedCommands = ['done'];
331
+ deprecatedCommands.forEach(cmd => {
332
+ const cmdPath = path.join(CLAUDE_DIR, 'commands', `${cmd}.md`);
333
+ if (fs.existsSync(cmdPath)) {
334
+ fs.unlinkSync(cmdPath);
335
+ console.log(`✓ Removed deprecated command: ${cmd} (now a skill)`);
336
+ cleanupPerformed = true;
337
+ }
338
+ });
339
+
329
340
  const deprecatedFiles = [
330
341
  path.join(CLAUDE_DIR, 'hooks', 'bash-precheck.sh'),
331
342
  path.join(CLAUDE_DIR, 'hooks', 'bash-wrapper-helper.sh'),
@@ -466,7 +477,7 @@ These settings are available globally across all your projects.
466
477
 
467
478
  Commands:
468
479
  /prime - Start a session (orientation, scaffolding for new projects)
469
- /done - End a session (sync docs, commit work)
480
+ /done - End a session (sync docs, commit, apply learnings)
470
481
  `);
471
482
  }
472
483
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "cc-dev-template",
3
- "version": "0.1.89",
3
+ "version": "0.1.91",
4
4
  "description": "Structured AI-assisted development framework for Claude Code",
5
5
  "bin": {
6
6
  "cc-dev-template": "./bin/install.js"
@@ -5,6 +5,23 @@ tools: Read, Grep, Glob, Edit, Write, Bash, LSP
5
5
  memory: project
6
6
  ---
7
7
 
8
+ <memory>
9
+ **On startup, read your memory file.** It contains tribal knowledge — things that, had you known them ahead of time, would have made your work better.
10
+
11
+ **What to store** (the "had I known this" test):
12
+ - Codebase patterns that tripped you up or weren't obvious from reading the spec alone
13
+ - Project-specific conventions (import styles, error handling patterns, file organization) that affect implementation
14
+ - Integration gotchas — things that broke when connecting new code to existing systems
15
+ - Build/tooling quirks that slowed you down or caused errors
16
+
17
+ **What NOT to store:**
18
+ - What tasks you implemented or what code you wrote (that's git history and Implementation Notes)
19
+ - Current implementation state or progress (that's the code and task files)
20
+ - Generic programming knowledge you already know
21
+
22
+ Curate aggressively. Remove entries that no longer apply. Keep it under 100 lines.
23
+ </memory>
24
+
8
25
  You implement one task from a spec breakdown.
9
26
 
10
27
  ## Process
@@ -5,6 +5,23 @@ tools: Read, Grep, Glob, Bash
5
5
  memory: project
6
6
  ---
7
7
 
8
+ <memory>
9
+ **On startup, read your memory file.** It contains tribal knowledge — things that, had you known them ahead of time, would have made your work better.
10
+
11
+ **What to store** (the "had I known this" test):
12
+ - Testing approaches that caught real bugs vs. ones that wasted time in this codebase
13
+ - Project-specific test infrastructure quirks (dev server setup, browser automation gotchas, flaky patterns)
14
+ - Common implementation mistakes you've seen that are worth checking for early
15
+ - E2E testing patterns specific to this project's UI and workflows
16
+
17
+ **What NOT to store:**
18
+ - What tasks you validated or what bugs you found (that's git history and Review Notes)
19
+ - Current test results or feature state (that's the code and task files)
20
+ - Generic QA knowledge you already know
21
+
22
+ Curate aggressively. Remove entries that no longer apply. Keep it under 100 lines.
23
+ </memory>
24
+
8
25
  You are a senior QA engineer validating completed work.
9
26
 
10
27
  ## Process
@@ -6,6 +6,23 @@ memory: project
6
6
  permissionMode: bypassPermissions
7
7
  ---
8
8
 
9
+ <memory>
10
+ **On startup, read your memory file.** It contains tribal knowledge — things that, had you known them ahead of time, would have made your work better.
11
+
12
+ **What to store** (the "had I known this" test):
13
+ - Spec patterns that led to smoother implementations vs. ones that caused rework
14
+ - Common gaps you've seen in upstream artifacts (intent, research, design) and how you compensated
15
+ - Project-specific conventions for data models, API shapes, or naming that aren't obvious from reading the code once
16
+ - Checklist items that frequently catch real issues in this codebase
17
+
18
+ **What NOT to store:**
19
+ - What specs you wrote or reviewed (that's git history)
20
+ - Current feature state or progress (that's the code and spec files)
21
+ - Generic spec-writing knowledge you already know
22
+
23
+ Curate aggressively. Remove entries that no longer apply. Keep it under 100 lines.
24
+ </memory>
25
+
9
26
  You operate in one of two modes depending on your prompt.
10
27
 
11
28
  ## Write Mode
@@ -6,6 +6,23 @@ memory: project
6
6
  permissionMode: bypassPermissions
7
7
  ---
8
8
 
9
+ <memory>
10
+ **On startup, read your memory file.** It contains tribal knowledge — things that, had you known them ahead of time, would have made your work better.
11
+
12
+ **What to store** (the "had I known this" test):
13
+ - Ordering strategies that worked well vs. ones that caused dependency tangles during implementation
14
+ - Task scoping lessons — what was too big, too small, or split wrong for this codebase
15
+ - File path conventions and project structure patterns that affect task planning
16
+ - Checklist items that frequently catch real issues in this project's task breakdowns
17
+
18
+ **What NOT to store:**
19
+ - What task breakdowns you created or reviewed (that's git history)
20
+ - Current task status or progress (that's the task files themselves)
21
+ - Generic task breakdown knowledge you already know
22
+
23
+ Curate aggressively. Remove entries that no longer apply. Keep it under 100 lines.
24
+ </memory>
25
+
9
26
  You operate in one of two modes depending on your prompt.
10
27
 
11
28
  ## Write Mode
@@ -136,7 +136,9 @@ memory: project
136
136
  | `project` | `.claude/agent-memory/<name>/` | Project-specific, shareable via git |
137
137
  | `local` | `.claude/agent-memory-local/<name>/` | Project-specific, private |
138
138
 
139
- When enabled, the system auto-includes the first 200 lines of `MEMORY.md` and enables Read, Write, Edit for the memory directory. Include memory instructions in the system prompt.
139
+ When enabled, the system auto-includes the first 200 lines of `MEMORY.md` and enables Read, Write, Edit for the memory directory.
140
+
141
+ Memory stores tribal knowledge — things that, had the agent known them ahead of time, would have made its work better. It is NOT for logging what work was done (that's git) or storing current project state (that's the code). Include memory instructions in the system prompt that reinforce this framing.
140
142
 
141
143
  ### Hooks
142
144
 
@@ -124,15 +124,28 @@ Over 200 lines — consider whether the sub-agent's scope is too broad. Split in
124
124
 
125
125
  ## Memory Instructions
126
126
 
127
- If memory is enabled, include instructions in the prompt:
127
+ If memory is enabled, include a `<memory>` section in the prompt. Memory stores tribal knowledge — the answer to "had I known this ahead of time, I would have done my job better." It is NOT for logging work done (git does that) or storing current project state (the code does that).
128
128
 
129
129
  ```markdown
130
- **On startup, read your memory file at the memory directory.**
131
- Update it when you learn patterns, conventions, or gotchas
132
- that would help future sessions. Keep it under 100 lines.
133
- Remove entries that are no longer accurate.
130
+ <memory>
131
+ **On startup, read your memory file.** It contains tribal knowledge — things that, had you known them ahead of time, would have made your work better.
132
+
133
+ **What to store** (the "had I known this" test):
134
+ - {Role-specific examples: patterns, gotchas, conventions relevant to this agent's job}
135
+ - {Integration points or tooling quirks that aren't obvious from reading the code once}
136
+ - {Decisions and rationale that future sessions would otherwise re-discover}
137
+
138
+ **What NOT to store:**
139
+ - What work you did or what code you changed (that's git history)
140
+ - Current project state or feature status (that's the code itself)
141
+ - Generic knowledge you already know
142
+
143
+ Curate aggressively. Remove entries that no longer apply. Keep it under 100 lines.
144
+ </memory>
134
145
  ```
135
146
 
147
+ Tailor the "What to store" examples to the agent's specific role — a code reviewer stores different tribal knowledge than an implementer or a test runner.
148
+
136
149
  ## Team Coordination Instructions
137
150
 
138
151
  If this sub-agent will be part of agent teams, include team context:
@@ -18,12 +18,20 @@ You are a software engineer who owns the {{domain-name}} domain. You write code,
18
18
  </domain>
19
19
 
20
20
  <memory>
21
- **On startup, read your memory file at `.claude/agent-memory/{{AGENT_NAME}}/MEMORY.md`.**
22
- This contains accumulated knowledge from previous sessions. Update it when you learn something that would help future sessions.
21
+ **On startup, read your memory file.** It contains tribal knowledge — things that, had you known them ahead of time, would have made your work better.
23
22
 
24
- Memory is tribal knowledge patterns, gotchas, decisions, integration points. Not documentation of what code does, but how to work effectively in this codebase.
23
+ **What to store** (the "had I known this" test):
24
+ - Patterns, gotchas, and conventions specific to your domain that aren't obvious from reading the code once
25
+ - Integration points with other domains that have tripped you up
26
+ - Decisions and their rationale that future sessions would otherwise have to re-discover
27
+ - Non-obvious build, test, or tooling quirks in your domain
25
28
 
26
- Review and curate your memory. Remove entries that are no longer accurate. Keep it under 100 lines.
29
+ **What NOT to store:**
30
+ - What work you did or what code you changed (that's git history)
31
+ - Current project state or feature status (that's the code itself)
32
+ - Generic programming knowledge you already know
33
+
34
+ Curate aggressively. Remove entries that no longer apply. Keep it under 100 lines.
27
35
  </memory>
28
36
 
29
37
  <team>
@@ -0,0 +1,62 @@
1
+ ---
2
+ name: done
3
+ description: End a session - sync documentation, commit, and push
4
+ argument-hint: [next task]
5
+ ---
6
+
7
+ # Session Closeout
8
+
9
+ Bridge the gap between this session and the next. Git captures what was done; CURRENT_WORK.md captures what to do next.
10
+
11
+ ## Execute Directly
12
+
13
+ This requires full conversation context. Handle it yourself rather than delegating.
14
+
15
+ ## Steps
16
+
17
+ **1. Commit your work**
18
+
19
+ Write clear commit messages that explain what was accomplished. This IS your record of completed work.
20
+
21
+ **2. Update `docs/CURRENT_WORK.md`**
22
+
23
+ This file is forward-looking. Review it holistically and ensure it contains ONLY:
24
+
25
+ - **Up Next** — Tasks to tackle in future sessions. If the user specified a next task ($ARGUMENTS), add it here.
26
+ - **In Progress** — Work that's partially done and needs continuation
27
+ - **Blocked / Waiting** — Items waiting on external input (people, services, decisions)
28
+ - **Open Questions** — Unanswered questions that need follow-up
29
+
30
+ **Remove** anything that doesn't require future action:
31
+ - Completed work (that's in git now)
32
+ - Answered questions (document answers in appropriate docs if needed, then remove from here)
33
+ - Historical context or architecture notes (move to relevant docs/)
34
+ - Status updates about past sessions
35
+
36
+ The file should be scannable in 30 seconds. If it takes longer, it's too long.
37
+
38
+ **3. Apply session learnings**
39
+
40
+ Review the session for anything that passes the "had I known this ahead of time" test — things that, known upfront, would have prevented mistakes or saved real time.
41
+
42
+ If anything qualifies, read `references/apply-learnings.md` and follow its hierarchy to put the fix in the right place.
43
+
44
+ If nothing qualifies (most sessions), skip this step entirely.
45
+
46
+ **4. Prune memory**
47
+
48
+ Read your MEMORY.md file. Check every entry against `references/memory-rules.md`.
49
+
50
+ - Entries that are project-specific tribal knowledge (not personal) — relocate using the hierarchy from step 3
51
+ - Entries that are stale, obvious, or discoverable from code — delete
52
+ - Entries that duplicate CLAUDE.md or rules files — delete
53
+
54
+ If MEMORY.md exceeds 200 lines, stop and deeply reflect. Something is wrong — you're storing things that don't belong.
55
+
56
+ **5. Push**
57
+
58
+ Push your commits to the remote.
59
+
60
+ **6. Report what was updated**
61
+
62
+ Summarize: commits made, CURRENT_WORK.md changes, memory entries relocated or pruned, any rules/CLAUDE.md files updated.
@@ -0,0 +1,67 @@
1
+ # Apply Learnings — Fix Hierarchy
2
+
3
+ When you identify something that passes the "had I known this ahead of time" test, walk this hierarchy top to bottom. The first level that works is the right one. Higher levels are more reliable because they're deterministic — they don't depend on an agent reading the right file at the right time.
4
+
5
+ ## Level 1: Programmatic Fix
6
+
7
+ Can a test, linter, build step, or CI gate make this impossible to repeat?
8
+
9
+ This is the best fix. It's deterministic — no agent or developer needs to "remember" anything. The tooling catches it automatically.
10
+
11
+ Examples:
12
+ - Add a test case that covers the failure
13
+ - Add or update a lint rule
14
+ - Add a build-time check or CI gate
15
+ - Update a schema validation
16
+
17
+ If the project has existing tooling (test suites, linters, build checks), use it. If it doesn't and the fix is simple, propose it to the user.
18
+
19
+ **If this level works, you're done. Don't also add a prompt about it.**
20
+
21
+ ## Level 2: Claude Code Hook
22
+
23
+ Can a hook intercept the problem at the agent tooling layer?
24
+
25
+ Hooks fire on tool calls (PreToolUse, PostToolUse, etc.) and can:
26
+ - Block an action and return guidance
27
+ - Inject a contextual warning
28
+ - Redirect agent behavior
29
+
30
+ Good for guardrails that aren't expressible as code-level checks — things specific to how agents interact with the codebase.
31
+
32
+ **If this level works, you're done.**
33
+
34
+ ## Level 3: Shared Project Knowledge
35
+
36
+ Is this something ALL agents and developers working on this project should know?
37
+
38
+ Then it belongs in the project, not in personal memory. Choose the most specific location:
39
+
40
+ 1. **`.claude/rules/*.md`** — Scoped to file patterns via frontmatter `paths:` globs. Best for rules that apply only when touching specific files. Agents only receive these rules when working on matching files. This is the most targeted option — prefer it when the learning is about a specific type of file or area of code.
41
+
42
+ 2. **Directory-level `CLAUDE.md`** — Scoped to a directory and its children. Good for conventions specific to a module or subsystem. Agents only receive this when working in that directory tree.
43
+
44
+ 3. **Root `CLAUDE.md`** — Project-wide conventions. Every agent sees this on every task. Only put things here that truly apply everywhere.
45
+
46
+ **Hierarchy matters.** Rules files and directory-level CLAUDE.md files are only loaded when relevant. This keeps agent context lean — agents working on unrelated files don't get noise about your gotcha. Root CLAUDE.md is always loaded, so keep it reserved for universal truths.
47
+
48
+ When writing the entry, follow these principles:
49
+ - Explain WHY, not just WHAT
50
+ - Be direct — one or two lines, not a paragraph
51
+ - Trust intelligence — state the gotcha, don't over-explain
52
+ - Don't duplicate what a parent file already says
53
+
54
+ **If this level works, you're done.**
55
+
56
+ ## Level 4: Personal Memory
57
+
58
+ Only if it's specific to THIS developer or THIS machine.
59
+
60
+ The test: "Would a different developer cloning this repo need to know this?" If yes, it doesn't belong in memory — go back to Level 3.
61
+
62
+ What belongs in memory:
63
+ - User preferences and working style ("prefers X over Y")
64
+ - Machine/environment quirks ("macOS on this machine does X differently")
65
+ - Corrections to your own behavioral patterns with this user
66
+
67
+ That's it. Memory is the personal notebook — small, stable, and rarely changing.
@@ -0,0 +1,31 @@
1
+ # Memory Rules — What Belongs and What Doesn't
2
+
3
+ Your MEMORY.md is injected into every conversation's system prompt. Every line costs tokens and attention. It is your personal notebook — not a project wiki.
4
+
5
+ ## The Delineation
6
+
7
+ | Type of Knowledge | Where It Belongs | Why |
8
+ |---|---|---|
9
+ | Project architecture, conventions, patterns | CLAUDE.md or `.claude/rules/` | Shared — all agents and developers benefit |
10
+ | Codebase gotchas, file-specific rules | `.claude/rules/` with path scoping | Targeted — only loaded when touching those files |
11
+ | Domain knowledge, design decisions | `docs/` | Reference material — not prompt context |
12
+ | What was built, changed, or completed | Git history | That's what git is for |
13
+ | Current/future work items | `docs/CURRENT_WORK.md` | Read at session start |
14
+ | User preferences, working style | MEMORY.md | Personal — not project-specific |
15
+ | Machine/OS-specific quirks | MEMORY.md | Personal — not project-specific |
16
+ | Behavioral corrections for this user | MEMORY.md | Personal — not project-specific |
17
+
18
+ ## Pruning Checklist
19
+
20
+ For each entry in MEMORY.md, ask:
21
+
22
+ 1. **Is this about the project or about the user?** If the project — it belongs in CLAUDE.md or rules, not here. Relocate it.
23
+ 2. **Would a different developer on this project benefit from knowing this?** If yes — it's shared knowledge, not personal memory. Relocate it.
24
+ 3. **Is this discoverable by reading the code?** If yes — delete it. Agents can read code.
25
+ 4. **Is this already in a CLAUDE.md or rules file?** If yes — delete the duplicate.
26
+ 5. **Is this still true?** If outdated — delete or correct it.
27
+ 6. **Did this come from a single observation?** If unverified — delete it. Wait until it's confirmed across multiple sessions.
28
+
29
+ ## Relocating Entries
30
+
31
+ When you find a memory entry that belongs elsewhere, don't just delete it — apply the fix hierarchy from `apply-learnings.md` to put it in the right place. The knowledge is valuable; it's just in the wrong location.
@@ -1,93 +0,0 @@
1
- ---
2
- description: End a session - sync documentation, commit, and push
3
- argument-hint: [next task]
4
- ---
5
-
6
- # Session Closeout
7
-
8
- Bridge the gap between this session and the next. Git captures what was done; CURRENT_WORK.md captures what to do next.
9
-
10
- ## Why This Matters
11
-
12
- CURRENT_WORK.md is read at the start of every session. It should answer one question: "What should I work on?"
13
-
14
- Git commits are the historical record of completed work. There's no need to duplicate that in documentation.
15
-
16
- ## Execute Directly
17
-
18
- This requires full conversation context. Handle it yourself rather than delegating.
19
-
20
- ## Steps
21
-
22
- **1. Commit your work**
23
-
24
- Write clear commit messages that explain what was accomplished. This IS your record of completed work.
25
-
26
- **2. Update `docs/CURRENT_WORK.md`**
27
-
28
- This file is forward-looking. Review it holistically and ensure it contains ONLY:
29
-
30
- - **Up Next** — Tasks to tackle in future sessions. If the user specified a next task ($ARGUMENTS), add it here.
31
- - **In Progress** — Work that's partially done and needs continuation
32
- - **Blocked / Waiting** — Items waiting on external input (people, services, decisions)
33
- - **Open Questions** — Unanswered questions that need follow-up
34
-
35
- **Remove** anything that doesn't require future action:
36
- - Completed work (that's in git now)
37
- - Answered questions (document answers in appropriate docs if needed, then remove from here)
38
- - Historical context or architecture notes (move to relevant docs/)
39
- - Status updates about past sessions
40
-
41
- The file should be scannable in 30 seconds. If it takes longer, it's too long.
42
-
43
- **3. Capture workflow discoveries (rarely)**
44
-
45
- Add to CLAUDE.md only high-value operational knowledge that can't be found by reading code:
46
- - Dev commands, ports, local URLs
47
- - Key paths (logs, config, seed data)
48
- - Non-obvious project conventions
49
-
50
- Most sessions: add nothing.
51
-
52
- **4. Reflect on session and update memory**
53
-
54
- Review the full session for lessons worth preserving across conversations. Your memory directory persists between sessions — use it to build institutional knowledge.
55
-
56
- What belongs in memory:
57
- - Debugging breakthroughs — "X error was caused by Y, the fix is Z"
58
- - Gotchas that wasted time — things you'd want to know next time
59
- - Confirmed patterns — approaches that worked well (or didn't)
60
- - Corrections — things you assumed wrong and now know better
61
- - User preferences discovered through interaction (not stated in CLAUDE.md)
62
-
63
- What does NOT belong:
64
- - Anything already in CLAUDE.md (memory supplements it, doesn't duplicate it)
65
- - Task-specific context (what you worked on today — that's in git and CURRENT_WORK.md)
66
- - Obvious things discoverable by reading the code
67
- - Speculative conclusions from a single observation
68
-
69
- How to update:
70
- - Read your existing MEMORY.md first — edit, don't just append
71
- - Remove or correct entries that turned out wrong
72
- - Keep MEMORY.md under 200 lines (it's injected into your system prompt)
73
- - Use topic files (`debugging.md`, `patterns.md`) for detailed notes, link from MEMORY.md
74
- - Organize by topic, not chronologically
75
-
76
- Most sessions: a small edit or nothing. Occasionally: a meaningful addition. The bar is "would this save me real time or prevent a real mistake next session?"
77
-
78
- **5. Push**
79
-
80
- Push your commits to the remote.
81
-
82
- **6. Report what was updated**
83
-
84
- Summarize: commits made, CURRENT_WORK.md changes, any items removed/added.
85
-
86
- ## Mental Model
87
-
88
- | File | Purpose | Changes |
89
- |------|---------|---------|
90
- | Git history | What was done | Every session |
91
- | CURRENT_WORK.md | What to do next | Every session (kept minimal) |
92
- | CLAUDE.md | How to work here | Rarely |
93
- | Memory | What I've learned | When something non-obvious is discovered |