From dev-on-leash
Use to declare a project's architecture and turn it into enforced guard-rails. Interviews the user in prose, extracts a structured .harness/architecture.yaml via subagent, compiles it into mechanical gates (import-linter for Python, dependency-cruiser for JS/TS, grep fallback elsewhere) and a project-local architecture-reviewer agent. Re-runnable (add / revise / re-describe).
How this skill is triggered — by the user, by Claude, or both
Slash command
/dev-on-leash:compose-architecture-leashThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
This skill runs **inside a target project** (not inside the dev-on-leash
This skill runs inside a target project (not inside the dev-on-leash
plugin repo). The user invokes it after bootstrap-dev-leash has been run.
It declares an architecture and turns it into enforced guard-rails.
The user wants to add or change architectural enforcement on top of the existing harness — phrasings like "put the architecture on leash", "set up clean architecture rules", "add architecture guard-rails", "the architecture changed, refresh the leash".
Refuse to run if CLAUDE.md or AGENTS.md is missing from the target —
that means bootstrap-dev-leash was not run. Tell the user to run
bootstrap first.
If .harness/architecture.yaml already exists, switch to re-run mode
(see the re-run section).
Read .claude/settings.json's allowlist and .harness/gates to infer the
project's stack:
pyproject.toml or setup.py present → Python adapter will fire.package.json present → JS/TS adapter will fire.No user question. Bootstrap already captured the stack.
Ask the user a single open question:
"Describe your project's architecture and the rules you want enforced. Layers, who depends on what, what's banned where, what shape use-cases/entities/etc. should take. Plain English is fine — be as long or as short as you want."
Do NOT offer multiple-choice presets. The declaration model is free-form prose by design (see spec).
Dispatch the plugin subagent dev-on-leash:architecture-extractor with:
architecture.yaml schema (version, style,
layers, allowed_dependencies, patterns, review_rules),Glob).The subagent returns a proposed YAML body plus a "Rationale" section.
Show the user the proposed YAML + rationale. Offer three responses:
Once accepted:
.harness/architecture.yaml.python scripts/harness/compile_architecture.py in the target.
This emits .harness/checks/pattern-*.py, .harness/importlinter.ini
(if Python), .harness/dependency-cruiser.json (if JS/TS), and appends
# arch-leash:<id>-tagged gate lines to .harness/gates.OPTIONAL:ARCHITECTURE block in AGENTS.md
between its markers with a human-readable summary derived from the
YAML: {{ARCHITECTURE_STYLE}}, a Markdown table of layers, a bullet
list of allowed edges, a bullet list of the new gates, and a pointer to
architecture.yaml as the source of truth. Keep the
<!-- OPTIONAL:ARCHITECTURE --> markers in place — the compiler
identifies its territory by them.agents/architecture-reviewer.md
from templates/architecture-reviewer.md.tmpl, substituting
{{ARCHITECTURE_STYLE}}, {{ARCHITECTURE_LAYER_TABLE}},
{{ARCHITECTURE_EDGE_LIST}}, {{ARCHITECTURE_REVIEW_RULES}}.Summarize, in three or four lines:
architecture.yaml: python scripts/harness/compile_architecture.py.When .harness/architecture.yaml already exists, ask the user one
multiple-choice question:
dev-on-leash:architecture-extractor with the message header
MODE: ADD so the extractor returns ONLY the new entries as a YAML
fragment. The extractor must not restate or rewrite any existing entry.layers, allowed_dependencies, patterns, review_rules).
Any top-level key that has no new entries is OMITTED entirely from the
fragment — empty lists are NOT permitted. The fragment must NOT include
version or style; those carry over from the existing file.architecture.yaml — the
subagent never touches the existing file. The merge appends new entries
under each present top-level key. If the merged file references an
allowed_dependencies edge whose from or to layer was not added in
the same fragment AND does not already exist in the file, the skill
rejects the fragment and asks the user to either (a) add the missing
layer in this same fragment or (b) declare it in a separate add run
first.python scripts/harness/validate_architecture.py (or by importing
parse_architecture from the validator) before writing.python scripts/harness/compile_architecture.py)
and re-render the OPTIONAL:ARCHITECTURE block in AGENTS.md as in
first-run Step 5.architecture.yaml as a numbered list of rules, each
labeled with its stable id (layer name for layers; id field for
everything else)..harness/architecture.yaml.bak-<UTC ISO timestamp> (one backup only;
overwrites any prior .bak- for this run — git is the real history).
Then write the new YAML, recompile, re-render.architecture.yaml actually changed.# arch-leash:<id>. Orphaned lines
(from removed rules) are pruned on the next compile.agents/architecture-reviewer.md is FULLY regenerated each compile.OPTIONAL:ARCHITECTURE block in AGENTS.md is FULLY regenerated
between its markers.npx claudepluginhub diogeneshfg/dev-on-leash --plugin dev-on-leashGuides creation, editing, and verification of skills for AI coding agents using test-driven development with subagent scenarios. Use when authoring or debugging skills.