Generate infrastructure setup workflow (foundation, planning docs, database) from tech stack
Generates infrastructure setup workflow with foundation, planning, and database phases from your tech stack.
/plugin marketplace add vanman2024/dev-lifecycle-marketplace/plugin install foundation@dev-lifecycle-marketplace<tech-stack-name> [--full|--summary|--phase <name>]šØ EXECUTION NOTICE FOR CLAUDE
When you invoke this command via SlashCommand, the system returns THESE INSTRUCTIONS below.
YOU are the executor. This is NOT an autonomous subprocess.
Immediately after SlashCommand returns, start executing Phase 0, then Phase 1, etc.
See @CLAUDE.md section "SlashCommand Execution - YOU Are The Executor" for detailed explanation.
Arguments: $ARGUMENTS (optional - auto-detects if not provided)
Goal: Generate INFRASTRUCTURE setup workflow for project initialization. This covers foundation, planning documentation, and database setup ONLY.
Scope Clarification:
This command (/foundation:generate-workflow): Infrastructure setup (one-time)
For feature implementation: Use /planning:generate-feature-workflow instead
Flags:
--full: Include all 6 phases (Foundation ā Implementation ā Quality ā Testing ā Deployment ā Iteration)--summary: Phases only, no command details (~50 lines)--phase <name>: Generate specific phase only (Foundation|Planning|Database|Implementation|Quality|Testing|Deployment)Phase 1: Load Knowledge Goal: Load workflow generation patterns and phasing knowledge
Actions:
Phase 2: Detect or Select Tech Stack Goal: Determine which tech stack this project uses
Actions:
If $ARGUMENTS provided:
If NO $ARGUMENTS (auto-detect mode):
Scan current directory for tech indicators: !{bash test -f package.json && grep -q "next" package.json && echo "nextjs:detected" || true} !{bash test -f requirements.txt && grep -q "fastapi" requirements.txt && echo "fastapi:detected" || true} !{bash test -d supabase && echo "supabase:detected" || true} !{bash grep -r "vercel.*ai" package.json 2>/dev/null && echo "vercel-ai-sdk:detected" || true}
Query ALL tech stacks from Airtable: !{Use mcp__airtable to list all records from Tech Stacks table tblG07GusbRMJ9h1I}
Match detected frameworks to tech stack components
Select best match (highest score)
Display: "Auto-detected: [Stack Name] (X% match based on your files)"
Ask user to confirm or choose different stack
Store selected tech stack name as STACK_NAME
Phase 2.5: Parse Flags and Determine Scope Goal: Parse command flags to determine what to include in workflow
Actions:
Parse $ARGUMENTS for flags:
--full flag: FULL_MODE=true/false--summary flag: SUMMARY_MODE=true/false--phase <name> flag: PHASE_FILTER="<name>"/nullDetermine workflow scope:
--full: INCLUDE_PHASES=["Foundation", "Planning", "Database", "Implementation", "Quality", "Testing", "Deployment", "Iteration"]--phase <name>: INCLUDE_PHASES=[<name>]--summary: INCLUDE_PHASES=All, SUMMARY_MODE=trueStore flags:
Display: "Scope: {Infrastructure only|Full workflow|Summary|Phase: <name>}"
Phase 3: Get Raw Data from Airtable Goal: Query Airtable and validate commands
Actions:
Display: "Querying Airtable for commands..."
Run Python script: !{bash python3 ~/.claude/plugins/marketplaces/dev-lifecycle-marketplace/plugins/foundation/skills/workflow-generation/scripts/generate-workflow-doc.py "$STACK_NAME"}
Parse JSON output
Store in memory:
If validation warnings exist:
Display: "ā Retrieved data for {N} plugins with {M} total commands"
Phase 4: Read Project Context (Intelligence) Goal: Understand current project state and architecture
Actions:
Display: "Reading project context..."
MUST READ: .claude/project.json !{Read .claude/project.json}
IF EXISTS: docs/architecture/ !{bash ls docs/architecture/*.md 2>/dev/null || echo "No architecture docs found"}
IF EXISTS: docs/adr/ !{bash ls docs/adr/*.md 2>/dev/null || echo "No ADRs found"}
IF EXISTS: features.json (PRIORITY - read this first!) !{bash test -f features.json && echo "features.json:exists" || echo "features.json:missing"}
IF EXISTS: specs/ !{bash ls specs/*/spec.md 2>/dev/null || echo "No specs found"}
Detect current state (file existence): !{bash test -f package.json && echo "package.json:exists" || echo "package.json:missing"} !{bash test -f requirements.txt && echo "requirements.txt:exists" || echo "requirements.txt:missing"} !{bash test -d supabase && echo "supabase:exists" || echo "supabase:missing"} !{bash test -d specs && echo "specs:exists" || echo "specs:missing"} !{bash test -d docs/architecture && echo "architecture:exists" || echo "architecture:missing"} !{bash test -f docs/ROADMAP.md && echo "roadmap:exists" || echo "roadmap:missing"} !{bash test -f .env && echo "env:exists" || echo "env:missing"}
Display: "ā Project context loaded"
Phase 4.5: Preserve Existing Progress (CRITICAL) Goal: Read existing workflow file and preserve manual checkmarks
Actions:
Determine expected workflow filename:
Check if workflow file exists: !{bash test -f "$WORKFLOW_FILE" && echo "exists" || echo "missing"}
If exists (REGENERATION mode):
Display: "š Reading existing workflow to preserve progress..."
Read existing workflow file: @{WORKFLOW_FILE}
Parse for command checkmarks:
- [ā
/š/ā”] /plugin:commandParse for feature checkmarks (if Feature Status section exists):
- [ā
/š/ā”] F001: Feature NameDisplay: "ā Preserved {N} command statuses and {M} feature statuses"
If missing (FIRST-TIME mode):
Phase 5: Organize Commands (Claude's Intelligence) Goal: Apply skill knowledge to organize commands into phases
Actions:
Using workflow-generation skill patterns:
Categorize each command into phases:
Apply INCLUDE_PHASES filter (from Phase 2.5):
Determine completion status for each command (PRESERVES EXISTING):
Apply dependency rules:
Include project context:
Display: "ā Commands organized into {N} phases"
Phase 6: Generate Workflow Document Goal: Create final project-aware workflow markdown
Actions:
Determine output filename:
Determine workflow title based on scope:
Generate workflow with sections:
1. Project Overview (skip if SUMMARY_MODE):
# {Project Name} - {Workflow Title}
**Auto-generated**: {Date}
**Tech Stack**: {From project.json}
**Scope**: {Infrastructure only|Full workflow|{Phase name}|Summary}
**Project Phase**: {From project state detection}
---
## Tech Stack Overview
{From project.json and Airtable}
## Architecture Overview
{From docs/architecture/ and ADRs}
## Progress Legend
- ā
= Completed (auto-detected from your files)
- ā” = Not started / To do
- š = In progress (partial implementation detected)
## Workflow Separation
- This workflow: Infrastructure setup (one-time)
- For features: Use /planning:generate-feature-workflow
2. Phased Commands (Respecting INCLUDE_PHASES):
If SUMMARY_MODE: Only show phase headers with command counts:
## Phase 1: Foundation & Project Setup (N commands)
## Phase 2: Planning & Architecture (M commands)
## Phase 3: Database & Auth (K commands)
If NOT SUMMARY_MODE: Include full command details
## Phase 1: Foundation & Project Setup
{Foundation commands IF "Foundation" in INCLUDE_PHASES}
## Phase 2: Planning & Architecture
{Planning commands IF "Planning" in INCLUDE_PHASES}
## Phase 3: Database & Auth
{Database commands IF "Database" in INCLUDE_PHASES}
## Phase 4: Implementation
{Implementation commands IF "Implementation" in INCLUDE_PHASES}
## Phase 5: Quality
{Quality commands IF "Quality" in INCLUDE_PHASES}
## Phase 6: Testing
{Testing commands IF "Testing" in INCLUDE_PHASES}
## Phase 7: Deployment
{Deployment commands IF "Deployment" in INCLUDE_PHASES}
## Phase 8: Iteration & Enhancement
{Iteration commands IF "Iteration" in INCLUDE_PHASES}
2.5. Feature Status (NEW - if features.json exists):
## Feature Implementation Status
{Read features.json if it exists}
{For each feature, determine status:}
- **FIRST**: Check PRESERVED_FEATURES["F{id}"] (from Phase 4.5)
* If exists: Use preserved status emoji
- **SECOND**: If NOT preserved: Use status from features.json
- **THIRD**: If no features.json: Auto-detect from file existence
{Display:}
- {status emoji} F{id}: {name} ({priority})
- Status: {from PRESERVED_FEATURES or features.json}
- Completion: {auto-detect from file existence}
Example:
- ā
F001: Google File Search RAG (P0)
- Status: completed
- Files: backend/services/file_search.py ā
- š F002: Claude Agent SDK (P0)
- Status: in-progress
- Files: backend/claude_agent/ (partial)
- ā” F003: Intelligent Routing (P1)
- Status: not-started
3. Project-Specific Context:
## Current Project Status Summary
{What's done, what's in progress, what's next}
## Key Architecture Decisions
{Relevant ADR summaries}
## Business Metrics
{If found in docs}
4. Footer:
---
**Regenerate this workflow:**
```bash
/foundation:generate-workflow "{STACK_NAME}"
Write to: {OUTPUT_FILE}
Phase 7: Summary Goal: Report results to user
Actions:
Error Handling: