跳到主要内容
知仓学习社ZHICANG

init

Write or refresh the "## Tech debt operations" section in AGENTS.md so a team shares one source of truth for debt-ops disciplines and cached quality…

不碰外部(只输出文字)无严重或高危命中hashgraph-online/awesome-codex-plugins

它会碰到什么

扫了多少2 个文本文件,5 KB
它会碰到什么不碰外部(只输出文字)
命中总数0 处
命中统计严重 0 · 高 0 · 中 0 · 低 0

这一栏是扫描器报的事实,不是结论。命中多不等于有毒(安全工具、规则库、示例脚本本来就会包含危险写法),命中少也不等于干净。它和你手上的凭据、文件、网络有什么关系,需要你自己看。

技能内容

init

Write or update a ## Tech debt operations section in ./AGENTS.md. Idempotent — only the managed section changes.

1. Read the cached commands

TOPLEVEL=$(git rev-parse --show-toplevel)
REPO_HASH=$(printf '%s' "$TOPLEVEL" | shasum | cut -c1-12)

# Hooks and skills share one deterministic cache base (ADR 0011). Override the
# base with DEBT_OPS_CACHE; default is ~/.cache/debt-ops.
CACHE_DIR="${DEBT_OPS_CACHE:-$HOME/.cache/debt-ops}/cache/$REPO_HASH"

LIST="$CACHE_DIR/feedback.list"
[ -f "$LIST" ] && cat "$LIST"

# Detected ADR/registry dirs. Fall back to the co-located defaults if the
# cache files aren't written yet.
ADR_DIR=$( [ -s "$CACHE_DIR/adr-dir" ] && cat "$CACHE_DIR/adr-dir" || echo "docs/adr" )
REGISTRY_DIR=$( [ -s "$CACHE_DIR/registry-dir" ] && cat "$CACHE_DIR/registry-dir" || echo "docs/debt" )
echo "adr-dir: $ADR_DIR"
echo "registry-dir: $REGISTRY_DIR"

If the file doesn't exist, the SessionStart discovery prompt hasn't run yet. Tell the developer:

> No cached quality commands yet. Start a new session so I can detect them, then re-run $init.

…and stop.

2. Compose the section (template)

Substitute {{COMMANDS}} with the cache contents verbatim, {{ADR_DIR}} with the detected adr-dir, and {{REGISTRY_DIR}} with the detected registry-dir (from step 1).

## Tech debt operations

<!-- this section is auto-managed by the debt-ops Codex plugin; safe to edit, run $init to regenerate -->

### Disciplines

1. The test for debt: would a future reader ask "why this way?" If yes, register via the `$add` skill immediately — no prompt. This is judgment, not a marker scan: a `TODO`/`FIXME`/`HACK`/`XXX` is the obvious case, but an unmade decision, a stub, a loosened type, or a default picked "for now" all count even with no marker in the diff. Use `payoff_trigger: unknown` if unsure. Announce: `+1 entry: <slug> (drop?)`. Over-register freely; the developer drops with "drop it".

2. When making an architecturally significant change — a data model, public interface, security boundary, release pipeline, or a dep-manifest change that is a major-version bump or a *new* top-level dependency — draft an ADR under `{{ADR_DIR}}/` in Nygard format: a `# NNNN — Title` heading, `**Date:**` and `**Status:**` lines, then Context, Decision, Consequences, Alternatives, Payoff trigger. Create the directory if needed. Only draft an ADR when there are two credible alternatives; if you cannot list two, it is a comment, not an ADR. An ADR with a payoff trigger *is* deliberate debt — when you write one, also invoke `$add` so the registry entry mirrors the ADR (don't conclude "no markers, no debt").

3. Read entries under `{{REGISTRY_DIR}}/` before changing files they reference.

### Quality commands

These run after every edit under a 3 s budget per command. Edit freely; the plugin reads tolerantly. Lines starting with `#` are estimates/comments and are skipped at run time.

<!-- debt-ops:feedback v1 -->
{{COMMANDS}}
<!-- /debt-ops:feedback -->

3. Apply

  • If ./AGENTS.md doesn't exist: Write it with the section above as the entire file.
  • If ./AGENTS.md has a ## Tech debt operations section: Edit to replace exactly that section — from the heading through (but not including) the next ## heading, or through EOF if no next heading. Leave every other byte unchanged.
  • If ./AGENTS.md exists without the section: Edit to append the section after the last existing line, with a single blank line between.

4. Announce

charter updated: ./AGENTS.md — disciplines + N quality commands

(N = count of non-comment, non-blank lines inside the marker block.)

Marker contract — do not deviate

  • <!-- debt-ops:feedback v1 --> is the open marker feedback.py keys on. Exact string; the v1 is part of the marker.
  • <!-- /debt-ops:feedback --> is the close marker.
  • The self-explaining <!-- this section is auto-managed by … --> line is mandatory — a teammate without the plugin reads that to understand what they're seeing.
  • Never touch any byte outside the ## Tech debt operations section.

想直接用这个技能?

本站把开放许可(MIT / Apache 等)的技能按仓库打包整理到网盘,点一下转存到你自己的网盘,不用一个个从 GitHub 拉。许可未声明的技能只给原始仓库链接,不打包。

同名技能的其他版本

有 6 个不同仓库或目录里都有叫 init 的技能。它们内容并不相同,别混用: