You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 58d8d19
Browse filesBrowse the repository at this point in the historyBrowse files
Copy file name to clipboardExpand all lines: .agents/skills/migrate-file-operation/SKILL.md
+3-3Lines changed: 3 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -52,7 +52,7 @@ Keep responsibilities in these layers:
52
52
1. Route/tool adapter: authenticate, construct a `Principal`, select the operation and rate policy, parse the surface contract, call the use case, and render the surface response.
53
53
2. Application use case: load the canonical resource, compare any asserted workspace, authorize the operation, run the business operation, record semantic audit, and trigger shared domain notifications.
54
54
3. Manager/repository: execute storage and database reads/writes. Accept canonical IDs and workspace scope, not credentials or principals.
55
-
4. Presenter: return the contract success body only. Never return `NextResponse`, rate metadata, or errors.
55
+
4. Presenter: return the contract success body only. Omit it when the use-case result already matches the contract. Never return `NextResponse`, rate metadata, or errors.
56
56
57
57
Use this order for ordinary JSON routes:
58
58
@@ -147,9 +147,9 @@ Use `defineInternalJsonRoute` and explicitly declare:
147
147
-`mapInput`
148
148
-`useCase`
149
149
- optional `onSuccess` only to preserve surface-specific behavior
150
-
-`present`
150
+
-`present` when the surface wire body differs from the use-case result
151
151
152
-
Keep the existing internal success and error envelope. The builder owns `withRouteHandler`, authentication-before-parse ordering, response validation, and `NextResponse` creation.
152
+
Keep the existing internal success and error envelope. Error policies project typed status/body descriptors rather than constructing responses. The builder owns `withRouteHandler`, authentication-before-parse ordering, response validation, and `NextResponse` creation.
Copy file name to clipboardExpand all lines: .claude/commands/migrate-file-operation.md
+3-3Lines changed: 3 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -51,7 +51,7 @@ Keep responsibilities in these layers:
51
51
1. Route/tool adapter: authenticate, construct a `Principal`, select the operation and rate policy, parse the surface contract, call the use case, and render the surface response.
52
52
2. Application use case: load the canonical resource, compare any asserted workspace, authorize the operation, run the business operation, record semantic audit, and trigger shared domain notifications.
53
53
3. Manager/repository: execute storage and database reads/writes. Accept canonical IDs and workspace scope, not credentials or principals.
54
-
4. Presenter: return the contract success body only. Never return `NextResponse`, rate metadata, or errors.
54
+
4. Presenter: return the contract success body only. Omit it when the use-case result already matches the contract. Never return `NextResponse`, rate metadata, or errors.
55
55
56
56
Use this order for ordinary JSON routes:
57
57
@@ -146,9 +146,9 @@ Use `defineInternalJsonRoute` and explicitly declare:
146
146
-`mapInput`
147
147
-`useCase`
148
148
- optional `onSuccess` only to preserve surface-specific behavior
149
-
-`present`
149
+
-`present` when the surface wire body differs from the use-case result
150
150
151
-
Keep the existing internal success and error envelope. The builder owns `withRouteHandler`, authentication-before-parse ordering, response validation, and `NextResponse` creation.
151
+
Keep the existing internal success and error envelope. Error policies project typed status/body descriptors rather than constructing responses. The builder owns `withRouteHandler`, authentication-before-parse ordering, response validation, and `NextResponse` creation.
Copy file name to clipboardExpand all lines: .cursor/commands/migrate-file-operation.md
+3-3Lines changed: 3 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -47,7 +47,7 @@ Keep responsibilities in these layers:
47
47
1. Route/tool adapter: authenticate, construct a `Principal`, select the operation and rate policy, parse the surface contract, call the use case, and render the surface response.
48
48
2. Application use case: load the canonical resource, compare any asserted workspace, authorize the operation, run the business operation, record semantic audit, and trigger shared domain notifications.
49
49
3. Manager/repository: execute storage and database reads/writes. Accept canonical IDs and workspace scope, not credentials or principals.
50
-
4. Presenter: return the contract success body only. Never return `NextResponse`, rate metadata, or errors.
50
+
4. Presenter: return the contract success body only. Omit it when the use-case result already matches the contract. Never return `NextResponse`, rate metadata, or errors.
51
51
52
52
Use this order for ordinary JSON routes:
53
53
@@ -142,9 +142,9 @@ Use `defineInternalJsonRoute` and explicitly declare:
142
142
-`mapInput`
143
143
-`useCase`
144
144
- optional `onSuccess` only to preserve surface-specific behavior
145
-
-`present`
145
+
-`present` when the surface wire body differs from the use-case result
146
146
147
-
Keep the existing internal success and error envelope. The builder owns `withRouteHandler`, authentication-before-parse ordering, response validation, and `NextResponse` creation.
147
+
Keep the existing internal success and error envelope. Error policies project typed status/body descriptors rather than constructing responses. The builder owns `withRouteHandler`, authentication-before-parse ordering, response validation, and `NextResponse` creation.
0 commit comments