ctx-cc 3.3.8 → 3.4.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/commands/init.md CHANGED
@@ -1,102 +1,328 @@
1
1
  ---
2
2
  name: ctx:init
3
- description: Initialize CTX project with STATE.md, PRD.json, design context, and secure credentials
3
+ description: Initialize CTX project with deep context gathering, research, and roadmap creation
4
+ allowed-tools:
5
+ - Read
6
+ - Write
7
+ - Bash
8
+ - Glob
9
+ - Grep
10
+ - Task
11
+ - AskUserQuestion
12
+ - mcp__arguseek__research_iteratively
13
+ - mcp__arguseek__fetch_url
4
14
  ---
5
15
 
6
16
  <objective>
7
- Initialize a new CTX 2.3 project. Front-loads ALL information gathering so execution runs autonomously with minimal interruption.
17
+ Initialize a new CTX project through unified flow: questioning research requirements roadmap.
8
18
 
9
- Creates:
10
- - `.ctx/STATE.md` - Execution state
11
- - `.ctx/PRD.json` - Requirements contract with design context
12
- - `.ctx/.env` - Secure credentials (gitignored)
13
- - `BRAND_KIT.md` - Visual foundation (if design work needed)
19
+ **Creates:**
20
+ - `.ctx/STATE.md` Living project state
21
+ - `.ctx/PRD.json` Requirements contract
22
+ - `.ctx/config.json` Workflow preferences
23
+ - `.ctx/research/` Domain research (ArguSeek)
24
+ - `.ctx/ROADMAP.md` — Phase structure
25
+
26
+ **After this command:** Run `/ctx` to start execution.
14
27
  </objective>
15
28
 
16
- <philosophy>
17
- ## Front-Loaded Approach
18
-
19
- **Gather EVERYTHING upfront:**
20
- 1. Project requirements PRD.json
21
- 2. User stories → PRD.json stories
22
- 3. Credentials for testing → .ctx/.env
23
- 4. URLs and endpoints .ctx/.env
24
- 5. Constitution/rules PRD.json constitution
25
- 6. Design context PRD.json brand/design sections
26
- 7. Visual requirements → Brand personality, mood, inspirations
27
-
28
- **Then execute autonomously:**
29
- - Minimal user interruption during execution
30
- - Only ask user for architecture decisions (Rule 4)
31
- - Only ask user for design approvals at gates
32
- - Use stored credentials for browser verification
33
- - Deliver complete, verified project
34
- </philosophy>
35
-
36
- <workflow>
37
- ## Step 1: Check Existing
38
- If `.ctx/STATE.md` exists:
39
- - Ask: "CTX project exists. Reinitialize? (will archive current state)"
40
- - If no: stop
41
- - If yes: backup to `.ctx/archive/STATE-{timestamp}.md`
42
-
43
- ## Step 2: Detect Project
44
- Scan the codebase:
45
- 1. **Package files**: package.json, Cargo.toml, go.mod, requirements.txt, pyproject.toml
46
- 2. **Frameworks**: React, Next.js, FastAPI, Express, Django, etc.
47
- 3. **Entry points**: main files, index files, app files
48
- 4. **Key directories**: src/, lib/, app/, components/, etc.
49
-
50
- ## Step 3: Create Structure
51
- ```
52
- .ctx/
53
- ├── STATE.md # Living digest - execution state
54
- ├── PRD.json # Requirements contract - stories + acceptance criteria
55
- ├── .env # Credentials for testing (GITIGNORED)
56
- ├── .gitignore # Protects secrets
57
- ├── phases/ # Phase-specific data
58
- │ └── {story_id}/
59
- │ ├── RESEARCH.md
60
- │ ├── PLAN.md
61
- │ └── VERIFY.md
62
- ├── checkpoints/ # Auto-checkpoints for resume
63
- ├── memory/ # Decision memory
64
- └── archive/ # Archived states
65
- ```
66
-
67
- **Create `.ctx/.gitignore`:**
29
+ <process>
30
+
31
+ ## Phase 1: Setup
32
+
33
+ **MANDATORY FIRST STEP Execute before any user interaction:**
34
+
35
+ ```bash
36
+ # Check if project already initialized
37
+ if [ -f .ctx/STATE.md ]; then
38
+ echo "ERROR: CTX project already exists. Use /ctx to continue."
39
+ exit 1
40
+ fi
41
+
42
+ # Initialize git if needed
43
+ if [ -d .git ] || [ -f .git ]; then
44
+ echo "Git repo exists"
45
+ else
46
+ git init
47
+ echo "Initialized git repo"
48
+ fi
49
+
50
+ # Detect existing code
51
+ CODE_FILES=$(find . -name "*.ts" -o -name "*.js" -o -name "*.py" -o -name "*.go" -o -name "*.rs" -o -name "*.swift" 2>/dev/null | grep -v node_modules | grep -v .git | head -20)
52
+ HAS_PACKAGE=$([ -f package.json ] || [ -f requirements.txt ] || [ -f Cargo.toml ] || [ -f go.mod ] && echo "yes")
53
+ ```
54
+
55
+ **You MUST run these bash commands using the Bash tool before proceeding.**
56
+
57
+ ## Phase 2: Brownfield Detection
58
+
59
+ **If existing code detected:**
60
+
61
+ Use AskUserQuestion:
62
+ ```
63
+ questions: [
64
+ {
65
+ header: "Existing Code",
66
+ question: "I detected existing code. Would you like to map the codebase first?",
67
+ multiSelect: false,
68
+ options: [
69
+ { label: "Map codebase first (Recommended)", description: "Understand architecture before planning" },
70
+ { label: "Skip mapping", description: "Proceed directly to initialization" }
71
+ ]
72
+ }
73
+ ]
74
+ ```
75
+
76
+ **If "Map codebase first":**
77
+ - Go to Map Codebase Flow (in ctx.md)
78
+ - Return to this command after mapping
79
+
80
+ **If "Skip mapping" or no code detected:** Continue to Phase 3.
81
+
82
+ ## Phase 3: Deep Questioning
83
+
84
+ **Display stage banner:**
85
+
68
86
  ```
87
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
88
+ CTX ► QUESTIONING
89
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
90
+ ```
91
+
92
+ **Open the conversation (freeform, NOT AskUserQuestion):**
93
+
94
+ "What do you want to build?"
95
+
96
+ Wait for response. This gives context for intelligent follow-up.
97
+
98
+ **Follow the thread with AskUserQuestion:**
99
+
100
+ Based on their response, ask probing questions:
101
+ - What problem sparked this?
102
+ - What does success look like?
103
+ - Any constraints (tech, budget, timeline)?
104
+ - What's already decided vs open to discussion?
105
+
106
+ **Decision gate:**
107
+
108
+ Use AskUserQuestion:
109
+ ```
110
+ questions: [
111
+ {
112
+ header: "Ready?",
113
+ question: "I think I understand. Ready to create the project?",
114
+ multiSelect: false,
115
+ options: [
116
+ { label: "Create project", description: "Move forward with initialization" },
117
+ { label: "Keep exploring", description: "I want to share more context" }
118
+ ]
119
+ }
120
+ ]
121
+ ```
122
+
123
+ Loop until "Create project" selected.
124
+
125
+ ## Phase 4: Create Structure
126
+
127
+ ```bash
128
+ mkdir -p .ctx/phases
129
+ mkdir -p .ctx/research
130
+ mkdir -p .ctx/checkpoints
131
+ mkdir -p .ctx/memory
132
+
133
+ # Create .gitignore for secrets
134
+ cat > .ctx/.gitignore << 'EOF'
69
135
  .env
70
136
  *.secrets
71
137
  credentials.json
138
+ EOF
139
+ ```
140
+
141
+ ## Phase 5: Write STATE.md
142
+
143
+ Detect tech stack:
144
+
145
+ ```bash
146
+ # Detect from package files
147
+ if [ -f package.json ]; then
148
+ STACK=$(cat package.json | grep -E '"(react|next|vue|svelte|express|fastify)"' | head -1)
149
+ fi
150
+ ```
151
+
152
+ Create STATE.md:
153
+
154
+ ```bash
155
+ cat > .ctx/STATE.md << 'EOF'
156
+ # CTX State
157
+
158
+ ## Project
159
+ Name: {{project_name}}
160
+ Stack: {{detected_stack}}
161
+ Created: {{timestamp}}
162
+
163
+ ## Status
164
+ initializing
165
+
166
+ ## Current Story
167
+ (none yet)
168
+
169
+ ## Recent Decisions
170
+ - {{decision_from_questioning}}
171
+
172
+ ## Context Budget
173
+ 5%
174
+
175
+ ## Next Action
176
+ Research domain
177
+ EOF
178
+ ```
179
+
180
+ **Commit:**
181
+
182
+ ```bash
183
+ git add .ctx/STATE.md .ctx/.gitignore
184
+ git commit -m "docs: initialize CTX project - {{project_name}}"
185
+ ```
186
+
187
+ ## Phase 6: Research Decision
188
+
189
+ Use AskUserQuestion:
190
+ ```
191
+ questions: [
192
+ {
193
+ header: "Research",
194
+ question: "Research the domain before defining requirements?",
195
+ multiSelect: false,
196
+ options: [
197
+ { label: "Research first (Recommended)", description: "Discover best practices, patterns, pitfalls" },
198
+ { label: "Skip research", description: "I know this domain well" }
199
+ ]
200
+ }
201
+ ]
202
+ ```
203
+
204
+ **If "Research first":**
205
+
206
+ Display banner:
207
+ ```
208
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
209
+ CTX ► RESEARCHING
210
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
211
+
212
+ Researching {{domain}} ecosystem...
213
+ ```
214
+
215
+ **Execute ArguSeek research (4 queries):**
216
+
217
+ ```
218
+ mcp__arguseek__research_iteratively({
219
+ query: "{{domain}} standard tech stack 2025 best practices"
220
+ })
221
+ ```
222
+
223
+ Write results to `.ctx/research/STACK.md`
224
+
225
+ ```
226
+ mcp__arguseek__research_iteratively({
227
+ query: "{{domain}} must-have features table stakes vs differentiators",
228
+ previous_query: "{{domain}} standard tech stack 2025 best practices"
229
+ })
230
+ ```
231
+
232
+ Write results to `.ctx/research/FEATURES.md`
233
+
234
+ ```
235
+ mcp__arguseek__research_iteratively({
236
+ query: "{{domain}} architecture patterns component structure",
237
+ previous_query: "{{domain}} must-have features table stakes vs differentiators"
238
+ })
239
+ ```
240
+
241
+ Write results to `.ctx/research/ARCHITECTURE.md`
242
+
243
+ ```
244
+ mcp__arguseek__research_iteratively({
245
+ query: "{{domain}} common pitfalls mistakes to avoid security",
246
+ previous_query: "{{domain}} architecture patterns component structure"
247
+ })
248
+ ```
249
+
250
+ Write results to `.ctx/research/PITFALLS.md`
251
+
252
+ **Synthesize findings:**
253
+
254
+ ```bash
255
+ cat > .ctx/research/SUMMARY.md << 'EOF'
256
+ # Research Summary: {{domain}}
257
+
258
+ ## Recommended Stack
259
+ {{from STACK.md}}
260
+
261
+ ## Table Stakes Features
262
+ {{from FEATURES.md}}
263
+
264
+ ## Architecture Pattern
265
+ {{from ARCHITECTURE.md}}
266
+
267
+ ## Pitfalls to Avoid
268
+ {{from PITFALLS.md}}
269
+ EOF
72
270
  ```
73
271
 
74
- ## Step 4: Initialize STATE.md
75
- Create STATE.md from template with:
76
- - Project name (from package.json or directory name)
77
- - Detected tech stack
78
- - Status: "initializing"
79
- - Context budget: 0%
80
- - Empty current phase
272
+ **Commit research:**
81
273
 
82
- ## Step 5: Index with ChunkHound (if available)
83
274
  ```bash
84
- chunkhound index . --output .ctx/chunks.json
275
+ git add .ctx/research/
276
+ git commit -m "docs: add domain research for {{domain}}"
277
+ ```
278
+
279
+ Display:
85
280
  ```
86
- This enables semantic code search during planning.
281
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
282
+ CTX ► RESEARCH COMPLETE ✓
283
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
87
284
 
88
- ## Step 6: Gather Requirements
89
- Ask user: **"What do you want to build/fix/improve?"**
285
+ Key Findings:
286
+ - Stack: {{recommended_stack}}
287
+ - Table Stakes: {{key_features}}
288
+ - Watch Out For: {{key_pitfalls}}
90
289
 
91
- Then ask follow-up questions to elicit user stories:
92
- - **"What are the main features/outcomes?"** (becomes stories)
93
- - **"How will you know each is done?"** (becomes acceptance criteria)
94
- - **"Any constraints or rules?"** (becomes constitution)
290
+ Files: .ctx/research/
291
+ ```
292
+
293
+ ## Phase 7: Define Requirements
294
+
295
+ Display banner:
296
+ ```
297
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
298
+ CTX ► DEFINING REQUIREMENTS
299
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
300
+ ```
301
+
302
+ **If research exists:** Present features by category from FEATURES.md
303
+
304
+ **Scope each category with AskUserQuestion:**
305
+
306
+ ```
307
+ questions: [
308
+ {
309
+ header: "{{Category}}",
310
+ question: "Which {{category}} features for v1?",
311
+ multiSelect: true,
312
+ options: [
313
+ { label: "{{Feature 1}}", description: "{{description}}" },
314
+ { label: "{{Feature 2}}", description: "{{description}}" },
315
+ { label: "{{Feature 3}}", description: "{{description}}" },
316
+ { label: "None for v1", description: "Defer this category" }
317
+ ]
318
+ }
319
+ ]
320
+ ```
95
321
 
96
- ## Step 7: Generate PRD.json
97
- Create PRD.json with gathered information:
322
+ **Generate PRD.json:**
98
323
 
99
- ```json
324
+ ```bash
325
+ cat > .ctx/PRD.json << 'EOF'
100
326
  {
101
327
  "$schema": "https://ctx.dev/schemas/prd.json",
102
328
  "version": "1.0",
@@ -107,10 +333,10 @@ Create PRD.json with gathered information:
107
333
  "created": "{{timestamp}}"
108
334
  },
109
335
  "constitution": {
110
- "principles": ["{{from user or defaults}}"],
111
- "always": ["{{from user or defaults}}"],
112
- "never": ["{{from user or defaults}}"],
113
- "askFirst": ["{{from user or defaults}}"]
336
+ "principles": ["{{from questioning}}"],
337
+ "always": ["{{from questioning}}"],
338
+ "never": ["{{from questioning}}"],
339
+ "askFirst": ["Architecture decisions", "Database schema changes"]
114
340
  },
115
341
  "stories": [
116
342
  {
@@ -120,205 +346,251 @@ Create PRD.json with gathered information:
120
346
  "acceptanceCriteria": ["{{criterion_1}}", "{{criterion_2}}"],
121
347
  "priority": 1,
122
348
  "phase": 1,
123
- "passes": false,
124
- "verifiedAt": null,
125
- "notes": ""
349
+ "passes": false
126
350
  }
127
351
  ],
128
352
  "metadata": {
129
353
  "totalStories": {{count}},
130
354
  "passedStories": 0,
131
- "currentStory": "S001",
132
- "lastUpdated": "{{timestamp}}"
355
+ "currentStory": "S001"
133
356
  }
134
357
  }
358
+ EOF
135
359
  ```
136
360
 
137
- **Story Generation Rules:**
138
- - Each distinct feature/outcome = one story
139
- - Max 3 acceptance criteria per story (keep atomic)
140
- - Ordered by dependency (foundation first)
141
- - All stories start with `passes: false`
361
+ **Commit:**
142
362
 
143
- ## Step 8: Gather Credentials for Testing
363
+ ```bash
364
+ git add .ctx/PRD.json
365
+ git commit -m "docs: define v1 requirements - {{story_count}} stories"
366
+ ```
144
367
 
145
- Ask user about testing requirements:
368
+ ## Phase 8: Workflow Preferences
146
369
 
147
- **"Will this project need browser testing?"**
148
- If yes, gather:
149
- - **App URL** (local dev, staging, or production)
150
- - **Test user credentials** (email/password for login flows)
151
- - **Admin credentials** (if admin features exist)
370
+ Use AskUserQuestion (2 rounds):
371
+
372
+ **Round 1:**
373
+ ```
374
+ questions: [
375
+ {
376
+ header: "Mode",
377
+ question: "How do you want to work?",
378
+ multiSelect: false,
379
+ options: [
380
+ { label: "YOLO (Recommended)", description: "Auto-approve, just execute" },
381
+ { label: "Interactive", description: "Confirm at each step" }
382
+ ]
383
+ },
384
+ {
385
+ header: "Depth",
386
+ question: "How thorough should planning be?",
387
+ multiSelect: false,
388
+ options: [
389
+ { label: "Quick", description: "3-5 stories, ship fast" },
390
+ { label: "Standard (Recommended)", description: "5-8 stories, balanced" },
391
+ { label: "Comprehensive", description: "8-12 stories, thorough" }
392
+ ]
393
+ }
394
+ ]
395
+ ```
152
396
 
153
- **"Are there external APIs or services?"**
154
- If yes, gather:
155
- - **API keys** (third-party services)
156
- - **Database URLs** (if direct DB testing needed)
157
- - **OAuth tokens** (if OAuth flows)
397
+ **Round 2:**
398
+ ```
399
+ questions: [
400
+ {
401
+ header: "Research",
402
+ question: "Research before planning each story?",
403
+ multiSelect: false,
404
+ options: [
405
+ { label: "Yes (Recommended)", description: "ArguSeek research for each story" },
406
+ { label: "No", description: "Plan directly" }
407
+ ]
408
+ },
409
+ {
410
+ header: "Profile",
411
+ question: "Which AI models?",
412
+ multiSelect: false,
413
+ options: [
414
+ { label: "Balanced (Recommended)", description: "Sonnet for most work" },
415
+ { label: "Quality", description: "Opus for complex work" },
416
+ { label: "Budget", description: "Haiku where possible" }
417
+ ]
418
+ }
419
+ ]
420
+ ```
158
421
 
159
- **"Any other secrets needed for testing?"**
160
- - Environment-specific values
161
- - Feature flags
162
- - Test data identifiers
422
+ **Create config.json:**
163
423
 
164
- ## Step 9: Create .ctx/.env
424
+ ```bash
425
+ cat > .ctx/config.json << 'EOF'
426
+ {
427
+ "mode": "{{yolo|interactive}}",
428
+ "depth": "{{quick|standard|comprehensive}}",
429
+ "model_profile": "{{quality|balanced|budget}}",
430
+ "workflow": {
431
+ "research": {{true|false}},
432
+ "plan_check": true,
433
+ "verifier": true
434
+ },
435
+ "git": {
436
+ "autoCommit": true,
437
+ "commitPerTask": true
438
+ }
439
+ }
440
+ EOF
441
+ ```
165
442
 
166
- Write credentials to `.ctx/.env`:
443
+ **Commit:**
167
444
 
168
445
  ```bash
169
- # CTX Test Credentials - DO NOT COMMIT
170
- # Generated by /ctx init
446
+ git add .ctx/config.json
447
+ git commit -m "chore: add workflow config - {{mode}} mode, {{profile}} profile"
448
+ ```
171
449
 
172
- # App URLs
173
- APP_URL=http://localhost:3000
174
- STAGING_URL=
450
+ ## Phase 9: Create Roadmap
451
+
452
+ Display banner:
453
+ ```
454
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
455
+ CTX ► CREATING ROADMAP
456
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
457
+ ```
458
+
459
+ Read PRD.json and research to create roadmap:
460
+
461
+ ```bash
462
+ cat > .ctx/ROADMAP.md << 'EOF'
463
+ # Roadmap
464
+
465
+ ## v1.0
466
+
467
+ ### Phase 1: {{phase_name}}
468
+ **Goal:** {{goal}}
469
+ **Stories:** S001, S002
470
+ **Success Criteria:**
471
+ - [ ] {{criterion_1}}
472
+ - [ ] {{criterion_2}}
473
+
474
+ ### Phase 2: {{phase_name}}
475
+ **Goal:** {{goal}}
476
+ **Stories:** S003, S004
477
+ **Success Criteria:**
478
+ - [ ] {{criterion_1}}
479
+ - [ ] {{criterion_2}}
480
+
481
+ ...
482
+ EOF
483
+ ```
175
484
 
176
- # Test User
177
- TEST_USER_EMAIL=
178
- TEST_USER_PASSWORD=
485
+ **Present for approval:**
179
486
 
180
- # Admin User (if applicable)
181
- ADMIN_EMAIL=
182
- ADMIN_PASSWORD=
487
+ Use AskUserQuestion:
488
+ ```
489
+ questions: [
490
+ {
491
+ header: "Roadmap",
492
+ question: "Does this roadmap work?",
493
+ multiSelect: false,
494
+ options: [
495
+ { label: "Approve", description: "Commit and start" },
496
+ { label: "Adjust", description: "I want to change something" }
497
+ ]
498
+ }
499
+ ]
500
+ ```
183
501
 
184
- # API Keys
185
- API_KEY=
502
+ If "Adjust": Get feedback, regenerate roadmap, loop.
186
503
 
187
- # Database (if applicable)
188
- DATABASE_URL=
504
+ **Commit:**
189
505
 
190
- # Other Secrets
191
- # Add as needed
506
+ ```bash
507
+ git add .ctx/ROADMAP.md
508
+ git commit -m "docs: create roadmap - {{phase_count}} phases"
192
509
  ```
193
510
 
194
- **IMPORTANT:**
195
- - Create `.ctx/.gitignore` with `.env` entry
196
- - Warn user: "Credentials stored in .ctx/.env - NEVER commit this file"
197
- - Verify .gitignore is in place before proceeding
511
+ ## Phase 10: Update State
198
512
 
199
- ## Step 10: Gather Design Context
513
+ ```bash
514
+ cat > .ctx/STATE.md << 'EOF'
515
+ # CTX State
200
516
 
201
- **"Does this project need visual/UI work?"**
517
+ ## Project
518
+ Name: {{project_name}}
519
+ Stack: {{detected_stack}}
520
+ Created: {{timestamp}}
202
521
 
203
- If yes, gather brand context:
522
+ ## Status
523
+ initializing
204
524
 
205
- **Brand Personality:**
206
- - "What 3-5 adjectives describe the desired brand feel?"
207
- - "Any brands you admire visually?" (inspirations)
208
- - "Any visual styles to AVOID?" (anti-inspirations)
525
+ ## Current Story
526
+ S001 - {{story_title}}
209
527
 
210
- **Existing Assets:**
211
- - "Do you have existing brand assets?" (logo, colors, fonts)
212
- - "Figma file link?" (optional but recommended)
528
+ ## Roadmap
529
+ Phase 1 of {{total}}: {{phase_name}}
213
530
 
214
- **Accessibility Requirements:**
215
- - "Target market includes EU?" (EAA 2025 compliance)
216
- - "WCAG level needed?" (default: 2.2 AA)
531
+ ## Recent Decisions
532
+ {{decisions_from_questioning}}
217
533
 
218
- **Mode Support:**
219
- - "Dark mode needed?" (light-only or light+dark)
534
+ ## Context Budget
535
+ 15%
220
536
 
221
- Store in PRD.json `brand` section:
222
- ```json
223
- {
224
- "brand": {
225
- "hasBrandKit": false,
226
- "personality": ["professional", "trustworthy", "modern"],
227
- "visualMood": "Clean, minimal, with subtle warmth",
228
- "inspirations": ["Stripe", "Linear"],
229
- "antiInspirations": ["flashy", "cluttered"],
230
- "existingAssets": ["logo.svg"],
231
- "darkModeRequired": true,
232
- "euMarket": true
233
- },
234
- "design": {
235
- "wcagLevel": "AA",
236
- "eaaCompliance": true,
237
- "tokenFormat": "w3c",
238
- "figmaFileKey": null,
239
- "breakpoints": { "mobile": 375, "tablet": 768, "desktop": 1440 }
240
- }
241
- }
537
+ ## Next Action
538
+ Research S001
539
+ EOF
242
540
  ```
243
541
 
244
- **Story Type Assignment:**
245
- - If no brand kit exists and UI work needed → Create brand story first (type: "brand")
246
- - For each UI component/page Create design story (type: "design")
247
- - For backend/logic work → Create feature story (type: "feature")
248
-
249
- ## Step 11: Link STATE.md to PRD
250
- Update STATE.md to reference current story:
251
- - **Current Story**: S001 - {{title}}
542
+ ```bash
543
+ git add .ctx/STATE.md
544
+ git commit -m "docs: project ready for execution"
545
+ ```
252
546
 
253
- Do NOT start planning yet. Set status to "initializing".
254
- The user will run `/ctx` to begin the research + planning phase.
255
- </workflow>
547
+ ## Phase 11: Done
256
548
 
257
- <output_format>
258
549
  ```
259
- [CTX 2.3] Initialized
550
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
551
+ CTX ► PROJECT INITIALIZED ✓
552
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
553
+
554
+ **{{project_name}}**
260
555
 
261
- Project: {{name}}
262
- Stack: {{language}} + {{framework}}
263
- Directory: .ctx/
556
+ | Artifact | Location |
557
+ |---------------|-----------------------|
558
+ | State | .ctx/STATE.md |
559
+ | Requirements | .ctx/PRD.json |
560
+ | Config | .ctx/config.json |
561
+ | Research | .ctx/research/ |
562
+ | Roadmap | .ctx/ROADMAP.md |
264
563
 
265
- PRD: {{story_count}} stories
266
- S001: [{{type}}] {{story_1_title}} ⬜
267
- S002: [{{type}}] {{story_2_title}} ⬜
268
- ...
564
+ **{{story_count}} stories** | **{{phase_count}} phases** | Ready to build ✓
269
565
 
270
- Constitution:
271
- Principles: {{count}}
272
- Always: {{count}}
273
- Never: {{count}}
566
+ ───────────────────────────────────────────────────────────────
274
567
 
275
- Design Context:
276
- Brand Kit: {{exists | needs creation}}
277
- Personality: {{adjectives}}
278
- WCAG Level: 2.2 {{level}}
279
- EAA 2025: {{required | not required}}
280
- Dark Mode: {{yes | no}}
281
- Figma: {{linked | not linked}}
568
+ ## ▶ Next Up
282
569
 
283
- Credentials:
284
- App URL: {{configured | not set}}
285
- Test User: {{configured | not set}}
286
- API Keys: {{count}} configured
287
- ⚠️ Stored in .ctx/.env (gitignored)
570
+ **Phase 1: {{phase_name}}** — {{goal}}
288
571
 
289
- Integrations:
290
- ArguSeek: ready
291
- ChunkHound: {{indexed | not found}}
292
- Browser Testing: {{ready | needs credentials}}
293
- Figma MCP: {{ready | not configured}}
294
- Gemini Design: {{ready | not configured}}
572
+ /ctx — start building
295
573
 
296
- Ready for autonomous execution.
297
- Next: Run /ctx to start planning for S001
574
+ <sub>/clear first fresh context window</sub>
575
+
576
+ ───────────────────────────────────────────────────────────────
577
+
578
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
579
+ To continue with CTX, run: /ctx
580
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
298
581
  ```
299
- </output_format>
582
+
583
+ </process>
300
584
 
301
585
  <success_criteria>
302
586
  - [ ] .ctx/ directory created
303
- - [ ] .ctx/.gitignore created (protects .env)
304
- - [ ] STATE.md initialized with detected info
305
- - [ ] PRD.json created with user stories
306
- - [ ] Constitution defined (user or defaults)
307
- - [ ] All stories have acceptance criteria
308
- - [ ] Stories assigned correct type (feature/brand/design)
309
- - [ ] Design context gathered (if UI work needed)
310
- - [ ] Brand story created first (if no BRAND_KIT.md)
311
- - [ ] .ctx/.env created with credentials (if provided)
312
- - [ ] ChunkHound index attempted
313
- - [ ] Status set to "initializing"
314
- - [ ] User warned about credential security
587
+ - [ ] Git repo initialized
588
+ - [ ] Deep questioning completed (threads followed)
589
+ - [ ] STATE.md created **committed**
590
+ - [ ] ArguSeek research executed (if selected)
591
+ - [ ] Research files created **committed**
592
+ - [ ] PRD.json created with stories → **committed**
593
+ - [ ] config.json created **committed**
594
+ - [ ] ROADMAP.md created **committed**
595
+ - [ ] User knows to run `/ctx` to continue
315
596
  </success_criteria>
316
-
317
- <security_reminders>
318
- **CRITICAL - Credential Security:**
319
- 1. NEVER commit `.ctx/.env` to version control
320
- 2. NEVER echo credentials in logs or output
321
- 3. ALWAYS verify `.ctx/.gitignore` exists before storing secrets
322
- 4. WARN user if `.gitignore` is missing or incomplete
323
- 5. Use credentials ONLY for automated testing
324
- </security_reminders>