skills/forge-profile/SKILL.md
[read-only] Analyze pipeline performance -- time spent per stage, per agent, and per iteration. Use when a pipeline run felt slow, when you want to identify bottlenecks, or when optimizing pipeline configuration for faster runs.
npx skillsauth add quantumbitcz/dev-pipeline forge-profileInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
See shared/skill-contract.md for the standard exit-code table.
Before any action, verify:
git rev-parse --show-toplevel 2>/dev/null. If fails: report "Not a git repository. Navigate to a project directory." and STOP..claude/forge.local.md exists. If not: report "Forge not initialized. Run /forge-init first." and STOP..forge/state.json exists with cost.wall_time_seconds > 0. If no timing data: report "No performance data available. Run a pipeline first with /forge-run." and STOP..forge/events.jsonl exists. If not: note that per-stage/per-agent timing analysis will be limited -- report token and convergence data from state.json only, and note that detailed timing requires events.jsonl.Read all available performance data sources:
Events log (.forge/events.jsonl): Parse all state_transition events to extract timing:
State file (.forge/state.json): Extract:
cost.wall_time_seconds -- total run timetokens.by_stage -- token consumption per stagetokens.by_agent -- token consumption per agentconvergence.phase_history -- iteration detailsscore_history -- quality score progressionRun reports (.forge/reports/*.json): If available, extract per-run timing for trend analysis across multiple runs.
Calculate the following metrics from the gathered data:
Present the analysis in this format:
# Pipeline Performance Profile
## Time Breakdown by Stage
| Stage | Duration | % of Total | Iterations |
|-------|----------|-----------|------------|
## Time Breakdown by Agent
| Agent | Total Time | Dispatches | Avg per Dispatch |
|-------|-----------|-----------|-----------------|
## Token Consumption
| Component | Input Tokens | Output Tokens | Total |
|-----------|-------------|--------------|-------|
## Convergence Efficiency
- Total iterations: {N}
- Phase 1 iterations: {N}
- Phase 2 iterations: {N}
- Safety gate attempts: {N}
- Score trajectory: {start} -> {end}
## Bottleneck Analysis
- Slowest stage: {stage} ({duration}s, {pct}% of total)
- Most dispatched agent: {agent} ({count} times)
- Highest token consumer: {agent/stage}
## Recommendations
{If any stage > 40% of total time, suggest optimization}
{If any agent dispatched > 5 times, suggest scope reduction}
{If convergence took > 5 iterations, suggest PREEMPT items or threshold tuning}
If multiple run reports exist in .forge/reports/, compare performance across runs:
| Condition | Action |
|-----------|--------|
| Prerequisites fail | Report specific error message and STOP |
| state.json missing or unparseable | Report "Pipeline state not found or corrupt. Run /forge-run first." and STOP |
| events.jsonl missing | Generate partial report from state.json only, note limited data |
| events.jsonl has malformed lines | Skip malformed lines, log WARNING, continue with valid entries |
| No token data available | Report "No token usage data recorded." and skip token analysis sections |
| State corruption | Suggest /forge-recover repair to fix state, then re-run profiler |
/forge-insights -- Cross-run analytics including quality trends, cost analysis, and memory health/forge-history -- View run history with scores and verdicts/forge-status -- Check current pipeline run state/forge-recover diagnose -- Diagnose pipeline health issues (state integrity, stalled stages)development
[writes] Build, fix, deploy, review, or modify code in this project. Universal entry for the forge pipeline. Auto-bootstraps on first run; brainstorms before planning when given a feature description. Use when you want to take any productive action: implementing features, fixing bugs, reviewing branches, deploying, committing, running migrations.
tools
[writes] Manage forge state and configuration: recovery, abort, config edits, session handoff, automations, playbooks, output compression, knowledge graph maintenance. Use when you need to recover from broken pipeline state, edit settings, or manage long-lived state.
development
[writes] Create, list, show, resume, or search forge session handoffs. Use when context is getting heavy and you want to transfer a forge run or conversation into a fresh Claude Code session, or to resume from a prior handoff artefact. Subcommands - no args (write), list, show, resume, search.
development
[writes] Manage the Neo4j knowledge graph. Subcommands: init, rebuild (writes); status, query <cypher>, debug (read-only). Requires Docker. No default — an explicit subcommand is required. Use when setting up the graph for the first time, rebuilding after major refactors, checking graph health, or running ad-hoc Cypher diagnostics.