aia 1.0.0.pre.beta → 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.
Files changed (53) hide show
  1. checksums.yaml +4 -4
  2. data/.version +1 -1
  3. data/CHANGELOG.md +89 -0
  4. data/COMMITS.md +192 -11
  5. data/README.md +327 -110
  6. data/docs/cli-reference.md +93 -10
  7. data/docs/configuration.md +29 -36
  8. data/docs/contributing.md +2 -2
  9. data/docs/directives-reference.md +49 -27
  10. data/docs/examples/index.md +2 -2
  11. data/docs/examples/mcp/index.md +93 -97
  12. data/docs/examples/prompts/automation/index.md +3 -2
  13. data/docs/examples/tools/index.md +17 -27
  14. data/docs/faq.md +9 -12
  15. data/docs/guides/basic-usage.md +4 -4
  16. data/docs/guides/chat.md +39 -34
  17. data/docs/guides/tools.md +4 -4
  18. data/docs/index.md +36 -62
  19. data/docs/installation.md +1 -1
  20. data/docs/mcp-integration.md +75 -139
  21. data/docs/prompt_management.md +88 -1
  22. data/docs/security.md +79 -81
  23. data/docs/tools-and-mcp-examples.md +8 -6
  24. data/docs/workflows-and-pipelines.md +2 -6
  25. data/examples/.gitignore +1 -0
  26. data/examples/README.md +41 -0
  27. data/examples/run_all.sh +261 -0
  28. data/lib/aia/adapter/chat_execution.rb +9 -7
  29. data/lib/aia/adapter/mcp_connector.rb +0 -29
  30. data/lib/aia/adapter/modality_handlers.rb +23 -15
  31. data/lib/aia/adapter/tool_filter.rb +21 -0
  32. data/lib/aia/adapter/tool_loader.rb +1 -9
  33. data/lib/aia/chat_loop.rb +244 -0
  34. data/lib/aia/chat_processor_service.rb +6 -3
  35. data/lib/aia/config/cli_parser.rb +56 -18
  36. data/lib/aia/config/defaults.yml +17 -2
  37. data/lib/aia/config/validator.rb +52 -11
  38. data/lib/aia/config.rb +29 -3
  39. data/lib/aia/directive.rb +29 -0
  40. data/lib/aia/directives/configuration_directives.rb +2 -1
  41. data/lib/aia/directives/execution_directives.rb +1 -1
  42. data/lib/aia/directives/model_directives.rb +28 -27
  43. data/lib/aia/directives/web_and_file_directives.rb +78 -40
  44. data/lib/aia/errors.rb +20 -1
  45. data/lib/aia/fzf.rb +8 -7
  46. data/lib/aia/input_collector.rb +24 -0
  47. data/lib/aia/prompt_handler.rb +36 -8
  48. data/lib/aia/prompt_pipeline.rb +183 -0
  49. data/lib/aia/session.rb +22 -372
  50. data/lib/aia/skill_utils.rb +61 -0
  51. data/lib/aia/ui_presenter.rb +8 -0
  52. data/lib/aia.rb +4 -0
  53. metadata +19 -45
data/README.md CHANGED
@@ -7,17 +7,11 @@
7
7
 
8
8
  ---
9
9
 
10
- > ## ⚠️ BREAKING CHANGES IN v0.10.* ⚠️
11
- >
12
- > **Version 0.10.0 introduces breaking changes affecting:**
13
- >
14
- > - **Environment Variables** — Naming conventions now use double underscore (`__`) for nested config sections (e.g., `AIA_LLM__TEMPERATURE`, `AIA_FLAGS__DEBUG`). See [Environment Variables](https://madbomber.github.io/aia/configuration/#environment-variables) for the complete list.
15
- >
16
- > - **Configuration Files** — Configuration now uses a nested YAML structure with sections like `llm:`, `prompts:`, `output:`, `flags:`, etc. The [defaults.yml](lib/aia/config/defaults.yml) file is the single source of truth for all configuration options. See [Configuration Guide](https://madbomber.github.io/aia/configuration/) for details.
17
- >
18
- > - **File Locations** — Configuration files now follow the XDG Base Directory Specification. The default config file location is `~/.config/aia/aia.yml`. See [Installation Guide](https://madbomber.github.io/aia/installation/) for setup instructions.
19
- >
20
- > **Review the [Configuration Guide](https://madbomber.github.io/aia/configuration/) before upgrading to v0.10.0.**
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)**
13
+
14
+ ---
21
15
 
22
16
  ---
23
17
 
@@ -70,9 +64,9 @@ For more information on AIA visit these locations:
70
64
  ```plain
71
65
 
72
66
  , ,
73
- (\____/) AI Assistant (v0.9.7) is Online
67
+ (\____/) AI Assistant (v1.1.0) is Online
74
68
  (_oo_) gpt-4o-mini
75
- (O) using ruby_llm (v1.3.1)
69
+ (O) using ruby_llm
76
70
  __||__ \) model db was last refreshed on
77
71
  [/______\] / 2025-06-18
78
72
  / \__AI__/ \/ You can share my tools
@@ -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
 
@@ -307,8 +417,10 @@ AIA determines configuration settings using this order (highest to lowest priori
307
417
  1. **Embedded config directives** (in prompt files): `/config model = gpt-4`
308
418
  2. **Command-line arguments**: `--model gpt-4`
309
419
  3. **Environment variables**: `export AIA_MODEL=gpt-4`
310
- 4. **Configuration files**: `~/.aia/config.yml`
311
- 5. **Default values**
420
+ 4. **Configuration files**: `~/.config/aia/aia.yml`
421
+ 5. **Default values**: [defaults.yml](lib/aia/config/defaults.yml)
422
+
423
+ **Note:** When `-c` / `--config-file` is used, it replaces the user config and environment variables. Configuration resets to bundled defaults, then the specified file is applied, then CLI arguments take precedence.
312
424
 
313
425
  ### Configuration Methods
314
426
 
@@ -319,12 +431,16 @@ export AIA_PROMPTS__DIR=~/my-prompts
319
431
  export AIA_LLM__TEMPERATURE=0.8
320
432
  ```
321
433
 
322
- **Configuration File** (`~/.aia/config.yml`):
434
+ **Configuration File** (`~/.config/aia/aia.yml`):
323
435
  ```yaml
324
- model: gpt-4
325
- prompts_dir: ~/my-prompts
326
- temperature: 0.8
327
- chat: false
436
+ models:
437
+ - name: gpt-4
438
+ prompts:
439
+ dir: ~/my-prompts
440
+ llm:
441
+ temperature: 0.8
442
+ flags:
443
+ chat: false
328
444
  ```
329
445
 
330
446
  **Embedded Directives** (in prompt files):
@@ -340,56 +456,113 @@ Your prompt content here...
340
456
  <details>
341
457
  <summary>Click to view all configuration options</summary>
342
458
 
343
- | Config Item Name | CLI Options | Default Value | Environment Variable |
344
- |------------------|-------------|---------------|---------------------|
345
- | adapter | --adapter | ruby_llm | AIA_ADAPTER |
346
- | aia_dir | | ~/.aia | AIA_DIR |
347
- | append | -a, --append | false | AIA_FLAGS__APPEND |
348
- | chat | --chat | false | AIA_FLAGS__CHAT |
349
- | clear | --clear | false | AIA_FLAGS__CLEAR |
350
- | config_file | -c, --config-file | ~/.aia/config.yml | AIA_CONFIG_FILE |
351
- | debug | -d, --debug | false | AIA_FLAGS__DEBUG |
352
- | embedding_model | --em, --embedding_model | text-embedding-ada-002 | AIA_LLM__EMBEDDING_MODEL |
353
- | erb | | true | AIA_FLAGS__ERB |
354
- | frequency_penalty | --frequency-penalty | 0.0 | AIA_LLM__FREQUENCY_PENALTY |
355
- | fuzzy | -f, --fuzzy | false | AIA_FLAGS__FUZZY |
356
- | image_quality | --iq, --image-quality | standard | AIA_IMAGE__QUALITY |
357
- | image_size | --is, --image-size | 1024x1024 | AIA_IMAGE__SIZE |
358
- | image_style | --style, --image-style | vivid | AIA_IMAGE__STYLE |
359
- | history_file | --history-file | ~/.prompts/_prompts.log | AIA_OUTPUT__HISTORY_FILE |
360
- | markdown | --md, --markdown | true | AIA_OUTPUT__MARKDOWN |
361
- | max_tokens | --max-tokens | 2048 | AIA_LLM__MAX_TOKENS |
362
- | model | -m, --model | gpt-4o-mini | AIA_MODEL |
363
- | next | -n, --next | nil | AIA_NEXT |
364
- | output | -o, --output | temp.md | AIA_OUTPUT__FILE |
365
- | parameter_regex | --regex | '(?-mix:(\[[A-Z _\|]+\]))' | AIA_PROMPTS__PARAMETER_REGEX |
366
- | pipeline | --pipeline | [] | AIA_PIPELINE |
367
- | presence_penalty | --presence-penalty | 0.0 | AIA_LLM__PRESENCE_PENALTY |
368
- | prompt_extname | | .md | AIA_PROMPTS__EXTNAME |
369
- | prompts_dir | --prompts-dir | ~/.prompts | AIA_PROMPTS__DIR |
370
- | refresh | --refresh | 7 (days) | AIA_REGISTRY__REFRESH |
371
- | require_libs | --rq --require | [] | AIA_REQUIRE_LIBS |
372
- | role | -r, --role | | AIA_ROLE |
373
- | roles_dir | | ~/.prompts/roles | AIA_ROLES__DIR |
374
- | roles_prefix | --roles-prefix | roles | AIA_ROLES__PREFIX |
375
- | shell | | true | AIA_FLAGS__SHELL |
376
- | speak | --speak | false | AIA_FLAGS__SPEAK |
377
- | speak_command | | afplay | AIA_SPEECH__COMMAND |
378
- | speech_model | --sm, --speech-model | tts-1 | AIA_SPEECH__MODEL |
379
- | system_prompt | --system-prompt | | AIA_SYSTEM_PROMPT |
380
- | temperature | -t, --temperature | 0.7 | AIA_LLM__TEMPERATURE |
381
- | terse | --terse | false | AIA_FLAGS__TERSE |
382
- | tokens | --tokens | false | AIA_FLAGS__TOKENS |
383
- | cost | --cost | false | AIA_FLAGS__COST |
384
- | tool_paths | --tools | [] | AIA_TOOLS__PATHS |
385
- | allowed_tools | --at, --allowed-tools | nil | AIA_TOOLS__ALLOWED |
386
- | rejected_tools | --rt, --rejected-tools | nil | AIA_TOOLS__REJECTED |
387
- | mcp_use | --mu, --mcp-use | ~ | AIA_MCP_USE |
388
- | mcp_skip | --ms, --mcp-skip | ~ | AIA_MCP_SKIP |
389
- | top_p | --top-p | 1.0 | AIA_LLM__TOP_P |
390
- | transcription_model | --tm, --transcription-model | whisper-1 | AIA_TRANSCRIPTION__MODEL |
391
- | verbose | -v, --verbose | false | AIA_FLAGS__VERBOSE |
392
- | voice | --voice | alloy | AIA_SPEECH__VOICE |
459
+ The configuration schema is defined in [defaults.yml](lib/aia/config/defaults.yml). Environment variables use the `AIA_` prefix with double underscores for nested keys.
460
+
461
+ **Mode & Display Flags:**
462
+
463
+ | Config Path | CLI Options | Default | Environment Variable |
464
+ |-------------|-------------|---------|---------------------|
465
+ | `flags.chat` | `--chat` | `false` | `AIA_FLAGS__CHAT` |
466
+ | `flags.fuzzy` | `-f`, `--fuzzy` | `false` | `AIA_FLAGS__FUZZY` |
467
+ | `flags.debug` | `-d`, `--debug` | `false` | `AIA_FLAGS__DEBUG` |
468
+ | `flags.verbose` | `-v`, `--verbose` | `false` | `AIA_FLAGS__VERBOSE` |
469
+ | `flags.tokens` | `--tokens` | `false` | `AIA_FLAGS__TOKENS` |
470
+ | `flags.cost` | `--cost` | `false` | `AIA_FLAGS__COST` |
471
+ | `flags.consensus` | `--[no-]consensus` | `false` | `AIA_FLAGS__CONSENSUS` |
472
+ | `flags.speak` | `--speak` | `false` | `AIA_FLAGS__SPEAK` |
473
+ | `flags.shell` | | `true` | `AIA_FLAGS__SHELL` |
474
+ | `flags.erb` | | `true` | `AIA_FLAGS__ERB` |
475
+ | `flags.clear` | `--clear` | `false` | `AIA_FLAGS__CLEAR` |
476
+ | `flags.no_mcp` | `--no-mcp` | `false` | `AIA_FLAGS__NO_MCP` |
477
+
478
+ **Model & LLM Parameters:**
479
+
480
+ | Config Path | CLI Options | Default | Environment Variable |
481
+ |-------------|-------------|---------|---------------------|
482
+ | `models` | `-m`, `--model` | `gpt-4o-mini` | `AIA_MODEL` |
483
+ | `llm.temperature` | `-t`, `--temperature` | `0.7` | `AIA_LLM__TEMPERATURE` |
484
+ | `llm.max_tokens` | `--max-tokens` | `2048` | `AIA_LLM__MAX_TOKENS` |
485
+ | `llm.top_p` | `--top-p` | `1.0` | `AIA_LLM__TOP_P` |
486
+ | `llm.frequency_penalty` | `--frequency-penalty` | `0.0` | `AIA_LLM__FREQUENCY_PENALTY` |
487
+ | `llm.presence_penalty` | `--presence-penalty` | `0.0` | `AIA_LLM__PRESENCE_PENALTY` |
488
+
489
+ **Prompts, Roles & Skills:**
490
+
491
+ | Config Path | CLI Options | Default | Environment Variable |
492
+ |-------------|-------------|---------|---------------------|
493
+ | `prompts.dir` | `--prompts-dir` | `~/.prompts` | `AIA_PROMPTS__DIR` |
494
+ | `prompts.extname` | | `.md` | `AIA_PROMPTS__EXTNAME` |
495
+ | `prompts.roles_prefix` | `--roles-prefix` | `roles` | `AIA_PROMPTS__ROLES_PREFIX` |
496
+ | `prompts.roles_dir` | | `~/.prompts/roles` | `AIA_PROMPTS__ROLES_DIR` |
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` |
501
+ | `prompts.system_prompt` | `--system-prompt` | | `AIA_PROMPTS__SYSTEM_PROMPT` |
502
+ | `pipeline` | `-p`, `--pipeline` | `[]` | |
503
+ | | `-n`, `--next` | | |
504
+
505
+ **Output & Files:**
506
+
507
+ | Config Path | CLI Options | Default | Environment Variable |
508
+ |-------------|-------------|---------|---------------------|
509
+ | `output.file` | `-o`, `--[no-]output` | `temp.md` | `AIA_OUTPUT__FILE` |
510
+ | `output.append` | `-a`, `--[no-]append` | `false` | `AIA_OUTPUT__APPEND` |
511
+ | `output.markdown` | `--md`, `--[no-]markdown` | `true` | `AIA_OUTPUT__MARKDOWN` |
512
+ | `output.history_file` | `--history-file` | `~/.prompts/_prompts.log` | `AIA_OUTPUT__HISTORY_FILE` |
513
+ | `paths.aia_dir` | | `~/.config/aia` | `AIA_PATHS__AIA_DIR` |
514
+ | `paths.config_file` | `-c`, `--config-file` | `~/.config/aia/aia.yml` | `AIA_PATHS__CONFIG_FILE` |
515
+
516
+ **Audio & Image:**
517
+
518
+ | Config Path | CLI Options | Default | Environment Variable |
519
+ |-------------|-------------|---------|---------------------|
520
+ | `audio.voice` | `--voice` | `alloy` | `AIA_AUDIO__VOICE` |
521
+ | `audio.speak_command` | | `afplay` | `AIA_AUDIO__SPEAK_COMMAND` |
522
+ | `audio.speech_model` | `--sm`, `--speech-model` | `tts-1` | `AIA_AUDIO__SPEECH_MODEL` |
523
+ | `audio.transcription_model` | `--tm`, `--transcription-model` | `whisper-1` | `AIA_AUDIO__TRANSCRIPTION_MODEL` |
524
+ | `image.size` | `--is`, `--image-size` | `1024x1024` | `AIA_IMAGE__SIZE` |
525
+ | `image.quality` | `--iq`, `--image-quality` | `standard` | `AIA_IMAGE__QUALITY` |
526
+ | `image.style` | `--style`, `--image-style` | `vivid` | `AIA_IMAGE__STYLE` |
527
+ | `embedding.model` | | `text-embedding-ada-002` | `AIA_EMBEDDING__MODEL` |
528
+
529
+ **Tools & MCP:**
530
+
531
+ | Config Path | CLI Options | Default | Environment Variable |
532
+ |-------------|-------------|---------|---------------------|
533
+ | `tools.paths` | `--tools` | `[]` | `AIA_TOOLS__PATHS` |
534
+ | `tools.allowed` | `--at`, `--allowed-tools` | | `AIA_TOOLS__ALLOWED` |
535
+ | `tools.rejected` | `--rt`, `--rejected-tools` | | `AIA_TOOLS__REJECTED` |
536
+ | `mcp_servers` | | `[]` | |
537
+ | `mcp_use` | `--mu`, `--mcp-use` | | `AIA_MCP_USE` |
538
+ | `mcp_skip` | `--ms`, `--mcp-skip` | | `AIA_MCP_SKIP` |
539
+ | | `--mcp FILE` | | |
540
+ | | `--mcp-list` | | |
541
+ | `require_libs` | `--rq`, `--require` | `[]` | |
542
+
543
+ **Logging:**
544
+
545
+ | Config Path | CLI Options | Default | Environment Variable |
546
+ |-------------|-------------|---------|---------------------|
547
+ | `logger.aia.level` | `--log-level` | `warn` | `AIA_LOGGER__AIA__LEVEL` |
548
+ | `logger.aia.file` | `--log-to` | `STDOUT` | `AIA_LOGGER__AIA__FILE` |
549
+ | `logger.llm.level` | `--log-level` | `warn` | `AIA_LOGGER__LLM__LEVEL` |
550
+ | `logger.llm.file` | `--log-to` | `STDOUT` | `AIA_LOGGER__LLM__FILE` |
551
+ | `logger.mcp.level` | `--log-level` | `warn` | `AIA_LOGGER__MCP__LEVEL` |
552
+ | `logger.mcp.file` | `--log-to` | `STDOUT` | `AIA_LOGGER__MCP__FILE` |
553
+ | `registry.refresh` | `--refresh` | `7` (days) | `AIA_REGISTRY__REFRESH` |
554
+
555
+ **Utility:**
556
+
557
+ | CLI Options | Description |
558
+ |-------------|-------------|
559
+ | `--dump FILE` | Export current configuration to FILE and exit |
560
+ | `--completion SHELL` | Generate shell completion script (bash/zsh/fish) and exit |
561
+ | `--available-models [QUERY]` | List available models and exit |
562
+ | `--list-roles` | List available role files and exit |
563
+ | `--list-tools` | List available tools and exit |
564
+ | `--version` | Show version and exit |
565
+ | `-h`, `--help` | Show help and exit |
393
566
 
394
567
  </details>
395
568
 
@@ -407,6 +580,8 @@ Directives are special commands in prompt files that begin with `/` and provide
407
580
  | `/restore` | Restore context to a previous checkpoint | `/restore save_point` |
408
581
  | `/include` | Insert file contents | `/include path/to/file.txt` |
409
582
  | `/paste` | Insert clipboard contents | `/paste` |
583
+ | `/skill` | Include a skill by ID or path to a skill directory | `/skill code-quality` or `/skill ~/skills/my-skill` |
584
+ | `/skills` | List available Claude Code skills | `/skills` |
410
585
  | `/shell` | Execute shell commands | `/shell ls -la` |
411
586
  | `/robot` | Show the pet robot ASCII art w/versions | `/robot` |
412
587
  | `/ruby` | Execute Ruby code | `/ruby puts "Hello World"` |
@@ -513,29 +688,29 @@ Checkpoints: ruby_basics, oop_concepts
513
688
 
514
689
  #### Custom Directive Examples
515
690
 
516
- You can extend AIA with custom directives by creating Ruby files that define new directive methods:
691
+ You can extend AIA with custom directives by subclassing `AIA::Directive`. Use `desc` before a method to register it as a directive. Aliases are detected automatically via `alias_method`.
517
692
 
518
693
  ```ruby
519
- # examples/directives/ask.rb
694
+ # examples/directives/timestamp_directive.rb
520
695
  module AIA
521
- class DirectiveProcessor
522
- private
523
- desc "A meta-prompt to LLM making its response available as part of the primary prompt"
524
- def ask(args, context_manager=nil)
525
- meta_prompt = args.empty? ? "What is meta-prompting?" : args.join(' ')
526
- AIA.config.client.chat(meta_prompt)
696
+ class CustomDirectives < Directive
697
+ desc "Insert current timestamp (optional strftime format, default: %Y-%m-%d %H:%M:%S)"
698
+ def timestamp(args = [], context_manager = nil)
699
+ format = args.empty? ? '%Y-%m-%d %H:%M:%S' : args.join(' ')
700
+ Time.now.strftime(format)
527
701
  end
528
702
  end
529
703
  end
530
704
  ```
531
705
 
532
- **Usage:** Use the --tools option to specific a specific directive file or a directory full of files
706
+ **Usage:** Use the `--tools` option to load a directive file or a directory of files:
533
707
  ```bash
534
708
  # Load custom directive
535
- aia --tools examples/directives/ask.rb --chat
709
+ aia --tools examples/directives/timestamp_directive.rb --chat
536
710
 
537
- # Use the results of the custom directive as input to a prompt
538
- /ask gather the latest closing data for the DOW, NASDAQ, and S&P 500
711
+ # Use the custom directive in chat mode
712
+ /timestamp
713
+ /timestamp %Y-%m-%d
539
714
  ```
540
715
 
541
716
  ### Multi-Model Support
@@ -934,25 +1109,40 @@ echo "You are a senior software architect..." > ~/.prompts/roles/specialized/sen
934
1109
  aia --model gpt-4o=specialized/senior_architect design.md
935
1110
  ```
936
1111
 
937
- **Using Config Files for Model Roles** (v2):
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
+
1127
+ **Using Config Files for Model Roles:**
938
1128
 
939
- Define model-role assignments in your config file (`~/.aia/config.yml`) for reusable setups:
1129
+ Define model-role assignments in your config file (`~/.config/aia/aia.yml`) for reusable setups:
940
1130
 
941
1131
  ```yaml
942
1132
  # Array of hashes format (mirrors internal structure)
943
- model:
944
- - model: gpt-4o
1133
+ models:
1134
+ - name: gpt-4o
945
1135
  role: architect
946
- - model: claude
1136
+ - name: claude
947
1137
  role: security
948
- - model: gemini
1138
+ - name: gemini
949
1139
  role: performance
950
1140
 
951
1141
  # Also supports models without roles
952
- model:
953
- - model: gpt-4o
1142
+ models:
1143
+ - name: gpt-4o
954
1144
  role: architect
955
- - model: claude # No role assigned
1145
+ - name: claude # No role assigned
956
1146
  ```
957
1147
 
958
1148
  Then simply run:
@@ -961,7 +1151,7 @@ Then simply run:
961
1151
  aia design_doc.md # Uses model configuration from config file
962
1152
  ```
963
1153
 
964
- **Using Environment Variables** (v2):
1154
+ **Using Environment Variables:**
965
1155
 
966
1156
  Set default model-role assignments via environment variable:
967
1157
 
@@ -980,9 +1170,37 @@ When model roles are specified in multiple places, the precedence is:
980
1170
  1. **Command-line inline** (highest): `--model gpt-4o=architect`
981
1171
  2. **Command-line flag**: `--model gpt-4o --role architect`
982
1172
  3. **Environment variable**: `AIA_MODEL="gpt-4o=architect"`
983
- 4. **Config file** (lowest): `model` array in `~/.aia/config.yml`
1173
+ 4. **Config file** (lowest): `models` array in `~/.config/aia/aia.yml`
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
984
1193
  ```
985
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
+
986
1204
  ### RubyLLM::Tool Support
987
1205
 
988
1206
  AIA supports function calling through RubyLLM tools for extended capabilities:
@@ -1023,14 +1241,14 @@ These MCP clients require the `ruby_llm-mcp` gem and provide access to external
1023
1241
 
1024
1242
  ### MCP Server Configuration
1025
1243
 
1026
- AIA supports defining MCP (Model Context Protocol) servers directly in your configuration file. This allows MCP tools to be automatically loaded at startup without needing to specify them on the command line each time.
1244
+ AIA supports defining MCP (Model Context Protocol) servers directly in your configuration file. This allows MCP tools to be automatically loaded at startup without needing to specify them on the command line each time. When multiple MCP servers are configured, AIA connects to them **in parallel** using fiber-based concurrency (via the `simple_flow` gem) for faster startup.
1027
1245
 
1028
1246
  #### Configuration Format
1029
1247
 
1030
- Add MCP servers to your `~/.aia/config.yml` file:
1248
+ Add MCP servers to your `~/.config/aia/aia.yml` file:
1031
1249
 
1032
1250
  ```yaml
1033
- :mcp_servers:
1251
+ mcp_servers:
1034
1252
  - name: "server-name"
1035
1253
  command: "server_command"
1036
1254
  args: ["arg1", "arg2"]
@@ -1054,8 +1272,8 @@ Add MCP servers to your `~/.aia/config.yml` file:
1054
1272
  The GitHub MCP server provides access to GitHub repositories, issues, pull requests, and more:
1055
1273
 
1056
1274
  ```yaml
1057
- # ~/.aia/config.yml
1058
- :mcp_servers:
1275
+ # ~/.config/aia/aia.yml
1276
+ mcp_servers:
1059
1277
  - name: "github"
1060
1278
  command: "github-mcp-server"
1061
1279
  args: ["stdio"]
@@ -1087,8 +1305,8 @@ See the [full HTM documentation](https://madbomber.github.io/htm) for database c
1087
1305
  A custom Ruby-based MCP server for accessing database-backed long term memory:
1088
1306
 
1089
1307
  ```yaml
1090
- # ~/.aia/config.yml
1091
- :mcp_servers:
1308
+ # ~/.config/aia/aia.yml
1309
+ mcp_servers:
1092
1310
  - name: "htm"
1093
1311
  command: "htm_mcp.rb"
1094
1312
  args: ["stdio"]
@@ -1108,8 +1326,8 @@ A custom Ruby-based MCP server for accessing database-backed long term memory:
1108
1326
  You can configure multiple MCP servers to provide different capabilities:
1109
1327
 
1110
1328
  ```yaml
1111
- # ~/.aia/config.yml
1112
- :mcp_servers:
1329
+ # ~/.config/aia/aia.yml
1330
+ mcp_servers:
1113
1331
  - name: "github"
1114
1332
  command: "github-mcp-server"
1115
1333
  args: ["stdio"]
@@ -1134,11 +1352,11 @@ When MCP servers are configured, AIA displays them in the startup robot:
1134
1352
 
1135
1353
  ```
1136
1354
  , ,
1137
- (\____/) AI Assistant (v0.9.23) is Online
1355
+ (\____/) AI Assistant (v1.1.0) is Online
1138
1356
  (_oo_) gpt-4o-mini (supports tools)
1139
- (O) using ruby_llm (v1.9.0 MCP v0.6.1)
1357
+ (O) using ruby_llm
1140
1358
  __||__ \) model db was last refreshed on
1141
- [/______\] / 2025-06-03
1359
+ [/______\] / 2025-06-18
1142
1360
  / \__AI__/ \/ You can share my tools
1143
1361
  / /__\ MCP: github, htm
1144
1362
  (\ /____\
@@ -1415,11 +1633,11 @@ echo "Home: $HOME" # Should show home directory
1415
1633
 
1416
1634
  **Configuration issues:**
1417
1635
  ```bash
1418
- # Check current configuration
1419
- aia --config
1636
+ # Dump current configuration to a file
1637
+ aia --dump config_snapshot.yml
1420
1638
 
1421
1639
  # Debug configuration loading
1422
- aia --debug --config
1640
+ aia --debug my_prompt
1423
1641
  ```
1424
1642
 
1425
1643
  ### Error Messages
@@ -1553,7 +1771,6 @@ rake test
1553
1771
 
1554
1772
  - **Enhanced Search**: Restore full-text search within prompt files
1555
1773
  - **UI Improvements**: Better configuration management for fzf and rg tools
1556
- - **Logging**: Enhanced logging using Ruby Logger class; integration with RubyLLM and RubyLLM::MCP logging
1557
1774
 
1558
1775
  ## License
1559
1776