@sous-io/sous 1.1.12 → 1.1.13
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 +82 -82
- package/docs/markdown/_sidebar.md +1 -0
- package/docs/markdown/commands.md +20 -6
- package/docs/markdown/configuration.md +26 -0
- package/docs/markdown/handlers.md +3 -1
- package/docs/markdown/project-recipes.md +193 -0
- package/docs/markdown/repositories-authoring.md +7 -1
- package/docs/markdown/repositories-consuming.md +1 -0
- package/docs/markdown/repositories-file-formats.md +20 -4
- package/docs/markdown/repositories.md +7 -0
- package/package.json +38 -38
- package/recipes/core/sous-skills/skills/about-sous/SKILL.tpl.md +7 -0
- 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 +25 -1
- package/recipes/core/sous-skills/sous.recipe.yaml +1 -1
- package/sous.config.schema.json +68 -0
|
@@ -14,6 +14,7 @@
|
|
|
14
14
|
- [Overview](repositories.md)
|
|
15
15
|
- [Quickstart](repositories-quickstart.md)
|
|
16
16
|
- [Consuming recipes](repositories-consuming.md)
|
|
17
|
+
- [Your project's own recipes](project-recipes.md)
|
|
17
18
|
- [Contributing a change](repositories-contributing.md)
|
|
18
19
|
- [Authoring a repository](repositories-authoring.md)
|
|
19
20
|
- [Recipe variables](repositories-variables.md)
|
|
@@ -263,8 +263,8 @@ sous init hooks --dry-run
|
|
|
263
263
|
### `sous build`
|
|
264
264
|
|
|
265
265
|
Compiles the project's outputs, then removes the ones the config no longer produces. It is the command you want
|
|
266
|
-
almost always. `-w, --watch` rebuilds on every change to a source file, a config file
|
|
267
|
-
and reloads the config when a file is added to or removed from a glob target's folder;
|
|
266
|
+
almost always. `-w, --watch` rebuilds on every change to a source file, a config file, a linked checkout or
|
|
267
|
+
anything under the project's own recipe paths, and reloads the config when a file is added to or removed from a glob target's folder;
|
|
268
268
|
`--rebuild` ignores cached hashes and reprocesses everything; `--strict` makes compile warnings fail the build.
|
|
269
269
|
|
|
270
270
|
Before it compiles, a build prepares the project's recipes: it pins any new subscription, restores whatever this
|
|
@@ -275,6 +275,15 @@ each replacement of a recipe the project subscribes to by name, then to remove t
|
|
|
275
275
|
[Retired recipes](repositories-consuming.md#retired-recipes)). The other commands
|
|
276
276
|
that build (`init`, `launch`, `prune`, `subscription add` and the like) run this same build.
|
|
277
277
|
|
|
278
|
+
A build also uses the project's own recipes, read from the working tree as they are now (see
|
|
279
|
+
[Your project's own recipes](project-recipes.md)), and pins what they need from other repositories. When
|
|
280
|
+
one has the same key as a subscribed recipe, the subscribed one is not built, and every build says so
|
|
281
|
+
(unless the subscribed one is `core`):
|
|
282
|
+
|
|
283
|
+
```text
|
|
284
|
+
Skipped the subscribed sous-recipes:tooling/linting: this project's own recipe project:tooling/linting is used instead.
|
|
285
|
+
```
|
|
286
|
+
|
|
278
287
|
A build compiles only the recipes whose subscriptions are switched on on this machine. Each one it skips gets a
|
|
279
288
|
line saying why:
|
|
280
289
|
|
|
@@ -711,7 +720,11 @@ sous sub ls
|
|
|
711
720
|
|
|
712
721
|
## namespace and recipe
|
|
713
722
|
|
|
714
|
-
Browse what the trusted repositories publish, offline
|
|
723
|
+
Browse what the trusted repositories publish, offline, and the project's own recipes, which are listed
|
|
724
|
+
under the reserved repository name `project` (see [Your project's own recipes](project-recipes.md)). For
|
|
725
|
+
those, `Latest` reads `working copy` and `Subscribed` reads `yes, its own`; a "Namespace from" column (in
|
|
726
|
+
`recipe show`, a field) says where each namespace was worked out from, and `recipe list` adds a note
|
|
727
|
+
explaining the repository `project`.
|
|
715
728
|
|
|
716
729
|
- `namespace list` lists every namespace and how much of it the project subscribes to.
|
|
717
730
|
- `namespace show REF` lists one namespace's recipes, with their latest and pinned versions.
|
|
@@ -730,8 +743,8 @@ sous recipe show omakase/house
|
|
|
730
743
|
Inspects and repairs the project's lockfile, `.sous/sous.lock.json`.
|
|
731
744
|
|
|
732
745
|
- `lock show` prints what the lockfile pins, and why each recipe is there.
|
|
733
|
-
- `lock rebuild` recomputes the lockfile from scratch from the subscriptions
|
|
734
|
-
for a lockfile damaged by a hand edit or a bad merge. A recipe whose index does not record what it depends on
|
|
746
|
+
- `lock rebuild` recomputes the lockfile from scratch from the subscriptions, the project's own recipes and the
|
|
747
|
+
cached indexes: the repair for a lockfile damaged by a hand edit or a bad merge. A recipe whose index does not record what it depends on
|
|
735
748
|
is downloaded to read its manifest; when one cannot be, nothing is written and the command fails, naming it.
|
|
736
749
|
`--dry-run` downloads nothing.
|
|
737
750
|
|
|
@@ -744,7 +757,8 @@ sous lock rebuild --dry-run
|
|
|
744
757
|
Inspects the questions the project's recipes ask, and the answers they hold; see
|
|
745
758
|
[Recipe variables](repositories-variables.md). `sous vars` alone is `vars list`.
|
|
746
759
|
|
|
747
|
-
- `vars list` lists every variable, with where its value came from.
|
|
760
|
+
- `vars list` lists every variable, with where its value came from. A variable of one of the project's own
|
|
761
|
+
recipes names it as "this project's own recipe (its working copy)" instead of a version and a repository.
|
|
748
762
|
- `vars show NAME` shows everything about one variable. `NAME` may also be an environment variable name that
|
|
749
763
|
answers it.
|
|
750
764
|
- `vars ask [NAME]` asks the questions and stores the answers in the `.sous` env files. `--save-shared` stores
|
|
@@ -101,6 +101,32 @@ sous for editor autocompletion; sous accepts and ignores the key.
|
|
|
101
101
|
?> Configs use `${var}` syntax. Template files use LiquidJS double-brace syntax instead; the two
|
|
102
102
|
are resolved at different stages and never mix.
|
|
103
103
|
|
|
104
|
+
### The project's own recipes
|
|
105
|
+
|
|
106
|
+
`projectRecipes` says where the project keeps recipes of its own, which every build reads from the
|
|
107
|
+
working tree with no subscription, release or lockfile entry. See
|
|
108
|
+
[Your project's own recipes](project-recipes.md).
|
|
109
|
+
|
|
110
|
+
- `projectRecipes.paths` (`string[] = [".sous/recipes/*"]`): folders or glob patterns, relative to
|
|
111
|
+
the project root. A matched folder holding a recipe manifest is a recipe; any other matched
|
|
112
|
+
folder is searched for recipe folders beneath it (never inside a recipe, `node_modules`, or a
|
|
113
|
+
folder whose name starts with a dot). `[]` turns the project's own recipes off.
|
|
114
|
+
- `projectRecipes.exclude` (`string[] = []`): recipes to leave out. Each entry is a namespace (every
|
|
115
|
+
recipe in it), a `namespace/recipe` key, a glob over keys, or a regular expression between two
|
|
116
|
+
slashes; the same forms as `recipes.memories.exclude`, plus bare namespaces.
|
|
117
|
+
|
|
118
|
+
```jsonc
|
|
119
|
+
{
|
|
120
|
+
"projectRecipes": {
|
|
121
|
+
"paths": [".sous/recipes/*", "tools/agent-recipes"],
|
|
122
|
+
"exclude": ["tooling/draft-*"]
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
```
|
|
126
|
+
|
|
127
|
+
The repository name `project` is reserved for these recipes, so a `repos.project` entry is an
|
|
128
|
+
error.
|
|
129
|
+
|
|
104
130
|
## Templates and the `.tpl.` convention
|
|
105
131
|
|
|
106
132
|
A file's own name decides whether sous renders it, every time. A file with `.tpl.` in its name is rendered
|
|
@@ -96,7 +96,9 @@ export async function checkJiraSignIn(sous) {
|
|
|
96
96
|
The rules for a recipe's handlers:
|
|
97
97
|
|
|
98
98
|
- **Trust.** A handler is code, so it runs only from a repository the project trusts, as a recipe's
|
|
99
|
-
plugin does. Nothing inside a repository runs before it is trusted.
|
|
99
|
+
plugin does. Nothing inside a repository runs before it is trusted. A handler of one of the project's
|
|
100
|
+
own recipes (see [Your project's own recipes](project-recipes.md)) runs with no trust question, since
|
|
101
|
+
it is code in the project itself.
|
|
100
102
|
- **One self-contained file each.** sous never runs `npm install` for a recipe, so a handler file cannot
|
|
101
103
|
import packages. Bundle anything it needs into the file.
|
|
102
104
|
- **Only subscribed recipes.** A recipe held only through `depends` is a library and contributes no
|
|
@@ -0,0 +1,193 @@
|
|
|
1
|
+
# Your Project's Own Recipes
|
|
2
|
+
|
|
3
|
+
A project can keep recipes of its own, inside its own repository, and use them without publishing
|
|
4
|
+
anything. Sous reads them from the working tree on every build, so an edit shows up on the next
|
|
5
|
+
`sous build`: no release, no version raise, no lockfile change.
|
|
6
|
+
|
|
7
|
+
Use one for agent configuration that belongs to this project alone (a review checklist, a deploy
|
|
8
|
+
skill, the hooks your team's tools need), or to try a recipe out before it goes to a shared
|
|
9
|
+
repository. A project recipe is an ordinary recipe: the same `sous.recipe.yaml`, the same
|
|
10
|
+
`contents`, variables, plugin and handlers as one you subscribe to (see
|
|
11
|
+
[Authoring a repository](repositories-authoring.md)). What differs is where it comes from.
|
|
12
|
+
|
|
13
|
+
## A first recipe
|
|
14
|
+
|
|
15
|
+
By default, sous looks for recipes under `.sous/recipes/`. Put a folder there holding a manifest
|
|
16
|
+
and the files it publishes:
|
|
17
|
+
|
|
18
|
+
```text
|
|
19
|
+
.sous/recipes/
|
|
20
|
+
tooling/
|
|
21
|
+
review-helpers/
|
|
22
|
+
sous.recipe.yaml
|
|
23
|
+
skills/
|
|
24
|
+
review-helpers/
|
|
25
|
+
SKILL.md
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
```yaml
|
|
29
|
+
# .sous/recipes/tooling/review-helpers/sous.recipe.yaml
|
|
30
|
+
formatVersion: 1
|
|
31
|
+
name: review-helpers
|
|
32
|
+
description: Our pre-merge review checklist.
|
|
33
|
+
contents:
|
|
34
|
+
- kind: skills
|
|
35
|
+
include: [skills/**]
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
Then build:
|
|
39
|
+
|
|
40
|
+
```bash
|
|
41
|
+
sous build
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
The skill is written to `.claude/skills/review-helpers/SKILL.md`, as a subscribed recipe's skill
|
|
45
|
+
would be. There was nothing to subscribe to: every recipe the project's recipe paths cover is in
|
|
46
|
+
use. The manifest needs no `namespace` and no `version`. The namespace, `tooling`, came from the
|
|
47
|
+
folder holding the recipe (see [Namespaces](#namespaces)), and a version is needed only to publish.
|
|
48
|
+
|
|
49
|
+
Sous lists project recipes under the reserved repository name `project`, so the full ref of this
|
|
50
|
+
one is `project:tooling/review-helpers`:
|
|
51
|
+
|
|
52
|
+
```text
|
|
53
|
+
$ sous recipe list
|
|
54
|
+
Recipe Repository Latest Pinned Subscribed What it is Namespace from
|
|
55
|
+
----------------------- ----------- ------------ ------ ------------ ------------------------------- ---------------------
|
|
56
|
+
tooling/review-helpers project working copy yes, its own Our pre-merge review checklist. the folder holding it
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
The table above is trimmed to the project's own recipe. The real list shows every recipe of every
|
|
60
|
+
repository the project trusts, with a note under it explaining the repository `project`.
|
|
61
|
+
|
|
62
|
+
`sous recipe show project:tooling/review-helpers` says it is used from its working copy, with no
|
|
63
|
+
lockfile entry, and where its namespace came from. `sous namespace list` shows the namespace with a
|
|
64
|
+
"Namespace from" column too.
|
|
65
|
+
|
|
66
|
+
## Where sous looks: `projectRecipes`
|
|
67
|
+
|
|
68
|
+
`projectRecipes.paths` (`string[] = [".sous/recipes/*"]`) lists the folders that hold the project's
|
|
69
|
+
own recipes, relative to the project root. Each entry is a folder or a glob pattern:
|
|
70
|
+
|
|
71
|
+
- A matched folder that holds a recipe manifest (`sous.recipe.yaml`, `.yml`, `.json` or `.jsonc`)
|
|
72
|
+
is a recipe.
|
|
73
|
+
- A matched folder that does not is searched for recipe folders beneath it, at any depth. The
|
|
74
|
+
search never looks inside a recipe, inside `node_modules`, or inside a folder whose name starts
|
|
75
|
+
with a dot.
|
|
76
|
+
- `[]` turns the project's own recipes off.
|
|
77
|
+
|
|
78
|
+
`projectRecipes.exclude` (`string[] = []`) leaves recipes out. Each entry is one of:
|
|
79
|
+
|
|
80
|
+
- a namespace, which leaves out every recipe in it: `tooling`;
|
|
81
|
+
- a `namespace/recipe` key: `tooling/review-helpers`;
|
|
82
|
+
- a glob over keys: `tooling/draft-*`;
|
|
83
|
+
- a regular expression between two slashes, matched against keys: `/^tooling\//`.
|
|
84
|
+
|
|
85
|
+
```jsonc
|
|
86
|
+
// .sous/sous.config.jsonc
|
|
87
|
+
{
|
|
88
|
+
"projectRecipes": {
|
|
89
|
+
"paths": [".sous/recipes/*", "tools/agent-recipes"],
|
|
90
|
+
"exclude": ["tooling/draft-*"]
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
```
|
|
94
|
+
|
|
95
|
+
The name `project` is reserved for these recipes. A `repos.project` entry is an error, which points
|
|
96
|
+
at `projectRecipes.paths: []` and `projectRecipes.exclude` as the way to turn them off.
|
|
97
|
+
|
|
98
|
+
## Namespaces
|
|
99
|
+
|
|
100
|
+
A recipe's namespace is the one its manifest names, when it names one. Otherwise sous works it out,
|
|
101
|
+
taking the first of these that gives a name:
|
|
102
|
+
|
|
103
|
+
1. The nearest `sous.namespace.yaml` above the recipe that sets a `name`.
|
|
104
|
+
2. The first folder under the path that found the recipe. With the path `.sous/recipes/*`, the
|
|
105
|
+
recipe in `.sous/recipes/a/b/review-helpers` gets `a`. A recipe directly under the path's folder,
|
|
106
|
+
such as `.sous/recipes/review-helpers`, gets nothing from this step.
|
|
107
|
+
3. The `name` in the project's sous config.
|
|
108
|
+
4. The `name` in the nearest `package.json`, without its npm scope: `@acme/widget` gives `widget`.
|
|
109
|
+
5. The repository name of the git `origin` remote.
|
|
110
|
+
6. The project folder's name.
|
|
111
|
+
|
|
112
|
+
Every search stops at the project root, and every name worked out this way is kebab-cased:
|
|
113
|
+
`Acme Tools` gives `acme-tools`. `recipe list`, `recipe show` and `namespace list` show which of
|
|
114
|
+
these each namespace came from.
|
|
115
|
+
|
|
116
|
+
A `sous.namespace.yaml` file names a namespace and describes it. It holds two optional fields:
|
|
117
|
+
|
|
118
|
+
```yaml
|
|
119
|
+
# .sous/recipes/tooling/sous.namespace.yaml
|
|
120
|
+
name: tooling
|
|
121
|
+
description: Helpers for the team's own tools.
|
|
122
|
+
```
|
|
123
|
+
|
|
124
|
+
`namespace list` shows its `description`. Two recipes that end up with the same
|
|
125
|
+
`namespace/recipe` key are a warning, and only the first (by folder) is used.
|
|
126
|
+
|
|
127
|
+
## When a subscribed recipe has the same key
|
|
128
|
+
|
|
129
|
+
A project recipe and a subscribed recipe may have the same key, for example when you copy a
|
|
130
|
+
published recipe into `.sous/recipes/` to change it. The project recipe is used. The subscribed one
|
|
131
|
+
keeps its pin in the lockfile but is not built, and every build says so:
|
|
132
|
+
|
|
133
|
+
```text
|
|
134
|
+
Skipped the subscribed sous-recipes:tooling/linting: this project's own recipe project:tooling/linting is used instead.
|
|
135
|
+
```
|
|
136
|
+
|
|
137
|
+
Delete the project recipe, or leave it out with `projectRecipes.exclude`, and the next build uses
|
|
138
|
+
the subscribed one again. A recipe that replaces one in the built-in `core` subscription does it
|
|
139
|
+
without the line.
|
|
140
|
+
|
|
141
|
+
## Depending on other repositories
|
|
142
|
+
|
|
143
|
+
A project recipe may list recipes from the project's trusted repositories under `depends` and
|
|
144
|
+
`subscribes`. Sous resolves and pins them as it does a subscription's, and records the project
|
|
145
|
+
recipe as their holder in the lockfile:
|
|
146
|
+
|
|
147
|
+
```yaml
|
|
148
|
+
# .sous/recipes/tooling/review-helpers/sous.recipe.yaml
|
|
149
|
+
formatVersion: 1
|
|
150
|
+
name: review-helpers
|
|
151
|
+
subscribes:
|
|
152
|
+
- workflow/task-files
|
|
153
|
+
```
|
|
154
|
+
|
|
155
|
+
```json
|
|
156
|
+
"workflow/task-files": { "kind": "subscribes", "repo": "sous-recipes", "version": "1.0.2",
|
|
157
|
+
"requestedBy": ["tooling/review-helpers"], "hash": "sha256-..." }
|
|
158
|
+
```
|
|
159
|
+
|
|
160
|
+
A bare `namespace/recipe` in a project recipe's manifest means one of the project's own recipes
|
|
161
|
+
first (as does anything written `project:namespace/recipe`), then the project's trusted
|
|
162
|
+
repositories, as for any ref. When a project recipe stops needing one, the next build removes it
|
|
163
|
+
from the lockfile. `sous lock rebuild` and `sous doctor` take project recipes into account.
|
|
164
|
+
|
|
165
|
+
## Code in a project recipe
|
|
166
|
+
|
|
167
|
+
A project recipe's [sous plugin](repositories-authoring.md#recipes-that-ship-sous-plugins) and its
|
|
168
|
+
[handlers](handlers.md) run with no trust question: they are files in your own repository, as any
|
|
169
|
+
script in it is. Review a change to them as you would review any code the project runs.
|
|
170
|
+
|
|
171
|
+
The config files a project recipe publishes may set the same keys as any recipe's (see
|
|
172
|
+
[recipes: what each content kind does](repositories-file-formats.md#recipes-what-each-content-kind-does)).
|
|
173
|
+
Its variables are asked like any recipe's; `sous vars list` names the recipe as "this project's own
|
|
174
|
+
recipe (its working copy)".
|
|
175
|
+
|
|
176
|
+
## Watch mode
|
|
177
|
+
|
|
178
|
+
`sous build --watch` rebuilds when anything changes under one of the project recipe paths,
|
|
179
|
+
including a new recipe folder. A glob path is watched from the folder before its first pattern
|
|
180
|
+
character, so `.sous/recipes/*` watches all of `.sous/recipes/`.
|
|
181
|
+
|
|
182
|
+
## Publishing
|
|
183
|
+
|
|
184
|
+
A project recipe is never published by being there. A project that is also a recipe repository
|
|
185
|
+
publishes the recipes its own `sous.repo.yaml` lists, through `sous repo release`; see
|
|
186
|
+
[Authoring a repository](repositories-authoring.md).
|
|
187
|
+
|
|
188
|
+
## Where to go next
|
|
189
|
+
|
|
190
|
+
- [Consuming recipes](repositories-consuming.md): subscribing to recipes others publish
|
|
191
|
+
- [Authoring a repository](repositories-authoring.md): the manifest, releasing and proposing
|
|
192
|
+
- [Repository file formats](repositories-file-formats.md): every manifest field and config key
|
|
193
|
+
- [Handlers](handlers.md): code a recipe runs during a build
|
|
@@ -117,6 +117,10 @@ relative to the recipe folder (and optional `exclude` patterns). Sous registers
|
|
|
117
117
|
[recipe manifest](repositories-file-formats.md#sousrecipeyaml-the-recipe-manifest) reference, and recipe
|
|
118
118
|
metadata is the source of truth for the version: never edit `sous.index.json` by hand.
|
|
119
119
|
|
|
120
|
+
?> To write a recipe for one project only, or to try one out before it is published, put it under that
|
|
121
|
+
project's `.sous/recipes/` instead: every build uses it from the working tree, with no release. See
|
|
122
|
+
[Your project's own recipes](project-recipes.md).
|
|
123
|
+
|
|
120
124
|
### Conditional contents, inline content and edits
|
|
121
125
|
|
|
122
126
|
`contents` is added to the subscriber's config, so any of its values may be a
|
|
@@ -197,7 +201,9 @@ plugin:
|
|
|
197
201
|
```
|
|
198
202
|
|
|
199
203
|
Nothing in a repository runs until the subscriber trusts the repository, so the trust question is the
|
|
200
|
-
gate for a recipe's plugin as for its other content.
|
|
204
|
+
gate for a recipe's plugin as for its other content. A project's own recipe (see
|
|
205
|
+
[Your project's own recipes](project-recipes.md)) asks no trust question: its plugin is code in the project
|
|
206
|
+
itself. Sous copies a recipe plugin's `.d.ts` file into the
|
|
201
207
|
subscriber's `.sous/types/`, so other plugins in that project see its types; a plugin with no `.d.ts`
|
|
202
208
|
still works. A recipe may also require plugins from npm, each with a version range:
|
|
203
209
|
|
|
@@ -587,5 +587,6 @@ variables. The command's help prints under the error, on stderr, and the error i
|
|
|
587
587
|
- [Recipe variables](repositories-variables.md): answers, the ladder, `sous vars`
|
|
588
588
|
- [Providers](repositories-providers.md): how a URL is matched, and reading a path on this machine
|
|
589
589
|
- [Authoring a repository](repositories-authoring.md): publishing recipes of your own
|
|
590
|
+
- [Your project's own recipes](project-recipes.md): recipes kept in the project, used without publishing
|
|
590
591
|
- [Repository file formats](repositories-file-formats.md): every schema
|
|
591
592
|
- [Command reference](commands.md): every command and flag
|
|
@@ -106,7 +106,7 @@ contents: # what a subscriber actually receives
|
|
|
106
106
|
| Field | Required | Notes |
|
|
107
107
|
|-------|----------|-------|
|
|
108
108
|
| `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 |
|
|
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. A project's own recipe that names none gets one worked out from where it is ([Namespaces](project-recipes.md#namespaces)) |
|
|
110
110
|
| `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
111
|
| `description` | no | Copied into the index at release time; shown by `sous recipe list` and `sous repo search` |
|
|
112
112
|
| `depends`, `subscribes` | no | Build dependencies and co-subscriptions; within either list, no entry may repeat |
|
|
@@ -342,6 +342,17 @@ At publish time: a `type: enum` variable must list its options under `validate.e
|
|
|
342
342
|
exceed `maxLength`, nor `min` exceed `max`; `default` and `example` must match the type and, for an enum, be
|
|
343
343
|
one of its options; `secret: true` with `scope: shared` is refused; the committed env file would leak it.
|
|
344
344
|
|
|
345
|
+
## `sous.namespace.yaml`: a namespace's name and description
|
|
346
|
+
|
|
347
|
+
Hand-written, in a folder among a project's own recipes (also `.yml`, `.json` or `.jsonc`). A recipe below it
|
|
348
|
+
whose manifest names no namespace belongs to the namespace it names; see
|
|
349
|
+
[Namespaces](project-recipes.md#namespaces).
|
|
350
|
+
|
|
351
|
+
```yaml
|
|
352
|
+
name: tooling # optional; lowercase kebab-case
|
|
353
|
+
description: Helpers for the team's own tools. # optional; shown by sous namespace list
|
|
354
|
+
```
|
|
355
|
+
|
|
345
356
|
## `sous.index.json`
|
|
346
357
|
|
|
347
358
|
Machine-written by `sous repo release` and committed beside the recipes it describes. Adding a repository
|
|
@@ -469,7 +480,7 @@ Machine-written, committed, and the reason a fresh clone restores with no prompt
|
|
|
469
480
|
|-------|-------|
|
|
470
481
|
| `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
482
|
| `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
|
|
483
|
+
| `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
484
|
| `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
485
|
|
|
475
486
|
A repository appears under two names on purpose: the key is the project's own short name, which every
|
|
@@ -567,17 +578,22 @@ recipes: # what each content kind a subscribed recipe publishe
|
|
|
567
578
|
memories: { first: ["communication/*"], exclude: ["tool-usage/automated-browser-tasks"] }
|
|
568
579
|
varMappings:
|
|
569
580
|
QA_SERVICE_TOKEN: workflow/qa-variables/qaServiceToken
|
|
581
|
+
projectRecipes: # the project's own recipes; both values are the defaults
|
|
582
|
+
paths: [".sous/recipes/*"]
|
|
583
|
+
exclude: []
|
|
570
584
|
```
|
|
571
585
|
|
|
572
586
|
| Key | Keyed by | Notes |
|
|
573
587
|
|-----|----------|-------|
|
|
574
|
-
| `repos` | the short name refs use | Adding a repository IS trusting it, and removing the entry withdraws that trust |
|
|
588
|
+
| `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
589
|
| `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
590
|
| `enabled: false` | either of the two above | The opt-out for the entries sous provides itself, the `sous-recipes` repository and the `core` subscription |
|
|
577
591
|
| `store` | fixed fields | Plain numbers, all optional; the values sous ships are defaults, not assumptions |
|
|
578
592
|
| `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) |
|
|
593
|
+
| `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
594
|
| `varMappings` | environment variable name | Binds one name to one recipe variable, written `namespace/recipe/variableName` with an optional `repo:` qualifier |
|
|
595
|
+
| `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) |
|
|
596
|
+
| `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
597
|
|
|
582
598
|
A repository's `url` may be a URL or an absolute path to one on this machine, read by the `local` provider
|
|
583
599
|
with identical trust. A hand-written entry is laid over sous's default field by field, so an entry holding
|
|
@@ -204,6 +204,11 @@ keeps a project from running what it has no use for and keeps unrelated recipes
|
|
|
204
204
|
everything in a trusted repository is already trusted. Nothing inside a repository runs, a sous
|
|
205
205
|
plugin included, until the repository is trusted.
|
|
206
206
|
|
|
207
|
+
The project's own recipes, under `.sous/recipes/` by default, are active whenever the project's
|
|
208
|
+
recipe paths cover them, with no subscription and no trust question: they are files in the
|
|
209
|
+
project's own repository. Sous lists them under the reserved repository name `project`. See
|
|
210
|
+
[Your project's own recipes](project-recipes.md).
|
|
211
|
+
|
|
207
212
|
A subscription can be switched off on one machine and left on for everyone else, for example from
|
|
208
213
|
a `conf.d` file of your own. A switched-off subscription is not built: its outputs are pruned, its
|
|
209
214
|
variables are not asked, and its pins stay in the committed lockfile. `sous subscription disable <ref>`
|
|
@@ -317,6 +322,7 @@ checks, so every build announces it loudly. See
|
|
|
317
322
|
| `.sous/conf.d/500-repos.jsonc` | the repositories the project trusts | yes |
|
|
318
323
|
| `.sous/conf.d/510-subscriptions.jsonc` | what the project subscribes to | yes |
|
|
319
324
|
| `.sous/conf.d/520-var-mappings.jsonc` | environment variable mapping records | yes |
|
|
325
|
+
| `.sous/recipes/` | the project's own recipes, by default (`projectRecipes.paths`) | yes |
|
|
320
326
|
| `.sous/sous.links.json` | this project's linked working copies | no |
|
|
321
327
|
| `.sous/repos/` | working copies cloned by `sous repo link` | no |
|
|
322
328
|
| `~/.sous/cache/` | the machine-wide recipe store | not in a project at all |
|
|
@@ -379,6 +385,7 @@ listed it), the error names it:
|
|
|
379
385
|
|
|
380
386
|
- [Quickstart](repositories-quickstart.md): an empty project to a compiled skill, in order
|
|
381
387
|
- [Consuming recipes](repositories-consuming.md): adding, subscribing, building, removing
|
|
388
|
+
- [Your project's own recipes](project-recipes.md): recipes kept in the project and used live
|
|
382
389
|
- [Authoring a repository](repositories-authoring.md): writing recipes, releasing, contributing
|
|
383
390
|
- [Recipe variables](repositories-variables.md): the resolution ladder and the question flow
|
|
384
391
|
- [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.1.
|
|
3
|
+
"version": "1.1.13",
|
|
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.1.
|
|
42
|
+
"@sous-io/sous-plugin-api": "1.1.13"
|
|
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.1.
|
|
50
|
-
"@sous-io/sous-
|
|
51
|
-
"@sous-io/sous-plugin-
|
|
52
|
-
"@sous-io/sous-plugin-
|
|
53
|
-
"@sous-io/sous-
|
|
54
|
-
"@sous-io/sous-plugin-
|
|
55
|
-
"@sous-io/sous-plugin-cli": "1.1.
|
|
56
|
-
"@sous-io/sous-plugin-config-files": "1.1.
|
|
57
|
-
"@sous-io/sous-plugin-expressions": "1.1.
|
|
58
|
-
"@sous-io/sous-plugin-formats": "1.1.
|
|
59
|
-
"@sous-io/sous-plugin-github": "1.1.
|
|
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-
|
|
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-
|
|
75
|
-
"@sous-io/sous-plugin-
|
|
76
|
-
"@sous-io/sous-plugin-
|
|
77
|
-
"@sous-io/sous-plugin-
|
|
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.1.13",
|
|
50
|
+
"@sous-io/sous-lib-core": "1.1.13",
|
|
51
|
+
"@sous-io/sous-plugin-build": "1.1.13",
|
|
52
|
+
"@sous-io/sous-plugin-claude-code": "1.1.13",
|
|
53
|
+
"@sous-io/sous-plugin-authoring": "1.1.13",
|
|
54
|
+
"@sous-io/sous-plugin-confd": "1.1.13",
|
|
55
|
+
"@sous-io/sous-plugin-cli": "1.1.13",
|
|
56
|
+
"@sous-io/sous-plugin-config-files": "1.1.13",
|
|
57
|
+
"@sous-io/sous-plugin-expressions": "1.1.13",
|
|
58
|
+
"@sous-io/sous-plugin-formats": "1.1.13",
|
|
59
|
+
"@sous-io/sous-plugin-github": "1.1.13",
|
|
60
|
+
"@sous-io/sous-plugin-compiler": "1.1.13",
|
|
61
|
+
"@sous-io/sous-plugin-gitlab": "1.1.13",
|
|
62
|
+
"@sous-io/sous-plugin-harnesses": "1.1.13",
|
|
63
|
+
"@sous-io/sous-plugin-init": "1.1.13",
|
|
64
|
+
"@sous-io/sous-plugin-host": "1.1.13",
|
|
65
|
+
"@sous-io/sous-plugin-git": "1.1.13",
|
|
66
|
+
"@sous-io/sous-plugin-inspect": "1.1.13",
|
|
67
|
+
"@sous-io/sous-plugin-liquid": "1.1.13",
|
|
68
|
+
"@sous-io/sous-plugin-memories": "1.1.13",
|
|
69
|
+
"@sous-io/sous-plugin-local": "1.1.13",
|
|
70
|
+
"@sous-io/sous-plugin-mcp": "1.1.13",
|
|
71
|
+
"@sous-io/sous-plugin-npm": "1.1.13",
|
|
72
|
+
"@sous-io/sous-plugin-pnpm": "1.1.13",
|
|
73
|
+
"@sous-io/sous-plugin-recipes": "1.1.13",
|
|
74
|
+
"@sous-io/sous-plugin-recipe-answers": "1.1.13",
|
|
75
|
+
"@sous-io/sous-plugin-refs": "1.1.13",
|
|
76
|
+
"@sous-io/sous-plugin-skills": "1.1.13",
|
|
77
|
+
"@sous-io/sous-plugin-update": "1.1.13",
|
|
78
|
+
"@sous-io/sous-plugin-variables": "1.1.13",
|
|
79
|
+
"@sous-io/sous-plugin-yarn": "1.1.13",
|
|
80
|
+
"@sous-io/sous-plugin-editor": "1.1.13",
|
|
81
|
+
"@sous-io/sous-plugin-doctor": "1.1.13",
|
|
82
|
+
"@sous-io/sous-plugin-handlers": "1.1.13",
|
|
83
|
+
"@sous-io/sous-plugin-migrations": "1.1.13",
|
|
84
|
+
"@sous-io/sous-plugin-codex": "1.1.13"
|
|
85
85
|
},
|
|
86
86
|
"engines": {
|
|
87
87
|
"node": ">=22"
|
|
@@ -120,6 +120,13 @@ skills, tool hooks, tool plugins (such as a Claude Code plugin) and Sous plugins
|
|
|
120
120
|
extends sous itself). A recipe held only through `depends` is a library: an active recipe may
|
|
121
121
|
include, call or import its files, but it adds nothing to the project itself.
|
|
122
122
|
|
|
123
|
+
The project's own recipes (under `.sous/recipes/` by default; `projectRecipes.paths` in the config
|
|
124
|
+
sets where) are active with no subscription and no trust question, since they are files in the
|
|
125
|
+
project itself. Every build reads them from the working tree, so an edit to one takes effect on the
|
|
126
|
+
next `sous build`, with no release. Sous lists them under the reserved repository name `project`
|
|
127
|
+
(`project:tooling/review-helpers`). Edit them in place: unlike a recipe in the store, they ARE the
|
|
128
|
+
source. YOU MUST load `about-sous-recipes` before creating or changing one.
|
|
129
|
+
|
|
123
130
|
A recipe's Sous plugin runs inside sous while sous builds the project's config, with the user's
|
|
124
131
|
own permissions, so it is code from that recipe's repository like any other. A recipe may also
|
|
125
132
|
require plugins from npm; `sous subscription add` refuses it while one is missing or outside
|
|
@@ -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
|
|
@@ -65,6 +65,30 @@ The fields in that example:
|
|
|
65
65
|
A file whose name contains `.tpl.` is rendered through LiquidJS and loses the `.tpl.`; every other
|
|
66
66
|
file is copied as it is. YOU MUST load `about-liquid-templates` before deciding which a file needs.
|
|
67
67
|
|
|
68
|
+
## The Project's Own Recipes
|
|
69
|
+
|
|
70
|
+
A project can keep recipes of its own, under `.sous/recipes/` by default (the config key
|
|
71
|
+
`projectRecipes.paths`, a list of folders or globs relative to the project root;
|
|
72
|
+
`projectRecipes.exclude` leaves some out). Every build uses them from the working tree, with no
|
|
73
|
+
subscription, release, version raise or lockfile entry, under the reserved repository name
|
|
74
|
+
`project`. Their manifests MAY leave out `namespace` and `version`.
|
|
75
|
+
|
|
76
|
+
- A namespace the manifest leaves out is worked out: the nearest `sous.namespace.yaml` above the
|
|
77
|
+
recipe that sets a `name`, else the first folder under the path that found it
|
|
78
|
+
(`.sous/recipes/tooling/review-helpers` gives `tooling`), else the project's own name (its sous
|
|
79
|
+
config's `name`, its `package.json`, its git `origin`, its folder). `sous recipe show
|
|
80
|
+
project:<namespace>/<recipe>` says which.
|
|
81
|
+
- A project recipe with the same key as a subscribed recipe replaces it, and every build says so.
|
|
82
|
+
- Its `depends` and `subscribes` may name recipes in the project's trusted repositories; sous pins
|
|
83
|
+
them in the lockfile with the project recipe as their holder. A bare `namespace/recipe` means a
|
|
84
|
+
project recipe first.
|
|
85
|
+
- Its plugin and handlers run with no trust question.
|
|
86
|
+
- It is published only when the project's own `sous.repo.yaml` lists it, through
|
|
87
|
+
`sous repo release`.
|
|
88
|
+
|
|
89
|
+
The rest of this skill applies to it as to any recipe, except "Raising the Version", which applies
|
|
90
|
+
only once it is published.
|
|
91
|
+
|
|
68
92
|
## Raising the Version
|
|
69
93
|
|
|
70
94
|
Every change to a published recipe raises its version, in the same change. Versions are semantic:
|
|
@@ -193,7 +217,7 @@ plugin:
|
|
|
193
217
|
```
|
|
194
218
|
|
|
195
219
|
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
|
|
220
|
+
repository or the project's own recipes: nothing inside a repository runs before it is trusted. A recipe held only through
|
|
197
221
|
`depends` is a library and adds nothing to the subscriber, so its plugin NEVER loads.
|
|
198
222
|
|
|
199
223
|
A recipe can also require plugins from npm, each with a version range:
|