From smith
Executes autonomous build pipeline: generates tasks, implements code, tests, commits, pushes to branch, creates/merges PRs, and generates release notes without user interaction.
npx claudepluginhub attckdigital/smithThis skill uses the workspace's default tool permissions.
Executes the full build pipeline from answered questions through to merged PR and release notes. This command runs entirely without user interaction, using subagents to manage context.
Executes implementation plans from spec files: detects mode (sequential, delegated, team) from YAML frontmatter, creates git feature branches, manages task dependencies, dispatches agents, runs validations/hooks.
Automates bug fixes and small code changes autonomously from invocation to merged PR. No questions gate, spec generation, or planning—for quick, well-defined updates in 1-3 files.
Executes implementation tasks from docs/plan/plan.md using TDD workflow, commits changes via git, verifies hooks, and updates progress. Use after /plan in build pipeline.
Share bugs, ideas, or general feedback.
Executes the full build pipeline from answered questions through to merged PR and release notes. This command runs entirely without user interaction, using subagents to manage context.
Arguments: $ARGUMENTS
Throughout this action, log significant events to the vault session log. Read the session log path from .smith/vault/.current-session. If the file is missing or the vault is not initialized, skip all logging silently.
Append entries using this format:
### [HH:MM:SS] /smith-build <event>
**User Request:**
> <verbatim user message that triggered this action — if invoked via /smith-new, reference the original request logged there. If invoked manually for recovery, capture the recovery command.>
**Synthesized Input:** <brief summary of what's being built>
**Outcome:** <what happened>
**Artifacts:** <files created/modified>
**Systems affected:** <system IDs>
Log at these points:
Immediately before every Agent tool call in this workflow (including each phase subagent, testing subagent, and spec-update subagent), append a block to the session log. The Agent tool's return value does not expose subagent_type or model to the parent, so this is the only place that information can be captured.
### [HH:MM:SS] Subagent invoked: <description>
**Type:** <subagent_type or "general">
**Model:** <model override passed to Agent, or "inherited" if none>
After the Agent tool returns, the subagent-vault-writeback.sh hook automatically appends a matching "Subagent completed" block with metrics read from the sidechain transcript — do not duplicate that logging in the skill.
This command can be invoked in two ways:
/smith-new after questions are answered (normal flow)/smith-build for recovery if a previous build failed partwayActivate workflow tracking — create a per-branch file in .smith/vault/active-workflows/:
BRANCH=$(git rev-parse --abbrev-ref HEAD)
SAFE_BRANCH=$(echo "$BRANCH" | sed 's/[^a-zA-Z0-9._-]/-/g')
mkdir -p .smith/vault/active-workflows
cat > .smith/vault/active-workflows/${SAFE_BRANCH}.yaml << EOF
workflow: smith-build
feature: <detected from branch or spec>
branch: $BRANCH
started: $(date -u +"%Y-%m-%dT%H:%M:%S")
EOF
Clear this file at the end of Phase 7 (after release notes) or on unrecoverable failure. Use the shipped helper so this works even on projects that deny Bash(rm:*):
.specify/scripts/bash/clear-active-workflow.sh "$BRANCH"
Detect worktree context:
COMMON_DIR=$(git rev-parse --git-common-dir)
GIT_DIR=$(git rev-parse --git-dir)
COMMON_DIR ≠ GIT_DIR: we are in a worktree. Set WORKTREE_MODE=true and WORKTREE_PATH=$(pwd).PRIMARY_REPO=$(git rev-parse --git-common-dir | sed 's|/\.git$||')Run prerequisites check:
.specify/scripts/bash/check-prerequisites.sh --json --paths-only
Parse JSON for FEATURE_DIR and AVAILABLE_DOCS.
If the script fails (e.g., not on a feature branch), check:
$ARGUMENTS?specs/*/tasks.md?Load feature context from FEATURE_DIR:
spec.md (REQUIRED)plan.md (REQUIRED)questions.md (REQUIRED — verify Status is "ANSWERED")tasks.md (OPTIONAL — may not exist yet if this is first run)data-model.md (IF EXISTS)contracts/ (IF EXISTS)research.md (IF EXISTS)quickstart.md (IF EXISTS)If .smith/vault/ledger/ exists and contains non-empty files, load relevant Ledger sections to inform this workflow. If the directory is missing, empty, or unreadable, skip silently — the Ledger is purely additive and never required.
Check: ls .smith/vault/ledger/*.md 2>/dev/null
If files exist, read the following sections (higher-confidence entries first, truncate at ~2000 tokens per file):
.smith/vault/ledger/patterns.md.smith/vault/ledger/antipatterns.md.smith/vault/ledger/tool-preferences.md.smith/vault/ledger/edge-cases.md.smith/vault/ledger/project-quirks.mdUse loaded patterns as additional context — not as hard rules. The Ledger informs judgment, it does not override spec/plan/constitution.
Budget violation tracking: If any Ledger file was truncated (entries were dropped to fit within the ~2000 token budget per file), increment context_budget_violations in .smith/vault/ledger/.meta.json by 1. If .meta.json does not exist, create it from the default template first. This signal tells the reconciliation system that the Ledger is too large for the configured budget.
Determine build state (for recovery):
tasks.md exists, check for completed tasks [X] vs incomplete [ ]Launch a subagent to generate the task breakdown.
The subagent should:
tasks.md following the strict format:
- [ ] [TaskID] [P?] [Story?] Description with file path
smith-analyze logic):
If the build execution fails, check config for auto-retry:
.smith/config.json — check ledger.auto_retry and ledger.max_retriesauto_retry is false (default) or config is missing, do NOT retry — fail normallyauto_retry is true:
a. Re-read .smith/vault/ledger/antipatterns.md to get the latest failure patterns
b. Analyze the failure against known antipatterns to adjust the approach
c. Retry the execution with the adjusted approach
d. Repeat up to max_retries times (default: 2), re-reading antipatterns before each attempt
e. If all retries exhausted, fail with a summary of all attemptsNote: Auto-retry applies to the Phase 2 implementation loop. If a phase's subagent fails after 3 internal attempts AND auto-retry is enabled, the entire phase is retried with updated Ledger context.
Execute tasks phase-by-phase, each phase in its own subagent to manage context.
Verify/create ignore files based on plan.md tech stack:
.gitignore, .dockerignore, .eslintignore, .prettierignore as applicableParse tasks.md to extract phases and their tasks.
For each phase in tasks.md:
Launch a subagent with:
[X] in tasks.md upon completionPhase execution rules:
[X] markerPhase completion check:
[X]docker compose up -d --build <service> immediatelyLaunch a testing subagent after all implementation is complete.
cd services/command-center && pnpm testcd services/<service> && poetry run pytestservices/command-center/src/components/**services/command-center/src/pages/**services/command-center/src/hooks/**services/command-center/src/App.tsxcd services/command-center && pnpm exec playwright testLaunch a subagent to update related system spec files.
Identify modified files from git diff:
git diff main --name-only
Map modified files to system specs:
services/command-center/ → specs/system-15-command-center/spec.mdservices/email-pipeline/ → specs/system-03-email-archive-contact-graph/spec.mdservices/sentiment-engine/ → specs/sentiment-engine/spec.mdservices/communication-triage/ → specs/system-05-communication-triage/spec.mdservices/voice-training/ → specs/system-04-personal-voice/spec.mddocker-compose.yml → specs/system-01-core-infrastructure/spec.mdspecs/*/spec.md contentFor each affected spec.md:
Update STATUS.md at project root with current progress.
.specify/systems/After updating the legacy specs/system-*/spec.md files above, also update the canonical system specs in .specify/systems/:
Read the feature spec frontmatter — extract primary_system and also_affects fields. If the feature spec has no frontmatter (legacy spec in specs/), fall back to the file-path mapping in step 2 above.
Update primary system spec — Read .specify/systems/<primary-system>/spec.md and update any sections affected by the feature:
Update affected system specs — For each system in also_affects, read its .specify/systems/<system>/spec.md and update relevant sections.
Log updates to vault — If .smith/vault/.current-session exists, append an entry to the session log noting which system specs were updated and what changed.
Commit system spec updates as part of the same feature branch before creating the PR.
If the build cannot determine what to update in a system spec (ambiguous changes), flag this in the vault session log for the user to review rather than making incorrect updates.
git add <all modified files — list explicitly, not git add -A>
git commit -m "<conventional commit message>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>"
git add -A or git add .).env files or credentialsgit push -u origin <branch-name>
gh pr create --title "<short title>" --body "$(cat <<'EOF'
## Summary
<bullet points from release notes>
## Test plan
<from test results>
## Release notes
See specs/<feature>/release.md
Generated with [Claude Code](https://claude.com/claude-code)
EOF
)"
Then merge the PR. IMPORTANT: Always run gh pr merge from the primary repo directory, not from a worktree. Running from a worktree causes "fatal: 'main' is already checked out" errors.
# If in worktree mode:
cd <PRIMARY_REPO> && gh pr merge <pr-number> --squash --delete-branch
# If in normal mode:
gh pr merge <pr-number> --squash --delete-branch
Normal mode:
git checkout main
git pull origin main
Worktree mode: Do NOT run git checkout main — main is already checked out in the primary repo. Instead, proceed directly to Phase 6. The worktree cleanup in Phase 7 handles branch deletion.
After merging to main:
docker-compose.yml, Dockerfile, or service build contexts"This feature modifies Docker configuration. Worktree isolates git only — Docker operations will affect running containers."
/tmp:
# If in worktree mode: pull changes to primary repo first
cd <PRIMARY_REPO> && git pull origin main
docker compose up -d --build <service-name>
# Normal mode:
docker compose up -d --build <service-name>
.env: If in worktree mode and Docker operations are needed, ensure .env exists in the primary repo (it always should — this is a safety check).bash scripts/health-check.sh
Write specs/<feature>/release.md:
# Release: [Feature Name]
**Date**: [YYYY-MM-DD]
**Branch**: [branch-name]
**PR**: [#number](link)
**Spec**: [spec.md](spec.md)
## Summary
[2-3 sentence description of what was built]
## Changes
### Files Created
| File | Purpose |
|------|---------|
| path/to/file.tsx | Description |
### Files Modified
| File | Change |
|------|--------|
| path/to/file.tsx | What changed |
### System Specs Updated
| Spec | Changes Recorded |
|------|-----------------|
| system-15-command-center/spec.md | Description |
## Testing
### Unit Tests
- [PASS/FAIL] pnpm test — X tests passed
- [PASS/FAIL] poetry run pytest — X tests passed
### E2E Tests (if applicable)
- [PASS/FAIL] Existing Playwright suite — X tests passed
- [PASS/FAIL] New Playwright tests — X tests for [flows tested]
### Known Issues
- [Any test failures that couldn't be resolved]
## Deviations from Spec
[Any differences between what was spec'd and what was implemented, with reasoning]
## Infrastructure
- Docker services rebuilt: [list]
- Health check: [PASS/FAIL]
git add specs/<feature>/release.md
git commit -m "docs: add release notes for <feature>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>"
git push origin main
If WORKTREE_MODE=true:
cd <PRIMARY_REPO> && git worktree remove <WORKTREE_PATH>
"Worktree preserved at <WORKTREE_PATH> for debugging. Clean up with:
git worktree remove <WORKTREE_PATH>"
Remove the active-workflow file to signal the workflow is complete. Use the shipped helper, which coexists with a broad Bash(rm:*) deny rule:
.specify/scripts/bash/clear-active-workflow.sh "$BRANCH"
After workflow completion (success or failure), trigger a Ledger reflection if enabled:
.smith/config.json — if ledger.auto_reflect is true (default), proceed.smith/vault/ledger/ pathsmith-reflect workflow.smith/config.json is missing or ledger.auto_reflect is false, skip silentlyAfter reflection completes (or is skipped):
.smith/config.json — if ledger.reconcile.auto_reconcile is false, skip.smith/vault/ledger/.meta.json — check signals against thresholds:
estimated_tokens > thresholds.total_tokens_max (default 30000)context_budget_violations > thresholds.context_violations_threshold (default 3)reinforcements_since_reconcile > thresholds.reinforcements_threshold (default 50)last_reconcile is less than minimum_hours_between_reconciles (default 6) hours ago, skipreconcile_model (default: Haiku).meta.json is missing, or config is missing, skip silentlyOutput to the user:
main with services healthyIf /smith-build is run manually (not from /smith-new):
Detect current state by checking:
Resume from the appropriate phase:
git add -A or git add . — always stage specific files.env files or credentials