
Metacognitive Self Mod
Capture execution traces and feed metacognitive self-modification so your agent improves playbooks from real tool sequences and outcomes—not only aggregate scores.
Install
npx skills add https://github.com/athola/claude-night-market --skill metacognitive-self-modWhat is this skill?
- Parent abstract for trace-capture: records tool sequences, decision points, and outcome attribution per skill invocation
- Trace JSON uses shared session-capture envelope (schema_version session-capture/1) for one parser across friction and tr
- Informed by Microsoft Trace-style propagation, trajectory-informed memory (arXiv 2603.10600), and ACE generation/reflect
- Child trace-capture lists metacognitive-self-mod dependency and decision-only capture_mode option
Adoption & trust: 1 installs on skills.sh; 304 GitHub stars; 3/3 security scanners passed (skills.sh audits); trending (+100% hot-view momentum).
Recommended Skills
Journey fit
Operate iterate is the canonical shelf for continuous learning loops; the parent skill governs how agents reflect on runs and adjust behavior over time. iterate subphase matches trace-backed attribution, session envelopes, and evolving playbooks rather than one-off build or launch tasks.
Common Questions / FAQ
Is Metacognitive Self Mod safe to install?
skills.sh reports 3 of 3 security scanners passed. Review the Security Audits panel on this page before installing in production.
SKILL.md
READMESKILL.md - Metacognitive Self Mod
# Execution Trace Capture Record execution traces so that metacognitive-self-mod can analyze concrete decision sequences, not just aggregate metrics. Inspired by Microsoft Trace (AutoDiff-like backward propagation through execution traces), Trajectory-Informed Memory Generation (arXiv 2603.10600, decision attribution from trajectories), and the ACE framework (evolving playbooks via generation, reflection, and curation). ## Trace Structure Each trace captures a single skill invocation from start to finish. The trace body sits inside the shared session-capture envelope (ADR-0011) so friction signals and traces can be consumed through one parser: ```json { "schema_version": "session-capture/1", "session_id": "2026-04-14-abc12345", "timestamp": "2026-04-14T10:30:00Z", "source": "trace-capture", "payload": { "trace_id": "session-{date}-{hash}", "skill": "attune:project-execution", "started": "2026-04-14T10:30:00Z", "completed": "2026-04-14T10:32:15Z", "outcome": "success", "capture_mode": "decision-only", "steps": [ { "tool": "Read", "target": "src/main.py", "purpose": "understand entry point", "result": "success", "tokens_used": 1200, "decision_point": false }, { "tool": "Edit", "target": "src/main.py:45", "purpose": "add error handling", "result": "success", "tokens_used": 800, "decision_point": true, "alternatives_considered": [ "try/except", "result type", "assertion" ], "rationale": "try/except matches existing patterns" } ], "attribution": { "success_factors": [ "followed existing patterns", "tested incrementally" ], "failure_factors": [], "key_decisions": [ "chose try/except over result type at step 4" ] } } } ``` Legacy traces written before envelope adoption are read as ``session-capture/0`` (entire file treated as the payload). See ``docs/adr/0011-session-capture-envelope.md`` for the contract and migration path. ## Capture Modes Not every invocation needs a full trace. Three modes control the recording fidelity. | Mode | Records | When to use | |------|---------|-------------| | `minimal` | Outcome and duration only | High-trust T3 skills | | `decision-only` | Decision points, outcome, duration | Default for all skills | | `full` | Every tool call, token counts, all fields | Skills with <85% success rate | **Mode selection logic:** - Default: `decision-only` (captures rationale without flooding storage). - Enable `full` with `--trace=full` or automatically for any skill whose rolling success rate falls below 85%. - Use `minimal` for T3 skills that consistently succeed and need only aggregate trend data. ## What to Capture - **Tool calls** (full mode only): tool name, target, purpose, result, approximate tokens consumed. - **Decision points** (all modes except minimal): alternatives considered (2-5), rationale for the chosen option, whether later revised. - **Trace completion** (all modes): overall outcome (`success`/`failure`/`partial`), wall-clock duration, total tokens consumed. ## Attribution Analysis After a trace completes, run backward attribution to identify which decisions drove the outcome. This follows the Microsoft Trace principle of propagating feedback backward through the execution path. **For successful traces:** 1. Identify decisions that aligned with known success patterns (from `improvement_memory.json`). 2. Flag novel successfu