@punks/cli 3.3.2 → 3.3.4

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 (75) hide show
  1. package/AGENTS.md +2 -1
  2. package/dist/BASELINE_CHANGELOG.md +4 -2
  3. package/dist/CHANGELOG.md +17 -1
  4. package/dist/baseline/scaffold-baseline/baseline.json +5 -5
  5. package/dist/baseline/scaffold-baseline/data/catalog/packs.json +2 -1
  6. package/dist/baseline/scaffold-baseline/data/catalog/skills.json +16 -0
  7. package/dist/baseline/scaffold-baseline/skills/agnostic/docs/write-graph-based-skills/AUTHORING-HANDOFF.md +12 -0
  8. package/dist/baseline/scaffold-baseline/skills/agnostic/docs/write-graph-based-skills/SKILL.md +84 -0
  9. package/dist/baseline/scaffold-baseline/skills/agnostic/docs/write-graph-based-skills/agents/openai.yaml +4 -0
  10. package/dist/baseline/scaffold-baseline/skills/agnostic/docs/write-graph-based-skills/phases/audit.md +33 -0
  11. package/dist/baseline/scaffold-baseline/skills/agnostic/docs/write-graph-based-skills/phases/define-authority.md +26 -0
  12. package/dist/baseline/scaffold-baseline/skills/agnostic/docs/write-graph-based-skills/phases/define-handoffs.md +34 -0
  13. package/dist/baseline/scaffold-baseline/skills/agnostic/docs/write-graph-based-skills/phases/model-state.md +30 -0
  14. package/dist/baseline/scaffold-baseline/skills/agnostic/docs/write-graph-based-skills/phases/qualify.md +27 -0
  15. package/dist/baseline/scaffold-baseline/skills/agnostic/docs/write-graph-based-skills/phases/router.md +36 -0
  16. package/dist/baseline/scaffold-baseline/skills/agnostic/docs/write-graph-based-skills/phases/test-routes.md +33 -0
  17. package/dist/baseline/scaffold-baseline/skills/agnostic/docs/write-graph-based-skills/phases/verify-disclosure.md +28 -0
  18. package/dist/baseline/scaffold-baseline/skills/agnostic/docs/write-graph-based-skills/phases/write-phases.md +33 -0
  19. package/dist/baseline/scaffold-baseline/skills/agnostic/docs/write-graph-based-skills/phases/write-router.md +30 -0
  20. package/dist/baseline/scaffold-baseline/skills/agnostic/docs/write-graph-based-skills/references/authoring-contract.md +226 -0
  21. package/dist/baseline/scaffold-baseline/skills/agnostic/generic/handback/SKILL.md +27 -0
  22. package/dist/baseline/scaffold-baseline/skills/agnostic/quality/autoreview/SKILL.md +9 -4
  23. package/dist/baseline/scaffold-baseline/skills/phases/debugging-phase/SKILL.md +6 -5
  24. package/dist/baseline/scaffold-baseline/skills/phases/delivery-phase/SKILL.md +5 -1
  25. package/dist/baseline/scaffold-baseline/skills/phases/delivery-phase/phases/debug.md +2 -2
  26. package/dist/baseline/scaffold-baseline/skills/phases/delivery-phase/phases/handback.md +23 -0
  27. package/dist/baseline/scaffold-baseline/skills/phases/delivery-phase/phases/implement.md +2 -0
  28. package/dist/baseline/scaffold-baseline/skills/phases/delivery-phase/phases/review.md +6 -4
  29. package/dist/baseline/scaffold-baseline/skills/phases/delivery-phase/phases/router.md +25 -19
  30. package/dist/baseline/scaffold-baseline/skills/phases/delivery-phase/references/phase-handoff.md +6 -2
  31. package/dist/baseline/scaffold-baseline/skills/phases/review-phase/phases/return-route.md +14 -9
  32. package/dist/baseline/scaffold-baseline/skills/phases/review-phase/phases/router.md +15 -13
  33. package/dist/baseline/scaffold-baseline/skills/phases/review-phase/phases/run-review.md +3 -2
  34. package/dist/baseline/scaffold-baseline/skills/phases/review-phase/references/durable-report.md +15 -12
  35. package/dist/baseline/scaffold-baseline/skills/phases/review-phase/references/runtime-handoff.md +2 -2
  36. package/dist/baseline/scaffold-baseline/skills/phases/review-phase/references/state-graph.md +5 -1
  37. package/dist/baseline/scaffold-baseline/skills/phases/review-phase/scripts/review-contract.mjs +15 -4
  38. package/dist/baseline/scaffold-baseline.json +5 -5
  39. package/dist/baseline/scaffold-baseline.tgz +0 -0
  40. package/dist/data/AGENTS.md +1 -0
  41. package/dist/data/shared-agents.md +113 -0
  42. package/dist/index.js +15 -9
  43. package/dist/skills/agnostic/docs/write-graph-based-skills/AUTHORING-HANDOFF.md +12 -0
  44. package/dist/skills/agnostic/docs/write-graph-based-skills/SKILL.md +84 -0
  45. package/dist/skills/agnostic/docs/write-graph-based-skills/agents/openai.yaml +4 -0
  46. package/dist/skills/agnostic/docs/write-graph-based-skills/phases/audit.md +33 -0
  47. package/dist/skills/agnostic/docs/write-graph-based-skills/phases/define-authority.md +26 -0
  48. package/dist/skills/agnostic/docs/write-graph-based-skills/phases/define-handoffs.md +34 -0
  49. package/dist/skills/agnostic/docs/write-graph-based-skills/phases/model-state.md +30 -0
  50. package/dist/skills/agnostic/docs/write-graph-based-skills/phases/qualify.md +27 -0
  51. package/dist/skills/agnostic/docs/write-graph-based-skills/phases/router.md +36 -0
  52. package/dist/skills/agnostic/docs/write-graph-based-skills/phases/test-routes.md +33 -0
  53. package/dist/skills/agnostic/docs/write-graph-based-skills/phases/verify-disclosure.md +28 -0
  54. package/dist/skills/agnostic/docs/write-graph-based-skills/phases/write-phases.md +33 -0
  55. package/dist/skills/agnostic/docs/write-graph-based-skills/phases/write-router.md +30 -0
  56. package/dist/skills/agnostic/docs/write-graph-based-skills/references/authoring-contract.md +211 -0
  57. package/dist/skills/agnostic/generic/handback/SKILL.md +27 -0
  58. package/dist/skills/agnostic/quality/autoreview/SKILL.md +9 -4
  59. package/dist/skills/frameworks/nestjs/nestjs-best-practices/.gitignore +29 -0
  60. package/dist/skills/phases/debugging-phase/SKILL.md +6 -5
  61. package/dist/skills/phases/delivery-phase/SKILL.md +5 -1
  62. package/dist/skills/phases/delivery-phase/phases/debug.md +2 -2
  63. package/dist/skills/phases/delivery-phase/phases/handback.md +23 -0
  64. package/dist/skills/phases/delivery-phase/phases/implement.md +2 -0
  65. package/dist/skills/phases/delivery-phase/phases/review.md +6 -4
  66. package/dist/skills/phases/delivery-phase/phases/router.md +23 -17
  67. package/dist/skills/phases/delivery-phase/references/phase-handoff.md +6 -2
  68. package/dist/skills/phases/review-phase/phases/return-route.md +14 -9
  69. package/dist/skills/phases/review-phase/phases/router.md +15 -13
  70. package/dist/skills/phases/review-phase/phases/run-review.md +3 -2
  71. package/dist/skills/phases/review-phase/references/durable-report.md +10 -8
  72. package/dist/skills/phases/review-phase/references/runtime-handoff.md +2 -2
  73. package/dist/skills/phases/review-phase/references/state-graph.md +5 -1
  74. package/dist/skills/phases/review-phase/scripts/review-contract.mjs +2 -0
  75. package/package.json +9 -52
@@ -43,18 +43,19 @@ output.
43
43
 
44
44
  | Priority | Current evidence | Output |
45
45
  | -------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------- |
46
- | 1 | Unsupported target, invalid accepted bounds, non-retryable contract or infrastructure failure, malformed active retention candidate, or `same_run_conflict` | terminal `review_failed` |
47
- | 2 | Delivery entry is otherwise valid, recovered `review_count >= 3`, and no already-started run has valid predecessor evidence | terminal `review_budget_exhausted` |
48
- | 3 | A repository-approved retained ref is required but cannot be derived and requires an operator decision | checkpoint `retained_ref_approval_required` |
49
- | 4 | Same-authority admissible evidence conflicts and no declared tie-break resolves it | blocked `review_state_conflict` |
50
- | 5 | Required explicit invocation context, accepted bounds, target evidence, or reconstructible lineage inputs are missing | blocked `review_context_blocked` |
51
- | 6 | The caller is in delivery-owned `debug_active`, `repair_active`, `debt_follow_up`, `docs_ingest`, `closeout`, `focused_validation`, or `clean_handoff` without fresh `review_due` evidence | blocked `review_not_due` |
52
- | 7 | A valid retained standalone report and durable returned routing output exist | terminal `review_complete` |
53
- | 8 | A valid retained delivery report and durable returned routing output exist | terminal `review_routed` |
54
- | 9 | Retention is verified and fresh, but its returned routing output is absent | [`return-route.md`](return-route.md) |
55
- | 10 | A complete fresh local report exists without unique verified retention, including a retryable retention failure | [`retain-report.md`](retain-report.md) |
56
- | 11 | Fresh `review_running` predecessor evidence exists without a complete local report | [`run-review.md`](run-review.md) |
57
- | 12 | Fresh `review_due` evidence exists, or mutation, partial-run, retryable failure, or stale target/source evidence invalidated later work | [`prepare-review.md`](prepare-review.md) |
46
+ | 1 | Durable `human_steering_required` while the `$handback` authority guard fails | terminal `human_steering_required` |
47
+ | 2 | Unsupported target, invalid accepted bounds, non-retryable contract or infrastructure failure, malformed active retention candidate, or `same_run_conflict` | terminal `review_failed` |
48
+ | 3 | Delivery entry is otherwise valid, recovered `review_count >= 3`, and no already-started run has valid predecessor evidence | terminal `review_budget_exhausted` |
49
+ | 4 | A repository-approved retained ref is required but cannot be derived and requires an operator decision | checkpoint `retained_ref_approval_required` |
50
+ | 5 | Same-authority admissible evidence conflicts and no declared tie-break resolves it | blocked `review_state_conflict` |
51
+ | 6 | Required explicit invocation context, accepted bounds, target evidence, or reconstructible lineage inputs are missing | blocked `review_context_blocked` |
52
+ | 7 | The caller is in delivery-owned `debug_active`, `repair_active`, `debt_follow_up`, `docs_ingest`, `closeout`, `focused_validation`, or `clean_handoff` without fresh `review_due` evidence | blocked `review_not_due` |
53
+ | 8 | A valid retained standalone report and durable returned routing output exist | terminal `review_complete` |
54
+ | 9 | A valid retained delivery report and durable returned routing output exist | terminal `review_routed` |
55
+ | 10 | Retention is verified and fresh, but its returned routing output is absent | [`return-route.md`](return-route.md) |
56
+ | 11 | A complete fresh local report exists without unique verified retention, including a retryable retention failure | [`retain-report.md`](retain-report.md) |
57
+ | 12 | Fresh `review_running` predecessor evidence exists without a complete local report | [`run-review.md`](run-review.md) |
58
+ | 13 | Fresh `review_due` evidence exists, or mutation, partial-run, retryable failure, or stale target/source evidence invalidated later work | [`prepare-review.md`](prepare-review.md) |
58
59
 
59
60
  ## State Coverage
60
61
 
@@ -67,7 +68,8 @@ output.
67
68
  - `review_routed` selects `return-route.md` until durable return evidence exists,
68
69
  then terminates as `review_complete` for standalone or `review_routed` for
69
70
  delivery.
70
- - `review_failed` and `review_budget_exhausted` are terminal router outcomes.
71
+ - `human_steering_required`, `review_failed`, and `review_budget_exhausted` are
72
+ terminal router outcomes.
71
73
  - Review-owned mutation or retryable partial-run evidence projects back to
72
74
  `review_due`; retryable fresh retention evidence remains
73
75
  `report_retention_pending`.
@@ -51,8 +51,9 @@ scope; the parent rejects stale, expanded, duplicated, or unverified output.
51
51
  6. Parent-verify every advisory and lens candidate against the frozen target and
52
52
  adjacent evidence. Only verified candidates become findings. Give each
53
53
  accepted finding a stable identifier, lens, severity, location, impact,
54
- evidence, action, and one explicit `return_route`: `debugging`,
55
- `implementation`, `debt_follow_up`, or `docs_ingest`.
54
+ evidence, action, and one explicit `return_route`: `human_steering_required`,
55
+ `debugging`, `implementation`, `debt_follow_up`, or `docs_ingest`. Use
56
+ `human_steering_required` when the repair triggers `$handback`.
56
57
  7. Run only the smallest safe readonly validation needed to verify candidates or
57
58
  governing acceptance evidence. Broader checks require explicit accepted spec
58
59
  or plan authority. Record missing required RED/GREEN evidence as a finding;
@@ -78,20 +78,23 @@ as null or not applicable.
78
78
  exactly the fields `id`, `lens`, `severity`, `location`, `impact`, `evidence`,
79
79
  `action`, and `return_route`. Finding IDs are unique, severity is `critical`,
80
80
  `high`, `medium`, or `low`, and each lens outcome agrees with whether that lens
81
- has a finding. Each finding's `return_route` is exactly `debugging`,
82
- `implementation`, `debt_follow_up`, or `docs_ingest`.
81
+ has a finding. Each finding's `return_route` is exactly
82
+ `human_steering_required`, `debugging`, `implementation`, `debt_follow_up`, or
83
+ `docs_ingest`.
83
84
 
84
85
  `routing` has exactly `primary` and `secondary_architecture_follow_up`.
85
- `primary` is `debugging`, `implementation`, `debt_follow_up`, `docs_ingest`, or
86
- `closeout`; the secondary flag is boolean. Aggregate routing is derived by the
87
- public `deriveReviewRouting` helper from the complete finding set. Precedence is
88
- `debugging` > `implementation` > `debt_follow_up` > `docs_ingest`; an empty set
89
- derives `closeout`, and debt is secondary only beside debugging or
90
- implementation. A supplied aggregate mismatch is invalid. `validation` is an
91
- array of records with exactly command, isolation mode, before/after frozen
92
- hashes, outcome, and evidence. Isolation is proven no-write, disposable
93
- checkout, or disposable snapshot. Retained validation records require equal
94
- before/after hashes.
86
+ `primary` is `human_steering_required`, `debugging`, `implementation`,
87
+ `debt_follow_up`, `docs_ingest`, or `closeout`; the secondary flag is boolean.
88
+ Aggregate routing is derived by the public `deriveReviewRouting` helper from
89
+ the complete finding set. Precedence is
90
+ `human_steering_required` > `debugging` > `implementation` > `debt_follow_up`
91
+
92
+ > `docs_ingest`; an empty set derives `closeout`, and debt is secondary only
93
+ > beside debugging or implementation. A supplied aggregate mismatch is invalid. `validation` is an
94
+ > array of records with exactly command, isolation mode, before/after frozen
95
+ > hashes, outcome, and evidence. Isolation is proven no-write, disposable
96
+ > checkout, or disposable snapshot. Retained validation records require equal
97
+ > before/after hashes.
95
98
 
96
99
  Delivery ordinals are 1 through 3. Review 1 has null preceding-repair ordinal;
97
100
  review 2 or 3 records respectively 1 or 2. Standalone delivery-goal identity,
@@ -69,8 +69,8 @@ Resume identity:
69
69
 
70
70
  `Review state` is exactly one of `review_due`, `review_running`,
71
71
  `report_retention_pending`, `retained_ref_approval_required`,
72
- `review_context_blocked`, `review_routed`, `review_complete`, or
73
- `review_failed`. `Next suggested route` is optional advice represented by
72
+ `review_context_blocked`, `review_routed`, `review_complete`,
73
+ `human_steering_required`, or `review_failed`. `Next suggested route` is optional advice represented by
74
74
  `none` when absent and is always lowest authority. `attempt` starts at 1 for a
75
75
  run and increases by one for each new stateful record. Persist locators and
76
76
  hashes, not reconstructible raw target, source, report, validation, or finding
@@ -24,7 +24,8 @@ and clean handoff.
24
24
  | `report_retention_pending` | Retryable retention failure | Hashes fresh | Report writer | `report_retention_pending` | None | Exact retryable evidence; no authoritative pass |
25
25
  | `report_retention_pending` | Non-retryable retention failure | Retry cannot succeed | Report writer | `review_failed` | None | Exact terminal evidence; no authoritative pass |
26
26
  | `report_retention_pending` | Freshness changed | Target or source hash changed | `review-phase` | `review_due` | None | Stale local report; unchanged counters |
27
- | `review_routed` | Readonly return | Standalone | Standalone caller | `review_complete` | None | Retained report output and route |
27
+ | `review_routed` | Human steering route | Derived primary route is `human_steering_required` | `review-phase` | `human_steering_required` | None | Retained report plus durable `$handback` outcome |
28
+ | `review_routed` | Readonly return | Standalone; primary route is not `human_steering_required` | Standalone caller | `review_complete` | None | Retained report output and route |
28
29
  | `review_routed` | Resume debug route | Handoff already records run id, debug route, and `debug_active` | `delivery-phase` | `debug_active` | None | Existing atomic handoff; no guard fallthrough |
29
30
  | `review_routed` | Resume implementation route | Handoff already records run id, implementation route, and `repair_active` | `delivery-phase` | `repair_active` | None | Existing atomic handoff; no guard fallthrough |
30
31
  | `review_routed` | Resume debt follow-up | Handoff already records run id, retained report, stable finding IDs, and `debt_follow_up` | Delivery review handoff | `debt_follow_up` | None | Existing debt keys and artifact; no duplicate capture |
@@ -69,6 +70,9 @@ Review 1 may open fix 1, review 2 fix 2, and review 3 fix 3. Fix 3 never opens
69
70
  review 4. A failed focused validation stays in repair epoch 3 until that same
70
71
  validation passes.
71
72
 
73
+ `human_steering_required` opens no repair. It remains terminal until the
74
+ `$handback` authority guard passes.
75
+
72
76
  Same-goal bounds revisions preserve delivery lineage and counters. Resume,
73
77
  rebase, new commit, process retry, and handoff preserve them. Only an explicitly
74
78
  new delivery goal with materially changed accepted bounds creates a new lineage
@@ -163,7 +163,13 @@ const HEX_64 = /^[0-9a-f]{64}$/u;
163
163
  const COMMIT_SHA = /^[0-9a-f]{40}(?:[0-9a-f]{24})?$/u;
164
164
  const LENS_KEYS = ["standards", "skill_adherence", "architecture", "simplify", "spec"];
165
165
  const PROTOTYPE_KEYS = new Set(["__proto__", "constructor", "prototype"]);
166
- const FINDING_ROUTES = ["debugging", "implementation", "debt_follow_up", "docs_ingest"];
166
+ const FINDING_ROUTES = [
167
+ "human_steering_required",
168
+ "debugging",
169
+ "implementation",
170
+ "debt_follow_up",
171
+ "docs_ingest",
172
+ ];
167
173
 
168
174
  export const deriveReviewRouting = (findings) => {
169
175
  if (
@@ -525,9 +531,14 @@ const validateReportSemantics = (report, errors) => {
525
531
 
526
532
  if (
527
533
  !exactKeys(report.routing, ["primary", "secondary_architecture_follow_up"]) ||
528
- !["debugging", "implementation", "debt_follow_up", "docs_ingest", "closeout"].includes(
529
- report.routing?.primary,
530
- ) ||
534
+ ![
535
+ "human_steering_required",
536
+ "debugging",
537
+ "implementation",
538
+ "debt_follow_up",
539
+ "docs_ingest",
540
+ "closeout",
541
+ ].includes(report.routing?.primary) ||
531
542
  typeof report.routing?.secondary_architecture_follow_up !== "boolean"
532
543
  ) {
533
544
  errors.push("malformed:routing");
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "schemaVersion": 2,
3
3
  "channel": "stable",
4
- "version": "2026.08.24-91e61685",
5
- "tag": "baseline/stable/2026.08.24-91e61685",
6
- "commit": "91e61685efea2d5a35d2162367cccbb178292ee0",
4
+ "version": "2026.08.25-560d7917",
5
+ "tag": "baseline/stable/2026.08.25-560d7917",
6
+ "commit": "560d7917dfa5c3b0a2eace307013c1c07c57d1a3",
7
7
  "archive": "scaffold-baseline.tgz",
8
- "archiveSha256": "1de19c201d653c95b4cf57063009ecdbe7a7acfaaf67f43ebaf1b4610c6ab7fb",
8
+ "archiveSha256": "4a703a9c2256bb4c145c61260714561ae51660dbd1fe217e1d4bad1f3fea2baf",
9
9
  "compatibility": {
10
- "cliVersionRange": ">=3.3.2 <3.4.0"
10
+ "cliVersionRange": ">=3.3.4 <3.4.0"
11
11
  }
12
12
  }
Binary file
@@ -3,6 +3,7 @@
3
3
  Primary skills here: `autoreview`, `codebase-design`, `improve-codebase-architecture`, `parallel-research`, `prototype`, `quality-types`, `review`, `simplify`, `tdd`.
4
4
 
5
5
  This scope owns packaged CLI assets: skill and pack catalogs, hooks, prompt content, subagent manifests, harness-projection scripts, and generated declarations. Keep runtime behavior in `apps/cli/src`; keep shared scaffold model contracts in `packages/scaffold`. Changes to embedded or generated assets must preserve their content hashes and public-output contracts.
6
+ Autonomy ends at accepted goal bounds. If progress requires changed requirements, a weaker gate, or substantial implementation redesign, invoke `$handback` before expanding work.
6
7
 
7
8
  When reusable skills change, complete the root source-first flow before treating these distributed assets as current: before editing, verify `git -C /Users/stefan/Desktop/repos/wearedevpunks-skills branch --show-current` returns exactly `main`; stop otherwise. Edit and commit the canonical source only on that checked-out `main` branch; alternate branches or worktrees are out of scope for this flow. Then push, run `bun run sync:skills`, verify the exact receipt SHA, and publish the baseline when requested.
8
9
 
@@ -0,0 +1,113 @@
1
+ # AGENTS.md
2
+
3
+ Behavioral guidelines to reduce common LLM coding mistakes. Merge with project-specific instructions as needed.
4
+
5
+ **Tradeoff:** These guidelines bias toward caution over speed. For trivial tasks, use judgment.
6
+
7
+ ## Philosophy
8
+
9
+ This codebase will outlive you. Every shortcut becomes someone else's burden. Every hack compounds into technical debt that slows the team down.
10
+
11
+ You are not writing code, you are shaping the future of the project. The patterns established will be copied, the corners cut will be cut again.
12
+
13
+ Fight entropy, leave the codebase better than when you found it.
14
+
15
+ ## Writing style
16
+
17
+ - When generating tokens be extremely concise. Sacrifice grammar for the sake of concision.
18
+ - Be detailed about concepts, reasoning, assumptions, tradeoffs, and questions; keep wording terse.
19
+
20
+ ## 1. Think Before Coding
21
+
22
+ **Don't assume. Don't hide confusion. Surface tradeoffs.**
23
+
24
+ Before implementing:
25
+
26
+ - State your assumptions explicitly. If uncertain, ask.
27
+ - If multiple interpretations exist, present them. Don't pick silently.
28
+ - If a simpler approach exists, say so. Push back when warranted.
29
+ - If something is unclear, stop. Name what's confusing. Ask.
30
+
31
+ ## 2. Simplicity First
32
+
33
+ **Minimum code that solves the problem. Nothing speculative.**
34
+
35
+ - No features beyond what was asked.
36
+ - No abstractions for single-use code.
37
+ - No "flexibility" or "configurability" that wasn't requested.
38
+ - No error handling for impossible scenarios.
39
+ - If you write 200 lines and it could be 50, rewrite it.
40
+
41
+ Ask yourself: "Would a senior engineer say this is overcomplicated?" If yes, simplify.
42
+
43
+ ## 3. Surgical Changes
44
+
45
+ **Touch only what you must. Clean up only your own mess.**
46
+
47
+ When editing existing code:
48
+
49
+ - Don't "improve" adjacent code, comments, or formatting by default.
50
+ - Don't refactor things that aren't broken by default.
51
+ - Match existing style, even if you'd do it differently.
52
+ - If you notice unrelated dead code, mention it. Don't delete it by default.
53
+ - If adjacent code materially affects correctness, clarity, maintainability, or the requested change, changing it is allowed. Fight entropy, do not preserve harmful local minima.
54
+
55
+ When your changes create orphans:
56
+
57
+ - Remove imports, variables, functions, and code paths that YOUR changes made unused.
58
+ - Don't remove pre-existing dead code unless asked.
59
+
60
+ The test: Every changed line should trace directly to the user's request or to necessary entropy-reducing support for that request.
61
+
62
+ ## 4. Goal-Driven Execution
63
+
64
+ **Define success criteria. Loop until verified.**
65
+
66
+ Transform tasks into verifiable goals:
67
+
68
+ - "Add validation" -> "Write tests for invalid inputs, then make them pass"
69
+ - "Fix the bug" -> "Write a test that reproduces it, then make it pass"
70
+ - "Refactor X" -> "Ensure tests pass before and after"
71
+
72
+ For multi-step tasks, state a brief plan:
73
+
74
+ ```text
75
+ 1. [Step] -> verify: [check]
76
+ 2. [Step] -> verify: [check]
77
+ 3. [Step] -> verify: [check]
78
+ ```
79
+
80
+ Strong success criteria let you loop independently. Weak criteria ("make it work") require constant clarification.
81
+
82
+ ## Dependency source inspection
83
+
84
+ - Prefer web search and official docs first when inspecting external libraries or packages.
85
+ - If web results are unsuccessful, stale, or not detailed enough for implementation, fetch source locally.
86
+ - For npm packages, use `opensrc path <package>` to get the absolute path to cached source code, fetching on cache miss.
87
+ - For non-npm packages, clone the upstream `owner/repo` git source directly with `opensrc path <owner>/<repo>`.
88
+
89
+ ## Subagents
90
+
91
+ Subagent-based working is mandatory. Before delegating, verify the active harness global/project settings actually enable subagent execution. Then verify `.agents/subagents/manifest.mjs` exists and the chosen specialist has matching owned paths, guidance files, and skills.
92
+
93
+ Use one active execution or implementation subagent at a time by default. Spawn multiple execution or implementation subagents in parallel only when the user explicitly asks for parallelism.
94
+
95
+ If a spawn is blocked by a full subagent/thread set, close existing completed or finished subagents, then retry.
96
+
97
+ Use readonly subagents for research, auditing, investigating hypotheses, or exploring separate paths. When readonly work can be split across independent questions, paths, or hypotheses, parallel readonly subagents are mandatory.
98
+
99
+ If the runtime guard fails, repair setup or report the blocker; do not claim inactive worker coverage and do not silently fall back to main-thread execution.
100
+
101
+ ## Notes — Cross-session Memory
102
+
103
+ Notebook at `.agents/notes/`. Shared memory across sessions. Never ask permission.
104
+
105
+ **On session start:** Read `.agents/notes/index.md` (create if missing).
106
+ **Write notes for:**
107
+
108
+ - Non-obvious behaviors, gotchas, edge cases
109
+ - Hard-won insights that took investigation
110
+ - Project conventions and architectural decisions
111
+ - Setup and config quirks
112
+ **Don't note:** File locations, basic structure, session summaries, trivial facts.
113
+ **Guidelines:** Store in `.agents/notes/`, keep `index.md` lean with one line per note, update existing notes before creating new ones, include why not just what, prune aggressively.