post-run-analysis
Skill5 starsChanged 8 months agoMITView on GitHub
Automatic post-mortem analysis — parses logs, compares with history, identifies recurring patterns, proposes fixes, updates memory. Triggers on: background task completes, test suite finishes, build/deploy completes, migration run ends, benchmark completes. Use when: analyze, post-mortem, what happened, evaluate results, what went wrong, compare runs, run history, run report.
- Reads credentials
In this repository29 other files it gives its agents.
- skills/architect/CLAUDE.mdCLAUDE.md
- skills/council/CLAUDE.mdCLAUDE.md
- agent-browserSkill
- app-store-screenshotsSkill
- architectSkill
- architecture-reviewerSkill
- c-cpp-analyzerSkill
- councilSkill
- c-to-rust-migrationSkill
- demo-pipelineSkill
- e2e-pipelineSkill
- founder-modeSkill
- full-evalSkill
- hackathon-jurySkill
- idea-labSkill
- ios-glass-ui-designerSkill
- learn-by-mistakeSkill
- maestro-mobile-testingSkill
- migration-validatorSkill
- mobile-design-systemSkill
- noricum-devSkill
- oss-readinessSkill
- pdf-presentationSkill
- playwright-recordingSkill
- rust-migrationSkill
- ui-ux-polishSkill
- vc-evaluatorSkill
- webreelSkill
- youtube-devrelSkill
The file
Show its rules and text
We split this skill into the rules it gives an agent
19 rules. About 0 are common, 17 are distinctive, and 2 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈17
Distinctive · estimate
This author's own choices. Worth a look.
2
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 24
After ANY of these events:
- Distinctive: line 26
Run the full 5-phase analysis protocol
- Distinctive: line 44
After any process that logs structured output (compiler errors, test results, timing data)
- Distinctive: line 73
Find the log: Look for the most recent log file (run output, build log, test results).
- Distinctive: line 119
Not every finding should be persisted to memory.
- Distinctive: line 153
Default to redacting. False positives are harmless.
- Distinctive: line 154
When in doubt, ask the user before persisting.
- Distinctive: line 161
Update warm-start/artifacts: if this run produced better intermediate results
- Distinctive: line 162
Update skill files: if learnings affect project conventions
- Distinctive: line 209
Do not just list errors -- categorize them and check if they are recurring
- Distinctive: line 210
Do not skip the comparison with previous runs -- trends matter more than snapshots
- Very specific: line 211
Do not update memory with every small detail -- only FIXABLE and NEEDS_INVESTIGATION findings
- Distinctive: line 212
Do not recommend changes without checking if a fix already exists
- Distinctive: line 213
Do not claim improvement without verifying (syntax errors can mask real error counts)
- Distinctive: line 214
Do not persist FIXED or ACCEPTED findings to memory -- they belong in the run report only
- Distinctive: line 215
Do not write secrets, tokens, or absolute paths to persistent files -- sanitize first
- Distinctive: line 228
Run history files should be committed to the repository so analysis persists across sessions.
- Very specific: line 233
When a FIXABLE finding is also a recurring error, suggest creating a lesson via /learn.
- Distinctive: line 234
Run history provides the data that proves whether a lesson's fix actually worked.
≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Post-Run Analysis
<CRITICAL>
This skill is ALWAYS ACTIVE. You do not wait for the user to say "analyze". Every time one of the following events occurs, you MUST follow the analysis protocol below AUTOMATICALLY. This is not optional. This is your core behavior whenever this skill is loaded.Trigger events:
- A background task completes (you receive a task completion notification)
- A test suite finishes (jest, vitest, pytest, cargo test, go test, etc.)
- A build or deploy completes (webpack, vite, docker build, cargo build, etc.)
- A migration run ends (database migration, code migration, data migration)
- A benchmark or performance test completes
- Any long-running process that produces structured output finishes
After ANY of these events:
- Locate the output/log from the completed process
- Run the full 5-phase analysis protocol
- Present the results to the user
- Persist findings according to the confidence gate rules
This applies even if the user did not ask for analysis. If a run completes, you act.
</CRITICAL>
Analyze completed iterative runs, extract learnings, compare with history, and close the feedback loop automatically.
Why This Exists
Iterative processes (code migration, test suites, deployments, benchmarks) produce valuable data that gets lost because nobody systematically reviews it. This skill ensures every run's lessons get captured, compared, and fed back into the next iteration -- turning trial-and-error into structured improvement.
When To Use
- A migration/build/test run just completed (background task notification or log file)
- User asks "what happened" or "analyze the results"
- User wants to compare this run vs previous runs
- After any process that logs structured output (compiler errors, test results, timing data)
- Proactively: when you see a completed background task with a log file
Run History Schema
Track every analyzed run in a standard format. Store in MEMORY.md or a dedicated .claude/run-history.md file:
## Run History
| # | Date | Target | Duration | Pass/Fail | Key Metric | Delta |
|---|------|--------|----------|-----------|------------|-------|
| 7 | 2026-03-17 | test-suite | 42s | PASS | 98% coverage | +2% |
| 6 | 2026-03-16 | test-suite | 51s | FAIL | 96% coverage | -1% |
| 5 | 2026-03-15 | migration | 3m12s | PASS | 847/900 files | +23 |Schema Rules
- #: Auto-incrementing run number, scoped per target
- Date: ISO date (YYYY-MM-DD)
- Target: Short identifier for what ran (test-suite, migration, build, deploy, benchmark-name)
- Duration: Wall-clock time
- Pass/Fail: Binary outcome based on exit code or threshold
- Key Metric: The single most important number for this run type
- Delta: Change from previous run of the same target (use
--for first run)
The Analysis Protocol
Phase 1: Gather Data
- Find the log: Look for the most recent log file (run output, build log, test results). Common locations:
run*-output.login project root- Background task output files
- Project artifact directories (
.artifacts/,build/,output/,dist/, etc.) - CI/CD output
- stdout/stderr from the just-completed process
- Extract key metrics from the log:
- Duration / timing
- Success/failure counts
- Error categories and counts
- Resource usage (API calls, tokens, cost)
- Any scores or quality metrics
- Find artifacts: Intermediate outputs, best versions, manifests
Phase 2: Compare With History
- Load run history from project memory (MEMORY.md,
.claude/run-history.md, or equivalent) - Build comparison table: This run vs previous runs on same target
- Identify trends: Improving? Regressing? Stalled?
- Flag anomalies: Unexpectedly good/bad results vs baseline
Phase 3: Error Pattern Analysis
- Categorize errors by type (group by error code, message pattern)
- Identify recurring errors that appear across multiple runs
- For each recurring error: Is there an existing fix? Was it supposed to be fixed? Did the fix regress?
- Distinguish root causes from symptoms: Syntax errors can mask semantic errors. Count errors AFTER fixing syntax first.
Phase 4: Actionable Recommendations
Classify each finding as one of:
- FIXED: Already have a fix/rule for this -- verify it is working
- FIXABLE: Clear pattern that can be automated (new rule, prompt change, config tweak)
- NEEDS_INVESTIGATION: Unclear root cause, needs deeper analysis
- ACCEPTED: Known limitation, not worth fixing now
For FIXABLE items, propose specific changes:
- Which file to modify
- What the fix looks like
- Expected impact
Confidence Gate for Persistence
Not every finding should be persisted to memory. Apply this filter:
- FIXABLE: Persist to memory. These are actionable and should be tracked.
- NEEDS_INVESTIGATION: Persist to memory. These need follow-up and should not be forgotten.
- FIXED: Note in the run report only. Do not persist -- the fix already exists.
- ACCEPTED: Note in the run report only. Do not persist -- consciously accepted trade-offs do not need tracking.
This keeps memory lean. Only items that require future action get stored.
Phase 4.5: Secret Sanitization
Before writing ANY content to memory, run history, or persistent files, scan every field for secrets and redact them. This is non-negotiable. Run reports and history files may be committed to version control.
Patterns to detect and redact:
| Pattern | Example | Replacement |
| API keys | sk-proj-abc123..., sk-ant-... | <REDACTED_API_KEY> |
| GitHub tokens | ghp_xxxx, github_pat_xxxx | <REDACTED_GITHUB_TOKEN> |
| AWS keys | AKIA..., aws_secret_access_key=... | <REDACTED_AWS_KEY> |
| Bearer tokens | Bearer eyJhb... | Bearer <REDACTED_TOKEN> |
| Generic tokens | token: abc123..., token=abc123... | token: <REDACTED> |
| Passwords | password=secret123 | password=<REDACTED> |
| Connection strings | postgres://user:pass@host/db | <REDACTED_CONNECTION_STRING> |
| MongoDB URIs | mongodb://user:pass@... | <REDACTED_CONNECTION_STRING> |
| Redis URIs | redis://:pass@host | <REDACTED_CONNECTION_STRING> |
| Absolute home paths | /home/username/..., /Users/name/... | <PROJECT_PATH>/... |
| Email addresses | user@domain.com | <REDACTED_EMAIL> |
| Internal IP addresses | 192.168.x.x, 10.x.x.x | <REDACTED_IP> |
| Private keys | -----BEGIN RSA PRIVATE KEY----- | <REDACTED_PRIVATE_KEY> |
| JWT tokens | eyJhbG... (3-part base64) | <REDACTED_JWT> |
| High-entropy strings | Base64 blobs, hex strings > 20 chars | <REDACTED_SECRET> |
If uncertain whether something is a secret:
- Default to redacting. False positives are harmless; leaked secrets are not.
- When in doubt, ask the user before persisting.
Phase 5: Update Memory & Artifacts
- Update project memory with run results (add to MEMORY.md or equivalent)
- Update run history table (append new row to the run history schema)
- Save new learnings as memory files if they are novel -- only FIXABLE and NEEDS_INVESTIGATION findings
- Update warm-start/artifacts if this run produced better intermediate results
- Update skill files if learnings affect project conventions
Output Format
Present the analysis as:
## Run [N] Analysis: [target name]
### Metrics
| Metric | This Run | Previous Best | Delta |
|--------|----------|---------------|-------|
| ... | ... | ... | ... |
### Error Breakdown
| Error Type | Count | Recurring? | Status |
|------------|-------|------------|--------|
| ... | ... | ... | FIXED/FIXABLE/... |
### Recommendations
1. [FIXABLE] Description -- File: path, Change: what
2. [NEEDS_INVESTIGATION] Description -- Why unclear
3. ...
### Memory Updates
- [x] Run history updated (#N)
- [x] New finding persisted: description
- [ ] Warm-start updated (if better than previous)
### Ready for Next Run?
[Yes/No] -- [what needs to change first]Adapting to Different Project Types
This skill is generic. Adapt the metrics and error analysis to the project:
- Code migration: errors = compiler errors, metrics = LOC/score/unsafe count
- Test suites: errors = test failures, metrics = pass rate/coverage/timing
- Deployments: errors = deploy failures, metrics = uptime/latency/rollback count
- Benchmarks: errors = N/A, metrics = performance numbers/regression detection
- Build pipelines: errors = build failures, metrics = build time/artifact size/warnings
The key principle is the same: extract -> compare -> categorize -> recommend -> persist.
Anti-Patterns
- Do not just list errors -- categorize them and check if they are recurring
- Do not skip the comparison with previous runs -- trends matter more than snapshots
- Do not update memory with every small detail -- only FIXABLE and NEEDS_INVESTIGATION findings
- Do not recommend changes without checking if a fix already exists
- Do not claim improvement without verifying (syntax errors can mask real error counts)
- Do not persist FIXED or ACCEPTED findings to memory -- they belong in the run report only
- Do not write secrets, tokens, or absolute paths to persistent files -- sanitize first
Slash Commands Reference
| Command | Action |
/analyze | Force analysis of the most recent run |
/runs | Browse run history, show trends and comparisons |
/compare <run1> <run2> | Compare two specific runs side by side |
Integration Notes
With version control
- Run history files should be committed to the repository so analysis persists across sessions.
- Sanitization ensures no secrets leak into committed files.
With learn-by-mistake
- Post-run-analysis identifies error patterns; learn-by-mistake captures the lessons.
- When a FIXABLE finding is also a recurring error, suggest creating a lesson via
/learn. - Run history provides the data that proves whether a lesson's fix actually worked.
With other skills
- This skill is reactive -- it activates on run completion events, not on explicit invocation (though
/analyzeforces it). - It cooperates with any build, test, or deployment workflow.
- It does not interfere with process output or runners.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

