Provides tools for installing and managing context files and skills from Ruby gems for AI agents.
This gem allows you to install and manage context files from other gems. Gems can provide context files in a context/ directory in their root, which can contain documentation, configuration examples, migration guides, and other contextual information for AI agents.
When you install context from gems, ordinary guides are placed in .agents/context/ and dependency skills in .agents/skills/. Browse .agents/context/GEM/ or use the list/show commands to find relevant guides.
Add the gem to your project and install context from all available gems:
$ bundle add agent-context
$ bake agent:context:installThis workflow:
- Adds the
agent-contextgem to your project. - Installs context files from all gems into
.agents/context/. - Installs metadata-declared skills into
.agents/skills/.
This gem provides its own context files in the context/ directory, including:
getting-started.md- Comprehensive guide for using and providing context files and skills.usage.md- Agent instructions for finding dependency guidance and managing context and skills, installed as theagent-context-usageskill.
When you install context from other gems, they will be placed in .agents/context/.
Please see the project documentation for more details.
- Getting Started - This guide explains how to install package guidance and skills using
agent-context.
Add the agent-context gem to your project:
$ bundle add agent-contextInstall ordinary context and skills from all available gems:
$ bake agent:context:installInstall context from a specific gem:
$ bake agent:context:install --gem asyncList all gems that have context available:
$ bake agent:context:listList context files for a specific gem:
$ bake agent:context:list --gem asyncShow the content of a specific context file:
$ bake agent:context:show --gem async --file thread-safetyThe context list marks skill documents with (skill), and the show and install tasks handle them alongside ordinary context. agent-context includes skill discovery and installation directly. Use it for Ruby dependency skills; the standalone agent-skills gem is deprecated.
In your repository instructions, direct agents to read relevant Markdown guides under .agents/context/GEM/ and apply matching skills from .agents/skills/. Run installation after changing dependencies.
Installation maintains a marked block in the local Git exclude file, discovered through git rev-parse --git-path info/exclude. It excludes generated context, ownership files, and exact dependency-installed skill directories. Track project-owned instructions and skills under .agents/. Remove any blanket /.agents/ rule from your project's .gitignore when adopting this layout. Re-run installation in each checkout.
To provide context files in your gem, create a context/ directory in your gem's root:
your-gem/
├── context/
│ ├── getting-started.md
│ ├── usage.md
│ └── configuration.md
├── lib/
└── your-gem.gemspec
Use descriptive filenames and focused Markdown guides. Agents find the installed files through directory listing and the list/show commands.
A root-level context document can declare a skill:
---
metadata:
type: skill
description: Run the provider's workflow when preparing a new project.
license: MIT
---
# Workflow
Follow these instructions.context/workflow.md from gem provider defaults to .agents/skills/provider-workflow/SKILL.md. Resources in context/workflow/ are copied alongside the instructions. Installed names have a 64-character limit; descriptions have a 1,024-character limit. The generated instructions include additional skill metadata.
Skills are discovered through metadata.type: skill metadata in context/*.md, matching bake-agent-context-rust. Include context/**/* in your gem's file list. Authored skill names are preserved; missing names default to <package>-<filename>.
Installed SKILL.md front matter records metadata.type: skill and the resolved metadata.ecosystem, metadata.package, and metadata.version. Ruby refreshes reconcile skills within their selected ecosystem and package scope. A full refresh also removes skills from removed or empty providers. After resolving an installation error, rerun the command to refresh generated files.
See the portable specification and Getting Started.
Please see the project releases for all releases.
- Resolve context source filenames before installed skill names and show authored content consistently.
- Install unfamiliar context types as ordinary guidance so providers can introduce new types.
- Store resolved skill provenance in
SKILL.mdfront matter undermetadata, withmetadata.type: skilldeclaring skills. - Preserve authored names, descriptions, additional metadata, and the original Markdown body using native front matter AST nodes.
- Share loaded documents between context and skill installation, and use direct writes with rerunnable progress.
- Discover dependency guidance through installed Markdown files and the list/show commands. Remove generated indexes and the
agent:context:indextask.
- Rename
agent.md->agents.md.
- Don't limit description length.
- Bake — The bake task execution tool.
We welcome contributions to this project.
Read the architecture design for the current Ruby and Rust boundaries and the proposed alignment work.
- Fork the repository.
- Create your feature branch (
git checkout -b my-new-feature). - Commit your changes (
git commit -am 'Add some feature.'). - Push to the branch (
git push origin my-new-feature). - Create a new pull request.
To run the test suite:
$ bundle exec susTo prepare a release branch and open a pull request from an up-to-date main:
$ bundle exec bake gem:github:release:patch # or minor or majorSee bake-gem-github for setup, remote releases, and recovery.
In order to protect users of this project, we require all contributors to comply with the Developer Certificate of Origin. This ensures that all contributions are properly licensed and attributed.
This project is best served by a collaborative and respectful environment. Treat each other professionally, respect differing viewpoints, and engage constructively. Harassment, discrimination, or harmful behavior is not tolerated. Communicate clearly, listen actively, and support one another. If any issues arise, please inform the project maintainers.