feat(new-project): add --auto flag for unattended initialization
Runs research → requirements → roadmap automatically after config questions. Requires idea document via @ reference. Auto-includes all table stakes features plus features mentioned in provided document. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
---
|
||||
name: gsd:new-project
|
||||
description: Initialize a new project with deep context gathering and PROJECT.md
|
||||
argument-hint: "[--auto]"
|
||||
allowed-tools:
|
||||
- Read
|
||||
- Bash
|
||||
@@ -8,6 +9,11 @@ allowed-tools:
|
||||
- Task
|
||||
- AskUserQuestion
|
||||
---
|
||||
<context>
|
||||
**Flags:**
|
||||
- `--auto` — Automatic mode. After config questions, runs research → requirements → roadmap without further interaction. Expects idea document via @ reference.
|
||||
</context>
|
||||
|
||||
<objective>
|
||||
Initialize a new project through unified flow: questioning → research (optional) → requirements → roadmap.
|
||||
|
||||
|
||||
@@ -6,6 +6,33 @@ Initialize a new project through unified flow: questioning, research (optional),
|
||||
Read all files referenced by the invoking prompt's execution_context before starting.
|
||||
</required_reading>
|
||||
|
||||
<auto_mode>
|
||||
## Auto Mode Detection
|
||||
|
||||
Check if `--auto` flag is present in $ARGUMENTS.
|
||||
|
||||
**If auto mode:**
|
||||
- Skip brownfield mapping offer (assume greenfield)
|
||||
- Skip deep questioning (extract context from provided document)
|
||||
- Config questions still required (Step 5)
|
||||
- After config: run Steps 6-9 automatically with smart defaults:
|
||||
- Research: Always yes
|
||||
- Requirements: Include all table stakes + features from provided document
|
||||
- Requirements approval: Auto-approve
|
||||
- Roadmap approval: Auto-approve
|
||||
|
||||
**Document requirement:**
|
||||
Auto mode requires an idea document via @ reference (e.g., `/gsd:new-project --auto @prd.md`). If no document provided, error:
|
||||
|
||||
```
|
||||
Error: --auto requires an idea document via @ reference.
|
||||
|
||||
Usage: /gsd:new-project --auto @your-idea.md
|
||||
|
||||
The document should describe what you want to build.
|
||||
```
|
||||
</auto_mode>
|
||||
|
||||
<process>
|
||||
|
||||
## 1. Setup
|
||||
@@ -27,6 +54,8 @@ git init
|
||||
|
||||
## 2. Brownfield Offer
|
||||
|
||||
**If auto mode:** Skip to Step 4 (assume greenfield, synthesize PROJECT.md from provided document).
|
||||
|
||||
**If `needs_codebase_map` is true** (from init — existing code detected but no codebase map):
|
||||
|
||||
Use AskUserQuestion:
|
||||
@@ -46,6 +75,8 @@ Exit command.
|
||||
|
||||
## 3. Deep Questioning
|
||||
|
||||
**If auto mode:** Skip. Extract project context from provided document instead and proceed to Step 4.
|
||||
|
||||
**Display stage banner:**
|
||||
|
||||
```
|
||||
@@ -100,6 +131,8 @@ Loop until "Create PROJECT.md" selected.
|
||||
|
||||
## 4. Write PROJECT.md
|
||||
|
||||
**If auto mode:** Synthesize from provided document. No "Ready?" gate was shown — proceed directly to commit.
|
||||
|
||||
Synthesize all context into `.planning/PROJECT.md` using the template from `templates/project.md`.
|
||||
|
||||
**For greenfield projects:**
|
||||
@@ -320,6 +353,8 @@ Use models from init: `researcher_model`, `synthesizer_model`, `roadmapper_model
|
||||
|
||||
## 6. Research Decision
|
||||
|
||||
**If auto mode:** Default to "Research first" without asking.
|
||||
|
||||
Use AskUserQuestion:
|
||||
- header: "Research"
|
||||
- question: "Research the domain ecosystem before defining requirements?"
|
||||
@@ -581,7 +616,16 @@ Read PROJECT.md and extract:
|
||||
|
||||
**If research exists:** Read research/FEATURES.md and extract feature categories.
|
||||
|
||||
**Present features by category:**
|
||||
**If auto mode:**
|
||||
- Auto-include all table stakes features (users expect these)
|
||||
- Include features explicitly mentioned in provided document
|
||||
- Auto-defer differentiators not mentioned in document
|
||||
- Skip per-category AskUserQuestion loops
|
||||
- Skip "Any additions?" question
|
||||
- Skip requirements approval gate
|
||||
- Generate REQUIREMENTS.md and commit directly
|
||||
|
||||
**Present features by category (interactive mode only):**
|
||||
|
||||
```
|
||||
Here are the features for [domain]:
|
||||
@@ -668,7 +712,7 @@ Reject vague requirements. Push for specificity:
|
||||
- "Handle authentication" → "User can log in with email/password and stay logged in across sessions"
|
||||
- "Support sharing" → "User can share post via link that opens in recipient's browser"
|
||||
|
||||
**Present full requirements list:**
|
||||
**Present full requirements list (interactive mode only):**
|
||||
|
||||
Show every requirement (not counts) for user confirmation:
|
||||
|
||||
@@ -791,7 +835,9 @@ Success criteria:
|
||||
---
|
||||
```
|
||||
|
||||
**CRITICAL: Ask for approval before committing:**
|
||||
**If auto mode:** Skip approval gate — auto-approve and commit directly.
|
||||
|
||||
**CRITICAL: Ask for approval before committing (interactive mode only):**
|
||||
|
||||
Use AskUserQuestion:
|
||||
- header: "Roadmap"
|
||||
@@ -824,7 +870,7 @@ Use AskUserQuestion:
|
||||
|
||||
**If "Review full file":** Display raw `cat .planning/ROADMAP.md`, then re-ask.
|
||||
|
||||
**Commit roadmap (after approval):**
|
||||
**Commit roadmap (after approval or auto mode):**
|
||||
|
||||
```bash
|
||||
node ~/.claude/get-shit-done/bin/gsd-tools.js commit "docs: create roadmap ([N] phases)" --files .planning/ROADMAP.md .planning/STATE.md .planning/REQUIREMENTS.md
|
||||
|
||||
Reference in New Issue
Block a user