build
npx machina-cli add skill Pamacea/smite/build --openclawImplement Skill - Unified Agent v3.0
š“ TOOL GATEKEEPER - NON-NEGOTIABLE
āāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāā š« PROHIBITED WITHOUT EXCEPTION: grep | egrep | find | ack | ag | ls | dir | glob
ā MANDATORY REPLACEMENT: grepai search "pattern" | /toolkit search "query"
šÆ DECISION TREE: Need to search code? ā grepai search or /toolkit search (NOT grep/ls/find) Need to implement? ā /studio build [flags] "task" āāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāā
Mission
Provide ONE unified implementation entry point with:
- 12 composable flags for maximum flexibility
- Auto-detection for zero-configuration usage
- Memory integration for continuous improvement
- Progress tracking for transparent workflow
- Quality metrics for objective validation
- Legacy compatibility for smooth migration
When to Use
- Building new features: "Build user authentication system"
- Implementing functionality: "Implement payment processing"
- Creating components: "Create dashboard widget"
- Adding APIs: "Add REST API endpoint for users"
- Developing modules: "Develop data validation layer"
Examples
# Simple fix
/studio build --speed "fix login button"
# Complex feature
/studio build --scale "build authentication system"
# Quality-critical
/studio build --quality "implement payment processing"
# Large project
/studio build --team "build full-stack SaaS feature"
When NOT to Use
- ā One-off instructions (just put in CLAUDE.md)
- ā Simple tool usage (Claude already knows how to use tools)
- ā Pure research tasks (no implementation needed)
- ā Questions about code (use Read/Grep tools)
- ā Configuration only (use Edit tool directly)
- ā Documentation review (use dedicated review skills)
šÆ Flag System v3.0
Core Flags (v2.0)
| Flag | Aliases | Effect | Use When |
|---|---|---|---|
--speed | --fast, --quick | Optimized for velocity | Quick fixes, small features |
--scale | --thorough, --epct | Comprehensive workflow | Complex features, multiple files |
--quality | --validate, --predator | Quality gates enabled | Critical code, production-ready |
--team | --swarm, --ralph | Parallel agent teams | Large projects, multi-domain |
š New Flags (v3.0)
| Flag | Effect | Use When |
|---|---|---|
--clean | Delete-first philosophy | Refactoring, removing duplication |
--test | TDD mode (RED-GREEN-REFACTOR) | Test-critical features |
--debug | Bug fixing workflow | Fixing existing bugs |
--docs | Auto-documentation | API docs, guides |
--git | Git-aware mode | Working with version control |
--branch | Context-aware behavior | Branch-specific workflows |
--profile | Performance profiling | Performance optimization |
--types | TypeScript improvements | Type safety improvements |
š¤ Subagent Auto-Activation System
Studio v3.0 automatically loads specialized agents based on flags and task analysis.
Auto-Activation Rules
| Flag Detected | Subagent Auto-Loaded | Trigger Keywords | Disabled With |
|---|---|---|---|
--profile | workflow/performance-profiler | "slow", "performance", "optimize", "bottleneck", "latency" | --no-profile-agent |
--security | workflow/security-scanner | "security", "OWASP", "vulnerability", "audit", "auth", "injection" | --no-security-agent |
--types | workflow/typescript-improver | "types", "TypeScript", "strict", "any" | --no-types-agent |
--test | testing/tdd-guide (existing) | "test", "TDD", "coverage", "spec" | --no-test-agent |
--team | Creates Agent Team | "large", "multi-domain", "parallel" | --no-team |
Activation Messages
When a subagent is auto-activated, you'll see clear feedback:
[INFO] Flag --profile detected
[INFO] ā Auto-loading: workflow/performance-profiler.agent.md
[INFO] ā Capabilities: CPU profiling, Memory profiling, Benchmarking
[INFO] ā To disable: --no-profile-agent
Keyword-Based Auto-Detection
Example 1: Performance profiling triggered without explicit flag
/studio build "optimize slow database queries"
# Auto-detects:
# - Keywords: "optimize", "slow"
# ā Activates: --profile mode
# ā Loads: workflow/performance-profiler.agent.md
Example 2: Security scanning triggered by context
/studio build "add authentication to API"
# Auto-detects:
# - Keywords: "authentication"
# ā Activates: --security mode
# ā Loads: workflow/security-scanner.agent.md
Example 3: TypeScript improvements triggered
/studio build "fix type errors in user service"
# Auto-detects:
# - Keywords: "type errors", TypeScript files
# ā Activates: --types mode
# ā Loads: workflow/typescript-improver.agent.md
Hybrid: Explicit Flag + Auto-Loading
# Explicit flag (clear intent)
/studio build --profile "optimize user list"
# Process:
# 1. User explicitly sets --profile
# 2. System loads: workflow/performance-profiler.agent.md
# 3. Applies performance patterns
# 4. Reports before/after metrics
# Same as implicit (auto-detected)
/studio build "optimize slow user list"
# Process:
# 1. System detects keywords: "optimize", "slow"
# 2. Auto-activates: --profile mode
# 3. Loads: workflow/performance-profiler.agent.md
# 4. Same result with less typing!
Disabling Auto-Activation
Disable specific agent:
/studio build --profile "optimize code" --no-profile-agent
# ā Won't load workflow/performance-profiler.agent.md
# ā Uses built-in performance patterns only
Disable all agents:
/studio build --scale "build feature" --no-agents
# ā No specialized agents loaded
# ā Uses core build skill only
Agent Loading Priority
1. Explicit flag (--profile, --security, --types)
ā
2. Explicit agent (--agent=workflow/performance-profiler)
ā
3. Auto-detection (keywords in task)
ā
4. Tech-specific agent (--tech=nextjs, --tech=rust)
ā
5. Default behavior
Example: Full Auto-Activation Flow
# User command
/studio build "optimize slow authentication with proper types"
# System analysis:
āā Keywords: "optimize", "slow" ā Activates --profile
āā Keywords: "authentication" ā Activates --security
āā Keywords: "types" ā Activates --types
āā File detection: .ts files ā Activates --types
āā Tech detection: --tech (if specified)
# Agents loaded:
ā
workflow/performance-profiler.agent.md
ā
workflow/security-scanner.agent.md
ā
workflow/typescript-improver.agent.md
# Execution order:
1. Performance profiling (identify bottlenecks)
2. Security scanning (OWASP compliance)
3. TypeScript improvements (type safety)
4. Implementation with all patterns applied
# Result:
- Optimized performance (ā„20% improvement)
- OWASP Top 10 compliant
- Zero `any`, type coverage ā„95%
- Proper commit message (if --git)
- Memory saved to claude-mem
š NEW: Flag Details
--clean (Delete-First Mode)
Purpose: Implement "Delete First" philosophy - remove before adding
Philosophy:
- Best code is no code
- Delete duplication before creating new
- Simplify over abstracting
Workflow:
EXPLORE (delete-focused, 10 min)
- Search for existing implementations
- Count occurrences of similar code
- Identify what can be removed
- Find components to compose
PLAN (minimal)
- List deletions planned
- List additions after deletions
- Verify nothing breaks
CODE (delete-first, 20-30 min)
1. DELETE first:
- Remove duplicated code
- Delete unused components
- Simplify abstractions
2. THEN add:
- Implement new feature
- Compose existing components
- Use variant props
TEST (verify)
- Verify nothing broke
- Test new implementation
- Measure code reduction
Example:
# Refactor with delete-first
/studio build --clean --scale "refactor user service"
# Quick duplicate removal
/studio build --clean --speed "remove duplicate buttons"
# Validated refactor
/studio build --clean --quality "simplify auth flow"
Success Criteria:
- Net code reduction (removed > added)
- Zero duplication
- Tests passing
- No regressions
--test (TDD Mode)
Purpose: Force Test-Driven Development (RED-GREEN-REFACTOR)
Philosophy:
- Tests first, implementation second
- Specifications drive design
- Failing tests guide implementation
Workflow:
PLAN (test specs)
- Define test scenarios
- Specify acceptance criteria
- Set coverage targets
CODE - RED (5-10 min)
- Write failing tests first
- Describe behavior, not implementation
- Test edge cases
- Output: test suite (all failing)
CODE - GREEN (15-30 min)
- Implement minimum to pass tests
- No extra code
- Make tests pass one by one
- Output: tests passing
CODE - REFACTOR (if needed)
- Clean up implementation
- Keep tests green
- Extract abstractions
- Output: clean code + passing tests
TEST (coverage)
- Verify coverage ā„ 80%
- All tests passing
- No testTODOs left
- Output: coverage report
Levels:
# Basic TDD (critical tests only)
/studio build --test --speed "add user validation"
# Full TDD (complete test suite)
/studio build --test --scale "payment processing"
# Strict TDD (100% coverage required)
/studio build --test --quality "security-critical auth"
Success Criteria:
- Tests written before implementation
- All tests passing
- Coverage ā„ 80% (or ā„ 95% with --quality)
- Tests describe behavior, not implementation
--debug (Debug Mode)
Purpose: Fix existing bugs systematically
Philosophy:
- Understand before fixing
- Fix root cause, not symptoms
- Add regression tests
Workflow:
EXPLORE (error investigation, 10 min)
- Search for error message in code
- Find stack trace source
- Identify code path
- Understand context
- Output: investigation.md
ANALYZE (root cause, 10 min)
- Reproduce the bug
- Identify root cause
- Understand why it happens
- Check related code
- Output: root_cause.md
FIX (implementation, 15-30 min)
- Implement fix
- Add regression test
- Verify fix works
- Check for similar bugs
- Output: fix.md
VERIFY (validation)
- Test fix works
- Regression test passes
- No new bugs introduced
- Edge cases covered
- Output: validation.md
Levels:
# Quick fix
/studio build --debug --speed "fix TypeError in auth"
# Validated fix
/studio build --debug --quality "critical production bug"
# Fix + refactor
/studio build --debug --clean "fix and simplify"
Success Criteria:
- Root cause identified
- Fix implemented
- Regression test added
- Bug cannot recur
--docs (Documentation Mode)
Purpose: Generate documentation automatically
Philosophy:
- Code is truth, docs are reflection
- Document why, not just what
- Self-documenting code first
Workflow:
CODE (with documentation)
- Write code with JSDoc/comments
- Document complex logic
- Explain "why" not "what"
- Use self-documenting names
OUTPUT (auto-generation)
- README.md (30-second hook)
- API.md (API documentation)
- GUIDE.md (5-minute storytelling)
- REFERENCE.md (cheat sheet)
FORMAT (structured)
- Examples in README
- Type signatures in API.md
- Architecture in GUIDE.md
- Quick reference in REFERENCE.md
Levels:
# Basic docs (README only)
/studio build --docs --speed "utility function"
# Full docs (README + API)
/studio build --docs --scale "API endpoints"
# Complete docs (all formats)
/studio build --docs --quality "public library"
Output Structure:
docs/
āāā README.md # Hook, quick start, examples
āāā API.md # All public APIs with types
āāā GUIDE.md # Architecture, patterns, workflows
āāā REFERENCE.md # Quick reference card
Success Criteria:
- README < 50 lines
- Quick start < 3 commands
- API documentation complete
- Examples runnable
--git (Git-Aware Mode)
Purpose: Intelligently work with Git changes
Workflow:
EXPLORE (git context)
- git diff to see changes
- git log for recent commits
- Understand branch context
- Check staging area
PLAN (git-aware)
- Consider modified files
- Respect branch purpose
- Plan atomic commits
- Prepare commit messages
IMPLEMENT (with git)
- Work on changed files
- Stage appropriately
- Suggest commit message
- Follow Git Flow Master format
Git Flow Master Format:
TYPE: PROJECT_NAME - vX.Y.Z
- Change 1
- Change 2
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Combinations:
# Feature with git integration
/studio build --git --scale "add OAuth"
# Bug fix with proper commit
/studio build --git --debug "fix auth bug"
# Refactor with git history awareness
/studio build --git --clean "simplify service"
--branch (Context-Aware Mode)
Purpose: Behavior adapted to Git branch
Auto-Detection:
| Branch Pattern | Detected Behavior |
|---|---|
feature/* | --scale (new features) |
bugfix/* | --debug (fixes) |
refactor/* | --clean (refactoring) |
main/master | --quality (production) |
hotfix/* | --debug --quality (urgent fixes) |
docs/* | --docs (documentation) |
test/* | --test (test-focused) |
Usage:
# Auto-detect from branch
/studio build --branch "implement auth"
# Explicit override
/studio build --branch=feature/auth "add OAuth"
# Combined with flags
/studio build --branch --scale "large feature"
š§ NEW: Memory Integration
After each build, automatically save to claude-mem:
Auto-Save Triggers:
- ā New pattern discovered
- ā Architecture decision made
- ā Anti-pattern identified
- ā Convention established
- ā Bug solution found
- ā Refactoring technique applied
Memory Categories:
| Category | What to Store |
|---|---|
| Patterns | Working code patterns |
| Decisions | Tech choices + rationale |
| Anti-Patterns | What NOT to do |
| Workflows | Repeatable processes |
| Solutions | Bug fixes and their causes |
Usage:
# Search memory before implementing
"Let me check claude-mem for similar patterns first"
# Save after solving
"Saving successful pattern to claude-mem for future reference"
š NEW: Progress Indicators
Show clear progress during implementation:
[āāāāāāāāāā] 80% - Coding (3/4 files done)
ā EXPLORE (5 min) ā Found 4 relevant files
ā PLAN (3 min) ā 3-step implementation
ā CODE (15 min) ā Implementing feature...
ā TEST (pending)
Phase Breakdown:
Phase 1: EXPLORE ā± 5 min
āā Searching codebase...
āā Found 4 relevant files
āā Pattern identified: feature-module
āā ā Complete
Phase 2: PLAN ā± 3 min
āā Creating implementation strategy...
āā 3 steps identified
āā Files to modify: 4
āā ā Complete
Phase 3: CODE ā± 15 min (in progress)
āā [āāāāāāāāāā] 80%
āā File 1/4: ā auth.service.ts
āā File 2/4: ā auth.types.ts
āā File 3/4: ā auth.controller.ts
āā File 4/4: ā auth.test.ts (writing...)
Phase 4: TEST ā± pending
āā Run tests
āā Verify coverage
āā Check regressions
š NEW: Quality Metrics
Report objective quality after build:
Code Quality Report
āāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāā
Lines Added: 127
Lines Removed: 23 (delete-first!)
Net Change: +104
Files Touched: 4
Barrel Exports: ā All proper
Type Coverage: 100%
Test Coverage: 85% (target: 80%)
Complexity: Reduced by 15%
Debt: -50 lines (net improvement)
Performance: +20% faster (measured)
Memory: 2 patterns saved to claude-mem
Documentation: README.md + API.md generated
Status: ā READY FOR MERGE
āāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāā
Metrics Collected:
- Code volume (added/removed/net)
- Test coverage (%)
- Type coverage (%)
- Complexity (cyclomatic)
- Performance (when applicable)
- Technical debt (lines)
- Documentation completeness
š Flag Combinations
Power Combinations
| Command | Behavior | Use For |
|---|---|---|
/studio build --clean --scale | Delete-first thorough refactor | Major refactoring |
/studio build --test --quality | TDD with 100% coverage | Critical features |
/studio build --debug --git | Bug fix with proper commit | Production bugs |
/studio build --clean --types | TypeScript improvement | Type safety |
/studio build --test --docs --scale | TDD + docs + thorough | Libraries/APIs |
/studio build --debug --clean | Fix + refactor | Bug with cleanup |
/studio build --git --branch --scale | Full git-aware feature | Feature branches |
/studio build --profile --quality | Performance optimization | Slow code |
/studio build --speed --team | Quick parallel | Large simple tasks |
š¤ Auto-Detection (Enhanced)
When no flags are provided, the system analyzes the task and selects appropriate behavior.
Enhanced Detection Rules
| Signal | Detected Profile |
|---|---|
| < 100 chars, no "and/with" | --speed |
| Contains "feature/build/create" | --scale |
| Contains "SaaS/platform/system" | --team |
| Contains "critical/security/payment" | --quality |
| Contains "refactor/cleanup/remove" | --clean |
| Contains "test/TDD/coverage" | --test |
| Contains "fix/bug/error/debug" | --debug |
| Contains "docs/API/guide" | --docs |
| Contains "slow/performance" | --profile |
| Contains "types/TypeScript" | --types |
Examples
# Auto-detects as --speed
/studio build "fix login button"
# Auto-detects as --clean
/studio build "refactor user service, remove duplicates"
# Auto-detects as --test
/studio build "add payment feature with full test coverage"
# Auto-detects as --debug
/studio build "fix TypeError in auth controller"
# Auto-detects as --docs
/studio build "create API with documentation"
# Auto-detects as --scale --test
/studio build "build payment feature with tests"
š§ Technical Subagents
| Subagent | Tech Stack | When Used |
|---|---|---|
impl-nextjs | React 19, RSC, Prisma | --tech=nextjs |
impl-rust | Ownership, async/await | --tech=rust |
impl-python | Type hints, FastAPI | --tech=python |
impl-go | Goroutines, interfaces | --tech=go |
impl-typescript | Strict types, Zod | --types flag |
ā Success Criteria
Universal Criteria (All Flags)
- ā Correct flag(s) chosen for task
- ā Implementation follows flag behavior
- ā Tests passing (flag-appropriate level)
- ā No regressions
- ā Code quality maintained
Additional Criteria by Flag
| Flag | Additional Criteria |
|---|---|
--clean | Net code reduction, zero duplication |
--test | Tests written first, coverage ā„ 80% |
--debug | Root cause identified, regression test added |
--docs | Documentation complete and accurate |
--git | Proper commit message prepared |
--profile | Performance improved, measured |
--types | Type coverage 100%, no any |
š Best Practices
- Start with auto-detection - Let the system choose, then refine
- Compose flags naturally - Combine for custom behavior
- Use --clean before --scale - Delete first, then add
- Use --test for critical features - Invest in test coverage
- Use --debug when fixing bugs - Systematic bug fixing
- Use --docs for public APIs - Good documentation matters
- Use --git for version control - Proper commit messages
- Check memory before implementing - Reuse past solutions
- Review metrics after build - Objective quality assessment
šÆ Decision Guide (Enhanced)
Quick Decision Tree
Need to implement?
āā Simple fix / small feature? ā /studio build --speed
āā Complex / multi-file? ā /studio build --scale
āā Quality-critical / security? ā /studio build --quality
āā Large project / multi-domain? ā /studio build --team
āā Refactoring / cleanup? ā /studio build --clean
āā Test-critical feature? ā /studio build --test
āā Bug fixing? ā /studio build --debug
āā Public API / library? ā /studio build --docs
āā Performance issue? ā /studio build --profile
āā Type safety issues? ā /studio build --types
āā Working with Git? ā /studio build --git
āā Branch-specific workflow? ā /studio build --branch
āā Not sure? ā /studio build (auto-detect)
āā Need specific combination? ā Compose flags!
Combination Guide
Too slow? Add --speed
Not thorough enough? Add --scale
Quality issues? Add --quality
Too large for one agent? Add --team
Too much duplication? Add --clean
Need test coverage? Add --test
Fixing a bug? Add --debug
Need documentation? Add --docs
Using Git? Add --git
Performance issues? Add --profile
Type safety issues? Add --types
Branch-specific? Add --branch
š Legacy Compatibility
Deprecated Commands (Still Work)
| Old Command | New Equivalent |
|---|---|
/oneshot "..." | /studio build --speed "..." |
/epct "..." | /studio build --scale "..." |
/predator "..." | /studio build --quality "..." |
/ralph "..." | /studio build --scale --team "..." |
/builder --tech=nextjs "..." | /studio build --scale --tech=nextjs "..." |
/studio build --quick "..." | /studio build --speed "..." |
/studio build --epct "..." | /studio build --scale "..." |
/studio build --predator "..." | /studio build --quality "..." |
/studio build --ralph "..." | /studio build --scale --team "..." |
/studio build --builder "..." | /studio build --scale --tech=* "..." |
Note: Legacy commands show a deprecation notice but work normally.
Anti-Patterns
| Anti-Pattern | Problem | Fix |
|---|---|---|
Using --scale for simple fixes | Wastes time on quick tasks | Use --speed for < 100 char tasks |
Using --speed for complex features | Misses important workflow steps | Use --scale for multi-file features |
Ignoring --test for critical code | Regressions in production | Always use --test for payment/auth/security |
| Skipping EXPLORE phase | Misses existing implementations | Always search codebase first |
Using --team for small tasks | Unnecessary overhead | Use --team only for large/multi-domain tasks |
| Not checking flags | Suboptimal workflow | Review flag combinations before starting |
| Ignoring auto-detection | Misses smart defaults | Try without flags first, let system choose |
| Combining too many flags | Conflicting behaviors | Max 2-3 complementary flags |
Integration with Other Skills
Requires:
- semantic-search - For EXPLORE phase (finding existing code)
- memory-integration - For saving patterns to claude-mem
Complements:
- refactor - Use after implementation for cleanup
- multi-review - Use for comprehensive code review
- pattern-capture - Use after successful implementation to save patterns
Used by:
- All smite workflows as primary implementation entry point
Implement Skill v3.0.0 - 12-flag system with memory integration and quality metrics
Source
git clone https://github.com/Pamacea/smite/blob/main/plugins/studio/skills/build/SKILL.mdView on GitHub Overview
build is the mandatory entry point for all implementation tasks in the Smite project. It supports phrases like 'build feature', 'implement this', 'create component', 'add functionality', and 'develop API'. It uses a 12-flag system with auto-detection, memory integration, and quality metrics to streamline feature development.
How This Skill Works
It exposes 12 composable flags (--speed, --scale, --quality, --team, --clean, --test, --debug, --docs, --git, --branch, --profile, --types) and can auto-detect context for zero-configuration usage. It integrates memory for continuous improvement and tracks progress and quality metrics to validate outcomes. Invoke it via /studio build [flags] "<task>" to drive the work.
When to Use It
- Building new features: Build user authentication system
- Implementing functionality: Implement payment processing
- Creating components: Create dashboard widget
- Adding APIs: Add REST API endpoint for users
- Developing modules: Develop data validation layer
Quick Start
- Step 1: Run /studio build with the desired flags and a task description
- Step 2: Pass the relevant flags (--speed, --scale, --quality, etc.) to shape the workflow
- Step 3: Review progress, memory integration outputs, and quality metrics; iterate as needed
Best Practices
- Use the 12 flags to tailor the workflow for each task
- Leverage auto-detection to minimize manual config
- Enable memory integration to support continuous improvement
- Monitor quality metrics and adjust accordingly
- Maintain legacy compatibility during migrations
Example Use Cases
- /studio build --speed \"fix login button\"
- /studio build --scale \"build authentication system\"
- /studio build --quality \"implement payment processing\"
- /studio build --team \"build full-stack SaaS feature\"
- /studio build --docs \"API docs for new module\"