@anhth2/spec-driven-dev-plugin 0.9.1 → 0.9.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (86) hide show
  1. package/ARCHITECTURE.md +1 -1
  2. package/bin/index.js +1 -2
  3. package/commands/debug.md +2 -1
  4. package/commands/define-product.md +2 -1
  5. package/commands/fix-bug.md +2 -1
  6. package/commands/generate-bdd.md +2 -1
  7. package/commands/generate-code.md +2 -1
  8. package/commands/generate-design-spec.md +2 -1
  9. package/commands/generate-prd.md +2 -1
  10. package/commands/generate-spec-manifest.md +2 -1
  11. package/commands/generate-tech-docs.md +53 -12
  12. package/commands/generate-tech-docs.tmpl +51 -11
  13. package/commands/generate-tests.md +2 -1
  14. package/commands/learn.md +2 -1
  15. package/commands/propose-scenario.md +2 -1
  16. package/commands/refine-prd.md +2 -1
  17. package/commands/report-bug.md +2 -1
  18. package/commands/review-code.md +2 -1
  19. package/commands/review-context.md +2 -1
  20. package/commands/review-tech-docs.md +3 -1
  21. package/commands/review-tech-docs.tmpl +1 -0
  22. package/commands/run-tests.md +2 -1
  23. package/commands/smoke-test.md +2 -1
  24. package/commands/validate-traces.md +2 -1
  25. package/core/FRAMEWORK_VERSION +1 -1
  26. package/core/commands/debug.md +2 -1
  27. package/core/commands/define-product.md +2 -1
  28. package/core/commands/fix-bug.md +2 -1
  29. package/core/commands/generate-bdd.md +2 -1
  30. package/core/commands/generate-code.md +2 -1
  31. package/core/commands/generate-design-spec.md +2 -1
  32. package/core/commands/generate-prd.md +2 -1
  33. package/core/commands/generate-spec-manifest.md +2 -1
  34. package/core/commands/generate-tech-docs.md +53 -12
  35. package/core/commands/generate-tests.md +2 -1
  36. package/core/commands/learn.md +2 -1
  37. package/core/commands/propose-scenario.md +2 -1
  38. package/core/commands/refine-prd.md +2 -1
  39. package/core/commands/report-bug.md +2 -1
  40. package/core/commands/review-code.md +2 -1
  41. package/core/commands/review-context.md +2 -1
  42. package/core/commands/review-tech-docs.md +3 -1
  43. package/core/commands/run-tests.md +2 -1
  44. package/core/commands/smoke-test.md +2 -1
  45. package/core/commands/validate-traces.md +2 -1
  46. package/core/modules/android-compose/module.yaml +13 -0
  47. package/core/modules/android-compose/stack-profile.yaml +57 -0
  48. package/core/modules/flutter/module.yaml +14 -0
  49. package/core/modules/flutter/stack-profile.yaml +59 -0
  50. package/core/modules/ios-swiftui/module.yaml +13 -0
  51. package/core/modules/ios-swiftui/stack-profile.yaml +55 -0
  52. package/core/modules/nuxt/module.yaml +14 -0
  53. package/core/modules/nuxt/stack-profile.yaml +58 -0
  54. package/core/modules/react-native/module.yaml +14 -0
  55. package/core/modules/react-native/stack-profile.yaml +56 -0
  56. package/core/modules/vue/module.yaml +14 -0
  57. package/core/modules/vue/stack-profile.yaml +65 -0
  58. package/core/skills/code/SKILL.md +2 -1
  59. package/core/skills/debug/SKILL.md +2 -1
  60. package/core/skills/design-spec/SKILL.md +2 -1
  61. package/core/skills/discovery/SKILL.md +2 -1
  62. package/core/skills/test/SKILL.md +4 -2
  63. package/core/steps/context-loader.md +2 -1
  64. package/core/templates/product-definition.template.md +3 -3
  65. package/core/templates/project-context.yaml +4 -1
  66. package/modules/android-compose/module.yaml +13 -0
  67. package/modules/android-compose/stack-profile.yaml +57 -0
  68. package/modules/flutter/module.yaml +14 -0
  69. package/modules/flutter/stack-profile.yaml +59 -0
  70. package/modules/ios-swiftui/module.yaml +13 -0
  71. package/modules/ios-swiftui/stack-profile.yaml +55 -0
  72. package/modules/nuxt/module.yaml +14 -0
  73. package/modules/nuxt/stack-profile.yaml +58 -0
  74. package/modules/react-native/module.yaml +14 -0
  75. package/modules/react-native/stack-profile.yaml +56 -0
  76. package/modules/vue/module.yaml +14 -0
  77. package/modules/vue/stack-profile.yaml +65 -0
  78. package/package.json +1 -1
  79. package/skills/code/SKILL.md +2 -1
  80. package/skills/debug/SKILL.md +2 -1
  81. package/skills/design-spec/SKILL.md +2 -1
  82. package/skills/discovery/SKILL.md +2 -1
  83. package/skills/test/SKILL.md +4 -2
  84. package/steps/context-loader.md +2 -1
  85. package/templates/product-definition.template.md +3 -3
  86. package/templates/project-context.yaml +4 -1
@@ -0,0 +1,59 @@
1
+ build:
2
+ compile: "flutter build apk / flutter build ios"
3
+ test: "flutter test"
4
+ run: "flutter run"
5
+ lint: "flutter analyze"
6
+
7
+ architecture:
8
+ style: "Feature-based (presentation → domain → data)"
9
+ key_rules:
10
+ - "Widget tree is pure UI — business logic lives in BLoC/Cubit or Riverpod providers"
11
+ - "Repositories abstract data sources; services contain domain logic"
12
+ - "State management: BLoC (complex flows) or Riverpod (simple/medium)"
13
+ - "Never call API directly inside a Widget build() method"
14
+ - "Shared UI widgets in lib/shared/widgets/, feature widgets in lib/features/{name}/presentation/"
15
+ - "Use const constructors wherever possible for performance"
16
+ folder_structure: |
17
+ lib/
18
+ ├── core/
19
+ │ ├── theme/ ← AppTheme, colors, text styles
20
+ │ ├── router/ ← GoRouter or auto_route
21
+ │ └── utils/
22
+ ├── shared/
23
+ │ └── widgets/ ← reusable UI widgets (AppButton, AppInput...)
24
+ ├── features/
25
+ │ └── {domain}/
26
+ │ ├── data/ ← repositories, data sources, models
27
+ │ ├── domain/ ← entities, use cases, repo interfaces
28
+ │ └── presentation/ ← pages, widgets, BLoC/Cubit
29
+ └── main.dart
30
+
31
+ coding_standards:
32
+ naming:
33
+ widgets: "PascalCase (e.g., OrderListPage, CreateOrderForm)"
34
+ blocs: "PascalCase + Bloc/Cubit suffix (e.g., OrderListCubit)"
35
+ repositories: "PascalCase + Repository suffix (e.g., OrderRepository)"
36
+ files:
37
+ page: "{feature}_page.dart"
38
+ widget: "{feature}_widget.dart"
39
+ cubit: "{feature}_cubit.dart"
40
+ repository: "{feature}_repository.dart"
41
+ model: "{feature}_model.dart"
42
+ patterns:
43
+ state_management: "BLoC / Cubit (flutter_bloc) or Riverpod"
44
+ navigation: "GoRouter or auto_route"
45
+ networking: "Dio with interceptors"
46
+ serialization: "json_serializable / freezed"
47
+
48
+ testing:
49
+ unit: "flutter_test + mocktail"
50
+ widget: "flutter_test WidgetTester"
51
+ integration: "integration_test package"
52
+ patterns:
53
+ - "Test BLoC/Cubit in isolation with fake repositories"
54
+ - "Widget tests pump the widget tree and find by key or semantics label"
55
+ - "Use goldenFileComparator for snapshot tests of complex widgets"
56
+
57
+ trace_tags:
58
+ implements: "// @trace.implements={UC-ID}-SC{N}"
59
+ source: "// @trace.source=specs/bdd/{domain}/{UC-ID}.feature"
@@ -0,0 +1,13 @@
1
+ name: "iOS (SwiftUI)"
2
+ version: "1.0.0"
3
+ description: "Native iOS development with SwiftUI + Swift"
4
+ language: "Swift"
5
+ framework: "SwiftUI"
6
+ stack_type: "mobile"
7
+ default_layer_order:
8
+ - Models / entities
9
+ - Repository (data sources)
10
+ - UseCase (business operations)
11
+ - ViewModel (ObservableObject state)
12
+ - View (SwiftUI presentation)
13
+ test_framework: "XCTest + Quick/Nimble"
@@ -0,0 +1,55 @@
1
+ build:
2
+ compile: "xcodebuild -scheme {AppName} -configuration Release"
3
+ test: "xcodebuild test -scheme {AppName}"
4
+ run: "Open in Xcode → Run (⌘R)"
5
+ lint: "swiftlint"
6
+
7
+ architecture:
8
+ style: "MVVM + Clean Architecture (View → ViewModel → UseCase → Repository)"
9
+ key_rules:
10
+ - "Views are pure SwiftUI — no business logic, no direct API calls"
11
+ - "ViewModels are ObservableObject classes; bind via @StateObject / @ObservedObject"
12
+ - "UseCases encapsulate single business operations"
13
+ - "Repositories abstract data sources (network, cache, local DB)"
14
+ - "Dependency injection via environment or constructor injection"
15
+ - "Use Combine or async/await for async flows — never DispatchQueue in ViewModel"
16
+ folder_structure: |
17
+ Sources/
18
+ ├── Core/
19
+ │ ├── Network/ ← URLSession wrapper, interceptors
20
+ │ ├── Theme/ ← Color, Font, Spacing tokens
21
+ │ └── Utils/
22
+ ├── Shared/
23
+ │ └── Components/ ← reusable SwiftUI views (AppButton, AppTextField...)
24
+ ├── Features/
25
+ │ └── {Domain}/
26
+ │ ├── Views/
27
+ │ ├── ViewModels/
28
+ │ ├── UseCases/
29
+ │ └── Repository/
30
+
31
+ coding_standards:
32
+ naming:
33
+ views: "PascalCase + View suffix (e.g., OrderListView, CreateOrderView)"
34
+ viewmodels: "PascalCase + ViewModel suffix (e.g., OrderListViewModel)"
35
+ usecases: "PascalCase + UseCase suffix (e.g., CreateOrderUseCase)"
36
+ files:
37
+ view: "{Feature}View.swift"
38
+ viewmodel: "{Feature}ViewModel.swift"
39
+ usecase: "{Feature}UseCase.swift"
40
+ patterns:
41
+ async: "async/await + Combine"
42
+ navigation: "NavigationStack (iOS 16+)"
43
+ persistence: "Core Data or SwiftData"
44
+ networking: "URLSession or Alamofire"
45
+
46
+ testing:
47
+ unit: "XCTest + Quick/Nimble"
48
+ ui: "XCUITest"
49
+ patterns:
50
+ - "Test ViewModel by injecting mock repositories"
51
+ - "UI tests use accessibility identifiers — set .accessibilityIdentifier on Views"
52
+
53
+ trace_tags:
54
+ implements: "// @trace.implements={UC-ID}-SC{N}"
55
+ source: "// @trace.source=specs/bdd/{domain}/{UC-ID}.feature"
@@ -0,0 +1,14 @@
1
+ name: "Nuxt"
2
+ version: "1.0.0"
3
+ description: "Nuxt 3 with SSR/SSG, Composition API, Pinia, and useFetch"
4
+ language: "TypeScript"
5
+ framework: "Nuxt 3"
6
+ stack_type: "frontend"
7
+ default_layer_order:
8
+ - Types / interfaces
9
+ - Server API routes (server/api/)
10
+ - Composables (useFetch / useAsyncData)
11
+ - State store (Pinia)
12
+ - UI components (presentational)
13
+ - Page components (pages/)
14
+ test_framework: "Vitest + Vue Test Utils + @nuxt/test-utils"
@@ -0,0 +1,58 @@
1
+ build:
2
+ compile: "npm run build"
3
+ test: "npm run test"
4
+ run: "npm run dev"
5
+ lint: "npm run lint"
6
+
7
+ architecture:
8
+ style: "Pages + Composables + Server routes (SSR/SSG)"
9
+ key_rules:
10
+ - "Pages in pages/ are route-level containers — no business logic"
11
+ - "Business logic in composables/ using useAsyncData or useFetch"
12
+ - "Server-side logic in server/api/ routes (nitro)"
13
+ - "Client-only state in Pinia stores; server state via useAsyncData"
14
+ - "Shared UI primitives in components/ui/, auto-imported by Nuxt"
15
+ - "Use useRoute/useRouter instead of $route/$router in Composition API"
16
+ - "'use client' equivalent: wrap client-only code in onMounted or <ClientOnly>"
17
+ folder_structure: |
18
+ ├── components/
19
+ │ └── ui/ ← auto-imported UI primitives (BaseButton, BaseInput...)
20
+ ├── composables/ ← auto-imported composables (useOrderList...)
21
+ ├── pages/ ← file-based routing
22
+ ├── server/
23
+ │ └── api/ ← nitro server routes (GET /api/orders.ts)
24
+ ├── stores/ ← Pinia stores (auto-imported)
25
+ ├── plugins/ ← Nuxt plugins
26
+ └── utils/ ← auto-imported utilities
27
+
28
+ coding_standards:
29
+ naming:
30
+ components: "PascalCase (auto-imported, e.g., OrderList, BaseButton)"
31
+ composables: "camelCase with 'use' prefix (auto-imported, e.g., useOrderList)"
32
+ stores: "camelCase + Store suffix via defineStore()"
33
+ server_routes: "method.path.ts (e.g., get.orders.ts or [id].get.ts)"
34
+ files:
35
+ component: "{Feature}.vue"
36
+ composable: "use{Feature}.ts"
37
+ store: "{feature}.store.ts"
38
+ server_route: "{resource}.get.ts / {resource}.post.ts"
39
+ patterns:
40
+ data_fetching: "useAsyncData() for SSR data, useFetch() for client fetches"
41
+ global_state: "Pinia stores"
42
+ forms: "VeeValidate + Zod"
43
+ api_client: "$fetch (ofetch) — built-in to Nuxt, SSR-compatible"
44
+ ssr_hydration: "useState() for shared SSR/client state to avoid hydration mismatch"
45
+
46
+ testing:
47
+ unit: "Vitest + @nuxt/test-utils"
48
+ e2e: "Playwright via @nuxt/test-utils/e2e"
49
+ patterns:
50
+ - "Use mountSuspended() for components that need Nuxt context"
51
+ - "Use registerEndpoint() to mock server routes in tests"
52
+ - "Test pages with renderSuspended() from @nuxt/test-utils"
53
+
54
+ trace_tags:
55
+ implements: "// @trace.implements={UC-ID}-SC{N}"
56
+ source: "// @trace.source=specs/bdd/{domain}/{UC-ID}.feature"
57
+ verifies: "// @trace.verifies={UC-ID}"
58
+ test_type: "// @trace.test_type=unit|integration"
@@ -0,0 +1,14 @@
1
+ name: "React Native"
2
+ version: "1.0.0"
3
+ description: "Cross-platform mobile (iOS + Android) with React Native / Expo"
4
+ language: "TypeScript"
5
+ framework: "React Native"
6
+ stack_type: "mobile"
7
+ default_layer_order:
8
+ - Types / interfaces
9
+ - API client (React Query hooks)
10
+ - State store (Zustand)
11
+ - Custom hooks (business logic)
12
+ - UI components (presentational)
13
+ - Screen / feature components (container)
14
+ test_framework: "Jest + React Native Testing Library"
@@ -0,0 +1,56 @@
1
+ build:
2
+ compile: "npx expo export / npx react-native build-android"
3
+ test: "jest"
4
+ run: "npx expo start / npx react-native run-ios"
5
+ lint: "eslint . && tsc --noEmit"
6
+
7
+ architecture:
8
+ style: "Feature-based (screens → hooks → queries → store)"
9
+ key_rules:
10
+ - "Business logic lives in custom hooks, not in screen components"
11
+ - "Server state managed by React Query (TanStack Query)"
12
+ - "Navigation state managed by React Navigation"
13
+ - "Native modules wrapped in a service layer — never called directly in components"
14
+ - "Shared UI primitives in src/components/ui/, feature screens in src/features/{name}/"
15
+ folder_structure: |
16
+ src/
17
+ ├── api/ ← axios instance, interceptors
18
+ ├── components/
19
+ │ └── ui/ ← reusable primitives (AppButton, AppInput...)
20
+ ├── features/
21
+ │ └── {domain}/
22
+ │ ├── components/
23
+ │ ├── hooks/
24
+ │ ├── queries/
25
+ │ └── screens/
26
+ ├── navigation/ ← React Navigation stacks/tabs
27
+ ├── store/ ← Zustand slices
28
+ └── lib/ ← utils, formatters, constants
29
+
30
+ coding_standards:
31
+ naming:
32
+ components: "PascalCase (e.g., OrderListScreen, CreateOrderForm)"
33
+ hooks: "camelCase with 'use' prefix (e.g., useOrderList)"
34
+ screens: "PascalCase + Screen suffix (e.g., OrderDetailScreen)"
35
+ files:
36
+ screen: "{Feature}Screen.tsx"
37
+ component: "{Feature}.tsx"
38
+ hook: "use{Feature}.ts"
39
+ patterns:
40
+ state_management: "Zustand + React Query"
41
+ navigation: "React Navigation v6 (Stack + Tab + Drawer)"
42
+ networking: "Axios"
43
+ forms: "React Hook Form + Zod"
44
+ storage: "MMKV or AsyncStorage"
45
+
46
+ testing:
47
+ unit: "Jest + React Native Testing Library"
48
+ e2e: "Detox or Maestro"
49
+ patterns:
50
+ - "Test by accessibility label or testID — never by style/className"
51
+ - "Mock native modules in jest setup"
52
+ - "Use renderWithProviders() with NavigationContainer + QueryClient"
53
+
54
+ trace_tags:
55
+ implements: "// @trace.implements={UC-ID}-SC{N}"
56
+ source: "// @trace.source=specs/bdd/{domain}/{UC-ID}.feature"
@@ -0,0 +1,14 @@
1
+ name: "Vue"
2
+ version: "1.0.0"
3
+ description: "Vue 3 SPA with Composition API, Pinia, and Vue Query"
4
+ language: "TypeScript"
5
+ framework: "Vue 3"
6
+ stack_type: "frontend"
7
+ default_layer_order:
8
+ - Types / interfaces
9
+ - API client (Vue Query / composables)
10
+ - State store (Pinia)
11
+ - Composables (business logic)
12
+ - UI components (presentational)
13
+ - Page / feature components (container)
14
+ test_framework: "Vitest + Vue Test Utils"
@@ -0,0 +1,65 @@
1
+ build:
2
+ compile: "npm run build"
3
+ test: "npm run test"
4
+ run: "npm run dev"
5
+ lint: "npm run lint"
6
+
7
+ architecture:
8
+ style: "Feature-based (components → composables → queries → store)"
9
+ key_rules:
10
+ - "Business logic lives in composables, not in component setup()"
11
+ - "Server state managed by Vue Query (@tanstack/vue-query)"
12
+ - "Client-only UI state managed by Pinia stores"
13
+ - "Components must be pure — no direct API calls inside <template> or setup()"
14
+ - "Shared UI primitives in components/ui/, feature logic in features/{name}/"
15
+ - "Never fetch data directly in a component — use a composable"
16
+ - "Props defined with defineProps<{}>(), emits with defineEmits<{}>()"
17
+ folder_structure: |
18
+ src/
19
+ ├── api/ ← axios instance, interceptors
20
+ ├── components/
21
+ │ └── ui/ ← reusable primitives (BaseButton, BaseInput...)
22
+ ├── features/
23
+ │ └── {domain}/
24
+ │ ├── components/ ← feature-specific UI
25
+ │ ├── composables/ ← useOrderList, useCreateOrder...
26
+ │ ├── queries/ ← Vue Query definitions
27
+ │ ├── store/ ← Pinia slice (if needed)
28
+ │ └── types.ts
29
+ ├── pages/ ← route-level page components (Vue Router)
30
+ ├── router/ ← route definitions
31
+ └── lib/ ← utilities, formatters, constants
32
+
33
+ coding_standards:
34
+ naming:
35
+ components: "PascalCase (e.g., OrderList, CreateOrderModal)"
36
+ composables: "camelCase with 'use' prefix (e.g., useOrderList, useCreateOrder)"
37
+ stores: "camelCase + Store suffix (e.g., useCartStore) — defined with defineStore()"
38
+ query_keys: "SCREAMING_SNAKE_CASE string/array (e.g., ['ORDER_LIST', customerId])"
39
+ files:
40
+ component: "{Feature}.vue"
41
+ composable: "use{Feature}.ts"
42
+ query: "{feature}.queries.ts"
43
+ store: "{feature}.store.ts"
44
+ types: "{feature}.types.ts"
45
+ patterns:
46
+ data_fetching: "Vue Query (TanStack Query v5 for Vue)"
47
+ global_state: "Pinia stores"
48
+ forms: "VeeValidate + Zod"
49
+ api_client: "Axios with interceptors for auth + error handling"
50
+ reactivity: "ref() for primitives, reactive() for objects, computed() for derived state"
51
+
52
+ testing:
53
+ unit: "Vitest + Vue Test Utils"
54
+ e2e: "Playwright or Cypress"
55
+ patterns:
56
+ - "Test behavior, not implementation — query by role/label via @testing-library/vue"
57
+ - "Mock Vue Query with VueQueryPlugin wrapper in test setup"
58
+ - "Use MSW (Mock Service Worker) to mock API calls in tests"
59
+ - "mountWithProviders() helper wraps component with Pinia + VueQuery + Router"
60
+
61
+ trace_tags:
62
+ implements: "// @trace.implements={UC-ID}-SC{N}"
63
+ source: "// @trace.source=specs/bdd/{domain}/{UC-ID}.feature"
64
+ verifies: "// @trace.verifies={UC-ID}"
65
+ test_type: "// @trace.test_type=unit|integration"
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@anhth2/spec-driven-dev-plugin",
3
- "version": "0.9.1",
3
+ "version": "0.9.2",
4
4
  "description": "AI-First Spec-Driven Development workflow plugin for Claude Code",
5
5
  "bin": {
6
6
  "spec-driven-dev": "./bin/index.js"
@@ -202,13 +202,14 @@ If `services` section is present:
202
202
  **4. Spec source auto-override** — if `setup.spec_source` is set AND the corresponding path was not already explicitly set in `paths:`:
203
203
  - Override `paths.prd_dir` → `{spec_source}/specs/prd`
204
204
  - Override `paths.design_spec_dir` → `{spec_source}/specs/design-spec`
205
+ - Override `paths.tech_docs_dir` → `{spec_source}/specs/tech-docs` — **only if step 2 did not already route it to a service** (multi-service umbrellas keep per-service tech-docs). This publishes the BE-authored API contract into the shared spec repo so FE/App can read it via the spec submodule at `/generate-code --phase=integration`.
205
206
  - Override `paths.domain_knowledge_dir` → `{spec_source}/specs/domain-knowledge`
206
207
  - Override `paths.business_dictionary` → `{spec_source}/specs/domain-knowledge/business-dictionary.md`
207
208
  - Override `paths.core_entities` → `{spec_source}/specs/domain-knowledge/core-entities.md`
208
209
  - Override `paths.bug_reports_dir` → `{spec_source}/feedback/bug-reports`
209
210
  - Override `paths.bdd_proposals_dir` → `{spec_source}/feedback/bdd-proposals`
210
211
 
211
- > **Why under `spec_source`:** tester feedback (`/report-bug`, `/propose-scenario`) must land in the **shared spec repo** so PO/Dev see it when they `/sync`. In single-service mode (no `spec_source`), these default to `feedback/bug-reports` and `feedback/bdd-proposals` at repo root — still shared, same repo.
212
+ > **Why under `spec_source`:** PRD, design-spec, domain knowledge, the **API contract (tech-docs)**, and tester feedback are all **cross-team artifacts** — they must live in the **shared spec repo** so every umbrella (FE/App/BE) reads the same source via `/sync`. Tech-docs specifically: BE authors the tech-design (API contract), commits + pushes it into the spec submodule (2-layer commit), and FE/App pull it on their next `/sync` to wire the real API in `/generate-code --phase=integration`. In single-service mode (no `spec_source`), these default under the repo root — still shared, same repo.
212
213
 
213
214
  ---
214
215
 
@@ -117,13 +117,14 @@ If `services` section is present:
117
117
  **4. Spec source auto-override** — if `setup.spec_source` is set AND the corresponding path was not already explicitly set in `paths:`:
118
118
  - Override `paths.prd_dir` → `{spec_source}/specs/prd`
119
119
  - Override `paths.design_spec_dir` → `{spec_source}/specs/design-spec`
120
+ - Override `paths.tech_docs_dir` → `{spec_source}/specs/tech-docs` — **only if step 2 did not already route it to a service** (multi-service umbrellas keep per-service tech-docs). This publishes the BE-authored API contract into the shared spec repo so FE/App can read it via the spec submodule at `/generate-code --phase=integration`.
120
121
  - Override `paths.domain_knowledge_dir` → `{spec_source}/specs/domain-knowledge`
121
122
  - Override `paths.business_dictionary` → `{spec_source}/specs/domain-knowledge/business-dictionary.md`
122
123
  - Override `paths.core_entities` → `{spec_source}/specs/domain-knowledge/core-entities.md`
123
124
  - Override `paths.bug_reports_dir` → `{spec_source}/feedback/bug-reports`
124
125
  - Override `paths.bdd_proposals_dir` → `{spec_source}/feedback/bdd-proposals`
125
126
 
126
- > **Why under `spec_source`:** tester feedback (`/report-bug`, `/propose-scenario`) must land in the **shared spec repo** so PO/Dev see it when they `/sync`. In single-service mode (no `spec_source`), these default to `feedback/bug-reports` and `feedback/bdd-proposals` at repo root — still shared, same repo.
127
+ > **Why under `spec_source`:** PRD, design-spec, domain knowledge, the **API contract (tech-docs)**, and tester feedback are all **cross-team artifacts** — they must live in the **shared spec repo** so every umbrella (FE/App/BE) reads the same source via `/sync`. Tech-docs specifically: BE authors the tech-design (API contract), commits + pushes it into the spec submodule (2-layer commit), and FE/App pull it on their next `/sync` to wire the real API in `/generate-code --phase=integration`. In single-service mode (no `spec_source`), these default under the repo root — still shared, same repo.
127
128
 
128
129
  ---
129
130
 
@@ -191,13 +191,14 @@ If `services` section is present:
191
191
  **4. Spec source auto-override** — if `setup.spec_source` is set AND the corresponding path was not already explicitly set in `paths:`:
192
192
  - Override `paths.prd_dir` → `{spec_source}/specs/prd`
193
193
  - Override `paths.design_spec_dir` → `{spec_source}/specs/design-spec`
194
+ - Override `paths.tech_docs_dir` → `{spec_source}/specs/tech-docs` — **only if step 2 did not already route it to a service** (multi-service umbrellas keep per-service tech-docs). This publishes the BE-authored API contract into the shared spec repo so FE/App can read it via the spec submodule at `/generate-code --phase=integration`.
194
195
  - Override `paths.domain_knowledge_dir` → `{spec_source}/specs/domain-knowledge`
195
196
  - Override `paths.business_dictionary` → `{spec_source}/specs/domain-knowledge/business-dictionary.md`
196
197
  - Override `paths.core_entities` → `{spec_source}/specs/domain-knowledge/core-entities.md`
197
198
  - Override `paths.bug_reports_dir` → `{spec_source}/feedback/bug-reports`
198
199
  - Override `paths.bdd_proposals_dir` → `{spec_source}/feedback/bdd-proposals`
199
200
 
200
- > **Why under `spec_source`:** tester feedback (`/report-bug`, `/propose-scenario`) must land in the **shared spec repo** so PO/Dev see it when they `/sync`. In single-service mode (no `spec_source`), these default to `feedback/bug-reports` and `feedback/bdd-proposals` at repo root — still shared, same repo.
201
+ > **Why under `spec_source`:** PRD, design-spec, domain knowledge, the **API contract (tech-docs)**, and tester feedback are all **cross-team artifacts** — they must live in the **shared spec repo** so every umbrella (FE/App/BE) reads the same source via `/sync`. Tech-docs specifically: BE authors the tech-design (API contract), commits + pushes it into the spec submodule (2-layer commit), and FE/App pull it on their next `/sync` to wire the real API in `/generate-code --phase=integration`. In single-service mode (no `spec_source`), these default under the repo root — still shared, same repo.
201
202
 
202
203
  ---
203
204
 
@@ -96,13 +96,14 @@ If `services` section is present:
96
96
  **4. Spec source auto-override** — if `setup.spec_source` is set AND the corresponding path was not already explicitly set in `paths:`:
97
97
  - Override `paths.prd_dir` → `{spec_source}/specs/prd`
98
98
  - Override `paths.design_spec_dir` → `{spec_source}/specs/design-spec`
99
+ - Override `paths.tech_docs_dir` → `{spec_source}/specs/tech-docs` — **only if step 2 did not already route it to a service** (multi-service umbrellas keep per-service tech-docs). This publishes the BE-authored API contract into the shared spec repo so FE/App can read it via the spec submodule at `/generate-code --phase=integration`.
99
100
  - Override `paths.domain_knowledge_dir` → `{spec_source}/specs/domain-knowledge`
100
101
  - Override `paths.business_dictionary` → `{spec_source}/specs/domain-knowledge/business-dictionary.md`
101
102
  - Override `paths.core_entities` → `{spec_source}/specs/domain-knowledge/core-entities.md`
102
103
  - Override `paths.bug_reports_dir` → `{spec_source}/feedback/bug-reports`
103
104
  - Override `paths.bdd_proposals_dir` → `{spec_source}/feedback/bdd-proposals`
104
105
 
105
- > **Why under `spec_source`:** tester feedback (`/report-bug`, `/propose-scenario`) must land in the **shared spec repo** so PO/Dev see it when they `/sync`. In single-service mode (no `spec_source`), these default to `feedback/bug-reports` and `feedback/bdd-proposals` at repo root — still shared, same repo.
106
+ > **Why under `spec_source`:** PRD, design-spec, domain knowledge, the **API contract (tech-docs)**, and tester feedback are all **cross-team artifacts** — they must live in the **shared spec repo** so every umbrella (FE/App/BE) reads the same source via `/sync`. Tech-docs specifically: BE authors the tech-design (API contract), commits + pushes it into the spec submodule (2-layer commit), and FE/App pull it on their next `/sync` to wire the real API in `/generate-code --phase=integration`. In single-service mode (no `spec_source`), these default under the repo root — still shared, same repo.
106
107
 
107
108
  ---
108
109
 
@@ -374,13 +374,14 @@ If `services` section is present:
374
374
  **4. Spec source auto-override** — if `setup.spec_source` is set AND the corresponding path was not already explicitly set in `paths:`:
375
375
  - Override `paths.prd_dir` → `{spec_source}/specs/prd`
376
376
  - Override `paths.design_spec_dir` → `{spec_source}/specs/design-spec`
377
+ - Override `paths.tech_docs_dir` → `{spec_source}/specs/tech-docs` — **only if step 2 did not already route it to a service** (multi-service umbrellas keep per-service tech-docs). This publishes the BE-authored API contract into the shared spec repo so FE/App can read it via the spec submodule at `/generate-code --phase=integration`.
377
378
  - Override `paths.domain_knowledge_dir` → `{spec_source}/specs/domain-knowledge`
378
379
  - Override `paths.business_dictionary` → `{spec_source}/specs/domain-knowledge/business-dictionary.md`
379
380
  - Override `paths.core_entities` → `{spec_source}/specs/domain-knowledge/core-entities.md`
380
381
  - Override `paths.bug_reports_dir` → `{spec_source}/feedback/bug-reports`
381
382
  - Override `paths.bdd_proposals_dir` → `{spec_source}/feedback/bdd-proposals`
382
383
 
383
- > **Why under `spec_source`:** tester feedback (`/report-bug`, `/propose-scenario`) must land in the **shared spec repo** so PO/Dev see it when they `/sync`. In single-service mode (no `spec_source`), these default to `feedback/bug-reports` and `feedback/bdd-proposals` at repo root — still shared, same repo.
384
+ > **Why under `spec_source`:** PRD, design-spec, domain knowledge, the **API contract (tech-docs)**, and tester feedback are all **cross-team artifacts** — they must live in the **shared spec repo** so every umbrella (FE/App/BE) reads the same source via `/sync`. Tech-docs specifically: BE authors the tech-design (API contract), commits + pushes it into the spec submodule (2-layer commit), and FE/App pull it on their next `/sync` to wire the real API in `/generate-code --phase=integration`. In single-service mode (no `spec_source`), these default under the repo root — still shared, same repo.
384
385
 
385
386
  ---
386
387
 
@@ -777,13 +778,14 @@ If `services` section is present:
777
778
  **4. Spec source auto-override** — if `setup.spec_source` is set AND the corresponding path was not already explicitly set in `paths:`:
778
779
  - Override `paths.prd_dir` → `{spec_source}/specs/prd`
779
780
  - Override `paths.design_spec_dir` → `{spec_source}/specs/design-spec`
781
+ - Override `paths.tech_docs_dir` → `{spec_source}/specs/tech-docs` — **only if step 2 did not already route it to a service** (multi-service umbrellas keep per-service tech-docs). This publishes the BE-authored API contract into the shared spec repo so FE/App can read it via the spec submodule at `/generate-code --phase=integration`.
780
782
  - Override `paths.domain_knowledge_dir` → `{spec_source}/specs/domain-knowledge`
781
783
  - Override `paths.business_dictionary` → `{spec_source}/specs/domain-knowledge/business-dictionary.md`
782
784
  - Override `paths.core_entities` → `{spec_source}/specs/domain-knowledge/core-entities.md`
783
785
  - Override `paths.bug_reports_dir` → `{spec_source}/feedback/bug-reports`
784
786
  - Override `paths.bdd_proposals_dir` → `{spec_source}/feedback/bdd-proposals`
785
787
 
786
- > **Why under `spec_source`:** tester feedback (`/report-bug`, `/propose-scenario`) must land in the **shared spec repo** so PO/Dev see it when they `/sync`. In single-service mode (no `spec_source`), these default to `feedback/bug-reports` and `feedback/bdd-proposals` at repo root — still shared, same repo.
788
+ > **Why under `spec_source`:** PRD, design-spec, domain knowledge, the **API contract (tech-docs)**, and tester feedback are all **cross-team artifacts** — they must live in the **shared spec repo** so every umbrella (FE/App/BE) reads the same source via `/sync`. Tech-docs specifically: BE authors the tech-design (API contract), commits + pushes it into the spec submodule (2-layer commit), and FE/App pull it on their next `/sync` to wire the real API in `/generate-code --phase=integration`. In single-service mode (no `spec_source`), these default under the repo root — still shared, same repo.
787
789
 
788
790
  ---
789
791
 
@@ -86,13 +86,14 @@ If `services` section is present:
86
86
  **4. Spec source auto-override** — if `setup.spec_source` is set AND the corresponding path was not already explicitly set in `paths:`:
87
87
  - Override `paths.prd_dir` → `{spec_source}/specs/prd`
88
88
  - Override `paths.design_spec_dir` → `{spec_source}/specs/design-spec`
89
+ - Override `paths.tech_docs_dir` → `{spec_source}/specs/tech-docs` — **only if step 2 did not already route it to a service** (multi-service umbrellas keep per-service tech-docs). This publishes the BE-authored API contract into the shared spec repo so FE/App can read it via the spec submodule at `/generate-code --phase=integration`.
89
90
  - Override `paths.domain_knowledge_dir` → `{spec_source}/specs/domain-knowledge`
90
91
  - Override `paths.business_dictionary` → `{spec_source}/specs/domain-knowledge/business-dictionary.md`
91
92
  - Override `paths.core_entities` → `{spec_source}/specs/domain-knowledge/core-entities.md`
92
93
  - Override `paths.bug_reports_dir` → `{spec_source}/feedback/bug-reports`
93
94
  - Override `paths.bdd_proposals_dir` → `{spec_source}/feedback/bdd-proposals`
94
95
 
95
- > **Why under `spec_source`:** tester feedback (`/report-bug`, `/propose-scenario`) must land in the **shared spec repo** so PO/Dev see it when they `/sync`. In single-service mode (no `spec_source`), these default to `feedback/bug-reports` and `feedback/bdd-proposals` at repo root — still shared, same repo.
96
+ > **Why under `spec_source`:** PRD, design-spec, domain knowledge, the **API contract (tech-docs)**, and tester feedback are all **cross-team artifacts** — they must live in the **shared spec repo** so every umbrella (FE/App/BE) reads the same source via `/sync`. Tech-docs specifically: BE authors the tech-design (API contract), commits + pushes it into the spec submodule (2-layer commit), and FE/App pull it on their next `/sync` to wire the real API in `/generate-code --phase=integration`. In single-service mode (no `spec_source`), these default under the repo root — still shared, same repo.
96
97
 
97
98
  ---
98
99
 
@@ -72,9 +72,9 @@
72
72
  - {Function 2}
73
73
 
74
74
  ### User Story
75
- As a {User role}
76
- I want to {User goal}
77
- So that {Business value}
75
+ - **As a** {User role}
76
+ - **I want to** {User goal}
77
+ - **So that** {Business value}
78
78
 
79
79
  ---
80
80
 
@@ -50,7 +50,9 @@ paths:
50
50
  # .agent/project-context.yaml to ".agent/project-lessons.md" (resolved per service_root).
51
51
  lessons_file: "specs/domain-knowledge/lessons-learned.md"
52
52
 
53
- # Tech Docs
53
+ # Tech Docs (BE-authored API contract).
54
+ # In umbrella mode with spec_source set, context-loader auto-routes this to
55
+ # {spec_source}/specs/tech-docs so FE/App read the contract via the spec submodule.
54
56
  tech_docs_dir: "tech-docs"
55
57
 
56
58
  # Design Specs (FE/App platforms only — web, app)
@@ -94,6 +96,7 @@ domains:
94
96
  # When spec_source is set, context-loader auto-derives:
95
97
  # prd_dir → {spec_source}/specs/prd
96
98
  # design_spec_dir → {spec_source}/specs/design-spec
99
+ # tech_docs_dir → {spec_source}/specs/tech-docs # shared API contract (per-service tech_docs_dir below wins in multi-service)
97
100
  # domain_knowledge_dir → {spec_source}/specs/domain-knowledge
98
101
  # (You can still override these manually in paths: section below.)
99
102
  #