topics
Selects GitHub topic candidates by having the `topics.mjs` engine perform constraint validation, popularity measurement, broad+narrow / singular-plural comparison, and hardcoded ozzy-labs conventions, then applies them via `gh repo edit --add-topic` following the policy's `externally-visible` gate (default batch-confirm). Scope is limited to use within ozzy-labs.
- License 许可
- MIT
- 所属仓库
- ozzy-labs/skills
- 最近更新
- 2026-07-13
- Stars
- ★ 0
- Forks
- 0
01 前言 Front Matter
- name
- topics
- description
- Selects GitHub topic candidates by having the `topics.mjs` engine perform constraint validation, popularity measurement, broad+narrow / singular-plural comparison, and hardcoded ozzy-labs conventions, then applies them via `gh repo edit --add-topic` following the policy's `externally-visible` gate (default batch-confirm). Scope is limited to use within ozzy-labs.
02 资源文件 2
- 参考文档SKILL.claude-code.md2.5 KB
- 脚本topics.mjs24.6 KB
03 SKILL.md 正文
topics - research-driven GitHub topics setup (ozzy-labs scope)
Selecting GitHub topics involves repeating, for every repo, the manual work of "enumerate candidates → validate against official constraints → check popularity → compare broad+narrow / singular-plural → align with ozzy-labs conventions → apply with gh repo edit --add-topic". This skill unifies the judgment of the selection stage and the work of the application stage.
The determinism (official constraint validation, popularity retrieval, broad+narrow 5x judgment, singular-plural comparison, ozzy-labs convention conversion / exclusion / hardcoded retention, final selection, rendering) is handled by the bundled topics.mjs engine (ADR-0028 R1, following the precedent of usage-check.mjs / skill-metrics.mjs / policy-read.mjs / health-check.mjs). This SKILL.md is confined to the judgment layer — when to call the engine, how to present the results, and where to confirm with a human (policy gate).
Scope: Limited to use in repositories under ozzy-labs. Cross-org generalization, persistent caching, and conventions for other orgs are out of scope (see Out of scope).
Input
topics <candidate-list>
--repo owner/repo (resolved from cwd's origin if omitted)
--apply (explicitly opts out of policy's batch-confirm and applies without confirmation)
--dry-run (analysis only, does not apply)
<candidate-list>is,-delimited, or multiple arguments- If both
--applyand--dry-runare specified,--dry-runtakes priority (to prevent accidental application; enforced by the engine) - If
--repois not specified, the engine extractsowner/repofromgit remote get-url origin. If no GitHub remote is found, it's recorded in the result JSON'srepo_error
Procedure
-
Execute the
topics.mjsin the same directory as this SKILL.md via Bash (passing the arguments as-is). In Claude Code that's~/.claude/skills/topics/topics.mjs(dogfood:<repo>/.claude/skills/topics/topics.mjs, Codex/Gemini:.agents/skills/topics/topics.mjs):node <this skill's directory>/topics.mjs <candidate-list> [--repo owner/repo] [--dry-run]By default the engine outputs formatted text (candidate count / constraint filter results / popularity table / broad+narrow and singular-plural judgment / convention conversion / final topics / apply plan) to stdout. Structured JSON can be obtained with
--json. -
Present the engine's output as-is (do not reformat or reinterpret it — constraint validation, 5x judgment, singular-plural, and ozzy-labs conventions are all the engine's responsibility). Candidates with unknown popularity (API failure) are explicitly marked in the table as
人気度不明and excluded from the 5x / singular-plural comparison. -
If
repo_erroris raised (no GitHub remote), present that fact and prompt for--repo owner/repoto be specified explicitly. -
Application (
gh repo edit --add-topic) follows the policy'sexternally-visiblegate below.
Application (follows the policy's externally-visible gate)
Applying gh repo edit --add-topic is an externally visible action. Rather than hardcoding an individual approval gate in prose, it follows the central autonomy policy (the SSOT of the 3 classes / gate vocabulary defined by the policy skill). Classification and zero-config default:
| This skill's action | Class | policy reference | Zero-config default gate |
|---|---|---|---|
Applying topics (gh repo edit --add-topic) |
externally-visible |
--action=topics-apply |
batch-confirm (present the final list once for a single batch confirmation) |
The effective gate is looked up via the sibling policy skill's policy-read.mjs (user-scope: ~/.claude/skills/policy/policy-read.mjs, dogfood: <repo>/.claude/skills/policy/policy-read.mjs, Codex/Gemini: .agents/skills/policy/policy-read.mjs):
node <policy skill directory>/policy-read.mjs --action=topics-apply --repo-root="$PWD"
# => .resolved.gate (default batch-confirm)
Align the flags with the policy:
- When
--dry-runis specified: the engine only outputs the analysis, and neither applies nor confirms (does not callgh repo edit) - When
--applyis specified: an explicit opt-out ofbatch-confirm. The engine executesgh repo edit <owner/repo> --add-topic <topic1>,<topic2>,...without confirmation, and even verifies withgh repo view --json repositoryTopics - When neither is specified (
planmode): the engine does not apply and returnsapply_command(the command to be executed). Confirms with the human per the gate:- gate=
batch-confirm(default): present the final topics list all at once for a single batch confirmation (the host's confirmation UI. Do not enumerateApply? [Y/n]in text output. In Claude Code, use AskUserQuestion — seeSKILL.claude-code.md). If approved, re-run with the same arguments plus--apply - gate=
proceed: re-run with--applywithout confirmation - gate=
ask: confirm one topic at a time
- gate=
Does not break even without policy present: policy-read.mjs is fail-safe by design — if it can't be read, or the value is invalid, it defaults to the stricter side (ask). In environments where the policy skill is not installed, apply the zero-config default gate in the table above directly (externally-visible=batch-confirm).
After applying, the engine returns the actually applied values (apply.verified_topics). Include the diff between the expected value (final_topics) and the actually applied value in the final report.
Error handling (the engine puts this in the JSON)
| Situation | Engine behavior |
|---|---|
gh CLI not authenticated |
gh_available:false. Each candidate's popularity is null + a reason in popularity_errors. Excluded from the 5x / singular-plural comparison (not treated as 0). The SKILL judgment layer presents "reliable comparison is not possible due to unknown popularity" |
| GitHub Search API rate limit / network error | Only the affected candidate gets popularity=null + a reason. Other candidates continue |
--repo not specified and no GitHub remote |
Raises repo_error. Does not apply |
| 100% constraint-violating candidates | error: no applicable candidates. The popularity API is not called |
gh repo edit --add-topic fails (during --apply) |
apply.applied:false + apply.error. The SKILL judgment layer presents the failure |
Out of scope
| Item | Reason for exclusion |
|---|---|
| 1. Cross-org generalization | Currently ozzy-labs only. Generalization is considered in a separate issue |
| 2. Persistent caching | Only within a session (the engine queries each topic only once per execution). Optimization spanning multiple sessions is out of scope |
| 3. Other repos' responsibility for the topics application part | commons/init-templates.sh's --topics is responsible only for "applying the specified list". This skill supports selection, commons handles application — the responsibilities are separated. The two are connected via a human operator |
Notes
- Do not read or stage
.envfiles - The hardcoded ozzy-labs conventions (the
claude-codeexception,*-cliremoval, fixing themulti-agentform, retaining bothclaude+claude-code) are implemented within the engine and take priority over mechanical judgment (broad+narrow 5x / singular-plural). If adding more exceptions, do so together intopics.mjs+ this SKILL.md (do not expand conventions on Claude's own judgment) - Applying topics follows the policy's
externally-visiblegate (defaultbatch-confirm). Do not hardcode an individual approval gate in prose - Since
--applyskips confirmation as an explicit opt-out ofbatch-confirm, it's recommended to always check the content with--dry-runfirst before using it
04 同仓库更多 Skills
verify
An integrated skill that runs the combined validation of build / typecheck / test / lint in one shot. The `verify.mjs` engine auto-discovers validation commands via a discovery chain (AGENTS.md's 「検証」 section → package.json scripts → justfile/Makefile/lefthook → language heuristics), executes them serially with their source attached, and returns a result summary. If a higher-priority stage produces a hit, only that stage is executed (no crossing stages).
usage-guard
Monitors Claude Code's Usage Limit (5-hour = Current / weekly = Weekly), pauses work when it exceeds 95%, and automatically resumes once the reset restores headroom. Bundles an engine form that a caller such as drive Reads at a checkpoint, and a standalone form, `/usage-guard "<continuation command>"`, that guards arbitrary work. Claude-only (depends on the OAuth usage-rate endpoint + ScheduleWakeup).
topics
Selects GitHub topic candidates by having the `topics.mjs` engine perform constraint validation, popularity measurement, broad+narrow / singular-plural comparison, and hardcoded ozzy-labs conventions, then applies them via `gh repo edit --add-topic` following the policy's `externally-visible` gate (default batch-confirm). Scope is limited to use within ozzy-labs.
skill-observability
Defines the skill observability event contract (event.schema.json) and emit substrate (obs-emit.mjs). The SSOT for the measurement layer of the skill improvement loop. Referenced by other skills and hooks.
skill-metrics
Aggregates the local observability event log (~/.agents/observability/events.jsonl) and presents, read-only, per-skill invocation counts and notable events (fallback / HITL rejection / loop cap reached / abort). Fires on "show me the skill metrics," "aggregate the observability results," "which skills get used the most?" Does not send anything.
ship
Runs verification, commit, and PR creation all at once. An integrated pipeline that runs verify (build + type + test + lint) → commit → PR creation in sequence against the changes.