AGENT SKILL

knowledge-sync

Synchronize knowledge after code, test, build, or architecture changes.

License 许可
Apache-2.0
最近更新
2026-07-21
Stars
★ 0
Forks
0

01 前言 Front Matter

name
knowledge-sync
description
Synchronize knowledge after code, test, build, or architecture changes.

03 SKILL.md 正文

Knowledge Sync

Use this skill whenever code or project behavior changes.

Steps

  1. Run:

    aih knowledge prepare
    
  2. Read the generated context file: .aih/runtime/knowledge-sync-context.md

  3. Analyze:

    • Git log
    • Committed diff
    • Staged diff
    • Unstaged diff
    • Relevant untracked files
    • Changed source files
    • Existing architecture docs
    • Existing module docs
    • Existing pitfalls
    • Existing decisions
    • Relevant tests
  4. Update knowledge files:

    • Only update docs supported by actual changes
    • Do not invent or guess behavior
    • Update architecture.md if architecture actually changed
    • Update pitfalls.md if you found reproducible, non-obvious issues
    • Update or create module docs if interfaces changed
  5. Create a Session:

    aih session new --agent codex --title "brief description"
    

    Fill in:

    • Goal: What was this session trying to achieve?
    • Changes Made: List actual changes
    • Validation: What was tested
    • Knowledge Updates: Which docs were changed
    • Decisions Created: Any ADRs
    • Remaining Work: Unfinished items
    • Uncertainties: Open questions
  6. Create Decision (ADR) ONLY if:

    • Module boundaries changed
    • Public interfaces changed
    • Data formats changed
    • Compiler pipeline or pass order changed
    • Long-term dependencies introduced
    • Performance or memory strategy chosen
    • Clear tradeoffs made with alternatives
    aih decision new --title "decision title"
    
  7. Finalize:

    aih knowledge finalize --agent codex
    
  8. Report:

    • Session created
    • Decisions created
    • Documents updated
    • Documents intentionally NOT updated
    • Validation performed
    • Remaining uncertainty

Rules

  • Session is mandatory for significant code changes
  • Decisions are rare and only for long-term architectural choices
  • All updates must be supported by actual diff evidence
  • Do not complete task until finalize succeeds

04 同仓库更多 Skills