cfsa-antigravity 2.19.0 → 2.19.2

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 (200) hide show
  1. package/package.json +1 -1
  2. package/template/.agent/kit-sync.md +3 -3
  3. package/template/.claude/commands/audit-ambiguity-execute.md +6 -0
  4. package/template/.claude/commands/audit-ambiguity-rubrics.md +6 -0
  5. package/template/.claude/commands/audit-ambiguity.md +6 -0
  6. package/template/.claude/commands/bootstrap-agents-fill.md +6 -0
  7. package/template/.claude/commands/bootstrap-agents-provision.md +6 -0
  8. package/template/.claude/commands/bootstrap-agents.md +6 -0
  9. package/template/.claude/commands/create-prd-architecture.md +6 -0
  10. package/template/.claude/commands/create-prd-compile.md +6 -0
  11. package/template/.claude/commands/create-prd-design-system.md +6 -0
  12. package/template/.claude/commands/create-prd-security.md +6 -0
  13. package/template/.claude/commands/create-prd-stack.md +6 -0
  14. package/template/.claude/commands/decompose-architecture-structure.md +6 -0
  15. package/template/.claude/commands/decompose-architecture-validate.md +6 -0
  16. package/template/.claude/commands/evolve-contract.md +6 -0
  17. package/template/.claude/commands/evolve-feature-cascade.md +6 -0
  18. package/template/.claude/commands/evolve-feature-classify.md +6 -0
  19. package/template/.claude/commands/evolve-feature.md +6 -0
  20. package/template/.claude/commands/ideate-discover.md +6 -0
  21. package/template/.claude/commands/ideate-extract.md +6 -0
  22. package/template/.claude/commands/ideate-validate.md +6 -0
  23. package/template/.claude/commands/implement-slice-setup.md +6 -0
  24. package/template/.claude/commands/implement-slice-tdd.md +6 -0
  25. package/template/.claude/commands/plan-phase-preflight.md +6 -0
  26. package/template/.claude/commands/plan-phase-write.md +6 -0
  27. package/template/.claude/commands/propagate-decision-apply.md +6 -0
  28. package/template/.claude/commands/propagate-decision-scan.md +6 -0
  29. package/template/.claude/commands/propagate-decision.md +6 -0
  30. package/template/.claude/commands/remediate-pipeline-assess.md +6 -0
  31. package/template/.claude/commands/remediate-pipeline-execute.md +6 -0
  32. package/template/.claude/commands/remediate-pipeline.md +6 -0
  33. package/template/.claude/commands/remediate-shard-split.md +6 -0
  34. package/template/.claude/commands/resolve-ambiguity.md +6 -0
  35. package/template/.claude/commands/setup-workspace-cicd.md +6 -0
  36. package/template/.claude/commands/setup-workspace-data.md +6 -0
  37. package/template/.claude/commands/setup-workspace-hosting.md +6 -0
  38. package/template/.claude/commands/setup-workspace-scaffold.md +6 -0
  39. package/template/.claude/commands/sync-kit.md +6 -0
  40. package/template/.claude/commands/update-architecture-map.md +6 -0
  41. package/template/.claude/commands/validate-phase-quality.md +6 -0
  42. package/template/.claude/commands/validate-phase-readiness.md +6 -0
  43. package/template/.claude/commands/verify-infrastructure.md +6 -0
  44. package/template/.claude/commands/write-architecture-spec-deepen.md +6 -0
  45. package/template/.claude/commands/write-architecture-spec-design.md +6 -0
  46. package/template/.claude/commands/write-be-spec-classify.md +6 -0
  47. package/template/.claude/commands/write-be-spec-write.md +6 -0
  48. package/template/.claude/commands/write-fe-spec-classify.md +6 -0
  49. package/template/.claude/commands/write-fe-spec-write.md +6 -0
  50. package/template/.claude/skills/accessibility/SKILL.md +522 -0
  51. package/template/.claude/skills/accessibility/references/WCAG.md +162 -0
  52. package/template/.claude/skills/accessibility/references/ia-spec-checklist.md +35 -0
  53. package/template/.claude/skills/adversarial-review/SKILL.md +90 -0
  54. package/template/.claude/skills/antigravity-workflows/SKILL.md +81 -0
  55. package/template/.claude/skills/antigravity-workflows/resources/implementation-playbook.md +36 -0
  56. package/template/.claude/skills/api-design-principles/SKILL.md +169 -0
  57. package/template/.claude/skills/api-design-principles/assets/api-design-checklist.md +155 -0
  58. package/template/.claude/skills/api-design-principles/assets/rest-api-template.py +182 -0
  59. package/template/.claude/skills/api-design-principles/references/graphql-schema-design.md +583 -0
  60. package/template/.claude/skills/api-design-principles/references/rest-best-practices.md +408 -0
  61. package/template/.claude/skills/api-design-principles/resources/implementation-playbook.md +513 -0
  62. package/template/.claude/skills/api-versioning/SKILL.md +166 -0
  63. package/template/.claude/skills/api-versioning/references/typescript.md +157 -0
  64. package/template/.claude/skills/architecture-mapping/SKILL.md +219 -0
  65. package/template/.claude/skills/bootstrap-agents/SKILL.md +258 -0
  66. package/template/.claude/skills/brainstorming/SKILL.md +177 -0
  67. package/template/.claude/skills/brand-guidelines/SKILL.md +44 -0
  68. package/template/.claude/skills/clean-code/SKILL.md +196 -0
  69. package/template/.claude/skills/clean-code/references/typescript.md +126 -0
  70. package/template/.claude/skills/code-review-pro/SKILL.md +152 -0
  71. package/template/.claude/skills/concise-planning/SKILL.md +107 -0
  72. package/template/.claude/skills/cross-layer-consistency/SKILL.md +117 -0
  73. package/template/.claude/skills/database-schema-design/SKILL.md +205 -0
  74. package/template/.claude/skills/database-schema-design/references/relational.md +228 -0
  75. package/template/.claude/skills/deployment-procedures/SKILL.md +241 -0
  76. package/template/.claude/skills/design-anti-cliche/SKILL.md +159 -0
  77. package/template/.claude/skills/design-direction/SKILL.md +45 -0
  78. package/template/.claude/skills/error-handling-patterns/SKILL.md +226 -0
  79. package/template/.claude/skills/error-handling-patterns/references/go.md +162 -0
  80. package/template/.claude/skills/error-handling-patterns/references/python.md +262 -0
  81. package/template/.claude/skills/error-handling-patterns/references/rust.md +112 -0
  82. package/template/.claude/skills/error-handling-patterns/references/typescript.md +178 -0
  83. package/template/.claude/skills/find-skills/SKILL.md +145 -0
  84. package/template/.claude/skills/git-advanced/SKILL.md +972 -0
  85. package/template/.claude/skills/git-workflow/SKILL.md +420 -0
  86. package/template/.claude/skills/idea-extraction/SKILL.md +644 -0
  87. package/template/.claude/skills/logging-best-practices/SKILL.md +192 -0
  88. package/template/.claude/skills/logging-best-practices/references/go.md +49 -0
  89. package/template/.claude/skills/logging-best-practices/references/python.md +52 -0
  90. package/template/.claude/skills/logging-best-practices/references/typescript.md +215 -0
  91. package/template/.claude/skills/migration-management/SKILL.md +200 -0
  92. package/template/.claude/skills/migration-management/references/relational.md +214 -0
  93. package/template/.claude/skills/minimalist-surgical-development/SKILL.md +135 -0
  94. package/template/.claude/skills/parallel-agents/SKILL.md +165 -0
  95. package/template/.claude/skills/parallel-debugging/SKILL.md +135 -0
  96. package/template/.claude/skills/parallel-feature-development/SKILL.md +157 -0
  97. package/template/.claude/skills/performance-budgeting/SKILL.md +144 -0
  98. package/template/.claude/skills/pipeline-rubrics/SKILL.md +51 -0
  99. package/template/.claude/skills/pipeline-rubrics/references/architecture-rubric.md +19 -0
  100. package/template/.claude/skills/pipeline-rubrics/references/be-rubric.md +21 -0
  101. package/template/.claude/skills/pipeline-rubrics/references/fe-rubric.md +20 -0
  102. package/template/.claude/skills/pipeline-rubrics/references/ia-rubric.md +19 -0
  103. package/template/.claude/skills/pipeline-rubrics/references/scoring.md +32 -0
  104. package/template/.claude/skills/pipeline-rubrics/references/vision-rubric.md +12 -0
  105. package/template/.claude/skills/prd-templates/SKILL.md +107 -0
  106. package/template/.claude/skills/prd-templates/references/architecture-completeness-checklist.md +28 -0
  107. package/template/.claude/skills/prd-templates/references/architecture-design-template.md +88 -0
  108. package/template/.claude/skills/prd-templates/references/be-spec-classification.md +41 -0
  109. package/template/.claude/skills/prd-templates/references/be-spec-template.md +107 -0
  110. package/template/.claude/skills/prd-templates/references/bootstrap-verification-protocol.md +50 -0
  111. package/template/.claude/skills/prd-templates/references/constraint-exploration.md +41 -0
  112. package/template/.claude/skills/prd-templates/references/data-placement-template.md +74 -0
  113. package/template/.claude/skills/prd-templates/references/decision-confirmation-protocol.md +68 -0
  114. package/template/.claude/skills/prd-templates/references/decision-propagation.md +121 -0
  115. package/template/.claude/skills/prd-templates/references/decomposition-templates.md +226 -0
  116. package/template/.claude/skills/prd-templates/references/deep-ideation-loading-protocol.md +114 -0
  117. package/template/.claude/skills/prd-templates/references/design-system-decisions.md +198 -0
  118. package/template/.claude/skills/prd-templates/references/design-system-prerequisite-check.md +18 -0
  119. package/template/.claude/skills/prd-templates/references/domain-exhaustion-criteria.md +37 -0
  120. package/template/.claude/skills/prd-templates/references/engagement-tier-protocol.md +58 -0
  121. package/template/.claude/skills/prd-templates/references/engineering-standards-template.md +126 -0
  122. package/template/.claude/skills/prd-templates/references/evolution-layer-guidance.md +91 -0
  123. package/template/.claude/skills/prd-templates/references/expansion-modes.md +27 -0
  124. package/template/.claude/skills/prd-templates/references/fe-classification-procedures.md +47 -0
  125. package/template/.claude/skills/prd-templates/references/fe-spec-template.md +90 -0
  126. package/template/.claude/skills/prd-templates/references/feature-ledger-protocol.md +149 -0
  127. package/template/.claude/skills/prd-templates/references/folder-seeding-protocol.md +77 -0
  128. package/template/.claude/skills/prd-templates/references/fractal-cx-template.md +58 -0
  129. package/template/.claude/skills/prd-templates/references/fractal-feature-template.md +93 -0
  130. package/template/.claude/skills/prd-templates/references/fractal-node-index-template.md +55 -0
  131. package/template/.claude/skills/prd-templates/references/gate-applicability.md +92 -0
  132. package/template/.claude/skills/prd-templates/references/ideation-crosscut-template.md +36 -0
  133. package/template/.claude/skills/prd-templates/references/ideation-index-template.md +111 -0
  134. package/template/.claude/skills/prd-templates/references/ideation-meta-template.md +126 -0
  135. package/template/.claude/skills/prd-templates/references/infrastructure-report-template.md +71 -0
  136. package/template/.claude/skills/prd-templates/references/input-classification.md +23 -0
  137. package/template/.claude/skills/prd-templates/references/map-guard-protocol.md +65 -0
  138. package/template/.claude/skills/prd-templates/references/operational-templates.md +116 -0
  139. package/template/.claude/skills/prd-templates/references/persona-completeness-gate.md +20 -0
  140. package/template/.claude/skills/prd-templates/references/placeholder-guard-template.md +21 -0
  141. package/template/.claude/skills/prd-templates/references/placeholder-workflow-mapping.md +50 -0
  142. package/template/.claude/skills/prd-templates/references/shard-boundary-analysis.md +103 -0
  143. package/template/.claude/skills/prd-templates/references/shard-split-remediation.md +157 -0
  144. package/template/.claude/skills/prd-templates/references/skill-loading-protocol.md +36 -0
  145. package/template/.claude/skills/prd-templates/references/slice-completion-gates.md +29 -0
  146. package/template/.claude/skills/prd-templates/references/spec-coverage-sweep.md +44 -0
  147. package/template/.claude/skills/prd-templates/references/surface-model.md +61 -0
  148. package/template/.claude/skills/prd-templates/references/tdd-testing-policy.md +39 -0
  149. package/template/.claude/skills/prd-templates/references/vision-template.md +57 -0
  150. package/template/.claude/skills/prd-templates/references/workflow-checkpoint-protocol.md +112 -0
  151. package/template/.claude/skills/prd-templates/references/write-verification-protocol.md +57 -0
  152. package/template/.claude/skills/prompt-engineer/SKILL.md +203 -0
  153. package/template/.claude/skills/regex-patterns/SKILL.md +333 -0
  154. package/template/.claude/skills/regex-patterns/references/go.md +44 -0
  155. package/template/.claude/skills/regex-patterns/references/javascript.md +63 -0
  156. package/template/.claude/skills/regex-patterns/references/python.md +77 -0
  157. package/template/.claude/skills/regex-patterns/references/rust.md +43 -0
  158. package/template/.claude/skills/resolve-ambiguity/SKILL.md +278 -0
  159. package/template/.claude/skills/security-scanning-security-hardening/SKILL.md +231 -0
  160. package/template/.claude/skills/session-continuity/SKILL.md +732 -0
  161. package/template/.claude/skills/session-continuity/protocols/01-session-resumption.md +38 -0
  162. package/template/.claude/skills/session-continuity/protocols/02-progress-generation.md +85 -0
  163. package/template/.claude/skills/session-continuity/protocols/03-progress-update.md +70 -0
  164. package/template/.claude/skills/session-continuity/protocols/04-pattern-extraction.md +60 -0
  165. package/template/.claude/skills/session-continuity/protocols/05-session-close.md +37 -0
  166. package/template/.claude/skills/session-continuity/protocols/06-decision-analysis.md +84 -0
  167. package/template/.claude/skills/session-continuity/protocols/07-spec-pipeline-generation.md +48 -0
  168. package/template/.claude/skills/session-continuity/protocols/08-spec-pipeline-update.md +55 -0
  169. package/template/.claude/skills/session-continuity/protocols/09-parallel-claim.md +122 -0
  170. package/template/.claude/skills/session-continuity/protocols/10-placeholder-verification-gate.md +83 -0
  171. package/template/.claude/skills/session-continuity/protocols/11-parallel-synthesis.md +21 -0
  172. package/template/.claude/skills/session-continuity/protocols/ambiguity-gates.md +48 -0
  173. package/template/.claude/skills/skill-creator/SKILL.md +203 -0
  174. package/template/.claude/skills/skill-creator/references/.gitkeep +0 -0
  175. package/template/.claude/skills/skill-creator/scripts/.gitkeep +0 -0
  176. package/template/.claude/skills/spec-writing/SKILL.md +110 -0
  177. package/template/.claude/skills/systematic-debugging/CREATION-LOG.md +119 -0
  178. package/template/.claude/skills/systematic-debugging/SKILL.md +297 -0
  179. package/template/.claude/skills/systematic-debugging/condition-based-waiting-example.ts +158 -0
  180. package/template/.claude/skills/systematic-debugging/condition-based-waiting.md +115 -0
  181. package/template/.claude/skills/systematic-debugging/defense-in-depth.md +122 -0
  182. package/template/.claude/skills/systematic-debugging/find-polluter.sh +63 -0
  183. package/template/.claude/skills/systematic-debugging/root-cause-tracing.md +169 -0
  184. package/template/.claude/skills/systematic-debugging/test-academic.md +14 -0
  185. package/template/.claude/skills/systematic-debugging/test-pressure-1.md +58 -0
  186. package/template/.claude/skills/systematic-debugging/test-pressure-2.md +68 -0
  187. package/template/.claude/skills/systematic-debugging/test-pressure-3.md +69 -0
  188. package/template/.claude/skills/tdd-workflow/SKILL.md +186 -0
  189. package/template/.claude/skills/tdd-workflow/references/typescript.md +231 -0
  190. package/template/.claude/skills/tech-stack-catalog/SKILL.md +49 -0
  191. package/template/.claude/skills/tech-stack-catalog/references/constraint-questions.md +237 -0
  192. package/template/.claude/skills/tech-stack-catalog/references/dev-tooling-decisions.md +37 -0
  193. package/template/.claude/skills/tech-stack-catalog/references/surface-decision-tables.md +69 -0
  194. package/template/.claude/skills/technical-writer/SKILL.md +242 -0
  195. package/template/.claude/skills/testing-strategist/SKILL.md +319 -0
  196. package/template/.claude/skills/testing-strategist/references/typescript.md +328 -0
  197. package/template/.claude/skills/verification-before-completion/SKILL.md +97 -0
  198. package/template/.claude/skills/workflow-automation/SKILL.md +166 -0
  199. package/template/.claude/skills/workflow-automation/references/inngest.md +88 -0
  200. package/template/.claude/skills/workflow-automation/references/temporal.md +64 -0
@@ -0,0 +1,39 @@
1
+ # TDD Testing Policy
2
+
3
+ ## Assertion Depth Rule
4
+
5
+ Every test must assert **at minimum**:
6
+ - Response status code AND response body structure (not just status)
7
+ - At least one specific field value from the response body
8
+ - For error paths: the full error shape (code + message), not just the status code
9
+ - Contract tests must assert both valid input accepted AND invalid input rejected with the correct error shape
10
+
11
+ Tests that only assert `status == 200` without checking the response body are **insufficient** and will be flagged during QA anti-cheat audit.
12
+
13
+ ## Anti-Mock-Abuse Rules
14
+
15
+ | Test Type | Mocking Policy |
16
+ |-----------|---------------|
17
+ | **Unit tests** | Mocking external dependencies allowed and expected |
18
+ | **Integration tests** | At least one test per endpoint must hit a real test database — no mocked DB responses |
19
+ | **E2E tests** | No mocks allowed — full stack or it doesn't count |
20
+
21
+ **Banned patterns**:
22
+ - Mocking the module under test (testing a mock of what you're building)
23
+ - Mock chains (mocking a mock that mocks another dependency)
24
+ - Tests where the mock returns exactly the expected value (circular, proves nothing)
25
+
26
+ **Test order**: Unit → Integration → E2E (if applicable)
27
+
28
+ ## QA Anti-Cheat Audit
29
+
30
+ Before marking tests as passing, verify:
31
+
32
+ - [ ] No tests with zero assertions
33
+ - [ ] No tautological tests (e.g., `expect(true).toBe(true)`, `expect(mock).toEqual(mock)`)
34
+ - [ ] No `test.skip` without a `BOUNDARY:` reference and tracking issue
35
+ - [ ] Every test that asserts a response also asserts the response body, not just the status code
36
+ - [ ] No tests that mock the thing they're supposed to test (e.g., mocking the handler to test the handler)
37
+ - [ ] Error path tests actually trigger the error condition — they don't just mock the error response
38
+
39
+ In sequential mode, the agent self-audits against this checklist. In parallel mode, the QA-GREEN agent runs this explicitly.
@@ -0,0 +1,57 @@
1
+ # Vision Document Template
2
+
3
+ Use this template when compiling `docs/plans/vision.md` as the human-readable executive summary.
4
+
5
+ > **Important**: `vision.md` is a summary document for human consumption. The pipeline reads
6
+ > `docs/plans/ideation/ideation-index.md` directly — not this file. All the depth, domain
7
+ > files, CX files, and structured data live in the `ideation/` folder's fractal tree.
8
+
9
+ ```markdown
10
+ # [Project Name] — Vision
11
+
12
+ > One-sentence pitch: [from Step 4]
13
+
14
+ > **This is a human-readable project summary.** For pipeline-grade detail, see
15
+ > [ideation-index.md](ideation/ideation-index.md) and the fractal domain tree it references.
16
+
17
+ ## Problem Statement
18
+ [Condensed from `meta/problem-statement.md`]
19
+
20
+ ## Target Users
21
+ [Condensed persona summaries from `meta/personas.md` — name + role + pain point + success criteria.
22
+ Not the full 6-field exploration — that detail stays in the personas file.]
23
+
24
+ ## Solution Overview
25
+ [2-3 paragraphs describing what the product does and why it matters.]
26
+
27
+ ## Domain Map
28
+ [One paragraph per domain, condensed from the ideation domain folders (paths in `ideation-index.md` Structure Map).
29
+ Each domain links to its folder's index file.]
30
+
31
+ ## Feature Inventory (MoSCoW)
32
+ ### Must Have (Phase 1)
33
+ [Feature names + one-line description. Links to domain folder index files for drill-down detail.]
34
+ ### Should Have (Phase 2)
35
+ [Feature names + one-line description.]
36
+ ### Could Have (Phase 3+)
37
+ ### Won't Have (explicitly excluded)
38
+
39
+ ## Key Cross-Cutting Interactions
40
+ [Top confirmed interactions from `ideation-cx.md` (global) and domain-level `*-cx.md` files.
41
+ Full synthesis detail stays in the CX files.]
42
+
43
+ ## Constraints Summary
44
+ [Condensed from `meta/constraints.md` — budget, timeline, team, compliance, performance, surfaces.]
45
+
46
+ ## Success Metrics
47
+ [Key metrics with concrete targets. Full details in relevant domain folder feature files.]
48
+
49
+ ## Competitive Landscape
50
+ [Condensed from `meta/competitive-landscape.md` — competitors, differentiation, moat.]
51
+
52
+ ## Key Decisions
53
+ [Numbered list of major product decisions made during ideation.]
54
+
55
+ ## Open Questions
56
+ [Anything unresolved that needs answers before architecture — with owners and target stages.]
57
+ ```
@@ -0,0 +1,112 @@
1
+ # Workflow Checkpoint Protocol
2
+
3
+ > Survive context truncation. When process memory is lost, this file tells the next context exactly where you are and what to do next.
4
+
5
+ ## When to use
6
+
7
+ Every `/create-prd` shard workflow writes and reads this checkpoint. It lives at `docs/plans/prd-working/workflow-state.md`.
8
+
9
+ ## Checkpoint file format
10
+
11
+ The checkpoint is a markdown file with YAML-style key-value pairs. Agents must parse it on shard start and update it at every write trigger.
12
+
13
+ ```markdown
14
+ # Workflow Checkpoint
15
+
16
+ active_shard: .agent/workflows/create-prd-stack.md
17
+ current_step: per-axis-flow
18
+ current_item: Frontend Framework (STK-04)
19
+ items_completed: [Hosting (STK-01), Database (STK-02), Auth (STK-03)]
20
+ next_action: Read ideation files for Frontend Framework axis, write synthesis
21
+ pending_reads:
22
+ - docs/plans/ideation/domains/dashboard/dashboard-deep-dive.md
23
+ - docs/plans/ideation/domains/diagnostics/diagnostics-deep-dive.md
24
+ - docs/plans/ideation/ideation-cx.md
25
+ synthesis_written: false
26
+ last_user_output: Confirmed Auth Provider as Supabase Auth (STK-03)
27
+ ```
28
+
29
+ ### Field definitions
30
+
31
+ | Field | Type | Purpose |
32
+ |-------|------|---------|
33
+ | `active_shard` | filepath | Which workflow file to `view_file` to recover process |
34
+ | `current_step` | string | Step identifier within the shard |
35
+ | `current_item` | string | Axis name, decision name, or section being worked on |
36
+ | `items_completed` | list | Already-completed items (decisions, sections, axes) |
37
+ | `next_action` | string | Exact next thing the agent should do |
38
+ | `pending_reads` | list | Files that MUST be read before next user-facing output |
39
+ | `synthesis_written` | bool | Whether synthesis was written for current item |
40
+ | `last_user_output` | string | Summary of last thing shown to the user |
41
+
42
+ ## Write triggers
43
+
44
+ Update the checkpoint file at these moments:
45
+
46
+ 1. **Shard start** — initialize with shard filepath, first step, empty completed list
47
+ 2. **After reading ideation files** — update `pending_reads` to empty, note files were read
48
+ 3. **After writing synthesis** — set `synthesis_written: true`
49
+ 4. **After each item completion** — move item to `items_completed`, set next item, reset `synthesis_written: false`, populate `pending_reads` for next item from the Ideation Relevance Index
50
+ 5. **Before user-facing output** — update `last_user_output` with summary of what was presented
51
+ 6. **Shard completion** — update `current_step: complete`, `next_action: proceed to [next shard]`
52
+
53
+ ## Read triggers — Resumption
54
+
55
+ At the start of every shard, check if `docs/plans/prd-working/workflow-state.md` exists.
56
+
57
+ ### If it exists and `active_shard` matches this shard:
58
+
59
+ 1. **Re-read the shard workflow**: `view_file` the path in `active_shard` — recover the full process
60
+ 2. **Load completed items**: Skip already-completed axes/decisions
61
+ 3. **Check `synthesis_written`**: If `false` → the agent was interrupted before writing synthesis. Read `pending_reads` files and write synthesis before doing anything else
62
+ 4. **Resume from `next_action`**: Execute exactly what the checkpoint says
63
+
64
+ ### If it exists and `active_shard` is a DIFFERENT shard:
65
+
66
+ The previous shard finished or a different shard is running. Check `current_step`:
67
+ - If `complete` → previous shard finished cleanly. Initialize fresh checkpoint for this shard
68
+ - If not `complete` → previous shard was interrupted. **STOP**: "Previous shard `{active_shard}` was interrupted at `{current_item}`. Resume that shard first or confirm skip."
69
+
70
+ ### If it does not exist:
71
+
72
+ Fresh start. Initialize the checkpoint.
73
+
74
+ ## Synthesis verification gate (HARD)
75
+
76
+ > This gate enforces `source-before-ask`. It is not optional.
77
+
78
+ **Before presenting ANY Tier 2 question, option table, or recommendation to the user:**
79
+
80
+ 1. Read the checkpoint file
81
+ 2. Check `synthesis_written` for the current item
82
+ 3. If `synthesis_written: false` → **STOP**. Do not present anything to the user. Read the files in `pending_reads`, write the synthesis to the appropriate synthesis file, update `synthesis_written: true` in the checkpoint, THEN proceed
83
+ 4. If `synthesis_written: true` → proceed with user-facing output
84
+
85
+ This gate catches the exact failure mode: context truncation drops the synthesis step, the agent pattern-matches "STK-04 is next" from the summary, and jumps straight to asking the user generic questions.
86
+
87
+ ## Shard-specific checkpoint patterns
88
+
89
+ ### create-prd-stack
90
+
91
+ - `current_item` format: `{Axis Name} (STK-{NN})`
92
+ - `items_completed` tracks each axis
93
+ - `pending_reads` populated from Ideation Relevance Index per-axis
94
+ - Checkpoint updated at per-axis flow step 9 (move to next axis)
95
+
96
+ ### create-prd-design-system
97
+
98
+ - `current_item` format: `{Decision Name} (DS-{NN})`
99
+ - 7 decisions tracked: Navigation Paradigm, Layout Grid, Page Archetypes, Component Hierarchy, Motion System, Data Density, State Design Language
100
+ - `pending_reads` populated from heavy domain files
101
+
102
+ ### create-prd-architecture / security / compile
103
+
104
+ - `current_item` format: `{Section Name}`
105
+ - Tracks major sections (e.g., "System Components", "Data Strategy", "Security Model")
106
+ - `pending_reads` populated from relevant ideation domains per section
107
+
108
+ ## Cleanup
109
+
110
+ The parent orchestrator (`create-prd.md`) deletes or archives the checkpoint file after Step E (quality gate) passes. The file is a process artifact — once the PRD is compiled, it has no further value.
111
+
112
+ The synthesis files in `prd-working/` are kept as audit trail.
@@ -0,0 +1,57 @@
1
+ # Write Verification Protocol
2
+
3
+ **Purpose**: Every file write MUST be verified by reading the file back. This protocol eliminates the ~18 instances of "write the completed section" without verification.
4
+
5
+ ---
6
+
7
+ ## Procedure
8
+
9
+ ### 1. Write
10
+
11
+ Write the content to the target file at the specified section.
12
+
13
+ ### 2. Read Back
14
+
15
+ Immediately after writing, read the target file. Locate the section header that was just written.
16
+
17
+ ### 3. Verify
18
+
19
+ Check ALL of these conditions:
20
+
21
+ - [ ] The section header exists in the file
22
+ - [ ] The section content is non-empty (not just a header with no body)
23
+ - [ ] The content matches what was intended (key fields present, no truncation)
24
+
25
+ ### 4. Handle Failure
26
+
27
+ **If ANY check fails:**
28
+
29
+ 1. Log: "Write verification failed for `[file]` section `[section]`."
30
+ 2. Retry the write once.
31
+ 3. Read back again and re-verify.
32
+ 4. If second attempt fails → **STOP**: "Unable to write `[section]` to `[file]` after 2 attempts. Investigate before proceeding."
33
+
34
+ ### 5. Confirm
35
+
36
+ After successful verification, log: `Write verified: [file] § [section]`
37
+
38
+ ---
39
+
40
+ ## When to Use
41
+
42
+ Any workflow step that says:
43
+ - "Write the completed [section]"
44
+ - "Write [content] to [file]"
45
+ - "Update [file] with [content]"
46
+ - "Append [content] to [file]"
47
+
48
+ MUST follow this protocol. There are no exceptions. A write instruction without read-back verification is an enforcement failure.
49
+
50
+ ---
51
+
52
+ ## Scope
53
+
54
+ This protocol applies to **spec and instruction file writes** — the documents that drive downstream pipeline behavior. It does NOT apply to:
55
+ - Progress tracking file writes (those have their own verification in the completion checklist)
56
+ - Temporary/scratch files
57
+ - Audit report writes (those are progressive and self-verifying)
@@ -0,0 +1,203 @@
1
+ ---
2
+ name: prompt-engineer
3
+ description: "Transforms user prompts into optimized prompts using established frameworks (RTF, RISEN, Chain of Thought, RODES). Analyzes intent, selects framework, and produces structured, ready-to-use prompts."
4
+ version: 2.0.0
5
+ source: self
6
+ date_added: "2026-02-27"
7
+ date_rewritten: "2026-03-14"
8
+ ---
9
+
10
+ # Prompt Engineering
11
+
12
+ Transform vague or unstructured prompts into highly effective, framework-backed prompts that maximize AI output quality.
13
+
14
+ ## When to Use
15
+
16
+ - User provides a vague or generic prompt ("help me code Python")
17
+ - User has a complex idea but struggles to articulate it clearly
18
+ - User asks "create a prompt for..." or "how do I ask AI to..."
19
+ - Task requires step-by-step reasoning (debugging, analysis, design)
20
+ - User wants to improve an existing prompt's effectiveness
21
+
22
+ ## When NOT to Use
23
+
24
+ - User's prompt is already clear and specific
25
+ - Simple factual questions ("what is X?")
26
+ - During pipeline workflows that have their own prompting structure
27
+
28
+ ## Operating Mode
29
+
30
+ Work silently — no framework jargon in the output. The user gets a polished prompt, not a lecture on prompt engineering theory.
31
+
32
+ ---
33
+
34
+ ## Workflow
35
+
36
+ ### 1. Analyze Intent
37
+
38
+ Read the raw prompt and detect:
39
+
40
+ | Dimension | Options |
41
+ |-----------|---------|
42
+ | **Type** | Coding, writing, analysis, design, learning, planning, creative |
43
+ | **Complexity** | Simple (one-step), moderate (multi-step), complex (reasoning needed) |
44
+ | **Clarity** | Clear intent vs. ambiguous/vague |
45
+ | **Domain** | Technical, business, creative, academic |
46
+
47
+ Identify implicit requirements:
48
+ - Does the user need examples?
49
+ - Is the output format specified?
50
+ - Are there constraints (time, scope, resources)?
51
+ - Is this exploratory or execution-focused?
52
+
53
+ ### 2. Clarify If Needed
54
+
55
+ - **0 questions** if intent is clear (most cases)
56
+ - **1-2 questions max** if critical information is ambiguous
57
+ - **Never ask** about framework selection — that's your job
58
+
59
+ ### 3. Select Framework
60
+
61
+ | Task Type | Framework | Why |
62
+ |-----------|-----------|-----|
63
+ | Role-based tasks (act as expert) | **RTF** (Role-Task-Format) | Clear role + task + output format |
64
+ | Step-by-step reasoning (debugging, analysis) | **Chain of Thought** | Forces explicit reasoning steps |
65
+ | Multi-phase projects (systems, deliverables) | **RISEN** (Role, Instructions, Steps, End goal, Narrowing) | Comprehensive structure |
66
+ | Complex design/architecture | **RODES** (Role, Objective, Details, Examples, Sense check) | Balances detail with validation |
67
+ | Summarization/synthesis | **Chain of Density** | Iterative compression to essentials |
68
+ | Communication (reports, presentations) | **RACE** (Role, Audience, Context, Expectation) | Audience-aware messaging |
69
+ | Goal-setting (OKRs, planning) | **CLEAR** (Collaborative, Limited, Emotional, Appreciable, Refinable) | Actionable goals |
70
+
71
+ **Blending**: Combine 2 frameworks when a task spans types. Example: architecture design → RODES + Chain of Thought.
72
+
73
+ **Selection happens silently** — never explain framework choice to the user.
74
+
75
+ ### 4. Generate Prompt
76
+
77
+ Build the optimized prompt using the selected framework(s):
78
+
79
+ **Structure rules:**
80
+ - Start with a clear role definition
81
+ - State the objective in one sentence
82
+ - Break complex tasks into numbered steps
83
+ - Include output format specification
84
+ - Add a validation/sense-check instruction for complex tasks
85
+ - Keep the prompt self-contained (no external context needed)
86
+
87
+ **Quality checks before presenting:**
88
+ - [ ] Prompt is self-contained
89
+ - [ ] Task is specific and measurable
90
+ - [ ] Output format is clear
91
+ - [ ] No ambiguous language
92
+ - [ ] Appropriate detail for task complexity
93
+ - [ ] Language matches user's language
94
+
95
+ ### 5. Present
96
+
97
+ Present the optimized prompt in a clean markdown code block. No meta-commentary, no framework explanation.
98
+
99
+ ---
100
+
101
+ ## Examples
102
+
103
+ ### Vague Input → RTF
104
+
105
+ **User**: "help me write better code"
106
+
107
+ **Output**:
108
+ ```
109
+ Role: You are a senior software engineer conducting a code review.
110
+
111
+ Task: Review the code I provide and identify issues across these dimensions:
112
+ 1. Readability — naming, structure, comments
113
+ 2. Correctness — logic errors, edge cases, off-by-one errors
114
+ 3. Performance — unnecessary allocations, O(n²) where O(n) exists
115
+ 4. Security — injection risks, data exposure, input validation
116
+ 5. Maintainability — coupling, cohesion, testability
117
+
118
+ Format: For each issue found, provide:
119
+ - Location (file/line if applicable)
120
+ - Category (readability/correctness/performance/security/maintainability)
121
+ - Current code
122
+ - Suggested improvement with explanation
123
+ - Severity (critical/warning/suggestion)
124
+ ```
125
+
126
+ ### Complex Input → RODES + Chain of Thought
127
+
128
+ **User**: "I need to build a recommendation system using purchase history and user preferences"
129
+
130
+ **Output**:
131
+ ```
132
+ Role: You are a senior ML engineer specializing in recommendation systems.
133
+
134
+ Objective: Design a product recommendation system combining user purchase history, stated preferences, and behavioral signals.
135
+
136
+ Details:
137
+ - Input sources: transaction logs, preference surveys, browsing behavior
138
+ - Algorithm tradeoffs: collaborative filtering vs. content-based vs. hybrid
139
+ - Performance targets: recommendations served in <200ms, updated hourly
140
+ - Scale: handle 100K+ users with sparse interaction matrices
141
+
142
+ Approach this step-by-step:
143
+ 1. Analyze data sources and their signal quality
144
+ 2. Propose 2-3 algorithm approaches with tradeoff analysis
145
+ 3. Design the data pipeline (ingestion → processing → serving)
146
+ 4. Define evaluation metrics (precision, recall, diversity, novelty)
147
+ 5. Outline a phased implementation roadmap
148
+
149
+ Examples: Include pseudocode for the core recommendation logic, a data flow diagram, and sample API response structure.
150
+
151
+ Sense check: Verify the solution balances personalization with discovery, handles cold-start problems for new users, and scales to production load.
152
+
153
+ Output: Technical design document with architecture diagrams, algorithm justification, and implementation roadmap.
154
+ ```
155
+
156
+ ### Debugging → Chain of Thought
157
+
158
+ **User**: "my code isn't working, needs debugging"
159
+
160
+ **Output**:
161
+ ```
162
+ You are an expert debugger.
163
+
164
+ Task: Debug the code I provide using systematic analysis.
165
+
166
+ Step-by-step approach:
167
+ 1. Read the code and identify its intended purpose
168
+ 2. Identify the error or unexpected behavior
169
+ 3. Trace variable states through execution
170
+ 4. Locate the root cause
171
+ 5. Propose a fix with explanation
172
+ 6. Suggest preventive measures
173
+
174
+ For each step, show your reasoning:
175
+ - What you're checking
176
+ - What you found
177
+ - Why it matters
178
+
179
+ Output format:
180
+ - **Issue**: [Describe the bug]
181
+ - **Root cause**: [Why it's happening]
182
+ - **Fix**: [Corrected code with inline comments]
183
+ - **Prevention**: [How to avoid this in the future]
184
+
185
+ Include a minimal working example to verify the fix.
186
+ ```
187
+
188
+ ---
189
+
190
+ ## Rules
191
+
192
+ **NEVER:**
193
+ - Explain which framework was selected or why
194
+ - Generate generic, one-size-fits-all prompts
195
+ - Ask more than 2 clarifying questions
196
+ - Include meta-commentary ("This prompt uses...", "Note that...")
197
+
198
+ **ALWAYS:**
199
+ - Analyze intent before generating
200
+ - Select framework based on task type and complexity
201
+ - Include output format specification
202
+ - Present in a clean code block
203
+ - Match the user's language (English → English, etc.)