evolve-ai-layer
Skill0 starsChanged 6 months agoMITView on GitHub
Use this skill when improving the AI layer — updating AGENTS.md, creating or editing rules, adding skills, refining commands, or diagnosing why the agent made a mistake. Triggers: 'update rules', 'improve AGENTS.md', 'add a rule', 'create a skill', 'why did you do that wrong', 'the agent keeps making this mistake', 'evolve', 'meta-reasoning'. Provides patterns for systematically improving the AI context system.
In this repository55 other files it gives its agents.
- AGENTS.mdAGENTS.md
- CLAUDE.mdCLAUDE.md
- agent-developmentSkill
- agent-teamsSkill
- ai-sdkSkill
- analyzing-financial-statementsSkill
- cache-componentsSkill
- chrome-devtoolsSkill
- Codex-automation-recommenderSkill
- Codex-md-improverSkill
- code-reviewSkill
- Command DevelopmentSkill
- creating-financial-modelsSkill
- data-visualizationSkill
- debugSkill
- develop-ai-functions-exampleSkill
- excalidraw-diagramSkill
- find-skillsSkill
- frontend-designSkill
- Hook DevelopmentSkill
- make-skill-templateSkill
- markdown-to-htmlSkill
- mcp-builderSkill
- MCP IntegrationSkill
- pdfSkill
- playwrightSkill
- Plugin SettingsSkill
- Plugin StructureSkill
- refactorSkill
- researchSkill
- security-best-practicesSkill
- skill-creatorSkill
- Skill DevelopmentSkill
- smithery-ai-cliSkill
- source-command-commit-and-deploySkill
- source-command-commitSkill
- source-command-create-prdSkill
- source-command-create-rulesSkill
- source-command-empty-redeploySkill
- source-command-evaluateSkill
- source-command-executeSkill
- source-command-handoffSkill
- source-command-plan-featureSkill
- source-command-primeSkill
- source-command-reviewSkill
- source-command-self-healSkill
- source-command-validateSkill
- sql-queriesSkill
- statistical-analysisSkill
- vscode-ext-localizationSkill
- webapp-testingSkill
- web-artifacts-builderSkill
- web-design-guidelinesSkill
- Writing Hookify RulesSkill
- xlsxSkill
The file
We split this skill into the rules it gives an agent
5 rules. About 0 are common, 3 are distinctive, and 2 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈3
Distinctive · estimate
This author's own choices. Worth a look.
2
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 13
When something went wrong, categorize the root cause:
- Distinctive: line 34
Keep it under 500 lines — this loads EVERY session
- Very specific: line 37
If a rule only applies to one area, move it to .Codex/rules/ instead
- Distinctive: line 92
Start with a clear header summarizing what the doc covers and when it's relevant — sub-agents read this to decide whether to load the full …
- Very specific: line 109
Test the change — run /prime and check the agent's understanding
≈ “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.
Files
Evolve AI Layer Skill
When to Use
The agent should read this skill when asked to improve the AI context layer — rules, commands, skills, on-demand docs — or when diagnosing repeated mistakes.
Diagnosis: Why Did the Agent Make a Mistake?
When something went wrong, categorize the root cause:
| Root Cause | Fix Location |
| Wrong coding pattern used | AGENTS.md code patterns section |
| Wrong pattern in specific area | .Codex/rules/{area}.md |
| Didn't know about a library gotcha | .Codex/docs/{library}.md |
| Made an assumption about requirements | Improve /plan-feature question phase |
| Forgot a step in a workflow | .Codex/commands/{workflow}.md |
| Repeated a dead-end approach | Add to /handoff or commit message |
| Didn't validate properly | Update /validate or /execute validation |
Updating AGENTS.md
When to Update
- A pattern was wrong or missing
- Commands changed (new dev/test/build commands)
- Architecture changed (new modules, changed data flow)
- A convention should be enforced project-wide
Rules for AGENTS.md
- Keep it under 500 lines — this loads EVERY session
- Be specific: "Use
zodfor API input validation" not "validate inputs" - Include the WHY when a rule isn't obvious
- If a rule only applies to one area, move it to
.Codex/rules/instead
Creating On-Demand Rules
When to Create
- Conventions specific to one part of the codebase
- Detailed patterns too long for AGENTS.md
- Guidelines that only matter when working in certain files
Structure
---
paths:
- "src/area/**"
- "**/*.pattern.ts"
---
# {Area} Conventions
## Key Patterns
{The most important things to know}
## Do / Don't
- ✅ Do this
- ❌ Don't do that
## Examples
{Actual code examples from this codebase}Creating Skills
When to Create
- The agent needs specialized knowledge for a type of task
- A process has multiple steps that should be followed consistently
- Knowledge that applies across projects (debugging, reviewing, researching)
Structure
.Codex/skills/{skill-name}/
└── SKILL.mdThe description in frontmatter is what the agent sees first. Make it keyword-rich so the agent knows when to load the full skill.
Creating Reference Docs
When to Create
- Deep technical documentation (architecture, data model, integrations)
- Content too heavy for rules (200+ lines)
- Knowledge that sub-agents should scout before the main agent loads
Location
.Codex/docs/{topic}.md
Start with a clear header summarizing what the doc covers and when it's relevant — sub-agents read this to decide whether to load the full document.
Updating Commands
When to Update
- The workflow has a step that keeps getting missed
- Validation needs to be more thorough
- A new project pattern should be part of the standard flow
Remember
- Commands are what YOU invoke (
/commit,/prime) - Skills are what the AGENT decides to read
- Rules auto-load based on file paths
- Docs are loaded by scout sub-agents
After Evolving
- Test the change — run
/primeand check the agent's understanding - Include AI layer changes in your next
/commit(the Context section) - Note the change in your git log so future sessions understand the evolution
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
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.

