opencastle 1.6.2 → 1.6.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 (275) hide show
  1. package/README.md +9 -9
  2. package/bin/cli.mjs +19 -12
  3. package/dist/cli/adapters/adapter-contract.test.js +1 -1
  4. package/dist/cli/adapters/single-file-base.d.ts.map +1 -1
  5. package/dist/cli/adapters/single-file-base.js +2 -12
  6. package/dist/cli/adapters/single-file-base.js.map +1 -1
  7. package/dist/cli/add.js +7 -7
  8. package/dist/cli/add.js.map +1 -1
  9. package/dist/cli/baseline.js +6 -6
  10. package/dist/cli/baseline.js.map +1 -1
  11. package/dist/cli/bootstrap.d.ts.map +1 -1
  12. package/dist/cli/bootstrap.js +15 -6
  13. package/dist/cli/bootstrap.js.map +1 -1
  14. package/dist/cli/bootstrap.test.js +8 -0
  15. package/dist/cli/bootstrap.test.js.map +1 -1
  16. package/dist/cli/ci.d.ts.map +1 -1
  17. package/dist/cli/ci.js +19 -9
  18. package/dist/cli/ci.js.map +1 -1
  19. package/dist/cli/command-namespace.test.js +4 -21
  20. package/dist/cli/command-namespace.test.js.map +1 -1
  21. package/dist/cli/convoy/engine.js +3 -3
  22. package/dist/cli/convoy/engine.js.map +1 -1
  23. package/dist/cli/convoy/engine.test.js +1 -1
  24. package/dist/cli/convoy/engine.test.js.map +1 -1
  25. package/dist/cli/convoy/read-model.d.ts +8 -15
  26. package/dist/cli/convoy/read-model.d.ts.map +1 -1
  27. package/dist/cli/convoy/read-model.js +9 -68
  28. package/dist/cli/convoy/read-model.js.map +1 -1
  29. package/dist/cli/convoy/read-model.test.js +6 -25
  30. package/dist/cli/convoy/read-model.test.js.map +1 -1
  31. package/dist/cli/convoy/spec-builder.d.ts +2 -2
  32. package/dist/cli/convoy/spec-builder.d.ts.map +1 -1
  33. package/dist/cli/convoy/spec-builder.js +3 -3
  34. package/dist/cli/convoy/spec-builder.js.map +1 -1
  35. package/dist/cli/convoy/spec-builder.test.js +2 -2
  36. package/dist/cli/convoy/spec-builder.test.js.map +1 -1
  37. package/dist/cli/convoy-cmd.js +16 -16
  38. package/dist/cli/convoy-cmd.js.map +1 -1
  39. package/dist/cli/convoy-cmd.test.js +11 -11
  40. package/dist/cli/convoy-cmd.test.js.map +1 -1
  41. package/dist/cli/dashboard.js +3 -3
  42. package/dist/cli/dashboard.js.map +1 -1
  43. package/dist/cli/dashboard.test.js +10 -2
  44. package/dist/cli/dashboard.test.js.map +1 -1
  45. package/dist/cli/dispatcher.test.js +7 -4
  46. package/dist/cli/dispatcher.test.js.map +1 -1
  47. package/dist/cli/docs-accuracy.test.js +5 -1
  48. package/dist/cli/docs-accuracy.test.js.map +1 -1
  49. package/dist/cli/doctor.d.ts.map +1 -1
  50. package/dist/cli/doctor.js +17 -42
  51. package/dist/cli/doctor.js.map +1 -1
  52. package/dist/cli/explain.js +2 -2
  53. package/dist/cli/explain.js.map +1 -1
  54. package/dist/cli/fleet.js +1 -1
  55. package/dist/cli/github-report.js +5 -5
  56. package/dist/cli/github-report.js.map +1 -1
  57. package/dist/cli/gitignore.js +1 -1
  58. package/dist/cli/gitignore.js.map +1 -1
  59. package/dist/cli/init.d.ts.map +1 -1
  60. package/dist/cli/init.js +27 -10
  61. package/dist/cli/init.js.map +1 -1
  62. package/dist/cli/layers.js +4 -4
  63. package/dist/cli/layers.js.map +1 -1
  64. package/dist/cli/lesson.js +12 -12
  65. package/dist/cli/lesson.js.map +1 -1
  66. package/dist/cli/lessons.d.ts.map +1 -1
  67. package/dist/cli/lessons.js +11 -7
  68. package/dist/cli/lessons.js.map +1 -1
  69. package/dist/cli/managed-block.js +1 -1
  70. package/dist/cli/managed-block.js.map +1 -1
  71. package/dist/cli/mcp-audit.js +6 -6
  72. package/dist/cli/mcp-audit.js.map +1 -1
  73. package/dist/cli/mcp-audit.test.js +5 -5
  74. package/dist/cli/mcp-audit.test.js.map +1 -1
  75. package/dist/cli/pipeline.d.ts +1 -1
  76. package/dist/cli/pipeline.flow.test.js +77 -77
  77. package/dist/cli/pipeline.flow.test.js.map +1 -1
  78. package/dist/cli/pipeline.js +30 -30
  79. package/dist/cli/pipeline.js.map +1 -1
  80. package/dist/cli/plan.d.ts +8 -2
  81. package/dist/cli/plan.d.ts.map +1 -1
  82. package/dist/cli/plan.js +18 -12
  83. package/dist/cli/plan.js.map +1 -1
  84. package/dist/cli/plan.test.js +17 -19
  85. package/dist/cli/plan.test.js.map +1 -1
  86. package/dist/cli/plugin.js +8 -8
  87. package/dist/cli/plugin.js.map +1 -1
  88. package/dist/cli/promote.js +5 -5
  89. package/dist/cli/promote.js.map +1 -1
  90. package/dist/cli/prompt.d.ts.map +1 -1
  91. package/dist/cli/prompt.js +15 -2
  92. package/dist/cli/prompt.js.map +1 -1
  93. package/dist/cli/prompt.test.js +33 -8
  94. package/dist/cli/prompt.test.js.map +1 -1
  95. package/dist/cli/remove.js +1 -1
  96. package/dist/cli/review.js +3 -3
  97. package/dist/cli/review.js.map +1 -1
  98. package/dist/cli/run/adapters/index.js +3 -3
  99. package/dist/cli/run/adapters/index.js.map +1 -1
  100. package/dist/cli/run/adapters/index.test.js +3 -3
  101. package/dist/cli/run/adapters/index.test.js.map +1 -1
  102. package/dist/cli/run/schema.js +3 -3
  103. package/dist/cli/run/schema.js.map +1 -1
  104. package/dist/cli/run.js +21 -21
  105. package/dist/cli/run.js.map +1 -1
  106. package/dist/cli/run.test.js +3 -3
  107. package/dist/cli/run.test.js.map +1 -1
  108. package/dist/cli/stack-config-update.test.js +18 -1
  109. package/dist/cli/stack-config-update.test.js.map +1 -1
  110. package/dist/cli/stack-config.d.ts.map +1 -1
  111. package/dist/cli/stack-config.js +10 -1
  112. package/dist/cli/stack-config.js.map +1 -1
  113. package/dist/cli/status.js +9 -9
  114. package/dist/cli/status.js.map +1 -1
  115. package/dist/cli/status.test.js +3 -3
  116. package/dist/cli/status.test.js.map +1 -1
  117. package/dist/cli/sync-check.js +16 -16
  118. package/dist/cli/sync-check.js.map +1 -1
  119. package/dist/cli/sync.js +1 -1
  120. package/dist/cli/team-ci.test.js +3 -3
  121. package/dist/cli/team-ci.test.js.map +1 -1
  122. package/dist/cli/team-commands.test.js +30 -1
  123. package/dist/cli/team-commands.test.js.map +1 -1
  124. package/dist/cli/update.d.ts.map +1 -1
  125. package/dist/cli/update.js +34 -66
  126. package/dist/cli/update.js.map +1 -1
  127. package/package.json +1 -1
  128. package/src/cli/adapters/adapter-contract.test.ts +1 -1
  129. package/src/cli/adapters/single-file-base.ts +2 -11
  130. package/src/cli/add.ts +7 -7
  131. package/src/cli/baseline.ts +6 -6
  132. package/src/cli/bootstrap.test.ts +9 -0
  133. package/src/cli/bootstrap.ts +16 -6
  134. package/src/cli/ci.ts +17 -9
  135. package/src/cli/command-namespace.test.ts +5 -22
  136. package/src/cli/convoy/engine.test.ts +1 -1
  137. package/src/cli/convoy/engine.ts +3 -3
  138. package/src/{orchestrator/prompts/assess-complexity.prompt.md → cli/convoy/prompts/convoy-assess.prompt.md} +0 -3
  139. package/src/{orchestrator/prompts/fix-convoy.prompt.md → cli/convoy/prompts/convoy-plan-fix.prompt.md} +0 -3
  140. package/src/{orchestrator/prompts/validate-convoy.prompt.md → cli/convoy/prompts/convoy-plan-review.prompt.md} +0 -3
  141. package/src/{orchestrator/prompts/generate-convoy.prompt.md → cli/convoy/prompts/convoy-plan.prompt.md} +0 -2
  142. package/src/{orchestrator/prompts/fix-prd.prompt.md → cli/convoy/prompts/convoy-prd-fix.prompt.md} +0 -3
  143. package/src/{orchestrator/prompts/validate-prd.prompt.md → cli/convoy/prompts/convoy-prd-review.prompt.md} +0 -3
  144. package/src/{orchestrator/prompts/generate-prd.prompt.md → cli/convoy/prompts/convoy-prd.prompt.md} +0 -3
  145. package/src/cli/convoy/read-model.test.ts +5 -29
  146. package/src/cli/convoy/read-model.ts +11 -71
  147. package/src/cli/convoy/spec-builder.test.ts +2 -2
  148. package/src/cli/convoy/spec-builder.ts +4 -4
  149. package/src/cli/convoy-cmd.test.ts +11 -11
  150. package/src/cli/convoy-cmd.ts +18 -18
  151. package/src/cli/dashboard/dashboard.js +2 -4
  152. package/src/cli/dashboard.test.ts +10 -2
  153. package/src/cli/dashboard.ts +3 -3
  154. package/src/cli/dispatcher.test.ts +8 -4
  155. package/src/cli/docs-accuracy.test.ts +5 -1
  156. package/src/cli/doctor.ts +17 -43
  157. package/src/cli/explain.ts +2 -2
  158. package/src/cli/fleet.ts +1 -1
  159. package/src/cli/github-report.ts +5 -5
  160. package/src/cli/gitignore.ts +1 -1
  161. package/src/cli/init.ts +26 -10
  162. package/src/cli/layers.ts +4 -4
  163. package/src/cli/lesson.ts +12 -12
  164. package/src/cli/lessons.ts +11 -7
  165. package/src/cli/managed-block.ts +1 -1
  166. package/src/cli/mcp-audit.test.ts +5 -5
  167. package/src/cli/mcp-audit.ts +6 -6
  168. package/src/cli/pipeline.flow.test.ts +78 -78
  169. package/src/cli/pipeline.ts +31 -31
  170. package/src/cli/plan.test.ts +18 -20
  171. package/src/cli/plan.ts +18 -12
  172. package/src/cli/plugin.ts +8 -8
  173. package/src/cli/promote.ts +5 -5
  174. package/src/cli/prompt.test.ts +41 -13
  175. package/src/cli/prompt.ts +14 -2
  176. package/src/cli/remove.ts +1 -1
  177. package/src/cli/review.ts +3 -3
  178. package/src/cli/run/adapters/index.test.ts +3 -3
  179. package/src/cli/run/adapters/index.ts +3 -3
  180. package/src/cli/run/schema.ts +3 -3
  181. package/src/cli/run.test.ts +3 -3
  182. package/src/cli/run.ts +21 -21
  183. package/src/cli/stack-config-update.test.ts +22 -1
  184. package/src/cli/stack-config.ts +9 -1
  185. package/src/cli/status.test.ts +3 -3
  186. package/src/cli/status.ts +9 -9
  187. package/src/cli/sync-check.ts +16 -16
  188. package/src/cli/sync.ts +1 -1
  189. package/src/cli/team-ci.test.ts +3 -3
  190. package/src/cli/team-commands.test.ts +32 -1
  191. package/src/cli/update.ts +32 -74
  192. package/src/orchestrator/agent-workflows/README.md +10 -18
  193. package/src/orchestrator/agent-workflows/data-pipeline.md +7 -140
  194. package/src/orchestrator/agent-workflows/database-migration.md +7 -153
  195. package/src/orchestrator/agent-workflows/performance-optimization.md +6 -119
  196. package/src/orchestrator/agent-workflows/refactoring.md +8 -137
  197. package/src/orchestrator/agent-workflows/schema-changes.md +8 -159
  198. package/src/orchestrator/agent-workflows/security-audit.md +7 -142
  199. package/src/orchestrator/agent-workflows/shared-delivery-phase.md +8 -25
  200. package/src/orchestrator/agents/architect.agent.md +2 -14
  201. package/src/orchestrator/agents/content-engineer.agent.md +8 -10
  202. package/src/orchestrator/agents/data-engineer.agent.md +8 -8
  203. package/src/orchestrator/agents/developer.agent.md +3 -10
  204. package/src/orchestrator/agents/devops-expert.agent.md +0 -3
  205. package/src/orchestrator/agents/performance-expert.agent.md +2 -3
  206. package/src/orchestrator/agents/security-expert.agent.md +10 -12
  207. package/src/orchestrator/agents/team-lead.agent.md +31 -75
  208. package/src/orchestrator/agents/testing-expert.agent.md +3 -6
  209. package/src/orchestrator/agents/ui-ux-expert.agent.md +1 -4
  210. package/src/orchestrator/agents/writer.agent.md +0 -3
  211. package/src/orchestrator/customizations/LESSONS-LEARNED.md +5 -3
  212. package/src/orchestrator/customizations/README.md +3 -4
  213. package/src/orchestrator/customizations/agents/agent-registry.md +3 -3
  214. package/src/orchestrator/customizations/agents/skill-matrix.json +6 -42
  215. package/src/orchestrator/instructions/general.instructions.md +10 -37
  216. package/src/orchestrator/prompts/bootstrap-customizations.prompt.md +4 -6
  217. package/src/orchestrator/prompts/brainstorm.prompt.md +7 -12
  218. package/src/orchestrator/prompts/bug-fix.prompt.md +19 -100
  219. package/src/orchestrator/prompts/convoy.prompt.md +20 -0
  220. package/src/orchestrator/prompts/create-skill.prompt.md +1 -5
  221. package/src/orchestrator/prompts/implement-feature.prompt.md +22 -93
  222. package/src/orchestrator/prompts/resolve-pr-comments.prompt.md +1 -5
  223. package/src/orchestrator/skills/api-patterns/SKILL.md +21 -18
  224. package/src/orchestrator/skills/deployment-infrastructure/SKILL.md +1 -1
  225. package/src/orchestrator/skills/fast-review/SKILL.md +28 -65
  226. package/src/orchestrator/skills/frontend-design/REFERENCE.md +0 -1
  227. package/src/orchestrator/skills/frontend-design/SKILL.md +3 -1
  228. package/src/orchestrator/skills/git-workflow/SKILL.md +18 -34
  229. package/src/orchestrator/skills/panel-majority-vote/SKILL.md +16 -46
  230. package/src/orchestrator/skills/security-hardening/SKILL.md +20 -19
  231. package/src/orchestrator/skills/self-improvement/LESSON-CATEGORIES.md +2 -2
  232. package/src/orchestrator/skills/self-improvement/SKILL.md +21 -46
  233. package/src/orchestrator/skills/technical-writing/SKILL.md +3 -1
  234. package/src/orchestrator/skills/technical-writing/TEMPLATES.md +23 -0
  235. package/src/orchestrator/skills/testing-workflow/SKILL.md +21 -23
  236. package/src/orchestrator/skills/validation-gates/REFERENCE.md +2 -14
  237. package/src/orchestrator/skills/validation-gates/SKILL.md +10 -88
  238. package/dist/cli/log.d.ts +0 -44
  239. package/dist/cli/log.d.ts.map +0 -1
  240. package/dist/cli/log.js +0 -336
  241. package/dist/cli/log.js.map +0 -1
  242. package/dist/cli/log.test.d.ts +0 -2
  243. package/dist/cli/log.test.d.ts.map +0 -1
  244. package/dist/cli/log.test.js +0 -208
  245. package/dist/cli/log.test.js.map +0 -1
  246. package/src/cli/log.test.ts +0 -228
  247. package/src/cli/log.ts +0 -374
  248. package/src/orchestrator/agent-workflows/bug-fix.md +0 -130
  249. package/src/orchestrator/agent-workflows/feature-implementation.md +0 -232
  250. package/src/orchestrator/instructions/ai-optimization.instructions.md +0 -17
  251. package/src/orchestrator/prompts/quick-refinement.prompt.md +0 -110
  252. package/src/orchestrator/skills/agent-hooks/HOOKS-REFERENCE.md +0 -44
  253. package/src/orchestrator/skills/agent-hooks/SKILL.md +0 -80
  254. package/src/orchestrator/skills/agent-memory/KNOWLEDGE-GRAPH.md +0 -49
  255. package/src/orchestrator/skills/agent-memory/SKILL.md +0 -50
  256. package/src/orchestrator/skills/code-commenting/SKILL.md +0 -18
  257. package/src/orchestrator/skills/context-map/REFERENCE.md +0 -67
  258. package/src/orchestrator/skills/context-map/SKILL.md +0 -71
  259. package/src/orchestrator/skills/decomposition/SKILL.md +0 -103
  260. package/src/orchestrator/skills/documentation-standards/SKILL.md +0 -33
  261. package/src/orchestrator/skills/fast-review/REFERENCE.md +0 -28
  262. package/src/orchestrator/skills/memory-merger/SKILL.md +0 -77
  263. package/src/orchestrator/skills/observability-logging/LOG-SCHEMA.md +0 -238
  264. package/src/orchestrator/skills/observability-logging/SKILL.md +0 -73
  265. package/src/orchestrator/skills/orchestration-protocols/REFERENCE.md +0 -38
  266. package/src/orchestrator/skills/orchestration-protocols/SKILL.md +0 -120
  267. package/src/orchestrator/skills/panel-majority-vote/REFERENCE.md +0 -49
  268. package/src/orchestrator/skills/panel-majority-vote/panel-report.template.md +0 -38
  269. package/src/orchestrator/skills/performance-optimization/SKILL.md +0 -23
  270. package/src/orchestrator/skills/project-consistency/SKILL.md +0 -80
  271. package/src/orchestrator/skills/project-consistency/TEMPLATES.md +0 -35
  272. package/src/orchestrator/skills/react-development/SKILL.md +0 -24
  273. package/src/orchestrator/skills/session-checkpoints/CHECKPOINT-TEMPLATE.md +0 -56
  274. package/src/orchestrator/skills/session-checkpoints/SKILL.md +0 -40
  275. package/src/orchestrator/skills/team-lead-reference/SKILL.md +0 -126
@@ -1,55 +1,25 @@
1
1
  ---
2
2
  name: panel-majority-vote
3
- description: "Three isolated reviewers vote PASS or BLOCK; the majority decides. Use on the 3rd fast-review FAIL, for security-sensitive changes or database migrations, or when someone asks for an independent multi-reviewer panel."
3
+ description: "Three isolated reviewers vote PASS or BLOCK on a high-risk change; the majority decides, and every MUST-FIX any of them raises is fixed. Use for changes to auth, payments, data migrations or anything that deletes data, after a third fast-review FAIL, or when someone asks for an independent panel."
4
4
  ---
5
5
 
6
- # Skill: Panel majority vote
6
+ # Panel Majority Vote
7
7
 
8
- ## Inputs / Outputs
8
+ For changes where a missed defect is expensive: auth and permissions, payments, data migrations, anything that deletes data. Everything else gets one reviewer (**fast-review**).
9
9
 
10
- **Inputs:** `<runRoot>`, `<panelKey>` (filesystem-safe), question text, artifact list. Panel dir default: `<runRoot>/panel/`.
10
+ 1. **Ask one question** — "Is this change safe to merge?" — with what answers it: the diff, the acceptance criteria, the test results, the files involved.
11
+ 2. **Three reviewers, in parallel, in isolation.** Three sub-agents dispatched as the **Reviewer** with the identical prompt; none sees another's answer or the conversation. Each answers in exactly these sections:
11
12
 
12
- | File | Path |
13
- |------|------|
14
- | Prompt payload (optional) | `<panelDir>/<panelKey>-panel-prompt.md` |
15
- | Raw reviewer outputs | `<panelDir>/<panelKey>-reviewer-outputs.md` |
16
- | Consolidated report | `<panelDir>/<panelKey>.md` |
13
+ ```text
14
+ VERDICT: PASS | BLOCK
15
+ MUST-FIX: <defects that block, each with file:line>
16
+ SHOULD-FIX: <improvements>
17
+ QUESTIONS: <what the reviewer could not decide>
18
+ ```
17
19
 
20
+ Where it can, a reviewer exercises the change — runs the entrypoint, the migration, the request — rather than only reading the diff.
21
+ 3. **Count.** PASS when two or three say PASS; otherwise BLOCK.
22
+ 4. **Fix the union.** Every MUST-FIX any reviewer raised is fixed, or answered with evidence: one reviewer's catch counts, whatever the vote. Mark each with how many raised it (`2/3`).
23
+ 5. **On BLOCK,** change the work and run the panel again with the same question — never reword it to get a PASS. Blocked a second time: stop, and tell the user what blocks it.
18
24
 
19
- ## Procedure
20
-
21
- 1. **Validate scope** — every artifact path under `<runRoot>`; list sufficient to answer question.
22
-
23
- 2. **Spawn 3 reviewers in parallel** — three sub-agent dispatches with identical prompts (same question, artifact list, constraints), each isolated. Required reviewer output sections (no others): `VERDICT: PASS | BLOCK`, `MUST-FIX:`, `SHOULD-FIX:`, `QUESTIONS:`, `TEST IDEAS:`, `CONFIDENCE: low | med | high`.
24
-
25
- 3. **Persist outputs** — write `<panelDir>/<panelKey>-reviewer-outputs.md` with a header (run root, panel key, question, artifacts) and each reviewer output verbatim, separated.
26
-
27
- 4. **Consolidate** — parse each reviewer output for its `VERDICT:` line and count PASS votes. Overall verdict = PASS if pass_count ≥ 2; otherwise BLOCK. Deduplicate `MUST-FIX:` and `SHOULD-FIX:` items and annotate each item with `(N/3 reviewers)`.
28
-
29
- ```bash
30
- # count PASS/BLOCK from combined outputs
31
- pass_count=$(grep -o "VERDICT: PASS" panel/run123-reviewer-outputs.md | wc -l)
32
- block_count=$(grep -o "VERDICT: BLOCK" panel/run123-reviewer-outputs.md | wc -l)
33
- verdict=$([ "$pass_count" -ge 2 ] && echo PASS || echo BLOCK)
34
-
35
- # emit a minimal JSON summary using jq (install jq if needed)
36
- jq -n --arg panel_key "run123-panel" --arg verdict "$verdict" --argjson pass_count $pass_count --argjson block_count $block_count '{panel_key:$panel_key, verdict:$verdict, pass_count:$pass_count, block_count:$block_count}' > panel/run123-summary.json
37
- ```
38
-
39
- 5. **Write report** — create `<panelDir>/<panelKey>.md` from [panel-report.template.md](./panel-report.template.md), referencing the generated summary. Minimal structure:
40
-
41
- - Title: Panel `<panelKey>` — Verdict: `PASS | BLOCK` (pass_count/block_count)
42
- - Highlights: top deduplicated `MUST-FIX` and `SHOULD-FIX` items
43
- - Evidence: paths to reviewer outputs and `panel/run123-summary.json`
44
-
45
- 6. **Print summary** — overall verdict + vote tally + report path.
46
-
47
- 7. **Log (⛔ hard gate)** — call the **observability-logging** skill with `panel_key`, `verdict`, `pass_count`, `block_count`, `must_fix`, `should_fix`, `reviewer_model`, `weighted`, `attempt`, `tracker_issue`, `artifacts_count`, `report_path` for verification.
48
-
49
- ## Notes
50
-
51
- - On BLOCK: change underlying work; re-run; do not re-word question.
52
- - After 3 consecutive BLOCKs on the same panel key: create a dispute record per **team-lead-reference** § Dispute Protocol.
53
- - Model selection: same model for all 3 reviewers. See **team-lead-reference** for model routing.
54
- - Weighted consensus variant (domain-expertise weighting): see [REFERENCE.md](./REFERENCE.md).
55
-
25
+ Report the verdict, the tally, and each MUST-FIX with what was done about it.
@@ -1,35 +1,36 @@
1
1
  ---
2
2
  name: security-hardening
3
- description: "Security rules for authentication, authorization, RLS policies, CSP and headers, input validation and API routes. Use when building an auth flow, writing RLS policies, setting CSP or security headers, validating input, or auditing security."
3
+ description: "Security rules for authentication, authorization, data access policies, input handling, headers and CSP, secrets and scheduled routes. Use when building an auth flow, adding an endpoint or handler, writing access policies, setting security headers, handling user input, or auditing security."
4
4
  ---
5
5
 
6
6
  # Security Hardening
7
7
 
8
- ## Authentication
8
+ These hold whatever the stack. The stack's own rules — its auth library, its database's access policies, its framework's middleware — are in the skills bound to the **database** and **framework** slots of `.opencastle/agents/skill-matrix.json`.
9
9
 
10
- Resolve the auth library via the **database** capability slot in the skill matrix.
10
+ ## Authentication and sessions
11
11
 
12
- - Every sign in/up/out goes through a server-side POST handler with CSRF protection. Server Actions have it built in (POST-only, Origin checked).
13
- - Refresh the session in request middleware (`proxy.ts` on Next 16) with HTTP-only cookies, and check protected routes there too.
14
- - Store roles server-side, where the client cannot write them (for example a `profiles.roles` column behind RLS).
12
+ - Sign-in, sign-up and sign-out go through server-side handlers with CSRF protection: POST only, Origin checked.
13
+ - Sessions live in HTTP-only, `Secure`, `SameSite` cookies, and are refreshed and checked on the server for every protected route — never only in the client.
14
+ - Roles and permissions are stored server-side, where the client cannot write them.
15
15
 
16
- ## CSP
16
+ ## Authorization and data access
17
17
 
18
- Least privilege; whitelist only required external domains per directive (project-specific, see deployment customization). `'unsafe-inline'`/`'unsafe-eval'` may be needed in dev — use nonces/hashes in production. Validate shipped headers with `curl -I` against the preview URL.
18
+ - Check on the server, for every read and write, who is asking and whether they may touch *this* record. Hiding a button is not access control.
19
+ - Identity comes from the verified session, never from a request parameter.
20
+ - Where the data layer has policies (row-level security, rules), enable them on every table, deny by default and allow explicitly — and keep a test that proves another user reads nothing.
19
21
 
20
- ## RLS
22
+ ## Input and output
21
23
 
22
- > SQL examples and role system: see the **database** skill (authoritative source for RLS).
24
+ - Validate every handler's input with a schema before it reaches the database or another service. Client-side validation is feedback, not protection.
25
+ - Parameterized queries only. Sanitize user-supplied HTML (DOMPurify or the equivalent) before rendering it.
26
+ - Errors sent to the client carry no stack trace, query or internal id.
23
27
 
24
- - `ALTER TABLE x ENABLE ROW LEVEL SECURITY;` on every table — default-deny, explicit-allow.
25
- - `auth.uid()` for auth checks, EXISTS subqueries for role checks.
26
- - Never disable RLS in production; never rely on client-side authorization alone.
27
- - CI gate: assert `SELECT relrowsecurity FROM pg_class WHERE relname = 'your_table'` is true, plus a positive/negative row-visibility test (other role must read 0 rows). Block merges on failure.
28
+ ## Headers and CSP
28
29
 
29
- ## API Security
30
+ Least privilege: allow only the origins each directive needs, and nonces or hashes in production instead of `'unsafe-inline'` or `'unsafe-eval'`. Check what actually ships with `curl -I` against a preview URL: CSP, `Strict-Transport-Security`, `X-Content-Type-Options: nosniff`, `Referrer-Policy`.
30
31
 
31
- Cron routes: require `authorization: Bearer ${process.env.CRON_SECRET}`, else return 401. Generate with `openssl rand -hex 32`; rotate quarterly.
32
+ ## Secrets and scheduled routes
32
33
 
33
- Validate every Server Action and route handler input with a schema (e.g. Zod) before any DB operation. Client-side validation (e.g. React Hook Form) is for feedback only.
34
-
35
- Cross-reference: the **api-patterns** skill for Server Action patterns; the **session-checkpoints** skill for checkpointing security-sensitive work.
34
+ - Secrets live in environment variables — never in code, logs or the client bundle. A value the browser needs is public.
35
+ - A cron or webhook route checks a shared secret (`authorization: Bearer <secret>`, generated with `openssl rand -hex 32`) or the provider's signature, and answers 401 otherwise.
36
+ - Check a new dependency's audit (`npm audit`, or the project's equivalent) before adding it.
@@ -1,6 +1,6 @@
1
1
  # Lesson Categories & Severity
2
2
 
3
- The values `opencastle lesson` accepts. Anything else is refused.
3
+ The values `npx opencastle lesson` accepts. Anything else is refused.
4
4
 
5
5
  ## Categories
6
6
 
@@ -29,7 +29,7 @@ The values `opencastle lesson` accepts. Anything else is refused.
29
29
 
30
30
  ## What a lesson file looks like
31
31
 
32
- `opencastle lesson` writes `.opencastle/lessons/<id>.md`:
32
+ `npx opencastle lesson` writes `.opencastle/lessons/<id>.md`:
33
33
 
34
34
  ```markdown
35
35
  ---
@@ -1,72 +1,47 @@
1
1
  ---
2
2
  name: self-improvement
3
- description: "Records, searches and re-verifies lessons in .opencastle/lessons/ with the opencastle lesson CLI. Use when a retry succeeds or a task fails, before work past lessons may cover, or when doctor reports a lesson's cited code changed."
3
+ description: "Records, searches, re-verifies and graduates lessons in .opencastle/lessons/ with npx opencastle lesson. Use when a retry succeeds or a task fails, before work past lessons may cover, when doctor reports a lesson's cited code changed, or when the lessons index grows long."
4
4
  ---
5
5
 
6
- # Self-Improvement Protocol
6
+ # Self-Improvement
7
7
 
8
- ## Core Rule
8
+ When a retry with a different approach works, record what you learned before you move on. A lesson is a file in `.opencastle/lessons/`; `.opencastle/LESSONS-LEARNED.md` is the index every agent reads first, rewritten from those files by every sync — never edit it by hand.
9
9
 
10
- **Retry with different approach and it works → record a lesson immediately.** Lessons live in `.opencastle/lessons/`, one Markdown file each; `.opencastle/LESSONS-LEARNED.md` is the index of them every agent reads first.
11
-
12
- ## Writing a Lesson
13
-
14
- > **⛔ HARD GATE — Use the CLI. Never write in `LESSONS-LEARNED.md`: it is rewritten from `lessons/` by every sync.**
10
+ ## Record a lesson
15
11
 
16
12
  ```sh
17
- opencastle lesson --title "Short descriptive title" --category general --severity high \
13
+ npx opencastle lesson --title "Short descriptive title" --category terminal --severity high \
18
14
  --problem "What was observed" --wrong "Failing approach" --correct "Working solution" \
19
15
  --why "Root cause" --cite src/lib/payments.ts:42
20
16
  ```
21
17
 
22
- Required: `--title`, `--category`, `--severity`, `--problem` · Optional: `--wrong`, `--correct`, `--why`, `--cite` (repeatable)
23
-
24
- `--cite` names the code the lesson is about, relative to the project root. When that code changes, `doctor` says the lesson may no longer hold — cite whenever the lesson is about a specific file.
25
-
26
- The command prints the new lesson's id (`2026-10-02-short-descriptive-title`). It refuses a lesson that would commit a credential, and a citation that does not exist.
27
-
28
- After writing: if the lesson reveals a gap in a skill or instruction file, update that file too (prevents the pitfall at source).
29
-
30
- ## Workflow
18
+ - Required: `--title`, `--category`, `--severity`, `--problem`. Fill `--wrong` and `--correct` too: the contrast is what makes a lesson usable. The categories, and when each applies: [LESSON-CATEGORIES.md](LESSON-CATEGORIES.md).
19
+ - `--cite` the code the lesson is about. When that code changes, `doctor` says the lesson may no longer hold.
20
+ - Exact error messages and commands, in code blocks. Never a token, key or password: describe it instead ("the Stripe test key in `.env`").
21
+ - One lesson per command. It prints the new id, and refuses a lesson holding a credential or citing a file that does not exist.
22
+ - A lesson that shows a gap in a skill or an instruction file: fix that file too.
31
23
 
32
- 1. Search past lessons for matching entries or similar errors (below).
33
- 2. Attempt task with conservative flags/options informed by lessons.
34
- 3. On failure: retry with modified approach (up to threshold); capture error details, context.
35
- 4. On success: run `opencastle lesson` to record the working approach.
36
- 5. Verify: the command printed an id, and `.opencastle/lessons/<id>.md` holds the title, category and severity you gave. If malformed → fix the flags and run it again, then delete the bad file.
37
- 6. If the lesson indicates a needed skill/instruction update: draft the change; propose a PR.
38
-
39
- Search the lessons themselves, not the index — the index has titles only:
24
+ Search the lessons themselves first — the index has titles only — so you do not record one twice:
40
25
 
41
26
  ```bash
42
27
  rg -i "CRON_SECRET" .opencastle/lessons/ || true
43
28
  ```
44
29
 
45
- ## When code a lesson cites has changed
30
+ ## When cited code has changed
46
31
 
47
- `doctor` names it: `<id> cites <file>, which has changed since it was verified`. Read the lesson against the code now:
32
+ `doctor` names it: `<id> cites <file>, which has changed since it was verified`. Read the lesson against the code:
48
33
 
49
34
  | Still true? | Run |
50
35
  |-------------|-----|
51
- | Yes, file unchanged in substance | `opencastle lesson verify <id>` |
52
- | Yes, but the code moved | `opencastle lesson verify <id> --cite <new/path.ts>` |
53
- | No longer applies | `opencastle lesson archive <id> --into <file that now covers it>` |
54
-
55
- ## Categories & Severity
56
-
57
- Valid `--category` and `--severity` values: [LESSON-CATEGORIES.md](LESSON-CATEGORIES.md).
58
-
59
- ## Quality Rules
60
-
61
- - Include exact error messages, commands, tool parameters
62
- - Always fill both `--wrong` and `--correct` — the contrast is what makes the lesson usable
63
- - One lesson per command; code blocks mandatory for commands
64
- - Never paste a token, key or password — describe it ("the Stripe test key in `.env`")
36
+ | Yes | `npx opencastle lesson verify <id>` |
37
+ | Yes, but the code moved | `npx opencastle lesson verify <id> --cite <new/path.ts>` |
38
+ | No longer | `npx opencastle lesson archive <id> --into <file that now covers it>` |
65
39
 
66
- ## Anti-Patterns
40
+ ## Graduate lessons
67
41
 
68
- Never duplicate an existing lesson · Never defer recording to end of session · Never edit `LESSONS-LEARNED.md` by hand
42
+ Every agent reads every active lesson before every task, so a lesson that has proven itself belongs in the skill or instruction file it is about, where only the agents that need it read it. `doctor` warns when the index passes about 2,000 tokens. Candidates: older than 60 days and still true, a problem two lessons describe, or `severity: high`.
69
43
 
70
- ## Agent Memory
44
+ 1. Rewrite it as a rule or an example in that file, beside the rules it belongs with — a rule, not an incident report, and no new file.
45
+ 2. `npx opencastle lesson archive <id> --into <that file>`. The lesson keeps its file and moves to the index's Archived section; never delete one.
71
46
 
72
- For expertise tracking, cross-session knowledge graphs, load **agent-memory** skill.
47
+ Resolve two lessons that contradict each other before you merge either.
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: technical-writing
3
- description: "Standard for technical prose in four layers: Diataxis document modes, Google developer style, Simplified Technical English and Global English. Use when writing or reviewing docs, RFCs, README files, PR descriptions or commit messages."
3
+ description: "Standard for technical prose in four layers: Diataxis document modes, Google developer style, Simplified Technical English and Global English, with templates for ADRs, changelogs and known issues. Use when writing or reviewing docs, RFCs, README files, ADRs, changelog entries, PR descriptions or commit messages."
4
4
  ---
5
5
 
6
6
  # Technical Writing
@@ -9,6 +9,8 @@ The goal is writing a tired engineer understands on the first read. Four layers
9
9
 
10
10
  Word-level cuts (filler, fancy synonyms, passive voice, hedging, AI vocabulary) are **unslop**'s job. One rule sits above the layers: **when a rule makes a sentence worse, fix it another way or leave it alone.** A sentence that follows every rule and sounds machine written has failed.
11
11
 
12
+ Templates for an ADR, a changelog entry, a known issue and a Mermaid diagram: [TEMPLATES.md](TEMPLATES.md).
13
+
12
14
  The codebase is the word list. Write the real symbol, file, flag, or command name, never a synonym or a description of it. Do not invent jargon; use the words a developer says out loud.
13
15
 
14
16
  ## Layer 1: pick the mode (Diataxis)
@@ -0,0 +1,23 @@
1
+ # Document Templates
2
+
3
+ Shapes for the documents a project keeps. Write the prose in each by the rest of **technical-writing**, then run **unslop**. The project's own documents are listed under Key Documentation in `.opencastle/project.instructions.md`.
4
+
5
+ **Known issue** (`.opencastle/KNOWN-ISSUES.md`) — `### ISSUE-ID: Brief Description`, then: Status (Known Limitation | Fixed | Workaround Available), Severity (Critical | High | Medium | Low), Impact, Problem, Root Cause, Solution Options (numbered, each with pros and cons), Related Files (path — what it does).
6
+
7
+ **ADR** — `## ADR-NNN: Decision Title`, then: Date, Status (Accepted | Superseded | Deprecated), Context, Decision, Consequences, Alternatives Considered.
8
+
9
+ **Changelog** — under a `## [1.2.0] - YYYY-MM-DD` heading, group changes as Added / Changed / Fixed / Removed, one imperative line per change with its PR or issue number, most recent version first. Breaking changes lead their group.
10
+
11
+ **Roadmap entry done** — mark it complete with the date and owner, the files it changed, and the command that verified it; then move it to the Completed section with a one-line release note.
12
+
13
+ ## Mermaid diagrams
14
+
15
+ One concern per diagram, at most 10–12 nodes. `flowchart TD` for pipelines, `LR` for request flows, `sequenceDiagram` for API flows, `erDiagram` for data models. Verbs on the arrows; a `%% Title: ...` line on a complex diagram.
16
+
17
+ ## Check before committing
18
+
19
+ Run the project's formatter on the docs (Key Commands), and check the links:
20
+
21
+ ```bash
22
+ npx markdown-link-check docs/**/*.md
23
+ ```
@@ -1,37 +1,35 @@
1
1
  ---
2
2
  name: testing-workflow
3
- description: "Plans tests, writes unit, integration and E2E tests, finds coverage gaps and flags testing anti-patterns. Use when writing or planning tests, mocking dependencies, or checking coverage."
3
+ description: "How to test a change: test first, what to cover, what to mock, and the anti-patterns that let tests pass without proving anything. Use when writing or planning tests, mocking a dependency, fixing a flaky test, or checking coverage."
4
4
  ---
5
5
 
6
6
  # Testing Workflow
7
7
 
8
- **Mandatory:** test in a real browser via the **e2e-testing** capability slot before marking any feature complete, including every project-defined responsive breakpoint (**validation-gates** Gate 7, **browser-testing** skill).
8
+ The project's test runner, its config and its commands are in the Project Context (Key Commands) and the skill bound to the **testing** slot; browser and E2E tests, in the skill bound to **e2e-testing**, and **browser-testing**.
9
9
 
10
- ## E2E Context Limits
10
+ ## Test first
11
11
 
12
- | Rule | Detail |
13
- |------|--------|
14
- | One suite per session | never run all suites in one conversation |
15
- | Max 3 screenshots | per session |
16
- | `evaluate_script()` over `take_snapshot()` | returns less data |
17
- | Reload between flows | clears state |
18
- | Report results | in the session output: suite, pass/fail counts, failures with their evidence |
12
+ 1. Write the test for the behaviour you are about to add or fix, and watch it fail, for the reason you expect. A test that has never failed proves nothing.
13
+ 2. Write the least code that makes it pass.
14
+ 3. Clean up with the test green.
19
15
 
20
- Suite files and project test config: `.opencastle/project.instructions.md`.
16
+ A bug fix starts with a test that reproduces the bug.
21
17
 
22
- ## Coverage
18
+ ## What to cover
23
19
 
24
- | Layer | Minimum |
25
- |-------|---------|
26
- | Unit (functions, components, hooks) | the threshold in the project's test config |
27
- | Integration (boundaries, URL sync) | all boundaries |
28
- | E2E (journeys, interactions, errors) | all critical paths |
20
+ - **Behaviour, not implementation:** inputs and outputs, what the user sees, what is stored. A refactor that keeps the behaviour keeps the tests green.
21
+ - **Past the happy path:** empty results, the boundaries, invalid input, a failing network or dependency, the same action twice.
22
+ - **That interactions change something:** assert that a control changes the result — not only that it renders — and assert the values, not a screenshot.
23
+ - **Coverage** at the threshold in the project's test config; integration tests at each boundary (API, database, URL state); E2E tests on the critical journeys.
29
24
 
30
- Verify with the project's own test and coverage commands (Key Commands in `.opencastle/project.instructions.md`).
25
+ ## Mocks
31
26
 
32
- ## Anti-Patterns
27
+ Mock what you do not own — external APIs, the clock, randomness — at the boundary. Never mock the module under test, and never assert on a mock's own behaviour: that tests the mock.
33
28
 
34
- - Testing only initial page load — exercise state/filter changes and confirm results actually differ.
35
- - Assuming a control works because it renders — verify each option changes results and triggers a server request.
36
- - Single scenario — cover empty results, min/max boundaries, invalid input, network errors.
37
- - Visual inspection only — assert data values and URL parameters programmatically.
29
+ ## Flaky tests
30
+
31
+ No `sleep`: wait for the condition (`waitFor`, an assertion that polls). Reset state between tests. A test that fails one run in ten is a bug — fix it or delete it; never retry it into green.
32
+
33
+ ## E2E in an agent session
34
+
35
+ One suite per session, at most three screenshots, a reload between flows, and the results in your answer: the suite, the counts, and each failure with its evidence.
@@ -1,6 +1,6 @@
1
- # Validation Gates Reference
1
+ # New Dependencies: the Full Check
2
2
 
3
- ## Gate 4: Full Dependency Audit Checklist
3
+ For a JavaScript project; other ecosystems have the same checks under their own tools.
4
4
 
5
5
  | Check | Tool / Command | Pass Criteria | On Failure |
6
6
  |-------|---------------|---------------|------------|
@@ -11,15 +11,3 @@
11
11
  | Maintenance | Check npm page / GitHub | Last publish <18 months; >100 weekly downloads | Evaluate alternatives |
12
12
  | Peer deps | `npm ls --depth=0` | No unmet peer dependencies | Fix before merge |
13
13
  | Type coverage | `npx @arethetypeswrong/cli <pkg>` | No `false` CJS/ESM resolution | SHOULD-FIX for new deps |
14
-
15
- ## Gate 7: Viewport Presets
16
-
17
- When the project names no breakpoints of its own (`.opencastle/stack/testing-config.md`):
18
-
19
- | Preset | Width × Height |
20
- |--------|---------------|
21
- | `mobile` | 375 × 812 |
22
- | `tablet` | 768 × 1024 |
23
- | `desktop` | 1440 × 900 |
24
-
25
- Resize with `resize_page`, check console errors with `list_console_messages`; the rest is in the **browser-testing** skill.
@@ -1,95 +1,17 @@
1
1
  ---
2
2
  name: validation-gates
3
- description: "Defines the ten gates delegated work passes, from secret scanning and lint/test/build to blast radius, dependency audit, browser, regression and smoke tests. Use when deciding which checks a change needs, or whether work is ready to merge or deploy."
3
+ description: "The checks a change passes before it is done or merged: secrets, the project's tests, lint and build, size, new dependencies, the browser for UI, review, regression and a smoke test. Use when deciding which checks a change needs, or whether work is ready to merge or deploy."
4
4
  ---
5
5
 
6
6
  # Validation Gates
7
7
 
8
- The project's commands live under Key Commands in `.opencastle/project.instructions.md`; with a task runner (Nx, Turborepo), its skill has them. Every gate below runs those, never a guessed `npm run …`.
8
+ Every command here is the project's own: Key Commands in `.opencastle/project.instructions.md`, or the task runner's skill (Nx, Turborepo). Never a guessed `npm run …`. Run them in this order; when one fails, fix it and start again.
9
9
 
10
- | Gate | Name | Runs When |
11
- |------|------|-----------|
12
- | 1 | Secret Scanning | Every delegation |
13
- | 2 | Deterministic Checks | Every delegation |
14
- | 3 | Blast Radius Check | Every delegation |
15
- | 4 | Dependency Audit | When `package.json` or lockfiles change |
16
- | 5 | Fast Review | Every delegation (with auto-PASS exceptions) |
17
- | 6 | Cache Clearing | Only when a stale cache is suspected |
18
- | 7 | Browser Testing | UI changes |
19
- | 8 | Regression Testing | Every delegation |
20
- | 9 | Panel Review | High-stakes changes only |
21
- | 10 | Final Smoke Test | Feature completion (after all tasks Done) |
22
-
23
- ## Gate 1: Secret Scanning
24
-
25
- **Secret scan (Constitution rule 1).** Block on any token, key, password, or
26
- connection string in code, logs, commits, or terminal output.
27
-
28
- Scan for: AWS keys (`AKIA...`), API tokens (`sk-...`, `ghp_...`), private keys,
29
- database URIs, hardcoded `password`/`secret`/`api_key`/`token` assignments
30
- (assignments, not references), `.env` contents pasted into source, and
31
- base64-encoded secrets.
32
-
33
- On a hit: block, name the file and line, and re-delegate with an instruction to use
34
- an environment variable. Already committed? Rotate it - git history is permanent.
35
-
36
- Not a hit: obviously fake test fixtures (`sk-test-1234567890`), documentation
37
- placeholders (`YOUR_API_KEY_HERE`), and pattern matches inside explanatory
38
- comments.
39
-
40
- Scan every diff **before** any other gate: `gitleaks git --redact --log-opts="main..HEAD"` for the branch's commits, `gitleaks dir <path>` for uncommitted files (or the CI equivalent). Fail on any finding.
41
-
42
- ## Gate 2: Deterministic Checks
43
-
44
- Run the project's own lint (with auto-fix), test and build commands for every affected project. All must pass with zero errors.
45
-
46
- ## Gate 3: Blast Radius Check
47
-
48
- | Metric | Normal | Warning | Escalate |
49
- |--------|--------|---------|----------|
50
- | Lines changed | ≤200 | 201–500 | >500 |
51
- | Files changed | ≤5 | 6–10 | >10 |
52
- | Projects affected | ≤1 | 2 | >2 |
53
-
54
- - **Normal** — proceed
55
- - **Warning** — log; investigate partition drift
56
- - **Escalate** — STOP; verify partition; split or revert; no auto-PASS
57
-
58
- **Sensitive files** (always Warning): `**/auth/**`, DB migrations, `next.config.*`, `.env*`, `.github/workflows/**`, lockfiles — also triggers Gate 4.
59
-
60
- ## Gate 4: Dependency Audit
61
-
62
- > Runs only when `package.json`, `yarn.lock`, `package-lock.json`, `pnpm-lock.yaml`, or similar lockfiles are modified.
63
-
64
- - **Vulnerability:** `npm audit --audit-level=high` — no new high/critical, else BLOCK (patched version or alternative).
65
- - **Bundle size:** frontend pkgs ≤50KB gzipped (project policy) — SHOULD-FIX; blocking if >200KB.
66
-
67
- Full checklist (license, duplicates, maintenance, peer deps, type coverage) with commands: [REFERENCE.md](REFERENCE.md).
68
-
69
- ## Gate 5: Fast Review
70
-
71
- Spawn a reviewer sub-agent (load **fast-review**). Auto-PASS rules, retries and escalation: the **fast-review** Handle Verdict table.
72
-
73
- ## Gate 6: Cache Clearing
74
-
75
- Skip unless a stale cache is the suspect: the browser shows old output, or a build reports files that no longer exist. Then clear the framework cache (e.g. `.next/cache`, `node_modules/.cache`) and the project's own build output directory, named in its build config, and rebuild.
76
-
77
- ## Gate 7: Browser Testing
78
-
79
- UI changes are verified in Chrome with the **browser-testing** skill (Chrome DevTools MCP: `navigate_page`, `take_snapshot`, `evaluate_script` with a `function`). Start the dev server → verify ACs → every project breakpoint → at most 3 screenshots, as evidence.
80
-
81
- ## Gate 8: Regression Testing
82
-
83
- 1. Full test suite for all affected projects.
84
- 2. Browser-test adjacent pages (navigation, routing, back-button) — find them via `rg "href=\"/changed-path|import .*from '@/components/changed'"`.
85
- 3. Find consuming apps/packages via `rg "from '@/components/PriceRange'|@my-org/ui-package"`; run their tests or smoke builds.
86
-
87
- ## Gate 9: Panel Review
88
-
89
- Load **panel-majority-vote** — 3 isolated reviewers, majority (2/3) wins. Use for: the 3rd fast-review FAIL, security-sensitive changes, DB migrations.
90
-
91
- ## Gate 10: Final Smoke Test
92
-
93
- > Runs once after ALL tasks are Done.
94
-
95
- The project's full build and test commands, its E2E suite included, from a clean state → E2E browser walkthrough → cross-task integration check → responsive sweep (if UI). On failure: re-delegate specific failing integration only.
10
+ 1. **Secrets.** No token, key, password or connection string in the diff, the logs or the output. With gitleaks installed: `gitleaks git --redact --log-opts="main..HEAD"` for the branch's commits, `gitleaks dir <path>` for files not yet committed. Without it, read the diff for keys (`AKIA…`, `sk-…`, `ghp_…`), private keys, connection strings and `password = "…"` assignments; fake fixtures and placeholders are not hits. A real secret that was committed must be rotated: git history keeps it.
11
+ 2. **Tests, lint, build** for every project the change touches, with zero errors. Lint with auto-fix first.
12
+ 3. **Size.** Over 500 changed lines, 10 files or 2 projects: stop and check the change has not drifted beyond its task, and split it if it can be split.
13
+ 4. **New dependencies** — when a manifest or lockfile changed: the package manager's audit at high severity (`npm audit --audit-level=high`, `pnpm audit`, `pip-audit`) finds nothing new, and the package is maintained, its licence fits, and it does not duplicate one already used ([REFERENCE.md](REFERENCE.md) has the commands).
14
+ 5. **Browser** — UI changes only: it works in a browser at every breakpoint the project uses, with no console errors (**browser-testing**). A stale page, or a build that lists deleted files: clear the framework's cache and rebuild first.
15
+ 6. **Review** — **fast-review**; **panel-majority-vote** for auth, payments, migrations or deleting data.
16
+ 7. **Regression** — the whole test suite of every project that uses what changed, not only the tests you touched.
17
+ 8. **Smoke test** — when a feature is complete: walk its main path end to end, from a clean build, as a user would.
package/dist/cli/log.d.ts DELETED
@@ -1,44 +0,0 @@
1
- import type { CliContext } from './types.js';
2
- /**
3
- * `opencastle log` — append one agent record to `.opencastle/logs/events.ndjson`.
4
- *
5
- * Agents call this from generated instructions, so a record it accepts is a
6
- * record every reader of the log has to cope with. It used to accept anything:
7
- * `--type session` with no fields, `--outcome banana`, a value-less `--model`
8
- * stored as `true`, `--task 007` stored as the number 7, `--agnet`, and a
9
- * caller-supplied `--timestamp yesterday`. Each record type is now checked
10
- * against the schema in `skills/observability-logging/LOG-SCHEMA.md`, field by field, and a
11
- * record that does not match is refused with every reason at once.
12
- */
13
- type Kind = 'text' | 'count' | 'number' | 'boolean' | 'list';
14
- interface Field {
15
- kind: Kind;
16
- required: boolean;
17
- /** The only values a text field may take. */
18
- values?: readonly string[];
19
- /** Smallest value of a count. */
20
- min?: number;
21
- }
22
- /** The record schemas, as `skills/observability-logging/LOG-SCHEMA.md` documents them. `log.test.ts` holds the two together. */
23
- export declare const LOG_RECORDS: Record<string, Record<string, Field>>;
24
- export type ParsedLog = {
25
- ok: true;
26
- help: true;
27
- } | {
28
- ok: true;
29
- help: false;
30
- record: Record<string, unknown>;
31
- logsDir: string | null;
32
- dryRun: boolean;
33
- } | {
34
- ok: false;
35
- errors: string[];
36
- type: string | null;
37
- };
38
- /** Read `opencastle log` arguments into a checked record, or every reason it is not one. */
39
- export declare function parseLogArgs(args: string[], now?: Date): ParsedLog;
40
- /** Append a structured event record to events.ndjson. */
41
- export declare function appendEvent(record: Record<string, unknown>, logsDir?: string | null): Promise<void>;
42
- export default function log({ args }: CliContext): Promise<void>;
43
- export {};
44
- //# sourceMappingURL=log.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"log.d.ts","sourceRoot":"","sources":["../../src/cli/log.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,YAAY,CAAA;AAE5C;;;;;;;;;;GAUG;AAEH,KAAK,IAAI,GAAG,MAAM,GAAG,OAAO,GAAG,QAAQ,GAAG,SAAS,GAAG,MAAM,CAAA;AAE5D,UAAU,KAAK;IACb,IAAI,EAAE,IAAI,CAAA;IACV,QAAQ,EAAE,OAAO,CAAA;IACjB,6CAA6C;IAC7C,MAAM,CAAC,EAAE,SAAS,MAAM,EAAE,CAAA;IAC1B,iCAAiC;IACjC,GAAG,CAAC,EAAE,MAAM,CAAA;CACb;AAQD,gIAAgI;AAChI,eAAO,MAAM,WAAW,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,KAAK,CAAC,CAiE7D,CAAA;AA8DD,MAAM,MAAM,SAAS,GACjB;IAAE,EAAE,EAAE,IAAI,CAAC;IAAC,IAAI,EAAE,IAAI,CAAA;CAAE,GACxB;IAAE,EAAE,EAAE,IAAI,CAAC;IAAC,IAAI,EAAE,KAAK,CAAC;IAAC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAAC,OAAO,EAAE,MAAM,GAAG,IAAI,CAAC;IAAC,MAAM,EAAE,OAAO,CAAA;CAAE,GACnG;IAAE,EAAE,EAAE,KAAK,CAAC;IAAC,MAAM,EAAE,MAAM,EAAE,CAAC;IAAC,IAAI,EAAE,MAAM,GAAG,IAAI,CAAA;CAAE,CAAA;AAExD,4FAA4F;AAC5F,wBAAgB,YAAY,CAAC,IAAI,EAAE,MAAM,EAAE,EAAE,GAAG,GAAE,IAAiB,GAAG,SAAS,CA6F9E;AA6DD,yDAAyD;AACzD,wBAAsB,WAAW,CAC/B,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAC/B,OAAO,CAAC,EAAE,MAAM,GAAG,IAAI,GACtB,OAAO,CAAC,IAAI,CAAC,CAgBf;AAED,wBAA8B,GAAG,CAAC,EAAE,IAAI,EAAE,EAAE,UAAU,GAAG,OAAO,CAAC,IAAI,CAAC,CA2BrE"}