You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: ALEXCLAW_ARCHITECTURE.md
+2Lines changed: 2 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -343,6 +343,8 @@ AlexClaw supports multi-node BEAM clustering. Each node runs its own sequential
343
343
344
344
Skills are Elixir modules implementing the `AlexClaw.Skill` behaviour (`run/1`, optional `description/0`, `routes/0`, `permissions/0`, `version/0`, `external/0`). Skills return `{:ok, result, :branch}` for conditional routing or `{:ok, result}` for backward compatibility. Registered in `AlexClaw.Workflows.SkillRegistry` with routes and external flag stored in ETS alongside permissions.
345
345
346
+
Skills also declare **UI metadata** via optional callbacks (`step_fields/0`, `config_hint/0`, `config_scaffold/0`, `config_presets/0`, `prompt_presets/0`, `config_help/0`, `prompt_help/0`). The workflow step editor reads these via `SkillRegistry.get_skill_meta/1` to dynamically render only the fields a skill needs. Skills that don't use LLM (scrapers, notifiers, shell) declare `step_fields: [:config]` — no LLM tier, provider, or prompt template shown. Zero hardcoded skill metadata in the LiveView.
347
+
346
348
Skills that fetch data from external sources declare `def external, do: true`. The workflow executor auto-sanitizes output from external skills through `AlexClaw.ContentSanitizer` (7-layer heuristic pipeline). Dynamic skills are AST-scanned at load time — undeclared HTTP/socket calls are rejected.
Copy file name to clipboardExpand all lines: docs/reference/changelog.md
+2-1Lines changed: 2 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -9,7 +9,8 @@
9
9
-**Bug fix** — `duplicate_workflow` now copies `input_from` and `routes` fields
10
10
-**Docker naming** — services renamed to `alexclaw-prod`, `db-prod`, `db-test` for clarity
11
11
-**Makefile** — quiet test builds, auto-teardown after tests, `test-down` target
12
-
-**Docs** — README, INSTALLATION, architecture, and readthedocs pages updated
12
+
-**Dynamic skill metadata** — skills declare their own UI fields via 7 new optional callbacks (`step_fields`, `config_hint`, `config_scaffold`, `config_presets`, `prompt_presets`, `config_help`, `prompt_help`). Step editor renders dynamically — zero hardcoded skill knowledge in the LiveView
13
+
-**Docs** — README, INSTALLATION, architecture, writing-skills, and readthedocs pages updated
|`external/0`|`false`| Whether the skill fetches data from external sources |
50
59
60
+
### UI Metadata
61
+
62
+
These callbacks control how the workflow step editor renders when your skill is selected. If not declared, all fields are shown (backward compatible).
63
+
64
+
| Callback | Default | Description |
65
+
|---|---|---|
66
+
|`step_fields/0`|`[:llm_tier, :llm_model, :prompt_template, :config]`| Which optional fields to show in the step editor. Use `[:config]` for skills that don't use LLM. Use `[]` for skills with no configurable fields. |
67
+
|`config_hint/0`|`""`| Placeholder text shown in the config JSON textarea |
68
+
|`config_scaffold/0`|`%{}`| Default config map pre-filled when adding a new step |
69
+
|`config_presets/0`|`%{}`| Named config templates shown as buttons (e.g. `%{"GET" => %{"method" => "GET"}}`) |
70
+
|`prompt_presets/0`|`%{}`| Named prompt templates shown as buttons (e.g. `%{"Summarize" => "Summarize:\n\n{input}"}`) |
71
+
|`config_help/0`|`"Skill-specific parameters as JSON."`| Help text shown as tooltip on the config field |
72
+
|`prompt_help/0`|`"Template sent to the LLM. Use {input} for previous step output."`| Help text shown as tooltip on the prompt field |
73
+
51
74
## The `args` Map
52
75
53
76
Every skill receives a map with these keys:
@@ -184,8 +207,50 @@ defmodule AlexClaw.Skills.Dynamic.UrlHealthCheck do
184
207
@impltrue
185
208
defroutes, do: [:on_success, :on_error]
186
209
210
+
# UI metadata — step editor shows only config, no LLM fields
211
+
@impltrue
212
+
defstep_fields, do: [:config]
213
+
214
+
@impltrue
215
+
defconfig_hint, do:~s|{"timeout": 5000}|
216
+
217
+
@impltrue
218
+
defconfig_scaffold, do: %{"timeout"=>5000}
219
+
220
+
@impltrue
221
+
defconfig_help, do:"timeout: HTTP timeout in ms per URL (default 5000). Input: newline-separated URLs."
0 commit comments