/cc-skills-meta:gto-oldfrom cc-skills-meta
Analyze what happened in this session and recommend what to do next. Detects: what skills were used, what wasn't completed, what gaps exist, what other skills should be invoked (like /pre-mortem after code changes, /critique after reviews, /git after edits).
Ships in cc-skills-meta. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
Reads session history to understand what happened, then recommends what skills to run next.
GTO analyzes your codebase to identify gaps, tasks, and opportunities across:
"Complete" for GTO v3.x means:
| Layer | Criterion | Target |
|---|---|---|
| L1 detectors | All 3 transcript-based detectors produce output | 100% |
| L1 detectors | Transcript-based detectors handle missing transcript gracefully | 100% |
| L2 subagent | No silent failures (unhandled exceptions) | 0 in last 10 runs |
| Output | Health score 0-100% reported | 100% |
| Output | Gap list non-empty (or explicit "no gaps" signal) | 100% |
| Self-verification | gto_assertions.py A1-A5 all pass | 100% |
| Persistence | State file written, readable on next run | 100% |
| Scores are measured against this table. A "complete" run is one where all rows are green. | ||
| A "partially complete" run is one where 1-2 rows fail. A "failed" run is 3+ failures or a critical (A1/A5) failure. |
/gto
GTO auto-detects the target from session context via semantic intent resolution:
/gto on hooks)/code or /planning was recently running → the feature/plan they were analyzingBefore recommending what to do next, /gto should run a short internal next-step integrity check:
/design, /planning, /verify, or another lower skill?/gto is genuinely blocked and cannot proceed safely without clarification.Step 1: Initialize session and terminal isolation
# Generate session-scoped identifiers
SESSION_ID="$(uuidgen 2>/dev/null || echo "session-$(date +%s)-$$")"
TERMINAL_ID="${CLAUDE_TERMINAL_ID:-${TERM:-console}-$$}"
TIMESTAMP=$(date +%Y%m%d_%H%M%S)
# Platform-safe temp directory
if [[ "$OSTYPE" == "msys" || "$OSTYPE" == "win32" ]]; then
TEMP_DIR="${TEMP:-C:/Users/$USER/AppData/Local/Temp}"
else
TEMP_DIR="${TMPDIR:-/tmp}"
fi
# Terminal-scoped temp subdirectory
TEMP_SUBDIR="$TEMP_DIR/gto-$TERMINAL_ID"
mkdir -p "$TEMP_SUBDIR"
# Evidence directory
EVIDENCE_DIR="P:/.claude/skills/gto/.evidence"
mkdir -p "$EVIDENCE_DIR"
Step 2: Run L1 analysis
python P:/.claude/skills/gto/gto_orchestrator.py \
--format json \
--output "$TEMP_SUBDIR/gto-l1-$TERMINAL_ID.json" || {
echo "ERROR: L1 analysis failed"
exit 1
}
Step 3: Dispatch correctness agents via Agent tool (parallel)
# NOTE: Agent tool is invoked internally by each subagent
# SKILL.md dispatches; Agent tool handles execution in Claude Code context
# Output paths include terminal_id for multi-terminal isolationAgent(subagent_type="gto-logic", prompt="Follow the constitution at P:/.claude/CLAUDE.md. Analyze P:/.claude/skills/gto/lib/ for pure logic errors (off-by-one, wrong operators, inverted conditionals). Write findings as JSON to $TEMP_SUBDIR/gto-correctness-logic-$TERMINAL_ID.json with format: {\"findings\": [{\"id\":\"LOGIC-001\",\"severity\":\"HIGH\",\"location\":\"file.py:123\",\"title\":\"...\",\"description\":\"...\",\"evidence\":\"...\"}]}. If no issues found, write {\"findings\": []}.") &
Agent(subagent_type="gto-quality", prompt="Follow the constitution at P:/.claude/CLAUDE.md. Analyze P:/.claude/skills/gto/lib/ for maintainability issues (technical debt, code smells, complex implementations). Write findings as JSON to $TEMP_SUBDIR/gto-correctness-quality-$TERMINAL_ID.json with format: {\"findings\": [{\"id\":\"QUAL-001\",\"severity\":\"MEDIUM\",\"location\":\"file.py:45\",\"title\":\"...\",\"description\":\"...\",\"evidence\":\"...\"}]}. If no issues found, write {\"findings\": []}.") &
Agent(subagent_type="gto-code-critic", prompt="Follow the constitution at P:/.claude/CLAUDE.md. Analyze P:/.claude/skills/gto/lib/ for root cause issues (causal chains, multi-step reasoning failures). Write findings as JSON to $TEMP_SUBDIR/gto-correctness-code-critic-$TERMINAL_ID.json with format: {\"findings\": [{\"id\":\"CAUSE-001\",\"severity\":\"HIGH\",\"location\":\"file.py:78\",\"title\":\"...\",\"description\":\"...\",\"evidence\":\"...\"}]}. If no issues found, write {\"findings\": []}.") &
AGENT_PIDS=($!)
Step 4: Poll for agent completion with early exit
TIMEOUT=300
elapsed=0
while [[ $elapsed -lt $TIMEOUT ]]; do
# Map agent index → output file path (defined once, used each iteration)
AGENT_OUTPUTS=(
"$TEMP_SUBDIR/gto-correctness-logic-$TERMINAL_ID.json"
"$TEMP_SUBDIR/gto-correctness-quality-$TERMINAL_ID.json"
"$TEMP_SUBDIR/gto-correctness-code-critic-$TERMINAL_ID.json"
)
# Check each agent: dead PIDs exit fast, live PIDs wait for file
for i in "${!AGENT_PIDS[@]}"; do
if ! kill -0 "${AGENT_PIDS[$i]}" 2>/dev/null; then
wait "${AGENT_PIDS[$i]}" || true
output_file="${AGENT_OUTPUTS[$i]}"
if [[ ! -f "$output_file" ]]; then
echo "ERROR: Agent ${i} died without producing output at $output_file"
exit 1
fi
fi
done
# Check if all required output files are present
if [[ -f "$TEMP_SUBDIR/gto-correctness-logic-$TERMINAL_ID.json" ]] && \
[[ -f "$TEMP_SUBDIR/gto-correctness-quality-$TERMINAL_ID.json" ]] && \
[[ -f "$TEMP_SUBDIR/gto-correctness-code-critic-$TERMINAL_ID.json" ]]; then
echo "All agent output files present after ${elapsed}s"
for pid in "${AGENT_PIDS[@]}"; do
wait "$pid" || {
echo "ERROR: Agent $pid exited with non-zero code"
exit 1
}
done
break
fi
sleep 1
((elapsed++))
done
if [[ $elapsed -ge $TIMEOUT ]]; then
echo "ERROR: Timeout after ${TIMEOUT}s waiting for agents"
for pid in "${AGENT_PIDS[@]}"; do
kill "$pid" 2>/dev/null || true
done
exit 1
fi
Step 5: Merge results
python P:/.claude/skills/gto/lib/merge_agent_results.py \
--l1 "$TEMP_SUBDIR/gto-l1-$TERMINAL_ID.json" \
--agents "$TEMP_SUBDIR/gto-correctness-*-${TERMINAL_ID}.json" \
--output "$EVIDENCE_DIR/gto-artifact-$SESSION_ID-$TIMESTAMP.json" \
--validate-schema || {
echo "ERROR: Merge failed"
echo "Temp files preserved at: $TEMP_SUBDIR"
exit 1
}
Step 6: Cleanup with trap protection
cleanup() {
local exit_code=$?
rm -f "$TEMP_SUBDIR"/gto-*-$TERMINAL_ID.json 2>/dev/null || true
rmdir "$TEMP_SUBDIR" 2>/dev/null || true
exit $exit_code
}
trap cleanup EXIT INT TERM
What happens:
.evidence/gto-artifact-{session_id}-{timestamp}.jsonGTO produces:
Three-layer design:
GTO includes an intelligent skill recommendation system that analyzes gaps and suggests relevant skills: Components:
lib/skill_registry_bridge.py - Loads skill metadata from registry with fallback cataloglib/gap_skill_mapper.py - Maps gap types to skill categories using GAP_TYPE_TO_CATEGORIESlib/skill_coverage_detector.py - Gap-aware recommendations for RSN output
How it works:Each terminal gets isolated state:
.evidence/gto-state-{terminal_id}/GTO should detect producer/consumer gaps as a first-class output category. Examples:
Contract Authority Packet exists/gto should suggest the owning lower skill for each gap family:
/design for state, contract, identity, ordering, dedupe, invalidation, or stale-data gaps/planning for execution-shape or missing contract-boundary matrix gaps/verify for unproven behavior or missing boundary-proof gaps/critique for adversarial review of risky or blind-spot-heavy changes/pre-mortem for risky fixes, recurring failures, or low-reversibility changes/retro for process-pattern gaps, repeated issues across sessions, or improvement investigation needs
/gto identifies and routes. It does not directly absorb those responsibilities.GTO maintains an append-only log of skill executions per target for routing suggestions.
Location: .evidence/skill_coverage/{target_key}.jsonl
Format (one JSON object per line):
{"skill": "/critique", "target": "skills/usm", "terminal_id": "console_abc123", "timestamp": "2026-03-24T...", "git_sha": "abc1234"}
Key properties:
action_type: "Use /skill"
Reference: lib/skill_coverage_detector.py — detect_skill_coverage() functionBefore claiming "done", you MUST:
verification.commands frontmatterP:/.claude/.artifacts/{terminal_id}/gto/verification.jsonpython P:/.claude/skills/gto/evals/gto_assertions.py
Note: Terminal ID is auto-detected from environment variables (CLAUDE_TERMINAL_ID, TERMINAL_ID, etc.) or derived from PID+timestamp.Do NOT write a freeform summary. Paste tool output verbatim with PASS/FAIL per command.
If any assertion fails:
The assertions script checks 5 criteria:
See references/ directory for:
architecture.md - Full system architectureapi.md - Complete API reference
Hook Path Resolution: GTO skill hooks use relative paths (../skills/gto/hooks/) not absolute paths. See memory/skill_hooks_path_resolution.md for details on skill-based hook path resolution.GTO uses a dynamic RNS format that groups findings by category, following the critique RNS pattern but with dynamically-generated domains based on gap types detected.
The formatter automatically groups gaps into categories based on type:
| Gap Type | Domain | Examples |
|---|---|---|
test_failure, missing_test | tests | Failing tests, missing test files |
missing_docs, outdated_docs | docs | Missing documentation, outdated docs |
git_dirty, uncommitted_changes | git | Uncommitted changes, dirty state |
import_error, missing_dependency | dependencies | Import errors, missing packages |
code_quality, tech_debt | code_quality | TODO/FIXME, code smells |
contract_gap, consumer_gap, stale_data_risk | contracts | Missing validators, implied fields, stale-artifact reuse |
🧪 TESTS TEST-001 [~5min] [R:1.25] Fix missing test in test_file.py (file:45) 📄 DOCS DOC-001 [~15min] [R:1.0] Add docstring to function_x (src/utils.py:78) 🔧 QUALITY QUAL-001 [~30min] [R:1.75] Refactor session_manager.py (src/session_manager.py:12) 🐙 GIT GIT-001 [~2min] [R:1.0] Commit 3 uncommitted changes in hooks/
After executing RNS actions, check whether documentation is stale for the gaps found: For each gap type detected, ask whether related docs are current:
test_gap / missing_test → check test coverage in relevant filesmissing_docs / outdated_docs → update the doc file directlycontract_gap → check if ADR or schema docs need updatingcode_quality → check if code comments or inline docs need refreshgit_dirty → commit first, then continue
If implementation happened in a different session from documentation, emit a follow-up DOCS item:📄 DOCS
[realize/low] DOC-N Update {file} with {specific change}
Rule: Documentation and implementation in the same session is preferred. If split across sessions, explicitly flag the doc gap. 📦 DEPS DEPS-001 [~5min] [R:1.5] Install missing httpx dependency ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 0 — Do ALL Recommended Next Actions (7 items, ~67min total) Format rules:
[ID] [~effort] [R:reversibility] Description (file:line)[causes: ID], [caused-by: ID], [blocks: ID]0 — Do ALL Recommended Next Actions directiveAfter running GTO and executing fixes, verify completeness and edge cases:
adversarial-failure-modes agent on changed files for edge case analysis__lib/fix-verification-protocol.md
Trigger: User asks "are all fixes verified?" or "any edge cases?" after GTO run.Static RNS sections assume all gap types are always present. GTO detects which gap types actually exist in the target project and only generates domains for those types. This prevents empty sections and keeps output focused.
When ranking gaps to fix, apply the Reversibility Scale:
| Score | Action |
|---|---|
| 1.0–1.25 (Trivial) | Fix immediately |
| 1.5 (Moderate) | Fix with tests |
| 1.75+ (Hard/Irreversible) | Defer unless critical |
| Reference: |
lib/next_steps_formatter.py — NextStepsFormatter classmemory/reversibility_scale.md — Reversibility Scale for decision guidance3.6.0 (2026-04-02) - Added Contract Authority Packet gap detection and downstream-consumption checks 3.5.0 (2026-04-02) - Added first-class contract gap detection and routing 3.4.0 (2026-04-01) - Remove --project-root override; rely on session context auto-detection 3.3.0 (2026-03-25) - Intelligent gap-aware skill recommendations with LLM context injection 3.2.0 (2026-03-24) - Added skill coverage append-only log with git-state freshness 3.1.0 (2026-03-22) - Added self-verifying infrastructure with binary assertions
HOOKS_DISCOVERY.md (opens in a new tab)__init__.py (opens in a new tab)__lib/__init__.py (opens in a new tab)__lib/adjacent_file_scanner.py (opens in a new tab)__lib/chain_integrity_checker.py (opens in a new tab)__lib/code_marker_scanner.py (opens in a new tab)__lib/dependency_checker.py (opens in a new tab)__lib/docs_presence_checker.py (opens in a new tab)__lib/entry_point_checker.py (opens in a new tab)__lib/gap_resolution_tracker.py (opens in a new tab)__lib/gap_skill_mapper.py (opens in a new tab)__lib/git_context.py (opens in a new tab)__lib/gto_self_health_detector.py (opens in a new tab)__lib/history_scanner.py (opens in a new tab)__lib/merge_agent_results.py (opens in a new tab)__lib/next_steps_formatter.py (opens in a new tab)__lib/omission_checklist.py (opens in a new tab)__lib/question_generator.md (opens in a new tab)__lib/results_builder.py (opens in a new tab)__lib/session_chain_analyzer.py (opens in a new tab)What SKILL.md sets; muted values are Claude Code's defaults
Other plugins' skills for the same job
51 skills in this plugin
/behaveStructured behavioral analysis for LLM performance debugging — hypothesis testing for session patterns (loops, context degradation, decision inefficiency, cognitive overload, attention drift)/cksConstitutional Knowledge System - unified command for search, add, and session extraction/concept-mapperUnified concept mapping for learning, system architecture, and text analysis. Creates Mermaid diagrams for mind maps, concept maps, system diagrams, and knowledge structures. Use for studying, documentation, architecture visualization, or converting articles/text into visual maps.Generated from the plugin's indexed repository (enduser123/cc-skills-meta) — no native marketplace selected
npx claudepluginhub p/enduser123-cc-skills-meta