add-reference-doc

A command that creates implementation-reference document templates for named parts of a software project.

In plain words
What is it for?
It adds reference files under docs/reference for layers such as infrastructure, data, application programming interface, frontend, user interface, security, or agent and language-model systems.
Why use it?
It gives teams a consistent starting structure for recording each layer's components, purpose, and code references.

Command

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/whchoi98/project-init/add-reference-doc
Clone the repo
git clone --depth 1 https://github.com/whchoi98/project-init
Per session 15 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 925 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.00015 $0.00925
Opus 5 $0.00008 $0.00463
Sonnet 5 $0.00003 $0.00185
Haiku 4.5 $0.00002 $0.00093

Measured yesterday against content hash 569521944153, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

add-reference-doc 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 yesterday.

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.

plugins/project-init/commands/add-reference-doc.md · 111 lines

How it starts

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

Add Implementation Reference Doc

Append a skeleton implementation reference document for the given layer(s) under docs/reference/.

Step 1: Validate Layer Names

Target layers: $ARGUMENTS

Valid layers (enum):

  • infrastructure
  • data
  • api
  • iac
  • frontend
  • ui
  • security
  • agent-llm

If any argument is not in the enum, abort with: Unknown layer "<name>". Valid: infrastructure, data, api, iac, frontend, ui, security, agent-llm.

Step 2: Ensure Target Directory

mkdir -p docs/reference

Step 3: For Each Layer — Generate Skeleton

For every requested layer:

  1. Check existence at docs/reference/{layer}.md:
    • If exists: prompt the user overwrite / skip / abort. On skip skip this layer; on abort abort the whole command.
  2. Extract skeleton from plugins/project-init/skills/project-scaffolder/references/reference-doc-template.md — read the fenced block under ## Layer: {layer}.
  3. Substitute variables:
    • {{COMPONENTS_TABLE}} → empty table row | <!-- TODO: component --> | <!-- path --> | <!-- purpose --> |
    • {{CODE_POINTERS_AUTO}}<!-- TODO: add 3-7 code pointers -->
  4. Write to docs/reference/{layer}.md.

Step 4: Regenerate docs/reference/INDEX.md

Read the current directory listing of docs/reference/*.md (excluding INDEX.md itself). Rewrite the file with this structure:

# Implementation Reference Index / 구현 참조 인덱스

[![English](https://img.shields.io/badge/Language-English-blue)](#english)
[![한국어](https://img.shields.io/badge/Language-한국어-red)](#korean)

<a id="english"></a>
## English

Layer-by-layer implementation guides. Each file follows the same 5-section
structure (Overview / Components / Key Decisions / Code Pointers / Cross-references).

<!-- AUTO-MANAGED:index -->
| Layer | File | Status |
|---|---|---|
| Infrastructure | [infrastructure.md](infrastructure.md) | present |
| Data | — | not applicable |
| API | — | not applicable |
| IaC | — | not applicable |
| Frontend | — | not applicable |
| UI | — | not applicable |
| Security | — | not applicable |
| Agent · LLM | — | not applicable |
<!-- /AUTO-MANAGED -->

Last updated: <today's date in YYYY-MM-DD> (managed by /init-project, /add-reference-doc, /sync-docs)

<a id="korean"></a>
## 한국어
(same structure, Korean section headings)

Read the full file on GitHub · 111 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. yesterday First seen · 111 lines · 15 tokens per session scan A 569521944153

Subscribe to this mod's changes

add-reference-doc is a command published in the GitHub repository whchoi98/project-init (2 stars, last pushed 1mo ago), licensed MIT. It adds 15 tokens to every session and 925 once invoked, about $0.0001 per session on Opus 5. 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-31.