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
{{ message }}
Repository navigation
Commit d5e47e1
Browse filesBrowse the repository at this point in the historyBrowse files
feat(skill): scope headless skill discovery and add an allowlist (#157)
`aictrl run` never scans ~/.claude, ~/.agents or ~/.opencode for
skills, however discovery reaches them (home scan, a non-git upward
walk, a symlinked home or project directory, ~/.opencode as a config
directory), so the skill tool description no longer depends on $HOME.
There is no switch back; a caller lists home skills explicitly in
config, e.g. skills.paths: ["~/.claude/skills"]. `~/` in skills.paths
now expands from Global.Path.home, the home path discovery uses.
`aictrl run --skill <name>` (repeatable) and config `skills.allow`
restrict the run to the named skills: only they are listed, loadable,
and reported in tool_catalog and skill_discovered/skill_loaded events,
for the main session and every subagent. The skill tool rejects other
names with an allowlist error. --skill is rejected with --attach or
an empty name. The allowlist matches names, not sources.
Headless detection reads the in-memory HeadlessRun mark that `run`
enables (#152), so Skill.setScope carries only the allowlist.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Copy file name to clipboardExpand all lines: EVENTS.md
+7-3Lines changed: 7 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -132,6 +132,8 @@ Emitted once per session, immediately after `session_start` and before the first
132
132
133
133
#### `skills[]` — skill packs resolved for this session (separate from `tools[]`)
134
134
135
+
Only skills in scope for the run are listed; see [Skill Events](#skill-events).
136
+
135
137
-**`name`** (string, **required**) — skill name from `SKILL.md` frontmatter.
136
138
-**`version`** (string or null, **required**) — version string from the `version` field in `SKILL.md` frontmatter. `null` when no version is declared.
137
139
@@ -432,6 +434,8 @@ with truthful process/session failure status.
432
434
433
435
Skills are loaded progressively. The model first sees skill names and descriptions in the tool schema. Full skill content only enters context when the model explicitly invokes the skill tool.
434
436
437
+
Skill events, and `tool_catalog.skills[]`, cover only the skills in scope for the run. Without `--attach`, `aictrl run` skips `~/.claude/skills`, `~/.agents/skills` and `~/.opencode/skills` (config `skills.paths` can list home skills explicitly), and `--skill <name>` (repeatable) or config `skills.allow` limits the set further (see [Skill Scope](packages/cli/README.md#skill-scope)). A skill outside the allowlist is neither discovered nor loadable: the skill tool rejects it with `Skill "<name>" is not in the skill allowlist for this run`, and no `skill_loaded` event is emitted. With `--attach`, the attached server's own skill discovery applies.
438
+
435
439
### `skill_discovered`
436
440
437
441
Emitted per skill when the skill tool is initialized and skill descriptions are registered in the tool schema. This happens at the start of each LLM turn.
@@ -441,7 +445,7 @@ Emitted per skill when the skill tool is initialized and skill descriptions are
Copy file name to clipboardExpand all lines: packages/cli/src/config/config.ts
+6Lines changed: 6 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -661,6 +661,12 @@ export namespace Config {
661
661
.array(z.string())
662
662
.optional()
663
663
.describe("URLs to fetch skills from (e.g., https://example.com/.well-known/skills/)"),
664
+
allow: z
665
+
.array(z.string())
666
+
.optional()
667
+
.describe(
668
+
"Only skills with these names are listed and loadable, from whichever source defines them; `aictrl run --skill` overrides it",
0 commit comments