create-pathfinder 1.8.0 → 2.0.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 (44) hide show
  1. package/AGENTS.md +3 -1
  2. package/CLAUDE.md +20 -0
  3. package/README.md +383 -65
  4. package/context/ai-interaction.md +78 -39
  5. package/context/coding-standards.md +119 -60
  6. package/copy-list.json +1 -0
  7. package/package.json +2 -1
  8. package/roles/developer.md +37 -0
  9. package/roles/planner.md +38 -0
  10. package/roles/tester.md +40 -0
  11. package/skills/challenge-me/SKILL.md +11 -7
  12. package/skills/complete-feature/SKILL.md +16 -11
  13. package/skills/handoff/SKILL.md +24 -4
  14. package/skills/kickstart-pathfinder/SKILL.md +6 -1
  15. package/skills/learning-review/SKILL.md +9 -6
  16. package/skills/load-feature/SKILL.md +21 -11
  17. package/skills/prototype/SKILL.md +3 -1
  18. package/skills/quiz-me/SKILL.md +33 -7
  19. package/skills/review-feature/SKILL.md +19 -11
  20. package/skills/role/SKILL.md +33 -0
  21. package/skills/setup-tracker/SKILL.md +29 -61
  22. package/skills/start-feature/SKILL.md +19 -16
  23. package/skills/sync-tracker/SKILL.md +67 -106
  24. package/skills/teach-architecture/SKILL.md +6 -5
  25. package/skills/teach-feature/SKILL.md +11 -8
  26. package/skills/to-specs/SKILL.md +40 -28
  27. package/skills/whereami/SKILL.md +87 -0
  28. package/src/cli.mjs +2 -1
  29. package/src/install.mjs +5 -1
  30. package/src/kit.mjs +70 -1
  31. package/templates/CHANGELOG.template.md +2 -1
  32. package/templates/feature-spec.template.md +18 -80
  33. package/templates/history.template.md +12 -0
  34. package/templates/lesson.template.md +22 -51
  35. package/templates/project-overview.template.md +80 -145
  36. package/context/current-feature.md +0 -46
  37. package/context/features/example-feature-spec.md +0 -103
  38. package/context/history.md +0 -14
  39. package/context/learning/learner-profile.md +0 -35
  40. package/context/learning/lessons/.gitkeep +0 -0
  41. package/context/learning/progress.md +0 -28
  42. package/context/project-overview.md +0 -211
  43. package/templates/progress-entry.template.md +0 -23
  44. package/templates/tracker.template.md +0 -359
@@ -1,49 +1,61 @@
1
1
  ---
2
2
  name: to-specs
3
- description: Convert approved project context into small sequential feature specs optimized for focused LLM context and reliable delivery.
3
+ description: Turn approved direction into small, clear Feature specs.
4
4
  ---
5
5
 
6
6
  # To Specs
7
7
 
8
- ## Readiness Check
8
+ Turn approved direction into the minimum Feature specs needed to implement it.
9
9
 
10
- Confirm:
10
+ ## Process
11
11
 
12
- - MVP and first useful flow are defined
13
- - critical stack and workflow choices are approved or deliberately deferred
14
- - required prototype direction is approved
15
- - known verification methods exist or are explicitly deferred
16
- - no material context contradictions remain
12
+ 1. Read the approved project context and relevant existing Features.
13
+ 2. Stop if a required human decision is still `TBD`.
14
+ 3. Decide whether the work is one Feature or needs a small number of Features.
15
+ 4. Create `context/features/` if it does not exist.
16
+ 5. Create each Feature from `templates/feature-spec.template.md`, named
17
+ `NN-feature-name.md` — see Naming below.
18
+ 6. Fill only information that materially helps implementation and review.
19
+ 7. Present the created Features and recommend which one to start first.
20
+ 8. If `context/tracker.md` exists, offer to publish them with `sync-tracker`.
21
+ Do nothing here if it does not.
17
22
 
18
- If not ready, report the blockers instead of inventing decisions.
23
+ ## Naming
19
24
 
20
- ## Sizing Principles
25
+ A Feature spec is named `NN-feature-name.md` in the spec source, for example
26
+ `context/features/27-export-saved-searches.md`.
21
27
 
22
- Each feature should:
28
+ `NN` is the Feature number: the next unused number in the spec source, counting
29
+ every spec already there whatever its status. Numbers are never reused and never
30
+ renumbered, because a published tracker item is matched on that number and
31
+ renumbering would orphan it.
23
32
 
24
- - create one visible or system-verifiable outcome
25
- - fit one focused branch/change set under the project's workflow
26
- - be independently reviewable and verifiable
27
- - require a coherent, bounded set of context
28
- - state dependencies, assumptions, and exclusions
29
- - contain stable delivery chunks
33
+ The number lives in the filename and nowhere else. The Feature template carries
34
+ no number field, and nothing else in the spec records one.
30
35
 
31
- Split a feature when it mixes several systems, requires a repo-wide mental model, combines infrastructure with unrelated UX/polish, or cannot be verified independently.
36
+ ## Sizing
32
37
 
33
- ## Output
38
+ Prefer one Feature when the work is coherent.
34
39
 
35
- Create only the coherent MVP roadmap in `context/features/`, using `templates/feature-spec.template.md` and project-selected naming/delivery policies.
40
+ Split only when separate outcomes:
36
41
 
37
- Each spec must include Context Boundary, Delivery Chunks, and Learning Targets.
42
+ - can be implemented or reviewed independently
43
+ - depend on meaningfully different context
44
+ - have a real dependency between them
45
+ - would make one Feature unnecessarily difficult to understand
38
46
 
39
- Write a `## Tags` section only when the project has configured work tracking and its `context/tracker.md` defines tag namespaces. Use the values that config already lists, never invented ones. No tags is a valid and common answer — omit the section rather than guessing.
47
+ Prefer fewer Features and fewer artifacts.
40
48
 
41
- After creation, summarize file, outcome, dependency, visible/verifiable win, context risk, and recommended first feature.
42
-
43
- If `context/tracker.md` exists, offer to publish the new specs with `sync-tracker`. If it does not, say nothing about tracking.
49
+ Use delivery chunks inside a Feature before creating additional Features.
44
50
 
45
51
  ## Rules
46
52
 
47
- - Do not implement or install packages.
48
- - Do not assume UI, mobile, a framework, a branch type, or conventional commits.
49
- - Do not plan the entire dream product.
53
+ - Do not implement.
54
+ - Do not invent unresolved decisions.
55
+ - Do not plan beyond the approved direction.
56
+ - Do not add workflow metadata that the Feature template does not require.
57
+ - Do not create tickets, tracker items, or extra planning files by default.
58
+ - Do not scan unrelated repository areas.
59
+
60
+ When implementation details are unclear, inspect only enough source code to
61
+ write an accurate Feature.
@@ -0,0 +1,87 @@
1
+ ---
2
+ name: whereami
3
+ description: Report a compact read-only snapshot of the current Pathfinder work session.
4
+ ---
5
+
6
+ # Where Am I
7
+
8
+ Answer one question: what is this session working on right now?
9
+
10
+ Use it when a session resumes, after a long gap, or before deciding the next
11
+ action. It reports state. It never changes it.
12
+
13
+ ## Process
14
+
15
+ 1. Role: report the role activated in this session via `/role`.
16
+ Roles are session state and are never written to disk, so if no role was
17
+ activated in this conversation, report `none`. Do not search `roles/`.
18
+ 2. Read `context/current-feature.md` if it exists.
19
+ Take Feature, Active chunk, and Next from it verbatim. The Feature number is
20
+ the `NN` recorded there, from its spec filename.
21
+ If the file is missing or still holds template placeholders, report `none`.
22
+ 3. Run `git status --short --branch` once.
23
+ Report the branch/ref, and `clean` or the count of changed paths.
24
+ 4. Compare the Git section of `context/current-feature.md` with step 3.
25
+ Report a drift line only if the recorded branch differs from the real one.
26
+ 5. Context telemetry: report it only if this harness exposes it.
27
+ Otherwise `unavailable`. Do not estimate.
28
+
29
+ ## Output
30
+
31
+ Exactly this shape, one line each:
32
+
33
+ ```
34
+ Role: <role | none>
35
+ Feature: <## — name | none>
36
+ Chunk: <number and name | none>
37
+ Git: <branch/ref> — <clean | N changed>
38
+ Context: <telemetry | unavailable>
39
+ Next: <single next action | none>
40
+ ```
41
+
42
+ Add at most one line after it, and only when step 4 found drift:
43
+
44
+ ```
45
+ Drift: current-feature.md records <branch>, working tree is on <branch>
46
+ ```
47
+
48
+ Then stop.
49
+
50
+ ## Rules
51
+
52
+ - Read only. No writes, no commits, no `git` command that mutates anything.
53
+ - Read at most one file: `context/current-feature.md`.
54
+ - Do not open the feature spec, history, roadmap, `.features/`, or source.
55
+ - Report `none` or `unavailable` instead of inferring a missing value.
56
+ - Do not offer to fix drift, update state, or start the next action.
57
+ The human decides what happens after the snapshot.
58
+
59
+ ## Example
60
+
61
+ `/whereami` after resuming mid-feature:
62
+
63
+ ```
64
+ Role: developer
65
+ Feature: 12 — export saved searches
66
+ Chunk: 2 — CSV writer
67
+ Git: feature/12-export-saved-searches — 3 changed
68
+ Context: unavailable
69
+ Next: Verify the CSV writer against the acceptance criteria
70
+ ```
71
+
72
+ ## Anti-example
73
+
74
+ Do not do this:
75
+
76
+ ```
77
+ Role: developer (inferred from recent commits)
78
+ Feature: 12 — export saved searches
79
+ Chunk: 3 — probably the download endpoint
80
+ Git: feature/12-export-saved-searches — 3 changed
81
+ Context: ~60% used
82
+ Next: I can update current-feature.md and start chunk 3 — want me to?
83
+ ```
84
+
85
+ It guesses the role from history, invents a chunk the spec never named,
86
+ estimates telemetry it cannot see, and turns a status report into a proposal
87
+ to write state.
package/src/cli.mjs CHANGED
@@ -205,7 +205,8 @@ export async function run(
205
205
  // as it goes.
206
206
  //
207
207
  // Planning adapters this early is safe, and specifically because of what the
208
- // copy list contains: AGENTS.md, CLAUDE.md, context, skills, and templates.
208
+ // copy list contains: AGENTS.md, CLAUDE.md, context, roles, skills, and
209
+ // templates.
209
210
  // No entry writes into `.claude/` or `.agents/`, so the copy cannot change
210
211
  // the answer `planAdapters` gives about an adapter path, and the canonical
211
212
  // skills it reads come from the kit rather than from the destination. If a
package/src/install.mjs CHANGED
@@ -16,7 +16,7 @@
16
16
  import { copyFileSync, existsSync, mkdirSync, readFileSync, readdirSync, statSync, writeFileSync } from "node:fs";
17
17
  import { dirname, join, relative, sep } from "node:path";
18
18
 
19
- import { COPY_LIST, isExcluded } from "./kit.mjs";
19
+ import { COPY_LIST, isExcluded, neverShips } from "./kit.mjs";
20
20
  import {
21
21
  ADAPTER_STATE,
22
22
  adapterPath,
@@ -43,6 +43,10 @@ export function planInstall(kitRoot, targetRoot, { force = false } = {}) {
43
43
  for (const entry of COPY_LIST) {
44
44
  for (const source of walkFiles(join(kitRoot, entry))) {
45
45
  const relativePath = relative(kitRoot, source).split(sep).join("/");
46
+ // Filtered here rather than in walkFiles, which sees basenames only and
47
+ // would have to guess whether a `tracker.md` is *the* one.
48
+ if (neverShips(relativePath)) continue;
49
+
46
50
  const destination = join(targetRoot, relativePath);
47
51
  const exists = existsSync(destination);
48
52
 
package/src/kit.mjs CHANGED
@@ -8,7 +8,7 @@
8
8
  */
9
9
 
10
10
  import { existsSync, readFileSync } from "node:fs";
11
- import { dirname, join, resolve } from "node:path";
11
+ import { dirname, join, relative, resolve, sep } from "node:path";
12
12
  import { fileURLToPath } from "node:url";
13
13
 
14
14
  const HERE = dirname(fileURLToPath(import.meta.url));
@@ -49,6 +49,75 @@ export function isExcluded(basename) {
49
49
  return EXCLUDED.has(basename) || basename.startsWith("._");
50
50
  }
51
51
 
52
+ /**
53
+ * Kit files that are deliberately not part of the kit, by kit-relative path.
54
+ *
55
+ * A different idea from EXCLUDED above, and kept separate for that reason.
56
+ * Those are OS and editor droppings that were never anybody's file. These are
57
+ * real, hand-written files that live inside a copy-list directory and must
58
+ * still never reach a destination project.
59
+ *
60
+ * All three are this repository's own working state, and every one of them
61
+ * would be actively wrong in somebody else's project.
62
+ *
63
+ * `context/tracker.md` is the original case. Work Tracking's off switch is the
64
+ * *absence* of that file in a destination project, so shipping this
65
+ * repository's own copy would hand every new project a configuration naming a
66
+ * tracker it does not own, pointing at a spec directory it does not have, with
67
+ * the off switch already defeated on first install.
68
+ *
69
+ * `context/current-feature.md` and `context/handoff.md` are transient session
70
+ * state, and they are here for the same reason one step further on: the kit
71
+ * stopped shipping a blank `current-feature.md` stencil, because `load-feature`
72
+ * writes the real one on first use and a placeholder is just a file a reader
73
+ * has to recognise as empty. Having stopped shipping the blank one, the thing
74
+ * to guard against is shipping a *filled-in* one — a destination project
75
+ * opening its first session to a note about whichever feature a Pathfinder
76
+ * maintainer had loaded on the day of the release.
77
+ *
78
+ * `context` is a *directory* entry in the copy list, so anything placed beneath
79
+ * it ships by default. Making the invariant enforced rather than intended is
80
+ * the same move `check_no_junk_tracked` made: an ignore rule is advisory, one
81
+ * `git add -f` defeats it, and `stage-kit.mjs` copies from the working tree
82
+ * without consulting it at all.
83
+ *
84
+ * Matched on the kit-relative path, never the basename — a project's own
85
+ * `tracker.md` somewhere else is not this file and must not be caught by it.
86
+ */
87
+ const NEVER_SHIPS = new Set([
88
+ "context/tracker.md",
89
+ "context/current-feature.md",
90
+ "context/handoff.md",
91
+ ]);
92
+
93
+ /**
94
+ * Is this kit-relative path one the kit must never hand over?
95
+ *
96
+ * @param {string} relativePath forward-slashed, relative to the kit root
97
+ */
98
+ export function neverShips(relativePath) {
99
+ return NEVER_SHIPS.has(relativePath);
100
+ }
101
+
102
+ /**
103
+ * A `cpSync` filter that drops never-ships files from a recursive copy.
104
+ *
105
+ * Lives here rather than inline in `stage-kit.mjs` so the staging path and its
106
+ * test run the same code. A test that rebuilds the predicate proves only that
107
+ * `cpSync` honours `filter`; it cannot catch the path arithmetic below going
108
+ * wrong, which is the part with anything to get wrong in it.
109
+ *
110
+ * `cpSync` hands the filter absolute paths and calls it for the copy root
111
+ * itself, so the root resolves to `""` and is kept — filtering a directory out
112
+ * would take its whole subtree with it.
113
+ *
114
+ * @param {string} rootDir absolute path the kit-relative paths are relative to
115
+ * @returns {(source: string) => boolean} true to copy, false to skip
116
+ */
117
+ export function neverShipsFilter(rootDir) {
118
+ return (source) => !neverShips(relative(rootDir, source).split(sep).join("/"));
119
+ }
120
+
52
121
  const PACKAGE_ROOT = resolve(HERE, "..");
53
122
 
54
123
  /**
@@ -1,6 +1,7 @@
1
1
  # Changelog
2
2
 
3
- Use this file only when the destination project adopts a changelog.
3
+ Use only when the project adopts a changelog.
4
+ Record user-facing changes, not implementation history.
4
5
 
5
6
  ## [Unreleased]
6
7
 
@@ -2,104 +2,42 @@
2
2
 
3
3
  ## Status
4
4
 
5
- Not Started
6
-
7
- ## Overview
8
-
9
- Describe the smallest coherent outcome, where it fits, and why it matters.
10
-
11
- ## Problem
12
-
13
- - What is missing, risky, confusing, inaccessible, unreliable, or inefficient?
14
- - Who or what is affected?
15
- - Why does this matter now?
5
+ Proposed
16
6
 
17
7
  ## Goal
18
8
 
19
- State one user-visible or system-verifiable outcome.
20
-
21
- ## Dependencies
9
+ [One clear user-visible or system-verifiable outcome.]
22
10
 
23
- - Earlier feature, system, decision, prototype, or `None`.
11
+ ## Context
24
12
 
25
- ## Tags
13
+ Include only what materially helps someone implement this Feature.
26
14
 
27
- - Optional. `namespace:value`, e.g. `area:cli`, `type:infra`, `agent:suitable`.
28
- - Omit this section entirely, or write `None`, when the project does not use tags. Most do not.
29
- - Only meaningful when the project has configured work tracking; nothing else reads them.
15
+ - Read: `[specific files, sections, or systems]`
16
+ - Relevant area: `[path or component]`
17
+ - Avoid: `[unrelated area, if useful]`
30
18
 
31
19
  ## Requirements
32
20
 
33
- - Requirement 1
34
- - Requirement 2
35
- - Requirement 3
36
- - Include relevant failure, permission, loading, empty, retry, responsive, accessibility, operational, or compatibility states only when applicable.
21
+ - `[required behavior]`
22
+ - `[important constraint]`
23
+ - `[relevant edge or failure behavior, when applicable]`
37
24
 
38
25
  ## Out of Scope
39
26
 
40
- - Explicit exclusion
41
- - Later feature, if known
42
- - Unrelated refactors, dependencies, or polish
43
-
44
- ## Experience or Operational Notes — When Applicable
45
-
46
- - User interaction, system behavior, responsive behavior, accessibility, observability, performance, security, or operational expectations.
47
-
48
- ## Technical Notes
49
-
50
- Likely areas:
51
-
52
- - `[specific path or bounded area]`
53
-
54
- Implementation constraints:
55
-
56
- - Follow project context and approved prototype direction.
57
- - Do not silently resolve open architecture decisions.
58
- - Keep prototype and production code boundaries explicit.
59
-
60
- ## Context Boundary
61
-
62
- Read:
63
-
64
- - `[specific context and code]`
65
-
66
- Avoid loading:
67
-
68
- - `[unrelated systems, old specs, generated output]`
69
-
70
- Split this feature further if its required context is not focused enough for reliable implementation and verification.
27
+ - `[explicit exclusion]`
71
28
 
72
29
  ## Delivery Chunks
73
30
 
74
- 1. `[stable, verifiable increment]`
75
- 2. `[stable, verifiable increment]`
76
- 3. `[optional stable increment]`
31
+ 1. `[small, stable, verifiable increment]`
32
+ 2. `[next increment, if needed]`
77
33
 
78
- Each chunk should leave the project stable.
34
+ Use one chunk when the Feature is already small.
79
35
 
80
36
  ## Acceptance Criteria
81
37
 
82
- - The defined outcome works end to end within scope.
83
- - Relevant failure and edge behavior is handled.
84
- - Applicable quality requirements are met.
85
- - Required automated/manual checks pass.
86
- - The work can be reviewed independently.
87
-
88
- ## Verification
89
-
90
- - Manual or operational checks:
91
- - Automated checks:
92
- - Edge cases:
93
- - Quality checks:
94
-
95
- ## Learning Targets
96
-
97
- - Concepts worth explaining after completion:
98
- - Diagram or demonstration opportunity:
99
- - Quiz ideas:
38
+ - `[observable result proving the Feature works]`
39
+ - `[important verification result]`
100
40
 
101
- ## Suggested Delivery Metadata
41
+ ## Notes / Decisions
102
42
 
103
- - Git action: `[follow project workflow]`
104
- - Suggested branch, when applicable: `[project naming convention]`
105
- - Suggested commit, when applicable: `[project convention]`
43
+ - `[Feature-specific dependency, approved decision, constraint, or None]`
@@ -0,0 +1,12 @@
1
+ # Project History
2
+
3
+ Compact record of completed work.
4
+
5
+ ## Completed
6
+
7
+ ### [YYYY-MM-DD] — [Feature or milestone]
8
+
9
+ - Outcome: `[what changed for the project/user]`
10
+ - Verification: `[brief result or evidence pointer]`
11
+ - Commit/PR: `[sha, PR, or release reference]`
12
+ - Follow-up: `[only if something remains, otherwise none]`
@@ -1,71 +1,42 @@
1
1
  # Lesson — [Feature Name]
2
2
 
3
3
  - Date:
4
- - Branch:
5
- - Feature spec:
6
- - Commit or diff range:
7
- - Difficulty:
8
- - Estimated review time:
4
+ - Feature:
5
+ - Commit/diff:
9
6
 
10
- ## 1. Feature in One Minute
7
+ ## What Changed
11
8
 
12
- What changed, why it exists, and the user or system value it creates.
9
+ Explain what was implemented and why it matters.
13
10
 
14
- ## 2. Mental Model
11
+ ## Mental Model
15
12
 
16
- Explain the feature through one clear model. Include a small Mermaid diagram when useful.
13
+ Explain the simplest useful way to understand the Feature.
17
14
 
18
- ## 3. Execution and Data Flow
15
+ Include a small diagram only when it helps.
19
16
 
20
- Trace one representative interaction from input to visible result.
17
+ ## How It Works
21
18
 
22
- ## 4. Important Files
19
+ Trace one representative flow through the implementation.
23
20
 
24
- | File | Responsibility | Why it matters |
25
- | --- | --- | --- |
21
+ ## Important Files
26
22
 
27
- ## 5. Key Decisions and Tradeoffs
23
+ | File | Responsibility |
24
+ | --- | --- |
28
25
 
29
- For each meaningful decision:
26
+ Include only files that materially help understanding.
30
27
 
31
- - Decision
32
- - Evidence in the repository
33
- - Benefit
34
- - Cost
35
- - Credible alternative
36
- - When the alternative would be better
28
+ ## Key Decisions
37
29
 
38
- ## 6. Concepts Worth Retaining
30
+ - `[important decision and why it was made]`
39
31
 
40
- Limit this to the most transferable concepts.
32
+ Include only decisions worth remembering.
41
33
 
42
- ## 7. Quality Lens
34
+ ## Concepts to Retain
43
35
 
44
- ### Testing
36
+ - `[transferable concept]`
45
37
 
46
- ### Accessibility
38
+ ## Check Your Understanding
47
39
 
48
- ### Performance
49
-
50
- ### Maintainability
51
-
52
- ### Error and edge states
53
-
54
- ## 8. Production-Scale Gap
55
-
56
- What would need to change for higher traffic, larger datasets, multiple teams, stricter security, or real-time collaboration?
57
-
58
- ## 9. Interview Preparation
59
-
60
- - Likely question:
61
- - Strong answer outline:
62
- - Follow-up question:
63
- - Vocabulary to use carefully:
64
-
65
- ## 10. Check Your Understanding
66
-
67
- Three short retrieval questions. Do not include answers here.
68
-
69
- ## 11. Suggested Next Action
70
-
71
- Choose one: quiz, challenge, architecture lesson, spaced review, or no further work.
40
+ 1. `[question]`
41
+ 2. `[question]`
42
+ 3. `[question]`