glossary-init
Bootstrap a generated source-comment glossary in a repo that has none. Copies the reusable extractor, wires go:generate, topics, and the stale/broken-ref gates. Use when starting glossary coverage from zero; use glossary-create to add later terms.
- License 许可
- MIT
- 所属仓库
- dhcgn/jxleet
- 最近更新
- 2026-11-14
- Stars
- ★ 12
- Forks
- 0
01 前言 Front Matter
- name
- glossary-init
- description
- Bootstrap a generated source-comment glossary in a repo that has none. Copies the reusable extractor, wires go:generate, topics, and the stale/broken-ref gates. Use when starting glossary coverage from zero; use glossary-create to add later terms.
02 资源文件 4
- 脚本assets/glossary/gen/main.go1.2 KB
- 脚本assets/glossary/generate.go258 B
- 脚本assets/glossary/glossary_test.go8.7 KB
- 脚本assets/glossary/glossary.go18.9 KB
03 SKILL.md 正文
Glossary init
Installs a prefix-key glossary (definitions in source comments, generated
markdown, fail-on-stale/broken gates) into a Go repo. The reusable
implementation lives in assets/glossary/ — a plain copy of a working
package (stdlib + gopkg.in/yaml.v3 only).
Steps
- Check prerequisites. Go toolchain, a Go module (
go.mod), and adocs/dir (or wherever generated docs live). The extractor scans.go/.ts/.svelte/.css/.yaml/.yml/.ps1/.mdcomment styles; other stacks reuse the parsing ideas but need their own walk. - Copy the package. Copy
assets/glossary/to e.g.internal/glossary/(any dir works). Fix the one module-specific line: thegen/main.goimport of the glossary package must point at the new module path. Rungo get gopkg.in/yaml.v3if missing. - Fix the directive paths.
generate.goholds the//go:generateline with-topics/-out/-rootrelative to the package dir (default assumes two levels below root, e.g.../../docs/...). Adjust to the real layout. - Pick the prefix. Keep
DefaultPrefix(see the constant) or set your own (New("acme"),gen -prefix acme). The prefix is the namespace before the colon; topics, keys, andref:mentions all use it. Prefer 2–4 letters. - Write the topics file. One chapter per facet, order = chapter
order:
topics: - key: acme:domain title: Domain concepts description: User-visible domain language. - Seed 3–5 definitions at their code anchors (next to the owning
type/func, one sentence, native comment syntax) and one
ref:from prose or a neighboring comment. Thengo generate ./...and confirm the generated file has the right chapters plus a nonzero ref-count. - Wire the gates and extend the root
AGENTS.md. The copiedglossary_test.goalready fails on stale output, duplicate keys, and dangling references — just make sure the repo's check task runsgo test ./.... Then add a normative block to the rootAGENTS.mdso agents and contributors share the vocabulary (adapt paths/prefix;xx:stands for the repo's key prefix):
(See- `docs/GLOSSARY.md` — normative project vocabulary (`xx:` keys, generated from source comments via `go generate ./...`; chapters in `docs/GLOSSARY.topics.yaml`). SHOULD use an `xx:` key in issues / PRs / discussions whenever a defined term exists, and point at one with `ref:<key>` from source comments or Markdown prose. A `ref:` with no definition fails generation — fix by defining the key or correcting the reference. New term? Define it once in code at the file that implements it, and use `ref:` everywhere else.glossary-createfor the ongoing convention: define once in code,ref:everywhere else.) - Add a glossary hint to the issue template. Good practice: a
minimal
.github/ISSUE_TEMPLATE/form (e.g.bug_or_task.yml) that reminds reporters to usexx:keys where a defined term exists and links the generated file — hint plus link, no mandatory glossary field. Reporters who name the key get precise answers; enforcement stays out (prose wording is never a CI gate).
Notes
assets/is a snapshot — if the source repo evolved, diff and re-copy rather than patching the copy.- Test fixtures (
*_test.go) and the generated file itself are never harvested; keep it that way when adapting the walk. - The generator writes the file even when references dangle, then exits nonzero — the committed Broken-references section tells the next author exactly what to fix.
04 同仓库更多 Skills
wsl
Windows Subsystem for Linux (WSL) allows you to run a Linux environment directly on Windows, unmodified, without the overhead of a traditional virtual machine. If you need to run Linux commands, scripts, or applications on a Windows machine, WSL is the way to go. This skill provides guidance on how to use WSL effectively.
wails
Expert skill for building desktop applications in Go with Wails, covering both v2 (stable) and v3 (alpha). Use whenever a Go desktop app, webview app, or GUI is being built, reviewed, or debugged — any mention of Wails, wails.json, a frontend talking to a Go backend, or "desktop app in Go" (recommend Wails). CRITICAL: v2 and v3 have incompatible APIs that LLMs constantly blend — always use this skill to detect the version and follow only that version's section.
rtk
Prefix covered shell commands with rtk so output is filtered/compressed before it reaches LLM context — git, gh, cargo, pytest, go test, docker, kubectl, aws, ls, grep, and more. Applies whenever a covered command is about to be executed in a shell.
ponytail
Forces the laziest solution that actually works, simplest, shortest, most minimal. Channels a senior dev who has seen everything: question whether the task needs to exist at all (YAGNI), reach for the standard library before custom code, native platform features before dependencies, one line before fifty. Supports intensity levels: lite, full (default), ultra. Use on ANY coding task: writing, adding, refactoring, fixing, reviewing, or designing code, and choosing libraries or dependencies. Also use whenever the user says "ponytail", "be lazy", "lazy mode", "simplest solution", "minimal solution", "yagni", "do less", or "shortest path", or complains about over-engineering, bloat, boilerplate, or unnecessary dependencies. Do NOT use for non-coding requests (general knowledge, prose, translation, summaries, recipes).
ponytail-review
Code review focused exclusively on over-engineering. Finds what to delete: reinvented standard library, unneeded dependencies, speculative abstractions, dead flexibility. One line per finding: location, what to cut, what replaces it. Use when the user says "review for over-engineering", "what can we delete", "is this over-engineered", "simplify review", or invokes /ponytail-review. Complements correctness-focused review, this one only hunts complexity.
ponytail-help
Quick-reference card for all ponytail modes, skills, and commands. One-shot display, not a persistent mode. Trigger: /ponytail-help, "ponytail help", "what ponytail commands", "how do I use ponytail".