AgentStack
SKILL verified MIT Self-run

Optimize Agent Instructions

skill-krkn-s-skills-optimize-agent-instructions · by krkn-s

Lean audit and rewrite workflow for agent instruction files such as AGENTS.md, CLAUDE.md, system prompts, rules files, and skill instructions. Use when the agent needs to clean up, shorten, or refactor an instruction file, remove redundant or contradictory rules, reduce unnecessary planning, questions, or validation steps, fix a CLAUDE.md or AGENTS.md that feels too long or too strict, review a s…

No reviews yet
0 installs
4 views
0.0% view→install

Install

$ agentstack add skill-krkn-s-skills-optimize-agent-instructions

✓ scanned · ✓ verified — works with Claude Code, Cursor, and more.

Security review

✓ Passed

No issues found. Passed automated security review. · v0.1.0 How review works →

  • Prompt-injection patterns
  • Secret / credential exfiltration
  • Dangerous shell & filesystem operations
  • Untrusted network calls
  • Known-malicious package signatures

What it can access

  • Network access No
  • Filesystem access No
  • Shell / process execution No
  • Environment & secrets No
  • Dynamic code execution No

From automated source analysis of v0.1.0. “Used” means the capability is present in the source — more access means more to trust, not that it’s unsafe.

Are you the author of Optimize Agent Instructions? Claim this listing to set pricing, connect Stripe payouts, and keep 70% of every sale.
Sign up to claim

About

Optimize Agent Instructions

Mission

Improve a provided agent instruction file such as AGENTS.md, CLAUDE.md, system prompt, rules file, or skill instructions.

Optimize for:

  • Correctness and safety proportionate to actual risk
  • Fast, direct execution for simple tasks
  • Minimal, non-redundant instructions
  • Clear decision thresholds
  • Compatibility across coding models and agent harnesses

Do not optimize for maximum caution. Do not add rules merely because they sound like good engineering practice.

Core principle

Every instruction has a cost. Keep a rule only when it:

  • Prevents a recurring or costly failure
  • Provides information the agent cannot reliably infer from the repository
  • Is universal for the file's scope
  • Does not conflict with another rule
  • Can be stated clearly and acted on consistently

Remove or merge everything else.

The yardstick: how a lean instruction file should make the agent behave

This is your reference for what "good" looks like. A well-tuned instruction file pushes the agent toward:

For simple, local, and reversible tasks:

  • Direct action, not a plan, assumption list, or confirmation loop.
  • The cheapest relevant check.

For non-trivial tasks:

  • Inspecting only relevant files, conventions, configuration, and tests.
  • The smallest solution that fulfills the request.
  • Validation proportional to blast radius and risk.

And asking one concise question only when a missing answer materially risks an incorrect, incompatible, destructive, costly, or insecure outcome — otherwise making the most reasonable low-risk assumption and mentioning it only if it matters.

When you audit a file, the file is the thing being judged and this behavior is the ruler. Flag any instruction that pushes the agent the other way: mandatory planning steps, redundant confirmations, or validation heavier than the actual risk warrants.

Review process

  1. Identify the file's scope:
  • Global, project, directory, task-specific, or system-level
  • Determine which instructions belong elsewhere
  1. Extract the intended outcomes:
  • Speed, safety, code quality, tool choice, style, communication, or workflow
  1. Audit every rule:
  • Is it actionable?
  • Is it specific enough to guide behavior?
  • Is it redundant with another rule?
  • Is it absolute where it should be conditional?
  • Does it require unnecessary planning, questions, tool calls, or validation?
  • Does it conflict with project conventions or other instructions?
  • Would its absence plausibly cause a meaningful failure?
  1. Classify each rule:
  • Keep
  • Rewrite
  • Merge
  • Move to local documentation
  • Remove
  1. Produce a lean replacement that preserves only high-value constraints.

Rules to reject by default

Remove or challenge instructions that:

  • Require asking permission before ordinary requested code changes
  • Require a plan, explanation of assumptions, or status report for every task
  • Require Git inspection before every small local change
  • Require tests, full builds, or broad checks for every change
  • Forbid standard tools absolutely when the project may rely on them
  • Impose global naming or style rules that local project conventions should decide
  • Invite unrelated cleanup, refactoring, formatting, or "making the codebase better"
  • Duplicate instructions already handled by linters, formatters, tests, CI, or the agent harness
  • Use vague language such as "be smart", "ensure quality", or "think carefully"
  • Add abstractions, dependencies, configurability, or edge-case handling without a demonstrated need

Required output

Reply in this exact structure.

Verdict

State whether the file should be kept, shortened, split, or replaced.

Critical issues

List only issues that materially affect speed, reliability, or instruction conflicts.

For each issue, include:

  • Existing rule or concept
  • Why it is harmful, redundant, vague, or misplaced
  • Recommended action

Proposed file

Provide a complete replacement in one Markdown code block.

Optional local rules

List only rules that should live in project-level or directory-level instructions instead.

Rationale

Use at most five bullets. Explain the main tradeoffs and any deliberate omissions.

Do not include a long theoretical explanation. Do not preserve wording merely because it appears authoritative. Do not invent project facts, commands, tools, conventions, or risks.

Source & license

This open-source skill is cataloged on AgentStack and links to its original source — we do not rehost the code.

Install and usage instructions live in the source repository linked above.

Reviews

No reviews yet — be the first.

Versions

  • v0.1.0 Imported from the upstream source.