agentleFS
rommelporrasrommelporras/kiro-config/skills/agent-audit/SKILL.md

agent-audit

Skill13 starsChanged 7 months agoMITView on GitHub

Audits agents, prompts, skills, knowledge, and documentation for gaps, inconsistencies, and improvement opportunities. Proposes changes for user approval. Triggers on "agent-audit", "audit agents", "review config", "what can we improve".

3 other projects use a version of this.

Adopted by

Most recently taken up by

The file

Show its rules and text

We split this skill into the rules it gives an agent

22 rules. About 0 are common, 12 are distinctive, and 10 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈12

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 10

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Read all of these files:

    line 16
  2. Very specific:

    All files in agents/prompts/

    line 17
  3. Very specific:

    All files in skills/*/SKILL.md (frontmatter only — name, description)

    line 23
  4. Very specific:

    If docs/improvements/pending.md exists, process it before any other analysis:

    line 32
  5. Distinctive:

    Read every entry — each has a date, project path, what went wrong, and a suggested fix

    line 34
  6. Very specific:

    Read the description frontmatter — this is what the orchestrator matches against

    line 49
  7. Distinctive:

    Check: does the trigger description match real user phrasing, or is it written in system terminology?

    line 52
  8. Distinctive:

    Do any rules reference tools, APIs, or patterns that no longer exist?

    line 69
  9. Very specific:

    Check that file paths mentioned in skill-catalog match the actual paths in the skill's SKILL.md content

    line 108
  10. Distinctive:

    Check that file paths in steering docs reference files that exist

    line 109
  11. Distinctive:

    Check that hook scripts referenced in agent JSON hooks exist on disk

    line 110
  12. Distinctive:

    Check that counts in welcome messages match actual counts for that agent's loaded resources

    line 122
  13. Distinctive:

    Check for files on disk that exist in listed directories but are missing from the tree

    line 126
  14. Very specific:

    When the current workspace has a .kiro/ directory (project-level config), also check:

    line 141
  15. Very specific:

    Path validity: Do allowedPaths in agent JSON files reference directories that actually exist?

    line 143
  16. Very specific:

    Knowledge base sources: Do knowledgeBase source paths point to directories that exist?

    line 144
  17. Distinctive:

    Prompt file references: Do file paths mentioned in agent prompts reference files that exist?

    line 145
  18. Distinctive:

    Stale structure references: Do prompts or skills reference folder patterns from a previous project structure?

    line 146
  19. Very specific:

    docs/context/ alignment: If docs/context/ exists, check that steering docs point to it rather than duplicating its content.

    line 147
  20. Very specific:

    After user approves resolved items, move them from docs/improvements/pending.md to docs/improvements/resolved.md.

    line 194
  21. Distinctive:

    When running agent-audit, also check:

    line 198
  22. Distinctive:

    If findings exist, append a "Proactive Suggestions" section to the report.

    line 202

≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Agent Audit

Analyze the current kiro-config and propose improvements.

Announce at start: "Running agent-audit against current kiro-config."

Process

Phase 1: Read current state

Read all of these files:

  • All files in agents/prompts/
  • All files in agents/*.json
  • knowledge/rules.md
  • knowledge/gotchas.md
  • knowledge/episodes.md
  • All files in steering/
  • All files in skills/*/SKILL.md (frontmatter only — name, description)
  • docs/reference/skill-catalog.md
  • docs/reference/security-model.md
  • docs/reference/creating-agents.md
  • README.md
  • docs/improvements/pending.md ← primary input (read first if it exists)

Phase 2: improvements/pending.md analysis

If docs/improvements/pending.md exists, process it before any other analysis:

  • Read every entry — each has a date, project path, what went wrong, and a suggested fix
  • Group entries by root cause type: steering gap | routing issue | missing skill | missing context
  • Identify patterns: 3+ entries with the same root cause = high-priority fix
  • Cross-reference each entry against the current config files to check if it's already been resolved
  • Entries that are already resolved → move to docs/improvements/resolved.md (after user approval)
  • Entries still unresolved → produce actionable proposals: "add X to Y.md", "update routing trigger Z"

Cross-project awareness: Improvement entries include the project path where friction occurred. Use this to identify patterns across projects without scanning those directories directly:

  • Multiple entries from the same project mentioning a language → check if a steering doc exists for that language
  • Routing corrections in entries → check if the routing table has the missing pattern
  • Missing context entries → check if a context doc or gotcha covers that gap

Phase 3: Skill coverage analysis

For each skill in skills/*/SKILL.md:

  • Read the description frontmatter — this is what the orchestrator matches against
  • Compare trigger phrases against how users actually phrase requests (use improvement entries as signal)
  • Flag triggers that are too narrow (miss common phrasings) or too broad (overlap with other skills)
  • Check: does the trigger description match real user phrasing, or is it written in system terminology?

Phase 4: Check agent and skill consistency

  • Agent prompts missing guidance that exists in steering docs
  • Rules in steering that aren't reflected in agent deny lists
  • Gotchas that should be promoted to rules
  • Episodes that have been sitting active for too long
  • Inconsistencies between agents (e.g., one has a deny rule another lacks)
  • Skills referenced in agent configs that don't exist on disk
  • Skills that exist on disk but aren't referenced by any agent
  • deniedCommands lists that differ between subagents (should be identical)

Phase 5: Steering effectiveness check

For each file in steering/:

  • Are the rules specific enough to act on, or are they vague guidance?
  • Do any rules reference tools, APIs, or patterns that no longer exist?
  • Are there rules that contradict each other across steering docs?
  • Flag rules that are too vague: "be careful" → needs a concrete action
  • Flag rules that are outdated: reference deprecated patterns or old file paths

Phase 6: Knowledge hygiene

Review knowledge/episodes.md and knowledge/rules.md:

  • Promotion candidates: Episodes that have recurred 2+ times → propose promoting to a rule
  • Stale rules: Rules that reference resolved issues, deprecated tools, or old file structures
  • Duplication: Any section in knowledge/gotchas.md or knowledge/rules.md longer than 3 lines that substantially overlaps with content in steering docs or agent prompts — gotchas and rules should be short pointers, not full copies of checklists

Phase 7: Routing review

Examine the orchestrator's routing table:

  • Dead routes: Triggers that haven't fired recently (use improvement entries as signal)
  • Overlapping triggers: Two routes with similar trigger words — which one wins?
  • Missing patterns: Improvement entries with "routing correction" root cause → what trigger was missing?
  • Skill trigger drift: Compare skill description frontmatter against the routing table entries that reference them

Phase 8: Check documentation consistency

Cross-reference documentation files against source-of-truth config files:

Skill counts:

  • Count skills/*/SKILL.md files on disk
  • Compare against counts in README.md, agent welcome messages, docs/reference/skill-catalog.md
  • Flag mismatches

Skill assignment matrix:

  • For each agent JSON, extract the skill:// entries from resources
  • Compare against the matrix in docs/reference/skill-catalog.md and README.md
  • Flag any agent that has a skill in its JSON but not in the matrix (or vice versa)

Skill descriptions:

  • For each skill in docs/reference/skill-catalog.md, compare the "Activates when you say..." column against the actual SKILL.md description frontmatter
  • Flag descriptions that have drifted

File paths in docs:

  • Check that file paths mentioned in skill-catalog match the actual paths in the skill's SKILL.md content
  • Check that file paths in steering docs reference files that exist
  • Check that hook scripts referenced in agent JSON hooks exist on disk

Steering and MCP counts:

  • Count steering/*.md files on disk
  • Count MCP servers across all agent configs
  • Compare against counts mentioned in README or docs

Agent tool alignment:

  • For each agent JSON, verify every tool in allowedTools is also in tools
  • Cross-check MCP servers: if an agent references an MCP tool, verify the MCP server is available

Welcome message accuracy:

  • Check that counts in welcome messages match actual counts for that agent's loaded resources

Directory tree verification:

  • For each directory tree in README.md, verify every listed file exists on disk
  • Check for files on disk that exist in listed directories but are missing from the tree
  • Flag any mismatch (file listed but missing, or file exists but unlisted)

Feature count verification:

  • For each count in the Features section (e.g., "N steering docs", "N skills", "N hooks", "N agents"), verify the number against the actual filesystem. Current baseline as of v0.7.0: 12 steering docs, 20 skills, 11 hooks, 11 agents.
  • Flag any count that doesn't match

Phase 9: Check for staleness

  • Rules that may be outdated (platform changes, new features)
  • Gotchas that have been resolved by config changes
  • Agent prompts that reference deprecated patterns

Phase 9.5: Project-level .kiro/ audit

When the current workspace has a .kiro/ directory (project-level config), also check:

  • Path validity: Do allowedPaths in agent JSON files reference directories that actually exist?
  • Knowledge base sources: Do knowledgeBase source paths point to directories that exist?
  • Prompt file references: Do file paths mentioned in agent prompts reference files that exist?
  • Stale structure references: Do prompts or skills reference folder patterns from a previous project structure?
  • docs/context/ alignment: If docs/context/ exists, check that steering docs point to it rather than duplicating its content.

Skip this phase if the workspace has no .kiro/ directory.

Phase 10: Output structured report

## Agent Audit Report — YYYY-MM-DD

### Improvements Backlog (from pending.md)
- [ ] [entry date + project] — proposed fix

### Skill Coverage Gaps
- [ ] [skill] — trigger mismatch or missing phrasing

### Steering Effectiveness
- [ ] [file:rule] — too vague / outdated

### Knowledge Hygiene
- [ ] [episode/rule] — promotion candidate or stale

### Routing Issues
- [ ] [route] — dead / overlapping / missing

### Config Gaps
- [ ] [file] — description of gap

### Documentation Drift
- [ ] [doc file vs source file] — what's inconsistent

### Stale Items
- [ ] [file:line] — what's stale and why

### Proposed Changes
For each finding, include:
- File to modify
- What to change
- Why

### Resolved (pending.md items already fixed)
Items that can be moved to resolved.md.

### No Action Needed
Items reviewed and found current.

Present to user for approval. Never auto-apply changes. After user approves resolved items, move them from docs/improvements/pending.md to docs/improvements/resolved.md.

Proactive Suggestions

When running agent-audit, also check:

  • Are there new Kiro CLI features (check /help, introspect) that could improve the config?
  • Are there patterns in recent sessions that suggest a new rule or gotcha?

If findings exist, append a "Proactive Suggestions" section to the report.

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.