Back/Engineering/Codex/GitHub Copilot
AdvancedEngineeringCodexGitHub Copilot

Build a Self-Improving AI to Generate Agent Skills in Codex

Use a Codex Automation to create a 'meta-agent' that analyzes your codebase, identifies opportunities for new reusable agent skills, and then spawns sub-agents to automatically test and validate those new skills.

Build a Self-Improving AI to Generate Agent Skills in Codex

Tools Used

Codex

OpenAI's cloud-based AI software engineering agent that can execute code, run tests, and handle complex multi-file tasks autonomously.

GitHub Copilot

AI pair programmer

02Step-by-Step Guide
1

Customize the 'Suggest Skills' Automation

In Codex, start with the 'From recent PRs and reviews suggest next skills to deepen' automation template. Set it to run on a recurring schedule, such as weekly on Fridays.

2

Enhance the Prompt with a Validation Loop

Modify the template's prompt to be more specific. Instruct the agent not only to identify potential new skills (like from a command-line tool) but also to validate them by spawning a sub-agent with a specific goal to test the skill against the main branch.

Prompt:
If you identify a skill, spin up its own thread and use that skill... validated against the base branch of the repo. We want to confirm that the skill actually works and outputs high quality... You should use a goal when validating the skill.
3

Run the Automation and Observe Sub-Agents

Execute the automation. The main agent will scan your GitHub history and begin delegating tasks. Monitor the chat list to see new sub-agents being created, each with a specific goal to validate a potential new skill.

4

Review and Implement Validated Skills

Once the sub-agents complete their goal-based loops, they will have confirmed which new skills are functional. You can then formally add these validated skills to your agent's reusable skill library, completing the self-improvement cycle.

Pro Tip: This process can be token-intensive. Monitor your costs, especially when first setting up the loops and sub-agents.

Start shipping
better products.

Join 100,000+ product managers who use ChatPRD to write better docs, align teams faster, and build products users love.

Free to start
No credit card
SOC 2 certified
Enterprise ready