/smith:smith-newfrom smith
Starts a new feature from scratch or conversation context. Handles requirements gathering, planning, questions gate, then triggers autonomous build.
Ships in smith. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
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.
Marker before first append: the workflow-gate denies markerless Bash redirection, so cat >> "$SESSION" appends are blocked until the active-workflow marker exists. Create the marker (Phase 1 step 0 helper) FIRST, then write the invocation entry immediately after — do not log before the marker.
Timestamps are UTC. HH:MM:SS comes from date -u +%H:%M:%S — never a local clock, never a time from memory. The append already runs through a shell, so read the clock in that same command (TS=$(date -u +%H:%M:%S)) and spend no extra tool call. Substitute the resulting value: an unexpanded $(...) reaching the log is a known regression and will not parse. Every hook-written stamp in this log is date -u, so a local-clock entry lands hours away from its neighbours and skews the workflow window hooks/workflow_summary_lib.py derives from them.
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>
HH:MM:SS here is UTC as well — date -u +%H:%M:%S, same rule as above. The subagent-vault-writeback.sh block that lands beside this one is hook-written and therefore already UTC; a local-clock invocation stamp would make a subagent appear to finish hours before it started.
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 — invoke the shipped helper to create the per-branch marker. The workflow-gate hook (PR #20) exempts this exact helper by basename so the bootstrap runs even when no marker exists yet (per spec/31-workflow-gate-bootstrap). The helper also stamps the current session log with a workflow-start line so workflow-summary.sh --totals-only can attribute tokens to this workflow:
# After determining branch name in step 4 and feature slug:
~/.smith/scripts/create-active-workflow.sh \
--branch "$BRANCH" \
--workflow smith-new \
--slug "<feature-slug>" \
--worktree "$WORKTREE_PATH"
(Falls back to scripts/create-active-workflow.sh in repo-dev layouts.) Clear this marker 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"
Resolve the configured base branch, then fetch it (does NOT change the user's current branch). Smith reads the project's integration branch from the constitution; it falls back to main when unconfigured:
BASE_BRANCH=$(.specify/scripts/bash/get-base-branch.sh)
git fetch origin "$BASE_BRANCH"
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 the configured base branch (origin/$BASE_BRANCH):
git worktree add /tmp/smith-<slug> -b <number>-<short-name> "origin/$BASE_BRANCH"
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.
Before finalizing the file structure in plan.md, the plan subagent MUST bake
in clean-code / clean-architecture principles so the feature ships as small,
reusable, single-responsibility modules rather than a few large files:
Reuse before creating. Find existing components that already do (or nearly do) what the feature needs, and prefer extending/importing them over writing new code:
.smith/index/ exists, run /smith-navigate "<feature description>"
(or read the relevant .smith/index/systems/* manifest) to surface
reusable modules, services, and utilities. A built, current manifest
makes this lookup fast and comprehensive — if the project has none,
consider running /smith-index once up front so future features get
accurate reuse detection cheaply.plan.md, list the existing components the feature will reuse and call
out anything that would otherwise be duplicated so the build phase extends
rather than recreates it.Prescribe a decomposed file structure. The plan.md file-structure
section MUST split responsibilities (interface / application / domain /
infrastructure where applicable) into small, focused files rather than
monolithic ones. Follow the constitution's File Size Policy (300-line
soft target, 500-line decomposition threshold) — do NOT restate a different
number. Flag any planned file expected to exceed 300 lines and split it up
front.
Apply the Clean Code rubric. Use the /smith-clean-code skill as the canonical
rubric — intention-revealing names, small single-purpose functions,
separation of concerns, low duplication. Reference it rather than restating
it; record only the feature-specific structural decisions in plan.md.
These are planning-time advisories that shape plan.md — they inform the
build, they do not block it.
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:
Invoke smith-question and walk through the questions one at a time.
Invoke the smith-question skill now. It is the canonical contract for the
presentation format (Context → Options with pros/cons → Recommended +
reasoning), the one-question-at-a-time / wait-for-reply pacing, and the
response grammar (yes/recommended → recommended option; an option letter →
that option; skip → deferred; done → mark the rest skipped; anything else →
custom answer). Follow that contract — do NOT restate it here, and do NOT use
the interactive AskUserQuestion popup.
Phase-5 specifics on top of the contract:
questions.md generated above in the feature's
spec folder. Fill in each **Answer:** field immediately as each question is
answered (the contract's "record the answer immediately" step), so the flow
is resumable.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"
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 context.py,
.js, .jsx, .ts, or .tsx file, update the touched file's
.meta description layer in-context — see the "Update .meta
Descriptions for Touched Methods" sub-step pattern in the
/smith-bugfix skill (Phase 3.5). Touched-method-only regeneration
keeps token cost bounded and preserves previously-accepted
descriptions for untouched methods, per the v2 manifest contract
(data-model.md §4 and spec.md C1). Failures of the helper are
non-blocking — the missing descriptions are surfaced by
/smith-build's PR-body Description Coverage Warnings section.4.5 In-context .meta description update (mid-conversation code edits).
If /smith-new itself wrote or edited any source code directly
(i.e. before delegating to /smith-build), apply the v3 inline
Task-spawning prose from /smith-bugfix Phase 3.5 (step 3) per
modified file. The flow is: discover → build-prompt → spawn Task
(subagent_type=general, model=claude-haiku-4-5) → pipe JSON into
describe_write.py apply --update-touched. Subscription billing
via session auth — no ANTHROPIC_API_KEY. See /smith-bugfix
Phase 3.5 for the full identification heuristic and prompt
assembly. Skip silently if no source code was edited at this stage.
Display 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 the totals command and paste the lines it prints verbatim — do this BEFORE step 9 (clearing the active-workflow file) so the numbers are fresh. Pass the workflow's own session log via --session so totals are computed against the correct file even if the session log rolled over mid-workflow:
# $SESSION was captured at workflow start (step 0). Fall back to the marker's
# session_log field, then to .current-session, if it's not in scope here.
SESSION="${SESSION:-$(cat .smith/vault/.current-session 2>/dev/null)}"
bash "$HOME/.claude/hooks/workflow-summary.sh" --totals-only --session "$SESSION"
The bash invocation is a required action, not an optional extra — the totals lines must appear in the chat message. If it prints n/a (no workflow invocation found) and exits non-zero, do NOT present those as real numbers — note that totals were unavailable and which session file was checked.
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 "$(.specify/scripts/bash/get-base-branch.sh)"
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 silentlyAs the VERY LAST action — after the PR merge, worktree removal, marker clear, and
the reflection/reconciliation launches above — Run /smith-sync from the
primary repo on the default branch. This sweeps the team-shareable .smith/
artifacts (manifest, .meta describe layer, ledger, bank, agents, sessions)
accumulated this session into a single chore(smith): … [skip ci] commit and
pushes it to the default branch, so teammates receive the updated context.
Do NOT block on the background reflection sub-agent — this session's ledger
update (written asynchronously by reflection) will be captured by the NEXT
/smith-sync run. /smith-sync no-ops cleanly if there is nothing to sync.
'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.What SKILL.md sets; muted values are Claude Code's defaults
Claude Code refuses to install this plugin
.claude-plugin/plugin.json: author: Invalid input: expected object, received string, hooks: Invalid string: must start with "./", hooks: Invalid string: must end with ".json", skills: Invalid string: must start with "./"
.claude-plugin/plugin.json: author: Invalid input: expected object, received string, hooks: Invalid string: must start with "./", hooks: Invalid string: must end with ".json", skills: Invalid string: must start with "./"
Checked against Claude Code 2.1.332's install rules. The listing below is what the repository ships; Claude Code cannot install it as published.
36 skills in this plugin
/smithInitialize SpecKit on a new or existing project — scans the codebase, interviews you about project details, and generates CLAUDE.md, constitution.md, and the full .specify/ scaffolding with commands and agents./smith-activityOpen the local Smith activity dashboard — one loopback daemon serving every registered project, showing live workflow phases, sessions, subagents, worktrees, token usage and divergence findings. Start, stop, restart or check the daemon, or open a new tab for the current project./smith-analyzePerform a non-destructive cross-artifact consistency and quality analysis across spec.md, plan.md, and tasks.md after task generation./smith-auditRun a comprehensive audit on a specific system or all systems. Prompts for system selection, then runs all sub-audits and produces a unified report./smith-bankCaptures ideas mid-conversation and stores them in the vault for later processing. Use when the user wants to save an idea, park a thought, or come back to something later. Supports listing, processing, editing, and prioritizing banked ideas./smith-bugfixLightweight fix workflow for bugs and small changes. Autonomous from invocation through merged PR — no questions gate, no spec generation, no planning phase.Other plugins' skills for the same job