# orchestrator > Coordinate all assimilation phases to scan a repo and generate skills. Use when assimilating a repository, running the full pipeline, or automating skill extraction. - Author: David Torres - Repository: datorresb/vibecoding-starter - Version: 20260206200846 - Stars: 0 - Forks: 0 - Last Updated: 2026-02-06 - Source: https://github.com/datorresb/vibecoding-starter - Web: https://mule.run/skillshub/@@datorresb/vibecoding-starter~orchestrator:20260206200846 --- --- name: orchestrator description: Coordinate all assimilation phases to scan a repo and generate skills. Use when assimilating a repository, running the full pipeline, or automating skill extraction. metadata: phase: coordinator pipeline: assimilation version: 1.0.0 --- # Orchestrator ## Overview Coordinate all phases of the assimilation pipeline in sequence, handling errors and producing a final summary. This is the meta-skill that runs everything. --- ## When to Use Use this skill when: - Assimilating a complete repository - Running the full scan → extract → generate pipeline - Automating skill extraction from a codebase - User says "assimilate this repo" --- ## Pipeline Flow ``` User: "assimilate this repo" │ ▼ ┌─────────────────┐ │ ORCHESTRATOR │ └────────┬────────┘ │ ┌────────▼────────┐ │ Phase 1: SCAN │ → scan-report.json └────────┬────────┘ │ ┌────────▼────────┐ │ Phase 2: EXTRACT│ → patterns.json └────────┬────────┘ │ ┌────────▼────────┐ │ Phase 3: GENERATE│ → SKILL.md files └────────┬────────┘ │ ┌────────▼────────┐ │ Phase 4: UPDATE │ → AGENTS.md section └────────┬────────┘ │ ┌────────▼────────┐ │ Phase 5: CLEANUP│ → Remove temp files └────────┬────────┘ │ ▼ 📊 Summary Report ``` --- ## Execution Steps ### Step 0: Setup ```bash # Create temp directory mkdir -p .github/temp # Record start time START_TIME=$(date -u +"%Y-%m-%dT%H:%M:%SZ") ``` ### Step 1: Phase 1 — Scan Repository **Invoke:** `assimilation/repo-scanner` skill ```markdown Using repo-scanner skill: - Apply ignore patterns - Detect language and framework - Identify domains and entry points - Generate scan-report.json ``` **Verify output:** ```bash if [ ! -f ".github/temp/scan-report.json" ]; then echo "❌ FAIL: Phase 1 did not produce scan-report.json" exit 1 fi # Check for error if grep -q '"error": true' .github/temp/scan-report.json; then echo "❌ FAIL: Scan reported error" cat .github/temp/scan-report.json exit 1 fi ``` **Report progress:** ``` ✅ Phase 1 complete: Repository scanned Language: Framework: Domains: ``` ### Step 2: Phase 2 — Extract Patterns **Invoke:** `assimilation/pattern-extractor` skill ```markdown Using pattern-extractor skill: - Run semantic grep for each category - Analyze key files - Calculate confidence scores - Generate patterns.json ``` **Verify output:** ```bash if [ ! -f ".github/temp/patterns.json" ]; then echo "❌ FAIL: Phase 2 did not produce patterns.json" exit 1 fi # Check pattern count PATTERN_COUNT=$(grep -c '"name":' .github/temp/patterns.json || echo "0") if [ "$PATTERN_COUNT" -eq 0 ]; then echo "⚠️ WARNING: No patterns found" fi ``` **Report progress:** ``` ✅ Phase 2 complete: Patterns extracted Patterns found: Categories: arch(), rel(), qual(), sec(), conv() ``` ### Step 3: Phase 3 — Generate Skills **Invoke:** `assimilation/skill-generator` skill ```markdown Using skill-generator skill: - Apply regularization (thresholds, abstraction, dedup) - Generate SKILL.md for each passing pattern - Write to both .github/skills/ and .claude/skills/ ``` **Verify output:** ```bash # Count generated skills SKILL_COUNT=$(find .github/skills -name "SKILL.md" 2>/dev/null | wc -l) if [ "$SKILL_COUNT" -eq 0 ]; then echo "⚠️ WARNING: No skills generated (all patterns filtered)" fi ``` **Report progress:** ``` ✅ Phase 3 complete: Skills generated Skills created: Validated: Experimental: ``` ### Step 4: Phase 4 — Update AGENTS.md (Optional) If skills were generated, append a section to AGENTS.md: **Check if AGENTS.md exists:** ```bash if [ -f "AGENTS.md" ]; then # Append section echo "Updating AGENTS.md with generated skills..." else # Create minimal AGENTS.md echo "Creating AGENTS.md with generated skills..." fi ``` **Section to add:** ```markdown --- ## Generated Skills The following skills were auto-generated from repository analysis on : ### Architecture | Skill | Use When | Status | |-------|----------|--------| | [](.github/skills/architecture//SKILL.md) | | | ### Reliability | Skill | Use When | Status | |-------|----------|--------| | [](.github/skills/reliability//SKILL.md) | | | ### Quality | Skill | Use When | Status | |-------|----------|--------| | [](.github/skills/quality//SKILL.md) | | | > Skills marked as `experimental` may need human review. ``` ### Step 5: Phase 5 — Cleanup ```bash # Remove temp files rm -rf .github/temp # Verify cleanup if [ -d ".github/temp" ]; then echo "⚠️ WARNING: Temp directory not fully removed" fi ``` ### Step 6: Update Usage Tracking (Append-Only) If this is not the first assimilation, append to usage tracking: ```bash # .github/skills-usage.json # Only orchestrator writes to this file ``` ```json { "assimilations": [ { "repo": "", "timestamp": "", "skills_generated": , "patterns_found": , "patterns_filtered": } ] } ``` ### Step 7: Generate Final Summary ``` ════════════════════════════════════════════════════════ ✅ ASSIMILATION COMPLETE ════════════════════════════════════════════════════════ Repository: Language: Framework: Pipeline Results: Phase 1 (Scan): ✅ domains found Phase 2 (Extract): ✅ patterns found Phase 3 (Generate): ✅ skills created Phase 4 (Update): ✅ AGENTS.md updated Phase 5 (Cleanup): ✅ Temp files removed Generated Skills by Category: architecture/ skills reliability/ skills quality/ skills security/ skills conventions/ skills Skill Locations: .github/skills///SKILL.md .claude/skills///SKILL.md ⚠️ Experimental Skills (need review): - (confidence: 0.XX) - (confidence: 0.XX) Next Steps: 1. Review experimental skills 2. Test a skill: "Use the skill to..." 3. Edit skills as needed ════════════════════════════════════════════════════════ ``` --- ## Error Handling ### Fail Fast Policy If any phase fails, stop immediately: ``` ❌ ASSIMILATION FAILED Failed at: Phase () Error: Partial outputs preserved in .github/temp/ for debugging. To resume: 1. Fix the issue 2. Re-run orchestrator To cleanup: rm -rf .github/temp ``` ### Error Conditions | Phase | Condition | Action | |-------|-----------|--------| | 1 | Empty directory | FAIL immediately | | 1 | No config files | WARN, continue with extension-based detection | | 2 | No patterns found | WARN, continue with empty output | | 3 | All patterns filtered | WARN, produce no skills | | 4 | AGENTS.md locked | WARN, skip update | | 5 | Cannot delete temp | WARN, continue | --- ## Subagent Invocation Pattern The orchestrator invokes each phase skill using the subagent pattern: ```markdown For Phase 1: "Using the repo-scanner skill, scan this repository and produce scan-report.json" For Phase 2: "Using the pattern-extractor skill, analyze the scan results and extract patterns" For Phase 3: "Using the skill-generator skill, generate SKILL.md files from the patterns" ``` Each subagent: 1. Reads required input files 2. Performs its phase 3. Writes output files 4. Reports completion --- ## Conventions ✅ **Do:** - Execute phases in strict order - Fail fast on critical errors - Clean up temp files on success - Report progress after each phase - Preserve temp on failure for debugging ❌ **Don't:** - Skip phases or run out of order - Continue after critical failure - Leave temp files on success - Generate skills directly (delegate to skill-generator) - Write to skills-usage.json from anywhere except orchestrator --- ## Related Skills - [repo-scanner](../repo-scanner/SKILL.md) — Phase 1: Scan repository structure - [pattern-extractor](../pattern-extractor/SKILL.md) — Phase 2: Extract patterns - [skill-generator](../skill-generator/SKILL.md) — Phase 3: Generate skills