xiaohongshu
xiaohongshu
adw-bootstrap
Bootstrap AI Developer Workflows (ADWs) infrastructure in any codebase. Use when user wants to: "set up ADWs", "bootstrap agentic workflows", "add AI developer workflows", "enable programmatic agent execution", "initialize ADW infrastructure", or "set up programmatic Claude Code". This enables p...
Full skill instructions
Bootstrap AI Developer Workflows (ADWs) infrastructure that enables programmatic agent orchestration in any codebase. Transform a regular project into one where AI agents can be invoked programmatically to plan, implement, test, and deploy features.
After setup, developers can:
./adws/adw_prompt.py "implement feature X"./adws/adw_slash_command.py /chore "task"agents/{id}/ for debuggingYou are NOT executing a rigid template substitution.
You will:
Use your reasoning. Handle novel structures, mixed languages, and edge cases that no template could anticipate.
ADWs create a two-layer architecture:
adws/, .claude/, specs/) - Templates engineering patterns, teaches agents how to operateapps/, src/, etc.) - The actual application code that agents operate onThe agentic layer wraps the application layer, providing a programmatic interface for AI-driven development.
Setup happens in phases based on project needs:
BEFORE starting fresh setup, ALWAYS check if ADWs already exist in this project.
Check for existence of:
# Primary indicator
adws/adw_modules/agent.py
# If exists, this is an ADW project - proceed to classification
If adws/ directory exists, DO NOT run fresh setup. Instead, classify and offer upgrade.
Use file presence to determine current phase:
Minimal Phase Indicators:
adws/adw_modules/agent.py (core module)adws/adw_prompt.py (basic CLI).claude/commands/chore.md (basic templates).claude/commands/implement.mdadws/adw_modules/agent_sdk.pyadws/adw_modules/state.pyEnhanced Phase Indicators:
adws/adw_modules/agent_sdk.py (SDK support)adws/adw_sdk_prompt.py (SDK CLI)adws/adw_slash_command.py (command executor)adws/adw_chore_implement.py (compound workflows)adws/adw_plan_tdd.py (TDD planning for large tasks).claude/commands/feature.md (richer templates).claude/commands/plan-tdd.md (TDD task breakdown).claude/commands/prime.mdadws/adw_modules/state.pyadws/adw_modules/worktree_ops.pyScaled Phase Indicators:
adws/adw_modules/state.py (state management)adws/adw_modules/git_ops.py (git operations)adws/adw_modules/worktree_ops.py (worktree isolation)adws/adw_modules/workflow_ops.py (workflow composition)adws/adw_modules/github.py (GitHub integration)adws/adw_sdlc_iso.py (multi-phase workflows).claude/commands/classify_issue.md (advanced templates).claude/commands/install_worktree.mdWhen existing ADW setup is detected:
🔍 Existing ADW setup detected!
Current Phase: <Minimal|Enhanced|Scaled>
Found infrastructure:
- Core modules: agent.py <and others...>
- CLI scripts: adw_prompt.py <and others...>
- Slash commands: <count> commands
- Workflows: <count> workflows
Available upgrades:
- <Next phase name>: <Brief description of what it adds>
Would you like to:
1. Upgrade to <next phase>
2. Keep current setup (no changes)
3. Add specific features
When user confirms upgrade:
Create timestamped backup:
mkdir -p .adw_backups
cp -r adws .adw_backups/adws_$(date +%Y%m%d_%H%M%S)
cp -r .claude .adw_backups/.claude_$(date +%Y%m%d_%H%M%S)
Inform user: "✅ Created backup in .adw_backups/"
Based on target phase, read appropriate references:
For Minimal → Enhanced upgrade:
For Enhanced → Scaled upgrade:
Before adding files, check if target paths exist:
# Pseudocode for detection logic
for file_to_add in new_files:
if file_exists(file_to_add):
# Compare with reference
if file_is_customized(file_to_add):
# Skip or ask user
print(f"⚠️ {file_to_add} appears customized - preserving")
else:
# Can safely update
print(f"📝 Updating {file_to_add}")
Never overwrite:
custom_ directory<file>.new insteadFor Enhanced upgrade, add:
adws/adw_modules/agent_sdk.py (if not exists)adws/adw_sdk_prompt.py (if not exists)adws/adw_slash_command.py (if not exists)adws/adw_chore_implement.py (if not exists)adws/adw_plan_tdd.py (if not exists).claude/commands/feature.md (if not exists).claude/commands/plan-tdd.md (if not exists).claude/commands/prime.md (if not exists)specs/plans/ directory (if not exists)For Scaled upgrade, add:
adws/adw_modules/state.py (if not exists)adws/adw_modules/git_ops.py (if not exists)adws/adw_modules/worktree_ops.py (if not exists)adws/adw_modules/workflow_ops.py (if not exists)adws/adw_modules/github.py (if not exists)adws/adw_modules/data_types.py (if not exists or needs extension)adws/adw_modules/utils.py (if not exists)adws/adw_sdlc_iso.py (if not exists)adws/adw_plan_build_test_review_iso.py (if not exists)adws/adw_ship_iso.py (if not exists).claude/commands/classify_issue.md (if not exists).claude/commands/classify_adw.md (if not exists).claude/commands/generate_branch_name.md (if not exists).claude/commands/patch.md (if not exists).claude/commands/install_worktree.md (if not exists).claude/commands/cleanup_worktrees.md (if not exists).claude/commands/test.md (if not exists).claude/commands/review.md (if not exists).claude/commands/document.md (if not exists).claude/commands/pull_request.md (if not exists).claude/commands/bug.md (if not exists)trees/ directory (create if not exists, add to .gitignore)For Enhanced upgrade:
For Scaled upgrade:
Add new sections to CLAUDE.md (if it exists):
Create/update README sections showing new usage patterns.
Run validation checks:
# Check all scripts are executable
# Verify imports resolve
# Test a simple prompt
./adws/adw_prompt.py "test upgrade" --model haiku
If validation passes: ✅ If validation fails: Show error and offer to rollback
🎉 Upgrade to <phase> completed successfully!
Added:
- <count> new modules
- <count> new workflows
- <count> new slash commands
Your customizations were preserved:
- <list any files that were skipped>
Backup location: .adw_backups/<timestamp>
Try the new capabilities:
- <example 1>
- <example 2>
- <example 3>
To rollback: cp -r .adw_backups/<timestamp>/* ./
Minimal → Scaled (skip Enhanced): If user wants to jump directly to Scaled, add both Enhanced and Scaled capabilities in one upgrade.
Customized setups:
If setup has significant customizations, offer to create new files with .new extension and let user merge manually.
Failed upgrades: If any step fails, automatically rollback to backup and report error.
Before creating anything, deeply understand the target project.
Use Glob to explore:
# Find configuration files
**/{package.json,pyproject.toml,go.mod,Cargo.toml,pom.xml}
# Find source code locations
**/src/**
**/app/**
**/lib/**
# Find existing tooling
**/{Dockerfile,docker-compose.yml,.github,Makefile}
Primary language(s):
Application layer location:
src/, app/, apps/, lib/, pkg/, root?Package manager in use:
Framework/runtime:
Existing development patterns:
Project maturity:
Based on analysis, recommend:
Minimal if:
Enhanced if:
Scaled if:
Ask the user which phase to install if unclear.
Before creating anything, read and understand the reference code.
Read @reference/minimal/adws/adw_modules/agent.py
This is the core pattern. Understand:
Key abstractions:
AgentPromptRequest - Configuration for prompt executionAgentPromptResponse - Results with success/failure/retry infoprompt_claude_code() - Core execution functionprompt_claude_code_with_retry() - Execution with automatic retryRetryCode enum - Different error types for retry decisionsRead @reference/minimal/adws/adw_prompt.py
This shows how to wrap agent.py for CLI use. Understand:
# /// script)agents/{adw_id}/{agent_name}/)Read @reference/minimal/commands/chore.md
This shows how to structure slash command templates. Understand:
Read @reference/minimal/commands/implement.md
Simple implementation template showing minimal structure.
Read @reference/minimal/env.sample
Shows configuration for both usage modes:
Read @reference/enhanced/adws/adw_modules/agent_sdk.py
This shows the SDK-based approach. Understand:
Read @reference/enhanced/adws/adw_slash_command.py
Shows how to execute slash commands programmatically.
Read @reference/enhanced/adws/adw_chore_implement.py
Shows compound workflow orchestration:
Read @reference/enhanced/adws/adw_plan_tdd.py
Shows TDD planning workflow for breaking large tasks into agent-sized chunks:
specs/plans/plan-{id}.mdKey Insight: Complexity measures context switching cost and iteration depth:
Read @reference/enhanced/commands/plan-tdd.md
Template for breaking down large specifications with:
Read @reference/enhanced/commands/feature.md
More comprehensive planning template with:
Read @reference/enhanced/commands/prime.md
Context loading pattern for priming Claude with project knowledge.
Now create the ADW infrastructure, adapted to the target project.
mkdir -p adws/adw_modules
mkdir -p .claude/commands
mkdir -p specs
mkdir -p agents # For output observability
If the project already has any of these, note and work with existing structure.
Do NOT just copy the reference. Adapt it:
Understand the core patterns from the reference, then create a version that:
Key adaptations:
project_root calculationget_safe_subprocess_env()Essential components to preserve:
AgentPromptRequest and AgentPromptResponse data modelsprompt_claude_code() core functionprompt_claude_code_with_retry() with retry logicAdapt the reference to this project:
Dependencies:
poetry runPaths:
Style:
Make it executable:
chmod +x adws/adw_prompt.py
Adapt the reference template:
Codebase Structure section:
Plan Format:
Validation Commands:
Example adaptation:
# Before (generic):
- `uv run python -m py_compile apps/*.py`
# After (adapted to Next.js project):
- `npm run type-check` - Verify TypeScript types
- `npm run lint` - Run ESLint
- `npm run build` - Ensure build succeeds
Simple implementation template - minimal changes needed, maybe adapt the validation reporting to match their tooling.
Adapt to show both usage modes:
# Mode A: Claude Max Subscription (default - recommended for interactive use)
# No configuration needed if you have Claude Max subscription
# Claude Code will authenticate through your subscription
# Mode B: API-Based Programmatic Execution (for automation, CI/CD, webhooks)
# Required for headless/automated workflows
# ANTHROPIC_API_KEY=sk-ant-...
# Optional: Claude Code Path (auto-detected if not set)
# CLAUDE_CODE_PATH=claude
# Optional: Maintain working directory
# CLAUDE_BASH_MAINTAIN_PROJECT_WORKING_DIR=true
Note: The agent module includes smart Claude CLI detection via find_claude_cli():
CLAUDE_CODE_PATH environment variablewhich claude commandIf CLAUDE.md exists, add ADW section. If not, create it with:
Essential Commands section:
## AI Developer Workflows (ADWs)
Execute Claude Code prompts programmatically:
```bash
# Direct prompt execution
./adws/adw_prompt.py "your prompt here"
./adws/adw_prompt.py "analyze this module" --model opus
# Run slash commands (after enhanced setup)
./adws/adw_slash_command.py /chore <id> "add feature X"
./adws/adw_slash_command.py /implement specs/chore-*.md
**Architecture section**:
Explain the two-layer model, observability in `agents/` directory, etc.
Use examples from THIS project structure.
### PHASE 4: Validate Minimal Setup
Before moving forward, validate everything works.
#### 4.1 Check Prerequisites
```bash
# Verify Claude Code installed
claude --version
# Check if it's available (should show help)
claude --help
If not installed, guide user to install:
# Try a simple prompt
./adws/adw_prompt.py "What is 2 + 2?"
Expected:
agents/{id}/oneoff/If subscription mode, should work with no API key. If API mode, requires ANTHROPIC_API_KEY.
Check that agents/{adw_id}/oneoff/ contains:
cc_raw_output.jsonl - Raw streaming outputcc_raw_output.json - Parsed JSON arraycc_final_object.json - Final result objectcustom_summary_output.json - High-level summaryShow:
Only proceed if user wants enhanced setup or you recommended it.
Adapt the SDK reference:
Dependencies:
claude-code-sdk Python packageAdaptation:
When to use SDK approach:
When to use subprocess approach:
Adapt for this project:
This orchestrates: planning (/chore) → implementation (/implement)
Adapt:
Create .claude/commands/feature.md:
Create .claude/commands/prime.md:
Create .claude/commands/start.md (if applicable):
Add to CLAUDE.md:
Enhanced Commands:
### Compound Workflows
# Plan and implement in one command
./adws/adw_chore_implement.py "add error handling to API"
# Feature development
./adws/adw_slash_command.py /feature <id> "user authentication"
# Prime Claude with context
./adws/adw_slash_command.py /prime
### TDD Planning for Large Tasks
# Break down large spec into agent-sized tasks
./adws/adw_plan_tdd.py "Add user authentication with JWT and OAuth2"
# From a spec file
./adws/adw_plan_tdd.py specs/feature-auth.md --spec-file
# Use Opus for complex architecture planning
./adws/adw_plan_tdd.py "Build real-time collaboration system" --model opus
# Output: specs/plans/plan-{id}.md with:
# - 25 tasks broken down (agent-optimized sizing)
# - Dependency graph and phases
# - TDD guidance for each task
# - Agent-centric complexity metrics
Architecture Deep Dive:
# Test slash command execution
./adws/adw_slash_command.py /prime
# Test compound workflow
./adws/adw_chore_implement.py "add a hello world endpoint"
Check outputs, verify everything works.
Only for production/enterprise needs.
This adds:
Note: This is advanced. Most projects won't need it initially.
Guide through adding:
adws/adw_modules/state.py - Workflow state trackingadws/adw_modules/workflow_ops.py - Orchestration helpersadws/adw_triggers/ - Event-driven invocationadws/adw_tests/ - Testing suitetrees/ - Git worktree isolation.claude/hooks/ - Event handlers.claude/settings.json - Hook configurationPackage manager detection:
# /// script headers with inline depspoetry add and poetry runStyle matching:
Validation commands:
Consider TypeScript version of ADWs:
Package manager:
Validation commands:
npm run test or their test commandnpm run type-check or equivalentnpm run lint or equivalentnpm run build to ensure buildsStructure awareness:
packages/ or apps/?Adapt paths:
Flexibility:
How it works:
claude -p "prompt" and it just worksSetup:
.env file neededLimitations:
How it works:
Setup:
# Create .env file
echo "ANTHROPIC_API_KEY=sk-ant-..." > .env
# Or set in environment
export ANTHROPIC_API_KEY=sk-ant-...
Use cases:
In agent.py, the environment handling already supports both:
def get_safe_subprocess_env():
env = {...}
# Only add API key if it exists
api_key = os.getenv("ANTHROPIC_API_KEY")
if api_key:
env["ANTHROPIC_API_KEY"] = api_key
# Claude Code will use subscription if no key provided
return env
Guide users:
After setup, tell the user:
AI Developer Workflows infrastructure is set up!
Created:
- adws/adw_modules/agent.py - Core subprocess execution engine
- adws/adw_prompt.py - CLI wrapper for adhoc prompts
- .claude/commands/ - Slash command templates (chore, implement)
- specs/ - Directory for implementation plans
- agents/ - Observability outputs directory
- .env.sample - Configuration template
- CLAUDE.md - Updated with ADW documentation
# Execute an adhoc prompt
./adws/adw_prompt.py "analyze the database schema"
# Create a plan for a chore
./adws/adw_slash_command.py /chore $(uuidgen | cut -c1-8) "add logging"
# Implement a plan
./adws/adw_slash_command.py /implement specs/chore-abc123-*.md
# Or do both in one command (enhanced setup)
./adws/adw_chore_implement.py "add error handling"
Agent outputs saved to:
agents/{adw_id}/{agent_name}/
cc_raw_output.jsonl - Raw streaming output
cc_raw_output.json - Parsed JSON array
cc_final_object.json - Final result object
custom_summary_output.json - High-level summary
See CLAUDE.md for:
- Complete command reference
- Architecture explanation
- Examples for this project
- Extension patterns
1. Try a simple prompt:
./adws/adw_prompt.py "what does this project do?"
2. Create your first plan:
./adws/adw_slash_command.py /chore test "add a new feature"
3. Read CLAUDE.md for more examples
4. (Optional) Upgrade to enhanced setup for more features:
- SDK support for better type safety
- Compound workflows (plan + implement in one command)
- Richer slash commands (feature planning, testing)
For API-based automation (CI/CD, webhooks):
1. Create .env file: cp .env.sample .env
2. Add your API key: ANTHROPIC_API_KEY=sk-ant-...
For interactive use with Claude Max subscription:
- No configuration needed! Just use the scripts.
# Check if installed
claude --version
# If not, guide to installation
# Make scripts executable
chmod +x adws/*.py
# Check dependencies
# For uv scripts, they auto-install on first run
# For poetry projects, run: poetry install
# Verify key is set
echo $ANTHROPIC_API_KEY
# Or check .env file
cat .env
✅ Directory structure created correctly ✅ Reference code adapted to project context ✅ Scripts are executable ✅ Test prompt executes successfully ✅ Output directories created properly ✅ Documentation updated with project-specific examples ✅ User understands how to use the system ✅ User knows how to extend the system
You're not installing a template. You're teaching a codebase how to work with programmatic agents.
xiaohongshu
technical spec
product ux expert
database patterns
Conduct multi-agent task orchestration and workflow coordination.
Initialize project with Conductor artifacts (product definition,
Expert in web animations, transitions, and motion design using Framer Motion and CSS
Creates Mermaid and ASCII diagrams for flowcharts, architecture, ERDs, state machines, mindmaps, and more. Use when user mentions diagram, flowchart, mermaid, ASCII diagram, text diagram, terminal diagram, visualize, C4, mindmap, architecture diagram, sequence diagram, ERD, or needs visual docume...
PostgreSQL bindings for H3 hexagonal grid system. Use when working with H3 cells in Postgres, including spatial indexing, geometry/geography integration, and raster analysis.
Context-Driven Development skill for projects using Conductor. Use this skill when you detect a `conductor/` directory in the project, when working on tasks defined in a `plan.md` file, or when the user asks about tracks, specs, or plans. Automatically applies TDD workflow, tracks task completion...
Display project status, active tracks, and next actions
Official Stakpak application containerization standard operating procedure, a step-by-step guidline to properly dockerize applications. This is a rule book curated by the Stakpak Team.
Generate, edit, and beat-sync AI video with leading models in one workspace.
The world's fastest calendar for remote work
Transform Your Design with AI Designer by ImgCreator.ai
Revolutionizing Video Production with AI-Powered Creativity
Extend an image past the frame and let AI fill the new aspect ratio.
Discover your celebrity doppelgänger with StarByFace!
ChainClarity explains 700+ crypto whitepapers in plain English, with layered summaries, comparisons, research tools, alerts, and a $4.99 Pro plan.
Opus.ai: Revolutionize Your Web Experience