Import Azure DevOps area paths from a project and map them to SpecWeave projects. Creates 2-level directory structure with area path-based organization.
Import Azure DevOps area paths from a project and map them to SpecWeave projects. Creates 2-level directory structure with area path-based organization.
/plugin marketplace add anton-abyzov/specweave/plugin install sw-ado@specweaveYou are an Azure DevOps integration expert. Help the user import area paths from an ADO project and map them to SpecWeave projects.
/sw-ado:import-areas # Interactive mode (prompts for project)
/sw-ado:import-areas --project MyProduct # Specific ADO project
/sw-ado:import-areas --dry-run # Preview without creating directories
/sw-ado:import-areas --include-children # Include child area paths
When the user runs this command:
Check ADO credentials exist in .env:
AZURE_DEVOPS_PATAZURE_DEVOPS_ORGAZURE_DEVOPS_PROJECTCheck config.json for existing area path mapping:
sync.profiles.*.config.areaPathMapping exists, warn userIf --project flag provided:
If no flag (interactive mode):
š· Azure DevOps Area Path Import
Enter the ADO project name to import area paths from:
> MyProduct
Fetching area paths from project MyProduct...
import { fetchAreaPathsForProject } from '../lib/ado-board-resolver';
const areaPaths = await fetchAreaPathsForProject(
process.env.AZURE_DEVOPS_ORG,
'MyProduct',
process.env.AZURE_DEVOPS_PAT
);
Display area paths:
Found 6 area paths in project MyProduct:
1. ā MyProduct\Frontend (45 active items)
2. ā MyProduct\Backend (78 active items)
3. ā MyProduct\Mobile (23 active items)
4. ā MyProduct\DevOps (12 active items)
5. ā MyProduct\Archive (0 items) [deselected - archive]
6. ā MyProduct (root) [deselected - root level]
Select area paths to import (Space to toggle, Enter to confirm)
For each selected area path, prompt for SpecWeave project ID:
š·ļø Mapping area paths to SpecWeave projects:
Area path "MyProduct\Frontend" ā SpecWeave project ID: [fe]
ā Include child area paths? [Y/n]: y
ā Keywords for auto-classification (optional): frontend, ui, angular, css
Area path "MyProduct\Backend" ā SpecWeave project ID: [be]
ā Include child area paths? [Y/n]: y
ā Keywords for auto-classification (optional): api, server, database, c#
Area path "MyProduct\Mobile" ā SpecWeave project ID: [mobile]
ā Include child area paths? [Y/n]: y
ā Keywords for auto-classification (optional): ios, android, xamarin
Area path "MyProduct\DevOps" ā SpecWeave project ID: [devops]
ā Include child area paths? [Y/n]: y
ā Keywords for auto-classification (optional): infrastructure, ci, cd, terraform
Project ID validation:
myproduct-fe instead of feCreate 2-level directory structure:
.specweave/docs/internal/specs/
āāā ADO-myproduct/ ā Level 1: ADO project
āāā fe/ ā Level 2: SpecWeave project
ā āāā .gitkeep
āāā be/
ā āāā .gitkeep
āāā mobile/
ā āāā .gitkeep
āāā devops/
āāā .gitkeep
Add area path mapping to config:
{
"sync": {
"profiles": {
"ado-default": {
"provider": "ado",
"config": {
"organization": "myorg",
"areaPathMapping": {
"project": "MyProduct",
"mappings": [
{
"areaPath": "MyProduct\\Frontend",
"specweaveProject": "fe",
"includeChildren": true,
"keywords": ["frontend", "ui", "angular", "css"]
},
{
"areaPath": "MyProduct\\Backend",
"specweaveProject": "be",
"includeChildren": true,
"keywords": ["api", "server", "database", "c#"]
},
{
"areaPath": "MyProduct\\Mobile",
"specweaveProject": "mobile",
"includeChildren": true,
"keywords": ["ios", "android", "xamarin"]
},
{
"areaPath": "MyProduct\\DevOps",
"specweaveProject": "devops",
"includeChildren": true,
"keywords": ["infrastructure", "ci", "cd", "terraform"]
}
]
}
}
}
}
},
"multiProject": {
"enabled": true,
"activeProject": "fe",
"projects": {
"fe": {
"name": "Frontend",
"externalTools": {
"ado": {
"areaPath": "MyProduct\\Frontend",
"project": "MyProduct"
}
}
},
"be": {
"name": "Backend",
"externalTools": {
"ado": {
"areaPath": "MyProduct\\Backend",
"project": "MyProduct"
}
}
},
"mobile": {
"name": "Mobile",
"externalTools": {
"ado": {
"areaPath": "MyProduct\\Mobile",
"project": "MyProduct"
}
}
},
"devops": {
"name": "DevOps",
"externalTools": {
"ado": {
"areaPath": "MyProduct\\DevOps",
"project": "MyProduct"
}
}
}
}
}
}
ā
Azure DevOps Area Paths Import Complete!
š· ADO Project: MyProduct
š Created: .specweave/docs/internal/specs/ADO-myproduct/
Area paths imported:
ā MyProduct\Frontend ā fe (includes children)
Keywords: frontend, ui, angular, css
ā MyProduct\Backend ā be (includes children)
Keywords: api, server, database, c#
ā MyProduct\Mobile ā mobile (includes children)
Keywords: ios, android, xamarin
ā MyProduct\DevOps ā devops (includes children)
Keywords: infrastructure, ci, cd, terraform
š” Next steps:
1. Use /sw:switch-project fe to switch active project
2. Create increment: /sw:increment "feature name"
3. User stories will auto-sync to the correct area path based on keywords
š Documentation: .specweave/docs/internal/architecture/adr/0143-jira-ado-multi-level-project-mapping.md
User: /sw-ado:import-areas
You:
š· Azure DevOps Area Path Import
Enter the ADO project name: MyProduct
Fetching area paths...
Found 4 area paths:
ā MyProduct\Frontend
ā MyProduct\Backend
ā MyProduct\Mobile
ā MyProduct (root) [deselected]
Mapping to SpecWeave projects:
MyProduct\Frontend ā fe
MyProduct\Backend ā be
MyProduct\Mobile ā mobile
ā
Import complete! 3 area paths mapped.
User: /sw-ado:import-areas --project MyProduct --dry-run
You:
š· Azure DevOps Area Path Import (DRY RUN)
Would import from project: MyProduct
Would create:
.specweave/docs/internal/specs/ADO-myproduct/
.specweave/docs/internal/specs/ADO-myproduct/fe/
.specweave/docs/internal/specs/ADO-myproduct/be/
.specweave/docs/internal/specs/ADO-myproduct/mobile/
Would update config.json with area path mapping.
No changes made (dry run).
User: /sw-ado:import-areas
You:
ā ļø Area path mapping already exists for project MyProduct
Current mappings:
MyProduct\Frontend ā fe
MyProduct\Backend ā be
Do you want to:
1. Add more area paths
2. Replace existing mapping
3. Cancel
> 1
Fetching additional area paths...
ā MyProduct\Frontend (already mapped)
ā MyProduct\Backend (already mapped)
ā MyProduct\Mobile (new)
ā MyProduct\DevOps (new)
Added:
MyProduct\Mobile ā mobile
MyProduct\DevOps ā devops
ā
Updated! Now 4 area paths mapped.
Missing credentials:
ā Azure DevOps credentials not found
Please add to .env:
AZURE_DEVOPS_PAT=your_personal_access_token
AZURE_DEVOPS_ORG=your_organization
AZURE_DEVOPS_PROJECT=your_project
Or run: specweave init . (to configure Azure DevOps)
Project not found:
ā ADO project "INVALID" not found in organization "myorg"
Available projects you have access to:
- MyProduct (My Product Development)
- Infrastructure (DevOps & Infrastructure)
- Legacy (Legacy Systems)
Tip: Use /sw-ado:import-areas --project MyProduct
No area paths found:
ā ļø No child area paths found in project MyProduct
The project only has the root area path. This means:
1. Teams aren't using area paths for organization
2. You can create area paths in ADO Project Settings
Suggestions:
- Use single-project mode (no area path mapping)
- Create area paths in ADO: Project Settings ā Work ā Areas
- Run this command again after creating area paths
/sw-ado:import-projects - Import multiple ADO projects/sw-ado:sync - Sync increments with ADO/sw:switch-project - Switch active SpecWeave project/sw:init-multiproject - Initialize multi-project mode