t3d-init
Copy the harness templates into the current project root (the directory where Claude Code was launched).
Plan
- Resolve the project root from
${CLAUDE_PROJECT_DIR}. Print it. - For each template file under
${CLAUDE_PLUGIN_ROOT}/templates/:- Compute destination path under
${CLAUDE_PROJECT_DIR}/. - If destination exists, ask the user before overwriting (do NOT silently clobber
CLAUDE.md). - Otherwise,
cpit across, preserving directory structure.
- Compute destination path under
- After copying, print a "next steps" message:
- Open
CLAUDE.mdand fill the<!-- FILL IN -->project-identity section. - Open
CONTEXT-MAP.mdand list your bounded contexts. - Run
/t3d-new-context <your-first-context>to scaffold the first context.
- Open
Required tool calls
You must use the Bash tool to run cp -r. Do not use the Write tool for
copying — it would re-author files and lose timestamps/perms.
Templates to copy
The plugin ships this layout under ${CLAUDE_PLUGIN_ROOT}/templates/:
templates/
├── CLAUDE.md # generic harness rules (with FILL IN placeholders)
├── CONTEXT-MAP.md # empty bounded-context inventory
├── contexts/
│ ├── _TEMPLATE/ # 4-layer skeleton — copy-paste source for new contexts
│ └── _shared_kernel/ # example pure value objects (Money, Timestamp, ModelName, TokenCount)
└── docs/
└── adr/
├── README.md # Matt Pocock 3-condition ADR rule
└── NNNN-template.md # ADR template
Conflict handling
If ${CLAUDE_PROJECT_DIR}/CLAUDE.md already exists, ask the user one of:
keep— leave existing, don't copy CLAUDE.md (default)overwrite— replace with plugin versionview-diff— show diff first
Do not overwrite contexts/_shared_kernel/ if it exists either — that
directory often has project-specific value objects.
Done criteria
After running, the user should be able to:
- Edit a file at
contexts/anything/domain/x.pycontainingimport fastapiand see the PreToolUse hook DENY it. - Run
/t3d-new-context billingand seecontexts/billing/appear with the full 4-layer skeleton.