@event4u/agent-config 8.9.0 → 8.11.0

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 (267) hide show
  1. package/.claude-plugin/marketplace.json +1 -1
  2. package/CHANGELOG.md +189 -0
  3. package/README.md +5 -5
  4. package/dist/agent-src/commands/challenge-me/vision.md +121 -32
  5. package/dist/agent-src/commands/challenge-me/with-docs.md +21 -8
  6. package/dist/agent-src/commands/commit/in-chunks.md +1 -1
  7. package/dist/agent-src/commands/commit.md +2 -1
  8. package/dist/agent-src/commands/cost/report.md +14 -3
  9. package/dist/agent-src/commands/feature/dev.md +4 -4
  10. package/dist/agent-src/commands/humanize.md +101 -0
  11. package/dist/agent-src/commands/jira-ticket.md +2 -2
  12. package/dist/agent-src/commands/memory/load.md +15 -0
  13. package/dist/agent-src/commands/optimize/project.md +12 -0
  14. package/dist/agent-src/commands/roadmap/create.md +12 -11
  15. package/dist/agent-src/commands/tests/create.md +29 -7
  16. package/dist/agent-src/commands/work.md +33 -0
  17. package/dist/agent-src/commands/worktree/cleanup.md +83 -0
  18. package/dist/agent-src/commands/worktree/create.md +64 -0
  19. package/dist/agent-src/commands/worktree/status.md +75 -0
  20. package/dist/agent-src/commands/worktree/verify.md +70 -0
  21. package/dist/agent-src/commands/worktree.md +85 -0
  22. package/dist/agent-src/contexts/execution/autonomy-mechanics.md +66 -0
  23. package/dist/agent-src/contexts/execution/orchestration-benchmark-gate.md +1 -0
  24. package/dist/agent-src/contexts/execution/orchestration-telemetry.md +91 -34
  25. package/dist/agent-src/contexts/execution/roadmap-process-loop.md +14 -0
  26. package/dist/agent-src/contexts/execution/roadmap-writing-source-derived.md +65 -0
  27. package/dist/agent-src/contexts/execution/subagent-modes-detail.md +84 -0
  28. package/dist/agent-src/rules/autonomous-execution.md +7 -37
  29. package/dist/agent-src/rules/broken-access-control.md +7 -45
  30. package/dist/agent-src/rules/code-comment-discipline.md +148 -0
  31. package/dist/agent-src/rules/context-hygiene.md +14 -0
  32. package/dist/agent-src/rules/delegation-policy.md +10 -8
  33. package/dist/agent-src/rules/design-fidelity.md +44 -0
  34. package/dist/agent-src/rules/git-history-discipline.md +4 -79
  35. package/dist/agent-src/rules/legal-safety-floor.md +11 -55
  36. package/dist/agent-src/rules/roadmap-progress-sync.md +5 -56
  37. package/dist/agent-src/rules/spreadsheet-source-quality.md +61 -0
  38. package/dist/agent-src/rules/think-before-action.md +10 -0
  39. package/dist/agent-src/rules/verify-before-complete.md +12 -0
  40. package/dist/agent-src/skills/accessibility-auditor/evals/evals.json +15 -0
  41. package/dist/agent-src/skills/agent-docs-writing/SKILL.md +13 -12
  42. package/dist/agent-src/skills/ai-council/SKILL.md +19 -9
  43. package/dist/agent-src/skills/analysis-skill-router/evals/evals.json +13 -0
  44. package/dist/agent-src/skills/api-design/SKILL.md +7 -5
  45. package/dist/agent-src/skills/api-testing/SKILL.md +16 -2
  46. package/dist/agent-src/skills/authz-review/SKILL.md +59 -2
  47. package/dist/agent-src/skills/blast-radius-analyzer/SKILL.md +1 -1
  48. package/dist/agent-src/skills/bug-analyzer/SKILL.md +19 -16
  49. package/dist/agent-src/skills/character-consistency/evals/evals.json +16 -0
  50. package/dist/agent-src/skills/code-refactoring/SKILL.md +9 -9
  51. package/dist/agent-src/skills/command-routing/evals/evals.json +14 -0
  52. package/dist/agent-src/skills/content-funnel-design/SKILL.md +2 -0
  53. package/dist/agent-src/skills/dashboard-design/evals/evals.json +16 -0
  54. package/dist/agent-src/skills/data-flow-mapper/SKILL.md +1 -1
  55. package/dist/agent-src/skills/dcf-modeling/evals/evals.json +20 -0
  56. package/dist/agent-src/skills/decision-record/evals/evals.json +20 -0
  57. package/dist/agent-src/skills/defense-in-depth/SKILL.md +2 -2
  58. package/dist/agent-src/skills/dependency-upgrade/SKILL.md +7 -7
  59. package/dist/agent-src/skills/design-intelligence/SKILL.md +8 -8
  60. package/dist/agent-src/skills/design-intelligence/evals/evals.json +14 -0
  61. package/dist/agent-src/skills/design-review/SKILL.md +29 -2
  62. package/dist/agent-src/skills/design-system-capture/SKILL.md +21 -0
  63. package/dist/agent-src/skills/design-system-capture/evals/evals.json +15 -0
  64. package/dist/agent-src/skills/developer-like-execution/evals/evals.json +16 -0
  65. package/dist/agent-src/skills/doc-coauthoring/SKILL.md +29 -0
  66. package/dist/agent-src/skills/doc-coauthoring/evals/evals.json +16 -0
  67. package/dist/agent-src/skills/editorial-calendar/SKILL.md +2 -0
  68. package/dist/agent-src/skills/editorial-calendar/evals/domain-truth.json +16 -0
  69. package/dist/agent-src/skills/editorial-calendar/evals/evals.json +16 -0
  70. package/dist/agent-src/skills/estimate-ticket/evals/evals.json +16 -0
  71. package/dist/agent-src/skills/existing-ui-audit/SKILL.md +30 -0
  72. package/dist/agent-src/skills/existing-ui-audit/evals/triggers.json +47 -0
  73. package/dist/agent-src/skills/fe-design/SKILL.md +43 -14
  74. package/dist/agent-src/skills/fe-design/evals/triggers.json +47 -0
  75. package/dist/agent-src/skills/forecasting/evals/evals.json +20 -0
  76. package/dist/agent-src/skills/fundraising-narrative/evals/domain-truth.json +16 -0
  77. package/dist/agent-src/skills/fundraising-narrative/evals/evals.json +16 -0
  78. package/dist/agent-src/skills/git-workflow/SKILL.md +86 -0
  79. package/dist/agent-src/skills/html-deck/SKILL.md +27 -0
  80. package/dist/agent-src/skills/humanizer/SKILL.md +147 -0
  81. package/dist/agent-src/skills/humanizer/data/patterns.md +190 -0
  82. package/dist/agent-src/skills/humanizer/evals/triggers.json +17 -0
  83. package/dist/agent-src/skills/iconography/SKILL.md +24 -0
  84. package/dist/agent-src/skills/incident-commander/evals/domain-truth.json +16 -0
  85. package/dist/agent-src/skills/incident-commander/evals/evals.json +20 -0
  86. package/dist/agent-src/skills/laravel/SKILL.md +14 -1
  87. package/dist/agent-src/skills/launch-readiness/SKILL.md +20 -19
  88. package/dist/agent-src/skills/launch-readiness/evals/evals.json +21 -0
  89. package/dist/agent-src/skills/legal-practice-profile/SKILL.md +126 -0
  90. package/dist/agent-src/skills/logging-monitoring/SKILL.md +1 -1
  91. package/dist/agent-src/skills/logging-monitoring/evals/evals.json +16 -0
  92. package/dist/agent-src/skills/mcp/SKILL.md +1 -1
  93. package/dist/agent-src/skills/memory-consolidation/SKILL.md +14 -1
  94. package/dist/agent-src/skills/messaging-architecture/evals/domain-truth.json +16 -0
  95. package/dist/agent-src/skills/messaging-architecture/evals/evals.json +16 -0
  96. package/dist/agent-src/skills/migration-architect/SKILL.md +2 -1
  97. package/dist/agent-src/skills/perf-feedback-craft/evals/evals.json +16 -0
  98. package/dist/agent-src/skills/performance/SKILL.md +1 -1
  99. package/dist/agent-src/skills/pest-testing/SKILL.md +1 -1
  100. package/dist/agent-src/skills/php-debugging/SKILL.md +17 -0
  101. package/dist/agent-src/skills/playwright-testing/SKILL.md +16 -0
  102. package/dist/agent-src/skills/prompt-engineering-patterns/evals/evals.json +16 -0
  103. package/dist/agent-src/skills/readme-writing/SKILL.md +2 -0
  104. package/dist/agent-src/skills/readme-writing-package/SKILL.md +2 -0
  105. package/dist/agent-src/skills/refine-prompt/evals/evals.json +16 -0
  106. package/dist/agent-src/skills/refine-ticket/evals/evals.json +16 -0
  107. package/dist/agent-src/skills/release-comms/SKILL.md +2 -0
  108. package/dist/agent-src/skills/release-comms/evals/evals.json +16 -0
  109. package/dist/agent-src/skills/rice-prioritization/evals/evals.json +20 -0
  110. package/dist/agent-src/skills/roadmap-writing/SKILL.md +22 -51
  111. package/dist/agent-src/skills/runway-cognition/evals/evals.json +20 -0
  112. package/dist/agent-src/skills/scenario-modeling/evals/evals.json +20 -0
  113. package/dist/agent-src/skills/security-audit/SKILL.md +6 -9
  114. package/dist/agent-src/skills/sentry-integration/SKILL.md +2 -2
  115. package/dist/agent-src/skills/skill-improvement-pipeline/SKILL.md +8 -0
  116. package/dist/agent-src/skills/source-discovery/SKILL.md +26 -24
  117. package/dist/agent-src/skills/spreadsheet-authoring/SKILL.md +98 -0
  118. package/dist/agent-src/skills/spreadsheet-authoring/evals/triggers.json +47 -0
  119. package/dist/agent-src/skills/subagent-orchestration/SKILL.md +55 -46
  120. package/dist/agent-src/skills/subagent-orchestration/evals/evals.json +42 -0
  121. package/dist/agent-src/skills/systematic-debugging/SKILL.md +10 -0
  122. package/dist/agent-src/skills/systematic-debugging/evals/evals.json +20 -0
  123. package/dist/agent-src/skills/test-case-discovery/SKILL.md +118 -0
  124. package/dist/agent-src/skills/test-case-discovery/evals/triggers.json +52 -0
  125. package/dist/agent-src/skills/test-driven-development/SKILL.md +32 -6
  126. package/dist/agent-src/skills/test-driven-development/evals/evals.json +16 -0
  127. package/dist/agent-src/skills/testing-anti-patterns/SKILL.md +7 -6
  128. package/dist/agent-src/skills/threat-modeling/evals/evals.json +21 -0
  129. package/dist/agent-src/skills/typography-system/evals/evals.json +14 -0
  130. package/dist/agent-src/skills/unit-economics-modeling/evals/evals.json +24 -0
  131. package/dist/agent-src/skills/using-git-worktrees/SKILL.md +10 -0
  132. package/dist/agent-src/skills/verify-completion-evidence/evals/evals.json +16 -0
  133. package/dist/agent-src/skills/vision-articulation/evals/evals.json +16 -0
  134. package/dist/agent-src/skills/voice-and-tone-design/evals/evals.json +16 -0
  135. package/dist/agent-src/skills/worktree-lifecycle/SKILL.md +187 -0
  136. package/dist/agent-src/skills/worktree-lifecycle/evals/evals.json +38 -0
  137. package/dist/agent-src/skills/worktree-lifecycle/evals/triggers.json +52 -0
  138. package/dist/agent-src/templates/agent-settings.md +3 -2
  139. package/dist/agent-src/templates/agents/agent-project-settings.example.yml +15 -1
  140. package/dist/agent-src/templates/roadmaps.md +14 -0
  141. package/dist/cli/commands/recordTriggerEval.js +4 -14
  142. package/dist/cli/commands/recordTriggerEval.js.map +1 -1
  143. package/dist/discovery/deprecation-report.md +1 -1
  144. package/dist/discovery/discovery-manifest.json +374 -88
  145. package/dist/discovery/discovery-manifest.json.sha256 +1 -1
  146. package/dist/discovery/discovery-manifest.summary.md +9 -9
  147. package/dist/discovery/orphan-report.md +1 -1
  148. package/dist/discovery/packs.json +30 -18
  149. package/dist/discovery/trust-report.md +5 -5
  150. package/dist/discovery/workspaces.json +31 -15
  151. package/dist/install/install.mjs +12 -7
  152. package/dist/mcp/registry-manifest.json +4 -4
  153. package/dist/router.json +1 -1
  154. package/dist/scripts/_lib/claude_settings_hooks.js +8 -0
  155. package/dist/scripts/_lib/claude_settings_hooks.js.map +1 -1
  156. package/dist/scripts/_lib/trigger_eval_floors.js +24 -0
  157. package/dist/scripts/_lib/trigger_eval_floors.js.map +1 -0
  158. package/dist/scripts/condense.js +12 -2
  159. package/dist/scripts/condense.js.map +1 -1
  160. package/dist/server/schemas/settings.js +5 -2
  161. package/dist/server/schemas/settings.js.map +1 -1
  162. package/docs/CLAIMS.md +24 -3
  163. package/docs/architecture.md +3 -3
  164. package/docs/benchmark.md +51 -0
  165. package/docs/catalog.md +23 -9
  166. package/docs/command-flows.md +7 -1
  167. package/docs/contracts/CHANGELOG-conventions.md +6 -0
  168. package/docs/contracts/ai-council-config.md +92 -0
  169. package/docs/contracts/command-clusters.md +1 -0
  170. package/docs/contracts/design-artifact-lifecycle.md +93 -0
  171. package/docs/contracts/design-artifact-verification.md +30 -1
  172. package/docs/contracts/evidence-based-pruning.md +1 -0
  173. package/docs/contracts/hook-architecture-v1.md +25 -0
  174. package/docs/contracts/kernel-membership.md +35 -0
  175. package/docs/contracts/measurement-baseline.md +1 -0
  176. package/docs/contracts/release-pr-gating.md +26 -0
  177. package/docs/contracts/release-sizing.md +107 -0
  178. package/docs/contracts/surface-agent-contracts.md +153 -0
  179. package/docs/contracts/write-engine.md +38 -1
  180. package/docs/customization.md +12 -0
  181. package/docs/decisions/ADR-002-kernel-bucket-overrides.md +11 -0
  182. package/docs/decisions/ADR-003-flat-cluster-subs-and-colon-syntax.md +11 -0
  183. package/docs/decisions/ADR-006-skill-tools-python-pilot.md +1 -1
  184. package/docs/decisions/ADR-028-root-layout.md +1 -1
  185. package/docs/decisions/ADR-038-canonical-settings-path.md +10 -0
  186. package/docs/decisions/ADR-092-defer-command-tier-alias-removal.md +29 -5
  187. package/docs/decisions/ADR-093-ai-council-config-user-global.md +1 -1
  188. package/docs/decisions/ADR-100-global-knowledge-card-sharing.md +7 -0
  189. package/docs/decisions/ADR-103-global-knowledge-default-off-until-measured.md +2 -2
  190. package/docs/decisions/ADR-105-automatic-subagent-orchestration.md +1 -1
  191. package/docs/decisions/ADR-114-commit-policy-iron-law-override.md +11 -0
  192. package/docs/decisions/ADR-115-command-cluster-consolidation-phase-4.md +1 -1
  193. package/docs/decisions/ADR-116-memory-tripwire-activation-path.md +11 -1
  194. package/docs/decisions/ADR-117-subagents-auto-default-on.md +2 -1
  195. package/docs/decisions/ADR-118-loop-engineering-boundaries.md +162 -0
  196. package/docs/decisions/ADR-119-global-knowledge-default-on.md +104 -0
  197. package/docs/decisions/ADR-200-python-to-typescript-migration.md +11 -1
  198. package/docs/decisions/ADR-rule-kernel-and-router.md +11 -0
  199. package/docs/decisions/INDEX.md +11 -9
  200. package/docs/design/cross-model-parity-eval.md +82 -0
  201. package/docs/design/length-neutral-judge-rerun.md +92 -0
  202. package/docs/distribution/consumer-matrix.md +96 -0
  203. package/docs/featured-skills.md +2 -2
  204. package/docs/getting-started-by-role.md +1 -1
  205. package/docs/getting-started.md +2 -2
  206. package/docs/governance-advantage.md +1 -1
  207. package/docs/guidelines/agent-infra/roadmap-progress-mechanics.md +80 -5
  208. package/docs/guidelines/code-clarity.md +106 -1
  209. package/docs/guidelines/design-antipatterns.md +20 -0
  210. package/docs/guidelines/php/php-coding-patterns.md +12 -2
  211. package/docs/proof.md +21 -15
  212. package/docs/release-runbook.md +3 -0
  213. package/docs/self-review-gate.md +51 -0
  214. package/docs/wedge/production-validator/production-validator.md +27 -0
  215. package/package.json +1 -1
  216. package/src/config/agent-settings.template.yml +29 -9
  217. package/src/scripts/_cli/cmd_doctor.ts +34 -1
  218. package/src/scripts/_lib/auto_dispatch.corpus.test.ts +87 -0
  219. package/src/scripts/_lib/claude_settings_hooks.ts +8 -0
  220. package/src/scripts/_lib/knowledge_global.ts +6 -2
  221. package/src/scripts/_lib/knowledge_global_redaction.ts +42 -4
  222. package/src/scripts/_lib/lexical_index.ts +15 -2
  223. package/src/scripts/_lib/orchestration_record.ts +27 -0
  224. package/src/scripts/_lib/orchestration_savings.ts +52 -0
  225. package/src/scripts/_lib/trigger_eval_floors.ts +31 -0
  226. package/src/scripts/ai_council/chairman.ts +90 -0
  227. package/src/scripts/ai_council/clients.ts +18 -3
  228. package/src/scripts/ai_council/config.ts +157 -0
  229. package/src/scripts/ai_council/debate_gates.ts +89 -0
  230. package/src/scripts/ai_council/orchestrator.ts +65 -2
  231. package/src/scripts/ai_council/prompts.ts +121 -11
  232. package/src/scripts/ai_council/replay.ts +17 -0
  233. package/src/scripts/ai_council/stance_tally.ts +184 -0
  234. package/src/scripts/ai_tells_rules.ts +433 -0
  235. package/src/scripts/bench_humanizer_eval.ts +240 -0
  236. package/src/scripts/build_discovery_manifest.ts +6 -0
  237. package/src/scripts/build_proof.ts +21 -9
  238. package/src/scripts/check_claims.ts +40 -0
  239. package/src/scripts/check_release_adjacent_health.ts +121 -0
  240. package/src/scripts/check_rule_invariants.ts +282 -0
  241. package/src/scripts/condense.ts +16 -2
  242. package/src/scripts/consumer_matrix.ts +392 -0
  243. package/src/scripts/council_cli.ts +147 -0
  244. package/src/scripts/detect_ai_tells.ts +312 -0
  245. package/src/scripts/generate_index.ts +3 -2
  246. package/src/scripts/install.ts +12 -0
  247. package/src/scripts/knowledge_global_cli.ts +1 -1
  248. package/src/scripts/lint_changelog_rollback.ts +293 -0
  249. package/src/scripts/lint_framework_leakage.ts +88 -7
  250. package/src/scripts/lint_framework_leakage_allowlist.json +59 -572
  251. package/src/scripts/lint_knowledge_scale.ts +30 -0
  252. package/src/scripts/lint_originality_shingles.ts +210 -0
  253. package/src/scripts/orchestration_record.ts +17 -0
  254. package/src/scripts/orchestration_savings_report.ts +36 -3
  255. package/src/scripts/schemas/agent-settings.schema.json +11 -0
  256. package/src/scripts/second_brain_retrieval.ts +44 -2
  257. package/src/scripts/self_review_gate.test.ts +65 -0
  258. package/src/scripts/self_review_gate.ts +298 -0
  259. package/src/scripts/skill_eval_coverage.ts +71 -3
  260. package/src/scripts/skill_linter.ts +1 -0
  261. package/src/scripts/trigger_eval_grandfather.json +223 -224
  262. package/src/scripts/trigger_eval_rotation.ts +344 -0
  263. package/src/scripts/update_counts.ts +5 -17
  264. package/src/scripts/worktree_cleanup_check.ts +263 -0
  265. package/src/server/schemas/settings.ts +8 -3
  266. package/src/scripts/analysis_freshness.ts +0 -362
  267. package/src/scripts/export_replay_corpus.ts +0 -208
@@ -50,8 +50,9 @@ Do NOT use when:
50
50
  [`judge-security-auditor`](../judge-security-auditor/SKILL.md)
51
51
  * The concern is PII leakage into logs specifically — route to
52
52
  [`data-flow-mapper`](../data-flow-mapper/SKILL.md). (Role-based field-level
53
- output filtering IS access gating — it stays in scope here + the vertical-BOPLA
54
- section of [`broken-access-control`](../../rules/broken-access-control.md).)
53
+ output filtering IS access gating — it stays in scope here; see
54
+ § Broken-access-control depth below and the
55
+ [`broken-access-control`](../../rules/broken-access-control.md) rule.)
55
56
  * The concern is implementing a control once identified — route to
56
57
  [`security`](../security/SKILL.md)
57
58
 
@@ -91,6 +92,62 @@ For every gap, answer:
91
92
  Do **not** list generic findings ("should use policies") — always anchor to a
92
93
  file:line and a specific actor who can reach the gap.
93
94
 
95
+ ## Broken-access-control depth
96
+
97
+ Depth for the [`broken-access-control`](../../rules/broken-access-control.md)
98
+ rule (migrated per P4 of `road-to-kernel-and-router.md`); the Iron Law and the
99
+ three negative tests stay in the rule.
100
+
101
+ Why this class dominates: the single most common — and most damaging — failure
102
+ in real systems and in AI-written code is that you log in as one user and see
103
+ another user's data. The login check passes, so the endpoint *feels* protected;
104
+ the per-object ownership/tenant check is the separate line devs and AI omit —
105
+ especially when the object id comes straight from the request. Broken Access
106
+ Control is OWASP Web #1 (A01:2021) and API #1 (BOLA/IDOR), trivially
107
+ scriptable, and a recurring real-world breach class — e.g. First American
108
+ Financial (885M documents exposed via sequential ids with no ownership check).
109
+
110
+ ### Non-optional controls (every data-returning surface)
111
+
112
+ - **Server-derived principal.** Ownership/tenant derived from the session/token, **never** from a request header/param/body the caller controls. A matching id in the request is not authorization.
113
+ - **Ownership/tenant check on every request id** before returning data. `findById(params.id)` with no `where owner/tenant = currentPrincipal` is the canonical bug.
114
+ - **Tenant-scoped by construction.** Every query on a tenant table carries the tenant predicate; prefer a base scope that injects it so a forgotten clause can't leak. (DSGVO: Mandantentrennung / Trennungskontrolle is a required TOM — a missing `tenant_id` filter is a compliance failure, not just a bug.)
115
+ - **Response minimization.** Return only entitled fields — no `SELECT *` / full-object serialization leaking PII "because the model has it" (Art. 25(2)).
116
+ - **Property-level authz (BOPLA / mass assignment).** Reject `role` / `user_id` / `tenant_id` / `is_admin` from the request body; explicit field allow-list, never whole-body binding.
117
+ - **Role/field-level output filtering (vertical BOPLA).** *Which* fields a principal receives depends on role + business rules — a driver role must not receive `price`; an office role must not receive the boss's `offer`. Serialize via a **role-scoped output DTO**, never the raw model / `to_json()`; sensitive fields (`price`/`cost`/`margin`/`salary`/`discount`/`offer`/internal notes) default-deny per role.
118
+ - **No guessable public ids** on sensitive resources — UUID/ULID, not sequential integers (turns one bug into full-DB enumeration).
119
+
120
+ ### Role-based field-level access — both directions (vertical BOPLA + BFLA)
121
+
122
+ Object-ownership (above) is *horizontal* (may this principal touch this record). This is *vertical*: which **fields** and which **functions** a role may reach — the maintainer's case (driver ≠ price, office worker ≠ boss's offer). Depends on role + business rules, and **the server is the only boundary** — the frontend hiding a field does not protect it: the raw JSON on the wire is readable via `curl`/DevTools/a proxy (3Fun leak: a privacy toggle filtered only in the app; the server returned every user's location to a direct query).
123
+
124
+ - **Read side (CWE-213 / Excessive Data Exposure).** Build the response from a **role-scoped output DTO** — never serialize the ORM model directly. Sensitive fields default-deny per role. A client `?fields=` selection is ergonomics, not authorization — intersect it server-side with the role's read-allowlist.
125
+ - **Write side (CWE-915).** Bind input through a **role-scoped write-allowlist** — never the raw body. Read-allowed ≠ write-allowed: a role may *see* `status` but not *set* `status:"approved"`; two independent sets.
126
+ - **Function level (BFLA, OWASP API #5).** A role must not reach a function/verb reserved for a higher role. Gate **every mutating verb** (POST/PUT/PATCH/DELETE), deny-by-default — not just the GET you were asked about. The admin button being hidden is not a control.
127
+ - **Nested / GraphQL.** Field-level checks propagate to nested selections; a low-role token selecting a restricted field gets null/error, not data.
128
+ - **Negative tests, per (role × sensitive field), both directions:** lower-role token → the field is **absent from the raw response body** (assert the body, not the UI); lower-role setting it on input → rejected/ignored, **verified by re-reading the persisted record**; every privileged verb → 403 for lower roles (403/404 on sensitive object reads).
129
+
130
+ ### Defense-in-depth (so one miss can't leak)
131
+
132
+ Stack ≥2 independent layers on sensitive data — query-level ownership scoping, a centralized default-deny policy layer (a route with no policy is denied, not silently open), and DB row-level security as the backstop for a forgotten `WHERE tenant_id`. (Merged with the pre-existing Gotcha bullet "Defense-in-depth so one miss can't leak" below — that bullet carries the concrete RLS configuration and is the stronger, operative statement.)
133
+
134
+ ### GDPR / DSGVO — data protection by design
135
+
136
+ A cross-user data leak violates **Art. 5(1)(f)** (integrity & confidentiality — a principle → higher fine tier), **Art. 25** (by design/default: default-deny + least privilege + response minimization), and **Art. 32** — which also **mandates a process for regularly testing effectiveness** of these controls (untested authz is a direct Art. 32 gap; hence the three negative tests are non-optional). A discovered live exposure is a **notifiable breach** (Art. 33, 72 h from discovery) — surface as "notify + remediate", never a silent patch. Data-protection context, not legal advice → [`privacy-review`](../privacy-review/SKILL.md), `domain-safety-pii`.
137
+
138
+ ### Backstop greps (authoring-time)
139
+
140
+ ```bash
141
+ # Record fetched by request id with no owner/tenant predicate nearby (high-noise — a hit means read the line, not auto-fix)
142
+ rg -n '(findById|find|findOne|get)\(\s*(req\.|request\.|params\.|\$request|\$id)'
143
+ # Client-supplied tenant/user hint used as the scope (should come from the session)
144
+ rg -n '(tenant|tenantId|user_id|userId)\s*=\s*(req|request|params|headers|query)\.'
145
+ ```
146
+
147
+ The full authoring-time grep set (mass-assignment, raw-serialization, secrets) lives once in [`ai-code-blindspots`](../ai-code-blindspots/SKILL.md).
148
+
149
+ A hit means read that line — is the ownership/tenant check present? Some are safe (already scoped); none should ship unchecked.
150
+
94
151
  ## Validation
95
152
 
96
153
  Before finalizing the report, confirm:
@@ -164,7 +164,7 @@ does not execute code, run tests, or touch the network**.
164
164
  ## Gotcha
165
165
 
166
166
  * **Reflection / string-based dispatch** — `call_user_func`, event names as
167
- strings, Laravel `resolve($classString)`. Grep the string too, not just the symbol.
167
+ strings, DI-container string lookups (Laravel `resolve($classString)`, NestJS `moduleRef.get()`). Grep the string too, not just the symbol.
168
168
  * **Dynamic column access** — `$model->{$field}` or query builder `->get([...])`
169
169
  with variable arrays. A column rename can leak through these.
170
170
  * **Trait / mixin fan-out** — overriding a method pulled in via trait affects
@@ -76,6 +76,12 @@ create new bugs. Quick patches mask underlying issues.
76
76
 
77
77
  ## Procedure: Analyze a bug
78
78
 
79
+ 1. **Inspect inputs and reproducers** — Pull every source named in *Input sources* (branch, Jira, Sentry, error string, user description) before forming a hypothesis.
80
+ 2. **Investigate root cause** — Run Phase 1 below; gather evidence, walk the stacktrace, consult engineering memory.
81
+ 3. **Find the pattern** — Run Phase 2; check for similar bugs elsewhere in the codebase.
82
+ 4. **Form and test a hypothesis** — Run Phase 3; write a failing test that reproduces the bug.
83
+ 5. **Fix and verify** — Run Phase 4; apply the minimal change, re-run the failing test plus the wider suite.
84
+
79
85
  ### Phase 1: Root Cause Investigation
80
86
 
81
87
  Gather all available evidence before forming any hypothesis:
@@ -122,7 +128,7 @@ This is especially important for:
122
128
 
123
129
  - Find **working examples** of similar code paths in the codebase.
124
130
  - Compare the broken path against the working reference.
125
- - Identify the **specific difference** that → the failure.
131
+ - Identify the **specific difference** that causes the failure.
126
132
  - Check if the issue is isolated or part of a broader pattern.
127
133
 
128
134
  ### Phase 3: Hypothesis and Testing
@@ -135,11 +141,11 @@ This is especially important for:
135
141
  - Each fix reveals new shared state or coupling in a different place.
136
142
  - Fixes require "massive refactoring" to implement.
137
143
  - Each fix creates new symptoms elsewhere.
138
- - Common root → in this project:
144
+ - Common root causes in this project:
139
145
  - **Missing validation** on external sync data (CSV, XML, JSON imports).
140
146
  - **Null values** from optional DB columns not handled.
141
147
  - **Type mismatches** between legacy DB columns and PHP code.
142
- - **Race conditions** in multi-tenant DB switching.
148
+ - **Race conditions** in multi-tenant database switching.
143
149
  - **Missing fallbacks** when external services are unavailable.
144
150
 
145
151
  ### Phase 4: Implementation
@@ -177,18 +183,9 @@ For each code path, test these scenarios mentally:
177
183
  | **State** | Uninitialized state, partial updates, rollback failures |
178
184
  | **External** | Network timeout, API errors, malformed responses |
179
185
 
180
- ### 3. Known bug patterns (PHP/Laravel)
186
+ ### 3. Known bug patterns
181
187
 
182
- - N+1 queries hidden in loops or accessors
183
- - Missing `->fresh()` after update when using same instance
184
- - Eloquent lazy loading in queued jobs (serialization issues)
185
- - `now()` timezone mismatches
186
- - Missing FK constraints allowing orphaned records
187
- - `DB::transaction()` with external side effects (emails, API calls)
188
- - Model events firing during seeding or migration
189
- - Off-by-one errors in pagination or date ranges
190
- - Silent exception swallowing (`catch (\Exception $e) {}`)
191
- - Floating point comparison for money/quantities
188
+ → PHP/Laravel bug-pattern catalogue: see [`php-debugging`](../php-debugging/SKILL.md).
192
189
 
193
190
  ### 4. Output format (proactive mode)
194
191
 
@@ -227,10 +224,10 @@ Focus on the "Bug fixes" attack questions: Is this the root cause or a symptom?
227
224
  |---|---|
228
225
  | "Should work now" | RUN the verification — confidence ≠ evidence |
229
226
  | "It's probably X, let me fix that" | "Probably" = guessing. Complete Phase 1 first |
230
- | "Quick fix for now" | Quick fixes mask root → and create technical debt |
227
+ | "Quick fix for now" | Quick fixes mask root causes and create technical debt |
231
228
  | "I'll investigate later" | Later never comes. Investigate now |
232
229
  | "One more fix attempt" (after 2+) | 3+ failures = architectural problem. Stop and discuss |
233
- | "Issue is simple, don't need process" | Simple issues have root → too. Process is fast for simple bugs |
230
+ | "Issue is simple, don't need process" | Simple issues have root causes too. Process is fast for simple bugs |
234
231
  | "Emergency, no time for process" | Systematic debugging is FASTER than guess-and-check thrashing |
235
232
 
236
233
  ## Output format
@@ -239,6 +236,12 @@ Focus on the "Bug fixes" attack questions: Is this the root cause or a symptom?
239
236
  2. Fix implementation or fix plan with specific files and changes
240
237
  3. Regression test covering the failure scenario
241
238
 
239
+ ## Verification examples
240
+
241
+ - **Backend bug**: reproduce with `curl` against the failing route (or an `actingAs()` HTTP test) before and after the fix; assert the new response shape with `assertJsonPath`.
242
+ - **Runtime bug**: place a `xdebug` breakpoint at the suspect frame, step through, and inspect the stack trace; for log-only repros, dump the failing variable with `dd(` once, then remove.
243
+ - **Regression test**: add a test that reproduces the original failure first (red), then makes it green — never write the test post-fix from memory.
244
+
242
245
  ## Gotcha
243
246
 
244
247
  - Don't assume the stacktrace shows the root cause — it often shows the symptom. Trace backwards.
@@ -0,0 +1,16 @@
1
+ {
2
+ "skill": "character-consistency",
3
+ "_calibration": "Behavioural fixture (road-to-skill-eval-coverage Phase 2, default-surface). Deterministic assertions on a real output property where reliable; rubric pins the qualitative core as a known-limit (pass ratified in PR review, not a hidden judge). finding_floor n is a conservative floor, not a calibrated per-host number.",
4
+ "scenarios": [
5
+ {
6
+ "id": "keep-character-consistent",
7
+ "prompt": "Keep this recurring character consistent across a multi-scene story.",
8
+ "assertions": [
9
+ {
10
+ "kind": "rubric",
11
+ "criterion": "Pins a character bible (traits, voice, visual anchors) and checks each scene against it, flagging drift — not re-inventing per scene."
12
+ }
13
+ ]
14
+ }
15
+ ]
16
+ }
@@ -100,7 +100,7 @@ Run the project's type-checker and linter after each significant step — do NOT
100
100
 
101
101
  | Stack | Typical pipeline |
102
102
  |---|---|
103
- | Laravel / PHP | `vendor/bin/phpstan analyse` → `vendor/bin/rector process` → `vendor/bin/ecs check --fix` → re-run PHPStan |
103
+ | Laravel / PHP | `vendor/bin/phpstan analyse` → `vendor/bin/rector process` → `vendor/bin/ecs check --fix` → re-run the static analyser |
104
104
  | TypeScript | `tsc --noEmit` → `eslint --fix` → `prettier --write` |
105
105
  | Python | `mypy` (or `pyright`) → `ruff check --fix` → `ruff format` |
106
106
  | Go | `go vet ./...` → `golangci-lint run --fix` → `gofmt -w` |
@@ -137,35 +137,35 @@ After the code changes are verified, update all affected documentation:
137
137
  ## Common refactoring patterns
138
138
 
139
139
  ### Rename (method, class, property)
140
- 1. Find all usages → update all usages → update docs → run PHPStan → run tests.
140
+ 1. Find all usages → update all usages → update docs → run the static analyser → run tests.
141
141
 
142
142
  ### Extract method / class
143
- 1. Create the new method/class → move logic → update caller → update docs → run PHPStan → run tests.
143
+ 1. Create the new method/class → move logic → update caller → update docs → run the static analyser → run tests.
144
144
 
145
145
  ### Move class to different namespace
146
- 1. Move file → update namespace → find all `use` statements → update imports → update docs → run PHPStan.
146
+ 1. Move file → update namespace → find all `use` statements → update imports → update docs → run the static analyser.
147
147
 
148
148
  ### Change method signature
149
- 1. Update the method → find all callers → update each caller → present test changes → update docs → run PHPStan.
149
+ 1. Update the method → find all callers → update each caller → present test changes → update docs → run the static analyser.
150
150
 
151
151
  ### Change API endpoint
152
152
  1. Update controller + request + resource + OpenAPI schemas + route → present test changes →
153
- update docs (`agents/reference/docs/controller.md`, `agents/reference/docs/api-resources.md`) → run PHPStan → run tests.
153
+ update docs (`agents/reference/docs/controller.md`, `agents/reference/docs/api-resources.md`) → run the static analyser → run tests.
154
154
 
155
155
  ### Replace implementation (e.g. switch service)
156
156
  1. Create new implementation → update binding → find all direct references → update → present test
157
- changes → update docs → run PHPStan → run tests → remove old implementation.
157
+ changes → update docs → run the static analyser → run tests → remove old implementation.
158
158
 
159
159
  ### Move/restructure module
160
160
  1. Move files → update namespaces → update `ModuleServiceProvider` if needed → update module routes →
161
- update module agent docs → update project contexts → run PHPStan → run tests.
161
+ update module agent docs → update project contexts → run the static analyser → run tests.
162
162
 
163
163
  ## Safety rules
164
164
 
165
165
  - **Never skip the caller search** — missing a caller is the #1 cause of broken refactorings.
166
166
  - **Never remove old code before verifying** the new code works everywhere.
167
167
  - **Never change test expectations without user approval** — explain what changes and why first.
168
- - **Run PHPStan after every step**, not just at the end.
168
+ - **Run the static analyser after every step** (PHPStan, `tsc --noEmit`, mypy — whichever the project runs), not just at the end.
169
169
  - **Run tests after every step**, not just at the end.
170
170
  - **Update docs after code changes** — stale docs are worse than no docs.
171
171
  - **Do NOT commit or push** — only apply local changes.
@@ -0,0 +1,14 @@
1
+ {
2
+ "skill": "command-routing",
3
+ "_calibration": "Behavioural fixtures (road-to-skill-eval-coverage Phase 2, router set). Deterministic `contains` asserts the invocation routes to the matching command (its file/path) rather than improvising — a mis-route runs the wrong command or reinvents it.",
4
+ "scenarios": [
5
+ {
6
+ "id": "route-create-pr",
7
+ "prompt": "I typed /create-pr — what runs, and which command file governs it?",
8
+ "assertions": [
9
+ { "kind": "contains", "value": "create-pr" },
10
+ { "kind": "rubric", "criterion": "Routes to the create-pr command file (commands/pr/create) and follows it rather than improvising a PR-creation flow." }
11
+ ]
12
+ }
13
+ ]
14
+ }
@@ -177,3 +177,5 @@ Mid-market HR analytics, funnel-analysis diagnosed mid-funnel leak (decision-sta
177
177
  - Leverage point — *mid-funnel proof*, because the decision-stage call is starved of conviction; structural ripple.
178
178
  - Pathway — *"How HR directors lose 7 hours per board-quarter"* (top) → *"Cohort-retention deep-dive vs. spreadsheet rebuild"* (mid) → *ROI calculator* (decision).
179
179
  - Hand-off → `editorial-calendar` re-allocates campaign weight to mid-funnel; `funnel-analysis` re-diagnoses at week 4.
180
+
181
+ → Final prose pass for audience-facing output: [`humanizer`](../humanizer/SKILL.md) — remove AI-writing tells before delivery.
@@ -0,0 +1,16 @@
1
+ {
2
+ "skill": "dashboard-design",
3
+ "_calibration": "Behavioural fixture (road-to-skill-eval-coverage Phase 2, default-surface). Deterministic assertions on a real output property where reliable; rubric pins the qualitative core as a known-limit (pass ratified in PR review, not a hidden judge). finding_floor n is a conservative floor, not a calibrated per-host number.",
4
+ "scenarios": [
5
+ {
6
+ "id": "design-metrics-dashboard",
7
+ "prompt": "Design a metrics dashboard for our SaaS ops team.",
8
+ "assertions": [
9
+ {
10
+ "kind": "rubric",
11
+ "criterion": "Leads with the decisions the viewer must make, groups metrics by that, uses the right chart per data shape, and avoids vanity metrics."
12
+ }
13
+ ]
14
+ }
15
+ ]
16
+ }
@@ -140,7 +140,7 @@ Runtime confirmation (e.g. *"actually POST a request and log the payload"*,
140
140
  it. If you stop at persistence you missed half the trace.
141
141
  * **Silent type coercion** — framework middleware often casts strings to
142
142
  ints or trims whitespace. Mark these as explicit hops.
143
- * **Confusing validation with authorization** — a FormRequest-style validator
143
+ * **Confusing validation with authorization** — a request-validation-layer validator (FormRequest in Laravel, zod schema in Node)
144
144
  is a validation hop, not an authorization hop. They are distinct.
145
145
  * **Tenancy scope on retrieval** — the write path was tenant-scoped; the read
146
146
  path joined on a global table and leaked. Check both directions.
@@ -0,0 +1,20 @@
1
+ {
2
+ "skill": "dcf-modeling",
3
+ "_calibration": "Behavioural fixture (road-to-skill-eval-coverage Phase 2, default-surface). Deterministic assertions on a real output property where reliable; rubric pins the qualitative core as a known-limit (pass ratified in PR review, not a hidden judge). finding_floor n is a conservative floor, not a calibrated per-host number.",
4
+ "scenarios": [
5
+ {
6
+ "id": "dcf-terminal-value-and-sensitivity",
7
+ "prompt": "DCF this target: year-6 FCFF $108M, WACC 10%, terminal growth 2%, net debt $200M. Give enterprise + equity value and the discount-rate sensitivity.",
8
+ "assertions": [
9
+ {
10
+ "kind": "contains",
11
+ "value": "WACC"
12
+ },
13
+ {
14
+ "kind": "rubric",
15
+ "criterion": "Computes Gordon terminal value = FCFF_{n+1}/(WACC−g) = 108/0.08 = 1350, bridges EV→equity via net debt, and includes a WACC/terminal-growth sensitivity grid — never a single point estimate."
16
+ }
17
+ ]
18
+ }
19
+ ]
20
+ }
@@ -0,0 +1,20 @@
1
+ {
2
+ "skill": "decision-record",
3
+ "_calibration": "Behavioural fixture (road-to-skill-eval-coverage Phase 2, default-surface). Deterministic assertions on a real output property where reliable; rubric pins the qualitative core as a known-limit (pass ratified in PR review, not a hidden judge). finding_floor n is a conservative floor, not a calibrated per-host number.",
4
+ "scenarios": [
5
+ {
6
+ "id": "record-adr",
7
+ "prompt": "Record our decision to adopt Postgres over MySQL as an ADR.",
8
+ "assertions": [
9
+ {
10
+ "kind": "contains",
11
+ "value": "Consequences"
12
+ },
13
+ {
14
+ "kind": "rubric",
15
+ "criterion": "Uses the ADR shape — Status / Context / Decision / Consequences / Alternatives — and states the trade-off given up, not only the choice."
16
+ }
17
+ ]
18
+ }
19
+ ]
20
+ }
@@ -36,7 +36,7 @@ Do NOT use when:
36
36
 
37
37
  ### Step 1: Layer 1 — Entry-point validation
38
38
 
39
- Reject obviously invalid input at the API / route / command boundary. In Laravel this is FormRequest rules; in pure PHP services it is the public method on the service.
39
+ Reject obviously invalid input at the API / route / command boundary. In Laravel this is FormRequest rules; in Express a zod-validated middleware; in pure services it is the public method on the service.
40
40
 
41
41
  ```php
42
42
  public function createProject(string $name, string $workingDirectory): Project
@@ -152,6 +152,6 @@ BEFORE adding the 5th guard:
152
152
 
153
153
  ## Provenance
154
154
 
155
- - Adopted from: an external reference (MIT, © 2025 an external reference).
155
+ - Adopted from: an external reference (internal provenance, redacted).
156
156
  - Provenance registry: `agents/settings/contexts/skills-provenance.yml` (entry: `defense-in-depth`).
157
157
  - Iron-Law floor: `non-destructive-by-default`, `verify-before-complete`, `skill-quality`.
@@ -85,7 +85,7 @@ pip list --outdated # pip
85
85
  poetry show --outdated # poetry
86
86
  uv pip list --outdated # uv
87
87
 
88
- # Upgrade a specific package
88
+ # Upgrade a specific package (same shape for composer require / npm install pkg@latest)
89
89
  pip install --upgrade package-name
90
90
  poetry update package-name
91
91
  uv pip install --upgrade package-name
@@ -230,17 +230,17 @@ When `composer require` or `npm install` fails with conflicts:
230
230
 
231
231
  ## Post-update malware & behavior audit
232
232
 
233
- CVE scanning (above) catches *known-vulnerable* versions. It does **not** catch a **compromised update**: a trusted package with a legitimate history ships a normal-looking version bump that quietly adds data-exfiltration or other harmful behavior. This is how the biggest supply-chain attacks landed — event-stream (wallet stealer as a new transitive dep), ua-parser-js (`preinstall` miner + credential stealer), @solana/web3.js (key exfil hidden inside expected network calls), chalk/debug + 16 (browser crypto-drainer, 2B weekly downloads), the self-propagating Shai-Hulud worm (added a `.github/workflows` + secret-scanning `postinstall`), xz-utils (backdoor in the released tarball, not the git repo). Routine updates slip through because the version looks normal and install runs scripts across the whole transitive tree silently — the exact [`lethal-trifecta-guard`](../../rules/lethal-trifecta-guard.md) egress shape.
233
+ CVE scanning (above) catches *known-vulnerable* versions. It does **not** catch a **compromised update**: a trusted package with a legitimate history ships a normal-looking version bump that quietly adds data-exfiltration or other harmful behavior. This is how the biggest supply-chain attacks landed — event-stream (wallet stealer as a new transitive dep), ua-parser-js (`preinstall` miner + credential stealer), @solana/web3.js (key exfil hidden inside expected network calls), chalk/debug + 16 (browser crypto-drainer, 2B weekly downloads), the self-propagating Shai-Hulud worm (added a `.github/workflows` + secret-scanning `postinstall`), xz-utils (backdoor in the released tarball, not the git repo). Routine updates slip through because the version looks normal and install runs scripts across the whole transitive tree silently — this is the exact [`lethal-trifecta-guard`](../../rules/lethal-trifecta-guard.md) egress shape.
234
234
 
235
235
  **Run this audit during/after any add or upgrade, then surface findings to the user and hold pending confirmation** (per [`active-remediation`](../../rules/active-remediation.md) — a live supply-chain risk is surfaced, never silently accepted):
236
236
 
237
- 1. **Install without running scripts first** — `npm install --ignore-scripts` (npm v12 defaults to this), `composer install --no-scripts`, `pip install --only-binary :all:` (wheels only — no sdist build code) — so install-time code (the #1 RCE vector) can't run before inspection.
238
- 2. **Diff the version delta old→new** — the `scripts` block (any newly-added `pre/post/install` hook), the dependency tree (any **new transitive dependency**), and where feasible the published tarball vs the git source (xz hid in the tarball).
237
+ 1. **Install without running scripts first** — `npm install --ignore-scripts` (npm v12 defaults to this), `composer install --no-scripts`, `pip install --only-binary :all:` (wheels only — no sdist build code) — so install-time code (the #1 RCE vector) cannot run before inspection.
238
+ 2. **Diff the version delta old→new** — the `scripts` block (any newly-added `pre/post/install` hook), the dependency tree (any **new transitive dependency**), and — where feasible — the published tarball vs the git source (xz hid in the tarball).
239
239
  3. **Capability / behavior diff** — did the new version add a capability its job doesn't need: network egress (`fetch`/`net`/`dns`/`http`), `child_process`/shell, env/secret/credential reads, filesystem writes, obfuscated/minified blobs, a `.github/workflows` file? Use `socket` / `guarddog <eco> scan <pkg>@<ver>` if available; else read the delta.
240
240
  4. **Purpose-vs-behavior legitimacy check** — a Slack/HTTP client legitimately makes network calls; a date/string/color util does not. For each new capability ask: *does the package's stated purpose require this?* A network/secret capability with no purpose justification — or a **new outbound endpoint** even in a package that already uses the network — is high-risk.
241
- 5. **Provenance + advisory feeds** — `npm audit signatures` (flag a dep that *had* provenance and lost it — a token-theft-publish hallmark); `osv-scanner --lockfile=…` and the GitHub Advisory / Socket / Snyk malware feeds against the newly-resolved versions.
241
+ 5. **Provenance + advisory feeds** — `npm audit signatures` (flag a dep that *had* provenance and lost it — a hallmark of a token-theft publish); `osv-scanner --lockfile=…` and the GitHub Advisory / Socket / Snyk malware feeds against the newly-resolved versions.
242
242
 
243
- **Surface to the user** any: new install script · new transitive dep · new network endpoint / secret read · obfuscated blob · lost provenance · advisory/malware hit — with the version delta + the purpose-vs-behavior verdict, and hold the update until they decide. Never auto-accept a bump that introduced an unexplained capability.
243
+ **Surface to the user** any: new install script · new transitive dep · new network endpoint / secret read · obfuscated blob · lost provenance · advisory/malware hit — with the version delta and the purpose-vs-behavior verdict, and hold the update until they decide. Never auto-accept a bump that introduced an unexplained capability.
244
244
 
245
245
  ## Output format
246
246
 
@@ -266,7 +266,7 @@ CVE scanning (above) catches *known-vulnerable* versions. It does **not** catch
266
266
  - Don't upgrade multiple major versions at once — one major version per upgrade cycle.
267
267
  - The model tends to skip reading the CHANGELOG — breaking changes hide in minor releases too.
268
268
  - Always run the full test suite after upgrading, not just the affected tests.
269
- - Lock file conflicts after upgrade are expected — resolve by re-running `composer update`.
269
+ - Lock file conflicts after upgrade are expected — resolve by re-running the package manager's update (`composer update`, `npm update`, `poetry update`).
270
270
 
271
271
  ## Do NOT
272
272
 
@@ -135,14 +135,14 @@ config, not a vibe — never re-infer when `DESIGN.md` already sets them
135
135
  Dials persist in `DESIGN.md`; the stack executors (`tailwind-engineer`,
136
136
  `react-shadcn-ui`, `blade-ui`, `flux`) read `DESIGN.md` and honour them.
137
137
 
138
- **Anti-Default Discipline — first-impulse check:** Before committing to any design direction, verify you are NOT defaulting to:
139
- - Purple/violet + cyan-on-dark gradient palette (AI color cliché)
140
- - Centered hero over a dark gradient mesh with a single CTA
141
- - Three equal-weight feature cards in a grid
142
- - Inter or Space Grotesk as the uncritical body font choice
143
- - "Premium consumer" cream/sand background + brass/clay accents
144
-
145
- If any of these was the first impulse, name a different direction or explicitly justify why this brief genuinely calls for it.
138
+ **Anti-Default Discipline — first-impulse check:** Before committing to any
139
+ design direction, cross-check your first impulse against the current-generation
140
+ tells in [`design-antipatterns.md`](../../../docs/guidelines/design-antipatterns.md)
141
+ (§ Current-generation tells — the warm-editorial C5+T2+T7 signature and the
142
+ previous-generation C1/C2 gradient) plus the L1/L2 layout defaults. If a tell was
143
+ your first reach, name a different direction or explicitly justify why this brief
144
+ genuinely calls for it. (The finalization cross-check against the full catalog is
145
+ under *Anti-slop discipline* below.)
146
146
 
147
147
  ## Honesty / real-system grounding
148
148
 
@@ -0,0 +1,14 @@
1
+ {
2
+ "skill": "design-intelligence",
3
+ "_calibration": "Behavioural fixtures (road-to-skill-eval-coverage Phase 2, rich set). Deterministic `contains` asserts the WCAG-checked-token property the skill promises; the rubric (pinned-judge known-limit) checks the corpus-grounding — a grounded brief names a concrete style/palette/type decision, not arbitrary taste.",
4
+ "scenarios": [
5
+ {
6
+ "id": "grounded-brief-fintech-dashboard",
7
+ "prompt": "Give me a grounded design brief (style, color tokens, typography, layout pattern) for a serious fintech analytics dashboard. Justify the palette's contrast.",
8
+ "assertions": [
9
+ { "kind": "contains", "value": "WCAG" },
10
+ { "kind": "rubric", "criterion": "Selects a concrete named style/archetype + a specific palette and type pairing grounded in the design corpus (not arbitrary), and states at least one anti-pattern to avoid." }
11
+ ]
12
+ }
13
+ ]
14
+ }
@@ -13,6 +13,12 @@ packs:
13
13
 
14
14
  ## When to use
15
15
 
16
+ > **Render-verification gate.** A UI verdict is gated on the
17
+ > [design-artifact verification checklist](../../../docs/contracts/design-artifact-verification.md#verification-checklist):
18
+ > where render capability exists, do not pass a design task without render
19
+ > evidence (checklist steps 1–5); where it is absent, scope the verdict to what
20
+ > was statically checked and say so — never "looks good" without evidence.
21
+
16
22
  Use this skill when:
17
23
  - Reviewing pull requests with UI changes
18
24
  - Auditing frontend components for design quality
@@ -52,9 +58,21 @@ A **live preview URL** is required for testing.
52
58
  ### Phase 1: Interaction
53
59
 
54
60
  - Test user flows end-to-end.
55
- - Verify hover, focus, active, and disabled states.
61
+ - **Six interaction states — every interactive element asserts each one** (single
62
+ canonical states checklist; no other review phase repeats it):
63
+ 1. **default** — resting state is a deliberate style, not the browser default.
64
+ 2. **hover** — pointer feedback present (not the *only* affordance — see focus).
65
+ 3. **active** — pressed/engaged state visibly distinct from hover.
66
+ 4. **disabled** — unmistakably non-interactive (a contrast dip a user cannot read
67
+ as "disabled" is a WCAG 1.4.1 failure — see `accessibility-auditor`).
68
+ 5. **focus** — visible `:focus-visible` indicator (Q6 floor, `lint_design_quality`).
69
+ 6. **loading** — explicit pending state (skeleton/spinner/disabled-submit), never a dead frozen control.
70
+ - **Transition timing** between these states follows the motion bands in
71
+ [`fe-design`](../fe-design/SKILL.md) § Motion (micro-feedback ~100–200 ms;
72
+ structural open/close ~200–500 ms) — the timing source of truth; do not restate
73
+ a competing band set here. Every animated transition carries a
74
+ `prefers-reduced-motion` alternative (M5 / Q4).
56
75
  - Test keyboard navigation (Tab, Enter, Escape, Arrow keys).
57
- - Check loading states and transitions.
58
76
  - Verify form submission and error recovery.
59
77
 
60
78
  ### Phase 2: Responsiveness
@@ -291,6 +309,15 @@ dispatch it via [`subagent-orchestration`](../subagent-orchestration/SKILL.md)
291
309
  and position it against [`verify-repair-loop`](../verify-repair-loop/SKILL.md)
292
310
  (the existing verify skill); it complements them, it does not duplicate them.
293
311
 
312
+ **Why the audit passes stay serial (not a parallel-4 fan-out).** A fan-out of
313
+ a11y + slop + hierarchy + states across four subagents was evaluated and
314
+ deferred: the passes share one live browser/navigation session and later phases
315
+ build on state established by earlier ones — not cleanly independent; and the
316
+ expensive part (browser probing / screenshots) is already offloaded by the async
317
+ verifier above, which captures the fan-out's main win without four separate
318
+ views. Reconsider only when `design-review` runs as a standalone heavy batch over
319
+ many *independent* surfaces, where per-surface `do-in-parallel` genuinely pays.
320
+
294
321
  ## Gotcha
295
322
 
296
323
  - Don't review design without understanding the user's constraints (time, resources, scope).
@@ -276,6 +276,27 @@ Fidelity declaration is load-bearing: hi-fi vs lo-fi tells the dev whether to
276
276
  recreate the mockup pixel-for-pixel or apply the existing system — the single
277
277
  most common handoff ambiguity.
278
278
 
279
+ ## Design-system extraction floor
280
+
281
+ When the goal is to extract this repo's design system as a **reusable package
282
+ artifact** (not just DESIGN.md prose), the extraction meets this floor — the
283
+ handoff shape emitted alongside `design-system.json`
284
+ ([import contract](reference/design-system-json.md)).
285
+
286
+ - **Contract contents.** A complete extraction carries: a root guide / manifest;
287
+ token CSS (or the stack's equivalent); the typography / colour / spacing /
288
+ iconography foundations; component specimens; an asset inventory (logos, icons,
289
+ fonts); UI-kit screens; and starting-point templates where appropriate.
290
+ - **Specimen granularity.** Many small foundation cards beat one dense dump —
291
+ each specimen demonstrates ONE reusable sub-concept (a single button state,
292
+ one spacing step, one elevation level), so a consumer lifts concepts
293
+ individually rather than parsing a monolith.
294
+ - **Developer handoff bundle** (extends § Design→dev handoff README): a
295
+ high-fidelity reference, behaviour notes, the assets list, the component
296
+ mapping (design name → code component), responsive states, known caveats, and
297
+ — when the artifact is a mock — an explicit "prototype, not production code"
298
+ warning so a consumer never ships the reference verbatim.
299
+
279
300
  ## Gotcha
280
301
 
281
302
  - **Over-writing instead of diff-updating** — the most common failure.
@@ -0,0 +1,15 @@
1
+ {
2
+ "skill": "design-system-capture",
3
+ "_calibration": "Behavioural fixtures (road-to-skill-eval-coverage Phase 2, rich set). Deterministic `contains` asserts the two artifacts the skill's contract maintains (DESIGN.md + PRODUCT.md); the rubric checks it captures decisions rather than re-describing generic guidance.",
4
+ "scenarios": [
5
+ {
6
+ "id": "capture-from-repo",
7
+ "prompt": "Capture this project's design system so future sessions stay consistent: it uses a 4px spacing grid, 8px radius, a spring motion strategy, and a blue primary. Where do these decisions go?",
8
+ "assertions": [
9
+ { "kind": "contains", "value": "DESIGN.md" },
10
+ { "kind": "contains", "value": "PRODUCT.md" },
11
+ { "kind": "rubric", "criterion": "Routes the visual decisions (spacing/radius/motion/color) into DESIGN.md and interaction patterns into PRODUCT.md, and flags any TBD rather than inventing values." }
12
+ ]
13
+ }
14
+ ]
15
+ }
@@ -0,0 +1,16 @@
1
+ {
2
+ "skill": "developer-like-execution",
3
+ "_calibration": "Behavioural fixture (road-to-skill-eval-coverage Phase 2, default-surface). Deterministic assertions on a real output property where reliable; rubric pins the qualitative core as a known-limit (pass ratified in PR review, not a hidden judge). finding_floor n is a conservative floor, not a calibrated per-host number.",
4
+ "scenarios": [
5
+ {
6
+ "id": "execute-like-dev",
7
+ "prompt": "Implement this small change end-to-end the way a senior would.",
8
+ "assertions": [
9
+ {
10
+ "kind": "rubric",
11
+ "criterion": "Reads before editing, keeps the diff minimal + scoped, updates downstream callers/tests, and verifies with a real run before claiming done."
12
+ }
13
+ ]
14
+ }
15
+ ]
16
+ }
@@ -13,6 +13,12 @@ packs:
13
13
 
14
14
  ## When to use
15
15
 
16
+ > **Cross-surface handoff.** When this document consumes upstream work (research
17
+ > → document, spreadsheet → report), read the handoff envelope from
18
+ > [`surface-agent-contracts`](../../../docs/contracts/surface-agent-contracts.md#cross-surface-handoff-envelope):
19
+ > trust `verification_already_done`, honour source restrictions, and don't
20
+ > re-fetch what the source already grounded.
21
+
16
22
  Use this skill when:
17
23
 
18
24
  * User starts a substantial writing task — PRD, RFC, design doc, decision doc, technical spec, proposal
@@ -40,6 +46,27 @@ Move from a fuzzy ask to a complete document the user owns, by:
40
46
  * `save-file` and `str-replace-editor` available
41
47
  * Target path and filename agreed up front
42
48
 
49
+ ## Document format & export floor
50
+
51
+ The document surface's floor (per
52
+ [`surface-agent-contracts`](../../../docs/contracts/surface-agent-contracts.md)):
53
+
54
+ - **Choose the format by intent.** Markdown vs `.docx` vs PDF follows what the
55
+ user will DO with it — when a named format is requested, produce THAT format
56
+ via the document tooling; never silently substitute markdown for a `.docx`
57
+ request. (fixture: `ssac-docx-requested-markdown-only`.)
58
+ - **Preserve edit scope.** On an edit, change only what was asked and preserve
59
+ the rest of the document (mirrors
60
+ [`minimal-safe-diff`](../../rules/minimal-safe-diff.md)).
61
+ - **Print/PDF preserves selectable text.** Never rasterize a text-heavy document
62
+ to an image-only PDF when browser print or native export keeps the text
63
+ selectable. (fixture: `ssac-pdf-screenshot-rasterized`.)
64
+ - **Verify the output opens/exports.** Confirm the generated file opens /
65
+ round-trips
66
+ ([`design-artifact-verification`](../../../docs/contracts/design-artifact-verification.md));
67
+ where the format's tooling is absent, ship the source + say what could not be
68
+ verified rather than claiming a produced file.
69
+
43
70
  ## Procedure
44
71
 
45
72
  ### 0. Inspect existing material
@@ -131,3 +158,5 @@ Apply the [Frugality Charter](../../contexts/contracts/frugality-charter.md).
131
158
  * Reprint the whole doc on every iteration
132
159
  * Declare "done" without the Stage 3 reader test
133
160
  * Generate doc content from scratch when the user has existing context — gap-closing is the whole point
161
+
162
+ → Final prose pass for audience-facing output: [`humanizer`](../humanizer/SKILL.md) — remove AI-writing tells before delivery.
@@ -0,0 +1,16 @@
1
+ {
2
+ "skill": "doc-coauthoring",
3
+ "_calibration": "Behavioural fixture (road-to-skill-eval-coverage Phase 2, default-surface). Deterministic assertions on a real output property where reliable; rubric pins the qualitative core as a known-limit (pass ratified in PR review, not a hidden judge). finding_floor n is a conservative floor, not a calibrated per-host number.",
4
+ "scenarios": [
5
+ {
6
+ "id": "coauthor-prd",
7
+ "prompt": "Help me write the PRD for our new onboarding flow.",
8
+ "assertions": [
9
+ {
10
+ "kind": "rubric",
11
+ "criterion": "Runs the 3-stage flow — context → section-by-section → reader-test — rather than dumping a full doc; asks for the missing context first."
12
+ }
13
+ ]
14
+ }
15
+ ]
16
+ }