Skip to main content

AI-Assisted Development

If you use a coding agent to work with Context-Generic Programming (CGP), a Rust library that lets you write several implementations of a trait and choose which one each type uses, the agent needs more information about CGP than its training provides. This section explains how to give your agent that information. It also explains how the CGP project itself uses agents, including how much of the documentation they write and how that work is checked.

Working with CGP through an agent​

Much of what has been published about CGP shows syntax the library no longer accepts. An agent reading your code also cannot see what CGP's macros generate from it. To fill these gaps, CGP provides an agent skill that teaches the agent CGP's vocabulary, its current syntax, and how to read its compile errors. The skill draws on a knowledge base that holds the complete record behind it.

Together, the skill and knowledge base can make it easier to learn CGP, write its wiring, and read its diagnostics. Your agent can still write wrong code, though, so review what it produces as you would any other change.

Choose the page for what you want to do:

The skill and knowledge base are written for agents. If you want to learn CGP yourself, start with the tutorials and the Concepts pages.

How the CGP project uses AI​

AI agents write most of CGP's documentation and most of cargo-cgp, maintain much of its test suite, and help implement parts of the library. The author designs every CGP construct and writes the core library almost entirely by hand. The following pages explain who does this work and how it is checked:


An AI agent wrote this page using the CGP knowledge base. See How AI is used in this project.