Multi-Project Spec Mapper - Intelligent Project Organization
Purpose: Automatically detect multiple projects in SpecWeave setup, analyze user stories to map them to the correct project (FE, BE, MOBILE, INFRA), and organize specs into project-specific folders with proper JIRA/GitHub sync.
When to Use:
- User has multiple JIRA projects configured (e.g., FE, BE, MOBILE)
- User has multiple GitHub repos to sync
- Brownfield projects with multiple teams/services
- Microservices architecture with separate frontend/backend/mobile codebases
- Need to split monolithic spec into project-specific specs
Key Capabilities:
- ✅ Intelligent Project Detection - Analyze config.json to detect multi-project setup
- ✅ User Story Classification - Map user stories to projects based on keywords, tech stack, components
- ✅ Spec Splitting - Split monolithic specs into project-specific files
- ✅ Folder Organization - Create
specs/FE/, specs/BE/, specs/MOBILE/ structure
- ✅ JIRA Item Type Mapping - Suggest Epic/Story/Task hierarchy based on scope
- ✅ Bidirectional Sync - Configure hooks for GitHub/JIRA sync per project
How It Works
Step 1: Detect Multi-Project Setup
Check config.json for:
{
"sync": {
"profiles": {
"jira-default": {
"provider": "jira",
"config": {
"domain": "company.atlassian.net",
"projects": ["FE", "BE", "MOBILE"] // ← Multiple projects!
}
}
}
}
}
If multiple projects found → Activate multi-project mode
Step 2: Analyze User Stories
For each user story, analyze:
- Keywords: "UI", "chart", "API", "mobile", "database", "deployment"
- Tech Stack: "React", "Node.js", "React Native", "PostgreSQL", "Kubernetes"
- Components: "component", "service", "screen", "controller", "pipeline"
Example:
US-001: Log a Workout (Web UI)
→ Keywords: "UI", "web", "chart"
→ Tech: "React"
→ Project: FE (90% confidence)
US-002: View Workout History (API)
→ Keywords: "API", "endpoint", "database"
→ Tech: "Node.js", "PostgreSQL"
→ Project: BE (95% confidence)
US-005: Cross-Platform Data Sync (Mobile)
→ Keywords: "mobile", "offline", "sync"
→ Tech: "React Native"
→ Project: MOBILE (100% confidence)
Step 3: Create Project-Specific Specs
Folder Structure:
.specweave/docs/internal/specs/
├── FE/
│ ├── spec-0001-fitness-tracker-web.md
│ └── README.md
├── BE/
│ ├── spec-0001-fitness-tracker-api.md
│ └── README.md
├── MOBILE/
│ ├── spec-0001-fitness-tracker-mobile.md
│ └── README.md
└── SHARED/
├── spec-0001-fitness-tracker-shared.md (cross-cutting concerns)
└── README.md
spec.md YAML Frontmatter (MANDATORY):
# For 1-level structure (projects only)
---
increment: 0001-fitness-tracker-web
project: FE # REQUIRED
title: "Fitness Tracker Web UI"
status: planned
---
# For 2-level structure (projects + boards)
---
increment: 0001-fitness-tracker-web
project: acme-corp # REQUIRED
board: digital-operations # REQUIRED for 2-level
title: "Fitness Tracker Web UI"
status: planned
---
Detection: Use detectStructureLevel() from src/utils/structure-level-detector.ts
Each spec contains:
- YAML frontmatter with
project: (and board: for 2-level) fields - MANDATORY
- User stories mapped to that project
- Project-specific acceptance criteria
- Links to shared infrastructure/requirements
Step 4: JIRA Sync with Project Mapping
Hierarchical JIRA Structure:
JIRA Project: FE
├── Epic: Fitness Tracker Web UI (SPEC-0001)
│ ├── Story: US-001: Log a Workout
│ │ ├── Task: T-001: Create Workout Form Component
│ │ ├── Task: T-002: Implement Exercise Search
│ │ └── Task: T-003: Add Set Logging UI
│ └── Story: US-004: Track Progress with Charts
│ ├── Task: T-010: Integrate Recharts Library
│ └── Task: T-011: Create Chart Components
JIRA Project: BE
├── Epic: Fitness Tracker API Backend (SPEC-0001)
│ ├── Story: US-002: View Workout History (API)
│ │ ├── Task: T-004: Create GET /api/workouts Endpoint
│ │ ├── Task: T-005: Implement Filtering Logic
│ │ └── Task: T-006: Add Pagination
│ └── Story: US-003: Manage Exercise Library (API)
│ ├── Task: T-007: Create Exercise CRUD Endpoints
│ └── Task: T-008: Implement Search
JIRA Project: MOBILE
├── Epic: Fitness Tracker Mobile App (SPEC-0001)
└── Story: US-005: Cross-Platform Data Sync
├── Task: T-012: Implement Offline Mode (AsyncStorage)
├── Task: T-013: Create Sync Queue
└── Task: T-014: Handle Conflict Resolution
Step 5: Configure Bidirectional Sync
GitHub Hooks (.specweave/config.json):
{
"hooks": {
"post_task_completion": {
"sync_living_docs": true,
"external_tracker_sync": true
}
},
"sync": {
"enabled": true,
"activeProfile": "jira-default",
"settings": {
"autoCreateIssue": true,
"syncDirection": "bidirectional",
"projectMapping": {
"FE": {
"jiraProject": "FE",
"jiraBoards": [123],
"githubRepo": "company/frontend-web"
},
"BE": {
"jiraProject": "BE",
"jiraBoards": [456],
"githubRepo": "company/backend-api"
},
"MOBILE": {
"jiraProject": "MOBILE",
"jiraBoards": [789],
"githubRepo": "company/mobile-app"
}
}
}
}
}
Project Mapping Rules
Frontend (FE)
Keywords:
- UI/UX: button, form, input, page, view, screen, modal, dropdown
- Visualization: chart, graph, dashboard, widget
- Styling: CSS, theme, dark mode, responsive
- State: Redux, Zustand, context, state management
Tech Stack:
- React, Vue, Angular, Next.js, Svelte
- TypeScript, JavaScript
- Tailwind, Material-UI, Chakra, Ant Design
- Recharts, D3, Chart.js
Components:
- Component, hook, context, provider, page, layout
Confidence: 30%+ for primary match
Backend (BE)
Keywords:
- API: endpoint, REST, GraphQL, route
- Database: query, migration, schema, model
- Auth: authentication, JWT, session, token
- Processing: queue, job, worker, cron, batch
Tech Stack:
- Node.js (Express, Fastify, NestJS)
- Python (FastAPI, Django, Flask)
- Java (Spring Boot), .NET (ASP.NET)
- PostgreSQL, MySQL, MongoDB, Redis
Components:
- Controller, service, repository, middleware, handler
Confidence: 30%+ for primary match
Mobile (MOBILE)
Keywords:
- Mobile: native, iOS, Android, cross-platform
- Device: camera, GPS, push notification, offline
- Navigation: tab bar, drawer, stack, screen transition
- Storage: AsyncStorage, local database
Tech Stack:
- React Native, Expo, Flutter
- Swift, Kotlin
- React Navigation
Components:
- Screen, navigator, bottom-sheet, drawer
Exclude: "web" keyword (penalty)
Confidence: 30%+ for primary match
Infrastructure (INFRA)
Keywords:
- DevOps: deployment, CI/CD, Docker, Kubernetes
- Monitoring: logging, metrics, alerting, SLO
- Security: SSL, TLS, firewall, VPC
- Scalability: load balancing, CDN, backup
Tech Stack:
- AWS, Azure, GCP
- Kubernetes, Docker, Terraform
- Jenkins, GitHub Actions, GitLab CI
- Prometheus, Grafana, Datadog
Components:
- Pipeline, manifest, Helm chart, Terraform module
Confidence: 30%+ for primary match
JIRA Item Type Hierarchy
Epic (> 13 story points):
- Large feature area spanning multiple stories
- Example: "Fitness Tracker MVP" (29 story points total)
Story (3-13 story points):
- Standard user story with clear value
- Example: "US-001: Log a Workout" (8 story points)
Task (1-2 story points):
- Small implementation task
- Example: "T-001: Create Workout Form Component" (2 story points)
Subtask (< 1 story point):
- Granular work item
- Example: "Create POST /api/workouts endpoint" (0.5 story points)
Usage Examples
Example 1: Fitness Tracker (Multi-Project)
Input: Monolithic spec with 35 user stories
Detection:
✓ Multi-project setup detected:
- FE (Frontend Web)
- BE (Backend API)
- MOBILE (React Native)
Classification:
Analyzing 35 user stories...
✓ US-001: Log a Workout → FE (90% confidence: React, UI, chart)
✓ US-002: View Workout History → BE (95% confidence: API, database, query)
✓ US-004: Track Progress with Charts → FE (100% confidence: Recharts, visualization)
✓ US-005: Cross-Platform Data Sync → MOBILE (100% confidence: React Native, offline)
Project Distribution:
- FE: 12 user stories (34%)
- BE: 15 user stories (43%)
- MOBILE: 6 user stories (17%)
- SHARED: 2 user stories (6%)
Output:
Creating project-specific specs...
✓ specs/FE/spec-0001-fitness-tracker-web.md (12 user stories)
✓ specs/BE/spec-0001-fitness-tracker-api.md (15 user stories)
✓ specs/MOBILE/spec-0001-fitness-tracker-mobile.md (6 user stories)
✓ specs/SHARED/spec-0001-fitness-tracker-shared.md (2 user stories)
JIRA Sync Configuration:
✓ FE → JIRA Project FE (Board 123)
✓ BE → JIRA Project BE (Board 456)
✓ MOBILE → JIRA Project MOBILE (Board 789)
Example 2: Microservices E-Commerce
Input: Spec for multi-service platform
Detection:
✓ Multi-project setup detected:
- FRONTEND (Web storefront)
- PRODUCT-SVC (Product service)
- ORDER-SVC (Order service)
- PAYMENT-SVC (Payment service)
- INFRA (Kubernetes + monitoring)
Classification:
Analyzing 50 user stories...
✓ US-010: Product Catalog UI → FRONTEND (95%)
✓ US-011: Product Search API → PRODUCT-SVC (100%)
✓ US-020: Shopping Cart → ORDER-SVC (90%)
✓ US-030: Stripe Integration → PAYMENT-SVC (100%)
✓ US-040: Kubernetes Deployment → INFRA (100%)
Project Distribution:
- FRONTEND: 15 user stories
- PRODUCT-SVC: 12 user stories
- ORDER-SVC: 10 user stories
- PAYMENT-SVC: 8 user stories
- INFRA: 5 user stories
Configuration
Enable Multi-Project Mode in .specweave/config.json:
{
"multiProject": {
"enabled": true,
"autoDetect": true,
"customRules": {
"FE": {
"keywords": ["react", "ui", "chart"],
"techStack": ["react", "typescript", "recharts"],
"confidenceThreshold": 0.3
}
}
}
}
Related Skills
- spec-generator: Creates comprehensive specs (uses this skill for multi-project splitting)
- increment-planner: Plans increments (uses this skill to assign work to projects)
- jira-sync: Syncs to JIRA (uses project mappings from this skill)
- github-sync: Syncs to GitHub (uses project mappings from this skill)
Based on: Increment 0020-multi-project-intelligent-sync
1---2name: multi-project-spec-mapper3description: Intelligent multi-project specification splitting that maps user stories to correct projects (FE, BE, MOBILE, INFRA). Use when working with multiple JIRA/GitHub projects, microservices architecture, or brownfield projects with multiple teams. Analyzes content and tech stack for automatic classification.4---5
6# Multi-Project Spec Mapper - Intelligent Project Organization
7
8**Purpose**: Automatically detect multiple projects in SpecWeave setup, analyze user stories to map them to the correct project (FE, BE, MOBILE, INFRA), and organize specs into project-specific folders with proper JIRA/GitHub sync.
9
10**When to Use**:
11- User has multiple JIRA projects configured (e.g., FE, BE, MOBILE)
12- User has multiple GitHub repos to sync
13- Brownfield projects with multiple teams/services
14- Microservices architecture with separate frontend/backend/mobile codebases
15- Need to split monolithic spec into project-specific specs
16
17**Key Capabilities**:
181. ✅ **Intelligent Project Detection** - Analyze config.json to detect multi-project setup
192. ✅ **User Story Classification** - Map user stories to projects based on keywords, tech stack, components
203. ✅ **Spec Splitting** - Split monolithic specs into project-specific files
214. ✅ **Folder Organization** - Create `specs/FE/`, `specs/BE/`, `specs/MOBILE/` structure
225. ✅ **JIRA Item Type Mapping** - Suggest Epic/Story/Task hierarchy based on scope
236. ✅ **Bidirectional Sync** - Configure hooks for GitHub/JIRA sync per project
24
25---
26
27## How It Works
28
29### Step 1: Detect Multi-Project Setup
30
31**Check config.json** for:
32```json
33{
34 "sync": {
35 "profiles": {
36 "jira-default": {
37 "provider": "jira",
38 "config": {
39 "domain": "company.atlassian.net",
40 "projects": ["FE", "BE", "MOBILE"] // ← Multiple projects!
41 }
42 }
43 }
44 }
45}
46```
47
48**If multiple projects found** → Activate multi-project mode
49
50---
51
52### Step 2: Analyze User Stories
53
54For each user story, analyze:
55- **Keywords**: "UI", "chart", "API", "mobile", "database", "deployment"
56- **Tech Stack**: "React", "Node.js", "React Native", "PostgreSQL", "Kubernetes"
57- **Components**: "component", "service", "screen", "controller", "pipeline"
58
59**Example**:
60```
61US-001: Log a Workout (Web UI)
62→ Keywords: "UI", "web", "chart"
63→ Tech: "React"
64→ Project: FE (90% confidence)
65
66US-002: View Workout History (API)
67→ Keywords: "API", "endpoint", "database"
68→ Tech: "Node.js", "PostgreSQL"
69→ Project: BE (95% confidence)
70
71US-005: Cross-Platform Data Sync (Mobile)
72→ Keywords: "mobile", "offline", "sync"
73→ Tech: "React Native"
74→ Project: MOBILE (100% confidence)
75```
76
77---
78
79### Step 3: Create Project-Specific Specs
80
81**Folder Structure**:
82```
83.specweave/docs/internal/specs/
84├── FE/
85│ ├── spec-0001-fitness-tracker-web.md
86│ └── README.md
87├── BE/
88│ ├── spec-0001-fitness-tracker-api.md
89│ └── README.md
90├── MOBILE/
91│ ├── spec-0001-fitness-tracker-mobile.md
92│ └── README.md
93└── SHARED/
94 ├── spec-0001-fitness-tracker-shared.md (cross-cutting concerns)
95 └── README.md
96```
97
98**spec.md YAML Frontmatter (MANDATORY)**:
99
100```yaml
101# For 1-level structure (projects only)
102---
103increment: 0001-fitness-tracker-web
104project: FE # REQUIRED
105title: "Fitness Tracker Web UI"
106status: planned
107---
108
109# For 2-level structure (projects + boards)
110---
111increment: 0001-fitness-tracker-web
112project: acme-corp # REQUIRED
113board: digital-operations # REQUIRED for 2-level
114title: "Fitness Tracker Web UI"
115status: planned
116---
117```
118
119**Detection**: Use `detectStructureLevel()` from `src/utils/structure-level-detector.ts`
120
121**Each spec contains**:
122- YAML frontmatter with `project:` (and `board:` for 2-level) fields - MANDATORY
123- User stories mapped to that project
124- Project-specific acceptance criteria
125- Links to shared infrastructure/requirements
126
127---
128
129### Step 4: JIRA Sync with Project Mapping
130
131**Hierarchical JIRA Structure**:
132```
133JIRA Project: FE
134├── Epic: Fitness Tracker Web UI (SPEC-0001)
135│ ├── Story: US-001: Log a Workout
136│ │ ├── Task: T-001: Create Workout Form Component
137│ │ ├── Task: T-002: Implement Exercise Search
138│ │ └── Task: T-003: Add Set Logging UI
139│ └── Story: US-004: Track Progress with Charts
140│ ├── Task: T-010: Integrate Recharts Library
141│ └── Task: T-011: Create Chart Components
142
143JIRA Project: BE
144├── Epic: Fitness Tracker API Backend (SPEC-0001)
145│ ├── Story: US-002: View Workout History (API)
146│ │ ├── Task: T-004: Create GET /api/workouts Endpoint
147│ │ ├── Task: T-005: Implement Filtering Logic
148│ │ └── Task: T-006: Add Pagination
149│ └── Story: US-003: Manage Exercise Library (API)
150│ ├── Task: T-007: Create Exercise CRUD Endpoints
151│ └── Task: T-008: Implement Search
152
153JIRA Project: MOBILE
154├── Epic: Fitness Tracker Mobile App (SPEC-0001)
155 └── Story: US-005: Cross-Platform Data Sync
156 ├── Task: T-012: Implement Offline Mode (AsyncStorage)
157 ├── Task: T-013: Create Sync Queue
158 └── Task: T-014: Handle Conflict Resolution
159```
160
161---
162
163### Step 5: Configure Bidirectional Sync
164
165**GitHub Hooks** (`.specweave/config.json`):
166```json
167{
168 "hooks": {
169 "post_task_completion": {
170 "sync_living_docs": true,
171 "external_tracker_sync": true
172 }
173 },
174 "sync": {
175 "enabled": true,
176 "activeProfile": "jira-default",
177 "settings": {
178 "autoCreateIssue": true,
179 "syncDirection": "bidirectional",
180 "projectMapping": {
181 "FE": {
182 "jiraProject": "FE",
183 "jiraBoards": [123],
184 "githubRepo": "company/frontend-web"
185 },
186 "BE": {
187 "jiraProject": "BE",
188 "jiraBoards": [456],
189 "githubRepo": "company/backend-api"
190 },
191 "MOBILE": {
192 "jiraProject": "MOBILE",
193 "jiraBoards": [789],
194 "githubRepo": "company/mobile-app"
195 }
196 }
197 }
198 }
199}
200```
201
202---
203
204## Project Mapping Rules
205
206### Frontend (FE)
207
208**Keywords**:
209- UI/UX: button, form, input, page, view, screen, modal, dropdown
210- Visualization: chart, graph, dashboard, widget
211- Styling: CSS, theme, dark mode, responsive
212- State: Redux, Zustand, context, state management
213
214**Tech Stack**:
215- React, Vue, Angular, Next.js, Svelte
216- TypeScript, JavaScript
217- Tailwind, Material-UI, Chakra, Ant Design
218- Recharts, D3, Chart.js
219
220**Components**:
221- Component, hook, context, provider, page, layout
222
223**Confidence**: 30%+ for primary match
224
225---
226
227### Backend (BE)
228
229**Keywords**:
230- API: endpoint, REST, GraphQL, route
231- Database: query, migration, schema, model
232- Auth: authentication, JWT, session, token
233- Processing: queue, job, worker, cron, batch
234
235**Tech Stack**:
236- Node.js (Express, Fastify, NestJS)
237- Python (FastAPI, Django, Flask)
238- Java (Spring Boot), .NET (ASP.NET)
239- PostgreSQL, MySQL, MongoDB, Redis
240
241**Components**:
242- Controller, service, repository, middleware, handler
243
244**Confidence**: 30%+ for primary match
245
246---
247
248### Mobile (MOBILE)
249
250**Keywords**:
251- Mobile: native, iOS, Android, cross-platform
252- Device: camera, GPS, push notification, offline
253- Navigation: tab bar, drawer, stack, screen transition
254- Storage: AsyncStorage, local database
255
256**Tech Stack**:
257- React Native, Expo, Flutter
258- Swift, Kotlin
259- React Navigation
260
261**Components**:
262- Screen, navigator, bottom-sheet, drawer
263
264**Exclude**: "web" keyword (penalty)
265
266**Confidence**: 30%+ for primary match
267
268---
269
270### Infrastructure (INFRA)
271
272**Keywords**:
273- DevOps: deployment, CI/CD, Docker, Kubernetes
274- Monitoring: logging, metrics, alerting, SLO
275- Security: SSL, TLS, firewall, VPC
276- Scalability: load balancing, CDN, backup
277
278**Tech Stack**:
279- AWS, Azure, GCP
280- Kubernetes, Docker, Terraform
281- Jenkins, GitHub Actions, GitLab CI
282- Prometheus, Grafana, Datadog
283
284**Components**:
285- Pipeline, manifest, Helm chart, Terraform module
286
287**Confidence**: 30%+ for primary match
288
289---
290
291## JIRA Item Type Hierarchy
292
293**Epic** (> 13 story points):
294- Large feature area spanning multiple stories
295- Example: "Fitness Tracker MVP" (29 story points total)
296
297**Story** (3-13 story points):
298- Standard user story with clear value
299- Example: "US-001: Log a Workout" (8 story points)
300
301**Task** (1-2 story points):
302- Small implementation task
303- Example: "T-001: Create Workout Form Component" (2 story points)
304
305**Subtask** (< 1 story point):
306- Granular work item
307- Example: "Create POST /api/workouts endpoint" (0.5 story points)
308
309---
310
311## Usage Examples
312
313### Example 1: Fitness Tracker (Multi-Project)
314
315**Input**: Monolithic spec with 35 user stories
316
317**Detection**:
318```
319✓ Multi-project setup detected:
320 - FE (Frontend Web)
321 - BE (Backend API)
322 - MOBILE (React Native)
323```
324
325**Classification**:
326```
327Analyzing 35 user stories...
328✓ US-001: Log a Workout → FE (90% confidence: React, UI, chart)
329✓ US-002: View Workout History → BE (95% confidence: API, database, query)
330✓ US-004: Track Progress with Charts → FE (100% confidence: Recharts, visualization)
331✓ US-005: Cross-Platform Data Sync → MOBILE (100% confidence: React Native, offline)
332
333Project Distribution:
334- FE: 12 user stories (34%)
335- BE: 15 user stories (43%)
336- MOBILE: 6 user stories (17%)
337- SHARED: 2 user stories (6%)
338```
339
340**Output**:
341```
342Creating project-specific specs...
343✓ specs/FE/spec-0001-fitness-tracker-web.md (12 user stories)
344✓ specs/BE/spec-0001-fitness-tracker-api.md (15 user stories)
345✓ specs/MOBILE/spec-0001-fitness-tracker-mobile.md (6 user stories)
346✓ specs/SHARED/spec-0001-fitness-tracker-shared.md (2 user stories)
347
348JIRA Sync Configuration:
349✓ FE → JIRA Project FE (Board 123)
350✓ BE → JIRA Project BE (Board 456)
351✓ MOBILE → JIRA Project MOBILE (Board 789)
352```
353
354---
355
356### Example 2: Microservices E-Commerce
357
358**Input**: Spec for multi-service platform
359
360**Detection**:
361```
362✓ Multi-project setup detected:
363 - FRONTEND (Web storefront)
364 - PRODUCT-SVC (Product service)
365 - ORDER-SVC (Order service)
366 - PAYMENT-SVC (Payment service)
367 - INFRA (Kubernetes + monitoring)
368```
369
370**Classification**:
371```
372Analyzing 50 user stories...
373✓ US-010: Product Catalog UI → FRONTEND (95%)
374✓ US-011: Product Search API → PRODUCT-SVC (100%)
375✓ US-020: Shopping Cart → ORDER-SVC (90%)
376✓ US-030: Stripe Integration → PAYMENT-SVC (100%)
377✓ US-040: Kubernetes Deployment → INFRA (100%)
378
379Project Distribution:
380- FRONTEND: 15 user stories
381- PRODUCT-SVC: 12 user stories
382- ORDER-SVC: 10 user stories
383- PAYMENT-SVC: 8 user stories
384- INFRA: 5 user stories
385```
386
387---
388
389## Configuration
390
391**Enable Multi-Project Mode** in `.specweave/config.json`:
392```json
393{
394 "multiProject": {
395 "enabled": true,
396 "autoDetect": true,
397 "customRules": {
398 "FE": {
399 "keywords": ["react", "ui", "chart"],
400 "techStack": ["react", "typescript", "recharts"],
401 "confidenceThreshold": 0.3
402 }
403 }
404 }
405}
406```
407
408---
409
410## Related Skills
411
412- **spec-generator**: Creates comprehensive specs (uses this skill for multi-project splitting)
413- **increment-planner**: Plans increments (uses this skill to assign work to projects)
414- **jira-sync**: Syncs to JIRA (uses project mappings from this skill)
415- **github-sync**: Syncs to GitHub (uses project mappings from this skill)
416
417---
418
419---
420
421Based on: Increment 0020-multi-project-intelligent-sync