AGENT SKILL

domain-architecture

Reviews PR diffs for domain model integrity, architecture dependency rules, and team/org boundary risks. Use when analyze risk_class includes domain, or when a PR crosses bounded contexts, ownership, or layering boundaries.

License 许可
MIT
最近更新
2026-11-14
Stars
★ 1
Forks
0

01 前言 Front Matter

name
domain-architecture
description
Reviews PR diffs for domain model integrity, architecture dependency rules, and team/org boundary risks. Use when analyze risk_class includes domain, or when a PR crosses bounded contexts, ownership, or layering boundaries.
allowed-tools
Bash Read Grep Glob

02 资源文件 2

03 SKILL.md 正文

Domain & Architecture Review

Quality Review pass covering taxonomy categories 1 Domain, 2 Architecture, and 15 Team/org boundaries. Emits Conventional Comment findings in the same schema as the bug-finder.

Inputs

  • PR URL: Full GitHub/Enterprise PR URL
  • OUTPUT_DIR (optional): Defaults to private mktemp -d
  • Analysis JSON (optional): $OUTPUT_DIR/pr-analysis-<PR_NUMBER>.json from analyze

Outputs

Writes $OUTPUT_DIR/domain-architecture-<PR_NUMBER>.json:

{
  "pr_number": 123,
  "pass": "domain-architecture",
  "findings": [
    {
      "severity": "critical|high|medium",
      "label": "issue|suggestion|nitpick|question|thought|praise",
      "decoration": "blocking|non-blocking|if-minor",
      "path": "exact/path",
      "line": 42,
      "title": "5-10 words",
      "body": "explanation",
      "suggestion": "concrete fix",
      "suggested_change": "exact replacement for lines start_line..line, or omit"
    }
  ]
}

suggested_change posts as a committable GitHub suggestion. Emit it only when the fix is confined to the commented lines, you can reproduce the range verbatim from the diff, and it runs under ~10 lines; otherwise leave the prose suggestion alone. Most findings in this pass are design-level and will not qualify.

path/line required when the issue maps to a diff location (line = NEW-file line). Omit both for architectural findings. Omit label/decoration to accept severity defaults (see shared/severity-rubric.md).

Step 0: Parse arguments

PR_URL="$1"
OUTPUT_DIR="${2:-$(mktemp -d -t pr-review-XXXXXX)}"
mkdir -p "$OUTPUT_DIR"
PR_NUMBER=$(echo "$PR_URL" | grep -oE 'pull/[0-9]+' | grep -oE '[0-9]+')

Step 1: Load context (progressive disclosure)

  1. Read references/anti-patterns.md.
  2. Read this skill's references/checklist.md for dimensions.
  3. Optionally skim shared/severity-rubric.md for Clean Code blocking rules.
  4. If present, read $OUTPUT_DIR/pr-analysis-${PR_NUMBER}.json for impact hints.

Step 2: Load the PR diff

/review:review captures the PR once into $OUTPUT_DIR and every pass shares it. Read $OUTPUT_DIR/pr.diff and $OUTPUT_DIR/pr-view.json; never write to either — the other passes are reading them. Fetch only when run standalone:

if [ ! -s "$OUTPUT_DIR/pr.diff" ]; then
  gh pr diff "$PR_URL" > "$OUTPUT_DIR/pr.diff"
  gh pr view "$PR_URL" --json title,body,files,additions,deletions,commits \
    > "$OUTPUT_DIR/pr-view.json"
fi

Step 3: Review

Walk checklist dimensions in order: domain → architecture → team boundaries. Clean Code findings are blocking regardless of module reach — blast radius sets severity, not whether to block. Name the resolving refactoring in suggestion.

Prioritize:

  1. Bounded context / ubiquitous language conflicts on public surfaces
  2. Aggregate invariants and layering violations
  3. Dependency direction / circular coupling / undeclared blast radius
  4. Ownership and cross-team contract breaks

Step 4: Emit JSON

Build with jq -n and --arg/--argjson so diff text is escaped. Write findings array; empty array is valid.

jq -n \
  --argjson pr_number "$PR_NUMBER" \
  --arg pass "domain-architecture" \
  --argjson findings "$FINDINGS_JSON" \
  '{pr_number: $pr_number, pass: $pass, findings: $findings}' \
  > "$OUTPUT_DIR/domain-architecture-${PR_NUMBER}.json"

Notes

  • Standalone: /review:domain-architecture <PR_URL> [OUTPUT_DIR]
  • Orchestrator gates this pass when domain ∈ risk_class (see shared/risk-class-routing.md)
  • Do not rubber-stamp large boundary-crossing PRs; prefer question when ownership is unclear

04 同仓库更多 Skills

ozzycodes2
ozzycodes2/claudellum

writing-design-docs

Use when the user wants to write a problem-statement design doc, says "let's plan a feature properly" / "write a design doc" / "I'm thinking about how to do X" for a non-trivial X, or before committing to a non-obvious technical direction

★ 1
ozzycodes2
ozzycodes2/claudellum

write-doc

Use when the user asks to write or draft a README, ADR, runbook, tutorial, how-to, explanation, or reference doc, or a caller passes "type ADR" or "type README". Picks the type, fills a template, adds diagrams. RFCs and design docs belong to writing-design-docs.

★ 1
ozzycodes2
ozzycodes2/claudellum

review-doc

Use when the user asks to review, critique, score, grade, or "how good is this doc" for a Markdown doc or pasted text. Read-only. Scores it on the 20 Practical Prose dimensions and emits a findings table. Does not edit; fix-doc applies the findings next.

★ 1
ozzycodes2
ozzycodes2/claudellum

fix-doc

Use when the user asks to fix, edit for prose quality, polish, tighten, humanize, or de-slop a Markdown doc or pasted text, or says "make this read less AI". Applies review-doc findings, generates flagged diagrams, lists substantive issues for the author, then runs the AI-tell pass last. Modifies the target.

★ 1
ozzycodes2
ozzycodes2/claudellum

create-slides

Use when the user asks for a slide deck, presentation, talk, or slides from a document, report, PR, notes, or topic. Builds one self-contained Machinify-branded HTML deck in a minimalist style, with headline-plus-visual slides, speaker notes, and every diagram drawn by architecture-design:create-diagram.

★ 1
ozzycodes2
ozzycodes2/claudellum

start-session

Open a Claude Code working session in a fresh, isolated git worktree, so the user can start a task with a single /start-session <name>. Use at the START of a session when the user says "start session", "start a worktree", "spin up a worktree for ABC-123", "begin work on <ticket>", or passes a name/ticket to work under. Creates and ENTERS a worktree via the EnterWorktree tool (never `git worktree add`) under .claude/worktrees/, named exactly after the argument, on a local branch `worktree-<argument>`. Reports what the worktree inherited (`.worktreeinclude` copies, symlinked node_modules) and whether its `.env` still points at the main checkout's stack. If the argument is a JIRA key (e.g. ABC-123, PROJ-1505), also loads that story with the Atlassian CLI (`acli`) when available and summarizes the implementation ask. Also renames the session to the argument (the same effect as `/rename <NAME>`) so it's easy to find in `/resume`. Then stops and waits — it sets up the workspace and context, it does not implement.

★ 1