From smith
Starts new feature workflows from scratch or conversation context: conversational requirements gathering, planning, questions gate, then autonomous build handoff. Triggers via /smith-new or natural phrases like 'let's smith this'.
npx claudepluginhub attckdigital/smithThis skill uses the workspace's default tool permissions.
This is the primary entry point for all new features. It combines requirements gathering, planning, and a questions gate into a single conversational flow, then hands off to autonomous execution.
Orchestrates SAM workflow for new features: discovery, codebase analysis, architecture spec, task decomposition, validation, context manifest. Creates MD/YAML artifacts for GitHub issues. Use for add/plan feature requests.
Guides GitHub Spec-Kit CLI integration for 7-phase constitution-based spec-driven feature development, managing .specify/specs/ directories with phases: Constitution, Specify, Clarify, Plan, Tasks, Analyze, Implement.
Manages 4-phase feature development pipeline: research, implementation planning, progress tracking, and phased execution via subcommands like /build research [name], status [name]. Ideal for structured major feature workflows.
Share bugs, ideas, or general feedback.
This is the primary entry point for all new features. It combines requirements gathering, planning, and a questions gate into a single conversational flow, then hands off to autonomous execution.
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 to the session log using this format:
### [HH:MM:SS] /smith-new <event>
**User Request:**
> <verbatim user message that triggered this action — capture the exact words the user typed, including any conversation context that led to the request. For natural language triggers, capture the trigger message. For explicit /smith-new invocations, capture $ARGUMENTS.>
**Synthesized Input:** <brief summary of what's being built>
**Outcome:** <what happened>
**Artifacts:** <files created/modified>
**Systems affected:** <system IDs>
Log at these points:
/smith-build autonomous phase was triggeredImmediately before every Agent tool call in this workflow, 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.
If the user says any of the following (or similar phrases) during a conversation, treat it as invoking this command using the full conversation context as the feature description:
When triggered by natural language, synthesize the entire conversation history into a comprehensive feature description and proceed as if that description was passed as $ARGUMENTS.
Before creating a worktree, check if the proposed feature warrants impact analysis.
Run /smith-explore automatically if ANY of these conditions are met:
$ARGUMENTS or conversation context mentions: "skill", "hook", "constitution", "CLAUDE.md", "MEMORY.md", "config", "policy".claude/skills/, .smith/, .specify/)--explore flag is passed explicitly/smith-explore with the feature description and scope auto-detected from contextclear: Continue to Phase 1 (worktree creation)conflicts-found (warnings only): Present summary to user, ask to proceed or resolve firstblocking-issues: STOP. Present blocking issues and require resolution before continuingIf none of the trigger conditions are met, skip directly to Phase 1. Exploration adds overhead and is only valuable for changes that may have system-wide impacts.
The worktree is created after exploration passes (or is skipped). This ensures the user's current working directory and branch are never touched — the entire workflow is isolated from the start.
Activate workflow tracking — create a per-branch file in .smith/vault/active-workflows/ in the main repo:
# After determining branch name in step 4:
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-new
feature: <feature-name>
branch: $BRANCH
worktree: $WORKTREE_PATH
started: $(date -u +"%Y-%m-%dT%H:%M:%S")
EOF
Clear this file at the end of Phase 6 (after merge) or if the workflow is abandoned. Use the shipped helper so this works even on projects that set Bash(rm:*) in the deny list:
.specify/scripts/bash/clear-active-workflow.sh "$BRANCH"
Fetch latest main (does NOT change the user's current branch):
git fetch origin main
Generate branch short-name (2-4 words) from $ARGUMENTS or conversation context. If no feature description is available yet (empty args, no context), use a placeholder like new-feature and rename the branch later after Phase 2.
Find next feature number by checking all three sources:
git ls-remote --heads origin | grep -oP '(?<=refs/heads/)\d+' | sort -n | tail -1git branch | grep -oP '^\s*\d+' | sort -n | tail -1ls -d .specify/systems/*/features/[0-9]*-* 2>/dev/null | grep -oP '\d+(?=-)' | sort -n | tail -1gh issue list --limit 1 --json number --jq '.[0].number'
Take the maximum across all sources and add 1.Create worktree with feature branch from origin/main:
git worktree add /tmp/smith-<slug> -b <number>-<short-name> origin/main
Store the worktree path (/tmp/smith-<slug>) as WORKTREE_PATH. The active-workflow file was already created in step 0 with the branch and worktree info.
Note: The user's current branch is completely unaffected. They can be on any branch — main, a feature branch, even a detached HEAD — and this workflow will not interfere.
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.
ls .smith/vault/ledger/*.md 2>/dev/null.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.mdcontext_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.Goal: Arrive at a clear, detailed feature description through conversation. This phase is purely conversational — no file operations needed. The worktree already exists from Phase 1.
$ARGUMENTS is empty AND no prior conversation context:$ARGUMENTS is provided:A complete feature description string that will be passed to the spec generation step.
Once requirements are finalized, launch a subagent to handle spec generation. The worktree (WORKTREE_PATH) was already created in Phase 1. All file operations happen there.
If the branch was created with a placeholder name in Phase 1 (because $ARGUMENTS was empty), rename it now:
cd $WORKTREE_PATH && git branch -m <old-placeholder-name> <number>-<short-name>
Rename the active-workflow file if the branch name changed:
OLD_SAFE=$(echo "$OLD_BRANCH" | sed 's/[^a-zA-Z0-9._-]/-/g')
NEW_SAFE=$(echo "$NEW_BRANCH" | sed 's/[^a-zA-Z0-9._-]/-/g')
mv .smith/vault/active-workflows/${OLD_SAFE}.yaml .smith/vault/active-workflows/${NEW_SAFE}.yaml
$WORKTREE_PATH/.specify/systems/system-*/spec.mdprimary_system (the system most directly impacted) and also_affects (other systems touched).specify/systems/<primary-system>/features/<NNN-short-name>/.specify/systems/cross-system/features/<NNN-short-name>/mkdir -p $WORKTREE_PATH/.specify/systems/<primary-system>/features/<NNN-short-name>/checklists
Note: Do NOT run create-new-feature.sh — the worktree creation in Phase 1 already created the branch.$WORKTREE_PATH/.specify/templates/spec-template.md---
feature: <NNN-short-name>
primary_system: <system-folder-name>
also_affects:
- <other-system-folder-name>
branch: <branch-name>
created: <YYYY-MM-DD>
status: in-progress
---
Fill all sections from the requirements conversation:
$WORKTREE_PATH/<feature-folder>/checklists/requirements.mdLaunch a separate subagent to generate the implementation plan. This preserves context window for the questions phase. All work happens in WORKTREE_PATH.
The subagent should:
Run setup script (from worktree):
cd $WORKTREE_PATH && .specify/scripts/bash/setup-plan.sh --json
Parse JSON for FEATURE_SPEC, IMPL_PLAN, SPECS_DIR, BRANCH.
Load context (from worktree):
$WORKTREE_PATH/.specify/memory/constitution.mdExecute plan workflow:
research.md (resolve unknowns, research dependencies)data-model.md, contracts/, quickstart.mdcd $WORKTREE_PATH && .specify/scripts/bash/update-agent-context.sh claudeReturn: Confirm plan artifacts are written to SPECS_DIR.
After the plan subagent completes, read ALL plan artifacts from WORKTREE_PATH and generate a comprehensive questions file. All file reads/writes in this phase use the worktree.
Read plan artifacts:
plan.md — architecture, file structure, tech decisionsresearch.md — decisions and alternativesdata-model.md — entities and relationships (if exists)contracts/ — API specifications (if exists)quickstart.md — integration scenarios (if exists)Generate <feature-folder>/questions.md (inside the feature's spec folder under .specify/systems/) with this structure:
# Implementation Questions: [Feature Name]
**Generated**: [DATE]
**Feature**: [Link to spec.md]
**Plan**: [Link to plan.md]
**Status**: AWAITING ANSWERS
---
## Q1: [Topic]
**Context**: [Quote relevant section from plan/spec/research that raises this question]
**Question**: [Specific question about an implementation decision]
**Options**:
| Option | Description | Implications |
|--------|-------------|--------------|
| A | [First option] | [Tradeoffs, effort, risk] |
| B | [Second option] | [Tradeoffs, effort, risk] |
| C | [Third option] | [Tradeoffs, effort, risk] |
**Recommended**: [A/B/C] — [Reasoning for recommendation]
**Answer**: ___
---
[Repeat for all questions]
Question quality rules:
Walk through questions interactively, one at a time.
For each question in the generated questions.md:
a. Present the question with its full context, all options with pros/cons, and the recommended answer with clear reasoning:
## Question [N] of [Total]: [Topic]
**Context:** [Quote from plan/spec that raises this question]
**Question:** [Specific implementation decision]
**Options:**
| Option | Description | Implications |
|--------|-------------|--------------|
| A | [description] | [pros: ..., cons: ...] |
| B | [description] | [pros: ..., cons: ...] |
| C | [description] | [pros: ..., cons: ...] |
**Recommended:** [Option letter] — [Reasoning]
Reply with an option letter, "yes" to accept the recommendation,
"skip" to defer, or type a custom answer.
b. Wait for the user's response, then:
"yes" / "recommended" → use the recommended answer"A", "B", etc.) → use that option"skip" → mark as **Answer:** SKIPPED — needs follow-upc. Immediately update questions.md — fill in the **Answer:** field for that question
d. Confirm and move to the next question: "Saved: Q[N] → [answer]. ([remaining] remaining)"
e. If the user says "done" before all questions, mark remaining as SKIPPED
After all questions answered:
a. Display a summary table of all answers b. Ask: "Would you like to change any answers? Reply with a question number or 'looks good'." c. If changes requested, re-present that question and collect a new answer d. Update Status in questions.md from "AWAITING ANSWERS" to "ANSWERED"
After answers are confirmed. All work continues in WORKTREE_PATH. The user's main working directory is never touched.
Update plan.md if any answers change the planned approach:
Copy .env from main repo to worktree if Docker-touching (scan plan.md for docker-compose.yml, Dockerfile references):
cp <main-repo-path>/.env $WORKTREE_PATH/.env
If Docker-touching, display warning:
"This feature modifies Docker configuration. The worktree isolates git only — Docker operations will affect running containers."
Build or Queue decision point. Ask the user:
All questions answered and spec is ready. Would you like to:
- Build now — launch
/smith-buildin the worktree for autonomous implementation- Queue for later — commit spec artifacts, push, and add to the Smith queue for batch processing
If "Queue for later" (or "2", "queue", "later"):
a. Ask: "Priority? (critical / high / medium / low)" — default to medium if the user just says "queue" without specifying
b. Commit spec artifacts in the worktree — stage and commit all files in the feature spec folder (spec.md, plan.md, questions.md, research.md, data-model.md, contracts/, checklists/):
cd $WORKTREE_PATH && git add <feature-spec-folder>/
cd $WORKTREE_PATH && git commit -m "docs: spec artifacts for <feature-name> — ready for queued build
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>"
c. Push the feature branch from the worktree:
cd $WORKTREE_PATH && git push -u origin <branch-name>
d. Create the queue entry in the main repo at .smith/vault/queue/<NNN-short-name>.md with this format:
---
task: "Build feature: <feature-name>"
branch: "<feature-branch-name>"
spec_path: "<path to the feature spec folder on the feature branch>"
primary_system: "<system ID from spec frontmatter>"
created: "<ISO timestamp>"
complexity: autonomous
priority: <user's choice or medium>
status: pending
depends_on: []
---
## Context
<brief description of the feature and key decisions from the questions phase>
## Artifacts on branch
- spec.md — feature specification
- plan.md — implementation plan
- questions.md — clarification questions (all answered)
- <list any other artifacts: research.md, data-model.md, contracts/, etc.>
## Execution Instructions
Run `/smith-build` from the `<branch-name>` branch with feature dir `<spec_path>`.
e. Clean up worktree:
git worktree remove $WORKTREE_PATH
f. Clear active-workflow file in the main repo (via the shipped helper, which coexists with a broad Bash(rm:*) deny rule):
.specify/scripts/bash/clear-active-workflow.sh "$BRANCH"
g. Confirm: "Queued: <filename> (priority: <level>, complexity: autonomous). Feature branch <branch-name> pushed with all spec artifacts. Run /smith-queue list to see pending tasks, or the 2am scheduler will pick it up automatically."
h. STOP here. Do NOT launch /smith-build.
If "Build now" (or "1", "build now", "yes", "go"):
Launch /smith-build in the worktree to execute the entire autonomous phase:
WORKTREE_PATH and the feature directory path as contextDisplay final summary to the user. Emit a chat message that starts with "Feature <name> complete. Here's the summary:" and includes the feature name and branch, files created/modified, PR link, release notes summary, and link to specs/<feature>/release.md. At the bottom, run bash hooks/workflow-summary.sh --totals-only and paste the two lines it prints (Total tokens used: ~<n> and Total duration: <d>) verbatim — do this BEFORE step 9 (clearing the active-workflow file) so the numbers are fresh. The bash invocation is a required action, not an optional extra — the two totals lines must appear in the chat message.
Merge PR from the main repo directory (not the worktree — avoids "main already checked out" errors):
IMPORTANT: Always run gh pr merge from the primary repo directory.
cd <main-repo-path> && gh pr merge <PR_NUMBER> --squash --delete-branch
cd <main-repo-path> && git pull origin main
Full workflow summary (session log only) — emitted automatically. The workflow-summary.sh Stop hook appends a "=== Workflow Summary ===" block with duration, estimated tokens, tool calls, subagent totals, and files changed to the session log file once the active-workflow file is removed (step 9 below). Do not emit the full block to the user manually — the two-line totals already surfaced in step 5 are the chat-visible version; the full block is for audit only.
Clean up worktree:
git worktree remove $WORKTREE_PATH
Clear workflow tracking — remove the active-workflow file via the shipped helper (safe against a 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 silently'I'\''m Groot'WORKTREE_PATH). Never checkout the feature branch or write files in the user's main working directory. The only files written to the main repo are vault entries (.smith/vault/queue/, .smith/vault/.active-workflow). The user's current branch is never changed or checked.