@mnbny/woof 0.1.0 → 0.1.1
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/README.md +42 -4
- package/cli/templates/add-draft.md +4 -3
- package/cli/templates/add-result.md +1 -0
- package/cli/templates/edit-draft.md +4 -2
- package/cli/templates/export-result.md +2 -0
- package/cli/templates/import-decision.md +3 -1
- package/cli/templates/import-private.md +6 -0
- package/cli/templates/private-value.md +1 -0
- package/cli/templates/private-warning.md +1 -0
- package/cli/woof.bundle.mjs +156 -154
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
<p align="center">Design tokens for your coding agent's instructions.</p>
|
|
3
3
|
|
|
4
4
|
<p align="center">
|
|
5
|
-
<img width="240" height="240" alt="image" src="https://github.com/user-attachments/assets/
|
|
5
|
+
<img width="240" height="240" alt="image" src="https://github.com/user-attachments/assets/2a079bf2-b98b-42a3-aea2-156798055599" />
|
|
6
6
|
</p>
|
|
7
7
|
|
|
8
8
|
My prompts, conventions, skills, and scripts were everywhere: copied between repos, stashed in ignored folders, slowly drifting apart. Every new project started the same way. Dig up the last agent file, copy it, fix the few lines that differ. All of it Markdown, and Markdown doesn't compose.
|
|
@@ -83,7 +83,7 @@ Edits, sharing, and repo setup work the same way. Your agent proposes, and you a
|
|
|
83
83
|
|
|
84
84
|
If you can commit to a repo, like `acme`, keep its woof configuration there, and Git shares it with your team. Client repos are another story. Your agent instructions don't always belong in someone else's codebase, but your coworkers on that client could still use them. So keep the configuration in your woof home instead, like `globex`, and share it as a file.
|
|
85
85
|
|
|
86
|
-
Ask your agent to export it. woof packs
|
|
86
|
+
Ask your agent to export it. woof packs the tokens and files `globex` needs into one zip:
|
|
87
87
|
|
|
88
88
|
<img src=".github/assets/readme/export.jpg" alt="you: share my globex setup with sam. agent: runs woof export --project globex, saves ~/.woof/exports/globex.woof.zip, and says to send it to Sam.">
|
|
89
89
|
|
|
@@ -93,6 +93,8 @@ On Sam's side, anything new comes straight in. Anything that differs from what S
|
|
|
93
93
|
|
|
94
94
|
Before it writes anything, woof saves a backup.
|
|
95
95
|
|
|
96
|
+
For values Sam should supply, like staging credentials, ask your agent to mark the token private before you share it. Sam gets a placeholder to fill in.
|
|
97
|
+
|
|
96
98
|
## Getting started
|
|
97
99
|
|
|
98
100
|
woof runs through npx, so there's nothing to install. You need Node.js 22.13+, 24, or 26+.
|
|
@@ -205,6 +207,20 @@ Set `$type` to `bash`, `node`, `tsx`, or `bun`, and `$exec` becomes the script.
|
|
|
205
207
|
|
|
206
208
|
The script runs in the repo root, and its output becomes the value. `$exec` can also be a file, like `"<root>/scripts/checks.sh"`, or a list of scripts that run in order and stop at the first failure.
|
|
207
209
|
|
|
210
|
+
### Private values
|
|
211
|
+
|
|
212
|
+
You might keep `globex`'s staging accounts in woof. Ask your agent to mark that token private before you share it with Sam. It adds `$private` to the token:
|
|
213
|
+
|
|
214
|
+
```json
|
|
215
|
+
{
|
|
216
|
+
"$type": "prompt",
|
|
217
|
+
"$exec": "user1:pass user2:pass",
|
|
218
|
+
"$private": true
|
|
219
|
+
}
|
|
220
|
+
```
|
|
221
|
+
|
|
222
|
+
You still get the real value locally. The export replaces it with `{{-woof:private-}}`. Sam can import the configuration and ask their agent to fill in their own value. Until then, woof warns whenever their agent uses the token.
|
|
223
|
+
|
|
208
224
|
### Projects
|
|
209
225
|
|
|
210
226
|
A project changes tokens for one codebase. It holds only what's different, and everything else comes from your shared tokens. A project lives in one of two places.
|
|
@@ -335,6 +351,7 @@ And `acme`'s repo config:
|
|
|
335
351
|
| `$exec` | A resource | Prompt text, script source, or a `<root>/` or `<repo>/` file. Scripts also take a list. |
|
|
336
352
|
| `$description` | A resource | Optional text for search |
|
|
337
353
|
| `$tags` | A resource | Optional list of strings for search |
|
|
354
|
+
| `$private` | A resource | Optional boolean. `true` replaces the content with `{{-woof:private-}}` on export. |
|
|
338
355
|
| `$projects` | Your shared file | Private projects by name: inline, or a `<root>/` path to the project's own file, like `initech` |
|
|
339
356
|
| `$metadata` | A private project | Optional `$basePaths` and `$worktreePaths` |
|
|
340
357
|
| `$basePaths` | `$metadata` | Paths that select the project, including everything below them |
|
|
@@ -350,6 +367,7 @@ And `acme`'s repo config:
|
|
|
350
367
|
- Shared tokens must resolve without a project. They can't reference project-only tokens or `<repo>` files.
|
|
351
368
|
- An override replaces the whole token, including its description and tags. A project can't replace a shared namespace with a token, or a token with a namespace.
|
|
352
369
|
- A missing reference or a cycle fails before any script runs. A token that references itself is a cycle.
|
|
370
|
+
- `{{-...-}}` is reserved for internal markers. Add and import remapping reject token addresses that produce this syntax, such as `-draft-`. Write `{{{{-woof:private-}}}}` to show the private marker literally.
|
|
353
371
|
- A checkout holds one repo config: `woof.config.json`, `.agents/woof.config.json`, or `.claude/woof.config.json`. Two different files fail.
|
|
354
372
|
- Every config file declares `"$schemaVersion": 2`. woof never upgrades a file on its own. When it asks for a migration, rerun the command with `--migrate`.
|
|
355
373
|
|
|
@@ -361,8 +379,8 @@ Your agent runs these as `npx @mnbny/woof <command>`. Add `--help` to any comman
|
|
|
361
379
|
| --- | --- | --- |
|
|
362
380
|
| `woof readme` | Prints this guide. Agents run it first. | — |
|
|
363
381
|
| `woof get [query…]` | Prints a token's value when the query is its exact path. Otherwise, searches. | `--search` to always search, `--project <name>` |
|
|
364
|
-
| `woof add [path]` | Adds a token | `--type`, `--content`, `--description`, `--tag`, and one of `--shared`, `--repo`, or `--project <name>` |
|
|
365
|
-
| `woof edit [path]` | Changes a token's content, description, or
|
|
382
|
+
| `woof add [path]` | Adds a token | `--type`, `--content`, `--description`, `--tag`, `--private`, and one of `--shared`, `--repo`, or `--project <name>` |
|
|
383
|
+
| `woof edit [path]` | Changes a token's content, description, tags, or privacy | `--content`, `--description`, `--tag`, `--private` or `--no-private`, `--shared` or `--override`, `--project <name>` |
|
|
366
384
|
| `woof init [location]` | Creates a repo config or a private project | `--repo`, or `--name <name>` with `--base-path` and `--worktree-path` |
|
|
367
385
|
| `woof projects` | Shows which project the current directory selects, and lists private projects | — |
|
|
368
386
|
| `woof explain [path]` | Traces how a token resolves, without running scripts | `--project <name>` |
|
|
@@ -377,6 +395,7 @@ Every command also takes `--agent` and `--migrate`. `woof --help` and `woof --ve
|
|
|
377
395
|
- `--content` takes text, the path of an existing file, or `-` to read standard input.
|
|
378
396
|
- `--tag`, `--base-path`, and `--worktree-path` repeat: `--tag git --tag commits`.
|
|
379
397
|
- In `edit`, an empty `--description` or `--tag` removes it. `--shared` changes a shared token for every project, and `--override` overrides it in the selected project only.
|
|
398
|
+
- `--private` on `add` or `edit` sets `$private: true`. `edit --no-private` removes the field. Other edits preserve the privacy setting. Disabling privacy alone on an already public definition makes no change.
|
|
380
399
|
- A qualified address, such as `'$projects.globex.git.commit'`, selects a project the same way `--project globex` does. Quote it so the shell leaves `$projects` alone.
|
|
381
400
|
|
|
382
401
|
#### Agent mode and exit status
|
|
@@ -387,6 +406,15 @@ Every command also takes `--agent` and `--migrate`. `woof --help` and `woof --ve
|
|
|
387
406
|
- `get` prints the value exactly as resolved, so you can pipe it.
|
|
388
407
|
- Exit status is `0` on success, `1` on a failure or a handoff, and `130` on a cancellation.
|
|
389
408
|
|
|
409
|
+
#### Export and import
|
|
410
|
+
|
|
411
|
+
- Export starts with the selected project's tokens and follows their references after applying overrides. It omits unrelated shared tokens, overridden defaults, and unused files. An empty project exports no shared tokens.
|
|
412
|
+
- A shared token that depends on a project override, directly or through another token, exports as a project token. Independent shared dependencies stay shared.
|
|
413
|
+
- For each exported token with `$private: true`, woof replaces `$exec` with `{{-woof:private-}}` and keeps the token's address, type, metadata, and privacy flag. Files and references used only by the omitted content stay out of the archive.
|
|
414
|
+
- Privacy applies only to the marked token. An unmarked token can still export the same file. Local values and source files stay unchanged, and recovery backups retain private values.
|
|
415
|
+
- Import warns about placeholders and continues. A differing value at the same address in the same layer needs conflict review. A new project token is added even if it overrides a shared token.
|
|
416
|
+
- Each lookup that reaches a private placeholder names the token, asks for its value, and warns on stderr. Replacing the marker with `woof edit` stops the warning and preserves the privacy flag.
|
|
417
|
+
|
|
390
418
|
### Scripts
|
|
391
419
|
|
|
392
420
|
A script token runs each time your agent gets it, and whatever it prints becomes the value.
|
|
@@ -409,6 +437,7 @@ A script token runs each time your agent gets it, and whatever it prints becomes
|
|
|
409
437
|
|
|
410
438
|
- Scripts run in the selected project's checkout, the same root as `<repo>`. Without one, they run in the current repo root, or in the current directory outside a repo.
|
|
411
439
|
- A list of scripts runs in order and stops at the first failure.
|
|
440
|
+
- A private placeholder returns a request for the missing value without starting a runtime. If any entry in a script list is a placeholder, none of the list runs.
|
|
412
441
|
- The first `tsx` or `bun` run may need the network.
|
|
413
442
|
- If a script fails, the lookup fails. woof doesn't undo what a script already did, and there's no timeout.
|
|
414
443
|
- Only `get` runs scripts. Searching, `explain`, and `validate` never do.
|
|
@@ -471,3 +500,12 @@ pnpm test
|
|
|
471
500
|
```
|
|
472
501
|
|
|
473
502
|
Design notes for contributors and agents live in [`.agents/docs/`](.agents/docs/index.md).
|
|
503
|
+
|
|
504
|
+
## ...and why "woof"?
|
|
505
|
+
|
|
506
|
+
<table>
|
|
507
|
+
<tr>
|
|
508
|
+
<td>After this interaction, I refer to my agents as woof.</td>
|
|
509
|
+
<td><img width="256" height="182" alt="telegram-cloud-photo-size-1-4954272345791073203-m" src="https://github.com/user-attachments/assets/d390675f-cf99-4acc-bca8-95a2a6076432" /></td>
|
|
510
|
+
</tr>
|
|
511
|
+
</table>
|
|
@@ -2,13 +2,14 @@ woof needs more input to add a token: {{missing}}.
|
|
|
2
2
|
|
|
3
3
|
Draft the token from the conversation:
|
|
4
4
|
|
|
5
|
-
1. Work out what the user wants to keep.
|
|
5
|
+
1. Work out what the user wants to keep. Make the content usable without this conversation.
|
|
6
6
|
2. Check for a similar token with woof get 'TERMS' --search --agent. If one exists, ask the user whether to add a new token or to change the existing token with woof edit 'PATH' --agent.
|
|
7
|
-
3. Choose a path that fits the existing namespaces below. Each name in the path contains only ASCII letters, digits, underscores and hyphens.
|
|
7
|
+
3. Choose a path that fits the existing namespaces below. Each name in the path contains only ASCII letters, digits, underscores and hyphens. Avoid paths such as -draft- whose references use the reserved {{-...-}} marker syntax.
|
|
8
8
|
4. Choose the type: prompt for instructions or other text, or bash, node, tsx or bun for a script.
|
|
9
9
|
5. Write a one-line description and a few tags, so that discovery can find the token.
|
|
10
10
|
6. Choose one target below. Shared tokens are available in every project. A project token exists only in that project, and it overrides a shared token at the same path.
|
|
11
|
-
7.
|
|
11
|
+
7. If the user wants the content omitted from exports, add --private to the command. The token will export with a placeholder. Local access still returns its value.
|
|
12
|
+
8. Show the user the path, target, type, description, tags, privacy setting and content. Save only after the user approves.
|
|
12
13
|
|
|
13
14
|
Existing namespaces:
|
|
14
15
|
{{namespaces}}
|
|
@@ -6,6 +6,7 @@ Configuration: {{configuration}}
|
|
|
6
6
|
Content: {{location}}
|
|
7
7
|
Description: {{description}}
|
|
8
8
|
Tags: {{tags}}
|
|
9
|
+
Private: {{private}}
|
|
9
10
|
|
|
10
11
|
Current content:
|
|
11
12
|
{{content}}
|
|
@@ -16,7 +17,8 @@ Layers:
|
|
|
16
17
|
1. Work out the change from the conversation.
|
|
17
18
|
2. Show the user the current and the new version. Apply the change only after the user approves.
|
|
18
19
|
3. Pass only the fields that change. Tags replace the current set. --description '' removes the description, and --tag '' removes all tags.
|
|
19
|
-
4.
|
|
20
|
-
5. If the
|
|
20
|
+
4. --private replaces the content with a placeholder on export. --no-private removes the privacy flag, so the content can export again. Use only one of these flags. Replacing a placeholder's content preserves the privacy setting unless --no-private is given.
|
|
21
|
+
5. Put new content between the WOOF lines, so that it goes to standard input. If the content is in a script file, edit that file directly. woof can still change its description, tags and export privacy. To change a shared script for this project only, first run the command with --override alone. woof copies the script into the project and reports the copy. Then edit the copy.
|
|
22
|
+
6. If the command has LAYER, replace it with one flag from Layers.
|
|
21
23
|
|
|
22
24
|
{{command}}
|
|
@@ -3,4 +3,6 @@ Exported {{project}}.
|
|
|
3
3
|
Archive: {{archive}}
|
|
4
4
|
Files: {{files}}
|
|
5
5
|
|
|
6
|
+
The archive contains the project's tokens and only their required dependencies after applying project overrides. Tokens marked private contain placeholders.
|
|
7
|
+
|
|
6
8
|
Import it with woof import {{archiveArgument}} --agent.
|
|
@@ -8,9 +8,11 @@ Import needs the user's decision for this item. No import files change until eve
|
|
|
8
8
|
|
|
9
9
|
Set choices[next.id] to the choice that the user makes:
|
|
10
10
|
|
|
11
|
-
- "take": use the archive's version.
|
|
11
|
+
- "take": use the archive's version. Add it if missing, or replace the local item.
|
|
12
12
|
- "keep": keep the local item and skip the archive's version.
|
|
13
13
|
- {"action":"add","address":"..."}: import it at a new address or path, and keep the local item.
|
|
14
14
|
- {"action":"reuse","address":"..."}: use an identical local item instead of importing it.
|
|
15
15
|
|
|
16
|
+
For token renames or reuse, avoid addresses such as -draft- whose references use the reserved {{-...-}} marker syntax.
|
|
17
|
+
|
|
16
18
|
Save the file and run woof import {{archive}} --decisions {{decisions}} --agent.
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
Warning: This archive contains private placeholders for these tokens:
|
|
2
|
+
{{tokens}}
|
|
3
|
+
|
|
4
|
+
Their values were omitted during export. Import can continue. After import, ask the user for the missing values and replace the placeholders with woof edit.
|
|
5
|
+
|
|
6
|
+
A placeholder that differs from a local value in the same layer needs normal conflict review. A shared token with the same name does not by itself cause a conflict with a new project token.
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
Token "{{path}}" needs a value because its private content was omitted during export. Ask the user to provide it, then update the token with woof edit.
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
Warning: {{message}}
|