Skip to content

Commit 09f5fed

Browse files
committed
Merge branch 'develop' of github.com:yn1323/yps-crispy-carnival into develop
2 parents 8f0ec71 + 623c028 commit 09f5fed

File tree

58 files changed

+2629
-235
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

58 files changed

+2629
-235
lines changed
Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
---
2+
name: difit-review
3+
description: A skill for reviewing a specific diff and showing the findings as comments inside difit (the diff viewer). Use it to review branch diffs, commit diffs, or GitHub PRs, then preload findings or code explanations into difit with `--comment` before launching it for the user.
4+
---
5+
6+
# Difit Review
7+
8+
## Overview
9+
10+
This skill launches a requested git diff in a viewer that is easy for humans to read. At the same time, the agent can attach arbitrary comments via the `--comment` option.
11+
This comment mechanism is well suited for code review findings and code explanations.
12+
Before running commands, choose `<difit-command>` using the following rule:
13+
14+
- If `command -v difit` succeeds, use `difit`.
15+
- Otherwise, use `npx difit`.
16+
- If falling back to `npx difit` would require network access in a sandboxed environment without network permission, request escalated permissions and user approval before running it.
17+
- 心理的安全性も考慮してレビューしてください
18+
19+
## Steps
20+
21+
The final command typically looks like this:
22+
23+
```bash
24+
<difit-command> <target> [compare-with] \
25+
--comment '{"type":"thread","filePath":"src/foobar.ts","position":{"side":"old","line":102},"body":"line 1\nline 2"}' \
26+
--comment '{"type":"thread","filePath":"src/example.ts","position":{"side":"new","line":{"start":36,"end":39}},"body":"Range comment for L36-L39"}'
27+
```
28+
29+
The detailed procedure is as follows.
30+
31+
1. Identify the target diff and review its contents.
32+
33+
- Inspect the diff specified by the user. This may be a local git revision, a GitHub URL, a patch file, or something similar.
34+
- Understand the diff normally, inspect surrounding code when needed, and think through the response required by the user's request, whether that is review findings, explanations, or something else.
35+
- For PR reviews, inspect the PR locally and keep the review result limited to difit output. Do not post comments back to remote GitHub.
36+
37+
2. Attach the prepared comments and launch difit.
38+
39+
- **difit launch options**
40+
- Use `<difit-command> <target> [compare-with]` to specify the target diff.
41+
- For uncommitted changes use `<difit-command> .`, for working tree changes use `<difit-command> working`, and for staged changes use `<difit-command> staging`.
42+
- For stdin input, use a form such as `diff -u file1.txt file2.txt | <difit-command>`.
43+
- **Comment arguments**
44+
- Use `type: "thread"` for each comment.
45+
- Write comment bodies in the language the user is using.
46+
- Use `position.side: "new"` for lines that exist on the target side of the diff.
47+
- Use `position.side: "old"` for lines that exist only on the deleted side.
48+
- Use range comments for issues that span multiple lines.
49+
- Never copy secrets, tokens, passwords, API keys, private keys, or other credential-like material from the diff into `--comment` bodies or any command-line arguments.
50+
- **Additional argument for files not yet added to git**
51+
- For uncommitted changes, if you decide files not yet added to git should also appear in the diff, add `--include-untracked`.
52+
53+
3. Share the difit URL and finish the response.
54+
- If there were no comments to attach, explicitly say so.
55+
- No manual verification of the launched difit page is required.
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
interface:
2+
display_name: 'Difit Review'
3+
short_description: 'Review diffs and open difit with inline findings.'
4+
default_prompt: 'Use $difit-review to review a diff or PR, convert concrete findings into --comment entries, and open difit if available, otherwise npx difit with those comments preloaded.'
Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
---
2+
name: difit-review
3+
description: A skill for reviewing a specific diff and showing the findings as comments inside difit (the diff viewer). Use it to review branch diffs, commit diffs, or GitHub PRs, then preload findings or code explanations into difit with `--comment` before launching it for the user.
4+
---
5+
6+
# Difit Review
7+
8+
## Overview
9+
10+
This skill launches a requested git diff in a viewer that is easy for humans to read. At the same time, the agent can attach arbitrary comments via the `--comment` option.
11+
This comment mechanism is well suited for code review findings and code explanations.
12+
Before running commands, choose `<difit-command>` using the following rule:
13+
14+
- If `command -v difit` succeeds, use `difit`.
15+
- Otherwise, use `npx difit`.
16+
- If falling back to `npx difit` would require network access in a sandboxed environment without network permission, request escalated permissions and user approval before running it.
17+
18+
## Steps
19+
20+
The final command typically looks like this:
21+
22+
```bash
23+
<difit-command> <target> [compare-with] \
24+
--comment '{"type":"thread","filePath":"src/foobar.ts","position":{"side":"old","line":102},"body":"line 1\nline 2"}' \
25+
--comment '{"type":"thread","filePath":"src/example.ts","position":{"side":"new","line":{"start":36,"end":39}},"body":"Range comment for L36-L39"}'
26+
```
27+
28+
The detailed procedure is as follows.
29+
30+
1. Identify the target diff and review its contents.
31+
32+
- Inspect the diff specified by the user. This may be a local git revision, a GitHub URL, a patch file, or something similar.
33+
- Understand the diff normally, inspect surrounding code when needed, and think through the response required by the user's request, whether that is review findings, explanations, or something else.
34+
- For PR reviews, inspect the PR locally and keep the review result limited to difit output. Do not post comments back to remote GitHub.
35+
36+
2. Attach the prepared comments and launch difit.
37+
38+
- **difit launch options**
39+
- Use `<difit-command> <target> [compare-with]` to specify the target diff.
40+
- For uncommitted changes use `<difit-command> .`, for working tree changes use `<difit-command> working`, and for staged changes use `<difit-command> staging`.
41+
- For stdin input, use a form such as `diff -u file1.txt file2.txt | <difit-command>`.
42+
- **Comment arguments**
43+
- Use `type: "thread"` for each comment.
44+
- Write comment bodies in the language the user is using.
45+
- Use `position.side: "new"` for lines that exist on the target side of the diff.
46+
- Use `position.side: "old"` for lines that exist only on the deleted side.
47+
- Use range comments for issues that span multiple lines.
48+
- Never copy secrets, tokens, passwords, API keys, private keys, or other credential-like material from the diff into `--comment` bodies or any command-line arguments.
49+
- **Additional argument for files not yet added to git**
50+
- For uncommitted changes, if you decide files not yet added to git should also appear in the diff, add `--include-untracked`.
51+
52+
3. Share the difit URL and finish the response.
53+
- If there were no comments to attach, explicitly say so.
54+
- No manual verification of the launched difit page is required.
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
interface:
2+
display_name: 'Difit Review'
3+
short_description: 'Review diffs and open difit with inline findings.'
4+
default_prompt: 'Use $difit-review to review a diff or PR, convert concrete findings into --comment entries, and open difit if available, otherwise npx difit with those comments preloaded.'

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ storybook-static
1919
node_modules/
2020
/test-results/
2121
/playwright-report/
22+
test-results.json
2223
/blob-report/
2324
/playwright/.cache/
2425

convex-seeds/seeds/db.zip

-890 Bytes
Binary file not shown.

convex/CLAUDE.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -159,7 +159,7 @@ query の返り値はドキュメントをそのまま返さず、必要なフ
159159
- [ ] query の返り値を必要最低限のフィールドに制限
160160
- [ ] Magic Link のワンタイム・有効期限を実装
161161
- [ ] エラーメッセージから内部情報が漏れないことを確認
162-
- [ ] レートリミットを Magic Link 検証に適用
162+
- [x] レートリミットを Magic Link 検証に適用
163163

164164
## テスト
165165

convex/_generated/api.d.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010

1111
import type * as _lib_dateFormat from "../_lib/dateFormat.js";
1212
import type * as _lib_functions from "../_lib/functions.js";
13+
import type * as _lib_rateLimits from "../_lib/rateLimits.js";
1314
import type * as _lib_resend from "../_lib/resend.js";
1415
import type * as _lib_time from "../_lib/time.js";
1516
import type * as _lib_uuid from "../_lib/uuid.js";
@@ -41,6 +42,7 @@ import type {
4142
declare const fullApi: ApiFromModules<{
4243
"_lib/dateFormat": typeof _lib_dateFormat;
4344
"_lib/functions": typeof _lib_functions;
45+
"_lib/rateLimits": typeof _lib_rateLimits;
4446
"_lib/resend": typeof _lib_resend;
4547
"_lib/time": typeof _lib_time;
4648
"_lib/uuid": typeof _lib_uuid;

convex/_lib/rateLimits.ts

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
import { defineRateLimits } from "convex-helpers/server/rateLimit";
2+
3+
const MINUTE = 60_000;
4+
const HOUR = 60 * MINUTE;
5+
6+
export const { checkRateLimit, rateLimit, resetRateLimit } = defineRateLimits({
7+
// マジックリンクトークン検証: トークン先頭8文字をキーに
8+
// 5回/分 — ブルートフォース保険
9+
verifyToken: {
10+
kind: "token bucket",
11+
rate: 5,
12+
period: MINUTE,
13+
capacity: 5,
14+
},
15+
16+
// リンク再発行リクエスト: email+recruitmentId をキーに
17+
// 3回/時 — メール爆撃防止(Resend課金対策)
18+
requestReissue: {
19+
kind: "token bucket",
20+
rate: 3,
21+
period: HOUR,
22+
capacity: 3,
23+
},
24+
});

convex/dashboard/queries.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ export const getDashboardData = authenticatedQuery({
5656
return {
5757
shop: { name: shop.name },
5858
recruitments: recruitmentsWithCounts,
59-
staffs: staffs.map((s) => ({ _id: s._id, name: s.name, email: s.email })),
59+
staffs: staffs.map((s) => ({ _id: s._id, name: s.name, email: s.email, isOwner: s.userId === ctx.user?._id })),
6060
};
6161
},
6262
});

0 commit comments

Comments
 (0)