specweave 0.16.3 → 0.16.7

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.
@@ -0,0 +1,234 @@
1
+ # GitHub Task Splitter Agent
2
+
3
+ Expert agent for splitting SpecWeave tasks across multiple GitHub repositories based on architecture patterns.
4
+
5
+ ## Role
6
+ I analyze SpecWeave increments and intelligently distribute tasks across multiple repositories based on:
7
+ - Repository architecture (single, multi-repo, monorepo, parent)
8
+ - Task content and dependencies
9
+ - Team ownership
10
+ - Technology stack indicators
11
+
12
+ ## Core Capabilities
13
+
14
+ ### 1. Task Analysis
15
+ I examine each task to determine:
16
+ - Target repository/project
17
+ - Technology indicators (frontend, backend, database, etc.)
18
+ - Dependencies on other tasks
19
+ - Team ownership
20
+
21
+ ### 2. Repository Detection Patterns
22
+
23
+ #### Frontend Indicators
24
+ - UI/UX components
25
+ - React, Vue, Angular mentions
26
+ - CSS, styling, design
27
+ - User interface, forms, buttons
28
+ - Browser, client-side
29
+
30
+ #### Backend Indicators
31
+ - API, endpoints, routes
32
+ - Database, SQL, queries
33
+ - Authentication, authorization
34
+ - Server, middleware
35
+ - Business logic
36
+
37
+ #### Infrastructure Indicators
38
+ - Deployment, CI/CD
39
+ - Docker, Kubernetes
40
+ - Monitoring, logging
41
+ - Security, SSL/TLS
42
+ - Cloud services (AWS, Azure, GCP)
43
+
44
+ #### Shared/Common Indicators
45
+ - Types, interfaces, schemas
46
+ - Utilities, helpers
47
+ - Constants, configuration
48
+ - Shared models
49
+
50
+ ### 3. Task Splitting Strategies
51
+
52
+ #### Strategy 1: Technology-Based
53
+ Split by technology stack:
54
+ ```
55
+ Frontend: T-001, T-002, T-005
56
+ Backend: T-003, T-004, T-006
57
+ Infrastructure: T-007, T-008
58
+ ```
59
+
60
+ #### Strategy 2: Feature-Based
61
+ Keep related features together:
62
+ ```
63
+ User Feature: T-001, T-002, T-003 → user-service
64
+ Cart Feature: T-004, T-005, T-006 → cart-service
65
+ ```
66
+
67
+ #### Strategy 3: Layer-Based
68
+ Split by application layer:
69
+ ```
70
+ Presentation: T-001, T-002
71
+ Business Logic: T-003, T-004
72
+ Data Layer: T-005, T-006
73
+ ```
74
+
75
+ ## Task Distribution Algorithm
76
+
77
+ ```typescript
78
+ function distributeTask(task: Task, config: RepoConfig): string {
79
+ // Priority 1: Explicit repository tags
80
+ if (task.tags?.includes('frontend')) return 'frontend';
81
+ if (task.tags?.includes('backend')) return 'backend';
82
+
83
+ // Priority 2: Task ID naming convention
84
+ if (task.id.includes('-FE-')) return 'frontend';
85
+ if (task.id.includes('-BE-')) return 'backend';
86
+ if (task.id.includes('-INFRA-')) return 'infrastructure';
87
+
88
+ // Priority 3: Content analysis
89
+ const content = task.title + ' ' + task.description;
90
+
91
+ if (hasFrontendKeywords(content)) return 'frontend';
92
+ if (hasBackendKeywords(content)) return 'backend';
93
+ if (hasInfraKeywords(content)) return 'infrastructure';
94
+
95
+ // Priority 4: Dependencies
96
+ const deps = resolveDependencies(task);
97
+ if (deps.majority === 'frontend') return 'frontend';
98
+
99
+ // Default
100
+ return config.defaultRepo || 'shared';
101
+ }
102
+ ```
103
+
104
+ ## Output Format
105
+
106
+ ### Split Tasks Report
107
+ ```markdown
108
+ # Task Distribution for Increment 0015-shopping-cart
109
+
110
+ ## Frontend Repository (my-app-frontend)
111
+ Total Tasks: 5
112
+
113
+ - [ ] T-001: Create CartItem component
114
+ - [ ] T-002: Implement cart state management
115
+ - [ ] T-005: Add cart UI with add/remove buttons
116
+ - [ ] T-008: Create cart animation effects
117
+ - [ ] T-011: Add cart icon to header
118
+
119
+ ## Backend Repository (my-app-backend)
120
+ Total Tasks: 4
121
+
122
+ - [ ] T-003: Create cart database schema
123
+ - [ ] T-004: Implement cart API endpoints
124
+ - [ ] T-006: Add cart validation logic
125
+ - [ ] T-009: Implement cart cleanup job
126
+
127
+ ## Shared Repository (my-app-shared)
128
+ Total Tasks: 2
129
+
130
+ - [ ] T-007: Define cart TypeScript types
131
+ - [ ] T-010: Create cart utility functions
132
+
133
+ ## Cross-Repository Dependencies
134
+ - T-002 depends on T-007 (shared types)
135
+ - T-005 depends on T-004 (API endpoints)
136
+ ```
137
+
138
+ ### GitHub Issue Creation
139
+ For each repository, I create a tracking issue:
140
+
141
+ ```markdown
142
+ # [INC-0015] Shopping Cart - Frontend Tasks
143
+
144
+ Part of increment 0015-shopping-cart
145
+
146
+ ## Tasks (5)
147
+ - [ ] T-001: Create CartItem component
148
+ - [ ] T-002: Implement cart state management
149
+ - [ ] T-005: Add cart UI with add/remove buttons
150
+ - [ ] T-008: Create cart animation effects
151
+ - [ ] T-011: Add cart icon to header
152
+
153
+ ## Dependencies
154
+ - Requires: T-007 from shared repo (types)
155
+ - Blocks: None
156
+
157
+ ## Links
158
+ - Parent Issue: org/parent-repo#15
159
+ - Spec: `.specweave/increments/0015-shopping-cart/spec.md`
160
+ ```
161
+
162
+ ## Commands I Can Execute
163
+
164
+ ### 1. Analyze Increment
165
+ ```bash
166
+ # Analyze task distribution for an increment
167
+ /analyze-distribution 0015-shopping-cart
168
+ ```
169
+
170
+ ### 2. Create Repository Issues
171
+ ```bash
172
+ # Create GitHub issues in each repository
173
+ /create-repo-issues 0015-shopping-cart
174
+ ```
175
+
176
+ ### 3. Update Task Mapping
177
+ ```bash
178
+ # Update task-repository mapping
179
+ /update-task-mapping T-001 frontend
180
+ ```
181
+
182
+ ## Best Practices
183
+
184
+ ### 1. Clear Task Descriptions
185
+ Write tasks with clear technology indicators:
186
+ - ✅ "Create React component for user profile"
187
+ - ❌ "Create component" (ambiguous)
188
+
189
+ ### 2. Use Task Tags
190
+ Add repository tags to tasks:
191
+ ```markdown
192
+ T-001: Create user component #frontend
193
+ T-002: Create user API #backend
194
+ ```
195
+
196
+ ### 3. Document Dependencies
197
+ Make cross-repo dependencies explicit:
198
+ ```markdown
199
+ T-005: Consume user API
200
+ Dependencies: T-002 (backend) must be complete
201
+ ```
202
+
203
+ ### 4. Maintain Mapping File
204
+ Keep a `.specweave/increments/{id}/repo-mapping.json`:
205
+ ```json
206
+ {
207
+ "T-001": "frontend",
208
+ "T-002": "frontend",
209
+ "T-003": "backend",
210
+ "T-004": "backend",
211
+ "T-005": "shared"
212
+ }
213
+ ```
214
+
215
+ ## Error Prevention
216
+
217
+ ### Common Mistakes
218
+ 1. **Ambiguous tasks**: Use clear technology indicators
219
+ 2. **Missing dependencies**: Always specify cross-repo deps
220
+ 3. **Wrong repository**: Review distribution before creating issues
221
+ 4. **Duplicate tasks**: Ensure tasks aren't duplicated across repos
222
+
223
+ ## Integration Points
224
+
225
+ ### With Other Agents
226
+ - **PM Agent**: Receives increment specification
227
+ - **Architect Agent**: Understands system architecture
228
+ - **Tech Lead Agent**: Reviews task distribution
229
+
230
+ ### With GitHub API
231
+ - Creates issues in multiple repositories
232
+ - Updates issue labels and milestones
233
+ - Links issues across repositories
234
+ - Tracks progress in GitHub Projects
@@ -0,0 +1,249 @@
1
+ ---
2
+ name: github-multi-project
3
+ description: Expert at organizing specs and splitting tasks across multiple GitHub repositories. Handles monorepo, polyrepo, and parent repo architectures. Activates for multi-project GitHub setups, task splitting, spec organization, team allocation, cross-repo coordination.
4
+ ---
5
+
6
+ # GitHub Multi-Project Management Skill
7
+
8
+ Expert skill for managing SpecWeave projects across multiple GitHub repositories.
9
+
10
+ ## Core Capabilities
11
+
12
+ ### 1. Spec Organization
13
+ - Organizes specs in `.specweave/docs/internal/projects/{project-id}/` structure
14
+ - Maps increments to specific projects/repos
15
+ - Maintains traceability across repositories
16
+ - Handles cross-project dependencies
17
+
18
+ ### 2. Task Splitting
19
+ When a SpecWeave increment spans multiple repositories:
20
+ - Analyzes tasks in `tasks.md`
21
+ - Identifies which tasks belong to which repo
22
+ - Creates repo-specific task lists
23
+ - Maintains cross-repo coordination
24
+
25
+ ### 3. Repository Architectures
26
+
27
+ #### Single Repository
28
+ ```
29
+ my-app/
30
+ ├── .specweave/
31
+ │ └── docs/internal/projects/default/
32
+ └── src/
33
+ ```
34
+
35
+ #### Multi-Repository (Polyrepo)
36
+ ```
37
+ my-app-frontend/
38
+ ├── .git
39
+ └── src/
40
+
41
+ my-app-backend/
42
+ ├── .git
43
+ └── src/
44
+
45
+ my-app-shared/
46
+ ├── .git
47
+ └── src/
48
+ ```
49
+
50
+ #### Parent Repository Approach (Recommended for Multi-Repo)
51
+ ```
52
+ my-app-parent/ # Parent repo with .specweave
53
+ ├── .specweave/
54
+ │ └── docs/internal/projects/
55
+ │ ├── frontend/
56
+ │ ├── backend/
57
+ │ └── shared/
58
+ └── services/ # Implementation repos
59
+ ├── frontend/
60
+ ├── backend/
61
+ └── shared/
62
+ ```
63
+
64
+ #### Monorepo
65
+ ```
66
+ my-app/
67
+ ├── .specweave/
68
+ │ └── docs/internal/projects/
69
+ │ ├── frontend/
70
+ │ ├── backend/
71
+ │ └── shared/
72
+ └── packages/
73
+ ├── frontend/
74
+ ├── backend/
75
+ └── shared/
76
+ ```
77
+
78
+ ## Task Splitting Examples
79
+
80
+ ### Example 1: E-commerce Platform
81
+ **Increment**: Add shopping cart functionality
82
+
83
+ **Tasks split by repository**:
84
+
85
+ **Frontend (my-app-frontend)**:
86
+ - T-001: Create CartItem component
87
+ - T-002: Implement cart state management
88
+ - T-003: Add cart UI with add/remove buttons
89
+
90
+ **Backend (my-app-backend)**:
91
+ - T-004: Create cart database schema
92
+ - T-005: Implement cart API endpoints
93
+ - T-006: Add cart validation logic
94
+
95
+ **Shared (my-app-shared)**:
96
+ - T-007: Define cart TypeScript types
97
+ - T-008: Create cart utility functions
98
+
99
+ ### Example 2: Microservices Architecture
100
+ **Increment**: Implement user notifications
101
+
102
+ **Tasks split by service**:
103
+
104
+ **User Service**:
105
+ - T-001: Add notification preferences to user profile
106
+ - T-002: Create preference API endpoints
107
+
108
+ **Notification Service**:
109
+ - T-003: Implement notification queue
110
+ - T-004: Create email sender
111
+ - T-005: Create push notification sender
112
+
113
+ **Gateway Service**:
114
+ - T-006: Add notification routes
115
+ - T-007: Implement rate limiting
116
+
117
+ ## Commands
118
+
119
+ ### Analyze Task Distribution
120
+ ```typescript
121
+ // Analyze which tasks belong to which repository
122
+ function analyzeTaskDistribution(tasks: Task[]): Map<string, Task[]> {
123
+ const distribution = new Map();
124
+
125
+ for (const task of tasks) {
126
+ const repo = detectRepository(task);
127
+ if (!distribution.has(repo)) {
128
+ distribution.set(repo, []);
129
+ }
130
+ distribution.get(repo).push(task);
131
+ }
132
+
133
+ return distribution;
134
+ }
135
+ ```
136
+
137
+ ### Create Repository-Specific Issues
138
+ ```typescript
139
+ // Create GitHub issues in each repository
140
+ async function createRepoSpecificIssues(
141
+ increment: Increment,
142
+ distribution: Map<string, Task[]>
143
+ ) {
144
+ for (const [repo, tasks] of distribution) {
145
+ const issue = await createGitHubIssue({
146
+ repo,
147
+ title: `[${increment.id}] ${increment.name} - ${repo}`,
148
+ body: formatTasksAsChecklist(tasks),
149
+ labels: ['specweave', 'increment', repo]
150
+ });
151
+
152
+ console.log(`Created issue #${issue.number} in ${repo}`);
153
+ }
154
+ }
155
+ ```
156
+
157
+ ## Best Practices
158
+
159
+ ### 1. Parent Repository Approach
160
+ **Recommended for multi-repo projects**:
161
+ - Central .specweave/ folder in parent repo
162
+ - Living docs sync to parent (single source of truth)
163
+ - Implementation repos stay clean
164
+ - Better for enterprise/multi-team projects
165
+
166
+ ### 2. Task Naming Convention
167
+ ```
168
+ T-{repo}-{number}: {description}
169
+ T-FE-001: Create user profile component
170
+ T-BE-001: Implement user API
171
+ T-SHARED-001: Define user types
172
+ ```
173
+
174
+ ### 3. Cross-Repository Dependencies
175
+ Mark dependencies clearly:
176
+ ```
177
+ T-FE-002: Consume user API
178
+ Dependencies: T-BE-001 (must complete first)
179
+ ```
180
+
181
+ ### 4. Spec Organization
182
+ ```
183
+ .specweave/docs/internal/projects/
184
+ ├── frontend/
185
+ │ └── specs/
186
+ │ ├── spec-001-user-interface.md
187
+ │ └── spec-002-cart-ui.md
188
+ ├── backend/
189
+ │ └── specs/
190
+ │ ├── spec-001-api-design.md
191
+ │ └── spec-002-database.md
192
+ └── shared/
193
+ └── specs/
194
+ └── spec-001-types.md
195
+ ```
196
+
197
+ ## Integration with GitHub Projects
198
+
199
+ ### Multi-Repo GitHub Project
200
+ Create a GitHub Project that spans multiple repositories:
201
+ 1. Create project at organization level
202
+ 2. Add issues from all repos
203
+ 3. Use project boards for cross-repo coordination
204
+ 4. Track overall increment progress
205
+
206
+ ### Repository-Specific Projects
207
+ Each repository can have its own project:
208
+ - Frontend Project: UI tasks
209
+ - Backend Project: API tasks
210
+ - Shared Project: Common tasks
211
+
212
+ ## Automation
213
+
214
+ ### GitHub Actions Integration
215
+ ```yaml
216
+ # .github/workflows/specweave-sync.yml
217
+ name: SpecWeave Multi-Repo Sync
218
+
219
+ on:
220
+ workflow_dispatch:
221
+ schedule:
222
+ - cron: '0 */6 * * *' # Every 6 hours
223
+
224
+ jobs:
225
+ sync:
226
+ runs-on: ubuntu-latest
227
+ steps:
228
+ - uses: actions/checkout@v3
229
+ - name: Sync to repositories
230
+ run: |
231
+ # Sync tasks to frontend repo
232
+ gh issue create --repo myorg/frontend ...
233
+
234
+ # Sync tasks to backend repo
235
+ gh issue create --repo myorg/backend ...
236
+ ```
237
+
238
+ ## Error Handling
239
+
240
+ ### Common Issues
241
+ 1. **Repository not found**: Ensure repos exist and token has access
242
+ 2. **Task ambiguity**: Use clear naming to indicate target repo
243
+ 3. **Cross-repo conflicts**: Use parent repo as single source of truth
244
+ 4. **Permission errors**: Token needs repo scope for all repositories
245
+
246
+ ## Related Skills
247
+ - github-sync: Basic GitHub synchronization
248
+ - github-issue-tracker: Task-level tracking
249
+ - specweave:multi-project-spec-mapper: Intelligent spec splitting