From spec-driven
Creates structured feature spec.md from description or PRD file (@file.md). Generates sequential ID, detects greenfield/brownfield via keywords/code search, supports --link for branch association.
npx claudepluginhub adeonir/claude-code-extras<description> | @<file.md># Init Command Initialize a new feature with a structured specification file. ## Content Separation (CRITICAL) Each artifact has a distinct purpose. Never mix these concerns. | File | Purpose | | -------- | -------------------------------------------------- | | spec.md | WHAT to build (requirements, acceptance criteria) | | plan.md | HOW to build (architecture, files, implementation) | | tasks.md | WHEN to build (ordered tasks with dependencies) | ### spec.md MUST contain ONLY: - User stories (As a... I want... so that...) - Functio...
/speckit-specifyCreates or updates feature specification from natural language description: generates short branch name, finds next feature number via git branches/specs checks, runs creation script.
/archStarts collaborative feature specification process: investigates codebase for patterns and constraints, proposes design with reasoning and file paths, resolves ambiguities via conversation, saves Markdown spec with behavior, architecture, constraints, and related files.
/initInitializes beads issue tracking database in current directory with optional prefix (defaults to dir name). Shows DB location, prefix, workflow overview, next steps; displays stats if already set up.
/initInitializes guided UI design for dashboards, apps, and tools. Assesses intent, proposes styles with rationale, builds components, and offers to save patterns.
/initDownloads and installs/updates the platform-specific notification binary for claude-notifications plugin from GitHub into the plugin's bin directory.
/initInitializes or re-boots llmdoc/ directory structure, runs multi-themed project investigations with investigator, and generates initial stable docs via recorder.
Share bugs, ideas, or general feedback.
Initialize a new feature with a structured specification file.
Each artifact has a distinct purpose. Never mix these concerns.
| File | Purpose |
|---|---|
| spec.md | WHAT to build (requirements, acceptance criteria) |
| plan.md | HOW to build (architecture, files, implementation) |
| tasks.md | WHEN to build (ordered tasks with dependencies) |
These belong in plan.md, created by /spec-driven:plan.
<description> - Text describing the feature@<file.md> - Path to PRD file to use as context--link <ID> - Associate current branch with existing featureArguments received: $ARGUMENTS
If --link <ID> provided:
.specs/spec.md frontmatter with branch: {current_branch}Scan .specs/ directory for existing features.
Find the highest ID number and increment by 1.
Example: If .specs/003-payment-flow/ exists, next ID is 004.
If .specs/ doesn't exist, start with 001.
Analyze the user's description to determine if this is greenfield (new) or brownfield (change to existing).
1. Extract keywords from description:
Brownfield keywords:
Greenfield keywords:
2. Search codebase for related code:
Extract technical terms from the description (e.g., "cache", "auth", "payment").
Use Glob/Grep to find related files:
# Example for "improve cache performance"
find . -name "*cache*" -type f
grep -r "cache" --include="*.ts" --include="*.js" -l
3. Determine type:
| Keywords | Code Found | Type |
|---|---|---|
| Greenfield | No | greenfield |
| Greenfield | Yes | Ask user |
| Brownfield | No | Ask user |
| Brownfield | Yes | brownfield |
| Unclear | No | greenfield |
| Unclear | Yes | Ask user |
4. If ambiguous, ask user:
> Found related code in: src/cache/redis.ts, src/cache/memory.ts
> Is this:
> 1. Feature nova (greenfield) - nao relacionada ao codigo existente
> 2. Mudanca em codigo existente (brownfield)
Store detected type for use in Step 7.
If input is a file reference (@file.md):
If input is text:
If input is empty:
When documentation is referenced with @path:
Output before generating spec:
## Extracted from Documentation
| Source | Item | Relevant | Mapped To |
| ------ | ----------------- | -------- | ----------------------------------- |
| {file} | {rule/constraint} | Yes/No | FR-xxx / AC-xxx / Skipped: {reason} |
If type is brownfield, understand the current user-facing behavior.
1. Analyze current behavior:
Use the technical terms found in Step 2b to understand what the system currently does from a user perspective.
2. Document baseline (high-level only):
Prepare baseline information for spec.md focusing on:
IMPORTANT: Do NOT include in the baseline:
Example baseline:
Current Behavior: Cache expires after fixed time, requires manual refresh
Gaps: No way to configure expiration, no automatic invalidation when data changes
From the description, derive a short kebab-case name:
add-2fauser-registrationGet current git branch:
git branch --show-current
Ask user:
{branch}?" (Yes/No)If on main/master, suggest creating a new branch.
Create .specs/{ID}-{feature}/spec.md with frontmatter and content:
Frontmatter:
---
id: { ID }
feature: { feature-name }
type: { greenfield | brownfield } # from Step 2b
status: draft
branch: { branch or empty }
created: { YYYY-MM-DD }
---
Content for greenfield:
# Feature: {Feature Title}
## Overview
{brief_description}
## User Stories
- As a {user_type}, I want {goal} so that {benefit}
## Functional Requirements
- [ ] FR-001: {requirement}
- [ ] FR-002: {requirement}
## Acceptance Criteria
- [ ] AC-001: {criterion}
- [ ] AC-002: {criterion}
## Notes
{additional_context}
<!-- Items marked [NEEDS CLARIFICATION] require resolution before plan -->
Content for brownfield (includes Baseline section):
NOTE: Baseline describes current BEHAVIOR, not implementation details. No file paths, no code, no technical specifics.
# Feature: {Feature Title}
## Overview
{brief_description}
## Baseline
Current state based on codebase analysis.
### Current Behavior
- {what the system currently does - user-facing behavior}
- {what the system currently does - user-facing behavior}
### Gaps / Limitations
- {what is missing or not working well}
- {what is missing or not working well}
## User Stories
- As a {user_type}, I want {goal} so that {benefit}
## Functional Requirements
- [ ] FR-001: {requirement}
- [ ] FR-002: {requirement}
## Acceptance Criteria
- [ ] AC-001: {criterion}
- [ ] AC-002: {criterion}
## Notes
{additional_context}
<!-- Items marked [NEEDS CLARIFICATION] require resolution before plan -->
For any unclear or underspecified items, add:
[NEEDS CLARIFICATION: specific question]
Inform the user:
{ID}-{feature}{greenfield | brownfield}.specs/{ID}-{feature}/spec.md{branch} (or "none")/spec-driven:clarify to resolve ambiguities, or /spec-driven:plan if none