cfsa-antigravity 2.0.0 → 2.1.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.
- package/README.md +14 -0
- package/package.json +1 -1
- package/template/.agent/instructions/commands.md +8 -32
- package/template/.agent/instructions/patterns.md +3 -3
- package/template/.agent/instructions/tech-stack.md +71 -23
- package/template/.agent/instructions/workflow.md +12 -1
- package/template/.agent/rules/completion-checklist.md +6 -0
- package/template/.agent/rules/security-first.md +3 -3
- package/template/.agent/rules/vertical-slices.md +1 -1
- package/template/.agent/skill-library/MANIFEST.md +6 -0
- package/template/.agent/skill-library/stack/devops/git-advanced/SKILL.md +972 -0
- package/template/.agent/skill-library/stack/devops/git-workflow/SKILL.md +420 -0
- package/template/.agent/skills/api-versioning/SKILL.md +44 -298
- package/template/.agent/skills/api-versioning/references/typescript.md +157 -0
- package/template/.agent/skills/architecture-mapping/SKILL.md +7 -7
- package/template/.agent/skills/bootstrap-agents/SKILL.md +151 -152
- package/template/.agent/skills/clean-code/SKILL.md +64 -118
- package/template/.agent/skills/clean-code/references/typescript.md +126 -0
- package/template/.agent/skills/database-schema-design/SKILL.md +93 -317
- package/template/.agent/skills/database-schema-design/references/relational.md +228 -0
- package/template/.agent/skills/error-handling-patterns/SKILL.md +62 -557
- package/template/.agent/skills/error-handling-patterns/references/go.md +162 -0
- package/template/.agent/skills/error-handling-patterns/references/python.md +262 -0
- package/template/.agent/skills/error-handling-patterns/references/rust.md +112 -0
- package/template/.agent/skills/error-handling-patterns/references/typescript.md +178 -0
- package/template/.agent/skills/idea-extraction/SKILL.md +119 -12
- package/template/.agent/skills/logging-best-practices/SKILL.md +108 -767
- package/template/.agent/skills/logging-best-practices/references/go.md +49 -0
- package/template/.agent/skills/logging-best-practices/references/python.md +52 -0
- package/template/.agent/skills/logging-best-practices/references/typescript.md +215 -0
- package/template/.agent/skills/migration-management/SKILL.md +127 -311
- package/template/.agent/skills/migration-management/references/relational.md +214 -0
- package/template/.agent/skills/parallel-feature-development/SKILL.md +34 -43
- package/template/.agent/skills/pipeline-rubrics/references/be-rubric.md +1 -1
- package/template/.agent/skills/pipeline-rubrics/references/ia-rubric.md +1 -1
- package/template/.agent/skills/prd-templates/SKILL.md +20 -3
- package/template/.agent/skills/prd-templates/references/be-spec-template.md +2 -2
- package/template/.agent/skills/prd-templates/references/decomposition-templates.md +2 -2
- package/template/.agent/skills/prd-templates/references/fe-spec-template.md +1 -1
- package/template/.agent/skills/prd-templates/references/ideation-domain-template.md +8 -2
- package/template/.agent/skills/prd-templates/references/ideation-index-template.md +25 -1
- package/template/.agent/skills/prd-templates/references/operational-templates.md +1 -1
- package/template/.agent/skills/prd-templates/references/placeholder-workflow-mapping.md +50 -21
- package/template/.agent/skills/prd-templates/references/skill-loading-protocol.md +32 -0
- package/template/.agent/skills/prd-templates/references/slice-completion-gates.md +21 -0
- package/template/.agent/skills/prd-templates/references/spec-coverage-sweep.md +3 -3
- package/template/.agent/skills/prd-templates/references/tdd-testing-policy.md +39 -0
- package/template/.agent/skills/prd-templates/references/vision-template.md +1 -1
- package/template/.agent/skills/regex-patterns/SKILL.md +122 -540
- package/template/.agent/skills/regex-patterns/references/go.md +44 -0
- package/template/.agent/skills/regex-patterns/references/javascript.md +63 -0
- package/template/.agent/skills/regex-patterns/references/python.md +77 -0
- package/template/.agent/skills/regex-patterns/references/rust.md +43 -0
- package/template/.agent/skills/session-continuity/SKILL.md +11 -9
- package/template/.agent/skills/session-continuity/protocols/02-progress-generation.md +2 -2
- package/template/.agent/skills/session-continuity/protocols/04-pattern-extraction.md +1 -1
- package/template/.agent/skills/session-continuity/protocols/05-session-close.md +1 -1
- package/template/.agent/skills/session-continuity/protocols/09-parallel-claim.md +1 -1
- package/template/.agent/skills/session-continuity/protocols/10-placeholder-verification-gate.md +57 -78
- package/template/.agent/skills/session-continuity/protocols/11-parallel-synthesis.md +1 -1
- package/template/.agent/skills/tdd-workflow/SKILL.md +94 -317
- package/template/.agent/skills/tdd-workflow/references/typescript.md +231 -0
- package/template/.agent/skills/testing-strategist/SKILL.md +74 -687
- package/template/.agent/skills/testing-strategist/references/typescript.md +328 -0
- package/template/.agent/skills/workflow-automation/SKILL.md +62 -154
- package/template/.agent/skills/workflow-automation/references/inngest.md +88 -0
- package/template/.agent/skills/workflow-automation/references/temporal.md +64 -0
- package/template/.agent/workflows/bootstrap-agents-fill.md +85 -143
- package/template/.agent/workflows/bootstrap-agents-provision.md +90 -107
- package/template/.agent/workflows/create-prd-architecture.md +16 -14
- package/template/.agent/workflows/create-prd-compile.md +11 -12
- package/template/.agent/workflows/create-prd-design-system.md +1 -1
- package/template/.agent/workflows/create-prd-security.md +9 -11
- package/template/.agent/workflows/create-prd-stack.md +10 -4
- package/template/.agent/workflows/create-prd.md +5 -6
- package/template/.agent/workflows/decompose-architecture-structure.md +3 -5
- package/template/.agent/workflows/decompose-architecture-validate.md +18 -1
- package/template/.agent/workflows/evolve-contract.md +11 -11
- package/template/.agent/workflows/ideate-discover.md +10 -6
- package/template/.agent/workflows/ideate-extract.md +61 -4
- package/template/.agent/workflows/ideate-validate.md +3 -3
- package/template/.agent/workflows/ideate.md +2 -2
- package/template/.agent/workflows/implement-slice-setup.md +25 -23
- package/template/.agent/workflows/implement-slice-tdd.md +51 -92
- package/template/.agent/workflows/implement-slice.md +4 -4
- package/template/.agent/workflows/plan-phase-preflight.md +6 -2
- package/template/.agent/workflows/plan-phase-write.md +6 -8
- package/template/.agent/workflows/resolve-ambiguity.md +1 -1
- package/template/.agent/workflows/update-architecture-map.md +22 -5
- package/template/.agent/workflows/validate-phase.md +26 -29
- package/template/.agent/workflows/verify-infrastructure.md +10 -10
- package/template/.agent/workflows/write-architecture-spec-design.md +17 -12
- package/template/.agent/workflows/write-be-spec-classify.md +25 -21
- package/template/.agent/workflows/write-be-spec.md +1 -1
- package/template/.agent/workflows/write-fe-spec-classify.md +6 -12
- package/template/.agent/workflows/write-fe-spec-write.md +1 -1
- package/template/AGENTS.md +1 -1
- package/template/GEMINI.md +3 -3
- package/template/docs/kit-architecture.md +34 -8
|
@@ -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
|
|
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
|
|
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
|
|
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
|
|
47
|
-
| Stream 2 (API) | `src/api/*`, `src/middleware/api
|
|
48
|
-
| Stream 3 (UI) | `src/components/*`, `src/pages/*` | `src/types/ui
|
|
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
|
|
52
|
-
- `src/config
|
|
53
|
-
-
|
|
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
|
|
58
|
-
- Shared files are **frozen** — do not mutate
|
|
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
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
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
|
|
84
|
-
- Do NOT change interface files during the concurrent
|
|
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
|
|
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
|
-
|
|
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** |
|
|
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
|
|
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):**
|
|
142
|
-
- **With `boundary-not-placeholder`:** Use `// BOUNDARY:` stubs for cross-stream dependencies
|
|
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
|
|
152
|
-
| API
|
|
153
|
-
| UI
|
|
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
|
|
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
|
|
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,
|
|
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:
|
|
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 |
|
|
@@ -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 `
|
|
17
|
+
> 1. Read `docs/plans/ideation/ideation-index.md` and the relevant ideation domain files (use Domain Documents table for correct paths — files may be in `domains/` or `surfaces/{name}/`) 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.
|
|
@@ -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`
|
|
55
|
+
Read `docs/plans/ideation/ideation-index.md` — specifically the `## Structural Classification` and `## Domain Documents` sections.
|
|
56
|
+
|
|
57
|
+
- **Single-surface projects**: Locate the relevant domain file in `docs/plans/ideation/domains/` for each shard's domain.
|
|
58
|
+
- **Multi-product projects**: Use the path from the Domain Documents table in `ideation-index.md`. Domain files may be in `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. If the ideation structure is `surfaces/`, the shard's decomposition surface (from `decompose-architecture`) tells you which surface subfolder to look in.
|
|
56
61
|
|
|
57
62
|
### Actor + Goal Format Rule
|
|
58
63
|
|
|
@@ -68,7 +73,7 @@ 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
|
|
76
|
+
If a shard's domain has no corresponding ideation domain file (the domain was introduced during architecture design, not ideation — check the `ideation-index.md` Domain Documents table for both `domains/` and `surfaces/` paths), 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
|
|
@@ -77,8 +82,9 @@ At the validation step, the user must confirm whether to:
|
|
|
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
|
|
@@ -86,3 +92,14 @@ docs/plans/ia/
|
|
|
86
92
|
├── 02-content-library.md ← ## Features seeded from ideation/domains/content-library.md
|
|
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/operations.md
|
|
101
|
+
├── 02-inventory.md ← ## Features seeded from ideation/surfaces/desktop/inventory.md
|
|
102
|
+
|
|
103
|
+
docs/plans/shared/ia/
|
|
104
|
+
├── 01-device-history.md ← ## Features seeded from ideation/domains/device-history.md
|
|
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 (
|
|
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
|
|
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 `
|
|
21
|
+
[Level-1 sub-features from the relevant ideation domain file for this domain. Check `ideation-index.md` Domain Documents table for the correct path — files may be in `domains/` or `surfaces/{name}/` depending on structural classification. 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 (
|
|
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)
|
|
@@ -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
|
|
47
|
+
[Click, hover, keyboard, form validation matching {{CONTRACT_LIBRARY}}]
|
|
48
48
|
|
|
49
49
|
## Responsive Behavior
|
|
50
50
|
[Breakpoints, component behavior per breakpoint]
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
> **Status**: `[SURFACE]` / `[BREADTH]` / `[DEEP]` / `[EXHAUSTED]`
|
|
4
4
|
> **Domain number**: NN
|
|
5
|
+
> **Surface**: _surface name (e.g., "web", "desktop", "mobile") or "shared"_
|
|
5
6
|
> **Last updated**: _timestamp_
|
|
6
7
|
|
|
7
8
|
## Overview
|
|
@@ -35,8 +36,13 @@ _Vertical drill content — features, behaviors, edge cases, failure modes._
|
|
|
35
36
|
|
|
36
37
|
#### Cross-Cut Notes
|
|
37
38
|
|
|
38
|
-
|
|
39
|
-
|
|
39
|
+
> **Path note:** Use the path from `ideation-index.md` Domain Documents table for cross-references.
|
|
40
|
+
> For single-surface: `../domains/NN-domain.md`. For multi-product: paths vary by location
|
|
41
|
+
> (same surface = `../NN-domain.md`, different surface = `../../surfaces/{name}/NN-domain.md`,
|
|
42
|
+
> shared = `../../domains/NN-domain.md`). Always verify against the index.
|
|
43
|
+
|
|
44
|
+
- Touches **Domain NN** ([domain-file.md](path-from-index)) because: _reason_
|
|
45
|
+
- Touches **Domain NN** ([domain-file.md](path-from-index)) because: _reason_
|
|
40
46
|
|
|
41
47
|
---
|
|
42
48
|
|
|
@@ -16,6 +16,12 @@
|
|
|
16
16
|
- Cross-cut Detection: always-on
|
|
17
17
|
- Deep Think Protocol: active
|
|
18
18
|
|
|
19
|
+
## Structural Classification
|
|
20
|
+
|
|
21
|
+
- **Project Shape**: [single-surface | multi-surface-shared | multi-product]
|
|
22
|
+
- **Surfaces**: [list of identified surfaces, e.g., "Web (Astro/React), Desktop (Rust/Tauri), Mobile (React Native)" — or "N/A" for single-surface]
|
|
23
|
+
- **Classification Basis**: [how this was determined — "detected from document", "user interview", "inferred from one-liner"]
|
|
24
|
+
|
|
19
25
|
## Progress Summary
|
|
20
26
|
|
|
21
27
|
| Metric | Value |
|
|
@@ -44,9 +50,27 @@
|
|
|
44
50
|
|
|
45
51
|
### Domain Documents
|
|
46
52
|
|
|
53
|
+
> **Path convention:** For single-surface projects, domains live in `domains/NN-slug.md`.
|
|
54
|
+
> For multi-product projects, surface-exclusive domains live in `surfaces/{surface}/NN-slug.md`
|
|
55
|
+
> and shared domains live in `domains/NN-slug.md`.
|
|
56
|
+
|
|
57
|
+
| # | Domain | Surface | Path | Status | Sub-areas | Deep Think |
|
|
58
|
+
|---|--------|---------|------|--------|-----------|------------|
|
|
59
|
+
| 01 | _Domain Name_ | _surface or shared_ | [01-domain-slug.md](domains/01-domain-slug.md) | `[SURFACE]` | _N_ sub-areas | _N_ hypotheses |
|
|
60
|
+
|
|
61
|
+
_For multi-product projects, group domains by surface:_
|
|
62
|
+
|
|
63
|
+
#### Surface: _Surface Name_
|
|
64
|
+
|
|
47
65
|
| # | Domain | Path | Status | Sub-areas | Deep Think |
|
|
48
66
|
|---|--------|------|--------|-----------|------------|
|
|
49
|
-
| 01 | _Domain Name_ | [01-
|
|
67
|
+
| 01 | _Domain Name_ | [01-slug.md](surfaces/{surface}/01-slug.md) | `[SURFACE]` | _N_ | _N_ |
|
|
68
|
+
|
|
69
|
+
#### Shared Domains
|
|
70
|
+
|
|
71
|
+
| # | Domain | Consumed By | Path | Status | Sub-areas | Deep Think |
|
|
72
|
+
|---|--------|-------------|------|--------|-----------|------------|
|
|
73
|
+
| 01 | _Domain Name_ | _surface list_ | [01-slug.md](domains/01-slug.md) | `[SURFACE]` | _N_ | _N_ |
|
|
50
74
|
|
|
51
75
|
### Cross-Cut Ledger
|
|
52
76
|
|
|
@@ -14,7 +14,7 @@ Use when writing slice entries during `/plan-phase` Step 4:
|
|
|
14
14
|
**Surfaces**: Contract, API, DB, UI
|
|
15
15
|
|
|
16
16
|
#### Tasks
|
|
17
|
-
- [ ] Contract:
|
|
17
|
+
- [ ] Contract: {{CONTRACT_LIBRARY}} schema for [entity] ← no tag (orchestrator handles sequentially)
|
|
18
18
|
- [ ] `BE` API endpoints for [entity] ← backend agent
|
|
19
19
|
- [ ] `FE` [entity] page and components ← frontend agent
|
|
20
20
|
- [ ] `QA` Integration tests for [entity] ← QA agent (runs FIRST to write failing tests, AND after BE+FE to verify)
|
|
@@ -1,21 +1,50 @@
|
|
|
1
|
-
#
|
|
2
|
-
|
|
3
|
-
Maps
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
|
10
|
-
|
|
11
|
-
|
|
|
12
|
-
|
|
|
13
|
-
|
|
|
14
|
-
|
|
|
15
|
-
|
|
|
16
|
-
|
|
|
17
|
-
|
|
|
18
|
-
|
|
|
19
|
-
|
|
|
20
|
-
|
|
|
21
|
-
|
|
|
1
|
+
# Map Column Reference
|
|
2
|
+
|
|
3
|
+
Maps surface stack map columns and cross-cutting categories to the workflows that consume them.
|
|
4
|
+
|
|
5
|
+
> **How workflows use the map**: See `.agent/instructions/tech-stack.md` for the surface stack map format and resolution rules. Workflows determine their surface context (from shard directory or slice surface tag), then look up the corresponding row and column.
|
|
6
|
+
|
|
7
|
+
## Per-Surface Columns
|
|
8
|
+
|
|
9
|
+
| Column | Workflows That Consume It |
|
|
10
|
+
|--------|--------------------------|
|
|
11
|
+
| **Languages** | write-be-spec-classify, write-fe-spec-classify, implement-slice-setup, implement-slice-tdd, evolve-contract |
|
|
12
|
+
| **BE Frameworks** | write-be-spec-classify |
|
|
13
|
+
| **FE Frameworks** | write-fe-spec-classify |
|
|
14
|
+
| **FE Design** | write-fe-spec-classify |
|
|
15
|
+
| **ORMs** | create-prd-architecture, write-be-spec-classify, implement-slice-setup, verify-infrastructure, validate-phase |
|
|
16
|
+
| **State Mgmt** | write-fe-spec-classify, implement-slice-setup |
|
|
17
|
+
| **Databases** | create-prd-architecture, write-architecture-spec-design, write-be-spec-classify |
|
|
18
|
+
| **Unit Tests** | create-prd-compile, write-be-spec-classify, implement-slice-setup, implement-slice-tdd, evolve-contract |
|
|
19
|
+
| **E2E Tests** | create-prd-compile, implement-slice-tdd, validate-phase |
|
|
20
|
+
| **Test Cmd** | implement-slice-tdd, validate-phase, evolve-contract |
|
|
21
|
+
| **Validation Cmd** | implement-slice-tdd, validate-phase, evolve-contract |
|
|
22
|
+
| **Lint Cmd** | validate-phase |
|
|
23
|
+
| **Build Cmd** | validate-phase |
|
|
24
|
+
| **Dev Cmd** | verify-infrastructure |
|
|
25
|
+
| **Package Mgr** | bootstrap-agents-fill |
|
|
26
|
+
|
|
27
|
+
## Cross-Cutting Categories
|
|
28
|
+
|
|
29
|
+
| Category | Workflows That Consume It |
|
|
30
|
+
|----------|--------------------------|
|
|
31
|
+
| **Auth** | create-prd-security, write-be-spec-classify |
|
|
32
|
+
| **CI/CD** | create-prd-compile, decompose-architecture-structure, plan-phase-write, verify-infrastructure, validate-phase |
|
|
33
|
+
| **Hosting** | create-prd-architecture, decompose-architecture-structure, plan-phase-write, verify-infrastructure, validate-phase |
|
|
34
|
+
| **Security** | create-prd-security, write-architecture-spec-design, validate-phase |
|
|
35
|
+
| **API Design** | create-prd-architecture, write-architecture-spec-design, write-be-spec-classify |
|
|
36
|
+
| **Accessibility** | write-fe-spec-classify, write-fe-spec-write, write-architecture-spec-design, validate-phase |
|
|
37
|
+
| **Contract Library** | tdd-contract-first rule, implement-slice-setup |
|
|
38
|
+
|
|
39
|
+
## Surface Context Resolution
|
|
40
|
+
|
|
41
|
+
How each workflow determines which surface's row to read:
|
|
42
|
+
|
|
43
|
+
| Workflow Type | Resolution Method |
|
|
44
|
+
|--------------|-------------------|
|
|
45
|
+
| Spec-writing (`write-be-spec`, `write-fe-spec`) | Shard directory path: `docs/plans/desktop/be/` → surface `desktop`; flat `docs/plans/be/` → surface `shared` |
|
|
46
|
+
| Implementation (`implement-slice`) | Slice's `surface:` tag from the phase plan |
|
|
47
|
+
| Planning (`plan-phase`) | Iterates ALL surfaces in the map |
|
|
48
|
+
| Validation (`validate-phase`) | Runs per-surface commands for all surfaces |
|
|
49
|
+
| Cross-cutting (`verify-infrastructure`) | Uses cross-cutting table + primary surface for commands |
|
|
50
|
+
| Architecture (`create-prd-*`) | Map may be incomplete during these workflows — falls back to inline conversation context |
|