AUTO-EXECUTE import of external work items (GitHub/JIRA/ADO) since last import. NO PROMPTS - immediately runs with defaults. Creates READ-ONLY references in living docs. Options available but NOT required.
Imports work items from GitHub, JIRA, or Azure DevOps as read-only references. Use this to sync new external items after initial setup without any prompts.
/plugin marketplace add anton-abyzov/specweave/plugin install sw@specweaveImport work items from GitHub (issues/milestones), JIRA (epics/stories), or Azure DevOps (work items) into SpecWeave living docs as read-only references.
Important: This command creates a reference catalog, NOT increments. Imported items have E-suffix IDs (US-001E, FS-042E). To implement an imported item, you must manually create an increment that references it.
When user runs /sw:import-external with NO arguments:
.specweave/sync-metadata.jsonWRONG behavior (DO NOT DO THIS):
❌ "What would you like to import?"
❌ "Which option would you like?"
❌ "Should I run a dry run first?"
❌ Showing a menu of options
CORRECT behavior:
✅ Immediately start importing
✅ Show progress: "🔄 Importing from GitHub... [25/150]"
✅ Show summary when done
Detects configured external tools (GitHub, JIRA, ADO) from environment/config
Fetches work items based on time range filter (since last import by default)
Assigns IDs with E suffix and validation (v1.0.102+)
import { validateIncrementNumber, logValidationResult } from './src/core/increment-validator.js';
// Get all existing feature IDs (including E-suffix ones)
const existingFeatures = [
...fs.readdirSync('.specweave/docs/internal/specs/'),
...fs.readdirSync('.specweave/increments/').map(parseFeatureId),
].filter(f => /^FS-\d{3}E?$/.test(f));
// For external feature FS-042E, validate base number 042
const baseNumber = featureId.replace('E', '').replace('FS-', '');
const result = validateIncrementNumber(baseNumber, existingFeatures);
// Log warnings if non-sequential
if (result.warnings.length > 0) {
console.log('ℹ️ External feature ID validation:');
logValidationResult(result);
console.log(' This is normal for external imports (IDs from external system)');
}
Creates living docs files in .specweave/docs/internal/specs/FS-XXXE/
Updates sync metadata (.specweave/sync-metadata.json) with import timestamp
Skips duplicates automatically (checks existing external IDs)
Shows progress indicator and summary report
/sw:import-external [options]
--since=<range> - Time range filter (default: since last import)
last - Since last import (uses sync metadata) ← DEFAULT1m, 3m, 6m - Last 1/3/6 monthsall - All items (no time filter)2025-01-01 - Since specific date (ISO format)--github-only - Import from GitHub only--jira-only - Import from JIRA only--ado-only - Import from Azure DevOps only--dry-run - Preview what would be imported without creating files/sw:import-external
# IMMEDIATELY executes with defaults:
# - Since last import (or 1 month if first import)
# - All configured platforms
# Output (NO QUESTIONS ASKED):
# 📥 Import External Work Items
#
# 📋 Import Configuration:
# Platforms: GITHUB
# Time range: last
# Dry run: No
#
# 🔗 Imported from GITHUB: 15 items
#
# 📊 Import Summary:
# Total imported: 15 items
# 🔗 GITHUB: 15 items
# ✅ Import complete!
/sw:import-external --github-only --since=3m
# Imports only from GitHub
# Items created in last 3 months
/sw:import-external --dry-run --since=1m
# Shows what would be imported without creating files
# Useful for checking item counts before actual import
# Result:
# 🔍 Dry run - no files will be created
# 📊 Preview:
# GitHub: 25 items (5 duplicates skipped)
# JIRA: 10 items (2 duplicates skipped)
# Total: 35 new items, 7 existing
# ⚠️ Remove --dry-run to perform actual import
/sw:import-external --jira-only --since=all
# Imports all JIRA items (no time filter)
# ⚠️ Warning shown if > 100 items detected
/sw:import-external
# Reads last import timestamp from:
# .specweave/sync-metadata.json
# {
# "github": { "lastImport": "2025-11-15T10:30:00Z" },
# "jira": { "lastImport": "2025-11-10T14:20:00Z" }
# }
#
# GitHub: imports items created after 2025-11-15T10:30:00Z
# JIRA: imports items created after 2025-11-10T14:20:00Z
--since=1m # Last 1 month
--since=3m # Last 3 months
--since=6m # Last 6 months
--since=2025-01-01 # Since January 1, 2025 (ISO format: YYYY-MM-DD)
--since=all # Import all items (no time filter)
# ⚠️ Warning: May import hundreds of items
The command auto-detects configured platforms from:
.git/config remote URLGITHUB_TOKEN environment variablegithub.com/{owner}/{repo}JIRA_HOST environment variableJIRA_EMAIL + JIRA_API_TOKENhttps://{company}.atlassian.netADO_ORG_URL environment variableADO_PAT (Personal Access Token)https://dev.azure.com/{org} + ADO_PROJECTDuring import, you'll see real-time progress:
🔄 Importing from GitHub... [25/150] ⠋
⚠️ GitHub rate limit low: 42/5000 remaining. Resets at 10:45 AM (in 300s).
🔄 Importing from GitHub... [150/150] ✓
🔄 Importing from JIRA... [12/12] ✓
[current/total] items processed✓ when platform import completesAfter import, a detailed summary is shown:
📊 Import Summary:
Total imported: 162 items
- GitHub: 150 items (US-201E to US-350E)
- JIRA: 12 items (US-351E to US-362E)
Duplicates skipped: 8 items
- GitHub: 5 items (already imported)
- JIRA: 3 items (already imported)
Rate limit status:
- GitHub: 3842/5000 remaining (resets at 11:00 AM)
- JIRA: Estimated 950/1000 remaining
✅ Import complete!
Living docs updated: .specweave/docs/internal/specs/
Sync metadata updated: .specweave/sync-metadata.json
The command automatically skips items that have already been imported:
us-*.md files in living docsexternal_id frontmatter fieldGH-#638, JIRA-PROJ-123)The command monitors API rate limits and handles them gracefully:
⚠️ GitHub rate limit low: 42/5000 remaining. Resets at 10:45 AM (in 300s).
⚠️ GitHub rate limit critically low. Waiting 60s before continuing...
❌ GitHub rate limit exceeded.
Remaining: 0/5000
Resets at: 10:45 AM (in 300 seconds)
💡 Suggestions:
- Wait 5 minutes and retry
- Use --github-only next time to avoid hitting limit
- Increase time range to reduce item count (--since=1m instead of --since=all)
If import detects > 100 items, you'll be prompted:
⚠️ Found 250 items to import:
- GitHub: 200 items
- JIRA: 50 items
This may take 5-10 minutes and use significant API quota.
Continue? (Y/n) _
Y or Enter to proceedn to cancel--since=1m to reduce item countAfter successful import, sync metadata is updated:
File: .specweave/sync-metadata.json
{
"github": {
"lastImport": "2025-11-19T10:30:00Z",
"lastImportCount": 150,
"lastSkippedCount": 5,
"lastSyncResult": "success"
},
"jira": {
"lastImport": "2025-11-19T10:32:00Z",
"lastImportCount": 12,
"lastSkippedCount": 3,
"lastSyncResult": "success"
}
}
lastImport: Timestamp of most recent successful importlastImportCount: Number of items imported in last synclastSkippedCount: Number of duplicates skippedlastSyncResult: success, partial, or failedImported items create living docs files with E suffix:
.specweave/docs/internal/specs/
├── FS-042E/ ← Feature (external)
│ ├── README.md ← Feature metadata
│ ├── us-001e-login.md ← User Story (external)
│ └── us-002e-signup.md ← User Story (external)
└── FS-043E/ ← Feature (external)
└── us-001e-api-auth.md ← User Story (external)
---
us_id: US-001E
title: "User Login"
feature_id: FS-042E
origin: external
external_platform: github
external_id: GH-#638
external_url: https://github.com/owner/repo/issues/638
imported_at: 2025-11-19T10:30:00Z
status: open
---
# US-001E: User Login
**Origin**: 🔗 GitHub (GH-#638)
## Description
[Original GitHub issue description]
## Acceptance Criteria
[Parsed from GitHub issue body or comments]
## Tasks
No tasks defined.
## Implementation Notes
[Original labels, comments, metadata from GitHub]
specweave initspecweave init| Feature | specweave init | /sw:import-external |
|---|---|---|
| When to use | First-time setup | Ongoing imports after init |
| User prompts | Interactive setup | NONE (auto-execute with defaults) |
| Time range | Configurable (default: 1 month) | Since last import (auto-detected) |
| Config update | Creates .specweave/config.json | Uses existing config |
| Primary use case | Brownfield onboarding | Stay in sync with external tools |
| Execution | Step-by-step wizard | Immediate (no questions asked) |
❌ No external platforms configured.
💡 Ensure one of these is set:
- GitHub: GITHUB_TOKEN + .git/config remote
- JIRA: JIRA_HOST + JIRA_EMAIL + JIRA_API_TOKEN
- Azure DevOps: ADO_ORG_URL + ADO_PROJECT + ADO_PAT
Solution: Set environment variables for at least one platform
❌ GitHub rate limit exceeded (0/5000 remaining).
Resets at: 10:45 AM (in 300 seconds)
Solution: Wait for rate limit reset, or use platform filter (--jira-only) to avoid GitHub
⚠️ No new items found since last import (2025-11-19T10:30:00Z).
Solution: This is expected if no new work items created since last import. Use --since=all to re-import all items (will skip duplicates).
specweave init - Initial project setup with external tool importImplementation: src/cli/commands/import-external.ts