一键导入
preferences-documentation
Documentation conventions including structure, formatting, and maintenance practices. Load when writing or reviewing documentation.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Documentation conventions including structure, formatting, and maintenance practices. Load when writing or reviewing documentation.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
Index curated reference corpora into a searchable knowledge graph via the cognee engine, then query it to ground technical writing, review, and analysis. Use when ingesting reference documents into named datasets or retrieving grounding context for tasks like drafting or reviewing a manuscript. A reference-knowledge index, explicitly not agent session memory.
Nix development conventions for flakes, derivations, modules, and code style. Use when authoring flake.nix files, writing derivations or builders, designing NixOS/nix-darwin/home-manager modules, or following nix formatting and naming conventions. For check architecture and CI integration, see preferences-nix-checks-architecture and preferences-nix-ci-cd-integration.
Approximately-verifiable, refinement-driven development for type-driven domain-driven design. Use when modeling a domain as a dependently-typed Lean 4 specification, refining/lowering it to a Rust implementation, lifting the implementation back via Charon and Aeneas to check spec<->implementation correspondence (translation validation) — mechanically when tractable, otherwise via differential testing or LLM comparison — or when generating and diffing type-system diagrams of the model and implementation to track their evolution. Mechanical on-the-nose proof is the precise ideal, not a requirement; its absence is not a failure of the method.
Guide for creating effective skills. This skill should be used when users want to create a new skill (or update an existing skill) that extends Claude's capabilities with specialized knowledge, workflows, or tool integrations.
Algebraic data type patterns including sum types, product types, and pattern matching across languages. Load when designing type hierarchies or working with discriminated unions.
Algebraic laws including functor/monad laws and property-based testing strategies. Load when verifying algebraic properties or writing property tests.
| name | preferences-documentation |
| description | Documentation conventions including structure, formatting, and maintenance practices. Load when writing or reviewing documentation. |
docs/ for their active documentation but some have
both docs/ and another directory like site/, website/, nbs/, etc.README.md files in the repository root should aim to include minimal
content with relevant links to the docs website unless they do not yet have
docs.Generally assume we intend to follow this standard structure for repository documentation combining user-facing and development documentation:
docs/
├── tutorials/ # Diataxis: Learning-oriented lessons
├── guides/ # Diataxis: Task-oriented how-tos
├── concepts/ # Diataxis: Understanding-oriented explanations
├── reference/ # Diataxis: Information-oriented API docs (optional)
├── about/ # Contributing, conduct, links into development
├── development/ # Development documentation (adapted AMDiRE-based)
│ ├── index.md # Development overview and navigation
│ ├── context/ # Context Specification (problem domain)
│ │ ├── index.md # Context overview and table of contents
│ │ └── context.md # Problem domain, stakeholders, objectives
│ ├── requirements/ # Requirements Specification (problem ↔ solution bridge)
│ │ ├── index.md # Requirements overview and traceability matrix
│ │ └── requirements.md # Functional/non-functional requirements
│ ├── architecture/ # System Specification (solution space)
│ │ ├── index.md # Architecture overview and table of contents
│ │ └── architecture.md # System design and component structure
│ ├── traceability/ # Requirements traceability
│ │ ├── index.md # Traceability overview
│ │ └── testing.md # Test framework and validation approach
│ └── work-items/ # Work packages and implementation tracking
│ ├── index.md # Work items overview and status dashboard
│ ├── active/ # In-progress work items
│ ├── completed/ # Finished items with PR/ADR/RFC/RFD references
│ └── backlog/ # Planned but not yet started items
└── notes/ # EPHEMERAL: Working notes excluded from rendering
└── [category]/ # Temporary staging (see "Working notes" section)
Many projects will begin with only docs/development/ and add the user docs
directories later. Initial development drafts context.md, requirements.md,
architecture.md, and testing.md as single comprehensive documents. As complexity
grows—expected for most real projects—decompose each document by major
subsection into separate files with descriptive names (e.g., context.md →
stakeholders.md, objectives.md, constraints.md). Update the corresponding
index.md to serve as table of contents and navigation after sharding. This
pattern maintains manageability while preserving traceability as documentation
scales. If the documentation becomes sufficiently complex, we can continue to
refactor into a directory tree with additional levels.
The docs/notes/ directory serves as ephemeral staging for development notes
that have not been formalized into the permanent documentation structure. These
notes are explicitly temporary and must be either migrated to formal
documentation or discarded.
Organization: Use category-based subdirectories with kebab-case filenames:
docs/notes/
├── security/ # Security investigations
├── architecture/ # Architectural exploration
├── performance/ # Performance analysis
└── [category]/ # Other categorized notes
Exclusion from rendering: Working notes must never appear in rendered documentation sites. Configure your documentation system accordingly:
src/content/config.ts, implicitly excluding notes/_quarto.yml):
project:
render:
- "!docs/notes/**"
docusaurus.config.js):
docs: {
exclude: ['**/notes/**']
}
mkdocs.yml):
exclude_docs: |
notes/
Lifecycle: Every working note must eventually follow one of two paths:
Migrate to formal documentation: Extract valuable insights, revoice from
informal working notes to formal documentation style, and move content to the
appropriate location in the user-facing docs (tutorials/, guides/,
concepts/, reference/) or development docs
(development/context/, development/requirements/,
development/architecture/, etc.). Delete the working note after migration.
Discard when no longer relevant: Delete notes that served temporary investigation purposes, documented abandoned approaches, or have been superseded by other documentation.
Working notes should not persist indefinitely. Regularly audit docs/notes/ for
stale content and progress notes through their lifecycle. The goal is to keep
this directory empty or minimal in stable projects.
Relationship to work items: Unlike docs/development/work-items/ which
maintains a permanent record of development efforts with traceability to issues
and PRs, working notes in docs/notes/ are ephemeral drafts that get cleaned
up after their content is either formalized or determined to be no longer needed.
Some documentation generators like Astro Starlight require markdown files to use YAML frontmatter with a title like
---
title: "Title: subtitle"
---
instead of the # Title: subtitle format.
As such it's best to primarily use this convention when authoring markdown.
Note that quotes are required in YAML when the title contains special characters like colons; simple titles without special characters don't require quotes.
Not all markdown documents require subtitles—the subtitle format is shown here for completeness to demonstrate proper quoting.
Plain markdown systems (GitHub, static markdown) also support frontmatter titles, making this convention broadly compatible.
When working in a documentation directory, check for frontmatter in existing files to confirm the convention in use.
If files contain title: in YAML frontmatter, use ## to start content sections to avoid duplicate titles in rendered output.
Consecutive **Term**: description lines merge into one paragraph when rendered.
Use - **Term**: description bullet format for 2+ definitions.
<issue-id>-<very-short-description>.md with zero-padded issue IDs to support
up to four digits (e.g. GitHub issue #12 becomes 0012-description.md in
work-items).ADRs live in docs/development/architecture/adrs/ following the AMDiRE structure above.
Authoring conventions covering section structure, status lifecycle, commanding voice, business justification requirements, and antipatterns are in references/adr-conventions.md.
Load that companion file when writing, reviewing, or evaluating ADRs.
Documents carry temporal context that informs their reliability. Use the following frontmatter fields to make provenance explicit.
These fields are optional but recommended for any document in docs/ that persists beyond a single session.
created: YYYY-MM-DD — date the document was first authored.last-validated: YYYY-MM-DD — date the document's content was last reviewed and confirmed accurate, independent of incidental edits (typo fixes, formatting). Session-checkpoint updates this field for documents reviewed during a session. Session-orient uses it for staleness scanning: a file modified recently for formatting but last validated months ago is stale; an unmodified file validated recently is not.superseded-by: <path or description> — marks a document as replaced by another. Documents with this field older than 30 days should be deleted or archived during session-orient health checks.No rigid precedence hierarchy exists between document types. A recently edited working note can supersede an older formal spec, and vice versa. When information from different documents contradicts, recency of the specific conflicting content is the primary signal.
Use git history rather than filesystem modification times to assess recency.
Filesystem mtime is unreliable — it changes on git checkout, git rebase, and other operations that do not represent content edits.
Prefer git log --follow -1 --format='%ai' -- <file> for file-level provenance and git blame -L <range> <file> for line-level provenance.
When contradictions are detected during any task, flag them to the user with provenance evidence (file paths, dates, relevant line ranges) rather than silently preferring one source. The user decides which source is authoritative; the agent's role is to surface the contradiction and the temporal evidence.
Maintain a docs/notes/README.md file as a table of contents for the ephemeral notes directory.
Each entry should include the subdirectory or file name, a one-line description of its purpose, and the date it was created or last validated.
This index helps agents and humans quickly assess which notes exist and their approximate currency without reading each file.
Update the index when creating, deleting, or significantly revising working notes.
docs/reference/ files automatically generated by
most language API reference documentation tools.docs/development/context/ if problem domain or stakeholders changedocs/development/requirements/ if functional/non-functional requirements changedocs/development/architecture/ if design decisions, components, or technology changedocs/development/traceability/ if test strategy or validation approach changesdocs/development/work-items/ for implementation status tracking~/.claude/skills/preferences-git-version-control/SKILL.md.