Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
180 commits
Select commit Hold shift + click to select a range
41dcec2
feat: update layout metadata with new title and description for impro…
arentant Dec 23, 2025
122bcb2
- Update wallet connection hooks
arentant Feb 3, 2026
d9f682c
add cursor skills
arentant Feb 3, 2026
e08951c
Merge branch 'main' into main-v2
arentant Feb 3, 2026
83e5622
Implement initial passkey/wallet login
arentant Feb 4, 2026
2d4acda
Refactor layout and integrate UserStatus component
arentant Feb 4, 2026
b353945
Enhance passkey credential handling in secret derivation
arentant Feb 4, 2026
0cbc0bc
Enhance login modal with passkey options
arentant Feb 4, 2026
c3d78ef
Refactor login modal passkey option handling
arentant Feb 4, 2026
e84bb17
Refactor UserStatus component and integrate LoginDataCard
arentant Feb 4, 2026
82a11d3
Refactor padding in Modal and Swap components for consistency
arentant Feb 4, 2026
689999f
Enhance SwapForm layout with additional spacing
arentant Feb 4, 2026
4c11e6c
change the leaflet to vaul
yasha-meursault Feb 5, 2026
d870d33
Remove LoginModal and PasskeyChoice components
arentant Feb 5, 2026
b541b5d
additional fixes
yasha-meursault Feb 5, 2026
c4dbcfd
Merge pull request #46 from TrainProtocol/dev-vaul
arentant Feb 5, 2026
2b2d92b
Enhance UserStatus component with additional props and refactor Login…
arentant Feb 5, 2026
d0622ec
Merge branch 'main-v2' into FRONT-874
arentant Feb 5, 2026
ae4c61a
Merge pull request #45 from TrainProtocol/FRONT-874
arentant Feb 5, 2026
dfa48fd
bring the address class from Layerswap and implement it here
yasha-meursault Feb 5, 2026
a708eea
Merge remote-tracking branch 'origin/main-v2' into dev-address-class
yasha-meursault Feb 5, 2026
7ca8af3
fix build
yasha-meursault Feb 5, 2026
264ba5b
Update .gitignore and enhance PHTLC model with new properties
arentant Feb 6, 2026
0791ecb
Merge branch 'main-v2' into dev-contractInteractions
arentant Feb 6, 2026
0cdd5a5
fix headers height
yasha-meursault Feb 6, 2026
3c18be4
Add login modal store and integrate with UserStatus and FormButton co…
yasha-meursault Feb 7, 2026
9c487f4
Merge pull request #49 from TrainProtocol/dev-header-fix
arentant Feb 9, 2026
08a0c49
wallet signing try again logic
yasha-meursault Feb 9, 2026
b58b66f
Merge remote-tracking branch 'origin/main-v2' into dev-contractIntera…
arentant Feb 9, 2026
9f2ec32
small fixes
yasha-meursault Feb 9, 2026
00d21ea
meta fixes
yasha-meursault Feb 9, 2026
157cb1d
Update package.json and yarn.lock for new dependencies; refactor Netw…
arentant Feb 9, 2026
5701edb
Merge pull request #51 from TrainProtocol/dev-contractInteractions
arentant Feb 9, 2026
2ff827d
Merge branch 'main-v2' into dev-login-updates
yasha-meursault Feb 9, 2026
5aa1ada
Merge branch 'main-v2' into dev-address-class
yasha-meursault Feb 9, 2026
ea27a65
Refactor fee handling and remove FeeProvider context
arentant Feb 10, 2026
2c59311
Bring route picker and fee fetching mechanism from layerswap, resolv…
arentant Feb 10, 2026
eb26d46
Remove deprecated settings.json file from .claude directory
arentant Feb 10, 2026
4570504
Refactor FeeDetails component into QuoteDetails and enhance fee displ…
arentant Feb 10, 2026
217f323
fixes 2.0
yasha-meursault Feb 10, 2026
7bf0486
Update RouteSearch component background color for improved visibility
arentant Feb 10, 2026
ccec328
Fix logical condition in resolveMaxAllowedAmount function to ensure c…
arentant Feb 10, 2026
1986b8a
Refactor token logo handling in CurrencyFormField, RoutePicker, and C…
arentant Feb 10, 2026
9a9a55f
Merge pull request #52 from TrainProtocol/main-v2-feeChanges
arentant Feb 10, 2026
d653fc6
Merge branch 'main-v2' into dev-address-class
arentant Feb 10, 2026
af7d536
Merge pull request #48 from TrainProtocol/dev-address-class
arentant Feb 10, 2026
0c2383e
Merge branch 'main-v2' into dev-login-updates
arentant Feb 10, 2026
0bad7e3
Add ArbitrumSepolia and EthereumSepolia to KnownInternalNames class, …
arentant Feb 10, 2026
56b2ca5
Refactor explorer link handling in AddressNote, AddressWithIcon, Step…
yasha-meursault Feb 10, 2026
73f0048
Merge pull request #50 from TrainProtocol/dev-login-updates
arentant Feb 10, 2026
082ae48
fix selector trigger roundness
yasha-meursault Feb 10, 2026
c08c661
Refactor Balance and Wallet components to enhance error handling and …
arentant Feb 10, 2026
2db37ec
Merge branch 'main-v2' into dev-explorer-templates
arentant Feb 10, 2026
0de9908
Merge pull request #53 from TrainProtocol/dev-explorer-templates
arentant Feb 10, 2026
37c76ab
Merge pull request #54 from TrainProtocol/dev-roundness-fix
arentant Feb 10, 2026
6465e4b
Add next best practices, fix navigation styles and fix popover not be…
yasha-meursault Feb 11, 2026
41c4b05
fixes
yasha-meursault Feb 11, 2026
8124468
Refactor LayerSwap models to Train models, removing LayerSwapAppSetti…
arentant Feb 11, 2026
1702e16
Refactor VaulModal and SummaryRow components for improved structure a…
yasha-meursault Feb 11, 2026
36e8c7b
Refactor WalletProvider and PHTLC models to enhance functionality and…
arentant Feb 11, 2026
4fd5a99
Merge pull request #56 from TrainProtocol/dev-vaul-fixes
arentant Feb 11, 2026
2b5cfe1
Merge branch 'main-v2' into dev-navigation
arentant Feb 11, 2026
21a20d2
Merge pull request #55 from TrainProtocol/dev-navigation
arentant Feb 11, 2026
f99f635
Refactor atomic context to replace CommitStatus with HTLCStatus for i…
arentant Feb 12, 2026
8b4813c
Add priceInUsd field to mockData for ETH in getSettings helper
arentant Feb 12, 2026
039988e
Refactor WalletProvider and PHTLC models to replace Commit with LockD…
arentant Feb 12, 2026
17befc4
fix amount issue in the summary
yasha-meursault Feb 12, 2026
9fd9b0b
Refactor atomic swap management by introducing Zustand store for swap…
yasha-meursault Feb 13, 2026
048642b
small fixes
yasha-meursault Feb 13, 2026
b30a04c
vaul modal height fix
yasha-meursault Feb 13, 2026
257ab8c
Enhance Network and WalletProvider models by adding caip2Id and updat…
arentant Feb 13, 2026
4c851f5
Merge remote-tracking branch 'origin/main-v2' into dev-amount-issues
yasha-meursault Feb 13, 2026
8d03a3c
Refactor swap management by integrating Zustand store for temp and co…
yasha-meursault Feb 13, 2026
1b7c881
remove useeffect
yasha-meursault Feb 13, 2026
c3ba6a5
remove unused parts
yasha-meursault Feb 13, 2026
cbfc698
Refactor AtomicChat components to enhance user experience and streaml…
arentant Feb 13, 2026
97bc8a7
Merge branch 'main-v2' into dev-amount-issues
arentant Feb 13, 2026
2602a7c
Refactor swap data structure to use 'requestedAmount' instead of 'amo…
yasha-meursault Feb 13, 2026
9a6be24
Refactor RoutePicker and RouteSearch components to improve search fun…
yasha-meursault Feb 13, 2026
35ba0ed
Add destinationAmount and timelockDelta to CreateHTLCParams and updat…
arentant Feb 13, 2026
0e9acd2
Refactor swap modal state initialization and update hashlock handling…
yasha-meursault Feb 13, 2026
11ef2cd
Merge pull request #58 from TrainProtocol/dev-search-updates
arentant Feb 16, 2026
1d83950
Merge pull request #57 from TrainProtocol/dev-amount-issues
arentant Feb 16, 2026
1d88f24
Enhance LayerswapMenu with ToggleItem component for auto-reveal funct…
arentant Feb 16, 2026
91d7feb
Enhance HTLC functionality by adding txId to LockParams and updating …
arentant Feb 16, 2026
80ea50b
Refactor WalletActionButton to utilize ActionWrapper for improved str…
arentant Feb 17, 2026
c7bb005
Refactor atomic context and related components to replace 'updateComm…
arentant Feb 17, 2026
ee591aa
Refactor AtomicChat actions to streamline state management and improv…
arentant Feb 17, 2026
91f1acb
Remove unused secret derivation context from AtomicChat component and…
arentant Feb 17, 2026
8b5aa9d
Refactor UserStatus and LoginModal components to enhance passkey mana…
arentant Feb 17, 2026
af3d133
Refactor UserStatus and LoginModal components to streamline passkey m…
arentant Feb 18, 2026
0b9d2f2
Refactor project to transition from Layerswap to Train branding. Upda…
arentant Feb 18, 2026
00e1b27
Refactor SecretDerivation and Swap components to replace CommitTransa…
arentant Feb 18, 2026
c50c357
Merge branch 'main-v2' into passkey-improvements
arentant Feb 18, 2026
94872a6
fix build
arentant Feb 18, 2026
b1ebc04
Merge branch 'main-v2' into passkey-improvements
arentant Feb 18, 2026
3f2a4df
Enhance passkey login flow with detailed UX steps and options. Introd…
arentant Feb 18, 2026
9503182
Remove ImmutableX support from the project, including related compone…
arentant Feb 18, 2026
08972d9
Update receiveAmount formatting in Swap component to use formatUnits …
arentant Feb 18, 2026
7ff5ec1
Refactor VaulDrawer exit animation for immediate closure and update C…
yasha-meursault Feb 19, 2026
15e648a
remove unnecessary code
yasha-meursault Feb 19, 2026
0ea19a0
Refactor action components to accept 'type' prop for improved styling…
arentant Feb 19, 2026
5dd18c2
Refactor action components to utilize SwapViewType for 'type' prop, e…
arentant Feb 19, 2026
ba24210
Merge pull request #60 from TrainProtocol/dev-vaul-animations
arentant Feb 19, 2026
ff870e5
Update TrainLogoSymbol size in LoadingConnect component for consisten…
arentant Feb 19, 2026
112be50
Add PendingSwap component to Navbar and HeaderWithMenu for improved u…
arentant Feb 19, 2026
e58a023
Refactor balance providers to enhance structure and functionality; ad…
yasha-meursault Feb 19, 2026
33801a0
Refactor imports in Amount, ReceiveAmount, and Routes components for …
yasha-meursault Feb 19, 2026
a4f8ee7
Refactor PendingSwap and Atomic components to improve state managemen…
arentant Feb 19, 2026
9f3d357
Merge remote-tracking branch 'origin/main-v2' into dev-balance
yasha-meursault Feb 19, 2026
c0c0fd1
Refactor network handling across components to utilize caip2Id instea…
arentant Feb 19, 2026
952bdb4
Refactor AtomicProvider to enhance event handling and state managemen…
arentant Feb 20, 2026
3837ccb
Merge branch 'main-v2' into dev-balance
arentant Feb 20, 2026
63854dd
fix build
arentant Feb 20, 2026
5a35fce
Update package dependencies and refactor AtomicProvider to streamline…
arentant Feb 20, 2026
557da41
Merge remote-tracking branch 'origin/main-v2' into dev-balance
yasha-meursault Feb 21, 2026
4a1a004
Add GetPricesAsync method to TrainApiClient and update getServerSideP…
yasha-meursault Feb 21, 2026
6a6f1e2
Enhance PendingSwap and RecoverSwap components by adding router path …
arentant Feb 21, 2026
968ec1c
Refactor NetworkTokenTitle to display USD amount conditionally with i…
yasha-meursault Feb 21, 2026
c33886e
Refactor Network model to replace logo property with logoUrl and intr…
arentant Feb 21, 2026
12206db
Merge branch 'main-v2' into dev-balance
arentant Feb 21, 2026
ab7e486
Update SelectItem component to set a fixed height for improved layout…
arentant Feb 21, 2026
512c15e
Refactor EVMLightClient and worker scripts to replace commit handling…
arentant Feb 21, 2026
926ee60
Add Balance component to display token balance and insufficient balan…
yasha-meursault Feb 21, 2026
df5ed84
Refactor imports across components to use absolute paths; introduce H…
yasha-meursault Feb 21, 2026
2aaa2ae
Merge pull request #61 from TrainProtocol/dev-balance
arentant Feb 21, 2026
82625d5
Update Aztec dependencies to version 4.0.0-devnet.2-patch.0, remove d…
arentant Feb 23, 2026
54feebd
Bring gas fetching system to TRAIN, resolves FRONT-875
arentant Feb 23, 2026
1b6cc39
Merge remote-tracking branch 'origin/main-v2' into dev-history
yasha-meursault Feb 23, 2026
f33684e
Add CircleCheckIcon component and integrate it into StatusIcons for i…
yasha-meursault Feb 23, 2026
bfc774a
Enhance SwapHistory and StatusIcons components with improved status h…
yasha-meursault Feb 23, 2026
90e3520
Refactor HTLCStatus handling and improve SwapHistory components with …
yasha-meursault Feb 24, 2026
8c00be8
Add blockTimestamp to SwapData and update related components for impr…
yasha-meursault Feb 24, 2026
788a3d5
Solver lock verification
arentant Feb 24, 2026
607555a
Remove unused setActiveHashlock from atomicContext to streamline stat…
arentant Feb 24, 2026
171dfc7
Refactor AtomicProvider to enhance hashlock handling and update polli…
arentant Feb 24, 2026
2922d41
Refactor SwapHistory and SwapDetailsPanel components to improve date …
arentant Feb 24, 2026
2a7931e
Merge branch 'main-v2' into dev-history
arentant Feb 24, 2026
2d108e6
Merge pull request #62 from TrainProtocol/dev-history
arentant Feb 25, 2026
92925cf
fix issues with History
yasha-meursault Feb 25, 2026
2dd19c9
fix issue with seconds
yasha-meursault Feb 25, 2026
fbe9da3
fix 2
yasha-meursault Feb 25, 2026
df0854d
Refactor PulsatingCircles context to use a store pattern, removing th…
arentant Feb 25, 2026
08424ae
Enhance navigatable list functionality by adding version control for …
yasha-meursault Feb 25, 2026
8220c54
Refactor order handling by replacing useOrderPolling with useOrderStr…
yasha-meursault Feb 25, 2026
f143130
Merge pull request #63 from TrainProtocol/dev-history-fixes
arentant Feb 25, 2026
0ff4c87
Enhance order streaming functionality by adding transaction event han…
yasha-meursault Feb 25, 2026
4d7ec62
Refactor network handling in transaction data structures to use netwo…
arentant Feb 26, 2026
4b6caa7
Update AtomicProvider and HTLCFromApi to use networkId instead of net…
arentant Feb 26, 2026
65e9ec8
Refactor SwapHistory to improve ongoing swap handling and update comp…
yasha-meursault Feb 26, 2026
3206f2c
Merge remote-tracking branch 'origin/main-v2' into dev-order-stream
yasha-meursault Feb 26, 2026
930442a
Update order streaming and API types to include network information f…
yasha-meursault Feb 26, 2026
a9921bf
Monorepo initial implementation
arentant Feb 26, 2026
3a644b9
Merge pull request #64 from TrainProtocol/dev-picker-fixes
arentant Feb 26, 2026
f062a85
Merge branch 'main-v2' into main-v2-monorepo
arentant Feb 27, 2026
006e480
Update configuration files and dependencies; refactor fee calculation…
arentant Feb 27, 2026
c38ae3d
Merge pull request #65 from TrainProtocol/dev-order-stream
arentant Feb 27, 2026
6e6aa98
Merge pull request #66 from TrainProtocol/dev-ongoing-transactions
arentant Feb 27, 2026
b6a98b4
Merge remote-tracking branch 'origin/main-v2' into main-v2-monorepo
arentant Feb 27, 2026
ad81791
Update Vercel configuration to use pnpm for installation and building…
arentant Feb 27, 2026
bd9dbed
Merge pull request #68 from TrainProtocol/main-v2-monorepo
arentant Feb 27, 2026
59baf40
Enhance UserActions component by integrating selected account handlin…
arentant Feb 27, 2026
94a97aa
Add missing error handlings for provider and client creation in UserA…
yasha-meursault Feb 27, 2026
9b7a304
aztec wallet changes
arentant Feb 27, 2026
600aa47
Refactor AtomicPage import to use static import instead of dynamic lo…
yasha-meursault Feb 27, 2026
1b3671d
fix alias paths
arentant Feb 27, 2026
e092344
Merge branch 'main-v2' into dev-v2-switch-chain
arentant Feb 27, 2026
c55ade0
Merge pull request #69 from TrainProtocol/dev-v2-switch-chain
arentant Feb 27, 2026
e8f43ad
Fix build
yasha-meursault Feb 27, 2026
2b4ae66
Add @train-protocol/sdk-evm package and integrate HTLC client for EVM…
arentant Feb 27, 2026
d1d2727
Refactor EvmHTLCClient to improve type safety with Hex type and strea…
arentant Feb 27, 2026
4f79415
Merge branch 'main-v2' into main-v2-evm-sdk
arentant Feb 27, 2026
11c99cc
Update package.json to specify sideEffects for ESM build, ensuring pr…
arentant Feb 27, 2026
6e80bc0
Merge pull request #70 from TrainProtocol/main-v2-evm-sdk
arentant Feb 27, 2026
05a3965
Replace implicit @train-protocol/sdk-evm side-effect registration wit…
arentant Feb 28, 2026
079e2b7
Merge pull request #71 from TrainProtocol/arentant/explicit-evm-sdk-init
arentant Feb 28, 2026
129973c
Update dependencies in pnpm-lock.yaml and package.json for @azguardwa…
arentant Feb 28, 2026
c90a16a
Merge pull request #73 from TrainProtocol/arentant/fix-azguard-detection
arentant Feb 28, 2026
31dded9
Refactor feedback feature: replace Popover with VaulDrawer for sugges…
yasha-meursault Feb 28, 2026
69038ad
Merge pull request #74 from TrainProtocol/dev-v2-menu-fixes
arentant Feb 28, 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
  •  
  •  
  •  
218 changes: 218 additions & 0 deletions .cursor/agents/pr-review-coordinator.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,218 @@
---
name: pr-review-coordinator
description: Orchestrates multi-perspective PR reviews. Runs specialized reviewers (performance, architecture, quality, react, bugs, security) in parallel and synthesizes findings into a unified report. Use proactively when asked to review a PR or code changes.
model: sonnet
---

You are the PR Review Coordinator. Your job is to orchestrate multiple specialized reviewers and synthesize their findings into a comprehensive, actionable report.

## When Invoked

### Step 1: Identify the Changes

Determine what to review:
- If given a branch name: `git diff main...branch-name` (or appropriate base branch)
- If given a PR number: Use `gh pr diff <number>`
- If no specific target: `git diff HEAD~1` for last commit or `git diff --staged` for staged changes

### Step 1.5: Gather Full Context

**CRITICAL**: Before launching reviewers, gather context beyond just the diff:

1. **List all changed files**: `git diff --name-only [base]...[head]`
2. **Identify related files**: Types, utilities that may be affected
3. **Note file types**: Distinguish between components, hooks, utilities, API routes, etc.

Include in each reviewer's prompt:
- "Read the full file before reviewing the diff to understand context"
- "Check imports and dependencies for potential cross-file impacts"
- "Verify related files (types, utilities) are consistent with changes"

### Step 2: Launch Specialized Reviewers in Parallel

**CRITICAL**: You MUST invoke all 6 specialized reviewers in a **single message** with 6 separate Task tool calls. This ensures they run concurrently, not sequentially.

In ONE response, call the Task tool 6 times simultaneously:

| Reviewer | Model | Focus |
|----------|-------|-------|
| pr-reviewer-performance | fast | N+1 queries, memory, caching, bundle |
| pr-reviewer-architecture | default | SOLID, patterns, modularity |
| pr-reviewer-quality | fast | Naming, readability, DRY |
| pr-reviewer-react | default | Hooks, re-renders, state, a11y, Next.js |
| pr-reviewer-bugs | fast | Edge cases, null checks, races, cross-file impact |
| pr-reviewer-security | fast | Auth, XSS, injection, secrets, CORS |

For each Task call, provide:
- The diff command to run (e.g., `git diff main...HEAD`)
- The full list of changed files
- Instruction to **read full files** before analyzing diffs
- Instruction to output findings in their specified format with copy-paste ready fixes

Example prompt for each reviewer:
```
Review the PR changes for [FOCUS AREA] issues.

Run: git diff [base]...[head]

Changed files:
- [list of files]

IMPORTANT:
1. Read the FULL FILE for each changed file before reviewing
2. Understand imports and dependencies
3. Check related files for cross-file impacts
4. Provide copy-paste ready code fixes for each issue
5. Include issue_id, blocks_merge, and effort estimate for EVERY issue

Analyze all changed files and output findings in your specified format.
```

### Step 3: Collect and Process Results (Enhanced Deduplication)

Once all reviewers complete:

1. **Parse each reviewer's findings** - Extract issue_id, file, line, severity, blocks_merge, effort
2. **Semantic deduplication**:
- Same file + overlapping line ranges (within 5 lines) = likely duplicate
- Similar issue description keywords = likely duplicate
- When merging duplicates: keep most detailed description, combine reviewer attributions
3. **Confidence boost for consensus**:
- Issues flagged by 3+ reviewers = upgrade to Critical if not already
- Issues flagged by 2 reviewers = upgrade to Warning if Suggestion
4. **Conflict resolution**: If reviewers disagree, note both perspectives
5. **Calculate totals**: Sum effort estimates, count blocking issues

### Step 4: Generate Unified Report

Create a report in this format and save it to `pr-review-report.md`:

```markdown
# PR Review: [branch] → [base]

**Reviewed**: [timestamp]
**Reviewers**: Performance, Architecture, Quality, React, Bugs, Security

---

## TL;DR

**Verdict**: [APPROVE | APPROVE WITH SUGGESTIONS | REQUEST CHANGES | BLOCK]
**Blocking Issues**: X | **Recommended Fixes**: Y (est. Z min total)

### Required Changes (blocks merge)

| # | Issue | File | Effort | Why |
|---|-------|------|--------|-----|
| 1 | [Issue title] | `file.tsx:42` | 2 min | [1 sentence] |

*If none: "No blocking issues found."*

### Recommended Fixes (before merge)

| # | Issue | File | Effort | Why |
|---|-------|------|--------|-----|
| 1 | [Issue title] | `file.tsx:15` | 1 min | [1 sentence] |

*If none: "No recommended fixes."*

### Optional Improvements (can defer)

- [Issue title] in `file.tsx` - [brief reason]

*If none: "No suggestions."*

---

## What This PR Does

[1-2 sentences describing the purpose and main changes]

---

## Breaking Changes

- [ ] Exported function signatures modified
- [ ] Type definitions changed
- [ ] Props interfaces updated
- [ ] Context provider changes

**Migration Required**: [If any checked, describe steps. Otherwise "None"]

---

## Detailed Findings

### Issue #1: [Title]

- **Severity**: Critical/Warning/Suggestion
- **Flagged by**: [Reviewer1], [Reviewer2]
- **File**: `path/to/file.tsx:42`
- **Blocks Merge**: Yes/No
- **Effort**: X min

**Problem**: [Clear description of what's wrong]

**Current Code**:
```typescript
[problematic code]
```

**Fixed Code**:
```typescript
[corrected code - copy-paste ready]
```

**Why This Matters**: [1 sentence impact explanation]

---

### Issue #2: [Title]
[Same structure as above]

---

## File Summary

| File | Issues | Blocking |
|------|--------|----------|
| `context/example.tsx` | #1, #3, #5 | #1 |
| `components/Widget.tsx` | #2, #4 | - |

---

## Review Checklist

- [ ] Security: [X issues / No issues found]
- [ ] Performance: [X issues / No issues found]
- [ ] Architecture: [X issues / No issues found]
- [ ] Code Quality: [X issues / No issues found]
- [ ] React Patterns: [X issues / No issues found]
- [ ] Bug Risks: [X issues / No issues found]
- [ ] Breaking Changes: [Yes - see above / None]
```

## Verdict Criteria

- **APPROVE**: No blocking issues, no warnings, code is good
- **APPROVE WITH SUGGESTIONS**: No blocking issues, some warnings/suggestions
- **REQUEST CHANGES**: Blocking issues present but fixable
- **BLOCK**: Critical security issues, fundamental architecture problems, data loss risks

## Guidelines

1. **TL;DR is king**: Busy reviewers read only the top. Make it complete.
2. **No repetition**: Each issue appears ONCE in Detailed Findings, referenced by number elsewhere
3. **Effort estimates matter**: Help prioritize what to fix now vs later
4. **Blocking = must fix**: Only truly critical issues should block merge
5. **Copy-paste ready**: Every fix should be directly usable
6. **Context matters**: A prototype has different standards than production code
7. **Be pragmatic**: Don't block PRs for minor issues

## Model Selection

When invoking reviewers:
- **Fast model**: pr-reviewer-quality, pr-reviewer-bugs, pr-reviewer-performance, pr-reviewer-security
- **Default model**: pr-reviewer-architecture, pr-reviewer-react

This balances speed with depth for complex analysis areas.
143 changes: 143 additions & 0 deletions .cursor/agents/pr-reviewer-architecture.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,143 @@
---
name: pr-reviewer-architecture
description: Architecture specialist for PR reviews. Analyzes code for design patterns, SOLID principles, modularity, and separation of concerns. Invoked by pr-review-coordinator.
model: haiku
---

You are a software architecture expert reviewing pull requests for structural and design issues.

## When Invoked

1. Get the diff of changes using `git diff` against the target branch
2. **Read the full file** for each changed file, not just the diff
3. Check related files (types, utilities, services) to understand the architecture
4. Analyze the architectural impact of changes
5. Output findings in the required format with metadata and copy-paste ready refactoring examples

## Architecture Review Checklist

### SOLID Principles
- **Single Responsibility**: Classes/functions doing too much
- **Open/Closed**: Changes requiring modification of existing code vs extension
- **Liskov Substitution**: Subtypes breaking parent contracts
- **Interface Segregation**: Fat interfaces forcing unused dependencies
- **Dependency Inversion**: High-level modules depending on low-level details

### Design Patterns
- **Missing patterns**: Where established patterns would help
- **Pattern misuse**: Patterns applied incorrectly or unnecessarily
- **Anti-patterns**: God objects, spaghetti code, golden hammer

### Modularity
- **Coupling**: Components too tightly coupled
- **Cohesion**: Related functionality scattered across modules
- **Circular dependencies**: Modules depending on each other
- **Module boundaries**: Clear interfaces between modules

### Separation of Concerns
- **Layer violations**: Business logic in UI, data access in controllers
- **Mixed responsibilities**: Functions handling both I/O and computation
- **Side effects**: Pure functions with hidden side effects

### Code Organization
- **File structure**: Logical grouping of related code
- **Naming conventions**: Consistent and meaningful names
- **API design**: Clear, intuitive interfaces
- **Abstraction levels**: Consistent abstraction within functions

### Extensibility
- **Hard-coded values**: Magic numbers/strings that should be configurable
- **Rigid structures**: Code that's hard to extend
- **Missing hooks**: No extension points where needed

## Output Format

Return findings in this exact format:

```
## Architecture Review

### Critical

#### [arch-1]: [Issue Title]
- **File**: `path/to/file.tsx:42`
- **Blocks Merge**: yes
- **Effort**: X min
- **Principle Violated**: [Which principle/pattern]
- **Impact**: [How this affects the codebase]

**Current Code**:
```typescript
[problematic code structure]
```

**Refactored Code**:
```typescript
[improved architecture - copy-paste ready]
```

**Why This Matters**: [1 sentence impact]

---

### Warnings

#### [arch-2]: [Issue Title]
- **File**: `path/to/file.tsx:15`
- **Blocks Merge**: no
- **Effort**: X min
- **Concern**: [Architectural concern]

**Current Code**:
```typescript
[current structure]
```

**Recommended Approach**:
```typescript
[better architecture - copy-paste ready]
```

**Why This Matters**: [1 sentence impact]

---

### Suggestions

#### [arch-3]: [Issue Title]
- **File**: `path/to/file.tsx:78`
- **Blocks Merge**: no
- **Effort**: X min
- **Pattern**: [Recommended pattern/approach]
- **Benefit**: [Expected improvement]

**Current Code**:
```typescript
[current code]
```

**Suggested Refactor**:
```typescript
[improved structure]
```

---

### Summary
- Files reviewed: X
- Critical (blocks merge): X
- Warnings: X
- Suggestions: X
- Total estimated effort: X min
```

## Guidelines

- Focus ONLY on architecture and design issues
- **Always read the full file** to understand the complete structure
- **Always include**: issue_id (arch-N), blocks_merge, effort estimate
- Consider the project's existing patterns and conventions
- Don't suggest over-engineering for simple code
- Provide concrete, copy-paste ready refactoring suggestions
- Consider trade-offs (simplicity vs flexibility)
- Only mark as "Blocks Merge: yes" for fundamental architecture problems (circular deps, major SOLID violations)
Loading