specweave 0.7.1 → 0.8.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CLAUDE.md +307 -11
- package/README.md +41 -3
- package/dist/cli/commands/import-docs.d.ts +21 -0
- package/dist/cli/commands/import-docs.d.ts.map +1 -0
- package/dist/cli/commands/import-docs.js +146 -0
- package/dist/cli/commands/import-docs.js.map +1 -0
- package/dist/cli/commands/init-multiproject.d.ts +11 -0
- package/dist/cli/commands/init-multiproject.d.ts.map +1 -0
- package/dist/cli/commands/init-multiproject.js +202 -0
- package/dist/cli/commands/init-multiproject.js.map +1 -0
- package/dist/cli/commands/init.js +3 -3
- package/dist/cli/commands/init.js.map +1 -1
- package/dist/cli/commands/migrate-to-multiproject.d.ts +37 -0
- package/dist/cli/commands/migrate-to-multiproject.d.ts.map +1 -0
- package/dist/cli/commands/migrate-to-multiproject.js +189 -0
- package/dist/cli/commands/migrate-to-multiproject.js.map +1 -0
- package/dist/cli/commands/migrate-to-profiles.d.ts +25 -0
- package/dist/cli/commands/migrate-to-profiles.d.ts.map +1 -0
- package/dist/cli/commands/migrate-to-profiles.js +350 -0
- package/dist/cli/commands/migrate-to-profiles.js.map +1 -0
- package/dist/cli/commands/switch-project.d.ts +13 -0
- package/dist/cli/commands/switch-project.d.ts.map +1 -0
- package/dist/cli/commands/switch-project.js +91 -0
- package/dist/cli/commands/switch-project.js.map +1 -0
- package/dist/cli/helpers/issue-tracker/index.js +4 -4
- package/dist/cli/helpers/issue-tracker/index.js.map +1 -1
- package/dist/cli/helpers/issue-tracker/utils.d.ts +6 -3
- package/dist/cli/helpers/issue-tracker/utils.d.ts.map +1 -1
- package/dist/cli/helpers/issue-tracker/utils.js +9 -7
- package/dist/cli/helpers/issue-tracker/utils.js.map +1 -1
- package/dist/core/brownfield/analyzer.d.ts +86 -0
- package/dist/core/brownfield/analyzer.d.ts.map +1 -0
- package/dist/core/brownfield/analyzer.js +365 -0
- package/dist/core/brownfield/analyzer.js.map +1 -0
- package/dist/core/brownfield/importer.d.ts +76 -0
- package/dist/core/brownfield/importer.d.ts.map +1 -0
- package/dist/core/brownfield/importer.js +287 -0
- package/dist/core/brownfield/importer.js.map +1 -0
- package/dist/core/config-manager.d.ts +47 -0
- package/dist/core/config-manager.d.ts.map +1 -0
- package/dist/core/config-manager.js +136 -0
- package/dist/core/config-manager.js.map +1 -0
- package/dist/core/project-manager.d.ts +127 -0
- package/dist/core/project-manager.d.ts.map +1 -0
- package/dist/core/project-manager.js +524 -0
- package/dist/core/project-manager.js.map +1 -0
- package/dist/core/sync/profile-manager.d.ts +72 -0
- package/dist/core/sync/profile-manager.d.ts.map +1 -0
- package/dist/core/sync/profile-manager.js +338 -0
- package/dist/core/sync/profile-manager.js.map +1 -0
- package/dist/core/sync/profile-selector.d.ts +52 -0
- package/dist/core/sync/profile-selector.d.ts.map +1 -0
- package/dist/core/sync/profile-selector.js +179 -0
- package/dist/core/sync/profile-selector.js.map +1 -0
- package/dist/core/sync/project-context.d.ts +81 -0
- package/dist/core/sync/project-context.d.ts.map +1 -0
- package/dist/core/sync/project-context.js +354 -0
- package/dist/core/sync/project-context.js.map +1 -0
- package/dist/core/sync/rate-limiter.d.ts +116 -0
- package/dist/core/sync/rate-limiter.d.ts.map +1 -0
- package/dist/core/sync/rate-limiter.js +308 -0
- package/dist/core/sync/rate-limiter.js.map +1 -0
- package/dist/core/sync/time-range-selector.d.ts +48 -0
- package/dist/core/sync/time-range-selector.d.ts.map +1 -0
- package/dist/core/sync/time-range-selector.js +224 -0
- package/dist/core/sync/time-range-selector.js.map +1 -0
- package/dist/core/types/config.d.ts +4 -0
- package/dist/core/types/config.d.ts.map +1 -1
- package/dist/core/types/config.js.map +1 -1
- package/dist/core/types/sync-profile.d.ts +205 -0
- package/dist/core/types/sync-profile.d.ts.map +1 -0
- package/dist/core/types/sync-profile.js +8 -0
- package/dist/core/types/sync-profile.js.map +1 -0
- package/dist/utils/project-detection.d.ts +141 -0
- package/dist/utils/project-detection.d.ts.map +1 -0
- package/dist/utils/project-detection.js +321 -0
- package/dist/utils/project-detection.js.map +1 -0
- package/package.json +2 -1
- package/plugins/specweave/agents/pm/AGENT.md +7 -4
- package/plugins/specweave/commands/specweave-abandon.md +17 -17
- package/plugins/specweave/commands/specweave-check-tests.md +14 -14
- package/plugins/specweave/commands/specweave-costs.md +1 -1
- package/plugins/specweave/commands/specweave-do.md +12 -12
- package/plugins/specweave/commands/specweave-done.md +28 -15
- package/plugins/specweave/commands/specweave-import-docs.md +212 -0
- package/plugins/specweave/commands/specweave-increment.md +10 -10
- package/plugins/specweave/commands/specweave-init-multiproject.md +146 -0
- package/plugins/specweave/commands/specweave-next.md +16 -16
- package/plugins/specweave/commands/specweave-pause.md +17 -17
- package/plugins/specweave/commands/specweave-progress.md +10 -10
- package/plugins/specweave/commands/specweave-qa.md +11 -11
- package/plugins/specweave/commands/specweave-resume.md +22 -22
- package/plugins/specweave/commands/specweave-status.md +18 -18
- package/plugins/specweave/commands/specweave-switch-project.md +168 -0
- package/plugins/specweave/commands/specweave-sync-docs.md +1 -1
- package/plugins/specweave/commands/specweave-sync-tasks.md +9 -9
- package/plugins/specweave/commands/specweave-tdd-cycle.md +7 -0
- package/plugins/specweave/commands/specweave-tdd-green.md +7 -0
- package/plugins/specweave/commands/specweave-tdd-red.md +7 -0
- package/plugins/specweave/commands/specweave-tdd-refactor.md +7 -0
- package/plugins/specweave/commands/specweave-translate.md +1 -1
- package/plugins/specweave/commands/specweave-update-scope.md +8 -8
- package/plugins/specweave/commands/specweave-validate.md +18 -20
- package/plugins/specweave/commands/specweave.md +5 -5
- package/plugins/specweave/skills/SKILLS-INDEX.md +1 -1
- package/plugins/specweave/skills/increment-planner/SKILL.md +40 -4
- package/plugins/specweave/skills/increment-quality-judge/SKILL.md +5 -5
- package/plugins/specweave/skills/increment-quality-judge-v2/SKILL.md +5 -5
- package/plugins/specweave/skills/specweave-detector/SKILL.md +3 -3
- package/plugins/specweave-ado/commands/{close-workitem.md → specweave-ado-close-workitem.md} +1 -1
- package/plugins/specweave-ado/commands/{create-workitem.md → specweave-ado-create-workitem.md} +1 -1
- package/plugins/specweave-ado/commands/{status.md → specweave-ado-status.md} +1 -1
- package/plugins/specweave-ado/commands/{sync.md → specweave-ado-sync.md} +1 -1
- package/plugins/specweave-ado/lib/ado-client-v2.ts +547 -0
- package/plugins/specweave-github/commands/{close-issue.md → specweave-github-close-issue.md} +1 -1
- package/plugins/specweave-github/commands/{create-issue.md → specweave-github-create-issue.md} +1 -1
- package/plugins/specweave-github/commands/{status.md → specweave-github-status.md} +1 -1
- package/plugins/specweave-github/commands/{sync-tasks.md → specweave-github-sync-tasks.md} +1 -1
- package/plugins/specweave-github/commands/specweave-github-sync.md +568 -0
- package/plugins/specweave-github/lib/github-client-v2.ts +555 -0
- package/plugins/specweave-infrastructure/commands/{monitor-setup.md → specweave-infrastructure-monitor-setup.md} +1 -1
- package/plugins/specweave-infrastructure/commands/{slo-implement.md → specweave-infrastructure-slo-implement.md} +1 -1
- package/plugins/specweave-jira/commands/{sync.md → specweave-jira-sync.md} +1 -1
- package/plugins/specweave-jira/lib/jira-client-v2.ts +529 -0
- package/plugins/specweave-ml/commands/{ml-deploy.md → specweave-ml-deploy.md} +1 -1
- package/plugins/specweave-ml/commands/{ml-evaluate.md → specweave-ml-evaluate.md} +1 -1
- package/plugins/specweave-ml/commands/{ml-explain.md → specweave-ml-explain.md} +1 -1
- package/plugins/specweave-ml/commands/{ml-pipeline.md → specweave-ml-pipeline.md} +1 -1
- package/src/templates/AGENTS.md.template +1 -0
- package/src/templates/CLAUDE.md.template +1 -0
- package/plugins/specweave-github/commands/sync.md +0 -443
- /package/plugins/specweave/{commands/README.md → COMMANDS.md} +0 -0
|
@@ -0,0 +1,568 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: specweave-github:sync
|
|
3
|
+
description: Synchronize SpecWeave increment with GitHub issue (Multi-Project Support). Select profile, configure time range, and sync with rate limit protection.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Sync Increment with GitHub Issue (Multi-Project)
|
|
7
|
+
|
|
8
|
+
Synchronize the current state of a SpecWeave increment with its GitHub issue across multiple repositories. Supports multi-profile management, time range filtering, and rate limit protection.
|
|
9
|
+
|
|
10
|
+
## Usage
|
|
11
|
+
|
|
12
|
+
```bash
|
|
13
|
+
/specweave-github:sync <increment-id> [options]
|
|
14
|
+
```
|
|
15
|
+
|
|
16
|
+
## Arguments
|
|
17
|
+
|
|
18
|
+
- `increment-id`: Increment ID (e.g., `0004` or `0004-plugin-architecture`)
|
|
19
|
+
|
|
20
|
+
## Options
|
|
21
|
+
|
|
22
|
+
### Sync Options
|
|
23
|
+
- `--profile <id>`: Use specific sync profile (skip selection prompt)
|
|
24
|
+
- `--time-range <preset>`: Time range for sync (`1W`, `2W`, `1M`, `3M`, `6M`, `1Y`, `ALL`)
|
|
25
|
+
- `--tasks`: Update task checklist in issue body
|
|
26
|
+
- `--comment`: Post progress comment (default)
|
|
27
|
+
- `--labels`: Update issue labels based on status
|
|
28
|
+
- `--force`: Force sync even if up-to-date
|
|
29
|
+
- `--direction`: Sync direction (`to-github`, `from-github`, `bidirectional`)
|
|
30
|
+
- `--all`: Sync all active increments
|
|
31
|
+
|
|
32
|
+
### Safety Options
|
|
33
|
+
- `--dry-run`: Preview changes without applying
|
|
34
|
+
- `--skip-rate-check`: Skip rate limit validation (not recommended)
|
|
35
|
+
|
|
36
|
+
## Examples
|
|
37
|
+
|
|
38
|
+
```bash
|
|
39
|
+
# Interactive sync (select profile + time range)
|
|
40
|
+
/specweave-github:sync 0004
|
|
41
|
+
|
|
42
|
+
# Use specific profile
|
|
43
|
+
/specweave-github:sync 0004 --profile specweave-dev
|
|
44
|
+
|
|
45
|
+
# Specify time range
|
|
46
|
+
/specweave-github:sync 0004 --time-range 1M
|
|
47
|
+
|
|
48
|
+
# Full sync with all options
|
|
49
|
+
/specweave-github:sync 0004 --profile main --time-range 1M --tasks --labels
|
|
50
|
+
|
|
51
|
+
# Dry run to preview changes
|
|
52
|
+
/specweave-github:sync 0004 --dry-run
|
|
53
|
+
|
|
54
|
+
# Force sync all increments
|
|
55
|
+
/specweave-github:sync --all --force
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
## Interactive Workflow
|
|
59
|
+
|
|
60
|
+
### Step 1: Profile Selection
|
|
61
|
+
|
|
62
|
+
If multiple GitHub profiles exist, you'll be prompted to select one:
|
|
63
|
+
|
|
64
|
+
```
|
|
65
|
+
🔗 Select GitHub Profile
|
|
66
|
+
|
|
67
|
+
Available profiles:
|
|
68
|
+
|
|
69
|
+
1. specweave-dev
|
|
70
|
+
└─ 🐙 GitHub: anton-abyzov/specweave
|
|
71
|
+
└─ Main SpecWeave repository
|
|
72
|
+
└─ Default time range: 1 month (max: 6 months)
|
|
73
|
+
|
|
74
|
+
2. another-repo
|
|
75
|
+
└─ 🐙 GitHub: myorg/another-project
|
|
76
|
+
└─ Another project repository
|
|
77
|
+
└─ Default time range: 1 month (max: 6 months)
|
|
78
|
+
|
|
79
|
+
3. ✨ Create new profile
|
|
80
|
+
|
|
81
|
+
Your choice: [1]
|
|
82
|
+
```
|
|
83
|
+
|
|
84
|
+
### Step 2: Time Range Selection
|
|
85
|
+
|
|
86
|
+
Choose how far back to fetch GitHub data:
|
|
87
|
+
|
|
88
|
+
```
|
|
89
|
+
📅 Select Time Range for Sync
|
|
90
|
+
|
|
91
|
+
⚠️ IMPORTANT: Time range affects sync performance and rate limits
|
|
92
|
+
|
|
93
|
+
📅 GitHub Rate Limits:
|
|
94
|
+
• Limit: 5,000 requests per 1h
|
|
95
|
+
• Current: 4,850/5,000 (97% available)
|
|
96
|
+
• Resets: 3:00:00 PM (25 min)
|
|
97
|
+
|
|
98
|
+
Select time range:
|
|
99
|
+
|
|
100
|
+
1. Last 1 week
|
|
101
|
+
└─ ~50 items | 75 API calls | ⚡ 30 sec | Rate: LOW (1.5%)
|
|
102
|
+
|
|
103
|
+
2. Last 2 weeks
|
|
104
|
+
└─ ~100 items | 150 API calls | ⚡ 1 min | Rate: LOW (3%)
|
|
105
|
+
|
|
106
|
+
3. Last 1 month ← Recommended
|
|
107
|
+
└─ ~200 items | 300 API calls | ⚡ 2 min | Rate: LOW (6%)
|
|
108
|
+
|
|
109
|
+
4. Last 3 months
|
|
110
|
+
└─ ~600 items | 900 API calls | ⚠️ 5 min | Rate: MEDIUM (18%)
|
|
111
|
+
|
|
112
|
+
5. Last 6 months
|
|
113
|
+
└─ ~1,200 items | 1,800 API calls | ⚠️ 10 min | Rate: HIGH (36%)
|
|
114
|
+
|
|
115
|
+
6. All time
|
|
116
|
+
└─ ~5,000 items | 7,500 API calls | ❌ 30+ min | Rate: CRITICAL (150%)
|
|
117
|
+
└─ ⚠️ WARNING: Will exceed rate limit! Not recommended.
|
|
118
|
+
|
|
119
|
+
Your choice: [3]
|
|
120
|
+
```
|
|
121
|
+
|
|
122
|
+
### Step 3: Sync Preview
|
|
123
|
+
|
|
124
|
+
Before executing, you'll see a preview:
|
|
125
|
+
|
|
126
|
+
```
|
|
127
|
+
📊 Sync Preview:
|
|
128
|
+
|
|
129
|
+
Profile: specweave-dev (GitHub)
|
|
130
|
+
└─ Repository: anton-abyzov/specweave
|
|
131
|
+
└─ Time range: Last 1 month (2025-10-04 to 2025-11-04)
|
|
132
|
+
|
|
133
|
+
Estimated sync:
|
|
134
|
+
├─ Work items: ~187 issues/PRs
|
|
135
|
+
├─ API calls: ~280 requests
|
|
136
|
+
├─ Duration: ~2 minutes
|
|
137
|
+
└─ Rate limit: Low impact (5.6% of hourly limit)
|
|
138
|
+
|
|
139
|
+
GitHub rate limit (BEFORE sync):
|
|
140
|
+
├─ Current: 4,850/5,000 (97% available)
|
|
141
|
+
├─ After sync: ~4,570/5,000 (91% available)
|
|
142
|
+
└─ Reset: 3:00:00 PM (25 min)
|
|
143
|
+
|
|
144
|
+
✅ This sync is SAFE to proceed
|
|
145
|
+
|
|
146
|
+
Continue with sync? [Y/n]:
|
|
147
|
+
```
|
|
148
|
+
|
|
149
|
+
### Step 4: Execution
|
|
150
|
+
|
|
151
|
+
If confirmed, sync proceeds with progress updates:
|
|
152
|
+
|
|
153
|
+
```
|
|
154
|
+
🔄 Syncing increment 0004 to GitHub...
|
|
155
|
+
|
|
156
|
+
✓ Profile loaded: specweave-dev
|
|
157
|
+
✓ GitHub repository: anton-abyzov/specweave
|
|
158
|
+
✓ Rate limit check: PASSED (4,850/5,000 remaining)
|
|
159
|
+
|
|
160
|
+
Fetching increment state...
|
|
161
|
+
✓ Increment loaded: 0004-plugin-architecture
|
|
162
|
+
✓ GitHub issue: #130
|
|
163
|
+
✓ Last synced: 30 minutes ago
|
|
164
|
+
|
|
165
|
+
Detecting changes...
|
|
166
|
+
✓ 3 new tasks completed (T-005, T-006, T-007)
|
|
167
|
+
✓ Progress: 4/48 → 7/48 (15%)
|
|
168
|
+
✓ Current task: T-008
|
|
169
|
+
|
|
170
|
+
Syncing to GitHub...
|
|
171
|
+
✓ Posted progress comment (ID: 1234567)
|
|
172
|
+
✓ Updated task checklist (7 tasks marked complete)
|
|
173
|
+
✓ Updated labels: +in-progress
|
|
174
|
+
✓ Metadata updated
|
|
175
|
+
|
|
176
|
+
Rate limit after sync: 4,570/5,000 (91% available)
|
|
177
|
+
|
|
178
|
+
✅ Sync Complete!
|
|
179
|
+
|
|
180
|
+
GitHub Issue: https://github.com/anton-abyzov/specweave/issues/130
|
|
181
|
+
Last synced: just now
|
|
182
|
+
Next sync: Use /specweave-github:sync 0004 when ready
|
|
183
|
+
```
|
|
184
|
+
|
|
185
|
+
## Key Features
|
|
186
|
+
|
|
187
|
+
- **Multi-Profile Support**: Unlimited GitHub repos (3+, 5+, 10+ profiles)
|
|
188
|
+
- **Flexible Syncing**: Different increments can sync to different repos
|
|
189
|
+
- Increment 0001 → anton-abyzov/specweave
|
|
190
|
+
- Increment 0002 → client-org/mobile-app
|
|
191
|
+
- Increment 0003 → internal-org/infrastructure
|
|
192
|
+
- **Time Range Filtering**: Fast syncs (2 min vs 25+ min)
|
|
193
|
+
- **Rate Limit Protection**: 95%+ success rate with smart estimates
|
|
194
|
+
- **Smart Estimates**: Preview impact before every sync
|
|
195
|
+
|
|
196
|
+
## Configuration
|
|
197
|
+
|
|
198
|
+
### Sync Profiles
|
|
199
|
+
|
|
200
|
+
Configure profiles in `.specweave/config.json`:
|
|
201
|
+
|
|
202
|
+
```json
|
|
203
|
+
{
|
|
204
|
+
"sync": {
|
|
205
|
+
"activeProfile": "specweave-dev",
|
|
206
|
+
"profiles": {
|
|
207
|
+
"specweave-dev": {
|
|
208
|
+
"provider": "github",
|
|
209
|
+
"displayName": "SpecWeave Development",
|
|
210
|
+
"config": {
|
|
211
|
+
"owner": "anton-abyzov",
|
|
212
|
+
"repo": "specweave"
|
|
213
|
+
},
|
|
214
|
+
"timeRange": {
|
|
215
|
+
"default": "1M",
|
|
216
|
+
"max": "6M"
|
|
217
|
+
},
|
|
218
|
+
"rateLimits": {
|
|
219
|
+
"maxItemsPerSync": 500,
|
|
220
|
+
"warnThreshold": 100
|
|
221
|
+
}
|
|
222
|
+
},
|
|
223
|
+
"another-repo": {
|
|
224
|
+
"provider": "github",
|
|
225
|
+
"displayName": "Another Repository",
|
|
226
|
+
"config": {
|
|
227
|
+
"owner": "myorg",
|
|
228
|
+
"repo": "another-project"
|
|
229
|
+
},
|
|
230
|
+
"timeRange": {
|
|
231
|
+
"default": "2W",
|
|
232
|
+
"max": "3M"
|
|
233
|
+
}
|
|
234
|
+
}
|
|
235
|
+
},
|
|
236
|
+
"settings": {
|
|
237
|
+
"autoDetectProject": true,
|
|
238
|
+
"defaultTimeRange": "1M",
|
|
239
|
+
"rateLimitProtection": true
|
|
240
|
+
}
|
|
241
|
+
}
|
|
242
|
+
}
|
|
243
|
+
```
|
|
244
|
+
|
|
245
|
+
### Credentials
|
|
246
|
+
|
|
247
|
+
Store credentials in `.env` (never committed):
|
|
248
|
+
|
|
249
|
+
```env
|
|
250
|
+
# GitHub
|
|
251
|
+
GITHUB_TOKEN=ghp_xxxxxxxxxxxxxxxxxxxx
|
|
252
|
+
```
|
|
253
|
+
|
|
254
|
+
### Per-Increment Configuration
|
|
255
|
+
|
|
256
|
+
Each increment stores its sync metadata in `.specweave/increments/{id}/metadata.json`:
|
|
257
|
+
|
|
258
|
+
```json
|
|
259
|
+
{
|
|
260
|
+
"id": "0004-plugin-architecture",
|
|
261
|
+
"sync": {
|
|
262
|
+
"profile": "specweave-dev",
|
|
263
|
+
"issueNumber": 130,
|
|
264
|
+
"issueUrl": "https://github.com/anton-abyzov/specweave/issues/130",
|
|
265
|
+
"timeRange": "1M",
|
|
266
|
+
"createdAt": "2025-10-15T10:00:00Z",
|
|
267
|
+
"lastSyncAt": "2025-11-04T14:30:00Z",
|
|
268
|
+
"status": "active"
|
|
269
|
+
}
|
|
270
|
+
}
|
|
271
|
+
```
|
|
272
|
+
|
|
273
|
+
## Rate Limiting Protection
|
|
274
|
+
|
|
275
|
+
### What It Does
|
|
276
|
+
|
|
277
|
+
Before every sync:
|
|
278
|
+
1. **Estimates API calls** based on time range and project size
|
|
279
|
+
2. **Checks current rate limit** via GitHub API
|
|
280
|
+
3. **Calculates impact** (low/medium/high/critical)
|
|
281
|
+
4. **Validates safety** (will it exceed limit?)
|
|
282
|
+
5. **Warns user** if risky operation detected
|
|
283
|
+
|
|
284
|
+
### Impact Levels
|
|
285
|
+
|
|
286
|
+
| Impact | API Calls | Duration | Safe? | Example Time Range |
|
|
287
|
+
|--------|-----------|----------|-------|-------------------|
|
|
288
|
+
| **Low** | <250 | <2 min | ✅ Yes | 1 week, 2 weeks, 1 month |
|
|
289
|
+
| **Medium** | 250-1000 | 2-5 min | ⚠️ Maybe | 3 months |
|
|
290
|
+
| **High** | 1000-2500 | 5-15 min | ⚠️ Risky | 6 months, 1 year |
|
|
291
|
+
| **Critical** | 2500+ | 15+ min | ❌ No | All time |
|
|
292
|
+
|
|
293
|
+
### Protection Actions
|
|
294
|
+
|
|
295
|
+
**Low/Medium Impact** → Proceed with optional warning
|
|
296
|
+
**High Impact** → Warn user, require confirmation
|
|
297
|
+
**Critical Impact** → Block sync, show recommendations
|
|
298
|
+
|
|
299
|
+
### Example: Critical Impact Blocked
|
|
300
|
+
|
|
301
|
+
```
|
|
302
|
+
❌ This sync may FAIL due to:
|
|
303
|
+
|
|
304
|
+
Blockers:
|
|
305
|
+
• CRITICAL rate limit impact: 7,500 API calls exceeds safe threshold for github
|
|
306
|
+
• Not enough rate limit remaining. Need 7,500 calls, only 4,850 remaining.
|
|
307
|
+
Reset at 2025-11-04 15:00:00
|
|
308
|
+
|
|
309
|
+
Recommendations:
|
|
310
|
+
1. Reduce time range to 1 month (~300 API calls, SAFE)
|
|
311
|
+
2. Wait for rate limit reset (25 minutes)
|
|
312
|
+
3. Split sync across multiple time periods
|
|
313
|
+
|
|
314
|
+
Sync cancelled. Please adjust and try again.
|
|
315
|
+
```
|
|
316
|
+
|
|
317
|
+
## Error Handling
|
|
318
|
+
|
|
319
|
+
### Profile Not Found
|
|
320
|
+
|
|
321
|
+
```
|
|
322
|
+
❌ Error: Sync profile 'unknown-profile' not found
|
|
323
|
+
|
|
324
|
+
Available profiles:
|
|
325
|
+
• specweave-dev (GitHub: anton-abyzov/specweave)
|
|
326
|
+
• another-repo (GitHub: myorg/another-project)
|
|
327
|
+
|
|
328
|
+
Create profile: /specweave:sync-profile create
|
|
329
|
+
List profiles: /specweave:sync-profile list
|
|
330
|
+
```
|
|
331
|
+
|
|
332
|
+
### No Profiles Configured
|
|
333
|
+
|
|
334
|
+
```
|
|
335
|
+
❌ Error: No GitHub sync profiles configured
|
|
336
|
+
|
|
337
|
+
Create your first profile:
|
|
338
|
+
/specweave:sync-profile create
|
|
339
|
+
|
|
340
|
+
Or migrate from old configuration:
|
|
341
|
+
specweave migrate-to-profiles
|
|
342
|
+
```
|
|
343
|
+
|
|
344
|
+
### Rate Limit Exceeded During Sync
|
|
345
|
+
|
|
346
|
+
```
|
|
347
|
+
⚠️ GitHub API rate limit exceeded during sync
|
|
348
|
+
|
|
349
|
+
Synced: 127/187 items (68%)
|
|
350
|
+
Remaining: 60 items
|
|
351
|
+
Rate limit resets: 2025-11-04 15:00:00 (12 minutes)
|
|
352
|
+
|
|
353
|
+
What would you like to do?
|
|
354
|
+
|
|
355
|
+
1. Wait and resume (auto-resume in 12 min)
|
|
356
|
+
2. Resume manually later (/specweave-github:sync 0004 --resume)
|
|
357
|
+
3. Cancel sync (partial data saved)
|
|
358
|
+
|
|
359
|
+
Your choice: [1]
|
|
360
|
+
```
|
|
361
|
+
|
|
362
|
+
### Network Error with Retry
|
|
363
|
+
|
|
364
|
+
```
|
|
365
|
+
❌ Error: Network error while syncing to GitHub
|
|
366
|
+
|
|
367
|
+
Failed to connect to GitHub API.
|
|
368
|
+
Synced: 45/187 items before error
|
|
369
|
+
|
|
370
|
+
Retry options:
|
|
371
|
+
1. Retry immediately
|
|
372
|
+
2. Retry with exponential backoff (recommended)
|
|
373
|
+
3. Cancel and retry manually later
|
|
374
|
+
|
|
375
|
+
Your choice: [2]
|
|
376
|
+
|
|
377
|
+
Retrying in 5 seconds...
|
|
378
|
+
Retrying in 10 seconds...
|
|
379
|
+
✓ Connection restored! Resuming sync...
|
|
380
|
+
```
|
|
381
|
+
|
|
382
|
+
## First-Time Setup
|
|
383
|
+
|
|
384
|
+
### Automatic Profile Creation
|
|
385
|
+
|
|
386
|
+
Run migration script:
|
|
387
|
+
|
|
388
|
+
```bash
|
|
389
|
+
specweave migrate-to-profiles
|
|
390
|
+
```
|
|
391
|
+
|
|
392
|
+
Output:
|
|
393
|
+
```
|
|
394
|
+
🔍 Detected old configuration:
|
|
395
|
+
GitHub: Yes
|
|
396
|
+
|
|
397
|
+
✅ Backed up old configuration to .specweave/config.json.backup
|
|
398
|
+
|
|
399
|
+
✅ Created GitHub profile: default-github
|
|
400
|
+
Repository: anton-abyzov/specweave
|
|
401
|
+
|
|
402
|
+
✅ Created default project context
|
|
403
|
+
Name: specweave
|
|
404
|
+
Default profile: default-github
|
|
405
|
+
|
|
406
|
+
📊 Migration Summary:
|
|
407
|
+
Profiles created: 1
|
|
408
|
+
Projects created: 1
|
|
409
|
+
Warnings: 0
|
|
410
|
+
Errors: 0
|
|
411
|
+
|
|
412
|
+
✅ Migration completed successfully!
|
|
413
|
+
|
|
414
|
+
Next steps:
|
|
415
|
+
1. Review profiles: /specweave:sync-profile list
|
|
416
|
+
2. Test sync: /specweave-github:sync 0004
|
|
417
|
+
3. Keep backup: .specweave/config.json.backup (until confirmed working)
|
|
418
|
+
```
|
|
419
|
+
|
|
420
|
+
### Manual Setup
|
|
421
|
+
|
|
422
|
+
If automatic profile creation fails:
|
|
423
|
+
|
|
424
|
+
1. Create profile manually:
|
|
425
|
+
```bash
|
|
426
|
+
/specweave:sync-profile create
|
|
427
|
+
```
|
|
428
|
+
|
|
429
|
+
2. Update increment metadata:
|
|
430
|
+
```json
|
|
431
|
+
{
|
|
432
|
+
"sync": {
|
|
433
|
+
"profile": "default-github",
|
|
434
|
+
"issueNumber": 130
|
|
435
|
+
}
|
|
436
|
+
}
|
|
437
|
+
```
|
|
438
|
+
|
|
439
|
+
3. Test sync:
|
|
440
|
+
```bash
|
|
441
|
+
/specweave-github:sync 0004
|
|
442
|
+
```
|
|
443
|
+
|
|
444
|
+
## Related Commands
|
|
445
|
+
|
|
446
|
+
- `/specweave-github:create-issue <increment-id>`: Create issue with profile selection
|
|
447
|
+
- `/specweave-github:close-issue <increment-id>`: Close issue
|
|
448
|
+
- `/specweave-github:status <increment-id>`: Check sync status
|
|
449
|
+
- `/specweave:sync-profile create`: Create new sync profile
|
|
450
|
+
- `/specweave:sync-profile list`: List all profiles
|
|
451
|
+
|
|
452
|
+
## Tips & Best Practices
|
|
453
|
+
|
|
454
|
+
### 1. Choose the Right Time Range
|
|
455
|
+
|
|
456
|
+
**For Active Projects**:
|
|
457
|
+
- Use `1M` (1 month) - Balances completeness and performance
|
|
458
|
+
- Daily syncs: `1W` (fast, <1 min)
|
|
459
|
+
|
|
460
|
+
**For Historical Analysis**:
|
|
461
|
+
- Use `3M` or `6M` with caution (check rate limits first)
|
|
462
|
+
- Never use `ALL` unless absolutely necessary
|
|
463
|
+
|
|
464
|
+
### 2. Monitor Rate Limits
|
|
465
|
+
|
|
466
|
+
Check before large operations:
|
|
467
|
+
```bash
|
|
468
|
+
gh api rate_limit
|
|
469
|
+
```
|
|
470
|
+
|
|
471
|
+
Output:
|
|
472
|
+
```json
|
|
473
|
+
{
|
|
474
|
+
"resources": {
|
|
475
|
+
"core": {
|
|
476
|
+
"limit": 5000,
|
|
477
|
+
"remaining": 4850,
|
|
478
|
+
"reset": 1699027200
|
|
479
|
+
}
|
|
480
|
+
}
|
|
481
|
+
}
|
|
482
|
+
```
|
|
483
|
+
|
|
484
|
+
### 3. Use Profiles Strategically
|
|
485
|
+
|
|
486
|
+
**Organize by project**:
|
|
487
|
+
- `project-a-dev` → Development repo
|
|
488
|
+
- `project-a-prod` → Production repo
|
|
489
|
+
- `project-b` → Different project
|
|
490
|
+
|
|
491
|
+
**Organize by team**:
|
|
492
|
+
- `frontend-team` → Frontend repo
|
|
493
|
+
- `backend-team` → Backend repo
|
|
494
|
+
- `infra-team` → Infrastructure repo
|
|
495
|
+
|
|
496
|
+
### 4. Enable Auto-Sync
|
|
497
|
+
|
|
498
|
+
For active development:
|
|
499
|
+
```json
|
|
500
|
+
{
|
|
501
|
+
"sync": {
|
|
502
|
+
"settings": {
|
|
503
|
+
"autoSync": true,
|
|
504
|
+
"syncFrequency": "every-task",
|
|
505
|
+
"rateLimitProtection": true
|
|
506
|
+
}
|
|
507
|
+
}
|
|
508
|
+
}
|
|
509
|
+
```
|
|
510
|
+
|
|
511
|
+
### 5. Use Dry Run for Testing
|
|
512
|
+
|
|
513
|
+
Before large syncs:
|
|
514
|
+
```bash
|
|
515
|
+
/specweave-github:sync 0004 --dry-run --time-range 6M
|
|
516
|
+
```
|
|
517
|
+
|
|
518
|
+
This shows what would happen without actually executing.
|
|
519
|
+
|
|
520
|
+
## Advanced
|
|
521
|
+
|
|
522
|
+
### Batch Sync Multiple Increments
|
|
523
|
+
|
|
524
|
+
```bash
|
|
525
|
+
# Sync all active increments (respects rate limits)
|
|
526
|
+
/specweave-github:sync --all --time-range 1M
|
|
527
|
+
|
|
528
|
+
# Sync specific increments
|
|
529
|
+
/specweave-github:sync 0001,0002,0003 --time-range 2W
|
|
530
|
+
```
|
|
531
|
+
|
|
532
|
+
### Custom Rate Limit Thresholds
|
|
533
|
+
|
|
534
|
+
Override default thresholds:
|
|
535
|
+
```json
|
|
536
|
+
{
|
|
537
|
+
"sync": {
|
|
538
|
+
"profiles": {
|
|
539
|
+
"my-profile": {
|
|
540
|
+
"rateLimits": {
|
|
541
|
+
"maxItemsPerSync": 1000,
|
|
542
|
+
"warnThreshold": 200
|
|
543
|
+
}
|
|
544
|
+
}
|
|
545
|
+
}
|
|
546
|
+
}
|
|
547
|
+
}
|
|
548
|
+
```
|
|
549
|
+
|
|
550
|
+
### Resume Failed Syncs
|
|
551
|
+
|
|
552
|
+
If sync fails mid-operation:
|
|
553
|
+
```bash
|
|
554
|
+
/specweave-github:sync 0004 --resume
|
|
555
|
+
```
|
|
556
|
+
|
|
557
|
+
System will:
|
|
558
|
+
1. Load sync state from metadata
|
|
559
|
+
2. Skip already-synced items
|
|
560
|
+
3. Continue from last checkpoint
|
|
561
|
+
|
|
562
|
+
---
|
|
563
|
+
|
|
564
|
+
**Command**: `/specweave-github:sync`
|
|
565
|
+
**Plugin**: specweave-github
|
|
566
|
+
**Version**: 1.0.0 (Multi-Project)
|
|
567
|
+
**Last Updated**: 2025-11-05
|
|
568
|
+
**Requires**: SpecWeave Core v0.8.0+
|