From 0ca12bf3589fcff48977b1bff923912b1208d40e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ahmet=20=C3=87etinkaya?= Date: Fri, 19 Sep 2025 17:11:03 +0300 Subject: [PATCH 1/4] refactor: migrate specs directory to docs/specs Update all references, paths, and directory structures from `specs/` to `docs/specs/` across documentation, scripts, and templates to better organize specifications as part of the docs hierarchy. This includes README.md, quickstart.md, spec-driven.md, bash and PowerShell scripts, and template files. --- README.md | 32 +++++++++++---------- docs/quickstart.md | 2 +- scripts/bash/common.sh | 2 +- scripts/bash/create-new-feature.sh | 2 +- scripts/bash/update-agent-context.sh | 2 +- scripts/powershell/common.ps1 | 2 +- scripts/powershell/create-new-feature.ps1 | 2 +- scripts/powershell/update-agent-context.ps1 | 2 +- spec-driven.md | 16 +++++------ templates/plan-template.md | 4 +-- templates/tasks-template.md | 2 +- 11 files changed, 35 insertions(+), 33 deletions(-) diff --git a/README.md b/README.md index 153d1dbe6..c6018dd53 100644 --- a/README.md +++ b/README.md @@ -246,7 +246,7 @@ delete any comments that you made, but you can't delete comments anybody else ma After this prompt is entered, you should see Claude Code kick off the planning and spec drafting process. Claude Code will also trigger some of the built-in scripts to set up the repository. -Once this step is completed, you should have a new branch created (e.g., `001-create-taskify`), as well as a new specification in the `specs/001-create-taskify` directory. +Once this step is completed, you should have a new branch created (e.g., `001-create-taskify`), as well as a new specification in the `docs/specs/001-create-taskify` directory. The produced specification should contain a set of user stories and functional requirements, as defined in the template. @@ -263,9 +263,10 @@ At this stage, your project folder contents should resemble the following: │ ├── get-feature-paths.sh │ ├── setup-plan.sh │ └── update-claude-md.sh -├── specs -│ └── 001-create-taskify -│ └── spec.md +├── docs +│ └── specs +│ └── 001-create-taskify +│ └── spec.md └── templates ├── plan-template.md ├── spec-template.md @@ -315,16 +316,17 @@ The output of this step will include a number of implementation detail documents │ ├── get-feature-paths.sh │ ├── setup-plan.sh │ └── update-claude-md.sh -├── specs -│ └── 001-create-taskify -│ ├── contracts -│ │ ├── api-spec.json -│ │ └── signalr-spec.md -│ ├── data-model.md -│ ├── plan.md -│ ├── quickstart.md -│ ├── research.md -│ └── spec.md +├── docs +│ └── specs +│ └── 001-create-taskify +│ ├── contracts +│ │ ├── api-spec.json +│ │ └── signalr-spec.md +│ ├── data-model.md +│ ├── plan.md +│ ├── quickstart.md +│ ├── research.md +│ └── spec.md └── templates ├── CLAUDE-template.md ├── plan-template.md @@ -383,7 +385,7 @@ You can also ask Claude Code (if you have the [GitHub CLI](https://docs.github.c Once ready, instruct Claude Code to implement your solution (example path included): ```text -implement specs/002-create-taskify/plan.md +implement docs/specs/002-create-taskify/plan.md ``` Claude Code will spring into action and will start creating the implementation. diff --git a/docs/quickstart.md b/docs/quickstart.md index 11d5c1e94..d0c008f83 100644 --- a/docs/quickstart.md +++ b/docs/quickstart.md @@ -104,7 +104,7 @@ to be doing that are obvious from reading this. Because I don't know if there's Finally, implement the solution: ```text -implement specs/002-create-taskify/plan.md +implement docs/specs/002-create-taskify/plan.md ``` ## Key Principles diff --git a/scripts/bash/common.sh b/scripts/bash/common.sh index 582d940de..82a5db0e4 100644 --- a/scripts/bash/common.sh +++ b/scripts/bash/common.sh @@ -13,7 +13,7 @@ check_feature_branch() { fi; return 0 } -get_feature_dir() { echo "$1/specs/$2"; } +get_feature_dir() { echo "$1/docs/specs/$2"; } get_feature_paths() { local repo_root=$(get_repo_root) diff --git a/scripts/bash/create-new-feature.sh b/scripts/bash/create-new-feature.sh index bc4b4067a..8fb781cfe 100644 --- a/scripts/bash/create-new-feature.sh +++ b/scripts/bash/create-new-feature.sh @@ -19,7 +19,7 @@ if [ -z "$FEATURE_DESCRIPTION" ]; then fi REPO_ROOT=$(git rev-parse --show-toplevel) -SPECS_DIR="$REPO_ROOT/specs" +SPECS_DIR="$REPO_ROOT/docs/specs" mkdir -p "$SPECS_DIR" HIGHEST=0 diff --git a/scripts/bash/update-agent-context.sh b/scripts/bash/update-agent-context.sh index 7742af3d4..6acf2cbb0 100644 --- a/scripts/bash/update-agent-context.sh +++ b/scripts/bash/update-agent-context.sh @@ -2,7 +2,7 @@ set -e REPO_ROOT=$(git rev-parse --show-toplevel) CURRENT_BRANCH=$(git rev-parse --abbrev-ref HEAD) -FEATURE_DIR="$REPO_ROOT/specs/$CURRENT_BRANCH" +FEATURE_DIR="$REPO_ROOT/docs/specs/$CURRENT_BRANCH" NEW_PLAN="$FEATURE_DIR/plan.md" CLAUDE_FILE="$REPO_ROOT/CLAUDE.md"; GEMINI_FILE="$REPO_ROOT/GEMINI.md"; COPILOT_FILE="$REPO_ROOT/.github/copilot-instructions.md" AGENT_TYPE="$1" diff --git a/scripts/powershell/common.ps1 b/scripts/powershell/common.ps1 index 3e04a1ece..c561679b1 100644 --- a/scripts/powershell/common.ps1 +++ b/scripts/powershell/common.ps1 @@ -21,7 +21,7 @@ function Test-FeatureBranch { function Get-FeatureDir { param([string]$RepoRoot, [string]$Branch) - Join-Path $RepoRoot "specs/$Branch" + Join-Path $RepoRoot "docs/specs/$Branch" } function Get-FeaturePathsEnv { diff --git a/scripts/powershell/create-new-feature.ps1 b/scripts/powershell/create-new-feature.ps1 index b99f08898..7af639afe 100644 --- a/scripts/powershell/create-new-feature.ps1 +++ b/scripts/powershell/create-new-feature.ps1 @@ -14,7 +14,7 @@ if (-not $FeatureDescription -or $FeatureDescription.Count -eq 0) { $featureDesc = ($FeatureDescription -join ' ').Trim() $repoRoot = git rev-parse --show-toplevel -$specsDir = Join-Path $repoRoot 'specs' +$specsDir = Join-Path $repoRoot 'docs/specs' New-Item -ItemType Directory -Path $specsDir -Force | Out-Null $highest = 0 diff --git a/scripts/powershell/update-agent-context.ps1 b/scripts/powershell/update-agent-context.ps1 index 7ac26a7d8..030975871 100644 --- a/scripts/powershell/update-agent-context.ps1 +++ b/scripts/powershell/update-agent-context.ps1 @@ -5,7 +5,7 @@ $ErrorActionPreference = 'Stop' $repoRoot = git rev-parse --show-toplevel $currentBranch = git rev-parse --abbrev-ref HEAD -$featureDir = Join-Path $repoRoot "specs/$currentBranch" +$featureDir = Join-Path $repoRoot "docs/specs/$currentBranch" $newPlan = Join-Path $featureDir 'plan.md' if (-not (Test-Path $newPlan)) { Write-Error "ERROR: No plan.md found at $newPlan"; exit 1 } diff --git a/spec-driven.md b/spec-driven.md index 0b763b9ac..d0c6f01ce 100644 --- a/spec-driven.md +++ b/spec-driven.md @@ -81,7 +81,7 @@ This command transforms a simple feature description (the user-prompt) into a co 1. **Automatic Feature Numbering**: Scans existing specs to determine the next feature number (e.g., 001, 002, 003) 2. **Branch Creation**: Generates a semantic branch name from your description and creates it automatically 3. **Template-Based Generation**: Copies and customizes the feature specification template with your requirements -4. **Directory Structure**: Creates the proper `specs/[branch-name]/` structure for all related documents +4. **Directory Structure**: Creates the proper `docs/specs/[branch-name]/` structure for all related documents ### The `/plan` Command @@ -125,7 +125,7 @@ Total: ~12 hours of documentation work # This automatically: # - Creates branch "003-chat-system" -# - Generates specs/003-chat-system/spec.md +# - Generates docs/specs/003-chat-system/spec.md # - Populates it with structured requirements # Step 2: Generate implementation plan (5 minutes) @@ -135,12 +135,12 @@ Total: ~12 hours of documentation work /tasks # This automatically creates: -# - specs/003-chat-system/plan.md -# - specs/003-chat-system/research.md (WebSocket library comparisons) -# - specs/003-chat-system/data-model.md (Message and User schemas) -# - specs/003-chat-system/contracts/ (WebSocket events, REST endpoints) -# - specs/003-chat-system/quickstart.md (Key validation scenarios) -# - specs/003-chat-system/tasks.md (Task list derived from the plan) +# - docs/specs/003-chat-system/plan.md +# - docs/specs/003-chat-system/research.md (WebSocket library comparisons) +# - docs/specs/003-chat-system/data-model.md (Message and User schemas) +# - docs/specs/003-chat-system/contracts/ (WebSocket events, REST endpoints) +# - docs/specs/003-chat-system/quickstart.md (Key validation scenarios) +# - docs/specs/003-chat-system/tasks.md (Task list derived from the plan) ``` In 15 minutes, you have: diff --git a/templates/plan-template.md b/templates/plan-template.md index 93ab96b5d..1b4dff4f8 100644 --- a/templates/plan-template.md +++ b/templates/plan-template.md @@ -4,7 +4,7 @@ **Branch**: `[###-feature-name]` | **Date**: [DATE] | **Spec**: [link] -**Input**: Feature specification from `/specs/[###-feature-name]/spec.md` +**Input**: Feature specification from `/docs/specs/[###-feature-name]/spec.md` ## Execution Flow (/plan command scope) ``` @@ -82,7 +82,7 @@ ### Documentation (this feature) ``` -specs/[###-feature]/ +docs/specs/[###-feature]/ ├── plan.md # This file (/plan command output) ├── research.md # Phase 0 output (/plan command) ├── data-model.md # Phase 1 output (/plan command) diff --git a/templates/tasks-template.md b/templates/tasks-template.md index b8a28fafd..ad53837ea 100644 --- a/templates/tasks-template.md +++ b/templates/tasks-template.md @@ -1,6 +1,6 @@ # Tasks: [FEATURE NAME] -**Input**: Design documents from `/specs/[###-feature-name]/` +**Input**: Design documents from `/docs/specs/[###-feature-name]/` **Prerequisites**: plan.md (required), research.md, data-model.md, contracts/ ## Execution Flow (main) From f2df6ac0ab422fdeae2cc9bd8841b829aa6915c9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ahmet=20=C3=87etinkaya?= Date: Fri, 19 Sep 2025 17:15:42 +0300 Subject: [PATCH 2/4] refactor: migrate tools and templates to .specify directory Update paths in documentation, scripts, and templates to reflect the new .specify subdirectory structure for memory files, scripts, and templates. This consolidates development tools while maintaining consistency across the project. --- CONTRIBUTING.md | 6 +- README.md | 62 +++++++++++---------- memory/constitution_update_checklist.md | 8 +-- scripts/bash/create-new-feature.sh | 2 +- scripts/bash/update-agent-context.sh | 2 +- scripts/powershell/create-new-feature.ps1 | 2 +- scripts/powershell/update-agent-context.ps1 | 2 +- spec-driven.md | 2 +- templates/commands/plan.md | 8 +-- templates/commands/specify.md | 6 +- templates/commands/tasks.md | 6 +- templates/plan-template.md | 8 +-- 12 files changed, 58 insertions(+), 56 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 0b1cbd726..59c9714e1 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -41,9 +41,9 @@ Here are a few things you can do that will increase the likelihood of your pull When working on spec-kit: 1. Test changes with the `specify` CLI commands (`/specify`, `/plan`, `/tasks`) in your coding agent of choice -2. Verify templates are working correctly in `templates/` directory -3. Test script functionality in the `scripts/` directory -4. Ensure memory files (`memory/constitution.md`) are updated if major process changes are made +2. Verify templates are working correctly in `.specify/templates/` directory +3. Test script functionality in the `.specify/scripts/` directory +4. Ensure memory files (`.specify/memory/constitution.md`) are updated if major process changes are made ## Resources diff --git a/README.md b/README.md index c6018dd53..03503a45d 100644 --- a/README.md +++ b/README.md @@ -253,24 +253,25 @@ The produced specification should contain a set of user stories and functional r At this stage, your project folder contents should resemble the following: ```text -├── memory -│ ├── constitution.md -│ └── constitution_update_checklist.md -├── scripts -│ ├── check-task-prerequisites.sh -│ ├── common.sh -│ ├── create-new-feature.sh -│ ├── get-feature-paths.sh -│ ├── setup-plan.sh -│ └── update-claude-md.sh +├── .specify +│ ├── memory +│ │ ├── constitution.md +│ │ └── constitution_update_checklist.md +│ ├── scripts +│ │ ├── check-task-prerequisites.sh +│ │ ├── common.sh +│ │ ├── create-new-feature.sh +│ │ ├── get-feature-paths.sh +│ │ ├── setup-plan.sh +│ │ └── update-claude-md.sh +│ └── templates +│ ├── plan-template.md +│ ├── spec-template.md +│ └── tasks-template.md ├── docs │ └── specs │ └── 001-create-taskify │ └── spec.md -└── templates - ├── plan-template.md - ├── spec-template.md - └── tasks-template.md ``` ### **STEP 2:** Functional specification clarification @@ -305,17 +306,23 @@ The output of this step will include a number of implementation detail documents ```text . +├── .specify +│ ├── memory +│ │ ├── constitution.md +│ │ └── constitution_update_checklist.md +│ ├── scripts +│ │ ├── check-task-prerequisites.sh +│ │ ├── common.sh +│ │ ├── create-new-feature.sh +│ │ ├── get-feature-paths.sh +│ │ ├── setup-plan.sh +│ │ └── update-claude-md.sh +│ └── templates +│ ├── CLAUDE-template.md +│ ├── plan-template.md +│ ├── spec-template.md +│ └── tasks-template.md ├── CLAUDE.md -├── memory -│ ├── constitution.md -│ └── constitution_update_checklist.md -├── scripts -│ ├── check-task-prerequisites.sh -│ ├── common.sh -│ ├── create-new-feature.sh -│ ├── get-feature-paths.sh -│ ├── setup-plan.sh -│ └── update-claude-md.sh ├── docs │ └── specs │ └── 001-create-taskify @@ -327,11 +334,6 @@ The output of this step will include a number of implementation detail documents │ ├── quickstart.md │ ├── research.md │ └── spec.md -└── templates - ├── CLAUDE-template.md - ├── plan-template.md - ├── spec-template.md - └── tasks-template.md ``` Check the `research.md` document to ensure that the right tech stack is used, based on your instructions. You can ask Claude Code to refine it if any of the components stand out, or even have it check the locally-installed version of the platform/framework you want to use (e.g., .NET). @@ -378,7 +380,7 @@ This helps refine the implementation plan and helps you avoid potential blind sp You can also ask Claude Code (if you have the [GitHub CLI](https://docs.github.com/en/github-cli/github-cli) installed) to go ahead and create a pull request from your current branch to `main` with a detailed description, to make sure that the effort is properly tracked. >[!NOTE] ->Before you have the agent implement it, it's also worth prompting Claude Code to cross-check the details to see if there are any over-engineered pieces (remember - it can be over-eager). If over-engineered components or decisions exist, you can ask Claude Code to resolve them. Ensure that Claude Code follows the [constitution](base/memory/constitution.md) as the foundational piece that it must adhere to when establishing the plan. +>Before you have the agent implement it, it's also worth prompting Claude Code to cross-check the details to see if there are any over-engineered pieces (remember - it can be over-eager). If over-engineered components or decisions exist, you can ask Claude Code to resolve them. Ensure that Claude Code follows the [constitution](.specify/memory/constitution.md) as the foundational piece that it must adhere to when establishing the plan. ### STEP 5: Implementation diff --git a/memory/constitution_update_checklist.md b/memory/constitution_update_checklist.md index 7f15d7ff6..dd2c8beba 100644 --- a/memory/constitution_update_checklist.md +++ b/memory/constitution_update_checklist.md @@ -1,13 +1,13 @@ # Constitution Update Checklist -When amending the constitution (`/memory/constitution.md`), ensure all dependent documents are updated to maintain consistency. +When amending the constitution (`/.specify/memory/constitution.md`), ensure all dependent documents are updated to maintain consistency. ## Templates to Update ### When adding/modifying ANY article: -- [ ] `/templates/plan-template.md` - Update Constitution Check section -- [ ] `/templates/spec-template.md` - Update if requirements/scope affected -- [ ] `/templates/tasks-template.md` - Update if new task types needed +- [ ] `/.specify/templates/plan-template.md` - Update Constitution Check section +- [ ] `/.specify/templates/spec-template.md` - Update if requirements/scope affected +- [ ] `/.specify/templates/tasks-template.md` - Update if new task types needed - [ ] `/.claude/commands/plan.md` - Update if planning process changes - [ ] `/.claude/commands/tasks.md` - Update if task generation affected - [ ] `/CLAUDE.md` - Update runtime development guidelines diff --git a/scripts/bash/create-new-feature.sh b/scripts/bash/create-new-feature.sh index 8fb781cfe..7e850a351 100644 --- a/scripts/bash/create-new-feature.sh +++ b/scripts/bash/create-new-feature.sh @@ -45,7 +45,7 @@ git checkout -b "$BRANCH_NAME" FEATURE_DIR="$SPECS_DIR/$BRANCH_NAME" mkdir -p "$FEATURE_DIR" -TEMPLATE="$REPO_ROOT/templates/spec-template.md" +TEMPLATE="$REPO_ROOT/.specify/templates/spec-template.md" SPEC_FILE="$FEATURE_DIR/spec.md" if [ -f "$TEMPLATE" ]; then cp "$TEMPLATE" "$SPEC_FILE"; else touch "$SPEC_FILE"; fi diff --git a/scripts/bash/update-agent-context.sh b/scripts/bash/update-agent-context.sh index 6acf2cbb0..cd5f5c8e5 100644 --- a/scripts/bash/update-agent-context.sh +++ b/scripts/bash/update-agent-context.sh @@ -13,7 +13,7 @@ NEW_FRAMEWORK=$(grep "^**Primary Dependencies**: " "$NEW_PLAN" 2>/dev/null | hea NEW_DB=$(grep "^**Storage**: " "$NEW_PLAN" 2>/dev/null | head -1 | sed 's/^**Storage**: //' | grep -v "N/A" | grep -v "NEEDS CLARIFICATION" || echo "") NEW_PROJECT_TYPE=$(grep "^**Project Type**: " "$NEW_PLAN" 2>/dev/null | head -1 | sed 's/^**Project Type**: //' || echo "") update_agent_file() { local target_file="$1" agent_name="$2"; echo "Updating $agent_name context file: $target_file"; local temp_file=$(mktemp); if [ ! -f "$target_file" ]; then - echo "Creating new $agent_name context file..."; if [ -f "$REPO_ROOT/templates/agent-file-template.md" ]; then cp "$REPO_ROOT/templates/agent-file-template.md" "$temp_file"; else echo "ERROR: Template not found"; return 1; fi; + echo "Creating new $agent_name context file..."; if [ -f "$REPO_ROOT/.specify/templates/agent-file-template.md" ]; then cp "$REPO_ROOT/.specify/templates/agent-file-template.md" "$temp_file"; else echo "ERROR: Template not found"; return 1; fi; sed -i.bak "s/\[PROJECT NAME\]/$(basename $REPO_ROOT)/" "$temp_file"; sed -i.bak "s/\[DATE\]/$(date +%Y-%m-%d)/" "$temp_file"; sed -i.bak "s/\[EXTRACTED FROM ALL PLAN.MD FILES\]/- $NEW_LANG + $NEW_FRAMEWORK ($CURRENT_BRANCH)/" "$temp_file"; if [[ "$NEW_PROJECT_TYPE" == *"web"* ]]; then sed -i.bak "s|\[ACTUAL STRUCTURE FROM PLANS\]|backend/\nfrontend/\ntests/|" "$temp_file"; else sed -i.bak "s|\[ACTUAL STRUCTURE FROM PLANS\]|src/\ntests/|" "$temp_file"; fi; if [[ "$NEW_LANG" == *"Python"* ]]; then COMMANDS="cd src && pytest && ruff check ."; elif [[ "$NEW_LANG" == *"Rust"* ]]; then COMMANDS="cargo test && cargo clippy"; elif [[ "$NEW_LANG" == *"JavaScript"* ]] || [[ "$NEW_LANG" == *"TypeScript"* ]]; then COMMANDS="npm test && npm run lint"; else COMMANDS="# Add commands for $NEW_LANG"; fi; sed -i.bak "s|\[ONLY COMMANDS FOR ACTIVE TECHNOLOGIES\]|$COMMANDS|" "$temp_file"; diff --git a/scripts/powershell/create-new-feature.ps1 b/scripts/powershell/create-new-feature.ps1 index 7af639afe..9e99475d4 100644 --- a/scripts/powershell/create-new-feature.ps1 +++ b/scripts/powershell/create-new-feature.ps1 @@ -38,7 +38,7 @@ git checkout -b $branchName | Out-Null $featureDir = Join-Path $specsDir $branchName New-Item -ItemType Directory -Path $featureDir -Force | Out-Null -$template = Join-Path $repoRoot 'templates/spec-template.md' +$template = Join-Path $repoRoot '.specify/templates/spec-template.md' $specFile = Join-Path $featureDir 'spec.md' if (Test-Path $template) { Copy-Item $template $specFile -Force } else { New-Item -ItemType File -Path $specFile | Out-Null } diff --git a/scripts/powershell/update-agent-context.ps1 b/scripts/powershell/update-agent-context.ps1 index 030975871..7c4f2a102 100644 --- a/scripts/powershell/update-agent-context.ps1 +++ b/scripts/powershell/update-agent-context.ps1 @@ -30,7 +30,7 @@ $newProjectType = Get-PlanValue 'Project Type' function Initialize-AgentFile($targetFile, $agentName) { if (Test-Path $targetFile) { return } - $template = Join-Path $repoRoot 'templates/agent-file-template.md' + $template = Join-Path $repoRoot '.specify/templates/agent-file-template.md' if (-not (Test-Path $template)) { Write-Error "Template not found: $template"; return } $content = Get-Content $template -Raw $content = $content.Replace('[PROJECT NAME]', (Split-Path $repoRoot -Leaf)) diff --git a/spec-driven.md b/spec-driven.md index d0c6f01ce..fa7b9575c 100644 --- a/spec-driven.md +++ b/spec-driven.md @@ -268,7 +268,7 @@ The templates transform the LLM from a creative writer into a disciplined specif ## The Constitutional Foundation: Enforcing Architectural Discipline -At the heart of SDD lies a constitution—a set of immutable principles that govern how specifications become code. The constitution (`memory/constitution.md`) acts as the architectural DNA of the system, ensuring that every generated implementation maintains consistency, simplicity, and quality. +At the heart of SDD lies a constitution—a set of immutable principles that govern how specifications become code. The constitution (`.specify/memory/constitution.md`) acts as the architectural DNA of the system, ensuring that every generated implementation maintains consistency, simplicity, and quality. ### The Nine Articles of Development diff --git a/templates/commands/plan.md b/templates/commands/plan.md index 4c5cbf323..6dcf7cb62 100644 --- a/templates/commands/plan.md +++ b/templates/commands/plan.md @@ -1,8 +1,8 @@ --- description: Execute the implementation planning workflow using the plan template to generate design artifacts. scripts: - sh: scripts/bash/setup-plan.sh --json - ps: scripts/powershell/setup-plan.ps1 -Json + sh: .specify/scripts/bash/setup-plan.sh --json + ps: .specify/scripts/powershell/setup-plan.ps1 -Json --- Given the implementation details provided as an argument, do this: @@ -14,10 +14,10 @@ Given the implementation details provided as an argument, do this: - Success criteria and acceptance criteria - Any technical constraints or dependencies mentioned -3. Read the constitution at `/memory/constitution.md` to understand constitutional requirements. +3. Read the constitution at `/.specify/memory/constitution.md` to understand constitutional requirements. 4. Execute the implementation plan template: - - Load `/templates/plan-template.md` (already copied to IMPL_PLAN path) + - Load `/.specify/templates/plan-template.md` (already copied to IMPL_PLAN path) - Set Input path to FEATURE_SPEC - Run the Execution Flow (main) function steps 1-10 - The template is self-contained and executable diff --git a/templates/commands/specify.md b/templates/commands/specify.md index 41b8f6f60..8f94ccecf 100644 --- a/templates/commands/specify.md +++ b/templates/commands/specify.md @@ -1,14 +1,14 @@ --- description: Create or update the feature specification from a natural language feature description. scripts: - sh: scripts/bash/create-new-feature.sh --json "{ARGS}" - ps: scripts/powershell/create-new-feature.ps1 -Json "{ARGS}" + sh: .specify/scripts/bash/create-new-feature.sh --json "{ARGS}" + ps: .specify/scripts/powershell/create-new-feature.ps1 -Json "{ARGS}" --- Given the feature description provided as an argument, do this: 1. Run the script `{SCRIPT}` from repo root and parse its JSON output for BRANCH_NAME and SPEC_FILE. All file paths must be absolute. -2. Load `templates/spec-template.md` to understand required sections. +2. Load `.specify/templates/spec-template.md` to understand required sections. 3. Write the specification to SPEC_FILE using the template structure, replacing placeholders with concrete details derived from the feature description (arguments) while preserving section order and headings. 4. Report completion with branch name, spec file path, and readiness for the next phase. diff --git a/templates/commands/tasks.md b/templates/commands/tasks.md index 29b4cd25e..6f9664900 100644 --- a/templates/commands/tasks.md +++ b/templates/commands/tasks.md @@ -1,8 +1,8 @@ --- description: Generate an actionable, dependency-ordered tasks.md for the feature based on available design artifacts. scripts: - sh: scripts/bash/check-task-prerequisites.sh --json - ps: scripts/powershell/check-task-prerequisites.ps1 -Json + sh: .specify/scripts/bash/check-task-prerequisites.sh --json + ps: .specify/scripts/powershell/check-task-prerequisites.ps1 -Json --- Given the context provided as an argument, do this: @@ -21,7 +21,7 @@ Given the context provided as an argument, do this: - Generate tasks based on what's available 3. Generate tasks following the template: - - Use `/templates/tasks-template.md` as the base + - Use `/.specify/templates/tasks-template.md` as the base - Replace example tasks with actual tasks based on: * **Setup tasks**: Project init, dependencies, linting * **Test tasks [P]**: One per contract, one per integration scenario diff --git a/templates/plan-template.md b/templates/plan-template.md index 1b4dff4f8..3315832f5 100644 --- a/templates/plan-template.md +++ b/templates/plan-template.md @@ -1,7 +1,7 @@ # Implementation Plan: [FEATURE] - - + + **Branch**: `[###-feature-name]` | **Date**: [DATE] | **Spec**: [link] **Input**: Feature specification from `/docs/specs/[###-feature-name]/spec.md` @@ -187,7 +187,7 @@ ios/ or android/ *This section describes what the /tasks command will do - DO NOT execute during /plan* **Task Generation Strategy**: -- Load `/templates/tasks-template.md` as base +- Load `/.specify/templates/tasks-template.md` as base - Generate tasks from Phase 1 design docs (contracts, data model, quickstart) - Each contract → contract test task [P] - Each entity → model creation task [P] @@ -237,4 +237,4 @@ ios/ or android/ - [ ] Complexity deviations documented --- -*Based on Constitution v2.1.1 - See `/memory/constitution.md`* \ No newline at end of file +*Based on Constitution v2.1.1 - See `/.specify/memory/constitution.md`* \ No newline at end of file From e5da23768f2129398f23588fb159c47e3ec9c804 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ahmet=20=C3=87etinkaya?= Date: Fri, 19 Sep 2025 21:21:58 +0300 Subject: [PATCH 3/4] Revert "refactor: migrate tools and templates to .specify directory" This reverts commit f2df6ac0ab422fdeae2cc9bd8841b829aa6915c9. --- CONTRIBUTING.md | 6 +-- README.md | 62 +++++++++++------------ scripts/bash/create-new-feature.sh | 2 +- scripts/powershell/create-new-feature.ps1 | 2 +- spec-driven.md | 2 +- templates/commands/plan.md | 8 +-- templates/commands/specify.md | 6 +-- templates/commands/tasks.md | 6 +-- templates/plan-template.md | 2 +- 9 files changed, 47 insertions(+), 49 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index c23913c38..9853fd110 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -41,9 +41,9 @@ Here are a few things you can do that will increase the likelihood of your pull When working on spec-kit: 1. Test changes with the `specify` CLI commands (`/specify`, `/plan`, `/tasks`) in your coding agent of choice -2. Verify templates are working correctly in `.specify/templates/` directory -3. Test script functionality in the `.specify/scripts/` directory -4. Ensure memory files (`.specify/memory/constitution.md`) are updated if major process changes are made +2. Verify templates are working correctly in `templates/` directory +3. Test script functionality in the `scripts/` directory +4. Ensure memory files (`memory/constitution.md`) are updated if major process changes are made ## Resources diff --git a/README.md b/README.md index 8ce6fbe98..92aac48d7 100644 --- a/README.md +++ b/README.md @@ -304,25 +304,24 @@ The produced specification should contain a set of user stories and functional r At this stage, your project folder contents should resemble the following: ```text -├── .specify -│ ├── memory -│ │ ├── constitution.md -│ │ └── constitution_update_checklist.md -│ ├── scripts -│ │ ├── check-task-prerequisites.sh -│ │ ├── common.sh -│ │ ├── create-new-feature.sh -│ │ ├── get-feature-paths.sh -│ │ ├── setup-plan.sh -│ │ └── update-claude-md.sh -│ └── templates -│ ├── plan-template.md -│ ├── spec-template.md -│ └── tasks-template.md +├── memory +│ ├── constitution.md +│ └── constitution_update_checklist.md +├── scripts +│ ├── check-task-prerequisites.sh +│ ├── common.sh +│ ├── create-new-feature.sh +│ ├── get-feature-paths.sh +│ ├── setup-plan.sh +│ └── update-claude-md.sh ├── docs │ └── specs │ └── 001-create-taskify │ └── spec.md +└── templates + ├── plan-template.md + ├── spec-template.md + └── tasks-template.md ``` ### **STEP 3:** Functional specification clarification @@ -357,23 +356,17 @@ The output of this step will include a number of implementation detail documents ```text . -├── .specify -│ ├── memory -│ │ ├── constitution.md -│ │ └── constitution_update_checklist.md -│ ├── scripts -│ │ ├── check-task-prerequisites.sh -│ │ ├── common.sh -│ │ ├── create-new-feature.sh -│ │ ├── get-feature-paths.sh -│ │ ├── setup-plan.sh -│ │ └── update-claude-md.sh -│ └── templates -│ ├── CLAUDE-template.md -│ ├── plan-template.md -│ ├── spec-template.md -│ └── tasks-template.md ├── CLAUDE.md +├── memory +│ ├── constitution.md +│ └── constitution_update_checklist.md +├── scripts +│ ├── check-task-prerequisites.sh +│ ├── common.sh +│ ├── create-new-feature.sh +│ ├── get-feature-paths.sh +│ ├── setup-plan.sh +│ └── update-claude-md.sh ├── docs │ └── specs │ └── 001-create-taskify @@ -385,6 +378,11 @@ The output of this step will include a number of implementation detail documents │ ├── quickstart.md │ ├── research.md │ └── spec.md +└── templates + ├── CLAUDE-template.md + ├── plan-template.md + ├── spec-template.md + └── tasks-template.md ``` Check the `research.md` document to ensure that the right tech stack is used, based on your instructions. You can ask Claude Code to refine it if any of the components stand out, or even have it check the locally-installed version of the platform/framework you want to use (e.g., .NET). @@ -431,7 +429,7 @@ This helps refine the implementation plan and helps you avoid potential blind sp You can also ask Claude Code (if you have the [GitHub CLI](https://docs.github.com/en/github-cli/github-cli) installed) to go ahead and create a pull request from your current branch to `main` with a detailed description, to make sure that the effort is properly tracked. >[!NOTE] ->Before you have the agent implement it, it's also worth prompting Claude Code to cross-check the details to see if there are any over-engineered pieces (remember - it can be over-eager). If over-engineered components or decisions exist, you can ask Claude Code to resolve them. Ensure that Claude Code follows the [constitution](.specify/memory/constitution.md) as the foundational piece that it must adhere to when establishing the plan. +>Before you have the agent implement it, it's also worth prompting Claude Code to cross-check the details to see if there are any over-engineered pieces (remember - it can be over-eager). If over-engineered components or decisions exist, you can ask Claude Code to resolve them. Ensure that Claude Code follows the [constitution](base/memory/constitution.md) as the foundational piece that it must adhere to when establishing the plan. ### STEP 6: Implementation diff --git a/scripts/bash/create-new-feature.sh b/scripts/bash/create-new-feature.sh index 7e850a351..8fb781cfe 100644 --- a/scripts/bash/create-new-feature.sh +++ b/scripts/bash/create-new-feature.sh @@ -45,7 +45,7 @@ git checkout -b "$BRANCH_NAME" FEATURE_DIR="$SPECS_DIR/$BRANCH_NAME" mkdir -p "$FEATURE_DIR" -TEMPLATE="$REPO_ROOT/.specify/templates/spec-template.md" +TEMPLATE="$REPO_ROOT/templates/spec-template.md" SPEC_FILE="$FEATURE_DIR/spec.md" if [ -f "$TEMPLATE" ]; then cp "$TEMPLATE" "$SPEC_FILE"; else touch "$SPEC_FILE"; fi diff --git a/scripts/powershell/create-new-feature.ps1 b/scripts/powershell/create-new-feature.ps1 index 9e99475d4..7af639afe 100644 --- a/scripts/powershell/create-new-feature.ps1 +++ b/scripts/powershell/create-new-feature.ps1 @@ -38,7 +38,7 @@ git checkout -b $branchName | Out-Null $featureDir = Join-Path $specsDir $branchName New-Item -ItemType Directory -Path $featureDir -Force | Out-Null -$template = Join-Path $repoRoot '.specify/templates/spec-template.md' +$template = Join-Path $repoRoot 'templates/spec-template.md' $specFile = Join-Path $featureDir 'spec.md' if (Test-Path $template) { Copy-Item $template $specFile -Force } else { New-Item -ItemType File -Path $specFile | Out-Null } diff --git a/spec-driven.md b/spec-driven.md index ff02627b5..45005de6a 100644 --- a/spec-driven.md +++ b/spec-driven.md @@ -268,7 +268,7 @@ The templates transform the LLM from a creative writer into a disciplined specif ## The Constitutional Foundation: Enforcing Architectural Discipline -At the heart of SDD lies a constitution—a set of immutable principles that govern how specifications become code. The constitution (`.specify/memory/constitution.md`) acts as the architectural DNA of the system, ensuring that every generated implementation maintains consistency, simplicity, and quality. +At the heart of SDD lies a constitution—a set of immutable principles that govern how specifications become code. The constitution (`memory/constitution.md`) acts as the architectural DNA of the system, ensuring that every generated implementation maintains consistency, simplicity, and quality. ### The Nine Articles of Development diff --git a/templates/commands/plan.md b/templates/commands/plan.md index e2e865dd2..18a0b5c64 100644 --- a/templates/commands/plan.md +++ b/templates/commands/plan.md @@ -1,8 +1,8 @@ --- description: Execute the implementation planning workflow using the plan template to generate design artifacts. scripts: - sh: .specify/scripts/bash/setup-plan.sh --json - ps: .specify/scripts/powershell/setup-plan.ps1 -Json + sh: scripts/bash/setup-plan.sh --json + ps: scripts/powershell/setup-plan.ps1 -Json --- Given the implementation details provided as an argument, do this: @@ -14,10 +14,10 @@ Given the implementation details provided as an argument, do this: - Success criteria and acceptance criteria - Any technical constraints or dependencies mentioned -3. Read the constitution at `/.specify/memory/constitution.md` to understand constitutional requirements. +3. Read the constitution at `/memory/constitution.md` to understand constitutional requirements. 4. Execute the implementation plan template: - - Load `/.specify/templates/plan-template.md` (already copied to IMPL_PLAN path) + - Load `/templates/plan-template.md` (already copied to IMPL_PLAN path) - Set Input path to FEATURE_SPEC - Run the Execution Flow (main) function steps 1-9 - The template is self-contained and executable diff --git a/templates/commands/specify.md b/templates/commands/specify.md index 7662360e5..5fbd76e71 100644 --- a/templates/commands/specify.md +++ b/templates/commands/specify.md @@ -1,15 +1,15 @@ --- description: Create or update the feature specification from a natural language feature description. scripts: - sh: .specify/scripts/bash/create-new-feature.sh --json "{ARGS}" - ps: .specify/scripts/powershell/create-new-feature.ps1 -Json "{ARGS}" + sh: scripts/bash/create-new-feature.sh --json "{ARGS}" + ps: scripts/powershell/create-new-feature.ps1 -Json "{ARGS}" --- Given the feature description provided as an argument, do this: 1. Run the script `{SCRIPT}` from repo root and parse its JSON output for BRANCH_NAME and SPEC_FILE. All file paths must be absolute. **IMPORTANT** You must only ever run this script once. The JSON is provided in the terminal as output - always refer to it to get the actual content you're looking for. -2. Load `.specify/templates/spec-template.md` to understand required sections. +2. Load `templates/spec-template.md` to understand required sections. 3. Write the specification to SPEC_FILE using the template structure, replacing placeholders with concrete details derived from the feature description (arguments) while preserving section order and headings. 4. Report completion with branch name, spec file path, and readiness for the next phase. diff --git a/templates/commands/tasks.md b/templates/commands/tasks.md index 6f9664900..29b4cd25e 100644 --- a/templates/commands/tasks.md +++ b/templates/commands/tasks.md @@ -1,8 +1,8 @@ --- description: Generate an actionable, dependency-ordered tasks.md for the feature based on available design artifacts. scripts: - sh: .specify/scripts/bash/check-task-prerequisites.sh --json - ps: .specify/scripts/powershell/check-task-prerequisites.ps1 -Json + sh: scripts/bash/check-task-prerequisites.sh --json + ps: scripts/powershell/check-task-prerequisites.ps1 -Json --- Given the context provided as an argument, do this: @@ -21,7 +21,7 @@ Given the context provided as an argument, do this: - Generate tasks based on what's available 3. Generate tasks following the template: - - Use `/.specify/templates/tasks-template.md` as the base + - Use `/templates/tasks-template.md` as the base - Replace example tasks with actual tasks based on: * **Setup tasks**: Project init, dependencies, linting * **Test tasks [P]**: One per contract, one per integration scenario diff --git a/templates/plan-template.md b/templates/plan-template.md index 1f7ff066d..fc6dc35b5 100644 --- a/templates/plan-template.md +++ b/templates/plan-template.md @@ -214,4 +214,4 @@ ios/ or android/ - [ ] Complexity deviations documented --- -*Based on Constitution v2.1.1 - See `.specify/memory/constitution.md`* \ No newline at end of file +*Based on Constitution v2.1.1 - See `/memory/constitution.md`* \ No newline at end of file From b36016cda3d4bad1589af5b540fae3ae52ed9f1e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ahmet=20=C3=87etinkaya?= Date: Fri, 19 Sep 2025 21:24:42 +0300 Subject: [PATCH 4/4] fix: update constitution path to .specify location --- templates/plan-template.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/templates/plan-template.md b/templates/plan-template.md index fc6dc35b5..1f7ff066d 100644 --- a/templates/plan-template.md +++ b/templates/plan-template.md @@ -214,4 +214,4 @@ ios/ or android/ - [ ] Complexity deviations documented --- -*Based on Constitution v2.1.1 - See `/memory/constitution.md`* \ No newline at end of file +*Based on Constitution v2.1.1 - See `.specify/memory/constitution.md`* \ No newline at end of file