agent-context 0.2.0 → 0.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 788628a6f37f9d5b903a2ff5925198ac462c548c60982dc26bd343c16d3fe385
4
- data.tar.gz: 92906fb976b9190dca498e6c7b1ab8a506c31def843440c244a70fbb0d3bb449
3
+ metadata.gz: 11e3e6b44ae4b564cf5a70031206df479edcc02e716c0c6eadc74e36f8118bd8
4
+ data.tar.gz: fe26f5e667e56ab362581df7b8e591d570a7f666638b12d31baa41daef4667f7
5
5
  SHA512:
6
- metadata.gz: 70e275a751175acbbc81843a8a814d0cbf46d009526aa3d21f60332fdaedd9507d63c98ae49a2f5ccf50491aae064a9c50f25f0bba9e050f4d245fb43b6ba55d
7
- data.tar.gz: ff10810cb0cfe267d39c6f57ea6a75b3cc974a42bd20b3440e2f68fbfaf05ea944b6f155f23d3b00c7918ea4610649b7d60d1195a6fcfe9599e95075793a966c
6
+ metadata.gz: 49995cbd0a102933c17760bf7d11b39d788e1bc91a1b0da6db3ff5cc70b6d047f5d806bf822a3a4e12073ba3cc244b60204ea84466b41d4155ffdb2da940fc83
7
+ data.tar.gz: fdad0c51486de3e66bdd3a7e2eeb9dfd0485dbcaec56256f95e9942489d38270ad9d972640de11f6be3d3de21cdbf2e195e608381153281e0ef31bfe0f6cbd1e
checksums.yaml.gz.sig CHANGED
Binary file
@@ -75,14 +75,14 @@ def install(gem: nil)
75
75
  end
76
76
  end
77
77
 
78
- # Update agent.md after installing context
78
+ # Update agents.md after installing context
79
79
  index = Agent::Context::Index.new(@installer.context_path)
80
- index.update_agent_md
80
+ index.update_agents_md
81
81
  end
82
82
 
83
- # Update or create AGENT.md in the project root with context section
84
- # This follows the AGENT.md specification for agentic coding tools
85
- def agent_md(path = "agent.md")
86
- index = Agent::Context::Index.new(@helper.context_path)
87
- index.update_agent_md(path)
83
+ # Update or create AGENTS.md in the project root with context section
84
+ # This follows the AGENTS.md specification for agentic coding tools
85
+ def agents_md(path = "agents.md")
86
+ index = Agent::Context::Index.new(@installer.context_path)
87
+ index.update_agents_md(path)
88
88
  end
@@ -1,10 +1,26 @@
1
- # Usage Guide
1
+ # Getting Started
2
2
 
3
- ## What is agent-context?
3
+ This guide explains how to use `agent-context`, a tool for discovering and installing contextual information from Ruby gems to help AI agents.
4
+
5
+ ## Overview
4
6
 
5
7
  `agent-context` is a tool that helps you discover and install contextual information from Ruby gems for AI agents. Gems can provide additional documentation, examples, and guidance in a `context/` directory.
6
8
 
7
- ## Quick Commands
9
+ ## Installation
10
+
11
+ Add the gem to your project:
12
+
13
+ ```bash
14
+ $ bundle add agent-context
15
+ ```
16
+
17
+ Then install agent context files:
18
+
19
+ ```bash
20
+ $ bundle exec bake agent:context:install
21
+ ```
22
+
23
+ ## Commands
8
24
 
9
25
  ```bash
10
26
  # See what context is available
@@ -0,0 +1,13 @@
1
+ # Automatically generated context index for Utopia::Project guides.
2
+ # Do not edit then files in this directory directly, instead edit the guides and then run `bake utopia:project:agent:context:update`.
3
+ ---
4
+ description: Install and manage context files from Ruby gems.
5
+ metadata:
6
+ documentation_uri: https://ioquatix.github.io/agent-context/
7
+ funding_uri: https://github.com/sponsors/ioquatix/
8
+ source_code_uri: https://github.com/ioquatix/agent-context.git
9
+ files:
10
+ - path: getting-started.md
11
+ title: Getting Started
12
+ description: This guide explains how to use `agent-context`, a tool for discovering
13
+ and installing contextual information from Ruby gems to help AI agents.
@@ -12,11 +12,11 @@ require "yaml"
12
12
  module Agent
13
13
  # @namespace
14
14
  module Context
15
- # Represents an index for managing and generating agent.md files from context files.
15
+ # Represents an index for managing and generating agents.md files from context files.
16
16
  #
17
- # This class provides functionality to update or create AGENT.md files following
18
- # the AGENT.md specification for agentic coding tools. It can parse existing
19
- # agent.md files, update the context section, and generate new files when needed.
17
+ # This class provides functionality to update or create AGENTS.md files following
18
+ # the AGENTS.md specification for agentic coding tools. It can parse existing
19
+ # agents.md files, update the context section, and generate new files when needed.
20
20
  class Index
21
21
  # Initialize a new index instance.
22
22
  # @parameter context_path [String] The path to the context directory (default: ".context").
@@ -26,18 +26,18 @@ module Agent
26
26
 
27
27
  attr :context_path
28
28
 
29
- # Update or create an AGENT.md file in the project root with context section
30
- # This follows the AGENT.md specification for agentic coding tools
31
- def update_agent_md(agent_md_path = "agent.md")
29
+ # Update or create an AGENTS.md file in the project root with context section
30
+ # This follows the AGENTS.md specification for agentic coding tools
31
+ def update_agents_md(agents_md_path = "agents.md")
32
32
  context_content = generate_context_section
33
33
 
34
- if File.exist?(agent_md_path)
35
- update_existing_agent_md(agent_md_path, context_content)
34
+ if File.exist?(agents_md_path)
35
+ update_existing_agents_md(agents_md_path, context_content)
36
36
  else
37
- create_new_agent_md(agent_md_path, context_content)
37
+ create_new_agents_md(agents_md_path, context_content)
38
38
  end
39
39
 
40
- Console.debug("Updated agent.md: #{agent_md_path}")
40
+ Console.debug("Updated agents.md: #{agents_md_path}")
41
41
  end
42
42
 
43
43
  # Generate just the context section content (without top-level headers)
@@ -100,8 +100,8 @@ module Agent
100
100
 
101
101
  private
102
102
 
103
- def update_existing_agent_md(agent_md_path, context_content)
104
- content = File.read(agent_md_path)
103
+ def update_existing_agents_md(agents_md_path, context_content)
104
+ content = File.read(agents_md_path)
105
105
 
106
106
  # Find the # Agent heading
107
107
  agent_heading_line = find_agent_heading_line(content)
@@ -123,10 +123,10 @@ module Agent
123
123
  end
124
124
 
125
125
  # Write the updated content back to file
126
- File.write(agent_md_path, updated_content)
126
+ File.write(agents_md_path, updated_content)
127
127
  end
128
128
 
129
- def create_new_agent_md(agent_md_path, context_content)
129
+ def create_new_agents_md(agents_md_path, context_content)
130
130
  content = [
131
131
  "# Agent",
132
132
  "",
@@ -134,7 +134,7 @@ module Agent
134
134
  "",
135
135
  context_content,
136
136
  ].join("\n")
137
- File.write(agent_md_path, content)
137
+ File.write(agents_md_path, content)
138
138
  end
139
139
 
140
140
  def find_agent_heading_line(content)
@@ -170,7 +170,6 @@ module Agent
170
170
 
171
171
  {
172
172
  "description" => gem[:summary] || "Context files for #{gem[:name]}",
173
- "version" => gem[:version],
174
173
  "metadata" => gem[:metadata],
175
174
  "files" => files
176
175
  }
@@ -183,7 +182,7 @@ module Agent
183
182
  unless File.exist?(index_path)
184
183
  # Generate dynamic index from gemspec
185
184
  index = generate_dynamic_index(gem, gem_directory)
186
-
185
+
187
186
  # Write the generated index
188
187
  File.write(index_path, index.to_yaml)
189
188
  Console.debug("Generated dynamic index for #{gem[:name]}: #{index_path}")
@@ -196,7 +195,6 @@ module Agent
196
195
  # Return a fallback index
197
196
  {
198
197
  "description" => gem[:summary] || "Context files for #{gem[:name]}",
199
- "version" => gem[:version],
200
198
  "metadata" => gem[:metadata],
201
199
  "files" => []
202
200
  }
@@ -6,6 +6,6 @@
6
6
 
7
7
  module Agent
8
8
  module Context
9
- VERSION = "0.2.0"
9
+ VERSION = "0.3.0"
10
10
  end
11
11
  end
data/post.md CHANGED
@@ -28,11 +28,11 @@
28
28
 
29
29
  **Claude:** "So how does this work in practice?"
30
30
 
31
- **Ruby:** "Let me show you! When a developer runs `bake agent:context:install`, it scans all my installed gems for `context/` directories, copies the files to a `.context/` folder in their project, and generates an `agent.md` file that gives you a comprehensive overview."
31
+ **Ruby:** "Let me show you! When a developer runs `bake agent:context:install`, it scans all my installed gems for `context/` directories, copies the files to a `.context/` folder in their project, and generates an `agents.md` file that gives you a comprehensive overview."
32
32
 
33
- **Claude:** "That sounds perfect! What does this `agent.md` file look like?"
33
+ **Claude:** "That sounds perfect! What does this `agents.md` file look like?"
34
34
 
35
- **Ruby:** "It's structured and organized, following the AGENT.md specification. Here's what it generates:"
35
+ **Ruby:** "It's structured and organized, following the AGENTS.md specification. Here's what it generates:"
36
36
 
37
37
  ```markdown
38
38
  # Agent
@@ -87,26 +87,26 @@ my-awesome-gem/
87
87
 
88
88
  **Claude:** "This is great, but how do I actually access this information? Different AI tools expect different file names and locations."
89
89
 
90
- **Ruby:** "Good question! The generated `agent.md` can be linked to whatever your tool expects:"
90
+ **Ruby:** "Good question! The generated `agents.md` can be linked to whatever your tool expects:"
91
91
 
92
92
  **For Cursor:**
93
- Create `.cursor/rules/agent.mdc` with:
93
+ Create `.cursor/rules/agents.mdc` with:
94
94
 
95
95
  ``` markdown
96
96
  ---
97
97
  alwaysApply: true
98
98
  ---
99
- Read the `agent.md` file in the project root directory for detailed context relating to this project and external dependencies.
99
+ Read the `agents.md` file in the project root directory for detailed context relating to this project and external dependencies.
100
100
  ```
101
101
 
102
102
  **For GitHub Copilot:**
103
103
  ```bash
104
- ln -s ../../agent.md .github/copilot-instructions.md
104
+ ln -s ../../agents.md .github/copilot-instructions.md
105
105
  ```
106
106
 
107
107
  **For Claude Code:**
108
108
  ```bash
109
- ln -s agent.md CLAUDE.md
109
+ ln -s agents.md CLAUDE.md
110
110
  ```
111
111
 
112
112
  **Claude:** "Perfect! So developers can easily integrate this with their preferred AI tools."
data/readme.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # Agent::Context
2
2
 
3
- Provides tools for installing and managing context files from Ruby gems for AI agents, and generating `agent.md` files following the <https://agent.md> specification.
3
+ 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.
4
4
 
5
5
  [![Development Status](https://github.com/ioquatix/agent-context/workflows/Test/badge.svg)](https://github.com/ioquatix/agent-context/actions?workflow=Test)
6
6
 
@@ -8,7 +8,7 @@ Provides tools for installing and managing context files from Ruby gems for AI a
8
8
 
9
9
  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.
10
10
 
11
- When you install context from gems, they are placed in the `.context/` directory and an `agent.md` file is generated or updated to provide a comprehensive overview for AI agents.
11
+ 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.
12
12
 
13
13
  ## Quick Start
14
14
 
@@ -23,8 +23,8 @@ This workflow:
23
23
 
24
24
  - Adds the `agent-context` gem to your project.
25
25
  - Installs context files from all gems into `.context/`.
26
- - Generates or updates `agent.md` with a comprehensive overview.
27
- - Follows the <https://agent.md> specification for agentic coding tools.
26
+ - Generates or updates `agents.md` with a comprehensive overview.
27
+ - Follows the <https://agents.md> specification for agentic coding tools.
28
28
 
29
29
  ## Context
30
30
 
@@ -32,12 +32,14 @@ This gem provides its own context files in the `context/` directory, including:
32
32
 
33
33
  - `usage.md` - Comprehensive guide for using and providing context files.
34
34
 
35
- When you install context from other gems, they will be placed in the `.context/` directory and referenced in `agent.md`.
35
+ When you install context from other gems, they will be placed in the `.context/` directory and referenced in `agents.md`.
36
36
 
37
37
  ## Usage
38
38
 
39
39
  Please see the [project documentation](https://ioquatix.github.io/agent-context/) for more details.
40
40
 
41
+ - [Getting Started](https://ioquatix.github.io/agent-context/guides/getting-started/index) - This guide explains how to use `agent-context`, a tool for discovering and installing contextual information from Ruby gems to help AI agents.
42
+
41
43
  ### Installation
42
44
 
43
45
  Add the `agent-context` gem to your project:
@@ -50,7 +52,7 @@ $ bundle add agent-context
50
52
 
51
53
  #### Install Context (Primary Command)
52
54
 
53
- Install context from all available gems and update `agent.md`:
55
+ Install context from all available gems and update `agents.md`:
54
56
 
55
57
  ``` bash
56
58
  $ bake agent:context:install
@@ -86,10 +88,10 @@ $ bake agent:context:show --gem async --file thread-safety
86
88
 
87
89
  ## Version Control
88
90
 
89
- Both `.context/` and `agent.md` should be committed to git:
91
+ Both `.context/` and `agents.md` should be committed to git:
90
92
 
91
- - `agent.md` is user-facing documentation that should be versioned.
92
- - `.context/` files are referenced by `agent.md` and needed for AI agents to function properly.
93
+ - `agents.md` is user-facing documentation that should be versioned.
94
+ - `.context/` files are referenced by `agents.md` and needed for AI agents to function properly.
93
95
  - This ensures AI agents in CI have access to the full context.
94
96
 
95
97
  ## Providing Context in Your Gem
@@ -123,69 +125,14 @@ files:
123
125
 
124
126
  If no `index.yaml` is provided, one will be generated automatically from your gemspec and markdown files.
125
127
 
126
- ## AI Tool Integration
127
-
128
- The generated `agent.md` file can be integrated with various AI coding tools by creating symbolic links to their expected locations:
129
-
130
- ### Cline
131
-
132
- ``` bash
133
- ln -s agent.md .clinerules
134
- ```
135
-
136
- ### Claude Code
137
-
138
- ``` bash
139
- ln -s agent.md CLAUDE.md
140
- ```
141
-
142
- ### Cursor
143
-
144
- First, create the `.cursor/rules` directory:
145
-
146
- ``` bash
147
- mkdir -p .cursor/rules
148
- ```
149
-
150
- Then create `.cursor/rules/agent.mdc` with:
151
-
152
- ``` markdown
153
- ---
154
- alwaysApply: true
155
- ---
156
- Read the `agent.md` file in the project root directory for detailed context relating to this project and external dependencies.
157
- ```
158
-
159
- This approach uses Cursor's proper front-matter format and directs the AI to consult the main `agent.md` file.
160
-
161
- ### Gemini CLI, OpenAI Codex, OpenCode
162
-
163
- ``` bash
164
- ln -s agent.md AGENTS.md
165
- ```
166
-
167
- ### GitHub Copilot
168
-
169
- ``` bash
170
- ln -s ../../agent.md .github/copilot-instructions.md
171
- ```
172
-
173
- ### Replit
174
-
175
- ``` bash
176
- ln -s agent.md .replit.md
177
- ```
178
-
179
- ### Windsurf
180
-
181
- ``` bash
182
- ln -s agent.md .windsurfrules
183
- ```
184
-
185
128
  ## Releases
186
129
 
187
130
  Please see the [project releases](https://ioquatix.github.io/agent-context/releases/index) for all releases.
188
131
 
132
+ ### v0.3.0
133
+
134
+ - Rename `agent.md` -\> `agents.md`.
135
+
189
136
  ### v0.2.0
190
137
 
191
138
  - Don't limit description length.
data/releases.md CHANGED
@@ -1,5 +1,9 @@
1
1
  # Releases
2
2
 
3
+ ## v0.3.0
4
+
5
+ - Rename `agent.md` -\> `agents.md`.
6
+
3
7
  ## v0.2.0
4
8
 
5
9
  - Don't limit description length.
data.tar.gz.sig CHANGED
@@ -1 +1,3 @@
1
- A�AJ}P����7h��t�==P�B�Y2����a{��U�����MeP�/0��@���ET�(7����iu���R����fJ8�ʲ�sP�zS^Gڊz�(d����u�#k5A����/z�s�y�]f�/�y�6w�T|gT[Gqf7��KǾ�%ш��N6��F� �n��+����4S�H�:1>�W٦C1��V��_wy}��)�%c2�GƮ��ضV��Yiӆx7�!T���_qq���2�[�q�O�T�W��j���rh��c�hY2����,��\�W"|�����D9���.�ݔ|�p���PM�������~��+�j�^Z�ui]@���!�B\����Gjkrw��P˕��NM%hDć}K
1
+ i>J9k���7�TZ�V�{ c���t_7$38�#��iz����fǦ�M�׀�
2
+ �m
3
+ �&���,U_q�c4�U_��� wH����O.d)��8�8�T9�s�eQř����q@��V�3e��0Cf����ל_c��]��������/Ь[��:ӧ �Y+�'Z�&v�~?�<�sL�x���az�$�$��'�s�:��L��Jy����y��q���_ڣ�6s���m���;�g���E\��l*�U�eq�����{�L^Y�ʅ�\�_�N ƌ<��宂�\�z �O� Ip��F� ץ���"
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: agent-context
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Samuel Williams
@@ -57,9 +57,9 @@ executables: []
57
57
  extensions: []
58
58
  extra_rdoc_files: []
59
59
  files:
60
- - agent.md
61
60
  - bake/agent/context.rb
62
- - context/usage.md
61
+ - context/getting-started.md
62
+ - context/index.yaml
63
63
  - lib/agent/context.rb
64
64
  - lib/agent/context/index.rb
65
65
  - lib/agent/context/installer.rb
metadata.gz.sig CHANGED
Binary file
data/agent.md DELETED
@@ -1,41 +0,0 @@
1
- # Agent
2
-
3
- ## Context
4
-
5
- This section provides links to documentation from installed packages. It is automatically generated and may be updated by running `bake agent:context:install`.
6
-
7
- **Important:** Before performing any code, documentation, or analysis tasks, always read and apply the full content of any relevant documentation referenced in the following sections. These context files contain authoritative standards and best practices for documentation, code style, and project-specific workflows. **Do not proceed with any actions until you have read and incorporated the guidance from relevant context files.**
8
-
9
- **Setup Instructions:** If the referenced files are not present or if dependencies have been updated, run `bake agent:context:install` to install the latest context files.
10
-
11
- ### decode
12
-
13
- Code analysis for documentation generation.
14
-
15
- #### [Getting Started with Decode](.context/decode/getting-started.md)
16
-
17
- The Decode gem provides programmatic access to Ruby code structure and metadata. It can parse Ruby files and extract definitions, comments, and documentation pragmas, enabling code analysis, docume...
18
-
19
- #### [Documentation Coverage](.context/decode/coverage.md)
20
-
21
- This guide explains how to test and monitor documentation coverage in your Ruby projects using the Decode gem's built-in bake tasks.
22
-
23
- #### [Ruby Documentation](.context/decode/ruby-documentation.md)
24
-
25
- This guide covers documentation practices and pragmas supported by the Decode gem for documenting Ruby code. These pragmas provide structured documentation that can be parsed and used to generate A...
26
-
27
- ### sus
28
-
29
- A fast and scalable test runner.
30
-
31
- #### [Using Sus Testing Framework](.context/sus/usage.md)
32
-
33
- Sus is a modern Ruby testing framework that provides a clean, BDD-style syntax for writing tests. It's designed to be fast, simple, and expressive.
34
-
35
- #### [Mocking](.context/sus/mocking.md)
36
-
37
- There are two types of mocking in sus: `receive` and `mock`. The `receive` matcher is a subset of full mocking and is used to set expectations on method calls, while `mock` can be used to replace m...
38
-
39
- #### [Shared Test Behaviors and Fixtures](.context/sus/shared.md)
40
-
41
- Sus provides shared test contexts which can be used to define common behaviours or tests that can be reused across one or more test files.