@dhzh/foundry 11.6.0 → 11.7.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.
@@ -32,8 +32,8 @@ the command details, output shapes, failure modes, and end-to-end examples.
32
32
  | Need | CLI entry point | Reference |
33
33
  | --- | --- | --- |
34
34
  | Create, read, edit, delete, or list reusable Markdown instructions | `foundry instructions` | [Instructions](references/instructions.md) |
35
- | List, read, create, edit metadata or files, or delete a Skill | `foundry skills` | [Skills](references/skills.md) |
36
- | Inspect installed Skills, saved assignments, bring in, delete, assign, or unassign | `foundry agents skills` | [Skill assignments](references/skills.md#external-symbolic-links) |
35
+ | List, read, create, edit metadata or files, or delete one or more Skills | `foundry skills` | [Skills](references/skills.md) |
36
+ | Inspect installed Skills, open origins, bring in, batch, assign, or unassign | `foundry agents skills` | [Skill assignments](references/agents.md#skill-assignments) |
37
37
  | Inspect, assign, enable, disable, or reapply instructions for an agent | `foundry agents instructions` | [Agents](references/agents.md) |
38
38
  | Inspect supported agents and raw assignment state | `foundry agents list` | [Agents](references/agents.md) |
39
39
  | Read or change application preferences | `foundry settings get/set` | [Settings](references/settings.md) |
@@ -2,8 +2,9 @@
2
2
 
3
3
  ## Overview
4
4
 
5
- Foundry composes saved instructions into external agent instruction files.
6
- Agent orchestration has three layers:
5
+ Foundry composes saved instructions into external agent instruction files and
6
+ distributes library Skills into agent Skill directories. Instruction
7
+ orchestration has three layers:
7
8
 
8
9
  1. **Instruction library**: reusable Markdown records under
9
10
  `<home>/.foundry/instructions`.
@@ -16,25 +17,27 @@ Assigning instructions changes Foundry state only. Enabling writes the block;
16
17
  disabling removes the block; reapplying rewrites it. The instruction library
17
18
  and all text outside Foundry's block remain independent.
18
19
 
19
- Use this reference when the task is to inspect agent state, assign or reorder
20
- instructions, turn instruction writing on or off, recover a managed block, or
21
- open an agent's instruction file. Read [Instructions](instructions.md) first
22
- when the needed instruction does not exist yet.
23
- For Skill distribution, use `foundry agents skills list/installed/assign/unassign`;
24
- see [Skill assignments](skills.md#external-symbolic-links) for command arguments,
25
- persisted state, and symlink behavior.
20
+ Skill distribution is separate: assigning a Skill saves its name on the agent
21
+ record and creates or replaces a same-name directory symlink. It does not write
22
+ the agent instruction file and is independent of the Instructions apply switch.
23
+
24
+ Use this reference when the task is to inspect or change agent assignments,
25
+ write instruction files, or manage installed Skill links. Read
26
+ [Instructions](instructions.md) or [Skills](skills.md) when the artifact does
27
+ not exist yet.
26
28
 
27
29
  ## Supported agents
28
30
 
29
31
  The agents and output paths are fixed:
30
32
 
31
- | Agent ID | Name | Instruction file |
32
- | --- | --- | --- |
33
- | `chatgpt` | ChatGPT | `~/.codex/AGENTS.md` |
34
- | `claude-code` | Claude Code | `~/.claude/CLAUDE.md` |
33
+ | Agent ID | Name | Instruction file | Skills directory |
34
+ | --- | --- | --- | --- |
35
+ | `chatgpt` | ChatGPT | `~/.codex/AGENTS.md` | `~/.agents/skills` |
36
+ | `claude-code` | Claude Code | `~/.claude/CLAUDE.md` | `~/.claude/skills` |
35
37
 
36
38
  `~` is the operating system user home directory. No command accepts an
37
- arbitrary output path.
39
+ arbitrary output path. Skill links live directly under the Skills directory;
40
+ the Foundry library remains at `<home>/.foundry/skills`.
38
41
 
39
42
  ## When to use
40
43
 
@@ -47,9 +50,14 @@ Use `foundry agents` when the user wants to:
47
50
  assignment.
48
51
  - Repair the managed block after a manual or malformed edit.
49
52
  - Open the external file for inspection.
53
+ - See which Skills are installed or assigned for an agent.
54
+ - Assign or unassign Skills individually or in batches.
55
+ - Bring an installed Skill into Foundry, delete an installed entry, or open a
56
+ link origin.
50
57
 
51
- Do not hand-edit assignment JSON to achieve these outcomes. Use the commands so
52
- the external files and stored state stay consistent.
58
+ Do not hand-edit instruction or Skill assignment JSON to achieve these
59
+ outcomes. Use the commands so the external files, links, and stored state stay
60
+ consistent.
53
61
 
54
62
  ## Inspect assignments
55
63
 
@@ -235,6 +243,100 @@ blocks and malformed Foundry markers while preserving text outside them. A
235
243
  single instruction's content is inserted as stored; Foundry does not rewrite
236
244
  the Markdown body.
237
245
 
246
+ ## Skill assignments
247
+
248
+ Foundry distributes library Skills by creating a directory symlink under each
249
+ selected agent's Skills directory. Both the Web UI and CLI support individual
250
+ and batch operations:
251
+
252
+ ```bash
253
+ foundry agents skills list
254
+ foundry agents skills list chatgpt
255
+ foundry agents skills installed
256
+ foundry agents skills installed chatgpt
257
+ foundry agents skills open chatgpt --skill hello
258
+ foundry agents skills bring-in chatgpt --skill hello
259
+ foundry agents skills delete chatgpt --skill hello
260
+ foundry agents skills assign chatgpt --skill hello
261
+ foundry agents skills unassign chatgpt --skill hello
262
+ foundry agents skills batch bring-in chatgpt --all
263
+ foundry agents skills batch delete chatgpt --skills hello,other
264
+ foundry agents skills batch assign --skills hello,other --agents chatgpt,claude-code
265
+ foundry agents skills batch unassign --skills hello,other --agents chatgpt,claude-code
266
+ ```
267
+
268
+ `list` returns an array of registered Skill agents with `id`, `name`, `icon`,
269
+ `directory`, and saved `skillNames`; the optional agent ID filters the array.
270
+ It shows persisted assignments even if a link was removed externally.
271
+ `installed` scans each agent's actual Skills directory and returns an array with
272
+ `id`, `name`, `icon`, `directory`, and `skills`; each installed skill contains
273
+ `directoryName`, metadata `name`, `description`, and `isManaged`. `isManaged`
274
+ is true when the entry resolves to the same directory as the Foundry library
275
+ Skill with that directory name. Symbolic-link entries also contain `originPath`,
276
+ the direct link target; non-link entries omit it.
277
+ It is independent of saved assignments and ignores entries without valid
278
+ `SKILL.md` frontmatter. The optional agent ID filters the array.
279
+
280
+ `open` requires a symbolic-link installed entry and opens its direct target.
281
+ Ordinary files and folders return `SKILL_ORIGIN_NOT_FOUND`. Success prints
282
+ `{ "agentId", "directoryName", "path" }`.
283
+
284
+ `bring-in` treats one installed directory name as the Skill name. If Foundry
285
+ does not already have that name, it copies the resolved origin into the Foundry
286
+ library; a symbolic-link origin is copied without modifying the origin itself.
287
+ If Foundry already has the name, the Foundry version wins and the agent version
288
+ is not copied. It then saves the assignment for the selected agent only,
289
+ replaces that agent's same-name entry with a symlink to the Foundry library, and
290
+ prints the complete Foundry Skill. Other agents and entries stay unchanged.
291
+ An entry already managed by Foundry returns `SKILL_ALREADY_MANAGED`; metadata
292
+ whose name does not match the directory is rejected.
293
+
294
+ `delete` removes one installed entry from the selected agent's Skills directory.
295
+ A symbolic link is unlinked without deleting its target; an ordinary file or
296
+ folder is deleted with all contents. Only a link that resolves to the same-name
297
+ Foundry library Skill clears that agent's saved assignment. Other links and
298
+ ordinary entries leave saved state unchanged. Other entries, agents, and Foundry
299
+ library sources stay unchanged.
300
+ It prints `{ "agentId", "directoryName", "kind" }`, where `kind` is `link`,
301
+ `file`, or `directory`.
302
+
303
+ `batch bring-in` and `batch delete` accept either a comma-separated `--skills`
304
+ list or `--all`. For bring-in, `--all` selects installed entries not managed by
305
+ Foundry; for delete, `--all` selects every installed entry. Both return
306
+ `{ "completed", "failed" }`; completed entries add `agentId` and the operation
307
+ `result`, while failed entries add `agentId`, `code`, and `message`. Later items
308
+ continue after a failure.
309
+
310
+ `batch assign` and `batch unassign` accept comma-separated `--skills` and
311
+ `--agents` lists and apply every skill-agent combination. They return the same
312
+ batch shape, with each completed `result` being the Skill's remaining saved
313
+ assignments. Unknown agents fail before any item runs; missing skills appear in
314
+ `failed` while other combinations continue.
315
+
316
+ `assign` requires an existing library Skill. It adds its name once to the
317
+ selected agent record and creates a directory symlink at
318
+ `<agent-skill-directory>/<skill-name>`. An existing entry at that exact name
319
+ is replaced, including files, directories, stale links, and dangling links.
320
+ Other names and agents stay unchanged. Link replacement never deletes a
321
+ symlink's target directory.
322
+
323
+ `unassign` removes the name from the selected saved record and unlinks any
324
+ same-name symbolic link, regardless of its target. Missing links, saved names,
325
+ and library sources succeed; ordinary files and directories remain intact.
326
+ Repeated assign/unassign is safe. Both print `{ "name": "hello", "agentIds": [...] }`
327
+ describing that Skill's remaining saved assignments. These writes operate on
328
+ saved JSON directly rather than importing other external links.
329
+
330
+ The UI reads saved `skills.skillNames` from each agent profile at
331
+ `~/.foundry/agents/<agent-id>.json`. Reading assignments imports existing matching
332
+ links once for a profile without Skill state. External link removal leaves a
333
+ saved assignment intact; assigning again repairs or replaces its named entry.
334
+ Targets come from the registry's Skills capability. Skill assignment takes
335
+ effect immediately and is independent of the Instructions apply switch.
336
+
337
+ Skill metadata edits, renames, and deletions synchronize or remove these links;
338
+ see [Agent links](skills.md#agent-links).
339
+
238
340
  ## Storage
239
341
 
240
342
  Each agent has one JSON profile:
@@ -258,12 +360,11 @@ an `instructions` namespace:
258
360
  }
259
361
  ```
260
362
 
261
- The `skills` sibling namespace stores `skillNames` and its own timestamps;
262
- see [Skill assignments](skills.md#external-symbolic-links). Legacy hashed
263
- profile filenames migrate transactionally to `<agent-id>.json`.
363
+ The `skills` sibling namespace stores `skillNames` and its own timestamps.
364
+ Legacy hashed profile filenames migrate transactionally to `<agent-id>.json`.
264
365
 
265
- Read it through `foundry agents list` or
266
- `foundry agents instructions list`; use the CLI for writes. Timestamps are Unix
366
+ Read it through `foundry agents list`, `foundry agents instructions list`, or
367
+ `foundry agents skills list`; use the CLI for writes. Timestamps are Unix
267
368
  epoch milliseconds, not ISO strings.
268
369
 
269
370
  ## Errors
@@ -277,11 +378,18 @@ epoch milliseconds, not ISO strings.
277
378
  | `AGENT_DISABLED` | Tried to reapply while the agent is off | Enable the agent first |
278
379
  | `OPEN_PATH_NOT_FOUND` | Tried to open a file that does not exist | Enable the agent or write the file outside Foundry first |
279
380
  | `INVALID_AGENT_INPUT` | Malformed API/CLI input shape | Correct the argument |
381
+ | `SKILL_AGENT_NOT_FOUND` | The agent ID is not registered with Skills support | Use a supported Skills agent |
382
+ | `SKILL_NOT_FOUND` | The selected installed or library Skill does not exist | Check `agents skills installed` or `skills list` |
383
+ | `SKILL_ORIGIN_NOT_FOUND` | `open` requires a symbolic-link entry | Open only a link entry |
384
+ | `SKILL_ALREADY_MANAGED` | `bring-in` entry already resolves to Foundry | Use the Foundry copy or `assign` to repair the link |
385
+ | `SKILL_LINK_CONFLICT` | A destination blocks link creation or replacement | Resolve the conflicting entry first |
386
+ | `BATCH_SELECTION_INVALID` | Batch command received both or neither selector | Pass exactly one of `--skills` or `--all` |
280
387
 
281
388
  Operation errors use Foundry's JSON error envelope and exit nonzero.
282
389
 
283
390
  ## Related
284
391
 
285
392
  - [Instructions](instructions.md): create and list the Markdown records.
393
+ - [Skills](skills.md): create, edit, and delete Skill sources and their link side effects.
286
394
  - [Settings](settings.md): application preferences and Skill installation.
287
395
  - [Encrypted backups](backups.md): assignments are included; external files are not.
@@ -1,8 +1,10 @@
1
1
  # Skills
2
2
 
3
- Use this reference to list, read, create, edit, delete, or assign a local Skill.
4
- Installing the bundled Foundry usage manual
5
- into another agent uses [Settings](settings.md#install-this-skill).
3
+ Use this reference to list, read, create, edit, or delete a local Skill. For
4
+ assigning Skills to agents or managing installed entries, see
5
+ [Skill assignments](agents.md#skill-assignments). Installing the bundled
6
+ Foundry usage manual into another agent uses
7
+ [Settings](settings.md#install-this-skill).
6
8
 
7
9
  ## List and read
8
10
 
@@ -199,72 +201,23 @@ the deleted Skill as JSON. Confirm the user's intent before invoking deletion
199
201
  if they have not already explicitly requested it. The Web UI asks for a second
200
202
  confirmation. `SKILL_NOT_FOUND` means the source no longer exists.
201
203
 
202
- ## External symbolic links
203
-
204
- Both the Web library and CLI can assign each Skill to individual agents:
205
-
206
204
  ```bash
207
- foundry agents skills list
208
- foundry agents skills list chatgpt
209
- foundry agents skills installed
210
- foundry agents skills installed chatgpt
211
- foundry agents skills bring-in chatgpt --skill hello
212
- foundry agents skills delete chatgpt --skill hello
213
- foundry agents skills assign chatgpt --skill hello
214
- foundry agents skills unassign chatgpt --skill hello
205
+ foundry skills batch delete --skills hello-again,old-skill
206
+ foundry skills batch delete --all
215
207
  ```
216
208
 
217
- `list` returns an array of registered Skill agents with `id`, `name`, `icon`,
218
- `directory`, and saved `skillNames`; the optional agent ID filters the array.
219
- It shows persisted assignments even if a link was removed externally.
220
- `installed` scans each agent's actual Skills directory and returns an array with
221
- `id`, `name`, `icon`, `directory`, and `skills`; each installed skill contains
222
- `directoryName`, metadata `name`, `description`, and `isManaged`. `isManaged`
223
- is true when the entry resolves to the same directory as the Foundry library
224
- Skill with that directory name. Symbolic-link entries also contain `originPath`,
225
- the direct link target; non-link entries omit it.
226
- It is independent of saved assignments and ignores entries without valid
227
- `SKILL.md` frontmatter. The optional agent ID filters the array.
228
-
229
- `bring-in` treats one installed directory name as the Skill name. If Foundry
230
- does not already have that name, it copies the resolved origin into the Foundry
231
- library; a symbolic-link origin is copied without modifying the origin itself.
232
- If Foundry already has the name, the Foundry version wins and the agent version
233
- is not copied. It then saves the assignment for the selected agent only,
234
- replaces that agent's same-name entry with a symlink to the Foundry library, and
235
- prints the complete Foundry Skill. Other agents and entries stay unchanged.
236
- An entry already managed by Foundry returns `SKILL_ALREADY_MANAGED`; metadata
237
- whose name does not match the directory is rejected.
238
-
239
- `delete` removes one installed entry from the selected agent's Skills directory.
240
- A symbolic link is unlinked without deleting its target; an ordinary file or
241
- folder is deleted with all contents. Only a link that resolves to the same-name
242
- Foundry library Skill clears that agent's saved assignment. Other links and
243
- ordinary entries leave saved state unchanged. Other entries, agents, and Foundry
244
- library sources stay unchanged.
245
- It prints `{ "agentId", "directoryName", "kind" }`, where `kind` is `link`,
246
- `file`, or `directory`.
247
-
248
- `assign` requires an existing library Skill. It adds its name once to the
249
- selected agent record and creates a directory symlink at
250
- `<agent-skill-directory>/<skill-name>`. An existing entry at that exact name
251
- is replaced, including files, directories, stale links, and dangling links.
252
- Other names and agents stay unchanged. Link replacement never deletes a
253
- symlink's target directory.
254
-
255
- `unassign` removes the name from the selected saved record and unlinks any
256
- same-name symbolic link, regardless of its target. Missing links, saved names,
257
- and library sources succeed; ordinary files and directories remain intact.
258
- Repeated assign/unassign is safe. Both print `{ "name": "hello", "agentIds": [...] }`
259
- describing that Skill's remaining saved assignments. These writes operate on
260
- saved JSON directly rather than importing other external links.
261
-
262
- The UI reads saved `skills.skillNames` from each agent profile at
263
- `~/.foundry/agents/<agent-id>.json`. Reading assignments imports existing matching
264
- links once for a profile without Skill state. External link removal leaves a
265
- saved assignment intact; assigning again repairs or replaces its named entry.
266
- Targets come from the registry's Skills capability. Skill assignment takes
267
- effect immediately and is independent of the Instructions apply switch.
209
+ `batch delete` accepts either a comma-separated `--skills` list or `--all` to
210
+ delete every Skill in the library, and returns `{ "completed", "failed" }`.
211
+ Each completed entry contains `name` and the deleted Skill as `result`; each
212
+ failed entry contains `name`, `code`, and `message`. Later items continue after
213
+ a failure, so inspect `failed` before reporting success.
214
+
215
+ ## Agent links
216
+
217
+ Skill lifecycle operations synchronize links in assigned agent Skill
218
+ directories. Agent assignment, installed-entry inspection, bring-in, and
219
+ removal commands belong to the Agents reference; see
220
+ [Skill assignments](agents.md#skill-assignments).
268
221
 
269
222
  Each edit creates or refreshes directory symlinks only for saved assigned
270
223
  agents. This includes edits to description only and missing links for those
@@ -272,21 +225,20 @@ agents. Unassigned agents stay unassigned. Creation alone does not distribute
272
225
  the Skill.
273
226
 
274
227
  Renaming updates saved assignments, moves the source folder, establishes links
275
- under the new name, and
276
- explicitly unlinks the old names if they still point to the previous source.
277
- Deleting removes saved assignments and explicitly unlinks matching entries in
278
- registered locations.
279
- Relative links and dangling links to the expected source are recognized.
280
- Unrelated entries at a new destination cause `SKILL_LINK_CONFLICT` before the
281
- source mutation commits. Unrelated old entries and user-replaced links survive
282
- rename and deletion. Links elsewhere or under aliases are outside this scope.
228
+ under the new name, and explicitly unlinks the old names if they still point to
229
+ the previous source. Deleting removes saved assignments and explicitly unlinks
230
+ matching entries in registered locations. Relative links and dangling links to
231
+ the expected source are recognized. Unrelated entries at a new destination
232
+ cause `SKILL_LINK_CONFLICT` before the source mutation commits. Unrelated old
233
+ entries and user-replaced links survive rename and deletion. Links elsewhere or
234
+ under aliases are outside this scope.
283
235
 
284
236
  Refresh creates a temporary symlink beside the destination and atomically
285
237
  renames it over the existing matching link. This avoids the missing-link window
286
238
  of unlink-then-link. The assignment record, source mutation, and synchronization
287
- intent share the
288
- redo journal; interrupted work resumes on the next storage operation or startup.
289
- Agent discovery/reload remains separate from filesystem updates. See the
239
+ intent share the redo journal; interrupted work resumes on the next storage
240
+ operation or startup. Agent discovery/reload remains separate from filesystem
241
+ updates. See the
290
242
  [symlink research](https://github.com/tinywaves/foundry/blob/main/docs/research/skill-symlink-lifecycle.md)
291
243
  for filesystem behavior and official agent references.
292
244
 
@@ -299,7 +251,8 @@ for filesystem behavior and official agent references.
299
251
  - `SKILL_LINK_CONFLICT`: a destination blocks metadata synchronization or rename,
300
252
  or an agent directory aliases the library source itself. Resolve that conflict
301
253
  before retrying. Explicit assign replaces normal same-name agent entries.
302
- - `SKILL_AGENT_NOT_FOUND`: the agent is not registered with Skills support.
254
+ - Agent assignment and installed-entry error codes are listed in
255
+ [Agents](agents.md#errors).
303
256
  - Missing required flags produce CLI argument errors.
304
257
  - `skills save` rejects malformed JSON and invalid file trees with the same
305
258
  validation errors as the Web. Filesystem read failures such as `ENOENT`