cristoslc avatar

Swain Doctor

Runs at every session start to validate your swain project setup: governance blocks in instructions, tool availability, memory directories, ticket structure, script permissions, and the .agents directory. It auto-migrates legacy .beads directories to .tickets, repairs stale artifact indexes, and fixes broken worktree layouts that don't match ADR conventions. The detection logic lives in a consolidated bash script that outputs structured JSON, then remediation happens selectively based on what actually failed. It's idempotent and safe to run manually whenever something feels off. If you're jumping between worktrees or onboarding to an existing swain repo, this is what catches configuration drift before it bites you mid-session.

skills.sh installs
123
GitHub stars
2
last updated
Aug 21, 2026

Install

$ npx -y skills add cristoslc/swain --skill swain-doctor --agent claude-code

Installs into .claude/skills of the current project.

Files

Doctor

Session-start health checks for swain projects. The consolidated script is authoritative for all detection. This skill file defines how to run the script and how to remediate each check.

Running the script

REPO_ROOT="$(git rev-parse --show-toplevel 2>/dev/null || pwd)"
bash "$REPO_ROOT/.agents/bin/swain-doctor.sh"

The script outputs structured JSON with { checks: [...], summary: {...} }. Each check has name, status, message, and optional detail. Parse it and present the summary table to the operator. Then use the remediation sections below only for checks that reported warning or advisory status — do not re-run detection.

To auto-fix flat-file artifacts: bash "$REPO_ROOT/.agents/bin/swain-doctor.sh" --fix-flat-artifacts

If the script is unavailable (e.g., .agents/bin/ symlinks not yet bootstrapped), fall back to running checks from the script source at skills/swain-doctor/scripts/swain-doctor.sh. Run checks sequentially (one Bash call at a time), never in parallel — parallel tool calls cascade-cancel on first error.

Preflight integration

Sponsors

Details

Repository
github.com/cristoslc/swain
Category
Automation & Workflows
First seen
Jun 3, 2026

More from cristoslc/swain

All 6
1feiskyer avatarcommand-creatorfeiskyer/claude-code-settingsCreate Claude Code custom slash commands with proper structure, frontmatter, and best practices. Use this skill whenever the user wants to create a new command,122skills.sh installs
2kingdee avatarkwc-lwc-developmentkingdee/kwc-skills【由 kwc-project-scaffold 调度】仅负责 LWC 组件代码编写,不直接承接用户需求,不创建文件。所有 KWC 需求和文件创建必须先经 kwc-project-scaffold。121skills.sh installs
3cinience avataralicloud-solution-content-article-illustratorcinience/alicloud-skillsUse when the user needs an end-to-end article illustration workflow in this repository that preserves Type x Style planning, loads article-illustration preferen118skills.sh installs
4feiskyer avatarkiro-skillfeiskyer/codex-settingsInteractive feature development workflow from idea to implementation. Creates requirements (EARS format), design documents, and implementation task lists. Use w115skills.sh installs
5charleswiltgen avataraxiom-xcode-mcp-toolscharleswiltgen/axiomXcode MCP workflow patterns — BuildFix loop, TestFix loop, preview verification, window targeting, tool gotchas113skills.sh installs
6feiskyer avatarspec-kit-skillfeiskyer/codex-settingsGitHub Spec-Kit integration for constitution-based spec-driven development. 7-phase workflow (constitution, specify, clarify, plan, tasks, analyze, implement). 110skills.sh installs