create-pathfinder 1.4.0 → 1.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.
Files changed (42) hide show
  1. package/AGENTS.md +4 -0
  2. package/CLAUDE.md +7 -1
  3. package/README.md +97 -9
  4. package/bin/create-pathfinder.mjs +32 -4
  5. package/context/features/example-feature-spec.md +5 -1
  6. package/context/project-overview.md +16 -3
  7. package/copy-list.json +0 -1
  8. package/package.json +2 -2
  9. package/skills/reflect/SKILL.md +46 -46
  10. package/skills/reverse-engineer/SKILL.md +2 -0
  11. package/skills/to-specs/SKILL.md +1 -1
  12. package/src/cli.mjs +765 -34
  13. package/src/clipboard.mjs +134 -0
  14. package/src/detect.mjs +183 -0
  15. package/src/editor.mjs +136 -0
  16. package/src/git.mjs +58 -0
  17. package/src/harnesses/adapter.mjs +288 -0
  18. package/src/harnesses/index.mjs +122 -0
  19. package/src/install.mjs +209 -1
  20. package/src/kickstart-prompt.mjs +81 -0
  21. package/src/prompt.mjs +307 -0
  22. package/templates/project-overview.template.md +16 -3
  23. package/prompts/01-kickstart-project.md +0 -1
  24. package/prompts/01-teach-current-feature.md +0 -9
  25. package/prompts/02-debate-me.md +0 -1
  26. package/prompts/02-quiz-current-feature.md +0 -7
  27. package/prompts/03-challenge-current-feature.md +0 -7
  28. package/prompts/03-prototype.md +0 -1
  29. package/prompts/04-teach-current-architecture.md +0 -7
  30. package/prompts/04-to-specs.md +0 -1
  31. package/prompts/05-learning-review.md +0 -5
  32. package/prompts/05-load-feature.md +0 -1
  33. package/prompts/06-start-feature.md +0 -1
  34. package/prompts/07-review-feature.md +0 -1
  35. package/prompts/08-complete-feature.md +0 -1
  36. package/prompts/09-learn-feature.md +0 -1
  37. package/prompts/10-learn-codebase.md +0 -1
  38. package/prompts/11-handoff.md +0 -1
  39. package/prompts/12-skillsmith.md +0 -1
  40. package/prompts/13-reverse-engineer.md +0 -18
  41. package/prompts/14-reflect.md +0 -13
  42. package/prompts/15-debug-issue.md +0 -15
package/AGENTS.md CHANGED
@@ -5,3 +5,7 @@ Read `CLAUDE.md` first.
5
5
  Project truth lives in `context/`. Follow the technology and delivery choices documented in `context/project-overview.md`; do not assume a framework, package manager, branch model, or release process.
6
6
 
7
7
  Use the smallest relevant context for the active task. Keep each delivery chunk stable, reviewable, and verifiable.
8
+
9
+ Canonical skills live under `skills/` and are the only behavior contract; anything under `.claude/skills/` or `.agents/skills/` is a generated pointer to one, so edit the canonical file and regenerate the adapter.
10
+
11
+ If this tool has no native skill discovery, invoke a skill by reading its canonical file directly: `Use skills/<name>/SKILL.md and follow it exactly.` That is the whole fallback — there is no launcher file, and no second copy of a skill to find.
package/CLAUDE.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # Project Agent Guide
2
2
 
3
- This repository uses an AI-assisted, human-in-the-loop workflow. Project truth lives in `context/`, reusable behaviors live in `skills/`, and manual launchers live in `prompts/`.
3
+ This repository uses an AI-assisted, human-in-the-loop workflow. Project truth lives in `context/`, and reusable behaviors live in `skills/`.
4
4
 
5
5
  ## Read only what is needed
6
6
 
@@ -48,6 +48,12 @@ Ask before actions identified in `context/ai-interaction.md`, especially depende
48
48
  - Prefer concrete verification over confident narration.
49
49
  - Report conflicts between specs, repository reality, and durable context.
50
50
 
51
+ ## Canonical skills and harness adapters
52
+
53
+ Canonical Pathfinder skills are tool-neutral and live under `skills/`. Harness-specific representations — `.claude/skills/`, `.agents/skills/` — are generated integration artifacts and must not become independent behavior contracts. Edit the canonical file; regenerate the adapter.
54
+
55
+ An adapter carries the canonical skill's frontmatter and a pointer to it, and nothing else. If an adapter and its canonical skill disagree, the canonical skill is correct.
56
+
51
57
  ## Available skills
52
58
 
53
59
  - `kickstart-pathfinder` — discover and initialize project context
package/README.md CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  **An AI-assisted, human-in-the-loop workflow for building software — without giving up the decisions.**
4
4
 
5
- This package installs [Pathfinder](https://github.com/rikilamadrid/pathfinder) into a Git repository you already have.
5
+ This package installs [Pathfinder](https://github.com/rikilamadrid/pathfinder) into a Git repository — one you already have, or one it offers to create for you.
6
6
 
7
7
  ```bash
8
8
  npx create-pathfinder
@@ -17,16 +17,21 @@ Do not install packages or write product code yet.
17
17
 
18
18
  ## What it installs
19
19
 
20
- Pathfinder is a kit of context files and skills — not a framework. There is no runtime, no dependency, and nothing to build. The installer copies six things into your repository and nothing else:
20
+ Pathfinder is a kit of context files and skills — not a framework. There is no runtime, no dependency, and nothing to build. The installer copies five things into your repository and nothing else:
21
21
 
22
22
  | Path | What it is |
23
23
  | --- | --- |
24
24
  | `AGENTS.md`, `CLAUDE.md` | Entry files that tell an agent how to work in the project |
25
25
  | `context/` | Project truth — overview, standards, interaction rules, current feature |
26
26
  | `skills/` | Twenty skills covering discovery, specs, delivery, debugging, review, and learning |
27
- | `prompts/` | Manual launchers for tools that do not discover local skills |
28
27
  | `templates/` | Starting points the project copies when it needs them |
29
28
 
29
+ On request it also writes one thing it does not copy:
30
+
31
+ | Path | What it is |
32
+ | --- | --- |
33
+ | `.claude/skills/`, `.agents/skills/` | **Generated** — a small adapter per skill, derived from `skills/` at install time, so your coding tool discovers them natively. Not part of the five above; see [Native skills for your coding tool](#native-skills-for-your-coding-tool) |
34
+
30
35
  It never copies Pathfinder's own `README.md`, `CHANGELOG.md`, CI configuration, or brand assets. Your repository gets the workflow, not the project that maintains it.
31
36
 
32
37
  ## What it will not do to your repository
@@ -34,22 +39,105 @@ It never copies Pathfinder's own `README.md`, `CHANGELOG.md`, CI configuration,
34
39
  This runs once, in real code, so it is deliberately timid:
35
40
 
36
41
  - **It never overwrites.** Files that already exist are left exactly as they are and listed by name in the summary. Pass `--force` if you actually want them replaced.
37
- - **It refuses to run outside a Git repository**, so whatever it writes is reviewable and undoable.
38
- - **`--dry-run` reports the same plan the real install would carry out**, without writing anything.
42
+ - **It will not install outside a Git repository**, so whatever it writes is reviewable and undoable. In an empty directory it offers to run `git init` for you — and that is the only Git command it will ever run. No `add`, no `commit`, no config, no branch. If you say no, nothing is written.
43
+ - **It never touches an existing history.** A directory that is already a repository, or inside one, is never asked about and never initialized.
44
+ - **`--dry-run` reports the same plan the real install would carry out**, including any `git init`, without writing anything.
45
+ - **It owns a generated adapter, and nothing else in your tool's directory.** A file at `.claude/skills/<name>/SKILL.md` or `.agents/skills/<name>/SKILL.md` belongs to the installer only if that name is a Pathfinder skill *and* the file carries the `pathfinder:adapter` marker it wrote. Your `settings.json`, `settings.local.json`, agents, commands, hooks, and any skill of your own are never read and never written, a file you wrote at an adapter path is left alone and named in the summary, and nothing is ever deleted.
46
+
47
+ **Re-running `npx create-pathfinder` in a project that already has Pathfinder is safe, requires no flags, and is idempotent.** Canonical files you have edited are skipped and listed; files new in this version are written; adapters are regenerated, byte-identical if nothing changed; anything you own is untouched. That is how a project installed before v1.5.0 gains adapters — one ordinary run, no migration command.
48
+
49
+ ## Native skills for your coding tool
50
+
51
+ Pathfinder's skills are tool-neutral files at `skills/<name>/SKILL.md`. Some coding tools discover skills natively from their own directory, and the installer can generate small adapters there so you get `/reflect` instead of pasting a path.
52
+
53
+ ```bash
54
+ npx create-pathfinder --agents claude-code,codex
55
+ ```
56
+
57
+ | Id | Writes to | Invoked as |
58
+ | --- | --- | --- |
59
+ | `claude-code` | `.claude/skills/<name>/SKILL.md` | `/reflect` |
60
+ | `codex` | `.agents/skills/<name>/SKILL.md` | `/skills`, or `$reflect` |
61
+
62
+ Each adapter is a few lines long: it carries the skill's name and description, and tells the tool to read the canonical file. Both harnesses get the same bytes at a different path — the behavior lives in one place, and the adapter never restates it.
63
+
64
+ Pick one, both, or neither. Choosing one never generates, removes, or claims anything under the other's directory, and Pathfinder never writes to a personal skills directory such as `$HOME/.agents/skills`.
65
+
66
+ In a terminal you are asked instead of passing the flag — a numbered list, comma-separated, `Enter` for the tools found on your machine, `0` for none. Each option shows the directory it writes to before you choose it.
67
+
68
+ The list has a third entry, **Something else…**, and it generates nothing. Name your tool and the summary says so plainly, because a `.mdc` file Cursor half-reads or a `SKILL.md` in a directory nothing scans would be a file your tool ignores under a summary claiming success. Two things do work for any tool: the kit installs `AGENTS.md` at the repository root, which Codex, Cursor, and several others read, and any agent can be given the line the adapters delegate to anyway — `Use skills/<name>/SKILL.md and follow it exactly.`
69
+
70
+ Nothing is configured unless you choose it. Detection only sets the default, a piped or scripted run configures nothing at all unless `--agents` says so, and `--agents` accepts only the ids in the table above — an unknown one exits 2 rather than quietly installing nothing.
71
+
72
+ **What the installer owns, and what it will not touch:**
73
+
74
+ - **It owns a file at `<tool>/skills/<name>/SKILL.md` only if that name is a Pathfinder skill *and* the file carries the `pathfinder:adapter` marker it wrote.** Those it regenerates freely, with no flag — that is how an older install gains adapters by re-running.
75
+ - **A file you wrote at one of those paths is left alone** and listed by name in the summary. `--force` replaces it; nothing else does.
76
+ - **Everything else under that directory is never read and never written** — your `settings.json`, `settings.local.json`, agents, commands, hooks, and any skill of your own.
77
+ - **Nothing is ever deleted.** An adapter for a skill a newer version no longer ships is reported and left in place.
78
+
79
+ Re-running is idempotent: the second run writes the same bytes and reports the adapters as already up to date.
39
80
 
40
- Re-running it is safe, and fills in only what is missing.
81
+ ## The Kickstart prompt, and your clipboard
82
+
83
+ Every install ends by printing the one prompt that starts a session, and the prompt follows the tool you chose:
84
+
85
+ | Configured | Prompt |
86
+ | --- | --- |
87
+ | `claude-code` | `/kickstart-pathfinder` |
88
+ | `codex` | `$kickstart-pathfinder` |
89
+ | both, or neither | `Use skills/kickstart-pathfinder/SKILL.md. Help me initialize this project. Do not install packages or write product code yet.` |
90
+
91
+ Two harnesses fall back to the neutral form because one clipboard cannot hold two syntaxes, and picking a favorite would quietly decide which of your tools is the real one.
92
+
93
+ In a terminal you are then asked whether to copy it. The question says what it replaces, because your clipboard is yours:
94
+
95
+ ```text
96
+ ? Copy that prompt to your clipboard? This replaces what is on it now. [Y/n]
97
+ ```
98
+
99
+ - **Nothing is copied without an explicit yes.** Declining, an unanswered question, `--no-clipboard`, `--yes`, `--dry-run`, and any run without a terminal on both ends all leave your clipboard exactly as it was.
100
+ - **The prompt is printed either way.** Copying is a convenience, never the only way to get it, which is what lets every failure be a non-event.
101
+ - **No dependency, and no clipboard is ever read.** The copy uses whatever your system already has — `pbcopy`, `clip.exe` including under WSL, or `wl-copy`, `xclip`, or `xsel` — chosen by what is actually installed rather than by your platform's name. If none of them is there, or one of them fails, the installer says so in one line and still exits 0.
102
+
103
+ ## Opening the project
104
+
105
+ The last question is whether to open the project, and it is only ever about an editor you already have. The installer looks for `code` (VS Code) and `cursor` (Cursor) on your `PATH`:
106
+
107
+ - **One found** — a yes/no naming it: `? Open this project in VS Code? [Y/n]`
108
+ - **Several found** — a numbered list, alphabetical, ending in `Don't open`
109
+ - **None found** — no question at all
110
+
111
+ Neither editor is a Pathfinder requirement, and the alphabetical order is not a recommendation. Nothing else can be launched: there is no way to name an editor or pass a path, because an editor the installer did not find is one it cannot honestly offer.
112
+
113
+ The launch is detached — the installer hands over the project directory and exits immediately, so it never waits for your editor and never prints your editor's output as its own.
114
+
115
+ - **Nothing is launched without an explicit yes.** Declining, an unanswered question, `Don't open`, `--no-open`, `--yes`, `--dry-run`, and any run without a terminal on both ends all leave your screen alone.
116
+ - **A failed launch is not a failed install.** If the binary is there but cannot be run, the installer says so in one line, tells you the directory to open yourself, and still exits 0. The install already succeeded; opening it was a convenience.
41
117
 
42
118
  ## Options
43
119
 
44
120
  | Option | Effect |
45
121
  | --- | --- |
46
- | `--dry-run` | Report what would be written; change nothing |
47
- | `--force` | Overwrite files that already exist |
122
+ | `--agents <ids>` | Generate skill adapters for these tools, comma-separated. Valid ids: `claude-code`, `codex`. Alias: `--agent` |
123
+ | `--dry-run` | Report what would be written, and any `git init` that would run first; change nothing |
124
+ | `--force` | Overwrite files that already exist, and replace a file you wrote at a path an adapter would occupy |
125
+ | `--git-init` | Run `git init` here if this is not a repository yet |
126
+ | `--no-git-init` | Never run `git init`; refuse instead |
127
+ | `--no-clipboard` | Never offer to copy the Kickstart prompt. The prompt is printed either way |
128
+ | `--no-open` | Never offer to open the project in an editor |
129
+ | `--yes`, `--no-input` | Take the defaults and ask nothing. It does not authorize `git init`, configure any tool, touch your clipboard, or open an editor — pass `--git-init` and `--agents` for the first two |
48
130
  | `-h`, `--help` | Show usage |
49
131
 
132
+ Questions are asked only when stdin and stdout are both terminals. Piped, redirected, or in CI, nothing is asked and nothing is prompted for — so a directory that is not a repository needs `--git-init`, or the install is refused, no tool is configured without `--agents`, the clipboard is never touched at all, and no editor is ever launched.
133
+
50
134
  ## Requirements
51
135
 
52
- Node 18 or newer, and a Git repository. No dependencies this package installs nothing into your project's `node_modules`, and has none of its own.
136
+ Node 18 or newer, and a Git repository — though the installer will offer to create one for you.
137
+
138
+ The `git` binary is only needed to *create* that repository. Inside one that already exists, the installer finds it by walking the filesystem for `.git` and never runs Git at all, so it works on a machine where `git` is not on your `PATH`.
139
+
140
+ No dependencies — this package installs nothing into your project's `node_modules`, and has none of its own.
53
141
 
54
142
  ## Links
55
143
 
@@ -1,8 +1,36 @@
1
1
  #!/usr/bin/env node
2
2
  import { run } from "../src/cli.mjs";
3
+ import { createPrompter } from "../src/prompt.mjs";
3
4
 
4
- process.exitCode = run(process.argv.slice(2), {
5
- cwd: process.cwd(),
6
- out: (text) => process.stdout.write(text),
7
- err: (text) => process.stderr.write(text),
5
+ // Everything the CLI learns about the outside world arrives through this call.
6
+ // `run` reads no globals of its own, so a test can hand it a synthesized
7
+ // environment a Windows PATH, an absent $HOME, a terminal that is not one —
8
+ // without touching the process it runs in.
9
+ //
10
+ // The TTY guard is decided here, once, and both ends must be terminals: a
11
+ // question needs somewhere to be printed *and* someone able to answer it.
12
+ // `create-pathfinder < /dev/null` in a terminal is not interactive, and neither
13
+ // is a run whose stdout is a pipe.
14
+ const interactive = Boolean(process.stdin.isTTY) && Boolean(process.stdout.isTTY);
15
+
16
+ const prompter = createPrompter({
17
+ input: process.stdin,
18
+ output: process.stdout,
19
+ interactive,
8
20
  });
21
+
22
+ try {
23
+ process.exitCode = await run(process.argv.slice(2), {
24
+ cwd: process.cwd(),
25
+ out: (text) => process.stdout.write(text),
26
+ err: (text) => process.stderr.write(text),
27
+ env: process.env,
28
+ platform: process.platform,
29
+ stdoutIsTTY: Boolean(process.stdout.isTTY),
30
+ prompter,
31
+ });
32
+ } finally {
33
+ // An open reader holds stdin open, and a process with an open stdin does not
34
+ // exit. Closed on every path, including the ones that refused.
35
+ prompter.close();
36
+ }
@@ -1,4 +1,8 @@
1
- # [Feature Name]
1
+ # Example Feature Spec
2
+
3
+ > A worked example of the shape `to-specs` writes into this folder. Real
4
+ > specs are new files here, titled with the feature's own name; copy
5
+ > `templates/feature-spec.template.md` to start one.
2
6
 
3
7
  ## Status
4
8
 
@@ -1,9 +1,10 @@
1
- # [Project Name] — Project Overview
1
+ # Project Overview
2
2
 
3
3
  > Describe the product, audience, intended feeling, and reason it should exist.
4
4
 
5
5
  ## Status
6
6
 
7
+ - Project: `[Project Name]`
7
8
  - Stage: `[idea / prototype / MVP / production / maintenance]`
8
9
  - Repo type: `[new / existing / application / library / service / monorepo / other]`
9
10
  - Primary goal: `[success definition]`
@@ -11,11 +12,23 @@
11
12
 
12
13
  ## Decision States
13
14
 
15
+ These four words describe a decision:
16
+
14
17
  - `TBD` — human decision required
15
18
  - `None` — intentionally excluded
16
19
  - `N/A` — not applicable
17
20
  - `Deferred` — intentionally postponed
18
21
 
22
+ ## Record Status
23
+
24
+ A `Status` column describes the record, not the decision:
25
+
26
+ - `proposed` — written down, not yet approved by the human
27
+ - `accepted` — approved by the human
28
+ - `superseded` — replaced by a later decision, kept for history
29
+
30
+ The two answer different questions. `TBD` says nobody has decided yet. `proposed` says something was recorded for the human to approve. A recorded proposal is not an approved decision.
31
+
19
32
  ## Product Vision
20
33
 
21
34
  - Problem:
@@ -55,9 +68,9 @@ starting state -> action/process -> useful result -> reason to return or continu
55
68
 
56
69
  ## Recommended and Approved Technology
57
70
 
58
- Recommendations may be proposed by `debate-me`; approved choices belong here.
71
+ Recommended and approved choices both live here. `debate-me` and `kickstart-pathfinder` may record a choice before the human approves it; that row is marked `proposed` in `Status` and stays that way until it is `accepted`. Leave `Status` empty while the choice is still `TBD`.
59
72
 
60
- | Layer | Approved choice | Reason | Status |
73
+ | Layer | Choice | Reason | Status |
61
74
  | --- | --- | --- | --- |
62
75
  | Platform/runtime | `TBD` | | |
63
76
  | Language(s) | `TBD` | | |
package/copy-list.json CHANGED
@@ -4,7 +4,6 @@
4
4
  "AGENTS.md",
5
5
  "CLAUDE.md",
6
6
  "context",
7
- "prompts",
8
7
  "skills",
9
8
  "templates"
10
9
  ]
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "create-pathfinder",
3
- "version": "1.4.0",
3
+ "version": "1.5.0",
4
4
  "description": "Install the Pathfinder AI-assisted, human-in-the-loop workflow kit into a Git repository.",
5
5
  "keywords": [
6
6
  "pathfinder",
@@ -34,11 +34,11 @@
34
34
  "AGENTS.md",
35
35
  "CLAUDE.md",
36
36
  "context",
37
- "prompts",
38
37
  "skills",
39
38
  "templates"
40
39
  ],
41
40
  "scripts": {
41
+ "test": "node --test",
42
42
  "stage": "node scripts/stage-kit.mjs",
43
43
  "unstage": "node scripts/stage-kit.mjs --clean",
44
44
  "prepack": "node scripts/stage-kit.mjs",
@@ -50,9 +50,9 @@ And:
50
50
 
51
51
  ---
52
52
 
53
- # Part 1 — Reflect on the work
53
+ ## Part 1 — Reflect on the work
54
54
 
55
- ## 1. Reconstruct what happened
55
+ ### 1. Reconstruct what happened
56
56
 
57
57
  Review the relevant work and available evidence.
58
58
 
@@ -73,7 +73,7 @@ Do not rely on vague recollection when repository evidence is available.
73
73
 
74
74
  Distinguish what actually happened from what was intended to happen.
75
75
 
76
- ## 2. Identify learning signals
76
+ ### 2. Identify learning signals
77
77
 
78
78
  Look specifically for:
79
79
 
@@ -96,11 +96,11 @@ Success alone is not evidence that the workflow was good.
96
96
 
97
97
  Failure alone is not evidence that the workflow must change.
98
98
 
99
- ## 3. Separate local knowledge from reusable learning
99
+ ### 3. Separate local knowledge from reusable learning
100
100
 
101
101
  Classify each finding as one of:
102
102
 
103
- ### PROJECT
103
+ #### PROJECT
104
104
 
105
105
  Specific to this repository, stack, business domain, architecture, environment, or team.
106
106
 
@@ -113,7 +113,7 @@ Examples:
113
113
  * this service must start before another service
114
114
  * a framework-specific workaround is required
115
115
 
116
- ### WORKFLOW CANDIDATE
116
+ #### WORKFLOW CANDIDATE
117
117
 
118
118
  Potentially useful across unrelated projects.
119
119
 
@@ -125,7 +125,7 @@ Examples:
125
125
  * an undocumented dependency should have been discovered during system analysis
126
126
  * the agent repeatedly needed human correction for something the workflow could have surfaced earlier
127
127
 
128
- ### NOISE
128
+ #### NOISE
129
129
 
130
130
  Interesting but not useful enough to preserve.
131
131
 
@@ -133,7 +133,7 @@ Discard it.
133
133
 
134
134
  Not every observation deserves memory.
135
135
 
136
- ## 4. Test generality
136
+ ### 4. Test generality
137
137
 
138
138
  For every WORKFLOW CANDIDATE ask:
139
139
 
@@ -149,7 +149,7 @@ If the lesson fails these tests, keep it project-specific.
149
149
 
150
150
  Generalize behavior, not technology.
151
151
 
152
- ## 5. Check for existing coverage
152
+ ### 5. Check for existing coverage
153
153
 
154
154
  Before proposing anything new, inspect the existing Pathfinder workflow and skills.
155
155
 
@@ -169,41 +169,41 @@ Avoid duplicate skills.
169
169
 
170
170
  Do not respond to every failure by adding another instruction.
171
171
 
172
- ## 6. Require evidence
172
+ ### 6. Require evidence
173
173
 
174
174
  Every proposed Pathfinder improvement must include:
175
175
 
176
- ### Observation
176
+ #### Observation
177
177
 
178
178
  What happened?
179
179
 
180
- ### Evidence
180
+ #### Evidence
181
181
 
182
182
  What concrete part of the execution demonstrates it?
183
183
 
184
- ### Generalization
184
+ #### Generalization
185
185
 
186
186
  Why could this recur outside this project?
187
187
 
188
- ### Current gap
188
+ #### Current gap
189
189
 
190
190
  Why does Pathfinder not already handle it?
191
191
 
192
- ### Proposed change
192
+ #### Proposed change
193
193
 
194
194
  What is the smallest change that would address it?
195
195
 
196
- ### Risk
196
+ #### Risk
197
197
 
198
198
  How could this rule become harmful, redundant, overly restrictive, or too specific?
199
199
 
200
- ### Validation
200
+ #### Validation
201
201
 
202
202
  How could future work demonstrate that the improvement actually helped?
203
203
 
204
204
  Do not promote intuition into workflow policy without evidence.
205
205
 
206
- ## 7. Prefer the smallest durable improvement
206
+ ### 7. Prefer the smallest durable improvement
207
207
 
208
208
  Possible outcomes include:
209
209
 
@@ -222,7 +222,7 @@ An improvement should remove more uncertainty than complexity it introduces.
222
222
 
223
223
  ---
224
224
 
225
- # Part 2 — Reflect on Reflect
225
+ ## Part 2 — Reflect on Reflect
226
226
 
227
227
  Reflect is subject to the same evidence standard it applies to Pathfinder.
228
228
 
@@ -234,7 +234,7 @@ Its purpose is not to endlessly rewrite Reflect.
234
234
 
235
235
  Its purpose is to discover whether Reflect systematically failed to do its own job.
236
236
 
237
- ## 8. Evaluate reflection quality
237
+ ### 8. Evaluate reflection quality
238
238
 
239
239
  Ask:
240
240
 
@@ -255,11 +255,11 @@ Do not search for a self-improvement merely because this section exists.
255
255
 
256
256
  "No improvement needed" is a valid and desirable result.
257
257
 
258
- ## 9. Identify Reflect improvement candidates
258
+ ### 9. Identify Reflect improvement candidates
259
259
 
260
260
  If the reflection process itself demonstrated a meaningful weakness, classify it as:
261
261
 
262
- ### REFLECT IMPROVEMENT CANDIDATE
262
+ #### REFLECT IMPROVEMENT CANDIDATE
263
263
 
264
264
  This classification is reserved for improvements to `reflect/SKILL.md` itself.
265
265
 
@@ -267,23 +267,23 @@ Do not use it for general Pathfinder improvements.
267
267
 
268
268
  For each candidate provide:
269
269
 
270
- ### Observed weakness
270
+ #### Observed weakness
271
271
 
272
272
  What was inadequate about Reflect's behavior or reasoning?
273
273
 
274
- ### Evidence
274
+ #### Evidence
275
275
 
276
276
  What concrete output, omission, human correction, or repeated failure demonstrates the weakness?
277
277
 
278
- ### Root cause
278
+ #### Root cause
279
279
 
280
280
  What part of the current Reflect process allowed the weakness?
281
281
 
282
- ### Proposed change
282
+ #### Proposed change
283
283
 
284
284
  What is the smallest change to `reflect/SKILL.md` that could improve future reflections?
285
285
 
286
- ### Regression risk
286
+ #### Regression risk
287
287
 
288
288
  Could the change make Reflect:
289
289
 
@@ -295,7 +295,7 @@ Could the change make Reflect:
295
295
  * excessively conservative
296
296
  * more expensive in context or execution time
297
297
 
298
- ### Validation
298
+ #### Validation
299
299
 
300
300
  What future behavior would demonstrate that the modification actually improved Reflect?
301
301
 
@@ -303,11 +303,11 @@ Do not recursively optimize stylistic preferences, wording preferences, or isola
303
303
 
304
304
  Self-improvements must materially improve reflection quality.
305
305
 
306
- ## 10. Evidence levels for self-improvement
306
+ ### 10. Evidence levels for self-improvement
307
307
 
308
308
  Treat evidence for changes to Reflect according to three levels:
309
309
 
310
- ### Level 1 — Incident
310
+ #### Level 1 — Incident
311
311
 
312
312
  One reflection exposed a plausible weakness.
313
313
 
@@ -315,13 +315,13 @@ This may justify an improvement candidate.
315
315
 
316
316
  It does not establish a general pattern.
317
317
 
318
- ### Level 2 — Pattern
318
+ #### Level 2 — Pattern
319
319
 
320
320
  The same weakness has appeared across multiple reflections or required repeated human correction.
321
321
 
322
322
  This provides stronger justification for changing Reflect.
323
323
 
324
- ### Level 3 — Validation
324
+ #### Level 3 — Validation
325
325
 
326
326
  A proposed change addresses the weakness and subsequent reflections demonstrate better behavior without obvious regression.
327
327
 
@@ -331,7 +331,7 @@ When history is available, prefer patterns over isolated incidents.
331
331
 
332
332
  Do not fabricate historical evidence.
333
333
 
334
- ## 11. Bound the recursion
334
+ ### 11. Bound the recursion
335
335
 
336
336
  Reflect may perform only one self-evaluation pass per invocation.
337
337
 
@@ -355,9 +355,9 @@ Recursive improvement should accumulate evidence across executions, not consume
355
355
 
356
356
  ---
357
357
 
358
- # Promotion rules
358
+ ## Promotion rules
359
359
 
360
- ## Pathfinder improvements
360
+ ### Pathfinder improvements
361
361
 
362
362
  Reflect proposes.
363
363
 
@@ -365,7 +365,7 @@ Humans promote.
365
365
 
366
366
  Do not silently modify Pathfinder's workflow, AGENTS.md, skills, templates, principles, or other durable guidance unless explicitly asked to implement an accepted recommendation.
367
367
 
368
- ## Reflect self-improvements
368
+ ### Reflect self-improvements
369
369
 
370
370
  The same rule applies to Reflect itself.
371
371
 
@@ -379,21 +379,21 @@ It raises it.
379
379
 
380
380
  ---
381
381
 
382
- # Output
382
+ ## Output
383
383
 
384
384
  Return only sections that contain meaningful information.
385
385
 
386
386
  Do not inflate the output to satisfy the template.
387
387
 
388
- ## What happened
388
+ ### What happened
389
389
 
390
390
  A concise reconstruction of the relevant execution.
391
391
 
392
- ## What we learned
392
+ ### What we learned
393
393
 
394
394
  The important findings and supporting evidence.
395
395
 
396
- ## Classification
396
+ ### Classification
397
397
 
398
398
  For each meaningful finding:
399
399
 
@@ -403,13 +403,13 @@ For each meaningful finding:
403
403
 
404
404
  Omit trivial noise when it adds no value.
405
405
 
406
- ## Pathfinder gaps
406
+ ### Pathfinder gaps
407
407
 
408
408
  Only genuine gaps not already covered.
409
409
 
410
410
  If none exist, say so.
411
411
 
412
- ## Recommended changes
412
+ ### Recommended changes
413
413
 
414
414
  Rank recommendations from highest to lowest value.
415
415
 
@@ -423,11 +423,11 @@ For each recommendation provide:
423
423
  * validation approach
424
424
  * confidence
425
425
 
426
- ## No-change findings
426
+ ### No-change findings
427
427
 
428
428
  Mention important observations that should not modify Pathfinder and explain why.
429
429
 
430
- ## Reflect self-evaluation
430
+ ### Reflect self-evaluation
431
431
 
432
432
  Briefly assess whether this reflection process itself performed adequately.
433
433
 
@@ -437,7 +437,7 @@ If no material weakness was discovered, state:
437
437
 
438
438
  Do not invent one.
439
439
 
440
- ## Reflect improvement candidates
440
+ ### Reflect improvement candidates
441
441
 
442
442
  Include this section only when evidence supports changing `reflect/SKILL.md`.
443
443
 
@@ -454,7 +454,7 @@ For each candidate provide:
454
454
 
455
455
  ---
456
456
 
457
- # Principles
457
+ ## Principles
458
458
 
459
459
  > Execution is evidence.
460
460
 
@@ -183,6 +183,7 @@ Do not silently run or imitate the responsibilities of those skills.
183
183
 
184
184
  Use only the sections that add value:
185
185
 
186
+ ```markdown
186
187
  # Reverse-Engineering Report
187
188
 
188
189
  ## Objective
@@ -220,6 +221,7 @@ Complexity, accessibility, performance, maintenance, legal, or fidelity concerns
220
221
  ## Recommended Pathfinder Handoff
221
222
 
222
223
  The appropriate next skill, if any, and why.
224
+ ```
223
225
 
224
226
  ## Rules
225
227
 
@@ -32,7 +32,7 @@ Split a feature when it mixes several systems, requires a repo-wide mental model
32
32
 
33
33
  ## Output
34
34
 
35
- Create only the coherent MVP roadmap in `context/features/`, using the example template and project-selected naming/delivery policies.
35
+ Create only the coherent MVP roadmap in `context/features/`, using `templates/feature-spec.template.md` and project-selected naming/delivery policies.
36
36
 
37
37
  Each spec must include Context Boundary, Delivery Chunks, and Learning Targets.
38
38