@punks/cli 2.1.9 → 2.1.11

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 (63) hide show
  1. package/README.md +1 -1
  2. package/dist/data/catalog/hooks.ts +8 -0
  3. package/dist/data/catalog/packs.ts +11 -3
  4. package/dist/data/catalog/skills.ts +48 -0
  5. package/dist/data/catalog/tools.ts +9 -1
  6. package/dist/data/hooks/scaffold-update-check.mjs +181 -0
  7. package/dist/data/hooks.test.ts +17 -0
  8. package/dist/data/scripts/sync-subagents.mjs +104 -32
  9. package/dist/data/subagents/manifest.mjs +120 -0
  10. package/dist/index.js +600 -85
  11. package/dist/skills/agnostic/cli/dp-cli/SKILL.md +3 -3
  12. package/dist/skills/agnostic/cli/dp-cli/references/commands.md +1 -1
  13. package/dist/skills/agnostic/cli/dp-cli/references/post-command-flow.md +1 -1
  14. package/dist/skills/agnostic/docs/docs-onboarding/SKILL.md +46 -0
  15. package/dist/skills/agnostic/docs/docs-onboarding/agents/openai.yaml +4 -0
  16. package/dist/skills/agnostic/docs/docs-onboarding/references/artifact-contract.md +67 -0
  17. package/dist/skills/agnostic/docs/writing-beats/SKILL.md +69 -0
  18. package/dist/skills/agnostic/docs/writing-fragments/SKILL.md +76 -0
  19. package/dist/skills/agnostic/docs/writing-shape/SKILL.md +75 -0
  20. package/dist/skills/agnostic/generic/handoff/SKILL.md +15 -0
  21. package/dist/skills/agnostic/planning/create-plan/SKILL.md +24 -8
  22. package/dist/skills/agnostic/planning/create-plan/references/plan-schema.md +20 -0
  23. package/dist/skills/agnostic/planning/create-plan/references/planner-phase.md +1 -1
  24. package/dist/skills/agnostic/planning/create-plan/references/tdd-phase.md +23 -1
  25. package/dist/skills/agnostic/planning/create-spec/SKILL.md +63 -17
  26. package/dist/skills/agnostic/planning/create-spec/references/discovery.md +24 -16
  27. package/dist/skills/agnostic/planning/create-spec/references/folder-naming.md +6 -2
  28. package/dist/skills/agnostic/planning/create-spec/references/wiki-bookkeeping.md +29 -5
  29. package/dist/skills/agnostic/planning/implement-spec/SKILL.md +20 -2
  30. package/dist/skills/agnostic/planning/implement-spec/references/lifecycle.md +7 -1
  31. package/dist/skills/agnostic/planning/implement-spec/references/parallel-worker-brief.md +15 -8
  32. package/dist/skills/agnostic/planning/implement-spec/references/sequential.md +8 -3
  33. package/dist/skills/agnostic/planning/stack/SKILL.md +89 -0
  34. package/dist/skills/agnostic/quality/tdd/SKILL.md +31 -0
  35. package/dist/skills/agnostic/requirements/requirements-grill/SKILL.md +1 -0
  36. package/dist/skills/agnostic/requirements/write-backlog/SKILL.md +7 -5
  37. package/dist/skills/frameworks/tanstack-query/tanstack-query/SKILL.md +621 -830
  38. package/dist/skills/frameworks/tanstack-start/tanstack-start/SKILL.md +250 -0
  39. package/dist/skills/phases/bug-discovery-phase/REFERENCE.md +30 -0
  40. package/dist/skills/phases/bug-discovery-phase/SKILL.md +8 -1
  41. package/dist/skills/phases/debugging-phase/SKILL.md +1 -0
  42. package/dist/skills/phases/delivery-phase/SKILL.md +33 -65
  43. package/dist/skills/phases/delivery-phase/phases/closeout.md +33 -0
  44. package/dist/skills/phases/delivery-phase/phases/debug.md +30 -0
  45. package/dist/skills/phases/delivery-phase/phases/docs-ingest.md +27 -0
  46. package/dist/skills/phases/delivery-phase/phases/implement.md +30 -0
  47. package/dist/skills/phases/delivery-phase/phases/plan.md +27 -0
  48. package/dist/skills/phases/delivery-phase/phases/review.md +29 -0
  49. package/dist/skills/phases/delivery-phase/phases/router.md +46 -0
  50. package/dist/skills/phases/delivery-phase/phases/spec.md +26 -0
  51. package/dist/skills/phases/delivery-phase/references/artifact-state.md +42 -0
  52. package/dist/skills/phases/delivery-phase/references/phase-handoff.md +25 -0
  53. package/dist/skills/phases/docs-ingest-phase/SKILL.md +28 -70
  54. package/dist/skills/phases/docs-ingest-phase/agents/openai.yaml +2 -2
  55. package/dist/skills/phases/docs-ingest-phase/phases/private-internal.md +57 -0
  56. package/dist/skills/phases/docs-ingest-phase/phases/public-docs.md +52 -0
  57. package/dist/skills/phases/docs-ingest-phase/phases/router.md +42 -0
  58. package/dist/skills/phases/docs-ingest-phase/references/fumadocs-routing.md +8 -5
  59. package/dist/skills/phases/docs-ingest-phase/references/learning-artifacts.md +96 -0
  60. package/dist/skills/phases/docs-ingest-phase/references/public-docs.md +90 -0
  61. package/dist/skills/phases/requirements-phase/SKILL.md +3 -0
  62. package/dist/skills/phases/review-phase/SKILL.md +5 -0
  63. package/package.json +1 -1
@@ -0,0 +1,26 @@
1
+ # Spec Phase
2
+
3
+ Use this phase when no reviewed matching `SPEC.md` exists, or the current spec is
4
+ stale, contradictory, or missing required scope.
5
+
6
+ ## Delegate
7
+
8
+ Load `create-spec` only after this phase is selected.
9
+
10
+ ## Checks Before Delegating
11
+
12
+ - Confirm the bounded goal, issue, tracker item, or requested capability.
13
+ - Reuse existing spec artifacts when they match the requested scope.
14
+ - Treat child stories, sub-issues, acceptance criteria, constraints, and non-goals as required input, not loose references.
15
+ - If requirements are still unsettled, stop and route to requirements work instead of inventing scope.
16
+
17
+ ## Completion State
18
+
19
+ Write or verify:
20
+
21
+ - matching `SPEC.md`
22
+ - review status or explicit human approval state
23
+ - unresolved questions, if any
24
+ - source issue/tracker/spec folder
25
+
26
+ Then stop or re-enter `delivery-phase` for routing.
@@ -0,0 +1,42 @@
1
+ # Artifact State
2
+
3
+ Use this reference when deciding whether a phase is complete enough to skip.
4
+
5
+ ## Spec Complete
6
+
7
+ - `SPEC.md` exists and matches the requested goal.
8
+ - Scope includes required tracker children, acceptance criteria, constraints,
9
+ and non-goals.
10
+ - Open questions are parked, resolved, or explicitly blocking.
11
+
12
+ ## Plan Complete
13
+
14
+ - `PLAN.md` exists and matches the spec.
15
+ - Tasks have order, dependencies, owned paths, and validation gates.
16
+ - Mode is explicit or derivable: `parallel: true` or `parallel: false`.
17
+
18
+ ## Implementation Complete
19
+
20
+ - Plan tasks are complete or explicitly deferred.
21
+ - Implementation notes or equivalent evidence describe changed files, validation,
22
+ blockers, and debt.
23
+
24
+ ## Review Complete
25
+
26
+ - `review-phase` ran after the latest implementation diff.
27
+ - Findings are resolved, accepted, routed to debug, or captured as follow-up.
28
+
29
+ ## Debug Complete
30
+
31
+ - Runtime evidence was investigated.
32
+ - Fix or blocker is recorded.
33
+ - Relevant validation was rerun.
34
+
35
+ ## Docs Complete
36
+
37
+ - Docs-affecting changes were ingested, or an explicit no-op reason exists.
38
+
39
+ ## Closeout Complete
40
+
41
+ - Final report names what ran, what was skipped, validation evidence, docs
42
+ outcome, stack state when relevant, and remaining blockers.
@@ -0,0 +1,25 @@
1
+ # Phase Handoff
2
+
3
+ Each phase must leave enough state for a later `delivery-phase` invocation to
4
+ resume without guessing.
5
+
6
+ ## Minimum Handoff Shape
7
+
8
+ ```text
9
+ Phase:
10
+ Status: complete | blocked | skipped
11
+ Scope:
12
+ Artifacts:
13
+ Validation:
14
+ Review/debug/docs state:
15
+ Next suggested route:
16
+ Blockers:
17
+ ```
18
+
19
+ ## Rules
20
+
21
+ - State what actually ran. Do not imply downstream phases ran.
22
+ - Prefer links or paths to durable artifacts over prose-only claims.
23
+ - If a phase is skipped, record the no-op reason.
24
+ - If the user requested HITL control, stop after the handoff even when the next
25
+ route is obvious.
@@ -1,88 +1,46 @@
1
1
  ---
2
2
  name: docs-ingest-phase
3
- description: Ingest specs and docs-affecting changes into canonical routed wiki/project docs and keep repo docs accurate. Use when a spec is ready for domain capture, when apps/wiki content or Fumadocs navigation changes, or when code changes alter architecture, setup, contracts, or operator workflow.
3
+ description: Routes docs-affecting work into private/internal ingest and public-facing docs paths. Use when specs need durable domain capture, public docs need creation or material updates, wiki/Fumadocs routing changes, or code changes alter architecture, setup, contracts, operator workflow, or user-facing behavior.
4
4
  ---
5
5
 
6
6
  # Docs Ingest Phase
7
7
 
8
- ## Contract
9
-
10
- - **Role:** higher-order ingest and repo-docs phase
11
- - **Entrypoint type:** public phase entrypoint
12
- - **Upstream:** reviewed or implemented spec folder, or concrete docs-affecting code changes
13
- - **Delegates to:** internal routed flow-writing phase, internal routed concept-writing phase, route/navigation bookkeeping
14
- - **Downstream:** canonical routed Fumadocs pages, `meta.json` navigation, ingest metadata, wiki log/index updates, and required `docs/` updates
15
- - **Entry conditions:** resolved spec folder for ingest work, or a concrete docs-affecting code change
16
- - **Stop conditions:** ingest bookkeeping complete, required docs updates complete, failures reported honestly
17
-
18
- ## Use When
19
-
20
- - A reviewed or implemented spec folder should become durable routed domain knowledge.
21
- - `apps/wiki` content, Fumadocs navigation, `meta.json`, or routed pages change.
22
- - Code changes alter architecture, setup, contracts, decisions, runbooks, or operator workflow.
23
- - `delivery-phase` reaches `$docs-ingest-phase` and docs-affecting changes exist.
24
-
25
- ## Do Not Use When
26
-
27
- - The work is still requirements discovery, planning, coding, or review.
28
- - The target spec is already marked `ingested: true`; report a no-op.
29
- - The requested docs would document speculative future behavior as current truth.
30
- - The task would duplicate large specs, plans, implementation notes, or runbooks into wiki/project pages instead of summarizing and linking.
31
-
32
8
  ## Quick Start
33
9
 
34
- 1. Resolve `<wiki-root>`:
35
- - monorepo: `apps/wiki`
36
- - single-repo: `wiki`
37
- 2. Read `<wiki-root>/AGENTS.md` before touching wiki content.
38
- 3. If ingesting a spec, read [references/wiki-ingest.md](references/wiki-ingest.md).
39
- 4. If updating routed docs or navigation, read [references/fumadocs-routing.md](references/fumadocs-routing.md).
40
- 5. If updating root `docs/`, read [references/repo-docs.md](references/repo-docs.md).
41
- 6. Finish by reporting written pages, metadata changes, docs updates, validation run, and any no-op reason.
42
-
43
- ## Wiki Ingest Pipeline
44
-
45
- Run this order exactly:
46
-
47
- ```text
48
- docs-ingest-phase
49
- -> routed flow-writing phase
50
- -> routed concept-writing phase
51
- -> ingest bookkeeping
52
- -> route/navigation bookkeeping
53
- ```
10
+ `docs-ingest-phase` is a reusable docs router.
54
11
 
55
- Why: concept pages can cross-link flow pages, so flows must exist first.
12
+ 1. Read [phases/router.md](phases/router.md).
13
+ 2. Inspect only enough source, diff, spec, notes, wiki, public docs, and root docs state to choose the current docs path.
14
+ 3. Load exactly one phase file from `phases/`.
15
+ 4. Complete that path, write the docs-ingest outcome, then stop or re-enter `docs-ingest-phase` to route again.
56
16
 
57
- ## Fumadocs Routing
17
+ Completion of one path does not imply loading the other path.
58
18
 
59
- Keep the private Fumadocs app discoverable:
19
+ ## Entry Modes
60
20
 
61
- - `/docs/project` is the routed surface for scaffolded repos. It owns specs, plans, implementation notes, maintenance logs, decisions, repo guidance, runbooks, useful management context, and project-specific projections.
21
+ - **Private/internal ingest:** durable capture for specs, project docs, wiki internals, root `docs/`, runbooks, operator workflow, routing metadata, or learning artifacts.
22
+ - **Public docs:** reader-facing product, usage, domain, command, onboarding, or changelog docs.
23
+ - **Mixed docs:** one change needs both private/internal capture and public-facing docs.
24
+ - **No-op check:** determine whether docs ingest is already complete or intentionally unnecessary.
62
25
 
63
- Do not create a second routed docs surface or a separate `domains/` content-owner layer just because docs ingest ran. Routed MDX pages under `content/docs/project` are the durable human-facing project pages.
26
+ ## Phase Files
64
27
 
65
- ## Output Contract
28
+ - [phases/router.md](phases/router.md): choose the next docs path from artifacts and audience.
29
+ - [phases/private-internal.md](phases/private-internal.md): ingest specs, project/wiki docs, root docs, routing metadata, and learning artifacts.
30
+ - [phases/public-docs.md](phases/public-docs.md): create or update reader-facing docs through the public writer flow.
66
31
 
67
- Always report:
32
+ ## Router Rules
68
33
 
69
- - source spec or docs-affecting change processed
70
- - flows written or skipped
71
- - concepts written or skipped
72
- - routed pages and `meta.json` updates
73
- - ingest frontmatter/bookkeeping updates
74
- - root `docs/` updates, if any
75
- - validation commands run
76
- - no-op reasons or blockers
34
+ - Do not read path files other than `router.md` until the router selects them.
35
+ - Classify by audience first: internal/project/operator docs are private/internal; reader/adopter/scaffold-recipient docs are public.
36
+ - Use the repo's existing private and public docs surfaces. Do not create a second routed docs surface or hardcode Harness-specific route names in other repos.
37
+ - If both paths apply, prefer private/internal first when source capture, route policy, metadata, or durable writer artifact location is unresolved.
38
+ - Public docs work that runs the writer flow must include the fragment sufficiency checkpoint from [phases/public-docs.md](phases/public-docs.md).
39
+ - After a path completes, report enough state for future resume: selected path, inputs processed, docs written or skipped, validation, blockers, and next path if any.
77
40
 
78
- ## Never Do
41
+ ## Stop Conditions
79
42
 
80
- - Leave new or moved routed pages out of Fumadocs `meta.json`.
81
- - Strip or omit `surface` / `permission` frontmatter from routed pages.
82
- - Proceed to concept writing after a flow write fails.
83
- - Write canonical concept or flow content under `<wiki-root>/domains/`.
84
- - Add a second routed docs surface.
85
- - Create `docs/prd`, `docs/dev`, roadmap, sprint, or backlog-mirror folders.
86
- - Put agent task instructions inside human-facing docs pages.
87
- - Leave docs orphaned from `docs/README.md` after adding or renaming them.
88
- - Duplicate wiki article content across routed pages and another source tree.
43
+ - Selected path completed and its resumable outcome was reported.
44
+ - Router finds no docs-affecting change and reports a no-op reason.
45
+ - Required docs surface, route policy, source artifact, or user guidance is missing.
46
+ - Public fragment sufficiency checkpoint is waiting for the user's answer.
@@ -1,4 +1,4 @@
1
1
  interface:
2
2
  display_name: "Docs Ingest Phase"
3
- short_description: "Wiki ingest plus repo docs maintenance"
4
- default_prompt: "Use $docs-ingest-phase to own the wiki ingest pipeline, then keep docs/ human-facing and implementation-grounded when code changes affect durable knowledge."
3
+ short_description: "Routes private/internal ingest and public docs updates"
4
+ default_prompt: "Use $docs-ingest-phase to route docs-affecting work between private/internal ingest and public docs. For public docs, present fragments and ask whether they are sufficient before beats, shape, or final writing."
@@ -0,0 +1,57 @@
1
+ # Private/Internal Docs Path
2
+
3
+ Use this path for private/project/operator docs, root docs, wiki ingest,
4
+ route/navigation metadata, durable learning, and writer artifact placement.
5
+
6
+ ## Load References
7
+
8
+ Read only the references that match the selected work:
9
+
10
+ - Spec or implementation-note ingest: [../references/wiki-ingest.md](../references/wiki-ingest.md)
11
+ - Durable bug or knowledge learning: [../references/learning-artifacts.md](../references/learning-artifacts.md)
12
+ - Routed wiki pages or navigation metadata: [../references/fumadocs-routing.md](../references/fumadocs-routing.md)
13
+ - Root `docs/` maintenance: [../references/repo-docs.md](../references/repo-docs.md)
14
+
15
+ ## Workflow
16
+
17
+ 1. Resolve `<wiki-root>` when wiki docs are in scope:
18
+ - monorepo: `apps/wiki`
19
+ - single-repo: `wiki`
20
+ 2. Read `<wiki-root>/AGENTS.md` before touching wiki content.
21
+ 3. Classify every target as private/internal or public by audience.
22
+ 4. For private/internal ingest, run the required reference workflows in this order:
23
+ - scoped learning-artifact scan and refresh
24
+ - routed flow-writing phase
25
+ - routed concept-writing phase
26
+ - ingest bookkeeping
27
+ - route/navigation bookkeeping
28
+ - root `docs/` updates
29
+ 5. If public docs are also needed, leave a handoff with the public target, source links, and durable writer artifact home. Re-enter `docs-ingest-phase` for the public path.
30
+
31
+ Flow pages must complete before concept pages because concept pages may
32
+ cross-link flows. If any required flow write fails, stop and report a resumable
33
+ failure.
34
+
35
+ ## Output Contract
36
+
37
+ Report:
38
+
39
+ - source spec or docs-affecting change processed
40
+ - learning artifacts scanned, written, updated, consolidated, replaced, deleted, marked stale, or intentionally skipped
41
+ - flows written or skipped
42
+ - concepts written or skipped
43
+ - routed pages and `meta.json` updates
44
+ - ingest frontmatter/bookkeeping updates
45
+ - root `docs/` updates, if any
46
+ - public docs handoff, if any
47
+ - validation commands run
48
+ - no-op reasons or blockers
49
+
50
+ ## Never Do
51
+
52
+ - Leave new or moved routed pages out of navigation metadata.
53
+ - Strip access-control frontmatter from routed pages.
54
+ - Proceed to concept writing after a flow write fails.
55
+ - Create duplicate routed docs surfaces, `domains/` owner layers, roadmap mirrors, or backlog mirrors.
56
+ - Create a separate `docs/solutions/` tree or hidden memory tree for canonical learning.
57
+ - Put agent task instructions inside human-facing docs pages.
@@ -0,0 +1,52 @@
1
+ # Public Docs Path
2
+
3
+ Use this path for reader-facing product, usage, domain, command, onboarding,
4
+ changelog, and scaffold-recipient docs.
5
+
6
+ ## Load References
7
+
8
+ Always read [../references/public-docs.md](../references/public-docs.md).
9
+
10
+ Also read [../references/fumadocs-routing.md](../references/fumadocs-routing.md)
11
+ when routed pages or navigation metadata will change.
12
+
13
+ ## Workflow
14
+
15
+ 1. Infer the repo's public docs surface from existing pages, sidebars, `meta.json`, indexes, and repo guidance.
16
+ 2. Confirm whether the change is substantial public-facing docs work or a small public-doc patch.
17
+ 3. For small patches, edit directly and report why the writer flow was skipped.
18
+ 4. For substantial work, choose or create one durable private writer artifact bundle for the public target.
19
+ 5. Inspect existing `fragments.md` in that bundle.
20
+ 6. If fragments are missing or stale, run `writing-fragments` in docs-ingest artifact mode to create or refresh `fragments.md`.
21
+ 7. Present the existing or generated fragments to the user and ask whether they are sufficient to continue.
22
+ 8. If the user says they are insufficient, asks for changes, or says more guidance is needed, ask for the missing guidance before running `writing-beats` or `writing-shape`.
23
+ 9. Once fragments are confirmed sufficient or the user has supplied enough guidance to revise them, update `fragments.md` as needed.
24
+ 10. Run `writing-beats`, then `writing-shape`, then write or merge the final public page.
25
+ 11. Update routed metadata, sidebars, and indexes required by the repo's docs system.
26
+
27
+ ## Fragment Sufficiency Checkpoint
28
+
29
+ This checkpoint is mandatory for substantial public-doc work.
30
+
31
+ When presenting fragments:
32
+
33
+ - Say whether they were existing or generated in this pass.
34
+ - Show a concise list of the current fragment claims, examples, constraints, and open questions.
35
+ - Ask directly: "Are these fragments sufficient to continue into beats and shape?"
36
+ - Ask directly: "If not, what guidance, examples, audience detail, tone, exclusions, or missing facts should I add?"
37
+
38
+ Do not continue to beats, shape, or final public page writing while the answer is
39
+ missing or the user has said guidance is needed but has not provided it.
40
+
41
+ ## Output Contract
42
+
43
+ Report:
44
+
45
+ - public docs target and audience
46
+ - writer artifact bundle used
47
+ - fragments presented, confirmed, revised, or blocked for guidance
48
+ - beats and shape artifacts written or skipped
49
+ - public pages written, merged, or skipped
50
+ - routed metadata, sidebar, or index updates
51
+ - validation commands run
52
+ - no-op reasons or blockers
@@ -0,0 +1,42 @@
1
+ # Router Phase
2
+
3
+ Use this file to choose the next docs-ingest path. Do not read other path files
4
+ until this router selects one.
5
+
6
+ ## Inputs To Inspect
7
+
8
+ - User request and explicit mode: private/internal, public docs, mixed, resume, or no-op check.
9
+ - Source spec folder, `SPEC.md`, implementation notes, review/debug output, diff, PR, issue, branch, or docs target named by the user.
10
+ - Existing private/project wiki pages, public docs pages, root `docs/`, `meta.json`, sidebars, ingest frontmatter, writer artifacts, and validation evidence.
11
+ - Relevant repo guidance only when needed to identify docs ownership, route policy, or validation surface.
12
+
13
+ ## Audience Definitions
14
+
15
+ - **Private/internal:** specs, plans, implementation notes, project knowledge, operator runbooks, setup/architecture decisions, root `docs/`, route metadata, learning artifacts, and durable writer artifacts.
16
+ - **Public:** reader-facing product, usage, domain, command, onboarding, changelog, or scaffold-recipient docs.
17
+
18
+ Audience is the primary signal. Route topology and permission metadata are secondary signals.
19
+
20
+ ## Routing Order
21
+
22
+ 1. If docs goal bounds or source artifacts are unclear, stop and ask one concrete question.
23
+ 2. If no docs-affecting change exists, report a no-op and stop.
24
+ 3. If audience classification is unclear after minimal inspection, stop and ask whether the target reader is internal/project/operator or public/adopter/user.
25
+ 4. If a spec, project/wiki page, root `docs/`, operator workflow, route metadata, or learning artifact needs ingest and is missing or stale, load [private-internal.md](private-internal.md).
26
+ 5. If both private/internal and public docs are required, route private/internal first unless its ingest outcome is already fresh and names the public target plus writer artifact location.
27
+ 6. If reader-facing public docs are requested or materially affected, load [public-docs.md](public-docs.md).
28
+ 7. Otherwise report a no-op with evidence.
29
+
30
+ ## Resume Behavior
31
+
32
+ Assume either path may have been completed manually. Verify artifact freshness;
33
+ do not re-run a path only because `docs-ingest-phase` did not run it.
34
+
35
+ ## Output
36
+
37
+ Report:
38
+
39
+ - selected path
40
+ - evidence that selected it
41
+ - path file to load next
42
+ - blocker question if no path can be selected safely
@@ -1,12 +1,12 @@
1
1
  # Fumadocs Routing
2
2
 
3
- Use this reference when `docs-ingest-phase` updates routed project docs.
3
+ Use this reference when `docs-ingest-phase` updates routed Fumadocs docs.
4
4
 
5
5
  ## Canonical Routed Content
6
6
 
7
- `apps/wiki` owns the wiki application and its documentation content. Routed MDX pages under `content/docs/project` are the canonical human-facing docs surface.
7
+ `apps/wiki` owns the wiki application and its documentation content. Routed MDX pages under `content/docs` are the canonical human-facing docs surface.
8
8
 
9
- Required route root:
9
+ Private route root example from this repo:
10
10
 
11
11
  - `<wiki-root>/content/docs/project`
12
12
 
@@ -16,7 +16,7 @@ Do not create or maintain a separate canonical `domains/` tree for concepts and
16
16
 
17
17
  ## Route Boundaries
18
18
 
19
- Use `/docs/project` for:
19
+ Use the repo's private docs route for:
20
20
 
21
21
  - specs
22
22
  - plans
@@ -28,9 +28,12 @@ Use `/docs/project` for:
28
28
  - useful Linear/grill-derived management context
29
29
  - project-specific projections
30
30
  - docs-ingest-phase concept/flow output
31
+ - durable public-doc writer artifacts
31
32
 
32
33
  Keep implementation specs and notes linked or summarized. Do not paste large source artifacts into routed pages.
33
34
 
35
+ Use the repo's public-facing docs routes for reader-facing product, usage, domain, command, changelog, and onboarding pages. Do not enforce this repo's public route names in other repos.
36
+
34
37
  ## Fumadocs Mechanics
35
38
 
36
39
  Fumadocs uses file paths to determine route slugs. Examples:
@@ -61,7 +64,7 @@ Routed ingest pages should also carry durable metadata when useful:
61
64
 
62
65
  ```yaml
63
66
  domain: <domain>
64
- type: concept | flow
67
+ type: concept | flow | writer-artifact
65
68
  status: proposed | implemented
66
69
  source:
67
70
  - apps/wiki/specs/<domain>/<spec>/SPEC.md
@@ -0,0 +1,96 @@
1
+ # Learning Artifacts
2
+
3
+ Use this reference when `docs-ingest-phase` receives a spec, implementation, bugfix, debugging result, review result, or operator workflow change that produced durable learning.
4
+
5
+ ## Purpose
6
+
7
+ Close the loop so future discovery, planning, debugging, and review can reuse what was learned. Canonical learning lives in routed wiki/project docs, not in a separate `docs/solutions/` tree and not as a hidden memory mirror.
8
+
9
+ ## Scope
10
+
11
+ Run a scoped scan around the current ingest's:
12
+
13
+ - domain
14
+ - module
15
+ - component
16
+ - referenced files
17
+ - source spec or implementation notes
18
+
19
+ Do not run broad repository archaeology by default.
20
+
21
+ ## Learning Types
22
+
23
+ Every learning artifact must declare one type:
24
+
25
+ - `learning_type: bug`
26
+ - `learning_type: knowledge`
27
+
28
+ Shared fields:
29
+
30
+ - `date`
31
+ - `domain`
32
+ - `module`
33
+ - `component`
34
+ - `severity`
35
+ - `source`
36
+ - `referenced_files`
37
+ - `future_use_hooks`
38
+
39
+ Bug-only fields:
40
+
41
+ - `symptoms`
42
+ - `root_cause`
43
+ - `resolution_type`
44
+ - `prevention`
45
+
46
+ Knowledge-only fields:
47
+
48
+ - `applies_when`
49
+ - `guidance`
50
+ - `why_it_matters`
51
+
52
+ ## Refresh Outcomes
53
+
54
+ Before writing a new learning artifact, check existing routed learning pages in the scoped area and choose exactly one outcome:
55
+
56
+ - `keep`: current learning is still accurate and this ingest adds nothing durable
57
+ - `update`: same learning needs fresher facts, references, examples, or prevention notes
58
+ - `consolidate`: overlapping learnings should become one canonical page
59
+ - `replace`: old guidance is misleading and a clear successor exists
60
+ - `delete`: old guidance is clearly obsolete, unreferenced, and no longer useful
61
+ - `mark_stale`: accuracy is ambiguous or needs a human decision
62
+
63
+ Record the outcome in the ingest report.
64
+
65
+ ## Future-Use Hooks
66
+
67
+ Every learning artifact must expose at least one hook that makes future reuse likely:
68
+
69
+ - link from a routed flow, concept, or runbook
70
+ - link from spec or implementation notes
71
+ - compact memory note only for hard-to-discover gotchas or routing aids
72
+ - update a phase skill reference when the learning changes agent behavior
73
+ - add a prevention or test note to a validation/review checklist
74
+
75
+ Do not rely on search alone as the hook.
76
+
77
+ ## Memory Boundary
78
+
79
+ Use memory notes sparingly.
80
+
81
+ - Canonical knowledge: routed learning artifact.
82
+ - Navigation/discovery: future-use hooks.
83
+ - Compact gotcha/routing aid: memory note.
84
+
85
+ Do not create memory notes for routine learnings, obvious file locations, or content that already has a routed page and future-use hooks.
86
+
87
+ ## Output
88
+
89
+ For each scoped ingest, report:
90
+
91
+ - scoped search area
92
+ - existing learning artifacts considered
93
+ - chosen refresh outcome
94
+ - pages written or changed
95
+ - future-use hooks added
96
+ - memory note written or skipped with reason
@@ -0,0 +1,90 @@
1
+ # Public Docs
2
+
3
+ Use this reference when `docs-ingest-phase` creates or materially updates public-facing documentation.
4
+
5
+ ## Scope
6
+
7
+ Public documentation is reader-facing product, usage, or domain documentation meant for users, adopters, or scaffold recipients.
8
+
9
+ Private documentation is internal project, operator, maintenance, implementation, or planning documentation meant to preserve how the project is built and run.
10
+
11
+ These are audience categories first. Route topology, permission metadata, and scaffold visibility are supporting signals.
12
+
13
+ ## Route Discovery
14
+
15
+ Infer the repo's docs architecture before writing:
16
+
17
+ 1. Read the wiki/docs `AGENTS.md` when present.
18
+ 2. Inspect existing routed docs roots, `meta.json` files, sidebars, and root docs indexes.
19
+ 3. Classify candidate targets as public-facing, private technical, or both.
20
+ 4. Use the repo's existing public-facing docs surfaces for final reader pages.
21
+ 5. Use the repo's existing private docs surface for writer artifacts.
22
+
23
+ Do not hardcode Harness Intelligence route names. In this repo, `/docs/get-started`, `/docs/harness`, `/docs/cli`, and `/docs/changelog` are examples of public-facing surfaces, while `/docs/project` is an example of a private surface.
24
+
25
+ ## When To Run The Writer Flow
26
+
27
+ Run the public writer flow for substantial public-facing docs work:
28
+
29
+ - new public-facing page
30
+ - major rewrite of an existing public-facing page
31
+ - delivery-phase change that materially changes product behavior, usage, positioning, or domain explanation
32
+ - private spec/project material being transformed into a reader-facing guide, concept page, usage page, or product/domain article
33
+
34
+ Skip the writer flow for small public-doc patches:
35
+
36
+ - typo fixes
37
+ - tiny command corrections
38
+ - metadata fixes
39
+ - changelog ledger updates
40
+ - narrow link or wording corrections
41
+
42
+ When skipped, report the skipped writer stages with an explicit no-op reason.
43
+
44
+ ## Writer Flow
45
+
46
+ Run these reusable skills in order:
47
+
48
+ ```text
49
+ writing-fragments
50
+ -> present fragments and confirm sufficiency with user
51
+ -> writing-beats
52
+ -> writing-shape
53
+ -> final public page write/merge
54
+ ```
55
+
56
+ The writer flow does not replace spec ingestion. If a spec or implementation notes need durable capture, run the private spec/project ingest path as well.
57
+
58
+ When `docs-ingest-phase` orchestrates these skills, call each one in docs-ingest artifact mode:
59
+
60
+ - `writing-fragments` writes or updates `fragments.md`
61
+ - `writing-beats` reads `fragments.md` and writes or updates `beats.md`
62
+ - `writing-shape` reads `fragments.md` plus `beats.md` and writes or updates `shape.md`
63
+ - `docs-ingest-phase` then writes or merges the final public page from those artifacts
64
+
65
+ ## Fragment Sufficiency Checkpoint
66
+
67
+ After inspecting existing fragments or generating fresh fragments, present the
68
+ current fragments to the user before running beats or shape. Ask whether they
69
+ are sufficient to continue. If the user says more guidance is needed, ask for
70
+ the missing guidance and revise `fragments.md` before continuing.
71
+
72
+ ## Durable Writer Artifacts
73
+
74
+ Substantial public-doc work must leave durable private writer artifacts:
75
+
76
+ - `fragments.md`
77
+ - `beats.md`
78
+ - `shape.md`
79
+
80
+ Organize them as one private artifact bundle per public-doc target or substantial docs pass.
81
+
82
+ Use routed human-facing private pages when the repo has a routed private docs surface. Use source-only private files as a fallback when it does not.
83
+
84
+ Do not enforce a universal path such as `docs/public-docs`. The path is repo-bounded. In this repo, a natural location would be under the private project docs surface, such as `apps/wiki/content/docs/project/public-docs/<topic-or-page-slug>/`.
85
+
86
+ ## Traceability
87
+
88
+ Writer artifacts should link forward to the final public page.
89
+
90
+ Final public pages should not visibly link back to private writer artifacts by default. Public pages should stay reader-facing. Non-visible source/frontmatter metadata is allowed when useful and compatible with the repo's docs system.
@@ -26,7 +26,9 @@ Normally do not create or update a formal agent goal. This phase is an interview
26
26
 
27
27
  1. Establish phase state.
28
28
  - Identify the topic, source artifacts, current backlog target/provider, and any explicit scope boundary.
29
+ - Scan relevant routed learning artifacts when known behavior, prior bugs, project conventions, or domain facts could affect requirements.
29
30
  - If grill artifacts exist, read status first, then log.
31
+ - If subagents are available and existing artifacts are long, use `requirements-synthesizer` to compress status/log evidence into accepted, rejected, superseded, parked, and unresolved decisions.
30
32
  - State assumptions and known unresolved branches tersely.
31
33
 
32
34
  2. Route to `requirements-grill` while decisions are open.
@@ -42,6 +44,7 @@ Normally do not create or update a formal agent goal. This phase is an interview
42
44
 
43
45
  4. Run `write-backlog` only after readiness.
44
46
  - Derive modules first, then epics/capabilities, then stories.
47
+ - If subagents are available, use `backlog-shaper` for draft module/epic/story shape before parent review.
45
48
  - Use accepted decisions and locked direction only.
46
49
  - Preserve parked scope and unresolved items as deferred notes, not silent backlog content.
47
50
  - Sync or draft provider payloads only when the user requested backlog write/sync.
@@ -52,6 +52,8 @@ or validation because delivery owns completion.
52
52
 
53
53
  1. Gather evidence:
54
54
  - inspect status, diff/range/PR metadata, tests, docs, and relevant local instructions
55
+ - for PR review, use the actual PR base branch instead of assuming trunk
56
+ - when stack metadata is relevant, include `stack status` or prior delivery stack evidence as readonly review evidence
55
57
  - prefer primary artifacts over tracker summaries
56
58
  - record exact files and commands consulted
57
59
  2. Split if useful:
@@ -63,6 +65,8 @@ or validation because delivery owns completion.
63
65
  - if standalone review finds code changes are needed, report them; if delivery owns fixes, hand them back to delivery and rerun after fixes
64
66
  4. Review findings-first:
65
67
  - prioritize bugs, regressions, broken contracts, missing validation, unsafe assumptions, and user-facing risks
68
+ - for behavior-changing implementation plans or specs, treat missing RED/GREEN proof as a blocking finding unless the task has an explicit valid `reason_not_testable`
69
+ - reject `reason_not_testable` when the only reason is forgotten RED; the delivery owner must recover with a public-result RED test and GREEN evidence
66
70
  - include file and line references when available
67
71
  - separate blocking findings from improvements and optional cleanup
68
72
  5. Apply mandatory local lenses:
@@ -111,3 +115,4 @@ If there are no findings, say so clearly and still report validation coverage an
111
115
  - Do not flatten scoped `AGENTS.md` guidance into generic advice; quote the concrete constraint that matters.
112
116
  - Do not skip scoped skills from `AGENTS.md` prompts. They are part of the review contract, not context flavor.
113
117
  - Do not let `delivery-phase` skip this phase just because tests passed.
118
+ - Do not run mutating stack commands in review. `review-phase` reports stack evidence only; delivery owns `stack sync`.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@punks/cli",
3
- "version": "2.1.9",
3
+ "version": "2.1.11",
4
4
  "description": "Harness Intelligence scaffolding CLI",
5
5
  "bin": {
6
6
  "devpunks": "dist/index.js",