@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.
Files changed (83) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +15 -2
  3. package/dist/builtins/extensions/docs/guides/day-two.md +3 -0
  4. package/dist/builtins/extensions/docs/guides/onboarding-2.md +3 -0
  5. package/dist/builtins/extensions/docs/guides/onboarding-3.md +3 -0
  6. package/dist/builtins/extensions/docs/skills/use-tack-docs/SKILL.md +67 -0
  7. package/dist/builtins/extensions/docs/skills/use-tack-docs/references/declare-docs.md +71 -0
  8. package/dist/builtins/extensions/docs/skills/use-tack-docs/references/docs-in-profiles.md +25 -0
  9. package/dist/builtins/extensions/docs/skills/use-tack-docs/references/docs-maintenance.md +35 -0
  10. package/dist/builtins/extensions/docs/skills/use-tack-docs/references/review.md +34 -0
  11. package/dist/builtins/extensions/docs/skills/write-reader-figures/SKILL.md +66 -0
  12. package/dist/builtins/extensions/docs/skills/write-reader-figures/references/figure-components.md +20 -0
  13. package/dist/builtins/extensions/docs/skills/write-reader-figures/references/figures/architecture-map.md +86 -0
  14. package/dist/builtins/extensions/docs/skills/write-reader-figures/references/figures/chart.md +52 -0
  15. package/dist/builtins/extensions/docs/skills/write-reader-figures/references/figures/figure.md +79 -0
  16. package/dist/builtins/extensions/docs/skills/write-reader-figures/references/figures/file-tree.md +74 -0
  17. package/dist/builtins/extensions/docs/skills/write-reader-figures/references/figures/schema.md +116 -0
  18. package/dist/builtins/extensions/docs/skills/write-reader-figures/references/figures/system.md +81 -0
  19. package/dist/builtins/extensions/docs/skills/write-reader-figures/references/figures/walkthrough.md +45 -0
  20. package/dist/builtins/extensions/docs/skills/write-reader-figures/references/page-components.md +82 -0
  21. package/dist/builtins/extensions/docs/skills/write-reader-figures/references/rules.md +27 -0
  22. package/dist/builtins/extensions/docs/tack.yaml +10 -0
  23. package/dist/builtins/extensions/scripts/guides/day-two.md +3 -0
  24. package/dist/builtins/extensions/scripts/guides/onboarding-2.md +3 -0
  25. package/dist/builtins/extensions/scripts/skills/author-tack-scripts/SKILL.md +48 -0
  26. package/dist/builtins/extensions/scripts/skills/author-tack-scripts/references/run-scripts.md +23 -0
  27. package/dist/builtins/extensions/scripts/skills/author-tack-scripts/references/script-api.md +76 -0
  28. package/dist/builtins/extensions/scripts/skills/author-tack-scripts/references/scripts-in-profiles.md +35 -0
  29. package/dist/builtins/extensions/scripts/skills/author-tack-scripts/references/scripts-in-sources.md +56 -0
  30. package/dist/builtins/extensions/scripts/tack.yaml +10 -0
  31. package/dist/builtins/skills/author-tack-profiles/SKILL.md +68 -0
  32. package/dist/builtins/skills/author-tack-profiles/references/apply.md +33 -0
  33. package/dist/builtins/skills/author-tack-profiles/references/bundles.md +59 -0
  34. package/dist/builtins/skills/author-tack-profiles/references/copy-workflows.md +46 -0
  35. package/dist/builtins/skills/manage-tack-sources/SKILL.md +75 -0
  36. package/dist/builtins/skills/manage-tack-sources/references/catalog-issues.md +38 -0
  37. package/dist/builtins/skills/manage-tack-sources/references/metadata.md +35 -0
  38. package/dist/builtins/skills/manage-tack-sources/references/tack-yaml.md +114 -0
  39. package/dist/builtins/skills/manage-tack-sources/references/worked-source.md +126 -0
  40. package/dist/builtins/skills/prepare-tack-checkout/SKILL.md +52 -0
  41. package/dist/builtins/skills/use-tack/SKILL.md +65 -0
  42. package/dist/builtins/skills/use-tack/references/agent-instructions.md +38 -0
  43. package/dist/builtins/skills/use-tack/references/day-two.md +35 -0
  44. package/dist/builtins/skills/use-tack/references/explore.md +13 -0
  45. package/dist/builtins/skills/use-tack/references/imports.md +30 -0
  46. package/dist/builtins/skills/use-tack/references/maintenance.md +51 -0
  47. package/dist/builtins/skills/use-tack/references/onboarding-2.md +41 -0
  48. package/dist/builtins/skills/use-tack/references/onboarding-3.md +29 -0
  49. package/dist/builtins/skills/use-tack/references/onboarding.md +54 -0
  50. package/dist/builtins/skills/use-tack/references/output.md +15 -0
  51. package/dist/builtins/skills/use-tack/references/selection.md +61 -0
  52. package/dist/builtins/skills/use-tack/references/setup.md +69 -0
  53. package/dist/builtins/tack.yaml +10 -0
  54. package/dist/bundle-support-ZGTM5CTZ.js +16 -0
  55. package/dist/chunk-CFUDY2NO.js +1791 -0
  56. package/dist/chunk-CRQMJGMU.js +225 -0
  57. package/dist/chunk-DCX5T7CG.js +281 -0
  58. package/dist/chunk-EZ5C7B2M.js +28 -0
  59. package/dist/chunk-H4AG4WIV.js +52 -0
  60. package/dist/chunk-I5RMMV2Y.js +18013 -0
  61. package/dist/chunk-JL3E32X5.js +92 -0
  62. package/dist/chunk-MR5PTCYF.js +26 -0
  63. package/dist/chunk-PHQL7OBB.js +162 -0
  64. package/dist/chunk-QQBCYPJZ.js +5733 -0
  65. package/dist/chunk-T6JAU547.js +12401 -0
  66. package/dist/chunk-W7GHLGII.js +16 -0
  67. package/dist/chunk-XARHV5M4.js +56 -0
  68. package/dist/chunk-XZH2XPII.js +1017 -0
  69. package/dist/chunk-ZT6BO7LG.js +36671 -0
  70. package/dist/corpus-effects-YWG5VVHJ.js +12069 -0
  71. package/dist/elk.bundled-EVXDSFFG.js +94125 -0
  72. package/dist/main-JHULX3QY.js +65517 -0
  73. package/dist/main.js +17 -0
  74. package/dist/reader/visuals.tsx +368 -0
  75. package/dist/script.d.ts +133 -0
  76. package/dist/script.js +90 -0
  77. package/dist/server-XF7NSYRQ.js +308 -0
  78. package/dist/src-DZKPD6VY.js +1871 -0
  79. package/dist/src-TC3RTKIS.js +1126 -0
  80. package/dist/tack-env.d.ts +137 -0
  81. package/dist/third-party-licenses.txt +2467 -0
  82. package/dist/worker-ZFY6P7X5.js +24246 -0
  83. package/package.json +31 -4
@@ -0,0 +1,35 @@
1
+ # Scripts in profiles and bundles
2
+
3
+ How scripts take part in the profiles and portable bundles the `author-tack-profiles` skill teaches. Every rule of that skill holds here.
4
+
5
+ ## Profiles
6
+
7
+ A profile file on a script's path overlaps that entry, and both are refused with `declaration-path-overlap` until the file moves. `tack check` on a source or a profile runs no script.
8
+
9
+ Scripts remain explicit-run resources. `profile enable` and `profile apply`, for a project or for the user, write no pick, execution or execution allowlist for them and leave them run only by `tack script run`.
10
+
11
+ ## Bundles
12
+
13
+ A script needs an explicit `bundle-support` entry in its source's `tack.yaml`, with `complete: true`, `files` and non-secret `prerequisites`:
14
+
15
+ ```yaml
16
+ version: 1
17
+ name: tools
18
+ scripts:
19
+ - name: report
20
+ path: tools/report.ts
21
+ description: Produce a report
22
+ profiles:
23
+ - name: ci
24
+ path: profiles/ci.yaml
25
+ bundle-support:
26
+ - kind: script
27
+ name: report
28
+ complete: true
29
+ files: [tools/helpers.ts, package.json, bun.lock]
30
+ prerequisites: [Bun runtime, Install the declared package versions explicitly before script run]
31
+ ```
32
+
33
+ The artifact carries the script's entrypoint and its explicit package/runtime facts. For an entrypoint with no package dependencies, use `package: none` explicitly instead of claiming missing package facts. Otherwise include `package.json` and lock information, or export reports `profile-bundle-incomplete`, and name the package in the setup prerequisites.
34
+
35
+ `profile inspect-bundle` and `tack check` on a bundle never run scripts, and no package hook runs automatically. Content portability does not promise offline script execution: the recipient installs the declared packages before `tack script run`.
@@ -0,0 +1,56 @@
1
+ # Scripts in a source
2
+
3
+ The `scripts` key of a source's `tack.yaml`, the rules of its entries and the catalog issues they raise. Every rule of the `manage-tack-sources` skill holds here. Tack checks the `scripts` key whether the scripts extension is on or off.
4
+
5
+ ## The entry
6
+
7
+ A source may declare only what it holds, such as `scripts` alone. `scripts` entries have `name`, `path` to one `.ts` file and a non-empty `description`, and take no patterns: `include` or `exclude` on a script entry is an unknown key, and the entry is quarantined with `declaration-entry-invalid`.
8
+
9
+ Script names use lowercase letters, digits and single hyphens. A script's reference is its declared `name`, not its file name, qualified with `source:` when ambiguous. Two scripts with one name in one source are both quarantined, as for any kind.
10
+
11
+ The module default-exports a `defineScript` definition imported from `@tackup/cli`, which the running Tack provides: never install it. Read [script API](script-api.md) before writing one. A source needs a `package.json` only for packages its scripts import; Tack never installs them, and `catalog` never imports or executes a script, so only `script run` finds a broken one. Scripts are run by reference, never selected or linked.
12
+
13
+ ## Paths and overlap
14
+
15
+ After symlinks, the path must be a `.ts` file inside the source; another type is refused with `declaration-path-wrong-type`. Every other path rule of `manage-tack-sources` holds.
16
+
17
+ A script entry is a file entry, so it overlaps a folder entry that holds its file, and every overlapping entry is quarantined with `declaration-path-overlap`. An `exclude` on the outer folder entry that prunes the script's file ends the overlap, because its walk never reaches that path: `context` `tools` with `exclude: ["run.ts"]` beside a script `tools/run.ts`. An `include` does not, since the walk still enters every folder. The finding names that exclude. A profile publication on the script's file overlaps it too.
18
+
19
+ ## A worked source
20
+
21
+ In the `quality-tools` source of the `manage-tack-sources` worked example, add `tools/report.ts` and declare it beside the other keys:
22
+
23
+ ```yaml
24
+ version: 1
25
+ name: quality-tools
26
+ skills:
27
+ - path: skills
28
+ scripts:
29
+ - name: report
30
+ path: tools/report.ts
31
+ description: Summarize the current project's checks.
32
+ ```
33
+
34
+ The script's reference is `report`, from its declared name, and its module must default-export a `defineScript` definition imported from `@tackup/cli`, which Tack provides at run time.
35
+
36
+ For a source without `tack.yaml`, `tack source add PATH --config` takes the same entry as JSON. For a source with skills under `personal/skills` minus archived folders and a report script, pass this declaration, on one line or through `--config -`:
37
+
38
+ ```json
39
+ {
40
+ "version": 1,
41
+ "name": "personal",
42
+ "skills": [{ "path": "personal/skills", "exclude": ["**/_*/**"] }],
43
+ "scripts": [{ "name": "report", "path": "tools/report.ts", "description": "Weekly report" }]
44
+ }
45
+ ```
46
+
47
+ ## Catalog issues
48
+
49
+ | Issue | Fix |
50
+ | ----------------------------- | ------------------------------------------------------------------------------------------------------------------------ |
51
+ | `declaration-entry-invalid` | The entry does not decode: an unknown key such as `include`, a missing `name`, `path` or `description`, or a bad `name`. |
52
+ | `declaration-path-wrong-type` | The path is not a `.ts` file. Point it at the module. |
53
+ | `declaration-path-overlap` | A folder entry holds the script's file. Add the `exclude` the message names to the folder entry, or move the script. |
54
+ | `extension-needed` | The source declares scripts while the extension is off. Ask the operator before `tack extension enable scripts`. |
55
+
56
+ Run `tack check PATH` after each fix, and `tack catalog --kind script` to see the scripts a registered source contributes.
@@ -0,0 +1,10 @@
1
+ version: 1
2
+ name: tack-scripts
3
+ description: The skill that ships with Tack's scripts extension, for writing, running and inspecting the scripts sources declare.
4
+ guidance:
5
+ - when: Before you edit any built-in skill.
6
+ body: |
7
+ Do not edit these skills. They ship with Tack, and the next upgrade replaces them. Report a
8
+ wrong or missing instruction to the operator instead.
9
+ skills:
10
+ - path: skills
@@ -0,0 +1,68 @@
1
+ ---
2
+ name: author-tack-profiles
3
+ description: Author, declare, inspect and repair Tack profiles. Use for profile files, source linkage, turning a profile on or off, membership copies, explicit fixed application and portable content bundles. Use manage-tack-sources for resource declarations and use-tack for daily selection.
4
+ metadata:
5
+ tack: |
6
+ version: 1
7
+ activation: opt-in
8
+ user-activation: default
9
+ ---
10
+
11
+ # Author Tack profiles
12
+
13
+ Authoring, checking and source-based application support fixed positive resource manifests. Profiles reference existing resources; they are not a resource kind. Use `manage-tack-sources` before changing the owning source, including its maintainers check. Extensions add more resources: `tack extension` lists them, and each one that is on brings its own skill, which says how a profile carries them.
14
+
15
+ 1. Inspect the resources with `tack catalog --details`. Agents use this noninteractive command; the terminal explorer is for people ([edit a profile in it](references/apply.md#edit-a-profile-in-the-terminal-explorer)).
16
+ 2. Declare the file in the owning source's `tack.yaml`, under its `profiles` key. A source declaration is version 1, with or without profiles. Any other source version fails before resource discovery. A broken profile leaves unrelated resources usable.
17
+
18
+ ```yaml
19
+ version: 1
20
+ name: tools
21
+ skills:
22
+ - path: skills
23
+ profiles:
24
+ - name: ci
25
+ path: profiles/ci.yaml
26
+ ```
27
+
28
+ 3. Write the separately versioned file. Only `version`, `name`, `depends-on` and `members` are accepted. The file's name must match its declaration. Paths are source-relative regular files inside the source, with no dot or parent segments. A profile file inside a declared resource folder, or on a declared file, overlaps that entry, and both are refused with `declaration-path-overlap` until the folder entry excludes the file or the file moves.
29
+
30
+ ```yaml
31
+ # profiles/ci.yaml
32
+ version: 1
33
+ name: ci
34
+ depends-on: [team]
35
+ members:
36
+ - review
37
+ - name: audit
38
+ kind: command
39
+ source: team
40
+ ```
41
+
42
+ A bare member always belongs to this profile's own source, even if another source has the same name. An external member always needs `source`, and that name must appear in the profile's `depends-on`. Add `kind` when several kinds share a name in that source. Missing members never retarget. External sources need distinct portable names; repair missing or clashing names in their declarations. Machine-local registration UUIDs and commit pins do not belong in a manifest. Required dependencies follow each resource's source `depends-on` rules. Optional edges are not expanded. New defaults never enter a saved profile without an explicit edit.
43
+
44
+ 4. Write the files, run `tack check /absolute/path/to/source /absolute/path/to/companion-source`, and repeat until clean. A source folder checks declarations, resources and every profile file. A profile file can be checked directly with its companion source folders. This authoring scope is stateless: it does not read registrations or require state initialization. The combined report gives file:line findings, structure, source linkage and direct/required inventory. Errors exit 1; warnings exit 0. No authored code or hooks run.
45
+
46
+ For source-based use, required external sources must already be available and registered. Check does not fetch or register them. A content bundle supplies retained source projections and registers them locally before delivery, without original source access.
47
+
48
+ Before application, verify an isolated context and every resolved destination, or list every root sharing the intent. Force never bypasses isolation or foreign-content protection. Read [apply](references/apply.md) before any apply: isolation, force, user targets, retained inventory and skipped members.
49
+
50
+ ## Apply from registered sources
51
+
52
+ `tack profile` lists the declared profiles by their SOURCE:PROFILE. Preview `tack profile apply SOURCE:PROFILE --project PROJECT --target-root /absolute/project`, with one `--target-root` for every registered root of the project, or `--user --target-home /isolated/home` with a matching HOME and an explicit state directory inside that home. Review the destinations, members and additions and removals, then repeat with `--apply`. Existing picks, exclusions, enabled profiles, mounts or an earlier application need `--force`, which replaces them for good: apply is one-way. The links of computed defaults do not need it. A fixed context then refuses ordinary `pick` and `explore` edits with `profile-fixed-context`.
53
+
54
+ ## Daily selection and profiles
55
+
56
+ Built-in release-owned skills are always delivered and locked. Selection copies omit them and say so in preview. A hand-written profile may still name them: check warns with `profile-builtin-omitted`, while apply and enable skip those members with a note. They do not become fixed inventory. Ordinary resources with the same name in another source remain normal members.
57
+
58
+ Use `tack profile save /path/to/source NAME --project PROJECT` to preview effective user + one project membership, its origins and file/declaration changes. `--apply` saves only the source profile. `--input user` and `--input project --project PROJECT` narrow the input; `--edit` explicitly updates an existing profile. Saving delivers nothing.
59
+
60
+ `tack profile enable SOURCE:PROFILE --project PROJECT` (or `--user`) turns a profile on at once as a live layer and `tack profile disable` turns it off: picks never change and win over members, and sync previews the links. The `use-tack` skill owns its rules.
61
+
62
+ Follow [copy workflows](references/copy-workflows.md) for CI, VPS and team-sharing walkthroughs, input narrowing, explicit existing-profile edits and cancellation without writes.
63
+
64
+ ## Port a profile as content
65
+
66
+ Preview `tack profile export SOURCE:PROFILE /artifacts/profile.tar.gz`, then add `--apply` after reviewing exact files, integrity facts, support closure and non-secret prerequisites. Read the manifest with `tack profile inspect-bundle /artifacts/profile.tar.gz` and validate it with `tack check /artifacts/profile.tar.gz`. Both work offline without local state; inspection is a content read-out, while check verifies complete projected profile linkage and inventory. Preview `tack profile apply-bundle /artifacts/profile.tar.gz --project PROJECT --target-root /repo`, then add `--apply` after complete-target review. It retains content and registers its source projections before fixed delivery, preserving originals and the same refusal/force contract.
67
+
68
+ Read [portable content](references/bundles.md) before export/apply: it defines bundle-support, package completeness, known sensitive paths, bounded archives, pristine-recipient setup, identity conflicts, immutable payloads and incomplete-delivery recovery. Bundle operations never execute supplied code, fetch content or install packages.
@@ -0,0 +1,33 @@
1
+ # Apply a profile from registered sources
2
+
3
+ The mechanics behind `tack profile apply`: what to verify before it, what each target needs, and what application retains. The `author-tack-profiles` skill gives the commands.
4
+
5
+ ## Before application
6
+
7
+ For source-based use, required external sources must already be available and registered. Check does not fetch or register them. A content bundle supplies retained source projections and registers them locally before delivery, without original source access.
8
+
9
+ Before application, verify an isolated context and every resolved destination, or list every root sharing the intent. Scratch HOME/state paths alone do not prove isolation. Existing selection includes explicit picks/exclusions, enabled profiles, docs settings, mounts, owed removals and empty/incomplete prior applies; computed defaults and the links they made do not count. Force replaces that intent only and never bypasses isolation or foreign-content protection.
10
+
11
+ ## Apply to a project
12
+
13
+ Preview `tack profile apply SOURCE:PROFILE --project PROJECT --target-root /absolute/project`. Repeat `--target-root` for every registered root of that project. After reviewing the physical destinations, direct/required members, per-kind roles and additions/removals, repeat with `--apply`. A fresh target with only computed defaults needs no force, and neither do the links they made. Existing picks, exclusions, enabled profiles, docs settings, mounts, owed removals, target recovery or a retained empty/incomplete apply require explicit `--force`. Foreign/changed entries stay protected and incomplete delivery remains visible.
14
+
15
+ ## Apply for the user
16
+
17
+ For user application, use `tack profile apply SOURCE:PROFILE --user --target-home /isolated/home` with matching HOME and an explicit state directory inside that home. Verify adapter parents resolve inside every authorized root. A different HOME that reuses ordinary state, a parent link reaching outside the target, or a partial root list refuses even with force. Project application leaves user paths and other projects alone; ambient user instructions and release skills remain outside profile control. Context stays inspectable.
18
+
19
+ ## What application retains
20
+
21
+ Apply retains exact local identities, including empty and incomplete inventories. `tack sync` and recovery use that inventory without adding new defaults or following later manifest edits. A changed required closure reports `profile-inventory-unresolved` and needs explicit reapply. Reapply still requires force when intent exists. Ordinary pick and explore edits in a fixed context refuse with `profile-fixed-context`; choose a separate daily-selection context. Inspect status and doctor for intended inventory and incomplete delivery. A member an enabled agent cannot take, such as a command for Claude Code, is skipped for that agent and still reaches every agent that takes it: apply lists it under `Skipped for AGENT` with the reason and its plan's `delivery.skipped`, apply and sync stay successful, and doctor's profiles check passes with a note. With no enabled adapter, delivery is incomplete: sync and status report `profile-delivery-incomplete` and doctor's profiles check fails.
22
+
23
+ Saves serialize updates to a source. A concurrent save or an intervening file edit produces `profile-save-conflict`; reload before retrying. Temporary staging files are removed on refusal.
24
+
25
+ ## Leave a fixed context
26
+
27
+ Apply is one-way: `--force` erases the picks, docs settings and enabled profiles it replaces, and no command brings them back. A fixed context ends in three ways: `tack project remove PROJECT` (then register the project again), `tack source remove SOURCE` of the source that declares the profile, or `tack state reset`. Each previews first. For a set to turn on and off, use `tack profile enable` in a context that keeps its own selection.
28
+
29
+ ## Edit a profile in the terminal explorer
30
+
31
+ The terminal explorer is for people; agents use `tack catalog --details`. In `tack explore`, press `d` and choose a profile or a new profile under Profiles. Profile mode lists opt-in and incompatible resources too, and rows show `● member`, `● required` or `○ not a member`. A project the profile is applied to opens read-only and says `fixed by SOURCE/PROFILE`. `i` toggles a positive member, `x` removes one, and `c` reviews direct and required inventory before save. Destination changes require save, discard or cancel when edits are pending. Profile save writes only its file and declaration.
32
+
33
+ In `tack explore`, the in-window save flow reviews/adjusts members before source/name choice, then shows the authoring diff before final save.
@@ -0,0 +1,59 @@
1
+ # Portable profile content
2
+
3
+ `profile apply` needs reachable registered sources. A bundle supplies copied content and fresh recipient-local source registrations; it is separate from `import add`, which copies upstream skills into an authored source and maintains import provenance.
4
+
5
+ ## Export and check
6
+
7
+ Preview `tack profile export tools:ci /artifacts/ci.tar.gz`. The report lists direct/required resources, source keys, exact files, sizes, modes, SHA-256 digests, provenance and setup requirements. Review known sensitive-path findings, then repeat with `--apply` to write a new artifact. Export never overwrites an occupied output. Source names do not pin revisions: the bundle freezes current bytes, including local edits to imported skills, and records their upstream facts as provenance.
8
+
9
+ `tack profile inspect-bundle /artifacts/ci.tar.gz` reads its manifest, files and setup information. Run `tack check /artifacts/ci.tar.gz` to validate archive safety, integrity and the projected profile's actual direct/dependency inventory. Both work without state, original sources or network. Neither imports supplied modules, runs supplied code, fetches content or installs packages. Checksums establish integrity, not publisher authenticity.
10
+
11
+ The artifact contains `manifest.json`, the defining profile file, source-separated projections and only required resource/support content. Skills include their whole folders; commands/context keep source-relative files/support. Operator state, UUID authority, journals, ownership records, execution history, dotenv and credentials are excluded. Known sensitive paths refuse even when declared as support, including `.git-credentials`. Ordinary authored text is not certified secret-free.
12
+
13
+ ## Declare support before claiming completeness
14
+
15
+ Commands, context and skills can declare required support in a `bundle-support` entry of their source's `tack.yaml`; an extension's skill says when one of its resources needs one. Every entry names one existing resource and uses `complete: true`, `files` and non-secret `prerequisites`. Files/directories are source-relative. No tool discovers closure by executing content.
16
+
17
+ ```yaml
18
+ version: 1
19
+ name: tools
20
+ skills:
21
+ - path: skills
22
+ profiles:
23
+ - name: ci
24
+ path: profiles/ci.yaml
25
+ bundle-support:
26
+ - kind: skill
27
+ name: review
28
+ complete: true
29
+ files: [shared/checklist.md]
30
+ prerequisites: [GitHub CLI]
31
+ ```
32
+
33
+ If modules import external packages, include package.json and lock information and name the package in the setup prerequisites. Materialize workspace/file dependencies or declare published external prerequisites. No package hook runs automatically.
34
+
35
+ Any non-literal import/require argument is computed. Missing helpers, undeclared package facts or computed module paths produce `profile-bundle-incomplete` with a repair. Add the named regular content; do not execute it to infer closure. Source symlinks require explicit materialization. Context stays inspectable.
36
+
37
+ ## Apply in a fresh dedicated environment
38
+
39
+ Provision the bundle separately, then use this sequence with an explicit state directory:
40
+
41
+ ```sh
42
+ tack --state-dir /var/lib/tack-ci state init
43
+ tack --state-dir /var/lib/tack-ci project add ci --repository-cwd /workspace/repo --apply
44
+ tack --state-dir /var/lib/tack-ci adapter enable cursor --apply
45
+ tack --state-dir /var/lib/tack-ci profile apply-bundle /artifacts/ci.tar.gz --project ci --target-root /workspace/repo
46
+ tack --state-dir /var/lib/tack-ci profile apply-bundle /artifacts/ci.tar.gz --project ci --target-root /workspace/repo --apply
47
+ ```
48
+
49
+ No original `source add`, prior ordinary sync or force is needed for this fresh defaults-only target. Repeat `--target-root` for every root sharing the named project. User application instead needs `--user --target-home /isolated/home`, matching HOME and an explicit state directory inside that home. Scratch paths that still share ordinary user intent or redirected adapter parents refuse. Force never authorizes partial roots, unsafe parents or another context's recovery.
50
+
51
+ Apply validates the complete boundary before retaining payloads, registering projections or replacing selection. It retains content under the explicit state directory and creates fresh local identities mapped from artifact/source keys. Original registrations and bytes remain independent, including newer same-name originals. Every resource/dependency resolves through the artifact mapping; missing members never fall back to originals. Qualified `bundle-…` labels distinguish retained projections. They do not contribute ordinary defaults to other targets; enabling a bundle profile there brings its members. A member wins over a default-selected original of its name; a required dependency collides with one, and an exclude of the original settles it.
52
+
53
+ Existing picks, exclusions, enabled profiles, mounts, owed removals, recovery records and empty/incomplete applications require `--force`. Foreign files remain protected conflicts. Intent and payloads remain after incomplete delivery, even with zero successful links; subsequent sync retries the same fixed inventory. Reapplying an identical artifact reuses only its verified registrations and content, and still needs force when intent exists. Different revisions keep distinct retained payloads.
54
+
55
+ `profile-bundle-identity` means conflicting source keys/mappings, changed retained bytes or foreign occupied payload paths. Repair the named mapping/path or choose another dedicated context; force cannot overwrite or rebind it. Retained projections are immutable: save into an authored source instead of editing them. Status/doctor expose `source-bundle-changed` when retained integrity fails. Do not remove payloads still referenced by links or recovery.
56
+
57
+ `profile-bundle-file-access-failed` means a file the command reads or writes cannot be accessed: the bundle named on the command line, the export output or a retained payload path. The message names the path and the reason, such as "it does not exist". Correct the path or its permissions and run the command again.
58
+
59
+ The initial bundle version is 1, using bounded POSIX ustar regular files/directories in gzip: 8 MiB compressed, 32 MiB expanded, 8 MiB per file, 5,000 entries. Unsafe/absolute/traversing paths, duplicates, case/Unicode conflicts, unsafe parents, links, special files, unsupported versions and bad digests refuse before target mutation. `profile-bundle-version` requires a compatible release or a version-1 export; source, profile, bundle and state versions are independent.
@@ -0,0 +1,46 @@
1
+ # Copy workflows
2
+
3
+ Saving, enabling and applying have different effects. Enable turns a live layer on for one project or the user, and disable turns it off; picks never change. Save writes a source profile/declaration. Apply retains exact inventory for a complete dedicated target. None of these operations executes resource content.
4
+
5
+ Built-in release-owned skills are always delivered and locked. Selection copies omit them and say so in preview. A hand-written profile may still name them: check warns with `profile-builtin-omitted`, while apply and enable skip those members with a note. They do not become fixed inventory. Ordinary resources with the same name in another source remain normal members.
6
+
7
+ ## CI agent for one repository
8
+
9
+ In a registered repository, open `tack explore`, press `d`, then choose “User + project … (default)” under “Save selection as profile”. The containing project is offered first. Outside a registered repository, choose one named project. User-only and project-only are explicit choices in this same window; there is no every-project composition or precedence between levels.
10
+
11
+ Review the effective membership and user/project origins. Exact duplicates appear once with both origins, and required dependencies remain visible. Use `i` or `x` to adjust members explicitly; select project-only if personal tools should not enter CI. Review with `c`, confirm the membership, choose the destination source, then enter “ci-review”. Review the before/after file and declaration, then confirm save. Cancel at any review or source/name chooser before saving to leave files, picks and links unchanged. A pending destination change asks for save, discard or cancel.
12
+
13
+ For an existing profile, choose its declared entry at the source/name step. This is an explicit edit, with its prior file and proposed membership shown before save. A new-name collision refuses; it never silently overwrites a declared profile.
14
+
15
+ Agents can preview the same copy without an interactive terminal:
16
+
17
+ ```sh
18
+ tack profile save /path/to/source ci-review --project demo
19
+ tack profile save /path/to/source ci-review --project demo --apply
20
+ ```
21
+
22
+ `--input user+project` is the default. `--project` may be omitted inside the intended registered repository. Use `--input project --project demo` to narrow the copy. Use `--edit` for an explicit existing-profile update after reviewing the diff. The command copies the complete chosen input; use `tack explore` to adjust individual members before source/name choice.
23
+
24
+ Later daily picks and new source defaults do not rewrite the saved file. An edit of the file reaches the next sync of every project or user it is enabled for. Required dependencies are resolved when a profile is checked/applied; explicitly reapply changed inventory to a fixed target.
25
+
26
+ ## General or repository-bound VPS
27
+
28
+ Choose user-only for a general toolbox:
29
+
30
+ ```sh
31
+ tack profile save /path/to/source toolbox --input user
32
+ ```
33
+
34
+ A repository-bound agent can keep user + one deployment project, then explicitly remove user resources in `tack explore`. Review external source linkage and runtime requirements. Every external member keeps its source qualifier even when globally unique. Missing or clashing portable source names require a distinct `name` in their declarations; UUIDs are never substituted.
35
+
36
+ ## Use a team profile day to day
37
+
38
+ ```sh
39
+ tack profile enable tools:ci-review --project demo
40
+ tack sync --project demo
41
+ tack sync --project demo --apply
42
+ ```
43
+
44
+ The profile's members join the project's selection at every sync, as the file lists them then, so a `git pull` in the source reaches the next sync preview. A teammate's own excludes and includes win. `tack profile disable tools:ci-review --project demo`, then a sync, returns to exactly their own selection. Enable lists the includes that equal a member: `tack pick remove` each one the profile should own. An earlier Tack could copy a profile into picks: it left such includes, includes of the members' required dependencies, which enable does not list, and docs attachments. Remove those with `tack pick remove` and `tack docs detach`. The excludes it turned into includes cannot be recovered.
45
+
46
+ To share a setup this way, save it project-only to leave personal user picks out, or keep the combined input after reviewing origins. The teammate registers the same sources, then enables the profile. A fixed context refuses enabling: choose a daily context.
@@ -0,0 +1,75 @@
1
+ ---
2
+ name: manage-tack-sources
3
+ description: Author Tack sources, folders of skills, commands and context. Use before editing any file inside a source, to check its maintainers first, and to create or register a source, declare resources in tack.yaml, set dependencies, resolve name clashes or fix catalog issues.
4
+ metadata:
5
+ tack: |
6
+ version: 1
7
+ activation: opt-in
8
+ user-activation: default
9
+ ---
10
+
11
+ # Manage Tack sources
12
+
13
+ A source is a directory that holds resources. It is the only grouping Tack has: a resource is identified by its source, its kind and its name. This skill creates, changes and registers sources. `use-tack` operates Tack (pick, sync) and owns the output and preview-before-`--apply` rules that apply here. `author-tack-profiles` owns `profiles` and `bundle-support`. Tack's state files are Tack's to write.
14
+
15
+ ## Before changing a source
16
+
17
+ Read its `maintainers` and `guidance` and follow them: the generated `tack-sources` skill (`tack-user-sources` for the user) lists both for each linked source. `maintainers` is descriptive contact information, not an edit permission or a resource grouping. Work within the operator's requested scope. Tack's own built-in source stays as shipped.
18
+
19
+ ```sh
20
+ tack source # each source: label, guidance, maintainers, path, health, declarations
21
+ tack catalog --details # resources, the declared path that found each, and issues to fix
22
+ ```
23
+
24
+ Read both text views before changing anything. `catalog` exits 1 while any issue remains, and `source` stays healthy when a declaration has problems: read `issues` and every declaration's `problems` before you report success.
25
+
26
+ ## Declare resources in `tack.yaml`
27
+
28
+ Tack reads resources only from the `tack.yaml` at the top of the source. A folder is never read because of its name: a folder called `skills/` means nothing until a declaration names it. List each folder that holds resources under its kind. A folder of one kind alone declares itself as `.`, such as `skills: [{ path: . }]`. A subfolder with its own `tack.yaml` is another source.
29
+
30
+ ```yaml
31
+ version: 1
32
+ name: quality-tools
33
+ skills:
34
+ - path: skills
35
+ exclude: ["**/_*/**"]
36
+ ```
37
+
38
+ `version: 1` is the only version. Every key but `version` and `name` is optional. `name` is the label others write, as in `quality-tools:review`: up to 64 lowercase letters, digits and single hyphens, never taken from the folder. `description`, `guidance`, `maintainers` and `depends-on` describe the source; `skills`, `commands` and `context` declare resources; extensions add keys of their own: `tack extension` lists them, and each one that is on brings its own skill. Read [references/tack-yaml.md](references/tack-yaml.md) before writing an entry: paths, overlap, patterns, the leaf rule and the `imports` section Tack writes: never edit it. For a complete source with patterns, dependencies and name clashes, follow [the worked example](references/worked-source.md).
39
+
40
+ | Kind | Name |
41
+ | ------- | -------------------------------------------------------------------------------------------- |
42
+ | skill | Its folder name, which must match `name` in `SKILL.md`; the file also needs a `description`. |
43
+ | command | File name without `.md`. |
44
+ | context | Path inside the declared folder, with its extension, such as `notes.md`. One file: its name. |
45
+
46
+ Skill and command names use lowercase letters, digits and single hyphens. Two resources of one kind and name in one source are both quarantined.
47
+
48
+ Skills and commands may carry Tack metadata in the `metadata.tack` YAML string of their frontmatter: `activation`, `user-activation`, `projects` and `dependencies`. `depends-on` in `tack.yaml` is the source-level allow list a dependency on another source needs. Read [references/metadata.md](references/metadata.md) before writing either.
49
+
50
+ ## Create and register a source
51
+
52
+ 1. Look inside the folder, then ask the person what each folder holds and which ones Tack should serve. `PATH/SKILL.md` makes PATH one skill: offer its parent as a folder of skills, or `tack import add` for a remote repository.
53
+ 2. Without `tack.yaml`: preview its declaration with `tack source add PATH --config '<json>'` (or `--config -` from standard input), such as `{"version": 1, "name": "skills", "skills": [{"path": "."}]}`. `tack guide tack-yaml` lists every key. Show the preview, ask once, rerun with `--apply` ([declaration creation](references/tack-yaml.md#declaration-creation)).
54
+ 3. Edit an existing `tack.yaml` by hand, then run `tack check /absolute/path` (with any companion source folders), or a bare `tack check` from inside the source folder, until clean. It reads no state and runs no authored code. Errors exit 1.
55
+ 4. With an existing `tack.yaml`, `tack source add /absolute/path` previews the registration: the name the source takes, its counts and issues. `--apply` registers it, links its default resources in every project and for the user, and sets up state when Tack has none. `--config` on such a source fails with `declaration-exists`.
56
+ 5. Run `tack catalog --details`, fix every issue and repeat. `doctor` and `status` show health. Deliver with `use-tack`.
57
+
58
+ To add a folder such as `vendor/skills`, add `- path: vendor/skills` under its kind. Never declare a folder inside or around another declared folder unless the outer entry excludes it (`exclude: ["vendor/**"]`). Then run `tack catalog` and `tack source`, and suggest `sync` only when the catalog is clean.
59
+
60
+ A moved source keeps its registration: `tack source relocate REGISTRATION_ID /new/path`. A retired one leaves with `tack source remove SOURCE`, which previews first and never touches its files. Registering, relocating, removing, `sync` and `pick` happen only when the operator asks.
61
+
62
+ ## Resolve name clashes
63
+
64
+ The same kind and name in different sources gives two healthy resources; a bare reference fails when it cannot choose. Qualify it as `source:name` with the source label:
65
+
66
+ ```sh
67
+ tack pick include base-skills:lint --project PROJECT
68
+ tack pick exclude audit-tools:lint --project PROJECT
69
+ ```
70
+
71
+ Within one source, rename one skill's folder and frontmatter `name`, or exclude it. Group folder names never qualify a resource. Two default-activated skills with one name are both withheld until the operator includes one or excludes the other. See [the worked example](references/worked-source.md#resolve-name-clashes).
72
+
73
+ ## Fix catalog issues
74
+
75
+ [references/catalog-issues.md](references/catalog-issues.md) gives the fix for each code `catalog` and `source` report, such as `declaration-path-overlap`, `declaration-reaches-source` and `resource-boundary-violation`, and the rules for bundle-provided sources. Read it before fixing an issue.
@@ -0,0 +1,38 @@
1
+ # Catalog issues and their fixes
2
+
3
+ The fix for each issue `catalog` and `source` report. Run `tack catalog --details` and `tack source` after each fix, and repeat until both are clean.
4
+
5
+ ## Read `source` and `catalog`
6
+
7
+ Read the text views of `source` and `catalog`; their JSON has no stable schema.
8
+
9
+ `source` shows a `label` and `maintainers` for every registered source, and for a healthy one its `declarations`: each entry's kind, `path`, `include` and `exclude` patterns, the number of `resources` it contributes and its `problems`, each with a reason code. A declaration that finds nothing shows `0` and is valid. `catalog` lists issues with the exact fix in each message, and with `--details` each resource carries `declaredPath`, the entry that found it. Read both before changing anything. `catalog` exits 1 while any issue remains, and `source` stays healthy when a declaration has problems: read `issues` and every declaration's `problems` before you report success.
10
+
11
+ ## Faults in the file
12
+
13
+ A fault in the file makes the whole source unhealthy: `declaration-missing`, `declaration-malformed` (broken YAML, or a key twice in one mapping), `declaration-version-unsupported`, and `declaration-schema-invalid` for an unknown top-level key such as `kind`, another resource key beside a `.` entry, or a bad `name`, `maintainers` or `depends-on`. A bad entry is quarantined alone.
14
+
15
+ ## Issues
16
+
17
+ | Issue | Fix |
18
+ | ---------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
19
+ | `declaration-resources-undeclared` | The source has no resource key and a folder named for a resource kind. Add the entries its message names, or an empty list. |
20
+ | `declaration-entry-invalid` | The entry does not decode: an unknown key, a wrong type, a missing `path`, or patterns on one skill, command or file. Other entries still load. |
21
+ | `declaration-path-invalid` | The `path` is empty, absolute, has a `.` or `..` segment, an empty segment or a backslash, names the source's own `tack.yaml`, or is a `context` entry `.`. |
22
+ | `declaration-path-outside-source` | The path resolves outside the source, or to the source folder by another path than `.`. Point it inside, or move the content into the source. |
23
+ | `declaration-path-missing` | Nothing exists at the path. Create it, fix the spelling, or delete the entry. |
24
+ | `declaration-path-wrong-type` | The path has the wrong type: a folder for `skills`, a folder or file for `context` and a folder or `.md` file for `commands`. |
25
+ | `declaration-path-overlap` | Two resource entries, or a profile declaration and one of them, are equal or nested; every one is refused. Add the `exclude` the message names to the outer folder entry, or keep one. |
26
+ | `declaration-reaches-source` | The path is or lies inside a folder with its own `tack.yaml`, or a walk met one and skipped it. Declare those resources there, add `exclude: ["FOLDER/**"]`, or delete the nested `tack.yaml`. |
27
+ | `source-is-one-skill`, `declaration-inside-source` | A source with a skills entry `.` holds `SKILL.md`: register its parent. `source add` refused a `tack.yaml` another source reaches: exclude the folder there first. |
28
+ | `resource-boundary-violation` | A file or link inside a declared folder resolves outside it. Declare the real path, or remove the link. |
29
+ | `skill-name-mismatch`, `skill-name-reserved`, `skill-frontmatter-*`, `skill-metadata-*`, `command-*` | Fix the frontmatter the message names. The skill folder name must equal `name`; `tack-sources` and `tack-user-sources` are reserved for the skills Tack generates. |
30
+ | `source-declares-no-resources`, `source-description-long`, `source-guidance-long`: warnings | Empty but healthy: add a resource key or an empty list. Keep `description` to 200 characters and the `guidance` bodies to 2,048 bytes together, which the `tack-sources` skill inlines. No exit code changes. |
31
+ | Dependency source undeclared or ambiguous | Add the label to `depends-on`, or add `source: LABEL` to the edge. |
32
+ | Declared source not registered, or unhealthy | `tack source add` for it, or remove the label from `depends-on`. An unhealthy one: `tack check` the path the blocker names. |
33
+ | `skill-address-duplicate` or `resource-address-duplicate`: one kind and name twice in one source | Both are quarantined, whichever declarations found them. Rename or delete one. Only the same name in different sources is allowed. |
34
+ | Source label reserved or duplicated | Change `name`. Two sources with one label cannot qualify a reference until one changes. |
35
+
36
+ ## Bundle-provided sources
37
+
38
+ Bundle-provided sources are verified retained projections, identified separately from authored sources and release-owned built-ins. They contribute no ordinary defaults to unrelated contexts; enabling a bundle profile brings its members into a daily selection. A required dependency it brings collides with a default-selected original of the same name: exclude the original. Their bytes/mappings are immutable, and `source-bundle-changed` requires restoring retained integrity or another dedicated context. Do not relocate a projection or edit it as an authored source. Existing `import add` semantics remain separate: profile export records current imported bytes/provenance without running import or fetching.
@@ -0,0 +1,35 @@
1
+ # Resource metadata and dependencies in detail
2
+
3
+ The main skill says where Tack reads metadata and why a dependency may block a resource. This reference holds the metadata keys and the rules that decide where a dependency edge resolves.
4
+
5
+ Skills and commands may carry Tack metadata in the `metadata.tack` YAML string of their frontmatter:
6
+
7
+ ```yaml
8
+ metadata:
9
+ tack: |
10
+ version: 1
11
+ activation: opt-in
12
+ user-activation: opt-in
13
+ projects: [PROJECT]
14
+ dependencies:
15
+ - kind: skill
16
+ name: git
17
+ - kind: skill
18
+ name: lint
19
+ source: base-skills
20
+ optional: true
21
+ ```
22
+
23
+ `activation` sets default selection for projects and `user-activation` for the user. Both accept `default` or `opt-in`; omitted, projects get `default` and the user gets `opt-in`. `projects` limits default selection to the named projects and does not restrict the user. An explicit pick wins in its own namespace, then an enabled profile that names the resource. Context items carry no metadata: they are always opt-in, selected only by `pick include` or an enabled profile, and have no delivery adapter yet.
24
+
25
+ Dependencies are declared per resource, in `metadata.tack.dependencies`. `depends-on` in the source's `tack.yaml` is the source-level allow list: a resource may always depend on its own source, and on another source only when its source lists that source's label in `depends-on`. Declare the source relationship explicitly before adding a cross-source edge. See [the worked source](worked-source.md) for matching declarations and skill frontmatter.
26
+
27
+ An edge names a `kind` (`skill` or `command`) and a `name`. These rules decide where it resolves:
28
+
29
+ 1. A resource may depend on a resource in its own source.
30
+ 2. It may depend on another source's resource only when its own source lists that source's label in `depends-on`.
31
+ 3. An edge without `source` looks in its own source first, then in the declared sources. Several matches block the requester: add `source: LABEL` to the edge.
32
+ 4. An edge with `source` must name its own source or a declared one.
33
+ 5. A declared source that is not registered, or not healthy, blocks a required edge and skips an optional one. An unregistered source is `source-unregistered`: fix it with `tack source add`. While a registered source cannot be read, its label is unknown, so the reason is `source-unhealthy` and lists that source's path: fix it with `tack check <path>`.
34
+
35
+ `tack check` applies these rules to every edge before registration, using only the source folders passed to it: pass each declared source's folder with the source. It reports an edge that names no single resource at its line, as `dependency-missing`, `dependency-quarantined`, `dependency-source-undeclared` or `dependency-ambiguous`. An optional edge is a warning, and so is an edge that resolves nowhere in the check while a declared source is missing from it (`dependency-source-unchecked`, which names it) or cannot be read (`dependency-source-unhealthy`). An edge that resolves is not checked against a missing source, which could still make it ambiguous: pass every declared source.
@@ -0,0 +1,114 @@
1
+ # The source `tack.yaml` in detail
2
+
3
+ A source declaration is version 1, the only version Tack reads. Beside ordinary resources it accepts `profiles`, an explicit list of `{ name, path }` declarations. Each file has its own profile schema and version. Use `author-tack-profiles` for the manifest and linkage rules. `tack check` reports malformed profile declarations/files while leaving unrelated healthy resources available. It also accepts `bundle-support`, which names explicit resource support files/directories, complete closure and non-secret setup prerequisites. Read `author-tack-profiles` before authoring that section.
4
+
5
+ A `tack.yaml` names folders and files in resource keys; the rules below are its rules. The path `.` names the folder that holds the `tack.yaml` itself.
6
+
7
+ **The label.** `name` is the label operators and other sources write, as in `quality-tools:review`: up to 64 lowercase letters, digits and single hyphens. Every `tack.yaml` declares it: the label never comes from the folder. `tack`, `tack-docs`, `tack-scripts` and generated `bundle-` labels are reserved, a registration-ID-shaped value is rejected, and two sources with one label cannot qualify a reference until one changes. Picks store IDs, never labels.
8
+
9
+ **Resource keys.** Every key but `version` and `name` is optional, so a source may declare only what it holds, such as `commands` alone. Each resource key is a list and may be empty: `skills: []`. A kind with no entries has no resources, whatever folders exist, so name every folder that holds resources. Group folders, the folders between a declared folder and a resource, organize a source and never change a name. `skills`, `commands` and `context` entries have a `path` to a folder or one resource, `.` for the source folder (never for `context`), and optional `include` and `exclude` globs that need a folder. A key an extension adds takes entries of its own shape, which that extension's skill gives. Add `exclude` patterns only for what must stay out, such as archives: `exclude: ["**/_*/**"]`.
10
+
11
+ ## The source folder
12
+
13
+ ```yaml
14
+ version: 1
15
+ name: review-skills
16
+ skills:
17
+ - path: .
18
+ ```
19
+
20
+ - A `skills` entry `.`: the source folder is a folder of skills. Its walk finds each folder below it that holds `SKILL.md`, as for any skills folder.
21
+ - A `commands` entry `.`: each `.md` file below the source folder whose name is a command name is a command. Exclude a `README.md` with `exclude: ["README.md"]`.
22
+
23
+ A `.` entry walks the source folder as a declared folder, with `include` and `exclude`, and it passes over dot, underscore and `node_modules` names, so `_drafts/` and `.git/` stay out. It passes over another source's folder without a finding. A `tack.yaml` with a `.` entry declares that one kind: another resource key would read the same files, so `tack check` refuses each other key with `declaration-schema-invalid`. To hold several kinds, keep the one `tack.yaml` and list each folder under its kind instead of `.`: each skill folder at the top is an entry of its own.
24
+
25
+ ```yaml
26
+ version: 1
27
+ name: ops
28
+ skills:
29
+ - path: deploy-service
30
+ - path: rollback
31
+ commands:
32
+ - path: commands
33
+ ```
34
+
35
+ A `context` entry is never `.`: context would take every file, the `tack.yaml` too, so it is refused with `declaration-path-invalid`. A source with a skills entry `.` whose folder holds `SKILL.md` is one skill, and the source is unhealthy with `source-is-one-skill`: register the folder above it, or import it with `tack import add`.
36
+
37
+ `kind` is no key of a `tack.yaml`. `tack check` refuses it with `declaration-schema-invalid` and prints the `tack.yaml` to write instead, with the kind's `.` entry.
38
+
39
+ A key a `tack.yaml` mapping names twice, anywhere in the file, is refused with `declaration-malformed`, which names the key and both of its lines. Keep one of them, or merge two lists into one.
40
+
41
+ ## Description and guidance
42
+
43
+ A source tells agents what it holds and how to read, use and edit it in two optional keys:
44
+
45
+ ```yaml
46
+ version: 1
47
+ name: team-handbook
48
+ description: The team handbook - deploy, incident and review skills, and the runbooks.
49
+ guidance:
50
+ - when: Before you read or use any runbook.
51
+ body: |
52
+ Runbooks assume the staging cluster. The `personal/` folder holds one engineer's drafts:
53
+ do not follow them as team practice.
54
+ - when: Before you edit any skill or runbook of this source.
55
+ body: |
56
+ 1. Create a `handbook/` branch before the first edit, never commit on `main`.
57
+ 2. Add a line to `CHANGELOG.md` for every skill you change.
58
+ maintainers:
59
+ - platform-team
60
+ skills:
61
+ - path: skills
62
+ context:
63
+ - path: runbooks
64
+ ```
65
+
66
+ - `description` is one sentence of about 200 characters that names what the source holds, such as its skills or runbooks. An agent picks the right source by it.
67
+ - `guidance` is a list of entries. Each `when` is one trigger line that says when the entry applies; each `body` says what to do, in Markdown addressed to agents. Guidance can say how to read the source, such as which parts are a team's and which are personal, as well as how to change it. Put first what must happen before the first edit.
68
+
69
+ `tack sync` writes one `tack-sources` skill per project in Tack's state, never in a source, and links it into every enabled agent's skills folder; the user's links get `tack-user-sources`. It lists each source with a linked resource: its name, description, real path, maintainers and a Guidance block with every entry, its `when` in bold and its body quoted, in declaration order. A source linked only for the user is listed in `tack-user-sources` alone. When a source's bodies pass 2,048 bytes together, the skill keeps each `when` and points to the `tack.yaml` for the bodies, and `tack check` warns with `source-guidance-long`, naming the size of each entry. A description over 200 characters warns with `source-description-long`. An empty `description`, an empty `guidance` list, or an entry with an empty or missing `when` or `body` makes the source unhealthy with `declaration-schema-invalid`, at the entry's field such as `guidance[1].body`. After an edit, `tack status` reports the skill as stale until the next `tack sync`.
70
+
71
+ ## Entries
72
+
73
+ The main skill shows the shape of a declaration and the names it produces. This reference holds the rules for each entry. Tack reads resources only from entries declared here, and a bad entry is quarantined alone: the rest of the source keeps working.
74
+
75
+ **What each declaration contributes.** `tack source` lists the declarations of a healthy source with their patterns, the number of resources each one contributes and its problems. `tack catalog --details` shows `declaredPath` on each resource. A declaration that finds nothing, such as an empty folder before an import, is valid and shows `0`.
76
+
77
+ **Paths.** Every `path` is `.`, the source folder, or relative and `/`-separated, with no `.`, `..`, empty segment or backslash. After symlinks it must exist inside the source with the right type: a folder for `skills`, a folder or one file for `context` and a folder or one `.md` file for `commands`. Everything found inside a declared folder must resolve inside that folder, or it is refused with `resource-boundary-violation`: declare the other path instead. Resource declarations may not overlap, so one file belongs to one declaration: two entries overlap when their paths are equal or one lies inside the other, and every overlapping entry is quarantined with `declaration-path-overlap`. A profile declaration counts as a file entry, so a profile inside a declared folder is refused too. An `exclude` on the outer folder entry that prunes the inner path ends the overlap, because its walk never reaches that path: `skills` with `exclude: ["vendor/**"]` beside a `skills/vendor` entry. An `include` does not, since the walk still enters every folder. The finding names that exclude.
78
+
79
+ **Nested sources.** A source has one `tack.yaml`, at its top: declare every folder there rather than splitting a kind into a subfolder with a `tack.yaml` of its own. A nested `tack.yaml` is an edge case, such as a vendored repository that is a source already. Each `tack.yaml` marks the edge of a source. Below the source's root, a folder that holds `tack.yaml` and no `SKILL.md` is another source, registered or not, and this source never reads it: configurations never merge or inherit. An entry whose path is or lies inside such a folder is refused with `declaration-reaches-source`; declare those resources in that folder's `tack.yaml`. A skills, commands or context walk that meets one skips the folder and reports `declaration-reaches-source`; add `exclude: ["vendor/**"]` to the entry when the nesting is intended. A `tack.yaml` inside a skill folder is the skill's content.
80
+
81
+ **Patterns.** `include` and `exclude` match a resource's path relative to the declared folder: a skill's folder path, a command's or context item's file path. A resource is contributed when it matches an `include` (any path when absent) and no `exclude`. A folder whose relative path followed by `/` matches an `exclude` is not entered, so nothing inside it is read or reported. A folder whose name starts with an underscore means nothing: exclude archives with `exclude: ["**/_*/**"]`. Patterns need a declared folder: on an entry that names one skill, one command or one file, the entry is quarantined with `declaration-entry-invalid`.
82
+
83
+ **Skill folders are leaves.** A folder that holds `SKILL.md` is one skill and Tack never looks inside it for more skills: a `SKILL.md` below it is content. Tack finds skills, commands and context at any depth, and group folders never change a name.
84
+
85
+ **Imports.** `tack import add --into SOURCE --apply` writes a skill folder into a declared skills folder and one record per skill into the top-level `imports` key, after one blank line and the comment `# Written by tack import`. A record holds the skill's folder, the location, the ref and its kind, the resolved revision, the upstream folder and tree ID, the import time, and a SHA-256 and executable bit for every file as imported. Tack replaces only that block, as text, and keeps every other byte of the file, comments and line endings included; it rewrites the block whole, so hand edits inside it are lost. `imports` in flow style, with an anchor, indented or repeated, makes every import command refuse the source with the line number. The catalog never reads it, and a source with the key is unhealthy for releases that predate import (`declaration-schema-invalid`). While a write runs, Tack stages it in `.tack-import-staging/` at the top of the source; a declaration entry that names that folder or a path inside it is quarantined with `declaration-path-invalid`, and a leftover folder is finished or rolled back by the next `import add` or `import remove` with `--apply` for the source.
86
+
87
+ ## Declaration creation
88
+
89
+ `tack source add PATH --config '<json>'` writes `tack.yaml` from a declaration you write, never from a guess. The value of `--config` is the declaration itself, as JSON: the same keys and values as `tack.yaml`. `--config -` reads it from standard input instead, which suits a long declaration in a heredoc. A value is never read as a path, and YAML or any other text fails with `config-not-json`. `tack guide tack-yaml` lists every key a declaration and each entry takes, and `tack guide tack-yaml-schema` prints the JSON Schema of the whole declaration. The `imports` key is refused with `config-imports-not-allowed`: only `tack import add` writes it.
90
+
91
+ ```sh
92
+ tack init # once per machine; it writes at once
93
+ tack source add /absolute/path --config '{"version": 1, "name": "personal", "skills": [{"path": "."}]}'
94
+ tack source add /absolute/path --config '{"version": 1, "name": "personal", "skills": [{"path": "."}]}' --apply
95
+ tack check /absolute/path
96
+ tack catalog --details
97
+ ```
98
+
99
+ For a source with skills under `personal/skills` minus archived folders and a folder of commands, pass this declaration, on one line or through `--config -`:
100
+
101
+ ```json
102
+ {
103
+ "version": 1,
104
+ "name": "personal",
105
+ "skills": [{ "path": "personal/skills", "exclude": ["**/_*/**"] }],
106
+ "commands": [{ "path": "personal/commands" }]
107
+ }
108
+ ```
109
+
110
+ `source add` checks the config as `tack check` checks a `tack.yaml`, with the same decoder and the same catalog discovery. A config that does not decode fails before anything else, with every issue at once, each with its field and its line in the config: an unknown key names the keys its form takes, and a missing `name` suggests one from the folder. Exit 2, and `tack guide tack-yaml` is the next command. Otherwise the preview prints the `tack.yaml` that `--apply` writes, normalized to YAML in the order of the keys above, the source name to use in `SOURCE:NAME` references, and what each entry finds: the names of its resources, their count and its problems at their line in the config. It writes neither the file nor state, and never repeats the JSON back as a next command: run the same command again with `--apply`. `--apply` reads and checks the config again, exclusively creates the file, then registers the source; pipe the same JSON again for `--config -`.
111
+
112
+ It never overwrites an existing file, including one created by another process during the operation: `--config` on a source that has `tack.yaml` fails with `declaration-exists`. Edit that file by hand and run `tack check`. A bare `tack source add` on a folder without `tack.yaml` fails with `declaration-config-required` and suggests a declaration read from the folder's top: a skills entry `.` for skill folders there, plus a source of its own with a `.` entry for a `commands` folder beside them, or one entry per folder named after a kind. A folder that a registered source's skills, commands or context walk reaches, other than a `.` entry's, or that holds one of its declared paths, fails with `declaration-inside-source`: its new `tack.yaml` would take the folder out of that source. Exclude the folder there first, as the message says. A preview in which a declared resource cannot be read, such as a command whose frontmatter does not parse, is partial and lists each error under Problems with its file; `--apply` still registers the source. When every entry has a problem and finds no resource, as with a skills entry that names a Markdown file, the source would load nothing: the preview is partial with `declaration-loads-nothing` and offers no `--apply`, and `--apply` fails with the same code. Fix the entries, then preview again.
113
+
114
+ Registration remains permissive: fix every resource issue and repeat `tack check` until clean, then verify `catalog --details`. If registration fails after creation, the written declaration remains available to inspect and repair.