/ado-reconcile
Reconcile Azure DevOps work item states with increment statuses. Fixes drift by closing work items for completed increments and reactivating work items for resumed increments.
> /plugin marketplace add anton-abyzov/specweave > /plugin install sw@specweave
How it fires
How this command gets triggered: by you, by Claude, or both.
- Fires itselfClaude auto-loads it when your prompt matches the work.
- You can call itInvoke it directly when you want it.
- Slash command
/ado-reconcile
Context preview
What this command does when you run it.
Reconcile Azure DevOps work item states with increment statuses. Fixes drift by closing work items for completed increments and reactivating work items for resumed increments.
Command definition
ado-reconcile.mddescription: Reconcile Azure DevOps work item states with increment statuses. Fixes drift by closing work items for completed increments and reactivating work items for resumed increments.
Azure DevOps Status Reconciliation
Scan all increments and fix any drift between local metadata.json status and ADO work item states.
Usage
sw-ado:reconcile [options]
Options
- `--dry-run`: Preview changes without making them
- `--verbose`: Show detailed output for each work item checked
What It Does
1. **Scans** all non-archived increments 2. **Compares** metadata.json status with ADO work item state 3. **Fixes** mismatches:
- `metadata=completed` + `ADO=Active` → **Close** the work item
- `metadata=in-progress` + `ADO=Closed` → **Reactivate** the work item
When to Use
- After manual metadata.json edits
- After git pulls that changed increment statuses
- When you notice active work items for completed work
- As a periodic health check
Implementation
Run the reconciliation using the AdoReconciler:
import { AdoReconciler } from '../../../src/sync/ado-reconciler.js';
const reconciler = new AdoReconciler({
projectRoot: process.cwd(),
dryRun: args.includes('--dry-run'),
});
const result = await reconciler.reconcile();
// Report results
console.log(`\nReconciliation complete:`);
console.log(` Scanned: ${result.scanned} increments`);
console.log(` Fixed: ${result.closed} closed, ${result.reopened} reopened`);
if (result.errors.length > 0) {
console.log(` Errors: ${result.errors.length}`);
}Example Output
📊 Scanning 5 increment(s) for ADO state drift...
✅ Work Item #1234 (0056-plugin-fix/US-001): State matches (Active)
❌ Work Item #1240 (0066-import-wizard/US-003): Active but should be CLOSED (status=completed)
✅ Closed work item #1240
❌ Work Item #1238 (0063-multi-repo/US-001): CLOSED but should be ACTIVE (status=in-progress)
✅ Reactivated work item #1238
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
📊 ADO RECONCILIATION SUMMARY
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
Increments scanned: 5
Mismatches found: 2
Work items closed: 1
Work items reopened: 1
Errors: 0
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━Dry Run Mode
sw-ado:reconcile --dry-run
Shows what would be changed without making any modifications:
❌ Work Item #1240 (0066-import-wizard/US-003): Active but should be CLOSED
[DRY RUN] Would close work item #1240
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
📊 ADO RECONCILIATION SUMMARY
⚠️ DRY RUN - No changes were made
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━Requirements
- Azure DevOps PAT configured (`AZURE_DEVOPS_PAT`)
- `sync.ado.enabled = true` in config.json
- `sync.settings.canUpdateExternalItems = true` in config.json
ADO Status Mapping
| SpecWeave Status | Expected ADO State | |-----------------|-------------------| | `completed` | Closed, Done, Resolved | | `abandoned` | Closed, Removed | | `in-progress` | Active, In Progress | | `active` | Active, New | | `planning` | New |
Related Commands
- `sw-ado:status`: View sync status for increments
- `sw-ado:sync`: Manual sync to ADO
- `sw:done`: Close increment (triggers auto-close)
- `sw:resume`: Resume increment (now triggers auto-reopen)
Read more
description: Reconcile Azure DevOps work item states with increment statuses. Fixes drift by closing work items for completed increments and reactivating work items for resumed increments.
Azure DevOps Status Reconciliation
Scan all increments and fix any drift between local metadata.json status and ADO work item states.
Usage
sw-ado:reconcile [options]
Options
- `--dry-run`: Preview changes without making them
- `--verbose`: Show detailed output for each work item checked
What It Does
1. **Scans** all non-archived increments 2. **Compares** metadata.json status with ADO work item state 3. **Fixes** mismatches:
- `metadata=completed` + `ADO=Active` → **Close** the work item
- `metadata=in-progress` + `ADO=Closed` → **Reactivate** the work item
When to Use
- After manual metadata.json edits
- After git pulls that changed increment statuses
- When you notice active work items for completed work
- As a periodic health check
Implementation
Run the reconciliation using the AdoReconciler:
import { AdoReconciler } from '../../../src/sync/ado-reconciler.js';
const reconciler = new AdoReconciler({
projectRoot: process.cwd(),
dryRun: args.includes('--dry-run'),
});
const result = await reconciler.reconcile();
// Report results
console.log(`\nReconciliation complete:`);
console.log(` Scanned: ${result.scanned} increments`);
console.log(` Fixed: ${result.closed} closed, ${result.reopened} reopened`);
if (result.errors.length > 0) {
console.log(` Errors: ${result.errors.length}`);
}Example Output
📊 Scanning 5 increment(s) for ADO state drift...
✅ Work Item #1234 (0056-plugin-fix/US-001): State matches (Active)
❌ Work Item #1240 (0066-import-wizard/US-003): Active but should be CLOSED (status=completed)
✅ Closed work item #1240
❌ Work Item #1238 (0063-multi-repo/US-001): CLOSED but should be ACTIVE (status=in-progress)
✅ Reactivated work item #1238
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
📊 ADO RECONCILIATION SUMMARY
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
Increments scanned: 5
Mismatches found: 2
Work items closed: 1
Work items reopened: 1
Errors: 0
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━Dry Run Mode
sw-ado:reconcile --dry-run
Shows what would be changed without making any modifications:
❌ Work Item #1240 (0066-import-wizard/US-003): Active but should be CLOSED
[DRY RUN] Would close work item #1240
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
📊 ADO RECONCILIATION SUMMARY
⚠️ DRY RUN - No changes were made
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━Requirements
- Azure DevOps PAT configured (`AZURE_DEVOPS_PAT`)
- `sync.ado.enabled = true` in config.json
- `sync.settings.canUpdateExternalItems = true` in config.json
ADO Status Mapping
| SpecWeave Status | Expected ADO State | |-----------------|-------------------| | `completed` | Closed, Done, Resolved | | `abandoned` | Closed, Removed | | `in-progress` | Active, In Progress | | `active` | Active, New | | `planning` | New |
Related Commands
- `sw-ado:status`: View sync status for increments
- `sw-ado:sync`: Manual sync to ADO
- `sw:done`: Close increment (triggers auto-close)
- `sw:resume`: Resume increment (now triggers auto-reopen)
Spec-first AI development: describe a feature → AI creates spec + plan + tasks, builds autonomously, syncs to GitHub/JIRA. Domain-expert skills for PM, Architect, Frontend, QA learn your patterns permanently. Claude Code, Codex, Cursor, Copilot & more.
Repo: anton-abyzov/specweave
Other commands on specweave.
- /abandon
Abandon an incomplete increment (requirements changed, obsolete)
Open command - /ado-cleanup-duplicates
Clean up duplicate Azure DevOps work items for a Feature. Finds work items with duplicate titles and closes all except the first created item.
Open command - /ado-clone
Clone Azure DevOps repositories to local workspace. Use after init if cloning was skipped, or to add repos later.
Open command - /ado-close
Close Azure DevOps work item when increment complete
Open command - /ado-create
Create Azure DevOps work item from SpecWeave increment
Open command - /ado-import-areas
Import Azure DevOps area paths from a project and map them to SpecWeave projects. Creates 2-level directory structure with area path-based organization.
Open command

