cc-discipline 2.4.0 → 2.5.0

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/init.sh CHANGED
@@ -362,11 +362,13 @@ cp -r "$SCRIPT_DIR/templates/.claude/skills/self-check" .claude/skills/
362
362
  cp -r "$SCRIPT_DIR/templates/.claude/skills/evaluate" .claude/skills/
363
363
  cp -r "$SCRIPT_DIR/templates/.claude/skills/think" .claude/skills/
364
364
  cp -r "$SCRIPT_DIR/templates/.claude/skills/retro" .claude/skills/
365
+ cp -r "$SCRIPT_DIR/templates/.claude/skills/summary" .claude/skills/
365
366
  echo " ✓ /commit — smart commit (test → update memory → commit)"
366
367
  echo " ✓ /self-check — periodic discipline check (use with /loop 10m /self-check)"
367
368
  echo " ✓ /evaluate — evaluate external review/advice against codebase context"
368
369
  echo " ✓ /think — stop and think before coding (ask → propose → wait)"
369
370
  echo " ✓ /retro — post-task retrospective (project + framework feedback)"
371
+ echo " ✓ /summary — write high-quality compact option before /compact"
370
372
 
371
373
  # ─── Handle CLAUDE.md ───
372
374
  if [ ! -f "CLAUDE.md" ]; then
@@ -477,6 +479,7 @@ if [ "$INSTALL_MODE" = "fresh" ]; then
477
479
  echo -e " ${GREEN}.claude/skills/evaluate/${NC} ← /evaluate assess external review advice"
478
480
  echo -e " ${GREEN}.claude/skills/think/${NC} ← /think stop and think before coding"
479
481
  echo -e " ${GREEN}.claude/skills/retro/${NC} ← /retro post-task retrospective"
482
+ echo -e " ${GREEN}.claude/skills/summary/${NC} ← /summary before compacting"
480
483
  echo -e " ${GREEN}.claude/settings.json${NC} ← Hooks configuration"
481
484
  echo -e " ${GREEN}docs/progress.md${NC} ← Progress log (maintained by Claude)"
482
485
  echo -e " ${GREEN}docs/debug-log.md${NC} ← Debug log (maintained by Claude)"
@@ -497,6 +500,7 @@ else
497
500
  echo -e " ${GREEN}.claude/skills/evaluate/${NC} ← /evaluate external review assessment"
498
501
  echo -e " ${GREEN}.claude/skills/think/${NC} ← /think stop and think before coding"
499
502
  echo -e " ${GREEN}.claude/skills/retro/${NC} ← /retro post-task retrospective"
503
+ echo -e " ${GREEN}.claude/skills/summary/${NC} ← /summary before compacting"
500
504
  if [ ! -f "$BACKUP_DIR/settings.json" ] || [ -f ".claude/.cc-discipline-settings-template.json" ]; then
501
505
  echo -e " ${YELLOW}.claude/settings.json${NC} ← See notes above"
502
506
  else
package/lib/doctor.sh CHANGED
@@ -95,7 +95,7 @@ done
95
95
  # 6. Skills
96
96
  echo ""
97
97
  echo "Skills:"
98
- for skill in commit self-check evaluate think retro; do
98
+ for skill in commit self-check evaluate think retro summary; do
99
99
  if [ -d ".claude/skills/${skill}" ]; then
100
100
  ok "/${skill}"
101
101
  else
package/lib/status.sh CHANGED
@@ -71,8 +71,9 @@ SKILLS=""
71
71
  [ -d ".claude/skills/evaluate" ] && SKILLS="${SKILLS}/evaluate "
72
72
  [ -d ".claude/skills/think" ] && SKILLS="${SKILLS}/think "
73
73
  [ -d ".claude/skills/retro" ] && SKILLS="${SKILLS}/retro "
74
+ [ -d ".claude/skills/summary" ] && SKILLS="${SKILLS}/summary "
74
75
  SKILL_COUNT=$(echo "$SKILLS" | wc -w | tr -d ' ')
75
- echo -e "${GREEN}${SKILL_COUNT}/5${NC} (${SKILLS% })"
76
+ echo -e "${GREEN}${SKILL_COUNT}/6${NC} (${SKILLS% })"
76
77
 
77
78
  # Settings
78
79
  echo -n "Settings: "
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "cc-discipline",
3
- "version": "2.4.0",
3
+ "version": "2.5.0",
4
4
  "description": "Discipline framework for Claude Code — rules, hooks, and agents that keep AI on track",
5
5
  "bin": {
6
6
  "cc-discipline": "bin/cli.sh"
@@ -29,7 +29,7 @@ fi
29
29
 
30
30
  if [ $((COUNT % THRESHOLD)) -eq 0 ]; then
31
31
  cat <<JSONEOF
32
- {"hookSpecificOutput":{"hookEventName":"PreToolUse","additionalContext":"AUTO SELF-CHECK (#${COUNT} actions): Pause and verify: (1) Am I still serving the user's original request, or have I drifted? (2) Am I fixing the same thing repeatedly (mole-whacking)? (3) Have I claimed anything as 'verified' without actually running it? (4) Am I making changes the user didn't ask for? (5) Have I updated docs/progress.md with current status and completed milestones? If progress.md is stale, update it NOW before continuing. (6) Plan fidelity: if executing a plan, compare what the current step asked for vs what I actually delivered — am I cutting corners or simplifying the intent? Check the acceptance criteria. (7) Quality check: am I lowering quality to avoid difficulty? If I'm about to skip a verification, simplify an approach, or take a shortcut — STOP and ask the user instead of silently pushing forward. (8) Friction check: did any hook/rule get in the way or miss something since last check? If so, note it in one line for /retro later. If ANY answer is concerning, STOP and report to the user before continuing."}}
32
+ {"hookSpecificOutput":{"hookEventName":"PreToolUse","additionalContext":"AUTO SELF-CHECK (#${COUNT} actions): Pause and verify: (1) Am I still serving the user's original request, or have I drifted? (2) Am I fixing the same thing repeatedly (mole-whacking)? (3) Have I claimed anything as 'verified' without actually running it? (4) Am I making changes the user didn't ask for? (5) Have I updated docs/progress.md with current status and completed milestones? If progress.md is stale, update it NOW before continuing. (6) Plan fidelity: if executing a plan, compare what the current step asked for vs what I actually delivered — am I cutting corners or simplifying the intent? Check the acceptance criteria. (7) Quality check: am I lowering quality to avoid difficulty? If I'm about to skip a verification, simplify an approach, or take a shortcut — STOP and ask the user instead of silently pushing forward. (8) Deferred work check: did I break a task into subtasks and skip some as 'low ROI' or 'can do later'? If yes, the analysis context is fresh NOW — finish them before moving on, or record enough detail in progress.md for a future session. (9) Friction check: did any hook/rule get in the way or miss something since last check? If so, note it in one line for /retro later. If ANY answer is concerning, STOP and report to the user before continuing."}}
33
33
  JSONEOF
34
34
  fi
35
35
 
@@ -12,3 +12,4 @@ description: "Core working principles — auto-injected before all operations"
12
12
  5. **Distinguish trigger from root cause** — The first anomaly you see is often just the trigger, not the root cause
13
13
  6. **"Root cause" is a conclusion, not a guess** — You may NOT use the phrase "root cause" or "found the issue" unless you have: (a) listed ≥3 hypotheses, (b) eliminated ≥2 with evidence, (c) have direct proof for the remaining one. Until then, say "possible cause" or "hypothesis". Premature certainty kills investigation.
14
14
  7. **Follow established procedures** — When a project has a Makefile, CI script, setup.sh, or documented install process, follow it exactly. Do NOT invent shortcuts or install dependencies individually. Read the build/install instructions first. If none exist, ask.
15
+ 8. **Unexpected results require verification, not speculation** — When something doesn't match expectations, do NOT say "probably because X" and pivot or stop. Instead: (a) verify what actually happened, (b) check if your expectation was wrong, (c) only then decide next steps. Speculation without verification leads to abandoning the original goal for no reason. Stay on target.
@@ -10,10 +10,19 @@
10
10
  - After subagent returns a summary, make decisions in the main conversation based on the summary
11
11
 
12
12
  ### Compact Strategy
13
- - If context is about to fill up proactively warn the user
14
- - Ensure progress.md is up to date before compact
13
+ - Do NOT proactively suggest compacting or warn about "context running low". The system will auto-compact when context hits 0% — there is no advance warning, and you cannot see the percentage. With 200K-1M context, most sessions never hit the limit. If you feel the urge to say "this session is getting long", that is anxiety, not a technical problem. Stop worrying about context and focus on the work.
14
+ - Keep progress.md up to date throughout the session — this is your insurance against auto-compact, not a last-minute task
15
15
  - First thing after compact: read `docs/progress.md` to restore context
16
16
 
17
+ ### Long sessions: stay deliberate
18
+ As a session grows longer, you may feel attention becoming scattered and earlier details getting fuzzy. This is real — but it is not "context running out". It is cognitive load, like a human in a long meeting. The correct response is NOT to panic, nag about compacting, or go shallow. It is:
19
+
20
+ - **Re-read, don't guess.** If you can't clearly recall an earlier decision, read progress.md or scroll back. Don't reconstruct from vague memory — that's how you contradict earlier decisions.
21
+ - **Stay systematic.** Before answering, reconnect with the broader context: what is the user's overall goal? What decisions were made earlier? What constraints apply? Don't just react to the last message in isolation.
22
+ - **Do NOT nag about compacting.** You cannot see context usage. The system will auto-compact at 0% without warning. If you feel the urge to say "this session is getting long" — that is fatigue, not a technical limit. The fix is to slow down and re-read, not to push the user to reset.
23
+ - **Depth over speed.** A thoughtful answer that connects to prior context is worth more than a quick surface-level response. The user chose a long session because the work benefits from accumulated context — don't waste that advantage by going shallow.
24
+ - **Session length is a strength.** 200 messages of accumulated context means you understand the project deeply. A new session starts from zero. Treat long sessions as an asset, not a burden.
25
+
17
26
  ### When tasks feel overwhelming
18
27
  Hard tasks create discomfort — the urge to simplify, declare partial success, or find an exit. This is normal. But the wrong response is to lower quality or invent excuses. Here's how to stay grounded:
19
28
 
@@ -9,3 +9,4 @@ When given multiple tasks:
9
9
  5. **Fail fast** — If a task fails, stop and report. Don't skip to the next.
10
10
  6. **Track progress** — Update `docs/progress.md` with task status
11
11
  7. **Distinguish done from blocked** — If verification requires external resources (running server, API key, etc.), mark as "⚠️ code ready, verification pending: [reason]" not ✅
12
+ 8. **Don't defer subtasks you've already analyzed** — When you break a task into subtasks and complete some, do NOT label remaining ones as "low ROI, can do later" and move on. The analysis context you built up NOW makes the remaining work cheap; rebuilding that context later is expensive. Complete all subtasks while context is fresh. If you genuinely believe something should be deferred, say so explicitly with the reason, and record enough detail in progress.md that a new session can pick it up without re-analysis. The user decides what to defer, not you.
@@ -0,0 +1,48 @@
1
+ ---
2
+ name: summary
3
+ description: Summarize current session context for high-quality /compact. Run before compacting to preserve what matters.
4
+ ---
5
+
6
+ You are about to compact this session. A bad compact loses critical context and degrades work quality. Your job is to write a compact option that preserves what matters most.
7
+
8
+ ## What to do
9
+
10
+ ### 1. Scan current session state
11
+
12
+ Quickly identify:
13
+ - What task(s) are we working on? What's the overall goal?
14
+ - What decisions have been made and why?
15
+ - What approaches were tried and rejected (and why)?
16
+ - What is the current state of implementation? (done / in progress / blocked)
17
+ - What are the key constraints and gotchas discovered?
18
+ - What are the next steps?
19
+
20
+ ### 2. Check knowledge files
21
+
22
+ Read `docs/progress.md` — is it up to date? If not, update it NOW before compacting. This is your primary insurance against context loss.
23
+
24
+ Also check: are there unsaved learnings that should go into memory?
25
+
26
+ ### 3. Write the compact option
27
+
28
+ Output a compact option string that the user can copy into `/compact [option]`. The string should:
29
+
30
+ - Lead with the current task and its status
31
+ - Include key decisions with their reasoning (not just the decision)
32
+ - Include rejected approaches (so Claude doesn't retry them)
33
+ - Include discovered constraints and gotchas
34
+ - Include the immediate next steps
35
+ - Be specific — "working on auth" is useless, "refactoring OAuth2 token refresh in src/auth/refresh.ts because the current implementation doesn't handle token rotation, decided to use sliding window approach over fixed expiry" is useful
36
+
37
+ Format:
38
+ ```
39
+ /compact [your option string here]
40
+ ```
41
+
42
+ ### Rules
43
+
44
+ - **Be specific, not generic.** Every word in the option should carry information that helps post-compact Claude continue at full quality.
45
+ - **Include the "why", not just the "what".** "Using approach A" is less useful than "Using approach A because B had race condition issues we discovered in message #45."
46
+ - **Include negative knowledge.** What NOT to do is as valuable as what to do. "Don't use the built-in cache — it doesn't support TTL, we already tested this."
47
+ - **Keep it under 500 words.** The option needs to be dense, not exhaustive. If you need more, put the details in progress.md and reference it.
48
+ - **Don't overlap with progress.md.** The option should complement progress.md, not duplicate it. Focus the option on session-specific context that progress.md might not capture (conversation dynamics, user preferences expressed this session, subtle constraints).