Command Palette

Search for a command to run...

UnylyUnyly
Назад к скиллам

outcome-reflection

БесплатноЗапускает вложенные скриптыНе проверен

Feed actual task results back into agent memory for calibration. Compares predicted vs actual outcomes, records accuracy scores, and tracks estimation…

oimiragieoот oimiragieo★ 48 звёзд на GitHub

Об этом скилле

Outcome Reflection

Overview

Closes the feedback loop between prediction and reality in agent task execution. After a task completes, this skill compares the predicted outcome (recorded at planning time) against the actual outcome (observed at completion), scores the accuracy on three dimensions, and persists the calibration record to memory for future use.

Over time, accumulated calibration data reveals systematic biases (e.g., consistent underestimation of implementation tasks) that planners can use to improve future predictions.

When to Use

Invoke immediately after any task that had a predicted outcome recorded:

  • After HIGH/EPIC pipeline completion (planner predictions vs actual)
  • After estimation tasks (token counts, time estimates, file counts)
  • After architectural decision tasks (expected impact vs observed impact)
  • After any task where the planner recorded explicit predictions in task metadata

Do not invoke for:

  • Tasks where no prediction was recorded (nothing to compare)
  • Trivial tasks (single-file edits) — overhead not justified
  • Ongoing tasks — invoke only after TaskUpdate(completed)

Iron Law

NO CALIBRATION WITHOUT A PRIOR PREDICTION

If no prediction was recorded at planning time, outcome-reflection cannot score accuracy. The fix is to ensure planners record predictions. See plan-generator for prediction metadata format.

Calibration Dimensions

Dimension 1: Estimation Accuracy

Measures how accurately the agent estimated measurable quantities:

  • Token count predictions vs actual
  • File count predictions vs actual
  • Step count predictions vs actual
  • Time/effort predictions vs actual

Score: 0.0–1.0 (1.0 = exact, 0.0 = off by >10x)

score = max(0, 1 - abs(predicted - actual) / max(predicted, actual))

Dimension 2: Prediction Quality

Measures how accurately the agent predicted qualitative outcomes:

  • Did the implementation meet stated requirements?
  • Did the plan identify the actual blockers?
  • Were edge cases predicted that actually occurred?

Score: 0.0–1.0 (1.0 = predicted outcome exactly matched, 0.0 = outcome unrecognized)

Scored by reading task completion metadata and comparing against task creation metadata.

Dimension 3: Decision Quality

Measures whether the decisions made during the task were appropriate in retrospect:

  • Did the chosen approach work without significant pivots?
  • Were there rework loops that a better decision would have avoided?
  • Did the agent's confidence match the actual difficulty?

Score: 0.0–1.0 (1.0 = no rework, smooth execution; 0.0 = multiple pivots or failure)

Calibration Record Format

Each outcome-reflection run produces one calibration record:

{
  "taskId": "task-N",
  "taskType": "implementation|planning|estimation|architecture|security",
  "completedAt": "ISO-8601",
  "agentType": "developer|planner|architect|...",
  "predictions": {
    "estimatedTokens": 5000,
    "estimatedFiles": 3,
    "estimatedSteps": 5,
    "predictedOutcome": "Add JWT auth with refresh tokens",
    "predictedBlockers": ["Redis not available"],
    "confidence": "Medium"
  },
  "actuals": {
    "actualTokens": 7200,
    "actualFiles": 5,
    "actualSteps": 8,
    "actualOutcome": "Added JWT auth with refresh tokens; added Redis fallback",
    "actualBlockers": ["Redis not available", "JWT library version mismatch"],
    "reworkLoops": 1
  },
  "scores": {
    "estimationAccuracy": 0.72,
    "predictionQuality": 0.85,
    "decisionQuality": 0.8,
    "overall": 0.79
  },
  "flags": [],
  "notes": "Token estimate was 44% low. Consider 1.5x buffer for JWT auth tasks."
}

Workflow

Step 0: Load Memory and Task Data

# Check calibration history for this agent type
grep -r "outcome-reflection" C:/dev/projects/agent-studio/.claude/context/memory/learnings.md 2>/dev/null | tail -10

Read the completed task's metadata using TaskGet:

const taskData = TaskGet({ taskId: 'task-N' });
// Access: taskData.metadata.predictions, taskData.metadata.actuals

Step 1: Validate Input

node .claude/skills/outcome-reflection/hooks/pre-execute.cjs \
  '{"taskId":"task-N","predictions":{},"actuals":{}}'

Expected output: { "valid": true } or error listing missing fields.

Step 2: Compute Estimation Accuracy Score

For each measurable quantity where a prediction exists:

estimationScore = max(0, 1 - abs(predicted - actual) / max(predicted, actual))

Command to compute:

node .claude/skills/outcome-reflection/scripts/main.cjs \
  --taskId task-N \
  --predicted '{"tokens":5000,"files":3,"steps":5}' \
  --actual '{"tokens":7200,"files":5,"steps":8}'

Expected output: JSON with per-dimension scores and overall score.

Step 3: Score Prediction Quality (Qualitative)

Read task creation metadata (what was predicted qualitatively) and task completion metadata (what actually happened). Score on 0.0–1.0:

| Outcome Match

Полный SKILL.md на GitHub

Установить outcome-reflection в Claude Code и Claude Desktop

Зарегайся, чтобы установить скилл

Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.

  • Открой команду установки в одну строку
  • Сохраняй скиллы в синхронизируемую библиотеку
  • Уведомления, когда скиллы обновляются
Зарегаться бесплатноУ меня уже есть аккаунт

Разрешённые инструменты

Инструменты, которые скиллу разрешено вызывать.

Read
Write
Edit
Bash
Glob
Grep
Skill
MemoryRecord
TaskGet

Вложенные файлы

commands/outcome-reflection.mdhooks/post-execute.cjshooks/pre-execute.cjsreferences/research-requirements.mdrules/outcome-reflection.mdschemas/input.schema.jsonschemas/output.schema.jsonscripts/main.cjstemplates/implementation-template.md

FAQ

Что делает скилл outcome-reflection?

Feed actual task results back into agent memory for calibration. Compares predicted vs actual outcomes, records accuracy scores, and tracks estimation quality, prediction quality, and decision quality over time to improve future agent performance.

Как установить скилл outcome-reflection?

Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.

Скилл outcome-reflection запускает скрипты?

Да, скилл несёт исполняемые скрипты. Проверь исходник перед установкой.

Похожие скиллы

Сравнить outcome-reflection с