一键导入
refacil-stats
Show statistics for a change — token savings, review history, compact and CodeGraph telemetry; optional narrative interpretation
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Show statistics for a change — token savings, review history, compact and CodeGraph telemetry; optional narrative interpretation
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
Guided complete flow to investigate and fix bugs — delegates investigation and fix to the refacil-debugger sub-agent in two passes separated by user confirmation
Internal reference — SDD-AI prerequisites shared by all other refacil skills (do not invoke manually)
Validate that the implementation meets the specs — builds a briefing with testCommand and CA/CR criteria, delegates to the refacil-validator sub-agent for the report, and handles corrections with user approval
Implement the tasks of a proposed change — verifies artifacts and working branch, builds a structured briefing, and delegates to the refacil-implementer sub-agent to execute the implementation in isolated context
Archive a completed change — move artifacts to archive and sync specs
Run the SDD implementation cycle autonomously after /refacil:propose was approved by the human — chains apply → test → verify → review → archive → up-code in a single invocation, and notifies the user via WhatsApp through Kapso when finished (success or failure). Use when the user says "autopilot", "ejecuta el resto del flujo", "termina solo", "modo autónomo", or indicates they will step away from the computer.
| name | refacil:stats |
| description | Show statistics for a change — token savings, review history, compact and CodeGraph telemetry; optional narrative interpretation |
| user-invocable | true |
This skill is a read-only utility that surfaces observability data for a given change. It is optional — it does not block or affect any existing flow. Run it at any point to understand how a change is progressing or has progressed.
Prerequisites: sdd profile from refacil-prereqs/SKILL.md.
$ARGUMENTS provides a change name, use it directly.refacil-sdd-ai sdd list --json and use the single active change if there is only one.
2.5. If sdd list --json returns [] (no active changes), auto-select the most recent archived change:
refacil-sdd-ai sdd list --include-archived --json.archived is true. Sort descending by archivedDate (tiebreak: name descending). Select the first item.<name>") and continue to Step 2 with that changeName.If the change name is given but not found in the active changes, do not suggest /refacil:propose. Instead:
refacil-sdd-ai sdd list --include-archived --json to check for archived changes.Execute:
refacil-sdd-ai sdd stats <changeName> --json
If the command exits with code 1 (change not found or invalid name), show the CLI error message. The step 1 fallback (archived lookup) should have already been applied before reaching here, so a code 1 at this point means the name is genuinely absent in both active and archived locations — inform the user and stop.
Parse the JSON block returned by the CLI. Expected fields:
{
"changeName": "<name>",
"isArchived": true | false,
"archivedDate": "<YYYY-MM-DD or null>",
"startDate": "<ISO timestamp or null>",
"memory": {
"testCommand": "<command or null>",
"lastStep": "<step or null>",
"criteriaRun": ["CA-01", "CR-01", ...],
"currentState": "<state or null>",
"stateInferred": true | false
},
"review": {
"passed": true | false,
"verdict": "<verdict or null>",
"date": "<ISO timestamp or null>",
"failCount": <int>
},
"compact": {
"eventsInPeriod": <int>,
"rewrites": <int>,
"estimatedTokensSavedByRewrites": <int>,
"alreadyCompact": <int>,
"estimatedTokensSavedAlreadyCompact": <int>
},
"codegraph": {
"eventsInPeriod": <int>,
"totalToolCalls": <int>,
"estimatedTokensSaved": <int>
}
}
If any field is null or 0, treat it as "no data" — do not error.
Present the data in a readable format. If isArchived is true, add [archivado el <archivedDate>] to the header:
=== Stats: <changeName> [archivado el <archivedDate>] === ← only when isArchived: true
=== Stats: <changeName> === ← when isArchived: false
Phase progress
Started: <startDate or "unknown">
Current state: <currentState or "unknown"> <(inferred) if stateInferred is true>
Last step: <lastStep or "not recorded">
Criteria: <criteriaRun list or "none">
Review
Passed: <yes/no>
Verdict: <verdict or "pending">
Date: <date or "—">
Fail count: <failCount>
Token savings (change period)
Compact rewrites: <rewrites> events — ~<estimatedTokensSavedByRewrites> tokens saved
Already compact: <alreadyCompact> events — ~<estimatedTokensSavedAlreadyCompact> tokens (skill discipline)
CodeGraph tool calls: <totalToolCalls> — ~<estimatedTokensSaved> tokens saved
After the numbers, add a brief narrative. Apply these heuristics:
Anomalous passes: if review.passed is true but memory.criteriaRun is empty or memory.lastStep is apply (no test phase recorded) — flag this:
Note: the change was reviewed but no test phase is recorded in memory. Recommend running /refacil:test before archiving.
Token concentration: if compact.estimatedTokensSavedByRewrites is 0 and codegraph.estimatedTokensSaved is also 0 — flag this:
Note: no token savings recorded for this change. Compact and CodeGraph telemetry may not be active.
Comparison with previous changes (optional — only if data exists):
refacil-sdd/changes/ that have memory.yaml.criteriaRun data, compute the average criteria count and compare:
This change ran <N> criteria vs. an average of <avg> in previous changes.
No anomalies: if none of the above apply, show:
No anomalies detected. The change looks healthy.
Skip this step entirely if isArchived === true — archived changes have no actionable next steps.
If memory.lastStep is apply (no test yet):
Recommended next step: /refacil:test
If memory.lastStep is test and review.passed is false:
Recommended next step: /refacil:verify
If review.passed is true:
The change is reviewed. Next step: /refacil:archive (if all tasks are done).