一键导入
context-driven-development
Use this skill for all context planning, creation, updates, review, search, and sync work in this repository.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Use this skill for all context planning, creation, updates, review, search, and sync work in this repository.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
| name | context-driven-development |
| description | Use this skill for all context planning, creation, updates, review, search, and sync work in this repository. |
| compatibility | opencode |
This is the single source of truth for CDD in this repository.
CDD separates:
<CTX_ID>-*.md): define desired outcomes and E2E-observable next actions.index.md): document how projects/features work and how to operate/debug them.SKILL.md or skill/SKILL.md, optional): document how a project should be consumed by other projects.lessons/<CTX_ID>-*.md, optional): capture non-obvious problems and validated workarounds for a specific context.CDD uses optional typed companion artifacts so each context links to references and lessons only when they are actually used.
CDD also supports explicit blocking dependencies between contexts.
Use CDD to describe what success looks like, not how code should be implemented.
.nexus/context/<project>/
├── index.md # Project operational knowledge
├── SKILL.md # Optional project integration guide (alternative to skill/SKILL.md)
├── lessons/
│ └── <CTX_ID>-<name>.md # Optional project-scoped lessons learned
├── reference/
│ ├── design_reference/
│ │ └── <CTX_ID>-<name>.md # Optional project-scoped design/visual reference
│ ├── system_design/
│ │ └── <CTX_ID>-<name>.md # Optional project-scoped architecture reference
│ └── <other_type>/
│ └── <CTX_ID>-<name>.md # Optional additional project-scoped references
├── skill/
│ └── SKILL.md # Optional cross-project wrapper/integration contract
└── <feature>/
├── index.md # Feature operational knowledge
├── SKILL.md # Optional feature integration guide (alternative to skill/SKILL.md)
├── skill/
│ └── SKILL.md # Optional feature wrapper/integration contract
├── <CTX_ID>-<name>.md # Context specification
├── lessons/
│ └── <CTX_ID>-<name>.md # Optional feature-scoped lessons learned
└── reference/
├── design_reference/
│ └── <CTX_ID>-<name>.md # Optional design/visual reference
├── system_design/
│ └── <CTX_ID>-<name>.md # Optional architecture/flow reference
└── <other_type>/
└── <CTX_ID>-<name>.md # Optional additional references as needed
Mapping:
<project>: crate/package/system name (kebab-case)<feature>: feature/domain name (kebab-case)Rules:
.nexus/context/<project>/<feature>/<CTX_ID>-<name>.md..nexus/context/<project>/SKILL.md or .nexus/context/<project>/skill/SKILL.md..nexus/context/<project>/<feature>/SKILL.md or .nexus/context/<project>/<feature>/skill/SKILL.md.nexus/context/<project>/<feature>/lessons/<CTX_ID>-<name>.md.nexus/context/<project>/lessons/<CTX_ID>-<name>.md.nexus/context/<project>/<feature>/reference/<type>/<CTX_ID>-<name>.md.nexus/context/<project>/reference/<type>/<CTX_ID>-<name>.mdreference/... and lessons/....Interpretation:
ui or data when those concerns belong inside domain features.Use .nexus/context/<project>/SKILL.md or .nexus/context/<project>/skill/SKILL.md when a project is intended to be wrapped or reused by other projects.
Purpose:
Rules:
depends_on.contexts), not in wrapper skill prose.SKILL.md and skill/SKILL.md exist, they must not conflict.Use context-scoped lessons files to record non-obvious execution issues discovered while implementing or operating one specific context.
Allowed canonical paths:
.nexus/context/<project>/lessons/<CTX_ID>-<name>.md.nexus/context/<project>/<feature>/lessons/<CTX_ID>-<name>.mdCreation rule:
lessons in frontmatter.Scope:
Do not use this file for:
Recommended entry shape:
Use vertical feature modules as the default baseline for web apps.
Example:
my-web-appplatform, auth, profile-pageExample file structure:
.nexus/context/my-web-app/
├── index.md
├── SKILL.md
├── platform/
│ ├── index.md
│ ├── SKILL.md
│ ├── PLA_001-bootstrap-project.md
│ ├── PLA_002-configure-database-migrations.md
│ ├── PLA_003-expose-rest-and-sse-contract.md
│ ├── lessons/
│ │ └── PLA_002-configure-database-migrations.md
│ └── reference/
│ └── system_design/
│ └── PLA_003-expose-rest-and-sse-contract.md
├── auth/
│ ├── index.md
│ ├── SKILL.md
│ ├── AUT_001-email-login-success.md
│ ├── AUT_002-facebook-login.md
│ ├── AUT_003-register-email-password.md
│ ├── AUT_004-password-reset-request.md
│ ├── lessons/
│ │ └── AUT_001-email-login-success.md
│ └── reference/
│ ├── design_reference/
│ │ └── AUT_001-email-login-success.md
│ └── system_design/
│ └── AUT_004-password-reset-request.md
└── profile-page/
├── index.md
├── SKILL.md
├── PRF_001-load-profile-page.md
├── PRF_002-edit-profile-fields.md
├── PRF_003-subscribe-profile-updates-sse.md
├── lessons/
│ └── PRF_002-edit-profile-fields.md
└── reference/
├── design_reference/
│ └── PRF_001-load-profile-page.md
└── system_design/
└── PRF_003-subscribe-profile-updates-sse.md
Example dependency semantics:
profile-page depends on platform and auth.auth depends on platform.Example context granularity under auth:
email-login-successfacebook-loginregister-email-passwordpassword-reset-requestUse typed reference files when needed so references stay traceable to one context.
Default folders:
.nexus/context/<project>/reference/design_reference/.nexus/context/<project>/reference/system_design/.nexus/context/<project>/<feature>/reference/design_reference/.nexus/context/<project>/<feature>/reference/system_design/reference/.Guidance:
design_reference: visual contracts, design intent, interaction states, and expected look/feel (Figma-like guidance).system_design: architecture flows, sequence/state diagrams, boundary contracts.Legacy compatibility:
.nexus/context/<project>/design_references/design_reference.md may be retained during migration, but it is not required.PRJ_NNN-brief-description.md or FTR_NNN-brief-description.mdPRJ or FTR: 3-letter uppercase prefix from project or feature nameNNN: zero-padded sequence number (scoped to the chosen prefix)brief-description: kebab-case, concise001 and increments within that prefix only.Prefix choice:
CLI_001, CLI_002): Use when contexts span multiple featuresRAL_001, MKT_002): Use when each feature has independent context trackingExamples:
CLI_007-marketplace-search.md (project-scoped)RAL_001-ralph-command-surface.md (feature-scoped)KNO_012-sync-workflow.md (project-scoped)Required YAML fields:
---
context_id: PRJ_001
title: Human-Readable Title
project: project-name
feature: feature-name
created: "YYYY-MM-DD"
---
Optional companion links (include only when used):
references:
design_reference: <CTX_ID>-<name>.md
system_design: <CTX_ID>-<name>.md
lesson: <CTX_ID>-<name>.md
Resolution rules:
references.design_reference: <file>.md resolves to reference/design_reference/<file>.md.references.system_design: <file>.md resolves to reference/system_design/<file>.md.lesson: <file>.md resolves to lessons/<file>.md.../reference/system_design/<file>.md).Optional dependency metadata (blocking prerequisites only):
skills:
- justfile
- nextjs
depends_on:
contexts:
- ABC_001
- XYZ_014
Rules:
depends_on is optional; omit when there are no prerequisites.depends_on.contexts only.depends_on.contexts entries must be context IDs (for example ABC_001).references and lesson are optional; include them only when the companion files exist and are used by this context.design_reference and system_design.references.* and lesson can resolve to feature-scoped or project-scoped files.skills is optional; use it to reference implementation guidance by skill name only.skills entries must be bare names (for example justfile, nextjs, pnpm) and must map to files under skills/**/<name>/SKILL.md.Context specs must use this order:
# CTX_ID: Title## Desired Outcome## Reference (optional; remove when empty)## Next ActionsUse a table:
| Description | Test |
|---|---|
| ... | ... |
Rules:
Description: starts with an action verb.Test: snake_case, no test_ prefix.Dependencies are strict prerequisites, not suggestions.
depends_on.contexts.skills using skill names.For each Next Action, agents should consume context artifacts in this order:
.nexus/context/<project>/<feature>/<CTX_ID>-<name>.md)references.*), if presentlesson), if presentAfter reading in this order, generate and execute E2E tests aligned to the Next Actions table.
index.mdindex.md files store operational knowledge, not context specs.
Both project and feature index.md files must start with YAML frontmatter using this exact schema:
---
project_id: project-or-subproject-id
title: Human-Readable Title
created: "YYYY-MM-DD"
status: active
dependencies:
- other-project-id
---
Rules for index frontmatter and dependency content:
dependencies entries must be project or feature identifiers only.dependencies must list only direct operational prerequisites.Examples:
profile-page depends on platform and auth.auth depends on platform.Project index.md should include:
reference/* and lessons/ folders)Feature index.md should include:
Rules:
index.md files only.index.md dependency sections are informational only.index.md as the authoritative source for blocking context dependencies.depends_on.contexts.auth, profile-page) over horizontal layers (ui, data).Do not put these in numbered context specs:
nexus -> select context/nexus-context-create -> create context specs/nexus-context-update -> update context/index docs/nexus-context-generate-red-tests -> generate red-only tests from Next Actions/nexus-context-sync-from-chat -> propose updates from conversation/nexus-context-sync-with-code -> propose updates from git/code changes/nexus-context-review -> audit CDD compliance/nexus-context-search -> search contexts by outcome/actions/nexus-context-from-code -> recommend contexts from code scope/nexus-context-validate-unstaged -> validate unstaged code/tests against Next Actions and language rulesWhen working on any context command or context file:
This skill should be used every time you work on Next.js projects or Next.js app code changes in this repository.
This skill should be used every time you do software engineering
Use this skill when working on Nexus context workflows, CDD specifications, or deriving reusable skills from repository code.