arch-flow
Arch-Flow Skill
Purpose: Top-level orchestrator for the planning pipeline. Runs Sketch → Spec → Plan → ADR in sequence, pausing at each stage gate for user confirmation. Detects existing docs/ artifacts and resumes from the right stage automatically.
Input
$ARGUMENTS
Can be:
- A plain-text feature idea → start from Stage 1 (Sketch)
docs/sketches/<file>.md→ start from Stage 2 (Spec)docs/specs/<file>.md→ start from Stage 3 (Plan)docs/plans/<file>.md→ start from Stage 4 (ADR)- A topic keyword (no path) → auto-detect stage (see below)
- Empty → ask via AskUserQuestion: "What feature or topic would you like to plan?"
Auto-Detection (Resume Protocol)
When given a topic string (not a file path), search for existing artifacts in this order:
ls docs/plans/ 2>/dev/null | grep -i "<topic>" # → Stage 4
ls docs/specs/ 2>/dev/null | grep -i "<topic>" # → Stage 3
ls docs/sketches/ 2>/dev/null | grep -i "<topic>" # → Stage 2
If an existing artifact is found, present via AskUserQuestion:
"Found existing [plan/spec/sketch] at [path]. Resume from Stage N ([stage name])? Or start fresh from Stage 1?"
Pipeline
Each stage ends with a gate — do not proceed to the next stage without explicit user confirmation.
Display a progress banner at each gate:
Pipeline: [✓ Sketch] → [✓ Spec] → [→ Plan] → [ ADR]
Stage 1: Sketch (light-plan)
Goal: Capture a freeform brainstorm/design through dialogue.
Follow the light-plan skill workflow:
- Check current project state (files, docs, recent commits)
- Ask questions one at a time (multiple choice preferred) to refine the idea
- Propose 2-3 approaches with trade-offs; lead with your recommendation
- Present the design in sections of 200-300 words, validate each section
- Write final sketch to
docs/sketches/YYYY-MM-DD-<topic>.mdwith frontmatter:--- stage: sketch created: YYYY-MM-DD topic: <topic> status: draft ---
Gate: "Sketch complete at docs/sketches/<file>. Proceed to spec generation? (Y / edit / stop)"
Stage 2: Spec (turn2spec)
Goal: Transform the sketch into a formal, implementation-agnostic feature specification.
Follow the turn2spec skill workflow:
- Load
docs/sketches/<file>.mdas source material - Extract: Feature Name, Actors, Core Actions, Constraints, Success Signals, Decisions Made, Open Questions, Data Entities
- Map extracted content to the spec template (
plugins/Vengineer/skills/reference/spec_template.md) - Write spec to
docs/specs/<feature-name>.mdwith frontmatter:--- stage: spec created: YYYY-MM-DD feature: <feature-name> source-sketch: docs/sketches/<file>.md status: draft --- - Update sketch frontmatter: add
next-spec: docs/specs/<feature-name>.md - Handle up to 3
[NEEDS CLARIFICATION]markers via AskUserQuestion (one at a time) - Validate: no implementation details, all acceptance scenarios in Given/When/Then format
Gate: "Spec complete at docs/specs/<feature-name>.md. Proceed to implementation plan? (Y / review / stop)"
Stage 3: Plan (medium-plan + optional deepen-plan)
Goal: Produce a structured implementation plan with parallelization strategy.
Follow the medium-plan skill workflow:
- Run these three agents in parallel:
- Task repo-research-analyst(feature from spec)
- Task best-practices-researcher(feature from spec)
- Task framework-docs-researcher(feature from spec)
- Run: Task spec-flow-analyzer(spec content, research findings)
- Build the plan following the spec's requirements and research findings
- Include an Execution Strategy section with:
- Mermaid
graph LRdependency diagram (green fill = can start immediately) - Phase table: Phase | Name | Depends On | Can Parallelize With | Effort
- Inline task tags:
[PARALLEL:group-id]or[SERIAL:after-group-id]
- Mermaid
- Write plan to
docs/plans/<feature-name>.mdwith frontmatter:--- stage: plan created: YYYY-MM-DD feature: <feature-name> source-spec: docs/specs/<feature-name>.md status: draft --- - Update spec frontmatter: add
next-plan: docs/plans/<feature-name>.md
Then ask: "Run deepen-plan for maximum research depth? (Y / skip)"
- If Y: follow the
deepen-planworkflow ondocs/plans/<feature-name>.md— launch 12 parallel research agents across architecture, performance, security, testing, integration dimensions; integrate findings
Gate: "Plan complete at docs/plans/<feature-name>.md. Proceed to ADR generation? (Y / review / stop)"
Stage 4: ADR (adr)
Goal: Crystallize the key architectural decisions into permanent records.
Follow the adr skill workflow on docs/plans/<feature-name>.md:
- Scan plan for architectural decision candidates
- Present candidate list via AskUserQuestion — user selects which to record
- For each selected decision: determine next NNNN, write
docs/adr/NNNN-<title>.md, updatedocs/adr/README.md - Update plan frontmatter: add
adr-refs:list
Gate: "ADR(s) written. Create GitHub issues from the plan? (Y / skip / done)"
Stage 5: Issues (batch-issues, optional)
Goal: Decompose the plan into actionable GitHub issues.
Follow the batch-issues skill workflow on docs/plans/<feature-name>.md.
Pipeline Summary (displayed at end)
## Pipeline Complete
| Stage | Artifact | Path |
|--------|------------------|-------------------------------|
| Sketch | Brainstorm/design | docs/sketches/YYYY-MM-DD-... |
| Spec | Feature spec | docs/specs/<feature-name>.md |
| Plan | Impl plan | docs/plans/<feature-name>.md |
| ADR | Decision record(s)| docs/adr/NNNN-*.md |
Key Principles
- Gate at every stage — never auto-advance without user confirmation
- Resume, don't restart — detect existing artifacts and offer to continue from the right point
- Pipeline stages are inline — run each stage's workflow directly in this conversation (not as Task subagents), preserving context across stage transitions
- Stop is always valid — the user can stop at any gate; all artifacts written so far are valid standalone documents