@theglitchking/persistent-planning 3.4.2 → 3.6.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.
Files changed (58) hide show
  1. package/.claude-plugin/marketplace.json +2 -2
  2. package/.claude-plugin/plugin.json +1 -1
  3. package/.documentation/INDEX.md +5 -4
  4. package/.documentation/REGISTRY.md +2 -2
  5. package/.documentation/agents/INDEX.md +2 -2
  6. package/.documentation/agents/REGISTRY.md +2 -2
  7. package/.documentation/api/INDEX.md +2 -2
  8. package/.documentation/api/REGISTRY.md +2 -2
  9. package/.documentation/architecture/INDEX.md +2 -2
  10. package/.documentation/architecture/REGISTRY.md +2 -2
  11. package/.documentation/architecture/lg-plan-artifact-lifecycle.md +4 -3
  12. package/.documentation/backups/INDEX.md +2 -2
  13. package/.documentation/backups/REGISTRY.md +2 -2
  14. package/.documentation/database/INDEX.md +2 -2
  15. package/.documentation/database/REGISTRY.md +2 -2
  16. package/.documentation/devops/INDEX.md +2 -2
  17. package/.documentation/devops/REGISTRY.md +2 -2
  18. package/.documentation/features/INDEX.md +2 -2
  19. package/.documentation/features/REGISTRY.md +2 -2
  20. package/.documentation/knowledge-base/facts/INDEX.md +57 -0
  21. package/.documentation/knowledge-base/facts/babel-fish-hook-adds-untracked-map.md +56 -0
  22. package/.documentation/knowledge-base/facts/claude-code-grep-v-exit-status.md +55 -0
  23. package/.documentation/knowledge-base/incidents/INDEX.md +17 -0
  24. package/.documentation/knowledge-base/symptoms/INDEX.md +17 -0
  25. package/.documentation/plans/INDEX.md +2 -2
  26. package/.documentation/plans/REGISTRY.md +2 -2
  27. package/.documentation/procedures/INDEX.md +2 -2
  28. package/.documentation/procedures/REGISTRY.md +2 -2
  29. package/.documentation/quickstart/INDEX.md +2 -2
  30. package/.documentation/quickstart/REGISTRY.md +2 -2
  31. package/.documentation/reference/INDEX.md +2 -2
  32. package/.documentation/reference/REGISTRY.md +2 -2
  33. package/.documentation/security/INDEX.md +2 -2
  34. package/.documentation/security/REGISTRY.md +2 -2
  35. package/.documentation/standards/INDEX.md +3 -3
  36. package/.documentation/standards/REGISTRY.md +3 -3
  37. package/.documentation/standards/mandatory-closing-phases.md +82 -27
  38. package/.documentation/testing/INDEX.md +2 -2
  39. package/.documentation/testing/REGISTRY.md +2 -2
  40. package/.documentation/testing/test-suite.md +3 -3
  41. package/.documentation/troubleshooting/INDEX.md +4 -3
  42. package/.documentation/troubleshooting/REGISTRY.md +6 -4
  43. package/.documentation/troubleshooting/docs-closer-missing-hewtd-steps.md +57 -0
  44. package/.documentation/troubleshooting/stale-skill-dir-drift.md +6 -3
  45. package/.documentation/workflows/INDEX.md +2 -2
  46. package/.documentation/workflows/REGISTRY.md +2 -2
  47. package/CHANGELOG.md +79 -0
  48. package/commands/start-planning.md +12 -0
  49. package/package.json +1 -1
  50. package/scripts/init-atom.sh +2 -0
  51. package/scripts/init-phase.sh +53 -10
  52. package/scripts/init-planning.sh +67 -5
  53. package/scripts/init-task.sh +2 -0
  54. package/scripts/lib/planning.sh +61 -0
  55. package/skills/persistent-planning/SKILL.md +24 -5
  56. package/templates/git-workflow-section.md +11 -0
  57. package/templates/lg/phase.md +21 -5
  58. package/templates/rules/persistent-planning.md +35 -0
@@ -3,7 +3,7 @@ title: Security Documentation Index
3
3
  tier: reference
4
4
  domains: [security]
5
5
  status: active
6
- last_updated: '2026-09-04'
6
+ last_updated: '2026-09-26'
7
7
  version: '1.0.0'
8
8
  purpose: Complete listing of security documentation
9
9
  ---
@@ -40,4 +40,4 @@ This domain covers: security, auth, authentication, authorization, oauth, jwt, k
40
40
 
41
41
  ---
42
42
 
43
- *Last updated: 2026-09-04*
43
+ *Last updated: 2026-09-26*
@@ -3,7 +3,7 @@ title: Security Registry
3
3
  tier: reference
4
4
  domains: [security]
5
5
  status: active
6
- last_updated: '2026-09-04'
6
+ last_updated: '2026-09-26'
7
7
  version: '1.0.0'
8
8
  purpose: Quick reference for security documentation
9
9
  ---
@@ -35,4 +35,4 @@ purpose: Quick reference for security documentation
35
35
 
36
36
  ---
37
37
 
38
- *Last updated: 2026-09-04*
38
+ *Last updated: 2026-09-26*
@@ -3,7 +3,7 @@ title: Standards Documentation Index
3
3
  tier: reference
4
4
  domains: [standards]
5
5
  status: active
6
- last_updated: '2026-09-04'
6
+ last_updated: '2026-10-23'
7
7
  version: '1.0.0'
8
8
  purpose: Complete listing of standards documentation
9
9
  ---
@@ -26,7 +26,7 @@ purpose: Complete listing of standards documentation
26
26
  | Document | Status | Updated | Words |
27
27
  |----------|--------|---------|-------|
28
28
  | [Atom Granularity (anti-pattern guide)](atom-granularity.md) | active | 2026-05-07 | 556 |
29
- | [Mandatory Closing Phases](mandatory-closing-phases.md) | active | 2026-08-31 | 770 |
29
+ | [Mandatory Closing Phases](mandatory-closing-phases.md) | active | 2026-10-23 | 770 |
30
30
 
31
31
  ## Keywords
32
32
 
@@ -40,4 +40,4 @@ This domain covers: standard, standards, convention, conventions, pattern, patte
40
40
 
41
41
  ---
42
42
 
43
- *Last updated: 2026-09-04*
43
+ *Last updated: 2026-10-23*
@@ -3,7 +3,7 @@ title: Standards Registry
3
3
  tier: reference
4
4
  domains: [standards]
5
5
  status: active
6
- last_updated: '2026-09-04'
6
+ last_updated: '2026-10-23'
7
7
  version: '1.0.0'
8
8
  purpose: Quick reference for standards documentation
9
9
  ---
@@ -27,7 +27,7 @@ purpose: Quick reference for standards documentation
27
27
 
28
28
  ## Recently Updated
29
29
 
30
- - [Mandatory Closing Phases](mandatory-closing-phases.md) - 2026-08-31
30
+ - [Mandatory Closing Phases](mandatory-closing-phases.md) - 2026-10-23
31
31
  - [Atom Granularity (anti-pattern guide)](atom-granularity.md) - 2026-05-07
32
32
 
33
33
  ## By Status
@@ -50,4 +50,4 @@ purpose: Quick reference for standards documentation
50
50
 
51
51
  ---
52
52
 
53
- *Last updated: 2026-09-04*
53
+ *Last updated: 2026-10-23*
@@ -8,11 +8,11 @@ audience:
8
8
  tags:
9
9
  - testing
10
10
  status: active
11
- last_updated: '2026-08-31'
11
+ last_updated: '2026-10-23'
12
12
  version: 1.0.0
13
- purpose: The two phases every persistent-planning plan must end with — validate
14
- success through comprehensive testing, then a documentation pass — why they
15
- exist, how they are seeded, and how to keep them last.
13
+ purpose: The three phases every persistent-planning plan must end with — cleanup,
14
+ then validate success through comprehensive testing, then a documentation pass —
15
+ why they exist, how they are seeded, and how to keep them last.
16
16
  estimated_read_time: 4 minutes
17
17
  word_count: 770
18
18
  last_validated: '2026-08-31'
@@ -21,11 +21,12 @@ backlinks: []
21
21
 
22
22
  # Mandatory Closing Phases
23
23
 
24
- Every plan this plugin creates ends with the same two units of work, in the same
24
+ Every plan this plugin creates ends with the same three units of work, in the same
25
25
  order, no exceptions:
26
26
 
27
- 1. **Validate success through comprehensive testing**
28
- 2. **Documentation pass — create / update / deprecate as many docs as needed to capture what was done, where it lives, how to troubleshoot it**
27
+ 1. **Cleanup — remove junk and unused code this work created**
28
+ 2. **Validate success through comprehensive testing**
29
+ 3. **Documentation pass — create / update / deprecate as many docs as needed to capture what was done, where it lives, how to troubleshoot it**
29
30
 
30
31
  They are seeded into the templates so an agent never has to remember them, and
31
32
  they are marked `MANDATORY` in the artifact itself so an agent re-reading the
@@ -53,30 +54,30 @@ filesystem-as-working-memory reasoning behind the plan artifacts themselves —
53
54
 
54
55
  | Mode | Artifact | Section | Seeded as |
55
56
  |---|---|---|---|
56
- | sm | `.planning/<slug>/task_plan.md` | `## Phases` | Phase 5 and Phase 6 of 6 |
57
- | lg | `.planning/<phase-slug>/phase.md` | `## Tasks` | The last two task checkboxes |
57
+ | sm | `.planning/<slug>/task_plan.md` | `## Phases` | Phases 5, 6 and 7 of 7 |
58
+ | lg | `.planning/<phase-slug>/phase.md` | `## Tasks` | The last three task checkboxes |
58
59
 
59
- In **sm mode** the plan is a single file, so the two phases are literally the
60
- last two checkboxes under `## Phases`.
60
+ In **sm mode** the plan is a single file, so the three phases are literally the
61
+ last three checkboxes under `## Phases`.
61
62
 
62
63
  In **lg mode** the plan is a tree (phase → task → atom, see
63
- [Lg-Mode Layered Planning Guide](../architecture/lg-mode.md)). The closing pair is seeded at the
64
+ [Lg-Mode Layered Planning Guide](../architecture/lg-mode.md)). The closing group is seeded at the
64
65
  **phase** level, because a phase is the strategic unit that actually ships. Every
65
66
  phase validates its own work and documents its own work; a phase cannot be marked
66
- `done` until both closing tasks are `done`. Individual tasks and atoms do **not**
67
- each carry the pair — that would produce a documentation pass per atom, which is
67
+ `done` until all three closing tasks are `done`. Individual tasks and atoms do **not**
68
+ each carry the group — that would produce a documentation pass per atom, which is
68
69
  noise.
69
70
 
70
- Neither closing task may be marked `parallelizable: true`. They gate on
71
+ No closing task may be marked `parallelizable: true`. They gate on
71
72
  everything before them by definition.
72
73
 
73
74
  ## The ordering rule
74
75
 
75
- > New work is inserted **above** the closing pair, never after it.
76
+ > New work is inserted **above** the closing group, never after it.
76
77
 
77
- An agent adding phases to an sm plan renumbers the closing pair so they remain
78
- last (Phase 5/6 becomes Phase 7/8, and so on). An agent adding tasks to an lg
79
- phase appends them above the two closing checkboxes. The template states this
78
+ An agent adding phases to an sm plan renumbers the closing group so it remains
79
+ last (Phase 5/6/7 becomes Phase 6/7/8, and so on). An agent adding tasks to an lg
80
+ phase appends them above the three closing checkboxes. The template states this
80
81
  rule inline, directly beneath the checkboxes, so it survives the plan being read
81
82
  in isolation without this document.
82
83
 
@@ -85,6 +86,18 @@ enforceable — see [how it is tested](../testing/test-suite.md).
85
86
 
86
87
  ## What each phase actually requires
87
88
 
89
+ **Cleanup.** Remove what the work left behind: scratch and test scripts, temp
90
+ output and backups, debug and probe logging, one-off test functions, commented-out
91
+ code, and code, helpers, imports or dependencies left unused by abandoned
92
+ approaches. None of it fails a test and none of it is a doc, so neither of the
93
+ other closers catches it. Scope is only what this work created or changed — diff
94
+ against where it started — and never a refactor of code it did not touch. When
95
+ unsure whether something is used, record it in `notes.md` instead of deleting it.
96
+
97
+ Cleanup runs **first** of the three on purpose. It deletes things, so validation
98
+ has to come after it: the tests then prove every deletion safe against the code
99
+ that actually ships. Documentation stays last so it describes that final state.
100
+
88
101
  **Validate success through comprehensive testing.** Prove the work with a check
89
102
  that *fails if the change breaks*. A test that passes both before and after the
90
103
  change validates nothing. For this repository that means adding assertions to
@@ -92,21 +105,62 @@ change validates nothing. For this repository that means adding assertions to
92
105
  command is. Mutation-check the assertion at least once: break the thing on
93
106
  purpose, confirm the test goes red, put it back.
94
107
 
108
+ The templates carry the sentence "we need to validate success thoroughly through
109
+ comprehensive testing of our changes" plus an instruction to write the concrete
110
+ checks into the plan *when the plan is written*. sm: under Phase 6. lg: as atoms of
111
+ the validation task. Without that, a plan got a one-line testing phase and the
112
+ user had to say the sentence afterwards to get real tests planned. The
113
+ `persistent-planning.md` rule repeats it so it is in context every session.
114
+
95
115
  **Documentation pass.** Create, update, or deprecate every doc the change
96
116
  touches, answering: what it is, where it lives, how to fix it, how to operate it,
97
117
  and why it matters. Deprecation counts — a doc made wrong by the change is worse
98
118
  than a missing one. If [hit-em-with-the-docs](https://github.com/TheGlitchKing/hit-em-with-the-docs)
99
119
  is installed, this pass **must** go through it (`hewtd integrate`, `hewtd
100
120
  archive`, `hewtd maintain`) rather than hand-managed markdown, so the doc lands
101
- in a domain and the indexes stay honest.
121
+ in a domain and the indexes stay honest. Every variant also says to capture new
122
+ procedures, tools, troubleshooting steps, gotchas and KB articles, and **never**
123
+ to include secrets or passwords.
124
+
125
+ Like validation, the docs step asks to be filled in when the plan is written,
126
+ naming each doc, by file, that the work creates, changes or makes stale. sm: in the
127
+ note under the phase list. lg: the docs closer's first atom and the `phase.md`
128
+ note. A behaviour test showed why: without that instruction, a planner filled
129
+ the validation closer with specific checks and left the docs closer generic. It
130
+ missed the project's own feature doc, which the change made wrong.
131
+
132
+ When the project uses hit-em-with-the-docs, the init scripts word this step for
133
+ it rather than leaving "if installed" for Claude to work out. A project counts if
134
+ it has a `.documentation/` tree or `.claude/hit-em-with-the-docs.json`
135
+ (`planning_uses_hewtd`; sm has its own copy). hewtd being installed for the whole
136
+ machine does not count.
137
+
138
+ - **sm:** Phase 7 reads "Documentation pass -- a full hit-em-with-the-docs pass to
139
+ create/update/deprecate as many docs as needed to capture all our changes: new
140
+ procedures, tools, troubleshooting steps, gotchas, KB articles, etc. Never
141
+ include secrets or passwords".
142
+ - **lg:** the docs closer's list line in `phase.md` says the same thing (the
143
+ `DOCS_CLOSER_PLACEHOLDER` slot). Its task is titled "Documentation pass — full
144
+ hit-em-with-the-docs pass", and its atoms cover `hewtd integrate`/`archive`,
145
+ procedures and tools, troubleshooting, gotchas as knowledge-base facts tagged
146
+ `gotcha`, KB articles, never secrets, and `hewtd maintain --quick` + `hewtd
147
+ audit`.
148
+
149
+ Elsewhere the wording is unchanged, and lg plans no longer get the
150
+ `npx hewtd archive`/`npx hewtd audit` atoms they used to receive unconditionally.
151
+ The slug `documentation-pass-create-update-deprecate-docs` is the same in both
152
+ variants, because the completion gate and existing plans key on it. The choice is
153
+ made once, when the plan is written. A project that adopts hewtd later keeps its
154
+ existing plans' wording; new plans pick it up. See
155
+ [docs step has no hewtd steps](../troubleshooting/docs-closer-missing-hewtd-steps.md).
102
156
 
103
157
  ## How to operate it
104
158
 
105
159
  Nothing to run — the phases arrive with the plan:
106
160
 
107
161
  ```bash
108
- /start-planning "Refactor auth" # sm: task_plan.md seeded with 6 phases
109
- /start-planning "Foundation" --mode lg # lg: phase.md seeded with 2 closing tasks
162
+ /start-planning "Refactor auth" # sm: task_plan.md seeded with 7 phases
163
+ /start-planning "Foundation" --mode lg # lg: phase.md seeded with 3 closing tasks
110
164
  ```
111
165
 
112
166
  To confirm the templates still seed them correctly after editing:
@@ -119,15 +173,16 @@ npm test
119
173
 
120
174
  | Symptom | Cause | Fix |
121
175
  |---|---|---|
122
- | A new plan has only 4 phases | Plan created by persistent-planning < 3.1.0 | Append the two closing phases by hand; upgrade the plugin |
123
- | Closing phases are no longer last | Work appended below them | Move the new phases above the pair and renumber |
124
- | `npm test` fails on "documentation phase is last" | A template edit added a checkbox after the pair, or reworded the pair | Restore the ordering in `scripts/init-planning.sh` / `templates/lg/phase.md` |
125
- | Phase marked `done` with closing tasks unchecked | Skipped the gate | Not done — finish both, then mark the phase |
176
+ | A new plan has only 4 phases | Plan created by persistent-planning < 3.1.0 | Append the closing phases by hand; upgrade the plugin |
177
+ | Closing phases are no longer last | Work appended below them | Move the new phases above the group and renumber |
178
+ | A plan has validate/docs closers but no cleanup | Plan created by persistent-planning < 3.5.0 | Add a cleanup phase or task above validate by hand, or leave it — the gate is additive |
179
+ | `npm test` fails on "documentation phase is last" | A template edit added a checkbox after the group, or reworded it | Restore the ordering in `scripts/init-planning.sh` / `templates/lg/phase.md` |
180
+ | Phase marked `done` with closing tasks unchecked | Skipped the gate | Not done — finish all three, then mark the phase |
126
181
 
127
182
 
128
183
  ## How they are enforced (3.3.0+)
129
184
 
130
- In lg mode the two closers are no longer only checkbox lines. `init-phase.sh` scaffolds
185
+ In lg mode the closers are no longer only checkbox lines. `init-phase.sh` scaffolds
131
186
  each as a real task directory — `task.md` with `mandatory: true`, `notes.md`, `atoms/`,
132
187
  and seeded atoms — so they are addressable artifacts like every other task.
133
188
 
@@ -3,7 +3,7 @@ title: Testing Documentation Index
3
3
  tier: reference
4
4
  domains: [testing]
5
5
  status: active
6
- last_updated: '2026-09-04'
6
+ last_updated: '2026-09-26'
7
7
  version: '1.0.0'
8
8
  purpose: Complete listing of testing documentation
9
9
  ---
@@ -39,4 +39,4 @@ This domain covers: test, testing, tests, unit, unit-test, integration, integrat
39
39
 
40
40
  ---
41
41
 
42
- *Last updated: 2026-09-04*
42
+ *Last updated: 2026-09-26*
@@ -3,7 +3,7 @@ title: Testing Registry
3
3
  tier: reference
4
4
  domains: [testing]
5
5
  status: active
6
- last_updated: '2026-09-04'
6
+ last_updated: '2026-09-26'
7
7
  version: '1.0.0'
8
8
  purpose: Quick reference for testing documentation
9
9
  ---
@@ -48,4 +48,4 @@ purpose: Quick reference for testing documentation
48
48
 
49
49
  ---
50
50
 
51
- *Last updated: 2026-09-04*
51
+ *Last updated: 2026-09-26*
@@ -34,7 +34,7 @@ its subject.
34
34
 
35
35
  The suite is also the thing that makes the
36
36
  [mandatory closing phases](../standards/mandatory-closing-phases.md) enforceable rather than
37
- aspirational: a template edit that pushes a checkbox below the closing pair turns
37
+ aspirational: a template edit that pushes a checkbox below the closing group turns
38
38
  the suite red.
39
39
 
40
40
  ## How to run it
@@ -51,8 +51,8 @@ is non-zero if anything failed, so it drops into CI unchanged.
51
51
 
52
52
  | Group | Asserts |
53
53
  |---|---|
54
- | sm mode | `task_plan.md` + `notes.md` land at the slugified path; the plan seeds 6 phases; validation is second-to-last and documentation is last; the ordering rule text is present; the task name is substituted; re-running does not clobber an edited plan |
55
- | lg mode | `detect-mode.sh` honors the `workspace.json` override; `phase.md` + `notes.md` are created; the two closing tasks are last and in order; HEWTD `tier: plan` frontmatter is present; no `PLACEHOLDER` tokens survive rendering; `task.md` is created with the right `parent:`; atom `sequence:` auto-increments 1 → 2 |
54
+ | sm mode | `task_plan.md` + `notes.md` land at the slugified path; the plan seeds 7 phases; cleanup is third-to-last, validation second-to-last, documentation last; the ordering rule text is present; the task name is substituted; re-running does not clobber an edited plan |
55
+ | lg mode | `detect-mode.sh` honors the `workspace.json` override; `phase.md` + `notes.md` are created; the three closing tasks are last and in order; HEWTD `tier: plan` frontmatter is present; no `PLACEHOLDER` tokens survive rendering; `task.md` is created with the right `parent:`; atom `sequence:` auto-increments 1 → 2 |
56
56
  | mode guards | `init-phase.sh` exits non-zero in sm mode |
57
57
 
58
58
  Every test runs the real script against a throwaway `CLAUDE_PROJECT_DIR` created
@@ -3,7 +3,7 @@ title: Troubleshooting Documentation Index
3
3
  tier: reference
4
4
  domains: [troubleshooting]
5
5
  status: active
6
- last_updated: '2026-09-04'
6
+ last_updated: '2026-10-23'
7
7
  version: '1.0.0'
8
8
  purpose: Complete listing of troubleshooting documentation
9
9
  ---
@@ -14,7 +14,7 @@ purpose: Complete listing of troubleshooting documentation
14
14
 
15
15
  ## Overview
16
16
 
17
- - **Total Documents:** 2
17
+ - **Total Documents:** 3
18
18
  - **Domain:** `troubleshooting/`
19
19
  - **Category:** advanced
20
20
  - **Load Priority:** 6/10
@@ -25,6 +25,7 @@ purpose: Complete listing of troubleshooting documentation
25
25
 
26
26
  | Document | Status | Updated | Words |
27
27
  |----------|--------|---------|-------|
28
+ | [A plan's docs step has no hit-em-with-the-docs steps](docs-closer-missing-hewtd-steps.md) | active | 2026-10-23 | 224 |
28
29
  | [A plan won't read COMPLETE](plan-never-reads-complete.md) | active | 2026-09-04 | 264 |
29
30
  | [Stale skill directory — commands run frozen code](stale-skill-dir-drift.md) | active | 2026-09-04 | 403 |
30
31
 
@@ -40,4 +41,4 @@ This domain covers: troubleshooting, troubleshoot, debug, debugging, issue, issu
40
41
 
41
42
  ---
42
43
 
43
- *Last updated: 2026-09-04*
44
+ *Last updated: 2026-10-23*
@@ -3,7 +3,7 @@ title: Troubleshooting Registry
3
3
  tier: reference
4
4
  domains: [troubleshooting]
5
5
  status: active
6
- last_updated: '2026-09-04'
6
+ last_updated: '2026-10-23'
7
7
  version: '1.0.0'
8
8
  purpose: Quick reference for troubleshooting documentation
9
9
  ---
@@ -16,17 +16,19 @@ purpose: Quick reference for troubleshooting documentation
16
16
 
17
17
  | Metric | Value |
18
18
  |--------|-------|
19
- | Documents | 2 |
19
+ | Documents | 3 |
20
20
  | Category | advanced |
21
21
  | Load Priority | 6/10 |
22
22
 
23
23
  ## Active Documents
24
24
 
25
+ - [A plan's docs step has no hit-em-with-the-docs steps](docs-closer-missing-hewtd-steps.md)
25
26
  - [A plan won't read COMPLETE](plan-never-reads-complete.md)
26
27
  - [Stale skill directory — commands run frozen code](stale-skill-dir-drift.md)
27
28
 
28
29
  ## Recently Updated
29
30
 
31
+ - [A plan's docs step has no hit-em-with-the-docs steps](docs-closer-missing-hewtd-steps.md) - 2026-10-23
30
32
  - [A plan won't read COMPLETE](plan-never-reads-complete.md) - 2026-09-04
31
33
  - [Stale skill directory — commands run frozen code](stale-skill-dir-drift.md) - 2026-09-04
32
34
 
@@ -34,7 +36,7 @@ purpose: Quick reference for troubleshooting documentation
34
36
 
35
37
  | Status | Count |
36
38
  |--------|-------|
37
- | active | 2 |
39
+ | active | 3 |
38
40
  | draft | 0 |
39
41
  | deprecated | 0 |
40
42
  | archived | 0 |
@@ -50,4 +52,4 @@ purpose: Quick reference for troubleshooting documentation
50
52
 
51
53
  ---
52
54
 
53
- *Last updated: 2026-09-04*
55
+ *Last updated: 2026-10-23*
@@ -0,0 +1,57 @@
1
+ ---
2
+ title: A plan's docs step has no hit-em-with-the-docs steps
3
+ tier: guide
4
+ domains:
5
+ - troubleshooting
6
+ audience:
7
+ - developers
8
+ tags: []
9
+ status: active
10
+ last_updated: '2026-10-23'
11
+ version: 1.0.0
12
+ purpose: Why a new plan in a hit-em-with-the-docs project got the generic docs step, and how to fix it.
13
+ estimated_read_time: 2 minutes
14
+ word_count: 224
15
+ last_validated: '2026-10-23'
16
+ backlinks: []
17
+ ---
18
+
19
+ # A plan's docs step has no hit-em-with-the-docs steps
20
+
21
+ ## Symptom
22
+
23
+ The project uses hit-em-with-the-docs, but a new plan's last step is the generic
24
+ one. sm: `Phase 7: Documentation pass -- create/update/deprecate as many docs as
25
+ needed to capture what was done…`. lg: the docs closer has no `hewtd audit`,
26
+ gotcha or KB-article atoms. The full hit-em-with-the-docs pass wording is missing.
27
+
28
+ ## Cause
29
+
30
+ The init scripts choose the wording once, when the plan is written. They use the
31
+ hewtd variant only when the **project** has a `.documentation/` tree or
32
+ `.claude/hit-em-with-the-docs.json`. Common reasons it wasn't chosen:
33
+
34
+ - **hewtd is only installed for the machine** (e.g. a marketplace install).
35
+ That's deliberate: otherwise every repo you plan in would get hewtd steps.
36
+ - **The plan predates the docs tree.** The project adopted hewtd after the plan
37
+ was written. Existing plans are never rewritten.
38
+ - **`CLAUDE_PROJECT_DIR` points somewhere else.** The scripts look in
39
+ `CLAUDE_PROJECT_DIR`, falling back to the current directory, not the git root.
40
+
41
+ ## Fix
42
+
43
+ 1. Check what the scripts see:
44
+ ```bash
45
+ ls -d "${CLAUDE_PROJECT_DIR:-$PWD}/.documentation" \
46
+ "${CLAUDE_PROJECT_DIR:-$PWD}/.claude/hit-em-with-the-docs.json"
47
+ ```
48
+ 2. If neither exists, set the project up with hit-em-with-the-docs (that creates
49
+ `.documentation/`), then start the plan again.
50
+ 3. For a plan that already exists, edit its last step by hand. sm: the Phase 7
51
+ line. lg: the docs closer's line in `phase.md` and its atoms. Or re-create it with
52
+ `PLANNING_FORCE=1` if nothing in it is worth keeping. Keep the lg slug
53
+ `documentation-pass-create-update-deprecate-docs`, because the completion gate
54
+ depends on it.
55
+
56
+ See [mandatory closing phases](../standards/mandatory-closing-phases.md) for the
57
+ two variants.
@@ -32,11 +32,14 @@ fixed in 3.2.0.
32
32
  A generated `task_plan.md` ends at Phase 4. A correct one ends:
33
33
 
34
34
  ```
35
- - [ ] Phase 5: Validate success through comprehensive testing (MANDATORY)
36
- - [ ] Phase 6: Documentation pass -- create/update/deprecate as many docs as needed to capture what was done, where it lives, how to troubleshoot it, etc. etc.. etc.. (MANDATORY)
35
+ - [ ] Phase 5: Cleanup -- remove junk and unused code this work created: scratch/test scripts, debug files, probe logging, one-off test functions, commented-out code, dead code from abandoned approaches (MANDATORY)
36
+ - [ ] Phase 6: Validate success through comprehensive testing -- we need to validate success thoroughly through comprehensive testing of our changes (MANDATORY)
37
+ - [ ] Phase 7: Documentation pass -- create/update/deprecate as many docs as needed to capture what was done, where it lives, how to troubleshoot it, etc. etc.. etc.. (MANDATORY)
37
38
  ```
38
39
 
39
- and carries an `## On Completion` section naming `/plan-status` and `/archive-plan`.
40
+ (In a project that uses hit-em-with-the-docs, Phase 7 reads as a full hit-em-with-the-docs pass instead —
41
+ see [mandatory closing phases](../standards/mandatory-closing-phases.md).) It also
42
+ carries an `## On Completion` section naming `/plan-status` and `/archive-plan`.
40
43
 
41
44
  ## Cause
42
45
 
@@ -3,7 +3,7 @@ title: Workflows Documentation Index
3
3
  tier: reference
4
4
  domains: [workflows]
5
5
  status: active
6
- last_updated: '2026-09-04'
6
+ last_updated: '2026-09-26'
7
7
  version: '1.0.0'
8
8
  purpose: Complete listing of workflows documentation
9
9
  ---
@@ -40,4 +40,4 @@ This domain covers: workflow, workflows, process, processes, flow, flowchart, se
40
40
 
41
41
  ---
42
42
 
43
- *Last updated: 2026-09-04*
43
+ *Last updated: 2026-09-26*
@@ -3,7 +3,7 @@ title: Workflows Registry
3
3
  tier: reference
4
4
  domains: [workflows]
5
5
  status: active
6
- last_updated: '2026-09-04'
6
+ last_updated: '2026-09-26'
7
7
  version: '1.0.0'
8
8
  purpose: Quick reference for workflows documentation
9
9
  ---
@@ -35,4 +35,4 @@ purpose: Quick reference for workflows documentation
35
35
 
36
36
  ---
37
37
 
38
- *Last updated: 2026-09-04*
38
+ *Last updated: 2026-09-26*
package/CHANGELOG.md CHANGED
@@ -2,6 +2,85 @@
2
2
 
3
3
  All notable changes to this project will be documented in this file.
4
4
 
5
+ ## [3.6.0] - 2026-10-23
6
+
7
+ ### Added — a full hit-em-with-the-docs pass as the last step, when the project uses it
8
+
9
+ When the project has `.documentation/` or `.claude/hit-em-with-the-docs.json`, the
10
+ plan's last step reads "Documentation pass -- a full hit-em-with-the-docs pass to
11
+ create/update/deprecate as many docs as needed to capture all our changes: new
12
+ procedures, tools, troubleshooting steps, gotchas, KB articles, etc. Never include
13
+ secrets or passwords". lg's docs closer also gets hewtd atoms: integrate/archive,
14
+ gotchas as KB facts, KB articles, never secrets, `maintain --quick` + `audit`.
15
+ A machine-wide hewtd install does not count.
16
+
17
+ - **Fixed:** lg plans in projects without hewtd no longer get the unconditional
18
+ `npx hewtd archive` / `npx hewtd audit` atoms.
19
+ - Every variant's note now says to capture procedures, tools, troubleshooting,
20
+ gotchas and KB articles, and never secrets or passwords.
21
+ - The docs step asks to be filled in when the plan is written, naming each doc
22
+ the work creates, changes or makes stale (lg: the closer's first atom). In a
23
+ behaviour test, the docs closer was otherwise left generic.
24
+ - Projects without hewtd: the sm Phase 7 line and the lg closer line are
25
+ byte-identical to before. The slug is unchanged.
26
+
27
+ ### Changed — the validation closer asks for the tests when the plan is written
28
+
29
+ The validate step now reads "we need to validate success thoroughly through
30
+ comprehensive testing of our changes". It also tells Claude to write the
31
+ concrete checks into the plan up front, without being asked: unit,
32
+ integration/end-to-end, regression, edge cases and failure paths, and the full
33
+ suite. sm: Phase 6 line and note. lg: `phase.md` note plus two new leading atoms
34
+ on the validation task. The `persistent-planning.md` rule and SKILL.md carry it
35
+ too. Titles and slugs are unchanged, so existing plans and the completion gate
36
+ are unaffected.
37
+
38
+ ### Added — init scripts seed `.claude/rules/`
39
+
40
+ Every init script (`init-planning.sh`, `init-phase.sh`, `init-task.sh`,
41
+ `init-atom.sh`) copies each `templates/rules/*.md` into the project's
42
+ `.claude/rules/` when that file is absent, so Claude Code loads the planning
43
+ workflow every session instead of only when the skill triggers. Ships one rule,
44
+ `persistent-planning.md`. A rule is written once and never overwritten — not even
45
+ under `PLANNING_FORCE` — so a repo's edits stick; delete it and the next init
46
+ restores it. Adding a rule is adding a file to `templates/rules/`.
47
+
48
+ The same step adds a **Persistent plans** section of hard git requirements — sync
49
+ `main`, cut a branch, implement through to completion, commit at the end of each
50
+ phase, finish with a single PR. It is appended to the repo's existing git workflow
51
+ rule (any `.claude/rules/` file named like `git-workflow.md` or `gitflow.md`,
52
+ including babel-fish's) or, if there is none, creates `git-workflow.md`. A marker
53
+ comment keeps it to one copy.
54
+
55
+ ## [3.5.0] - 2026-09-26
56
+
57
+ ### Added — a mandatory cleanup closer at the end of every phase (#20)
58
+
59
+ Every plan now ends with three mandatory closers instead of two:
60
+
61
+ 1. **Cleanup — remove junk and unused code** (new)
62
+ 2. Validate success through comprehensive testing
63
+ 3. Documentation pass
64
+
65
+ Agent-driven work reliably leaves debris: scratch and test scripts, temp
66
+ output, probe logging, one-off test functions, commented-out code, and code or
67
+ imports left unused by abandoned approaches. None of it fails a test and none
68
+ of it is a doc, so neither existing closer caught it.
69
+
70
+ Cleanup runs *first* of the three so validation proves every deletion safe, and
71
+ docs describe the final state. Its scope is only what the phase created or
72
+ changed; uncertain items go in `notes.md` instead of being deleted.
73
+
74
+ - **lg**: `init-phase.sh` scaffolds `cleanup-remove-junk-and-unused-code/` as a
75
+ real task dir with `mandatory: true` and seeded atoms, third-to-last in
76
+ `phase.md`. Insertion and the completion gate needed no change — new tasks
77
+ already land above the first `MANDATORY` entry, and `plan-status.sh` already
78
+ gates on every `mandatory: true` task.
79
+ - **sm**: `task_plan.md` gains Phase 5 Cleanup; validate and docs renumber to 6
80
+ and 7. This is a deliberate change to the v2 sm template, as #5 was.
81
+
82
+ Existing plans are untouched; they simply lack the third closer.
83
+
5
84
  ## [3.4.2] - 2026-09-05
6
85
 
7
86
  ### Changed — the local `update` guard moves upstream into the runtime
@@ -100,6 +100,18 @@ bash ~/.claude/skills/persistent-planning/scripts/init-planning.sh "<name>"
100
100
 
101
101
  Add tasks under a phase with `/start-task "<name>" --parent <phase-slug>`.
102
102
 
103
+ ### Both modes
104
+ In a project that uses hit-em-with-the-docs (it has `.documentation/`), the last step
105
+ is worded as a full hit-em-with-the-docs pass: capture all changes, including procedures,
106
+ tools, troubleshooting, gotchas and KB articles, and never secrets.
107
+
108
+ `.claude/rules/persistent-planning.md` is added if the project does not already have
109
+ it. It is never overwritten, so edit it freely.
110
+
111
+ A "Persistent plans" git section (sync main, branch, commit per phase, one PR) is
112
+ appended once to the project's existing git workflow rule, or `.claude/rules/git-workflow.md`
113
+ is created to hold it.
114
+
103
115
  ## Slug conversion
104
116
 
105
117
  Names are converted to URL-friendly slugs:
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@theglitchking/persistent-planning",
3
- "version": "3.4.2",
3
+ "version": "3.6.0",
4
4
  "description": "Persistent markdown-based planning with task directories, progress tracking, and context engineering for multi-step Claude Code workflows",
5
5
  "type": "module",
6
6
  "bin": {
@@ -137,6 +137,8 @@ planning_insert_list_item \
137
137
  "## Atoms" \
138
138
  "- [ ] **${ATOM_NAME}** (\`atoms/${ATOM_SLUG}.md\`, sequence: ${NEXT_SEQUENCE})"
139
139
 
140
+ planning_seed_rules "${ROOT}"
141
+
140
142
  echo ""
141
143
  planning_ok "Atom '${ATOM_NAME}' ready"
142
144
  echo ""