agentskills.codes
MA

maestro-companion

Knowledge companion — load context, record companion doc, capture insights, route to skills

Install

mkdir -p .claude/skills/maestro-companion && curl -L -o skill.zip "https://agentskills.codes/api/skills/download/14806" && unzip -o skill.zip -d .claude/skills/maestro-companion && rm skill.zip

Installs to .claude/skills/maestro-companion

Activation

This is the description your AI agent reads to decide when to run this skill — the better it matches your request, the more reliably it fires.

Knowledge companion — load context, record companion doc, capture insights, route to skills
91 charsno explicit “when” trigger

About this skill

<purpose> Task companion command — pairs with any task to provide knowledge context loading, structured companion document recording, insight capture, and skill routing.

Four modes:

  • before — Pre-task: load spec + knowhow index + codebase index, create companion doc
  • note — Mid-task: append a structured entry to the active companion doc
  • after — Post-task: review companion doc, promote entries to spec/knowhow, suggest next steps
  • route — Routing: recommend next skill/command based on intent

No arguments → auto-detect: uncommitted changes → after, else → before. </purpose>

<context> $ARGUMENTS — mode + optional flags.
$maestro-companion
$maestro-companion "before --task 'implement auth module' --type implement"
$maestro-companion "before --task 'fix login bug' --type debug --category coding"
$maestro-companion "note 'decided to use bcrypt over argon2'"
$maestro-companion "note --file src/auth.ts 'changed token validation logic'"
$maestro-companion "after"
$maestro-companion "route what should I do next"

Mode detection priority:

  1. Explicit before / note / after / route
  2. Intent text that is not a mode keyword → route
  3. No arguments → show git status summary and ask user to choose mode via request_user_input:
    • Options: before (start new task), after (review & promote), route (get next command suggestion)
    • Display working tree status (clean/dirty, changed file count) as context for the choice
    • NEVER auto-enter after mode based on dirty tree — let the user decide

Flags:

  • --task <description> — Current task description (for targeted knowledge loading and doc title)
  • --type <task_type> — Task type for field template selection (see task types below)
  • --category <cat> — Spec category filter: coding / arch / test / review / debug / learning / ui

Task types (determines which recording sections are active):

TypeDescriptionKey sections
implementFeature development, code writingworking_files, dependencies, decisions, tests_affected
debugBug investigation, root cause analysissymptoms, hypotheses, evidence, root_cause, fix_applied
analyzeCode/architecture/performance analysisscope, findings, risks, recommendations
designArchitecture/UI/API designconstraints, alternatives, trade_offs, chosen_approach
planTask decomposition, roadmap planninggoals, breakdown, estimates, dependencies
reviewCode review, PR reviewfiles_reviewed, findings, severity_counts, verdict
testTest writing, UAT, coverage expansioncoverage_before, coverage_after, gaps, test_files
refactorCode restructuring, tech debtaffected_modules, before_after, breaking_changes
learnCodebase exploration, knowledge buildingquestions, answers, mental_model, references
generalDefault / unclassified(all universal sections)

Auto-detection: if --type not provided, infer from --task description keywords.

Output boundary: ALL file writes MUST target .workflow/.scratchpad/ (companion docs + .companion-active pointer) only. Promotion writes (spec/knowhow) are delegated to spec-add / manage-knowhow-capture skills. NEVER modify source code, .workflow/state.json, or files outside .workflow/.scratchpad/.

Companion document:

  • Path: .workflow/.scratchpad/companion-{YYYYMMDD-HHmmss}.md
  • Active doc tracking: .workflow/.scratchpad/.companion-active (stores path of current companion doc)
  • Format: YAML frontmatter (rich metadata) + typed sections + timestamped entries </context>
<invariants> 1. **No session creation** — companion NEVER creates workflow sessions, NEVER writes to state.json 2. **Side-car only** — companion MUST NOT modify source code or execute implementation tasks; it is strictly a knowledge loading + recording utility 3. **One active doc** — only one `.companion-active` pointer SHALL exist at a time; creating a new companion doc MUST clear any stale pointer 4. **Append-only entries** — note mode MUST append entries; NEVER overwrite or reorder existing entries 5. **Promotion via delegation** — spec/knowhow promotion MUST route through `spec-add` / `manage-knowhow-capture` skills; companion NEVER writes directly to `.workflow/specs/` or `.workflow/knowhow/` 6. **Type-template integrity** — context template sections MUST match the resolved `task_type`; NEVER mix templates from different types </invariants> <execution>

S_BEFORE — Knowledge Loading + Companion Doc Creation

Step 1: Load Specs

Run maestro load --type spec with appropriate flags:

  • With --category: maestro load --type spec --category <cat>
  • With --task: maestro load --type spec --keyword <extracted_keyword>
  • No flags: maestro load --type spec --category coding

Display loaded rules summary (entry count + key rule names).

Step 2: Browse Knowhow Index

Run maestro knowhow list --store workflow. With --task, also run maestro search "<task_keyword>" --type knowhow. Display available entries (ID + title). Hint: maestro load --type knowhow --id <id> for details.

Step 3: Check Codebase Index

Check if .workflow/codebase/doc-index.json exists.

  • Exists → display "Codebase docs ready, last updated: {timestamp}"
  • Missing → suggest $manage-codebase-rebuild
  • Stale (>7 days) → suggest $manage-codebase-refresh

Step 4: Create Companion Document

Create .workflow/.scratchpad/ if needed. Resolve task type from --type flag or infer from --task keywords.

Write companion doc with full field template:

---
# === Identity ===
task: "{task_description or 'Untitled task'}"
task_type: "{resolved type}"
created: "{ISO timestamp}"
status: active

# === Context Loaded ===
specs_loaded: "{category or 'coding'}"
specs_count: {N}
knowhow_searched: "{keyword or 'none'}"
knowhow_available: {M}
codebase_index: "{ready|missing|stale}"
branch: "{current git branch}"
phase: "{current phase from state.json or 'none'}"
milestone: "{current milestone from state.json or 'none'}"

# === Scope ===
working_files: []
dependencies: []
related_artifacts: []

# === Outcome (populated by after mode) ===
outcome: ""
files_changed: []
promoted_specs: 0
promoted_knowhow: 0
follow_up: []
completed: ""
---

# Companion Doc — {task_description}

> `$maestro-companion "note '<content>'"` — add entries
> `$maestro-companion after` — review, promote, close

## Context

{Type-specific context section}

## Entries

## Summary

Type-specific context templates (written into ## Context):

implement:

### Working Files
| File | Role | Status |
|------|------|--------|

### Dependencies
- (modules, APIs, or services this task depends on)

### Decisions
| # | Decision | Rationale | Alternatives Considered |
|---|----------|-----------|------------------------|

### Tests Affected
- (test files that need creation or update)

debug:

### Symptoms
- (observable behavior vs expected behavior)

### Hypotheses
| # | Hypothesis | Status | Evidence |
|---|-----------|--------|----------|

### Evidence Trail
| Time | Source | Type | Finding |
|------|--------|------|---------|

### Root Cause
- (populated when identified)

### Fix Applied
- (description of fix, files changed)

analyze:

### Scope
- (what is being analyzed and boundaries)

### Findings
| # | Finding | Severity | Location |
|---|---------|----------|----------|

### Risks
- (identified risks or concerns)

### Recommendations
- (actionable recommendations)

design:

### Constraints
- (hard limits, requirements, compatibility needs)

### Alternatives
| # | Approach | Pros | Cons |
|---|----------|------|------|

### Trade-offs
- (key trade-off decisions and rationale)

### Chosen Approach
- (selected design with justification)

plan:

### Goals
- (what success looks like)

### Breakdown
| # | Task | Estimate | Depends On | Status |
|---|------|----------|------------|--------|

### Dependencies
- (external dependencies, blockers, prerequisites)

review:

### Files Reviewed
| File | Lines | Findings |
|------|-------|----------|

### Findings
| # | Severity | Category | File:Line | Description |
|---|----------|----------|-----------|-------------|

### Verdict
- (pass / pass-with-concerns / fail)

test:

### Coverage
- Before: {%}
- After: {%}
- Target: {%}

### Test Files
| File | Type | Tests Added | Status |
|------|------|------------|--------|

### Gaps
- (uncovered paths or scenarios)

refactor:

### Affected Modules
- (modules being restructured)

### Before / After
| Aspect | Before | After |
|--------|--------|-------|

### Breaking Changes
- (API or behavior changes that affect consumers)

learn:

### Questions
| # | Question | Answered | Source |
|---|----------|----------|--------|

### Mental Model
- (evolving understanding of how it works)

### References
- (files, docs, wiki entries consulted)

general:

### Notes
- (general working notes)

Write the companion doc path to .workflow/.scratchpad/.companion-active.

Step 5: Output Summary Card

Knowledge context loaded
  Spec:     {N} rules ({category})
  Knowhow:  {M} entries available
  Codebase: {status}
  Doc:      {companion_doc_path} [{task_type}]

Mid-task commands:
  $maestro-companion "note 'finding or decision'"
  $maestro-companion "note --file src/auth.ts 'changed validation'"
  $spec-load "--keyword <keyword>"

S_NOTE — Append Structured Entry to Companion Doc

Step 1: Locate Active Companion Doc

Read .workflow/.scratchpad/.companion-active to get the doc path. If missing or file not found → create a new companion doc (same as Step 4 above, minimal — no spec/knowhow loading).

Step 2: Parse Entry Content and Flags

Parse $ARGUMENTS after note keyword


Content truncated.

Search skills

Search the agent skills registry