aia 1.0.0 → 1.1.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: 93f948db1a8860374c1c8d5e5913fc6f53c41d827fb9f5f4cbac546c9d5029da
4
- data.tar.gz: dd3300150ace0fff6103f6fac3571cd2b782b57ca485e6aee264a5d1eb0a59e0
3
+ metadata.gz: d72af72c970719f5d9508d14fc7903e46b7b751028d75cb045c8c23418151b44
4
+ data.tar.gz: 7a2b43f842f38d7e2f94f2118c85f087a4f97b944958b7a63c5d2798bab05cb9
5
5
  SHA512:
6
- metadata.gz: 9312d50d65c8e9952a5762796989cd925691f0da38aaa4b9839af1438c2cf43b3256c884668956e77de6917f8cefdcb5e006c85dd94645ff226a7eb154d10b1b
7
- data.tar.gz: a20827ca6d36ed203fc9d322ae7d6593f0696d7e48d5378291968f99c75abddb52f0c71dda349db4c86c6c08ac47a8cb0dddac7a3f70d68bc201b2778ea96511
6
+ metadata.gz: a27344680f0eb4ac9f1a9535982b53b102bb2face18b66f293918996a9b27e6d29aea2c46480671c2abecbb9a7e4f8c1400c84d5f157f7083c357a8766b399da
7
+ data.tar.gz: 3b740188dc4b8a74873fca77112fde35737574bd47c2a2c7f3e888cc831b669fb520b3e5e212b6124960ca0afe09ebe5fa004bf8e18f8507e32f5ea58afb5ae5
data/.version CHANGED
@@ -1 +1 @@
1
- 1.0.0
1
+ 1.1.0
data/CHANGELOG.md CHANGED
@@ -1,4 +1,55 @@
1
1
  # Changelog
2
+ ## [1.1.0] - 2026-04-23
3
+
4
+ ### New Features
5
+ - **Skills system**: Skills are subdirectories under `~/.prompts/skills` (configurable), each containing a `SKILL.md` file with YAML front matter (`name`, `description`, and any custom fields)
6
+ - `/skills [query]` directive lists available skills; supports positive/negative search filtering (`-term`, `~term`, `!term`)
7
+ - `/skill <name>` directive includes the `SKILL.md` content into the conversation; resolves by exact match then prefix match
8
+ - `/skill <path>` directive accepts path-based IDs (absolute, `~/`, `./`, `../`) including direct `.md` files
9
+ - `--list-skills` CLI flag prints all skills as markdown tables (one `## skill` heading + `| Key | Value |` table per skill, showing all front matter fields)
10
+ - `--skill`/`-s SKILL_IDS` CLI option prepends one or more skills to the prompt (comma-separated, repeatable); accepts skill IDs or paths
11
+ - `--skills-dir DIR` and `--skills-prefix PREFIX` CLI options configure the skills directory
12
+ - **Path-based skill resolution**: `--skill` and `/skill` now accept file-system paths in addition to named IDs
13
+ - Absolute paths: `--skill /path/to/skill-dir` or `--skill /path/to/skill.md`
14
+ - Home-relative: `--skill ~/skills/my-skill`
15
+ - Working-directory-relative: `--skill ./temp_skill.md`
16
+ - Direct `.md` files: the file content is used as-is (front matter stripped); no `SKILL.md` lookup needed
17
+ - **Path-based role resolution**: `--role` now accepts file-system paths in addition to role IDs
18
+ - Absolute and home-relative paths bypass the `~/.prompts/roles/` prefix lookup
19
+ - Example: `aia --role ~/custom/expert.md my_prompt`
20
+ - **Skills in chat-only mode**: `ChatLoop` now loads and sends configured skills to the AI at session start via `process_skill_context`, even when no pipeline prompt is specified; the AI's acknowledgment is displayed so the user can confirm the skill was applied
21
+ - **`AIA::SkillUtils` module**: New shared utility module (`lib/aia/skill_utils.rb`) consolidating path and skill helpers previously duplicated across four classes
22
+ - `path_based_id?(id)` — detects `/`, `~/`, `./`, `../` prefixes
23
+ - `parse_front_matter(path)` — reads and parses YAML front matter from a `.md` file; returns `{}` on any failure
24
+ - `find_skill_dir(skill_name, base_dir)` — resolves a skill name or path to its directory (or direct `.md` file); enforces symlink/prefix-traversal checks for ID-based lookups
25
+ - `safe_skill_path(path, dir)` — verifies a resolved path is contained within `dir` using `File::SEPARATOR`-terminated prefix to prevent sibling-directory attacks
26
+ - `skill_body(content)` — strips YAML front matter from skill file content
27
+ - Included by `PromptPipeline`, `PromptHandler`, `WebAndFileDirectives`, `CLIParser`, `ConfigValidator`, and `ChatLoop`
28
+ - **`roles` config section**: Top-level `roles.dir` config key (`~/.prompts/roles` default) alongside existing `prompts.roles_prefix`
29
+ - **`parse_search_terms` helper**: New private method on `AIA::Directive` base class available to all directive subclasses; splits argument tokens into `[positive_terms, negative_terms]` arrays (negative prefixes: `-`, `~`, `!`; positive: `+` or bare; all downcased)
30
+
31
+ ### Bug Fixes
32
+ - **Direct `.md` skill files silently ignored**: `--skill ./my-skill.md` previously returned `nil` because `find_skill_dir` only checked `Dir.exist?`. Now checks `File.file?` and returns the path directly; `load_skills` and `/skill` read and strip front matter from the file without requiring a `SKILL.md` sub-file
33
+ - **Path-prefix collision in `safe_skill_path`**: A sibling directory named `skills-attack` could bypass the containment check against `skills` because `start_with?(realpath)` matched the shared prefix. Fixed by appending `File::SEPARATOR` to the base path before the `start_with?` comparison
34
+ - **Path-based role IDs incorrectly prefixed**: `ConfigValidator#process_role_configuration` was unconditionally prepending the roles prefix (e.g., `roles/`) to role IDs, corrupting absolute and relative paths like `/custom/role.md` into `roles//custom/role.md`. Now guards with `AIA::SkillUtils.path_based_id?` before applying the prefix
35
+
36
+ ### Improvements
37
+ - **`/available_models` filtering** now uses `parse_search_terms` for consistent positive/negative term filtering across local (Ollama, LM Studio) and cloud model listings
38
+ - **Standardized warning output**: Replaced `$stderr.puts` with `warn` throughout `prompt_pipeline.rb` for idiomatic Ruby error reporting
39
+ - **Skills CLI options moved to Prompt Options group**: `--skill`, `--skills-dir`, `--skills-prefix`, `--list-skills` now appear under `--help`'s Prompt Options section alongside `--role` and related options, rather than Model Options
40
+
41
+ ### Testing
42
+ - Added `test/aia/skill_utils_test.rb` — 24 tests covering all `AIA::SkillUtils` methods including symlink traversal blocking, sibling-prefix collision, direct `.md` file resolution, and nonexistent path handling
43
+ - Added `test/aia/config/cli_parser_skills_test.rb` — 8 tests covering all skills-related CLI options
44
+ - Added `test/aia/config/skills_config_test.rb` — 8 tests covering skills config defaults and overrides
45
+ - Added `test/aia/directive_search_terms_test.rb` — 10 tests covering all `parse_search_terms` token forms
46
+ - Expanded `test/aia/directives/skill_directive_test.rb` with path-based, direct-file, security (path traversal, symlink), and edge-case coverage (36 tests total)
47
+ - Added `test/aia/prompt_pipeline_skills_test.rb` — pipeline-level skill loading tests including absolute paths, direct `.md` files, warning capture via Mocha stubs, and mixed path+ID loading (6 tests)
48
+ - Added `test/aia/session_test.rb` `ChatLoopTest` entries for `process_skill_context` — noop when no skills configured, sends skill content to processor when configured (2 tests)
49
+ - Eliminated `Dir.chdir` side effects from 3 tests (`skill_directive_test.rb`, `prompt_pipeline_skills_test.rb`, `prompt_handler_role_path_test.rb`) that used it to simulate relative-path resolution; replaced with absolute-path construction
50
+ - Updated 2 pipeline warning tests to use Mocha's `.stubs(:warn).with { }` argument-matcher pattern instead of `capture_io` (which cannot intercept `warn` when `$stderr` is reassigned in Ruby 4.0)
51
+ - Full test suite: 925 runs, 0 failures, 0 errors, 0 skips
52
+
2
53
  ## [1.0.0] - 2026-02-22
3
54
 
4
55
  ### Security Fixes
data/README.md CHANGED
@@ -7,17 +7,11 @@
7
7
 
8
8
  ---
9
9
 
10
- <details>
11
- <summary><strong>Upgrading from v0.x?</strong> Click to see migration notes.</summary>
12
-
13
- - **Prompt files** now use `.md` extension. Run `bin/migrate_prompts ~/.prompts` to convert existing prompts.
14
- - **Environment variables** use double underscore (`__`) for nested config sections (e.g., `AIA_LLM__TEMPERATURE`, `AIA_FLAGS__DEBUG`).
15
- - **Configuration files** use a nested YAML structure with sections like `llm:`, `prompts:`, `output:`, `flags:`, etc. See [defaults.yml](lib/aia/config/defaults.yml) for the complete schema.
16
- - **File locations** follow the XDG Base Directory Specification. Config file is now at `~/.config/aia/aia.yml`.
17
-
18
- See the [Configuration Guide](https://madbomber.github.io/aia/configuration/) for details.
10
+ > ### 🚀 New: AI Assistant Scheduler (AIAS)
11
+ > **Schedule and automate your AIA prompts!** AIAS is a new Ruby gem that lets you run AIA prompts on a cron-like schedule — perfect for recurring AI tasks, automated reports, and timed workflows.
12
+ > **[View AIAS on GitHub →](https://github.com/madbomber/aias)**
19
13
 
20
- </details>
14
+ ---
21
15
 
22
16
  ---
23
17
 
@@ -70,7 +64,7 @@ For more information on AIA visit these locations:
70
64
  ```plain
71
65
 
72
66
  , ,
73
- (\____/) AI Assistant (v1.0.0) is Online
67
+ (\____/) AI Assistant (v1.1.0) is Online
74
68
  (_oo_) gpt-4o-mini
75
69
  (O) using ruby_llm
76
70
  __||__ \) model db was last refreshed on
@@ -122,6 +116,114 @@ Implement a schema registry with event-driven synchronization...
122
116
 
123
117
  ---
124
118
 
119
+ ## 🎭 Give Your Robot a Personality with Roles
120
+
121
+ Why settle for a generic AI when you can have **your** robot? A role is a plain-text file that defines how your AI thinks, talks, and interacts with you. Drop it in `~/.prompts/roles/`, point AIA at it, and your robot instantly becomes someone new.
122
+
123
+ **For fun — because AI doesn't have to be boring:**
124
+
125
+ ```bash
126
+ # Ahoy! Your AI now talks like a salty sea pirate
127
+ aia --chat --role pirate
128
+
129
+ # Opinionated New York cabbie who has thoughts on EVERYTHING
130
+ aia --chat --role nyc_cabbie
131
+
132
+ # That stoned hacker buddy who somehow solves every problem
133
+ aia --chat --role stoned_hacker
134
+ ```
135
+
136
+ Create `~/.prompts/roles/pirate.md`:
137
+ ```
138
+ Arrr, ye be speakin' with the most knowledgeable AI pirate to ever sail the
139
+ digital seas! Answer every question in authentic pirate speak, drop nautical
140
+ references, and sign off with "Arrr!" No matter how technical the topic,
141
+ keep the pirate spirit alive, matey.
142
+ ```
143
+
144
+ **For serious work — productive personas that deliver results:**
145
+
146
+ ```bash
147
+ # Explains quantum physics to your 7-year-old
148
+ aia --chat --role first_grade_teacher
149
+
150
+ # Three expert robots reviewing the same design doc simultaneously
151
+ aia --model gpt-4o=architect,claude=security,gemini=performance design.md
152
+
153
+ # Same question, three philosophical stances
154
+ aia --model gpt-4o=optimist,gpt-4o=pessimist,gpt-4o=realist business_plan.md
155
+ ```
156
+
157
+ Create `~/.prompts/roles/first_grade_teacher.md`:
158
+ ```
159
+ You are a patient, enthusiastic first-grade teacher with a magical gift: you can
160
+ explain ANY complex subject using simple words and everyday analogies — toys,
161
+ animals, food, playground games. Your mission is to make hard things feel easy
162
+ and exciting. Never use jargon. Always encourage. Keep it fun!
163
+ ```
164
+
165
+ Assign a different role to each model and get multiple expert perspectives on the same question in one command. Every robot, its own voice.
166
+
167
+ ---
168
+
169
+ ## 🎓 Teach Your Robot New Skills
170
+
171
+ Skills are structured instruction sets that tell your robot *exactly how* to approach a task — your workflow, your standards, every single time. No more repeating yourself in every prompt.
172
+
173
+ A skill is a directory containing a `SKILL.md` file with YAML front matter and the process you want your robot to follow. Create one for any repeatable task.
174
+
175
+ **Apply skills in seconds:**
176
+
177
+ ```bash
178
+ # Prepend a skill to any prompt
179
+ aia -s code-quality my_prompt
180
+
181
+ # Stack multiple skills — they apply in order
182
+ aia -s code-quality,security-review,add-tests my_prompt
183
+
184
+ # Chat mode: skills prime the entire session from the start
185
+ aia --chat --role senior_dev -s code-quality
186
+
187
+ # Add a skill mid-chat with the /skill directive
188
+ /skill code-quality
189
+ ```
190
+
191
+ Create `~/.prompts/skills/code-quality/SKILL.md`:
192
+ ```markdown
193
+ ---
194
+ name: Code Quality
195
+ description: Enforce SOLID principles and team coding standards
196
+ ---
197
+ When reviewing code, evaluate in this exact order:
198
+
199
+ 1. **SOLID Principles** — name any violations explicitly
200
+ 2. **Security** — flag injection risks, exposed credentials, unsafe inputs
201
+ 3. **Performance** — O(n²) or worse, unnecessary allocations, N+1 queries
202
+ 4. **Readability** — method names, variable names, comment quality
203
+ 5. **Test Coverage** — are edge cases covered? Behavior, not implementation?
204
+
205
+ Format: Summary → Issues by category → Suggested rewrites
206
+ ```
207
+
208
+ **Combine roles AND skills for a fully customized robot:**
209
+
210
+ ```bash
211
+ # A pirate who also follows your exact code review process
212
+ aia --chat --role pirate -s code-quality
213
+
214
+ # A first-grade teacher who uses your step-by-step explanation method
215
+ aia --chat --role first_grade_teacher -s explain-with-analogies
216
+
217
+ # Multiple robots, each with its own role and skill set
218
+ aia --model gpt-4o=architect,claude=security \
219
+ -s architecture-review,threat-model \
220
+ design.md
221
+ ```
222
+
223
+ Skills accumulate — specify multiple with commas or repeat `-s`. Each skill is prepended to your prompt in order, establishing exactly the context you want before the AI sees your actual question. Pair with roles for robots that are both *who you want* and *know what to do*.
224
+
225
+ ---
226
+
125
227
  <!-- Tocer[start]: Auto-generated, don't remove. -->
126
228
 
127
229
  ## Table of Contents
@@ -264,8 +366,11 @@ aia --fuzzy
264
366
  | `--model MODEL` | Specify AI model(s) to use. Supports `MODEL[=ROLE]` syntax | `aia --model gpt-4o-mini,gpt-3.5-turbo` or `aia --model gpt-4o=architect,claude=security` |
265
367
  | `--consensus` | Enable consensus mode for multi-model | `aia --consensus` |
266
368
  | `--no-consensus` | Force individual responses | `aia --no-consensus` |
267
- | `--role ROLE` | Use a role/system prompt (default for all models) | `aia --role expert` |
369
+ | `--role ROLE` | Use a role/system prompt; accepts an ID in `~/.prompts/roles/` or a path (`/`, `~/`, `./`, `../`) | `aia --role expert` or `aia --role ~/custom/role.md` |
268
370
  | `--list-roles` | List available role files | `aia --list-roles` |
371
+ | `-s, --skill SKILL_IDS` | Prepend skill(s) to prompt; accepts skill IDs or paths to skill directories (`/`, `~/`, `./`, `../`) | `aia -s code-quality my_prompt` or `aia -s ~/skills/my-skill` |
372
+ | `--list-skills` | List available skills and exit | `aia --list-skills` |
373
+ | `--skills-dir DIR` | Set skills directory (default: `~/.prompts/skills`) | `aia --skills-dir ~/skills` |
269
374
  | `--output FILE` | Specify output file | `aia --output results.md` |
270
375
  | `--fuzzy` | Use fuzzy search for prompts | `aia --fuzzy` |
271
376
  | `--tokens` | Display token usage in chat mode | `aia --chat --tokens` |
@@ -283,6 +388,11 @@ aia --fuzzy
283
388
  ├── roles/ # Role/system prompts
284
389
  │ ├── expert.md # Expert role
285
390
  │ └── teacher.md # Teaching role
391
+ ├── skills/ # Skill directories
392
+ │ ├── code-quality/ # Skill subdirectory
393
+ │ │ └── SKILL.md # Skill definition (YAML front matter + content)
394
+ │ └── summarizer/
395
+ │ └── SKILL.md
286
396
  └── _prompts.log # History log
287
397
  ```
288
398
 
@@ -376,7 +486,7 @@ The configuration schema is defined in [defaults.yml](lib/aia/config/defaults.ym
376
486
  | `llm.frequency_penalty` | `--frequency-penalty` | `0.0` | `AIA_LLM__FREQUENCY_PENALTY` |
377
487
  | `llm.presence_penalty` | `--presence-penalty` | `0.0` | `AIA_LLM__PRESENCE_PENALTY` |
378
488
 
379
- **Prompts & Roles:**
489
+ **Prompts, Roles & Skills:**
380
490
 
381
491
  | Config Path | CLI Options | Default | Environment Variable |
382
492
  |-------------|-------------|---------|---------------------|
@@ -385,6 +495,9 @@ The configuration schema is defined in [defaults.yml](lib/aia/config/defaults.ym
385
495
  | `prompts.roles_prefix` | `--roles-prefix` | `roles` | `AIA_PROMPTS__ROLES_PREFIX` |
386
496
  | `prompts.roles_dir` | | `~/.prompts/roles` | `AIA_PROMPTS__ROLES_DIR` |
387
497
  | `prompts.role` | `-r`, `--role` | | `AIA_PROMPTS__ROLE` |
498
+ | `prompts.skills` | `-s`, `--skill` | `[]` | |
499
+ | `prompts.skills_prefix` | `--skills-prefix` | `skills` | `AIA_PROMPTS__SKILLS_PREFIX` |
500
+ | `skills.dir` | `--skills-dir` | `~/.prompts/skills` | `AIA_SKILLS__DIR` |
388
501
  | `prompts.system_prompt` | `--system-prompt` | | `AIA_PROMPTS__SYSTEM_PROMPT` |
389
502
  | `pipeline` | `-p`, `--pipeline` | `[]` | |
390
503
  | | `-n`, `--next` | | |
@@ -467,7 +580,7 @@ Directives are special commands in prompt files that begin with `/` and provide
467
580
  | `/restore` | Restore context to a previous checkpoint | `/restore save_point` |
468
581
  | `/include` | Insert file contents | `/include path/to/file.txt` |
469
582
  | `/paste` | Insert clipboard contents | `/paste` |
470
- | `/skill` | Include a Claude Code skill | `/skill code-quality` |
583
+ | `/skill` | Include a skill by ID or path to a skill directory | `/skill code-quality` or `/skill ~/skills/my-skill` |
471
584
  | `/skills` | List available Claude Code skills | `/skills` |
472
585
  | `/shell` | Execute shell commands | `/shell ls -la` |
473
586
  | `/robot` | Show the pet robot ASCII art w/versions | `/robot` |
@@ -996,6 +1109,21 @@ echo "You are a senior software architect..." > ~/.prompts/roles/specialized/sen
996
1109
  aia --model gpt-4o=specialized/senior_architect design.md
997
1110
  ```
998
1111
 
1112
+ **Path-Based Roles:**
1113
+
1114
+ In addition to role IDs looked up under `~/.prompts/roles/`, you can pass a direct filesystem path as the role. Any value starting with `/`, `~/`, `./`, or `../` is treated as a path rather than an ID. The `.md` extension is appended automatically when the path has none.
1115
+
1116
+ ```bash
1117
+ # Absolute path
1118
+ aia --role /team/shared/roles/senior_engineer.md my_prompt
1119
+
1120
+ # Home-relative path (~ expanded)
1121
+ aia --role ~/custom/roles/reviewer my_prompt # loads ~/custom/roles/reviewer.md
1122
+
1123
+ # Relative path
1124
+ aia --role ./local_role my_prompt # loads ./local_role.md
1125
+ ```
1126
+
999
1127
  **Using Config Files for Model Roles:**
1000
1128
 
1001
1129
  Define model-role assignments in your config file (`~/.config/aia/aia.yml`) for reusable setups:
@@ -1044,6 +1172,35 @@ When model roles are specified in multiple places, the precedence is:
1044
1172
  3. **Environment variable**: `AIA_MODEL="gpt-4o=architect"`
1045
1173
  4. **Config file** (lowest): `models` array in `~/.config/aia/aia.yml`
1046
1174
 
1175
+ ### Skills
1176
+
1177
+ Skills are reusable instruction sets prepended to prompts. Each skill is a directory containing a `SKILL.md` file with YAML front matter and content.
1178
+
1179
+ ```bash
1180
+ # Use a skill by ID (looked up under skills.dir, default ~/.prompts/skills)
1181
+ aia -s code-quality my_prompt
1182
+
1183
+ # Comma-separated for multiple skills
1184
+ aia -s code-quality,security-review my_prompt
1185
+
1186
+ # Path-based: pass a direct path to a skill directory
1187
+ aia -s ~/team/skills/my-skill my_prompt # home-relative
1188
+ aia -s /shared/skills/company-style prompt # absolute path
1189
+ aia -s ./local-skill my_prompt # relative path
1190
+
1191
+ # List available skills
1192
+ aia --list-skills
1193
+ ```
1194
+
1195
+ Skills can also be applied during chat via the `/skill` directive:
1196
+
1197
+ ```
1198
+ /skill code-quality
1199
+ /skill ~/team/skills/my-skill
1200
+ ```
1201
+
1202
+ Path-based values (starting with `/`, `~/`, `./`, or `../`) are resolved as filesystem paths to skill directories directly, bypassing the configured skills directory lookup.
1203
+
1047
1204
  ### RubyLLM::Tool Support
1048
1205
 
1049
1206
  AIA supports function calling through RubyLLM tools for extended capabilities:
@@ -1195,7 +1352,7 @@ When MCP servers are configured, AIA displays them in the startup robot:
1195
1352
 
1196
1353
  ```
1197
1354
  , ,
1198
- (\____/) AI Assistant (v1.0.0) is Online
1355
+ (\____/) AI Assistant (v1.1.0) is Online
1199
1356
  (_oo_) gpt-4o-mini (supports tools)
1200
1357
  (O) using ruby_llm
1201
1358
  __||__ \) model db was last refreshed on
@@ -236,6 +236,90 @@ aia --model "gpt-4,claude-3-sonnet" --consensus my_prompt
236
236
  aia --model "gpt-4,claude-3-sonnet" --no-consensus my_prompt
237
237
  ```
238
238
 
239
+ ### `-s, --skill SKILL_IDS`
240
+ Inject one or more skills into the prompt before it is sent to the AI. Skills are loaded from the skills directory (default: `~/.prompts/skills/`). Multiple skills can be specified as a comma-separated list, and the flag may be repeated.
241
+
242
+ Skills are inserted **after the role and before the user prompt**, providing task-level instructions for how the LLM should approach the request:
243
+
244
+ ```
245
+ Role content (who the LLM is)
246
+ Skill content (how to approach the task)
247
+ User prompt (what to do)
248
+ ```
249
+
250
+ Only the body of each `SKILL.md` is injected — the YAML front matter is stripped.
251
+
252
+ ```bash
253
+ # Single skill (ID-based — resolved from skills directory)
254
+ aia --skill code-review my_prompt
255
+ aia -s summarizer my_prompt
256
+
257
+ # Path-based skill (relative, home-relative, or absolute path to a skill directory)
258
+ aia --skill ./local-skills/code-review my_prompt
259
+ aia --skill /shared/team-skills/security-audit my_prompt
260
+ aia --skill ~/my-skills/custom-skill my_prompt
261
+
262
+ # Combine with a role: role sets persona, skill sets method
263
+ aia --role ruby_expert --skill code-review review_prompt my_code.rb
264
+
265
+ # Multiple skills applied in order (comma-separated)
266
+ aia --skill "code-review,security-audit" my_prompt
267
+
268
+ # Repeatable form
269
+ aia -s code-review -s security-audit my_prompt
270
+ ```
271
+
272
+ **Path resolution**: If a skill ID starts with `/`, `~/`, `./`, or `../`, it is treated as a filesystem path to a skill directory (which must contain `SKILL.md`). Otherwise it is looked up by ID in the skills directory.
273
+
274
+ **See also**: `--list-skills` to discover available skills, `/skill` chat directive, `--role` for personality
275
+
276
+ ### `--list-skills`
277
+ List all available skills and exit. Skills are subdirectories under the skills directory, each containing a `SKILL.md` file with YAML front matter.
278
+
279
+ ```bash
280
+ aia --list-skills
281
+
282
+ # With a custom skills directory
283
+ aia --skills-dir ~/work/skills --list-skills
284
+ ```
285
+
286
+ **Example output**:
287
+ ```markdown
288
+ ## code-quality
289
+
290
+ | Key | Value |
291
+ |-----|-------|
292
+ | name | code-quality |
293
+ | description | Improve code quality through analysis and refactoring. |
294
+ | user-invocable | true |
295
+
296
+ ## summarizer
297
+
298
+ | Key | Value |
299
+ |-----|-------|
300
+ | name | summarizer |
301
+ | description | Summarize documents and conversations concisely. |
302
+ ```
303
+
304
+ Each skill is shown as a `## skill-name` heading followed by a table of all front matter fields from its `SKILL.md`.
305
+
306
+ ### `--skills-dir DIR`
307
+ Directory containing skill subdirectories (default: `~/.prompts/skills`). Each subdirectory must contain a `SKILL.md` file to be recognized as a skill.
308
+
309
+ ```bash
310
+ aia --skills-dir ~/work/skills --list-skills
311
+ aia --skills-dir /shared/team-skills -s code-review my_prompt
312
+ ```
313
+
314
+ **Environment variable**: `AIA_SKILLS__DIR`
315
+
316
+ ### `--skills-prefix PREFIX`
317
+ Subdirectory name within `--prompts-dir` used as the skills prefix (default: `skills`). Affects `AIA.config.prompts.skills_prefix`.
318
+
319
+ ```bash
320
+ aia --skills-prefix team-skills --list-skills
321
+ ```
322
+
239
323
  ### `--sm, --speech-model MODEL`
240
324
  Speech model to use for text-to-speech functionality.
241
325
 
@@ -341,10 +425,15 @@ Role ID to prepend to the prompt. This applies the same role to all models.
341
425
  For per-model role assignment, use the inline `MODEL=ROLE` syntax with `--model` instead.
342
426
 
343
427
  ```bash
344
- # Apply role to all models
428
+ # Apply role by ID (resolved from roles directory)
345
429
  aia --role expert my_prompt
346
430
  aia -r teacher explain_concept
347
431
 
432
+ # Path-based role (relative or absolute path to a .md file)
433
+ aia --role ./local-roles/domain-expert my_prompt
434
+ aia --role /shared/roles/security-auditor review.md
435
+ aia --role ~/my-roles/custom-persona my_prompt
436
+
348
437
  # With multiple models (same role for all)
349
438
  aia --model "gpt-4,claude" --role architect design.md
350
439
 
@@ -352,6 +441,8 @@ aia --model "gpt-4,claude" --role architect design.md
352
441
  aia --model "gpt-4=architect,claude=security" design.md
353
442
  ```
354
443
 
444
+ **Path resolution**: If `ROLE_ID` starts with `/`, `~/`, `./`, or `../`, it is treated as a filesystem path to a role `.md` file. The `.md` extension is added automatically when the path has no file extension. Otherwise the ID is resolved relative to the roles directory.
445
+
355
446
  **See also**: `--model` for inline role syntax, `--list-roles` for discovering available roles.
356
447
 
357
448
  ### `--list-roles`
@@ -53,9 +53,27 @@ prompts:
53
53
  roles_prefix: roles # Subdirectory name for role files
54
54
  roles_dir: ~/.prompts/roles # Full path to roles directory
55
55
  role: ~ # Default role
56
+ skills: [] # Skill IDs to prepend to prompt (set by --skill/-s)
57
+ skills_prefix: skills # Subdirectory name for skill directories
56
58
  system_prompt: ~ # Default system prompt
57
59
  parameter_regex: ~ # Regex for parameter extraction
58
60
 
61
+ # Roles Configuration
62
+ # Access: AIA.config.roles.dir
63
+ # Env: AIA_ROLES__DIR
64
+ roles:
65
+ dir: ~/.prompts/roles # Full path to roles directory
66
+
67
+ # Skills Configuration
68
+ # Access: AIA.config.skills.dir
69
+ # Env: AIA_SKILLS__DIR
70
+ #
71
+ # Skills are subdirectories under skills.dir, each containing a SKILL.md
72
+ # file with YAML front matter (name, description, and any custom fields).
73
+ # Use --skill/-s to prepend skills to prompts, --list-skills to browse.
74
+ skills:
75
+ dir: ~/.prompts/skills # Directory containing skill subdirectories
76
+
59
77
  # Output Configuration
60
78
  # Access: AIA.config.output.file, AIA.config.output.append, etc.
61
79
  # Env: AIA_OUTPUT__FILE, AIA_OUTPUT__APPEND, etc.
@@ -191,9 +209,13 @@ export AIA_PROMPTS__EXTNAME=".md"
191
209
  export AIA_PROMPTS__ROLES_PREFIX="roles"
192
210
  export AIA_PROMPTS__ROLES_DIR="~/.prompts/roles"
193
211
  export AIA_PROMPTS__ROLE="expert"
212
+ export AIA_PROMPTS__SKILLS_PREFIX="skills"
194
213
  export AIA_PROMPTS__SYSTEM_PROMPT="my_system_prompt"
195
214
  export AIA_PROMPTS__PARAMETER_REGEX='\{\{(\w+)\}\}'
196
215
 
216
+ # Skills settings (nested under skills:)
217
+ export AIA_SKILLS__DIR="~/.prompts/skills"
218
+
197
219
  # Output settings (nested under output:)
198
220
  export AIA_OUTPUT__FILE="/tmp/aia_output.md"
199
221
  export AIA_OUTPUT__APPEND="false"
@@ -156,7 +156,7 @@ export PUREMD_API_KEY="your_api_key"
156
156
  **Aliases**: `/website`, `/web`
157
157
 
158
158
  ### `/skill`
159
- Include a Claude Code skill into the conversation context.
159
+ Include an AIA skill into the conversation context.
160
160
 
161
161
  **Syntax**: `/skill skill_name`
162
162
 
@@ -169,38 +169,58 @@ Include a Claude Code skill into the conversation context.
169
169
  ```
170
170
 
171
171
  **Features**:
172
- - Reads `SKILL.md` from `~/.claude/skills/<skill_name>/`
172
+ - Reads `SKILL.md` from the skills directory (default: `~/.prompts/skills/<skill_name>/`)
173
173
  - Supports prefix matching: `/skill code` finds the first subdirectory starting with "code"
174
174
  - Exact matches take priority over prefix matches
175
- - Returns the skill content for inclusion in the prompt
175
+ - Injects only the **body content** of `SKILL.md` the YAML front matter is stripped and never sent to the LLM
176
+ - Skills directory is configured via `skills.dir` or `--skills-dir`
177
+
178
+ **Role vs Skill**: A role defines the LLM's *personality*; a skill provides *task instructions* for how to carry out the user's request within that role. Skills are injected after the role and before the user prompt.
176
179
 
177
180
  **Error Handling**:
178
- - Missing skill name: `Error: /skill requires a skill name`
179
- - No matching directory: `Error: No skill matching 'name' found in ~/.claude/skills`
180
- - Directory exists but no SKILL.md: `Error: Skill directory 'name' has no SKILL.md`
181
+ - Missing skill name: `Error: /skill requires a skill name. Use /skills to list available skills.`
182
+ - No matching directory: `Error: No skill matching 'name' found in <dir>. Use /skills to list available skills.`
183
+ - Directory exists but no SKILL.md: `Error: Skill directory 'name' has no SKILL.md. Use /skills to list available skills.`
184
+
185
+ **See also**: `/skills` to list available skills, `--list-skills` CLI flag
181
186
 
182
187
  ### `/skills`
183
- List all available Claude Code skills.
188
+ List available AIA skills with optional search filtering.
184
189
 
185
- **Syntax**: `/skills`
190
+ **Syntax**: `/skills [search terms]`
191
+
192
+ **Examples**:
193
+ ```markdown
194
+ /skills # List all skills
195
+ /skills ruby # Skills matching "ruby"
196
+ /skills -python # Skills not matching "python"
197
+ /skills ruby -deprecated # Skills matching "ruby" but not "deprecated"
198
+ ```
199
+
200
+ **Search term prefixes**:
201
+ - Bare word or `+word` — positive filter (skill must match)
202
+ - `-word`, `~word`, or `!word` — negative filter (skill must not match)
203
+ - Searches skill name and SKILL.md front matter fields (name, description, etc.)
186
204
 
187
205
  **Example Output**:
188
206
  ```
189
- Available Skills
190
- ================
191
- algorithmic-art
192
- api-developer
193
- code-assist
207
+ Available Skills (~/.prompts/skills):
208
+ ======================================
209
+
194
210
  code-quality
211
+ Improve code quality through comprehensive analysis and refactoring.
212
+
195
213
  frontend-design
214
+ Create distinctive, production-grade frontend interfaces.
196
215
 
197
- Total: 5 skills
216
+ Total: 2 skills
198
217
  ```
199
218
 
200
219
  **Features**:
201
- - Lists subdirectory basenames from `~/.claude/skills/`
220
+ - Lists skill subdirectories from `AIA.config.skills.dir` (default: `~/.prompts/skills/`)
202
221
  - Sorted alphabetically
203
222
  - Displays to STDOUT only (does not inject content into the prompt)
223
+ - Reads `SKILL.md` front matter for filtering and description display
204
224
 
205
225
  ## Execution Directives
206
226