document-component

A command for creating or updating the documentation record for one existing user-interface component. A component is a reusable screen element such as a button or form field.

In plain words
What is it for?
Choose a component, gather its current documentation, improve its description, ask targeted questions, set its update date, and run a documentation check.
Why use it?
It turns scattered or outdated component information into a checked documentation record using the project's existing settings.

Command for Cursor

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add commands/jrpease/throughline/document-component
Clone the repo
git clone --depth 1 https://github.com/jrpease/throughline

Made for: Cursor.

Per session 0 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 960 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00000 $0.00960
Opus 5 $0.00000 $0.00480
Sonnet 5 $0.00000 $0.00192
Haiku 4.5 $0.00000 $0.00096

Measured 2d ago against content hash 332364e602d4, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

document-component scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 2d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

adapters/cursor/.cursor/commands/document-component.md · 59 lines

How it starts

The opening of the file, as written. The whole thing — 59 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Document a single existing component end to end, using the settings already in design-system.json (project.uiFramework, figma.mechanism, sync.platforms) rather than re-asking configuration. Scale explanation to user.codingLevel.

Ask which component to document (e.g. "Button"), then:

  1. Author/refresh the record. Run the doc-authoring pipeline from the component-builder rule's Author the documentation record step — ingest any existing docs first (brownfield), then infer → enrich (from .throughline/references/component-doc-archetypes.md) → specialize → interview. Authored prose follows .throughline/references/doc-writing-standard.md. Set updatedAt to today's date (ISO, YYYY-MM-DD) whenever the record is written or rewritten — it is a projected field and the doc card's header renders it. Once the record is written, run node .throughline/scripts/docs-lint.mjs design-system/docs/components/<Name>.doc.json and fix its warnings. Do not raise a separate confirmation for a warning on an imported/user block: draft the rewrite and carry it into the approval gate below, shown as before/after and labelled with the block's provenance, so one approval covers the whole record. The user approves the drafted record before anything is projected (Figma description, doc card, manifest). Blocks the user did not clear keep their existing text; blocks the user did clear are stamped imported+user so a later run neither re-asks nor rewrites them.
  2. Project it. Write design-system/docs/components/<Name>.doc.json, set the Figma component description, rebuild the doc card's Usage band with the canonical builder (.throughline/references/doc-card-builder.md — verify its returned summary and stamp surfaces.docCard.{src,render,renderer} from it), and (if the repo/code side exists) render MDX/JSDoc and run docs:digest per the storybook-chromatic-builder render step.
  3. Reconcile drift. Before trusting docs:check, confirm the repo's copy of the doc scripts is current: compare DOC_CARD_RENDERER_VERSION in the repo's scripts/lib/doc-card-plan.mjs against the same constant in .throughline/scripts/lib/doc-card-plan.mjs. If the repo file is missing, or its version is lower, docs:check is reading stale rules and its "no drift" is meaningless — say so plainly, and offer to refresh the repo's doc scripts from the plugin copy. Refresh the whole set and re-check the npm registrations, both per Documentation scripts — install as a set in .throughline/scripts/README.md — a refreshed file whose script was never registered is the same failure in a new place. Run docs:check (with the refreshed scripts, if any). For each drifted surface, offer a per-item choice — re-render (canonical wins) or pull-back (fold the surface edit into the record) — and land the result as a reviewable change. On a brownfield component's first pass, adopt existing content (provenance: imported) rather than overwriting it. docs:check may also report layout-upgrade-available (informational, never failing): the card's layout predates the current builder. Offer to re-render the Usage band now — rebuild happens on this touch, never unprompted.
  4. Close the flow. Hand back in the four-beat guide voice from .throughline/references/guide-voice.md: the outcome, what you set aside and why, one recommended next step, and at most one light alternative. Read existing state to name what is actually outstanding rather than guessing — a component at status: "draft" with no code surface in meta[name].doc.surfaces means the code side is deferred. Do not close with a grid of co-equal options.

See .throughline/references/component-doc-schema.md for the record schema, fingerprint contract, and projection mapping. If a component was never built in Figma, point the user at component-builder first.

Read the full file on GitHub · 59 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 2d ago First seen · 59 lines · 0 tokens per session scan A 332364e602d4

Subscribe to this mod's changes

document-component is a command published in the GitHub repository jrpease/throughline (76 stars, last pushed 4d ago), licensed MIT. It costs nothing until one of its globs matches a file; then it loads 960 tokens. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.