@champpaba/claude-agent-kit 2.4.0 → 2.6.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 (45) hide show
  1. package/.claude/CLAUDE.md +102 -9
  2. package/.claude/commands/csetup.md +335 -16
  3. package/.claude/commands/cview.md +364 -364
  4. package/.claude/commands/pageplan.md +18 -0
  5. package/.claude/contexts/design/accessibility.md +611 -611
  6. package/.claude/contexts/design/layout.md +400 -400
  7. package/.claude/contexts/design/responsive.md +551 -551
  8. package/.claude/contexts/design/shadows.md +522 -522
  9. package/.claude/contexts/design/typography.md +465 -465
  10. package/.claude/contexts/domain/README.md +164 -164
  11. package/.claude/contexts/patterns/agent-coordination.md +388 -388
  12. package/.claude/contexts/patterns/development-principles.md +513 -513
  13. package/.claude/contexts/patterns/error-handling.md +478 -478
  14. package/.claude/contexts/patterns/logging.md +424 -424
  15. package/.claude/contexts/patterns/tdd-classification.md +516 -516
  16. package/.claude/contexts/patterns/testing.md +413 -413
  17. package/.claude/lib/tdd-classifier.md +345 -345
  18. package/.claude/lib/validation-gates.md +484 -484
  19. package/.claude/settings.local.json +42 -42
  20. package/.claude/templates/context-template.md +45 -45
  21. package/.claude/templates/flags-template.json +42 -42
  22. package/.claude/templates/phases-sections/accessibility-test.md +17 -17
  23. package/.claude/templates/phases-sections/api-design.md +37 -37
  24. package/.claude/templates/phases-sections/backend-tests.md +16 -16
  25. package/.claude/templates/phases-sections/backend.md +37 -37
  26. package/.claude/templates/phases-sections/business-logic-validation.md +16 -16
  27. package/.claude/templates/phases-sections/component-tests.md +17 -17
  28. package/.claude/templates/phases-sections/contract-backend.md +16 -16
  29. package/.claude/templates/phases-sections/contract-frontend.md +16 -16
  30. package/.claude/templates/phases-sections/database.md +35 -35
  31. package/.claude/templates/phases-sections/e2e-tests.md +16 -16
  32. package/.claude/templates/phases-sections/fix-implementation.md +17 -17
  33. package/.claude/templates/phases-sections/frontend-integration.md +18 -18
  34. package/.claude/templates/phases-sections/manual-flow-test.md +15 -15
  35. package/.claude/templates/phases-sections/manual-ux-test.md +16 -16
  36. package/.claude/templates/phases-sections/refactor-implementation.md +17 -17
  37. package/.claude/templates/phases-sections/refactor.md +16 -16
  38. package/.claude/templates/phases-sections/regression-tests.md +15 -15
  39. package/.claude/templates/phases-sections/responsive-test.md +16 -16
  40. package/.claude/templates/phases-sections/script-implementation.md +43 -43
  41. package/.claude/templates/phases-sections/test-coverage.md +16 -16
  42. package/.claude/templates/phases-sections/user-approval.md +14 -14
  43. package/LICENSE +21 -21
  44. package/README.md +23 -3
  45. package/package.json +1 -1
package/.claude/CLAUDE.md CHANGED
@@ -1,8 +1,8 @@
1
1
  # CLAUDE.md
2
2
 
3
3
  > **Navigation Hub for AI Agents**
4
- > **Template Version:** 2.4.0 - Adaptive Depth Research
5
- > **Latest:** Dynamic research layers (0-10+) per change + Zero-maintenance tech detection + Claude 4.5 optimized agents
4
+ > **Template Version:** 2.5.0 - Smart Topic Query
5
+ > **Latest:** Cross-library integration detection + Integration risk summary + Proactive error prevention
6
6
 
7
7
  ---
8
8
 
@@ -131,18 +131,22 @@ Universal, framework-agnostic template for AI-assisted development.
131
131
 
132
132
  ---
133
133
 
134
- ## 📚 Best Practices System (v2.3.0 - Zero Maintenance)
134
+ ## 📚 Best Practices System (v2.5.0 - Smart Topic Query)
135
135
 
136
136
  **Quick Summary:**
137
137
  - `/csetup` **dynamically detects any library** from spec text + package files (no hardcoded mappings)
138
138
  - **Works with any language:** JavaScript, Python, Rust, Go, PHP, Ruby - automatically
139
139
  - **Context7 validates** each potential library name and resolves to official docs
140
+ - **v2.5.0:** Smart Topic Query includes other library names for cross-library integration docs
141
+ - **v2.5.0:** Auto-generates `INTEGRATION_RISKS.md` with detected concerns
140
142
  - Files created in `.claude/contexts/domain/project/best-practices/`
141
- - **Agents read** best practices before coding (validated by agent-executor)
143
+ - **Agents read** best practices + integration risks before coding
142
144
 
143
- **Key Change in v2.3.0:**
144
- - Old: Hardcoded regex patterns + manual ID mappings (required maintenance)
145
- - ✅ New: NLP extraction + Context7 resolution (zero maintenance, any library)
145
+ **Key Changes:**
146
+ | Version | Change |
147
+ |---------|--------|
148
+ | v2.3.0 | NLP extraction + Context7 resolution (zero maintenance) |
149
+ | v2.5.0 | Smart Topic Query + Integration Risk Detection |
146
150
 
147
151
  **Detection Sources:**
148
152
  | Source | Examples |
@@ -155,15 +159,24 @@ Universal, framework-agnostic template for AI-assisted development.
155
159
  | PHP | composer.json |
156
160
  | Ruby | Gemfile |
157
161
 
158
- **Flow:**
162
+ **Flow (v2.5.0):**
159
163
  ```
160
164
  /csetup → extract potential library names from ALL text sources
161
165
  → Context7 resolve-library-id (validates if real library)
162
- → Context7 get-library-docs (fetch best practices)
166
+ → Context7 get-library-docs (Smart Topic Query with other lib names)
167
+ → detect integration risks from docs content
163
168
  → generate .md files for each verified library
169
+ → generate INTEGRATION_RISKS.md if risks detected
164
170
  /cdev → inject paths into prompt → agent reads → validation checks
165
171
  ```
166
172
 
173
+ **Output Files:**
174
+ | File | Content |
175
+ |------|---------|
176
+ | `{lib}.md` | Library best practices with integration info |
177
+ | `INTEGRATION_RISKS.md` | Cross-library risks + checklist (if any detected) |
178
+ | `index.md` | Registry of all best practices files |
179
+
167
180
  ---
168
181
 
169
182
  ## 🎨 Design System v2.0.0 (Interactive Setup)
@@ -305,6 +318,86 @@ User: "Build login system"
305
318
 
306
319
  ---
307
320
 
321
+ ## 🆕 v2.5.0: Smart Topic Query + Integration Risk Detection
322
+
323
+ **Problem Solved:** Context7 queries used static topic "best practices" which missed adapter/integration documentation. Example: Drizzle + Auth.js requires specific column naming (snake_case) but this wasn't detected, causing runtime errors.
324
+
325
+ **Solution:** Smart Topic Query includes other library names in topic + automatic integration risk detection.
326
+
327
+ ### How Smart Topic Query Works
328
+
329
+ ```
330
+ Old (v2.4.0):
331
+ topic: "best practices, patterns, anti-patterns, common mistakes"
332
+ → Misses adapter-specific docs
333
+
334
+ New (v2.5.0):
335
+ topic: "best practices, patterns, adapter, integration, schema, {other-lib-names}"
336
+ → Gets cross-library integration docs automatically
337
+ ```
338
+
339
+ ### Key Features
340
+
341
+ | Feature | Description |
342
+ |---------|-------------|
343
+ | **Smart Topic** | Includes other detected library names in Context7 topic |
344
+ | **Bidirectional Query** | Query BOTH libraries (Auth.js → Drizzle, Drizzle → Auth.js) |
345
+ | **Risk Pattern Detection** | Scans docs for adapter, schema, column, sync, webhook patterns |
346
+ | **INTEGRATION_RISKS.md** | Auto-generated summary of detected integration concerns |
347
+ | **Zero Maintenance** | No hardcoded library pairs - works with any combination |
348
+
349
+ ### Integration Risk Patterns Detected
350
+
351
+ | Pattern | Keywords | Example |
352
+ |---------|----------|---------|
353
+ | Adapter | adapter, drizzleadapter, prismaadapter | ORM + Auth integrations |
354
+ | Schema | column, snake_case, camelcase, mapping | Column naming mismatches |
355
+ | Sync | sync, migrate, syncurl, embedded replica | Mobile/Edge data sync |
356
+ | Webhook | webhook, webhookendpoint | Payment/notification handlers |
357
+ | Lifecycle | beforeall, aftereach, setup, teardown | Test configuration |
358
+
359
+ ### Output Files
360
+
361
+ | File | Content |
362
+ |------|---------|
363
+ | `best-practices/{lib}.md` | Library-specific best practices (enhanced with integration docs) |
364
+ | `best-practices/INTEGRATION_RISKS.md` | Cross-library risk summary + checklist |
365
+
366
+ ### Example Flow
367
+
368
+ ```
369
+ Detected: [drizzle, auth.js, stripe]
370
+
371
+ Query drizzle with topic: "best practices, adapter, integration, auth.js, stripe"
372
+ → Gets: Drizzle adapter patterns, column naming
373
+
374
+ Query auth.js with topic: "best practices, adapter, integration, drizzle, stripe"
375
+ → Gets: DrizzleAdapter config, usersTable/accountsTable schema
376
+
377
+ Query stripe with topic: "best practices, adapter, integration, drizzle, auth.js"
378
+ → Gets: Webhook patterns, payment integration
379
+
380
+ Risk Detection:
381
+ → auth.js mentions "drizzleadapter", "userstable" → SCHEMA pattern
382
+ → stripe mentions "webhook", "webhooksecret" → WEBHOOK pattern
383
+
384
+ Output:
385
+ → drizzle.md (with auth.js integration info)
386
+ → auth-js.md (with Drizzle adapter config)
387
+ → stripe.md (with webhook patterns)
388
+ → INTEGRATION_RISKS.md (summary of all detected risks)
389
+ ```
390
+
391
+ ### Files Changed
392
+
393
+ | File | Change |
394
+ |------|--------|
395
+ | `csetup.md` Step 2.7 | Smart Topic Query implementation |
396
+ | `detectIntegrationRisks()` | New: Pattern detection from docs |
397
+ | `generateIntegrationRiskSummary()` | New: INTEGRATION_RISKS.md output |
398
+
399
+ ---
400
+
308
401
  ## 🆕 v2.4.0: Adaptive Depth Research
309
402
 
310
403
  **Problem Solved:** Previous feature detection was hardcoded (only 4 types: auth, payment, fileUpload, apiDesign) and used fixed standards. Missing domain-level best practices like "how to design a good database" or "healthcare compliance requirements."
@@ -1045,6 +1045,7 @@ if (resolvedLibraries.length === 0) {
1045
1045
  }
1046
1046
 
1047
1047
  // 5. Generate best-practices files for resolved libraries
1048
+ // v2.5.0: Smart Topic Query - include other library names for cross-library integration docs
1048
1049
  const bpDir = '.claude/contexts/domain/project/best-practices/'
1049
1050
  const existingBp = fileExists(bpDir) ? listFiles(bpDir) : []
1050
1051
 
@@ -1056,22 +1057,53 @@ const newLibraries = resolvedLibraries.filter(lib => {
1056
1057
 
1057
1058
  if (newLibraries.length > 0) {
1058
1059
  output(`\n📚 Generating Best Practices from Context7...`)
1060
+ output(` 💡 Using Smart Topic Query for cross-library integration docs`)
1059
1061
 
1060
1062
  // Create directory if needed
1061
1063
  if (!fileExists(bpDir)) {
1062
1064
  mkdir(bpDir)
1063
1065
  }
1064
1066
 
1067
+ // Collect all integration risks for summary
1068
+ const integrationRisks = []
1069
+
1065
1070
  for (const lib of newLibraries) {
1066
1071
  output(` 📖 Fetching ${lib.title} best practices...`)
1067
1072
 
1068
1073
  try {
1074
+ // v2.5.0: Smart Topic Query - include other library names in topic
1075
+ // WHY: This captures integration docs (e.g., "drizzle adapter" in auth.js docs)
1076
+ const otherLibNames = resolvedLibraries
1077
+ .filter(l => l.name !== lib.name)
1078
+ .map(l => l.name.toLowerCase())
1079
+ .slice(0, 5) // Limit to 5 to avoid topic overflow
1080
+ .join(', ')
1081
+
1082
+ const smartTopic = [
1083
+ 'best practices',
1084
+ 'patterns',
1085
+ 'anti-patterns',
1086
+ 'common mistakes',
1087
+ 'adapter', // Key for ORM + Auth integrations
1088
+ 'integration', // Key for multi-library setups
1089
+ 'schema', // Key for database + auth column naming
1090
+ 'configuration', // Key for setup requirements
1091
+ otherLibNames // Include other detected libraries
1092
+ ].filter(Boolean).join(', ')
1093
+
1069
1094
  const docs = await mcp__context7__get_library_docs({
1070
1095
  context7CompatibleLibraryID: lib.context7Id,
1071
- topic: 'best practices, patterns, anti-patterns, common mistakes',
1096
+ topic: smartTopic,
1072
1097
  mode: 'code'
1073
1098
  })
1074
1099
 
1100
+ // v2.5.0: Detect integration risks from docs content
1101
+ const risks = detectIntegrationRisks(docs, lib.name, resolvedLibraries)
1102
+ if (risks.length > 0) {
1103
+ integrationRisks.push(...risks)
1104
+ output(` ⚠️ Found ${risks.length} integration pattern(s) to review`)
1105
+ }
1106
+
1075
1107
  const bpContent = generateBestPracticesFile(lib.title, docs, lib.context7Id)
1076
1108
  const safeName = lib.name.toLowerCase().replace(/[^a-z0-9]/g, '-')
1077
1109
  Write(`${bpDir}${safeName}.md`, bpContent)
@@ -1082,6 +1114,13 @@ if (newLibraries.length > 0) {
1082
1114
  }
1083
1115
  }
1084
1116
 
1117
+ // v2.5.0: Generate integration risk summary if any found
1118
+ if (integrationRisks.length > 0) {
1119
+ generateIntegrationRiskSummary(integrationRisks, bpDir, resolvedLibraries)
1120
+ output(`\n⚠️ Integration Risk Summary generated (${integrationRisks.length} items)`)
1121
+ output(` 📄 ${bpDir}INTEGRATION_RISKS.md`)
1122
+ }
1123
+
1085
1124
  // Generate/update index.md
1086
1125
  generateBestPracticesIndex(resolvedLibraries, changeId)
1087
1126
  output(` ✅ index.md updated`)
@@ -1771,6 +1810,228 @@ function extractChecklist(docs: string): string {
1771
1810
 
1772
1811
  ---
1773
1812
 
1813
+ ### Helper: detectIntegrationRisks() - v2.5.0
1814
+
1815
+ > **Smart Risk Detection:** Scans Context7 docs for integration patterns that require attention.
1816
+ > **WHY:** Proactively catch integration requirements BEFORE implementation, not at runtime.
1817
+
1818
+ ```typescript
1819
+ function detectIntegrationRisks(
1820
+ docs: string,
1821
+ currentLib: string,
1822
+ allLibs: Array<{ name: string; title: string }>
1823
+ ): Array<{ library: string; risk: string; pattern: string; recommendation: string }> {
1824
+ const risks = []
1825
+ const docsLower = docs.toLowerCase()
1826
+
1827
+ // Integration risk patterns to detect
1828
+ const riskPatterns = [
1829
+ // Adapter patterns (ORM + Auth)
1830
+ {
1831
+ keywords: ['adapter', 'drizzleadapter', 'prismaadapter'],
1832
+ risk: 'Database adapter configuration required',
1833
+ pattern: 'adapter',
1834
+ recommendation: 'Verify adapter schema matches expected column names'
1835
+ },
1836
+ // Column naming patterns
1837
+ {
1838
+ keywords: ['column', 'columnname', 'snake_case', 'camelcase', 'mapping'],
1839
+ risk: 'Column naming convention mismatch possible',
1840
+ pattern: 'schema',
1841
+ recommendation: 'Check column naming between ORM schema and library expectations'
1842
+ },
1843
+ // Schema patterns
1844
+ {
1845
+ keywords: ['userstable', 'accountstable', 'sessionstable', 'schema'],
1846
+ risk: 'Custom table schema required',
1847
+ pattern: 'schema',
1848
+ recommendation: 'Ensure table schemas match library documentation exactly'
1849
+ },
1850
+ // Sync/Migration patterns
1851
+ {
1852
+ keywords: ['sync', 'migrate', 'migration', 'syncurl', 'embedded replica'],
1853
+ risk: 'Data synchronization setup required',
1854
+ pattern: 'sync',
1855
+ recommendation: 'Configure sync intervals and handle offline scenarios'
1856
+ },
1857
+ // Webhook patterns
1858
+ {
1859
+ keywords: ['webhook', 'webhookendpoint', 'webhooksecret'],
1860
+ risk: 'Webhook endpoint configuration required',
1861
+ pattern: 'webhook',
1862
+ recommendation: 'Set up webhook endpoints and verify signatures'
1863
+ },
1864
+ // API Key patterns
1865
+ {
1866
+ keywords: ['apikey', 'secretkey', 'authtoken', 'bearer'],
1867
+ risk: 'API credentials setup required',
1868
+ pattern: 'credentials',
1869
+ recommendation: 'Store credentials securely in environment variables'
1870
+ },
1871
+ // Lifecycle patterns
1872
+ {
1873
+ keywords: ['beforeall', 'afterall', 'beforeeach', 'aftereach', 'setup', 'teardown'],
1874
+ risk: 'Test lifecycle hooks required',
1875
+ pattern: 'lifecycle',
1876
+ recommendation: 'Implement proper setup/teardown in test configuration'
1877
+ }
1878
+ ]
1879
+
1880
+ for (const rp of riskPatterns) {
1881
+ const found = rp.keywords.some(kw => docsLower.includes(kw.toLowerCase()))
1882
+ if (found) {
1883
+ // Check if this risk involves other detected libraries
1884
+ const involvedLibs = allLibs
1885
+ .filter(l => l.name !== currentLib)
1886
+ .filter(l => docsLower.includes(l.name.toLowerCase()))
1887
+ .map(l => l.name)
1888
+
1889
+ risks.push({
1890
+ library: currentLib,
1891
+ risk: rp.risk,
1892
+ pattern: rp.pattern,
1893
+ recommendation: rp.recommendation,
1894
+ involvedLibraries: involvedLibs
1895
+ })
1896
+ }
1897
+ }
1898
+
1899
+ return risks
1900
+ }
1901
+ ```
1902
+
1903
+ ---
1904
+
1905
+ ### Helper: generateIntegrationRiskSummary() - v2.5.0
1906
+
1907
+ > **Risk Summary Output:** Creates INTEGRATION_RISKS.md with all detected cross-library concerns.
1908
+ > **WHY:** Agents can review this BEFORE implementation to avoid common integration mistakes.
1909
+
1910
+ ```typescript
1911
+ function generateIntegrationRiskSummary(
1912
+ risks: Array<{
1913
+ library: string
1914
+ risk: string
1915
+ pattern: string
1916
+ recommendation: string
1917
+ involvedLibraries?: string[]
1918
+ }>,
1919
+ bpDir: string,
1920
+ allLibs: Array<{ name: string; title: string }>
1921
+ ): void {
1922
+ // Group risks by pattern type
1923
+ const byPattern = {}
1924
+ for (const r of risks) {
1925
+ if (!byPattern[r.pattern]) byPattern[r.pattern] = []
1926
+ byPattern[r.pattern].push(r)
1927
+ }
1928
+
1929
+ const content = `# Integration Risk Summary
1930
+
1931
+ > **Generated:** ${new Date().toISOString().split('T')[0]}
1932
+ > **Template Version:** 2.5.0 - Smart Topic Query
1933
+ > **Detected Libraries:** ${allLibs.map(l => l.name).join(', ')}
1934
+
1935
+ ---
1936
+
1937
+ ## ⚠️ Review Before Implementation
1938
+
1939
+ The following integration patterns were detected from library documentation.
1940
+ **Agents should review these items in STEP 0 before writing code.**
1941
+
1942
+ ---
1943
+
1944
+ ${Object.entries(byPattern).map(([pattern, patternRisks]) => `
1945
+ ### ${pattern.toUpperCase()} Patterns
1946
+
1947
+ | Library | Risk | Recommendation |
1948
+ |---------|------|----------------|
1949
+ ${patternRisks.map(r => `| ${r.library} | ${r.risk} | ${r.recommendation} |`).join('\n')}
1950
+ ${patternRisks.some(r => r.involvedLibraries?.length > 0) ? `
1951
+ **Cross-library concerns:**
1952
+ ${patternRisks.filter(r => r.involvedLibraries?.length > 0).map(r => `- ${r.library} ↔ ${r.involvedLibraries.join(', ')}: ${r.risk}`).join('\n')}
1953
+ ` : ''}
1954
+ `).join('\n')}
1955
+
1956
+ ---
1957
+
1958
+ ## Quick Checklist
1959
+
1960
+ Before implementing integrations:
1961
+
1962
+ ${[...new Set(risks.map(r => r.recommendation))].map(rec => `- [ ] ${rec}`).join('\n')}
1963
+
1964
+ ---
1965
+
1966
+ **This file is auto-generated by /csetup v2.5.0**
1967
+ **Agents read this in STEP 0 alongside best-practices files**
1968
+ `
1969
+
1970
+ Write(`${bpDir}INTEGRATION_RISKS.md`, content)
1971
+ }
1972
+ ```
1973
+
1974
+ ---
1975
+
1976
+ ### Helper: generateBestPracticesIndex() - v2.5.0
1977
+
1978
+ > **Index File:** Creates index.md registry of all best practices files.
1979
+ > **v2.5.0:** Now includes INTEGRATION_RISKS.md if present.
1980
+
1981
+ ```typescript
1982
+ function generateBestPracticesIndex(
1983
+ resolvedLibraries: Array<{ name: string; title: string; context7Id: string }>,
1984
+ changeId: string
1985
+ ): void {
1986
+ const bpDir = '.claude/contexts/domain/project/best-practices/'
1987
+ const hasIntegrationRisks = fileExists(`${bpDir}INTEGRATION_RISKS.md`)
1988
+
1989
+ const content = `# Best Practices Index
1990
+
1991
+ > **Generated:** ${new Date().toISOString().split('T')[0]}
1992
+ > **Template Version:** 2.5.0 - Smart Topic Query
1993
+ > **Change:** ${changeId}
1994
+
1995
+ ---
1996
+
1997
+ ## 📚 Library Best Practices
1998
+
1999
+ | Library | File | Context7 ID |
2000
+ |---------|------|-------------|
2001
+ ${resolvedLibraries.map(lib => {
2002
+ const safeName = lib.name.toLowerCase().replace(/[^a-z0-9]/g, '-')
2003
+ return `| ${lib.title} | [${safeName}.md](./${safeName}.md) | \`${lib.context7Id}\` |`
2004
+ }).join('\n')}
2005
+
2006
+ ---
2007
+
2008
+ ${hasIntegrationRisks ? `## ⚠️ Integration Risks
2009
+
2010
+ Cross-library integration concerns detected. **Review before implementation.**
2011
+
2012
+ → [INTEGRATION_RISKS.md](./INTEGRATION_RISKS.md)
2013
+
2014
+ ---
2015
+
2016
+ ` : ''}## Usage
2017
+
2018
+ Agents read these files in **STEP 0** before implementation:
2019
+
2020
+ 1. Read \`index.md\` (this file) for overview
2021
+ 2. Read relevant \`{library}.md\` files for specific best practices
2022
+ ${hasIntegrationRisks ? '3. Read `INTEGRATION_RISKS.md` for cross-library concerns' : ''}
2023
+
2024
+ ---
2025
+
2026
+ **Auto-generated by /csetup v2.5.0**
2027
+ `
2028
+
2029
+ Write(`${bpDir}index.md`, content)
2030
+ }
2031
+ ```
2032
+
2033
+ ---
2034
+
1774
2035
  ### Step 3: Analyze Tasks
1775
2036
 
1776
2037
  **Parse tasks.md content and detect keywords:**
@@ -2348,33 +2609,91 @@ contextTemplate = contextTemplate
2348
2609
 
2349
2610
  Write to: `openspec/changes/{change-id}/.claude/context.md`
2350
2611
 
2351
- ### Step 8: Output Summary
2612
+ ### Step 8: Output Summary (ENHANCED v2.6.0)
2352
2613
 
2353
- ```
2614
+ ```typescript
2615
+ // Check if UI work was detected (from Step 2.5/Step 3)
2616
+ const hasUIWork = hasFrontend || (hasDatabase && lower.includes('ui'))
2617
+
2618
+ // Check for existing page-plan.md
2619
+ const pagePlanPath = `openspec/changes/${changeId}/page-plan.md`
2620
+ const hasPagePlan = fileExists(pagePlanPath)
2621
+
2622
+ // Build output
2623
+ let output = `
2354
2624
  ✅ Change setup complete!
2355
2625
 
2356
- 📦 Change: {change-id}
2357
- 📋 Template: {template-name} ({total-phases} phases)
2358
- 🛠️ Detected: {detected-categories}
2626
+ 📦 Change: ${changeId}
2627
+ 📋 Template: ${templateName} (${totalPhases} phases)
2628
+ 🛠️ Detected: ${detectedCategories.join(', ')}
2359
2629
 
2360
2630
  📁 Files created:
2361
- ✓ openspec/changes/{change-id}/.claude/phases.md
2362
- ✓ openspec/changes/{change-id}/.claude/flags.json
2363
- ✓ openspec/changes/{change-id}/.claude/context.md
2631
+ ✓ openspec/changes/${changeId}/.claude/phases.md
2632
+ ✓ openspec/changes/${changeId}/.claude/flags.json
2633
+ ✓ openspec/changes/${changeId}/.claude/context.md
2364
2634
 
2365
2635
  📊 Workflow:
2366
- Phase 1: {first-phase-name} ({agent} agent, {estimated} min)
2636
+ Phase 1: ${firstPhaseName} (${firstPhaseAgent} agent, ${firstPhaseMin} min)
2367
2637
  ...
2368
- Phase {n}: {last-phase-name}
2638
+ Phase ${totalPhases}: ${lastPhaseName}
2369
2639
 
2370
- ⏱️ Total estimated time: ~{hours}h {minutes}m
2640
+ ⏱️ Total estimated time: ~${hours}h ${minutes}m
2641
+ `
2371
2642
 
2643
+ // 🆕 v2.6.0: Recommend /pageplan if UI work detected
2644
+ if (hasUIWork) {
2645
+ if (hasPagePlan) {
2646
+ output += `
2647
+ ✅ page-plan.md found: ${pagePlanPath}
2648
+ → uxui-frontend will use this for component planning
2649
+ `
2650
+ } else {
2651
+ output += `
2652
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
2653
+ 🎨 UI Work Detected!
2654
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
2655
+
2656
+ Phases with UI work:
2657
+ ${uiPhases.map(p => \` • Phase \${p.number}: \${p.name} (\${p.agent})\`).join('\\n')}
2658
+
2659
+ 💡 RECOMMENDED: Run /pageplan before /cdev
2660
+
2661
+ Why?
2662
+ ├── Content variants (3 options per element - user picks A/B/C)
2663
+ ├── Component index (auto-generated, prevents duplicates)
2664
+ ├── Asset checklist (images, icons with specs)
2665
+ └── Approval process (user reviews before implementation)
2666
+
2667
+ 📝 Recommended Steps:
2668
+ 1. /pageplan @prd.md ← Generate page plan
2669
+ 2. Edit page-plan.md ← Pick A/B/C content, prepare assets
2670
+ 3. Mark APPROVED in Section 6 ← Sign-off before implementation
2671
+ 4. /cdev ${changeId} ← Implement with real content
2672
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
2673
+ `
2674
+ }
2675
+ }
2676
+
2677
+ output += `
2372
2678
  🚀 Ready to start development!
2373
2679
 
2374
- Next steps:
2375
- 1. Review generated workflow: openspec/changes/{change-id}/.claude/phases.md
2376
- 2. Start development: /cdev {change-id}
2377
- 3. View progress: /cview {change-id}
2680
+ Next steps:`
2681
+
2682
+ if (hasUIWork && !hasPagePlan) {
2683
+ output += `
2684
+ 1. (Recommended) Run: /pageplan @prd.md
2685
+ 2. Edit page-plan.md (content, assets, approval)
2686
+ 3. Review workflow: openspec/changes/${changeId}/.claude/phases.md
2687
+ 4. Start development: /cdev ${changeId}
2688
+ 5. View progress: /cview ${changeId}`
2689
+ } else {
2690
+ output += `
2691
+ 1. Review workflow: openspec/changes/${changeId}/.claude/phases.md
2692
+ 2. Start development: /cdev ${changeId}
2693
+ 3. View progress: /cview ${changeId}`
2694
+ }
2695
+
2696
+ console.log(output)
2378
2697
  ```
2379
2698
 
2380
2699
  ---