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.zipInstalls 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 skillsAbout this skill
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>
$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:
- Explicit
before/note/after/route - Intent text that is not a mode keyword →
route - No arguments → show
git statussummary and ask user to choose mode viarequest_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
aftermode based on dirty tree — let the user decide
- Options:
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):
| Type | Description | Key sections |
|---|---|---|
implement | Feature development, code writing | working_files, dependencies, decisions, tests_affected |
debug | Bug investigation, root cause analysis | symptoms, hypotheses, evidence, root_cause, fix_applied |
analyze | Code/architecture/performance analysis | scope, findings, risks, recommendations |
design | Architecture/UI/API design | constraints, alternatives, trade_offs, chosen_approach |
plan | Task decomposition, roadmap planning | goals, breakdown, estimates, dependencies |
review | Code review, PR review | files_reviewed, findings, severity_counts, verdict |
test | Test writing, UAT, coverage expansion | coverage_before, coverage_after, gaps, test_files |
refactor | Code restructuring, tech debt | affected_modules, before_after, breaking_changes |
learn | Codebase exploration, knowledge building | questions, answers, mental_model, references |
general | Default / 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>
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.