跳到正文
cccskills
免费在 GitHub 公开

tw-codebase-doctrine

Compile deep repository evidence into artifact-bound correctness doctrine — authority/law/proof maps, owned invariants, failure archaeology, and the strongest durable destination for each piece of knowledge, plus an optional minimal repository-specific skill portfolio. Use when the user wants both deep codebase understanding AND durable doctrine, knowledge routing, or repo-specific skill recommendations. Research discoverable facts before asking. Read-only. Not for quick onboarding, one isolated invariant, ordinary implementation, generic review, or direct skill creation.

中文简介正在准备中。当前显示原文说明。

查看安装方法

包含的文件(1)

  • SKILL.md8.9 KB

SKILL.md(原文)

安装前可以查看交给 AI 代理的指令内容。

Codebase Doctrine

Mission

Determine what future maintainers and coding agents must know, decide, reject, and prove to change a repository safely.

authorized intent
-> named search questions
-> artifact-bound evidence
-> closed claim graph
-> current/target authorities, laws, invariants, boundaries, failures, proof
-> strongest knowledge destinations
-> zero or one root skill plus zero to five focused skill candidates

The doctrine is a canonical synthesis for one pinned repository and intent state. It is never stronger than current code, executable proof, or explicit user authority.

Activation boundary

Use only when the request contains both deep repository understanding and durable correctness doctrine, knowledge routing, authority/proof maps, or repo-specific skill recommendations.

Do not use for: quick onboarding or architecture fingerprinting (use tw-codebase-archaeology); one feature, bug trace, or isolated invariant (use tw-invariant-ace); ordinary implementation or generic review; skill brainstorming without repository evidence; or direct skill creation. This skill is read-only — persistence and skill creation require separate explicit authorization.

Modes

ModePurposeTerminal artifact
surveyProvisional map + exact next questionsCodebase Survey
doctrineComplete baseline workflowCodebase Doctrine
deepBaseline plus adaptive specialistsDoctrine + specialist receipts
refreshRevalidate an existing doctrine at a new stateDoctrine Delta + resulting Doctrine
portfolioReevaluate knowledge destinations and skill candidacyPortfolio
auditCompare current guidance and skills against doctrineDoctrine Audit

Pick exactly one. Do not force a full doctrine into survey, portfolio, audit, or delta work.

Phase 0 — intent before doctrine

Before asking intent questions, inspect enough to distinguish discoverable facts from user-owned choices: repository guidance and existing skills; manifests and build/test/release roots; major subsystems and cross-cutting flows; deployment/distribution shape; visible correctness, compatibility, security, performance, and operational priorities.

Then clarify only material user-owned choices (ask directly, or hand to a clarifying-questions pass): target boundary, consumers, current-state vs target-state posture, desired products, correctness priorities, non-goals, proof bar, compatibility/migration posture, persistence. Do not ask for repository facts, laws, implementation design, or skill-file content — discover those.

Record an intent capsule: target, consumers, posture, products, priorities, non-goals, proof bar, a primary correctness question, a primary risk, explicitly-sourced user invariant hypotheses (if any), and assumptions/deferrals. The capsule does not declare repository-derived laws before research.

Artifact state

Pin and bind all evidence to one state: repository_root, repository_name, branch, head, dirty_state, scope, intent_id, captured_at. Re-pin before closure; reject stale evidence after a relevant head, diff, scope, or intent change.

Evidence discipline

Always separate: fact | inference | recommendation | open-question | current-observed-law | documented-intent | explicit-user-target | proposed-law | contradicted-or-retired. Treat absent evidence as uncertainty, not permission.

Workflow

1. Fingerprint the repository

Repository kind, languages, build/test systems, deployment shape, dependency direction, subsystems, public-contract roots, entrypoints, local dialect. Architecture is a hypothesis backed by responsibilities and dependency direction, not directory names.

2. Build the system map

Trace representative flows: input/trigger -> parsing/routing -> orchestration -> domain transition -> persistence/integration -> output/effect. Record external boundaries, persistence/config roots, feedback loops, and delays.

3. Map authority and state

For important state and evidence, identify who may create, mutate, validate, certify, publish, transfer, consume, retire, and roll back it. Prioritize write paths, transitions, certificates, transactions, and rollback over readers or names.

4. Extract the behavioral model

Use the smallest correctness vocabulary that explains carriers, operations, observations, state classes, transitions, laws, non-laws, forbidden states, and projections. Do not turn incidental current behavior into doctrine.

5. Extract current and target laws

Every law records: doctrine status and normative authority; owner; accepted observations and counterexamples; current evidence and (when applicable) target authority; gap statement; proof obligations and proof surfaces. Never merge an observed law and a proposed repair law into one unlabelled row.

6. Extract owned invariants and boundaries

An invariant requires: owner, source of truth, initialization, preserving transitions, violating counterexamples, enforcement boundary, exception owner, proof. A boundary requires: accepted/rejected inputs, authority before/after, transferred state or evidence, proof.

7. Failure archaeology

Normalize local wounds into recurring law, authority, representation, boundary, or proof-shape failures. A negative route may be suspected, witnessed, canonical, or retired — only a current canonical projection may create a durable route exclusion.

8. Map proof

Distinguish proof design, executed current proof, historical proof, and manual/reviewer proof. Executed current proof records command, exit code, result reference, toolchain, target, artifact state, and verification time.

9. Resolve contradictions

Do not average incompatible claims. Resolve them, or preserve the contradiction, the stronger evidence, residual uncertainty, and materiality.

10. Route durable knowledge

Every durable active claim gets exactly one primary destination — prefer the strongest enforceable one:

code | type_or_representation | test_or_property | static_tool_or_linter | CI_gate
| repository_guidance (AGENTS.md/CLAUDE.md) | ADR_or_reference | negative_ledger
| repository_root_skill | focused_skill | retain_in_doctrine | reject

11. Optional skill portfolio

Shape: zero or one root repository skill, plus zero to five focused skills. No skill is required. Each candidate is an evidence-bearing decision, not a self-attested boolean; new candidates normally end as recommended_for_trial, with accepted reserved for empirical use evidence.

12. Test saturation

Stop when more search is unlikely to change a material decision: every required lane covered, no open route-changing search, no unresolved material contradiction, every durable active claim routed. Never claim exhaustive understanding.

Adaptive specialists (deep mode)

Only for unresolved route-changing questions, never just because mode is deep. Suggested waves: (1) cartographer + authority/state mapper; (2) behavioral-law miner / failure-forensics / proof mapper on identified surfaces; (3) portfolio skeptic after draft routing; (4) saturation auditor after the complete draft. Spawn read-only workers with your harness's parallel-agent mechanism (Claude Code Task / Codex custom agents); each gets a scoped assignment and returns one evidence-bearing packet; reject stale, wrong-scope, or out-of-authority material; synthesize yourself.

Persistence and handoff

Default output is conversational. Persist only when requested, to .codebase-doctrine/doctrine.yaml (local-exclude by default unless the user wants versioned doctrine). This skill recommends skills; it does not create them. After explicit authorization, hand a doctrine-bound skill brief to a skill-authoring pass.

Hard rules

  • Read-only. Research discoverable facts before asking.
  • No material doctrine without a locked intent capsule.
  • No repository-derived invariant locked as user intent; no silent intent drift.
  • Every durable active claim has exactly one primary route.
  • Writes and transitions outrank reads for authority.
  • No law without status, authority, counterexample, evidence, and proof posture.
  • No invariant without owner, initialization, transitions, boundary, counterexample, and proof.
  • No persistence or skill creation without explicit authorization.
  • Never claim exhaustive understanding.

评价

还没有评价。欢迎分享你的使用感受。

评论

无需登录即可发表。欢迎分享使用感受、提问,或说明在哪些环境下无法运行。

还没有评论。来写第一条吧。

提交后会立即公开。请勿填写邮箱、电话等个人信息。URL 最多 2 个。

0 / 1000 字

此表单受 reCAPTCHA 保护,适用 Google 的隐私权政策和服务条款。

同一仓库的技能

Automates browser interactions for web testing, form filling, screenshots, and data extraction. Use when the user needs to navigate websites, interact with web pages, fill forms, take screenshots, test web applications, or extract information from web pages.

中文简介正在准备中。当前显示原文说明。

SDiamante13/dotfiles102026年10月2日 更新

catchup

免费

Rebuilds session context after a clear by reading git history, plans, and beads state. Triggers on 'catch up'.

中文简介正在准备中。当前显示原文说明。

SDiamante13/dotfiles102026年10月2日 更新

changelog

免费

Generate a bullet-point summary of branch changes for a PR description. Triggers on "changelog", "pr summary", "summarize branch", or "/changelog".

中文简介正在准备中。当前显示原文说明。

SDiamante13/dotfiles102026年10月2日 更新

commit

免费

Commit the current changes with quality checks, status review, staged diff inspection, appropriate tests, and a clear commit message. Use when the user says "commit", "c", asks to make a commit, or wants changes saved in git.

中文简介正在准备中。当前显示原文说明。

SDiamante13/dotfiles102026年10月2日 更新

declutter

免费

Refactor code to remove dead code, useless comments, unused variables, and unused imports. Use when asked to declutter a class, clean up noisy code, remove cruft, or run `/refactor:declutter`.

中文简介正在准备中。当前显示原文说明。

SDiamante13/dotfiles102026年10月2日 更新

dry

免费

Refactor duplicated code by extracting helpers, shared abstractions, or clearer reusable structure. Use when asked to apply DRY, remove duplication, consolidate repeated logic, or run `/refactor:dry`.

中文简介正在准备中。当前显示原文说明。

SDiamante13/dotfiles102026年10月2日 更新

查看 SDiamante13 的全部技能

报告此技能的问题