.agents/skills/arch-review/SKILL.md
Review code changes (PRs, diffs, branches) against the opinionated TypeScript architecture rules. Checks whether changes align with the architecture — layer dependencies, module boundaries, event patterns, domain purity, and structural conventions. Triggers on phrases like "review this PR", "arch review", "check if this change follows the architecture", "review these changes", "does this PR align with the architecture", or "architecture review". Also invocable via the /tseng:arch-review slash command.
npx skillsauth add kagenti/humr arch-reviewInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
echo "Architecture docs: ${CLAUDE_SKILL_DIR}/architecture/"
echo "Version: $(cat "${CLAUDE_SKILL_DIR}/VERSION")"
Reviews specific code changes (PRs, diffs, branches) against the architecture rules. Unlike the full-project review skill, this skill focuses on what changed and whether those changes comply with the architecture. No review records are created — this is a lightweight, focused review.
Read only the overview to start — load specific docs lazily based on what the changes touch:
architecture/index.md from the architecture docs directory (shown above). This gives you the map of all topics without the full weight.Do NOT read all architecture files upfront. Instead, load them on-demand in Phase 4 after you know which areas the changes affect:
| When the changes touch... | Then read... |
|-------------------------------------------------|-------------------------------|
| Technology/dependency choices | stack.md |
| Layer code (routers, services, domain) | slice-composition.md |
| Module creation or modification | modules.md |
| Cross-module imports or communication | module-boundaries.md |
| Infrastructure (repos, adapters, DI) | infrastructure.md |
| File/directory structure, package layout | project-structure.md |
Read the project's TSEng context to understand where it stands:
tseng/index.md exists. If it does, read it and follow every link:
tseng/project-structure.md — package layout, names, paths, server runtimetseng/adoption.md — applied, discarded, and remaining changestseng/reviews/index.md — review historysrc/modules/ directories and contract package src/modules/ directories.tseng/vocabulary.md exists. If it does, read it — this is the project's ubiquitous language.If the project has no tseng/ directory at all, warn the user that project context is missing and suggest running /tseng:adopt first. Do not refuse to proceed — the user may have a good reason — but warn that the review will lack project-specific context (e.g., discarded rules won't be respected).
Ask the user how they want to provide the changes to review:
What would you like me to review?
- PR — give me the PR number or URL
- Branch — compare current branch against base (e.g., main)
- Local changes — staged/unstaged changes in the working tree
- Specific commit(s) — give me the commit SHA(s)
For option 1: Use gh pr diff <number> to get the diff and gh pr view <number> --json title,body for context.
For option 2: Use git diff main...HEAD (or whatever base the user specifies).
For option 3: Use git diff for unstaged and git diff --cached for staged changes.
For option 4: Use git show <sha> for each commit.
Read the full diff. Then read the complete contents of every changed file (not just the diff hunks) — architecture violations often depend on the full file context (e.g., the import block at the top, the module structure around the change).
Before launching the subagent, analyze the changes to determine which architecture topics are relevant:
Based on this analysis, load the specific architecture docs from the table in Phase 1. Read their full contents — the subagent will need the actual rules, not just file names.
If the changes are broad (touching multiple layers, modules, and structural concerns), load all architecture docs. For narrow changes (e.g., a single domain entity), load only the relevant subset.
Launch a subagent (using the Agent tool) to perform the actual review. The subagent receives the architecture docs as the review standard and the changes as the subject.
Use this subagent prompt template:
You are reviewing code changes in a TypeScript project at {project_path} against architecture rules.
ARCHITECTURE RULES (this is the standard — review the changes against everything stated here):
{full_architecture_doc_contents}
ADOPTION STATE (these rules were discarded by the project — do NOT flag violations for them):
{discarded_rules_or_"None — all rules apply"}
UBIQUITOUS LANGUAGE (check that changes use these established domain terms consistently):
{vocabulary_contents_or_"No vocabulary established yet"}
CHANGES TO REVIEW (diff):
{diff}
FULL FILE CONTENTS (for context — imports, structure, surrounding code):
{changed_file_contents}
Go through every rule in the architecture docs above. For each rule that is relevant to the changes:
- Check if the changes comply
- Mark it ✅ (compliant) or ❌ (violation) or ⚠️ (potential concern)
- Cite the specific file and line
- If it violates, explain what's wrong and how to fix it
Only review rules that are relevant to the changes. Skip rules about areas the changes don't touch.
Do NOT add suggestions, improvements, or opinions beyond what the architecture docs state. Only verify against the documented rules.
Do NOT include the skill instructions, phase descriptions, or any other meta-context in the subagent prompt. The subagent gets only the architecture rules, the changes, and the review instructions.
Take the subagent's output and present the final report to the user:
tseng/adoption.md shows certain rules were discarded, do not flag violations for those rules./tseng:adopt or /tseng:bootstrap would be more appropriate./tseng:review for that.development
Create a PRD through user interview, codebase exploration, and module design, then submit as a GitHub issue after user approval. Use when user wants to write a PRD, create a product requirements document, or plan a new feature. Always present the PRD for user approval before submitting.
testing
Upgrade a previously bootstrapped or adopted project when the architecture evolves. Diffs the current architecture rules against the project's last locked review, identifies new or changed rules, and proposes incremental changes. Triggers on phrases like "upgrade my project", "sync with latest architecture", "update to new rules", "upgrade tseng", or "architecture changed, update my project". Also invocable via the /tseng:upgrade slash command.
development
Spec out a feature or change with full knowledge of the opinionated TypeScript architecture and the project's adoption state. Conducts a thorough discovery interview to understand domain concerns, bounded contexts, and application services, then produces a high-level architectural specification — never concrete implementation details. Triggers on phrases like "spec this feature", "design this change", "architect this", "help me spec", "what modules do I need", or "think through this feature". Also invocable via the /tseng:spec slash command.
development
Review an existing TypeScript project against the opinionated architecture rules. Use when the user asks to review, audit, check, or validate their project's architecture. Triggers on phrases like "review my project", "check the architecture", "audit my code structure", "validate my project", or "does my project follow the rules". Also invocable via the /tseng:review slash command.