Skip to content

Commit 8093823

Browse files
Merge pull request #5 from 23blocks-OS/refactor/module-split
refactor: split aimaestro-agent.sh into modular architecture
2 parents 5d506e1 + 3c3175e commit 8093823

10 files changed

Lines changed: 3958 additions & 3809 deletions

File tree

CHANGELOG.md

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
# Changelog
2+
3+
All notable changes to AI Maestro Plugins are documented in this file.
4+
Format follows [Keep a Changelog](https://keepachangelog.com/).
5+
6+
## [1.0.1] - 2026-02-20
7+
8+
### Changed
9+
- **Modular CLI architecture** -- Split `aimaestro-agent.sh` (3,879 lines) into 6 focused modules:
10+
- `agent-core.sh` -- Shared infrastructure: security scanning, validation, JSON editing, Claude CLI helpers
11+
- `agent-commands.sh` -- CRUD: list, show, create, delete, update, rename, export, import
12+
- `agent-session.sh` -- Session lifecycle: add, remove, exec, hibernate, wake, restart
13+
- `agent-skill.sh` -- Skill management: list, add, remove, install, uninstall
14+
- `agent-plugin.sh` -- Plugin management (10 subcommands) + marketplace (4 subcommands)
15+
- `aimaestro-agent.sh` -- Thin 108-line dispatcher that sources all modules
16+
- Each module has a double-source guard and uses the fallback path pattern (`SCRIPT_DIR` then `~/.local/bin/`)
17+
- No functional changes -- all commands work identically
18+
19+
## [1.0.0] - 2026-02-09
20+
21+
### Added
22+
- Initial plugin release with 6 skills and CLI scripts
23+
- Agent lifecycle management (create, delete, hibernate, wake, rename, export, import)
24+
- Plugin and marketplace management (install, uninstall, update, enable, disable)
25+
- Skill management (list, add, remove, install, uninstall)
26+
- AMP messaging integration
27+
- Code graph querying
28+
- Memory search
29+
- Documentation search
30+
- Planning skill with persistent task tracking
31+
- ToxicSkills security scanner for skill installation
32+
- Auto-trust mechanism for agent creation
33+
- `AIM_AGENT_*` environment variables (replacing `CLAUDE_AGENT_*` with backward compat)

plugins/ai-maestro/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22

33
Built from plugin.manifest.json with 2 sources.
44

5-
**Skills:** 6 | **Scripts:** 39
5+
**Skills:** 6 | **Scripts:** 44
66

7-
Built at: 2026-02-20T16:20:40Z
7+
Built at: 2026-02-20T18:24:27Z
88

99
See the [main repo](https://github.com/23blocks-OS/ai-maestro-plugins) for source files and build instructions.

plugins/ai-maestro/skills/ai-maestro-agents-management/SKILL.md

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -919,11 +919,19 @@ aimaestro-agent.sh skill uninstall backend-api debug-skill --scope local
919919

920920
---
921921

922-
## Helper Scripts
922+
## Script Architecture
923923

924-
This skill relies on an internal helper script that provides shared utility functions:
924+
The CLI is split into focused modules, all sourced by the main dispatcher:
925925

926-
- **`agent-helper.sh`** - Sourced by `aimaestro-agent.sh`. Provides agent-specific utilities including API base URL resolution, agent name/ID lookups, tmux session management, and dependency checks (bash 4.0+, curl, jq). Located alongside the CLI script in `~/.local/bin/` (installed) or `plugin/src/scripts/` (source). If the CLI script fails with dependency or API errors, check that `agent-helper.sh` is present in the same directory.
926+
- **`aimaestro-agent.sh`** - Thin dispatcher (~108 lines). Sources all modules below, sets up cleanup trap, and routes commands.
927+
- **`agent-helper.sh`** - Shared utilities: colors, `print_*`, `resolve_agent`, `get_api_base`, API URL resolution, agent name/ID lookups.
928+
- **`agent-core.sh`** - Shared infrastructure: security scanning (ToxicSkills), validation, Claude CLI helpers, `safe_json_edit`, temp file management.
929+
- **`agent-commands.sh`** - CRUD commands: `list`, `show`, `create`, `delete`, `update`, `rename`, `export`, `import`.
930+
- **`agent-session.sh`** - Session lifecycle: `session add/remove/exec`, `hibernate`, `wake`, `restart`.
931+
- **`agent-skill.sh`** - Skill management: `skill list/add/remove/install/uninstall`.
932+
- **`agent-plugin.sh`** - Plugin management (10 subcommands) + marketplace (4 subcommands).
933+
934+
All modules are located alongside the CLI script in `~/.local/bin/` (installed) or `plugin/src/scripts/` (source). Each module has a double-source guard to prevent re-sourcing. If the CLI fails with sourcing errors, verify all `agent-*.sh` files are present in the same directory.
927935

928936
---
929937

0 commit comments

Comments
 (0)