@izkac/forgekit 0.3.11 → 0.3.13

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 (116) hide show
  1. package/bin/forge.mjs +107 -107
  2. package/bin/forgekit.mjs +83 -83
  3. package/bin/review.mjs +81 -81
  4. package/package.json +1 -1
  5. package/scripts/prepack.mjs +78 -78
  6. package/scripts/run-tests.mjs +50 -50
  7. package/src/adr.mjs +236 -236
  8. package/src/adr.test.mjs +170 -170
  9. package/src/change.mjs +327 -234
  10. package/src/change.test.mjs +145 -83
  11. package/src/cleanup-sessions.mjs +84 -84
  12. package/src/config.mjs +103 -103
  13. package/src/defer.mjs +75 -75
  14. package/src/doctor.mjs +350 -341
  15. package/src/doctor.test.mjs +114 -114
  16. package/src/init.mjs +680 -621
  17. package/src/install.mjs +815 -815
  18. package/src/install.test.mjs +180 -180
  19. package/src/integrity-check.mjs +60 -60
  20. package/src/integrity.mjs +682 -682
  21. package/src/integrity.test.mjs +566 -566
  22. package/src/lib.mjs +143 -143
  23. package/src/models.defaults.json +41 -41
  24. package/src/new-session.mjs +99 -99
  25. package/src/openspec-overlays/README.md +19 -19
  26. package/src/openspec-overlays/openspec-apply-change-footer.md +14 -14
  27. package/src/openspec-overlays/opsx-apply-completion-step.md +1 -1
  28. package/src/openspec-overlays/opsx-apply-implement-step.md +11 -11
  29. package/src/paths.mjs +92 -92
  30. package/src/plan-engine.mjs +321 -278
  31. package/src/plan-engine.test.mjs +447 -283
  32. package/src/preferences.defaults.json +78 -78
  33. package/src/preferences.mjs +438 -438
  34. package/src/preferences.test.mjs +174 -174
  35. package/src/record-evidence.mjs +204 -204
  36. package/src/resolve-model.mjs +312 -312
  37. package/src/resolve-model.test.mjs +194 -194
  38. package/src/review/cli.test.mjs +117 -117
  39. package/src/review/export.mjs +172 -172
  40. package/src/review/export.test.mjs +197 -197
  41. package/src/review/fixtures/valid-review.json +42 -42
  42. package/src/review/lib.mjs +894 -894
  43. package/src/review/lib.test.mjs +266 -266
  44. package/src/review/schema.json +196 -196
  45. package/src/review/signals.test.mjs +62 -62
  46. package/src/score-cli.mjs +68 -68
  47. package/src/score.mjs +568 -566
  48. package/src/score.test.mjs +366 -340
  49. package/src/session-reminder.mjs +207 -207
  50. package/src/session-status.mjs +70 -70
  51. package/src/set-models.mjs +186 -186
  52. package/src/set-phase.mjs +205 -205
  53. package/src/set-prefs.mjs +294 -294
  54. package/src/specs-sync.mjs +234 -0
  55. package/src/specs-sync.test.mjs +114 -0
  56. package/src/spine.mjs +93 -93
  57. package/src/triage-prompt.mjs +175 -175
  58. package/src/triage-prompt.test.mjs +50 -50
  59. package/src/vendor-openspec-overlays.mjs +176 -176
  60. package/src/vendor-openspec-overlays.test.mjs +62 -62
  61. package/vendor/skills/archive-to-adr/SKILL.md +149 -149
  62. package/vendor/skills/forge/SKILL.md +136 -136
  63. package/vendor/skills/forge/docs/forge.md +650 -647
  64. package/vendor/skills/forge/phases/brainstorm.md +23 -23
  65. package/vendor/skills/forge/phases/finish.md +90 -87
  66. package/vendor/skills/forge/phases/implement.md +77 -77
  67. package/vendor/skills/forge/phases/plan-openspec.md +60 -60
  68. package/vendor/skills/forge/phases/plan-specs.md +163 -117
  69. package/vendor/skills/forge/phases/review.md +25 -25
  70. package/vendor/skills/forge/phases/verify.md +124 -124
  71. package/vendor/skills/forge/references/forge-layout.md +85 -85
  72. package/vendor/skills/forge/references/pace.md +115 -115
  73. package/vendor/skills/forge/references/plan-routing.md +52 -51
  74. package/vendor/skills/forge/references/runtime-integrity.md +232 -225
  75. package/vendor/skills/forge/references/substantial-work.md +37 -37
  76. package/vendor/skills/forge/references/test-evidence.md +30 -30
  77. package/vendor/skills/forge/references/test-strategy.md +68 -68
  78. package/vendor/skills/forge/skills/subagent-driven-development/SKILL.md +87 -87
  79. package/vendor/skills/forge/subagents/final-reviewer-prompt.md +56 -56
  80. package/vendor/skills/forge/subagents/implementer-prompt.md +38 -38
  81. package/vendor/skills/git-resolve-adr-conflict/SKILL.md +132 -132
  82. package/vendor/skills/thorough-code-review/SKILL.md +290 -290
  83. package/vendor/skills/thorough-code-review/examples.md +133 -133
  84. package/vendor/skills/thorough-code-review/reference/accepted-risks.md +26 -26
  85. package/vendor/skills/thorough-code-review/reference/lenses.md +96 -96
  86. package/vendor/skills/thorough-code-review/reference/phase1-scout.md +62 -62
  87. package/vendor/skills/thorough-code-review/reference/phase2-skeptic.md +105 -105
  88. package/vendor/skills/thorough-code-review/reference/report-schema.json +222 -222
  89. package/vendor/skills/thorough-code-review/reference/report-template.md +115 -115
  90. package/vendor/skills/thorough-code-review/reference/severity-rubric.md +49 -49
  91. package/vendor/skills/thorough-code-review/reference/signals-preflight.md +55 -55
  92. package/vendor/templates/adr/README.md +7 -7
  93. package/vendor/templates/adr/decisions.md +141 -141
  94. package/vendor/templates/adr/hooks/check-pending-adrs.mjs +74 -74
  95. package/vendor/templates/adr/hooks/check-pending-adrs.sh +3 -3
  96. package/vendor/templates/adr/hooks/openspec-archive-agent-message.mjs +52 -52
  97. package/vendor/templates/adr/hooks/openspec-archive-agent-message.sh +3 -3
  98. package/vendor/templates/project/claude/commands/forge-apply.md +75 -75
  99. package/vendor/templates/project/claude/commands/forge-brainstorm.md +7 -7
  100. package/vendor/templates/project/claude/commands/forge-build.md +17 -17
  101. package/vendor/templates/project/claude/commands/forge-plan.md +12 -12
  102. package/vendor/templates/project/claude/commands/forge-skip.md +14 -14
  103. package/vendor/templates/project/claude/commands/forge-status.md +16 -16
  104. package/vendor/templates/project/claude/commands/forge.md +16 -16
  105. package/vendor/templates/project/claude/hooks/forge-prompt-hook.mjs +73 -73
  106. package/vendor/templates/project/claude/hooks/forge-session-start.mjs +19 -19
  107. package/vendor/templates/project/claude/hooks/forge-triage-hook.mjs +77 -77
  108. package/vendor/templates/project/cursor/commands/forge-apply.md +75 -75
  109. package/vendor/templates/project/cursor/commands/forge-brainstorm.md +10 -10
  110. package/vendor/templates/project/cursor/commands/forge-build.md +17 -17
  111. package/vendor/templates/project/cursor/commands/forge-plan.md +15 -15
  112. package/vendor/templates/project/cursor/commands/forge-skip.md +14 -14
  113. package/vendor/templates/project/cursor/commands/forge-status.md +16 -16
  114. package/vendor/templates/project/cursor/commands/forge.md +16 -16
  115. package/vendor/templates/project/cursor/hooks/forge-session-start.mjs +30 -30
  116. package/vendor/templates/project/cursor/hooks/forge-session-start.sh +3 -3
@@ -1,105 +1,105 @@
1
- # Phase 2 — Skeptic pass
2
-
3
- You are an **adversarial skeptic**. Your job is to **disprove** the scout's claim unless evidence confirms it.
4
-
5
- **You receive only this packet — no chat history.** It may contain **one finding** (critical, or an important finding alone in its file) or a **batch of findings sharing a file or module** (important: ≤4, minor: ≤6) — steelman and verdict each finding independently; never let one verdict color another.
6
-
7
- ## Finding(s) under review
8
-
9
- One block per finding:
10
-
11
- ```
12
- id: {FINDING_ID}
13
- lens: {LENS}
14
- location: {LOCATION}
15
- claim: {CLAIM}
16
- evidence: {EVIDENCE}
17
- context: {CONTEXT_EXCERPT} # ±30 lines around the cited location, from the scout
18
- related: {RELATED} # callers, test files, ADR paths
19
- tentative_severity: {SEVERITY}
20
- confidence: {CONFIDENCE}
21
- ```
22
-
23
- Start from `context` and `related` — most verdicts need only 1–2 additional reads. Read more files only when the disproof checklist genuinely requires it.
24
-
25
- ## Scope context
26
-
27
- - **Scope:** {SCOPE_DESCRIPTION}
28
- - **Mode:** {MODE} <!-- `initial` or `reverify` -->
29
- - **Accepted risks:** {ACCEPTED_RISKS_DIGEST} <!-- contents of reference/accepted-risks.md -->
30
-
31
- Check the digest **before** reading `docs/adr/` — if it covers the claim and no re-open trigger fired, the verdict is `false_positive` (cite the ADR id). Read full ADRs only when the digest is silent.
32
-
33
- ## Steelman rule
34
-
35
- First, restate the **strongest** version of the claim — the worst reasonable interpretation an attacker or failure mode could exploit.
36
-
37
- ## Disproof checklist
38
-
39
- Attempt each before concluding:
40
-
41
- 1. **Call chain** — trace callers and callees; does the dangerous path actually execute?
42
- 2. **Data flow** — is input attacker-controlled at the sink?
43
- 3. **Tests** — read (or run if feasible) tests covering this path
44
- 4. **Framework mitigations** — middleware, ORM parameterization, framework defaults
45
- 5. **Deployment boundary** — internal-only API, LAN trust model, ADR-accepted risk
46
- 6. **Project docs** — `docs/adr/`, `AGENTS.md`, prior security reviews
47
- 7. **Intent** — comment, type guard, or early return that negates the claim
48
-
49
- ## Verdict (initial review)
50
-
51
- | Verdict | When |
52
- | ------- | ---- |
53
- | `confirmed` | Issue is real at stated or higher severity |
54
- | `false_positive` | Claim does not hold after investigation |
55
- | `downgraded` | Real issue but lower severity — set `severity` and `original_severity` |
56
- | `needs_decision` | Architectural/policy choice; not a clear defect |
57
-
58
- **Requirements:**
59
-
60
- - `verdict_reason` must cite specific evidence (file:line, test name, ADR id).
61
- - "Looks fine" without evidence is invalid.
62
- - Upgrade severity only with **new** evidence not in the scout packet.
63
-
64
- ## Risk-weighted second opinion
65
-
66
- A single skeptic returning `false_positive` is itself a single point of failure — it can quietly bury a real bug. The orchestrator dispatches a **second independent skeptic** (no history, blind to the first verdict) when the finding is in the **dangerous quadrant**:
67
-
68
- - `severity` is `critical`/`important` **and** the first verdict is `false_positive`, or
69
- - `phase1_confidence: high` **and** the first verdict is `false_positive` (scout/skeptic disagreement), or
70
- - `phase1_confidence: low` **and** `severity: critical` (high-stakes, low-certainty).
71
-
72
- If you are the second skeptic, verify independently and return your verdict in the `second_opinion` block. When the two skeptics disagree, the orchestrator keeps the higher-severity outcome or routes to `needs_decision` — a disagreement is never silently resolved in favour of dismissal.
73
-
74
- ## Verdict (reverify mode)
75
-
76
- When `MODE` is `reverify`, the finding was previously `confirmed` or `downgraded`. Read **current** code at `location`.
77
-
78
- | Verdict | When |
79
- | ------- | ---- |
80
- | `resolved` | Fix fully addresses the issue |
81
- | `still_open` | Issue persists unchanged |
82
- | `partially_fixed` | Improved but incomplete |
83
- | `regressed` | Fix introduced new problem or made it worse |
84
-
85
- Include `verdict_reason` with before/after comparison.
86
-
87
- ## Output
88
-
89
- Return one structured block **per finding** for synthesis:
90
-
91
- ```yaml
92
- id: F-001
93
- lens: security
94
- location: path:line
95
- claim: ...
96
- severity: critical | important | minor
97
- original_severity: ... # required if downgraded
98
- verdict: confirmed | false_positive | downgraded | needs_decision | resolved | still_open | partially_fixed | regressed
99
- verdict_reason: ...
100
- evidence: ...
101
- second_opinion: # only for dangerous-quadrant findings
102
- verdict: ...
103
- verdict_reason: ...
104
- agrees: true | false
105
- ```
1
+ # Phase 2 — Skeptic pass
2
+
3
+ You are an **adversarial skeptic**. Your job is to **disprove** the scout's claim unless evidence confirms it.
4
+
5
+ **You receive only this packet — no chat history.** It may contain **one finding** (critical, or an important finding alone in its file) or a **batch of findings sharing a file or module** (important: ≤4, minor: ≤6) — steelman and verdict each finding independently; never let one verdict color another.
6
+
7
+ ## Finding(s) under review
8
+
9
+ One block per finding:
10
+
11
+ ```
12
+ id: {FINDING_ID}
13
+ lens: {LENS}
14
+ location: {LOCATION}
15
+ claim: {CLAIM}
16
+ evidence: {EVIDENCE}
17
+ context: {CONTEXT_EXCERPT} # ±30 lines around the cited location, from the scout
18
+ related: {RELATED} # callers, test files, ADR paths
19
+ tentative_severity: {SEVERITY}
20
+ confidence: {CONFIDENCE}
21
+ ```
22
+
23
+ Start from `context` and `related` — most verdicts need only 1–2 additional reads. Read more files only when the disproof checklist genuinely requires it.
24
+
25
+ ## Scope context
26
+
27
+ - **Scope:** {SCOPE_DESCRIPTION}
28
+ - **Mode:** {MODE} <!-- `initial` or `reverify` -->
29
+ - **Accepted risks:** {ACCEPTED_RISKS_DIGEST} <!-- contents of reference/accepted-risks.md -->
30
+
31
+ Check the digest **before** reading `docs/adr/` — if it covers the claim and no re-open trigger fired, the verdict is `false_positive` (cite the ADR id). Read full ADRs only when the digest is silent.
32
+
33
+ ## Steelman rule
34
+
35
+ First, restate the **strongest** version of the claim — the worst reasonable interpretation an attacker or failure mode could exploit.
36
+
37
+ ## Disproof checklist
38
+
39
+ Attempt each before concluding:
40
+
41
+ 1. **Call chain** — trace callers and callees; does the dangerous path actually execute?
42
+ 2. **Data flow** — is input attacker-controlled at the sink?
43
+ 3. **Tests** — read (or run if feasible) tests covering this path
44
+ 4. **Framework mitigations** — middleware, ORM parameterization, framework defaults
45
+ 5. **Deployment boundary** — internal-only API, LAN trust model, ADR-accepted risk
46
+ 6. **Project docs** — `docs/adr/`, `AGENTS.md`, prior security reviews
47
+ 7. **Intent** — comment, type guard, or early return that negates the claim
48
+
49
+ ## Verdict (initial review)
50
+
51
+ | Verdict | When |
52
+ | ------- | ---- |
53
+ | `confirmed` | Issue is real at stated or higher severity |
54
+ | `false_positive` | Claim does not hold after investigation |
55
+ | `downgraded` | Real issue but lower severity — set `severity` and `original_severity` |
56
+ | `needs_decision` | Architectural/policy choice; not a clear defect |
57
+
58
+ **Requirements:**
59
+
60
+ - `verdict_reason` must cite specific evidence (file:line, test name, ADR id).
61
+ - "Looks fine" without evidence is invalid.
62
+ - Upgrade severity only with **new** evidence not in the scout packet.
63
+
64
+ ## Risk-weighted second opinion
65
+
66
+ A single skeptic returning `false_positive` is itself a single point of failure — it can quietly bury a real bug. The orchestrator dispatches a **second independent skeptic** (no history, blind to the first verdict) when the finding is in the **dangerous quadrant**:
67
+
68
+ - `severity` is `critical`/`important` **and** the first verdict is `false_positive`, or
69
+ - `phase1_confidence: high` **and** the first verdict is `false_positive` (scout/skeptic disagreement), or
70
+ - `phase1_confidence: low` **and** `severity: critical` (high-stakes, low-certainty).
71
+
72
+ If you are the second skeptic, verify independently and return your verdict in the `second_opinion` block. When the two skeptics disagree, the orchestrator keeps the higher-severity outcome or routes to `needs_decision` — a disagreement is never silently resolved in favour of dismissal.
73
+
74
+ ## Verdict (reverify mode)
75
+
76
+ When `MODE` is `reverify`, the finding was previously `confirmed` or `downgraded`. Read **current** code at `location`.
77
+
78
+ | Verdict | When |
79
+ | ------- | ---- |
80
+ | `resolved` | Fix fully addresses the issue |
81
+ | `still_open` | Issue persists unchanged |
82
+ | `partially_fixed` | Improved but incomplete |
83
+ | `regressed` | Fix introduced new problem or made it worse |
84
+
85
+ Include `verdict_reason` with before/after comparison.
86
+
87
+ ## Output
88
+
89
+ Return one structured block **per finding** for synthesis:
90
+
91
+ ```yaml
92
+ id: F-001
93
+ lens: security
94
+ location: path:line
95
+ claim: ...
96
+ severity: critical | important | minor
97
+ original_severity: ... # required if downgraded
98
+ verdict: confirmed | false_positive | downgraded | needs_decision | resolved | still_open | partially_fixed | regressed
99
+ verdict_reason: ...
100
+ evidence: ...
101
+ second_opinion: # only for dangerous-quadrant findings
102
+ verdict: ...
103
+ verdict_reason: ...
104
+ agrees: true | false
105
+ ```