AGENT SKILL

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

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

  1. Check prerequisites. Go toolchain, a Go module (go.mod), and a docs/ dir (or wherever generated docs live). The extractor scans .go/.ts/.svelte/.css/.yaml/.yml/.ps1/.md comment styles; other stacks reuse the parsing ideas but need their own walk.
  2. Copy the package. Copy assets/glossary/ to e.g. internal/glossary/ (any dir works). Fix the one module-specific line: the gen/main.go import of the glossary package must point at the new module path. Run go get gopkg.in/yaml.v3 if missing.
  3. Fix the directive paths. generate.go holds the //go:generate line with -topics/-out/-root relative to the package dir (default assumes two levels below root, e.g. ../../docs/...). Adjust to the real layout.
  4. 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, and ref: mentions all use it. Prefer 2–4 letters.
  5. Write the topics file. One chapter per facet, order = chapter order:
    topics:
      - key: acme:domain
        title: Domain concepts
        description: User-visible domain language.
    
  6. 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. Then go generate ./... and confirm the generated file has the right chapters plus a nonzero ref-count.
  7. Wire the gates and extend the root AGENTS.md. The copied glossary_test.go already fails on stale output, duplicate keys, and dangling references — just make sure the repo's check task runs go test ./.... Then add a normative block to the root AGENTS.md so agents and contributors share the vocabulary (adapt paths/prefix; xx: stands for the repo's key prefix):
    - `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.
    
    (See glossary-create for the ongoing convention: define once in code, ref: everywhere else.)
  8. 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 use xx: 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

dhcgn
dhcgn/jxleet

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.

★ 12
dhcgn
dhcgn/jxleet

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.

★ 12
dhcgn
dhcgn/jxleet

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.

★ 12
dhcgn
dhcgn/jxleet

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).

★ 12
dhcgn
dhcgn/jxleet

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.

★ 12
dhcgn
dhcgn/jxleet

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".

★ 12