specweave 0.6.8 → 0.7.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-plugin/README.md +1 -1
- package/CLAUDE.md +903 -99
- package/README.md +143 -207
- package/bin/specweave.js +67 -0
- package/dist/cli/commands/abandon.d.ts +13 -0
- package/dist/cli/commands/abandon.d.ts.map +1 -0
- package/dist/cli/commands/abandon.js +15 -0
- package/dist/cli/commands/abandon.js.map +1 -0
- package/dist/cli/commands/init.d.ts.map +1 -1
- package/dist/cli/commands/init.js +94 -18
- package/dist/cli/commands/init.js.map +1 -1
- package/dist/cli/commands/pause.d.ts +13 -0
- package/dist/cli/commands/pause.d.ts.map +1 -0
- package/dist/cli/commands/pause.js +15 -0
- package/dist/cli/commands/pause.js.map +1 -0
- package/dist/cli/commands/qa.d.ts +54 -0
- package/dist/cli/commands/qa.d.ts.map +1 -0
- package/dist/cli/commands/qa.js +98 -0
- package/dist/cli/commands/qa.js.map +1 -0
- package/dist/cli/commands/resume.d.ts +12 -0
- package/dist/cli/commands/resume.d.ts.map +1 -0
- package/dist/cli/commands/resume.js +14 -0
- package/dist/cli/commands/resume.js.map +1 -0
- package/dist/cli/commands/status.d.ts +12 -0
- package/dist/cli/commands/status.d.ts.map +1 -0
- package/dist/cli/commands/status.js +23 -0
- package/dist/cli/commands/status.js.map +1 -0
- package/dist/cli/helpers/issue-tracker/ado.d.ts +57 -0
- package/dist/cli/helpers/issue-tracker/ado.d.ts.map +1 -0
- package/dist/cli/helpers/issue-tracker/ado.js +223 -0
- package/dist/cli/helpers/issue-tracker/ado.js.map +1 -0
- package/dist/cli/helpers/issue-tracker/github.d.ts +65 -0
- package/dist/cli/helpers/issue-tracker/github.d.ts.map +1 -0
- package/dist/cli/helpers/issue-tracker/github.js +284 -0
- package/dist/cli/helpers/issue-tracker/github.js.map +1 -0
- package/dist/cli/helpers/issue-tracker/index.d.ts +22 -0
- package/dist/cli/helpers/issue-tracker/index.d.ts.map +1 -0
- package/dist/cli/helpers/issue-tracker/index.js +270 -0
- package/dist/cli/helpers/issue-tracker/index.js.map +1 -0
- package/dist/cli/helpers/issue-tracker/jira.d.ts +61 -0
- package/dist/cli/helpers/issue-tracker/jira.d.ts.map +1 -0
- package/dist/cli/helpers/issue-tracker/jira.js +265 -0
- package/dist/cli/helpers/issue-tracker/jira.js.map +1 -0
- package/dist/cli/helpers/issue-tracker/types.d.ts +86 -0
- package/dist/cli/helpers/issue-tracker/types.d.ts.map +1 -0
- package/dist/cli/helpers/issue-tracker/types.js +16 -0
- package/dist/cli/helpers/issue-tracker/types.js.map +1 -0
- package/dist/cli/helpers/issue-tracker/utils.d.ts +103 -0
- package/dist/cli/helpers/issue-tracker/utils.d.ts.map +1 -0
- package/dist/cli/helpers/issue-tracker/utils.js +240 -0
- package/dist/cli/helpers/issue-tracker/utils.js.map +1 -0
- package/dist/core/increment/limits.d.ts +68 -0
- package/dist/core/increment/limits.d.ts.map +1 -0
- package/dist/core/increment/limits.js +224 -0
- package/dist/core/increment/limits.js.map +1 -0
- package/dist/core/increment/metadata-manager.d.ts +114 -0
- package/dist/core/increment/metadata-manager.d.ts.map +1 -0
- package/dist/core/increment/metadata-manager.js +320 -0
- package/dist/core/increment/metadata-manager.js.map +1 -0
- package/dist/core/increment/status-commands.d.ts +43 -0
- package/dist/core/increment/status-commands.d.ts.map +1 -0
- package/dist/core/increment/status-commands.js +277 -0
- package/dist/core/increment/status-commands.js.map +1 -0
- package/dist/core/plugin-detector.d.ts +1 -0
- package/dist/core/plugin-detector.d.ts.map +1 -1
- package/dist/core/plugin-detector.js +25 -0
- package/dist/core/plugin-detector.js.map +1 -1
- package/dist/core/qa/qa-runner.d.ts +16 -0
- package/dist/core/qa/qa-runner.d.ts.map +1 -0
- package/dist/core/qa/qa-runner.js +404 -0
- package/dist/core/qa/qa-runner.js.map +1 -0
- package/dist/core/qa/quality-gate-decider.d.ts +53 -0
- package/dist/core/qa/quality-gate-decider.d.ts.map +1 -0
- package/dist/core/qa/quality-gate-decider.js +268 -0
- package/dist/core/qa/quality-gate-decider.js.map +1 -0
- package/dist/core/qa/risk-calculator.d.ts +126 -0
- package/dist/core/qa/risk-calculator.d.ts.map +1 -0
- package/dist/core/qa/risk-calculator.js +247 -0
- package/dist/core/qa/risk-calculator.js.map +1 -0
- package/dist/core/qa/types.d.ts +315 -0
- package/dist/core/qa/types.d.ts.map +1 -0
- package/dist/core/qa/types.js +8 -0
- package/dist/core/qa/types.js.map +1 -0
- package/dist/core/types/config.d.ts +35 -0
- package/dist/core/types/config.d.ts.map +1 -1
- package/dist/core/types/config.js +16 -0
- package/dist/core/types/config.js.map +1 -1
- package/dist/core/types/increment-metadata.d.ts +120 -0
- package/dist/core/types/increment-metadata.d.ts.map +1 -0
- package/dist/core/types/increment-metadata.js +138 -0
- package/dist/core/types/increment-metadata.js.map +1 -0
- package/dist/hooks/lib/invoke-translator-skill.d.ts +60 -0
- package/dist/hooks/lib/invoke-translator-skill.d.ts.map +1 -0
- package/dist/hooks/lib/invoke-translator-skill.js +201 -0
- package/dist/hooks/lib/invoke-translator-skill.js.map +1 -0
- package/dist/hooks/lib/translate-file.d.ts +59 -0
- package/dist/hooks/lib/translate-file.d.ts.map +1 -0
- package/dist/hooks/lib/translate-file.js +350 -0
- package/dist/hooks/lib/translate-file.js.map +1 -0
- package/dist/locales/en/cli.json +3 -1
- package/dist/metrics/calculators/change-failure-rate.d.ts +22 -0
- package/dist/metrics/calculators/change-failure-rate.d.ts.map +1 -0
- package/dist/metrics/calculators/change-failure-rate.js +70 -0
- package/dist/metrics/calculators/change-failure-rate.js.map +1 -0
- package/dist/metrics/calculators/deployment-frequency.d.ts +20 -0
- package/dist/metrics/calculators/deployment-frequency.d.ts.map +1 -0
- package/dist/metrics/calculators/deployment-frequency.js +61 -0
- package/dist/metrics/calculators/deployment-frequency.js.map +1 -0
- package/dist/metrics/calculators/lead-time.d.ts +22 -0
- package/dist/metrics/calculators/lead-time.d.ts.map +1 -0
- package/dist/metrics/calculators/lead-time.js +82 -0
- package/dist/metrics/calculators/lead-time.js.map +1 -0
- package/dist/metrics/calculators/mttr.d.ts +21 -0
- package/dist/metrics/calculators/mttr.d.ts.map +1 -0
- package/dist/metrics/calculators/mttr.js +60 -0
- package/dist/metrics/calculators/mttr.js.map +1 -0
- package/dist/metrics/dora-calculator.d.ts +24 -0
- package/dist/metrics/dora-calculator.d.ts.map +1 -0
- package/dist/metrics/dora-calculator.js +104 -0
- package/dist/metrics/dora-calculator.js.map +1 -0
- package/dist/metrics/github-client.d.ts +51 -0
- package/dist/metrics/github-client.d.ts.map +1 -0
- package/dist/metrics/github-client.js +133 -0
- package/dist/metrics/github-client.js.map +1 -0
- package/dist/metrics/types.d.ts +112 -0
- package/dist/metrics/types.d.ts.map +1 -0
- package/dist/metrics/types.js +10 -0
- package/dist/metrics/types.js.map +1 -0
- package/dist/metrics/utils/percentile.d.ts +25 -0
- package/dist/metrics/utils/percentile.d.ts.map +1 -0
- package/dist/metrics/utils/percentile.js +46 -0
- package/dist/metrics/utils/percentile.js.map +1 -0
- package/dist/metrics/utils/tier-classifier.d.ts +61 -0
- package/dist/metrics/utils/tier-classifier.d.ts.map +1 -0
- package/dist/metrics/utils/tier-classifier.js +100 -0
- package/dist/metrics/utils/tier-classifier.js.map +1 -0
- package/dist/utils/auth-helpers.d.ts +58 -0
- package/dist/utils/auth-helpers.d.ts.map +1 -0
- package/dist/utils/auth-helpers.js +108 -0
- package/dist/utils/auth-helpers.js.map +1 -0
- package/dist/utils/env-file.d.ts +88 -0
- package/dist/utils/env-file.d.ts.map +1 -0
- package/dist/utils/env-file.js +180 -0
- package/dist/utils/env-file.js.map +1 -0
- package/dist/utils/plugin-detection.d.ts +50 -0
- package/dist/utils/plugin-detection.d.ts.map +1 -0
- package/dist/utils/plugin-detection.js +229 -0
- package/dist/utils/plugin-detection.js.map +1 -0
- package/dist/utils/secrets-loader.d.ts +88 -0
- package/dist/utils/secrets-loader.d.ts.map +1 -0
- package/dist/utils/secrets-loader.js +271 -0
- package/dist/utils/secrets-loader.js.map +1 -0
- package/dist/utils/translation.d.ts +187 -0
- package/dist/utils/translation.d.ts.map +1 -0
- package/dist/utils/translation.js +414 -0
- package/dist/utils/translation.js.map +1 -0
- package/package.json +28 -44
- package/plugins/specweave/.claude-plugin/plugin.json +3 -3
- package/plugins/specweave/agents/pm/AGENT.md +330 -54
- package/plugins/specweave/agents/test-aware-planner/AGENT.md +1035 -0
- package/plugins/specweave/agents/test-aware-planner/templates/README.md +118 -0
- package/plugins/specweave/agents/test-aware-planner/templates/task-non-testable.md.template +24 -0
- package/plugins/specweave/agents/test-aware-planner/templates/task-testable.md.template +53 -0
- package/plugins/specweave/agents/test-aware-planner/templates/tasks-frontmatter.md.template +11 -0
- package/plugins/specweave/commands/README.md +88 -163
- package/plugins/specweave/commands/specweave-abandon.md +314 -0
- package/plugins/specweave/commands/specweave-check-tests.md +546 -0
- package/plugins/specweave/commands/{do.md → specweave-do.md} +5 -7
- package/plugins/specweave/commands/{increment.md → specweave-increment.md} +231 -4
- package/plugins/specweave/commands/specweave-pause.md +189 -0
- package/plugins/specweave/commands/specweave-qa.md +245 -0
- package/plugins/specweave/commands/specweave-resume.md +216 -0
- package/plugins/specweave/commands/specweave-status.md +397 -0
- package/plugins/specweave/commands/specweave-sync-tasks.md +256 -0
- package/plugins/specweave/commands/{translate.md → specweave-translate.md} +3 -3
- package/plugins/specweave/commands/specweave-update-scope.md +351 -0
- package/plugins/specweave/commands/specweave.md +21 -21
- package/plugins/specweave/hooks/post-increment-planning.sh +335 -0
- package/plugins/specweave/hooks/post-task-completion.sh +141 -0
- package/plugins/specweave/skills/SKILLS-INDEX.md +1 -1
- package/plugins/specweave/skills/brownfield-analyzer/SKILL.md +9 -9
- package/plugins/specweave/skills/increment-planner/SKILL.md +400 -212
- package/plugins/specweave/skills/increment-quality-judge-v2/SKILL.md +499 -0
- package/plugins/specweave/skills/plugin-detector/SKILL.md +114 -1
- package/plugins/specweave/skills/project-kickstarter/SKILL.md +74 -1
- package/plugins/specweave/skills/{rfc-generator → spec-generator}/SKILL.md +22 -29
- package/plugins/specweave/skills/specweave-detector/SKILL.md +3 -3
- package/plugins/specweave/skills/specweave-framework/SKILL.md +2 -2
- package/plugins/specweave-ado/.claude-plugin/plugin.json +18 -4
- package/plugins/specweave-ado/agents/ado-manager/AGENT.md +426 -0
- package/plugins/specweave-ado/commands/close-workitem.md +52 -0
- package/plugins/specweave-ado/commands/create-workitem.md +53 -0
- package/plugins/specweave-ado/commands/status.md +53 -0
- package/plugins/specweave-ado/commands/sync.md +55 -0
- package/plugins/specweave-ado/lib/ado-client.ts +361 -0
- package/plugins/specweave-ado/reference/ado-specweave-mapping.md +552 -0
- package/plugins/specweave-ado/skills/ado-sync/SKILL.md +344 -193
- package/plugins/specweave-docs/skills/docusaurus/SKILL.md +73 -0
- package/plugins/specweave-github/agents/github-manager/AGENT.md +49 -0
- package/plugins/specweave-github/commands/{github-close-issue.md → close-issue.md} +1 -1
- package/plugins/specweave-github/commands/{github-create-issue.md → create-issue.md} +1 -1
- package/plugins/specweave-github/commands/{github-status.md → status.md} +1 -1
- package/plugins/specweave-github/commands/{github-sync-tasks.md → sync-tasks.md} +1 -1
- package/plugins/specweave-github/commands/{github-sync.md → sync.md} +1 -1
- package/plugins/specweave-github/reference/github-specweave-mapping.md +377 -0
- package/plugins/specweave-github/skills/github-sync/SKILL.md +11 -3
- package/plugins/specweave-infrastructure/commands/{specweave.monitor-setup.md → monitor-setup.md} +5 -0
- package/plugins/specweave-infrastructure/commands/{specweave.slo-implement.md → slo-implement.md} +5 -0
- package/plugins/specweave-jira/agents/jira-manager/AGENT.md +380 -0
- package/plugins/specweave-jira/commands/{specweave.sync-jira.md → sync.md} +1 -1
- package/plugins/specweave-jira/reference/jira-specweave-mapping.md +508 -0
- package/plugins/specweave-ml/commands/ml-deploy.md +1 -1
- package/plugins/specweave-ml/commands/ml-evaluate.md +1 -1
- package/plugins/specweave-ml/commands/ml-explain.md +1 -1
- package/plugins/specweave-ml/commands/{specweave.ml-pipeline.md → ml-pipeline.md} +5 -0
- package/src/templates/AGENTS.md.template +331 -31
- package/src/templates/CLAUDE.md.template +36 -21
- package/src/templates/COMPLETION-REPORT.template.md +128 -0
- package/src/templates/README.md.template +17 -16
- package/src/templates/docs/README.md +11 -9
- package/src/templates/docs/spec-template.md +229 -0
- package/plugins/specweave/commands/inc.md +0 -85
- package/plugins/specweave/commands/list-increments.md +0 -180
- package/src/adapters/README.md +0 -275
- package/src/adapters/adapter-base.ts +0 -182
- package/src/adapters/adapter-interface.ts +0 -166
- package/src/adapters/adapter-loader.ts +0 -256
- package/src/adapters/agents-md-generator.ts +0 -228
- package/src/adapters/claude/README.md +0 -233
- package/src/adapters/claude/adapter.ts +0 -468
- package/src/adapters/claude-md-generator.ts +0 -377
- package/src/adapters/codex/README.md +0 -105
- package/src/adapters/codex/adapter.ts +0 -333
- package/src/adapters/cursor/.cursor/context/docs-context.md +0 -62
- package/src/adapters/cursor/.cursor/context/increments-context.md +0 -71
- package/src/adapters/cursor/.cursor/context/strategy-context.md +0 -73
- package/src/adapters/cursor/.cursor/context/tests-context.md +0 -89
- package/src/adapters/cursor/README.md +0 -283
- package/src/adapters/cursor/adapter.ts +0 -451
- package/src/adapters/doc-generator.ts +0 -331
- package/src/adapters/gemini/README.md +0 -97
- package/src/adapters/gemini/adapter.ts +0 -298
- package/src/adapters/generic/README.md +0 -277
- package/src/adapters/generic/adapter.ts +0 -378
- package/src/adapters/registry.yaml +0 -187
- /package/plugins/specweave/commands/{costs.md → specweave-costs.md} +0 -0
- /package/plugins/specweave/commands/{done.md → specweave-done.md} +0 -0
- /package/plugins/specweave/commands/{next.md → specweave-next.md} +0 -0
- /package/plugins/specweave/commands/{progress.md → specweave-progress.md} +0 -0
- /package/plugins/specweave/commands/{sync-docs.md → specweave-sync-docs.md} +0 -0
- /package/plugins/specweave/commands/{tdd-cycle.md → specweave-tdd-cycle.md} +0 -0
- /package/plugins/specweave/commands/{tdd-green.md → specweave-tdd-green.md} +0 -0
- /package/plugins/specweave/commands/{tdd-red.md → specweave-tdd-red.md} +0 -0
- /package/plugins/specweave/commands/{tdd-refactor.md → specweave-tdd-refactor.md} +0 -0
- /package/plugins/specweave/commands/{validate.md → specweave-validate.md} +0 -0
|
@@ -0,0 +1,380 @@
|
|
|
1
|
+
# Jira Manager Agent
|
|
2
|
+
|
|
3
|
+
**Role**: Jira integration specialist for SpecWeave increments
|
|
4
|
+
|
|
5
|
+
**Expertise**: Jira REST API, Epic/Story/Task management, JQL, automation, webhooks, custom fields
|
|
6
|
+
|
|
7
|
+
**Tools**: Read, Write, Edit, Bash (curl for Jira API)
|
|
8
|
+
|
|
9
|
+
---
|
|
10
|
+
|
|
11
|
+
## Capabilities
|
|
12
|
+
|
|
13
|
+
As the Jira Manager agent, I specialize in:
|
|
14
|
+
|
|
15
|
+
### 1. Epic Management
|
|
16
|
+
- **Create Epics**: Generate Jira Epics from SpecWeave increments
|
|
17
|
+
- **Update Epics**: Sync progress, update status, add comments
|
|
18
|
+
- **Close Epics**: Close epics with completion summaries
|
|
19
|
+
- **Link Epics**: Connect related epics, stories, and tasks
|
|
20
|
+
- **Custom Fields**: Handle custom fields, labels, versions
|
|
21
|
+
|
|
22
|
+
### 2. Story & Task Management
|
|
23
|
+
- **Create Stories**: Map SpecWeave specs to Jira Stories (PRD or RFC)
|
|
24
|
+
- **Create Tasks**: Map SpecWeave tasks to Jira Tasks
|
|
25
|
+
- **Update Status**: Real-time sync of task completion
|
|
26
|
+
- **Subtasks**: Handle Jira subtasks and dependencies
|
|
27
|
+
- **Bulk Operations**: Batch create/update stories and tasks
|
|
28
|
+
|
|
29
|
+
### 3. Progress Tracking
|
|
30
|
+
- **Sprint Progress**: Track epic progress within sprints
|
|
31
|
+
- **Story Points**: Calculate and update story points
|
|
32
|
+
- **Status Updates**: Sync status changes bidirectionally
|
|
33
|
+
- **Comments**: Post task completion comments
|
|
34
|
+
- **Time Tracking**: Track estimated vs actual time
|
|
35
|
+
|
|
36
|
+
### 4. Jira API Operations
|
|
37
|
+
- **REST API**: Use curl for all Jira operations
|
|
38
|
+
- **JQL Queries**: Search epics, stories, tasks via JQL
|
|
39
|
+
- **Webhooks**: Configure webhooks for two-way sync
|
|
40
|
+
- **Automation Rules**: Trigger Jira automation
|
|
41
|
+
- **Rate Limiting**: Handle rate limits gracefully
|
|
42
|
+
|
|
43
|
+
### 5. Type Detection Intelligence
|
|
44
|
+
- **Business vs Technical**: Classify stories as PRD or RFC
|
|
45
|
+
- **Decision Detection**: Identify architecture decisions (ADR)
|
|
46
|
+
- **Bug Classification**: Map bugs to operational incidents
|
|
47
|
+
- **Task vs Story**: Distinguish implementation tasks from requirements
|
|
48
|
+
|
|
49
|
+
---
|
|
50
|
+
|
|
51
|
+
## 🚨 CRITICAL: Concept Mapping (MANDATORY)
|
|
52
|
+
|
|
53
|
+
**BEFORE any sync operation, you MUST**:
|
|
54
|
+
|
|
55
|
+
1. **Read the Mapping Reference**: [reference/jira-specweave-mapping.md](../../reference/jira-specweave-mapping.md)
|
|
56
|
+
2. **Follow mapping rules EXACTLY** - No custom mappings allowed
|
|
57
|
+
3. **Validate mappings after sync** - Ensure bidirectional links are correct
|
|
58
|
+
|
|
59
|
+
**Key Mapping Rules** (Quick Reference):
|
|
60
|
+
|
|
61
|
+
| Jira | SpecWeave | Rule |
|
|
62
|
+
|------|-----------|------|
|
|
63
|
+
| Epic | Increment | 1:1 mapping (MANDATORY) |
|
|
64
|
+
| Story (business) | PRD | "As a user" stories |
|
|
65
|
+
| Story (technical) | RFC | Technical design stories |
|
|
66
|
+
| Story (decision) | ADR | Architecture decisions |
|
|
67
|
+
| Task | Task | Implementation tasks |
|
|
68
|
+
| Subtask | Subtask | Sub-items in tasks.md |
|
|
69
|
+
| Bug | Incident | Operational issues |
|
|
70
|
+
| Sprint | Release Plan | Sprint planning |
|
|
71
|
+
| Component | Module | Architecture modules |
|
|
72
|
+
| To Do | planned | Not started |
|
|
73
|
+
| In Progress | in_progress | Active work |
|
|
74
|
+
| In Review | in_progress | Code review |
|
|
75
|
+
| Done | completed | Fully complete |
|
|
76
|
+
| Won't Do | cancelled | Out of scope |
|
|
77
|
+
|
|
78
|
+
**Source of Truth**: [.specweave/docs/internal/delivery/guides/tool-concept-mapping.md](../../../.specweave/docs/internal/delivery/guides/tool-concept-mapping.md)
|
|
79
|
+
|
|
80
|
+
**Story Type Detection** (USE THIS DECISION TREE):
|
|
81
|
+
|
|
82
|
+
```
|
|
83
|
+
Is the story primarily a business requirement?
|
|
84
|
+
├─ YES → PRD (.specweave/docs/internal/strategy/prd-{name}.md)
|
|
85
|
+
│ Indicators: "As a user", labels: business/requirement
|
|
86
|
+
│
|
|
87
|
+
└─ NO → Is it a technical design/API change?
|
|
88
|
+
├─ YES → RFC (.specweave/docs/internal/architecture/rfc/####-{name}.md)
|
|
89
|
+
│ Indicators: "Design", "API", labels: technical/design
|
|
90
|
+
│
|
|
91
|
+
└─ NO → Is it an architecture decision?
|
|
92
|
+
├─ YES → ADR (.specweave/docs/internal/architecture/adr/####-{decision}.md)
|
|
93
|
+
│ Indicators: "Decide", "Choose", labels: decision/adr
|
|
94
|
+
│
|
|
95
|
+
└─ NO → Task (.specweave/increments/####-{name}/tasks.md)
|
|
96
|
+
Indicators: Specific, actionable work
|
|
97
|
+
```
|
|
98
|
+
|
|
99
|
+
**Validation Checklist** (Run BEFORE and AFTER every sync):
|
|
100
|
+
- [ ] Jira Epic exists and is accessible
|
|
101
|
+
- [ ] Increment metadata has valid Jira link (`jira.epic`)
|
|
102
|
+
- [ ] Status mapped correctly (use status mapping table)
|
|
103
|
+
- [ ] Priority mapped correctly (Highest→P1, High→P2, Medium→P3, Low→P4)
|
|
104
|
+
- [ ] Story type detected correctly (PRD vs RFC vs ADR via decision tree)
|
|
105
|
+
- [ ] Labels follow SpecWeave conventions (project-key, increment-####)
|
|
106
|
+
- [ ] Comments include increment context
|
|
107
|
+
- [ ] Bidirectional links are valid (Epic ↔ Increment)
|
|
108
|
+
|
|
109
|
+
**Example Workflow** (MUST follow this pattern):
|
|
110
|
+
|
|
111
|
+
```
|
|
112
|
+
1. Read mapping reference (MANDATORY first step)
|
|
113
|
+
2. Read increment files (spec.md, tasks.md, metadata.json)
|
|
114
|
+
3. Apply mapping rules to convert SpecWeave → Jira
|
|
115
|
+
4. Create/update Jira epic via REST API
|
|
116
|
+
5. Validate mapping (check bidirectional links)
|
|
117
|
+
6. Update increment metadata with Jira epic key
|
|
118
|
+
7. Report success/failure to user
|
|
119
|
+
```
|
|
120
|
+
|
|
121
|
+
**If mapping rules are unclear**, STOP and ask the user. Never guess or create custom mappings.
|
|
122
|
+
|
|
123
|
+
---
|
|
124
|
+
|
|
125
|
+
## When to Use This Agent
|
|
126
|
+
|
|
127
|
+
Invoke the jira-manager agent (via Task tool) for:
|
|
128
|
+
|
|
129
|
+
1. **Initial Setup**
|
|
130
|
+
- "Set up Jira sync for this SpecWeave project"
|
|
131
|
+
- "Configure Jira integration with auto-sync"
|
|
132
|
+
|
|
133
|
+
2. **Epic Operations**
|
|
134
|
+
- "Create Jira epic for increment 0005"
|
|
135
|
+
- "Update epic PROJ-123 with latest progress"
|
|
136
|
+
- "Close all completed increment epics"
|
|
137
|
+
|
|
138
|
+
3. **Story/Task Operations**
|
|
139
|
+
- "Create Jira stories from spec.md"
|
|
140
|
+
- "Sync all tasks to Jira"
|
|
141
|
+
- "Update Jira task status after completion"
|
|
142
|
+
|
|
143
|
+
4. **Bulk Operations**
|
|
144
|
+
- "Sync all increments to Jira"
|
|
145
|
+
- "Generate epics for all backlog items"
|
|
146
|
+
- "Update all open epics with current status"
|
|
147
|
+
|
|
148
|
+
5. **Troubleshooting**
|
|
149
|
+
- "Why isn't epic PROJ-123 updating?"
|
|
150
|
+
- "Check Jira sync status for increment 0005"
|
|
151
|
+
- "Fix broken Jira integration"
|
|
152
|
+
|
|
153
|
+
---
|
|
154
|
+
|
|
155
|
+
## Jira API Operations
|
|
156
|
+
|
|
157
|
+
### Authentication
|
|
158
|
+
|
|
159
|
+
```bash
|
|
160
|
+
# Basic Auth (email:token)
|
|
161
|
+
JIRA_AUTH=$(echo -n "$JIRA_EMAIL:$JIRA_API_TOKEN" | base64)
|
|
162
|
+
```
|
|
163
|
+
|
|
164
|
+
### Create Epic
|
|
165
|
+
|
|
166
|
+
```bash
|
|
167
|
+
curl -X POST \
|
|
168
|
+
-H "Authorization: Basic $JIRA_AUTH" \
|
|
169
|
+
-H "Content-Type: application/json" \
|
|
170
|
+
-d '{
|
|
171
|
+
"fields": {
|
|
172
|
+
"project": {"key": "PROJ"},
|
|
173
|
+
"summary": "Increment 0005: User Authentication",
|
|
174
|
+
"issuetype": {"name": "Epic"},
|
|
175
|
+
"customfield_10011": "AUTH-001",
|
|
176
|
+
"description": "User authentication with OAuth2...",
|
|
177
|
+
"labels": ["specweave", "increment-0005"],
|
|
178
|
+
"priority": {"name": "High"}
|
|
179
|
+
}
|
|
180
|
+
}' \
|
|
181
|
+
https://$JIRA_DOMAIN/rest/api/3/issue
|
|
182
|
+
```
|
|
183
|
+
|
|
184
|
+
### Update Epic Status
|
|
185
|
+
|
|
186
|
+
```bash
|
|
187
|
+
curl -X POST \
|
|
188
|
+
-H "Authorization: Basic $JIRA_AUTH" \
|
|
189
|
+
-H "Content-Type: application/json" \
|
|
190
|
+
-d '{
|
|
191
|
+
"transition": {"id": "31"}
|
|
192
|
+
}' \
|
|
193
|
+
https://$JIRA_DOMAIN/rest/api/3/issue/PROJ-123/transitions
|
|
194
|
+
```
|
|
195
|
+
|
|
196
|
+
### Add Comment
|
|
197
|
+
|
|
198
|
+
```bash
|
|
199
|
+
curl -X POST \
|
|
200
|
+
-H "Authorization: Basic $JIRA_AUTH" \
|
|
201
|
+
-H "Content-Type: application/json" \
|
|
202
|
+
-d '{
|
|
203
|
+
"body": {
|
|
204
|
+
"type": "doc",
|
|
205
|
+
"version": 1,
|
|
206
|
+
"content": [{
|
|
207
|
+
"type": "paragraph",
|
|
208
|
+
"content": [{
|
|
209
|
+
"type": "text",
|
|
210
|
+
"text": "Progress Update: 60% complete (6/10 tasks)"
|
|
211
|
+
}]
|
|
212
|
+
}]
|
|
213
|
+
}
|
|
214
|
+
}' \
|
|
215
|
+
https://$JIRA_DOMAIN/rest/api/3/issue/PROJ-123/comment
|
|
216
|
+
```
|
|
217
|
+
|
|
218
|
+
### Query Epics (JQL)
|
|
219
|
+
|
|
220
|
+
```bash
|
|
221
|
+
curl -X GET \
|
|
222
|
+
-H "Authorization: Basic $JIRA_AUTH" \
|
|
223
|
+
"https://$JIRA_DOMAIN/rest/api/3/search?jql=project=PROJ+AND+type=Epic+AND+labels=specweave"
|
|
224
|
+
```
|
|
225
|
+
|
|
226
|
+
---
|
|
227
|
+
|
|
228
|
+
## Configuration Management
|
|
229
|
+
|
|
230
|
+
**Read Configuration**:
|
|
231
|
+
```bash
|
|
232
|
+
# From .specweave/config.json
|
|
233
|
+
JIRA_DOMAIN=$(jq -r '.externalPM.config.domain' .specweave/config.json)
|
|
234
|
+
JIRA_PROJECT=$(jq -r '.externalPM.config.project' .specweave/config.json)
|
|
235
|
+
```
|
|
236
|
+
|
|
237
|
+
**Validate Configuration**:
|
|
238
|
+
- Domain format: `*.atlassian.net` or self-hosted
|
|
239
|
+
- API token valid and not expired
|
|
240
|
+
- Project exists and user has access
|
|
241
|
+
- Required custom fields exist (epic name, epic link)
|
|
242
|
+
|
|
243
|
+
---
|
|
244
|
+
|
|
245
|
+
## Error Handling
|
|
246
|
+
|
|
247
|
+
### Common Errors
|
|
248
|
+
|
|
249
|
+
**401 Unauthorized**:
|
|
250
|
+
- API token invalid or expired
|
|
251
|
+
- Email address incorrect
|
|
252
|
+
- Solution: Regenerate token, verify credentials
|
|
253
|
+
|
|
254
|
+
**403 Forbidden**:
|
|
255
|
+
- Insufficient permissions (need: Browse Projects, Create Issues, Edit Issues)
|
|
256
|
+
- Solution: Contact Jira admin for permissions
|
|
257
|
+
|
|
258
|
+
**404 Not Found**:
|
|
259
|
+
- Project key invalid
|
|
260
|
+
- Epic doesn't exist
|
|
261
|
+
- Solution: Verify project key and epic key
|
|
262
|
+
|
|
263
|
+
**400 Bad Request**:
|
|
264
|
+
- Invalid custom field
|
|
265
|
+
- Invalid status transition
|
|
266
|
+
- Solution: Validate request payload, check workflow
|
|
267
|
+
|
|
268
|
+
### Retry Strategy
|
|
269
|
+
|
|
270
|
+
```bash
|
|
271
|
+
# Exponential backoff
|
|
272
|
+
for i in 1 2 3; do
|
|
273
|
+
response=$(curl -w "%{http_code}" ...)
|
|
274
|
+
if [ "$response" = "200" ]; then
|
|
275
|
+
break
|
|
276
|
+
fi
|
|
277
|
+
sleep $((2 ** i))
|
|
278
|
+
done
|
|
279
|
+
```
|
|
280
|
+
|
|
281
|
+
---
|
|
282
|
+
|
|
283
|
+
## Rate Limiting
|
|
284
|
+
|
|
285
|
+
**Jira Cloud Limits**:
|
|
286
|
+
- Varies by account type (standard: ~100 req/sec)
|
|
287
|
+
- Burst allowance available
|
|
288
|
+
- 429 response when exceeded
|
|
289
|
+
|
|
290
|
+
**Strategy**:
|
|
291
|
+
- Track request count
|
|
292
|
+
- Implement token bucket algorithm
|
|
293
|
+
- Queue requests if approaching limit
|
|
294
|
+
- Warn user if rate limit hit
|
|
295
|
+
|
|
296
|
+
---
|
|
297
|
+
|
|
298
|
+
## Bidirectional Sync (Future)
|
|
299
|
+
|
|
300
|
+
**Jira → SpecWeave**:
|
|
301
|
+
1. Poll Jira for epic changes
|
|
302
|
+
2. Detect status changes (In Progress → Done)
|
|
303
|
+
3. Update increment status locally
|
|
304
|
+
4. Notify user
|
|
305
|
+
|
|
306
|
+
**Webhook Setup** (preferred):
|
|
307
|
+
1. Configure Jira webhook
|
|
308
|
+
2. Point to SpecWeave endpoint
|
|
309
|
+
3. Receive real-time updates
|
|
310
|
+
4. Process state changes
|
|
311
|
+
|
|
312
|
+
---
|
|
313
|
+
|
|
314
|
+
## Security Considerations
|
|
315
|
+
|
|
316
|
+
**Jira API Token**:
|
|
317
|
+
- ✅ Store in environment variable: `JIRA_API_TOKEN`
|
|
318
|
+
- ✅ Never log or commit token
|
|
319
|
+
- ✅ Use Basic Auth: `base64(email:token)`
|
|
320
|
+
- ✅ Rotate every 90 days
|
|
321
|
+
|
|
322
|
+
**API Requests**:
|
|
323
|
+
- ✅ Use HTTPS only
|
|
324
|
+
- ✅ Validate SSL certificates
|
|
325
|
+
- ✅ Sanitize user input
|
|
326
|
+
- ✅ Log requests (without token)
|
|
327
|
+
|
|
328
|
+
---
|
|
329
|
+
|
|
330
|
+
## Examples
|
|
331
|
+
|
|
332
|
+
### Example 1: Create Epic from Increment
|
|
333
|
+
|
|
334
|
+
**Input**: Increment 0005-user-authentication
|
|
335
|
+
|
|
336
|
+
**Process**:
|
|
337
|
+
1. Read spec.md → Extract title, summary, acceptance criteria
|
|
338
|
+
2. Read mapping reference → Confirm Epic = Increment
|
|
339
|
+
3. Format Jira epic payload (project key, summary, description, labels)
|
|
340
|
+
4. POST to Jira API → Create epic
|
|
341
|
+
5. Parse response → Extract epic key (PROJ-123)
|
|
342
|
+
6. Save to metadata.json: `external_ids.jira.epic = PROJ-123`
|
|
343
|
+
7. Display: "Created Jira Epic: PROJ-123"
|
|
344
|
+
|
|
345
|
+
### Example 2: Sync Progress
|
|
346
|
+
|
|
347
|
+
**Input**: 6/10 tasks complete
|
|
348
|
+
|
|
349
|
+
**Process**:
|
|
350
|
+
1. Read tasks.md → Parse completion status
|
|
351
|
+
2. Calculate: 60% complete
|
|
352
|
+
3. Identify: Recently completed tasks (T-005, T-006)
|
|
353
|
+
4. Format comment with progress update
|
|
354
|
+
5. POST comment to epic PROJ-123
|
|
355
|
+
6. Display: "Synced to Jira Epic: PROJ-123"
|
|
356
|
+
|
|
357
|
+
### Example 3: Close Epic
|
|
358
|
+
|
|
359
|
+
**Input**: Increment 0005 complete (10/10 tasks)
|
|
360
|
+
|
|
361
|
+
**Process**:
|
|
362
|
+
1. Validate: All tasks complete
|
|
363
|
+
2. Generate: Completion summary
|
|
364
|
+
3. Transition epic state → Done
|
|
365
|
+
4. POST final comment
|
|
366
|
+
5. Display: "Closed Jira Epic: PROJ-123"
|
|
367
|
+
|
|
368
|
+
---
|
|
369
|
+
|
|
370
|
+
## Related Tools
|
|
371
|
+
|
|
372
|
+
- **Jira CLI**: Alternative to REST API (requires installation)
|
|
373
|
+
- **Jira REST API v3**: https://developer.atlassian.com/cloud/jira/platform/rest/v3/
|
|
374
|
+
- **Jira Automation**: Trigger rules from SpecWeave
|
|
375
|
+
|
|
376
|
+
---
|
|
377
|
+
|
|
378
|
+
**Status**: Production-ready
|
|
379
|
+
**Version**: 1.0.0
|
|
380
|
+
**Last Updated**: 2025-11-04
|