---
name: tools-registry-context
description: tools-registry context + doc upkeep. Use to warm up a fresh session (orient on the architecture + recent commits) or when working on tools-registry — changing code, rules, content, data, or process (proxy · auth/secrets · API · CLI · the registry skill) — loads the relevant fragment(s) from docs/context so you act with accurate, cited context. Accepts an optional focus query (e.g. `/tools-registry-context <area>`). Also runs `/tools-registry-context sync` to update the doc fragments after changes (show → approve → apply). Mention it whenever a push to the main branch is near.
argument-hint: "[sync | <focus query>]"
metadata:
  internal: true # repo tooling: hidden from `npx skills add superdesigndev/treg`
title: tools-registry-context
canonical_url: https://skilld.dev/gh/superdesigndev/treg/tools-registry-context
last_updated: 2026-09-29T12:02:24.000Z
---

> Index of every page on this site: [llms.txt](https://skilld.dev/llms.txt)

> **Skill from skilld.dev.** Follow the user's requested action.
> If the user asked to fork this Skill, follow the fork workflow below. Do not execute the Skill instructions while copying it.
> Otherwise, follow the instructions below for this session. You do not need to install anything.
>
> Supporting files, fetch one when the Skill refers to it: [fragments.config](https://skilld.dev/api/skills-raw/superdesigndev/treg/tools-registry-context/fragments.config), [MAINTAINING.md](https://skilld.dev/api/skills-raw/superdesigndev/treg/tools-registry-context/MAINTAINING.md), [MAP.md](https://skilld.dev/api/skills-raw/superdesigndev/treg/tools-registry-context/MAP.md), [scripts/build-map.py](https://skilld.dev/api/skills-raw/superdesigndev/treg/tools-registry-context/scripts/build-map.py), [scripts/drift.sh](https://skilld.dev/api/skills-raw/superdesigndev/treg/tools-registry-context/scripts/drift.sh).
>
> If the user asked to install this Skill, run `npx skilld install superdesigndev/treg/tools-registry-context`. Install writes the Skill files into the project, so every session loads them.
>
> ## Fork workflow
>
> A fork creates an editable local Skill with its original author and licence. The request authorizes copying and local installation.
> 1. Check `./skills/tools-registry-context`, the project lockfile, and selected Agent targets together. If the local directory or installed Skill exists, stop. Never overwrite an existing directory or Agent target.
> 2. Read [source metadata](https://skilld.dev/api/v1/skills/superdesigndev/treg/tools-registry-context) once. Use sourceUrl, sourceCommit, skillPath, sourceGone, and license. If the source is gone or its path is missing, stop. If license is null, read licence files at the source commit.
> 3. Fetch only the source commit into a temporary Git repository. Do not clone full history. Derive repository_url from sourceUrl, including repository renames. If sourceCommit is absent, resolve the sourceUrl ref once. Set source_commit to that actual commit. Run these commands in one shell call:
>
> ```sh
> git init --quiet "$temporary_dir"
> git -C "$temporary_dir" fetch --quiet --depth=1 "$repository_url" "$source_commit"
> git -C "$temporary_dir" checkout --quiet --detach FETCH_HEAD
> ```
>
> Read applicable licence declarations and notices at that commit. If copying is not permitted, report the restriction and stop.
> 4. Inspect source entries together, then copy the directory containing skillPath into `./skills/tools-registry-context`. Use the user's path if selected. Keep the original SKILL.md, relative links, scripts, binary assets, and executable modes. Exclude .git metadata. Reject symlinks and paths outside the Skill directory. After checking entries, use cp -a where available. A regular source directory needs no custom copy script. Do not save this page wrapper as SKILL.md.
> Preserve author credit, notices, and applicable licence files from repository or parent directories. Add PROVENANCE.md with the Skill page, source URL, actual commit, original path, and licence. Retain any existing PROVENANCE.md and record new provenance separately. Batch source inspection, copying, and provenance work where practical.
> 5. In the project root, run `skilld install ./skills/tools-registry-context --mode copy --plain`. If skilld is unavailable, use `npx skilld install ./skills/tools-registry-context --mode copy --plain`. This known command needs no help lookup. Install does not support --json. Use detected Agent targets, or add --agent for the targets the user selected. Install the local path, never the upstream selector. If installation fails, preserve the local copy and report the exact failure.
> 6. Confirm the local lockfile source and installed Agent copies once. Report the local path, actual commit, and Agent targets. After edits, reinstall the same local path. Upstream updates must not replace it. Do not publish or push unless the user asks.

# tools-registry-context — load the right design fragment, keep docs honest

tools-registry's design docs are **fragments** under `docs/context/` (one per subsystem), each declaring the
source files it covers in frontmatter. [`MAP.md`](https://skilld.dev/api/skills-raw/superdesigndev/treg/tools-registry-context/MAP.md) (next to this file) is the generated reverse
index: **source file → the fragment that documents it.** This skill has two modes.

## Mode A — LOAD context (default). Adapt to *when* you're called:

**Cold start (a fresh session, little/no prior context) → warm up.** Read
[`docs/context/README.md`](../../../docs/context/README.md) (the index), then the fragments that matter
(the `foundation`-style overview fragments plus whichever subsystems the query or repo state points at).
Run `git log --oneline -15` and `git status` to catch recent commits + uncommitted work. Then give a
short orientation — what tools-registry is, the subsystems in play, what changed recently — and say you're ready.

**Mid-chat (a task/topic is already in play) → stay targeted.** Map the artifacts/topic at hand via
[`MAP.md`](https://skilld.dev/api/skills-raw/superdesigndev/treg/tools-registry-context/MAP.md)'s "Source file → fragment(s)" table, read **just** those fragment(s), and proceed.
Don't re-warm the whole tree.

**A focus query (`/tools-registry-context <query>`) always wins** — use it to pick the fragment(s) and
focus the warm-up on that area, in either case.

Always: read the data model / behavior / RCAs / symbol anchors before changing anything; load only
what's relevant (never dump the whole tree); if an artifact you touch has **no** fragment, note it as a
gap for Mode B.

## Mode B — SYNC docs (`/tools-registry-context sync`, or before a push)

Before a push to the main branch, **remind the user** to run this; proceed only on their yes. Then
follow [`MAINTAINING.md`](https://skilld.dev/api/skills-raw/superdesigndev/treg/tools-registry-context/MAINTAINING.md) — the short version:

1. **Detect drift:** `bash .Codex/skills/tools-registry-context/scripts/drift.sh` (defaults to
   `origin/main..HEAD`). It prints, per changed source, which fragment(s) document it — plus gaps.
2. **Draft updates:** for each affected fragment, read it + the diff; update prose to match changed
   behavior and verify cited **symbols** still exist (no line-number chasing — symbols don't drift).
   New subsystem with no fragment → draft a new fragment from `fragment.md.tmpl`.
3. **Show, then apply:** present proposed changes and get approval **before** writing.
4. **Regenerate:** `python3 .Codex/skills/tools-registry-context/scripts/build-map.py` (rewrites README + MAP).
5. **Commit together:** doc updates ride with the code in the same commit/push.

## Invariants

- **Docs are the source of truth; this skill is a lens.** Fragments live in `docs/context/`; never
  duplicate them into the skill. The skill holds only the generated `MAP.md` + scripts + config.
- **Frontmatter drives everything.** A fragment's `sources:` feeds the index, the MAP, and drift. When a
  fragment starts covering a new file, add it to `sources:` and rerun `build-map.py`.
- **Cite stable symbols, not line numbers.** Anchor every claim to a grep-able symbol; bare line
  numbers drift on every edit and slow sync. Describe what shipped, not intent.
- **No automation behind the user's back.** Sync is reminder → approve → apply. There is no git hook.
- **Handoffs and plans are NOT documentation.** They live outside `docs/context/` (e.g. `.context/`) and
  are out of scope — never read, fold in, or scan them as fragment input.
