Provides tools for installing and managing context files from Ruby gems for AI agents, and generating agents.md files following the https://agents.md specification.
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, they are placed in the .context/ directory and an agents.md file is generated or updated to provide a comprehensive overview for AI agents.
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
.context/. - Generates or updates
agents.mdwith a comprehensive overview. - Follows the https://agents.md specification for agentic coding tools.
This gem provides its own context files in the context/ directory, including:
usage.md- Comprehensive guide for using and providing context files.
When you install context from other gems, they will be placed in the .context/ directory and referenced in agents.md.
Please see the project documentation for more details.
- Getting Started - This guide explains how to use
agent-context, a tool for discovering and installing contextual information from Ruby gems to help AI agents.
Add the agent-context gem to your project:
$ bundle add agent-contextInstall context from all available gems and update agents.md:
$ 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-safetyBoth .context/ and agents.md should be committed to git:
agents.mdis user-facing documentation that should be versioned..context/files are referenced byagents.mdand needed for AI agents to function properly.- This ensures AI agents in CI have access to the full context.
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
│ └── index.yaml (optional)
├── lib/
└── your-gem.gemspec
You can provide a custom index.yaml file to control ordering and metadata:
description: "Your gem description from gemspec"
version: "1.0.0"
files:
- path: getting-started.md
title: "Getting Started"
description: "Quick start guide"
- path: usage.md
title: "Usage Guide"
description: "Detailed usage instructions"If no index.yaml is provided, one will be generated automatically from your gemspec and markdown files.
Please see the project releases for all releases.
- Rename
agent.md->agents.md.
- Don't limit description length.
- Bake — The bake task execution tool.
We welcome contributions to this project.
- Fork it.
- 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 new Pull Request.
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.