@sous-io/sous 1.1.12 → 1.2.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.
- package/dist/sous.js +101 -91
- package/docs/markdown/_sidebar.md +2 -0
- package/docs/markdown/commands.md +40 -14
- package/docs/markdown/configuration.md +43 -0
- package/docs/markdown/handlers.md +3 -1
- package/docs/markdown/project-recipes.md +193 -0
- package/docs/markdown/repositories-authoring.md +37 -1
- package/docs/markdown/repositories-consuming.md +56 -1
- package/docs/markdown/repositories-file-formats.md +64 -9
- package/docs/markdown/repositories.md +22 -0
- package/package.json +38 -38
- package/recipes/core/sous-skills/skills/about-sous/SKILL.tpl.md +14 -1
- package/recipes/core/sous-skills/skills/about-sous-configuration/SKILL.tpl.md +5 -0
- package/recipes/core/sous-skills/skills/about-sous-recipes/SKILL.tpl.md +53 -7
- package/recipes/core/sous-skills/skills/about-sous-repos/SKILL.tpl.md +7 -4
- package/recipes/core/sous-skills/sous.recipe.yaml +1 -1
- package/sous.config.schema.json +77 -0
|
@@ -9,7 +9,10 @@ change raises that number, so an older sous refuses a file it would otherwise mi
|
|
|
9
9
|
|
|
10
10
|
?> Both hand-written manifests are YAML or JSON, never JavaScript: `.yaml`, `.yml`, `.json` or `.jsonc`
|
|
11
11
|
(both JSON forms allow comments and trailing commas). Two in one directory is an error, not a first-match
|
|
12
|
-
win.
|
|
12
|
+
win. In the recipe manifest, a key sous does not know is skipped with a warning naming the key and the file,
|
|
13
|
+
so a manifest written for a later sous still loads (a sous older than 1.2.0 refuses it instead); the
|
|
14
|
+
repository manifest refuses one. Extension keys starting with `x-` are carried through untouched in both,
|
|
15
|
+
with no warning; [the one
|
|
13
16
|
sous reads](repositories-authoring.md#declare-the-variables-a-recipe-needs) is `x-intentional`. Every path
|
|
14
17
|
in a manifest is checked: absolute paths, backslashes, `.` or `..` segments, empty segments and trailing
|
|
15
18
|
slashes are refused.
|
|
@@ -98,6 +101,14 @@ version: 0.1.0
|
|
|
98
101
|
depends: # 'subscribes' takes the same two spellings
|
|
99
102
|
- workflow/qa-helper
|
|
100
103
|
- github://sous-io/sous-recipes/workflow/sub-agent-delegation@^1.0
|
|
104
|
+
recommends: # offered to the subscriber, who decides
|
|
105
|
+
- quality/lint-rules
|
|
106
|
+
- ref: quality/test-coverage
|
|
107
|
+
reason: >-
|
|
108
|
+
/review flags untested changes much more precisely when the coverage skill is present. Skip it if
|
|
109
|
+
your project has no test suite.
|
|
110
|
+
- ref: github://sous-io/sous-recipes/workflow/task-files@^1.2
|
|
111
|
+
reason: Lets /review attach its findings to the current task file.
|
|
101
112
|
contents: # what a subscriber actually receives
|
|
102
113
|
- kind: skills
|
|
103
114
|
include: [skills/**/*.md] # 'exclude' is the optional counterpart
|
|
@@ -106,10 +117,11 @@ contents: # what a subscriber actually receives
|
|
|
106
117
|
| Field | Required | Notes |
|
|
107
118
|
|-------|----------|-------|
|
|
108
119
|
| `name` | yes | Unique within the recipe's namespace |
|
|
109
|
-
| `namespace` | to release | The recipe's namespace; `sous repo release` refuses a recipe that names none, or one the repository manifest does not declare |
|
|
120
|
+
| `namespace` | to release | The recipe's namespace; `sous repo release` refuses a recipe that names none, or one the repository manifest does not declare. A project's own recipe that names none gets one worked out from where it is ([Namespaces](project-recipes.md#namespaces)) |
|
|
110
121
|
| `version` | to release | An exact semantic version; the manifest is the source of truth and the git tag follows it. `sous repo release` refuses a recipe that names none |
|
|
111
122
|
| `description` | no | Copied into the index at release time; shown by `sous recipe list` and `sous repo search` |
|
|
112
123
|
| `depends`, `subscribes` | no | Build dependencies and co-subscriptions; within either list, no entry may repeat |
|
|
124
|
+
| `recommends` | no | Recipes or namespaces the subscriber is offered, and may decline; each entry is a ref, or `{ ref, reason }` with an optional `reason` shown when sous asks. Needs sous 1.2.0 or later; see [Recommendations](#recommendations) |
|
|
113
125
|
| `contents`, `variables` | no | Contents default to an empty list, which is what a curated bundle publishes; a duplicated variable name, or two definitions claiming one `env`, is an error. Any value in `contents` may be an expression; see [Contents are config](#contents-are-config) |
|
|
114
126
|
| `edits` | no | Changes to document files the recipe does not own; see [Edits](#edits) |
|
|
115
127
|
| `submissions` | no | Whether this recipe takes proposed changes, winning over the repository's block; see [The submissions block](#the-submissions-block) |
|
|
@@ -254,9 +266,28 @@ proposes it if the contributor carries on. `sous repo release --check` fails a p
|
|
|
254
266
|
because a pull request can be opened without `submit`, and the check is the one gate every change passes. A
|
|
255
267
|
release itself is never restricted, so whatever publishes the recipe still releases it.
|
|
256
268
|
|
|
269
|
+
### Recommendations
|
|
270
|
+
|
|
271
|
+
`recommends` names recipes that work well beside this one but that it does not need. Unlike a `subscribes`
|
|
272
|
+
entry, a recommendation lands nothing on its own: sous asks the subscriber about each one, showing its
|
|
273
|
+
`reason`, and only a yes subscribes to it. What the subscriber sees is in
|
|
274
|
+
[Recommended recipes](repositories-consuming.md#recommended-recipes).
|
|
275
|
+
|
|
276
|
+
An entry is either a ref, written as a `subscribes` entry is ([Dependencies named by location](#dependencies-named-by-location)),
|
|
277
|
+
or an object:
|
|
278
|
+
|
|
279
|
+
| Field | Required | Notes |
|
|
280
|
+
|-------|----------|-------|
|
|
281
|
+
| `ref` | yes | The recommended recipe or namespace, in any form a `subscribes` entry accepts |
|
|
282
|
+
| `reason` | no | Why the subscriber may want it, in plain sentences. Sous shows it when it asks, shortened when it is long and with control characters and terminal escape sequences removed; `sous repo release` warns about a long one or one holding such characters, and publishes it as written |
|
|
283
|
+
|
|
284
|
+
The object form is spelled `ref:` because an entry may name a whole namespace as well as a recipe. No ref may
|
|
285
|
+
repeat within the list. `sous repo release` warns about every recipe that uses `recommends`, because a sous
|
|
286
|
+
older than 1.2.0 refuses a manifest holding it.
|
|
287
|
+
|
|
257
288
|
### Dependencies named by location
|
|
258
289
|
|
|
259
|
-
`depends` and `
|
|
290
|
+
`depends`, `subscribes` and `recommends` name their targets by where they live: `workflow/qa-helper` is a sibling in this
|
|
260
291
|
same repository, and `github://sous-io/sous-recipes/workflow/sub-agent-delegation@^1.0` is a recipe in
|
|
261
292
|
another one. Every spelling in [Ref forms](#ref-forms) that names a namespace or a recipe is accepted here,
|
|
262
293
|
except a `repo:` qualifier (one project's private name for a repository), a local path or `local://`
|
|
@@ -303,7 +334,7 @@ end of the project path with `/-/`, so it reads one way.
|
|
|
303
334
|
| --- | --- |
|
|
304
335
|
| The command line | every form; names in any case |
|
|
305
336
|
| A config file's subscription keys | `namespace` or `namespace/recipe`, lowercase; the repository is recorded in the lockfile and a range in the entry's `range` field |
|
|
306
|
-
| A recipe manifest's `depends` and `
|
|
337
|
+
| A recipe manifest's `depends`, `subscribes` and `recommends` | every form naming a namespace or a recipe, except `repo:` and a local location |
|
|
307
338
|
| A key sous stores (the lockfile, the index, the store) | `namespace` or `namespace/recipe`, lowercase |
|
|
308
339
|
| An include line, after its `~` | `namespace/recipe/path`, any part a glob, optionally starting with a `repo:` qualifier; see [Include syntax](configuration.md#include-syntax) |
|
|
309
340
|
|
|
@@ -342,6 +373,17 @@ At publish time: a `type: enum` variable must list its options under `validate.e
|
|
|
342
373
|
exceed `maxLength`, nor `min` exceed `max`; `default` and `example` must match the type and, for an enum, be
|
|
343
374
|
one of its options; `secret: true` with `scope: shared` is refused; the committed env file would leak it.
|
|
344
375
|
|
|
376
|
+
## `sous.namespace.yaml`: a namespace's name and description
|
|
377
|
+
|
|
378
|
+
Hand-written, in a folder among a project's own recipes (also `.yml`, `.json` or `.jsonc`). A recipe below it
|
|
379
|
+
whose manifest names no namespace belongs to the namespace it names; see
|
|
380
|
+
[Namespaces](project-recipes.md#namespaces).
|
|
381
|
+
|
|
382
|
+
```yaml
|
|
383
|
+
name: tooling # optional; lowercase kebab-case
|
|
384
|
+
description: Helpers for the team's own tools. # optional; shown by sous namespace list
|
|
385
|
+
```
|
|
386
|
+
|
|
345
387
|
## `sous.index.json`
|
|
346
388
|
|
|
347
389
|
Machine-written by `sous repo release` and committed beside the recipes it describes. Adding a repository
|
|
@@ -361,6 +403,10 @@ fetches only this file; nothing more is downloaded until a project subscribes.
|
|
|
361
403
|
"kind": "depends" } },
|
|
362
404
|
"depends": [ "github://sous-io/sous-recipes/workflow/sub-agent-delegation@^1.0" ],
|
|
363
405
|
"subscribes": [ "workflow" ],
|
|
406
|
+
"recommends": [
|
|
407
|
+
{ "key": "quality/lint-rules", "range": "^0.3.0", "declared": "quality/lint-rules" },
|
|
408
|
+
{ "key": "quality/test-coverage", "range": "^1.4.0", "declared": "quality/test-coverage",
|
|
409
|
+
"reason": "/review flags untested changes much more precisely when the coverage skill is present." } ],
|
|
364
410
|
"variables": [ { "name": "qaNotesDir", "type": "path", "prompt": "Where should notes go?",
|
|
365
411
|
"description": "The directory QA notes are written to.", "example": "docs/qa",
|
|
366
412
|
"default": ".sous/qa-notes", "required": true, "secret": false, "scope": "shared" } ],
|
|
@@ -380,6 +426,7 @@ fetches only this file; nothing more is downloaded until a project subscribes.
|
|
|
380
426
|
| `dependencies` | per version | The range each dependency may take, keyed `namespace/recipe`; see below |
|
|
381
427
|
| `variables` | per version | The version's variable definitions, exactly as its manifest publishes them (see [Variable definitions](#variable-definitions)), with `required`, `secret` and `scope` filled in; `[]` when it asks nothing |
|
|
382
428
|
| `depends`, `subscribes` | per version | The version's manifest lists, exactly as written; `[]` when empty |
|
|
429
|
+
| `recommends` | per version | The version's recommendations, settled at release, in the manifest's order; `[]` when it has none, and absent on a version released before sous recorded recommendations. Each carries `key` (`namespace/recipe`, or `namespace` for a whole namespace), `range` (worked out as a dependency's is; absent for a namespace), `repo` (the identity of another repository; absent for this one), `declared` (the entry's ref exactly as written) and `reason` when the entry has one. Recommendations are not dependencies and never appear under `dependencies` |
|
|
383
430
|
| `retired` | top level | Recipes the repository published and no longer lists, keyed `namespace/recipe`; absent when there are none. Each entry carries `path`, `description` and `versions` as a recipe under `recipes` does, plus `replacements`; see below |
|
|
384
431
|
| `replacements` | per retired recipe | The recipes offered in its place, in order. Each carries `key` (`namespace/recipe`), `repo` (the identity of another repository; absent for this one) and `declared` (the entry exactly as `sous.repo.yaml` wrote it) |
|
|
385
432
|
|
|
@@ -417,7 +464,7 @@ that the list lacks, a recipe in the list the manifest does not declare, a recor
|
|
|
417
464
|
declared one (for a sibling named with no range, not a `^<version>` range or `*`), an older entry's `version`
|
|
418
465
|
outside its declared range, or another repository's entry with a different repository is an error naming the
|
|
419
466
|
recipe, the version and each difference; restore the entry if the index was edited, or bump the version to publish
|
|
420
|
-
different dependencies. A version rebuilt from its tag, when the index lost it, has its dependencies recorded
|
|
467
|
+
different dependencies. Its recorded `recommends` is checked against the manifest the same way. A version rebuilt from its tag, when the index lost it, has its dependencies recorded
|
|
421
468
|
from the repository as it stood at that tag, then frozen the same way. An entry written before sous
|
|
422
469
|
recorded dependencies carries none, stays that way, and installs by resolving its manifest's ranges.
|
|
423
470
|
|
|
@@ -469,7 +516,7 @@ Machine-written, committed, and the reason a fresh clone restores with no prompt
|
|
|
469
516
|
|-------|-------|
|
|
470
517
|
| `repos.<name>.url`, `.identity`, `.indexHash` | Where the repository lives, as recorded when it was added; the canonical identity the store and index cache file it under; and the hash of the index this lock was resolved against, when known. The URL may be an HTTPS or SSH URL (`git@gitlab.com:acme/recipes.git` or `ssh://git@gitlab.com/acme/recipes.git`) or an absolute path. A build fills in a missing `indexHash` from the cached index, and leaves one already recorded alone |
|
|
471
518
|
| `recipes.<key>.repo`, `.version`, `.hash` | The project's short name for the repository, which must appear under `repos`; the version resolved; and the hash verified against the store after every fetch |
|
|
472
|
-
| `recipes.<key>.requestedBy`, `.kind` | Who holds the entry, the literal `project` or the key of a recipe that requires it, and whether that holder is a `subscribes` or a `depends
|
|
519
|
+
| `recipes.<key>.requestedBy`, `.kind` | Who holds the entry, the literal `project` or the key of a recipe that requires it (one of the project's own recipes included), and whether that holder is a `subscribes` or a `depends`. The project's own recipes have no entry of their own |
|
|
473
520
|
| `recipes.<key>.pins.<holder>.version`, `.hash` | A version pinned for one holder alone, keyed by that holder's recipe key; absent when every holder uses `version` |
|
|
474
521
|
|
|
475
522
|
A repository appears under two names on purpose: the key is the project's own short name, which every
|
|
@@ -557,6 +604,8 @@ subscriptions:
|
|
|
557
604
|
workflow/task-files:
|
|
558
605
|
range: "^1.2.0" # defaults to "*"; prerelease, enabled, alwaysPull, addedAt
|
|
559
606
|
prerelease: false # and addedBy work as they do above
|
|
607
|
+
declinedRecommendations: # recommendations this project said no to; sous does not offer them again
|
|
608
|
+
- quality/lint-rules
|
|
560
609
|
store: # every value is a default you can change
|
|
561
610
|
maxBytes: 1073741824 # one gigabyte; past it, 'sous repo gc' evicts unpinned entries
|
|
562
611
|
freshnessSeconds: 300 # how long a fetched index stays fresh
|
|
@@ -567,17 +616,23 @@ recipes: # what each content kind a subscribed recipe publishe
|
|
|
567
616
|
memories: { first: ["communication/*"], exclude: ["tool-usage/automated-browser-tasks"] }
|
|
568
617
|
varMappings:
|
|
569
618
|
QA_SERVICE_TOKEN: workflow/qa-variables/qaServiceToken
|
|
619
|
+
projectRecipes: # the project's own recipes; both values are the defaults
|
|
620
|
+
paths: [".sous/recipes/*"]
|
|
621
|
+
exclude: []
|
|
570
622
|
```
|
|
571
623
|
|
|
572
624
|
| Key | Keyed by | Notes |
|
|
573
625
|
|-----|----------|-------|
|
|
574
|
-
| `repos` | the short name refs use | Adding a repository IS trusting it, and removing the entry withdraws that trust |
|
|
626
|
+
| `repos` | the short name refs use | Adding a repository IS trusting it, and removing the entry withdraws that trust. The name `project` is reserved for the project's own recipes and is an error here |
|
|
575
627
|
| `subscriptions` | a ref key | A bare namespace (every recipe in it, including ones published later) or `namespace/recipe`. No repo qualifier and no range in the key |
|
|
576
628
|
| `enabled: false` | either of the two above | The opt-out for the entries sous provides itself, the `sous-recipes` repository and the `core` subscription |
|
|
629
|
+
| `declinedRecommendations` | a list | `string[]`, empty by default. Each entry is a recommended recipe or namespace the project declined, in canonical form (`namespace/recipe` or `namespace`); see [Recommended recipes](repositories-consuming.md#recommended-recipes) |
|
|
577
630
|
| `store` | fixed fields | Plain numbers, all optional; the values sous ships are defaults, not assumptions |
|
|
578
631
|
| `recipes` | content kind | What each kind does; see [recipes: what each content kind does](#recipes-what-each-content-kind-does) |
|
|
579
|
-
| `recipes.handlers` | a list | Written by sous while the config is built: one `{ recipe, purpose, file, handler }` entry for each handler a subscribed recipe from a trusted repository lists; see [Handlers](handlers.md) |
|
|
632
|
+
| `recipes.handlers` | a list | Written by sous while the config is built: one `{ recipe, purpose, file, handler }` entry for each handler a subscribed recipe from a trusted repository, or one of the project's own recipes, lists; see [Handlers](handlers.md) |
|
|
580
633
|
| `varMappings` | environment variable name | Binds one name to one recipe variable, written `namespace/recipe/variableName` with an optional `repo:` qualifier |
|
|
634
|
+
| `projectRecipes` | fixed fields | `paths` and `exclude`: where the project's own recipes are, and which of them it leaves out; see [Your project's own recipes](project-recipes.md) |
|
|
635
|
+
| `recipes.repository`, `recipes.namespaces` | fixed fields; a list | Written by sous while the config is built: the project's own `sous.repo.yaml` as `{ file, manifest }`, and each `sous.namespace.yaml` found above its own recipes as `{ file, dir, name?, description? }` |
|
|
581
636
|
|
|
582
637
|
A repository's `url` may be a URL or an absolute path to one on this machine, read by the `local` provider
|
|
583
638
|
with identical trust. A hand-written entry is laid over sous's default field by field, so an entry holding
|
|
@@ -616,7 +671,7 @@ are `.jsonc` so they can carry real comments, and each opens with a header sayin
|
|
|
616
671
|
| Layer | Holds | Written by |
|
|
617
672
|
|-------|-------|-----------|
|
|
618
673
|
| `500-repos.jsonc` | `repos` | `sous repo add`, `sous repo remove` |
|
|
619
|
-
| `510-subscriptions.jsonc` | `subscriptions` | `sous subscription add`, `remove`, `enable` and `disable` |
|
|
674
|
+
| `510-subscriptions.jsonc` | `subscriptions`, `declinedRecommendations` | `sous subscription add`, `remove`, `enable` and `disable`; `sous subscription add` and `sous update` when a recommendation is declined |
|
|
620
675
|
| `520-var-mappings.jsonc` | `varMappings` | `sous vars ask` |
|
|
621
676
|
|
|
622
677
|
```jsonc
|
|
@@ -111,6 +111,21 @@ a recipe made mostly of `subscribes` entries. Because both lists are
|
|
|
111
111
|
declarative YAML rather than code, sous can read the whole dependency closure before fetching any
|
|
112
112
|
of it, which is what makes the trust decision answerable up front.
|
|
113
113
|
|
|
114
|
+
A third list, `recommends`, names recipes that work well beside this one but that it does not need. A
|
|
115
|
+
recommendation lands nothing by itself: sous asks the subscriber about each one, showing the author's
|
|
116
|
+
reason, and a yes makes it one of the project's own subscriptions. A no is remembered in the project's
|
|
117
|
+
config, so sous does not ask again. See [Recommended recipes](repositories-consuming.md#recommended-recipes).
|
|
118
|
+
|
|
119
|
+
```yaml
|
|
120
|
+
recommends:
|
|
121
|
+
- quality/lint-rules
|
|
122
|
+
- ref: quality/test-coverage
|
|
123
|
+
reason: >-
|
|
124
|
+
/review flags untested changes much more precisely when the coverage skill is present.
|
|
125
|
+
```
|
|
126
|
+
|
|
127
|
+
A recipe that uses `recommends` needs sous 1.2.0 or later.
|
|
128
|
+
|
|
114
129
|
### The lockfile
|
|
115
130
|
|
|
116
131
|
`.sous/sous.lock.json` records the exact version, content hash and holder of everything the
|
|
@@ -204,6 +219,11 @@ keeps a project from running what it has no use for and keeps unrelated recipes
|
|
|
204
219
|
everything in a trusted repository is already trusted. Nothing inside a repository runs, a sous
|
|
205
220
|
plugin included, until the repository is trusted.
|
|
206
221
|
|
|
222
|
+
The project's own recipes, under `.sous/recipes/` by default, are active whenever the project's
|
|
223
|
+
recipe paths cover them, with no subscription and no trust question: they are files in the
|
|
224
|
+
project's own repository. Sous lists them under the reserved repository name `project`. See
|
|
225
|
+
[Your project's own recipes](project-recipes.md).
|
|
226
|
+
|
|
207
227
|
A subscription can be switched off on one machine and left on for everyone else, for example from
|
|
208
228
|
a `conf.d` file of your own. A switched-off subscription is not built: its outputs are pruned, its
|
|
209
229
|
variables are not asked, and its pins stay in the committed lockfile. `sous subscription disable <ref>`
|
|
@@ -317,6 +337,7 @@ checks, so every build announces it loudly. See
|
|
|
317
337
|
| `.sous/conf.d/500-repos.jsonc` | the repositories the project trusts | yes |
|
|
318
338
|
| `.sous/conf.d/510-subscriptions.jsonc` | what the project subscribes to | yes |
|
|
319
339
|
| `.sous/conf.d/520-var-mappings.jsonc` | environment variable mapping records | yes |
|
|
340
|
+
| `.sous/recipes/` | the project's own recipes, by default (`projectRecipes.paths`) | yes |
|
|
320
341
|
| `.sous/sous.links.json` | this project's linked working copies | no |
|
|
321
342
|
| `.sous/repos/` | working copies cloned by `sous repo link` | no |
|
|
322
343
|
| `~/.sous/cache/` | the machine-wide recipe store | not in a project at all |
|
|
@@ -379,6 +400,7 @@ listed it), the error names it:
|
|
|
379
400
|
|
|
380
401
|
- [Quickstart](repositories-quickstart.md): an empty project to a compiled skill, in order
|
|
381
402
|
- [Consuming recipes](repositories-consuming.md): adding, subscribing, building, removing
|
|
403
|
+
- [Your project's own recipes](project-recipes.md): recipes kept in the project and used live
|
|
382
404
|
- [Authoring a repository](repositories-authoring.md): writing recipes, releasing, contributing
|
|
383
405
|
- [Recipe variables](repositories-variables.md): the resolution ladder and the question flow
|
|
384
406
|
- [Providers](repositories-providers.md): `github`, `gitlab` and `local`, and what each one can do
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sous-io/sous",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.2.0",
|
|
4
4
|
"description": "Compiles AI coding agent configuration (CLAUDE.md, skills, memories) from LiquidJS templates",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -39,49 +39,49 @@
|
|
|
39
39
|
"sous.config.schema.json"
|
|
40
40
|
],
|
|
41
41
|
"dependencies": {
|
|
42
|
-
"@sous-io/sous-plugin-api": "1.
|
|
42
|
+
"@sous-io/sous-plugin-api": "1.2.0"
|
|
43
43
|
},
|
|
44
44
|
"devDependencies": {
|
|
45
45
|
"esbuild": "^0.27.4",
|
|
46
46
|
"jsonc-parser": "^3.3.1",
|
|
47
47
|
"yaml": "^2.9.0",
|
|
48
48
|
"zod": "^4.4.3",
|
|
49
|
-
"@sous-io/sous-lib-documents": "1.
|
|
50
|
-
"@sous-io/sous-
|
|
51
|
-
"@sous-io/sous-plugin-authoring": "1.
|
|
52
|
-
"@sous-io/sous-plugin-build": "1.
|
|
53
|
-
"@sous-io/sous-
|
|
54
|
-
"@sous-io/sous-plugin-
|
|
55
|
-
"@sous-io/sous-plugin-
|
|
56
|
-
"@sous-io/sous-plugin-
|
|
57
|
-
"@sous-io/sous-plugin-expressions": "1.
|
|
58
|
-
"@sous-io/sous-plugin-formats": "1.
|
|
59
|
-
"@sous-io/sous-plugin-
|
|
60
|
-
"@sous-io/sous-plugin-
|
|
61
|
-
"@sous-io/sous-plugin-
|
|
62
|
-
"@sous-io/sous-plugin-
|
|
63
|
-
"@sous-io/sous-plugin-
|
|
64
|
-
"@sous-io/sous-plugin-
|
|
65
|
-
"@sous-io/sous-plugin-init": "1.
|
|
66
|
-
"@sous-io/sous-plugin-
|
|
67
|
-
"@sous-io/sous-plugin-
|
|
68
|
-
"@sous-io/sous-plugin-
|
|
69
|
-
"@sous-io/sous-plugin-
|
|
70
|
-
"@sous-io/sous-plugin-
|
|
71
|
-
"@sous-io/sous-plugin-
|
|
72
|
-
"@sous-io/sous-plugin-
|
|
73
|
-
"@sous-io/sous-plugin-
|
|
74
|
-
"@sous-io/sous-plugin-recipes": "1.
|
|
75
|
-
"@sous-io/sous-plugin-
|
|
76
|
-
"@sous-io/sous-plugin-
|
|
77
|
-
"@sous-io/sous-plugin-variables": "1.
|
|
78
|
-
"@sous-io/sous-plugin-
|
|
79
|
-
"@sous-io/sous-plugin-
|
|
80
|
-
"@sous-io/sous-plugin-
|
|
81
|
-
"@sous-io/sous-plugin-
|
|
82
|
-
"@sous-io/sous-plugin-
|
|
83
|
-
"@sous-io/sous-plugin-
|
|
84
|
-
"@sous-io/sous-plugin-
|
|
49
|
+
"@sous-io/sous-lib-documents": "1.2.0",
|
|
50
|
+
"@sous-io/sous-lib-core": "1.2.0",
|
|
51
|
+
"@sous-io/sous-plugin-authoring": "1.2.0",
|
|
52
|
+
"@sous-io/sous-plugin-build": "1.2.0",
|
|
53
|
+
"@sous-io/sous-plugin-claude-code": "1.2.0",
|
|
54
|
+
"@sous-io/sous-plugin-cli": "1.2.0",
|
|
55
|
+
"@sous-io/sous-plugin-compiler": "1.2.0",
|
|
56
|
+
"@sous-io/sous-plugin-confd": "1.2.0",
|
|
57
|
+
"@sous-io/sous-plugin-expressions": "1.2.0",
|
|
58
|
+
"@sous-io/sous-plugin-formats": "1.2.0",
|
|
59
|
+
"@sous-io/sous-plugin-git": "1.2.0",
|
|
60
|
+
"@sous-io/sous-plugin-config-files": "1.2.0",
|
|
61
|
+
"@sous-io/sous-plugin-github": "1.2.0",
|
|
62
|
+
"@sous-io/sous-plugin-gitlab": "1.2.0",
|
|
63
|
+
"@sous-io/sous-plugin-harnesses": "1.2.0",
|
|
64
|
+
"@sous-io/sous-plugin-host": "1.2.0",
|
|
65
|
+
"@sous-io/sous-plugin-init": "1.2.0",
|
|
66
|
+
"@sous-io/sous-plugin-inspect": "1.2.0",
|
|
67
|
+
"@sous-io/sous-plugin-liquid": "1.2.0",
|
|
68
|
+
"@sous-io/sous-plugin-local": "1.2.0",
|
|
69
|
+
"@sous-io/sous-plugin-mcp": "1.2.0",
|
|
70
|
+
"@sous-io/sous-plugin-memories": "1.2.0",
|
|
71
|
+
"@sous-io/sous-plugin-npm": "1.2.0",
|
|
72
|
+
"@sous-io/sous-plugin-pnpm": "1.2.0",
|
|
73
|
+
"@sous-io/sous-plugin-recipe-answers": "1.2.0",
|
|
74
|
+
"@sous-io/sous-plugin-recipes": "1.2.0",
|
|
75
|
+
"@sous-io/sous-plugin-refs": "1.2.0",
|
|
76
|
+
"@sous-io/sous-plugin-update": "1.2.0",
|
|
77
|
+
"@sous-io/sous-plugin-variables": "1.2.0",
|
|
78
|
+
"@sous-io/sous-plugin-skills": "1.2.0",
|
|
79
|
+
"@sous-io/sous-plugin-yarn": "1.2.0",
|
|
80
|
+
"@sous-io/sous-plugin-handlers": "1.2.0",
|
|
81
|
+
"@sous-io/sous-plugin-editor": "1.2.0",
|
|
82
|
+
"@sous-io/sous-plugin-doctor": "1.2.0",
|
|
83
|
+
"@sous-io/sous-plugin-migrations": "1.2.0",
|
|
84
|
+
"@sous-io/sous-plugin-codex": "1.2.0"
|
|
85
85
|
},
|
|
86
86
|
"engines": {
|
|
87
87
|
"node": ">=22"
|
|
@@ -118,7 +118,20 @@ project subscribes to it, directly or through its namespace, or when an active r
|
|
|
118
118
|
lists it under `subscribes`. Only an active recipe adds anything to the project: output files,
|
|
119
119
|
skills, tool hooks, tool plugins (such as a Claude Code plugin) and Sous plugins (code that
|
|
120
120
|
extends sous itself). A recipe held only through `depends` is a library: an active recipe may
|
|
121
|
-
include, call or import its files, but it adds nothing to the project itself.
|
|
121
|
+
include, call or import its files, but it adds nothing to the project itself. A recipe an active
|
|
122
|
+
recipe lists under `recommends` is only offered: `sous subscription add` and `sous update` ask about
|
|
123
|
+
it, and a yes makes it one of the project's own subscriptions. A no is recorded under
|
|
124
|
+
`declinedRecommendations` in `.sous/conf.d/510-subscriptions.jsonc`; `sous subscription add` with
|
|
125
|
+
that ref, or deleting the entry, undoes it. `--yes` never accepts a recommendation;
|
|
126
|
+
`--accept-recommendations` and `--decline-recommendations` answer every one, and without a
|
|
127
|
+
terminal and without either, each stays pending and is listed in the output.
|
|
128
|
+
|
|
129
|
+
The project's own recipes (under `.sous/recipes/` by default; `projectRecipes.paths` in the config
|
|
130
|
+
sets where) are active with no subscription and no trust question, since they are files in the
|
|
131
|
+
project itself. Every build reads them from the working tree, so an edit to one takes effect on the
|
|
132
|
+
next `sous build`, with no release. Sous lists them under the reserved repository name `project`
|
|
133
|
+
(`project:tooling/review-helpers`). Edit them in place: unlike a recipe in the store, they ARE the
|
|
134
|
+
source. YOU MUST load `about-sous-recipes` before creating or changing one.
|
|
122
135
|
|
|
123
136
|
A recipe's Sous plugin runs inside sous while sous builds the project's config, with the user's
|
|
124
137
|
own permissions, so it is code from that recipe's repository like any other. A recipe may also
|
|
@@ -73,6 +73,11 @@ prefer the on-disk copies.
|
|
|
73
73
|
`recipes.skills.outputs`; with neither, the build skips the skills and says why.
|
|
74
74
|
`recipes.memories.first` and `recipes.memories.exclude` (globs over `namespace/recipe`, or
|
|
75
75
|
`/regex/` strings) order and filter the recipe memories.
|
|
76
|
+
- `projectRecipes.paths` (`string[] = [".sous/recipes/*"]`, folders or globs relative to the
|
|
77
|
+
project root) says where the project's own recipes are; `[]` turns them off.
|
|
78
|
+
`projectRecipes.exclude` (`string[] = []`) leaves some out by namespace, `namespace/recipe` key,
|
|
79
|
+
glob or `/regex/`. The repository name `project` is reserved for them, so `repos.project` is an
|
|
80
|
+
error. See `{{ sousRootPath }}/docs/markdown/project-recipes.md`.
|
|
76
81
|
- A target in `compilation.targets` wins over a plugin's or a recipe's target that would write
|
|
77
82
|
the same file. A project that compiles its own memories file replaces the one the Claude Code
|
|
78
83
|
plugin builds (`.claude/rules/SOUS-MEMORIES.md`, from `.sous/MEMORIES.tpl.md`; the config
|
|
@@ -3,7 +3,7 @@ name: about-sous-recipes
|
|
|
3
3
|
description: >
|
|
4
4
|
YOU MUST load this skill when creating or changing a sous recipe: its sous.recipe.yaml, its
|
|
5
5
|
version, the variables it asks for, the files it publishes, a Sous plugin it ships or requires,
|
|
6
|
-
its depends or
|
|
6
|
+
its depends, subscribes or recommends lists, or a partial or @~ include inside it.
|
|
7
7
|
user-invocable: false
|
|
8
8
|
license: Apache-2.0
|
|
9
9
|
compatibility:
|
|
@@ -21,8 +21,9 @@ load `about-agent-skills`.
|
|
|
21
21
|
|
|
22
22
|
## The Manifest
|
|
23
23
|
|
|
24
|
-
The manifest is YAML or JSON, never JavaScript
|
|
25
|
-
starting with `x
|
|
24
|
+
The manifest is YAML or JSON, never JavaScript. A key sous does not know is skipped with a warning (a
|
|
25
|
+
sous older than 1.2.0 refuses it instead); extension keys starting with `x-` are carried through
|
|
26
|
+
with no warning. A typical one:
|
|
26
27
|
|
|
27
28
|
```yaml
|
|
28
29
|
formatVersion: 1
|
|
@@ -59,12 +60,36 @@ The fields in that example:
|
|
|
59
60
|
`projectRoot`, which sous sets itself (to the directory holding `.sous/`); setting it is an error. A recipe that only bundles others
|
|
60
61
|
may leave `contents` out.
|
|
61
62
|
- `plugin` and `requires` are described in "Shipping Sous Plugins" below.
|
|
62
|
-
- `depends`, `subscribes` and `variables` are described below; `submissions` is in
|
|
63
|
+
- `depends`, `subscribes`, `recommends` and `variables` are described below; `submissions` is in
|
|
63
64
|
`about-sous-repos`.
|
|
64
65
|
|
|
65
66
|
A file whose name contains `.tpl.` is rendered through LiquidJS and loses the `.tpl.`; every other
|
|
66
67
|
file is copied as it is. YOU MUST load `about-liquid-templates` before deciding which a file needs.
|
|
67
68
|
|
|
69
|
+
## The Project's Own Recipes
|
|
70
|
+
|
|
71
|
+
A project can keep recipes of its own, under `.sous/recipes/` by default (the config key
|
|
72
|
+
`projectRecipes.paths`, a list of folders or globs relative to the project root;
|
|
73
|
+
`projectRecipes.exclude` leaves some out). Every build uses them from the working tree, with no
|
|
74
|
+
subscription, release, version raise or lockfile entry, under the reserved repository name
|
|
75
|
+
`project`. Their manifests MAY leave out `namespace` and `version`.
|
|
76
|
+
|
|
77
|
+
- A namespace the manifest leaves out is worked out: the nearest `sous.namespace.yaml` above the
|
|
78
|
+
recipe that sets a `name`, else the first folder under the path that found it
|
|
79
|
+
(`.sous/recipes/tooling/review-helpers` gives `tooling`), else the project's own name (its sous
|
|
80
|
+
config's `name`, its `package.json`, its git `origin`, its folder). `sous recipe show
|
|
81
|
+
project:<namespace>/<recipe>` says which.
|
|
82
|
+
- A project recipe with the same key as a subscribed recipe replaces it, and every build says so.
|
|
83
|
+
- Its `depends` and `subscribes` may name recipes in the project's trusted repositories; sous pins
|
|
84
|
+
them in the lockfile with the project recipe as their holder. A bare `namespace/recipe` means a
|
|
85
|
+
project recipe first.
|
|
86
|
+
- Its plugin and handlers run with no trust question.
|
|
87
|
+
- It is published only when the project's own `sous.repo.yaml` lists it, through
|
|
88
|
+
`sous repo release`.
|
|
89
|
+
|
|
90
|
+
The rest of this skill applies to it as to any recipe, except "Raising the Version", which applies
|
|
91
|
+
only once it is published.
|
|
92
|
+
|
|
68
93
|
## Raising the Version
|
|
69
94
|
|
|
70
95
|
Every change to a published recipe raises its version, in the same change. Versions are semantic:
|
|
@@ -146,15 +171,17 @@ combination: secret, `local` or required if any definition is, and only the valu
|
|
|
146
171
|
accepts. When no value can satisfy both (different types, no shared `enum` option), each recipe is
|
|
147
172
|
asked separately under its recipe-scoped name.
|
|
148
173
|
|
|
149
|
-
## Depends and
|
|
174
|
+
## Depends, Subscribes and Recommends
|
|
150
175
|
|
|
151
|
-
|
|
176
|
+
The three lists name other recipes, and they do different things:
|
|
152
177
|
|
|
153
178
|
- `depends` makes the other recipe a **library** for this one. It is fetched and pinned, and its
|
|
154
179
|
files can be included from this recipe's templates, but its files never reach the subscriber's
|
|
155
180
|
output.
|
|
156
181
|
- `subscribes` is a **co-subscription**. The other recipe's files land, as if the project had
|
|
157
182
|
subscribed to it too.
|
|
183
|
+
- `recommends` is an **offer**. Sous asks the subscriber about each recommended recipe, showing its
|
|
184
|
+
`reason`, and subscribes to it only on a yes; a no is remembered, and never asked again.
|
|
158
185
|
|
|
159
186
|
Under either list, the other recipe's questions are asked, and its answers are in this recipe's
|
|
160
187
|
templates.
|
|
@@ -175,6 +202,25 @@ Each entry names its target by where it lives:
|
|
|
175
202
|
`local://` locators and `repo:` short names are refused: both are one project's private view of a
|
|
176
203
|
repository, and a published manifest is read everywhere.
|
|
177
204
|
|
|
205
|
+
A `recommends` entry is a ref, written as above, or `{ ref, reason }`. Use it for a recipe that makes
|
|
206
|
+
this one work better but that a subscriber could do without, and keep `subscribes` for what this
|
|
207
|
+
recipe needs. The `reason` tells the subscriber what the other recipe adds and when to skip it; put
|
|
208
|
+
the point in its first sentence, because a long one is shortened when shown.
|
|
209
|
+
|
|
210
|
+
```yaml
|
|
211
|
+
recommends:
|
|
212
|
+
- quality/lint-rules
|
|
213
|
+
- ref: quality/test-coverage
|
|
214
|
+
reason: >-
|
|
215
|
+
/review flags untested changes much more precisely when the coverage skill is present. Skip
|
|
216
|
+
it if your project has no test suite.
|
|
217
|
+
```
|
|
218
|
+
|
|
219
|
+
A recommended recipe may be missing, because the subscriber declined it: this recipe MUST NOT
|
|
220
|
+
include its files or read its variables, and its instructions MUST read correctly without it. A
|
|
221
|
+
sous older than 1.2.0 refuses a manifest holding `recommends`, and `sous repo release` warns about
|
|
222
|
+
every recipe that uses it.
|
|
223
|
+
|
|
178
224
|
## Shipping Sous Plugins
|
|
179
225
|
|
|
180
226
|
A recipe MAY ship a Sous plugin (code that extends sous itself, for example to add a Liquid
|
|
@@ -193,7 +239,7 @@ plugin:
|
|
|
193
239
|
```
|
|
194
240
|
|
|
195
241
|
Sous loads the plugin while it builds the subscriber's config, and only from a trusted
|
|
196
|
-
repository: nothing inside a repository runs before it is trusted. A recipe held only through
|
|
242
|
+
repository or the project's own recipes: nothing inside a repository runs before it is trusted. A recipe held only through
|
|
197
243
|
`depends` is a library and adds nothing to the subscriber, so its plugin NEVER loads.
|
|
198
244
|
|
|
199
245
|
A recipe can also require plugins from npm, each with a version range:
|
|
@@ -47,7 +47,9 @@ A recipe repository holds three kinds of file that sous reads:
|
|
|
47
47
|
|
|
48
48
|
Manifests are YAML (`.yaml`, `.yml`) or JSON (`.json`, `.jsonc`, both allowing comments and
|
|
49
49
|
trailing commas), never JavaScript: sous reads them before anyone has trusted the repository, so
|
|
50
|
-
nothing in them may run.
|
|
50
|
+
nothing in them may run. A key sous does not know is refused in the repo manifest and skipped with
|
|
51
|
+
a warning in a recipe manifest (a sous older than 1.2.0 refuses it there too); extension keys
|
|
52
|
+
starting with `x-` are carried through with no warning. A
|
|
51
53
|
recipe folder MUST NOT contain a symbolic link; the release refuses one.
|
|
52
54
|
|
|
53
55
|
```yaml
|
|
@@ -73,8 +75,8 @@ once a git tag shaped `namespace/recipe@version` exists for it (for example
|
|
|
73
75
|
`review/checklist@1.2.0`). The index records each published version with its content hash, its
|
|
74
76
|
tag, the range each of its dependencies may take (the declared range, or `^<version at release>`
|
|
75
77
|
for a sibling named with no range; each with the manifest entry that brought it in and whether it
|
|
76
|
-
is a co-subscription or a build dependency)
|
|
77
|
-
definitions it publishes, which is how a project lists what a recipe installs and asks before
|
|
78
|
+
is a co-subscription or a build dependency), its `recommends` list (settled the same way, each
|
|
79
|
+
`reason` included) and the variable definitions it publishes, which is how a project lists what a recipe installs and asks before
|
|
78
80
|
fetching it; for the length of one release commit it also records the version each manifest
|
|
79
81
|
declares, whose tag that release cuts next. A published version never changes: new files need a
|
|
80
82
|
new version, and a release refuses to publish different content under a version already tagged. A
|
|
@@ -108,7 +110,8 @@ the index has uncommitted changes, or while git cannot say who is committing. Un
|
|
|
108
110
|
to other files (a project file a sous migration rewrote, for example) do not stop it, and its
|
|
109
111
|
commit leaves them out. In one run it:
|
|
110
112
|
|
|
111
|
-
1. validates every manifest
|
|
113
|
+
1. validates every manifest, warning about each recipe that uses `recommends` (subscribers need
|
|
114
|
+
sous 1.2.0 or later to read it);
|
|
112
115
|
2. finds the recipes whose files changed since the tag that last published them (a recipe never
|
|
113
116
|
tagged is released at the version its manifest declares);
|
|
114
117
|
3. raises the version of each changed recipe whose version still equals that tag (a patch step by
|
package/sous.config.schema.json
CHANGED
|
@@ -359,6 +359,15 @@
|
|
|
359
359
|
},
|
|
360
360
|
"additionalProperties": false
|
|
361
361
|
},
|
|
362
|
+
"declinedRecommendations": {
|
|
363
|
+
"description": "The recommended recipes and namespaces this project declined, so sous does not offer them again. Sous adds one when you decline a recommendation, and removes one when you subscribe to it.",
|
|
364
|
+
"type": "array",
|
|
365
|
+
"default": [],
|
|
366
|
+
"items": {
|
|
367
|
+
"type": "string",
|
|
368
|
+
"description": "A recipe ('namespace/recipe') or a namespace ('namespace')."
|
|
369
|
+
}
|
|
370
|
+
},
|
|
362
371
|
"editor": {
|
|
363
372
|
"description": "Edits to files Sous does not own (editor.edits), applied, recorded and undone by the editor.",
|
|
364
373
|
"type": "object",
|
|
@@ -481,6 +490,32 @@
|
|
|
481
490
|
}
|
|
482
491
|
}
|
|
483
492
|
},
|
|
493
|
+
"projectRecipes": {
|
|
494
|
+
"description": "The project's own recipes, used live from its working tree.",
|
|
495
|
+
"type": "object",
|
|
496
|
+
"default": {},
|
|
497
|
+
"properties": {
|
|
498
|
+
"paths": {
|
|
499
|
+
"type": "array",
|
|
500
|
+
"items": {
|
|
501
|
+
"type": "string"
|
|
502
|
+
},
|
|
503
|
+
"default": [
|
|
504
|
+
".sous/recipes/*"
|
|
505
|
+
],
|
|
506
|
+
"description": "Folders holding the project's own recipes, relative to the project root; glob patterns are allowed. A matched folder that is not a recipe is searched for recipe folders beneath it. An empty list turns the project's own recipes off."
|
|
507
|
+
},
|
|
508
|
+
"exclude": {
|
|
509
|
+
"type": "array",
|
|
510
|
+
"items": {
|
|
511
|
+
"type": "string"
|
|
512
|
+
},
|
|
513
|
+
"default": [],
|
|
514
|
+
"description": "Project recipes not to use: a namespace (every recipe in it), a namespace/recipe key, a glob, or a /regular expression/ matched against keys."
|
|
515
|
+
}
|
|
516
|
+
},
|
|
517
|
+
"additionalProperties": false
|
|
518
|
+
},
|
|
484
519
|
"repos": {
|
|
485
520
|
"description": "The repositories this project trusts, by short name.",
|
|
486
521
|
"type": "object",
|
|
@@ -792,6 +827,48 @@
|
|
|
792
827
|
},
|
|
793
828
|
"default": {}
|
|
794
829
|
},
|
|
830
|
+
"namespaces": {
|
|
831
|
+
"description": "The sous.namespace.yaml files among this project's own recipes, added by sous-plugin-recipes (read-only in practice).",
|
|
832
|
+
"type": "array",
|
|
833
|
+
"default": [],
|
|
834
|
+
"items": {
|
|
835
|
+
"type": "object",
|
|
836
|
+
"required": [
|
|
837
|
+
"file",
|
|
838
|
+
"dir"
|
|
839
|
+
],
|
|
840
|
+
"properties": {
|
|
841
|
+
"file": {
|
|
842
|
+
"type": "string"
|
|
843
|
+
},
|
|
844
|
+
"dir": {
|
|
845
|
+
"type": "string"
|
|
846
|
+
},
|
|
847
|
+
"name": {
|
|
848
|
+
"type": "string"
|
|
849
|
+
},
|
|
850
|
+
"description": {
|
|
851
|
+
"type": "string"
|
|
852
|
+
}
|
|
853
|
+
}
|
|
854
|
+
}
|
|
855
|
+
},
|
|
856
|
+
"repository": {
|
|
857
|
+
"description": "This project's own sous.repo.yaml, when it has one, added by sous-plugin-recipes (read-only in practice).",
|
|
858
|
+
"type": "object",
|
|
859
|
+
"required": [
|
|
860
|
+
"file",
|
|
861
|
+
"manifest"
|
|
862
|
+
],
|
|
863
|
+
"properties": {
|
|
864
|
+
"file": {
|
|
865
|
+
"type": "string"
|
|
866
|
+
},
|
|
867
|
+
"manifest": {
|
|
868
|
+
"type": "object"
|
|
869
|
+
}
|
|
870
|
+
}
|
|
871
|
+
},
|
|
795
872
|
"skills": {
|
|
796
873
|
"description": "Where skills go (outputs, `${var}` allowed) and directories of your own skills (include).",
|
|
797
874
|
"type": "object",
|