From maister
Orchestrates performance optimization workflows using static code analysis to detect bottlenecks like N+1 queries, missing indexes, O(n^2) algorithms, blocking I/O, and memory leaks. Accepts profiling data.
npx claudepluginhub skillpanel/maister --plugin maisterThis skill uses the workspace's default tool permissions.
Static-analysis-first performance optimization workflow. Identifies bottlenecks by reading code, then uses the standard specification/planning/implementation/verification pipeline to fix them.
Orchestrates performance fixes via static analysis for bottlenecks like N+1 queries, missing indexes, O(n^2) algorithms, blocking I/O, memory leaks. Accepts profiling data; runs spec/plan/impl/verify phases.
Performs Maestro-style performance assessments to identify hotspots, regressions, establish baselines, prioritize fixes, and plan optimizations from code and metrics.
Performs static code analysis for performance bottlenecks, optimization opportunities, scalability issues, including N+1 queries, memory leaks, caching, and Core Web Vitals. Generates prioritized report with code fixes.
Share bugs, ideas, or general feedback.
Static-analysis-first performance optimization workflow. Identifies bottlenecks by reading code, then uses the standard specification/planning/implementation/verification pipeline to fix them.
BEFORE executing any phase, you MUST complete these steps:
Read the framework reference file NOW using the Read tool:
../orchestrator-framework/references/orchestrator-patterns.md - Delegation rules, interactive mode, state schema, initialization, context passing, issue resolutionTaskCreate for all phases (see Phase Configuration), then set dependencies with TaskUpdate addBlockedBy.maister/tasks/performance/YYYY-MM-DD-task-name/analysis/, analysis/user-profiling-data/, implementation/, verification/orchestrator-state.yml with performance contextOutput:
Performance Orchestrator Started
Task: [performance issue description]
Directory: [task-path]
Starting Phase 1: Codebase Analysis...
Use for:
DO NOT use for: New features, bug fixes, refactoring without performance goals.
| Phase | content | activeForm | Agent/Skill |
|---|---|---|---|
| 1 | "Analyze codebase" | "Analyzing codebase" | codebase-analyzer |
| 2 | "Analyze performance bottlenecks" | "Analyzing performance bottlenecks" | bottleneck-analyzer |
| 3 | "Gather requirements & create specification" | "Gathering requirements & creating specification" | specification-creator |
| 4 | "Audit specification" | "Auditing specification" | spec-auditor (conditional) |
| 5 | "Plan implementation" | "Planning implementation" | implementation-planner |
| 6 | "Execute implementation" | "Executing implementation" | implementation-plan-executor |
| 7 | "Prompt verification options" | "Prompting verification options" | Direct |
| 8 | "Verify implementation & resolve issues" | "Verifying implementation" | implementation-verifier |
| 9 | "Finalize workflow" | "Finalizing workflow" | Direct |
Purpose: Comprehensive codebase exploration for performance context, followed by scope/requirements clarification Execute:
maister:codebase-analyzeranalysis/clarifications.md
Output: analysis/codebase-analysis.md, analysis/clarifications.md
State: Update performance_context.phase_summaries.codebase_analysis, task_context.clarifications_resolvedPass task_type="enhancement" and the performance-focused description. The codebase-analyzer adaptively selects parallel Explore agents based on task complexity. For performance tasks, the description should guide agents toward: database query patterns, hot code paths, I/O operations, caching layers, connection management, schema/migration files.
→ AUTO-CONTINUE — Do NOT end turn, do NOT prompt user. Proceed immediately to Phase 2.
Purpose: Identify bottlenecks through static code analysis + optional user profiling data
Execute: Task tool - maister:bottleneck-analyzer subagent
Output: analysis/performance-analysis.md
State: Update performance_context.bottlenecks_identified, performance_context.user_data_available, performance_context.bottleneck_priorities
Process:
analysis/user-profiling-data/ contains any filesANTI-PATTERN — DO NOT DO THIS:
INVOKE NOW — Task tool call:
maister:bottleneck-analyzer subagentContext to pass: task_path, description, codebase analysis summary from Phase 1, user data paths (if any)
SELF-CHECK: Did you just invoke the Task tool with maister:bottleneck-analyzer? Or did you start analyzing code yourself? If the latter, STOP and invoke the Task tool.
→ Pause
AskUserQuestion - "Performance analysis complete. [N] bottlenecks identified ([P0 count] P0, [P1 count] P1). Continue to specification?"
Phase gate: Requires
AskUserQuestionconfirmation from Phase 2 before executing.
Purpose: Gather optimization requirements and create specification
Output: analysis/requirements.md, implementation/spec.md
State: Update performance_context.phase_summaries.specification
Part A — Requirements Gathering (inline):
analysis/requirements.md with: performance issue description, bottleneck analysis summary, optimization priorities, constraints, targetsPart B — Specification Creation (subagent):
📋 Standards Discovery: Read .maister/docs/INDEX.md before creating spec.
ANTI-PATTERN — DO NOT DO THIS:
INVOKE NOW — Task tool call:
maister:specification-creator subagentContext to pass: task_path, task_type="performance", task_description, requirements_path (analysis/requirements.md), project_context_paths (INDEX.md, vision.md, roadmap.md, tech-stack.md), phase_summaries (codebase_analysis, bottleneck_analysis)
SELF-CHECK: Did you just invoke the Task tool with maister:specification-creator? Or did you start writing spec.md yourself? If the latter, STOP and invoke the Task tool.
→ Pause
AskUserQuestion - Display executive summary before asking. Read implementation/spec.md and extract: optimization targets, approach chosen, number of changes planned, expected impact. Format as brief overview then "Continue to specification audit?"
Phase gate: Requires
AskUserQuestionconfirmation from Phase 3 before executing.
Purpose: Independent review of optimization specification
Execute: Task tool - maister:spec-auditor subagent
Output: verification/spec-audit.md
State: Update options.spec_audit_enabled
Run if: >5 optimizations planned, spec >50 lines, or user requests Skip if: Simple optimization (1-3 changes)
AskUserQuestion to decide - "Run specification audit?"
→ Pause
AskUserQuestion - Display executive summary before asking. Read verification/spec-audit.md and extract: overall verdict, issue counts by severity, top findings. Format as brief overview then "Continue to implementation planning?"
Phase gate: Requires
AskUserQuestionconfirmation from Phase 4 before executing.
Purpose: Break optimization specification into implementation steps
📋 Standards Discovery: Read .maister/docs/INDEX.md before planning.
ANTI-PATTERN — DO NOT DO THIS:
INVOKE NOW — Task tool call:
Execute: Task tool - maister:implementation-planner subagent
Output: implementation/implementation-plan.md
State: Update task groups and dependencies
Context to pass: task_path, task_type="performance", task_description, phase_summaries (specification, bottleneck_analysis, codebase_analysis)
SELF-CHECK: Did you just invoke the Task tool with maister:implementation-planner? Or did you start writing the plan yourself? If the latter, STOP and invoke the Task tool.
→ Pause
AskUserQuestion - Display executive summary before asking. Read implementation/implementation-plan.md and extract: number of task groups, total steps, key dependencies, optimization sequence. Format as brief overview then "Continue to implementation?"
Phase gate: Requires
AskUserQuestionconfirmation from Phase 5 before executing.
Purpose: Execute the optimization plan
📋 Standards Discovery: Implementation reads .maister/docs/INDEX.md continuously.
ANTI-PATTERN — DO NOT DO THIS:
INVOKE NOW — Skill tool call:
Execute: Skill tool - maister:implementation-plan-executor
Output: Implemented optimizations, implementation/work-log.md
State: Update implementation progress, extract phase_summaries.implementation
SELF-CHECK: Did you just invoke the Skill tool with maister:implementation-plan-executor? Or did you start writing code yourself? If the latter, STOP immediately and invoke the Skill tool instead.
⚠️ POST-IMPLEMENTATION CONTINUATION — After the skill completes and returns control:
orchestrator-state.yml to confirm you are the orchestratorcompleted_phases→ Pause
AskUserQuestion - Display executive summary before asking. Extract from phase_summaries.implementation and implementation/work-log.md: optimizations applied, files changed, test results, any known issues. Format as brief overview then "Continue to verification?"
Phase gate: Requires
AskUserQuestionconfirmation from Phase 6 before executing.
Purpose: Determine which verification checks to run
Execute: Direct - use AskUserQuestion for options
Output: Updated state with verification options
State: Set options.code_review_enabled, options.pragmatic_review_enabled, options.production_check_enabled, options.reality_check_enabled
Always enabled: Reality check, pragmatic review
Auto-set: skip_test_suite: true (full test suite already passed during implementation phase; cleared before re-verification if fixes are applied)
AskUserQuestion with multiselect - "Which additional verification checks?"
→ Pause
AskUserQuestion - "Options selected. Continue to Phase 8?"
Phase gate: Requires
AskUserQuestionconfirmation from Phase 7 before executing.
Purpose: Comprehensive implementation verification with user-driven fix cycles
Output: verification/implementation-verification.md, optional review reports
State: Update verification_context
Execute:
Step 1: Invoke Skill tool - maister:implementation-verifier
Step 2: Display detailed issue breakdown grouped by category and severity (critical/warning/info), listing location, description, and fixability for each.
Step 3: Gate on verification status:
status: passed → skip to Pausestatus: passed_with_issues or failed → enter user-driven fix loop (Step 4)Step 4: User-driven fix loop (max 3 iterations):
skip_test_suite: false (code changed, tests must re-run)maister:implementation-verifier → return to Step 2→ Pause
AskUserQuestion - Display executive summary: total issues found, issues fixed, issues remaining by severity. Then "Continue to finalization?"
Phase gate: Requires
AskUserQuestionconfirmation from Phase 8 before executing.
Purpose: Complete workflow and provide next steps
Execute: Direct - create summary, update state, guide commit
Output: Workflow summary
State: Set task.status: completed
Process:
→ End of workflow
Performance-specific fields in orchestrator-state.yml:
performance_context:
bottlenecks_identified: null # count from bottleneck-analyzer
user_data_available: false # whether user provided profiling data
bottleneck_priorities:
p0: 0
p1: 0
p2: 0
p3: 0
phase_summaries:
codebase_analysis: {key_files: [], summary: null}
bottleneck_analysis: {bottlenecks: [], summary: null, user_data_incorporated: false}
specification: {summary: null}
verification_context:
last_status: null
issues_found: null
fixes_applied: []
decisions_made: []
reverify_count: 0
options:
spec_audit_enabled: null
skip_test_suite: true
code_review_enabled: true
pragmatic_review_enabled: true
reality_check_enabled: true
production_check_enabled: null
.maister/tasks/performance/YYYY-MM-DD-task-name/
├── orchestrator-state.yml
├── analysis/
│ ├── codebase-analysis.md # Phase 1
│ ├── performance-analysis.md # Phase 2
│ ├── user-profiling-data/ # Optional user-provided data
│ └── requirements.md # Phase 3
├── implementation/
│ ├── spec.md # Phase 3
│ ├── implementation-plan.md # Phase 5
│ └── work-log.md # Phase 6
└── verification/
├── spec-audit.md # Phase 4 (conditional)
└── implementation-verification.md # Phase 8
| Phase | Max Attempts | Strategy |
|---|---|---|
| 1 | 2 | Expand search scope, prompt user for hints |
| 2 | 2 | Re-analyze with broader patterns, ask user |
| 3 | 2 | Regenerate spec with adjusted requirements |
| 5 | 2 | Regenerate plan |
| 6 | 5 | Fix syntax, imports, tests |
| 8 | 3 | Fix-then-reverify cycles |
Invoked via:
/maister:performance [description] (new)/maister:performance [task-path] [--from=PHASE] (resume)Task directory: .maister/tasks/performance/YYYY-MM-DD-task-name/