跳到正文
FunCoding

搜索

搜索文档、Skill 和 MCP

context-audit

Audit an agent's context layout against the four places: system prompt, tools, history, tail. Use when the user asks to audit, review or fix their agent's context, prompt caching, token spend per turn, or CLAUDE.md / AGENTS.md layout. Read-only: reports findings and a fix list, changes nothing. Do NOT use for writing evals (evals-bootstrap) or for loop design (goal-test).

测试1kplugins/agents-course/skills/context-audit/SKILL.md

安装

把这段话发给 Claude Code、Codex 或 Cursor。智能体会先检查安全性,你确认后才安装。

读取 https://funcoding.ai/skills/undefined-ui/second-brain-os/context-audit/install.md ,按里面的步骤帮我安装这个 Skill。

SKILL.md

Audit the context window

Theory: How models read context and The four places. Every piece of context belongs in exactly one of four places — a byte-stable system prompt, a frozen tool set, a compacting history, and a short live tail — and most agent problems trace back to something sitting in the wrong one.

Core rule

Report and rank; never edit. The output is an audit, and the user decides what to apply. If they ask you to apply fixes afterwards, that is a normal edit session, not this skill.

Workflow

  1. Find the context sources. Locate what actually reaches the model: system prompt (or CLAUDE.md / AGENTS.md for a Claude Code setup), tool definitions, and — if the project logs requests — one full mid-conversation payload. If nothing is logged, say so and audit the static files; ask for one captured request only if the user can produce it cheaply.
  2. Measure the five numbers. Approximate token counts for: system prompt, tool definitions, message history, retrieved content, current query. A rough count (chars / 4) is fine; write all five down.
  3. Hunt cache killers. Flag every dynamic value in the system prompt — timestamps, user names, injected memories, "current task" lines. Each one is a guaranteed cache miss on every call. Check whether the tool list can change mid-run; a changing list invalidates the whole prefix.
  4. Hunt window bloat. Find the largest single item in the history. A verbatim tool result over ~2,000 tokens should have been a file path plus a one-line receipt. Count tools: past twenty (or ~10K tokens of definitions), recommend deferred tools + tool search.
  5. Check the tail. Locate the current goal. If it appears only in the opening message, it lives in the weak middle of the window — recommend restating it in the tail every three to five steps.
  6. Check guides. If CLAUDE.md / AGENTS.md exists: it should be a few lines of constraints the code cannot show, not four pages of narrative. Flag anything the repo already records (structure, history).

Output format

Context audit — <project>
system prompt   <n> tok   <clean | N dynamic values: ...>
tools           <n> tok   <n> tools  <frozen | mutates mid-run>
history         <n> tok   largest item: <what, n tok>
tail            <present | goal only in opening message>

Top fixes, in order of saved tokens per turn:
1. ...
2. ...

Each fix names the file and line where possible, states what moves to which of the four places, and estimates the saving. Close with the one-line rule: stable prefix, frozen tools, compact history, live tail.

相似的 Skill

skill-creator
anthropics/skills180k

skill-creator

Create new skills, modify and improve existing skills, and measure skill performance. Use when users want to create a skill from scratch, edit, or optimize an existing skill, run evals to test a skill, benchmark skill performance with variance analysis, or optimize a skill's description for better triggering accuracy.

测试

ponytail-audit
DietrichGebert/ponytail158k

ponytail-audit

Quality audit of a whole repo: bugs, security holes, what breaks under real load, risky code without tests, slow paths, and what to delete, merge or split. Ranked, each finding explained in plain English. One-shot report, changes nothing. Use for "audit this codebase", "review the whole repo", "find bloat", "what can I delete", /ponytail-audit.

测试

ponytail-audit
DietrichGebert/ponytail158k

ponytail-audit

Quality audit of the whole repo: bugs, security, real load, missing tests, speed, and what to delete. Most important first.

测试

ponytail-review
DietrichGebert/ponytail158k

ponytail-review

Quality review of a diff: bugs, security, real load, missing tests, speed, and what to delete. Each finding says what goes wrong and how to fix it.

测试

ci-cd-and-automation
addyosmani/agent-skills103k

ci-cd-and-automation

Automates CI/CD pipeline setup. Use when setting up or modifying build and deployment pipelines. Use when you need to automate quality gates, configure test runners in CI, or establish deployment strategies.

测试

idea-refine
addyosmani/agent-skills103k

idea-refine

Refines raw ideas into sharp, actionable concepts through structured divergent and convergent thinking. Use when an idea is still vague, when you need to stress-test assumptions before committing to a plan, or when you want to expand options before converging on one. Triggers on "ideate", "refine this idea", or "stress-test my plan".

测试