Agent Skills › google/ax › sync-contract

sync-contract

GitHub

用于在代码变更后同步更新AGENTS.md和SKILL.md等契约文档,确保文件路径、函数名及配置等信息与代码保持一致。

skills/sync-contract/SKILL.md google/ax

触发场景

代码变更完成前 需要验证文档准确性时

安装

npx skills add google/ax --skill sync-contract -g -y
更多选项

不安装直接使用

npx skills use google/ax@sync-contract

指定 Agent (Claude Code)

npx skills add google/ax --skill sync-contract -a claude-code -g -y

安装 repo 全部 skill

npx skills add google/ax --all -g -y

预览 repo 内 skill

npx skills add google/ax --list

SKILL.md

Frontmatter
{
    "name": "sync-contract",
    "description": "End-of-change pass that brings AGENTS.md and skills\/ back in step with the code. Load after any code change, before declaring done; it is the last step of the Definition of done."
}

Sync the agent contract with the code

AGENTS.md and skills/*/SKILL.md quote facts about the tree: file paths, function names, versions, flag defaults, CI steps. Code changes silently invalidate them. Run this diff-driven procedure before declaring a task done.

1. Inspect what changed

git diff --name-only origin/main...HEAD      # or: git status --short for uncommitted work

2. Find which contract docs mention what you changed

  1. Search AGENTS.md and skills/ for the file paths, package names, CLI flags, or exported symbols touched in your diff.
  2. Check by area:
    • Package layout, CLI subcommands, CI steps (.github/workflows/go.yml), Makefile, go.mod, or CONTRIBUTING.md → check AGENTS.md.
    • Any domain listed in the AGENTS.md Skills table (for example, internal/substrate, internal/guest, internal/metadata, ate-system / atenet-router addresses, or E2E setup → skills/substrate/SKILL.md) → check that skill's SKILL.md.

3. Per-document checklist

For each document you opened:

  • Every path it names exists (ls it).
  • Every function/const/flag it names still exists under that name.
  • Every number it states (file counts, package counts, versions) is re-derived, not trusted.
  • Every "only place that…" / "no X exists" statement is re-checked across the tree, not just in the changed file.
  • Removed behaviour is removed from the doc; renamed behaviour is renamed.
  • New behaviour that a future agent would get wrong without being told is added — as a fact with its location, not as advice.
  • Prefer a pointer ("see go.mod") over copying a value that changes often.

4. Quick structural check

Run this one-liner whenever AGENTS.md or skills/ was touched:

# Verify symlinks and that every skills/<name>/SKILL.md is indexed in AGENTS.md
test -L CLAUDE.md && test -L GEMINI.md && \
for d in skills/*/; do
  s=$(basename "$d")
  test -f "$d/SKILL.md" && grep -q "\`/$s\`" AGENTS.md || echo "MISSING: $s"
done

版本历史

  • b82f57e 当前 2026-11-02 09:36

同 Skill 集合

skills/substrate/SKILL.md

元信息

文件数
0
版本
b82f57e
Hash
4fff07e1
收录时间
2026-11-02 09:36

首页 - Wiki
Copyright © 2011-2026 iteam. Current version is 2.155.2. UTC+08:00, 2026-11-03 01:07
浙ICP备14020137号-1