swain-roadmap
Roadmap
Before proceeding with any state-changing operation, check for an active session:
REPO_ROOT="$(git rev-parse --show-toplevel 2>/dev/null || pwd)"
bash "$REPO_ROOT/.agents/bin/swain-session-check.sh" 2>/dev/null
If the JSON output has "status" other than "active", inform the operator: "No active session — start one with /swain-init?" Proceed if they dismiss.
Regenerates ROADMAP.md from the artifact graph and opens it. The heavy lifting is done by chart.sh roadmap in swain-design — this skill is the user-facing entry point.
When invoked
1. Locate chart.sh
REPO_ROOT="$(git rev-parse --show-toplevel 2>/dev/null || pwd)"
CHART_SH="$REPO_ROOT/.agents/bin/chart.sh"
If chart.sh is not found, tell the user swain-design is not installed and stop.
2. Regenerate roadmap
Parse the argument: if the user provided an artifact ID (e.g., swain-roadmap VISION-001), set SCOPE_ID to that ID. Otherwise, SCOPE_ID is empty.
If SCOPE_ID is set:
bash "$CHART_SH" roadmap --scope "$SCOPE_ID"
This writes a roadmap.md to the scoped artifact's folder.
If SCOPE_ID is empty:
bash "$CHART_SH" roadmap
This writes ROADMAP.md to the project root AND regenerates all per-Vision and per-Initiative roadmap.md slices in their respective artifact folders.
The project-wide ROADMAP.md contains:
- Quadrant chart — priority matrix as PNG (falls back to inline Mermaid if
mmdcis unavailable) - Legend — epics grouped by quadrant with short IDs
- Eisenhower tables — Do First / Schedule / In Progress / Backlog with progress, unblock counts, and operator decision needs
- Gantt timeline — priority-staggered schedule with dependency links
- Dependency graph — blocking relationships across priority boundaries (only if dependencies exist)
Each per-artifact slice contains: intent summary, child artifact table with links and progress, aggregate progress bar, recent git commits, and an Eisenhower priority subset.
2.5. Post-process intent placeholders
After chart.sh completes, scan the output file(s) for {{INTENT: <ID>}} placeholders. For each:
- Read the source artifact markdown.
- Extract the first sentence of
## Value Proposition(for Visions) or## Goal / Objective(for Initiatives). - Replace the
{{INTENT: <ID>}}marker with the extracted sentence. - Write the file back.
If the section cannot be found, leave the placeholder as-is (the operator can fill it in manually or wait for brief-description frontmatter to be populated via SPEC-144).
3. Open the roadmap
If SCOPE_ID was set, open the scoped slice. Look up the artifact's file path from the graph cache to find its folder:
ARTIFACT_FILE="$(bash "$CHART_SH" show "$SCOPE_ID" 2>/dev/null | grep -oE 'docs/[^ ]+' | head -1)"
if [ -n "$ARTIFACT_FILE" ]; then
open "$REPO_ROOT/$(dirname "$ARTIFACT_FILE")/roadmap.md"
fi
If no scope, open the project-wide roadmap:
open "$REPO_ROOT/ROADMAP.md"
Always open the rendered file so the operator gets the full view with charts and diagrams. Never tell the operator to open it themselves — just do it.
4. Show CLI summary
ROADMAP.md contains tables, Mermaid diagrams, and image references that do not render in a terminal. Use the --cli flag to get a pre-formatted plain text summary:
bash "$CHART_SH" roadmap --cli
This outputs a deterministic, aligned summary grouped by Eisenhower quadrant (Do First, Schedule, In Progress, Backlog), with all first-degree children (EPICs, SPECs, SPIKEs) nested under their parent initiative. Show this output directly — do not reformat or filter it.
Say "ROADMAP.md refreshed and opened." before the CLI output. For scoped runs, say "Roadmap slice for {SCOPE_ID} refreshed and opened." instead.
Context-rich display
When listing roadmap items (Eisenhower quadrants, Gantt timeline), present each artifact as a context line instead of a bare ID:
REPO_ROOT="$(git rev-parse --show-toplevel 2>/dev/null || pwd)"
bash "$REPO_ROOT/.agents/bin/artifact-context.sh" <ID> 2>/dev/null
Fall back to <ID> — <title> if the utility is unavailable.
6. Focus lane context
If a focus lane is set in .agents/session.json, mention it at the end.
FOCUS="$(bash "$REPO_ROOT/.agents/bin/swain-focus.sh" 2>/dev/null)"
If focus is set, note: "Focus: {FOCUS}. Recommendations are scoped to this lane."
Freshness check (for other skills)
Other skills can call chart.sh directly for staleness-based regeneration. This skill always regenerates unconditionally — it is the "force refresh" path.
Status Dashboard (ADR-023, formerly SPEC-122)
When the operator says "status", "what's next", "dashboard", "overview", "where are we", or "what should I work on", run the status script:
REPO_ROOT="$(git rev-parse --show-toplevel 2>/dev/null || pwd)"
STATUS_SCRIPT="$REPO_ROOT/.agents/bin/swain-status.sh"
[ -f "$STATUS_SCRIPT" ] && bash "$STATUS_SCRIPT" --refresh || echo "status dashboard script not found"
For compact mode (MOTD): bash "$STATUS_SCRIPT" --compact
Cache
Status writes to .agents/status-cache.json with 120-second TTL. Use --refresh to bypass, --json for raw output.
Recommendation
Read .priority.recommendations[0] from the JSON cache. When a focus lane is set, recommendations scope to that vision/initiative.
Mode Inference
- Both specs in review AND strategic decisions pending -> ask operator
- Specs awaiting review -> detail mode
- Focus lane + pending decisions -> vision mode
- Nothing actionable -> vision mode (master plan mirror)
Decisions Needed (roadmap integration)
Uses chart.sh roadmap --json for Eisenhower classification. Show top 5 items from "Do First" and "Schedule" quadrants that need operator decisions.
Error handling
- If chart.sh fails, show the error output and suggest running
swain-doctor - If ROADMAP.md exists but chart.sh is unavailable, show the existing (possibly stale) file with a staleness warning
- Never fail hard — show whatever is available
More from cristoslc/swain
swain-do
Task tracking and implementation execution for swain projects. Invoke whenever a SPEC needs an implementation plan, the user asks what to work on next, wants to check or update task status, claim or close tasks, manage dependencies, abandon work, bookmark context, or record a decision. Also invoked by swain-design after creating a SPEC that's ready for implementation. Tracks SPECs and SPIKEs — not EPICs, VISIONs, or JOURNEYs directly (those get decomposed into SPECs first). Triggers also on: 'bookmark', 'remember where I am', 'record decision'.
124swain-update
Update swain skills to the latest version. Use when the user says 'update swain', 'upgrade swain', 'pull latest swain', 'reinstall swain', 'refresh skills', or wants to update their swain skills installation. Uses npx to pull the latest swain release from GitHub, with a git-clone fallback, then invokes swain-doctor to reconcile governance and validate project health.
121swain-release
Cut a release — detect versioning context, generate a changelog from conventional commits, bump versions, create a git tag, and optionally squash-merge to a release branch. Use when the user says "release", "cut a release", "tag a release", "bump the version", "create a changelog", "ship a version", "publish", or any variation of shipping/publishing a version. This skill is intentionally generic and works across any repo — it infers context from git history and project structure rather than assuming a specific setup. Supports the trunk+release branch model (ADR-013) when a `release` branch exists.
121swain-design
Create, validate, and transition documentation artifacts (Vision, Initiative, Epic, Spec, Spike, ADR, Persona, Runbook, Design, Journey) through lifecycle phases. Handles spec writing, feature planning, epic creation, initiative creation, ADR drafting, research spikes, persona definition, runbook creation, design capture, architecture docs, phase transitions, implementation planning, cross-reference validation, and audits. Also invoke to update frontmatter fields, re-parent an artifact under a different epic or initiative, or set priority on a Vision or Initiative. Chains into swain-do for implementation tracking on SPEC; decomposes EPIC/VISION/INITIATIVE/JOURNEY into children first.
121swain
Meta-router for swain skills. Invoke when the user explicitly asks swain to do something — not merely when they mention the project by name. Routes to the matching swain-* sub-skill — only load the one that matches. If the user's intent matches multiple rows, pick the most specific match. Sub-skills that are not installed will gracefully no-op.
118swain-search
Trove collection and normalization for swain-design artifacts. Collects sources from the web, local files, and media (video/audio), normalizes them to markdown, and caches them in reusable troves. Use when researching a topic for a spike, ADR, vision, or any artifact that needs structured research. Also use to refresh stale troves or extend existing ones with new sources. Triggers on: 'research X', 'gather sources for', 'compile research on', 'search for sources about', 'refresh the trove', 'find existing research on X', or when swain-design needs research inputs for a spike or ADR.
112