Maintain Skills
Manage the repository's role-skill lifecycle without reimplementing its sync
surfaces. Treat this skill as the operator workflow for skill structure and
registration, references/sync-surfaces.md as the authoritative sync checklist,
and references/change-types.md as the change classification.
Read references/change-types.md before classifying a
request. Read references/sync-surfaces.md before
editing anything, and check every surface it lists against the final diff.
Classify the Change
- Treat "新增 agent / skill" as add. A new skill lives inside an existing
agent; a new agent adds the full
agents/{agent-name}/ skeleton.
- Treat "修改 skill 的 SKILL.md、frontmatter、结构、描述或共享契约副本" as modify.
Judge the change tier against the tier contract in
AGENTS.md(hotfix /
standard / major)and record it before planning.
- Treat "重命名 skill 目录" as rename. Renames are path-contract changes:
marketplace paths, router references, README references, and lockfile entries
all move together.
- Classify first, then scan. Do not skip classification because the edit looks
small.
Scan the Impact
- Read
references/sync-surfaces.md and list every surface the change touches:
registration, routing, discovery, agent docs, top-level entry, process docs,
and shared-contract copies.
- Check the high-risk surfaces named in the reference: discovery metadata,
PM entry classification, and process-doc/diff consistency.
- State the forbidden files or areas for this change explicitly; do not edit
anything outside the confirmed scope.
Plan the Minimal Change
Before editing, output:
- Change type and
change_tier with the evidence that supports them.
- The exact impact-surface list and forbidden areas.
- A line-count order-of-magnitude expectation (e.g. "净新增约 150 行,不新增
抽象").
- The verification commands that will prove the change.
Only implement changes listed in the plan. If the plan grows beyond the expected
scale, stop and re-scope.
Execute the Sync
- Registration: add or update the skill in
.claude-plugin/marketplace.json and
refresh its entry and computedHash in skills-lock.json. A new agent also
creates agents/{agent}/.claude-plugin/plugin.json and adds its skills
directory to .kimi-plugin/plugin.json (the contracts check path validity
and version, not full agent coverage). Any tracked file change under a skill
directory refreshes that skill's hash; a rename updates path and hash
together.
- Routing: update the router SKILL.md sections that enumerate the specialist
(Available Skills, Routing Signals, Specialist Gate Pointers, Default
Routes, Role Boundary).
- Discovery: update the marketplace agent
description, the router frontmatter
description, and the root-routing pointer sentence in AGENTS.md.
- Agent docs: update
agents/{agent}/README.md skills table, counts, and
Routing Rules; mirror to README_zh.md.
- Top-level entry: update root
README.md / README_zh.md (agent-table
counts and capability descriptions, badges, agent name rows, router counts,
install commands, Kimi directory counts, collaboration diagram, common
flows, and the agent-doc index), the router listings in .codex/INSTALL.md
and docs/README.codex.md, the agent counts and collaboration flow in
AGENTS.md, and pm-agent/SKILL.md handoff targets, request classification
lines, and Default Routes.
- Shared contracts: when extending an enum such as
doc_type, update every
copy: the authoritative definition, the consumer-skill copied tables, and the
script assets and templates shipped by docs-site-bootstrap. Note in the PR
that existing hosts must re-run bootstrap because shipped copies do not
auto-upgrade.
- Process docs: keep PRD/TRD/implementation-plan touch tables and forbidden
areas consistent with the actual diff.
Verify the Final State
After the edits, run:
uv run scripts/check_repository_contract.py
uv run scripts/check_doc_contract.py
uv run --with pytest pytest <affected deterministic tests>
git diff --check
Stop and repair a static failure before considering the change done. Run the
deterministic tests that cover the touched surfaces (e.g. lockfile contract
tests).
Report
Summarize for handoff: the change type and tier, files changed with the
sync-surface checklist result, verification results, and any leftover items.
1---2name: maintain-skills3description: Manage role Skill and Agent lifecycle changes in this repository, including additions, modifications, renames, and required sync surfaces. Use for Skill contract or registration changes.4---56# Maintain Skills78Manage the repository's role-skill lifecycle without reimplementing its sync9surfaces. Treat this skill as the operator workflow for skill structure and10registration, `references/sync-surfaces.md` as the authoritative sync checklist,11and `references/change-types.md` as the change classification.1213Read [references/change-types.md](references/change-types.md) before classifying a14request. Read [references/sync-surfaces.md](references/sync-surfaces.md) before15editing anything, and check every surface it lists against the final diff.1617## Classify the Change1819- Treat "新增 agent / skill" as **add**. A new skill lives inside an existing20 agent; a new agent adds the full `agents/{agent-name}/` skeleton.21- Treat "修改 skill 的 SKILL.md、frontmatter、结构、描述或共享契约副本" as **modify**.22 Judge the change tier against the tier contract in `AGENTS.md`(hotfix /23 standard / major)and record it before planning.24- Treat "重命名 skill 目录" as **rename**. Renames are path-contract changes:25 marketplace paths, router references, README references, and lockfile entries26 all move together.27- Classify first, then scan. Do not skip classification because the edit looks28 small.2930## Scan the Impact3132- Read `references/sync-surfaces.md` and list every surface the change touches:33 registration, routing, discovery, agent docs, top-level entry, process docs,34 and shared-contract copies.35- Check the high-risk surfaces named in the reference: discovery metadata,36 PM entry classification, and process-doc/diff consistency.37- State the forbidden files or areas for this change explicitly; do not edit38 anything outside the confirmed scope.3940## Plan the Minimal Change4142Before editing, output:43441. Change type and `change_tier` with the evidence that supports them.452. The exact impact-surface list and forbidden areas.463. A line-count order-of-magnitude expectation (e.g. "净新增约 150 行,不新增47 抽象").484. The verification commands that will prove the change.4950Only implement changes listed in the plan. If the plan grows beyond the expected51scale, stop and re-scope.5253## Execute the Sync5455- Registration: add or update the skill in `.claude-plugin/marketplace.json` and56 refresh its entry and `computedHash` in `skills-lock.json`. A new agent also57 creates `agents/{agent}/.claude-plugin/plugin.json` and adds its skills58 directory to `.kimi-plugin/plugin.json` (the contracts check path validity59 and version, not full agent coverage). Any tracked file change under a skill60 directory refreshes that skill's hash; a rename updates path and hash61 together.62- Routing: update the router SKILL.md sections that enumerate the specialist63 (Available Skills, Routing Signals, Specialist Gate Pointers, Default64 Routes, Role Boundary).65- Discovery: update the marketplace agent `description`, the router frontmatter66 `description`, and the root-routing pointer sentence in `AGENTS.md`.67- Agent docs: update `agents/{agent}/README.md` skills table, counts, and68 Routing Rules; mirror to `README_zh.md`.69- Top-level entry: update root `README.md` / `README_zh.md` (agent-table70 counts and capability descriptions, badges, agent name rows, router counts,71 install commands, Kimi directory counts, collaboration diagram, common72 flows, and the agent-doc index), the router listings in `.codex/INSTALL.md`73 and `docs/README.codex.md`, the agent counts and collaboration flow in74 `AGENTS.md`, and `pm-agent/SKILL.md` handoff targets, request classification75 lines, and Default Routes.76- Shared contracts: when extending an enum such as `doc_type`, update every77 copy: the authoritative definition, the consumer-skill copied tables, and the78 script assets and templates shipped by `docs-site-bootstrap`. Note in the PR79 that existing hosts must re-run bootstrap because shipped copies do not80 auto-upgrade.81- Process docs: keep PRD/TRD/implementation-plan touch tables and forbidden82 areas consistent with the actual diff.8384## Verify the Final State8586After the edits, run:8788```bash89uv run scripts/check_repository_contract.py90uv run scripts/check_doc_contract.py91uv run --with pytest pytest <affected deterministic tests>92git diff --check93```9495Stop and repair a static failure before considering the change done. Run the96deterministic tests that cover the touched surfaces (e.g. lockfile contract97tests).9899## Report100101Summarize for handoff: the change type and tier, files changed with the102sync-surface checklist result, verification results, and any leftover items.