swain-status
Status
Cross-cutting project status dashboard. Aggregates data from artifact lifecycle (swain chart), task tracking (tk), git, GitHub issues, and session state into an activity-oriented view.
Roadmap freshness
The status script includes a staleness check that regenerates ROADMAP.md if it is missing or older than any doc artifact. This runs automatically — no separate invocation needed.
For a full roadmap refresh (unconditional regeneration), use swain-roadmap instead.
When invoked
Locate and run the status script from skills/swain-status/scripts/swain-status.sh:
# Find the script from the project root or installed skills directories
SKILL_DIR="$(find . .claude .agents -path '*/swain-status/scripts/swain-status.sh' -print -quit 2>/dev/null)"
bash "$SKILL_DIR" --refresh
If the path search fails, glob for **/swain-status/scripts/swain-status.sh.
The script's terminal output uses OSC 8 hyperlinks for clickable artifact links. Let the terminal output scroll by — it is reference data, not the primary output.
After the script runs, present a structured agent summary following the template in references/agent-summary-template.md. The agent summary is what the user reads for decision-making. It must lead with a Recommendation section (see below), then Decisions Needed, then Work Ready to Start, then reference data — following the template in references/agent-summary-template.md.
The script collects from five data sources:
- Artifacts —
swain chartvision-rooted hierarchy (epic progress, ready/blocked items, dependency info). Usebash "$(find "$(git rev-parse --show-toplevel 2>/dev/null || pwd)" -path '*/swain-design/scripts/chart.sh' -print -quit 2>/dev/null)" recommendfor ranked artifact view; respects focus lane automatically. - Tasks — tk (in-progress, recently completed)
- Git — branch, working tree state, recent commits
- GitHub — open issues, issues assigned to the user
- Session — bookmarks and context from swain-session
Compact mode (MOTD integration)
The script supports --compact for consumption by swain-stage's MOTD panel:
REPO_ROOT="$(git rev-parse --show-toplevel 2>/dev/null || pwd)"
STATUS_SCRIPT="$(find "$REPO_ROOT" -path '*/swain-status/scripts/swain-status.sh' -print -quit 2>/dev/null)"
[ -n "$STATUS_SCRIPT" ] && bash "$STATUS_SCRIPT" --compact || echo "swain-status.sh not found"
This outputs 4-5 lines suitable for the MOTD box: branch, active epic progress, current task, ready count, assigned issue count.
Cache
The script writes a JSON cache to the project-local agents directory:
.agents/status-cache.json
- TTL: 120 seconds (configurable via
status.cacheTTLin settings) - Force refresh:
--refreshflag bypasses TTL - JSON access:
--jsonflag outputs raw cache for programmatic use
The MOTD can read this cache cheaply between full refreshes.
Migration: If .agents/status-cache.json does not exist but ~/.claude/projects/<project-path-slug>/memory/status-cache.json does, read the old location once and write to the new location going forward.
Recommendation
The recommendation uses a scoring formula:
score = unblock_count × vision_weight
Where vision_weight is inherited from the artifact's Vision ancestor (high=3, medium=2, low=1, default=medium). Read .priority.recommendations[0] from the JSON cache for the top-ranked item.
Tiebreakers (applied in order):
- Higher decision debt in the artifact's vision
- Decision-type artifacts over implementation-type
- Artifact ID (deterministic fallback)
When a focus lane is set, recommendations are scoped to that vision/initiative. Peripheral visions are summarized separately (see Peripheral Awareness).
If attention drift is detected for the recommended item's vision, include it as context in the recommendation.
Mode Inference
swain-status infers the operating mode from context (first match wins):
- Both specs in review AND strategic decisions pending → ask: "Steering or reviewing?"
- Specs awaiting operator review (agent finished, needs sign-off) → detail mode
- Focus lane set with pending strategic decisions → vision mode within that lane
- No specs in review, decisions piling up → vision mode
- Nothing actionable in either mode → vision mode (show the master plan mirror)
Once the operator answers, swain remembers for the session via swain-session bookmark.
Focus Lane
The operator can set a focus lane via swain-session to scope recommendations to a single vision or initiative:
bash "$(find . .claude .agents -path '*/swain-session/scripts/swain-focus.sh' -print -quit 2>/dev/null)" set VISION-001
When set, .priority.recommendations only includes items under that vision. Non-focus visions appear in the Peripheral Awareness section.
Peripheral Awareness
When a focus lane is set, non-focus visions with pending decisions are summarized: "Meanwhile: [Vision] has N pending decisions (weight: W)"
This is a mirror, not a recommendation — the operator decides when accumulation warrants redirection.
Active epics with all specs resolved
When an Active epic has progress.done == progress.total:
- Show "→ ready to close" in the Readiness column of the Epic Progress table
- Do NOT show it in the Work Ready to Start bucket (it's not implementation work)
- Do NOT show it as "work on child specs"
Decisions Needed (roadmap integration)
After the existing status output sections, surface top decision items from the roadmap. This section uses the Eisenhower classification from chart.sh roadmap --json.
Data collection
bash "$(find . -path '*/swain-design/scripts/chart.sh' -print -quit)" roadmap --json
Filtering
- Focus lane scoping: If a focus lane is set, filter items to that Vision only.
- Eisenhower quadrant filter: Show items from "Do First" and "Schedule" quadrants. Classification criteria:
- Important: weight >= 3
- Urgent: active status or score > 0
- Operator decision filter: Show items that need operator decisions:
- Status "Proposed" — needs activate or drop decision
children_total == 0— needs decomposition into child specschildren_complete == children_totalandchildren_total > 0— ready to complete/close
Display
- Limit to top 5 items, ordered by weight descending then score descending.
- Format each as an actionable prompt, not a passive list entry. Examples:
EPIC-038 PR-Only Agent Guardrails — **needs decomposition** (0 specs, high priority)EPIC-024 GitHub Issue Polling — **activate or drop?** (Proposed, high priority)EPIC-012 Session Atomization — **ready to complete** (4/4 specs done)
- If no items match, omit the section entirely — do not show an empty heading.
Degradation
If chart.sh roadmap --json fails or returns empty data, skip the Decisions Needed section silently and continue with the rest of the status output.
Settings
Read from swain.settings.json (project) and ~/.config/swain/settings.json (user override).
| Key | Type | Default | Description |
|---|---|---|---|
status.cacheTTL |
number | 120 |
Cache time-to-live in seconds |
Session bookmark
After presenting status, update the bookmark with the most actionable highlight: bash "$(find . .claude .agents -path '*/swain-session/scripts/swain-bookmark.sh' -print -quit 2>/dev/null)" "Checked status — {key highlight}"
Error handling
- If chart.sh / specgraph is unavailable: skip artifact section, show other data
- If tk is unavailable: skip task section
- If gh CLI is unavailable or no GitHub remote: skip issues section
- If
.agents/session.jsondoesn't exist: skip bookmark - Never fail hard — show whatever data 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'.
125swain-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.
122swain-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.
122swain-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.
122swain
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.
119swain-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.
113