@sous-io/sous 0.1.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.
Files changed (82) hide show
  1. package/LICENSE +201 -0
  2. package/README.md +154 -0
  3. package/bin/run.js +17 -0
  4. package/bin/xcv +5 -0
  5. package/package.json +81 -0
  6. package/shared-prompts/_partials/resume-task.md +51 -0
  7. package/shared-prompts/_partials/sub-agent-delegation.md +32 -0
  8. package/shared-prompts/_partials/update-task-file.md +52 -0
  9. package/shared-prompts/memories/automated-browser-tasks/INDEX.tpl.md +52 -0
  10. package/shared-prompts/skills/automated-browser-tasks/about-automated-browser-tasks/SKILL.tpl.md +102 -0
  11. package/shared-prompts/skills/automated-browser-tasks/about-automated-browser-tasks/examples/auth-failure-handling.mjs +81 -0
  12. package/shared-prompts/skills/automated-browser-tasks/about-automated-browser-tasks/examples/chained-workflow.mjs +126 -0
  13. package/shared-prompts/skills/automated-browser-tasks/about-automated-browser-tasks/examples/simple-fetch.mjs +92 -0
  14. package/shared-prompts/skills/automated-browser-tasks/about-automated-browser-tasks/references/architecture.md +61 -0
  15. package/shared-prompts/skills/automated-browser-tasks/about-automated-browser-tasks/references/auth-and-sessions.md +65 -0
  16. package/shared-prompts/skills/automated-browser-tasks/about-automated-browser-tasks/references/ctx-api.md +96 -0
  17. package/shared-prompts/skills/automated-browser-tasks/about-automated-browser-tasks/references/installation.md +104 -0
  18. package/shared-prompts/skills/automated-browser-tasks/about-automated-browser-tasks/references/script-conventions.md +243 -0
  19. package/shared-prompts/skills/automated-browser-tasks/about-automated-browser-tasks/scripts/chrome-state.mjs +148 -0
  20. package/shared-prompts/skills/automated-browser-tasks/about-automated-browser-tasks/scripts/debug.mjs +383 -0
  21. package/shared-prompts/skills/automated-browser-tasks/about-automated-browser-tasks/scripts/debug.spec.mjs +267 -0
  22. package/shared-prompts/skills/automated-browser-tasks/about-automated-browser-tasks/scripts/eslint.config.mjs +56 -0
  23. package/shared-prompts/skills/automated-browser-tasks/about-automated-browser-tasks/scripts/harness.mjs +169 -0
  24. package/shared-prompts/skills/automated-browser-tasks/about-automated-browser-tasks/scripts/keyring.mjs +59 -0
  25. package/shared-prompts/skills/automated-browser-tasks/about-automated-browser-tasks/scripts/logger.mjs +25 -0
  26. package/shared-prompts/skills/automated-browser-tasks/about-automated-browser-tasks/scripts/params.mjs +140 -0
  27. package/shared-prompts/skills/automated-browser-tasks/about-automated-browser-tasks/scripts/run.mjs +140 -0
  28. package/shared-prompts/skills/automated-browser-tasks/about-automated-browser-tasks/scripts/settings.tpl.mjs +1 -0
  29. package/shared-prompts/skills/automated-browser-tasks/about-automated-browser-tasks/scripts/utils.mjs +185 -0
  30. package/shared-prompts/skills/automated-browser-tasks/create-automated-browser-task/SKILL.tpl.md +52 -0
  31. package/shared-prompts/skills/automated-browser-tasks/running-automated-browser-tasks/SKILL.tpl.md +59 -0
  32. package/shared-prompts/skills/automated-browser-tasks/update-automated-browser-task/SKILL.tpl.md +47 -0
  33. package/shared-prompts/skills/control-flow/approve/SKILL.tpl.md +26 -0
  34. package/shared-prompts/skills/control-flow/opine/SKILL.tpl.md +58 -0
  35. package/shared-prompts/skills/control-flow/repeat/SKILL.tpl.md +27 -0
  36. package/shared-prompts/skills/control-flow/research/SKILL.tpl.md +34 -0
  37. package/shared-prompts/skills/sous-skills/about-agent-skills/SKILL.tpl.md +177 -0
  38. package/shared-prompts/skills/sous-skills/about-agent-skills/examples/about-something.md +45 -0
  39. package/shared-prompts/skills/sous-skills/about-agent-skills/examples/do-something.md +33 -0
  40. package/shared-prompts/skills/sous-skills/about-agent-skills/references/advanced-patterns.md +87 -0
  41. package/shared-prompts/skills/sous-skills/about-agent-skills/references/commands.md +46 -0
  42. package/shared-prompts/skills/sous-skills/about-agent-skills/references/frontmatter.md +25 -0
  43. package/shared-prompts/skills/sous-skills/about-agent-skills/references/substitutions.md +50 -0
  44. package/shared-prompts/skills/sous-skills/about-liquid-templates/SKILL.tpl.md +268 -0
  45. package/shared-prompts/skills/sous-skills/about-liquid-templates/references/liquid-filters.md +82 -0
  46. package/shared-prompts/skills/sous-skills/about-sous/SKILL.tpl.md +51 -0
  47. package/shared-prompts/skills/sous-skills/create-skill/SKILL.tpl.md +114 -0
  48. package/shared-prompts/skills/task-files/about-task-files/SKILL.tpl.md +122 -0
  49. package/shared-prompts/skills/task-files/continue-task-in-new-branch/SKILL.tpl.md +80 -0
  50. package/shared-prompts/skills/task-files/go/SKILL.tpl.md +14 -0
  51. package/shared-prompts/skills/task-files/resume-task/SKILL.tpl.md +13 -0
  52. package/shared-prompts/skills/task-files/start-task/SKILL.tpl.md +93 -0
  53. package/shared-prompts/skills/task-files/update/SKILL.tpl.md +14 -0
  54. package/shared-prompts/skills/task-files/update-task-file/SKILL.tpl.md +13 -0
  55. package/src/base-command.ts +163 -0
  56. package/src/commands/build.ts +196 -0
  57. package/src/commands/clear.ts +71 -0
  58. package/src/commands/compile.ts +95 -0
  59. package/src/commands/launch.ts +111 -0
  60. package/src/commands/prune.ts +48 -0
  61. package/src/lib/build-service.ts +258 -0
  62. package/src/lib/config-discovery.ts +199 -0
  63. package/src/lib/env-local.ts +195 -0
  64. package/src/lib/include-resolver.ts +146 -0
  65. package/src/lib/markdown-compiler.ts +580 -0
  66. package/src/lib/pid-service.ts +88 -0
  67. package/src/lib/settings.ts +695 -0
  68. package/src/lib/state.ts +135 -0
  69. package/src/lib/watch-service.ts +115 -0
  70. package/src/templating/filters/bullet-list.ts +9 -0
  71. package/src/templating/filters/index.ts +8 -0
  72. package/src/templating/init-liquid-engine.ts +82 -0
  73. package/src/templating/lib/glob-files.ts +74 -0
  74. package/src/templating/lib/import-export.ts +32 -0
  75. package/src/templating/lib/tag-args.ts +19 -0
  76. package/src/templating/tags/exportScalarVarsJs.ts +43 -0
  77. package/src/templating/tags/getFiles.ts +89 -0
  78. package/src/templating/tags/index.ts +14 -0
  79. package/src/templating/tags/listFiles.ts +54 -0
  80. package/src/templating/tags/showVars.ts +22 -0
  81. package/src/utils/formatting.ts +338 -0
  82. package/src/utils/prompts.ts +19 -0
package/LICENSE ADDED
@@ -0,0 +1,201 @@
1
+ Apache License
2
+ Version 2.0, January 2004
3
+ http://www.apache.org/licenses/
4
+
5
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
6
+
7
+ 1. Definitions.
8
+
9
+ "License" shall mean the terms and conditions for use, reproduction,
10
+ and distribution as defined by Sections 1 through 9 of this document.
11
+
12
+ "Licensor" shall mean the copyright owner or entity authorized by
13
+ the copyright owner that is granting the License.
14
+
15
+ "Legal Entity" shall mean the union of the acting entity and all
16
+ other entities that control, are controlled by, or are under common
17
+ control with that entity. For the purposes of this definition,
18
+ "control" means (i) the power, direct or indirect, to cause the
19
+ direction or management of such entity, whether by contract or
20
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
21
+ outstanding shares, or (iii) beneficial ownership of such entity.
22
+
23
+ "You" (or "Your") shall mean an individual or Legal Entity
24
+ exercising permissions granted by this License.
25
+
26
+ "Source" form shall mean the preferred form for making modifications,
27
+ including but not limited to software source code, documentation
28
+ source, and configuration files.
29
+
30
+ "Object" form shall mean any form resulting from mechanical
31
+ transformation or translation of a Source form, including but
32
+ not limited to compiled object code, generated documentation,
33
+ and conversions to other media types.
34
+
35
+ "Work" shall mean the work of authorship, whether in Source or
36
+ Object form, made available under the License, as indicated by a
37
+ copyright notice that is included in or attached to the work
38
+ (an example is provided in the Appendix below).
39
+
40
+ "Derivative Works" shall mean any work, whether in Source or Object
41
+ form, that is based on (or derived from) the Work and for which the
42
+ editorial revisions, annotations, elaborations, or other modifications
43
+ represent, as a whole, an original work of authorship. For the purposes
44
+ of this License, Derivative Works shall not include works that remain
45
+ separable from, or merely link (or bind by name) to the interfaces of,
46
+ the Work and Derivative Works thereof.
47
+
48
+ "Contribution" shall mean any work of authorship, including
49
+ the original version of the Work and any modifications or additions
50
+ to that Work or Derivative Works thereof, that is intentionally
51
+ submitted to Licensor for inclusion in the Work by the copyright owner
52
+ or by an individual or Legal Entity authorized to submit on behalf of
53
+ the copyright owner. For the purposes of this definition, "submitted"
54
+ means any form of electronic, verbal, or written communication sent
55
+ to the Licensor or its representatives, including but not limited to
56
+ communication on electronic mailing lists, source code control systems,
57
+ and issue tracking systems that are managed by, or on behalf of, the
58
+ Licensor for the purpose of discussing and improving the Work, but
59
+ excluding communication that is conspicuously marked or otherwise
60
+ designated in writing by the copyright owner as "Not a Contribution."
61
+
62
+ "Contributor" shall mean Licensor and any individual or Legal Entity
63
+ on behalf of whom a Contribution has been received by Licensor and
64
+ subsequently incorporated within the Work.
65
+
66
+ 2. Grant of Copyright License. Subject to the terms and conditions of
67
+ this License, each Contributor hereby grants to You a perpetual,
68
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
69
+ copyright license to reproduce, prepare Derivative Works of,
70
+ publicly display, publicly perform, sublicense, and distribute the
71
+ Work and such Derivative Works in Source or Object form.
72
+
73
+ 3. Grant of Patent License. Subject to the terms and conditions of
74
+ this License, each Contributor hereby grants to You a perpetual,
75
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
76
+ (except as stated in this section) patent license to make, have made,
77
+ use, offer to sell, sell, import, and otherwise transfer the Work,
78
+ where such license applies only to those patent claims licensable
79
+ by such Contributor that are necessarily infringed by their
80
+ Contribution(s) alone or by combination of their Contribution(s)
81
+ with the Work to which such Contribution(s) was submitted. If You
82
+ institute patent litigation against any entity (including a
83
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
84
+ or a Contribution incorporated within the Work constitutes direct
85
+ or contributory patent infringement, then any patent licenses
86
+ granted to You under this License for that Work shall terminate
87
+ as of the date such litigation is filed.
88
+
89
+ 4. Redistribution. You may reproduce and distribute copies of the
90
+ Work or Derivative Works thereof in any medium, with or without
91
+ modifications, and in Source or Object form, provided that You
92
+ meet the following conditions:
93
+
94
+ (a) You must give any other recipients of the Work or
95
+ Derivative Works a copy of this License; and
96
+
97
+ (b) You must cause any modified files to carry prominent notices
98
+ stating that You changed the files; and
99
+
100
+ (c) You must retain, in the Source form of any Derivative Works
101
+ that You distribute, all copyright, patent, trademark, and
102
+ attribution notices from the Source form of the Work,
103
+ excluding those notices that do not pertain to any part of
104
+ the Derivative Works; and
105
+
106
+ (d) If the Work includes a "NOTICE" text file as part of its
107
+ distribution, then any Derivative Works that You distribute must
108
+ include a readable copy of the attribution notices contained
109
+ within such NOTICE file, excluding those notices that do not
110
+ pertain to any part of the Derivative Works, in at least one
111
+ of the following places: within a NOTICE text file distributed
112
+ as part of the Derivative Works; within the Source form or
113
+ documentation, if provided along with the Derivative Works; or,
114
+ within a display generated by the Derivative Works, if and
115
+ wherever such third-party notices normally appear. The contents
116
+ of the NOTICE file are for informational purposes only and
117
+ do not modify the License. You may add Your own attribution
118
+ notices within Derivative Works that You distribute, alongside
119
+ or as an addendum to the NOTICE text from the Work, provided
120
+ that such additional attribution notices cannot be construed
121
+ as modifying the License.
122
+
123
+ You may add Your own copyright statement to Your modifications and
124
+ may provide additional or different license terms and conditions
125
+ for use, reproduction, or distribution of Your modifications, or
126
+ for any such Derivative Works as a whole, provided Your use,
127
+ reproduction, and distribution of the Work otherwise complies with
128
+ the conditions stated in this License.
129
+
130
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
131
+ any Contribution intentionally submitted for inclusion in the Work
132
+ by You to the Licensor shall be under the terms and conditions of
133
+ this License, without any additional terms or conditions.
134
+ Notwithstanding the above, nothing herein shall supersede or modify
135
+ the terms of any separate license agreement you may have executed
136
+ with Licensor regarding such Contributions.
137
+
138
+ 6. Trademarks. This License does not grant permission to use the trade
139
+ names, trademarks, service marks, or product names of the Licensor,
140
+ except as required for reasonable and customary use in describing the
141
+ origin of the Work and reproducing the content of the NOTICE file.
142
+
143
+ 7. Disclaimer of Warranty. Unless required by applicable law or
144
+ agreed to in writing, Licensor provides the Work (and each
145
+ Contributor provides its Contributions) on an "AS IS" BASIS,
146
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
147
+ implied, including, without limitation, any warranties or conditions
148
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
149
+ PARTICULAR PURPOSE. You are solely responsible for determining the
150
+ appropriateness of using or redistributing the Work and assume any
151
+ risks associated with Your exercise of permissions under this License.
152
+
153
+ 8. Limitation of Liability. In no event and under no legal theory,
154
+ whether in tort (including negligence), contract, or otherwise,
155
+ unless required by applicable law (such as deliberate and grossly
156
+ negligent acts) or agreed to in writing, shall any Contributor be
157
+ liable to You for damages, including any direct, indirect, special,
158
+ incidental, or consequential damages of any character arising as a
159
+ result of this License or out of the use or inability to use the
160
+ Work (including but not limited to damages for loss of goodwill,
161
+ work stoppage, computer failure or malfunction, or any and all
162
+ other commercial damages or losses), even if such Contributor
163
+ has been advised of the possibility of such damages.
164
+
165
+ 9. Accepting Warranty or Additional Liability. While redistributing
166
+ the Work or Derivative Works thereof, You may choose to offer,
167
+ and charge a fee for, acceptance of support, warranty, indemnity,
168
+ or other liability obligations and/or rights consistent with this
169
+ License. However, in accepting such obligations, You may act only
170
+ on Your own behalf and on Your sole responsibility, not on behalf
171
+ of any other Contributor, and only if You agree to indemnify,
172
+ defend, and hold each Contributor harmless for any liability
173
+ incurred by, or claims asserted against, such Contributor by reason
174
+ of your accepting any such warranty or additional liability.
175
+
176
+ END OF TERMS AND CONDITIONS
177
+
178
+ APPENDIX: How to apply the Apache License to your work.
179
+
180
+ To apply the Apache License to your work, attach the following
181
+ boilerplate notice, with the fields enclosed by brackets "[]"
182
+ replaced with your own identifying information. (Don't include
183
+ the brackets!) The text should be enclosed in the appropriate
184
+ comment syntax for the file format. We also recommend that a
185
+ file or class name and description of purpose be included on the
186
+ same "printed page" as the copyright notice for easier
187
+ identification within third-party archives.
188
+
189
+ Copyright 2026 Luke Chavers
190
+
191
+ Licensed under the Apache License, Version 2.0 (the "License");
192
+ you may not use this file except in compliance with the License.
193
+ You may obtain a copy of the License at
194
+
195
+ http://www.apache.org/licenses/LICENSE-2.0
196
+
197
+ Unless required by applicable law or agreed to in writing, software
198
+ distributed under the License is distributed on an "AS IS" BASIS,
199
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
200
+ See the License for the specific language governing permissions and
201
+ limitations under the License.
package/README.md ADDED
@@ -0,0 +1,154 @@
1
+ # sous
2
+
3
+ sous compiles AI coding agent configuration from templates. You write skills, memories, and
4
+ instructions once as LiquidJS templates in layered sources, then sous renders them into the
5
+ formats agents actually read: `.claude/` plus `CLAUDE.md` for Claude Code, `.codex/` plus
6
+ `AGENTS.md` for Codex. The CLI binary is named `xcv`.
7
+
8
+ ## Why
9
+
10
+ - Share one set of agent configs across every project you work in, and with teammates.
11
+ - Write a rule once as a template with variables; each project gets its own rendered copy.
12
+ - Compile the same source to more than one agent's format.
13
+ - Keep machine-specific values (absolute paths, tokens) in an untracked env file, out of git,
14
+ with shared team defaults in a committed one.
15
+
16
+ ## Quickstart
17
+
18
+ Install the CLI:
19
+
20
+ ```bash
21
+ git clone git@github.com:sous-io/sous.git
22
+ cd sous
23
+ npm install
24
+ npm link
25
+ ```
26
+
27
+ Then set up a project. A project needs a `.sous/` directory holding a config file, named
28
+ `sous.config.js`, `sous.config.mjs`, or `sous.config.json`:
29
+
30
+ ```bash
31
+ cd /path/to/your/project
32
+ mkdir .sous
33
+ $EDITOR .sous/sous.config.js
34
+ ```
35
+
36
+ A config that compiles one file:
37
+
38
+ ```js
39
+ export const config = {
40
+ projects: {
41
+ myproject: {
42
+ name: "My Project",
43
+ _vars: { projectRoot: "${sousDir}/.." },
44
+ compilation: {
45
+ targets: [
46
+ {
47
+ entryPoint: "${sousDir}/AGENTS.md",
48
+ outputs: [{ destinationFile: "${projectRoot}/CLAUDE.md" }],
49
+ },
50
+ ],
51
+ },
52
+ },
53
+ },
54
+ };
55
+ ```
56
+
57
+ `${sousDir}` is the `.sous/` directory sous found, so a config can name paths relative to
58
+ itself without hardcoding anything machine-specific. With a single project defined you do
59
+ not need `defaultProject`; sous uses the only one. Then build:
60
+
61
+ ```bash
62
+ xcv build
63
+ ```
64
+
65
+ `xcv build` compiles every configured target and prunes outputs that are no longer in the
66
+ config. Config discovery walks up from the current directory until it finds a `.sous/`
67
+ directory holding a config, so you can run it from anywhere inside the project. Pass
68
+ `--config <path>` to point at one explicitly instead.
69
+
70
+ Values reach the config through its top-level `_env` block, which maps a config variable
71
+ to an environment variable. Both env files use `KEY=value` lines and are loaded before
72
+ anything resolves. There are two layers:
73
+
74
+ - `.sous/.env` is committed. Put shared team defaults here, never secrets.
75
+ - `.sous/.env.local` is gitignored. Put machine-specific values and secrets here.
76
+
77
+ Precedence, highest first: your shell environment, then `.env.local`, then `.env`. So
78
+ `FOO=bar xcv build` beats both files, and `.env.local` beats `.env` per key. This repo
79
+ ships `.sous/.env.local.example` documenting the layer.
80
+
81
+ Useful commands:
82
+
83
+ | Command | What it does |
84
+ |---|---|
85
+ | `xcv build` | Compile, then prune stale outputs |
86
+ | `xcv build --watch` | Rebuild on source changes |
87
+ | `xcv compile` | Compile only |
88
+ | `xcv prune` | Remove outputs no longer in the config |
89
+ | `xcv clear` | Delete every file sous wrote for the project |
90
+ | `xcv launch claude` | Build, then start the agent |
91
+
92
+ ## How it works
93
+
94
+ Sources are markdown files. A file with `.tpl.` in its name is rendered through LiquidJS and
95
+ the `.tpl.` is dropped from the output name (`skill.tpl.md` becomes `skill.md`). Files without
96
+ `.tpl.` are copied verbatim. Any line of the form `@path/to/file.md` pulls in another file, so
97
+ one instruction block can be composed into several outputs.
98
+
99
+ Config lists targets. Each target names an entry point or a glob, plus one or more outputs, and
100
+ each level can define variables:
101
+
102
+ ```js
103
+ // One entry point to one file.
104
+ {
105
+ entryPoint: "${sousDir}/memory/MEMORY.root.tpl.md",
106
+ outputs: [{ destinationFile: "${projectRoot}/CLAUDE.md" }],
107
+ }
108
+
109
+ // One glob to a directory, mirroring the source tree under it.
110
+ {
111
+ entryGlob: "${sousDir}/skills/**/*",
112
+ outputs: [{ destinationDir: "${projectRoot}/.claude/skills" }],
113
+ }
114
+ ```
115
+
116
+ Variables resolve later-wins across scopes: auto-injected, env, root, project, compilation,
117
+ target, output. Templates read them as `{{ varName }}`; config files reference them as `${varName}`.
118
+ The auto-injected ones include `${sousDir}` and `${sousConfigPath}` for the discovered
119
+ config, and `${sousTemplatePath}` for the template being rendered.
120
+
121
+ Sources come in three tiers, each able to build on the one above it:
122
+
123
+ 1. **Built-in** shared prompts that ship with sous, covering skill authoring, templating, and
124
+ the sous conventions themselves.
125
+ 2. **Team-shared**, a repo your team owns, holding the configs everyone should get.
126
+ 3. **Per-project**, the project's own `.sous/` directory, for anything specific to it.
127
+
128
+ The built-in tier is reachable without knowing where sous is installed. `@include` paths
129
+ accept aliases, and two are always defined: `~sous-shared` for the shared prompts that ship
130
+ with sous, and `~project` for the project root. So `@~sous-shared/_partials/sub-agent-delegation.md`
131
+ composes a built-in block into your own instruction file, and an `entryGlob` can point at a
132
+ built-in skill bundle to compile it into your project. Define your own aliases with an
133
+ `_aliases` block to do the same for a team-shared repo.
134
+
135
+ Sous records every file and directory it writes in a state file, `.sous/sous.state.json` by
136
+ default, which is what lets `prune` and `clear` clean up precisely instead of guessing.
137
+
138
+ ## Platform support
139
+
140
+ - **Ubuntu** is where sous is developed and tested.
141
+ - **macOS** should work for the core CLI, but is not tested yet. Reports welcome.
142
+ - **Windows** is not supported.
143
+ - The browser-automation skill bundle is **Linux only**. It depends on Linux Chrome paths and
144
+ the GNOME keyring.
145
+
146
+ Node 22 is required; the version is pinned in `.nvmrc`.
147
+
148
+ ## Contributing
149
+
150
+ See [CONTRIBUTING.md](CONTRIBUTING.md). Note the licensing terms for contributions.
151
+
152
+ ## License
153
+
154
+ Apache License 2.0. See [LICENSE](LICENSE).
package/bin/run.js ADDED
@@ -0,0 +1,17 @@
1
+ #!/usr/bin/env node
2
+ import { register } from "tsx/esm/api";
3
+
4
+ // The CLI runs from TypeScript source; register tsx before oclif dynamically
5
+ // imports any command module. Resolving "tsx" from this file (rather than a
6
+ // $PKG_ROOT/node_modules path) works in every install layout: repo clone,
7
+ // global install (nested deps), and local/npx installs (hoisted deps).
8
+ register();
9
+
10
+ const { execute, settings } = await import("@oclif/core");
11
+
12
+ // tsx (above) already makes .ts imports work, so oclif's own auto-transpile
13
+ // machinery is redundant; leaving it on makes every downstream run warn that
14
+ // the (unshipped) typescript devDependency is missing.
15
+ settings.enableAutoTranspile = false;
16
+
17
+ await execute({ development: true, dir: import.meta.url });
package/bin/xcv ADDED
@@ -0,0 +1,5 @@
1
+ #!/usr/bin/env bash
2
+
3
+ # Dev convenience wrapper used by the repo's npm scripts (`./bin/xcv ...`).
4
+ # The published bin is run.js itself, which handles tsx registration.
5
+ exec node "$(cd -P "$(dirname "${BASH_SOURCE[0]}")" > /dev/null && pwd)/run.js" "$@"
package/package.json ADDED
@@ -0,0 +1,81 @@
1
+ {
2
+ "name": "@sous-io/sous",
3
+ "version": "0.1.0",
4
+ "description": "Compiles AI coding agent configuration (CLAUDE.md, skills, memories) from LiquidJS templates",
5
+ "type": "module",
6
+ "license": "Apache-2.0",
7
+ "author": "Luke Chavers",
8
+ "repository": {
9
+ "type": "git",
10
+ "url": "git+https://github.com/sous-io/sous.git"
11
+ },
12
+ "homepage": "https://sous-io.github.io/sous",
13
+ "bugs": "https://github.com/sous-io/sous/issues",
14
+ "keywords": [
15
+ "cli",
16
+ "ai",
17
+ "agents",
18
+ "claude",
19
+ "claude-code",
20
+ "codex",
21
+ "prompts",
22
+ "skills",
23
+ "templates",
24
+ "liquidjs"
25
+ ],
26
+ "publishConfig": {
27
+ "access": "public"
28
+ },
29
+ "bin": {
30
+ "xcv": "./bin/run.js"
31
+ },
32
+ "files": [
33
+ "bin",
34
+ "src",
35
+ "!src/**/*.spec.ts",
36
+ "!src/test",
37
+ "shared-prompts"
38
+ ],
39
+ "scripts": {
40
+ "build": "tsc",
41
+ "sous:build": "./bin/xcv build --rebuild",
42
+ "claude": "./bin/xcv launch claude",
43
+ "clean": "rm -rf dist",
44
+ "test": "vitest run",
45
+ "test:watch": "vitest",
46
+ "test:coverage": "vitest run --coverage",
47
+ "test:e2e": "vitest run --config vitest.e2e.config.ts"
48
+ },
49
+ "dependencies": {
50
+ "@inquirer/prompts": "^8.3.2",
51
+ "@oclif/color": "^1.0.13",
52
+ "@oclif/core": "^4",
53
+ "chokidar": "^5.0.0",
54
+ "glob": "^13.0.6",
55
+ "liquidjs": "^10.25.0",
56
+ "minimatch": "^10.2.4",
57
+ "tiktoken": "^1.0.22",
58
+ "tsx": "^4"
59
+ },
60
+ "devDependencies": {
61
+ "@types/glob": "^8.1.0",
62
+ "@types/node": "^22",
63
+ "@vitest/coverage-v8": "^4.1.0",
64
+ "memfs": "^4.56.11",
65
+ "typescript": "^5",
66
+ "vitest": "^4.1.0"
67
+ },
68
+ "oclif": {
69
+ "bin": "xcv",
70
+ "dirname": "xcv",
71
+ "flexibleTaxonomy": true,
72
+ "topicSeparator": " ",
73
+ "commands": {
74
+ "strategy": "pattern",
75
+ "target": "./src/commands"
76
+ }
77
+ },
78
+ "engines": {
79
+ "node": ">=22"
80
+ }
81
+ }
@@ -0,0 +1,51 @@
1
+ The agent performing this work MUST load `about-task-files`.
2
+
3
+ ## Delegation
4
+
5
+ Per the sub-agent delegation pattern (`~sous-shared/_partials/sub-agent-delegation.md`), the
6
+ orchestrator delegates steps 1 and 2 (find and read the task file, extract status) to a background
7
+ sub-agent, which reports back a concise summary. Step 3 is orchestrator-only.
8
+
9
+ ## Steps
10
+
11
+ ### 1. Find the Task File
12
+
13
+ Run `git status` to get the current branch name. Look for the task file at:
14
+ ```
15
+ {{ taskFileRoot }}/[branch-name].md
16
+ ```
17
+
18
+ If not found, run a fresh `git status` to confirm the branch before concluding the file doesn't exist. If it truly doesn't exist, report that back; the orchestrator asks the user whether to create one (load `start-task`).
19
+
20
+ ### 2. Read and Analyze
21
+
22
+ Read the entire task file. Identify:
23
+ - Overall objective
24
+ - What has been completed (checked items, status markers)
25
+ - What remains (unchecked items, TODOs)
26
+ - Any blockers or pending issues
27
+ - Recent decisions and learnings
28
+
29
+ ### 3. Present Status and Next Steps
30
+
31
+ Orchestrator-only; sub-agents cannot talk to the user. A sub-agent doing steps 1 and 2 returns its
32
+ summary to the orchestrator, which presents:
33
+
34
+ ```
35
+ Based on the task file, here's where we are:
36
+
37
+ **Current Status:**
38
+ [Brief summary of completed phases and where work stopped]
39
+
40
+ **Recommended Next Steps:**
41
+ 1. [First thing to do]
42
+ 2. [Second thing]
43
+ 3. [etc.]
44
+
45
+ Would you like me to:
46
+ - A) Proceed with these next steps?
47
+ - B) Focus on something specific?
48
+ - C) Something else?
49
+ ```
50
+
51
+ **Do not begin work until the user confirms.** If the task file has contradictions or outdated information, point them out before proceeding.
@@ -0,0 +1,32 @@
1
+ # Sub-Agent Delegation
2
+
3
+ Several shared skills say work is "delegated" and cite the sub-agent delegation pattern. This is
4
+ that pattern. Include this partial in a project's core memory (`@~sous-shared/_partials/sub-agent-delegation.md`)
5
+ if the project wants the agent to follow it by default.
6
+
7
+ The main chat session is an **orchestrator**: it does the reasoning, the decisions, and all
8
+ interaction with the user, and it delegates execution to sub-agents. The orchestrator usually runs
9
+ an expensive model, so pushing execution down to cheaper sub-agents cuts cost and, because
10
+ sub-agents run in parallel, finishes sooner.
11
+
12
+ **Orchestrator-only:** planning, decisions, anything that needs the user (questions, approvals,
13
+ drafts), and very small actions where delegating costs more than doing it (a quick file read, a
14
+ one-line edit).
15
+
16
+ **Delegated:** anything with real work in it, including research, code changes, doc and task file
17
+ writing, and multi-step lookups.
18
+
19
+ **Rules:**
20
+
21
+ - Run sub-agents in the background and in parallel by default; batch independent dispatches into one
22
+ message. Go synchronous only when the result blocks the very next step.
23
+ - Prompts must be self-contained. Sub-agents start with fresh context and cannot see the
24
+ conversation, so state every fact, path, ID, and decision they need, and name the skills they
25
+ should load. Anything the sub-agent can gather itself (branch name, commits, test output) should
26
+ be left to it.
27
+ - Sub-agents cannot talk to the user. Questions and user-facing messages go back to the orchestrator
28
+ to relay.
29
+ - Every sub-agent reports a concise summary of what it did or found, not a file dump.
30
+ - The orchestrator spot-checks load-bearing results (task files, code diffs, outward-facing writes)
31
+ in a cheap, targeted way; it does not re-read everything.
32
+ - Never fabricate or predict a pending sub-agent's result. Wait for it.
@@ -0,0 +1,52 @@
1
+ The agent performing this work MUST load `about-task-files`.
2
+
3
+ **CRITICAL: Do NOTHING ELSE. Update the task file IMMEDIATELY. Use as few edits as possible.**
4
+
5
+ ## Delegation
6
+
7
+ Per the sub-agent delegation pattern (`~sous-shared/_partials/sub-agent-delegation.md`), writing the
8
+ task file is delegated work. The orchestrator does not edit the file itself; it hands an Opus
9
+ sub-agent everything below in one self-contained prompt:
10
+
11
+ - The task file path (branch name), or instructions to derive it from `git status`.
12
+ - The facts and decisions to record. Compiling these is orchestrator-only; sub-agents cannot see
13
+ this conversation, so anything known only from the conversation must be stated in the prompt.
14
+ - Anything the sub-agent can gather itself (commit list, changed files, test/build output), which it
15
+ should collect rather than have the orchestrator paste in.
16
+
17
+ The sub-agent loads `about-task-files`, edits the file, and reports back a concise summary of what
18
+ it wrote. The orchestrator spot-checks with a targeted diff, not a full re-read.
19
+
20
+ ## What to Include
21
+
22
+ Update the task file with all of the following:
23
+
24
+ 1. **Progress since last update** — what was completed, what is in progress, current status
25
+ 2. **Decisions made** — technical approach chosen, alternatives considered and rejected
26
+ 3. **Remaining work** — everything still needed, prioritized next steps, known dependencies
27
+ 4. **Pending issues** — unresolved problems, blockers, questions needing answers
28
+ 5. **Learnings** — insights, patterns discovered, things to remember
29
+ 6. **Commits made** — commit IDs and brief description of each
30
+ 7. **Testing URLs** — web URLs currently in use, database query results referenced
31
+ 8. **Files changed** — absolute paths with line numbers, what was done and why
32
+ 9. **Unresolved errors** — test failures, build errors, TypeScript errors — with paths and line numbers
33
+
34
+ ## Checklist Management
35
+
36
+ - Mark completed items `[x]`
37
+ - Add `[ ]` for newly identified tasks
38
+ - Remove or condense sections no longer relevant
39
+
40
+ ## Consistency Check
41
+
42
+ Scan the existing file for contradictions or outdated information. Correct before saving.
43
+
44
+ ## After Update
45
+
46
+ **STOP immediately.** Do not:
47
+ - Continue working on the task
48
+ - Start new work
49
+ - Make additional changes
50
+
51
+ A sub-agent reports what it wrote and stops. The orchestrator then waits; the user will end the
52
+ session and start a new one.
@@ -0,0 +1,52 @@
1
+ # Automated Browser Tasks
2
+
3
+ This project can drive a real web browser to accomplish tasks — logging in as
4
+ you (using your existing Chrome session), navigating, and extracting data —
5
+ **headlessly**, without opening a visible browser or interrupting your work.
6
+
7
+ **When a task needs a browser and no API or MCP server can do it, this is the
8
+ default path.** Do not tell the user to click through a browser manually if it
9
+ can be scripted.
10
+
11
+ **Running a non-mutating task is normal workflow — do it without asking.** A task
12
+ that only navigates and reads (extracts data; submits nothing, changes no state,
13
+ sends nothing outward) is investigation, the same category as reading a file or
14
+ running a query. Running an existing read-only task is not a "manual action" and
15
+ not "outward-facing," so it does not need the user's permission — especially while
16
+ investigating. Just run it and report what it found; pausing to ask first only
17
+ wastes a round trip on a no-risk action. (Creating or modifying a task script, or
18
+ running a task that mutates external state, is a separate case — apply normal
19
+ judgment there.)
20
+
21
+ The agent performing the work MUST load the `about-automated-browser-tasks` skill
22
+ before writing, running, or modifying any of these tasks. It explains the `ctx`
23
+ API, the auth model, and the scriptwriting conventions. The action skills
24
+ `create-automated-browser-task`, `update-automated-browser-task`, and
25
+ `running-automated-browser-tasks` cover those specific operations (including
26
+ exact runner invocation).
27
+
28
+ Browser runs are slow and multi-step, so they are delegated to a background
29
+ sub-agent, per the sub-agent delegation pattern
30
+ (`~sous-shared/_partials/sub-agent-delegation.md`). The sub-agent loads the skills
31
+ itself and reports the result plus any link or actionable message.
32
+
33
+ ## Available Tasks
34
+
35
+ {% getFiles browserTasks root=browserAutomationScriptsDir include="*.mjs" import="meta" -%}
36
+ {% if browserTasks.size > 0 -%}
37
+ {%- for t in browserTasks %}
38
+ ### {{ t.meta.name }}
39
+
40
+ {{ t.meta.description }}
41
+
42
+ - Script: `{{ t.path }}`
43
+ {%- if t.meta.params %}
44
+ - Parameters:
45
+ {%- for p in t.meta.params %}
46
+ - `{{ p[0] }}` ({% if p[1].required %}required{% else %}optional{% if p[1].default %}, default: `{{ p[1].default }}`{% endif %}{% endif %}) — {{ p[1].description | split: ". " | first }}.
47
+ {%- endfor %}
48
+ {%- endif %}
49
+ {% endfor -%}
50
+ {% else -%}
51
+ _No automation tasks exist yet. Load `create-automated-browser-task` to add one._
52
+ {% endif %}