cfsa-antigravity 2.0.0 → 2.2.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 (116) hide show
  1. package/README.md +14 -0
  2. package/package.json +1 -1
  3. package/template/.agent/instructions/commands.md +8 -32
  4. package/template/.agent/instructions/example.md +21 -0
  5. package/template/.agent/instructions/patterns.md +3 -3
  6. package/template/.agent/instructions/tech-stack.md +71 -23
  7. package/template/.agent/instructions/workflow.md +12 -1
  8. package/template/.agent/rules/completion-checklist.md +6 -0
  9. package/template/.agent/rules/security-first.md +3 -3
  10. package/template/.agent/rules/vertical-slices.md +1 -1
  11. package/template/.agent/skill-library/MANIFEST.md +6 -0
  12. package/template/.agent/skill-library/stack/devops/git-advanced/SKILL.md +972 -0
  13. package/template/.agent/skill-library/stack/devops/git-workflow/SKILL.md +420 -0
  14. package/template/.agent/skills/api-versioning/SKILL.md +44 -298
  15. package/template/.agent/skills/api-versioning/references/typescript.md +157 -0
  16. package/template/.agent/skills/architecture-mapping/SKILL.md +13 -13
  17. package/template/.agent/skills/bootstrap-agents/SKILL.md +151 -152
  18. package/template/.agent/skills/clean-code/SKILL.md +64 -118
  19. package/template/.agent/skills/clean-code/references/typescript.md +126 -0
  20. package/template/.agent/skills/database-schema-design/SKILL.md +93 -317
  21. package/template/.agent/skills/database-schema-design/references/relational.md +228 -0
  22. package/template/.agent/skills/error-handling-patterns/SKILL.md +62 -557
  23. package/template/.agent/skills/error-handling-patterns/references/go.md +162 -0
  24. package/template/.agent/skills/error-handling-patterns/references/python.md +262 -0
  25. package/template/.agent/skills/error-handling-patterns/references/rust.md +112 -0
  26. package/template/.agent/skills/error-handling-patterns/references/typescript.md +178 -0
  27. package/template/.agent/skills/idea-extraction/SKILL.md +322 -224
  28. package/template/.agent/skills/logging-best-practices/SKILL.md +108 -767
  29. package/template/.agent/skills/logging-best-practices/references/go.md +49 -0
  30. package/template/.agent/skills/logging-best-practices/references/python.md +52 -0
  31. package/template/.agent/skills/logging-best-practices/references/typescript.md +215 -0
  32. package/template/.agent/skills/migration-management/SKILL.md +127 -311
  33. package/template/.agent/skills/migration-management/references/relational.md +214 -0
  34. package/template/.agent/skills/parallel-feature-development/SKILL.md +34 -43
  35. package/template/.agent/skills/pipeline-rubrics/references/be-rubric.md +1 -1
  36. package/template/.agent/skills/pipeline-rubrics/references/ia-rubric.md +2 -2
  37. package/template/.agent/skills/pipeline-rubrics/references/scoring.md +1 -1
  38. package/template/.agent/skills/pipeline-rubrics/references/vision-rubric.md +2 -1
  39. package/template/.agent/skills/prd-templates/SKILL.md +23 -6
  40. package/template/.agent/skills/prd-templates/references/be-spec-template.md +2 -2
  41. package/template/.agent/skills/prd-templates/references/decomposition-templates.md +2 -2
  42. package/template/.agent/skills/prd-templates/references/engineering-standards-template.md +2 -0
  43. package/template/.agent/skills/prd-templates/references/fe-spec-template.md +1 -1
  44. package/template/.agent/skills/prd-templates/references/fractal-cx-template.md +58 -0
  45. package/template/.agent/skills/prd-templates/references/fractal-feature-template.md +93 -0
  46. package/template/.agent/skills/prd-templates/references/fractal-node-index-template.md +55 -0
  47. package/template/.agent/skills/prd-templates/references/ideation-crosscut-template.md +26 -47
  48. package/template/.agent/skills/prd-templates/references/ideation-index-template.md +47 -31
  49. package/template/.agent/skills/prd-templates/references/operational-templates.md +1 -1
  50. package/template/.agent/skills/prd-templates/references/placeholder-workflow-mapping.md +50 -21
  51. package/template/.agent/skills/prd-templates/references/skill-loading-protocol.md +32 -0
  52. package/template/.agent/skills/prd-templates/references/slice-completion-gates.md +29 -0
  53. package/template/.agent/skills/prd-templates/references/spec-coverage-sweep.md +3 -3
  54. package/template/.agent/skills/prd-templates/references/tdd-testing-policy.md +39 -0
  55. package/template/.agent/skills/prd-templates/references/vision-template.md +8 -8
  56. package/template/.agent/skills/regex-patterns/SKILL.md +122 -540
  57. package/template/.agent/skills/regex-patterns/references/go.md +44 -0
  58. package/template/.agent/skills/regex-patterns/references/javascript.md +63 -0
  59. package/template/.agent/skills/regex-patterns/references/python.md +77 -0
  60. package/template/.agent/skills/regex-patterns/references/rust.md +43 -0
  61. package/template/.agent/skills/resolve-ambiguity/SKILL.md +1 -1
  62. package/template/.agent/skills/session-continuity/SKILL.md +11 -9
  63. package/template/.agent/skills/session-continuity/protocols/02-progress-generation.md +2 -2
  64. package/template/.agent/skills/session-continuity/protocols/04-pattern-extraction.md +1 -1
  65. package/template/.agent/skills/session-continuity/protocols/05-session-close.md +1 -1
  66. package/template/.agent/skills/session-continuity/protocols/09-parallel-claim.md +1 -1
  67. package/template/.agent/skills/session-continuity/protocols/10-placeholder-verification-gate.md +57 -78
  68. package/template/.agent/skills/session-continuity/protocols/11-parallel-synthesis.md +1 -1
  69. package/template/.agent/skills/spec-writing/SKILL.md +1 -1
  70. package/template/.agent/skills/tdd-workflow/SKILL.md +94 -317
  71. package/template/.agent/skills/tdd-workflow/references/typescript.md +231 -0
  72. package/template/.agent/skills/testing-strategist/SKILL.md +74 -687
  73. package/template/.agent/skills/testing-strategist/references/typescript.md +328 -0
  74. package/template/.agent/skills/workflow-automation/SKILL.md +62 -154
  75. package/template/.agent/skills/workflow-automation/references/inngest.md +88 -0
  76. package/template/.agent/skills/workflow-automation/references/temporal.md +64 -0
  77. package/template/.agent/workflows/bootstrap-agents-fill.md +85 -143
  78. package/template/.agent/workflows/bootstrap-agents-provision.md +90 -107
  79. package/template/.agent/workflows/create-prd-architecture.md +23 -16
  80. package/template/.agent/workflows/create-prd-compile.md +11 -12
  81. package/template/.agent/workflows/create-prd-design-system.md +1 -1
  82. package/template/.agent/workflows/create-prd-security.md +9 -11
  83. package/template/.agent/workflows/create-prd-stack.md +10 -4
  84. package/template/.agent/workflows/create-prd.md +9 -9
  85. package/template/.agent/workflows/decompose-architecture-structure.md +4 -6
  86. package/template/.agent/workflows/decompose-architecture-validate.md +18 -1
  87. package/template/.agent/workflows/decompose-architecture.md +18 -3
  88. package/template/.agent/workflows/evolve-contract.md +11 -11
  89. package/template/.agent/workflows/evolve-feature-classify.md +14 -6
  90. package/template/.agent/workflows/ideate-discover.md +72 -107
  91. package/template/.agent/workflows/ideate-extract.md +84 -63
  92. package/template/.agent/workflows/ideate-validate.md +26 -22
  93. package/template/.agent/workflows/ideate.md +9 -9
  94. package/template/.agent/workflows/implement-slice-setup.md +25 -23
  95. package/template/.agent/workflows/implement-slice-tdd.md +73 -89
  96. package/template/.agent/workflows/implement-slice.md +4 -4
  97. package/template/.agent/workflows/plan-phase-preflight.md +6 -2
  98. package/template/.agent/workflows/plan-phase-write.md +6 -8
  99. package/template/.agent/workflows/remediate-pipeline-assess.md +2 -1
  100. package/template/.agent/workflows/resolve-ambiguity.md +2 -2
  101. package/template/.agent/workflows/update-architecture-map.md +22 -5
  102. package/template/.agent/workflows/validate-phase-quality.md +155 -0
  103. package/template/.agent/workflows/validate-phase-readiness.md +167 -0
  104. package/template/.agent/workflows/validate-phase.md +19 -157
  105. package/template/.agent/workflows/verify-infrastructure.md +10 -10
  106. package/template/.agent/workflows/write-architecture-spec-design.md +23 -14
  107. package/template/.agent/workflows/write-be-spec-classify.md +25 -21
  108. package/template/.agent/workflows/write-be-spec.md +1 -1
  109. package/template/.agent/workflows/write-fe-spec-classify.md +6 -12
  110. package/template/.agent/workflows/write-fe-spec-write.md +1 -1
  111. package/template/AGENTS.md +6 -2
  112. package/template/GEMINI.md +5 -3
  113. package/template/docs/README.md +10 -10
  114. package/template/docs/kit-architecture.md +126 -33
  115. package/template/docs/plans/ideation/README.md +8 -3
  116. package/template/.agent/skills/prd-templates/references/ideation-domain-template.md +0 -55
@@ -0,0 +1,214 @@
1
+ # Relational Database Migration Patterns
2
+
3
+ Paradigm-specific patterns for the `migration-management` skill. Read `SKILL.md` first for universal methodology.
4
+
5
+ Covers: **PostgreSQL**, **MySQL**
6
+
7
+ ---
8
+
9
+ ## Migration Tracking Tables
10
+
11
+ ### PostgreSQL
12
+
13
+ ```sql
14
+ CREATE TABLE schema_migrations (
15
+ version BIGINT PRIMARY KEY,
16
+ name VARCHAR(255) NOT NULL,
17
+ executed_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
18
+ duration_ms INTEGER,
19
+ checksum VARCHAR(64)
20
+ );
21
+
22
+ CREATE TABLE migration_logs (
23
+ id UUID PRIMARY KEY DEFAULT gen_random_uuid(),
24
+ version BIGINT NOT NULL,
25
+ status VARCHAR(20) NOT NULL,
26
+ error_message TEXT,
27
+ rolled_back_at TIMESTAMP,
28
+ executed_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP
29
+ );
30
+
31
+ CREATE OR REPLACE FUNCTION record_migration(
32
+ p_version BIGINT, p_name VARCHAR, p_duration_ms INTEGER
33
+ ) RETURNS void AS $$
34
+ BEGIN
35
+ INSERT INTO schema_migrations (version, name, duration_ms)
36
+ VALUES (p_version, p_name, p_duration_ms)
37
+ ON CONFLICT (version) DO UPDATE SET executed_at = CURRENT_TIMESTAMP;
38
+ END;
39
+ $$ LANGUAGE plpgsql;
40
+ ```
41
+
42
+ ### MySQL
43
+
44
+ ```sql
45
+ CREATE TABLE schema_migrations (
46
+ version BIGINT PRIMARY KEY,
47
+ name VARCHAR(255) NOT NULL,
48
+ executed_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
49
+ duration_ms INT,
50
+ checksum VARCHAR(64)
51
+ ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
52
+
53
+ CREATE TABLE migration_status (
54
+ id INT AUTO_INCREMENT PRIMARY KEY,
55
+ version BIGINT NOT NULL,
56
+ status ENUM('pending', 'completed', 'failed', 'rolled_back'),
57
+ error_message TEXT,
58
+ created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP
59
+ ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
60
+ ```
61
+
62
+ ---
63
+
64
+ ## Adding Columns
65
+
66
+ ### PostgreSQL
67
+
68
+ ```sql
69
+ -- Non-blocking column addition
70
+ ALTER TABLE users ADD COLUMN phone VARCHAR(20) DEFAULT '';
71
+ ALTER TABLE users ADD CONSTRAINT phone_format
72
+ CHECK (phone = '' OR phone ~ '^\+?[0-9\-\(\)]{10,}$');
73
+ CREATE INDEX CONCURRENTLY idx_users_phone ON users(phone);
74
+
75
+ -- Rollback:
76
+ -- DROP INDEX CONCURRENTLY idx_users_phone;
77
+ -- ALTER TABLE users DROP COLUMN phone;
78
+ ```
79
+
80
+ ### MySQL
81
+
82
+ ```sql
83
+ ALTER TABLE users
84
+ ADD COLUMN phone VARCHAR(20) DEFAULT '',
85
+ ADD INDEX idx_phone (phone);
86
+
87
+ -- Rollback:
88
+ -- ALTER TABLE users DROP COLUMN phone;
89
+ ```
90
+
91
+ ---
92
+
93
+ ## Renaming Columns
94
+
95
+ ```sql
96
+ -- PostgreSQL
97
+ ALTER TABLE users RENAME COLUMN user_name TO full_name;
98
+ REINDEX TABLE users;
99
+
100
+ -- Rollback:
101
+ -- ALTER TABLE users RENAME COLUMN full_name TO user_name;
102
+ ```
103
+
104
+ ---
105
+
106
+ ## Creating Indexes Non-Blocking
107
+
108
+ ### PostgreSQL (CONCURRENTLY)
109
+
110
+ ```sql
111
+ CREATE INDEX CONCURRENTLY idx_orders_user_created
112
+ ON orders(user_id, created_at DESC);
113
+
114
+ CREATE INDEX CONCURRENTLY idx_products_category_active
115
+ ON products(category_id) WHERE active = true;
116
+
117
+ -- Verify
118
+ SELECT schemaname, tablename, indexname, idx_scan
119
+ FROM pg_stat_user_indexes WHERE indexname LIKE 'idx_%';
120
+ ```
121
+
122
+ ### MySQL (INPLACE)
123
+
124
+ ```sql
125
+ ALTER TABLE orders
126
+ ADD INDEX idx_user_created (user_id, created_at),
127
+ ALGORITHM=INPLACE, LOCK=NONE;
128
+ ```
129
+
130
+ ---
131
+
132
+ ## Data Transformations
133
+
134
+ ### PostgreSQL
135
+
136
+ ```sql
137
+ -- Normalize emails
138
+ UPDATE users SET email = LOWER(TRIM(email))
139
+ WHERE email != LOWER(TRIM(email));
140
+
141
+ -- Deduplicate (keep latest)
142
+ DELETE FROM users WHERE id NOT IN (
143
+ SELECT DISTINCT ON (LOWER(email)) id
144
+ FROM users ORDER BY LOWER(email), created_at DESC
145
+ );
146
+ ```
147
+
148
+ ### MySQL
149
+
150
+ ```sql
151
+ UPDATE products p
152
+ JOIN category_mapping cm ON p.old_category = cm.old_name
153
+ SET p.category_id = cm.new_category_id
154
+ WHERE p.old_category IS NOT NULL;
155
+ ```
156
+
157
+ ---
158
+
159
+ ## Testing in Transaction
160
+
161
+ ```sql
162
+ BEGIN;
163
+ ALTER TABLE users ADD COLUMN test_column VARCHAR(255);
164
+ SELECT COUNT(*) FROM users;
165
+ -- ROLLBACK if issues, COMMIT if good
166
+ ROLLBACK;
167
+ ```
168
+
169
+ ---
170
+
171
+ ## Bidirectional Migration Example
172
+
173
+ ```sql
174
+ -- ===== UP =====
175
+ CREATE TYPE user_status AS ENUM ('active', 'suspended', 'deleted');
176
+ ALTER TABLE users ADD COLUMN status user_status DEFAULT 'active';
177
+
178
+ -- ===== DOWN =====
179
+ -- ALTER TABLE users DROP COLUMN status;
180
+ -- DROP TYPE user_status;
181
+ ```
182
+
183
+ ---
184
+
185
+ ## Production Safety
186
+
187
+ ```sql
188
+ -- PostgreSQL: Prevent hanging migrations
189
+ SET statement_timeout = '30min';
190
+ SET lock_timeout = '5min';
191
+ ```
192
+
193
+ ---
194
+
195
+ ## Combined Migration Example
196
+
197
+ ```sql
198
+ BEGIN;
199
+ ALTER TABLE users ADD COLUMN full_name VARCHAR(255);
200
+ UPDATE users SET full_name = first_name || ' ' || last_name;
201
+ CREATE INDEX idx_users_full_name ON users(full_name);
202
+ ALTER TABLE users ADD CONSTRAINT email_unique UNIQUE(email);
203
+ COMMIT;
204
+ ```
205
+
206
+ ---
207
+
208
+ ## Tools
209
+
210
+ - [PostgreSQL ALTER TABLE](https://www.postgresql.org/docs/current/sql-altertable.html)
211
+ - [MySQL ALTER TABLE](https://dev.mysql.com/doc/refman/8.0/en/alter-table.html)
212
+ - [Flyway](https://flywaydb.org/) — Java
213
+ - [Alembic](https://alembic.sqlalchemy.org/) — Python
214
+ - [Knex.js](https://knexjs.org/) — Node.js
@@ -1,13 +1,13 @@
1
1
  ---
2
2
  name: parallel-feature-development
3
- description: Prevent tool call conflicts when making concurrent edits across a codebase. Establishes strict file ownership, interface contracts, and merge strategies. Use with parallel-agents when executing concurrent `replace_file_content` calls.
3
+ description: Prevent tool call conflicts when making concurrent edits across a codebase. Establishes strict file ownership, interface contracts, and merge strategies. Use with parallel-agents when executing concurrent code changes.
4
4
  ---
5
5
 
6
6
  # Concurrent Feature Development
7
7
 
8
8
  ## Overview
9
9
 
10
- When making concurrent code edits (e.g. implementing the frontend and backend of a slice simultaneously), the #1 risk is **file hash conflicts** — trying to execute multiple `replace_file_content` calls on the same file, which causes the operation to fail. This skill prevents that with strict file ownership, typed interface contracts, and batched execution.
10
+ When making concurrent code edits (e.g. implementing the frontend and backend of a slice simultaneously), the #1 risk is **file conflicts** — trying to modify the same file from multiple streams, which causes the operation to fail. This skill prevents that with strict file ownership, typed interface contracts, and batched execution.
11
11
 
12
12
  **Core principle:** One concurrent stream per file, always. No exceptions. If two streams need the same file, they're not independent — restructure the decomposition.
13
13
 
@@ -36,58 +36,51 @@ If Stream A owns `src/auth/login.ts`, no other stream may modify that file — n
36
36
 
37
37
  ### 1. Ownership Declaration
38
38
 
39
- Before writing code concurrently, create an explicit mental or written ownership manifest:
39
+ Before writing code concurrently, create an explicit ownership manifest:
40
40
 
41
41
  ```markdown
42
42
  ## File Ownership Manifest
43
43
 
44
44
  | Stream | Owned Files | Interface Files |
45
45
  |--------|-------------|-----------------|
46
- | Stream 1 (Auth) | `src/auth/*`, `src/middleware/auth.ts` | `src/types/auth.ts` |
47
- | Stream 2 (API) | `src/api/*`, `src/middleware/api.ts` | `src/types/api.ts` |
48
- | Stream 3 (UI) | `src/components/*`, `src/pages/*` | `src/types/ui.ts` |
46
+ | Stream 1 (Auth) | `src/auth/*`, `src/middleware/auth.*` | `src/types/auth.*` |
47
+ | Stream 2 (API) | `src/api/*`, `src/middleware/api.*` | `src/types/api.*` |
48
+ | Stream 3 (UI) | `src/components/*`, `src/pages/*` | `src/types/ui.*` |
49
49
 
50
50
  ### Shared Files (Frozen)
51
- - `src/types/shared.ts` — modify only in synthesis step
52
- - `src/config.ts` — frozen during parallel work
53
- - `package.json` — frozen during parallel work
51
+ - `src/types/shared.*` — modify only in synthesis step
52
+ - `src/config.*` — frozen during parallel work
53
+ - Package manifest — frozen during parallel work
54
54
  ```
55
55
 
56
56
  **Rules:**
57
- - Every source file to be edited appears in exactly ONE workstream
58
- - Shared files are **frozen** — do not mutate them concurrently
57
+ - Every source file appears in exactly ONE workstream
58
+ - Shared files are **frozen** — do not mutate concurrently
59
59
  - If a stream needs a change to a shared file, document it as a `// BOUNDARY:` stub
60
60
  - Interface files define the contract between streams
61
61
 
62
62
  ### 2. Interface Contracts
63
63
 
64
- Before generating concurrent edits, define the typed interfaces they'll communicate through:
65
-
66
- ```typescript
67
- // src/types/auth.ts — Stream 1 PRODUCES this, Stream 2 CONSUMES it
68
- export interface AuthResult {
69
- userId: string;
70
- roles: string[];
71
- token: string;
72
- }
73
-
74
- // src/types/api.ts — Stream 2 PRODUCES this, Stream 3 CONSUMES it
75
- export interface UserResponse {
76
- id: string;
77
- name: string;
78
- email: string;
79
- }
64
+ Before generating concurrent edits, define the typed interfaces they'll communicate through.
65
+
66
+ **Example (pseudocode — adapt to your language):**
67
+ ```
68
+ // src/types/auth Stream 1 PRODUCES, Stream 2 CONSUMES
69
+ AuthResult { userId: string, roles: string[], token: string }
70
+
71
+ // src/types/api — Stream 2 PRODUCES, Stream 3 CONSUMES
72
+ UserResponse { id: string, name: string, email: string }
80
73
  ```
81
74
 
82
75
  **Contract rules:**
83
- - Interfaces are strictly defined BEFORE generating logic
84
- - Do NOT change interface files during the concurrent implementation phase
76
+ - Interfaces defined BEFORE generating logic
77
+ - Do NOT change interface files during the concurrent phase
85
78
  - Each interface has exactly one PRODUCER and one or more CONSUMERS
86
79
  - Develop against the interface, not assumptions
87
80
 
88
81
  ### 3. Batched Tool Execution
89
82
 
90
- When generating concurrent tool calls in the same turn:
83
+ When generating concurrent tool calls:
91
84
 
92
85
  ```markdown
93
86
  ## Stream: [Role]
@@ -110,7 +103,7 @@ If you need something from another stream's domain:
110
103
 
111
104
  ### 4. Merge Protocol
112
105
 
113
- Always execute edits that don't overlap in a single batched `multi_replace_file_content` call, but conceptually process dependencies:
106
+ Process dependencies in order:
114
107
 
115
108
  ```
116
109
  1. Interface files (already defined, verify no changes)
@@ -127,19 +120,17 @@ Always execute edits that don't overlap in a single batched `multi_replace_file_
127
120
 
128
121
  ### 5. Conflict Resolution
129
122
 
130
- If despite everything, a conflict is detected:
131
-
132
123
  | Conflict Type | Resolution |
133
124
  |---------------|-----------|
134
- | **Same file modified** | `replace_file_content` block. Separate edits into sequential tool calls. |
125
+ | **Same file modified** | Separate edits into sequential tool calls |
135
126
  | **Interface mismatch** | Producer's implementation doesn't match contract → fix producer |
136
127
  | **Missing dependency** | Assumed something exists that doesn't → add BOUNDARY stub |
137
- | **Mutual dependency** | A needs B's output AND B needs A's output → can't go concurrent, code sequentially |
128
+ | **Mutual dependency** | A needs B's output AND B needs A's → can't go concurrent, code sequentially |
138
129
 
139
130
  ## Integration with Kit
140
131
 
141
- - **With `session-continuity` Protocol 9 (Parallel Claim):** When tasks in progress files have surface tags (`BE`, `FE`, `QA`) and claim markers (`[!]`), the `files:` blocks under claimed tasks serve as your live ownership manifest. By analyzing these blocks, you can safely batch `replace_file_content` calls for both `FE` and `BE` tasks simultaneously.
142
- - **With `boundary-not-placeholder`:** Use `// BOUNDARY:` stubs for cross-stream dependencies you can't resolve concurrently. Resolve them sequentially afterward.
132
+ - **With `session-continuity` Protocol 9 (Parallel Claim):** Surface tags (`BE`, `FE`, `QA`) and claim markers (`[!]`) in progress files serve as your live ownership manifest.
133
+ - **With `boundary-not-placeholder`:** Use `// BOUNDARY:` stubs for cross-stream dependencies. Resolve them sequentially afterward.
143
134
  - **With `implement-slice`:** When a slice enters parallel mode (step 1.5), claim all tags concurrently. The synthesis step (6.5) resolves BOUNDARY stubs on frozen files.
144
135
 
145
136
  ## Example: Concurrent Vertical Slice
@@ -148,19 +139,19 @@ If despite everything, a conflict is detected:
148
139
 
149
140
  | Stream | Surface | Owned Files | Produces | Consumes |
150
141
  |--------|---------|-------------|----------|----------|
151
- | DB Stream | Schema | `migrations/003-profile.sql`, `src/db/profile.ts` | `ProfileRecord` type | — |
152
- | API Stream | Endpoint | `src/api/profile.ts`, `src/api/profile.test.ts` | `GET /api/profile` | `ProfileRecord` |
153
- | UI Stream | Component | `src/components/Profile.tsx`, `src/pages/profile.astro` | Rendered page | `GET /api/profile` |
142
+ | DB | Schema | `migrations/003-profile.*`, `src/db/profile.*` | `ProfileRecord` type | — |
143
+ | API | Endpoint | `src/api/profile.*`, `src/api/profile.test.*` | `GET /api/profile` | `ProfileRecord` |
144
+ | UI | Component | `src/components/Profile.*`, `src/pages/profile.*` | Rendered page | `GET /api/profile` |
154
145
 
155
146
  **Merge order:** DB → API → UI (dependency chain)
156
147
 
157
- **Frozen files:** `src/types/shared.ts`, `astro.config.mjs`, `package.json`
148
+ **Frozen files:** `src/types/shared.*`, config, package manifest
158
149
 
159
150
  ## Common Mistakes
160
151
 
161
152
  | Mistake | Consequence | Fix |
162
153
  |---------|-------------|-----|
163
- | Two sub-tasks mutate the same file | Tool call conflict, lost edits | ONE STREAM PER FILE. NO EXCEPTIONS. |
154
+ | Two streams mutate the same file | Tool call conflict, lost edits | ONE STREAM PER FILE |
164
155
  | No interface contracts | Mismatched assumptions | Define types BEFORE editing |
165
156
  | Skipping integration tests | Interfaces match but behavior doesn't | Full suite after batch edits |
166
- | Parallelizing tightly coupled code | Constant blocking, BOUNDARY stubs everywhere | Code sequentially |
157
+ | Parallelizing tightly coupled code | Constant blocking, stubs everywhere | Code sequentially |
@@ -3,7 +3,7 @@
3
3
  | # | Dimension | ✅ (must meet ALL criteria) | ⚠️ | ❌ |
4
4
  |---|---|---|---|---|
5
5
  | 1 | Upstream Traceability | (a) Every endpoint cites its IA source shard + section. (b) Every schema field traces to an IA data model field. No endpoint is "inferred" from context. (c) Every sub-feature listed in the IA shard's `## Features` is represented by at least one endpoint in the BE spec — a sub-feature with zero endpoints and no explicit `[Deferred to Phase N]` note is a gap. | Some endpoints or fields missing IA citations, or ≤20% of sub-features lack endpoint representation | Orphan endpoints with no IA source, or >20% of sub-features have no endpoint and no deferral note |
6
- | 2 | Contract Completeness | Every endpoint has: Zod request schema (all fields typed) + Zod response schema (all fields typed) + error schema. No field uses `any`, `unknown`, or untyped `string` where a more specific type exists. | Some schemas present but fields untyped or missing | Major schemas absent |
6
+ | 2 | Contract Completeness | Every endpoint has: {{CONTRACT_LIBRARY}} request schema (all fields typed) + {{CONTRACT_LIBRARY}} response schema (all fields typed) + error schema. No field uses `any`, `unknown`, or untyped `string` where a more specific type exists. | Some schemas present but fields untyped or missing | Major schemas absent |
7
7
  | 3 | Error Exhaustiveness | Every endpoint has: HTTP status code + application error code (not just HTTP) + error message format + retry guidance. No endpoint uses "standard error handling" without defining it. | Some endpoints missing error codes or retry guidance | Generic 500s or no error section |
8
8
  | 4 | Schema Completeness | Every database table has: all fields with types + constraints (nullable, unique, indexed) + relationships with foreign keys + indexes for every query pattern. No field uses "standard" constraints without defining them. | Constraints or indexes missing | Sketched only |
9
9
  | 5 | Middleware Explicitness | Every endpoint has an explicit middleware matrix: auth required (yes/no) + rate limit (number/window) + input validation (where it runs) + CORS policy. No endpoint inherits "default middleware" without defining it. | Some endpoints missing middleware entries | No matrix |
@@ -2,7 +2,7 @@
2
2
 
3
3
  | # | Dimension | ✅ (must meet ALL criteria) | ⚠️ | ❌ |
4
4
  |---|---|---|---|---|
5
- | 1 | Feature Enumeration | (a) Every feature from the ideation index's Must Have list appears in at least one shard. (b) Every feature has a clear scope boundary (what's in, what's out). (c) Every shard's `## Features` section contains Level-1 sub-features from the ideation domain files — not architecture headlines — and every sub-feature is represented in at least one section body (User Interactions, Data Model, Access Control, or Edge Cases). | Some features vague, scope unclear, or sub-features listed in `## Features` but not represented in any section body | Major Must Have features missing, or `## Features` contains only architecture headlines with no sub-feature detail |
5
+ | 1 | Feature Enumeration | (a) Every feature from the ideation index's Must Have list appears in at least one shard. (b) Every feature has a clear scope boundary (what's in, what's out). (c) Every shard's `## Features` section contains Level-1 sub-features from the ideation domain tree (folder index + feature files) — not architecture headlines — and every sub-feature is represented in at least one section body (User Interactions, Data Model, Access Control, or Edge Cases). | Some features vague, scope unclear, or sub-features listed in `## Features` but not represented in any section body | Major Must Have features missing, or `## Features` contains only architecture headlines with no sub-feature detail |
6
6
  | 2 | Access Model | Every role has: a named role + an exhaustive list of what it CAN do + an exhaustive list of what it CANNOT do + escalation path. No role uses "standard access" without defining it. | Some roles defined but missing permission or restriction lists | No access model |
7
7
  | 3 | Data Model | Every entity has: named fields + field types + constraints + relationships with cardinality. No field uses "standard" or "typical" without defining it. | Structure present but field types or constraints missing | Absent |
8
8
  | 4 | User Flows | Every user flow has: trigger + step-by-step actions + system responses + error paths. No flow ends at "success" without defining what success looks like. | Happy path only, or flows missing error paths | None |
@@ -14,6 +14,6 @@
14
14
  > **Deep Dive audit note**: When auditing dimension 7, read each deep dive file directly — do not infer its completeness from the parent shard's reference to it. A parent shard that links to a deep dive scores ⚠️ (not ✅) if the deep dive file itself is still a skeleton. Score ✅ only when the deep dive file contains exhaustive subsystem detail that an implementer could work from without asking questions.
15
15
 
16
16
  > **Dimension 1 audit procedure**:
17
- > 1. Read `docs/plans/ideation/ideation-index.md` and the relevant domain files in `docs/plans/ideation/domains/` to extract the authoritative list of Level-1 sub-features per domain.
17
+ > 1. Read `docs/plans/ideation/ideation-index.md` and the relevant ideation domain folders (use Structure Map for correct paths — folders are under `domains/` or `surfaces/{name}/`). For each domain, read the folder's `*-index.md` for the children table, then each child feature file to extract the authoritative list of Level-1 sub-features per domain.
18
18
  > 2. For each shard, open `docs/plans/ia/[NN-domain-name].md` and confirm every sub-feature from step 1 appears in the `## Features` section. Score ❌ if Must Have sub-features are missing entirely.
19
19
  > 3. For each sub-feature listed in `## Features`, verify it is represented in at least one section body (User Interactions, Data Model, Access Control, or Edge Cases). A sub-feature that appears only as a headline in `## Features` but has no corresponding detail in any section body scores ⚠️ — headline only = warning, not pass.
@@ -21,7 +21,7 @@ Write all cross-layer findings to a `## Cross-Layer Consistency` section in the
21
21
 
22
22
  | Layer | Documents to load |
23
23
  |-------|-------------------|
24
- | Ideation | `docs/plans/ideation/ideation-index.md` + domain files |
24
+ | Ideation | `docs/plans/ideation/ideation-index.md` + `ideation-cx.md` + all `*-index.md`, `*-cx.md`, and feature `.md` files recursively under `domains/` (and `surfaces/` for multi-product projects) |
25
25
  | Architecture | `docs/plans/*-architecture-design.md`, `docs/plans/ENGINEERING-STANDARDS.md` |
26
26
  | IA | `docs/plans/ia/index.md` + each shard listed + `docs/plans/ia/deep-dives/*.md` (list directory; include all files present) |
27
27
  | BE | `docs/plans/be/index.md` + each spec listed |
@@ -1,4 +1,4 @@
1
- # Vision Rubric (7 dimensions)
1
+ # Vision Rubric (8 dimensions)
2
2
 
3
3
  | # | Dimension | ✅ (must meet ALL criteria) | ⚠️ | ❌ |
4
4
  |---|---|---|---|---|
@@ -9,3 +9,4 @@
9
9
  | 5 | Success Measurability | Every metric is a number with a unit and a timeframe (e.g., "p95 < 500ms at launch"). No metric uses "fast", "good", or "acceptable". | Directional only | Missing |
10
10
  | 6 | Competitive Positioning | ≥3 named competitors. Differentiation is a specific capability gap. Moat is a defensible mechanism. | Vague positioning or <3 competitors | Not addressed |
11
11
  | 7 | Open Question Resolution | Every open question has: owner + deadline + what decision it blocks. No question is listed without an owner. | Questions listed, no owners or deadlines | No questions section |
12
+ | 8 | Structural Compliance | Every domain folder has `*-index.md` + `*-cx.md`. Role Matrix populated in every domain index. Feature files have Role Lens. Structure Map in `ideation-index.md` matches actual folder tree. No Classification Gate violations (no folders with 1 child, no flat features with ≥3 sub-features). | Structure exists but some folders missing CX or Role Matrix is partially empty | No fractal structure, or flat files used instead of folders |
@@ -52,7 +52,12 @@ Run this procedure when filling the `## Features` section of each shard skeleton
52
52
 
53
53
  ### Source
54
54
 
55
- Read `docs/plans/ideation/ideation-index.md` and locate the relevant domain file in `docs/plans/ideation/domains/` for each shard's domain.
55
+ Read `docs/plans/ideation/ideation-index.md` specifically the `## Structural Classification` and `## Structure Map` sections.
56
+
57
+ - **All project shapes**: Use the Structure Map to find the correct domain **folder** path. Each domain is a folder containing `*-index.md` (children table + Role Matrix), `*-cx.md` (cross-cuts), and child feature `.md` files.
58
+ - **Multi-product projects**: Domain folders may be under `docs/plans/ideation/surfaces/{surface-name}/` (surface-exclusive) or `docs/plans/ideation/domains/` (shared).
59
+
60
+ Match each shard to its ideation domain by name. Walk the domain's fractal tree: read the domain index for the children list, then read each child feature file to extract sub-features. If the domain has sub-domain folders, recurse into them.
56
61
 
57
62
  ### Actor + Goal Format Rule
58
63
 
@@ -68,21 +73,33 @@ List sub-features as bullet points in the `## Features` section. Group by functi
68
73
 
69
74
  ### `[THIN — review with user]` Fallback Rule
70
75
 
71
- If a shard's domain has no corresponding file in `docs/plans/ideation/domains/` (the domain was introduced during architecture design, not ideation), mark the skeleton with `[THIN — review with user]` at the top of `## Features` and seed from the architecture design description instead.
76
+ If a shard's domain has no corresponding ideation domain folder (the domain was introduced during architecture design, not ideation — check the `ideation-index.md` Structure Map for paths under `domains/` and `surfaces/`), mark the skeleton with `[THIN — review with user]` at the top of `## Features` and seed from the architecture design description instead.
72
77
 
73
78
  At the validation step, the user must confirm whether to:
74
79
  - Keep the shard separate
75
80
  - Merge it into an adjacent shard
76
- - Add missing sub-features from ideation
81
+ - Add missing sub-features from ideation (create a domain folder if needed)
77
82
 
78
83
  ### Directory Example
79
84
 
80
- Seeded skeletons live in the `docs/plans/ia/` directory:
85
+ Seeded skeletons live in the `docs/plans/ia/` directory (or per-surface directories for multi-product):
81
86
 
87
+ **Single-surface:**
82
88
  ```
83
89
  docs/plans/ia/
84
90
  ├── 00-infrastructure.md
85
- ├── 01-user-accounts.md ← ## Features seeded from ideation/domains/user-accounts.md
86
- ├── 02-content-library.md ← ## Features seeded from ideation/domains/content-library.md
91
+ ├── 01-user-accounts.md ← ## Features seeded from ideation/domains/01-user-accounts/ (index + feature files)
92
+ ├── 02-content-library.md ← ## Features seeded from ideation/domains/02-content-library/ (index + feature files)
87
93
  ├── ...
88
94
  ```
95
+
96
+ **Multi-product:**
97
+ ```
98
+ docs/plans/desktop/ia/
99
+ ├── 00-infrastructure.md
100
+ ├── 01-operations.md ← ## Features seeded from ideation/surfaces/desktop/01-operations/ (index + feature files)
101
+ ├── 02-inventory.md ← ## Features seeded from ideation/surfaces/desktop/02-inventory/ (index + feature files)
102
+
103
+ docs/plans/shared/ia/
104
+ ├── 01-device-history.md ← ## Features seeded from ideation/domains/01-device-history/ (index + feature files)
105
+ ```
@@ -24,7 +24,7 @@ that lets a reviewer verify nothing was missed or invented.]
24
24
  | [specific subsystem] | [deep-dive.md] | § Key Decisions |
25
25
 
26
26
  ## API Endpoints
27
- ## Request/Response Contracts (Zod schemas)
27
+ ## Request/Response Contracts ({{CONTRACT_LIBRARY}} schemas)
28
28
  ## Database Schema
29
29
  ## Middleware & Policies
30
30
  ## Data Flow
@@ -42,7 +42,7 @@ that lets a reviewer verify nothing was missed or invented.]
42
42
 
43
43
  Apply after writing every BE spec:
44
44
 
45
- - [ ] Every endpoint has a Zod request AND response schema
45
+ - [ ] Every endpoint has a {{CONTRACT_LIBRARY}} request AND response schema
46
46
  - [ ] Every database table has defined fields, indexes, and permissions
47
47
  - [ ] Security constraints from IA shard reflected in middleware section
48
48
  - [ ] Error codes are specific (not generic 500s)
@@ -18,7 +18,7 @@ For each shard, create at `docs/plans/ia/[NN-domain-name].md`:
18
18
  [1-2 sentence description of this domain's scope]
19
19
 
20
20
  ## Features
21
- [Level-1 sub-features from the relevant domain file in `docs/plans/ideation/domains/` for this domain. NOT architecture-level headlines. See /decompose-architecture-structure Step 5 for seeding instructions.]
21
+ [Level-1 sub-features from the relevant ideation domain folder for this domain. Check `ideation-index.md` Structure Map for the correct folder path — folders are under `domains/` or `surfaces/{name}/`. Read the folder's `*-index.md` for the children table, then each child feature file. NOT architecture-level headlines. See /decompose-architecture-structure Step 5 for seeding instructions.]
22
22
 
23
23
  ## User Interactions
24
24
  [To be filled during /write-architecture-spec]
@@ -101,7 +101,7 @@ Read cross-cutting specs first, then feature specs in numerical order.
101
101
 
102
102
  Every BE spec MUST include:
103
103
  - API Endpoints (method, path, description)
104
- - Request/Response Contracts (Zod schemas)
104
+ - Request/Response Contracts ({{CONTRACT_LIBRARY}} schemas)
105
105
  - Database Schema (tables, fields, indexes, permissions)
106
106
  - Middleware & Policies (auth, rate limits, validation)
107
107
  - Data Flow (request lifecycle)
@@ -102,9 +102,11 @@ Use this template when creating `docs/plans/ENGINEERING-STANDARDS.md`. Fill in c
102
102
 
103
103
  ## Security
104
104
  - Dependency audit: [e.g., npm audit on every CI run]
105
+ - Dependency audit enforcement: [e.g., Fail on HIGH/CRITICAL, Warn on MODERATE]
105
106
  - Secret scanning: [tool/approach]
106
107
  - CSP policy: [strict/relaxed + details] (web surfaces)
107
108
  - Code signing: [signing certificate strategy] (desktop/mobile surfaces)
109
+ - Security testing tool: [e.g., OWASP ZAP for web, MobSF for mobile, or none] (surface-specific dynamic security scan)
108
110
 
109
111
  ## Code Quality
110
112
  - Max file length: [e.g., 300 lines]
@@ -44,7 +44,7 @@ Use this template when writing FE specs to `docs/plans/fe/[NN-feature-name].md`.
44
44
  [Server state, client state, URL state, loading/error/empty]
45
45
 
46
46
  ## Interaction Specification
47
- [Click, hover, keyboard, form validation matching Zod]
47
+ [Click, hover, keyboard, form validation matching {{CONTRACT_LIBRARY}}]
48
48
 
49
49
  ## Responsive Behavior
50
50
  [Breakpoints, component behavior per breakpoint]
@@ -0,0 +1,58 @@
1
+ # {Node Name} — Cross-Cuts
2
+
3
+ > **Level**: {surface | domain | sub-domain}
4
+ > **Scope**: Connections between children of [{parent}](../{parent}-index.md)
5
+
6
+ ## Cross-Cut Map
7
+
8
+ | # | Source | Target | Relationship | Roles Affected | Confidence | Evidence |
9
+ |---|--------|--------|--------------|----------------|------------|----------|
10
+ | CX-01 | [child-A](./path) | [child-B](./path) | _what the interaction is_ | Tech, Owner | High | _specific evidence from exploration_ |
11
+ | CX-02 | [child-C](./path) | [{external-node}](../../path) | _cross-level interaction_ | Tech | Medium | _evidence_ |
12
+
13
+ > **Confidence levels:** High (confirmed with evidence), Medium (strong signal, needs validation), Low (hypothesis)
14
+ >
15
+ > **Cross-level references:** When a cross-cut spans levels (e.g., a feature in one surface touches a domain in another), record it here at the HIGHER level with a link path to the specific lower-level item. The detail of HOW they interact lives in the LOWER-level CX file.
16
+ >
17
+ > **Cross-references:** When referencing a CX entry from another file, use format `{filename}#CX-NN` (e.g., `ai-assistant-cx.md#CX-03`)
18
+
19
+ ---
20
+
21
+ ## Cross-Cut Details
22
+
23
+ ### CX-01: {Source} ↔ {Target}
24
+
25
+ **Relationship**: _Detailed description of how these two children interact. What data flows between them? What triggers what?_
26
+
27
+ **Role scoping**:
28
+ - **{Role 1}**: _what this role experiences at this intersection_
29
+ - **{Role 2}**: _what this role experiences_
30
+ - **{Role 3}**: _not affected / no visibility_
31
+
32
+ **Synthesis questions answered**:
33
+ 1. **Shared state conflict**: _Who owns the entity? What's the merge strategy if both sides modify it?_
34
+ 2. **Trigger chain**: _Does A trigger B? What happens if B fails — rollback? Compensating action? Is it sync or async?_
35
+ 3. **Permission intersection**: _Does a permission in A affect what you can do in B?_
36
+ 4. **Notification fan-out**: _Does an event in A notify actors in B?_
37
+ 5. **State transition conflict**: _Can A and B race? What's the consistency impact?_
38
+
39
+ ---
40
+
41
+ _Repeat the Cross-Cut Details section for each CX entry in the map._
42
+
43
+ ---
44
+
45
+ ## Rejected Pairs
46
+
47
+ | # | Source | Target | Reason for Rejection |
48
+ |---|--------|--------|---------------------|
49
+ | R-01 | _{child-A}_ | _{child-B}_ | _No shared state, no trigger dependency, independent lifecycles_ |
50
+
51
+ > **Notes for agents:**
52
+ > - This template is used at EVERY folder level in the fractal structure
53
+ > - CX files ONLY connect children at their own level — a surface CX connects domains, a domain CX connects sub-domains, a sub-domain CX connects features
54
+ > - CX entries use sequential `CX-NN` numbering within each file, starting at CX-01
55
+ > - Always include role scoping — every cross-cut affects specific roles, not all roles equally
56
+ > - Rejected pairs are valuable — they show the agent considered the interaction and dismissed it with reasoning
57
+ > - The 5 synthesis questions should be answered for EVERY confirmed cross-cut (CX entries with High confidence)
58
+ > - For Medium/Low confidence entries, the synthesis questions can be deferred to later drilling passes