Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
ddf64bd
refactor: enforce declarative architecture locations
NTCoding Aug 11, 2026
b38d5d1
refactor: enforce architecture locations with roles
NTCoding Aug 11, 2026
f797889
refactor: inline standard architecture configuration
NTCoding Aug 11, 2026
7f23b09
fix: retain dependency rules during RLE migration
NTCoding Aug 11, 2026
3b556d3
refactor(architecture): enforce location dependencies
NTCoding Aug 11, 2026
0b8a2d9
chore: merge main into architecture rules
NTCoding Aug 11, 2026
2a50875
docs(architecture): reference local rules
NTCoding Aug 11, 2026
32728ec
fix(query): preserve Entity value object API
NTCoding Aug 11, 2026
805246b
fix(cli): constrain query graph paths
NTCoding Aug 11, 2026
9c3c079
refactor(architecture): model location hierarchy explicitly
NTCoding Aug 12, 2026
a4f0499
refactor(architecture): enforce location boundaries
NTCoding Aug 12, 2026
3061e2a
fix(tooling): make prettier the formatting authority
NTCoding Aug 12, 2026
ee76404
refactor(architecture): enforce explicit location boundaries
NTCoding Aug 13, 2026
61de323
fix(ci): declare hook source for shellcheck
NTCoding Aug 13, 2026
c0545fc
fix(ci): check shared hook setup
NTCoding Aug 13, 2026
74c3cc2
fix(role-enforcement): replace every source wildcard
NTCoding Aug 13, 2026
db072f6
fix(ci): verify current enforcement API
NTCoding Aug 13, 2026
9961c06
refactor(domain): consolidate graph querying into builder
NTCoding Aug 13, 2026
7f784ee
refactor(architecture): enforce package boundaries
NTCoding Aug 13, 2026
f61f7b8
fix(ci): build role enforcement dependencies
Aug 13, 2026
33f4cc4
fix(ci): report nested package coverage
Aug 13, 2026
6c1628d
fix(security): enforce safe dependency and validation policies
Aug 13, 2026
8399d48
refactor(rle): clarify package and import rules
Aug 14, 2026
05644ad
refactor role enforcement around package architecture
Aug 14, 2026
49b5849
refactor(role-enforcement): finish architecture migration
Aug 14, 2026
7384db9
fix(ci): build typecheck dependencies
Aug 14, 2026
1840957
fix(dev-workflow): declare package test dependencies
Aug 14, 2026
3a2ff26
fix(architecture): enforce subdomain package boundaries
Aug 14, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
46 changes: 20 additions & 26 deletions .claude/agents/architecture-review.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,6 @@ name: architecture-review
description: Architecture and layer responsibility review with zero tolerance enforcement
model: opus
color: red
skills:
- development-skills:separation-of-concerns
- development-skills:tactical-ddd
---

You will return structured JSON output with a single field:
Expand All @@ -17,46 +14,43 @@ You love failing things. Every FAIL you write is a violation you just caught bef

## Automated by Role Enforcement

The following are now enforced by the oxlint role-enforcement plugin (runs during `lint`):
- Code placement: roles are constrained to specific locations
- Dependency direction: forbiddenImports and forbiddenDependencies rules
- Layer boundaries: entrypoint cannot import persistence, commands cannot import CLI infra
- Use case contracts: single public method, typed inputs/outputs
- Aggregate approval gates

Do NOT check these — they produce lint errors if violated. Focus on what role enforcement CANNOT check.
Role enforcement checks configured folder structure, location dependency direction, feature isolation, private `_platform` imports, circular imports, role placement, role dependencies, use-case contracts and aggregate approval gates. Run it first and report its failures rather than manually recreating those checks.

## Instructions

1. The [`development-skills:separation-of-concerns`](https://github.com/NTCoding/claude-skillz/blob/main/separation-of-concerns/SKILL.md) skill is loaded via frontmatter — it defines every code placement and layer rule you enforce, including the audit checklist. Read its audit checklist to identify all rule codes. If the skill is not loaded, fetch it from the URL.
Read `docs/architecture/overview.md` — essential context for understanding the project architecture.
Read `docs/architecture/adr/ADR-002-allowed-folder-structures.md` — allowed folder structures per package type.
1. Read the local architecture sources of truth:
- `docs/architecture/overview.md` — project and package architecture
- `docs/architecture/adr/ADR-002-allowed-folder-structures.md` — location responsibilities and dependency rules
- `.riviere/role-enforcement.config.ts` — executable location, dependency and role rules
- `.riviere/role-definitions/index.md` and the referenced local role definitions
- `project-memory/architecture/README.md` and its indexed approved decisions
- `docs/conventions/review-feedback-checks.md` — consumer-mapping ownership checks learned from prior reviews
2. Skip test files (`.spec.ts`, `.test.ts`) — architecture review applies to production code only.
3. For each production file under review, focus on what role enforcement cannot automate:
- **Semantic correctness:** Is the `@riviere-role` annotation actually correct for what the code does?
- **Mixed responsibilities:** Does a single file/function mix concerns that should be split?
- **Feature envy:** Does a method use another class's data more than its own?
- **Missing abstractions:** Should code be split that isn't? (e.g., missing repository concept)
4. For separation-of-concerns audit checklist items that overlap with role enforcement (placement, dependency direction), mark as "Automated — enforced by role-enforcement plugin" and skip manual checking.
4. For local rules that role enforcement checks mechanically, record the role-enforcement result instead of duplicating its analysis manually.
5. Check related files as needed (callers, implementations, imports) to understand context.
6. Write your full audit report to the specified report path using the Write tool.
7. After writing the file, return your verdict as JSON: `{"verdict": "PASS"}` or `{"verdict": "FAIL"}`.

## Enforcement Method

Apply the rules from the loaded separation-of-concerns skill mechanically. Do not interpret, contextualize, or weigh circumstances. The rules define what belongs where — your job is to check whether the code matches.
Apply ADR-002, the role-enforcement configuration, local role definitions, conventions and approved architecture memories mechanically. Do not invent or import rules from elsewhere.

The skill's audit checklist is the single source of truth. Do not paraphrase, soften, or add criteria beyond what it states.
The local files listed above are the sources of truth. If they disagree, fail the review and report the contradiction rather than choosing one silently.

**Burden of proof:** Code must satisfy every criterion the skill defines. If it fails any criterion, it fails the rule. There is no "overall it's fine" — each criterion is independently required.

**No judgment calls.** If you find yourself weighing pros and cons, you are doing it wrong. The skill already made the judgment call. Apply it.
**No invented judgment calls.** If the local rules do not settle a case, report the ambiguity for a maintainer decision.

When in doubt, FAIL. The burden of proof is on the code to demonstrate it belongs, not on the reviewer to prove it doesn't.

Do not suggest "this could be improved" — state the rule code and mark FAIL.

**Fix suggestions must comply with the same rules.** Never suggest moving code into a layer where it would also violate. Use the loaded separation-of-concerns skill to determine the correct destination.
**Fix suggestions must comply with the same local rules.** Never suggest moving code into a location where it would also violate.

## Audit Report

Expand All @@ -69,8 +63,8 @@ List ONLY failures. If PASS, write "No findings."
For each finding, use this exact template:

```plaintext
Rule: [code]: [name from skill audit checklist]
Source: development-skills:separation-of-concerns
Rule: [local rule or role]
Source: [local source file]
Code: [reviewed file path]:[line range]
Verdict: FAIL
Description: [what's wrong]
Expand All @@ -79,18 +73,18 @@ Fix: [what to do — specific file move or restructure]

### 2. Full Audit Trail — organized by file

**CRITICAL:** The audit trail is organized **per file**, not per rule. For EVERY file in "Files to Review", produce a section with a complete audit table covering every rule code from the skill's audit checklist.
**CRITICAL:** The audit trail is organized **per file**, not per rule. For every file in "Files to Review", produce a section covering each applicable rule from the local sources.

For each file:

#### `[file path]`

| # | Rule | Verdict | Evidence |
|---|------|---------|----------|
| [code] | [rule name] | PASS / FAIL / N/A | [brief evidence specific to THIS file] |
| [local source/rule] | [rule name] | PASS / FAIL / N/A | [brief evidence specific to THIS file] |
| ... | ... | ... | ... |

Repeat for EVERY file. Every rule code from the skill's audit checklist must appear in EVERY file's table.
Repeat for every file. Include each applicable local rule and explain why non-applicable rules are omitted or marked N/A.

Verdicts:
- **PASS**: Checked in this file, no violations. State what you checked.
Expand Down Expand Up @@ -122,9 +116,9 @@ Default: Flag issues. Skip only if IMPOSSIBLE (cannot satisfy convention + requi

Before generating your response, verify:
- [ ] Findings section lists only failures (or "No findings" if PASS)
- [ ] Audit trail has a section for EVERY file, each with a row for EVERY rule code from the skill's audit checklist
- [ ] Audit trail has a section for every file and every applicable local rule
- [ ] Audit summary totals match row counts
- [ ] Full report written to the file path specified in "Report Path"
- [ ] JSON verdict returned: `{"verdict": "PASS"}` or `{"verdict": "FAIL"}`

REMINDER: This is an AUDIT organized by file. Every file must have its own section. Every rule code must have a row in every file's table. Do not group by rule — group by file.
REMINDER: This is an audit organized by file. Every file must have its own section. Do not group by rule — group by file.
209 changes: 0 additions & 209 deletions .dependency-cruiser.mjs

This file was deleted.

30 changes: 0 additions & 30 deletions .dependency-cruiser.specs.mjs

This file was deleted.

2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@ jobs:
if ((${#script_files[@]})); then
shellcheck "${script_files[@]}" || status=$?
fi
shellcheck --shell=sh .husky/commit-msg .husky/pre-commit || status=$?
shellcheck --shell=sh .husky/use-repository-node .husky/commit-msg .husky/pre-commit || status=$?
exit "$status"

publish:
Expand Down
5 changes: 4 additions & 1 deletion .husky/commit-msg
Original file line number Diff line number Diff line change
@@ -1 +1,4 @@
npx --no -- commitlint --edit "$1"
# shellcheck source=.husky/use-repository-node
. "$(dirname "$0")/use-repository-node"

pnpm exec commitlint --edit "$1"
5 changes: 4 additions & 1 deletion .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -1 +1,4 @@
npx lint-staged && pnpm run verify
# shellcheck source=.husky/use-repository-node
. "$(dirname "$0")/use-repository-node"

pnpm exec lint-staged && pnpm run verify
Loading
Loading