@tackup/cli 0.0.0-stage → 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.
- package/LICENSE +21 -0
- package/README.md +15 -2
- package/dist/builtins/extensions/docs/guides/day-two.md +3 -0
- package/dist/builtins/extensions/docs/guides/onboarding-2.md +3 -0
- package/dist/builtins/extensions/docs/guides/onboarding-3.md +3 -0
- package/dist/builtins/extensions/docs/skills/use-tack-docs/SKILL.md +67 -0
- package/dist/builtins/extensions/docs/skills/use-tack-docs/references/declare-docs.md +71 -0
- package/dist/builtins/extensions/docs/skills/use-tack-docs/references/docs-in-profiles.md +25 -0
- package/dist/builtins/extensions/docs/skills/use-tack-docs/references/docs-maintenance.md +35 -0
- package/dist/builtins/extensions/docs/skills/use-tack-docs/references/review.md +34 -0
- package/dist/builtins/extensions/docs/skills/write-reader-figures/SKILL.md +66 -0
- package/dist/builtins/extensions/docs/skills/write-reader-figures/references/figure-components.md +20 -0
- package/dist/builtins/extensions/docs/skills/write-reader-figures/references/figures/architecture-map.md +86 -0
- package/dist/builtins/extensions/docs/skills/write-reader-figures/references/figures/chart.md +52 -0
- package/dist/builtins/extensions/docs/skills/write-reader-figures/references/figures/figure.md +79 -0
- package/dist/builtins/extensions/docs/skills/write-reader-figures/references/figures/file-tree.md +74 -0
- package/dist/builtins/extensions/docs/skills/write-reader-figures/references/figures/schema.md +116 -0
- package/dist/builtins/extensions/docs/skills/write-reader-figures/references/figures/system.md +81 -0
- package/dist/builtins/extensions/docs/skills/write-reader-figures/references/figures/walkthrough.md +45 -0
- package/dist/builtins/extensions/docs/skills/write-reader-figures/references/page-components.md +82 -0
- package/dist/builtins/extensions/docs/skills/write-reader-figures/references/rules.md +27 -0
- package/dist/builtins/extensions/docs/tack.yaml +10 -0
- package/dist/builtins/extensions/scripts/guides/day-two.md +3 -0
- package/dist/builtins/extensions/scripts/guides/onboarding-2.md +3 -0
- package/dist/builtins/extensions/scripts/skills/author-tack-scripts/SKILL.md +48 -0
- package/dist/builtins/extensions/scripts/skills/author-tack-scripts/references/run-scripts.md +23 -0
- package/dist/builtins/extensions/scripts/skills/author-tack-scripts/references/script-api.md +76 -0
- package/dist/builtins/extensions/scripts/skills/author-tack-scripts/references/scripts-in-profiles.md +35 -0
- package/dist/builtins/extensions/scripts/skills/author-tack-scripts/references/scripts-in-sources.md +56 -0
- package/dist/builtins/extensions/scripts/tack.yaml +10 -0
- package/dist/builtins/skills/author-tack-profiles/SKILL.md +68 -0
- package/dist/builtins/skills/author-tack-profiles/references/apply.md +33 -0
- package/dist/builtins/skills/author-tack-profiles/references/bundles.md +59 -0
- package/dist/builtins/skills/author-tack-profiles/references/copy-workflows.md +46 -0
- package/dist/builtins/skills/manage-tack-sources/SKILL.md +75 -0
- package/dist/builtins/skills/manage-tack-sources/references/catalog-issues.md +38 -0
- package/dist/builtins/skills/manage-tack-sources/references/metadata.md +35 -0
- package/dist/builtins/skills/manage-tack-sources/references/tack-yaml.md +114 -0
- package/dist/builtins/skills/manage-tack-sources/references/worked-source.md +126 -0
- package/dist/builtins/skills/prepare-tack-checkout/SKILL.md +52 -0
- package/dist/builtins/skills/use-tack/SKILL.md +65 -0
- package/dist/builtins/skills/use-tack/references/agent-instructions.md +38 -0
- package/dist/builtins/skills/use-tack/references/day-two.md +35 -0
- package/dist/builtins/skills/use-tack/references/explore.md +13 -0
- package/dist/builtins/skills/use-tack/references/imports.md +30 -0
- package/dist/builtins/skills/use-tack/references/maintenance.md +51 -0
- package/dist/builtins/skills/use-tack/references/onboarding-2.md +41 -0
- package/dist/builtins/skills/use-tack/references/onboarding-3.md +29 -0
- package/dist/builtins/skills/use-tack/references/onboarding.md +54 -0
- package/dist/builtins/skills/use-tack/references/output.md +15 -0
- package/dist/builtins/skills/use-tack/references/selection.md +61 -0
- package/dist/builtins/skills/use-tack/references/setup.md +69 -0
- package/dist/builtins/tack.yaml +10 -0
- package/dist/bundle-support-ZGTM5CTZ.js +16 -0
- package/dist/chunk-CFUDY2NO.js +1791 -0
- package/dist/chunk-CRQMJGMU.js +225 -0
- package/dist/chunk-DCX5T7CG.js +281 -0
- package/dist/chunk-EZ5C7B2M.js +28 -0
- package/dist/chunk-H4AG4WIV.js +52 -0
- package/dist/chunk-I5RMMV2Y.js +18013 -0
- package/dist/chunk-JL3E32X5.js +92 -0
- package/dist/chunk-MR5PTCYF.js +26 -0
- package/dist/chunk-PHQL7OBB.js +162 -0
- package/dist/chunk-QQBCYPJZ.js +5733 -0
- package/dist/chunk-T6JAU547.js +12401 -0
- package/dist/chunk-W7GHLGII.js +16 -0
- package/dist/chunk-XARHV5M4.js +56 -0
- package/dist/chunk-XZH2XPII.js +1017 -0
- package/dist/chunk-ZT6BO7LG.js +36671 -0
- package/dist/corpus-effects-YWG5VVHJ.js +12069 -0
- package/dist/elk.bundled-EVXDSFFG.js +94125 -0
- package/dist/main-JHULX3QY.js +65517 -0
- package/dist/main.js +17 -0
- package/dist/reader/visuals.tsx +368 -0
- package/dist/script.d.ts +133 -0
- package/dist/script.js +90 -0
- package/dist/server-XF7NSYRQ.js +308 -0
- package/dist/src-DZKPD6VY.js +1871 -0
- package/dist/src-TC3RTKIS.js +1126 -0
- package/dist/tack-env.d.ts +137 -0
- package/dist/third-party-licenses.txt +2467 -0
- package/dist/worker-ZFY6P7X5.js +24246 -0
- package/package.json +31 -4
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 nclsndr
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
CHANGED
|
@@ -1,3 +1,16 @@
|
|
|
1
|
-
#
|
|
1
|
+
# @tackup/cli
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Tack is an open-source CLI that combines the agent skills, commands, docs and scripts in the folders and Git repositories you and your team own into one setup, links it into every coding agent, project and Git worktree, and shows every change before it writes.
|
|
4
|
+
|
|
5
|
+
```sh
|
|
6
|
+
npm install --global @tackup/cli
|
|
7
|
+
tack init
|
|
8
|
+
```
|
|
9
|
+
|
|
10
|
+
It runs on macOS and Linux, on Node 22.23 or later. With Bun, install it with `bun add --global @tackup/cli` and run it with `bun --bun`.
|
|
11
|
+
|
|
12
|
+
- [Get started](https://tackup.dev/docs/getting-started)
|
|
13
|
+
- [Reference](https://tackup.dev/docs/reference/setup)
|
|
14
|
+
- [Source code](https://github.com/nclsndr/tack)
|
|
15
|
+
|
|
16
|
+
Scripts import the script API from this package: `import { defineScript } from "@tackup/cli"`. Tack provides it when it runs a script, so a source installs nothing.
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
## Docs folders
|
|
2
|
+
|
|
3
|
+
A folder of Markdown is docs. Each folder of PATH that holds docs is its own source, such as `{"version": 1, "name": "handbook", "docs": [{"name": "handbook", "path": "."}]}` for `PATH/handbook`. Markdown at the top of PATH and nothing else makes PATH itself the docs folder, `"docs": [{"name": "NAME", "path": "."}]`. A docs name other than its folder's goes into the same JSON. Attaching docs to a project comes after setup, as the `use-tack-docs` skill says.
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: use-tack-docs
|
|
3
|
+
description: Attach, search, read and write the docs of a project with Tack's docs extension. Use for any `tack docs` command - list, attach, detach, configure, search, target, icons, serve, review wait - and for `tack check` on Markdown pages. The `write-reader-figures` skill teaches figures; the `use-tack` skill covers every other `tack` command.
|
|
4
|
+
metadata:
|
|
5
|
+
tack: |
|
|
6
|
+
version: 1
|
|
7
|
+
activation: opt-in
|
|
8
|
+
user-activation: default
|
|
9
|
+
---
|
|
10
|
+
|
|
11
|
+
# Use Tack docs
|
|
12
|
+
|
|
13
|
+
Docs are folders of Markdown a source declares. Attach them to a project and every worktree of the project gets a link to them under `.tack/docs`, so agents read and search the same files people edit. This skill ships with the docs extension and is linked while it is on.
|
|
14
|
+
|
|
15
|
+
Replace uppercase arguments with values obtained from inspection. Examples use the installed `tack`; a source run swaps in the form the `use-tack` skill gives. Read the text view; add `--json` only when a program parses a stable payload; of the docs commands only `docs review wait` has one.
|
|
16
|
+
|
|
17
|
+
Read-only commands: `tack docs --project PROJECT`, `tack docs search "QUERY" --project PROJECT --limit 5` and `tack docs target --project PROJECT`.
|
|
18
|
+
|
|
19
|
+
## Attach documentation
|
|
20
|
+
|
|
21
|
+
Declare documentation in the registered source's top-level `tack.yaml`:
|
|
22
|
+
|
|
23
|
+
```yaml
|
|
24
|
+
version: 1
|
|
25
|
+
name: team-knowledge
|
|
26
|
+
skills:
|
|
27
|
+
- path: skills
|
|
28
|
+
docs:
|
|
29
|
+
- name: handbook
|
|
30
|
+
path: knowledge
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
The path is source-relative. Plain Markdown needs no frontmatter or reader configuration. A `tack.yaml` with `docs` and a folder named for another kind also needs that kind's key (`skills: []` when the folder is ordinary content, as the example shows with a `skills` entry).
|
|
34
|
+
|
|
35
|
+
Read the reference for the topic of the task:
|
|
36
|
+
|
|
37
|
+
- [declare docs](references/declare-docs.md): the `docs` key of `tack.yaml`, its `reader` settings, the `.` entry, overlap and its catalog issue.
|
|
38
|
+
- [docs maintenance](references/docs-maintenance.md): docs mounts in sync, removal, cleanup, status and explore, and what stays while docs is off.
|
|
39
|
+
- [review a page](references/review.md): receive the comments and answers a person sends from the reader, with `tack docs review wait`. Read it before waiting for a review.
|
|
40
|
+
- [docs in profiles](references/docs-in-profiles.md): docs in profiles, fixed contexts and bundles.
|
|
41
|
+
|
|
42
|
+
Docs is an extension, off until `tack extension enable docs` turns it on for the machine. While it is off, every `docs` command and `sync --no-docs` fail with `extension-disabled`, and `next` names that command.
|
|
43
|
+
|
|
44
|
+
```sh
|
|
45
|
+
tack extension enable docs
|
|
46
|
+
tack docs attach handbook --project PROJECT
|
|
47
|
+
tack docs configure --project PROJECT --default handbook
|
|
48
|
+
tack sync --no-adapters --project PROJECT
|
|
49
|
+
tack sync --no-adapters --project PROJECT --apply
|
|
50
|
+
tack docs target --project PROJECT
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
A docs resource is identified by source registration ID and name. Use `source:name` when the name is ambiguous; the source can be its label or registration ID. `docs configure --destination RELATIVE_PATH` changes the project-relative destination base; like every `docs` command except `docs icons` it takes `--project PROJECT` or the registered project containing the current directory or `--cwd PATH`. A destination that is absolute or leaves the project root fails with `docs-destination-invalid`. Reconcile afterward.
|
|
54
|
+
|
|
55
|
+
`docs search` matches every query term, case-insensitively, across saved content and paths. The query is at most 512 characters, `--limit` is 1 to 50 and defaults to 10, and `--type`, `--status` and `--tag` filter on exact metadata. A project with no attached docs is incomplete, with `complete: false` and a `setup` object naming the `tack docs attach` command that closes the gap.
|
|
56
|
+
|
|
57
|
+
Write files, run `tack check PATH...`, and repeat until clean. It detects source folders, profile YAML files, content bundles and Markdown docs without state or a browser. Include companion source folders for cross-source profile linkage. Source folders include their resources, declared profiles and docs figures. Findings have file:line locations; errors exit 1, warnings exit 0. Figures, icons and author components use the reader's static rules without running a page; they run only while the docs extension is on, and otherwise `tack check` says so with an info `extension-needed`. Unknown icons produce `icon-unknown`; misused components produce `component-issue`. Computed props produce `figure-not-checked`; unavailable inputs produce `check-path-unavailable`. A folder of skills without `tack.yaml` produces the warning `check-not-a-source` and gives the same advice as a bare `tack source add PATH`: a JSON declaration for `--config` read from its layout, a skills entry `.` for skill folders at its top or one entry per folder named after a kind, and the folder above for a `SKILL.md` at PATH. The `write-reader-figures` skill teaches figure authoring.
|
|
58
|
+
|
|
59
|
+
`tack docs icons [WORD]` lists the Lucide icons a document may draw with `<Icon name>`, by category, with the Lucide version they come from; a word filters names, categories and old Lucide names. It needs no project. Pick names from it rather than from memory.
|
|
60
|
+
|
|
61
|
+
Detach with `tack docs detach handbook --project PROJECT`, then preview and apply docs reconciliation. Detaching the default writing resource clears the default. Use `tack docs configure --project PROJECT --clear-default` to clear it without detaching.
|
|
62
|
+
|
|
63
|
+
## Search and write documentation
|
|
64
|
+
|
|
65
|
+
Search returns bounded excerpts with physical source paths and line ranges. Read the cited files before relying on their contents or editing them. Check `complete` and `issues` (add `--json` when the text view hides them): an incomplete search does not show that a result is absent. Narrow with `--type`, `--status` or `--tag` when the project uses those metadata fields.
|
|
66
|
+
|
|
67
|
+
Write documentation to the verified `destinationPath` from `docs target`. It resolves to the attached source, so other projects attached to that source share the change. With no default writing resource, inspect `docs` and select one with `--name SOURCE:NAME` (the source is its label or registration ID). An absent or redirected mount needs repair; write only to the verified destination. `tack docs serve --project PROJECT --no-open --port 0` prints a local reader URL, then stays in the foreground until interrupted, so run it in the background.
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
# Declare docs in a source
|
|
2
|
+
|
|
3
|
+
The rules of the `docs` key of a source's `tack.yaml`. The `manage-tack-sources` skill owns the rest of the declaration: the label, the other resource keys, paths, patterns, overlap, nested sources and catalog issues. Run `tack check PATH` after each change and repeat until clean.
|
|
4
|
+
|
|
5
|
+
## Entries
|
|
6
|
+
|
|
7
|
+
Docs are folders of Markdown that need no frontmatter or configuration. A `docs` entry has `name`, `path` to a folder and an optional `reader`. It takes no `include` or `exclude` patterns. The path is source-relative and must be a folder inside the source; another type is refused with `declaration-path-wrong-type`.
|
|
8
|
+
|
|
9
|
+
Every key but `version` and `name` is optional, so a source may declare `docs` alone, and a `docs` key is a resource key: a source with one does not warn with `source-declares-no-resources`. A source that declares only `docs` still has its folders checked: a folder named for another kind, such as `skills/`, needs that kind's key, or the source reports `declaration-resources-undeclared`. Write `skills: []` when the folder is ordinary content.
|
|
10
|
+
|
|
11
|
+
```yaml
|
|
12
|
+
version: 1
|
|
13
|
+
name: team-knowledge
|
|
14
|
+
skills: []
|
|
15
|
+
docs:
|
|
16
|
+
- name: handbook
|
|
17
|
+
path: knowledge
|
|
18
|
+
- name: operations
|
|
19
|
+
path: runbooks
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
The docs references are `handbook` and `operations`. Projects attach them separately with `tack docs attach`.
|
|
23
|
+
|
|
24
|
+
## Reader settings
|
|
25
|
+
|
|
26
|
+
A `reader` key, an inline mapping or a source-relative `.yaml` file, tunes navigation and components (reader settings: https://tackup.dev/docs/reference/docs#reader-settings). Use its `content` settings to filter documents inside a docs resource, since the entry takes no patterns. A component module imports `Icon`, `Callout`, `Tabs`, `Tab` and `Term` from `@tackup/reader`; `Icon` names are typed, and written literally so the reader bundles them. Writing the pages themselves is the `write-reader-figures` skill.
|
|
27
|
+
|
|
28
|
+
## The source folder
|
|
29
|
+
|
|
30
|
+
A `docs` entry `.` makes the whole source folder one docs resource, named by the entry's `name`. Like any `.` entry it declares that one kind: `tack check` refuses each other resource key with `declaration-schema-invalid`.
|
|
31
|
+
|
|
32
|
+
```yaml
|
|
33
|
+
version: 1
|
|
34
|
+
name: handbook
|
|
35
|
+
docs:
|
|
36
|
+
- name: handbook
|
|
37
|
+
path: .
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
A docs walk passes over dot, underscore and `node_modules` names, so `_drafts/` and `.git/` stay out. It skips the folder of another source silently, without the `declaration-reaches-source` finding a skills, commands or context walk reports.
|
|
41
|
+
|
|
42
|
+
## Overlap
|
|
43
|
+
|
|
44
|
+
Docs overlap like any other entry. A `skills` entry with `exclude: ["handbook/**"]` may hold a docs entry `skills/handbook`, but a docs entry takes no `exclude`, so a docs folder that holds or equals another entry's path is refused with it, with `declaration-path-overlap`. Give the docs their own folder. A profile file inside a docs folder overlaps the entry too, and since the entry cannot exclude it, the profile file must move.
|
|
45
|
+
|
|
46
|
+
## Issues
|
|
47
|
+
|
|
48
|
+
`declaration-invalid` is a `docs` key that is not a list, or a docs entry with an unknown key or a bad `name`. Fix it as the message says.
|
|
49
|
+
|
|
50
|
+
## Declaration creation
|
|
51
|
+
|
|
52
|
+
`tack source add PATH --config '<json>'` takes `docs` entries like every other key. For a source with skills under `personal/skills` minus archived folders and a handbook, pass:
|
|
53
|
+
|
|
54
|
+
```json
|
|
55
|
+
{
|
|
56
|
+
"version": 1,
|
|
57
|
+
"name": "personal",
|
|
58
|
+
"skills": [{ "path": "personal/skills", "exclude": ["**/_*/**"] }],
|
|
59
|
+
"docs": [{ "name": "handbook", "path": "team/handbook" }]
|
|
60
|
+
}
|
|
61
|
+
```
|
|
62
|
+
|
|
63
|
+
A bare `tack source add` on a folder without `tack.yaml` suggests a declaration read from its top: for a `docs` folder beside skill folders, it suggests a source of its own with a `.` entry.
|
|
64
|
+
|
|
65
|
+
## Name clashes
|
|
66
|
+
|
|
67
|
+
Two sources may each declare docs named `handbook`. A bare `handbook` is then ambiguous: choose one with `tack docs attach quality-tools:handbook --project PROJECT`, where the source is its label or registration ID. Distinct source-qualified docs mounts can coexist. Attaching changes state at once, so register a test project before you try it.
|
|
68
|
+
|
|
69
|
+
## The sources skill
|
|
70
|
+
|
|
71
|
+
The `tack-sources` skill that `tack sync` writes for each project lists a source whose only linked resource is docs, and names each docs mount of a source by path. While docs is off, it lists no mounted folders.
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
# Docs in profiles and bundles
|
|
2
|
+
|
|
3
|
+
How docs take part in the profiles and portable bundles the `author-tack-profiles` skill teaches. Every rule of that skill holds here.
|
|
4
|
+
|
|
5
|
+
## Docs need a project
|
|
6
|
+
|
|
7
|
+
Profile docs are the same attachments that `tack docs`, `docs search`, `docs serve` and `docs target` read. Docs attach to a project only:
|
|
8
|
+
|
|
9
|
+
- While a project's profile is enabled, its docs members are attached beside the project's own attachments, which stay stored apart with the writing default. `docs detach` refuses a resource only a profile attaches with `docs-attached-by-profile`: disable the profile. It cannot be the writing default either: `docs attach` it first, or pass `--name` to `docs target`. `docs` lists such resources as attached by an enabled profile. A profile enabled for the user skips its docs.
|
|
10
|
+
- `profile apply` for the user with docs in the profile leaves delivery incomplete: sync and status report `profile-delivery-incomplete` and doctor's profiles check fails.
|
|
11
|
+
- A bundle's docs need a project target.
|
|
12
|
+
|
|
13
|
+
## Fixed contexts
|
|
14
|
+
|
|
15
|
+
Existing docs intent, like existing picks, needs `--force` on `profile apply`, from a source or a bundle. A fixed context then refuses ordinary docs edits, such as attaching, detaching or changing the default writing resource, in `tack docs` or with explore's `a`, with `profile-fixed-context`. For a user application, verify that docs parents resolve inside every authorized root.
|
|
16
|
+
|
|
17
|
+
## Authoring
|
|
18
|
+
|
|
19
|
+
A profile file inside a docs folder overlaps the docs entry, and since a docs entry takes no `exclude`, the profile file must move. `tack check` on a source folder checks its docs figures too, and runs no reader module.
|
|
20
|
+
|
|
21
|
+
## Bundles
|
|
22
|
+
|
|
23
|
+
A docs resource needs an explicit `bundle-support` entry in its source's `tack.yaml`. A bundle includes whole docs directories and their reader settings and support. `profile inspect-bundle` and `tack check` on an archive never start a reader.
|
|
24
|
+
|
|
25
|
+
Docs support must include required reader modules, assets and support outside the selected directory. Relative Markdown and MDX links, reference-style assets, HTML and JSX asset attributes and static module imports (MDX side-effect imports included) need included content. Prose, inline code and fenced examples do not declare executable imports. Incomplete reader support produces `profile-bundle-incomplete` with a repair: add the named regular content, and do not execute it to infer closure.
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
# Docs mounts in sync, removal and status
|
|
2
|
+
|
|
3
|
+
How the docs extension takes part in the commands the `use-tack` skill teaches. Every rule of that skill holds here: preview before `--apply`, read the text view, follow `Next`.
|
|
4
|
+
|
|
5
|
+
## The extension
|
|
6
|
+
|
|
7
|
+
`tack extension enable docs` turns docs on for the machine. The extension ships `use-tack-docs` and `write-reader-figures` through its own built-in source, `tack-docs`, in the catalog while docs is on: enabling links them at once, and `tack extension disable docs` unlinks them. While docs is off, every `docs` command and `sync --no-docs` fail with `extension-disabled`.
|
|
8
|
+
|
|
9
|
+
Docs off keeps what it made. Sync and project refresh leave its mounts as they are, `status` lists them in `keptMounts` and the doctor `links` check fails for one that is gone or changed, status has no `docsDestination`, the sources skill lists no mounted folders, doctor has no `docs` check, explore lists no docs, and `tack check` runs no page rule (it says so with an info `extension-needed`). `profile apply` keeps a profile's docs in its inventory without mounting them. The next sync after turning docs on plans the mounts again, without applying the profile again.
|
|
10
|
+
|
|
11
|
+
## Stay in scope
|
|
12
|
+
|
|
13
|
+
Attach, detach or mount only what the request names. `tack docs attach`, `docs detach` and `docs configure` persist at once, with no preview. `tack catalog --kind docs` lists the docs resources, and `tack docs` also accepts `list` and `ls`.
|
|
14
|
+
|
|
15
|
+
In a checkout that the `prepare-tack-checkout` skill linked, when the task writes documentation, run `tack docs target` and write only there.
|
|
16
|
+
|
|
17
|
+
## Sync
|
|
18
|
+
|
|
19
|
+
`sync --no-adapters` plans only docs mounts, for a project: it cannot be combined with `--adapter`, `--no-docs` or `--user`. `sync --no-docs` plans only resource links. `--source SOURCE` plans that source's docs mounts with its links.
|
|
20
|
+
|
|
21
|
+
Apply a preview with the flags that made it: `--apply` alone widens a `--no-adapters` or `--no-docs` preview to everything. The plan's `options` echoes the `--no-docs` it was made with, and `resources: null` means `--no-adapters`.
|
|
22
|
+
|
|
23
|
+
`status --project PROJECT --details` prints the project's `.gitignore` lines; when docs are attached, they include the docs mount folder (`/.tack/` by default), which ends with `/`, unlike the line of each link.
|
|
24
|
+
|
|
25
|
+
## Removal and cleanup
|
|
26
|
+
|
|
27
|
+
The `source remove` preview lists the source's docs mounts everywhere and the docs attachments that go. The `project remove` preview lists the project's docs mounts and docs attachments. After `source relocate`, reconcile docs links too.
|
|
28
|
+
|
|
29
|
+
`state clean` removes managed docs links for the selected scope with the agent links. A docs mount whose removal could not be made safely stays on disk as a pending removal, as an agent link does; retry with `state clean --pending` once the cause is fixed.
|
|
30
|
+
|
|
31
|
+
A partial result names a `docs-*` code for a docs link that cannot proceed. After a docs change, check the mount with `tack docs target` when it is meant for writing.
|
|
32
|
+
|
|
33
|
+
## Explore
|
|
34
|
+
|
|
35
|
+
In `tack explore`, `a` attaches or detaches docs. Like `i` and `x`, it toggles: the key that staged a change unstages it. On a group already saved that way, `a` detaches docs.
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
# Review a page with its reader
|
|
2
|
+
|
|
3
|
+
A person reads a page in `tack docs serve`, answers its questions and sends one review: answers, comments and a note. The agent that wrote the page receives it with `tack docs review wait`. Everything stays in Tack's state directory on this machine; nothing is written into the docs source.
|
|
4
|
+
|
|
5
|
+
## The loop
|
|
6
|
+
|
|
7
|
+
1. Write the page in the docs source as `.mdx`. Where it needs a decision, ask with `<Question>` beside the text it is about; the `write-reader-figures` skill shows how. Run `tack check PAGE` until clean.
|
|
8
|
+
2. Give the person the reader URL, and say how to review: select text and press Comment, or use the comment control beside a block or Comment on a figure; answer the questions in place; then open Review at the bottom right and press Send to the agent. When none is running, start `tack docs serve --project PROJECT --no-open --port 0` in the background and read the URL it prints.
|
|
9
|
+
3. Wait: `tack docs review wait --project PROJECT --page PAGE --timeout 540`. Always name the page: a wait without `--page` takes the review of any page of the project, also one another agent wrote.
|
|
10
|
+
4. `timed-out` is a success and loses nothing: run the same command again, as Next gives it. Stop when the person says the review is over.
|
|
11
|
+
5. Leave the page as it is while the person reviews it: after a change they must delete the comments made before it. Once you received the review, change the page from it, run `tack check PAGE`, say what you changed and what you did not, and wait again when the person wants another round.
|
|
12
|
+
|
|
13
|
+
A review is handed out once: the command marks it received once its output is written, so act on what it prints. When the command is interrupted or its output fails, the review stays pending for the next wait. A received review stays in `extensions/docs/reviews/PROJECT/received/` in the state directory, for at least 30 days.
|
|
14
|
+
|
|
15
|
+
## Wait in each agent
|
|
16
|
+
|
|
17
|
+
- **Claude Code**: run the wait as a background command with a `--timeout`, such as 3600; the session is told when it exits. In the foreground a command ends after 10 minutes, so keep `--timeout 540`.
|
|
18
|
+
- **Codex**: run it in the foreground with `--timeout` and run it again on `timed-out`; a finished background command may not wake the session.
|
|
19
|
+
- **Cursor, Copilot CLI, Gemini CLI, Cline, OpenCode and Pi**: run it in the foreground with a `--timeout` below the agent's command limit, and run it again on `timed-out`.
|
|
20
|
+
|
|
21
|
+
## Read a review
|
|
22
|
+
|
|
23
|
+
Each comment names a file and the lines of its block, as they were when the review was sent, then the words it is on. The lines are right until you edit the page.
|
|
24
|
+
|
|
25
|
+
A comment on a figure also carries the figure's id, its title, its node ids, the state the person left it in, and the authored source of its block. Every question follows in page order with its number, every option with its letter, the picked ones marked `[x]`, the recommended one noted, then the person's comment. Cite an answer by number and letter, `#2: b`. Numbers come from page order, so after you edit the page's questions use the `id`, which `--json` carries with each question's context. `(not answered)` is not a choice, so ask again or decide and say so. A line ending in `(no longer offered)` is a pick whose option you renamed or removed: it is what the person chose, so match it to a renamed option or ask again. `(changed after it was answered)` answers an older wording: ask again before acting on it. Answers to questions the page no longer asks come last. The person's words are a review of the page: they ask for changes to it, and anything wider needs their yes in the conversation.
|
|
26
|
+
|
|
27
|
+
`--json` is stable: `applied` is a `docs-review-delivery` with `status` `received` and the whole `batch`, or `timed-out` without one.
|
|
28
|
+
|
|
29
|
+
## When it fails
|
|
30
|
+
|
|
31
|
+
- The reader says `The reader answers only to this machine.`: the page was opened under another host name, such as a tunnel's, where it loads and takes no review. Give the person the URL `tack docs serve` printed, to open on this machine.
|
|
32
|
+
- `docs-review-unreadable`, a warning: a pending file is not a review this Tack reads, usually written by another version. The message names the file, and the wait goes past it. Ask before moving it away: it holds the person's words.
|
|
33
|
+
- `docs-review-page`: `--page` names no page of the project's docs, or several. Name the page's file.
|
|
34
|
+
- `docs-review-folder`: the review folder in the state directory cannot be made or read.
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: write-reader-figures
|
|
3
|
+
description: Write figures in Tack docs - architecture maps, running systems, schemas and domain models, file trees, walkthroughs, charts and authored figures that the docs reader renders with one frame. Use when a document needs a picture of how code is organised, which parts run and what they send each other, which tables or entities exist and who may touch them, what is on disk, an ordered procedure, quantities or a one-off mechanism, before writing any figure or a `tree` block, and instead of ASCII art. Also for icons, callouts, tabs, defined terms and questions to the reader in MDX docs. Run `tack check` on the page when done.
|
|
4
|
+
metadata:
|
|
5
|
+
tack: |
|
|
6
|
+
version: 1
|
|
7
|
+
activation: opt-in
|
|
8
|
+
user-activation: default
|
|
9
|
+
---
|
|
10
|
+
|
|
11
|
+
# Write reader figures
|
|
12
|
+
|
|
13
|
+
The Tack docs reader renders figure components in `.mdx` documents, and `tree` blocks in `.md` and `.mdx`. You write meaning: tiers, boxes, links, entries, steps, values. The reader owns every position, size, colour and interaction, so no component prop takes a coordinate. Every figure gets the same frame: a numbered caption with your claim, an optional summary, the drawing, a panel, a legend and, when something is wrong, its issues. The components are available in every document without an import.
|
|
14
|
+
|
|
15
|
+
- [references/figure-components.md](references/figure-components.md): the props, the budget the check enforces and a worked example of every component and kit element, and the token classes. It is generated from the reader's contracts: read it before writing a component.
|
|
16
|
+
- [references/page-components.md](references/page-components.md): authored figures, for the rare figure no component fits, and icons, callouts, tabs, terms and questions. Read it before using any of them.
|
|
17
|
+
|
|
18
|
+
## 1. Plan first
|
|
19
|
+
|
|
20
|
+
A figure earns its place when it shows a mechanism the viewer would otherwise assemble from prose: what may use what, what a command passes through, what changes when a part fails. If a sentence or a table says it faster, write the sentence or the table.
|
|
21
|
+
|
|
22
|
+
Write these five lines for yourself before the figure. Do not put them in the page.
|
|
23
|
+
|
|
24
|
+
1. Question: what is the viewer asking? ("Where does this code belong?")
|
|
25
|
+
2. Claim: the one sentence the figure proves. It becomes the `title`.
|
|
26
|
+
3. Form: pick it from the list below, by the question.
|
|
27
|
+
4. Parts: the elements the claim turns on. Name what you leave out.
|
|
28
|
+
5. Cases: the situations worth replaying on the same drawing: a command, a request, a failure.
|
|
29
|
+
|
|
30
|
+
## 2. Pick the form by the question
|
|
31
|
+
|
|
32
|
+
- How is the code organised, what may use what, which parts does a command pass through? `ArchitectureMap`: tiers of real modules, the rule in words, a replay of a real command. Not: A box per folder with every import drawn at once.
|
|
33
|
+
- Which parts run and what do they send each other? What happens when one fails? `System`: real containers or processes, a verb on every link, a replay of one request, a lens per failure. Not: Same-shaped boxes with unlabelled arrows.
|
|
34
|
+
- Which tables or entities exist, how do they join, and which role may touch what? `Schema`: real tables and columns, a `ref` per foreign key, a lens per role with `access`. Not: Entity names in boxes, a grants matrix under it.
|
|
35
|
+
- In what order do decisions or steps apply? `Walkthrough`: numbered steps. Not: A flowchart of a straight line.
|
|
36
|
+
- What is on disk, what points where, what is temporary? A `tree` block (`FileTree`): real paths, symlinks as `->`, notes, sizes, a lens per moment. Not: An ASCII tree in a `text` block.
|
|
37
|
+
- How much, how many? `Chart`, or numbers in a Markdown table. Not: A diagram.
|
|
38
|
+
- Which values compare along several attributes? A Markdown table. Not: A figure that restates the table.
|
|
39
|
+
|
|
40
|
+
For anything else, such as a pipeline across two places on disk or a process tree, write an authored figure (in the page components reference), or a Markdown table or a list when that says it faster. Do not draw ASCII art: an ASCII tree becomes a figure by changing its fence to `tree` and marking its comments with `#`. The fence line carries the id and the claim: ` ```tree id="release-on-disk" title="Each release is one immutable directory" `.
|
|
41
|
+
|
|
42
|
+
## 3. Rules
|
|
43
|
+
|
|
44
|
+
- State how to read it. An `ArchitectureMap` needs its `rule` ("Imports point down"), two to four `startWith` entry points, and at least one replay of a real command or request.
|
|
45
|
+
- One claim per figure. The `title` is the claim as a sentence ("A page never reads the database"), never a topic ("Data flow"). The check rejects titles under four words.
|
|
46
|
+
- Draw the mechanism, not the names. If the drawing would mean the same with the labels shuffled, it is a list.
|
|
47
|
+
- Show real artefacts: real module paths, command names, column names. No "Service A".
|
|
48
|
+
- Give a link a specific verb when it is not plain use (`implements`, `wires`, `INSERT`). "Uses", "calls" and "handles" say nothing. In a `System` every link needs its label.
|
|
49
|
+
- Links follow the data in a `System`, and a role is a lens in a `Schema`: read [the form rules](references/rules.md) before drawing either.
|
|
50
|
+
- Respect the budget of the form (in the reference). A map holds up to 60 boxes because links stay hidden until a box is in focus: show the real modules, not five summary boxes.
|
|
51
|
+
- Replay, do not repeat. A command, a failure or a role is a replay or a lens on the same drawing, not a second figure. A failure is a lens: `focus` names what keeps working, `broken` what is down. A table of failures becomes one lens per row.
|
|
52
|
+
- Do not restate a neighbouring table as a figure. Keep the one that answers the question.
|
|
53
|
+
- Introduce each figure with one sentence that says what to look for.
|
|
54
|
+
- The ground behind a drawing depends on what it shows (quad-ruled paper for an architecture). It is a default the reader picks, not something to set or fight.
|
|
55
|
+
- Make the resting state, before any click, answer the main question, and spend boldness on the one thing the viewer must see ([be bold where it pays](references/rules.md#be-bold-where-it-pays)).
|
|
56
|
+
- Derive, do not type: relations that exist in code or data come from a script, as a literal data module the page imports. Read [derive, do not type](references/rules.md#derive-do-not-type) first.
|
|
57
|
+
|
|
58
|
+
## 4. Check the page
|
|
59
|
+
|
|
60
|
+
Run the figure check on the document, or on its folder, and repeat until clean:
|
|
61
|
+
|
|
62
|
+
```sh
|
|
63
|
+
tack check docs/architecture.mdx
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
It needs no registered state or browser, and prints file:line findings with the reader's own figure, icon and author-component rules: `icon-unknown`, `component-issue`. Errors exit 1; warnings exit 0. `figure-not-checked` means a prop is computed at runtime: make it literal or import it from a static data module. Then open the page in the reader (`tack docs serve`), point at a box, pin one, and run each replay once to see that the steps read in order.
|
package/dist/builtins/extensions/docs/skills/write-reader-figures/references/figure-components.md
ADDED
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
# Figure components
|
|
2
|
+
|
|
3
|
+
Generated from the reader's component contracts. Do not edit by hand. No prop takes a position, a size or a colour: the reader draws every figure from meaning. Each component has a page with its props, what the reader draws, its budget and a worked example. Read the page of the component you write.
|
|
4
|
+
|
|
5
|
+
- [`ArchitectureMap`](figures/architecture-map.md): How is the code organised, what may use what, and which parts does a command pass through?
|
|
6
|
+
- [`FileTree`](figures/file-tree.md): What is on disk, what points where, and what is temporary?
|
|
7
|
+
- [`System`](figures/system.md): Which parts run and what do they send each other? What happens when one fails?
|
|
8
|
+
- [`Schema`](figures/schema.md): Which tables or entities exist, how do they relate at the level of a column, and which role may read or write what?
|
|
9
|
+
- [`Figure`](figures/figure.md): Anything no component fits: a pipeline, a process tree, a one-off mechanism.
|
|
10
|
+
- [`Walkthrough`](figures/walkthrough.md): In what order do steps or decisions apply, when a reader follows them one at a time?
|
|
11
|
+
- [`Chart`](figures/chart.md): How much, how many, when comparing sizes is the point?
|
|
12
|
+
|
|
13
|
+
## Token classes
|
|
14
|
+
|
|
15
|
+
Classes a source may use in its own components, its MDX and the raw SVG of an authored figure. The reader styles them in both appearances. Never write a colour value.
|
|
16
|
+
|
|
17
|
+
- Colours, for `bg`, `text`, `border`, `fill` and `stroke`: `paper`, `sheet`, `rule`, `rule-strong`, `ink`, `body`, `muted`, `faint`, `pen`, `pen-wash`, `red`, `red-wash`. For example `stroke-muted` or `fill-sheet`.
|
|
18
|
+
- Fonts: `font-mono`, `font-sans`.
|
|
19
|
+
- Grounds: `tack-ground-quad-ruled`, `tack-ground-ruled-lines`, `tack-ground-dot-grid`.
|
|
20
|
+
- Tints, inside a figure: `tack-tint-1`, `tack-tint-2`, `tack-tint-3`, `tack-tint-4`, `tack-tint-5`, `tack-tint-6`, `tack-tint-fill`, `tack-tint-edge`. Pick one with `tack-tint-N` and paint with `tack-tint-fill` and `tack-tint-edge`.
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
# `ArchitectureMap`
|
|
2
|
+
|
|
3
|
+
Generated from the reader's component contracts. Do not edit by hand. No prop takes a position, a size or a colour: the reader draws every figure from meaning.
|
|
4
|
+
|
|
5
|
+
Answers: How is the code organised, what may use what, and which parts does a command pass through?
|
|
6
|
+
|
|
7
|
+
| Prop | Required | Meaning |
|
|
8
|
+
| --- | --- | --- |
|
|
9
|
+
| `id` | Yes | Unique on the page. A short lowercase slug. |
|
|
10
|
+
| `title` | Yes | The claim, as a sentence of at least 4 words. Never a topic such as "CLI architecture". |
|
|
11
|
+
| `summary` | No | One or two sentences under the caption, in plain text: Markdown is not rendered there. |
|
|
12
|
+
| `rule` | Yes | `{ title, text }`: the one rule that position encodes, such as "Imports point down". |
|
|
13
|
+
| `tiers` | Yes | Top to bottom. Each entry is a tier, or an array of two sibling tiers that share one band. |
|
|
14
|
+
| `links` | Yes | `{ from, to, label? }`: `from` uses `to`. Each end is a node id or a tier id. Import it from a generated data file when it comes from code. |
|
|
15
|
+
| `barriers` | No | `{ between: [tierId, tierId], label }` for two sibling tiers that must not use each other. Drawn as a wall. |
|
|
16
|
+
| `startWith` | No | Node ids offered as entry points. Two to four. |
|
|
17
|
+
| `replays` | No | `{ id?, label, steps: [{ at: nodeId, note }] }`: a real command or request, step by step. |
|
|
18
|
+
| `lenses` | No | `{ id?, label, note, focus: [ids], blocked?: [ids] }`: a named subset in focus, such as a failure or a role. |
|
|
19
|
+
| tier | | `{ id, label, path?, note?, nodes }`. `path` and `note` show in the tier's margin. |
|
|
20
|
+
| node | | `{ id, label, detail?, about? }`. `detail` is one short line under the label (a path, a role). `about` shows in the panel when the box is pinned. |
|
|
21
|
+
|
|
22
|
+
What the reader draws:
|
|
23
|
+
|
|
24
|
+
- Tiers as bands, top to bottom. The margin of a band shows its label, path, note and a `uses` line computed from the links.
|
|
25
|
+
- Boxes of one tier share one size and fill balanced rows. A label that repeats the tier path drops it: `features/status` in `features/` prints as `status`.
|
|
26
|
+
- Sibling tiers share a band; a barrier draws a wall between them with its label.
|
|
27
|
+
- No link at rest. Pointing at a box or focusing it shows its links: uses solid, used by dashed, one further hop muted. Click or Enter pins it.
|
|
28
|
+
- A box with more than 24 links in one direction draws one bundle per tier, with a count; the panel lists every link.
|
|
29
|
+
- The ground is quad-ruled paper by default.
|
|
30
|
+
|
|
31
|
+
Budget, checked by `tack check`:
|
|
32
|
+
|
|
33
|
+
- At most 60 boxes and 8 tier rows.
|
|
34
|
+
- At most 12 steps in a replay.
|
|
35
|
+
- At most 1,200 px tall at column width.
|
|
36
|
+
- A link that points up, or crosses a barrier, is drawn in the warning style and reported.
|
|
37
|
+
|
|
38
|
+
## Worked example
|
|
39
|
+
|
|
40
|
+
The plan, five lines kept out of the page:
|
|
41
|
+
|
|
42
|
+
1. Question: where does code belong in this web app, and what may a page touch?
|
|
43
|
+
2. Claim: a page never reads the database; it asks an API route, which owns every query.
|
|
44
|
+
3. Form: ArchitectureMap, because the question is what may use what.
|
|
45
|
+
4. Parts: the folders of src/ in four tiers; API and jobs as siblings with a barrier.
|
|
46
|
+
5. Cases: one replay, placing an order, from the page to the row.
|
|
47
|
+
|
|
48
|
+
The figure:
|
|
49
|
+
|
|
50
|
+
```mdx
|
|
51
|
+
import { links } from "./web-imports.ts";
|
|
52
|
+
|
|
53
|
+
<ArchitectureMap
|
|
54
|
+
id="web-architecture"
|
|
55
|
+
title="A page never reads the database: it asks an API route, which owns every query"
|
|
56
|
+
summary="Each box is one folder of src/. The links come from the import graph."
|
|
57
|
+
rule={{ title: "Imports point down", text: "An import points down the map or stays inside its tier." }}
|
|
58
|
+
tiers={[
|
|
59
|
+
{ id: "pages", label: "Pages", path: "pages/", note: "what the browser loads", nodes: [
|
|
60
|
+
{ id: "pages-home", label: "pages/home" },
|
|
61
|
+
{ id: "pages-account", label: "pages/account", detail: "signed in only" },
|
|
62
|
+
] },
|
|
63
|
+
[
|
|
64
|
+
{ id: "api", label: "API", path: "api/", note: "route handlers", nodes: [
|
|
65
|
+
{ id: "api-orders", label: "api/orders", about: "The only writer of orders." },
|
|
66
|
+
] },
|
|
67
|
+
{ id: "jobs", label: "Jobs", path: "jobs/", note: "scheduled work", nodes: [
|
|
68
|
+
{ id: "jobs-billing", label: "jobs/billing" },
|
|
69
|
+
] },
|
|
70
|
+
],
|
|
71
|
+
{ id: "data", label: "Data", path: "db/", note: "queries and schema", nodes: [
|
|
72
|
+
{ id: "db-orders", label: "db/orders" },
|
|
73
|
+
] },
|
|
74
|
+
]}
|
|
75
|
+
barriers={[{ between: ["api", "jobs"], label: "share nothing but the database" }]}
|
|
76
|
+
links={links}
|
|
77
|
+
startWith={["pages-account", "api-orders"]}
|
|
78
|
+
replays={[
|
|
79
|
+
{ id: "place-order", label: "Place an order", steps: [
|
|
80
|
+
{ at: "pages-account", note: "The form posts to /api/orders." },
|
|
81
|
+
{ at: "api-orders", note: "Validates the order and opens a transaction." },
|
|
82
|
+
{ at: "db-orders", note: "Inserts the order row." },
|
|
83
|
+
] },
|
|
84
|
+
]}
|
|
85
|
+
/>
|
|
86
|
+
```
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
# `Chart`
|
|
2
|
+
|
|
3
|
+
Generated from the reader's component contracts. Do not edit by hand. No prop takes a position, a size or a colour: the reader draws every figure from meaning.
|
|
4
|
+
|
|
5
|
+
Answers: How much, how many, when comparing sizes is the point?
|
|
6
|
+
|
|
7
|
+
| Prop | Required | Meaning |
|
|
8
|
+
| --- | --- | --- |
|
|
9
|
+
| `id` | Yes | Unique on the page. A short lowercase slug. |
|
|
10
|
+
| `title` | Yes | The claim, as a sentence of at least 4 words. Never a topic such as "Release layout". |
|
|
11
|
+
| `data` | Yes | `{ label, value }` per bar, in order. `value` is a finite number; never invent one. |
|
|
12
|
+
| `unit` | No | Shown after every value, such as `s` or `MB`. |
|
|
13
|
+
| `scenarios` | No | `{ id, label, multiplier }`: alternatives that scale every value, such as a slower network. The first shows first. |
|
|
14
|
+
|
|
15
|
+
What the reader draws:
|
|
16
|
+
|
|
17
|
+
- One horizontal bar per value, in order, with its label and value; pointing at a bar selects it.
|
|
18
|
+
- A scenario switch, a multiplier and a linear or square-root scale, kept in the view state.
|
|
19
|
+
- A few values of different units, or values a reader must look up, stay a Markdown table.
|
|
20
|
+
|
|
21
|
+
Budget, checked by `tack check`:
|
|
22
|
+
|
|
23
|
+
- Every value has a label and a finite number.
|
|
24
|
+
|
|
25
|
+
## Worked example
|
|
26
|
+
|
|
27
|
+
The plan, five lines kept out of the page:
|
|
28
|
+
|
|
29
|
+
1. Question: what makes a sync slow?
|
|
30
|
+
2. Claim: large folders dominate the time a sync takes.
|
|
31
|
+
3. Form: Chart, because the point is how the sizes compare.
|
|
32
|
+
4. Parts: three folder sizes, measured.
|
|
33
|
+
5. Cases: a scenario for a network home folder.
|
|
34
|
+
|
|
35
|
+
The figure:
|
|
36
|
+
|
|
37
|
+
```mdx
|
|
38
|
+
<Chart
|
|
39
|
+
id="sync-time"
|
|
40
|
+
title="Large folders dominate the time a sync takes"
|
|
41
|
+
unit="s"
|
|
42
|
+
data={[
|
|
43
|
+
{ label: "10 skills", value: 0.4 },
|
|
44
|
+
{ label: "100 skills", value: 1.2 },
|
|
45
|
+
{ label: "1,000 skills", value: 9.8 },
|
|
46
|
+
]}
|
|
47
|
+
scenarios={[
|
|
48
|
+
{ id: "laptop", label: "Laptop SSD", multiplier: 1 },
|
|
49
|
+
{ id: "network", label: "Network home folder", multiplier: 4 },
|
|
50
|
+
]}
|
|
51
|
+
/>
|
|
52
|
+
```
|
package/dist/builtins/extensions/docs/skills/write-reader-figures/references/figures/figure.md
ADDED
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
# `Figure`
|
|
2
|
+
|
|
3
|
+
Generated from the reader's component contracts. Do not edit by hand. No prop takes a position, a size or a colour: the reader draws every figure from meaning.
|
|
4
|
+
|
|
5
|
+
Answers: Anything no component fits: a pipeline, a process tree, a one-off mechanism.
|
|
6
|
+
|
|
7
|
+
| Prop | Required | Meaning |
|
|
8
|
+
| --- | --- | --- |
|
|
9
|
+
| `id` | Yes | Unique on the page. A short lowercase slug. |
|
|
10
|
+
| `title` | Yes | The claim, as a sentence of at least 4 words. Never a topic such as "Release layout". |
|
|
11
|
+
| `kind` | No | What it depicts: `architecture`, `system` (the default), `schema` or `tree`. It picks the ground. |
|
|
12
|
+
| `summary` | No | One or two sentences under the caption, in plain text: Markdown is not rendered there. |
|
|
13
|
+
| `rule` | No | `{ title, text }`: the one rule the layout encodes. |
|
|
14
|
+
| `startWith` | No | Box ids offered as entry points. |
|
|
15
|
+
| `replays` | No | `{ id?, label, steps: [{ at: boxId, note }] }`: an ordered case. |
|
|
16
|
+
| `lenses` | No | `{ id?, label, note, focus?: [ids], blocked?: [ids], broken?: [ids] }`: a failure, a role, a moment. |
|
|
17
|
+
| `legend` | No | Names for what the drawing uses: a link style (`solid`, `dashed`, `muted`), a tint (`tint-1` to `tint-6`) or a shape. A link with no label needs a legend entry for its style. |
|
|
18
|
+
| `children` | Yes | One `Drawing`. |
|
|
19
|
+
| `Drawing` | | `{ height }`. Always 728 wide. Holds the kit elements below. |
|
|
20
|
+
| `Box` | | `{ id, x, y, label, detail?, about?, tint?: 1-6, shape?, w? }`. Shapes: `plain`, `store`, `queue`, `external`, `actor`, `sheet`. Its width follows from its text unless `w` is given. |
|
|
21
|
+
| `Link` | | `{ from, to, label?, style? }` between two box ids. The kit routes it as a curve. |
|
|
22
|
+
| `Band` | | `{ x, y, w, h, label, tint? }`: a labelled region, such as a tier, a boundary or a swimlane. |
|
|
23
|
+
| `Badge` | | `{ at: boxId, n }`: a numbered mark on a box. |
|
|
24
|
+
| `Note` | | `{ x, y, text, to?: boxId }`: a short annotation, with a leader line to a box. |
|
|
25
|
+
| `Label` | | `{ x, y, text, size?: "large" | "small", anchor? }`: free text in one of the two drawing sizes. |
|
|
26
|
+
| raw SVG | | Any other SVG element, such as `<path>`, for the one thing no element covers. Paint it with the token classes of `figure-components.md`. |
|
|
27
|
+
|
|
28
|
+
What the reader draws:
|
|
29
|
+
|
|
30
|
+
- The same frame as every figure: caption, cases, focus, panel, legend, text equivalent and view state, from the ids. Write no event handler.
|
|
31
|
+
- Links show at rest up to 12 boxes; above that, only the links of the box in focus.
|
|
32
|
+
- Bands first, then raw SVG, then links, notes, boxes and labels.
|
|
33
|
+
- The ground follows `kind`: quad-ruled for a system.
|
|
34
|
+
|
|
35
|
+
Budget, checked by `tack check`:
|
|
36
|
+
|
|
37
|
+
- At most 24 boxes and 12 steps in a replay.
|
|
38
|
+
- At most 1,200 px tall.
|
|
39
|
+
- The check reports boxes that overlap, text that does not fit its box, an element outside the drawing, a link that crosses a box that is not one of its ends, and unknown ids. It counts raw shapes it cannot check.
|
|
40
|
+
|
|
41
|
+
## Worked example
|
|
42
|
+
|
|
43
|
+
The plan, five lines kept out of the page:
|
|
44
|
+
|
|
45
|
+
1. Question: what happens between running the update and the new release being active?
|
|
46
|
+
2. Claim: nothing outside staging/ changes until the gate passes.
|
|
47
|
+
3. Form: an authored Figure, because no component draws a pipeline across two places on disk.
|
|
48
|
+
4. Parts: the export, the gate, the pointer swap; the two directories as bands.
|
|
49
|
+
5. Cases: a replay of a good update, a lens for a failed gate.
|
|
50
|
+
|
|
51
|
+
The figure:
|
|
52
|
+
|
|
53
|
+
```mdx
|
|
54
|
+
<Figure
|
|
55
|
+
id="update-pipeline"
|
|
56
|
+
kind="system"
|
|
57
|
+
title="Nothing outside staging/ changes until the gate passes"
|
|
58
|
+
rule={{ title: "Left to right", text: "Each step runs only when the one before it passed." }}
|
|
59
|
+
startWith={["gate"]}
|
|
60
|
+
legend={{ dashed: "only when the checkout is clean" }}
|
|
61
|
+
replays={[{ label: "A good update", steps: [
|
|
62
|
+
{ at: "export", note: "git archive into a clean tree." },
|
|
63
|
+
{ at: "gate", note: "The built release is run for real." },
|
|
64
|
+
{ at: "swap", note: "current moves to the new release." },
|
|
65
|
+
] }]}
|
|
66
|
+
lenses={[{ label: "The gate fails", note: "Nothing outside staging/ changed.", focus: ["export"], broken: ["gate"], blocked: ["swap"] }]}
|
|
67
|
+
>
|
|
68
|
+
<Drawing height={200}>
|
|
69
|
+
<Band x={16} y={12} w={452} h={176} label="staging/<uuid>" />
|
|
70
|
+
<Band x={484} y={12} w={228} h={176} label="~/.local/share/tack" />
|
|
71
|
+
<Box id="export" x={32} y={60} label="git archive" detail="clean tree, no .git" />
|
|
72
|
+
<Box id="gate" x={260} y={60} label="gate-release" detail="5 min cap" />
|
|
73
|
+
<Box id="swap" x={500} y={60} label="swap current" tint={2} shape="sheet" />
|
|
74
|
+
<Link from="export" to="gate" label="release/" />
|
|
75
|
+
<Link from="gate" to="swap" label="passes" />
|
|
76
|
+
<Note x={260} y={160} text="fails: the commit is held" to="gate" />
|
|
77
|
+
</Drawing>
|
|
78
|
+
</Figure>
|
|
79
|
+
```
|