dh-domain-check
Map tasks to DDD bounded contexts and validate SOLID as a pre-implementation gate; flag boundary violations, produce verdict. Use after planning, to validate architecture, check SOLID, or bounded context check.
- License 许可
- MIT
- 最近更新
- 2026-11-10
- Stars
- ★ 8
- Forks
- 1
01 前言 Front Matter
- name
- dh-domain-check
- license
- MIT
- metadata
- { "audience": "developers", "workflow": "development" }
- description
- Map tasks to DDD bounded contexts and validate SOLID as a pre-implementation gate; flag boundary violations, produce verdict. Use after planning, to validate architecture, check SOLID, or bounded context check.
- allowed-tools
- read, write
- compatibility
- opencode, copilot, antigravity
03 SKILL.md 正文
Core Rules
- Read
./docs/plans/<plan-slug>/plan.md(or current task scope) to understand what will change - Read the project's
AGENTS.mdfor architectural conventions if it exists - Scan the project directory structure to identify bounded contexts by module/domain boundaries
- If the project has no explicit DDD structure, note it and skip bounded-context mapping — do not force-fit
- Check each SOLID principle; only flag violations with a plausible failure path
- Do not block progress on minor style preferences or naming disagreements
- Write output to
./docs/plans/<plan-slug>/tasks/domain-check.md
SOLID Validation Guide
For each planned change, check:
- Single Responsibility: Does each unit (class, module, sub-task) have exactly one reason to change?
- Open/Closed: Are we extending behavior without modifying existing tested abstractions?
- Liskov Substitution: Would new types break substitutability with their base types?
- Interface Segregation: Are we adding fat interfaces that force clients to depend on methods they don't use?
- Dependency Inversion: Are new dependencies on abstractions, not concretions?
Graph-Assisted Boundary Discovery
When dh-setup indexed the project, use the dh-code-query skill to ground
the context map instead of relying only on directory names:
cgr graph importers/callersto expose cross-module dependencies and actual usage edges.cgr graph implementors/overridesto test LSP/ISP claims.cgr graph tests-reachingto see which contexts have coverage at the boundary.
Verify every row in the source; fall back to the directory scan below when the project is not indexed or the graph is stale.
Bounded Context Discovery
To identify bounded contexts:
- Look for top-level directories that represent distinct domains (e.g.,
auth/,billing/,catalog/) - Identify shared kernel modules used across contexts (e.g.,
common/,shared/,lib/) - Check for anti-corruption layers (translation between contexts)
- Flag any sub-task that reads/writes across context boundaries without an explicit integration pattern
Output Template
# Domain & Architecture Check: [Task Title]
## Bounded Contexts Touched
| Context | Module(s) | Risk |
|---|---|---|
| [Name] | `path/to/module` | Low / Med / High |
## Cross-Context Concerns
- [Any boundary violations, integration risks, or missing anti-corruption layers]
## SOLID Compliance
| Principle | Sub-Task / Change | Status | Note |
|---|---|---|---|
| SRP | [change description] | ✅ / ⚠️ / ❌ | [brief explanation] |
| OCP | [change description] | ✅ / ⚠️ / ❌ | [brief explanation] |
| LSP | [change description] | ✅ / ⚠️ / ❌ | [brief explanation] |
| ISP | [change description] | ✅ / ⚠️ / ❌ | [brief explanation] |
| DIP | [change description] | ✅ / ⚠️ / ❌ | [brief explanation] |
## Verdict
Clear to proceed / Proceed with caution / Architecture concern (blocking)
## Blocking Issues (if any)
- [Only if ❌ flagged with concrete impact and remediation suggestion]
Safety
- Do not modify any code files
- Write only to
./docs/plans/<plan-slug>/tasks/domain-check.md - If no plan exists, ask the user to run
/planfirst - A "proceed with caution" verdict is not a failure — it means be aware of the noted risks
Doc search
Documentation management: delegate create / update / delete / retrieve of generated documents (excluding docs/plans) to the best available documentation agent (bundled documentation capability as fallback) — the main and only documentation owner (see dh-create-documentation).
Search generated documentation quickly: notesmd-cli search-content "<term>" --vault "<project-name>" or obsidian search query="<term>" (fallback: rg --glob '*.md' "<term>" docs/).
04 同仓库更多 Skills
dh-simplify
Review changed code for reuse, quality, and efficiency (three parallel reviews), then fix findings directly. Use after making changes or when asked to clean up, refactor, simplify, or improve this code.
dh-setup
Audit system software, configure user MCPs/plugins, scaffold project QA (hooks + per-stack tools), bootstrap docs/architecture with the selected architecture agent, and write harness directives into AGENTS.md. Use to check requirements or setup the environment.
dh-semver
Apply strict Semantic Versioning — analyze commits since the last tag to determine the bump type (major/minor/patch from conventional commit prefixes), generate an automated changelog grouped by breaking changes, features, fixes, and chores, and create a git tag locally without pushing until confirmed, handling both conventional commits and manual version decisions. Use when preparing a release, invoked by dh-execute-plan after plan completion and dh-final-review for release readiness, or when the user asks "what version is next?", "bump version", "generate changelog", "tag release", or "what changed since last release?".
dh-review
Verify a plan sub-task against acceptance criteria, scope, done-when; review diff, validation, regression risk; structured verdict to tasks/review.md. Plan Alignment Mode (fast execution) is a separate mode: no sub-task selection, no diff review, no code review — it compares plan.md with plan_fast.md and writes tasks/review-fast.md (pre-execution) or tasks/review-fast-final.md (plan-end). Use after implementation, to review/verify the sub-task, or to check fast-plan alignment.
dh-resume-plan
Resume a paused phased plan from docs/plans/<slug>/handoff.md: validate the contract, detect drift, rehydrate context, mark the handoff resumed, and continue via dh-execute-plan resume mode. Use when the user says "resume the plan", "continue where we stopped", "pick up the plan", or "resume after a pause".
dh-preflight
Run tests, linters, static analysis as a release gate: auto-detect tooling, check dirty state, pass/fail verdict with actionable failures (no auto-fixes). Use to run preflight, pre-release check, or validate before release.