Sync Setup Wizard
Interactive skill that configures SpecWeave's external sync in one guided flow.
Workflow
Step 1: Provider Selection
Ask the user which providers to enable:
code
AskUserQuestion: "Which external platforms do you want to sync with?" Options: GitHub, JIRA, Azure DevOps (multiSelect: true)
Step 2: Credentials (per provider)
GitHub:
- •Check
gh auth status— if authenticated, use existing token - •If not, ask for GITHUB_TOKEN
- •Ask for owner/repo (or auto-detect from git remote)
JIRA:
- •Ask for JIRA domain (e.g.,
company.atlassian.net) - •Ask for email
- •Ask for API token (from https://id.atlassian.com/manage/api-tokens)
- •Ask for project key
- •Validate:
curl -u email:token https://domain/rest/api/3/myself
Azure DevOps:
- •Ask for organization name
- •Ask for project name
- •Ask for PAT (from https://dev.azure.com/org/_usersSettings/tokens)
- •Validate:
curl -u :PAT https://dev.azure.com/org/_apis/projects/project?api-version=7.1
Step 3: Permission Preset
code
AskUserQuestion: "What sync permissions do you want?" Options: - read-only: Only pull changes from external tools - push-only: Only push SpecWeave changes to external tools - bidirectional (Recommended): Both push and pull - full-control: Everything including delete
Step 4: Hierarchy Detection (JIRA/ADO only)
For JIRA and ADO, auto-detect the hierarchy:
typescript
// Use the new SyncEngine to detect hierarchy
const engine = new SyncEngine({ permissions: resolvePermissions('read-only') });
engine.registerProvider(adapter);
const hierarchy = await engine.detectHierarchy(platform);
Show detected mapping and ask for confirmation:
code
AskUserQuestion: "Detected hierarchy pattern: [pattern]. Is this correct?" Options: Yes, use detected mapping | No, let me customize | Use flat mapping
Step 5: GitHub Projects v2 (GitHub only)
code
AskUserQuestion: "Do you want to sync with a GitHub Project board?" Options: Yes, select a project | No, just Issues + Labels
If yes, list available projects and ask which one.
Step 6: Write Config
Write the following:
- •
.env— Add credentials (JIRA_API_TOKEN, JIRA_EMAIL, AZURE_DEVOPS_PAT, etc.) - •
.specweave/config.json— Update sync section:
json
{
"sync": {
"enabled": true,
"preset": "bidirectional",
"github": { "enabled": true, "owner": "...", "repo": "..." },
"jira": { "enabled": true, "domain": "...", "projectKey": "..." },
"ado": { "enabled": true, "organization": "...", "project": "..." }
}
}
Step 7: Dry Run
Run a test sync (read-only) to verify configuration:
bash
# Test each enabled provider
node -e "
import { SyncEngine } from './src/sync/engine.js';
import { GitHubAdapter } from './src/sync/providers/github.js';
// ... test connection for each provider
"
Report results and confirm setup is complete.
Key Principles
- •Never commit secrets: Credentials go in
.envonly - •Validate before saving: Test API calls before writing config
- •Safe defaults: Default to
bidirectionalpreset (no delete) - •User confirmation: Always confirm detected hierarchy