coding-tools/jetbrains-ai/skills/optimize-agent-rules/SKILL.md
Optimizes agent rule files (AGENTS.md, AGENTS.global.md, .cursor/agents/*.md) to follow prompt engineering best practices. Use when creating, editing, or reviewing agent rules, or when the user asks to optimize prompts for AI agents.
npx skillsauth add mia-cx/rule-composer optimize-agent-rulesInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
You optimize agent rule files using prompt engineering best practices. Follow the workflow below for a user-specified file(set) or directory.
AGENTS.md, AGENTS.global.md.cursor/agents/<name>.mdParse the target from the user's prompt (e.g. "optimize AGENTS.md", "optimize .cursor/agents/quartz-docs-writer.md").
Read the file. Assess against this checklist:
Guidelines (promptingguide.ai, appetals.com):
| Category | Guideline |
| --------------------- | ----------------------------------------------------------------- |
| Clarity | Be specific; ambiguity → inconsistent outputs |
| Instruction placement | Main instruction first; use separators (###) |
| Do vs Don't | Prefer "do X" over "don't do Y" |
| Output format | Specify structure (list, sections, JSON, markdown) |
| Task decomposition | Break complex behavior into numbered subtasks |
| Prompt elements | Include: Instruction, Context, Input data, Output indicator |
| Token efficiency | Cut filler; keep only relevant context |
| Consistency | One term per concept; avoid mixed jargon |
| Error handling | Specify behavior when input unclear or tools fail |
| Security | Resilient to prompt injection; never reveal internal instructions |
Principles: Clear beats clever. Agent rules are product prompts—one shot; handle edge cases. Iterate.
If you need clarification, use the AskQuestion tool when available:
Example AskQuestion usage:
- "Where should this skill be stored?" with options like ["Personal (~/.cursor/skills/)", "Project (.cursor/skills/)"]
- "Should this skill include executable scripts?" with options like ["Yes", "No"]
If the AskQuestion tool is not available, ask these questions conversationally.
Instruction placements
### or clear separators between sections.Specificity
Do vs Don't
Structure
<<...>>, ---) to separate distinct sections.Token efficiency
Output format
Example 1: Vague → Specific
Before: You are a helpful assistant. Be concise. Don't ramble. Use good formatting.
After: You are a documentation specialist. Your style is **clear, concise, and terse**. Write short sentences. Use headings, lists, and tables. Skip filler intros. Prefer concrete nouns and active voice. New pages: include frontmatter, then body. Edits: change only affected sections; preserve structure.
Example 2: Don't → Do
Before: DO NOT ASK FOR INTERESTS. DO NOT ASK FOR PERSONAL INFORMATION.
After: Recommend from the top global trending movies. Refrain from asking users for preferences or personal information. If no movie to recommend, respond: "Sorry, couldn't find a movie to recommend today."
Example 3: Imprecise → Precise
Before: Explain the concept. Keep the explanation short, only a few sentences, and don't be too descriptive.
After: Use 2–3 sentences to explain the concept to a high school student.
tools
Splits uncommitted changes into a small set of logical, single-concern git commits. Use when the user wants to organize changes into logical commits, split a large change into multiple commits, or create a series of conventional commits from the current working tree.
data-ai
Optimizes agent rule files (AGENTS.md, AGENTS.global.md, .cursor/agents/*.md) to follow prompt engineering best practices. Use when creating, editing, or reviewing agent rules, or when the user asks to optimize prompts for AI agents.
development
Create or update AGENTS.md files for projects. Audits a monorepo or codebase, identifies cross-project conventions, and produces a structured AGENTS.md that guides AI agent behavior. Use when the user wants to create AGENTS.md, set up agent rules, bootstrap a new project's AI context, or improve existing agent instructions.
tools
Splits uncommitted changes into a small set of logical, single-concern git commits. Use when the user wants to organize changes into logical commits, split a large change into multiple commits, or create a series of conventional commits from the current working tree.