writing-specs
БесплатноБез исполняемых скриптовНе проверенComplete spec workflow - generates Run ID, creates isolated worktree, brainstorms requirements, writes lean spec documents that reference constitutions…
Об этом скилле
Writing Specifications
Overview
A specification defines WHAT to build and WHY. It is NOT an implementation plan.
Core principle: Reference constitutions, link to docs, keep it lean. The /plan command handles task decomposition.
Spec = Requirements + Architecture Plan = Tasks + Dependencies
When to Use
Use this skill when:
- Invoked from
/spectacular:specslash command - Creating a new feature specification from scratch
- Need the complete spec workflow (Run ID, worktree, brainstorm, spec, validation)
Do NOT use for:
- Implementation plans with task breakdown - Use
/spectacular:planinstead - API documentation - Goes in code comments or separate docs
- Runbooks or operational guides - Different document type
Announce: "I'm using the writing-specs skill to create a feature specification."
Workspace Detection
Before starting the spec workflow, detect the workspace mode:
# Detect workspace mode
REPO_COUNT=$(find . -maxdepth 2 -name ".git" -type d 2>/dev/null | wc -l | tr -d ' ')
if [ "$REPO_COUNT" -gt 1 ]; then
echo "Multi-repo workspace detected ($REPO_COUNT repos)"
WORKSPACE_MODE="multi-repo"
WORKSPACE_ROOT=$(pwd)
# List detected repos
find . -maxdepth 2 -name ".git" -type d | xargs -I{} dirname {} | sed 's|^\./||'
else
echo "Single-repo mode"
WORKSPACE_MODE="single-repo"
fi
Single-repo mode (current behavior):
- Specs stored in
specs/{runId}-{feature}/spec.mdat repo root - Worktree created at
.worktrees/{runId}-main/ - Constitution referenced from
@docs/constitutions/current/
Multi-repo mode (new behavior):
- Specs stored in
./specs/{runId}-{feature}/spec.mdat WORKSPACE root - NO worktree created (specs live at workspace level, not inside any repo)
- Each repo's constitution referenced separately
Constitution Adherence
All specifications MUST follow: @docs/constitutions/current/
- architecture.md - Layer boundaries, project structure
- patterns.md - Mandatory patterns (next-safe-action, ts-pattern, etc.)
- schema-rules.md - Database design philosophy
- tech-stack.md - Approved libraries and versions
- testing.md - Testing requirements
The Process
Step 0: Generate Run ID
First action: Generate a unique run identifier for this spec.
# Generate 6-char hash from feature name + timestamp
TIMESTAMP=$(date +%s)
RUN_ID=$(echo "{feature-description}-$TIMESTAMP" | shasum -a 256 | head -c 6)
echo "RUN_ID: $RUN_ID"
CRITICAL: Execute this entire block as a single multi-line Bash tool call. The comment on the first line is REQUIRED - without it, command substitution $(...) causes parse errors.
Store for use in:
- Spec directory name:
specs/{run-id}-{feature-slug}/ - Spec frontmatter metadata
- Plan generation
- Branch naming during execution
Announce: "Generated RUN_ID: {run-id} for tracking this spec run"
Step 0.5: Create Isolated Worktree
Announce: "Creating isolated worktree for this spec run..."
Multi-repo mode: Skip worktree creation. Specs live at workspace root, not inside any repo.
if [ "$WORKSPACE_MODE" = "multi-repo" ]; then
echo "Multi-repo mode: Specs stored at workspace root, no worktree needed"
mkdir -p specs/${RUN_ID}-${FEATURE_SLUG}
# Skip to Step 1 (brainstorming)
fi
Single-repo mode: Continue with worktree creation as normal.
Create worktree for isolated development:
Create branch using git-spice:
- Use
using-git-spiceskill to create branch{runId}-mainfrom current branch - Branch name format:
{runId}-main(e.g.,abc123-main)
- Use
Create worktree:
# Create worktree at .worktrees/{runId}-main/ git worktree add .worktrees/${RUN_ID}-main ${RUN_ID}-mainError handling:
- If worktree already exists: "Worktree {runId}-main already exists. Remove it first with
git worktree remove .worktrees/{runId}-mainor use a different feature name." - If worktree creation fails: Report the git error details and exit
- If worktree already exists: "Worktree {runId}-main already exists. Remove it first with
Working directory context:
- All subsequent file operations happen in
.worktrees/{runId}-main/ - Brainstorming and spec generation occur in the worktree context
- Main repository working directory remains unchanged
Announce: "Worktree created at .worktrees/{runId}-main/ - all work will happen in isolation"
Step 0.6: Install Dependencies in Worktree
REQUIRED: Each worktree needs dependencies installed before work begins.
Check CLAUDE.md for setup commands:
Look for this pattern in the project's CLAUDE.md:
## Development Commands ### Setup - **install**: `bun install` - **postinstall**: `npx prisma generate`If setup commands found, run installation:
# Navigate to worktree cd .worktrees/${RUN_ID}-main # Check if dependencies already installed (handles resume) if [ ! -d node_modules ]; then echo "Installing dependencies..." {install-command} # From
Установить writing-specs в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
FAQ
Что делает скилл writing-specs?
Complete spec workflow - generates Run ID, creates isolated worktree, brainstorms requirements, writes lean spec documents that reference constitutions, validates architecture quality, and reports completion
Как установить скилл writing-specs?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл writing-specs запускает скрипты?
Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.
Похожие скиллы
doc-coauthoring
Guide users through a structured workflow for co-authoring documentation. Use when user wants to write documentation, proposals, technical specs, decision…
от Anthropicacademy-guide
Stop and check this skill before finishing any reply to a question about how to use Claude or a Claude product — it recommends matching courses, tutorials…
от Anthropicinternal-comms
A set of resources to help me write all kinds of internal communications, using the formats that my company likes to use. Claude should use this skill…
от Anthropicskill-development
This skill should be used when the user wants to "create a skill", "add a skill to plugin", "write a new skill", "improve skill description", "organize skill…
от Anthropic