@punks/cli 3.1.10 → 3.1.12

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 (76) hide show
  1. package/dist/BASELINE_CHANGELOG.md +61 -0
  2. package/dist/CHANGELOG.md +57 -0
  3. package/dist/data/subagents/manifest.mjs +11 -6
  4. package/dist/index.js +28 -28
  5. package/dist/skills/agnostic/cli/hi-cli/references/post-command-flow.md +5 -0
  6. package/dist/skills/agnostic/docs/writing-beats/LICENSE +21 -0
  7. package/dist/skills/agnostic/docs/writing-beats/UPSTREAM.md +11 -0
  8. package/dist/skills/agnostic/docs/writing-fragments/LICENSE +21 -0
  9. package/dist/skills/agnostic/docs/writing-fragments/UPSTREAM.md +11 -0
  10. package/dist/skills/agnostic/docs/writing-shape/LICENSE +21 -0
  11. package/dist/skills/agnostic/docs/writing-shape/UPSTREAM.md +11 -0
  12. package/dist/skills/agnostic/frontend/frontend-domain-structure/SKILL.md +24 -42
  13. package/dist/skills/agnostic/frontend/frontend-domain-structure/agents/openai.yaml +1 -1
  14. package/dist/skills/agnostic/frontend/frontend-domain-structure/references/react/structure.md +51 -78
  15. package/dist/skills/agnostic/frontend/frontend-domain-structure/references/structure.md +89 -212
  16. package/dist/skills/agnostic/generic/handoff/LICENSE +21 -0
  17. package/dist/skills/agnostic/generic/handoff/UPSTREAM.md +11 -0
  18. package/dist/skills/agnostic/planning/create-plan/REFERENCE.md +1 -1
  19. package/dist/skills/agnostic/planning/create-plan/SKILL.md +19 -7
  20. package/dist/skills/agnostic/planning/create-plan/references/plan-schema.md +19 -0
  21. package/dist/skills/agnostic/planning/create-plan/references/planner-task-graph.md +27 -10
  22. package/dist/skills/agnostic/planning/implement-spec/SKILL.md +6 -2
  23. package/dist/skills/agnostic/planning/implement-spec/assets/IMPLEMENTATION-NOTES-TEMPLATE.md +22 -6
  24. package/dist/skills/agnostic/planning/implement-spec/references/lifecycle.md +12 -0
  25. package/dist/skills/agnostic/planning/implement-spec/references/parallel-orchestration.md +10 -2
  26. package/dist/skills/agnostic/planning/implement-spec/references/parallel-worker-brief.md +10 -1
  27. package/dist/skills/agnostic/planning/implement-spec/references/parallel.md +2 -0
  28. package/dist/skills/agnostic/quality/autoreview/SKILL.md +11 -2
  29. package/dist/skills/agnostic/quality/codebase-design/LICENSE +21 -0
  30. package/dist/skills/agnostic/quality/codebase-design/UPSTREAM.md +11 -0
  31. package/dist/skills/agnostic/quality/review/LICENSE +21 -0
  32. package/dist/skills/agnostic/quality/review/SKILL.md +16 -11
  33. package/dist/skills/agnostic/quality/review/UPSTREAM.md +11 -0
  34. package/dist/skills/agnostic/quality/tdd/LICENSE +21 -0
  35. package/dist/skills/agnostic/quality/tdd/UPSTREAM.md +11 -0
  36. package/dist/skills/agnostic/research/improve-codebase-architecture/LICENSE +21 -0
  37. package/dist/skills/agnostic/research/improve-codebase-architecture/UPSTREAM.md +11 -0
  38. package/dist/skills/frameworks/effect/effect/SKILL.md +5 -12
  39. package/dist/skills/frameworks/effect/effect/references/CONFIG.md +10 -19
  40. package/dist/skills/frameworks/effect/effect/references/SERVICES_LAYERS.md +3 -63
  41. package/dist/skills/frameworks/effect/effect/references/TESTING.md +2 -72
  42. package/dist/skills/frameworks/effect/effect-backend-structure/SKILL.md +12 -29
  43. package/dist/skills/frameworks/effect/effect-backend-structure/agents/openai.yaml +1 -1
  44. package/dist/skills/frameworks/effect/effect-backend-structure/references/layout.md +9 -9
  45. package/dist/skills/frameworks/sqlalchemy/sqlalchemy-schema-design/SKILL.md +199 -0
  46. package/dist/skills/frameworks/sqlalchemy/sqlalchemy-schema-design/UPSTREAM.md +31 -0
  47. package/dist/skills/frameworks/sqlalchemy/sqlalchemy-schema-design/agents/openai.yaml +4 -0
  48. package/dist/skills/languages/python/python-backend-structure/SKILL.md +91 -0
  49. package/dist/skills/languages/python/python-backend-structure/agents/openai.yaml +4 -0
  50. package/dist/skills/languages/python/python-design-patterns/SKILL.md +93 -69
  51. package/dist/skills/languages/python/python-project-structure/SKILL.md +4 -247
  52. package/dist/skills/phases/delivery-phase/SKILL.md +13 -4
  53. package/dist/skills/phases/delivery-phase/phases/closeout.md +3 -0
  54. package/dist/skills/phases/delivery-phase/phases/debug.md +8 -1
  55. package/dist/skills/phases/delivery-phase/phases/implement.md +11 -2
  56. package/dist/skills/phases/delivery-phase/phases/review.md +50 -29
  57. package/dist/skills/phases/delivery-phase/phases/router.md +56 -36
  58. package/dist/skills/phases/delivery-phase/references/artifact-state.md +8 -2
  59. package/dist/skills/phases/delivery-phase/references/phase-handoff.md +60 -10
  60. package/dist/skills/phases/finder-phase/references/root-routing.md +6 -1
  61. package/dist/skills/phases/prototype-phase/agents/openai.yaml +2 -0
  62. package/dist/skills/phases/review-phase/AUTHORING-HANDOFF.md +622 -0
  63. package/dist/skills/phases/review-phase/SKILL.md +11 -42
  64. package/dist/skills/phases/review-phase/agents/openai.yaml +2 -0
  65. package/dist/skills/phases/review-phase/phases/prepare-review.md +105 -0
  66. package/dist/skills/phases/review-phase/phases/retain-report.md +113 -0
  67. package/dist/skills/phases/review-phase/phases/return-route.md +95 -0
  68. package/dist/skills/phases/review-phase/phases/router.md +78 -0
  69. package/dist/skills/phases/review-phase/phases/run-review.md +128 -0
  70. package/dist/skills/phases/review-phase/references/durable-report.md +153 -0
  71. package/dist/skills/phases/review-phase/references/runtime-handoff.md +138 -0
  72. package/dist/skills/phases/review-phase/references/state-graph.md +69 -0
  73. package/dist/skills/phases/review-phase/references/targets.md +156 -0
  74. package/dist/skills/phases/review-phase/scripts/review-contract.mjs +819 -0
  75. package/package.json +56 -2
  76. package/dist/skills/phases/review-phase/REFERENCE.md +0 -147
@@ -1,31 +1,52 @@
1
1
  # Review Phase
2
2
 
3
- Use this phase after implementation or when delivery resumes with an unreviewed
4
- diff, branch, PR, or implementation artifact.
5
-
6
- ## Delegate
7
-
8
- Mandatory step: after this phase is selected, load and call `review-phase`
9
- before routing or closing delivery. Preserve its findings-first, readonly
10
- posture even when tests pass.
11
-
12
- ## Rules
13
-
14
- - Review is mandatory even when tests pass.
15
- - Review remains findings-first and readonly unless the called review skill says otherwise.
16
- - Classify findings before routing:
17
- - No blocking findings: route to docs ingest or closeout.
18
- - In-scope non-runtime blockers: route back to implement.
19
- - Runtime evidence: route to debug.
20
- - Broad scope or architecture debt: capture follow-up debt instead of expanding delivery.
21
-
22
- ## Completion State
23
-
24
- Write or verify:
25
-
26
- - review command or process used
27
- - findings and severity
28
- - accepted no-op reason if no findings
29
- - next route decision and why
30
-
31
- Then stop or re-enter `delivery-phase` for routing.
3
+ Use after implementation or whenever delivery has `review_due` for a stale or
4
+ missing retained review.
5
+
6
+ ## Prepare Explicit Review
7
+
8
+ 1. Validate accepted bounds and normalize a supported Git/diff target without
9
+ mutating it. Unsupported targets or invalid bounds enter `review_failed`
10
+ with exact evidence, no report, and no counter change.
11
+ 2. Keep that result in memory and recover `review_count` from unique valid retained passes for the
12
+ delivery lineage and reconcile the handoff projection.
13
+ 3. If recovered `review_count >= 3`, return `review_budget_exhausted` with exact
14
+ current-route evidence. This is a zero-write no-op: do not persist
15
+ `review_due` or mutate any handoff, counter, or delivery status.
16
+ 4. Only when recovered `review_count < 3`, persist `review_due` with the valid
17
+ normalized target and exact explicit `$review-phase` invocation
18
+ context defined in the phase-handoff reference. Do not preallocate an ordinal
19
+ or derive `review_run_id` yet.
20
+ 5. Return that invocation context and stop. Only an explicit operator invocation
21
+ of `$review-phase` consumes it, preallocates ordinal `review_count + 1`, fixes
22
+ `review_run_id`, and enters `review_running`.
23
+
24
+ For `report_retention_pending`, return an explicit `$review-phase` resume context
25
+ with the existing run id, local report identity, and fresh target/source hashes,
26
+ then stop. The explicit review invocation resumes retention without rerunning
27
+ lenses.
28
+
29
+ ## Route Retained Findings
30
+
31
+ After the retained report establishes the completed ordinal:
32
+
33
+ 1. Runtime evidence routes primarily to debugging.
34
+ 2. Otherwise, an in-scope non-runtime blocker routes primarily to implementation.
35
+ 3. Otherwise, broad architecture debt routes to debt follow-up.
36
+ 4. Otherwise, route to docs ingest or closeout by documentation completeness.
37
+
38
+ Architecture debt may remain a secondary follow-up beside debugging or
39
+ implementation. Opening either repair route is one atomic durable handoff write
40
+ of active state, route, `repair_count = review_count`, and idempotency
41
+ `review_run_id`. Reject a mismatched or already-consumed repair ordinal.
42
+ Complete the transition only after that write. Resume an already-recorded run
43
+ directly without another increment.
44
+
45
+ ## Completion
46
+
47
+ Before review, completion is a durable `review_due` handoff plus exact explicit
48
+ invocation context and a stop. After review returns `review_routed`, completion
49
+ records report path, report SHA-256, report commit SHA, verified retained ref,
50
+ lineage, run id, recovered/projected counts, stable finding ids, primary route,
51
+ secondary debt route when present, and resulting state. Then stop or re-enter
52
+ delivery routing.
@@ -1,48 +1,68 @@
1
1
  # Router Phase
2
2
 
3
- Use this file to choose the next delivery phase. Do not read other phase files
4
- until this router selects one.
3
+ Choose one next phase from durable artifacts. Review counters and active repair
4
+ state take precedence over inferred artifact order.
5
5
 
6
- ## Inputs To Inspect
6
+ ## Inputs
7
7
 
8
- - User request and entry intent: full delivery, resume, HITL checkpoint, or closeout.
9
- - Tracker item, issue, PR, branch, or spec folder named by the user.
10
- - Existing `SPEC.md`, backlog projection evidence, `PLAN.md`, implementation notes, review output, debug evidence, docs ingest notes, stack state, and validation evidence.
11
- - Relevant repo guidance only when needed to identify ownership or validation surface.
8
+ - entry intent and accepted goal bounds
9
+ - matching spec, backlog projection, plan, implementation notes, and validation
10
+ - retained review reports plus durable phase handoff
11
+ - current diff/target and governing source hashes
12
+ - docs, stack, tracker, and PR state when relevant
12
13
 
13
- ## Routing Order
14
+ ## Route
14
15
 
15
- 1. If goal bounds are unclear, stop and ask one concrete question.
16
- 2. If no matching agent-ready `SPEC.md` exists, load [spec.md](spec.md).
17
- 3. If the spec exists but is stale, contradictory, or missing required child-story scope, load [spec.md](spec.md).
18
- 4. If the verified post-spec backlog projection is missing or stale, load [backlog.md](backlog.md).
19
- 5. If no execution-ready matching plan exists, load [plan.md](plan.md).
20
- 6. If the plan exists but lacks dependencies, owned paths, validation gates, or wave boundaries, load [plan.md](plan.md).
21
- 7. If accepted plan work is incomplete, load [implement.md](implement.md).
22
- 8. If implementation exists but mandatory review is missing or stale, load [review.md](review.md).
23
- 9. If review found in-scope non-runtime blockers, route back to [implement.md](implement.md).
24
- 10. If validation or review produced runtime evidence, load [debug.md](debug.md).
25
- 11. If docs-affecting changes exist and ingest is missing, load [docs-ingest.md](docs-ingest.md).
26
- 12. Otherwise load [closeout.md](closeout.md).
16
+ 1. Stop on unclear goal bounds and ask one concrete question.
17
+ 2. For durable `review_due`, load [review.md](review.md). It first validates
18
+ accepted bounds and normalizes a supported target. A rejection enters
19
+ `review_failed` even when a persisted counter is 3. Only after those checks
20
+ may it recover `review_count` and evaluate the budget in memory. Exhaustion
21
+ returns `review_budget_exhausted` with zero handoff or status writes. A count
22
+ below 3 persists `review_due` and returns the exact explicit `$review-phase`
23
+ invocation context. Then stop. Delivery never enters `review_running` itself.
24
+ 3. For `report_retention_pending`, load [review.md](review.md) only to return the
25
+ exact explicit `$review-phase` resume context, then stop. A fresh local report
26
+ resumes without rerunning lenses. Stop on terminal `review_failed` with its
27
+ exact evidence.
28
+ 4. Otherwise recover review state by `review_lineage_id`: read the highest valid
29
+ retained ordinal, reconcile the handoff `review_count` projection, then assess
30
+ target and source freshness separately.
31
+ 5. Route a fresh retained `review_routed` report through [review.md](review.md)
32
+ when no durable route handoff exists yet.
33
+ 6. Resume an atomic handoff already in `debug_active` through [debug.md](debug.md)
34
+ or `repair_active` through [implement.md](implement.md). A recorded
35
+ `review_run_id` cannot increment `repair_count` again.
36
+ 7. Route `focused_validation` to its recorded implementation or debugging owner.
37
+ Passing becomes `clean_handoff`; failure remains repair epoch 3.
38
+ 8. Route `clean_handoff` to [docs-ingest.md](docs-ingest.md) when docs remain,
39
+ otherwise [closeout.md](closeout.md).
40
+ 9. If no matching agent-ready `SPEC.md` exists, or it is stale,
41
+ contradictory, or incomplete, load [spec.md](spec.md).
42
+ 10. If the verified post-spec backlog projection is missing or stale, load
43
+ [backlog.md](backlog.md).
44
+ 11. If no execution-ready matching plan exists, or it lacks dependencies, owned
45
+ paths, validation gates, or wave boundaries, load [plan.md](plan.md).
46
+ 12. If accepted plan work is incomplete, load [implement.md](implement.md).
47
+ 13. If implementation exists and its retained review is missing or stale, load
48
+ [review.md](review.md). That phase validates accepted bounds and normalizes a
49
+ supported target before any delivery-budget evaluation, then returns either
50
+ `review_failed`, `review_budget_exhausted`, or the exact explicit
51
+ `$review-phase` invocation context and stops.
52
+ 14. Route remaining docs-affecting work to [docs-ingest.md](docs-ingest.md),
53
+ otherwise [closeout.md](closeout.md).
27
54
 
28
- ## HITL Behavior
55
+ Only an explicitly new delivery goal with materially changed accepted bounds
56
+ creates a new lineage and resets review/repair counters. Same-goal bounds
57
+ revision, resume, rebase, commit, retry, and handoff preserve them.
29
58
 
30
- A HITL checkpoint is explicit user control, never an inferred spec approval
31
- gate. When requested, route only the requested phase and stop after writing its
32
- phase handoff. On resume, an agent-ready `SPEC.md` proceeds directly to the next
33
- applicable phase; no reviewed or approved status is required.
59
+ ## HITL And Resume
34
60
 
35
- ## Resume Behavior
36
-
37
- Assume earlier phases may have been completed manually through their direct
38
- skills. Verify artifact freshness; do not re-run a phase only because
39
- `delivery-phase` did not run it.
61
+ A HITL checkpoint is explicit user control. Run only the requested phase and
62
+ stop after its handoff. Earlier phases may have completed through direct skills;
63
+ reuse fresh matching artifacts rather than rerunning them.
40
64
 
41
65
  ## Output
42
66
 
43
- Report:
44
-
45
- - selected phase
46
- - evidence that selected it
47
- - child skill or phase file to load next
48
- - blocker question if no phase can be selected safely
67
+ Report the selected state and phase, the durable evidence that selected it, the
68
+ next file or child skill, and any exact blocker.
@@ -30,8 +30,14 @@ Use this reference when deciding whether a phase is complete enough to skip.
30
30
 
31
31
  ## Review Complete
32
32
 
33
- - `review-phase` ran after the latest implementation diff.
34
- - Findings are resolved, accepted, routed to debug, or captured as follow-up.
33
+ - A fresh immutable report matches the delivery lineage, accepted bounds,
34
+ normalized target, governing source hashes, and latest implementation state.
35
+ - Its commit exists on a verified retained ref; a local report alone is pending.
36
+ - The highest valid retained ordinal is authoritative and the handoff
37
+ `review_count` is its reconciled projection.
38
+ - Findings are routed by stable ids. Review itself entered no repair state.
39
+ - After fix 3, `clean_handoff` supersedes the normal fresh-review requirement
40
+ and links report 3, final changes, focused validation, and clean status.
35
41
 
36
42
  ## Debug Complete
37
43
 
@@ -1,9 +1,8 @@
1
1
  # Phase Handoff
2
2
 
3
- Each phase must leave enough state for a later `delivery-phase` invocation to
4
- resume without guessing.
3
+ Each phase leaves enough durable state for resume without guessing.
5
4
 
6
- ## Minimum Handoff Shape
5
+ ## Base Shape
7
6
 
8
7
  ```text
9
8
  Phase:
@@ -17,11 +16,62 @@ Next suggested route:
17
16
  Blockers:
18
17
  ```
19
18
 
20
- ## Rules
19
+ State only what ran. Prefer durable artifact paths/links. Carry approved
20
+ artifacts and UI evidence. Give every skip an exact no-op reason. Honor explicit
21
+ HITL stops.
21
22
 
22
- - State what actually ran. Do not imply downstream phases ran.
23
- - Prefer links or paths to durable artifacts over prose-only claims.
24
- - Carry approved artifact links and before/after UI Evidence links forward; if links are missing, name whether `repo-asset-management` is blocked or not applicable.
25
- - If a phase is skipped, record the no-op reason.
26
- - If the user requested HITL control, stop after the handoff even when the next
27
- route is obvious.
23
+ ## Review And Repair Projection
24
+
25
+ For a delivery goal with review activity, also persist:
26
+
27
+ ```text
28
+ delivery_goal_identity:
29
+ accepted_bounds_identity:
30
+ accepted_bounds_hash:
31
+ review_lineage_id:
32
+ review_run_id:
33
+ state: review_due | review_running | report_retention_pending | review_routed | debug_active | repair_active | focused_validation | clean_handoff
34
+ primary_route:
35
+ review_count:
36
+ repair_count:
37
+ authoritative_report_path:
38
+ authoritative_report_commit:
39
+ verified_retained_ref:
40
+ stable_finding_ids:
41
+ ```
42
+
43
+ `review_count` is a projection of the highest valid retained report ordinal for
44
+ the lineage. Reconcile it on resume. An opening repair transition atomically
45
+ writes active state, primary route, `repair_count = review_count`, and
46
+ idempotency `review_run_id`; complete the transition only after the write. A
47
+ recorded run id resumes its state without increment or guard fallthrough.
48
+
49
+ ## Explicit Review Invocation Context
50
+
51
+ Delivery persists this block for `review_due` and returns it unchanged before
52
+ stopping:
53
+
54
+ ```text
55
+ explicit_operator_invocation_required: true
56
+ review_invocation_skill: $review-phase
57
+ review_invocation_mode: delivery
58
+ delivery_goal_identity:
59
+ accepted_bounds_identity:
60
+ accepted_bounds_hash:
61
+ review_lineage_id:
62
+ recovered_review_count:
63
+ current_route:
64
+ normalized_target:
65
+ ```
66
+
67
+ The `review_due` handoff leaves `review_run_id` unset. Only the explicit operator
68
+ invocation consumes this context, preallocates the next ordinal, fixes the run
69
+ id, and enters `review_running`.
70
+
71
+ For `report_retention_pending`, the explicit resume context additionally carries
72
+ the existing `review_run_id`, ordinal, local report path and SHA-256, target hash,
73
+ source hashes, and intended retained ref. Delivery returns it and stops; the
74
+ operator invokes `$review-phase` to retry retention without rerunning lenses.
75
+
76
+ After fix 3, `clean_handoff` is final authority. Link immutable review 3, final
77
+ changes, the same passing focused validation, and clean status.
@@ -15,7 +15,8 @@ Keep root prompt guidance short:
15
15
  - Unclear requirements inside a bounded topic route to `requirements-phase`.
16
16
  - Accepted specs, issues, or plans route to `delivery-phase`.
17
17
  - Runtime failures route to `debugging-phase`.
18
- - Reviews route to `review-phase`.
18
+ - Review requests persist the bounded target and accepted-bounds context, then
19
+ point the operator to the exact explicit `$review-phase` invocation.
19
20
  - Docs learning after proven changes routes to `docs-ingest-phase`.
20
21
 
21
22
  ## Boundary
@@ -28,3 +29,7 @@ Keep root prompt guidance short:
28
29
  - `create-spec`, `create-plan`, or `delivery-phase` after implementation scope is accepted.
29
30
 
30
31
  It chooses the route and updates the frontier handoff.
32
+
33
+ `finder-phase`, root routing, and `delivery-phase` never invoke, delegate to, or
34
+ model-select `review-phase`. They may only persist its input context, return the
35
+ exact explicit `$review-phase` instruction, and stop.
@@ -0,0 +1,2 @@
1
+ policy:
2
+ allow_implicit_invocation: false