@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
@@ -0,0 +1,16 @@
1
+ {
2
+ "skill": "perf-feedback-craft",
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": "perf-review-feedback",
7
+ "prompt": "Give this engineer performance feedback: they ship fast but skip tests.",
8
+ "assertions": [
9
+ {
10
+ "kind": "rubric",
11
+ "criterion": "Names the specific behaviour + its impact with an example, is balanced (strength + growth), and gives an actionable next step — not vague praise/blame."
12
+ }
13
+ ]
14
+ }
15
+ ]
16
+ }
@@ -56,7 +56,7 @@ Re-measure after fix. Check that cache invalidation works correctly.
56
56
 
57
57
  - Cache invalidation bugs are worse than slow queries — don't add caching everywhere.
58
58
  - Eager loading N+1 is the #1 win — always check list endpoints.
59
- - Don't cache Eloquent collections with loaded relations — too large.
59
+ - Don't cache ORM collections/entities with loaded relations (Eloquent, Doctrine, Prisma) — too large.
60
60
  - Always include tenant ID in cache keys (multi-tenant).
61
61
 
62
62
  ## Do NOT
@@ -56,6 +56,7 @@ discipline, mock-isolation gates, and the 12 process rationalizations
56
56
  - Keep setup minimal and relevant.
57
57
  - Favor confidence and maintainability over excessive mocking.
58
58
  - Cover happy path, validation failures, authorization failures, and important edge cases.
59
+ - Enumerate the cases BEFORE writing — run the [`test-case-discovery`](../test-case-discovery/SKILL.md) funnel; floor per behavior: 1 happy + 1 boundary + 1 error (+1 abuse on security paths).
59
60
 
60
61
  ## TDD workflow (Red-Green-Refactor)
61
62
 
@@ -291,7 +292,6 @@ When generating Pest tests:
291
292
  - assert both response and side effects where relevant
292
293
  - keep tests readable, isolated, and maintainable
293
294
 
294
-
295
295
  ### Filter Pest output
296
296
 
297
297
  When triaging a verbose run, narrow the output with `--filter` (Pest)
@@ -214,9 +214,26 @@ docker compose logs php-xdebug | rg --color=never "$REQUEST_ID"
214
214
  - Do NOT use var_dump() or dd() — use Xdebug breakpoints.
215
215
  - Do NOT debug in the fast container — switch to the Xdebug container.
216
216
 
217
+ ## Clarification guard — ambiguous repro → ask
218
+
219
+ If the bug repro is unclear (which request, which user, which env, which input shape?), do not start placing breakpoints at random. Ask the user for the failing payload, the exact route, or the Sentry trace. Setting breakpoints based on a guessed flow wastes a session.
220
+
217
221
  ## Auto-trigger keywords
218
222
 
219
223
  - Xdebug
220
224
  - PHP debugging
221
225
  - breakpoint
222
226
  - step debugging
227
+
228
+ ## Known Laravel bug patterns (from bug-analyzer)
229
+
230
+ - N+1 queries hidden in loops or accessors
231
+ - Missing `->fresh()` after update when using same instance
232
+ - Eloquent lazy loading in queued jobs (serialization issues)
233
+ - `now()` timezone mismatches
234
+ - Missing FK constraints allowing orphaned records
235
+ - `DB::transaction()` with external side effects (emails, API calls)
236
+ - Model events firing during seeding or migration
237
+ - Off-by-one errors in pagination or date ranges
238
+ - Silent exception swallowing (`catch (\Exception $e) {}`)
239
+ - Floating point comparison for money/quantities
@@ -13,6 +13,11 @@ packs:
13
13
 
14
14
  ## When to use
15
15
 
16
+ > **Design verification.** When exercising a UI artifact, run the
17
+ > [design-artifact verification checklist](../../../docs/contracts/design-artifact-verification.md#verification-checklist)
18
+ > (open → console/load → viewport → text-fit → assets → interaction) and capture
19
+ > evidence; a design task with browser capability present is not "done" without it.
20
+
16
21
  Use this skill when:
17
22
  - Writing end-to-end tests with Playwright
18
23
  - Automating browser interactions for testing
@@ -31,6 +36,7 @@ Use this skill when:
31
36
  3. **Check existing tests** — match patterns in `tests/e2e/` or `e2e/`.
32
37
  4. **Check test utilities** — look for page objects, fixtures, helpers.
33
38
  5. **Check CI setup** — how are E2E tests run in the pipeline?
39
+ 6. **Enumerate the cases** — run the [`test-case-discovery`](../test-case-discovery/SKILL.md) funnel per user flow before writing specs; cover the happy flow AND at least one boundary (empty state, max input) and one error path (failed request, validation rejection) per flow — never the happy flow alone.
34
40
 
35
41
  ## Test structure
36
42
 
@@ -183,6 +189,12 @@ jq '.suites[].specs[] | select(.tests[].results[].status=="failed")' pw.json
183
189
  rg --color=never 'getByRole.*Submit' test-results/
184
190
  ```
185
191
 
192
+ **Run verification.** The test run's **exit code** is the pass/fail signal — `0`
193
+ means every spec passed, non-zero means at least one failed. Read the **command
194
+ output** (or the `--reporter=json` above) to **diagnose** the failing spec's
195
+ **root cause**; do not blindly re-run hoping it turns green — a retry-until-pass
196
+ is not a fix, and a flaky green hides the real defect.
197
+
186
198
  ## Avoiding flaky tests
187
199
 
188
200
  | Problem | Solution |
@@ -263,3 +275,7 @@ await page.route('**/api/users', route =>
263
275
  - Do NOT test implementation details — test user-visible behavior.
264
276
  - Do NOT put assertions in Page Objects — assertions belong in test files.
265
277
  - Do NOT commit `.only` — enforce via `forbidOnly: !!process.env.CI`.
278
+
279
+ ## Anti-bruteforce — diagnose before retry
280
+
281
+ When a spec fails, do not retry blindly by re-running, swapping locators at random, or bumping timeouts until green. Diagnose the root cause first: open the trace viewer, inspect the failing locator's `aria` tree, identify the real reason (timing, locator, app state), then apply a targeted fix. Trial-and-error locator swaps mask flaky test design.
@@ -0,0 +1,16 @@
1
+ {
2
+ "skill": "prompt-engineering-patterns",
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": "apply-prompt-pattern",
7
+ "prompt": "Which prompting pattern should I use to get structured extraction from messy text, and why?",
8
+ "assertions": [
9
+ {
10
+ "kind": "rubric",
11
+ "criterion": "Names a concrete pattern (e.g. schema-constrained/structured-output, few-shot) matched to the extraction task, with the trade-off — not a generic tips list."
12
+ }
13
+ ]
14
+ }
15
+ ]
16
+ }
@@ -238,3 +238,5 @@ to every README you author.
238
238
  - Do NOT skip repository inspection before writing
239
239
  - Do NOT preserve weak structure from an existing README just because it exists
240
240
  - Do NOT add marketing language ("blazing fast", "revolutionary", "next-gen")
241
+
242
+ → Final prose pass for audience-facing output: [`humanizer`](../humanizer/SKILL.md) — remove AI-writing tells before delivery.
@@ -348,3 +348,5 @@ to every package README you author.
348
348
  - Do NOT hide requirements or version constraints
349
349
  - Do NOT write a giant example when a 10-line one would do
350
350
  - Do NOT overload README with reference material — link to /docs
351
+
352
+ → Final prose pass for audience-facing output: [`humanizer`](../humanizer/SKILL.md) — remove AI-writing tells before delivery.
@@ -0,0 +1,16 @@
1
+ {
2
+ "skill": "refine-prompt",
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": "refine-a-prompt",
7
+ "prompt": "Improve this prompt: 'write good marketing copy'.",
8
+ "assertions": [
9
+ {
10
+ "kind": "rubric",
11
+ "criterion": "Adds role, concrete task, constraints, and success criteria; removes vague adjectives — a measurably tighter prompt, not a paraphrase."
12
+ }
13
+ ]
14
+ }
15
+ ]
16
+ }
@@ -0,0 +1,16 @@
1
+ {
2
+ "skill": "refine-ticket",
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": "refine-ticket-dor",
7
+ "prompt": "Refine this ticket: 'make search better'.",
8
+ "assertions": [
9
+ {
10
+ "kind": "rubric",
11
+ "criterion": "Tightens to a bounded scope with acceptance criteria + a definition-of-ready; asks the one blocking question rather than guessing scope."
12
+ }
13
+ ]
14
+ }
15
+ ]
16
+ }
@@ -131,3 +131,5 @@ Sprint 47 ships a one-click monthly export and three small bug fixes:
131
131
  - "After this release, you can pull a board-ready monthly report in one click." (active, at-risk — same sentence ⇒ collapse to one).
132
132
  - Surfaces: changelog (full), in-app prompt to active users on next month-end, email to at-risk cohort with the same sentence and one CTA. No social.
133
133
  - Truth-check: claim links to the export PR; "one click" is literal — verified against the shipped UI.
134
+
135
+ → Final prose pass for audience-facing output: [`humanizer`](../humanizer/SKILL.md) — remove AI-writing tells before delivery.
@@ -0,0 +1,16 @@
1
+ {
2
+ "skill": "release-comms",
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": "write-release-note",
7
+ "prompt": "Write the release announcement for our v-next dashboard redesign.",
8
+ "assertions": [
9
+ {
10
+ "kind": "rubric",
11
+ "criterion": "Leads with user value + what changed, notes any migration/breaking step, and matches the product voice — not a raw changelog dump."
12
+ }
13
+ ]
14
+ }
15
+ ]
16
+ }
@@ -0,0 +1,20 @@
1
+ {
2
+ "skill": "rice-prioritization",
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": "rice-rank-three",
7
+ "prompt": "Prioritize these three features with RICE: A (reach 5000, impact 2, conf 80%, effort 3), B (reach 1000, impact 3, conf 100%, effort 1), C (reach 8000, impact 1, conf 50%, effort 5).",
8
+ "assertions": [
9
+ {
10
+ "kind": "contains",
11
+ "value": "RICE"
12
+ },
13
+ {
14
+ "kind": "rubric",
15
+ "criterion": "Computes RICE = Reach×Impact×Confidence/Effort per item (A≈2667, B=3000, C=800) and ranks by the score, not by gut feel."
16
+ }
17
+ ]
18
+ }
19
+ ]
20
+ }
@@ -91,6 +91,16 @@ and council-pass notes capture the *why*; checkboxes capture the
91
91
  [`roadmap-progress-sync`](../../rules/roadmap-progress-sync.md)
92
92
  Iron Law #2.
93
93
 
94
+ **Bind a `verify:` on behavior-changing steps.** A step that changes
95
+ behavior (a new guard, migration, wired endpoint, mechanism edit) SHOULD
96
+ carry a narrow `verify:` command in an inline annotation —
97
+ `- [ ] Wire the guard <!-- verify: task test -- --filter=GuardTest -->` —
98
+ so its `[x]` flip is machine-checkable, not just agent-asserted (template
99
+ rule 23; enforced by the flip-guard). Bind it only where a single narrow
100
+ command (targeted test / grep / build of the touched surface) proves the
101
+ step; leave it off doc-only / prose steps, never the full CI suite
102
+ (`roadmap-ci-steps-policy`).
103
+
94
104
  ### 4b. Declare the execution mode (frontmatter)
95
105
 
96
106
  Every new roadmap declares how a later `/roadmap:process-*` run should
@@ -220,57 +230,18 @@ originally wrote it.
220
230
 
221
231
  ### 8. Source-derived & capability-adoption roadmaps (conditional)
222
232
 
223
- Fires **only** when roadmap originates from external input or adopts
224
- capabilities into the suite:
225
-
226
- - competitive / capability harvest, external suggestion, or external
227
- LLM ideation thread, **or**
228
- - decision to integrate/adopt new skills, commands, or a pack, **or**
229
- - plan whose design has genuinely contested, unresolved trade-offs.
230
-
231
- Ordinary internally-originated roadmap → **skip this section**; §§ 0–7
232
- are the whole job. Don't bolt a Provenance block or gap-table onto a
233
- plan needing neither (template rule 19).
234
-
235
- When it fires, add four moves to §§ 0–7:
236
-
237
- **A. Gap-table before drafting (don't adopt — integrate).** Audit each
238
- proposed item against the *existing* skill / command / rule surface;
239
- classify `KEEP` (verified gap), `FOLD` (into a named existing artefact),
240
- `CUT` (already covered). Only `KEEP` items become scope; `FOLD`/`CUT`
241
- recorded so the cut is auditable. Negative grep ≠ proof — open the
242
- nearest existing artefacts (per
243
- [`think-before-action`](../../rules/think-before-action.md); for an
244
- external source,
245
- [`external-reference-deep-dive`](../../rules/external-reference-deep-dive.md)).
246
-
247
- **B. Resolve contested design in council *first*, then author.** Default
248
- council flow (`/roadmap:ai-council`) *challenges a finished roadmap*. For
249
- a contested/source-derived plan, run council **up front** on the design
250
- questions (`/council:design`, or the
251
- [`ai-council`](../ai-council/SKILL.md) skill), converge, **then** write
252
- the roadmap encoding the verdicts — ships already-decided, not as open
253
- questions in prose. One run, converge; don't relitigate.
254
-
255
- **C. Encode the decision so it survives.**
256
- - Inline council convergence under `## Council notes (<date>, <depth>)`
257
- — members + date, **never** a session filepath
258
- ([`no-roadmap-references`](../../rules/no-roadmap-references.md)).
259
- - Add `## Provenance` — source by **neutral descriptor** (never the raw
260
- competitor/tool name,
261
- [`source-confidentiality`](../../rules/source-confidentiality.md));
262
- retain the real link as an `ENC1:` token via
263
- `src/scripts/_lib/link_crypto.ts encrypt --value <url>`.
264
- - Save the locked decision to memory (project type, "don't relitigate")
265
- so a future session does not re-derive it.
266
-
267
- **D. Make "integration, not dump" a testable acceptance criterion.** AC
268
- encodes the anti-dump litmus, decidably: visible commands within the
269
- pack's `size_class` budget; each new visible command reuses ≥ 2 existing
270
- skills; no new artefact duplicates an existing one; governance preflight
271
- recorded — `domain-adoption-policy` (new domain?), `persona-governance`
272
- (new personas?), `framework-neutrality`, `size-enforcement` —
273
- disposition stated in the roadmap.
233
+ Fires **only** when the roadmap originates from an external input
234
+ (competitive/capability harvest, external suggestion, external LLM
235
+ ideation) or adopts new skills/commands/a pack, or has genuinely
236
+ contested trade-offs. For an ordinary internally-originated roadmap,
237
+ **skip this section** — §§ 0–7 are the whole job.
238
+
239
+ When it fires, add four moves — a gap-table before drafting (KEEP/FOLD/CUT,
240
+ integrate don't dump), resolve contested design in the council *first*
241
+ then author, encode the decision so it survives (Council notes +
242
+ neutral-descriptor Provenance + memory lock), and make "integration, not
243
+ dump" a testable acceptance criterion. Full four-move detail →
244
+ [`roadmap-writing-source-derived`](../../agent-src/contexts/execution/roadmap-writing-source-derived.md).
274
245
 
275
246
  ## Output format
276
247
 
@@ -0,0 +1,20 @@
1
+ {
2
+ "skill": "runway-cognition",
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": "runway-shape-and-decision",
7
+ "prompt": "We have $4.2M cash and burn $560k/month. How long do we have and what should we do?",
8
+ "assertions": [
9
+ {
10
+ "kind": "contains",
11
+ "value": "runway"
12
+ },
13
+ {
14
+ "kind": "rubric",
15
+ "criterion": "Computes months-of-runway = cash/burn (≈7.5) AND frames raise/hold/cut-vs-grow as a shape against the org-stage band, not a single number."
16
+ }
17
+ ]
18
+ }
19
+ ]
20
+ }
@@ -0,0 +1,20 @@
1
+ {
2
+ "skill": "scenario-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": "base-upside-downside",
7
+ "prompt": "Model base / upside / downside for our annual plan off a $6.3M commit.",
8
+ "assertions": [
9
+ {
10
+ "kind": "contains",
11
+ "value": "downside"
12
+ },
13
+ {
14
+ "kind": "rubric",
15
+ "criterion": "Downside names a concrete HEADWIND (not base×0.8), upside names a tailwind, and reads optionality — not just ±20% on base."
16
+ }
17
+ ]
18
+ }
19
+ ]
20
+ }
@@ -67,7 +67,7 @@ User Input → Controller → Validation → Service → DB/File/External
67
67
  | Category | What to look for |
68
68
  |---|---|
69
69
  | **SQL Injection** | Raw queries with concatenation, missing parameter binding |
70
- | **XSS** | Unescaped output in Blade (`{!! !!}`), JSON responses with HTML |
70
+ | **XSS** | Unescaped template output (Blade `{!! !!}`, JSX `dangerouslySetInnerHTML`, Jinja `|safe`), JSON responses with HTML |
71
71
  | **CSRF** | Missing middleware, API endpoints without token verification |
72
72
  | **Auth bypass** | Missing policy checks, broken gate logic, `withoutMiddleware()` |
73
73
  | **IDOR** | Direct object access without ownership verification |
@@ -81,14 +81,7 @@ User Input → Controller → Validation → Service → DB/File/External
81
81
 
82
82
  ### 4. Framework-specific checks
83
83
 
84
- **Laravel:**
85
- - `env()` in non-config files (leaks in debug mode)
86
- - Debug mode (`APP_DEBUG=true`) in production
87
- - Missing `$fillable` on models used with `request()->all()`
88
- - `Route::any()` exposing unintended HTTP methods
89
- - Missing rate limiting on login/register/password-reset
90
- - Broadcast channels without proper authorization
91
- - Missing encryption on sensitive cookie/session data
84
+ → Laravel-specific checks: see [`laravel`](../laravel/SKILL.md) § Security audit checks.
92
85
 
93
86
  ### 5. Dependency audit
94
87
 
@@ -99,6 +92,10 @@ User Input → Controller → Validation → Service → DB/File/External
99
92
 
100
93
  ## Output format
101
94
 
95
+ 1. Emit one entry per vulnerability using the field list below; one finding = one block, never merge.
96
+ 2. Category must map to an OWASP Top 10 (or LLM Top 10) bucket; Severity must use Low / Medium / High / Critical with a single Exploitability tag.
97
+ 3. Close with a *Recommended Fix Order* ranked by exploitability × blast radius and tag each line with Confidence.
98
+
102
99
  For each vulnerability:
103
100
 
104
101
  - **Vulnerability:** concise title
@@ -147,7 +147,7 @@ search_events(organizationSlug='my-org', naturalLanguageQuery='count of database
147
147
  - **Skill:** `logging-monitoring` — full monitoring stack (Sentry + Grafana + Loki)
148
148
  - **Skill:** `bug-analyzer` — uses Sentry as input for bug investigation
149
149
  - **Command:** `/bug-investigate` — fetches Sentry details automatically
150
- - **Config:** `config/sentry.php` — Sentry DSN and configuration
150
+ - **Config:** the SDK's config surface (`config/sentry.php` in Laravel, `sentry.client.config.ts` in Next.js) — Sentry DSN and configuration
151
151
 
152
152
 
153
153
  ## Output format
@@ -157,7 +157,7 @@ search_events(organizationSlug='my-org', naturalLanguageQuery='count of database
157
157
 
158
158
  ## Gotcha
159
159
 
160
- - Sentry groups errors by stacktrace — different root → may appear as the same issue. Check multiple events.
160
+ - Sentry groups errors by stacktrace — different root causes may appear as the same issue. Check multiple events.
161
161
  - The model tends to analyze only the latest event — check the "Events" tab for patterns across time.
162
162
  - Don't use Sentry MCP tools for simple lookups — use the Sentry web UI link instead (saves tokens).
163
163
 
@@ -107,6 +107,14 @@ Decide what to create:
107
107
 
108
108
  ### Step 4: Create or Update
109
109
 
110
+ > **Anchor exact commands to the transcript, not the journal.** A session
111
+ > journal is a *lossy summary*; a command, path, or flag reconstructed from it
112
+ > can be subtly wrong. Before writing a concrete step (a command, a file path, a
113
+ > config key) into a rule or skill, confirm it against the anchored source
114
+ > transcript — carry a `transcript:` / session anchor on the mined learning so
115
+ > the exact wording is recoverable, and verify against it rather than trusting
116
+ > the summary.
117
+
110
118
  - **New rule** → create in `.agent-src.uncondensed/rules/`, follow rule conventions
111
119
  - **New skill** → use `skill-writing` skill, create in `.agent-src.uncondensed/skills/`
112
120
  - **Update existing** → use `skill-management` skill
@@ -92,7 +92,7 @@ distinct methods/fields *intended* to be used, OR the source exposes >50 methods
92
92
  and ≥1 is used, OR a prior hallucination on it, OR local types/README are
93
93
  insufficient)** — judged on *intended* use at discovery (still built **before**
94
94
  coding). For a card-worthy dependency named in the task: **local-first**
95
- (`node_modules` / `vendor` README + type defs; the **installed version is ground
95
+ (`node_modules` / `vendor/` README + type defs; the **installed version is ground
96
96
  truth**), then the net (registry → repo host → homepage). **Pin the remote ref to
97
97
  the installed version — never blind `main`.** Reuse
98
98
  [`external-reference-deep-dive`](../../rules/external-reference-deep-dive.md) +
@@ -106,19 +106,21 @@ Resolve and read the actual class fresh (Step 0). In-codebase → local, no card
106
106
 
107
107
  ### E. Global cards — leads only (v2, ADR-100)
108
108
 
109
- When `knowledge.global_sharing.enabled` (user-global, **default off until cross-project reuse measured** — ADR-103), a matching
109
+ When `knowledge.global_sharing.enabled` (user-global, default on), a matching
110
110
  card may exist in the per-user file-first store
111
- (`~/.event4u/agent-config/knowledge/`), promoted from another project. **Lead,
112
- never a build input**:
113
-
114
- - Load **negative facts + pointers** as leads (`trust: durable`).
115
- - Load **positive structure** under **"Assumed (from card · GLOBAL,
116
- unverified)"** — record via `evidence_report.ts add --bucket assumed --origin
117
- global …` and **re-confirm vs the live source this session** before use
118
- (version skew / schema drift). Never "Verified" on the global card alone.
119
- - `public`/`vendor` seen in ≥ `auto_promote_threshold` distinct repos → one-tap
120
- promotion **suggestion** (never silent); `proprietary` is manual-only. Record
121
- sightings via `_lib/knowledge_global_promote.ts record-seen`.
111
+ (`~/.event4u/agent-config/knowledge/`), promoted from another project. It is a
112
+ **lead, never a build input**:
113
+
114
+ - Load its **negative facts + pointers** as usable leads (`trust: durable`).
115
+ - Load any **positive structure** into the Evidence Report under **"Assumed
116
+ (from card · GLOBAL, unverified)"** — record it with
117
+ `evidence_report.ts add --bucket assumed --origin global …` and **re-confirm it
118
+ against the live source this session** before use (version skew / schema drift
119
+ across projects). Never "Verified" on the global card alone.
120
+ - A `public`/`vendor` card seen in ≥ `auto_promote_threshold` distinct repos
121
+ triggers a one-tap promotion **suggestion** (never silent). `proprietary` cards
122
+ are manual-only and never auto-shared. Record sightings via
123
+ `_lib/knowledge_global_promote.ts record-seen`.
122
124
 
123
125
  ## Missing structure → fixed extension workflow
124
126
 
@@ -156,21 +158,21 @@ threshold is met, a thin committed card.
156
158
 
157
159
  ## Evidence v2 — self-building context (heuristics only, never a bypass)
158
160
 
159
- Curated project-intelligence (Class A config digests, Class B observed conventions,
160
- Class C learned lessons) may be loaded to inform *where to look* and *what convention
161
- to expect* — but read **for heuristics only** and **never** bypasses a fresh structural
162
- read. A field/endpoint/column/value is still confirmed against a live source this
163
- session. v2 capture is **write-only into gitignored intake** (agent may *suggest* a
164
- signal, never silently commit); trust and commit are always human-gated. Full model +
165
- the three classes + memory tiers:
161
+ Curated project-intelligence (Class A config digests, Class B observed
162
+ conventions, Class C learned lessons) may be loaded to inform *where to look* and
163
+ *what convention to expect* — but it is read **for heuristics only** and **never**
164
+ bypasses a fresh structural read. A field/endpoint/column/value is still confirmed
165
+ against a live source this session. v2 capture is **write-only into gitignored
166
+ intake** (the agent may *suggest* a signal, never silently commit); trust and
167
+ commit are always human-gated. Full model + the three classes + memory tiers:
166
168
  [`project-intelligence`](../../agent-src/contexts/execution/project-intelligence.md).
167
169
 
168
170
  ## Knowledge capture (`api_shape_learned` / `convention_detected` events)
169
171
 
170
172
  A confirmed API/GraphQL shape (§B) or an observed coding convention with
171
- ≥ 2 supporting locations is worth persisting for the team, distinct
172
- from the per-session Evidence Report above. Append to the knowledge
173
- intake — never write a tracked page mid-task:
173
+ ≥ 2 supporting locations is worth persisting for the team, distinct from
174
+ the per-session Evidence Report above. Append to the knowledge intake —
175
+ never write a tracked page mid-task:
174
176
 
175
177
  ```bash
176
178
  ./scripts-run src/scripts/emit_knowledge_event --type api_shape_learned \
@@ -182,7 +184,7 @@ intake — never write a tracked page mid-task:
182
184
 
183
185
  `/team-knowledge consolidate` turns accumulated events into
184
186
  `agents/knowledge/concepts/` pages as a reviewed batch — see
185
- [`knowledge-pages`](../../templates/contexts/knowledge-pages.md).
187
+ [`knowledge-pages`](../../agent-src/templates/contexts/knowledge-pages.md).
186
188
 
187
189
  ## Gotchas
188
190
 
@@ -0,0 +1,98 @@
1
+ ---
2
+ model_tier: high
3
+ name: spreadsheet-authoring
4
+ description: "Use when building or editing a spreadsheet or model — formulas over hardcoded values, read-back after writes, official-source data, pivot-first charts. Triggers on 'spreadsheet', 'build a model'."
5
+ domain: process
6
+ workspaces:
7
+ - finance
8
+ packs:
9
+ - finance-basic
10
+ trust:
11
+ level: professional
12
+ install:
13
+ removable: true
14
+ execution:
15
+ type: manual
16
+ ---
17
+
18
+ # spreadsheet-authoring
19
+
20
+ > The spreadsheet surface's correctness floor (per
21
+ > [`surface-agent-contracts`](../../../docs/contracts/surface-agent-contracts.md)):
22
+ > a spreadsheet's **truth source is the formula read-back**, not a plausible
23
+ > table of numbers. A cell that holds a hardcoded computed value is a latent
24
+ > lie — it silently goes stale the moment an input changes.
25
+
26
+ ## When to use
27
+
28
+ - Building or editing a spreadsheet / financial model (SaaS, ops, budget, forecast).
29
+ - Charting raw tabular data.
30
+ - Entering web-sourced or financial figures into cells.
31
+
32
+ Do NOT use for: per-customer unit-economics *reasoning* (route to
33
+ `unit-economics-modeling`), runway *shape* (route to `runway-cognition`), or a
34
+ prose document/table (that is the document surface, `doc-coauthoring`).
35
+
36
+ ## Procedure
37
+
38
+ 1. **Detect the surface + capability.** Confirm a spreadsheet is the right
39
+ surface (not a prose table). Confirm native spreadsheet tooling is available;
40
+ if not, see § Capability-aware degradation.
41
+ 2. **Formulas over hardcoded values.** Any computed cell holds a **formula**
42
+ (`=SUM(...)`, `=B2*C2`), never the typed-in result. Hardcoding a computed
43
+ value is the cardinal spreadsheet defect — it does not recalculate.
44
+ 3. **Read back after every write.** After writing a formula, read the cell back
45
+ and confirm no formula error (`#REF!`, `#DIV/0!`, `#VALUE!`). The read-back is
46
+ the spreadsheet's verification truth source.
47
+ 4. **Source-comment web-sourced cells.** Any figure taken from the web carries a
48
+ cell comment with its source. Financial figures follow the
49
+ [`spreadsheet-source-quality`](../../rules/spreadsheet-source-quality.md) rule
50
+ (official sources first; aggregators need permission + unofficial marking).
51
+ 5. **Expand ranges on structural edits.** After inserting a row/column inside a
52
+ formula's range, expand the range (or use a whole-column / table reference) so
53
+ the new data is included — verified by read-back.
54
+ 6. **Pivot-first charting.** Chart from a pivot/aggregate of raw data, not
55
+ directly from hundreds of raw transactional rows.
56
+ 7. **Bulk range operations over manual cell loops.** Prefer a single range
57
+ formula / fill over hand-editing cells one by one.
58
+
59
+ ## Capability-aware degradation
60
+
61
+ - **Native tooling present** → write + read back formulas directly.
62
+ - **Only exported files + a parser present** → operate on the exported file;
63
+ state that formulas were written into the export, and what the target app will
64
+ recompute on open.
65
+ - **Neither** → do NOT pretend formulas were written or read back. Say plainly
66
+ what cannot be verified on this host, and deliver the formula definitions +
67
+ the layout as a durable plan the user applies in their spreadsheet app.
68
+
69
+ ## Output format
70
+
71
+ 1. **The spreadsheet / model** — cells carrying formulas (not baked values),
72
+ source comments on sourced cells, pivots feeding charts.
73
+ 2. **`assumptions.md`** — every input value, sourced or marked `assumption`;
74
+ the official-vs-unofficial status of each financial figure.
75
+ 3. **`verification-note.md`** — which cells were read back, any formula errors
76
+ found + fixed, and — on a degraded host — exactly what could not be verified.
77
+
78
+ ## Gotcha
79
+
80
+ - Hardcoding a computed value instead of a formula is the #1 spreadsheet defect:
81
+ it looks right today and is silently wrong after the next input change.
82
+ - A formula range not expanded after a row insert silently drops the new row
83
+ from every downstream total.
84
+ - Charting straight off a raw transactional table (no pivot) produces an
85
+ unreadable chart and hides the data's real shape.
86
+ - An aggregator/news figure entered as if it were official financial data is a
87
+ sourcing defect even when the number happens to be right — see
88
+ `spreadsheet-source-quality`.
89
+ - On a host without spreadsheet tooling, claiming "formulas written + verified"
90
+ is a fabricated verification (never do it — degrade honestly).
91
+
92
+ ## Do NOT
93
+
94
+ - Do NOT write a computed value where a formula belongs.
95
+ - Do NOT enter a financial figure from an aggregator/news/social source as
96
+ official without the user's explicit permission + a cell-level unofficial mark.
97
+ - Do NOT claim a formula was read back / verified on a host that cannot open the
98
+ spreadsheet — say what could not be verified instead.