Files
msd-core/commands/gsd/quick.md
Lex Christopherson 563bcdf765 feat(01-02): implement gsd-executor spawn for quick mode
- Add Step 6 with gsd-executor Task spawn
- Include plan reference and constraints
- Verify SUMMARY.md creation after executor returns
- Note wave execution support for multi-plan cases
2026-01-19 15:59:29 -06:00

219 lines
4.9 KiB
Markdown

---
name: gsd:quick
description: Execute a quick task with GSD guarantees (atomic commits, state tracking) but skip optional agents
argument-hint: ""
allowed-tools:
- Read
- Write
- Edit
- Glob
- Grep
- Bash
- Task
- AskUserQuestion
---
<objective>
Execute small, ad-hoc tasks with GSD guarantees (atomic commits, STATE.md tracking) while skipping optional agents (research, plan-checker, verifier).
Quick mode is the same system with a shorter path:
- Spawns gsd-planner (quick mode) + gsd-executor(s)
- Skips gsd-phase-researcher, gsd-plan-checker, gsd-verifier
- Quick tasks live in `.planning/quick/` separate from planned phases
- Updates STATE.md "Quick Tasks Completed" table (NOT ROADMAP.md)
Use when: You know exactly what to do and the task is small enough to not need research or verification.
</objective>
<execution_context>
<!-- DEFERRED TO PLAN 02: Reference to quick workflow will be populated here -->
</execution_context>
<context>
@.planning/STATE.md
</context>
<process>
**Step 1: Pre-flight validation**
Check that an active GSD project exists:
```bash
if [ ! -f .planning/ROADMAP.md ]; then
echo "Quick mode requires an active project with ROADMAP.md."
echo "Run /gsd:new-project first."
exit 1
fi
```
If validation fails, stop immediately with the error message.
Quick tasks can run mid-phase - validation only checks ROADMAP.md exists, not phase status.
---
**Step 2: Get task description**
Prompt user interactively for the task description:
```
AskUserQuestion(
header: "Quick Task",
question: "What do you want to do?",
followUp: null
)
```
Store response as `$DESCRIPTION`.
If empty, re-prompt: "Please provide a task description."
Generate slug from description:
```bash
slug=$(echo "$DESCRIPTION" | tr '[:upper:]' '[:lower:]' | sed 's/[^a-z0-9]/-/g' | sed 's/--*/-/g' | sed 's/^-//;s/-$//' | cut -c1-40)
```
---
**Step 3: Calculate next quick task number**
Ensure `.planning/quick/` directory exists and find the next sequential number:
```bash
# Ensure .planning/quick/ exists
mkdir -p .planning/quick
# Find highest existing number and increment
last=$(ls -1d .planning/quick/[0-9][0-9][0-9]-* 2>/dev/null | sort -r | head -1 | xargs -I{} basename {} | grep -oE '^[0-9]+')
if [ -z "$last" ]; then
next_num="001"
else
next_num=$(printf "%03d" $((10#$last + 1)))
fi
```
---
**Step 4: Create quick task directory**
Create the directory for this quick task:
```bash
QUICK_DIR=".planning/quick/${next_num}-${slug}"
mkdir -p "$QUICK_DIR"
```
Report to user:
```
Creating quick task ${next_num}: ${DESCRIPTION}
Directory: ${QUICK_DIR}
```
Store `$QUICK_DIR` for use in orchestration.
---
**Step 5: Spawn planner (quick mode)**
Spawn gsd-planner with quick mode context:
```
Task(
prompt="
<planning_context>
**Mode:** quick
**Directory:** ${QUICK_DIR}
**Description:** ${DESCRIPTION}
**Project State:**
@.planning/STATE.md
</planning_context>
<constraints>
- Create a SINGLE plan with 1-3 focused tasks
- Quick tasks should be atomic and self-contained
- No research phase, no checker phase
- Target ~30% context usage (simple, focused)
</constraints>
<output>
Write PLAN.md to: ${QUICK_DIR}/PLAN.md
Return: ## PLANNING COMPLETE with plan path
</output>
",
subagent_type="gsd-planner",
description="Quick plan: ${DESCRIPTION}"
)
```
After planner returns:
1. Verify PLAN.md exists at `${QUICK_DIR}/PLAN.md`
2. Extract plan count (typically 1 for quick tasks)
3. Report: "Plan created: ${QUICK_DIR}/PLAN.md"
If PLAN.md not found, error: "Planner failed to create PLAN.md"
---
**Step 6: Spawn executor**
Spawn gsd-executor with plan reference:
```
Task(
prompt="
Execute quick task ${next_num}.
Plan: @${QUICK_DIR}/PLAN.md
Project state: @.planning/STATE.md
<constraints>
- Execute all tasks in the plan
- Commit each task atomically
- Create SUMMARY.md in the quick task directory
- Do NOT update ROADMAP.md (quick tasks are separate from planned phases)
</constraints>
",
subagent_type="gsd-executor",
description="Execute: ${DESCRIPTION}"
)
```
After executor returns:
1. Verify SUMMARY.md exists at `${QUICK_DIR}/SUMMARY.md`
2. Extract commit hash from executor output
3. Report completion status
If SUMMARY.md not found, error: "Executor failed to create SUMMARY.md"
Note: For quick tasks producing multiple plans (rare), spawn executors in parallel waves per execute-phase patterns.
---
**Step 7: Update STATE.md**
<!-- DEFERRED: Add row to "Quick Tasks Completed" table -->
---
**Step 8: Commit artifacts**
<!-- DEFERRED: Stage and commit quick task artifacts -->
</process>
<success_criteria>
- [ ] ROADMAP.md validation passes
- [ ] User provides task description
- [ ] Slug generated (lowercase, hyphens, max 40 chars)
- [ ] Next number calculated (001, 002, 003...)
- [ ] Directory created at `.planning/quick/NNN-slug/`
- [ ] PLAN.md created by planner
- [ ] SUMMARY.md created by executor
- [ ] STATE.md updated with quick task row
- [ ] Artifacts committed
</success_criteria>