aiagent: Command for Claude Code

.claude/commands/check-layers.md

check-layers is a command for Claude Code from drujensen/aiagent. It costs 19 tokens per session (264 once invoked), scanned A, original, MIT.

A command that checks whether the project's Domain-Driven Design layer boundaries and related Go conventions are intact. It looks for forbidden imports, misplaced interfaces, invalid constructors, missing data tags, and unwrapped errors.

In plain words
What is it for?
Use it to verify that the domain package does not depend on implementation code and to report specific violations with suggested fixes.
Why use it?
It provides a quick way to find architectural and code-quality violations before they spread through the project.

Command for Claude Code

Written for Claude Code: installed under .claude/.

This is drujensen/aiagent's own configuration. It tells Claude Code how to work on aiagent itself, so it is not a mod to install elsewhere. Copy it as a starting point and replace the rules that are about this project. Everything aiagent configures →

Reuse

Borrowing it

Nothing to install: this file belongs to drujensen/aiagent. Take a copy, put it at the same path in your own repository, and replace the rules that are about this project with yours.

Copy the file
curl -O https://raw.githubusercontent.com/drujensen/aiagent/main/.claude/commands/check-layers.md
Clone the repo
git clone --depth 1 https://github.com/drujensen/aiagent

Made for: Claude Code.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for check-layers

README.md
[![agentmods](https://agentmods.dev/badge/commands/drujensen/aiagent/check-layers/github.svg)](https://agentmods.dev/commands/drujensen/aiagent/check-layers)
Your own site
<a href="https://agentmods.dev/commands/drujensen/aiagent/check-layers"><img src="https://agentmods.dev/badge/commands/drujensen/aiagent/check-layers/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for check-layers

Your own site · 80×15
<a href="https://agentmods.dev/commands/drujensen/aiagent/check-layers"><img src="https://agentmods.dev/badge/commands/drujensen/aiagent/check-layers.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 19 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 264 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00019 $0.00264
Opus 5.5 $0.00008 $0.00106
Sonnet 5.5 $0.00004 $0.00053
Haiku 4.5 $0.00002 $0.00026

Measured 4d ago against content hash d7a75bcce6dc, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

check-layers scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 4d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

.claude/commands/check-layers.md · 32 lines

What it actually says

Check that the DDD dependency rules are not violated in the aiagent project.

Rule

internal/domain/ must NEVER import from internal/impl/. internal/impl/ may import from internal/domain/. internal/tui/ and internal/ui/ may import from both.

Check Commands

Run these to find violations:

# Find any domain file that imports from impl
grep -r "drujensen/aiagent/internal/impl" internal/domain/ --include="*.go" -l

# Show full import context for any violations
grep -r "drujensen/aiagent/internal/impl" internal/domain/ --include="*.go" -n

Also verify:

  1. All domain interfaces are defined in internal/domain/interfaces/ (not in impl)
  2. All entity constructors follow NewXxx naming
  3. All entities have both json and bson struct tags
  4. No naked errors (errors without wrapping context)

Report any violations found and suggest the correct fix (e.g., move the dependency to an interface, inject it via constructor).

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 4d ago First seen · 32 lines · 19 tokens per session scan A d7a75bcce6dc

Subscribe to this mod's changes

check-layers is a command published in the GitHub repository drujensen/aiagent (5 stars, last pushed 2mo ago), licensed MIT. It adds 19 tokens to every session and 264 once invoked, about $0.0001 per session on Opus 5.5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-10-03.