specweave 0.30.13 → 0.30.16
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-plugin/marketplace.json +0 -11
- package/CLAUDE.md +1 -1
- package/README.md +32 -0
- package/bin/fix-marketplace-errors.sh +1 -1
- package/bin/specweave.js +28 -0
- package/dist/src/cli/commands/commits.d.ts +7 -0
- package/dist/src/cli/commands/commits.d.ts.map +1 -0
- package/dist/src/cli/commands/commits.js +42 -0
- package/dist/src/cli/commands/commits.js.map +1 -0
- package/dist/src/cli/commands/living-docs.d.ts +29 -0
- package/dist/src/cli/commands/living-docs.d.ts.map +1 -0
- package/dist/src/cli/commands/living-docs.js +350 -0
- package/dist/src/cli/commands/living-docs.js.map +1 -0
- package/dist/src/cli/helpers/ado-area-selector.js +1 -1
- package/dist/src/cli/helpers/ado-area-selector.js.map +1 -1
- package/dist/src/core/background/index.d.ts +2 -2
- package/dist/src/core/background/index.d.ts.map +1 -1
- package/dist/src/core/background/index.js +1 -1
- package/dist/src/core/background/index.js.map +1 -1
- package/dist/src/core/living-docs/living-docs-sync.d.ts +34 -10
- package/dist/src/core/living-docs/living-docs-sync.d.ts.map +1 -1
- package/dist/src/core/living-docs/living-docs-sync.js +223 -32
- package/dist/src/core/living-docs/living-docs-sync.js.map +1 -1
- package/dist/src/importers/ado-importer.js +2 -2
- package/dist/src/importers/ado-importer.js.map +1 -1
- package/dist/src/importers/item-converter.d.ts +6 -1
- package/dist/src/importers/item-converter.d.ts.map +1 -1
- package/dist/src/importers/item-converter.js +15 -2
- package/dist/src/importers/item-converter.js.map +1 -1
- package/dist/src/integrations/ado/ado-pat-provider.d.ts +3 -3
- package/dist/src/integrations/ado/ado-pat-provider.js +3 -3
- package/dist/src/living-docs/epic-id-allocator.d.ts +1 -1
- package/dist/src/living-docs/epic-id-allocator.js +1 -1
- package/dist/src/living-docs/fs-id-allocator.d.ts +1 -1
- package/dist/src/living-docs/fs-id-allocator.js +1 -1
- package/dist/src/living-docs/smart-doc-organizer.js +1 -1
- package/dist/src/living-docs/smart-doc-organizer.js.map +1 -1
- package/dist/src/utils/auth-helpers.d.ts +23 -0
- package/dist/src/utils/auth-helpers.d.ts.map +1 -1
- package/dist/src/utils/auth-helpers.js +51 -0
- package/dist/src/utils/auth-helpers.js.map +1 -1
- package/dist/src/utils/feature-id-collision.d.ts +48 -5
- package/dist/src/utils/feature-id-collision.d.ts.map +1 -1
- package/dist/src/utils/feature-id-collision.js +251 -19
- package/dist/src/utils/feature-id-collision.js.map +1 -1
- package/dist/src/utils/validators/ado-validator.js +2 -2
- package/dist/src/utils/validators/ado-validator.js.map +1 -1
- package/package.json +12 -13
- package/plugins/PLUGINS-INDEX.md +2 -3
- package/plugins/specweave/commands/specweave-living-docs.md +321 -0
- package/plugins/specweave/commands/specweave-organize-docs.md +3 -3
- package/plugins/specweave/hooks/v2/handlers/github-sync-handler.sh +10 -1
- package/plugins/specweave/hooks/v2/handlers/living-docs-handler.sh +10 -1
- package/plugins/specweave-ado/agents/ado-manager/AGENT.md +58 -0
- package/plugins/specweave-ado/commands/{specweave-ado-close-workitem.md → close.md} +9 -5
- package/plugins/specweave-ado/commands/{specweave-ado-create-workitem.md → create.md} +9 -5
- package/plugins/specweave-ado/commands/pull.md +489 -0
- package/plugins/specweave-ado/commands/push.md +391 -0
- package/plugins/specweave-ado/commands/{specweave-ado-status.md → status.md} +12 -0
- package/plugins/specweave-ado/commands/{specweave-ado-sync.md → sync.md} +95 -3
- package/plugins/specweave-ado/hooks/README.md +1 -1
- package/plugins/specweave-docs/commands/generate.md +3 -3
- package/plugins/specweave-docs/commands/init.md +4 -4
- package/plugins/specweave-docs/commands/preview.md +5 -5
- package/plugins/specweave-github/agents/github-manager/AGENT.md +22 -0
- package/plugins/specweave-github/agents/user-story-updater/AGENT.md +1 -1
- package/plugins/specweave-github/commands/{specweave-github-close-issue.md → close.md} +2 -2
- package/plugins/specweave-github/commands/{specweave-github-create-issue.md → create.md} +2 -2
- package/plugins/specweave-github/commands/pull.md +142 -0
- package/plugins/specweave-github/commands/push.md +154 -0
- package/plugins/specweave-github/commands/{specweave-github-sync.md → sync.md} +19 -5
- package/plugins/specweave-github/commands/{specweave-github-update-user-story.md → update-user-story.md} +1 -1
- package/plugins/specweave-github/hooks/README.md +1 -1
- package/plugins/specweave-jira/agents/jira-manager/AGENT.md +30 -0
- package/plugins/specweave-jira/commands/pull.md +164 -0
- package/plugins/specweave-jira/commands/push.md +170 -0
- package/plugins/specweave-jira/commands/{specweave-jira-sync.md → sync.md} +18 -3
- package/plugins/specweave-jira/hooks/README.md +1 -1
- package/plugins/specweave-kafka/README.md +20 -0
- package/plugins/specweave-kafka/benchmarks/kafka-throughput.benchmark.ts +551 -0
- package/plugins/specweave-kafka/examples/README.md +191 -0
- package/plugins/specweave-kafka/examples/avro-schema-registry/.env.example +8 -0
- package/plugins/specweave-kafka/examples/avro-schema-registry/README.md +69 -0
- package/plugins/specweave-kafka/examples/avro-schema-registry/consumer.js +37 -0
- package/plugins/specweave-kafka/examples/avro-schema-registry/package.json +14 -0
- package/plugins/specweave-kafka/examples/avro-schema-registry/producer.js +57 -0
- package/plugins/specweave-kafka/examples/exactly-once-semantics/.env.example +5 -0
- package/plugins/specweave-kafka/examples/exactly-once-semantics/README.md +30 -0
- package/plugins/specweave-kafka/examples/exactly-once-semantics/eos-pipeline.js +79 -0
- package/plugins/specweave-kafka/examples/exactly-once-semantics/package.json +11 -0
- package/plugins/specweave-kafka/examples/kafka-streams-app/.env.example +4 -0
- package/plugins/specweave-kafka/examples/kafka-streams-app/README.md +30 -0
- package/plugins/specweave-kafka/examples/kafka-streams-app/package.json +11 -0
- package/plugins/specweave-kafka/examples/kafka-streams-app/windowed-aggregation.js +66 -0
- package/plugins/specweave-kafka/examples/n8n-workflow/README.md +54 -0
- package/plugins/specweave-kafka/examples/n8n-workflow/docker-compose.yml +19 -0
- package/plugins/specweave-kafka/examples/n8n-workflow/kafka-to-slack.json +50 -0
- package/plugins/specweave-kafka/examples/simple-producer-consumer/.env.example +15 -0
- package/plugins/specweave-kafka/examples/simple-producer-consumer/README.md +183 -0
- package/plugins/specweave-kafka/examples/simple-producer-consumer/consumer.js +60 -0
- package/plugins/specweave-kafka/examples/simple-producer-consumer/docker-compose.yml +30 -0
- package/plugins/specweave-kafka/examples/simple-producer-consumer/package.json +18 -0
- package/plugins/specweave-kafka/examples/simple-producer-consumer/producer.js +52 -0
- package/plugins/specweave-release/commands/specweave-release-npm.md +4 -4
- package/plugins/specweave-docs-preview/.claude-plugin/plugin.json +0 -21
- package/plugins/specweave-docs-preview/commands/build.md +0 -489
- package/plugins/specweave-docs-preview/commands/preview.md +0 -355
- package/plugins/specweave-docs-preview/skills/docs-preview/SKILL.md +0 -386
- /package/plugins/specweave-ado/commands/{specweave-ado-clone-repos.md → clone.md} +0 -0
- /package/plugins/specweave-ado/commands/{specweave-ado-import-areas.md → import-areas.md} +0 -0
- /package/plugins/specweave-ado/commands/{specweave-ado-import-projects.md → import-projects.md} +0 -0
- /package/plugins/specweave-github/commands/{specweave-github-cleanup-duplicates.md → cleanup-duplicates.md} +0 -0
- /package/plugins/specweave-github/commands/{specweave-github-reconcile.md → reconcile.md} +0 -0
- /package/plugins/specweave-github/commands/{specweave-github-status.md → status.md} +0 -0
- /package/plugins/specweave-jira/commands/{specweave-jira-import-boards.md → import-boards.md} +0 -0
- /package/plugins/specweave-jira/commands/{specweave-jira-import-projects.md → import-projects-full.md} +0 -0
|
@@ -0,0 +1,142 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: specweave-github:pull
|
|
3
|
+
description: Pull latest changes from GitHub Issues (like git pull). Imports comments, labels, and status changes.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# GitHub Pull Command
|
|
7
|
+
|
|
8
|
+
**Usage**: `/specweave-github:pull [increment-id]`
|
|
9
|
+
|
|
10
|
+
**Purpose**: Pull latest changes from GitHub Issues to your local increment (like `git pull`)
|
|
11
|
+
|
|
12
|
+
---
|
|
13
|
+
|
|
14
|
+
## Quick Start
|
|
15
|
+
|
|
16
|
+
```bash
|
|
17
|
+
# Pull for current/active increment
|
|
18
|
+
/specweave-github:pull
|
|
19
|
+
|
|
20
|
+
# Pull for specific increment
|
|
21
|
+
/specweave-github:pull 0005
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
---
|
|
25
|
+
|
|
26
|
+
## What Gets Pulled
|
|
27
|
+
|
|
28
|
+
| Field | Behavior |
|
|
29
|
+
|-------|----------|
|
|
30
|
+
| **Status** | Issue state (open/closed) -> increment status |
|
|
31
|
+
| **Labels** | Priority labels imported |
|
|
32
|
+
| **Comments** | New team comments imported to notes |
|
|
33
|
+
| **Assignees** | Updated if changed |
|
|
34
|
+
| **Milestone** | Iteration/sprint mapping |
|
|
35
|
+
|
|
36
|
+
---
|
|
37
|
+
|
|
38
|
+
## Command Behavior
|
|
39
|
+
|
|
40
|
+
When user runs this command:
|
|
41
|
+
|
|
42
|
+
### 1. Resolve Increment
|
|
43
|
+
|
|
44
|
+
```typescript
|
|
45
|
+
const incrementId = args.incrementId || await findActiveIncrement();
|
|
46
|
+
|
|
47
|
+
const metadata = JSON.parse(await fs.readFile(
|
|
48
|
+
`.specweave/increments/${incrementId}/metadata.json`, 'utf-8'
|
|
49
|
+
));
|
|
50
|
+
|
|
51
|
+
const issueNumber = metadata?.external_sync?.github?.issue;
|
|
52
|
+
if (!issueNumber) {
|
|
53
|
+
console.log(`Not linked to GitHub. Run: /specweave-github:create ${incrementId}`);
|
|
54
|
+
return;
|
|
55
|
+
}
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
### 2. Fetch and Compare
|
|
59
|
+
|
|
60
|
+
```
|
|
61
|
+
Use Task tool with subagent_type: "specweave-github:github-manager:AGENT"
|
|
62
|
+
|
|
63
|
+
Prompt: "Pull changes from GitHub for increment {increment-id}.
|
|
64
|
+
|
|
65
|
+
Issue: #{issueNumber}
|
|
66
|
+
|
|
67
|
+
Steps:
|
|
68
|
+
1. Fetch issue #{issueNumber} via gh api
|
|
69
|
+
2. Compare GitHub state vs local status
|
|
70
|
+
3. Apply conflict resolution (external wins for status)
|
|
71
|
+
4. Import new comments to increment notes
|
|
72
|
+
5. Update labels/assignees in metadata
|
|
73
|
+
6. Display what changed"
|
|
74
|
+
```
|
|
75
|
+
|
|
76
|
+
### 3. Display Changes
|
|
77
|
+
|
|
78
|
+
```
|
|
79
|
+
Pulled from GitHub
|
|
80
|
+
|
|
81
|
+
Issue: #123
|
|
82
|
+
Repository: owner/repo
|
|
83
|
+
|
|
84
|
+
Changes Applied:
|
|
85
|
+
Status: open -> closed (mapped to: completed)
|
|
86
|
+
Labels: +bug, +priority-high
|
|
87
|
+
Comments: 2 new imported
|
|
88
|
+
|
|
89
|
+
Last synced: 2025-12-04 10:30:00
|
|
90
|
+
URL: https://github.com/owner/repo/issues/123
|
|
91
|
+
```
|
|
92
|
+
|
|
93
|
+
---
|
|
94
|
+
|
|
95
|
+
## Status Mapping
|
|
96
|
+
|
|
97
|
+
| GitHub State | SpecWeave Status |
|
|
98
|
+
|--------------|------------------|
|
|
99
|
+
| `open` | in-progress |
|
|
100
|
+
| `closed` | completed |
|
|
101
|
+
|
|
102
|
+
---
|
|
103
|
+
|
|
104
|
+
## Examples
|
|
105
|
+
|
|
106
|
+
### Example 1: Simple Pull
|
|
107
|
+
|
|
108
|
+
```
|
|
109
|
+
User: /specweave-github:pull
|
|
110
|
+
|
|
111
|
+
Claude:
|
|
112
|
+
Pulling from GitHub...
|
|
113
|
+
Increment: 0005-payment-integration
|
|
114
|
+
Issue: #123
|
|
115
|
+
|
|
116
|
+
Changes Applied:
|
|
117
|
+
Status: open -> closed (completed)
|
|
118
|
+
|
|
119
|
+
Pull complete!
|
|
120
|
+
```
|
|
121
|
+
|
|
122
|
+
### Example 2: Not Linked
|
|
123
|
+
|
|
124
|
+
```
|
|
125
|
+
User: /specweave-github:pull 0005
|
|
126
|
+
|
|
127
|
+
Claude:
|
|
128
|
+
Increment 0005 not linked to GitHub yet.
|
|
129
|
+
|
|
130
|
+
To link: /specweave-github:create 0005
|
|
131
|
+
```
|
|
132
|
+
|
|
133
|
+
---
|
|
134
|
+
|
|
135
|
+
## Related Commands
|
|
136
|
+
|
|
137
|
+
| Command | Purpose |
|
|
138
|
+
|---------|---------|
|
|
139
|
+
| `/specweave-github:push` | Push local changes to GitHub |
|
|
140
|
+
| `/specweave-github:sync` | Two-way sync (pull + push) |
|
|
141
|
+
| `/specweave-github:status` | Check sync status |
|
|
142
|
+
| `/specweave-github:create` | Create GitHub issue |
|
|
@@ -0,0 +1,154 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: specweave-github:push
|
|
3
|
+
description: Push local progress to GitHub Issues (like git push). Updates issue with task completion checklist.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# GitHub Push Command
|
|
7
|
+
|
|
8
|
+
**Usage**: `/specweave-github:push [increment-id]`
|
|
9
|
+
|
|
10
|
+
**Purpose**: Push local progress to GitHub Issues (like `git push`)
|
|
11
|
+
|
|
12
|
+
---
|
|
13
|
+
|
|
14
|
+
## Quick Start
|
|
15
|
+
|
|
16
|
+
```bash
|
|
17
|
+
# Push current/active increment
|
|
18
|
+
/specweave-github:push
|
|
19
|
+
|
|
20
|
+
# Push specific increment
|
|
21
|
+
/specweave-github:push 0005
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
---
|
|
25
|
+
|
|
26
|
+
## What Gets Pushed
|
|
27
|
+
|
|
28
|
+
| Field | Source |
|
|
29
|
+
|-------|--------|
|
|
30
|
+
| **Task Checklist** | Updated from tasks.md completion |
|
|
31
|
+
| **Comment** | Auto-generated progress update |
|
|
32
|
+
| **Labels** | Status labels updated |
|
|
33
|
+
| **State** | Closed if 100% complete |
|
|
34
|
+
|
|
35
|
+
---
|
|
36
|
+
|
|
37
|
+
## Command Behavior
|
|
38
|
+
|
|
39
|
+
When user runs this command:
|
|
40
|
+
|
|
41
|
+
### 1. Check Permission Gate
|
|
42
|
+
|
|
43
|
+
```typescript
|
|
44
|
+
const config = JSON.parse(await fs.readFile('.specweave/config.json', 'utf-8'));
|
|
45
|
+
const canUpdateExternal = config?.sync?.settings?.canUpdateExternalItems ?? false;
|
|
46
|
+
|
|
47
|
+
if (!canUpdateExternal) {
|
|
48
|
+
console.log(`
|
|
49
|
+
Permission Denied: GitHub writes disabled
|
|
50
|
+
|
|
51
|
+
To enable: Set sync.settings.canUpdateExternalItems = true
|
|
52
|
+
|
|
53
|
+
Or use read-only: /specweave-github:pull ${incrementId}
|
|
54
|
+
`);
|
|
55
|
+
return;
|
|
56
|
+
}
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
### 2. Calculate Progress
|
|
60
|
+
|
|
61
|
+
```typescript
|
|
62
|
+
const tasksContent = await fs.readFile(
|
|
63
|
+
`.specweave/increments/${incrementId}/tasks.md`, 'utf-8'
|
|
64
|
+
);
|
|
65
|
+
|
|
66
|
+
const totalTasks = (tasksContent.match(/### T-\d+/g) || []).length;
|
|
67
|
+
const completedTasks = (tasksContent.match(/\[x\] completed/gi) || []).length;
|
|
68
|
+
const percentage = Math.round((completedTasks / totalTasks) * 100);
|
|
69
|
+
```
|
|
70
|
+
|
|
71
|
+
### 3. Invoke Push Sync
|
|
72
|
+
|
|
73
|
+
```
|
|
74
|
+
Use Task tool with subagent_type: "specweave-github:github-manager:AGENT"
|
|
75
|
+
|
|
76
|
+
Prompt: "Push progress to GitHub for increment {increment-id}.
|
|
77
|
+
|
|
78
|
+
Issue: #{issueNumber}
|
|
79
|
+
Progress: {completedTasks}/{totalTasks} ({percentage}%)
|
|
80
|
+
|
|
81
|
+
Steps:
|
|
82
|
+
1. Update issue body task checklist
|
|
83
|
+
2. Add progress comment
|
|
84
|
+
3. Update labels if needed
|
|
85
|
+
4. Close issue if 100% complete (if canUpdateStatus)
|
|
86
|
+
5. Update sync timestamp"
|
|
87
|
+
```
|
|
88
|
+
|
|
89
|
+
### 4. Display Result
|
|
90
|
+
|
|
91
|
+
```
|
|
92
|
+
Pushed to GitHub
|
|
93
|
+
|
|
94
|
+
Issue: #123
|
|
95
|
+
Repository: owner/repo
|
|
96
|
+
|
|
97
|
+
Progress: 6/10 tasks (60%)
|
|
98
|
+
|
|
99
|
+
Updates:
|
|
100
|
+
Task checklist: 6/10 checked
|
|
101
|
+
Comment: Progress update posted
|
|
102
|
+
Labels: +in-progress
|
|
103
|
+
|
|
104
|
+
URL: https://github.com/owner/repo/issues/123
|
|
105
|
+
```
|
|
106
|
+
|
|
107
|
+
---
|
|
108
|
+
|
|
109
|
+
## Examples
|
|
110
|
+
|
|
111
|
+
### Example 1: Simple Push
|
|
112
|
+
|
|
113
|
+
```
|
|
114
|
+
User: /specweave-github:push
|
|
115
|
+
|
|
116
|
+
Claude:
|
|
117
|
+
Pushing to GitHub...
|
|
118
|
+
Increment: 0005-payment-integration
|
|
119
|
+
Issue: #123
|
|
120
|
+
|
|
121
|
+
Progress: 8/10 tasks (80%)
|
|
122
|
+
Checklist updated, comment posted.
|
|
123
|
+
|
|
124
|
+
Push complete!
|
|
125
|
+
```
|
|
126
|
+
|
|
127
|
+
### Example 2: 100% Complete
|
|
128
|
+
|
|
129
|
+
```
|
|
130
|
+
User: /specweave-github:push 0005
|
|
131
|
+
|
|
132
|
+
Claude:
|
|
133
|
+
Pushing to GitHub...
|
|
134
|
+
|
|
135
|
+
Progress: 10/10 tasks (100%)
|
|
136
|
+
|
|
137
|
+
Updates:
|
|
138
|
+
Task checklist: 10/10 checked
|
|
139
|
+
Comment: "All tasks complete!"
|
|
140
|
+
Issue: CLOSED
|
|
141
|
+
|
|
142
|
+
Ready for next: /specweave:done 0005
|
|
143
|
+
```
|
|
144
|
+
|
|
145
|
+
---
|
|
146
|
+
|
|
147
|
+
## Related Commands
|
|
148
|
+
|
|
149
|
+
| Command | Purpose |
|
|
150
|
+
|---------|---------|
|
|
151
|
+
| `/specweave-github:pull` | Pull changes from GitHub |
|
|
152
|
+
| `/specweave-github:sync` | Two-way sync (pull + push) |
|
|
153
|
+
| `/specweave-github:status` | Check sync status |
|
|
154
|
+
| `/specweave-github:close` | Close issue with summary |
|
|
@@ -547,13 +547,27 @@ If automatic profile creation fails:
|
|
|
547
547
|
/specweave-github:sync 0004
|
|
548
548
|
```
|
|
549
549
|
|
|
550
|
+
## Simpler Alternatives
|
|
551
|
+
|
|
552
|
+
For most use cases, use the git-style commands:
|
|
553
|
+
|
|
554
|
+
| Command | Purpose |
|
|
555
|
+
|---------|---------|
|
|
556
|
+
| `/specweave-github:pull` | Pull changes from GitHub (read-only) |
|
|
557
|
+
| `/specweave-github:push` | Push progress to GitHub |
|
|
558
|
+
|
|
559
|
+
Use `/specweave-github:sync` for advanced operations with time ranges and rate limit control.
|
|
560
|
+
|
|
550
561
|
## Related Commands
|
|
551
562
|
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
563
|
+
| Command | Purpose |
|
|
564
|
+
|---------|---------|
|
|
565
|
+
| `/specweave-github:pull` | Pull from GitHub (git-style) |
|
|
566
|
+
| `/specweave-github:push` | Push to GitHub (git-style) |
|
|
567
|
+
| `/specweave-github:create` | Create GitHub issue |
|
|
568
|
+
| `/specweave-github:close` | Close GitHub issue |
|
|
569
|
+
| `/specweave-github:status` | Check sync status |
|
|
570
|
+
| `/specweave:sync-profile create` | Create new sync profile |
|
|
557
571
|
|
|
558
572
|
## Tips & Best Practices
|
|
559
573
|
|
|
@@ -281,7 +281,7 @@ If upgrading from SpecWeave v0.12.x or earlier:
|
|
|
281
281
|
- **Core Plugin Hooks**: `plugins/specweave/hooks/README.md`
|
|
282
282
|
- **Architecture Analysis**: `.specweave/increments/0018-strict-increment-discipline-enforcement/reports/HOOKS-ARCHITECTURE-ANALYSIS.md`
|
|
283
283
|
- **Claude Code Hooks Guide**: https://code.claude.com/docs/en/hooks-guide
|
|
284
|
-
- **GitHub Sync Command**: `plugins/specweave-github/commands/
|
|
284
|
+
- **GitHub Sync Command**: `plugins/specweave-github/commands/sync.md`
|
|
285
285
|
|
|
286
286
|
---
|
|
287
287
|
|
|
@@ -46,6 +46,36 @@ Task({
|
|
|
46
46
|
|
|
47
47
|
---
|
|
48
48
|
|
|
49
|
+
## 🔐 CRITICAL: Authentication (DO NOT HALLUCINATE)
|
|
50
|
+
|
|
51
|
+
**EXACT environment variable names - use ONLY these:**
|
|
52
|
+
|
|
53
|
+
| Service | Env Var | Example |
|
|
54
|
+
|---------|---------|---------|
|
|
55
|
+
| **Jira Token** | `JIRA_API_TOKEN` | `JIRA_API_TOKEN=abc123xyz...` |
|
|
56
|
+
| **Jira Email** | `JIRA_EMAIL` | `JIRA_EMAIL=user@example.com` |
|
|
57
|
+
| **Jira Domain** | `JIRA_DOMAIN` | `JIRA_DOMAIN=company.atlassian.net` |
|
|
58
|
+
|
|
59
|
+
⚠️ **NEVER USE OR SUGGEST these non-existent env vars:**
|
|
60
|
+
- ❌ `JIRA_TOKEN` ← DOES NOT EXIST (use `JIRA_API_TOKEN`)
|
|
61
|
+
- ❌ `JIRA_PAT` ← DOES NOT EXIST
|
|
62
|
+
- ❌ `ATLASSIAN_TOKEN` ← DOES NOT EXIST
|
|
63
|
+
|
|
64
|
+
**When auth fails, display this EXACT message:**
|
|
65
|
+
```
|
|
66
|
+
Jira Authentication Required
|
|
67
|
+
|
|
68
|
+
Set in .env file:
|
|
69
|
+
JIRA_API_TOKEN=your-api-token
|
|
70
|
+
JIRA_EMAIL=your-email@example.com
|
|
71
|
+
JIRA_DOMAIN=your-domain.atlassian.net
|
|
72
|
+
|
|
73
|
+
Generate token at:
|
|
74
|
+
https://id.atlassian.com/manage-profile/security/api-tokens
|
|
75
|
+
```
|
|
76
|
+
|
|
77
|
+
---
|
|
78
|
+
|
|
49
79
|
## Capabilities
|
|
50
80
|
|
|
51
81
|
As the Jira Manager agent, I specialize in:
|
|
@@ -0,0 +1,164 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: specweave-jira:pull
|
|
3
|
+
description: Pull latest changes from Jira (like git pull). Imports status, priority, sprint, and comments.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Jira Pull Command
|
|
7
|
+
|
|
8
|
+
**Usage**: `/specweave-jira:pull [increment-id]`
|
|
9
|
+
|
|
10
|
+
**Purpose**: Pull latest changes from Jira to your local increment (like `git pull`)
|
|
11
|
+
|
|
12
|
+
---
|
|
13
|
+
|
|
14
|
+
## Quick Start
|
|
15
|
+
|
|
16
|
+
```bash
|
|
17
|
+
# Pull for current/active increment
|
|
18
|
+
/specweave-jira:pull
|
|
19
|
+
|
|
20
|
+
# Pull for specific increment
|
|
21
|
+
/specweave-jira:pull 0005
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
---
|
|
25
|
+
|
|
26
|
+
## What Gets Pulled
|
|
27
|
+
|
|
28
|
+
| Field | Behavior |
|
|
29
|
+
|-------|----------|
|
|
30
|
+
| **Status** | External ALWAYS wins (QA/stakeholder decisions) |
|
|
31
|
+
| **Priority** | External wins (stakeholder prioritization) |
|
|
32
|
+
| **Sprint** | Updated if changed in Jira |
|
|
33
|
+
| **Comments** | New team comments imported to notes |
|
|
34
|
+
| **Assignee** | Updated if changed |
|
|
35
|
+
| **Story Points** | Imported if set |
|
|
36
|
+
|
|
37
|
+
---
|
|
38
|
+
|
|
39
|
+
## Status Mapping
|
|
40
|
+
|
|
41
|
+
| Jira Status | SpecWeave Status |
|
|
42
|
+
|-------------|------------------|
|
|
43
|
+
| To Do | draft |
|
|
44
|
+
| In Progress | in-progress |
|
|
45
|
+
| Code Review | implemented |
|
|
46
|
+
| In Review | implemented |
|
|
47
|
+
| QA / Testing | in-qa |
|
|
48
|
+
| Done / Closed | completed |
|
|
49
|
+
| Blocked | blocked |
|
|
50
|
+
| Cancelled | cancelled |
|
|
51
|
+
|
|
52
|
+
---
|
|
53
|
+
|
|
54
|
+
## Command Behavior
|
|
55
|
+
|
|
56
|
+
When user runs this command:
|
|
57
|
+
|
|
58
|
+
### 1. Resolve Increment
|
|
59
|
+
|
|
60
|
+
```typescript
|
|
61
|
+
const incrementId = args.incrementId || await findActiveIncrement();
|
|
62
|
+
|
|
63
|
+
const metadata = JSON.parse(await fs.readFile(
|
|
64
|
+
`.specweave/increments/${incrementId}/metadata.json`, 'utf-8'
|
|
65
|
+
));
|
|
66
|
+
|
|
67
|
+
const jiraIssueKey = metadata?.external_sync?.jira?.issueKey;
|
|
68
|
+
if (!jiraIssueKey) {
|
|
69
|
+
console.log(`Not linked to Jira. Link manually or use: /specweave-jira:sync ${incrementId}`);
|
|
70
|
+
return;
|
|
71
|
+
}
|
|
72
|
+
```
|
|
73
|
+
|
|
74
|
+
### 2. Fetch and Apply
|
|
75
|
+
|
|
76
|
+
```
|
|
77
|
+
Use Task tool with subagent_type: "specweave-jira:jira-manager:jira-manager"
|
|
78
|
+
|
|
79
|
+
Prompt: "Pull changes from Jira for increment {increment-id}.
|
|
80
|
+
|
|
81
|
+
Issue: {jiraIssueKey}
|
|
82
|
+
|
|
83
|
+
Steps:
|
|
84
|
+
1. Fetch issue {jiraIssueKey} via Jira REST API
|
|
85
|
+
2. Compare Jira status vs local status
|
|
86
|
+
3. Apply conflict resolution (EXTERNAL WINS for status/priority)
|
|
87
|
+
4. Import new comments to increment notes
|
|
88
|
+
5. Update sprint/assignee in metadata
|
|
89
|
+
6. Display what changed"
|
|
90
|
+
```
|
|
91
|
+
|
|
92
|
+
### 3. Display Changes
|
|
93
|
+
|
|
94
|
+
```
|
|
95
|
+
Pulled from Jira
|
|
96
|
+
|
|
97
|
+
Issue: PROJ-123
|
|
98
|
+
Project: My Project
|
|
99
|
+
|
|
100
|
+
Changes Applied:
|
|
101
|
+
Status: In Progress -> Done (mapped to: completed)
|
|
102
|
+
Priority: Medium -> High
|
|
103
|
+
Sprint: Sprint 23 -> Sprint 24
|
|
104
|
+
Comments: 3 new imported
|
|
105
|
+
|
|
106
|
+
Last synced: 2025-12-04 10:30:00
|
|
107
|
+
URL: https://mycompany.atlassian.net/browse/PROJ-123
|
|
108
|
+
```
|
|
109
|
+
|
|
110
|
+
---
|
|
111
|
+
|
|
112
|
+
## Conflict Resolution
|
|
113
|
+
|
|
114
|
+
**CRITICAL**: External tool status ALWAYS wins.
|
|
115
|
+
|
|
116
|
+
| Scenario | Winner | Reason |
|
|
117
|
+
|----------|--------|--------|
|
|
118
|
+
| Status differs | **External** | QA/stakeholder decisions |
|
|
119
|
+
| Priority differs | **External** | Stakeholder prioritization |
|
|
120
|
+
| Sprint differs | **External** | Sprint planning decisions |
|
|
121
|
+
|
|
122
|
+
---
|
|
123
|
+
|
|
124
|
+
## Examples
|
|
125
|
+
|
|
126
|
+
### Example 1: Simple Pull
|
|
127
|
+
|
|
128
|
+
```
|
|
129
|
+
User: /specweave-jira:pull
|
|
130
|
+
|
|
131
|
+
Claude:
|
|
132
|
+
Pulling from Jira...
|
|
133
|
+
Increment: 0005-payment-integration
|
|
134
|
+
Issue: PROJ-123
|
|
135
|
+
|
|
136
|
+
Changes Applied:
|
|
137
|
+
Status: In Progress -> Done (completed)
|
|
138
|
+
|
|
139
|
+
Pull complete!
|
|
140
|
+
```
|
|
141
|
+
|
|
142
|
+
### Example 2: Already Up to Date
|
|
143
|
+
|
|
144
|
+
```
|
|
145
|
+
User: /specweave-jira:pull 0005
|
|
146
|
+
|
|
147
|
+
Claude:
|
|
148
|
+
Pulling from Jira...
|
|
149
|
+
Increment: 0005-payment-integration
|
|
150
|
+
Issue: PROJ-123
|
|
151
|
+
|
|
152
|
+
Already up to date!
|
|
153
|
+
Last synced: 5 minutes ago
|
|
154
|
+
```
|
|
155
|
+
|
|
156
|
+
---
|
|
157
|
+
|
|
158
|
+
## Related Commands
|
|
159
|
+
|
|
160
|
+
| Command | Purpose |
|
|
161
|
+
|---------|---------|
|
|
162
|
+
| `/specweave-jira:push` | Push local changes to Jira |
|
|
163
|
+
| `/specweave-jira:sync` | Two-way sync (pull + push) |
|
|
164
|
+
| `/specweave-jira:import-boards` | Import Jira boards |
|
|
@@ -0,0 +1,170 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: specweave-jira:push
|
|
3
|
+
description: Push local progress to Jira (like git push). Updates epic/story with task completion and comments.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Jira Push Command
|
|
7
|
+
|
|
8
|
+
**Usage**: `/specweave-jira:push [increment-id]`
|
|
9
|
+
|
|
10
|
+
**Purpose**: Push local progress to Jira (like `git push`)
|
|
11
|
+
|
|
12
|
+
---
|
|
13
|
+
|
|
14
|
+
## Quick Start
|
|
15
|
+
|
|
16
|
+
```bash
|
|
17
|
+
# Push current/active increment
|
|
18
|
+
/specweave-jira:push
|
|
19
|
+
|
|
20
|
+
# Push specific increment
|
|
21
|
+
/specweave-jira:push 0005
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
---
|
|
25
|
+
|
|
26
|
+
## What Gets Pushed
|
|
27
|
+
|
|
28
|
+
| Field | Source |
|
|
29
|
+
|-------|--------|
|
|
30
|
+
| **Progress** | Calculated from tasks.md (X/Y tasks, Z%) |
|
|
31
|
+
| **Comment** | Auto-generated with completed tasks list |
|
|
32
|
+
| **Status** | Transition if threshold crossed |
|
|
33
|
+
| **Custom Fields** | Completion % if field exists |
|
|
34
|
+
|
|
35
|
+
---
|
|
36
|
+
|
|
37
|
+
## Command Behavior
|
|
38
|
+
|
|
39
|
+
When user runs this command:
|
|
40
|
+
|
|
41
|
+
### 1. Check Permission Gate
|
|
42
|
+
|
|
43
|
+
```typescript
|
|
44
|
+
const config = JSON.parse(await fs.readFile('.specweave/config.json', 'utf-8'));
|
|
45
|
+
const canUpdateExternal = config?.sync?.settings?.canUpdateExternalItems ?? false;
|
|
46
|
+
|
|
47
|
+
if (!canUpdateExternal) {
|
|
48
|
+
console.log(`
|
|
49
|
+
Permission Denied: Jira writes disabled
|
|
50
|
+
|
|
51
|
+
To enable: Set sync.settings.canUpdateExternalItems = true
|
|
52
|
+
|
|
53
|
+
Or use read-only: /specweave-jira:pull ${incrementId}
|
|
54
|
+
`);
|
|
55
|
+
return;
|
|
56
|
+
}
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
### 2. Calculate Progress
|
|
60
|
+
|
|
61
|
+
```typescript
|
|
62
|
+
const tasksContent = await fs.readFile(
|
|
63
|
+
`.specweave/increments/${incrementId}/tasks.md`, 'utf-8'
|
|
64
|
+
);
|
|
65
|
+
|
|
66
|
+
const totalTasks = (tasksContent.match(/### T-\d+/g) || []).length;
|
|
67
|
+
const completedTasks = (tasksContent.match(/\[x\] completed/gi) || []).length;
|
|
68
|
+
const percentage = Math.round((completedTasks / totalTasks) * 100);
|
|
69
|
+
```
|
|
70
|
+
|
|
71
|
+
### 3. Invoke Push Sync
|
|
72
|
+
|
|
73
|
+
```
|
|
74
|
+
Use Task tool with subagent_type: "specweave-jira:jira-manager:jira-manager"
|
|
75
|
+
|
|
76
|
+
Prompt: "Push progress to Jira for increment {increment-id}.
|
|
77
|
+
|
|
78
|
+
Issue: {jiraIssueKey}
|
|
79
|
+
Progress: {completedTasks}/{totalTasks} ({percentage}%)
|
|
80
|
+
|
|
81
|
+
Steps:
|
|
82
|
+
1. Format progress comment with task list
|
|
83
|
+
2. POST comment to Jira issue
|
|
84
|
+
3. Update custom fields if available
|
|
85
|
+
4. Transition status if threshold crossed:
|
|
86
|
+
- 100% completed -> Done (if canUpdateStatus)
|
|
87
|
+
5. Update sync timestamp in metadata
|
|
88
|
+
6. Display push summary"
|
|
89
|
+
```
|
|
90
|
+
|
|
91
|
+
### 4. Display Result
|
|
92
|
+
|
|
93
|
+
```
|
|
94
|
+
Pushed to Jira
|
|
95
|
+
|
|
96
|
+
Issue: PROJ-123
|
|
97
|
+
Project: My Project
|
|
98
|
+
|
|
99
|
+
Progress: 6/10 tasks (60%)
|
|
100
|
+
|
|
101
|
+
Comment posted:
|
|
102
|
+
"Progress Update: 60% complete
|
|
103
|
+
|
|
104
|
+
Recently completed:
|
|
105
|
+
- T-005: Add payment validation
|
|
106
|
+
- T-006: Implement refund flow"
|
|
107
|
+
|
|
108
|
+
Fields updated:
|
|
109
|
+
Completion: 60%
|
|
110
|
+
|
|
111
|
+
URL: https://mycompany.atlassian.net/browse/PROJ-123
|
|
112
|
+
```
|
|
113
|
+
|
|
114
|
+
---
|
|
115
|
+
|
|
116
|
+
## Permission Requirements
|
|
117
|
+
|
|
118
|
+
| Permission | Required | Purpose |
|
|
119
|
+
|------------|----------|---------|
|
|
120
|
+
| `canUpdateExternalItems` | **true** | Write to Jira |
|
|
121
|
+
| `canUpdateStatus` | optional | Transition issue status |
|
|
122
|
+
|
|
123
|
+
---
|
|
124
|
+
|
|
125
|
+
## Examples
|
|
126
|
+
|
|
127
|
+
### Example 1: Simple Push
|
|
128
|
+
|
|
129
|
+
```
|
|
130
|
+
User: /specweave-jira:push
|
|
131
|
+
|
|
132
|
+
Claude:
|
|
133
|
+
Pushing to Jira...
|
|
134
|
+
Increment: 0005-payment-integration
|
|
135
|
+
Issue: PROJ-123
|
|
136
|
+
|
|
137
|
+
Progress: 8/10 tasks (80%)
|
|
138
|
+
Comment posted.
|
|
139
|
+
|
|
140
|
+
Push complete!
|
|
141
|
+
```
|
|
142
|
+
|
|
143
|
+
### Example 2: 100% Complete
|
|
144
|
+
|
|
145
|
+
```
|
|
146
|
+
User: /specweave-jira:push 0005
|
|
147
|
+
|
|
148
|
+
Claude:
|
|
149
|
+
Pushing to Jira...
|
|
150
|
+
|
|
151
|
+
Progress: 10/10 tasks (100%)
|
|
152
|
+
|
|
153
|
+
Comment posted:
|
|
154
|
+
"All tasks complete!"
|
|
155
|
+
|
|
156
|
+
Status transitioned:
|
|
157
|
+
In Progress -> Done (canUpdateStatus = true)
|
|
158
|
+
|
|
159
|
+
Ready to close: /specweave:done 0005
|
|
160
|
+
```
|
|
161
|
+
|
|
162
|
+
---
|
|
163
|
+
|
|
164
|
+
## Related Commands
|
|
165
|
+
|
|
166
|
+
| Command | Purpose |
|
|
167
|
+
|---------|---------|
|
|
168
|
+
| `/specweave-jira:pull` | Pull changes from Jira |
|
|
169
|
+
| `/specweave-jira:sync` | Two-way sync (pull + push) |
|
|
170
|
+
| `/specweave-jira:import-boards` | Import Jira boards |
|