---
name: maintain-tack
description: Keep the built-in skills and the website docs in step with the code. Use before opening a PR that changes the Tack CLI (commands, flags, aliases, output, diagnostic codes, adapters, release or upgrade) the source format (tack.yaml, discovery, skill metadata, dependencies) or the reader's figure components, when writing tests or fixing a test warning, and when naming a new package; names what to update and compare.
---
# Maintain Tack's guidance
Tack ships four built-in skills in `apps/cli/src/builtins/skills`, and three in the extensions, under `packages/extension-ID/builtin`. Agents on every machine load them to operate Tack and to author sources, and nothing else tells them what changed. A skill left behind makes agents run removed flags, miss new rules and teach operators behavior that is gone. **Change the skills in the same PR as the behavior.** A PR that alters what a skill describes is not done until the skill says the new thing. The same holds for the website docs, the one home of the user documentation: see [Docs and READMEs](#docs-and-readmes).
To place the code of a new command, feature or domain concept, use the `tack-cli-architecture` skill.
## What to update
| File | Owns |
| ------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `apps/cli/src/builtins/skills/author-tack-profiles/SKILL.md` | Profile files, source linkage, `profile save`, layers (`enable` and `disable`), fixed application and bundle behavior. |
| `apps/cli/src/builtins/skills/author-tack-profiles/references/apply.md` | Fixed application: isolation, force, user targets, retained inventory, skipped members, how a fixed context ends, profile mode in `tack explore`. |
| `apps/cli/src/builtins/skills/author-tack-profiles/references/copy-workflows.md` | What `profile save`, `profile enable` and `profile apply` each write, with worked commands. |
| `apps/cli/src/builtins/skills/author-tack-profiles/references/bundles.md` | Profile bundles: `bundle-support`, export, inspect, check and apply, integrity and retention. |
| `apps/cli/src/builtins/skills/use-tack/SKILL.md` | Finding resources, the executable, state and scope, preview and apply, the stable JSON contract. |
| `apps/cli/src/builtins/skills/use-tack/references/setup.md` | `init`, the built-in skills, sources and projects, the extension switches, upgrade, state format, running a checkout. |
| `apps/cli/src/builtins/skills/use-tack/references/selection.md` | Selection defaults, picks, profiles on and off (layers, their order and diagnostics), `sync`, the adapter table and what each adapter delivers. |
| `apps/cli/src/builtins/skills/use-tack/references/imports.md` | `import add`, `import remove` and the `imports` records. |
| `packages/extension-docs/builtin/skills/use-tack-docs/SKILL.md` | Docs attachment, search, the writing destination and `tack check` on pages; which reference to read. |
| `packages/extension-docs/builtin/skills/use-tack-docs/references/declare-docs.md` | The `docs` key of `tack.yaml`, its `reader` settings, the `.` entry and its catalog issue. |
| `packages/extension-docs/builtin/skills/use-tack-docs/references/docs-maintenance.md` | Docs mounts in sync, removal, cleanup, status and explore, and what stays while docs is off. |
| `packages/extension-docs/builtin/skills/use-tack-docs/references/docs-in-profiles.md` | Docs in enabled and applied profiles, fixed contexts and bundles. |
| `packages/extension-docs/builtin/skills/use-tack-docs/references/review.md` | Receiving a review of a page with `tack docs review wait`: the loop, how each agent waits, what a review holds, what can fail. |
| `packages/extension-scripts/builtin/skills/author-tack-scripts/references/run-scripts.md` | `script run`, `script show`, `types` and the run history. |
| `apps/cli/src/builtins/skills/use-tack/references/maintenance.md` | Refresh, cleanup, removal reasons, links in the way, authoring checks, fixed profiles. |
| `apps/cli/src/builtins/skills/use-tack/references/output.md` | The JSON envelope, the stable payloads, exit codes and `internal-error`. |
| `apps/cli/src/builtins/skills/use-tack/references/explore.md` | `tack explore`, for an agent to explain to the operator: modes, rows and keys. |
| `apps/cli/src/builtins/skills/use-tack/references/onboarding*.md` | First-time setup that `tack guide onboarding`, `onboarding-2` and `onboarding-3` print: mode, depth, approvals, the setup steps, hand-over. Printed guides take no relative links; name `tack guide TOPIC` instead. Each prints in under 8,000 characters, and a part ends with the command for the next. |
| `apps/cli/src/builtins/skills/use-tack/references/day-two.md` | The commands for a new project, worktree, clone, source, skill, script or docs after setup, and for turning an agent or a profile on or off. |
| `apps/cli/src/builtins/skills/use-tack/references/agent-instructions.md` | The Tack section for a project's `AGENTS.md`: when to offer it, which file gets it, its exact text. |
| `apps/cli/src/builtins/skills/manage-tack-sources/SKILL.md` | The source `tack.yaml`, resource names and metadata, dependencies, name clashes, catalog issue fixes. |
| `apps/cli/src/builtins/skills/manage-tack-sources/references/catalog-issues.md` | Reading `source` and `catalog`, file faults, the fix for each catalog issue, bundle-provided sources. |
| `apps/cli/src/builtins/skills/manage-tack-sources/references/tack-yaml.md` | Every `tack.yaml` key and version, declared paths, patterns and `profiles` declarations. |
| `apps/cli/src/builtins/skills/manage-tack-sources/references/metadata.md` | Resource metadata keys and where a `depends-on` edge resolves. |
| `apps/cli/src/builtins/skills/manage-tack-sources/references/worked-source.md` | Complete source layout, patterns, scripts, docs, resource dependencies and name-clash fixes. |
<!-- ‹guest · 2026-12-04› -->
| `packages/extension-scripts/builtin/skills/author-tack-scripts/SKILL.md` | Declaring, running and inspecting scripts with the scripts extension, and where its references are. |
| `packages/extension-scripts/builtin/skills/author-tack-scripts/references/script-api.md` | Writing a script with `defineScript`: arguments, secrets, the run context, outcome codes and dependencies. |
| `packages/extension-scripts/builtin/skills/author-tack-scripts/references/scripts-in-sources.md` | The `scripts` entry of `tack.yaml`, its paths, overlap and catalog issues. |
| `packages/extension-scripts/builtin/skills/author-tack-scripts/references/scripts-in-profiles.md` | Scripts in profiles, application and bundles. |
| `packages/extension-*/builtin/guides` | The sections an extension adds to `tack guide day-two` and the onboarding parts while it is on, one file per guide. |
| `apps/cli/src/builtins/skills/prepare-tack-checkout/SKILL.md` | Linking a repository's skills at the start of work in a new clone or worktree, and the approval its section gives. |
| `packages/extension-docs/builtin/skills/write-reader-figures/SKILL.md` | Writing figures in docs: when to draw, which component, the rules, `tack check`. Update it with the reader's figure catalog. Its `references/figure-components.md` and `references/figures/` are generated: run `bun run figures:reference`. |
| `packages/extension-docs/builtin/skills/write-reader-figures/references/rules.md` | The `System` and `Schema` rules, where to be bold, deriving figure data from code. |
| `packages/extension-docs/builtin/skills/write-reader-figures/references/page-components.md` | Authored figures, icons, callouts, tabs, terms and questions. |
| `apps/website/docs/docs` | Every user use case and reference, for people and agents: guides for tasks, `reference/` pages for every command, flag, file format, code and payload. Skills summarize them; they must agree. |
| `CONTEXT.md` | The glossary. |
| `README.md`, `apps/*/README.md`, `packages/*/README.md` | Short pages that point to the website docs. A package README holds only its local setup (run, build, test) and its layout. |
The built-in `tack.yaml` (`apps/cli/src/builtins/tack.yaml`) declares the core's built-in skills, and `packages/extension-ID/builtin/tack.yaml` those of an extension, which join the catalog while it is on. Add a skill there only on purpose: every built-in skill is installed for the user by default.
## Docs and READMEs
The website docs at `apps/website/docs/docs`, published on https://tackup.dev/docs/, are the single home for what a user of Tack needs, human or agent: each task gets a guide, and each command, flag, file format and payload is in a `reference/` page. Many diagnostic codes are not documented there yet: give a code you add or change its line in the page that owns it. A change that adds or alters user-facing behavior updates the page that owns it, in the same PR, and adds a page to the sidebar in `apps/website/rspress.config.ts` when no page fits.
READMEs stay short and never restate the docs. The root README says what Tack is, how to install it and links to tackup.dev pages. A package README says what the package is, how to run, build and test it locally and where its code lives, then links to the docs. Product or reference text found in a README moves to the docs page that owns it.
## What to compare
Run these against your change and read the code, not the skill, to decide what is true.
| If the change touches… | Compare with… |
| ------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| A command, subcommand, flag, alias or default | `bun tack --help` and `bun tack PATH... --help`, the specs in `cli/commands` and, for an extension, `packages/definitions/src/{docs,scripts}/commands.ts`, and the operation map in `cli/human/help-map.ts`. Aliases such as `list` and `ls` are not in the map: read `cli/commands/list-alias.ts`. |
| Which flags combine, which selector a command needs | The command's spec and its route in `apps/cli/src/cli`, or its implementation in `packages/extension-ID/src`. A flag that "requires" another is a claim to test. |
| JSON payloads, `kind` names, stable commands | The payload schemas in `domain/*/*-schema.ts` and `packages/definitions/src`, and `cli/commands/manifest.ts`. The stable set is in `apps/website/docs/docs/reference/automation.mdx#stable-payloads`. |
| Human output, `--format`, color, `next` | Skills teach the text view and its `Next` block. Say that text views are unstable and not to be parsed. |
| Diagnostic or quarantine codes | The string literals in `apps/cli/src` and `packages/extension-*/src`. Codes are kebab-case; script run outcome codes are snake_case. |
| Docs conflict reasons, mounts, search | `packages/extension-docs`, its `docs-links.ts`, the code table of `reference/automation.mdx` and the `use-tack-docs` references. Update all names, not one. |
| Adapters, delivery paths, which kinds an adapter links | `domain/agents/agent-adapter.ts` and the adapter table in `selection.md`. |
| Source format: keys, paths, patterns, names, overlap | `domain/sources/source-schema.ts`, and `resource-declarations.ts`, `declared-path.ts` and `docs-discovery.ts` in `features/sources`. |
| Skill or command metadata, activation, dependency rules | `features/sources/resource-frontmatter.ts`, `features/choices`, and the metadata section of `manage-tack-sources`. |
| Source or project health, `doctor` checks | `features/doctor`, `source-schema.ts` warnings, and the catalog issue table in `manage-tack-sources/references/catalog-issues.md`. |
| Profiles, fixed profile application, the `profile` commands | `domain/profiles`, `features/profiles/profile-*.ts`, `cli/commands/profiles.ts`, and `author-tack-profiles` with its `apply` and `copy-workflows` references. |
| Profile layers: order, diagnostics, `enable` and `disable` | `domain/choices/profile-layer.ts` and `profile-layer-schema.ts`, `features/profiles/profile-layer.ts`, `selection.md` and `reference/profiles.mdx`. |
| Profile bundles: format, export, check, apply, retention | `domain/bundles`, `features/profiles/bundle-*.ts`, and `author-tack-profiles/references/bundles.md`. |
<!-- ‹guest · 2026-12-04› -->
| Install, upgrade, release, state format, built-in skills | `domain/self/upgrade-guide.ts`, `release.ts` (built-in copies), `scripts/package/build.command.ts` (the bundled CLI without runtime dependencies, and `@tackup/docs`), `apps/website/docs/docs/reference/setup.mdx`, and the install and upgrade parts of `use-tack` and its `setup` reference. |
| Extensions, their switch and payload packages | `packages/definitions/src/extension`, `domain/extensions`, `domain/self/packages.ts`, `features/extensions`, the Extensions section of `reference/setup.mdx` and `use-tack` setup. |
| Script API or declaration | `packages/core/src/script-api.ts`, `packages/extension-scripts/src/platform/script-api-adapter.ts`, `packages/definitions/src/scripts`, and the `author-tack-scripts` skill and its references. After an API change, run `bun run script-api:types`. |
| Page reviews: questions, the batch, `tack docs review wait` | `packages/definitions/src/docs/review.ts`, `packages/extension-docs/src`, the `use-tack-docs` review reference, `write-reader-figures/references/page-components.md` and `reference/docs.mdx`. |
| The package build, its manifests or a release workflow | `scripts/package/manifest.ts`, `.github/workflows/README.md#releases`, the Releases part of `CONTRIBUTING.md` and `apps/*/npm-readme.md`, `packages/reader/npm-readme.md`. |
| A figure component, its props, its budget or the figure check | `packages/reader/src/figures/reference.ts` (the contracts the skill's reference is generated from) and the `write-reader-figures` decision table. |
## Procedure
1. List what the change makes true, false or new for an agent or an author. Include removed behavior: deleted flags, renamed codes, retired layouts.
2. Search the files above for every name involved: `grep -rn "NAME" apps/cli/src/builtins packages/extension-*/builtin .ai/skills apps/website/docs/docs CONTEXT.md`. Fix each hit, and add what is new where the skill that owns the topic teaches it.
3. Exercise the claim, do not trust the prose. Use a throwaway `HOME` and an explicit `--state-dir` under `mktemp -d`, a source built from the skill's own example, and run the command the skill tells an agent to run. Never use the real `~/.tack`.
4. Run `bun --bun vitest run apps/cli/test/guidance-commands.repo.test.ts apps/cli/test/guidance-drift.repo.test.ts`. Extend the checks when the change adds something a test can derive: a new adapter, a new declaration key or code is picked up automatically; a new family of codes needs its prefix in `scripts/guidance/drift.ts`.
5. Run `bun run check`, then re-read the diff of the skills as an agent who has only that text.
## What the tests catch, and what they do not
- `guidance-commands.repo.test.ts` fails when a skill names a command or flag the executable no longer has, a diagnostic code the code no longer defines, a stable-JSON set that changed, an adapter directory that moved, or a declaration key or quarantine code the source skill does not mention.
- `guidance-drift.repo.test.ts` fails when guidance teaches a resource tier Tack removed, or the retired folder-based source layout.
- `guidance-commands.repo.test.ts` decodes fenced `version: 1` declarations from guides and skill references with the real source, resource-entry and docs-entry decoders. It also parses worked skill frontmatter and metadata examples. Keep examples fenced as `yaml` or `markdown` so the tests find them. The worked-source reference must retain its three declarations.
- `guidance-drift.repo.test.ts` also rejects retired resource groupings and source labels in guidance.
- Neither catches a wrong sentence. "Requires `--project`", "plans only docs mounts", "context is selected by default" are behavior claims: read the handler and run the command.
## Writing rules for the skills
- Never hard-wrap skill prose to a line length, in built-in or `.ai/skills` skills: editors soft-wrap, so a paragraph or list item is one line. The same holds for the text that `apps/cli/src/domain/generated/sources-skill.ts` writes into the generated `tack-sources` and `tack-user-sources` skills; it quotes the guidance bodies of sources as their authors wrote them.
- Keep every built-in `SKILL.md` at 7,000 bytes or less, frontmatter included, and every reference at 20 KiB or less: Codex and Cline cut a skill body at 8,000, and `builtin-skill-size.repo.test.ts` enforces both. The body holds the triggers, the safety rules and the core procedure. A branch, operator-only help such as the `tack explore` keys, and a wide table go to a reference behind a pointer that says when to read it.
- Tack commands in a skill carry no `--json`: agents read the text view, and `--json` is for exact state fields or a structured answer (the stable payloads of `apps/website/docs/docs/reference/automation.mdx#stable-payloads`). Preview before `--apply`, and say which commands change state immediately.
- Describe what Tack does now. Skills ship with the package the operator installed, so they describe that version: no retired layout, removed flag or future release.
- Describe resources by source, kind and name. `maintainers` is descriptive contact information; it grants no permissions and defines no resource grouping. Filesystem link ownership and repository visibility are separate concepts.
- Keep complex worked examples in references and link them from the compact skill. Pair `depends-on` with resource metadata, and show how to resolve each name clash the example creates.
- Keep a fact in the skill that owns it and name that skill from the others. The source format belongs to `manage-tack-sources`; operating Tack belongs to `use-tack`.
- Keep the operator's machine, paths outside `$HOME/.local` and `~/.tack`, and people (other than as an example of `maintainers`) out of the skills.
- When code and a skill disagree and the code looks wrong, report the bug in the PR and keep the skill true to the shipped behavior.
## Package names
Every package in this repository uses the npm organization `@tackup`, published or private: the CLI publishes as `@tackup/cli`, its workspace name, the docs reader publishes as `@tackup/docs`, built from `packages/reader` by `scripts/package/build.command.ts`, and the private workspace packages are `@tackup/core`, `@tackup/definitions`, `@tackup/extension-docs`, `@tackup/extension-scripts`, `@tackup/reader`, `@tackup/harness`, `@tackup/website`, `@tackup/scripts` and `@tackup/evals`. Name a new package `@tackup/<name>`.
## Writing tests
<!-- ‹guest · 2026-12-04› -->
- Name a file in `apps/cli/test` after the behavior it tests and its level: `.system.test.ts` spawns the CLI, `.host.test.ts` runs the host or a feature in-process on live layers, `.unit.test.ts` touches neither, and `.repo.test.ts` checks repository files. A test of another level goes to a file of that level. Never name a file after a project phase. A test beside its module in `src` keeps the plain `.test.ts`.
- Import the shared test kit through the `#test/*` alias (`#test/support/state-fixture.ts`), at any depth.
- Keep `bun run test` warning-free. Fix each new stderr warning at its root cause; the fix is never stderr filtering, console suppression, a longer timeout or a global sleep.
- Treat a warning as a possible product bug: a missing `Drawer.Viewport` once broke swipe-to-close and touch scroll on mobile. A product fix ships with a regression test that goes red without it.
- Test a text view beside it in `apps/cli/src/cli/human/`, on the helpers of `human.test-support.ts`. `render.test.ts` holds every operation to the view contract (fits 40, 80 and 120 columns, no ANSI without color); a view test passes its long or wide samples to `expectViewContract` instead of checking widths or escapes itself.
- Render React in reader tests through `testRoot()` from `packages/reader/src/react.test-support.ts`. It owns the act flag, the container and the unmount, and fails a test on an update outside `act()`. Settle async React state with `waitForReact` from the same file, never `vi.waitFor`. Render with `react-render-to-markdown` inside `act()`: start the render in the callback and await it outside, since awaiting it inside `act()` hangs.
- Navigate in jsdom with cancelable clicks (`{ bubbles: true, cancelable: true }`) and route fixture pages through the mocked router, as `packages/reader/src/runtime.browser.test.ts` does.
- Prefer in-process tests (jsdom or node) over a headless browser. CLI tests run with a throwaway `HOME`, `XDG_*` and `TMPDIR` under `mktemp -d`, as `apps/cli/test/reader-shutdown.system.test.ts` does.
- A full-suite failure on a loaded machine is a regression only once the failing files also fail alone with one worker (`bun --bun vitest run --no-file-parallelism FILE...`). CI is the source of truth.
- A PR that adds or changes tests reports its CI time against a recent green `main` run.
این نسخه با نشانهگذاری اختصاصی حساب شما نمایش داده میشود. برای نصب سریع، به تب نصب و راهاندازی بروید.