@dhzh/foundry 10.1.2 → 11.0.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.
@@ -14,21 +14,22 @@ foundry skills get hello
14
14
  `list` returns a JSON array of `{ name, description }` summaries, or `[]` for
15
15
  an empty library. `get` returns one complete Skill with `name`, `description`,
16
16
  `content`, and nested `files`. Each file has a full skill-relative `path` and
17
- `content`; each folder has `path` and `children`. The top-level `content` and
18
- `SKILL.md` entry contain the Markdown body without YAML frontmatter.
17
+ `content`; each folder has `path` and `children`. File content is the complete
18
+ source text, including YAML frontmatter in `SKILL.md`. The top-level `content`
19
+ contains only the Markdown body. Edit the file entry to save source changes.
19
20
 
20
21
  ## Save file changes
21
22
 
22
23
  Prefer stdin for agent workflows: read the detail into memory, change its
23
24
  `files`, and submit the JSON through `--file -`. Foundry reads this input in
24
25
  memory and does not create an intermediate JSON file. For example, update only
25
- the primary body while retaining every other entry:
26
+ the primary file while retaining every other entry:
26
27
 
27
28
  ```bash
28
29
  node <<'JS'
29
30
  const { execFileSync } = require('node:child_process');
30
31
  const skill = JSON.parse(execFileSync('foundry', ['skills', 'get', 'hello'], { encoding: 'utf8' }));
31
- skill.files.find((file) => file.path === 'SKILL.md').content = '# Updated\n';
32
+ skill.files.find((file) => file.path === 'SKILL.md').content += '\n# Updated\n';
32
33
  const saved = execFileSync('foundry', ['skills', 'save', 'hello', '--file', '-'], {
33
34
  input: JSON.stringify({ files: skill.files }),
34
35
  encoding: 'utf8',
@@ -44,12 +45,12 @@ project or home directory when stdin can carry the input.
44
45
 
45
46
  Input is `{ "files": [...] }`, or the complete `get` output. Only `files` is
46
47
  applied; top-level `name`, `description`, and `content` are ignored. Use `edit`
47
- for metadata changes. Example file tree:
48
+ to rename the Skill. Other metadata can be changed in `SKILL.md`. Example file tree:
48
49
 
49
50
  ```json
50
51
  {
51
52
  "files": [
52
- { "path": "SKILL.md", "content": "# Hello\n" },
53
+ { "path": "SKILL.md", "content": "---\nname: hello\ndescription: Use when greeting users.\n---\n# Hello\n" },
53
54
  {
54
55
  "path": "scripts",
55
56
  "children": [
@@ -64,7 +65,9 @@ for metadata changes. Example file tree:
64
65
  Saving replaces the complete editable tree: new paths are created, included
65
66
  text is replaced, and omitted entries are deleted. Include every entry you
66
67
  want to retain. An empty folder uses `children: []`. `SKILL.md` is required;
67
- its `content` replaces only the body and preserves frontmatter. Binary or
68
+ its `content` replaces the complete file verbatim, including frontmatter.
69
+ Frontmatter must contain a valid name matching the directory and a valid
70
+ description. Invalid metadata rejects the entire save. Binary or
68
71
  oversized existing files are returned with `content: null`; retain that entry
69
72
  unchanged to preserve it, or omit it to delete it. Null cannot create a file.
70
73
  Child symlinks are hidden from the tree, preserved, and never followed.
@@ -347,8 +350,9 @@ has file navigation on the left and a Monaco source editor on the right,
347
350
  including for an empty `SKILL.md` body. Save with the toolbar button or Cmd/Ctrl+S.
348
351
  `GET /api/skills/:name` returns metadata and the complete nested `files` tree.
349
352
  Files contain `path` and `content`; folders contain `path` and `children`.
350
- The `SKILL.md` content is its Markdown body; frontmatter remains managed through
351
- Overview. Other editable files contain their full source text. Binary and large
353
+ All editable files contain their full source text, including `SKILL.md` YAML
354
+ frontmatter, comments, and whitespace. Save writes that text verbatim after
355
+ validating metadata; use Overview to rename the Skill. Binary and large
352
356
  files use `content: null` and remain unchanged unless deleted from the draft.
353
357
  File additions, edits, and deletions stay local until Save sends `{ files }` to
354
358
  `PUT /api/skills/:name`. One transaction applies the complete tree. Existing agent