x_aeon_agents 1.0.28

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.
Files changed (48) hide show
  1. checksums.yaml +7 -0
  2. data/AGENTS.md +136 -0
  3. data/CHANGELOG.md +398 -0
  4. data/README.md +579 -0
  5. data/TODO.md +48 -0
  6. data/bin/xaa +5 -0
  7. data/lib/x_aeon_agents/agent_defaults.rb +60 -0
  8. data/lib/x_aeon_agents/agent_options.rb +58 -0
  9. data/lib/x_aeon_agents/agents/coder_agent.rb +82 -0
  10. data/lib/x_aeon_agents/agents/committer_agent.rb +71 -0
  11. data/lib/x_aeon_agents/agents/developer_agent.rb +235 -0
  12. data/lib/x_aeon_agents/agents/diff_interpreter_agent.rb +80 -0
  13. data/lib/x_aeon_agents/agents/documenter_agent.rb +44 -0
  14. data/lib/x_aeon_agents/agents/executor_agent.rb +9 -0
  15. data/lib/x_aeon_agents/agents/feedback_analyst_agent.rb +62 -0
  16. data/lib/x_aeon_agents/agents/gh_comments.gql +64 -0
  17. data/lib/x_aeon_agents/agents/git_diff_interpreter_agent.rb +57 -0
  18. data/lib/x_aeon_agents/agents/issue_implementer_agent.rb +88 -0
  19. data/lib/x_aeon_agents/agents/one_line_code_diff_summarizer_agent.rb +57 -0
  20. data/lib/x_aeon_agents/agents/plan_generator_agent.rb +51 -0
  21. data/lib/x_aeon_agents/agents/planner_agent.rb +89 -0
  22. data/lib/x_aeon_agents/agents/pull_request_creator_agent.rb +144 -0
  23. data/lib/x_aeon_agents/agents/readme/about_analyzer_agent.rb +55 -0
  24. data/lib/x_aeon_agents/agents/readme/contributing_agent.rb +47 -0
  25. data/lib/x_aeon_agents/agents/readme/development_agent.rb +54 -0
  26. data/lib/x_aeon_agents/agents/readme/documentation_agent.rb +43 -0
  27. data/lib/x_aeon_agents/agents/readme/features_agent.rb +45 -0
  28. data/lib/x_aeon_agents/agents/readme/how_it_works_agent.rb +47 -0
  29. data/lib/x_aeon_agents/agents/readme/license_agent.rb +43 -0
  30. data/lib/x_aeon_agents/agents/readme/public_api_agent.rb +44 -0
  31. data/lib/x_aeon_agents/agents/readme/quick_start_agent.rb +50 -0
  32. data/lib/x_aeon_agents/agents/readme/requirements_agent.rb +43 -0
  33. data/lib/x_aeon_agents/agents/readme_generator_agent.rb +438 -0
  34. data/lib/x_aeon_agents/agents/review_resolver_agent.rb +236 -0
  35. data/lib/x_aeon_agents/agents/review_responder_agent.rb +64 -0
  36. data/lib/x_aeon_agents/agents/skill_generator_agent.rb +95 -0
  37. data/lib/x_aeon_agents/agents/skill_installer_agent.rb +103 -0
  38. data/lib/x_aeon_agents/agents/task_starter_agent.rb +66 -0
  39. data/lib/x_aeon_agents/agents/tester_agent.rb +44 -0
  40. data/lib/x_aeon_agents/cli.rb +384 -0
  41. data/lib/x_aeon_agents/config.rb +110 -0
  42. data/lib/x_aeon_agents/gen_helpers.rb +270 -0
  43. data/lib/x_aeon_agents/helpers.rb +211 -0
  44. data/lib/x_aeon_agents/logger.rb +21 -0
  45. data/lib/x_aeon_agents/providers/cline.rb +78 -0
  46. data/lib/x_aeon_agents/version.rb +6 -0
  47. data/lib/x_aeon_agents.rb +38 -0
  48. metadata +296 -0
data/README.md ADDED
@@ -0,0 +1,579 @@
1
+ <div align="center">
2
+
3
+ # x_aeon_agents
4
+
5
+ **x_aeon_agents** is a Ruby gem and CLI that arms AI assistants with ready-to-use skills to automate everyday development workflows for X-Aeon projects.
6
+
7
+ [![Build](https://github.com/Muriel-Salvan/x_aeon_agents/actions/workflows/continuous_integration.yml/badge.svg)](https://github.com/Muriel-Salvan/x_aeon_agents/actions/workflows/continuous_integration.yml)
8
+ [![Test Coverage](https://img.shields.io/codecov/c/gh/Muriel-Salvan/x_aeon_agents)](https://codecov.io/gh/Muriel-Salvan/x_aeon_agents)
9
+ [![GitHub stars](https://img.shields.io/github/stars/Muriel-Salvan/x_aeon_agents)](https://github.com/Muriel-Salvan/x_aeon_agents/stargazers)
10
+ [![License](https://img.shields.io/github/license/Muriel-Salvan/x_aeon_agents)](LICENSE)
11
+ [![Gem Version](https://img.shields.io/gem/v/x_aeon_agents)](https://rubygems.org/gems/x_aeon_agents)
12
+ [![Gem Total Downloads](https://img.shields.io/gem/dt/x_aeon_agents)](https://rubygems.org/gems/x_aeon_agents)
13
+
14
+ </div>
15
+
16
+ **x_aeon_agents** is a ๐Ÿ’Ž Ruby gem that gives AI assistants a **ready-to-use skill set** so they can automate everyday development workflows for X-Aeon projects. ๐Ÿค–
17
+
18
+ Powered by the `xaa` command-line interface (and usable as a library too), it takes care of:
19
+
20
+ - ๐Ÿ“ฌ **Pull Request reviews** โ€” automatically read, address and reply to GitHub review comments
21
+ - ๐Ÿ“ **Commit messages** โ€” generate meaningful descriptions for your staged changes
22
+ - ๐Ÿ“š **README generation** โ€” build documentation sections straight from your codebase
23
+ - ๐Ÿ” **Git diff interpretation** โ€” summarize what changed and why
24
+ - ๐Ÿš€ **Issue implementation** โ€” turn GitHub issues into working code
25
+ - ๐Ÿ› ๏ธ **Task bootstrapping** โ€” create git worktrees and feature branches in seconds
26
+ - ๐Ÿ”ง **Skill templating** โ€” generate reusable agent workflows from ERB templates
27
+
28
+ Use it as a **โšก CLI** in your terminal or as a **๐Ÿ“ฆ library** inside your Ruby projects.
29
+
30
+ ## Table of contents
31
+
32
+ - [Quick start](#quick-start)
33
+ - [Prerequisites](#prerequisites)
34
+ - [Install](#install)
35
+ - [Configure](#configure)
36
+ - [Use the CLI](#use-the-cli)
37
+ - [Use as a library](#use-as-a-library)
38
+ - [Requirements](#requirements)
39
+ - [Features](#features)
40
+ - [Public API](#public-api)
41
+ - [Executable: `xaa`](#executable-xaa)
42
+ - [`XAeonAgents::Config`](#xaeonagentsconfig)
43
+ - [`XAeonAgents::AgentOptions`](#xaeonagentsagentoptions)
44
+ - [`XAeonAgents::GenHelpers`](#xaeonagentsgenhelpers)
45
+ - [Documentation](#documentation)
46
+ - [Library public API](#library-public-api)
47
+ - [How it works](#how-it-works)
48
+ - [Entry point ๐Ÿšช](#entry-point-)
49
+ - [Agents as composable workflows ๐Ÿงฉ](#agents-as-composable-workflows-)
50
+ - [Orchestration ๐Ÿ”—](#orchestration-)
51
+ - [Configuration & providers ๐Ÿ”](#configuration--providers-)
52
+ - [Skills & ERB templating ๐Ÿ“š](#skills--erb-templating-)
53
+ - [Helpers ๐Ÿ› ๏ธ](#helpers-)
54
+ - [Development](#development)
55
+ - [Prerequisites](#prerequisites-1)
56
+ - [Clone and install dependencies](#clone-and-install-dependencies)
57
+ - [Project layout](#project-layout)
58
+ - [Running the test suite](#running-the-test-suite)
59
+ - [Linting](#linting)
60
+ - [Building skills from templates](#building-skills-from-templates)
61
+ - [Common development tasks](#common-development-tasks)
62
+ - [Packaging and release](#packaging-and-release)
63
+ - [Contributing](#contributing)
64
+ - [๐Ÿ› Reporting issues](#-reporting-issues)
65
+ - [๐Ÿด Forking & branching](#-forking--branching)
66
+ - [๐Ÿงช Running the tests](#-running-the-tests)
67
+ - [๐Ÿ”€ Opening a Pull Request](#-opening-a-pull-request)
68
+ - [๐Ÿค– CI & coverage](#-ci--coverage)
69
+ - [๐Ÿงน Code style](#-code-style)
70
+ - [โœ… Before you submit](#-before-you-submit)
71
+ - [License](#license)
72
+ - [Ways skills are written](#ways-skills-are-written)
73
+ - [General principles](#general-principles)
74
+ - [Generating skills from ERB templates](#generating-skills-from-erb-templates)
75
+
76
+ ## Quick start
77
+
78
+ ### Prerequisites
79
+
80
+ - Ruby `>= 3.1`
81
+ - An OpenRouter API key (`OPENROUTER_API_KEY`) so the built-in agents can call an LLM
82
+ - A GitHub token (`GITHUB_TOKEN`) for features that talk to GitHub (Pull Requests, issues, comments)
83
+ - Optionally a Cline API key (`CLINE_API_KEY`) when driving the Cline agent
84
+
85
+ ### Install
86
+
87
+ Install the gem from RubyGems:
88
+
89
+ ```bash
90
+ gem install x_aeon_agents
91
+ ```
92
+
93
+ Or add it to your project's `Gemfile` and install with Bundler:
94
+
95
+ ```ruby
96
+ gem 'x_aeon_agents'
97
+ ```
98
+
99
+ ```bash
100
+ bundle install
101
+ ```
102
+
103
+ ### Configure
104
+
105
+ Export the required credentials as environment variables (the CLI reads them automatically):
106
+
107
+ ```bash
108
+ export OPENROUTER_API_KEY="sk-or-..."
109
+ export GITHUB_TOKEN="ghp_..."
110
+ ```
111
+
112
+ ### Use the CLI
113
+
114
+ The `xaa` command is installed alongside the gem. Run it from inside any Git repository.
115
+
116
+ Commit your staged changes with an AI-generated message:
117
+
118
+ ```bash
119
+ xaa commit
120
+ ```
121
+
122
+ Address GitHub Pull Request review comments (auto-detected from the current branch):
123
+
124
+ ```bash
125
+ xaa review-comments
126
+ ```
127
+
128
+ Push your branch and open a Pull Request:
129
+
130
+ ```bash
131
+ xaa create-pr
132
+ ```
133
+
134
+ Generate or update the project README from the codebase:
135
+
136
+ ```bash
137
+ xaa generate-readme
138
+ ```
139
+
140
+ Ask a quick one-off question to the agent:
141
+
142
+ ```bash
143
+ xaa prompt "What is the capital of France?"
144
+ ```
145
+
146
+ Bootstrap a new task in a git worktree:
147
+
148
+ ```bash
149
+ xaa start-task --branch feature/my-task
150
+ ```
151
+
152
+ ### Use as a library
153
+
154
+ Require the gem and configure it in your Ruby code:
155
+
156
+ ```ruby
157
+ require 'x_aeon_agents'
158
+
159
+ XAeonAgents::Config.configure(
160
+ openrouter_api_key: ENV['OPENROUTER_API_KEY'],
161
+ github_token: ENV['GITHUB_TOKEN']
162
+ )
163
+
164
+ # Trigger agents programmatically
165
+ XAeonAgents::Agents::CommitterAgent.new.run
166
+ ```
167
+
168
+ ## Requirements
169
+
170
+ - **Ruby** `>= 3.1` โ€” the `xaa` CLI and library are Ruby-based (RubyGems/Bundler needed to install the gem)
171
+ - **Git** command-line client in `PATH` โ€” the agents operate on repositories, branches, worktrees and commits
172
+ - **GitHub CLI (`gh`)** installed and authenticated โ€” used by the Pull Request and comment skills to query and reply via `gh api`
173
+ - **`GITHUB_TOKEN`** environment variable โ€” a GitHub personal access token used by Octokit for API access
174
+ - **`OPENROUTER_API_KEY`** environment variable โ€” an OpenRouter API key that powers the AI agents through RubyLLM
175
+ - **`CLINE_API_KEY`** environment variable (optional) โ€” only required when driving the Cline agent integration
176
+
177
+ ## Features
178
+
179
+ **x_aeon_agents** provides a *`xaa`* command-line interface and a reusable Ruby library that package a suite of AI agents to automate everyday development workflows.
180
+
181
+ - ๐Ÿ“ฌ **Pull Request review handling** โ€” auto-detect the PR for the current branch, read agent-addressed comments, fix the code and reply to each thread
182
+ - ๐Ÿ“ **AI commit messages** โ€” analyze staged changes and generate a meaningful message, with flexible staging strategies (`all`, `if_empty`, `none`)
183
+ - ๐Ÿš€ **Automated Pull Request creation** โ€” push the branch to GitHub and open a PR against a configurable base ref with an AI-written description
184
+ - ๐Ÿ“š **README generation** โ€” build a full README from the codebase with toggleable sections (about, quick start, requirements, features, public API, documentation, how-it-works, development, contributing, license)
185
+ - ๐Ÿ› **GitHub issue implementation** โ€” turn an issue (and its comments) into working code, committing changes and opening a PR automatically
186
+ - ๐Ÿ› ๏ธ **Arbitrary requirement implementation** โ€” pass free-form requirements to a Developer agent that edits the codebase, optionally committing and opening a PR
187
+ - ๐Ÿ” **Git diff interpretation** โ€” summarize the working tree changes and the intent behind them relative to any base ref
188
+ - ๐Ÿ’ฌ **One-shot prompts** โ€” send a single prompt to the AI agent and print the response
189
+ - ๐Ÿ”ง **Skill templating** โ€” generate skill files from ERB templates, evaluating templates and copying assets to the output directory
190
+ - ๐Ÿ“ฅ **Skill installation** โ€” install skills and their recursively-resolved dependencies from a manifest for a chosen agent
191
+ - ๐ŸŒฟ **Task bootstrapping** โ€” create a feature branch, set up a git worktree, push it upstream and open it in the editor
192
+ - ๐Ÿ“ฆ **Reusable Ruby library** โ€” require the gem and trigger agents programmatically (e.g. `Agents::CommitterAgent.new.run`)
193
+ - ๐Ÿงฉ **Agent framework & provider integration** โ€” composable agents built on `ai-agents`/`composable_agents`, a Cline/OpenRouter provider, central `Config`, helpers and `GenHelpers`
194
+ - ๐Ÿ’พ **Session persistence & debugging** โ€” global `--session-id` for conversation persistence and a `--debug` flag for verbose logging
195
+
196
+ ## Public API
197
+
198
+ x_aeon_agents exposes a command-line executable and a set of Ruby library entry points. Only the components below are part of the public API (methods tagged in the `Public API` YARD group).
199
+
200
+ ### Executable: `xaa`
201
+
202
+ The `bin/xaa` script is the entry point of the CLI. It boots the gem and dispatches `ARGV` to `XAeonAgents::Cli`.
203
+
204
+ **Usecase** โ€” commit staged changes with an AI-generated message:
205
+
206
+ ```bash
207
+ xaa commit
208
+ ```
209
+
210
+ More details: [GitHub โ€” bin/xaa](https://github.com/Muriel-Salvan/x_aeon_agents/blob/main/bin/xaa)
211
+
212
+ ### `XAeonAgents::Config`
213
+
214
+ Singleton holding all configuration of X-Aeon Agents (secrets, data directory, CLI defaults, debug flag). All methods below are part of the public API.
215
+
216
+ **Usecase** โ€” configure credentials and options at once:
217
+
218
+ ```ruby
219
+ require 'x_aeon_agents'
220
+
221
+ XAeonAgents::Config.configure(
222
+ openrouter_api_key: ENV['OPENROUTER_API_KEY'],
223
+ github_token: ENV['GITHUB_TOKEN'],
224
+ debug: false
225
+ )
226
+ ```
227
+
228
+ More details: [RubyDoc โ€” XAeonAgents::Config](https://www.rubydoc.info/gems/x-aeon_agents/XAeonAgents/Config)
229
+
230
+ Public methods:
231
+ - `configure(**kwargs)` โ€” set any configuration property. [doc](https://www.rubydoc.info/gems/x-aeon_agents/XAeonAgents/Config#configure-class_method)
232
+ - `cline_api_key` / `cline_api_key=` โ€” Cline API key (also `openrouter_api_key`, `github_token`). [doc](https://www.rubydoc.info/gems/x-aeon_agents/XAeonAgents/Config)
233
+ - `data_dir` / `data_dir=` โ€” X-Aeon Agents data directory. [doc](https://www.rubydoc.info/gems/x-aeon_agents/XAeonAgents/Config#data_dir-class_method)
234
+ - `default_cline_cli_args` / `default_cline_cli_args=` โ€” default Cline CLI arguments. [doc](https://www.rubydoc.info/gems/x-aeon_agents/XAeonAgents/Config#default_cline_cli_args-class_method)
235
+ - `debug` / `debug=` โ€” debug mode. [doc](https://www.rubydoc.info/gems/x-aeon_agents/XAeonAgents/Config#debug-class_method)
236
+ - `agent_options` โ€” the available `AgentOptions` instance. [doc](https://www.rubydoc.info/gems/x-aeon_agents/XAeonAgents/Config#agent_options-class_method)
237
+
238
+ ### `XAeonAgents::AgentOptions`
239
+
240
+ Provides agent options (model, strategy, etc.) keyed by agent category. These options can be passed to an agent's constructor.
241
+
242
+ **Usecase** โ€” read the options for a given category:
243
+
244
+ ```ruby
245
+ opts = XAeonAgents::Config.agent_options['free_simple']
246
+ # => { model: 'openrouter/free', strategy: ComposableAgents::PromptRenderingStrategy::Markdown }
247
+ ```
248
+
249
+ More details: [RubyDoc โ€” XAeonAgents::AgentOptions](https://www.rubydoc.info/gems/x-aeon_agents/XAeonAgents/AgentOptions)
250
+
251
+ Public methods:
252
+ - `[](agent_category)` โ€” get the options for a category (lazily evaluated). [doc](https://www.rubydoc.info/gems/x-aeon_agents/XAeonAgents/AgentOptions#%5B%5D-instance_method)
253
+ - `[]=(agent_category, agent_options)` โ€” set the options for a category. [doc](https://www.rubydoc.info/gems/x-aeon_agents/XAeonAgents/AgentOptions)
254
+
255
+ ### `XAeonAgents::GenHelpers`
256
+
257
+ DSL mixed into ERB skill templates, used to generate skill files (metadata, goals, rules, todo lists).
258
+
259
+ **Usecase** โ€” declare a skill's frontmatter inside an ERB template:
260
+
261
+ ```erb
262
+ <%= skill(description: 'Implement a GitHub issue', dependencies: ['analyzing-github-issue']) %>
263
+ ```
264
+
265
+ More details: [RubyDoc โ€” XAeonAgents::GenHelpers](https://www.rubydoc.info/gems/x-aeon_agents/XAeonAgents/GenHelpers)
266
+
267
+ Public methods:
268
+ - `skill(description:, dependencies:, plan:, metadata:)` โ€” define skill metadata / YAML frontmatter. [doc](https://www.rubydoc.info/gems/x-aeon_agents/XAeonAgents/GenHelpers#skill-instance_method)
269
+ - `goal(goal_desc = nil)` โ€” define or get the skill goal. [doc](https://www.rubydoc.info/gems/x-aeon_agents/XAeonAgents/GenHelpers#goal-instance_method)
270
+ - `goal_sentence` โ€” the skill goal as a sentence. [doc](https://www.rubydoc.info/gems/x-aeon_agents/XAeonAgents/GenHelpers#goal_sentence-instance_method)
271
+ - `announce` โ€” prompt announcing the agent is working on the skill. [doc](https://www.rubydoc.info/gems/x-aeon_agents/XAeonAgents/GenHelpers#announce-instance_method)
272
+ - `tmp_path` โ€” default temporary folder for agents. [doc](https://www.rubydoc.info/gems/x-aeon_agents/XAeonAgents/GenHelpers#tmp_path-instance_method)
273
+ - `rule(title, description:, type:, bad:, good:, rationale:)` โ€” generate a documented rule block. [doc](https://www.rubydoc.info/gems/x-aeon_agents/XAeonAgents/GenHelpers#rule-instance_method)
274
+ - `ordered_todo_list(&erb_block)` โ€” generate a numbered todo list section. [doc](https://www.rubydoc.info/gems/x-aeon_agents/XAeonAgents/GenHelpers#ordered_todo_list-instance_method)
275
+ - `when_to_use(&erb_block)` โ€” generate the "When to use it" section. [doc](https://www.rubydoc.info/gems/x-aeon_agents/XAeonAgents/GenHelpers#when_to_use-instance_method)
276
+ - `name` โ€” the skill name being generated. [doc](https://www.rubydoc.info/gems/x-aeon_agents/XAeonAgents/GenHelpers#name-instance_method)
277
+ - `self.config(skill_name)` โ€” read a skill's `.skill_config.yml`. [doc](https://www.rubydoc.info/gems/x-aeon_agents/XAeonAgents/GenHelpers#config-class_method)
278
+
279
+ It also exposes `XAeonAgents::GenHelpers::ErbEvaluator`, a small public helper class that evaluates ERB skill templates with this DSL (`ErbEvaluator#new(erb_file)` and `ErbEvaluator#result`). [doc](https://www.rubydoc.info/gems/x-aeon_agents/XAeonAgents/GenHelpers/ErbEvaluator)
280
+
281
+ ## Documentation
282
+
283
+ - **GitHub repository** โ€” main project page with source code, issues and CI: [github.com/Muriel-Salvan/x_aeon_agents](https://github.com/Muriel-Salvan/x_aeon_agents)
284
+ - **Project README** โ€” overview, CLI usage and skill-authoring guidelines: [github.com/Muriel-Salvan/x_aeon_agents/blob/main/README.md](https://github.com/Muriel-Salvan/x_aeon_agents/blob/main/README.md)
285
+ - **RubyDoc.info** โ€” full API reference generated from the source (YARD): [rubydoc.info/gems/x_aeon_agents](https://www.rubydoc.info/gems/x_aeon_agents)
286
+ - **RubyGems** โ€” published gem page and release history: [rubygems.org/gems/x_aeon_agents](https://rubygems.org/gems/x_aeon_agents)
287
+
288
+ ### Library public API
289
+
290
+ The documented public methods (browseable on RubyDoc.info):
291
+
292
+ - `XAeonAgents` module:
293
+ - `agent_name` โ€” [doc](https://www.rubydoc.info/gems/x-aeon_agents/XAeonAgents#agent_name-class_method)
294
+ - `agent_signature` โ€” [doc](https://www.rubydoc.info/gems/x-aeon_agents/XAeonAgents#agent_signature-class_method)
295
+ - `VERSION` โ€” [doc](https://www.rubydoc.info/gems/x-aeon_agents/XAeonAgents#VERSION-constant)
296
+ - `XAeonAgents::GenHelpers` โ€” DSL helpers for generating skill content from ERB templates:
297
+ - `skill` โ€” [doc](https://www.rubydoc.info/gems/x-aeon_agents/XAeonAgents/GenHelpers#skill-instance_method)
298
+ - `goal` โ€” [doc](https://www.rubydoc.info/gems/x-aeon_agents/XAeonAgents/GenHelpers#goal-instance_method)
299
+ - `goal_sentence` โ€” [doc](https://www.rubydoc.info/gems/x-aeon_agents/XAeonAgents/GenHelpers#goal_sentence-instance_method)
300
+ - `announce` โ€” [doc](https://www.rubydoc.info/gems/x-aeon_agents/XAeonAgents/GenHelpers#announce-instance_method)
301
+ - `tmp_path` โ€” [doc](https://www.rubydoc.info/gems/x-aeon_agents/XAeonAgents/GenHelpers#tmp_path-instance_method)
302
+ - `rule` โ€” [doc](https://www.rubydoc.info/gems/x-aeon_agents/XAeonAgents/GenHelpers#rule-instance_method)
303
+ - `ordered_todo_list` โ€” [doc](https://www.rubydoc.info/gems/x-aeon_agents/XAeonAgents/GenHelpers#ordered_todo_list-instance_method)
304
+ - `when_to_use` โ€” [doc](https://www.rubydoc.info/gems/x-aeon_agents/XAeonAgents/GenHelpers#when_to_use-instance_method)
305
+ - `name` โ€” [doc](https://www.rubydoc.info/gems/x-aeon_agents/XAeonAgents/GenHelpers#name-instance_method)
306
+ - `config` (class method) โ€” [doc](https://www.rubydoc.info/gems/x-aeon_agents/XAeonAgents/GenHelpers#config-class_method)
307
+ - `XAeonAgents::GenHelpers::ErbEvaluator` โ€” helper class to evaluate ERB skill templates:
308
+ - `new` โ€” [doc](https://www.rubydoc.info/gems/x-aeon_agents/XAeonAgents/GenHelpers/ErbEvaluator#new-instance_method)
309
+ - `result` โ€” [doc](https://www.rubydoc.info/gems/x-aeon_agents/XAeonAgents/GenHelpers/ErbEvaluator#result-instance_method)
310
+
311
+ ## How it works
312
+
313
+ `x_aeon_agents` is a ๐Ÿ’Ž Ruby gem organized around three layers: a **CLI**, a set of **orchestrating agents**, and a shared **configuration / helper** core.
314
+
315
+ ### Entry point ๐Ÿšช
316
+
317
+ The `xaa` executable ([`bin/xaa`](https://github.com/Muriel-Salvan/x_aeon_agents/blob/main/bin/xaa)) boots Zeitwerk auto-loading and calls `XAeonAgents::Cli.start(ARGV)`. The CLI ([`lib/x_aeon_agents/cli.rb`](https://github.com/Muriel-Salvan/x_aeon_agents/blob/main/lib/x_aeon_agents/cli.rb)) is a [Thor](https://github.com/rails/thor) application: each sub-command maps **1:1** to an agent and forwards global options (`--session-id`, `--debug`).
318
+
319
+ ### Agents as composable workflows ๐Ÿงฉ
320
+
321
+ Every capability (`commit`, `create-pr`, `review-comments`, `implement-issue`, `generate-readme`โ€ฆ) is implemented by an `Agents::*Agent` class. They inherit from `composable_agents` base classes:
322
+
323
+ - `ComposableAgents::Agent` โ€” pure orchestrators that run shell commands and coordinate children.
324
+ - `ComposableAgents::AiAgents::Agent` / `ComposableAgents::Cline::Agent` โ€” LLM-driven agents that execute prompts.
325
+
326
+ Each agent is enriched by the `AgentDefaults` mixin ([`lib/x_aeon_agents/agent_defaults.rb`](https://github.com/Muriel-Salvan/x_aeon_agents/blob/main/lib/x_aeon_agents/agent_defaults.rb)), which:
327
+
328
+ - injects `new_agent(...)`, `step(...)` and `step_agent(...)` to build multi-step pipelines;
329
+ - auto-configures the underlying frameworks (`setup_composable_agents`, `setup_ai_agents`, `setup_cline`);
330
+ - manages a per-session directory under `Config.data_dir/sessions/<id>`;
331
+ - prepends `ArtifactContract` + `Resumable` mixins for input/output validation and pause/resume.
332
+
333
+ ### Orchestration ๐Ÿ”—
334
+
335
+ A top-level agent decomposes its task into **steps** that delegate to child agents, passing state through a shared `@artifacts` hash referenced via `artifact_ref`. For example, `DeveloperAgent` chains `PlannerAgent` โžœ `CoderAgent` โžœ `TesterAgent` โžœ (optional) `CommitterAgent` / `DocumenterAgent` โžœ (optional) `PullRequestCreatorAgent`.
336
+
337
+ ```mermaid
338
+ flowchart TD
339
+ CLI[XAeonAgents::Cli / xaa] -->|instantiates + run| A[Top-level Agent]
340
+ A -->|step_agent| P[PlannerAgent]
341
+ A -->|step_agent| C[CoderAgent]
342
+ A -->|step_agent| T[TesterAgent]
343
+ A -->|step_agent| K[CommitterAgent]
344
+ C -.->|artifacts hash| T
345
+ T -.->|artifacts hash| K
346
+ subgraph LLM[AI backends]
347
+ C --> Prov[Cline / OpenRouter provider]
348
+ T --> Prov
349
+ end
350
+ K --> Git[(Git + GitHub via Octokit)]
351
+ ```
352
+
353
+ ### Configuration & providers ๐Ÿ”
354
+
355
+ [`XAeonAgents::Config`](https://www.rubydoc.info/gems/x-aeon_agents/XAeonAgents/Config) is a singleton holding secrets (`cline_api_key`, `openrouter_api_key`, `github_token`), the data directory, debug flag and per-category `AgentOptions` (model + strategy, e.g. `free_simple`, `free_complex`). LLM access flows through `Providers::Cline` ([`lib/x_aeon_agents/providers/cline.rb`](https://github.com/Muriel-Salvan/x_aeon_agents/blob/main/lib/x_aeon_agents/providers/cline.rb)), an OpenAI-compatible [RubyLLM](https://github.com/crmne/ruby_llm) provider targeting the Cline API.
356
+
357
+ ### Skills & ERB templating ๐Ÿ“š
358
+
359
+ Reusable agent instructions live as Markdown **skills** under `skills/`. Some are generated from ERB templates in `skills.src/` via the `generate-skills` command, evaluated by `XAeonAgents::GenHelpers` ([`lib/x_aeon_agents/gen_helpers.rb`](https://github.com/Muriel-Salvan/x_aeon_agents/blob/main/lib/x_aeon_agents/gen_helpers.rb)) โ€” a DSL that emits YAML front-matter, goals, rules and checklists.
360
+
361
+ ### Helpers ๐Ÿ› ๏ธ
362
+
363
+ `XAeonAgents::Helpers` ([`lib/x_aeon_agents/helpers.rb`](https://github.com/Muriel-Salvan/x_aeon_agents/blob/main/lib/x_aeon_agents/helpers.rb)) centralizes **Git**, **GitHub (Octokit)**, real-time command execution, diff extraction and interactive content review used across all agents.
364
+
365
+ ## Development
366
+
367
+ This section explains how to set up a local environment to develop **x_aeon_agents**, run its test suite, lint the code and build the gem.
368
+
369
+ ### Prerequisites
370
+
371
+ - **Ruby** `>= 3.1` (the CI runs on Ruby `3.4`) and a matching **Bundler**.
372
+ - **Git** command-line client.
373
+ - *(Maintainer only)* **Node.js** and **npm**, required for `skillkit` and `semantic-release` used during packaging and release.
374
+
375
+ ### Clone and install dependencies
376
+
377
+ ```bash
378
+ git clone https://github.com/Muriel-Salvan/x_aeon_agents.git
379
+ cd x_aeon_agents
380
+ bundle install
381
+ ```
382
+
383
+ `bundle install` installs the runtime dependencies declared in `x_aeon_agents.gemspec` plus the development dependencies from the `Gemfile` (`rspec`, `rubocop`, `rubocop-rspec`, `rubocop-yard`, `simplecov`, `simplecov-cobertura`, `sem_ver_components`).
384
+
385
+ > [!NOTE]
386
+ > `Gemfile.lock` is intentionally git-ignored: this is a library, not an application.
387
+
388
+ ### Project layout
389
+
390
+ ```
391
+ lib/ # Library source, auto-loaded with Zeitwerk (entry: lib/x_aeon_agents.rb)
392
+ x_aeon_agents/
393
+ cli.rb # The `xaa` Thor CLI definition
394
+ config.rb # Global configuration
395
+ agents/ # AI agents (commit, PR, README generation, โ€ฆ)
396
+ providers/ # LLM provider integrations
397
+ gen_helpers.rb # ERB skill template helpers
398
+ version.rb # Gem version (bumped automatically on release)
399
+ bin/
400
+ xaa # CLI executable
401
+ skills.src/ # ERB skill templates (source of truth)
402
+ skills/ # Generated skills (produced from skills.src)
403
+ spec/ # RSpec test suite
404
+ spec_helper.rb # Global RSpec / SimpleCov configuration
405
+ scenarios/ # End-to-end scenario specs
406
+ x_aeon_agents_test/ # Test helpers (loaded via Zeitwerk)
407
+ .github/workflows/ # CI (continuous_integration.yml)
408
+ ```
409
+
410
+ ### Running the test suite
411
+
412
+ Tests use **RSpec 3** with **SimpleCov** coverage (minimum 97%).
413
+
414
+ ```bash
415
+ # Run the whole suite, exactly like the CI does
416
+ bundle exec rspec --format documentation
417
+
418
+ # Run a single file or directory
419
+ bundle exec rspec spec/scenarios/code_quality_spec.rb
420
+
421
+ # Enable verbose test logging
422
+ TEST_DEBUG=1 bundle exec rspec
423
+ ```
424
+
425
+ The coverage report is written to `coverage/` (Cobertura format for Codecov). Each example runs with a cleaned, temporary `.x_aeon_agents_test/` data directory (git-ignored), and the application configuration is populated with dummy API keys by `spec_helper.rb`.
426
+
427
+ ### Linting
428
+
429
+ Code style is enforced with **RuboCop** (`rubocop`, `rubocop-rspec`, `rubocop-yard`), configured through `.rubocop.yml`.
430
+
431
+ ```bash
432
+ # Check style
433
+ bundle exec rubocop
434
+
435
+ # Check and auto-correct
436
+ bundle exec rubocop -A
437
+ ```
438
+
439
+ ### Building skills from templates
440
+
441
+ Some skills are authored as ERB templates under `skills.src/`. Generate the final `skills/` files with:
442
+
443
+ ```bash
444
+ bundle exec ruby bin/xaa generate-skills
445
+ ```
446
+
447
+ This finds every `.erb` file in `skills.src/`, evaluates it with the `XAeonAgents::GenHelpers` DSL and writes the resulting files (minus the `.erb` extension). Always regenerate skills before committing so the committed `skills/` directory stays in sync with its sources.
448
+
449
+ ### Common development tasks
450
+
451
+ Run the CLI locally without installing the gem:
452
+
453
+ ```bash
454
+ bundle exec ruby bin/xaa --help
455
+ bundle exec ruby bin/xaa <command> [options]
456
+ ```
457
+
458
+ Build the gem package locally:
459
+
460
+ ```bash
461
+ gem build x_aeon_agents.gemspec
462
+ ```
463
+
464
+ This produces a `x_aeon_agents-<version>.gem` file. Note that `x_aeon_agents.gemspec` only packages `lib/**/*` and top-level `*.md`/`*.txt` files; the `skills/` directory is committed to the repository separately (regenerate it first) and is not bundled inside the gem.
465
+
466
+ Generate the API documentation with **YARD** (output in `doc/`, git-ignored):
467
+
468
+ ```bash
469
+ bundle exec yard
470
+ ```
471
+
472
+ ### Packaging and release
473
+
474
+ Releases are automated through the `package` job of GitHub Actions using `semantic-release` and `semantic-release-rubygem`:
475
+
476
+ 1. Skills are regenerated (`bundle exec ruby bin/xaa generate-skills`) and staged.
477
+ 2. `semantic-release` computes the next version from conventional commits, updates `lib/x_aeon_agents/version.rb` and `CHANGELOG.md`, and creates a Git tag plus a GitHub release.
478
+ 3. The gem is built and pushed to RubyGems.
479
+
480
+ Contributors do not need to run these release steps locally โ€” just make sure tests pass with `bundle exec rspec` and skills are regenerated with `bundle exec ruby bin/xaa generate-skills` before sharing your changes.
481
+
482
+ ## Contributing
483
+
484
+ Contributions to **x_aeon_agents** are welcome! This ๐Ÿ’Ž Ruby gem lives on [GitHub](https://github.com/Muriel-Salvan/x_aeon_agents) and is released automatically via `semantic-release`, so a clean, linear history and passing CI keep the project healthy. ๐ŸŒฑ
485
+
486
+ ### ๐Ÿ› Reporting issues
487
+ - Open a new issue on the [issue tracker](https://github.com/Muriel-Salvan/x_aeon_agents/issues) and describe the *expected* vs *actual* behavior, your Ruby version, and clear steps to reproduce.
488
+ - For a bug in a specific skill, mention the skill name (e.g. `addressing-pull-request-comments`) and the command you ran.
489
+
490
+ ### ๐Ÿด Forking & branching
491
+ - ๐Ÿ“Œ *Fork* the repo and add upstream as a remote named `github`: `git remote add github https://github.com/Muriel-Salvan/x_aeon_agents.git`.
492
+ - Create a *feature branch* from `main`; the project favors git worktrees, so you can run `xaa start-task --branch feature/my-change`.
493
+ - Keep your branch current by *rebasing* on `github/main` (`git fetch --all && git rebase github/main`) โ€” never merge.
494
+
495
+ ### ๐Ÿงช Running the tests
496
+ To run the suite locally, install the test dependencies with `bundle install` (the `Gemfile` pulls in RSpec 3, RuboCop, SimpleCov and its Cobertura formatter), then launch the full suite exactly like CI via `bundle exec rspec --format documentation`, or scope it to a single file such as `bundle exec rspec spec/scenarios/code_quality_spec.rb`; each example runs against a temporary, auto-cleaned `.x_aeon_agents_test/` directory with dummy API keys injected by `spec/spec_helper.rb`, and SimpleCov enforces a *minimum 97% coverage* before the run is considered green.
497
+
498
+ ### ๐Ÿ”€ Opening a Pull Request
499
+ - Push your branch to your fork and open a PR *against* `main` on the upstream repo.
500
+ - Describe *what* changed and *why*, and link the related issue when relevant.
501
+ - Rebase on the latest `github/main` and push with `git push github --force-with-lease` if you rebased.
502
+
503
+ ### ๐Ÿค– CI & coverage
504
+ - Every push triggers the [continuous integration workflow](https://github.com/Muriel-Salvan/x_aeon_agents/actions/workflows/continuous_integration.yml), which runs on Ruby `3.4`, installs `skillkit`, executes the tests and uploads coverage to Codecov.
505
+ - The `package` job regenerates skills (`bundle exec ruby bin/xaa generate-skills`) and runs `npx semantic-release` โ€” you don't need to run these locally, but your changes must not break them.
506
+
507
+ ### ๐Ÿงน Code style
508
+ - Lint with `bundle exec rubocop` (config in `.rubocop.yml`, using `rubocop`, `rubocop-rspec` and `rubocop-yard`); auto-fix with `bundle exec rubocop -A`.
509
+ - If you edit a skill written as an ERB template under `skills.src/`, *always* regenerate the committed `skills/` files with `bundle exec ruby bin/xaa generate-skills` before committing.
510
+
511
+ ### โœ… Before you submit
512
+ - ๐ŸŸข All RSpec examples pass and coverage stays โ‰ฅ 97%.
513
+ - ๐Ÿช„ `rubocop` reports no offenses.
514
+ - ๐Ÿ“ Generated skills are in sync (`skills/` matches `skills.src/`).
515
+ - ๐Ÿ“œ Keep the [BSD-3-Clause](LICENSE) license and stay kind & respectful in all interactions. ๐Ÿ’›
516
+
517
+ ## License
518
+
519
+ This project is licensed under the BSD License (modified). See the [LICENSE](LICENSE) file for the full text and terms.
520
+
521
+ ## Ways skills are written
522
+
523
+ * Follow guidelines from the following sources:
524
+ * [agentskills.io](https://agentskills.io/specification)
525
+ * [Claude code best practices](https://platform.claude.com/docs/en/agents-and-tools/agent-skills/best-practices)
526
+ * Help agents follow those skills and their steps by using the following guidelines:
527
+ * About skill name and YAML frontmatter:
528
+ * Always name skills using `<verb>[-<object>-[<context>]]`.
529
+ * Use gerund in the skill name.
530
+ * Use third person in the skill description.
531
+ * Always add a `Use when ...` part of the skill description.
532
+ * About skill content:
533
+ * Use Markdown for the skill's content.
534
+ * Use imperative verbs (ex: `Read the README file to know about the CLI usage`).
535
+ * Separate ordered steps in the skill's content using Markdown's headers (ex: `## 5. Perform data analysis`), and give details of this step using bullet points.
536
+ * Don't mix several commands in 1 step. Split steps if several commands are involved.
537
+ * Use `{variable_name}` to identify placeholders.
538
+ * Be clear and consistent about commands: always use backticks to identify a command, and use a prefix for the command type. Here are the prefixes in use:
539
+ * `cli: `: Used for command-line tools. Ex: ``Use `cli: ls -la` to list all the files``.
540
+ * `agent: `: Used for agent commands. Ex: ``Use `agent: ask_followup_question` to ask the USER about the intent``.
541
+ * `skill: `: Used for skills. Ex: ``Use `skill: creating-pull-request` to create the PR for {branch}``.
542
+ * Don't use capital wordings as it adds emotional noise and is different from non-capitalized tokens used during LLMs training.
543
+ * Use some wording in a consistent way. Those words are inspired by https://github.com/rohitg00/skillkit/blob/39b94534ec1c3698c0dec3a005744dafa99e63e9/packages/core/src/quality/index.ts
544
+ * `User` represents the developer asking the agent to perform a task.
545
+ * `Always` is used to emphasize that a specific step is mandatory (ex.: ``Always use `cli: gh` to gather issue information``).
546
+ * `Never` is used to emphasize that a specific step should never be done (ex.: ``Never use `cli: gh` to create a PR``).
547
+ * `If` ... `then` ... `else` are used to clearly identify some branching decisions.
548
+ * `Plan` and `Act` modes refer to precisely the 2 ways of executing skills by the agents.
549
+ * About skill semantics:
550
+ * A skill is better followed when it consists only in a sequence of easily identified steps (like a workflow). Don't use vague guidelines in a skill.
551
+ * When another skill is performing a sub-task of your skill, reference it explicitely, like ``Use `skill: skill_name` to perform this action`` instead of `Perform this action`. Don't rely on the model understanding that `skill_name` was the right skill to perform the action.
552
+ * Always ask the agent to inform the user about executing the skill.
553
+ * Any step that can be coded and automated with a tool should be implemented in a tool. Never rely on the guarantee that models will follow steps, unless they are implemented in a tool.
554
+
555
+ ## General principles
556
+
557
+ Those principles allow for a safe agent interaction, while keeping its agility.
558
+
559
+ * The user sets the branch for the agent, in a worktree.
560
+ * Agents should never switch branches.
561
+ * Agents automatically push their changes to the github remote, and create a Pull Request for their branch.
562
+ * Agents can rebase their branch.
563
+
564
+ ## Generating skills from ERB templates
565
+
566
+ Some skills are written as ERB templates (files ending with `.erb`) to allow dynamic content generation. To generate the final skill files from these templates, run the following executable:
567
+
568
+ ```bash
569
+ bundle exec ruby bin/xaa generate-skills
570
+ ```
571
+
572
+ This will:
573
+ - Find all `.erb` files in the `skills/` directory
574
+ - Process them using the ERB engine (with `XAeonAgents::GenHelpers` available)
575
+ - Generate the corresponding output files (removing the `.erb` extension)
576
+
577
+ The following helper methods are available in ERB templates:
578
+ - `XAeonAgents::GenHelpers.init_skill_checklist` - Returns the "Create Execution Checklist (MANDATORY)" section
579
+ - `XAeonAgents::GenHelpers.validate_skill_checklist` - Returns the "Final Verification (MANDATORY)" section
data/TODO.md ADDED
@@ -0,0 +1,48 @@
1
+ * Don't put .x_aeon_agents dir in the project dir: it confuses the LLMs.
2
+ * Don't use project skills and rules: it adds noise to the LLMs that scan the files and code base. Use only global objects from dedicated config dirs.
3
+ * Add desktop notification when user input is needed.
4
+ * Test with other models.
5
+ * Provide a unified CLI with Thor and actions to not pollute the user CLI environment too much.
6
+ * Implement non-debug logs with progress bars (one char per message received).
7
+ * Cache the cli auth call for performace between several agents of the same run.
8
+ * Make the WSL CLI tool a Ruby script to avoid paths and slashes issues.
9
+ * The model reported is wrong. Fix this.
10
+ * The list of rules should also have a checklist. We see that some of them are missed. It should report a summary of all the rules it has read.
11
+ * Remove the editing-files skill. We should use linters to check for missing lines, and Cline should be intelligent enough to catch missed edits (anyway those should go away soon).
12
+ * Remove the semilinearity check: it should be in tests.
13
+ * Consider removing the analyzing-github-issue skill: models know how to do it
14
+ * Consider using short tasks instead of full skills, orchestrated by a tool that would use the cline CLI and memory banks for context kept between tasks. For example:
15
+ * 1 task for planning
16
+ * 1 task for implementation
17
+ * 1 task for testing
18
+ * 1 task for updating doc
19
+ * 1 task for commiting + rebasing + pushing
20
+ * 1 task for creating PR
21
+ Goal would be to reduce the amount of skills or rules each task needs, so that it gets focused on what it needs to do given previous context.
22
+ Each task could even be performed by different models, and in parallel
23
+ * Write a proper README file.
24
+ * Use templates to better guide the format of commit comments and PR descriptions.
25
+ * Extract the generate_skills executable into a generic Rubygem that generates skills following agents best practices
26
+ * Add a conventions skill that explains conventions used:
27
+ * Commands with skill/agent/cli prefixes.
28
+ * Ideas for blog post:
29
+ * Very difficult to evaluate model's accuracy as it changes a lot over short periodes of time (cf the monitoring site).
30
+ * Even 2 prompts right one after another can have very different results: 1 follows skills, the other not.
31
+ * Make sure tools are working perfectly: when they are not the agent will try plenty of workarounds and that will contribute A LOT to context dilution later.
32
+ * Repeatitive safe guard rails on check lists and validations, hence need for prompt generation and optimization.
33
+ * If it can be technically automated in a script, do it. Leave prompts for things that depend on context or on reasoning decisions.
34
+ * Better results under Linux envs: models were trained like that and their default conventions or CLI will often be Linux based, even if they can later correct for Windows. LF/CRLF and paths separators issues will be avoided too.
35
+ * Use Plan and Act modes.
36
+ * Different models have different behaviors: well-formed prompts are very important but even when it is well written, some models won't follow prompt instructions, especially when those instructions become large (like test + doc + commit + push).
37
+ * For Cline, there is no need for double checks (upon completion) when models are good. That can reduce tokens usage.
38
+ * Better to replace existing default tools than having wrappers: if we want a different CLI than rspec, better to have a rspec tool in PATH that wraps the real rspec than having a rspec_wrapper tool.
39
+ * Models get lose a lot of accuracy between versions (example gpt-5.3-codex is much worse than gpt-5.2-codex).
40
+ * Models are good at performing small tasks, not huge workflows. We need workflows orchestrators handling context and memory.
41
+ * Check anthropic's skill-creator skill: https://github.com/anthropics/skills/blob/main/skills/skill-creator/SKILL.md
42
+ * Check security warnings that we got from installation and fix them.
43
+ * Move the Cline Ruby connector into a Rubygem.
44
+ * Split helpers in Utils / Git/Github/Generators/Skills...
45
+ * Rename in x_aeon_agents because it's not about skills only anymore.
46
+ * Yank old Rubygems.
47
+ * Migrate comments to YARD.
48
+ * Check useless methods, require and gems after separating the code properly.
data/bin/xaa ADDED
@@ -0,0 +1,5 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ require 'x_aeon_agents'
4
+
5
+ XAeonAgents::Cli.start(ARGV)