spec-consistency
Prevent and repair drift between `/docs` (source of truth), code, tests, CI, and runtime artifacts. Use before marking work done.
安装与使用
请根据来源仓库和你的 AI 工具说明安装此技能。先阅读技能文件和依赖要求,再添加到工作流。
查看来源 ↗使用指南技能说明
Spec Consistency (Anti-Drift)
When to use
Use whenever:
- Behavior changes (features/bugs/refactors that affect outputs)
-
/docschanges (especially/docs/use-cases/) - New endpoints/routes/commands are added
- QA Gatekeeper is reviewing completion
- Repo Explorer suspects drift
Drift is blocking in Gaia.
Inputs
-
/docs/(use-cases, architecture, testing docs) - Code changes (API/CLI/UI)
- Tests (unit/integration/e2e)
- CI workflows
- Docker compose + Makefile
Outputs
- Drift status:
none | suspected | confirmed - A concrete fix list (docs updates and/or code/test/CI alignment)
- Updated docs/tests/configs so docs and repo behavior match
Core rule
If unsure about “source of truth” direction, default to docs. Orchestrator may decide case-by-case, but must be able to justify in 1 line.
If “code wins” changes a use case: apply use-case gates (Playwright specs + manual regression).
Checks (do these in order)
1) Use-case ↔ behavior
For each affected UC file:
- Does the described outcome exist in the system?
- Are inputs/outputs (status codes, payload shapes, UI states) consistent?
- Are acceptance criteria testable and still true?
If UC changed (new/change/remove): trigger use-case gates.
2) Public surface ↔ docs
Validate consistency between:
- Documented routes/commands and actual ones
- Auth requirements and actual behavior
- Error formats/codes and actual behavior
- Versioning / pagination / sorting rules (if applicable)
3) Tests ↔ use cases
- For use-case changes: ensure integration/e2e coverage exists.
- Web: Playwright specs (follow repo convention; else standardize)
- API: curl-like checks against docker-compose stack
- Ensure tests reference UC IDs where relevant (web specs include UC ID in filename).
4) CI ↔ reality
- CI must run lint/build/tests as applicable.
- Ensure CI uses the same commands as local Make targets (or vice versa).
- If CI failing: fix CI first (blocking).
5) Docker/Make ↔ docs
If HTTP API:
- docker-compose must exist and match documented run instructions
-
.env.exampleexists and docs list required vars (high-level) Makefile: -
make up/down/test/lint/build(or best approximation) exists and docs reflect it
Fix strategies
- Prefer minimal, surgical changes that restore consistency.
- If docs are correct: change code/tests/configs to match docs.
- If code is correct and docs outdated: update docs comprehensively.
- If behavior/use-cases change as a result → apply use-case gates.
Validation checklist (before declaring “no drift”)
- UC acceptance criteria matches observable behavior
- Playwright specs exist when web use-cases changed
- Manual regression labels completed for use-case changes (
curl,playwright-mcp) - CI exists and is green
- Make targets align with CI and docs
- Skills that mention commands/paths match reality (skill drift = blocking)
References
-
AGENTS.md(drift policy; blocking) -
.github/skills/gaia-process/SKILL.md(workflow) -
.github/skills/doc-derivation/SKILL.md(restore docs-first) -
.github/workflows/,Makefile,docker-compose.yml -
/docs/use-cases/,/docs/architecture/,/docs/testing/
使用示例
查看来源仓库中的使用示例与配置说明。
查看来源 ↗来源历史
- 收录时间
- 2026-03-11
- 索引更新时间
- 2026-03-11
- Branch
- main
收录与同步日期属于本站记录。源码修改历史请查看来源仓库。
GitHub ↗chat Comments (0)
Sign in to join the discussion and leave a comment.
No comments yet. Be the first to share your thoughts!