[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M7FD2RBKNFCHDF0N5S1Y3AMS":3,"skill-same:01M7FD2RBKNFCHDF0N5S1Y3AMS":48},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":16,"categories":17,"keywords":18,"publishedAt":19,"linkOnly":20,"markdownContent":21,"markdownBody":22,"frontMatter":23,"refName":26,"commitSha":27,"skillDirectory":28,"forksCount":29,"repositoryHtmlUrl":30,"repositoryHomepageUrl":6,"ownerHtmlUrl":31,"ownerBlogUrl":6,"ownerDescription":32,"updatedAt":33,"install":34,"resources":47},"01M7FD2RBKNFCHDF0N5S1Y3AMS","meta-optimize",null,"Analyze ARIS usage logs and propose optimizations to SKILL.md files, reviewer prompts, and workflow defaults. Outer-loop harness optimization inspired by Meta-Harness (Lee et al., 2026). Use when user says \"优化技能\", \"meta optimize\", \"improve skills\", \"分析使用记录\", or wants to optimize ARIS's own harness components based on accumulated experience.","CZX-LBJ\u002Fdeepseek-science","CZX-LBJ","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F204594689?v=4","01M7FC59WQ9PFXT04MKGJDCFFT","czx","01M7FC59XB2GW0BKWN9JTDBQS7",1,"MIT","https:\u002F\u002Fgithub.com\u002FCZX-LBJ\u002Fdeepseek-science\u002Fblob\u002Fmain\u002Fpackages\u002Fskill\u002Fskill-science\u002Fassets\u002Fsources\u002Faris\u002Fskills\u002Fmeta-optimize\u002FSKILL.md",[],[],"2026-11-16 10:05:34",false,"---\nname: meta-optimize\ndescription: \"Analyze ARIS usage logs and propose optimizations to SKILL.md files, reviewer prompts, and workflow defaults. Outer-loop harness optimization inspired by Meta-Harness (Lee et al., 2026). Use when user says \\\"优化技能\\\", \\\"meta optimize\\\", \\\"improve skills\\\", \\\"分析使用记录\\\", or wants to optimize ARIS's own harness components based on accumulated experience.\"\nargument-hint: \"[target-skill-or-all]\"\nallowed-tools: Bash(*), Read, Grep, Glob, mcp__codex__codex, mcp__codex__codex-reply\n---\n\n# Meta-Optimize: Outer-Loop Harness Optimization for ARIS\n\nAnalyze accumulated usage logs and propose optimizations for: **$ARGUMENTS**\n\n## Privilege boundary — this skill is a READ-ONLY PRODUCER\n\nmeta-optimize **proposes**; it does not **land**. The mutation of the skill corpus\nis the exclusive job of a separate, human-invoked skill: [`\u002Fmeta-apply`](..\u002Fmeta-apply\u002FSKILL.md).\nThis split is structural, not advisory — it is why a missed instruction cannot let\nthis loop apply its own patch (the self-acquittal failure mode):\n\n- **No `Write`\u002F`Edit` tool.** This skill cannot edit a SKILL.md \u002F shared-reference \u002F\n  any corpus file with the frictionless mutators. Its only outputs are the REPORT and\n  staged patch files, written under `.aris\u002Fmeta\u002F` (a scratch area, never the corpus).\n- **No apply step.** There is no in-skill \"apply the patch\" path (see Step 6). The\n  producer ends by *staging* approved patches for `\u002Fmeta-apply`; a human must then\n  invoke `\u002Fmeta-apply` to land them. That human action is the landing gate.\n- **`Bash` writes to the corpus are filtered, not impossible — be honest about the\n  layers.** What IS fully closed: the *accidental \u002F in-flow* self-acquittal — this skill\n  has no `Write`\u002F`Edit` and no apply step, so an honest run cannot slip into editing the\n  corpus. Defense-in-depth: install the\n  [`corpus_write_guard`](..\u002F..\u002Ftemplates\u002Fclaude-hooks\u002Fcorpus_write_guard.json) PreToolUse\n  hook (like `meta_logging.json`), which DENIES the common Bash shell-writes (`>`, `tee`,\n  `sed -i`, `cp`\u002F`mv`, `touch`, `open(...,'w')`) to corpus paths. **This is a blacklist,\n  NOT a complete sandbox** — a *deliberately* obscured Bash write (`git apply`, `patch`,\n  `$var`\u002Fabsolute paths, language file APIs) is not all caught. **Full structural\n  prevention requires either removing this skill's `Bash` or an FS sandbox** — over-built\n  for a not-yet-load-bearing producer, so deferred to when the gate carries real\n  auto-modification volume (a brick-3 trigger). The intended backstop against a deliberate\n  write is **detection, not prevention** — a corpus change with no valid\u002Fcurrent\n  `provenance` stamp (content-hash mismatch) *would be* catchable in a pre-push integrity\n  check — but that verifier is **NOT yet built** (`provenance.py` has `content_hash` but no\n  integrity-check subcommand, and no pre-push hook runs one). So today the deliberate-write\n  case is neither prevented nor actively detected; track the integrity verifier as a\n  follow-up before this producer goes load-bearing. Its legitimate Bash writes go only to\n  `.aris\u002Fmeta\u002F`.\n\nSee [`shared-references\u002Facceptance-gate.md`](..\u002Fshared-references\u002Facceptance-gate.md):\na loop can DRIVE (propose, review) same-model, but the ACQUITTAL that lands a change\nmust be cross-model (Step 4 jury) **and** the landing must be a separate human-gated\nact (`\u002Fmeta-apply`).\n\n## Context\n\nARIS is a **research harness** — a system of skills, bridges, workflows, and artifact contracts that wraps around LLMs to orchestrate research. This skill implements a prototype **outer loop** that observes how the harness is used and proposes improvements to the harness itself (not to the research artifacts it produces).\n\nInspired by Meta-Harness (Lee et al., 2026): the key insight is that harness design matters as much as model weights, and harness engineering can be partially automated by logging execution traces and using them to guide improvements.\n\n## What This Skill Optimizes (Harness Components)\n\n| Component | Example | Optimizable? |\n|-----------|---------|:---:|\n| SKILL.md prompts | Reviewer instructions, quality gates, step descriptions | Yes |\n| Default parameters | `difficulty: medium`, `MAX_ROUNDS: 4`, `threshold: 6\u002F10` | Yes |\n| Convergence rules | When to stop the review loop, retry counts | Yes |\n| Workflow ordering | Skill chain sequence within a workflow | Yes |\n| Artifact schemas | What fields go in EXPERIMENT_LOG.md, idea-stage\u002FIDEA_REPORT.md | Cautious |\n| MCP bridge config | Which reviewer model, routing rules | No (infra) |\n\n**Not optimized**: The research artifacts themselves (papers, code, experiments). That's what the regular workflows do.\n\n## Prerequisites\n\n1. **Logging must be active.** Copy `templates\u002Fclaude-hooks\u002Fmeta_logging.json` into your project's `.claude\u002Fsettings.json` (or merge the hooks section).\n2. **Sufficient data.** At least 5 complete workflow runs logged in `.aris\u002Fmeta\u002Fevents.jsonl`. The skill will check and warn if insufficient.\n\n## Workflow\n\n### Step 0: Check Data Availability\n\n```bash\nEVENTS_FILE=\".aris\u002Fmeta\u002Fevents.jsonl\"\nif [ ! -f \"$EVENTS_FILE\" ]; then\n    echo \"ERROR: No event log found at $EVENTS_FILE\"\n    echo \"Enable logging first: copy templates\u002Fclaude-hooks\u002Fmeta_logging.json into .claude\u002Fsettings.json\"\n    exit 1\nfi\n\nEVENT_COUNT=$(wc -l \u003C \"$EVENTS_FILE\")\nSKILL_INVOCATIONS=$(grep -c '\"skill_invoke\"' \"$EVENTS_FILE\" || echo 0)\nSESSIONS=$(grep -c '\"session_start\"' \"$EVENTS_FILE\" || echo 0)\n\necho \"📊 Event log: $EVENT_COUNT events, $SKILL_INVOCATIONS skill invocations, $SESSIONS sessions\"\n\nif [ \"$SKILL_INVOCATIONS\" -lt 5 ]; then\n    echo \"⚠️  Insufficient data (\u003C5 skill invocations). Continue using ARIS normally and re-run later.\"\n    exit 0\nfi\n\n# Bottleneck succession: what did the LAST cycle say was the limiting stage?\nBOTTLENECK_LOG=\".aris\u002Fmeta\u002Fbottleneck_log.jsonl\"\nif [ -f \"$BOTTLENECK_LOG\" ]; then\n    echo \"🧭 Prior cycle's bottleneck: $(tail -1 \"$BOTTLENECK_LOG\")\"\nfi\n```\n\nIf a prior bottleneck entry exists, open the report (Step 5) by stating whether\nthat named bottleneck was **resolved** (and by which landed patches) and what it\nhas now **moved to** — bottleneck SUCCESSION, not just existence, is the signal\nthis ledger exists to carry.\n\n### Step 1: Analyze Usage Patterns\n\nRead `.aris\u002Fmeta\u002Fevents.jsonl` and compute:\n\n**Frequency analysis:**\n- Which skills are invoked most often?\n- Which slash commands do users type most?\n- What parameter overrides are most common? (These suggest bad defaults.)\n\n**Failure analysis:**\n- Which tools fail most often? In which skills?\n- What error patterns repeat? (OOM, import, compilation, timeout)\n- How many auto-debug retries per workflow run?\n\n**Convergence analysis (for auto-review-loop):**\n- Average rounds to reach threshold\n- Score trajectory shape (fast improvement? plateau? oscillation?)\n- Which review round catches the most critical issues?\n- Do users override difficulty mid-run?\n\n**Human intervention analysis:**\n- Where do users interrupt with manual prompts during workflows?\n- What manual corrections do users make most? (These indicate skill gaps.)\n\n**Model-delta analysis (harness diet):**\n- Has the session model (`session_start` events' `model` field) or the pinned\n  reviewer model changed since a skill's SKILL.md was last touched?\n  (`git log -1 --format=%cs -- skills\u002F\u003Cskill>\u002FSKILL.md` vs the model-bump date.)\n- A model bump is a **trigger to re-read, not evidence by itself**. For each\n  reasoning-scaffolding step or worked example in that SKILL.md, a deletion\n  proposal must cite TARGET-SPECIFIC evidence that the new model no longer\n  needs it: a capability-specific release note, or repeated observed behavior\n  in the event log (e.g. zero failures\u002Finterventions in the guarded step since\n  the bump). \"The model got newer\" alone never justifies a deletion.\n- **Never deletion candidates**, regardless of model: privilege boundaries,\n  acceptance\u002Freview gates, corpus- and provenance-integrity rules, output\n  contracts, and safety checks. The diet targets model-compensation scaffolding\n  only — a capability the new model has natively is pure overhead (context\n  weight, drift surface, reading cost). A harness that only ever grows is a\n  harness nobody is re-reading.\n\n**Trigger-rate analysis (optional, measured — not from the event log):**\n- The event log shows which skills were USED, not which were WANTED-but-omitted\n  — the omission failure mode (Claude Code passing over the right skill when the\n  installed list is long) is invisible to it. `tools\u002Fmeta_opt\u002Ftrigger_eval.py`\n  measures it directly: `claude -p` probes with paraphrased-intent queries run\n  from a neutral cwd (so the realistic long installed corpus is loaded), scored\n  as trigger \u002F confusion(→which skill) \u002F miss.\n- Run it when a specific skill is suspected of under- or mis-triggering, or as a\n  before\u002Fafter check around a description edit:\n  `python3 tools\u002Fmeta_opt\u002Ftrigger_eval.py --eval-file tools\u002Fmeta_opt\u002Ftrigger_evals.sample.json --skills \u003Cname> --samples 2`\n- The **confusion matrix is the signal**, not just the rate: a query that keeps\n  landing on a sibling skill means the two descriptions overlap on that intent —\n  the fix is disambiguation, not \"make the description pushier\".\n- **Measure-only, evidence not verdict.** A low trigger rate is an INPUT to a\n  Step-2 proposal (which lands only via `\u002Fmeta-apply`), never a self-applied\n  description rewrite. Trigger rate is model-dependent, so compare like with\n  like (record the probe model) and treat it as a proxy — it measures selection\n  under a query set, not the full long-list omission problem.\n\nPresent findings as a structured summary table.\n\n### Step 1.5: Name the Current Bottleneck\n\nSynthesize the Step-1 analyses into **one sentence naming the single\nmost-limiting pipeline stage right now** — e.g. \"planning\", \"verification\nquality\", \"experiment execution reliability\", \"writing polish\" — with the\nsupporting evidence. The bottleneck always moves: when coding stops being the\nconstraint, planning becomes it; when planning is solved, verification; when\nverification is automated, taste. This step exists to make the CURRENT\nconstraint visible, so Step 2's ranked table reads as sub-fixes for one named\nconstraint instead of scattered tweaks.\n\nAppend the verdict to the append-only ledger `.aris\u002Fmeta\u002Fbottleneck_log.jsonl`\n(same never-mutate discipline as `.aris\u002Fruns\u002F\u003Crun_id>.iterations.jsonl`):\n\n```bash\nmkdir -p .aris\u002Fmeta\n# json.dumps, NOT hand-interpolated shell strings: bottleneck\u002Fevidence are\n# natural language — a stray quote must not break the JSONL (or the shell).\npython3 - \u003C\u003C'PY'\nimport json, datetime\nentry = {\n    \"ts\": datetime.datetime.now().astimezone().isoformat(timespec=\"seconds\"),\n    \"cycle\": 3,\n    \"bottleneck\": \"verification quality\",\n    \"evidence\": \"review rounds plateau at 6\u002F10 while tool failures are rare\",\n    \"top_patch_ids\": [\"P1\", \"P2\"],\n}\nwith open(\".aris\u002Fmeta\u002Fbottleneck_log.jsonl\", \"a\", encoding=\"utf-8\") as fh:\n    fh.write(json.dumps(entry, ensure_ascii=False) + \"\\n\")\nPY\n```\n\nNever edit or delete prior lines — succession history is the point.\n\n### Step 2: Identify Optimization Targets\n\nBased on Step 1, rank optimization opportunities by expected impact:\n\n```markdown\n## Optimization Opportunities (ranked)\n\n| # | Target | Signal | Proposed Change | Expected Impact |\n|---|--------|--------|-----------------|-----------------|\n| 1 | auto-review-loop default threshold | Users override to 7\u002F10 in 60% of runs | Change default from 6\u002F10 to 7\u002F10 | Fewer manual overrides |\n| 2 | experiment-bridge retry count | 40% of runs hit max retries on OOM | Add OOM-specific recovery (reduce batch size) | Fewer failed experiments |\n| 3 | paper-write de-AI patterns | Users manually fix \"delve\" in 80% of runs | Add \"delve\" to default watchword list | Fewer manual edits |\n| 4 | experiment-bridge Phase-2 hand-holding steps | Model bump (session_start model changed); scaffold untouched since 2 generations ago; zero tool_failures in the steps it guards | **DELETE steps N–M — the new model does this unprompted** | Smaller harness, less drift surface |\n```\n\nThe Proposed-Change column is explicitly allowed to be a **deletion** — \"DELETE\nstep N, new model does this for free\" is a first-class optimization, ranked by\nthe same impact logic as additions.\n\nIf `$ARGUMENTS` specifies a target skill, focus analysis on that skill only.\nIf `$ARGUMENTS` is empty or \"all\", analyze all skills with sufficient data.\n\n### Step 3: Generate Patch Proposals\n\nFor each optimization target, generate a concrete diff:\n\n```diff\n--- a\u002Fskills\u002Fauto-review-loop\u002FSKILL.md\n+++ b\u002Fskills\u002Fauto-review-loop\u002FSKILL.md\n@@ -15,7 +15,7 @@\n ## Constants\n \n-- **SCORE_THRESHOLD = 6** — Minimum review score to accept.\n+- **SCORE_THRESHOLD = 7** — Minimum review score to accept. (Raised based on usage data: 60% of users overrode to 7+.)\n```\n\n**Rules for patch generation:**\n- One patch per optimization target\n- Each patch must include a comment explaining WHY (with data from the log)\n- Patches must be minimal — change only what the data supports\n- Never change artifact schemas or MCP bridge config in v1\n- Never change behavior that would break existing user workflows\n- **Anti-self-poisoning screen** (see [`shared-references\u002Fcapture-antipatterns.md`](..\u002Fshared-references\u002Fcapture-antipatterns.md)):\n  run a proposed patch's rationale through `tools\u002Fcapture_filter.py` (resolve via\n  the canonical chain). NEVER propose a change that encodes a **negative\n  tool-capability claim** (\"codex can't…\", \"gemini is broken\") or a **one-off \u002F\n  transient failure** as a durable rule — those harden into self-cited refusals.\n  Encode the *fix \u002F the flag needed \u002F the workaround*, not \"X can't do Y\".\n\n### Step 4: Cross-Model Review of Patches (ADVISORY pre-screen)\n\n> This review is **advisory** — it sharpens the Step-5 REPORT so the human can decide\n> what to stage. It is **not** the landing verdict. The binding cross-model jury runs\n> later, at landing, inside [`\u002Fmeta-apply`](..\u002Fmeta-apply\u002FSKILL.md), on the actual staged\n> diff (a producer-relayed verdict would be forgeable). Record this result as\n> `advisory_screen` only.\n\nSend each patch to GPT-6-Astra xhigh for adversarial review:\n\n```\nmcp__codex__codex:\n  model: gpt-6-astra\n  config: {\"model_reasoning_effort\": \"xhigh\"}\n  prompt: |\n    You are reviewing a proposed optimization to an ARIS SKILL.md file.\n    \n    ## Original Skill (relevant section)\n    [paste original]\n    \n    ## Proposed Patch\n    [paste diff]\n    \n    ## Evidence from Usage Log\n    [paste summary stats]\n    \n    Review this patch:\n    1. Does the evidence support the change?\n    2. Could this change hurt other use cases?\n    3. Is the change minimal and safe?\n    4. Score 1-10: should this be applied?\n    \n    If score \u003C 7, explain what additional evidence would be needed.\n\n    === SCOPE LIMITS (these bound what you PROPOSE, never what you look for) ===\n    Report anything that is actually wrong here — including a rare-looking case, if\n    this repo actually produces it. Then keep the fix in scope:\n    1. This is a RESEARCH-WORKFLOW tool, not a security paper. Verification is\n       welcome; over-defense is not. Assume a cooperating operator on their own\n       machine — a malicious local user is NOT in the threat model.\n    2. Do NOT propose SHA \u002F hash \u002F content-fingerprint \u002F digest-binding schemes.\n       Reporting a real defect in hashing code that already exists is fine.\n    3. NO speculative machinery: do not add feature flags, migration frameworks,\n       compat layers, wrappers, pins, or similar mechanisms unless evidence shows\n       a current repo defect they fix or an explicit existing invariant they must\n       preserve. \"Load-bearing\", \"compatibility\", and \"not scaffolding\" are labels,\n       not evidence. Point to the failing path\u002Fartifact or invariant, and check the\n       proposal's factual premises, such as whether a named package version exists.\n    4. NO corner-case obsession: exotic encodings, symlink races, RTL text and\n       millisecond races are out of scope unless you can show the case arises here.\n    5. Where a rubric or checklist is genuinely needed, do not over-mechanize\n       judgement. A clear sentence a human reads beats a scored table nobody\n       maintains.\n    Exception: code that runs remote commands, starts a network service, or installs\n    an MCP server runs on the user's machine with their credentials — trust-boundary\n    findings there are in scope and the default is strict.\n    Say plainly when something is correct. Do not manufacture findings.\n```\n\n### Step 5: Present Results\n\nOutput a structured report:\n\n```markdown\n# ARIS Meta-Optimization Report\n\n**Date**: [today]\n**Data**: [N] events, [M] skill invocations, [K] sessions\n**Target**: [skill name or \"all\"]\n\n## Current Bottleneck\n\n**[one-phrase name]** — [one-line evidence]. Prior cycle's bottleneck: [name —\nresolved by \u003Cpatch ids> \u002F unresolved \u002F first recorded cycle]. (Ledger:\n`.aris\u002Fmeta\u002Fbottleneck_log.jsonl`)\n\n## Proposed Changes\n\n### Change 1: [title]\n- **Target**: [skill\u002Ffile:line]\n- **Signal**: [what the data shows]\n- **Patch**: [diff]\n- **Reviewer Score**: [X\u002F10]\n- **Reviewer Notes**: [summary]\n- **Status**: ✅ Recommended \u002F ⚠️ Needs more data \u002F ❌ Rejected\n\n### Change 2: ...\n\n## Changes NOT Made (insufficient evidence)\n- [pattern observed but too few samples]\n\n## Recommendations\n- [ ] Apply Change 1 (reviewer approved)\n- [ ] Collect more data for Change 3 (need N more runs)\n- [ ] Consider manual review of Change 2\n\n## Next Steps\nThis skill only **proposes**. To land changes: tell me which to stage, then run\n`\u002Fmeta-apply` (a separate, human-invoked applier that re-checks the cross-model\nverdict before mutating anything). meta-optimize never applies.\n```\n\n### Step 6: Stage approved patches for `\u002Fmeta-apply` (NO in-skill apply)\n\nThis skill does **not** apply anything. After the user has read the Step-5 REPORT and\nindicated which changes to land, **stage** them for the privileged applier:\n\n1. For each approved change `N`, write its unified diff to\n   `.aris\u002Fmeta\u002Fpending\u002F\u003CNN>_\u003Cskill>.diff` and append a row to\n   `.aris\u002Fmeta\u002Fpending\u002Fmanifest.jsonl`:\n   `{patch: \"\u003CNN>_\u003Cskill>.diff\", target: \"\u003Ccorpus path>\", author_model: \"\u003Cexecutor>\",\n   advisory_screen: \"pass|kill\", advisory_reason: \"\u003Cone line>\"}`.\n   The `advisory_screen` (your Step-4 codex pre-review) is **advisory only** — it helps\n   the human read the REPORT. It is **NOT** the landing verdict and `\u002Fmeta-apply` does not\n   trust it: a producer-written verdict would be forgeable. The binding cross-model jury\n   runs **at landing, inside `\u002Fmeta-apply`,** on the actual staged diff.\n2. Tell the user: *\"Staged M patches. Run `\u002Fmeta-apply` to judge & land them.\"*\n\nThe backup → **fresh jury-at-landing** → apply → **provenance stamp** → log all happen\ninside [`\u002Fmeta-apply`](..\u002Fmeta-apply\u002FSKILL.md). meta-optimize never touches the corpus and\nnever produces the acquittal.\n\n**Never apply in this skill. Landing is `\u002Fmeta-apply` + a fresh jury + a human, always.**\n\n## Key Rules\n\n- **Log-driven, not speculative.** Every proposed change must cite specific data from the event log. No \"I think this would be better.\"\n- **Minimal patches.** Change one thing at a time. Don't rewrite entire skills — the one sanctioned large edit is a scaffolding **deletion** backed by TARGET-SPECIFIC model-delta evidence (a capability-specific release note, or repeated post-bump event-log behavior showing the scaffold is unused — the model name changing is a trigger to look, never sufficient evidence). Privilege boundaries, acceptance gates, corpus\u002Fprovenance rules, output contracts, and safety checks are never deletion candidates. Deletions go through the same review + approval gates as everything else.\n- **Reviewer-gated.** Every patch goes through cross-model review before recommendation.\n- **Reversible.** Always back up before applying. Always log what changed.\n- **User-approved.** Never auto-apply. Present, explain, let the user decide.\n- **Honest about uncertainty.** If the data is insufficient, say so. Don't optimize on noise.\n- **Portable.** Optimizations should improve the skill for all users, not just one user's style. If a change seems user-specific, flag it.\n\n## Event Schema Reference\n\nThe log at `.aris\u002Fmeta\u002Fevents.jsonl` contains JSONL records with these shapes:\n\n```jsonl\n{\"ts\":\"...\",\"session\":\"...\",\"event\":\"skill_invoke\",\"skill\":\"auto-review-loop\",\"args\":\"difficulty: hard\"}\n{\"ts\":\"...\",\"session\":\"...\",\"event\":\"PostToolUse\",\"tool\":\"Bash\",\"input_summary\":\"pdflatex main.tex\"}\n{\"ts\":\"...\",\"session\":\"...\",\"event\":\"codex_call\",\"tool\":\"mcp__codex__codex\",\"input_summary\":\"review...\"}\n{\"ts\":\"...\",\"session\":\"...\",\"event\":\"tool_failure\",\"tool\":\"Bash\",\"input_summary\":\"python train.py\"}\n{\"ts\":\"...\",\"session\":\"...\",\"event\":\"slash_command\",\"command\":\"\u002Fauto-review-loop\",\"args\":\"\"}\n{\"ts\":\"...\",\"session\":\"...\",\"event\":\"user_prompt\",\"prompt_preview\":\"change difficulty to hard\"}\n{\"ts\":\"...\",\"session\":\"...\",\"event\":\"session_start\",\"source\":\"startup\",\"model\":\"claude-opus-4-6\"}\n{\"ts\":\"...\",\"session\":\"...\",\"event\":\"session_end\"}\n```\n\n## Triggering\n\nThis skill is NOT part of the standard W1→W1.5→W2→W3→W4 pipeline. It is a **maintenance workflow** with three trigger mechanisms:\n\n1. **Passive logging** (always on): Claude Code hooks record events to `.aris\u002Fmeta\u002Fevents.jsonl` automatically during normal usage. Zero user effort.\n\n2. **Automatic readiness check** (SessionEnd hook): When a Claude Code session ends, `check_ready.sh` counts skill invocations since the last `\u002Fmeta-optimize` run. If ≥5 new invocations have accumulated, it prints a reminder:\n   ```\n   📊 ARIS has logged 8 skill runs since last optimization. Run \u002Fmeta-optimize to check for improvement opportunities.\n   ```\n   It ALSO fires — regardless of invocation count — when the session model has\n   changed since the last optimize (compared against `.aris\u002Fmeta\u002F.last_optimize_model`):\n   ```\n   🔁 Model changed since last optimization (claude-opus-4-6 → claude-opus-4-8). Run \u002Fmeta-optimize — a model bump makes existing scaffolding a deletion candidate (harness diet).\n   ```\n   Both are **suggestions only** — they do not auto-run optimization.\n\n3. **Manual trigger**: User runs `\u002Fmeta-optimize` when they see the reminder or whenever they want.\n\n**After each `\u002Fmeta-optimize` run**, the skill writes the current timestamp to `.aris\u002Fmeta\u002F.last_optimize` and the current session model (latest `session_start` event's `model` field) to `.aris\u002Fmeta\u002F.last_optimize_model`, so the readiness check can detect both new usage and model bumps.\n\n## Acknowledgements\n\nInspired by [Meta-Harness](https:\u002F\u002Farxiv.org\u002Fabs\u002F2603.28052) (Lee et al., 2026) — end-to-end optimization of model harnesses via filesystem-based experience access and agentic code search.\n\n## Output Protocols\n\n> Follow these shared protocols for all output files:\n> - **[Output Versioning Protocol](..\u002Fshared-references\u002Foutput-versioning.md)** — write timestamped file first, then copy to fixed name\n> - **[Output Manifest Protocol](..\u002Fshared-references\u002Foutput-manifest.md)** — log every output to MANIFEST.md\n> - **[Output Language Protocol](..\u002Fshared-references\u002Foutput-language.md)** — respect the project's language setting\n\n## Review Tracing\n\nAfter each `mcp__codex__codex` or `mcp__codex__codex-reply` reviewer call, save the trace following `shared-references\u002Freview-tracing.md` (Policy C — forensic; never silently skip). Use `save_trace.sh` (resolved per the chain in `shared-references\u002Fintegration-contract.md` §2) or write files directly to `.aris\u002Ftraces\u002F\u003Cskill>\u002F\u003Cdate>_run\u003CNN>\u002F`. Respect the `--- trace:` parameter (default: `full`).\n","# Meta-Optimize: Outer-Loop Harness Optimization for ARIS\n\nAnalyze accumulated usage logs and propose optimizations for: **$ARGUMENTS**\n\n## Privilege boundary — this skill is a READ-ONLY PRODUCER\n\nmeta-optimize **proposes**; it does not **land**. The mutation of the skill corpus\nis the exclusive job of a separate, human-invoked skill: [`\u002Fmeta-apply`](..\u002Fmeta-apply\u002FSKILL.md).\nThis split is structural, not advisory — it is why a missed instruction cannot let\nthis loop apply its own patch (the self-acquittal failure mode):\n\n- **No `Write`\u002F`Edit` tool.** This skill cannot edit a SKILL.md \u002F shared-reference \u002F\n  any corpus file with the frictionless mutators. Its only outputs are the REPORT and\n  staged patch files, written under `.aris\u002Fmeta\u002F` (a scratch area, never the corpus).\n- **No apply step.** There is no in-skill \"apply the patch\" path (see Step 6). The\n  producer ends by *staging* approved patches for `\u002Fmeta-apply`; a human must then\n  invoke `\u002Fmeta-apply` to land them. That human action is the landing gate.\n- **`Bash` writes to the corpus are filtered, not impossible — be honest about the\n  layers.** What IS fully closed: the *accidental \u002F in-flow* self-acquittal — this skill\n  has no `Write`\u002F`Edit` and no apply step, so an honest run cannot slip into editing the\n  corpus. Defense-in-depth: install the\n  [`corpus_write_guard`](..\u002F..\u002Ftemplates\u002Fclaude-hooks\u002Fcorpus_write_guard.json) PreToolUse\n  hook (like `meta_logging.json`), which DENIES the common Bash shell-writes (`>`, `tee`,\n  `sed -i`, `cp`\u002F`mv`, `touch`, `open(...,'w')`) to corpus paths. **This is a blacklist,\n  NOT a complete sandbox** — a *deliberately* obscured Bash write (`git apply`, `patch`,\n  `$var`\u002Fabsolute paths, language file APIs) is not all caught. **Full structural\n  prevention requires either removing this skill's `Bash` or an FS sandbox** — over-built\n  for a not-yet-load-bearing producer, so deferred to when the gate carries real\n  auto-modification volume (a brick-3 trigger). The intended backstop against a deliberate\n  write is **detection, not prevention** — a corpus change with no valid\u002Fcurrent\n  `provenance` stamp (content-hash mismatch) *would be* catchable in a pre-push integrity\n  check — but that verifier is **NOT yet built** (`provenance.py` has `content_hash` but no\n  integrity-check subcommand, and no pre-push hook runs one). So today the deliberate-write\n  case is neither prevented nor actively detected; track the integrity verifier as a\n  follow-up before this producer goes load-bearing. Its legitimate Bash writes go only to\n  `.aris\u002Fmeta\u002F`.\n\nSee [`shared-references\u002Facceptance-gate.md`](..\u002Fshared-references\u002Facceptance-gate.md):\na loop can DRIVE (propose, review) same-model, but the ACQUITTAL that lands a change\nmust be cross-model (Step 4 jury) **and** the landing must be a separate human-gated\nact (`\u002Fmeta-apply`).\n\n## Context\n\nARIS is a **research harness** — a system of skills, bridges, workflows, and artifact contracts that wraps around LLMs to orchestrate research. This skill implements a prototype **outer loop** that observes how the harness is used and proposes improvements to the harness itself (not to the research artifacts it produces).\n\nInspired by Meta-Harness (Lee et al., 2026): the key insight is that harness design matters as much as model weights, and harness engineering can be partially automated by logging execution traces and using them to guide improvements.\n\n## What This Skill Optimizes (Harness Components)\n\n| Component | Example | Optimizable? |\n|-----------|---------|:---:|\n| SKILL.md prompts | Reviewer instructions, quality gates, step descriptions | Yes |\n| Default parameters | `difficulty: medium`, `MAX_ROUNDS: 4`, `threshold: 6\u002F10` | Yes |\n| Convergence rules | When to stop the review loop, retry counts | Yes |\n| Workflow ordering | Skill chain sequence within a workflow | Yes |\n| Artifact schemas | What fields go in EXPERIMENT_LOG.md, idea-stage\u002FIDEA_REPORT.md | Cautious |\n| MCP bridge config | Which reviewer model, routing rules | No (infra) |\n\n**Not optimized**: The research artifacts themselves (papers, code, experiments). That's what the regular workflows do.\n\n## Prerequisites\n\n1. **Logging must be active.** Copy `templates\u002Fclaude-hooks\u002Fmeta_logging.json` into your project's `.claude\u002Fsettings.json` (or merge the hooks section).\n2. **Sufficient data.** At least 5 complete workflow runs logged in `.aris\u002Fmeta\u002Fevents.jsonl`. The skill will check and warn if insufficient.\n\n## Workflow\n\n### Step 0: Check Data Availability\n\n```bash\nEVENTS_FILE=\".aris\u002Fmeta\u002Fevents.jsonl\"\nif [ ! -f \"$EVENTS_FILE\" ]; then\n    echo \"ERROR: No event log found at $EVENTS_FILE\"\n    echo \"Enable logging first: copy templates\u002Fclaude-hooks\u002Fmeta_logging.json into .claude\u002Fsettings.json\"\n    exit 1\nfi\n\nEVENT_COUNT=$(wc -l \u003C \"$EVENTS_FILE\")\nSKILL_INVOCATIONS=$(grep -c '\"skill_invoke\"' \"$EVENTS_FILE\" || echo 0)\nSESSIONS=$(grep -c '\"session_start\"' \"$EVENTS_FILE\" || echo 0)\n\necho \"📊 Event log: $EVENT_COUNT events, $SKILL_INVOCATIONS skill invocations, $SESSIONS sessions\"\n\nif [ \"$SKILL_INVOCATIONS\" -lt 5 ]; then\n    echo \"⚠️  Insufficient data (\u003C5 skill invocations). Continue using ARIS normally and re-run later.\"\n    exit 0\nfi\n\n# Bottleneck succession: what did the LAST cycle say was the limiting stage?\nBOTTLENECK_LOG=\".aris\u002Fmeta\u002Fbottleneck_log.jsonl\"\nif [ -f \"$BOTTLENECK_LOG\" ]; then\n    echo \"🧭 Prior cycle's bottleneck: $(tail -1 \"$BOTTLENECK_LOG\")\"\nfi\n```\n\nIf a prior bottleneck entry exists, open the report (Step 5) by stating whether\nthat named bottleneck was **resolved** (and by which landed patches) and what it\nhas now **moved to** — bottleneck SUCCESSION, not just existence, is the signal\nthis ledger exists to carry.\n\n### Step 1: Analyze Usage Patterns\n\nRead `.aris\u002Fmeta\u002Fevents.jsonl` and compute:\n\n**Frequency analysis:**\n- Which skills are invoked most often?\n- Which slash commands do users type most?\n- What parameter overrides are most common? (These suggest bad defaults.)\n\n**Failure analysis:**\n- Which tools fail most often? In which skills?\n- What error patterns repeat? (OOM, import, compilation, timeout)\n- How many auto-debug retries per workflow run?\n\n**Convergence analysis (for auto-review-loop):**\n- Average rounds to reach threshold\n- Score trajectory shape (fast improvement? plateau? oscillation?)\n- Which review round catches the most critical issues?\n- Do users override difficulty mid-run?\n\n**Human intervention analysis:**\n- Where do users interrupt with manual prompts during workflows?\n- What manual corrections do users make most? (These indicate skill gaps.)\n\n**Model-delta analysis (harness diet):**\n- Has the session model (`session_start` events' `model` field) or the pinned\n  reviewer model changed since a skill's SKILL.md was last touched?\n  (`git log -1 --format=%cs -- skills\u002F\u003Cskill>\u002FSKILL.md` vs the model-bump date.)\n- A model bump is a **trigger to re-read, not evidence by itself**. For each\n  reasoning-scaffolding step or worked example in that SKILL.md, a deletion\n  proposal must cite TARGET-SPECIFIC evidence that the new model no longer\n  needs it: a capability-specific release note, or repeated observed behavior\n  in the event log (e.g. zero failures\u002Finterventions in the guarded step since\n  the bump). \"The model got newer\" alone never justifies a deletion.\n- **Never deletion candidates**, regardless of model: privilege boundaries,\n  acceptance\u002Freview gates, corpus- and provenance-integrity rules, output\n  contracts, and safety checks. The diet targets model-compensation scaffolding\n  only — a capability the new model has natively is pure overhead (context\n  weight, drift surface, reading cost). A harness that only ever grows is a\n  harness nobody is re-reading.\n\n**Trigger-rate analysis (optional, measured — not from the event log):**\n- The event log shows which skills were USED, not which were WANTED-but-omitted\n  — the omission failure mode (Claude Code passing over the right skill when the\n  installed list is long) is invisible to it. `tools\u002Fmeta_opt\u002Ftrigger_eval.py`\n  measures it directly: `claude -p` probes with paraphrased-intent queries run\n  from a neutral cwd (so the realistic long installed corpus is loaded), scored\n  as trigger \u002F confusion(→which skill) \u002F miss.\n- Run it when a specific skill is suspected of under- or mis-triggering, or as a\n  before\u002Fafter check around a description edit:\n  `python3 tools\u002Fmeta_opt\u002Ftrigger_eval.py --eval-file tools\u002Fmeta_opt\u002Ftrigger_evals.sample.json --skills \u003Cname> --samples 2`\n- The **confusion matrix is the signal**, not just the rate: a query that keeps\n  landing on a sibling skill means the two descriptions overlap on that intent —\n  the fix is disambiguation, not \"make the description pushier\".\n- **Measure-only, evidence not verdict.** A low trigger rate is an INPUT to a\n  Step-2 proposal (which lands only via `\u002Fmeta-apply`), never a self-applied\n  description rewrite. Trigger rate is model-dependent, so compare like with\n  like (record the probe model) and treat it as a proxy — it measures selection\n  under a query set, not the full long-list omission problem.\n\nPresent findings as a structured summary table.\n\n### Step 1.5: Name the Current Bottleneck\n\nSynthesize the Step-1 analyses into **one sentence naming the single\nmost-limiting pipeline stage right now** — e.g. \"planning\", \"verification\nquality\", \"experiment execution reliability\", \"writing polish\" — with the\nsupporting evidence. The bottleneck always moves: when coding stops being the\nconstraint, planning becomes it; when planning is solved, verification; when\nverification is automated, taste. This step exists to make the CURRENT\nconstraint visible, so Step 2's ranked table reads as sub-fixes for one named\nconstraint instead of scattered tweaks.\n\nAppend the verdict to the append-only ledger `.aris\u002Fmeta\u002Fbottleneck_log.jsonl`\n(same never-mutate discipline as `.aris\u002Fruns\u002F\u003Crun_id>.iterations.jsonl`):\n\n```bash\nmkdir -p .aris\u002Fmeta\n# json.dumps, NOT hand-interpolated shell strings: bottleneck\u002Fevidence are\n# natural language — a stray quote must not break the JSONL (or the shell).\npython3 - \u003C\u003C'PY'\nimport json, datetime\nentry = {\n    \"ts\": datetime.datetime.now().astimezone().isoformat(timespec=\"seconds\"),\n    \"cycle\": 3,\n    \"bottleneck\": \"verification quality\",\n    \"evidence\": \"review rounds plateau at 6\u002F10 while tool failures are rare\",\n    \"top_patch_ids\": [\"P1\", \"P2\"],\n}\nwith open(\".aris\u002Fmeta\u002Fbottleneck_log.jsonl\", \"a\", encoding=\"utf-8\") as fh:\n    fh.write(json.dumps(entry, ensure_ascii=False) + \"\\n\")\nPY\n```\n\nNever edit or delete prior lines — succession history is the point.\n\n### Step 2: Identify Optimization Targets\n\nBased on Step 1, rank optimization opportunities by expected impact:\n\n```markdown\n## Optimization Opportunities (ranked)\n\n| # | Target | Signal | Proposed Change | Expected Impact |\n|---|--------|--------|-----------------|-----------------|\n| 1 | auto-review-loop default threshold | Users override to 7\u002F10 in 60% of runs | Change default from 6\u002F10 to 7\u002F10 | Fewer manual overrides |\n| 2 | experiment-bridge retry count | 40% of runs hit max retries on OOM | Add OOM-specific recovery (reduce batch size) | Fewer failed experiments |\n| 3 | paper-write de-AI patterns | Users manually fix \"delve\" in 80% of runs | Add \"delve\" to default watchword list | Fewer manual edits |\n| 4 | experiment-bridge Phase-2 hand-holding steps | Model bump (session_start model changed); scaffold untouched since 2 generations ago; zero tool_failures in the steps it guards | **DELETE steps N–M — the new model does this unprompted** | Smaller harness, less drift surface |\n```\n\nThe Proposed-Change column is explicitly allowed to be a **deletion** — \"DELETE\nstep N, new model does this for free\" is a first-class optimization, ranked by\nthe same impact logic as additions.\n\nIf `$ARGUMENTS` specifies a target skill, focus analysis on that skill only.\nIf `$ARGUMENTS` is empty or \"all\", analyze all skills with sufficient data.\n\n### Step 3: Generate Patch Proposals\n\nFor each optimization target, generate a concrete diff:\n\n```diff\n--- a\u002Fskills\u002Fauto-review-loop\u002FSKILL.md\n+++ b\u002Fskills\u002Fauto-review-loop\u002FSKILL.md\n@@ -15,7 +15,7 @@\n ## Constants\n \n-- **SCORE_THRESHOLD = 6** — Minimum review score to accept.\n+- **SCORE_THRESHOLD = 7** — Minimum review score to accept. (Raised based on usage data: 60% of users overrode to 7+.)\n```\n\n**Rules for patch generation:**\n- One patch per optimization target\n- Each patch must include a comment explaining WHY (with data from the log)\n- Patches must be minimal — change only what the data supports\n- Never change artifact schemas or MCP bridge config in v1\n- Never change behavior that would break existing user workflows\n- **Anti-self-poisoning screen** (see [`shared-references\u002Fcapture-antipatterns.md`](..\u002Fshared-references\u002Fcapture-antipatterns.md)):\n  run a proposed patch's rationale through `tools\u002Fcapture_filter.py` (resolve via\n  the canonical chain). NEVER propose a change that encodes a **negative\n  tool-capability claim** (\"codex can't…\", \"gemini is broken\") or a **one-off \u002F\n  transient failure** as a durable rule — those harden into self-cited refusals.\n  Encode the *fix \u002F the flag needed \u002F the workaround*, not \"X can't do Y\".\n\n### Step 4: Cross-Model Review of Patches (ADVISORY pre-screen)\n\n> This review is **advisory** — it sharpens the Step-5 REPORT so the human can decide\n> what to stage. It is **not** the landing verdict. The binding cross-model jury runs\n> later, at landing, inside [`\u002Fmeta-apply`](..\u002Fmeta-apply\u002FSKILL.md), on the actual staged\n> diff (a producer-relayed verdict would be forgeable). Record this result as\n> `advisory_screen` only.\n\nSend each patch to GPT-6-Astra xhigh for adversarial review:\n\n```\nmcp__codex__codex:\n  model: gpt-6-astra\n  config: {\"model_reasoning_effort\": \"xhigh\"}\n  prompt: |\n    You are reviewing a proposed optimization to an ARIS SKILL.md file.\n    \n    ## Original Skill (relevant section)\n    [paste original]\n    \n    ## Proposed Patch\n    [paste diff]\n    \n    ## Evidence from Usage Log\n    [paste summary stats]\n    \n    Review this patch:\n    1. Does the evidence support the change?\n    2. Could this change hurt other use cases?\n    3. Is the change minimal and safe?\n    4. Score 1-10: should this be applied?\n    \n    If score \u003C 7, explain what additional evidence would be needed.\n\n    === SCOPE LIMITS (these bound what you PROPOSE, never what you look for) ===\n    Report anything that is actually wrong here — including a rare-looking case, if\n    this repo actually produces it. Then keep the fix in scope:\n    1. This is a RESEARCH-WORKFLOW tool, not a security paper. Verification is\n       welcome; over-defense is not. Assume a cooperating operator on their own\n       machine — a malicious local user is NOT in the threat model.\n    2. Do NOT propose SHA \u002F hash \u002F content-fingerprint \u002F digest-binding schemes.\n       Reporting a real defect in hashing code that already exists is fine.\n    3. NO speculative machinery: do not add feature flags, migration frameworks,\n       compat layers, wrappers, pins, or similar mechanisms unless evidence shows\n       a current repo defect they fix or an explicit existing invariant they must\n       preserve. \"Load-bearing\", \"compatibility\", and \"not scaffolding\" are labels,\n       not evidence. Point to the failing path\u002Fartifact or invariant, and check the\n       proposal's factual premises, such as whether a named package version exists.\n    4. NO corner-case obsession: exotic encodings, symlink races, RTL text and\n       millisecond races are out of scope unless you can show the case arises here.\n    5. Where a rubric or checklist is genuinely needed, do not over-mechanize\n       judgement. A clear sentence a human reads beats a scored table nobody\n       maintains.\n    Exception: code that runs remote commands, starts a network service, or installs\n    an MCP server runs on the user's machine with their credentials — trust-boundary\n    findings there are in scope and the default is strict.\n    Say plainly when something is correct. Do not manufacture findings.\n```\n\n### Step 5: Present Results\n\nOutput a structured report:\n\n```markdown\n# ARIS Meta-Optimization Report\n\n**Date**: [today]\n**Data**: [N] events, [M] skill invocations, [K] sessions\n**Target**: [skill name or \"all\"]\n\n## Current Bottleneck\n\n**[one-phrase name]** — [one-line evidence]. Prior cycle's bottleneck: [name —\nresolved by \u003Cpatch ids> \u002F unresolved \u002F first recorded cycle]. (Ledger:\n`.aris\u002Fmeta\u002Fbottleneck_log.jsonl`)\n\n## Proposed Changes\n\n### Change 1: [title]\n- **Target**: [skill\u002Ffile:line]\n- **Signal**: [what the data shows]\n- **Patch**: [diff]\n- **Reviewer Score**: [X\u002F10]\n- **Reviewer Notes**: [summary]\n- **Status**: ✅ Recommended \u002F ⚠️ Needs more data \u002F ❌ Rejected\n\n### Change 2: ...\n\n## Changes NOT Made (insufficient evidence)\n- [pattern observed but too few samples]\n\n## Recommendations\n- [ ] Apply Change 1 (reviewer approved)\n- [ ] Collect more data for Change 3 (need N more runs)\n- [ ] Consider manual review of Change 2\n\n## Next Steps\nThis skill only **proposes**. To land changes: tell me which to stage, then run\n`\u002Fmeta-apply` (a separate, human-invoked applier that re-checks the cross-model\nverdict before mutating anything). meta-optimize never applies.\n```\n\n### Step 6: Stage approved patches for `\u002Fmeta-apply` (NO in-skill apply)\n\nThis skill does **not** apply anything. After the user has read the Step-5 REPORT and\nindicated which changes to land, **stage** them for the privileged applier:\n\n1. For each approved change `N`, write its unified diff to\n   `.aris\u002Fmeta\u002Fpending\u002F\u003CNN>_\u003Cskill>.diff` and append a row to\n   `.aris\u002Fmeta\u002Fpending\u002Fmanifest.jsonl`:\n   `{patch: \"\u003CNN>_\u003Cskill>.diff\", target: \"\u003Ccorpus path>\", author_model: \"\u003Cexecutor>\",\n   advisory_screen: \"pass|kill\", advisory_reason: \"\u003Cone line>\"}`.\n   The `advisory_screen` (your Step-4 codex pre-review) is **advisory only** — it helps\n   the human read the REPORT. It is **NOT** the landing verdict and `\u002Fmeta-apply` does not\n   trust it: a producer-written verdict would be forgeable. The binding cross-model jury\n   runs **at landing, inside `\u002Fmeta-apply`,** on the actual staged diff.\n2. Tell the user: *\"Staged M patches. Run `\u002Fmeta-apply` to judge & land them.\"*\n\nThe backup → **fresh jury-at-landing** → apply → **provenance stamp** → log all happen\ninside [`\u002Fmeta-apply`](..\u002Fmeta-apply\u002FSKILL.md). meta-optimize never touches the corpus and\nnever produces the acquittal.\n\n**Never apply in this skill. Landing is `\u002Fmeta-apply` + a fresh jury + a human, always.**\n\n## Key Rules\n\n- **Log-driven, not speculative.** Every proposed change must cite specific data from the event log. No \"I think this would be better.\"\n- **Minimal patches.** Change one thing at a time. Don't rewrite entire skills — the one sanctioned large edit is a scaffolding **deletion** backed by TARGET-SPECIFIC model-delta evidence (a capability-specific release note, or repeated post-bump event-log behavior showing the scaffold is unused — the model name changing is a trigger to look, never sufficient evidence). Privilege boundaries, acceptance gates, corpus\u002Fprovenance rules, output contracts, and safety checks are never deletion candidates. Deletions go through the same review + approval gates as everything else.\n- **Reviewer-gated.** Every patch goes through cross-model review before recommendation.\n- **Reversible.** Always back up before applying. Always log what changed.\n- **User-approved.** Never auto-apply. Present, explain, let the user decide.\n- **Honest about uncertainty.** If the data is insufficient, say so. Don't optimize on noise.\n- **Portable.** Optimizations should improve the skill for all users, not just one user's style. If a change seems user-specific, flag it.\n\n## Event Schema Reference\n\nThe log at `.aris\u002Fmeta\u002Fevents.jsonl` contains JSONL records with these shapes:\n\n```jsonl\n{\"ts\":\"...\",\"session\":\"...\",\"event\":\"skill_invoke\",\"skill\":\"auto-review-loop\",\"args\":\"difficulty: hard\"}\n{\"ts\":\"...\",\"session\":\"...\",\"event\":\"PostToolUse\",\"tool\":\"Bash\",\"input_summary\":\"pdflatex main.tex\"}\n{\"ts\":\"...\",\"session\":\"...\",\"event\":\"codex_call\",\"tool\":\"mcp__codex__codex\",\"input_summary\":\"review...\"}\n{\"ts\":\"...\",\"session\":\"...\",\"event\":\"tool_failure\",\"tool\":\"Bash\",\"input_summary\":\"python train.py\"}\n{\"ts\":\"...\",\"session\":\"...\",\"event\":\"slash_command\",\"command\":\"\u002Fauto-review-loop\",\"args\":\"\"}\n{\"ts\":\"...\",\"session\":\"...\",\"event\":\"user_prompt\",\"prompt_preview\":\"change difficulty to hard\"}\n{\"ts\":\"...\",\"session\":\"...\",\"event\":\"session_start\",\"source\":\"startup\",\"model\":\"claude-opus-4-6\"}\n{\"ts\":\"...\",\"session\":\"...\",\"event\":\"session_end\"}\n```\n\n## Triggering\n\nThis skill is NOT part of the standard W1→W1.5→W2→W3→W4 pipeline. It is a **maintenance workflow** with three trigger mechanisms:\n\n1. **Passive logging** (always on): Claude Code hooks record events to `.aris\u002Fmeta\u002Fevents.jsonl` automatically during normal usage. Zero user effort.\n\n2. **Automatic readiness check** (SessionEnd hook): When a Claude Code session ends, `check_ready.sh` counts skill invocations since the last `\u002Fmeta-optimize` run. If ≥5 new invocations have accumulated, it prints a reminder:\n   ```\n   📊 ARIS has logged 8 skill runs since last optimization. Run \u002Fmeta-optimize to check for improvement opportunities.\n   ```\n   It ALSO fires — regardless of invocation count — when the session model has\n   changed since the last optimize (compared against `.aris\u002Fmeta\u002F.last_optimize_model`):\n   ```\n   🔁 Model changed since last optimization (claude-opus-4-6 → claude-opus-4-8). Run \u002Fmeta-optimize — a model bump makes existing scaffolding a deletion candidate (harness diet).\n   ```\n   Both are **suggestions only** — they do not auto-run optimization.\n\n3. **Manual trigger**: User runs `\u002Fmeta-optimize` when they see the reminder or whenever they want.\n\n**After each `\u002Fmeta-optimize` run**, the skill writes the current timestamp to `.aris\u002Fmeta\u002F.last_optimize` and the current session model (latest `session_start` event's `model` field) to `.aris\u002Fmeta\u002F.last_optimize_model`, so the readiness check can detect both new usage and model bumps.\n\n## Acknowledgements\n\nInspired by [Meta-Harness](https:\u002F\u002Farxiv.org\u002Fabs\u002F2603.28052) (Lee et al., 2026) — end-to-end optimization of model harnesses via filesystem-based experience access and agentic code search.\n\n## Output Protocols\n\n> Follow these shared protocols for all output files:\n> - **[Output Versioning Protocol](..\u002Fshared-references\u002Foutput-versioning.md)** — write timestamped file first, then copy to fixed name\n> - **[Output Manifest Protocol](..\u002Fshared-references\u002Foutput-manifest.md)** — log every output to MANIFEST.md\n> - **[Output Language Protocol](..\u002Fshared-references\u002Foutput-language.md)** — respect the project's language setting\n\n## Review Tracing\n\nAfter each `mcp__codex__codex` or `mcp__codex__codex-reply` reviewer call, save the trace following `shared-references\u002Freview-tracing.md` (Policy C — forensic; never silently skip). Use `save_trace.sh` (resolved per the chain in `shared-references\u002Fintegration-contract.md` §2) or write files directly to `.aris\u002Ftraces\u002F\u003Cskill>\u002F\u003Cdate>_run\u003CNN>\u002F`. Respect the `--- trace:` parameter (default: `full`).\n",{"name":5,"description":7,"allowed-tools":24,"argument-hint":25},"Bash(*), Read, Grep, Glob, mcp__codex__codex, mcp__codex__codex-reply","[target-skill-or-all]","main","18193d71ea3441d7c033dbf195b8a7c75ac96f75","packages\u002Fskill\u002Fskill-science\u002Fassets\u002Fsources\u002Faris\u002Fskills\u002Fmeta-optimize",0,"https:\u002F\u002Fgithub.com\u002FCZX-LBJ\u002Fdeepseek-science","https:\u002F\u002Fgithub.com\u002FCZX-LBJ","一个没事喜欢随便写点代码的小菜鸡\r\n","2026-10-22 09:48:04",{"source":8,"skillName":5,"commands":35,"prompt":45,"zipAvailable":46},[36,39,42],{"tool":37,"command":38},"npx","npx skills add CZX-LBJ\u002Fdeepseek-science --skill meta-optimize",{"tool":40,"command":41},"bunx","bunx skills add CZX-LBJ\u002Fdeepseek-science --skill meta-optimize",{"tool":43,"command":44},"pnpm","pnpm dlx skills add CZX-LBJ\u002Fdeepseek-science --skill meta-optimize","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002FCZX-LBJ\u002Fdeepseek-science\u002Fblob\u002Fmain\u002Fpackages\u002Fskill\u002Fskill-science\u002Fassets\u002Fsources\u002Faris\u002Fskills\u002Fmeta-optimize\u002FSKILL.md",true,[],[49,56,63,70,77,84],{"skillNo":50,"name":51,"nameZh":6,"description":52,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":53,"categories":54,"keywords":55,"publishedAt":19},"01M7FEEKSNMRMKW6JEK93PFDFY","bio-free-energy-calculations","Performs alchemical free-energy calculations including relative binding free energy (RBFE \u002F FEP+) and absolute binding free energy (ABFE) via OpenFE, FEP+, GROMACS, AMBER pmemd, and OpenMM with explicit lambda scheduling, soft-core potentials, MBAR\u002FBAR analysis, cycle-closure validation, and protocol-appropriate enhanced sampling. Compares ML alternatives (Boltz-2 affinity, DeepDock). Use when ranking analogs by binding affinity beyond docking accuracy, performing prospective lead optimization, or validating SAR predictions.","https:\u002F\u002Fgithub.com\u002FCZX-LBJ\u002Fdeepseek-science\u002Fblob\u002Fmain\u002Fpackages\u002Fskill\u002Fskill-science\u002Fassets\u002Fsources\u002Fbioskills\u002Fchemoinformatics\u002Ffree-energy-calculations\u002FSKILL.md",[],[],{"skillNo":57,"name":58,"nameZh":6,"description":59,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":60,"categories":61,"keywords":62,"publishedAt":19},"01M7FEE5CTE5QK55CEMXNNVWY9","bio-conformer-generation","Generates 3D conformer ensembles using RDKit ETKDGv3 with knowledge-enhanced distance geometry, MMFF94\u002FUFF force-field optimization, CREST + GFN2-xTB semi-empirical refinement, and macrocycle-aware torsion preferences. Provides explicit decision rules for single vs ensemble conformer use, RMSD pruning, energy windows, conformer count, and force-field choice. Use when preparing 3D ligands for docking, generating descriptor input for 3D QSAR, or sampling macrocycle\u002Fpeptide conformational ensembles.","https:\u002F\u002Fgithub.com\u002FCZX-LBJ\u002Fdeepseek-science\u002Fblob\u002Fmain\u002Fpackages\u002Fskill\u002Fskill-science\u002Fassets\u002Fsources\u002Fbioskills\u002Fchemoinformatics\u002Fconformer-generation\u002FSKILL.md",[],[],{"skillNo":64,"name":65,"nameZh":6,"description":66,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":67,"categories":68,"keywords":69,"publishedAt":19},"01M7FEDNGFEMFWD1MSEDR5H7CY","bio-admet-prediction","Predicts ADMET properties using ADMETlab 3.0 (119 platform features, including 77 prediction models with modeled-endpoint uncertainty), ADMET-AI, DeepChem MolNet, and chemprop D-MPNN with explicit handling of OECD QSAR principles, applicability domain assessment, calibration, hERG\u002FCYP\u002FAMES endpoints, and PAINS \u002F Lipinski \u002F Ro5 \u002F Veber \u002F BBB druglikeness filters. Use when filtering compounds for drug-likeness, prioritizing leads by predicted safety, or building an in-house ADMET QSAR model.","https:\u002F\u002Fgithub.com\u002FCZX-LBJ\u002Fdeepseek-science\u002Fblob\u002Fmain\u002Fpackages\u002Fskill\u002Fskill-science\u002Fassets\u002Fsources\u002Fbioskills\u002Fchemoinformatics\u002Fadmet-prediction\u002FSKILL.md",[],[],{"skillNo":71,"name":72,"nameZh":6,"description":73,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":74,"categories":75,"keywords":76,"publishedAt":19},"01M7FED69GFB54FRF7AV5066DN","writing-systems-papers","Paragraph-level structural blueprint for 10-12 page systems papers targeting OSDI, SOSP, ASPLOS, NSDI, and EuroSys. Provides page allocation, paragraph templates, and writing patterns. Use when user says \"写系统论文\", \"systems paper structure\", \"OSDI paper\", \"SOSP paper\", or wants fine-grained structural guidance for a systems conference submission.","https:\u002F\u002Fgithub.com\u002FCZX-LBJ\u002Fdeepseek-science\u002Fblob\u002Fmain\u002Fpackages\u002Fskill\u002Fskill-science\u002Fassets\u002Fsources\u002Faris\u002Fskills\u002Fwriting-systems-papers\u002FSKILL.md",[],[],{"skillNo":78,"name":79,"nameZh":6,"description":80,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":81,"categories":82,"keywords":83,"publishedAt":19},"01M7FECVVDWZ0X0VEDTCE4B4DZ","wiki-enrich","Fill in the per-paper TODO sections of research-wiki\u002Fpapers\u002F\u003Cslug>.md pages that literature-ingest skills leave as bare scaffolds. Use when user says 'enrich wiki', 'fill paper TODOs', 'wiki body 補完', '把 paper 摘要寫進 wiki', 'research-wiki 自動填', or after a batch ingest that left papers\u002F as TODO scaffolds.","https:\u002F\u002Fgithub.com\u002FCZX-LBJ\u002Fdeepseek-science\u002Fblob\u002Fmain\u002Fpackages\u002Fskill\u002Fskill-science\u002Fassets\u002Fsources\u002Faris\u002Fskills\u002Fwiki-enrich\u002FSKILL.md",[],[],{"skillNo":85,"name":86,"nameZh":6,"description":87,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":88,"categories":89,"keywords":90,"publishedAt":19},"01M7FECD4BCJ2MTSBDDSE3ZAJ5","web-debug-search","Search GitHub, Stack Exchange, Chinese technical communities, official documentation, and general developer web sources for software errors, compatibility problems, API usage questions, and real-world workarounds. Use for debugging and discovery only; results are not paper-citation evidence.","https:\u002F\u002Fgithub.com\u002FCZX-LBJ\u002Fdeepseek-science\u002Fblob\u002Fmain\u002Fpackages\u002Fskill\u002Fskill-science\u002Fassets\u002Fsources\u002Faris\u002Fskills\u002Fweb-debug-search\u002FSKILL.md",[],[]]