Skip to content

Commit e3a360e

Browse files
Align docs with v0.3.0: branching in CONTRIBUTING, dynamic skills, .heex files
CONTRIBUTING.md skill example updated with routes/0 callback and triple tuple return format. README dynamic skills section mentions conditional branching and route persistence. Architecture doc updated for .heex files. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent ed25333 commit e3a360e

File tree

3 files changed

+14
-2
lines changed

3 files changed

+14
-2
lines changed

ALEXCLAW_ARCHITECTURE.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -410,7 +410,7 @@ lib/
410410
database_controller.ex # Schema browser, backup download
411411
github_webhook_controller.ex # GitHub webhook receiver (HMAC verified)
412412
oauth_callback_controller.ex # Google OAuth callback handler
413-
live/admin_live/ # LiveView pages (12 pages)
413+
live/admin_live/ # LiveView pages (13 pages, .ex logic + .html.heex templates)
414414
plugs/
415415
caching_body_reader.ex # Caches raw body for webhook HMAC verification
416416
rate_limit.ex # Plug for POST /login rate limiting

CONTRIBUTING.md

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,12 +80,23 @@ defmodule AlexClaw.Skills.MySkill do
8080
@impl true
8181
def description, do: "Short description for the skill registry"
8282

83+
# Optional: declare branches for conditional workflow routing.
84+
# Default is [:on_success, :on_error] if not implemented.
85+
@impl true
86+
def routes, do: [:on_results, :on_empty, :on_error]
87+
8388
@impl true
8489
def run(args) do
8590
# args[:input] — output from previous workflow step
8691
# args[:config] — step configuration from the workflow editor
8792
# args[:resources] — attached resources
88-
{:ok, result}
93+
94+
# Return triple tuple with branch name for conditional routing:
95+
{:ok, result, :on_results}
96+
97+
# Or on empty/error:
98+
# {:ok, "No results found.", :on_empty}
99+
# {:error, reason} — implicit :on_error
89100
end
90101
end
91102
```

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,7 @@ Load custom skills at runtime — no code changes, no Docker rebuild, no restart
6060
- **Admin UI** — Upload, reload, and unload skills from the Skills page. Core and dynamic skills are shown separately.
6161
- **Telegram commands**`/skill load`, `/skill unload`, `/skill reload`, `/skill create`, `/skill list`
6262
- **Cross-skill invocation** — Dynamic skills can call other skills (core or dynamic) through `SkillAPI.run_skill/3`
63+
- **Conditional branching** — Dynamic skills can declare `routes/0` (e.g. `[:on_results, :on_empty, :on_error]`) and return triple tuples `{:ok, result, :branch_name}` for workflow routing. Routes are persisted in the database on load and cleaned up on unload — same behavior as core skills.
6364

6465
#### Permissions
6566

0 commit comments

Comments
 (0)