cc-discipline 2.10.1 → 2.10.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.
- package/README.md +153 -153
- package/README.zh-CN.md +207 -207
- package/bin/cli.sh +96 -96
- package/global/CLAUDE.md +45 -45
- package/init.sh +594 -594
- package/lib/doctor.sh +145 -145
- package/lib/stack-remove.sh +68 -68
- package/lib/status.sh +100 -100
- package/package.json +34 -34
- package/templates/.claude/agents/investigator.md +44 -44
- package/templates/.claude/agents/reviewer.md +46 -46
- package/templates/.claude/hooks/action-counter.sh +58 -58
- package/templates/.claude/hooks/git-guard.sh +62 -62
- package/templates/.claude/hooks/phase-gate.sh +10 -10
- package/templates/.claude/hooks/post-error-remind.sh +114 -114
- package/templates/.claude/hooks/pre-edit-guard.sh +100 -100
- package/templates/.claude/hooks/session-start.sh +44 -44
- package/templates/.claude/hooks/streak-breaker.sh +111 -111
- package/templates/.claude/rules/00-core-principles.md +16 -16
- package/templates/.claude/rules/01-debugging.md +32 -32
- package/templates/.claude/rules/02-before-edit.md +22 -22
- package/templates/.claude/rules/03-context-mgmt.md +44 -44
- package/templates/.claude/rules/04-no-mole-whacking.md +26 -26
- package/templates/.claude/rules/05-phase-discipline.md +15 -15
- package/templates/.claude/rules/06-multi-task.md +12 -12
- package/templates/.claude/rules/07-integrity.md +92 -92
- package/templates/.claude/rules/stacks/embedded.md +24 -24
- package/templates/.claude/rules/stacks/js-ts.md +21 -21
- package/templates/.claude/rules/stacks/mobile.md +16 -16
- package/templates/.claude/rules/stacks/python.md +20 -20
- package/templates/.claude/rules/stacks/rtl.md +24 -24
- package/templates/.claude/settings.json +84 -84
- package/templates/.claude/skills/commit/SKILL.md +40 -40
- package/templates/.claude/skills/evaluate/SKILL.md +57 -57
- package/templates/.claude/skills/investigate/SKILL.md +192 -192
- package/templates/.claude/skills/retro/SKILL.md +40 -40
- package/templates/.claude/skills/self-check/SKILL.md +87 -87
- package/templates/.claude/skills/summary/SKILL.md +48 -48
- package/templates/.claude/skills/think/SKILL.md +108 -108
- package/templates/CLAUDE.md +96 -96
- package/templates/docs/debug-log.md +48 -48
- package/templates/docs/progress.md +72 -72
- package/templates/memory/MEMORY.md +23 -23
package/templates/CLAUDE.md
CHANGED
|
@@ -1,96 +1,96 @@
|
|
|
1
|
-
# [PROJECT_NAME] — CLAUDE.md
|
|
2
|
-
|
|
3
|
-
> General discipline rules are auto-injected via `.claude/rules/`. This file is for project-specific information only.
|
|
4
|
-
|
|
5
|
-
---
|
|
6
|
-
|
|
7
|
-
## Project Overview
|
|
8
|
-
|
|
9
|
-
- **Project name**: [PROJECT_NAME]
|
|
10
|
-
- **One-line description**: [TODO — what this project aims to achieve]
|
|
11
|
-
- **Tech stack**: [TODO]
|
|
12
|
-
- **Key constraints**: [TODO — e.g., performance requirements, compatibility, security]
|
|
13
|
-
|
|
14
|
-
---
|
|
15
|
-
|
|
16
|
-
## Project Structure
|
|
17
|
-
|
|
18
|
-
[TODO — describe directory structure and module responsibilities]
|
|
19
|
-
|
|
20
|
-
```
|
|
21
|
-
├── src/ ← [TODO]
|
|
22
|
-
├── tests/ ← [TODO]
|
|
23
|
-
├── docs/
|
|
24
|
-
│ ├── progress.md ← Progress and decision log (maintained by Claude, do not edit manually)
|
|
25
|
-
│ └── debug-log.md ← Debug session log (maintained by Claude)
|
|
26
|
-
└── .claude/
|
|
27
|
-
├── rules/ ← Auto-injected rules
|
|
28
|
-
├── hooks/ ← Enforced hooks
|
|
29
|
-
└── agents/ ← Reviewer & investigator subagents
|
|
30
|
-
```
|
|
31
|
-
|
|
32
|
-
---
|
|
33
|
-
|
|
34
|
-
## Common Commands
|
|
35
|
-
|
|
36
|
-
[TODO — build, test, lint, run commands]
|
|
37
|
-
|
|
38
|
-
```bash
|
|
39
|
-
# Build
|
|
40
|
-
# [TODO]
|
|
41
|
-
|
|
42
|
-
# Test
|
|
43
|
-
# [TODO]
|
|
44
|
-
|
|
45
|
-
# Lint / Type Check
|
|
46
|
-
# [TODO]
|
|
47
|
-
|
|
48
|
-
# Run / Simulate
|
|
49
|
-
# [TODO]
|
|
50
|
-
```
|
|
51
|
-
|
|
52
|
-
---
|
|
53
|
-
|
|
54
|
-
## Project Tools
|
|
55
|
-
|
|
56
|
-
<!-- Claude: when you create a helper script, tool, or reusable one-liner during a session,
|
|
57
|
-
register it here IMMEDIATELY. Don't wait for /commit — do it when you create it.
|
|
58
|
-
Next session's Claude will thank you. -->
|
|
59
|
-
|
|
60
|
-
<!-- TEMPLATE:
|
|
61
|
-
### [tool name]
|
|
62
|
-
- **Path**: `path/to/script`
|
|
63
|
-
- **Purpose**: what it does, when to use it
|
|
64
|
-
- **Usage**: `exact command to run [with args]`
|
|
65
|
-
- **Created**: [date] — [why it was needed]
|
|
66
|
-
-->
|
|
67
|
-
|
|
68
|
-
---
|
|
69
|
-
|
|
70
|
-
## Code Style
|
|
71
|
-
|
|
72
|
-
[TODO — team conventions]
|
|
73
|
-
|
|
74
|
-
---
|
|
75
|
-
|
|
76
|
-
## Known Pitfalls
|
|
77
|
-
|
|
78
|
-
[TODO — project-specific gotchas, examples:]
|
|
79
|
-
- [e.g., Module X's interface looks like REST but is actually WebSocket]
|
|
80
|
-
- [e.g., Database migrations must be backwards-compatible]
|
|
81
|
-
- [e.g., Third-party library v2 API has breaking changes, we're pinned to v1]
|
|
82
|
-
|
|
83
|
-
---
|
|
84
|
-
|
|
85
|
-
## Compact Supplement
|
|
86
|
-
|
|
87
|
-
When compacting, in addition to general rules (preserve task objectives, progress, decisions), also preserve:
|
|
88
|
-
- [TODO — project-specific context that must be retained]
|
|
89
|
-
|
|
90
|
-
---
|
|
91
|
-
|
|
92
|
-
## Decision Log
|
|
93
|
-
|
|
94
|
-
| Date | Decision | Reason | Impact |
|
|
95
|
-
|------|----------|--------|--------|
|
|
96
|
-
| | | | |
|
|
1
|
+
# [PROJECT_NAME] — CLAUDE.md
|
|
2
|
+
|
|
3
|
+
> General discipline rules are auto-injected via `.claude/rules/`. This file is for project-specific information only.
|
|
4
|
+
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
## Project Overview
|
|
8
|
+
|
|
9
|
+
- **Project name**: [PROJECT_NAME]
|
|
10
|
+
- **One-line description**: [TODO — what this project aims to achieve]
|
|
11
|
+
- **Tech stack**: [TODO]
|
|
12
|
+
- **Key constraints**: [TODO — e.g., performance requirements, compatibility, security]
|
|
13
|
+
|
|
14
|
+
---
|
|
15
|
+
|
|
16
|
+
## Project Structure
|
|
17
|
+
|
|
18
|
+
[TODO — describe directory structure and module responsibilities]
|
|
19
|
+
|
|
20
|
+
```
|
|
21
|
+
├── src/ ← [TODO]
|
|
22
|
+
├── tests/ ← [TODO]
|
|
23
|
+
├── docs/
|
|
24
|
+
│ ├── progress.md ← Progress and decision log (maintained by Claude, do not edit manually)
|
|
25
|
+
│ └── debug-log.md ← Debug session log (maintained by Claude)
|
|
26
|
+
└── .claude/
|
|
27
|
+
├── rules/ ← Auto-injected rules
|
|
28
|
+
├── hooks/ ← Enforced hooks
|
|
29
|
+
└── agents/ ← Reviewer & investigator subagents
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
---
|
|
33
|
+
|
|
34
|
+
## Common Commands
|
|
35
|
+
|
|
36
|
+
[TODO — build, test, lint, run commands]
|
|
37
|
+
|
|
38
|
+
```bash
|
|
39
|
+
# Build
|
|
40
|
+
# [TODO]
|
|
41
|
+
|
|
42
|
+
# Test
|
|
43
|
+
# [TODO]
|
|
44
|
+
|
|
45
|
+
# Lint / Type Check
|
|
46
|
+
# [TODO]
|
|
47
|
+
|
|
48
|
+
# Run / Simulate
|
|
49
|
+
# [TODO]
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
---
|
|
53
|
+
|
|
54
|
+
## Project Tools
|
|
55
|
+
|
|
56
|
+
<!-- Claude: when you create a helper script, tool, or reusable one-liner during a session,
|
|
57
|
+
register it here IMMEDIATELY. Don't wait for /commit — do it when you create it.
|
|
58
|
+
Next session's Claude will thank you. -->
|
|
59
|
+
|
|
60
|
+
<!-- TEMPLATE:
|
|
61
|
+
### [tool name]
|
|
62
|
+
- **Path**: `path/to/script`
|
|
63
|
+
- **Purpose**: what it does, when to use it
|
|
64
|
+
- **Usage**: `exact command to run [with args]`
|
|
65
|
+
- **Created**: [date] — [why it was needed]
|
|
66
|
+
-->
|
|
67
|
+
|
|
68
|
+
---
|
|
69
|
+
|
|
70
|
+
## Code Style
|
|
71
|
+
|
|
72
|
+
[TODO — team conventions]
|
|
73
|
+
|
|
74
|
+
---
|
|
75
|
+
|
|
76
|
+
## Known Pitfalls
|
|
77
|
+
|
|
78
|
+
[TODO — project-specific gotchas, examples:]
|
|
79
|
+
- [e.g., Module X's interface looks like REST but is actually WebSocket]
|
|
80
|
+
- [e.g., Database migrations must be backwards-compatible]
|
|
81
|
+
- [e.g., Third-party library v2 API has breaking changes, we're pinned to v1]
|
|
82
|
+
|
|
83
|
+
---
|
|
84
|
+
|
|
85
|
+
## Compact Supplement
|
|
86
|
+
|
|
87
|
+
When compacting, in addition to general rules (preserve task objectives, progress, decisions), also preserve:
|
|
88
|
+
- [TODO — project-specific context that must be retained]
|
|
89
|
+
|
|
90
|
+
---
|
|
91
|
+
|
|
92
|
+
## Decision Log
|
|
93
|
+
|
|
94
|
+
| Date | Decision | Reason | Impact |
|
|
95
|
+
|------|----------|--------|--------|
|
|
96
|
+
| | | | |
|
|
@@ -1,48 +1,48 @@
|
|
|
1
|
-
# Debug Log
|
|
2
|
-
|
|
3
|
-
> Maintained by Claude Code during debugging sessions.
|
|
4
|
-
> Prevents repeated dead ends after compact. Prevents mole-whacking.
|
|
5
|
-
> Do not edit this file manually — let Claude maintain it.
|
|
6
|
-
|
|
7
|
-
---
|
|
8
|
-
|
|
9
|
-
## Active Debug Sessions
|
|
10
|
-
|
|
11
|
-
<!-- Claude: create a new entry below when starting a debug session -->
|
|
12
|
-
|
|
13
|
-
---
|
|
14
|
-
|
|
15
|
-
## Debug Entry Template
|
|
16
|
-
|
|
17
|
-
<!--
|
|
18
|
-
Copy the template below to create a new debug entry:
|
|
19
|
-
|
|
20
|
-
### [date] — [one-line problem description]
|
|
21
|
-
|
|
22
|
-
**Symptoms**: [specific error messages or abnormal behavior]
|
|
23
|
-
|
|
24
|
-
**Reproduction conditions**: [how to trigger the problem]
|
|
25
|
-
|
|
26
|
-
**Hypothesis list**:
|
|
27
|
-
| # | Hypothesis | Supporting evidence | Contradicting evidence | Status |
|
|
28
|
-
|---|-----------|-------------------|----------------------|--------|
|
|
29
|
-
| 1 | | | | [status] |
|
|
30
|
-
| 2 | | | | [status] |
|
|
31
|
-
| 3 | | | | [status] |
|
|
32
|
-
|
|
33
|
-
Status values: pending → eliminated / confirmed
|
|
34
|
-
|
|
35
|
-
**Root cause**: [fill in after confirmed]
|
|
36
|
-
|
|
37
|
-
**Fix**: [describe the fix and how it addresses the root cause]
|
|
38
|
-
|
|
39
|
-
**Verification**: [results after fixing]
|
|
40
|
-
|
|
41
|
-
**Lessons learned**: [what was learned; should CLAUDE.md "Known Pitfalls" be updated?]
|
|
42
|
-
-->
|
|
43
|
-
|
|
44
|
-
---
|
|
45
|
-
|
|
46
|
-
## Closed Debug Sessions
|
|
47
|
-
|
|
48
|
-
<!-- Claude: move completed entries here -->
|
|
1
|
+
# Debug Log
|
|
2
|
+
|
|
3
|
+
> Maintained by Claude Code during debugging sessions.
|
|
4
|
+
> Prevents repeated dead ends after compact. Prevents mole-whacking.
|
|
5
|
+
> Do not edit this file manually — let Claude maintain it.
|
|
6
|
+
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
## Active Debug Sessions
|
|
10
|
+
|
|
11
|
+
<!-- Claude: create a new entry below when starting a debug session -->
|
|
12
|
+
|
|
13
|
+
---
|
|
14
|
+
|
|
15
|
+
## Debug Entry Template
|
|
16
|
+
|
|
17
|
+
<!--
|
|
18
|
+
Copy the template below to create a new debug entry:
|
|
19
|
+
|
|
20
|
+
### [date] — [one-line problem description]
|
|
21
|
+
|
|
22
|
+
**Symptoms**: [specific error messages or abnormal behavior]
|
|
23
|
+
|
|
24
|
+
**Reproduction conditions**: [how to trigger the problem]
|
|
25
|
+
|
|
26
|
+
**Hypothesis list**:
|
|
27
|
+
| # | Hypothesis | Supporting evidence | Contradicting evidence | Status |
|
|
28
|
+
|---|-----------|-------------------|----------------------|--------|
|
|
29
|
+
| 1 | | | | [status] |
|
|
30
|
+
| 2 | | | | [status] |
|
|
31
|
+
| 3 | | | | [status] |
|
|
32
|
+
|
|
33
|
+
Status values: pending → eliminated / confirmed
|
|
34
|
+
|
|
35
|
+
**Root cause**: [fill in after confirmed]
|
|
36
|
+
|
|
37
|
+
**Fix**: [describe the fix and how it addresses the root cause]
|
|
38
|
+
|
|
39
|
+
**Verification**: [results after fixing]
|
|
40
|
+
|
|
41
|
+
**Lessons learned**: [what was learned; should CLAUDE.md "Known Pitfalls" be updated?]
|
|
42
|
+
-->
|
|
43
|
+
|
|
44
|
+
---
|
|
45
|
+
|
|
46
|
+
## Closed Debug Sessions
|
|
47
|
+
|
|
48
|
+
<!-- Claude: move completed entries here -->
|
|
@@ -1,72 +1,72 @@
|
|
|
1
|
-
# Progress & Decision Log
|
|
2
|
-
|
|
3
|
-
> Maintained by Claude Code during work sessions. Read this file after compact to restore context.
|
|
4
|
-
> Do not edit this file manually — let Claude maintain it.
|
|
5
|
-
|
|
6
|
-
---
|
|
7
|
-
|
|
8
|
-
## Current Status
|
|
9
|
-
|
|
10
|
-
- **In progress**: [none]
|
|
11
|
-
- **Last updated**: [none]
|
|
12
|
-
- **Next steps**: [none]
|
|
13
|
-
- **Modified files**: [none]
|
|
14
|
-
|
|
15
|
-
---
|
|
16
|
-
|
|
17
|
-
## Working Context
|
|
18
|
-
|
|
19
|
-
<!-- Claude: THIS SECTION IS CRITICAL. After compact, this is all you have.
|
|
20
|
-
Update this continuously, not as a last-minute save.
|
|
21
|
-
Everything here should let a post-compact Claude resume at full speed. -->
|
|
22
|
-
|
|
23
|
-
### Key Commands
|
|
24
|
-
<!-- Build, test, deploy, env setup — anything you'd need to re-run -->
|
|
25
|
-
|
|
26
|
-
### Current Workflow
|
|
27
|
-
<!-- Step-by-step: what process are you following right now?
|
|
28
|
-
e.g., "1. Edit schema → 2. Run migrate → 3. Run tests → 4. Check API"
|
|
29
|
-
Include the exact commands, flags, paths. -->
|
|
30
|
-
|
|
31
|
-
### Tools & Scripts Developed
|
|
32
|
-
<!-- Any helper scripts, one-liners, or tools created this session.
|
|
33
|
-
Include the file path and what it does. These are easy to forget. -->
|
|
34
|
-
|
|
35
|
-
### Environment State
|
|
36
|
-
<!-- What's running? What's configured? What ports? What branches?
|
|
37
|
-
e.g., "Docker compose up on port 5432, feature/auth branch checked out" -->
|
|
38
|
-
|
|
39
|
-
### Gotchas Discovered
|
|
40
|
-
<!-- Things that bit you this session. Workarounds found. Traps to avoid.
|
|
41
|
-
e.g., "pytest must be run from /src not root", "API returns 200 on error" -->
|
|
42
|
-
|
|
43
|
-
---
|
|
44
|
-
|
|
45
|
-
## Milestones
|
|
46
|
-
|
|
47
|
-
<!-- Claude: append a record below after completing each milestone.
|
|
48
|
-
DON'T just write one sentence. Each milestone should capture enough
|
|
49
|
-
detail that a future session can learn from it, not just know it happened.
|
|
50
|
-
Use the template below. -->
|
|
51
|
-
|
|
52
|
-
<!-- TEMPLATE (copy and fill for each milestone):
|
|
53
|
-
|
|
54
|
-
### [date] — [milestone title]
|
|
55
|
-
|
|
56
|
-
**What**: [what was accomplished, 2-3 sentences]
|
|
57
|
-
**How**: [approach taken, key files changed, commands used]
|
|
58
|
-
**Why this approach**: [why this way and not another — rejected alternatives]
|
|
59
|
-
**Gotchas**: [what went wrong, what was surprising, workarounds]
|
|
60
|
-
**Verification**: [how we confirmed it works — test output, manual check]
|
|
61
|
-
|
|
62
|
-
-->
|
|
63
|
-
|
|
64
|
-
---
|
|
65
|
-
|
|
66
|
-
## Key Decisions
|
|
67
|
-
|
|
68
|
-
<!-- Claude: record decisions and reasoning below when making architectural/design decisions -->
|
|
69
|
-
|
|
70
|
-
| # | Decision | Reason | Impact Scope | Date |
|
|
71
|
-
|---|----------|--------|-------------|------|
|
|
72
|
-
| | | | | |
|
|
1
|
+
# Progress & Decision Log
|
|
2
|
+
|
|
3
|
+
> Maintained by Claude Code during work sessions. Read this file after compact to restore context.
|
|
4
|
+
> Do not edit this file manually — let Claude maintain it.
|
|
5
|
+
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
## Current Status
|
|
9
|
+
|
|
10
|
+
- **In progress**: [none]
|
|
11
|
+
- **Last updated**: [none]
|
|
12
|
+
- **Next steps**: [none]
|
|
13
|
+
- **Modified files**: [none]
|
|
14
|
+
|
|
15
|
+
---
|
|
16
|
+
|
|
17
|
+
## Working Context
|
|
18
|
+
|
|
19
|
+
<!-- Claude: THIS SECTION IS CRITICAL. After compact, this is all you have.
|
|
20
|
+
Update this continuously, not as a last-minute save.
|
|
21
|
+
Everything here should let a post-compact Claude resume at full speed. -->
|
|
22
|
+
|
|
23
|
+
### Key Commands
|
|
24
|
+
<!-- Build, test, deploy, env setup — anything you'd need to re-run -->
|
|
25
|
+
|
|
26
|
+
### Current Workflow
|
|
27
|
+
<!-- Step-by-step: what process are you following right now?
|
|
28
|
+
e.g., "1. Edit schema → 2. Run migrate → 3. Run tests → 4. Check API"
|
|
29
|
+
Include the exact commands, flags, paths. -->
|
|
30
|
+
|
|
31
|
+
### Tools & Scripts Developed
|
|
32
|
+
<!-- Any helper scripts, one-liners, or tools created this session.
|
|
33
|
+
Include the file path and what it does. These are easy to forget. -->
|
|
34
|
+
|
|
35
|
+
### Environment State
|
|
36
|
+
<!-- What's running? What's configured? What ports? What branches?
|
|
37
|
+
e.g., "Docker compose up on port 5432, feature/auth branch checked out" -->
|
|
38
|
+
|
|
39
|
+
### Gotchas Discovered
|
|
40
|
+
<!-- Things that bit you this session. Workarounds found. Traps to avoid.
|
|
41
|
+
e.g., "pytest must be run from /src not root", "API returns 200 on error" -->
|
|
42
|
+
|
|
43
|
+
---
|
|
44
|
+
|
|
45
|
+
## Milestones
|
|
46
|
+
|
|
47
|
+
<!-- Claude: append a record below after completing each milestone.
|
|
48
|
+
DON'T just write one sentence. Each milestone should capture enough
|
|
49
|
+
detail that a future session can learn from it, not just know it happened.
|
|
50
|
+
Use the template below. -->
|
|
51
|
+
|
|
52
|
+
<!-- TEMPLATE (copy and fill for each milestone):
|
|
53
|
+
|
|
54
|
+
### [date] — [milestone title]
|
|
55
|
+
|
|
56
|
+
**What**: [what was accomplished, 2-3 sentences]
|
|
57
|
+
**How**: [approach taken, key files changed, commands used]
|
|
58
|
+
**Why this approach**: [why this way and not another — rejected alternatives]
|
|
59
|
+
**Gotchas**: [what went wrong, what was surprising, workarounds]
|
|
60
|
+
**Verification**: [how we confirmed it works — test output, manual check]
|
|
61
|
+
|
|
62
|
+
-->
|
|
63
|
+
|
|
64
|
+
---
|
|
65
|
+
|
|
66
|
+
## Key Decisions
|
|
67
|
+
|
|
68
|
+
<!-- Claude: record decisions and reasoning below when making architectural/design decisions -->
|
|
69
|
+
|
|
70
|
+
| # | Decision | Reason | Impact Scope | Date |
|
|
71
|
+
|---|----------|--------|-------------|------|
|
|
72
|
+
| | | | | |
|
|
@@ -1,23 +1,23 @@
|
|
|
1
|
-
# Project Discipline (cc-discipline framework)
|
|
2
|
-
|
|
3
|
-
This project has cc-discipline installed. Note the following at the start of each new conversation.
|
|
4
|
-
|
|
5
|
-
## Three Lines of Defense
|
|
6
|
-
1. **Rules** (`.claude/rules/`) — Auto-injected by file path; editing source code triggers checklists
|
|
7
|
-
2. **Hooks** (`.claude/hooks/`) — Run automatically before/after edits; can block operations (exit 2)
|
|
8
|
-
3. **Agents** (`.claude/agents/`) — Reviewer audits proposals; investigator performs isolated research
|
|
9
|
-
|
|
10
|
-
## Hook Behavior
|
|
11
|
-
- `pre-edit-guard.sh` — **Blocks source code edits** when there are unverified hypotheses; update docs/debug-log.md first
|
|
12
|
-
- `streak-breaker.sh` — Warns at >=3 edits to the same file, **hard stop** at >=5
|
|
13
|
-
- `post-error-remind.sh` — Injects debugging process reminder when errors are detected (via exit 2 feedback)
|
|
14
|
-
|
|
15
|
-
## Key Files
|
|
16
|
-
- `docs/progress.md` — Progress log, updated at each milestone; first thing to read after compact
|
|
17
|
-
- `docs/debug-log.md` — Debug log, hypotheses marked "pending"/"confirmed"; affects pre-edit-guard
|
|
18
|
-
|
|
19
|
-
## Core Discipline
|
|
20
|
-
- Understand before acting; don't lock onto first explanation (>=2 alternative hypotheses)
|
|
21
|
-
- 3 consecutive failures → stop and report
|
|
22
|
-
- Don't mole-whack — repeated edits to the same file means root cause not found
|
|
23
|
-
- Four debugging phases: gather → hypothesize → verify → fix; no skipping steps
|
|
1
|
+
# Project Discipline (cc-discipline framework)
|
|
2
|
+
|
|
3
|
+
This project has cc-discipline installed. Note the following at the start of each new conversation.
|
|
4
|
+
|
|
5
|
+
## Three Lines of Defense
|
|
6
|
+
1. **Rules** (`.claude/rules/`) — Auto-injected by file path; editing source code triggers checklists
|
|
7
|
+
2. **Hooks** (`.claude/hooks/`) — Run automatically before/after edits; can block operations (exit 2)
|
|
8
|
+
3. **Agents** (`.claude/agents/`) — Reviewer audits proposals; investigator performs isolated research
|
|
9
|
+
|
|
10
|
+
## Hook Behavior
|
|
11
|
+
- `pre-edit-guard.sh` — **Blocks source code edits** when there are unverified hypotheses; update docs/debug-log.md first
|
|
12
|
+
- `streak-breaker.sh` — Warns at >=3 edits to the same file, **hard stop** at >=5
|
|
13
|
+
- `post-error-remind.sh` — Injects debugging process reminder when errors are detected (via exit 2 feedback)
|
|
14
|
+
|
|
15
|
+
## Key Files
|
|
16
|
+
- `docs/progress.md` — Progress log, updated at each milestone; first thing to read after compact
|
|
17
|
+
- `docs/debug-log.md` — Debug log, hypotheses marked "pending"/"confirmed"; affects pre-edit-guard
|
|
18
|
+
|
|
19
|
+
## Core Discipline
|
|
20
|
+
- Understand before acting; don't lock onto first explanation (>=2 alternative hypotheses)
|
|
21
|
+
- 3 consecutive failures → stop and report
|
|
22
|
+
- Don't mole-whack — repeated edits to the same file means root cause not found
|
|
23
|
+
- Four debugging phases: gather → hypothesize → verify → fix; no skipping steps
|