Compare commits
3 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
b18ef208cb | ||
|
|
5828e58f84 | ||
|
|
dd57e9d444 |
@@ -116,11 +116,15 @@ build_variant() {
|
|||||||
plan_norm=$(tr -d '\r' < "$plan_tpl")
|
plan_norm=$(tr -d '\r' < "$plan_tpl")
|
||||||
# Extract script command from YAML frontmatter
|
# Extract script command from YAML frontmatter
|
||||||
script_command=$(printf '%s\n' "$plan_norm" | awk -v sv="$script" '/^[[:space:]]*'"$script"':[[:space:]]*/ {sub(/^[[:space:]]*'"$script"':[[:space:]]*/, ""); print; exit}')
|
script_command=$(printf '%s\n' "$plan_norm" | awk -v sv="$script" '/^[[:space:]]*'"$script"':[[:space:]]*/ {sub(/^[[:space:]]*'"$script"':[[:space:]]*/, ""); print; exit}')
|
||||||
|
|
||||||
if [[ -n $script_command ]]; then
|
if [[ -n $script_command ]]; then
|
||||||
|
# Always prefix with .specify/ for plan usage
|
||||||
|
script_command=".specify/$script_command"
|
||||||
tmp_file=$(mktemp)
|
tmp_file=$(mktemp)
|
||||||
# Replace {SCRIPT} placeholder with the script command and __AGENT__ with agent name
|
# Replace {SCRIPT} placeholder with the script command and __AGENT__ with agent name
|
||||||
sed "s|{SCRIPT}|${script_command}|g" "$plan_tpl" | tr -d '\r' | sed "s|__AGENT__|${agent}|g" > "$tmp_file" && mv "$tmp_file" "$plan_tpl"
|
substituted=$(sed "s|{SCRIPT}|${script_command}|g" "$plan_tpl" | tr -d '\r' | sed "s|__AGENT__|${agent}|g")
|
||||||
|
# Strip YAML frontmatter from plan template output (keep body only)
|
||||||
|
stripped=$(printf '%s\n' "$substituted" | awk 'BEGIN{fm=0;dash=0} /^---$/ {dash++; if(dash==1){fm=1; next} else if(dash==2){fm=0; next}} {if(!fm) print}')
|
||||||
|
printf '%s\n' "$stripped" > "$plan_tpl"
|
||||||
else
|
else
|
||||||
echo "Warning: no plan-template script command found for $script in YAML frontmatter" >&2
|
echo "Warning: no plan-template script command found for $script in YAML frontmatter" >&2
|
||||||
fi
|
fi
|
||||||
|
|||||||
@@ -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_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 "")
|
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
|
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/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";
|
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_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";
|
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";
|
||||||
|
|||||||
@@ -31,7 +31,7 @@ $newProjectType = Get-PlanValue 'Project Type'
|
|||||||
|
|
||||||
function Initialize-AgentFile($targetFile, $agentName) {
|
function Initialize-AgentFile($targetFile, $agentName) {
|
||||||
if (Test-Path $targetFile) { return }
|
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 }
|
if (-not (Test-Path $template)) { Write-Error "Template not found: $template"; return }
|
||||||
$content = Get-Content $template -Raw
|
$content = Get-Content $template -Raw
|
||||||
$content = $content.Replace('[PROJECT NAME]', (Split-Path $repoRoot -Leaf))
|
$content = $content.Replace('[PROJECT NAME]', (Split-Path $repoRoot -Leaf))
|
||||||
|
|||||||
@@ -19,7 +19,7 @@ Given the implementation details provided as an argument, do this:
|
|||||||
4. Execute the implementation plan template:
|
4. Execute the implementation plan template:
|
||||||
- Load `/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
|
- Set Input path to FEATURE_SPEC
|
||||||
- Run the Execution Flow (main) function steps 1-10
|
- Run the Execution Flow (main) function steps 1-9
|
||||||
- The template is self-contained and executable
|
- The template is self-contained and executable
|
||||||
- Follow error handling and gate checks as specified
|
- Follow error handling and gate checks as specified
|
||||||
- Let the template guide artifact generation in $SPECS_DIR:
|
- Let the template guide artifact generation in $SPECS_DIR:
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
---
|
---
|
||||||
description: "Implementation plan template for feature development"
|
description: "Implementation plan template for feature development"
|
||||||
scripts:
|
scripts:
|
||||||
sh: ".specify/scripts/bash/update-agent-context.sh __AGENT__"
|
sh: scripts/bash/update-agent-context.sh __AGENT__
|
||||||
ps: ".specify/scripts/powershell/update-agent-context.ps1 -AgentType __AGENT__"
|
ps: scripts/powershell/update-agent-context.ps1 -AgentType __AGENT__
|
||||||
---
|
---
|
||||||
|
|
||||||
# Implementation Plan: [FEATURE]
|
# Implementation Plan: [FEATURE]
|
||||||
@@ -17,18 +17,19 @@ scripts:
|
|||||||
2. Fill Technical Context (scan for NEEDS CLARIFICATION)
|
2. Fill Technical Context (scan for NEEDS CLARIFICATION)
|
||||||
→ Detect Project Type from context (web=frontend+backend, mobile=app+api)
|
→ Detect Project Type from context (web=frontend+backend, mobile=app+api)
|
||||||
→ Set Structure Decision based on project type
|
→ Set Structure Decision based on project type
|
||||||
3. Evaluate Constitution Check section below
|
3. Fill the Constitution Check section based on the content of the constitution document.
|
||||||
|
4. Evaluate Constitution Check section below
|
||||||
→ If violations exist: Document in Complexity Tracking
|
→ If violations exist: Document in Complexity Tracking
|
||||||
→ If no justification possible: ERROR "Simplify approach first"
|
→ If no justification possible: ERROR "Simplify approach first"
|
||||||
→ Update Progress Tracking: Initial Constitution Check
|
→ Update Progress Tracking: Initial Constitution Check
|
||||||
4. Execute Phase 0 → research.md
|
5. Execute Phase 0 → research.md
|
||||||
→ If NEEDS CLARIFICATION remain: ERROR "Resolve unknowns"
|
→ If NEEDS CLARIFICATION remain: ERROR "Resolve unknowns"
|
||||||
5. Execute Phase 1 → contracts, data-model.md, quickstart.md, agent-specific template file (e.g., `CLAUDE.md` for Claude Code, `.github/copilot-instructions.md` for GitHub Copilot, or `GEMINI.md` for Gemini CLI).
|
6. Execute Phase 1 → contracts, data-model.md, quickstart.md, agent-specific template file (e.g., `CLAUDE.md` for Claude Code, `.github/copilot-instructions.md` for GitHub Copilot, or `GEMINI.md` for Gemini CLI).
|
||||||
6. Re-evaluate Constitution Check section
|
7. Re-evaluate Constitution Check section
|
||||||
→ If new violations: Refactor design, return to Phase 1
|
→ If new violations: Refactor design, return to Phase 1
|
||||||
→ Update Progress Tracking: Post-Design Constitution Check
|
→ Update Progress Tracking: Post-Design Constitution Check
|
||||||
7. Plan Phase 2 → Describe task generation approach (DO NOT create tasks.md)
|
8. Plan Phase 2 → Describe task generation approach (DO NOT create tasks.md)
|
||||||
8. STOP - Ready for /tasks command
|
9. STOP - Ready for /tasks command
|
||||||
```
|
```
|
||||||
|
|
||||||
**IMPORTANT**: The /plan command STOPS at step 7. Phases 2-4 are executed by other commands:
|
**IMPORTANT**: The /plan command STOPS at step 7. Phases 2-4 are executed by other commands:
|
||||||
@@ -52,35 +53,7 @@ scripts:
|
|||||||
## Constitution Check
|
## Constitution Check
|
||||||
*GATE: Must pass before Phase 0 research. Re-check after Phase 1 design.*
|
*GATE: Must pass before Phase 0 research. Re-check after Phase 1 design.*
|
||||||
|
|
||||||
**Simplicity**:
|
[Gates determined based on constitution file]
|
||||||
- Projects: [#] (max 3 - e.g., api, cli, tests)
|
|
||||||
- Using framework directly? (no wrapper classes)
|
|
||||||
- Single data model? (no DTOs unless serialization differs)
|
|
||||||
- Avoiding patterns? (no Repository/UoW without proven need)
|
|
||||||
|
|
||||||
**Architecture**:
|
|
||||||
- EVERY feature as library? (no direct app code)
|
|
||||||
- Libraries listed: [name + purpose for each]
|
|
||||||
- CLI per library: [commands with --help/--version/--format]
|
|
||||||
- Library docs: llms.txt format planned?
|
|
||||||
|
|
||||||
**Testing (NON-NEGOTIABLE)**:
|
|
||||||
- RED-GREEN-Refactor cycle enforced? (test MUST fail first)
|
|
||||||
- Git commits show tests before implementation?
|
|
||||||
- Order: Contract→Integration→E2E→Unit strictly followed?
|
|
||||||
- Real dependencies used? (actual DBs, not mocks)
|
|
||||||
- Integration tests for: new libraries, contract changes, shared schemas?
|
|
||||||
- FORBIDDEN: Implementation before test, skipping RED phase
|
|
||||||
|
|
||||||
**Observability**:
|
|
||||||
- Structured logging included?
|
|
||||||
- Frontend logs → backend? (unified stream)
|
|
||||||
- Error context sufficient?
|
|
||||||
|
|
||||||
**Versioning**:
|
|
||||||
- Version number assigned? (MAJOR.MINOR.BUILD)
|
|
||||||
- BUILD increments on every change?
|
|
||||||
- Breaking changes handled? (parallel tests, migration plan)
|
|
||||||
|
|
||||||
## Project Structure
|
## Project Structure
|
||||||
|
|
||||||
@@ -178,7 +151,7 @@ ios/ or android/
|
|||||||
- Quickstart test = story validation steps
|
- Quickstart test = story validation steps
|
||||||
|
|
||||||
5. **Update agent file incrementally** (O(1) operation):
|
5. **Update agent file incrementally** (O(1) operation):
|
||||||
- Run {SCRIPT} for your AI assistant
|
- Run `{SCRIPT}` for your AI assistant
|
||||||
- If exists: Add only NEW tech from current plan
|
- If exists: Add only NEW tech from current plan
|
||||||
- Preserve manual additions between markers
|
- Preserve manual additions between markers
|
||||||
- Update recent changes (keep last 3)
|
- Update recent changes (keep last 3)
|
||||||
|
|||||||
Reference in New Issue
Block a user