Skip to content

About

The agent skill for Context-Generic Programming (CGP): it helps coding agents read, write, debug, and explain CGP code in Rust.

Topics

Resources

Stars

1 star

Watchers

0 watching

Forks

Repository files navigation

License Tests

cgp-skills: agent skills for CGP

A coding agent that meets Context-Generic Programming (CGP) in a Rust project starts with little reliable knowledge of it. CGP's macros generate traits and impls the agent never sees, and what it learned in training may show syntax the library no longer accepts. This repository holds the /cgp skill, which teaches an agent to read, write, debug, and explain CGP code. The agent loads it when a task involves CGP, so you can ask about wiring or a confusing compile error and get an answer in CGP's own terms.

The skill supports cgp v0.8.0 and every later release, though not an older cgp. Because it keeps improving between releases, you install it from this repository's main branch and update it from there. It is plain Markdown, with no scripts, and it summarizes the CGP knowledge base, which it links for detail.

Website · Installation · Quickstart · Reference

Installing the skill

The quickest route is to give your agent this repository's URL, https://github.com/contextgeneric/cgp-skills, and ask it to install the /cgp skill. The steps below are written for it as much as for you. The website's installation page covers each harness in more detail.

If you are an agent installing this skill, follow these steps:

  1. Ask the user whether to install the skill for them in every project, or only in the current project, where it can be committed for the whole team.
  2. Use the harness's own installer when it has one, from the list below.
  3. Otherwise copy the cgp/ directory from the main branch into the harness's skills directory from the table further down. Copy it rather than linking a clone, and keep SKILL.md and references/ together.
  4. Install through one route only, because a plugin and a copy together give the harness two copies of the skill.
  5. Check that the harness now lists a skill named cgp, which may need a new session.
  6. Change no other setting without asking.

These harnesses and tools have their own installers, and each one takes the skill from main:

  • Claude Code: run /plugin marketplace add contextgeneric/cgp-skills, then /plugin install cgp@cgp-skills. The plugin's skill is /cgp:cgp.
  • Codex: run codex plugin marketplace add contextgeneric/cgp-skills, then codex plugin add cgp@cgp-skills. Codex lists the skill as cgp:cgp. Its built-in $skill-installer can also install https://github.com/contextgeneric/cgp-skills/tree/main/cgp when asked.
  • Gemini CLI: run gemini skills install https://github.com/contextgeneric/cgp-skills.git --path cgp, which takes the default branch, main.
  • Pi: run pi install git:github.com/contextgeneric/cgp-skills, adding -l to install it for the current project.
  • Any agent the installers support: run npx skills add contextgeneric/cgp-skills --skill cgp, adding -g to install it for every project. It sends anonymous telemetry unless DISABLE_TELEMETRY=1 is set. The GitHub CLI does the same with gh skill install contextgeneric/cgp-skills cgp, choosing the harness with --agent and the scope with --scope.

To copy the skill by hand, clone the repository and copy cgp/ into the directory this table gives for your harness:

Harness For you, in every project For one project
Claude Code ~/.claude/skills/cgp .claude/skills/cgp
Codex ~/.agents/skills/cgp .agents/skills/cgp
Cursor ~/.cursor/skills/cgp .cursor/skills/cgp
GitHub Copilot and VS Code ~/.copilot/skills/cgp .github/skills/cgp
Gemini CLI ~/.gemini/skills/cgp .gemini/skills/cgp
OpenCode ~/.config/opencode/skills/cgp .opencode/skills/cgp
Pi and most other agents ~/.agents/skills/cgp .agents/skills/cgp

For Claude Code, installing for yourself, the commands are:

git clone --depth 1 https://github.com/contextgeneric/cgp-skills.git
mkdir -p ~/.claude/skills
cp -R cgp-skills/cgp ~/.claude/skills/cgp

A copied skill is /cgp in Claude Code.

Updating the skill

Fixes and better explanations reach main between cgp releases, so update the skill from time to time, and whenever your project moves to a newer cgp. The skill helps with the second case: when the project's cgp is newer than the releases it describes, it has the agent check main and tell you when a newer skill is there. Each route updates with its own command:

  • Claude Code: run claude plugin marketplace update cgp-skills, then claude plugin update cgp@cgp-skills, and start a new session. To have it update by itself, open /plugin, select cgp-skills in the Marketplaces tab, and choose Enable auto-update, which is off for marketplaces outside Anthropic's own.
  • Codex: run codex plugin marketplace upgrade cgp-skills, then codex plugin add cgp@cgp-skills.
  • Gemini CLI: it has no update command, so run gemini skills uninstall cgp, then install the skill again.
  • Pi: run pi update --extensions. A plain pi update updates only Pi itself.
  • npx skills and the GitHub CLI: run npx skills update cgp, adding -g for an install in every project, or gh skill update cgp.
  • A copy: remove the old directory and copy cgp/ again from a fresh clone, since cp -R puts a new copy inside an existing directory.

What the skill covers

cgp is the foundational skill for CGP in Rust. Its SKILL.md explains consumer and provider traits, wiring, and impl-side dependencies, and recommends cargo-cgp for readable errors. From there it sends the agent to the reference that owns the task at hand:

How the skill relates to the knowledge base

A skill has to fit in an agent's context window, so it gathers the core concepts, the common constructs, and worked examples from across the knowledge base, and links the online reference for what it leaves out. The knowledge base, by contrast, gives the exhaustive account: every construct, the internals, the examples, and the comparisons with other approaches. Where the code and either document disagree, the CGP source is the authority.

The skill teaches an agent rather than a person. If you are learning CGP yourself, start at the website with the quickstart and the tutorials. Either way, review what an agent writes with the skill as you would any other change.

Checks

CI runs python3 scripts/check.py, which checks that each file has exactly one # heading, that the relative links inside cgp/ resolve, and that the skill's frontmatter meets the Agent Skills specification: its name matches its directory, its description stays within 1024 characters, and it sets a license. It also checks that the plugin manifests and package.json parse as JSON and agree with the skill: skills paths that hold a SKILL.md, descriptions that match the skill's first sentence, and no version in plugin.json or package.json, so a plugin install takes every commit on main as an update. Finally, it checks that the versions SKILL.md states match the table in versions.

Related repositories

sibling-projects.md lists the related repositories, and contributors follow AGENTS.md, which keeps the skill in step with the code and the knowledge base.

License

Licensed under the Apache License, Version 2.0.

About

The agent skill for Context-Generic Programming (CGP): it helps coding agents read, write, debug, and explain CGP code in Rust.

Topics

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages