cc-dev-template 0.1.90 → 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.90",
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"
@@ -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 |