/project-toolkit:domain-designfrom project-toolkit
Designs APIs, schemas, and module boundaries from business behavior rather than payload shape or CRUD defaults. Guides state derivation, domain operations, and use-case validation.
Ships in project-toolkit. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them; scripts run unread.
Design from the behavior the business must observe and control. Source shape and implementation convenience are inputs, not the domain model.
Owns one invariant: an API, schema, or module boundary is derived from business
questions and operations, then validated against them. It does not mandate DDD
tactical patterns, ban CRUD, or replace architecture review or the ADR
workflow. Quality principles (cohesion, coupling, YAGNI, minimal
implementation) belong to the code-qualities-assessment skill; this skill
applies them and does not restate them.
design this schema, API design, where should this module boundary go,
CRUD or domain operation, is this explicit state or reconstruction
A change adds or reshapes an API contract, a table or document schema, or a module boundary. A change that reuses an existing contract unchanged skips this skill.
business question or operation
-> observable behavior + invariant
-> state that must be explicit
-> API/module contract, and schema/history model
-> validate against use cases
-> simpler adequate model? yes: adopt. no: revise boundaries and state.
evaluate_design.py turns the answers above into a decision table so a
reviewer can read them. It is advisory: it cannot tell whether the answers are
true.
( for d in "${CLAUDE_PLUGIN_ROOT}" "${COPILOT_PLUGIN_ROOT}" .claude; do if [ -n "$d" ] && [ -f "$d/lib/ptk_run.py" ]; then exec python3 "$d/lib/ptk_run.py" skills/domain-design/scripts/evaluate_design.py proposal.json; fi; done; echo "ptk_run: no plugin root holds lib/ptk_run.py" >&2; exit 2 )
| Field | Meaning |
|---|---|
business_question | The question the design must answer |
state_representation | explicit or reconstructed |
fact_is_first_class | The business must know this fact directly |
api_style | crud or domain |
behavior_has_invariant | The behavior has rules or multi-step transaction semantics |
temporal_question / history_modeled | The answer depends on a prior time / the design keeps history |
mirrors_source_payload / behavior_diverges_from_source | The model copies the payload / the business question differs from it |
speculative_mechanism / mechanism_has_behavioral_need | A proposed aggregate, event store, or abstraction (or null) / a current behavior requires it |
use_cases | Non-empty list of {question, needs_reconstruction} from step 6 |
All fields are required except speculative_mechanism, which may be null or
omitted. mechanism_has_behavioral_need is still required as a boolean when
there is no mechanism. The script checks for at least one use case; walking
three to five is the author's job. A minimal proposal.json:
{
"business_question": "Which sites finished fetching for March?",
"state_representation": "explicit",
"fact_is_first_class": true,
"api_style": "domain",
"behavior_has_invariant": true,
"temporal_question": false,
"history_modeled": false,
"mirrors_source_payload": false,
"behavior_diverges_from_source": false,
"speculative_mechanism": null,
"mechanism_has_behavioral_need": false,
"use_cases": [{"question": "Is site 7 done for March?", "needs_reconstruction": false}]
}
| Exit | Meaning |
|---|---|
0 | Adopt: no axis needs revision |
1 | Revise: the report names each axis |
2 | Bad input: unreadable file, invalid JSON, or invalid proposal |
Source-shaped, then behavior-shaped. An ingestion payload arrives as
raw_fetch_events. The source-shaped design stores those rows and answers
"what have we fetched?" by de-duplicating them on every read. The business must
know fetch progress, and row presence cannot tell a partial fetch from a
complete one, so the behavior-shaped design records fetch_progress per
source and window as explicit state. The payload stays an integration contract
that feeds an ingest step. The question becomes one indexed read.
CRUD stays correct. A tag has a unique name and nothing else. Create,
read, rename, delete is the whole behavior. Adopt CRUD. Wrapping it in
RegisterTag and RetireTag adds ceremony with no invariant.
Temporal. "Which plan was the customer on when we billed them?" depends on a
prior time. Overwriting current_plan loses the answer. Keep effective-dated
plan rows.
Speculative mechanism. A proposal adds event sourcing for a screen that reads the latest value. No current question needs replay. Reject it under the quality principles; add it when a question requires it.
| Anti-pattern | Instead |
|---|---|
| Mirror the source payload as the internal model | Derive the model from behavior; keep the payload as an integration contract |
| Rebuild a first-class fact from fact or output rows | Record explicit state the business can read directly |
| CRUD over a behavior with invariants or multi-step mechanics | One domain operation that enforces the invariant |
| A domain verb for a behavior with no invariant | CRUD |
| Overwrite state when the question depends on time | Keep history or effective-time rows |
| Event sourcing or aggregates with no current behavioral need | Reject until a question requires them |
Add an axis by writing one check_* function in evaluate_design.py, the
proposal field it reads, and a positive, negative, and mutation test. Append the
function to the CHECKS tuple, or evaluate never calls it. Add the field to
_BOOL_KEYS or _STRING_KEYS, or a missing or mistyped field is not validated
and does not exit 2. Keep this
page the decision procedure; move long worked examples into a reference file.
cva-analysis: abstraction discovery, once behavior and invariants justify an abstraction.software-engineering-library: book-depth reference on domain-driven design, data-intensive applications, and enterprise patterns.review: its architect axis calls this skill when a diff changes an API, schema, or module boundary.evaluate_design.py exit code and report are quoted for the final design.What SKILL.md sets; muted values are Claude Code's defaults
npx claudepluginhub rjmurillo/ai-agents --plugin project-toolkit2 plugins in one repository ship this exact skill · first indexed Nov 13, 2026
105 skills in this plugin
/adr-generatorCreate comprehensive Architectural Decision Records (ADRs). Researches the destination directory to detect existing template conventions, gathers context, determines next ADR number, generates the ADR, validates completeness, and saves. Supports multiple ADR formats (MADR, Nygard, Alexandrian, project canonical). Use when documenting technical decisions, creating new ADR files, or capturing rationale so future readers can revisit a choice. Use when you say "write an ADR", "document this decision", "document these design choices", "record why we chose this", "capture the rationale", or "for future maintainers", or when creating an ADR-like markdown file under docs/decisions/, docs/adr/, docs/architecture/, architecture/decisions/, or .project-toolkit/architecture/. Do NOT use to debate or review an existing ADR (use adr-review)./adr-reviewMulti-agent debate orchestration for Architecture Decision Records. Automatically triggers on ADR create/edit/delete. Coordinates architect, critic, independent-thinker, security, analyst, and high-level-advisor agents in structured debate rounds until consensus. Use when you say "review this ADR", when an ADR is created/edited/deleted, or when reviewing, accepting, or updating a decision file under .project-toolkit/architecture/, docs/architecture/, docs/decisions/, docs/adr/, or architecture/decisions/, including intent like "review this decision record" or "check this rationale for future maintainers". Do NOT use to author a new ADR (use adr-generator)./agent-harness-referenceField reference for Claude Code and GitHub Copilot CLI hook contracts. Covers hook locations, events, matchers, payloads, decisions, exit codes, timeouts, plugin roots, and cloud limits with official URLs and versioned probes. Use for `harness contract`, `copilot cli hook behavior`, `hook payload format`, `stale plugin root`, `Errno 2 _dispatch.py`, or before changing cross-harness hooks. Do NOT use to run the porting campaign (in the ai-agents repository, use `ai-agents-portability-campaign`)./ai-agents-external-claimsVerify external, vendor, and third-party claims (numbers, attributions, structure) against authoritative primary sources before they land in a repo artifact or external deliverable. Covers stake-holding sources, round-number tells, citation-chain drift, and the walk-the-gate-or-file-conservative discipline. Use when you say `verify an external claim`, `check a vendor number`, `is this stat real`, `validate a third-party citation`. Do NOT use for running an experiment (use `ai-agents-research-methodology` in the ai-agents repository) or command-injection scanning (use `security-scan`)./analysis-provenanceIdentify code ownership before modifying validators or linters. Checks file headers for provenance indicators, reviews documentation, and determines provenance as UPSTREAM, LOCAL, VENDOR, or UNKNOWN. Prevents accidental modification of upstream tools./analyzeSystematic multi-step codebase analysis producing prioritized findings with file-line evidence. Covers architecture reviews, security assessments, and code quality evaluations through guided exploration, investigation planning, and synthesis. Use when you say "analyze this codebase", "run security assessment", "architecture review of this system", "find code smells", or "review code quality" across multiple files. Do NOT use for single-file maintainability scoring (use code-qualities-assessment) or CWE-78 injection pattern scanning (use security-scan).Other plugins' skills for the same job