Skip to content
Merged
Show file tree
Hide file tree
Changes from 6 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .claude/commands/sync-settings.md
Original file line number Diff line number Diff line change
Expand Up @@ -202,11 +202,11 @@ Uncommitted changes がある場合:
#### 更新方針

1. **[features]**: 共通で有効化されている feature を設定
2. **[mcp_servers.*]**:
2. **[mcp_servers.\*]**:
- 共通 MCP サーバーをマージ
- 同名サーバーの設定は既存を優先
- 新規サーバーは末尾に追加
3. **[projects.*]**: 削除(ローカル固有設定は含めない)
3. **[projects.\*]**: 削除(ローカル固有設定は含めない)
4. **notify**: 削除(OS固有設定は含めない)
5. **その他の設定**: 既存を保持

Expand Down
24 changes: 12 additions & 12 deletions .claude/hooks/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -160,20 +160,20 @@ Hooksは、Claude Codeの特定のイベント(ツール実行前後、タス

**検出するパターン**:

| パターン | ラベル |
| パターン | ラベル |
| ---------------------------------------- | ---------------------------- | ------------------- | --- | ---- | ----------- | ---------------- |
| `(AKIA | ASIA)[0-9A-Z]{16}` | AWS アクセスキー ID |
| `aws_secret_access_key=...` | AWS シークレットアクセスキー |
| `ghp_...` / `gho_...` / `github_pat_...` | GitHub トークン(3種) |
| `sk-ant-...` | Anthropic API キー |
| `sk-proj-...` / `sk-...` | OpenAI キー |
| `xox[baprs]-...` | Slack トークン |
| `[sr]k\_(live | test)\_...` | Stripe キー |
| `lin_api_...` | Linear API キー |
| `AIza...` | Google API キー |
| `glpat-...` | GitLab PAT |
| `(AKIA | ASIA)[0-9A-Z]{16}` | AWS アクセスキー ID |
| `aws_secret_access_key=...` | AWS シークレットアクセスキー |
| `ghp_...` / `gho_...` / `github_pat_...` | GitHub トークン(3種) |
| `sk-ant-...` | Anthropic API キー |
| `sk-proj-...` / `sk-...` | OpenAI キー |
| `xox[baprs]-...` | Slack トークン |
| `[sr]k\_(live | test)\_...` | Stripe キー |
| `lin_api_...` | Linear API キー |
| `AIza...` | Google API キー |
| `glpat-...` | GitLab PAT |
| `dp.(pt | st | sa | ct | scim | audit)....` | Doppler トークン |
| `-----BEGIN ... PRIVATE KEY-----` | 秘密鍵 |
| `-----BEGIN ... PRIVATE KEY-----` | 秘密鍵 |

**動作**:

Expand Down
38 changes: 32 additions & 6 deletions .claude/hooks/stop_test_verification.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,30 @@
from pathlib import Path
from common import get_git_root, detect_package_manager, build_run_command


# Test-irrelevant path definitions (skip tests when only these files changed)
IRRELEVANT_SUFFIXES = ('.md', '.txt')
IRRELEVANT_PREFIXES = (
'docs/',
'.context/',
'.gemini/',
'.cursor/',
'.vscode/',
'.idea/',
)


def affects_tests(files):
"""Return True if any changed file could affect tests."""
for f in files:
if not (
f.endswith(IRRELEVANT_SUFFIXES)
or any(f.startswith(p) for p in IRRELEVANT_PREFIXES)
):
return True
return False


# 無限ループ防止
if os.environ.get("STOP_HOOK_ACTIVE") == "1":
sys.exit(0)
Expand All @@ -39,12 +63,14 @@
["git", "ls-files", "--others", "--exclude-standard"],
capture_output=True, text=True, timeout=10, cwd=repo_root
)
has_changes = bool(
(diff_result.stdout or "").strip()
or (staged_result.stdout or "").strip()
or (untracked_result.stdout or "").strip()
)
if not has_changes:
changed_files = list(filter(None,
(diff_result.stdout or "").strip().splitlines()
+ (staged_result.stdout or "").strip().splitlines()
+ (untracked_result.stdout or "").strip().splitlines()
))
if not changed_files:
sys.exit(0)
if not affects_tests(changed_files):
sys.exit(0)
except (subprocess.TimeoutExpired, FileNotFoundError):
sys.exit(0)
Expand Down
11 changes: 11 additions & 0 deletions .claude/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -273,6 +273,17 @@
}
]
},
{
"matcher": "Write|Edit",

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Match MultiEdit for memory updates

If a Claude Code version exposes MultiEdit (as the adjacent post-edit hook already accounts for), memory files changed via that tool skip this reminder entirely because the Claude Code hooks reference treats Write|Edit as an exact list of tool names, not a substring regex. Batched updates under ~/.claude/projects/*/memory/ therefore won't inject the Notion sync context even though they are the same memory-update scenario.

Useful? React with 👍 / 👎.

Comment thread
coderabbitai[bot] marked this conversation as resolved.
Resolved
"hooks": [
{
"type": "command",
"command": "jq -c 'if ((.tool_input.file_path // \"\") | test(\"/[.]claude/projects/[^/]+/memory/\")) then {\"hookSpecificOutput\":{\"hookEventName\":\"PostToolUse\",\"additionalContext\":\"📝 メモリを更新しました。READMEの反映先チェックリストに従い、①NotionコンテキストDocの🔄最近の動き ②デイリーログ への反映も必要か確認し、必要ならその場で反映してください。\"}} else empty end'",
"timeout": 10,
"statusMessage": "メモリ更新を検知..."
}
]
},
{
"matcher": "Bash",
"hooks": [
Expand Down
32 changes: 17 additions & 15 deletions .context/code-complexity-baseline.json
Original file line number Diff line number Diff line change
@@ -1,34 +1,36 @@
{
"generated": "2026-06-05",
"generated": "2026-07-03",
"tool": "script/code-complexity-check.sh",
"overall_score": 22,
"overall_score": 20,
"rating": "Poor",
"total_files": 25,
"total_files": 37,
"distribution": {
"low_lt5": 1,
"medium_5_10": 9,
"low_lt5": 4,
"medium_5_10": 6,
"high_10_20": 12,
"critical_gt20": 13
"critical_gt20": 15
},
"files": [
{ "file": "script/security-credential-scan.sh", "complexity": 65, "lines": 480 },
{ "file": "script/repo-maintenance.sh", "complexity": 71, "lines": 470 },
{ "file": "script/container-health.sh", "complexity": 57, "lines": 324 },
{ "file": "script/install-skills.sh", "complexity": 52, "lines": 282 },
{ "file": "script/update-agents-md.sh", "complexity": 51, "lines": 293 },
{ "file": "script/setup-team-protection.sh", "complexity": 48, "lines": 551 },
{ "file": "script/update-agents-md.sh", "complexity": 52, "lines": 305 },
{ "file": "script/dependency-health-check.sh", "complexity": 50, "lines": 227 },
{ "file": "script/code-complexity-check.sh", "complexity": 45, "lines": 282 },
{ "file": "script/codespaces-secrets.sh", "complexity": 43, "lines": 421 },
{ "file": "script/codespaces-secrets.sh", "complexity": 43, "lines": 422 },
{ "file": "script/branch-cleanup.sh", "complexity": 39, "lines": 243 },
{ "file": "script/dependency-health-check.sh", "complexity": 38, "lines": 188 },
{ "file": "script/update-actions.sh", "complexity": 35, "lines": 217 },
{ "file": "script/pre-pr-checklist.sh", "complexity": 27, "lines": 215 },
{ "file": "script/setup-new-repo.sh", "complexity": 25, "lines": 266 },
{ "file": "script/audit-references.sh", "complexity": 23, "lines": 181 },
{ "file": "script/changelog-generator.sh", "complexity": 23, "lines": 182 },
{ "file": "script/test-coverage-trend.sh", "complexity": 22, "lines": 263 },
{ "file": "script/setup-ci.sh", "complexity": 21, "lines": 245 },
{ "file": "script/import.sh", "complexity": 20, "lines": 123 },
{ "file": "script/install-claude-plugins.sh", "complexity": 19, "lines": 141 },
{ "file": "script/import.sh", "complexity": 19, "lines": 117 },
{ "file": "script/check-trivyignore-review.sh", "complexity": 15, "lines": 52 },
{ "file": "script/export.sh", "complexity": 15, "lines": 87 },
{ "file": "script/brew-deps.sh", "complexity": 14, "lines": 209 },
{ "file": "script/update-all.sh", "complexity": 14, "lines": 130 },
{ "file": "script/brew-deps.sh", "complexity": 14, "lines": 208 },
{ "file": "script/export.sh", "complexity": 14, "lines": 81 },
{ "file": "script/create-codespace.sh", "complexity": 12, "lines": 233 },
{ "file": "script/wait-ci-checks.sh", "complexity": 12, "lines": 94 },
{ "file": "script/check-file-length.sh", "complexity": 11, "lines": 65 },
Expand Down
51 changes: 31 additions & 20 deletions .context/complexity-report.md
Original file line number Diff line number Diff line change
@@ -1,51 +1,62 @@
# Code Complexity Report

Generated: Thu Jun 05 00:00:00 UTC 2026
Generated: Thu Jul 03 00:00:00 UTC 2026

## Summary

- Total Files: 25
- Average Complexity: 22/20 (Poor)
- Total Files: 37
- Overall Score: 20/20 (Poor)
- High Complexity (10-20): 12 files
- Critical Complexity (>20): 13 files
- Critical Complexity (>20): 15 files

## Changes Since Previous Report (2026-05-22)
## Changes Since Previous Report (2026-06-05)

| File | Previous | Current | Delta |
| ---- | -------- | ------- | ----- |
| script/security-credential-scan.sh | 48 | 65 | +17 (worsened) ⚠️ Issue #798 |
| script/setup-team-protection.sh | 45 | 48 | +3 (worsened) ⚠️ Issue #762 |
| script/wait-ci-checks.sh | N/A | 12 | NEW |
| File | Previous | Current | Delta | Issue |
| ---- | -------- | ------- | ----- | ----- |
| script/dependency-health-check.sh | 38 | 50 | +12 (悪化) ⚠️ | #886 |
| script/update-agents-md.sh | 51 | 52 | +1 (悪化) | #887 |
| script/import.sh | 19 | 20 | +1 (悪化) | — |
| script/export.sh | 14 | 15 | +1 (悪化) | — |
| script/repo-maintenance.sh | N/A | 71 | NEW 🚨 | #888 |
| script/setup-new-repo.sh | N/A | 25 | NEW | — |
| script/audit-references.sh | N/A | 23 | NEW | — |
| script/setup-ci.sh | N/A | 21 | NEW | — |
| script/check-trivyignore-review.sh | N/A | 15 | NEW | — |
| script/security-credential-scan.sh | 65 | N/A | 改善または削除 ✅ | — |
| script/install-skills.sh | 52 | N/A | 改善または削除 ✅ | — |
| script/setup-team-protection.sh | 48 | N/A | 改善または削除 ✅ | — |

## File Details

### CRITICAL (>20)

| File | Complexity | Lines | Nesting |
| ---- | ---------- | ----- | ------- |
| script/security-credential-scan.sh | 65 | 480 | 2 |
| script/repo-maintenance.sh | 71 | 470 | 2 |
| script/container-health.sh | 57 | 324 | 1 |
| script/install-skills.sh | 52 | 282 | 1 |
| script/update-agents-md.sh | 51 | 293 | 3 |
| script/setup-team-protection.sh | 48 | 551 | 3 |
| script/update-agents-md.sh | 52 | 305 | 3 |
| script/dependency-health-check.sh | 50 | 227 | 3 |
| script/code-complexity-check.sh | 45 | 282 | 2 |
| script/codespaces-secrets.sh | 43 | 421 | 2 |
| script/codespaces-secrets.sh | 43 | 422 | 2 |
| script/branch-cleanup.sh | 39 | 243 | 1 |
| script/dependency-health-check.sh | 38 | 188 | 3 |
| script/update-actions.sh | 35 | 217 | 1 |
| script/pre-pr-checklist.sh | 27 | 215 | 1 |
| script/setup-new-repo.sh | 25 | 266 | 5 |
| script/audit-references.sh | 23 | 181 | 1 |
| script/changelog-generator.sh | 23 | 182 | 1 |
| script/test-coverage-trend.sh | 22 | 263 | 2 |
| script/setup-ci.sh | 21 | 245 | 1 |
| script/import.sh | 20 | 123 | 1 |

### HIGH (10-20)

| File | Complexity | Lines | Nesting |
| ---- | ---------- | ----- | ------- |
| script/install-claude-plugins.sh | 19 | 141 | 0 |
| script/import.sh | 19 | 117 | 1 |
| script/install-claude-plugins.sh | 19 | 141 | 1 |
| script/check-trivyignore-review.sh | 15 | 52 | 1 |
| script/export.sh | 15 | 87 | 1 |
| script/brew-deps.sh | 14 | 209 | 2 |
| script/update-all.sh | 14 | 130 | 1 |
| script/brew-deps.sh | 14 | 208 | 2 |
| script/export.sh | 14 | 81 | 1 |
| script/create-codespace.sh | 12 | 233 | 1 |
| script/wait-ci-checks.sh | 12 | 94 | 1 |
| script/check-file-length.sh | 11 | 65 | 1 |
Expand Down
8 changes: 4 additions & 4 deletions .devcontainer/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ RUN OP_VERSION="${OP_CLI_VERSION}" \

# Install Node.js
# Version is managed by .github/workflows/update-dev-tools.yml
ARG NODE_VERSION=24.17.0
ARG NODE_VERSION=24.18.0
RUN NODE_ARCH=$(dpkg --print-architecture | sed 's/amd64/x64/;s/armhf/armv7l/;s/arm64/arm64/') \
&& wget -q https://nodejs.org/dist/v${NODE_VERSION}/node-v${NODE_VERSION}-linux-${NODE_ARCH}.tar.xz \
&& tar -xJf node-v${NODE_VERSION}-linux-${NODE_ARCH}.tar.xz -C /usr/local --strip-components=1 \
Expand All @@ -77,7 +77,7 @@ RUN NODE_ARCH=$(dpkg --print-architecture | sed 's/amd64/x64/;s/armhf/armv7l/;s/

# Install pnpm
# Version is managed by .github/workflows/update-dev-tools.yml
ARG PNPM_VERSION=11.8.0
ARG PNPM_VERSION=11.9.0
RUN npm install -g pnpm@${PNPM_VERSION}

USER vscode
Expand All @@ -99,7 +99,7 @@ COPY npm/global.json /tmp/npm-global.json
# Install Claude Code using native installer (npm installation deprecated)
# Must run as vscode user so claude installs to /home/vscode/.claude/local/bin
# Version is managed by .github/workflows/update-dev-tools.yml
ARG CLAUDE_CODE_VERSION=2.1.185
ARG CLAUDE_CODE_VERSION=2.1.195
USER vscode
RUN curl -fsSL https://claude.ai/install.sh | bash -s "${CLAUDE_CODE_VERSION}" \
&& echo 'export PATH="$HOME/.local/bin:$HOME/.claude/local/bin:$PATH"' >> /home/vscode/.bashrc
Expand Down Expand Up @@ -215,6 +215,6 @@ RUN echo "${IMAGE_VERSION}" > /etc/config-base-version \

COPY package.json package-lock.json /tmp/
COPY .husky /tmp/.husky/
COPY git/commitlint.config.js /tmp/commitlint.config.js
COPY commitlint.config.js /tmp/commitlint.config.js
# package.json の overrides により handlebars >= 4.7.9 (CVE-2026-33937対応) が強制インストールされる
RUN cd /tmp && npm ci && npm run prepare || true
18 changes: 18 additions & 0 deletions .devcontainer/claude-settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -356,6 +356,24 @@
"command": "python3 /home/vscode/.claude/hooks/post_pr_ai_review.py"
}
]
},
{
"matcher": "Bash",
"hooks": [
{
"type": "command",
"command": "python3 /home/vscode/.claude/hooks/post_pr_ci_watch.py"
}
]
},
{
"matcher": "Bash",
"hooks": [
{
"type": "command",
"command": "bash -c 'cd \"$(git rev-parse --show-toplevel 2>/dev/null || echo .)\" && python3 /home/vscode/.claude/hooks/post_commit_adr_reminder.py'"
}
]
}
],
"Stop": [
Expand Down
14 changes: 14 additions & 0 deletions .filelengthignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# .filelengthignore - 行数チェック (check-file-length.sh) の除外パターン
#
# .gitignore と同じ記法でパターンを指定できます。
# - 空行とコメント行 (#) は無視されます
# - glob パターンが使えます(*, **, ? など)
# - パスはリポジトリルートからの相対パスで評価されます

# 自動生成パターン
**/*.generated.*
**/*.gen.*
**/database.types.ts

# テンプレートサンプルファイル(網羅的な参照実装のため分割不可)
templates/testing/**
2 changes: 1 addition & 1 deletion .github/workflows/claude-code-review.yml
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ jobs:
- name: Run Claude Code Review
id: claude-review
if: steps.claude-auth.outputs.available == 'true'
uses: anthropics/claude-code-action@2fee15510437d71399d9139ed60433470484a8fb # v1
uses: anthropics/claude-code-action@a92e7c70a4da9793dc164451d829089dc057a464 # v1
with:
claude_code_oauth_token: ${{ secrets.CLAUDE_CODE_OAUTH_TOKEN }}
anthropic_api_key: ${{ secrets.ANTHROPIC_API_KEY }}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/claude.yml
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ jobs:
- name: Run Claude Code
id: claude
if: steps.pr_draft.outputs.is_draft != 'true'
uses: anthropics/claude-code-action@2fee15510437d71399d9139ed60433470484a8fb # v1
uses: anthropics/claude-code-action@a92e7c70a4da9793dc164451d829089dc057a464 # v1
with:
claude_code_oauth_token: ${{ secrets.CLAUDE_CODE_OAUTH_TOKEN }}

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/scheduled-maintenance.yml
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ jobs:

- name: Run scheduled maintenance
id: maintenance
uses: anthropics/claude-code-action@2fee15510437d71399d9139ed60433470484a8fb # v1
uses: anthropics/claude-code-action@a92e7c70a4da9793dc164451d829089dc057a464 # v1
env:
CLAUDE_BRANCH: ${{ env.CLAUDE_BRANCH }}
with:
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ supabase/.temp/
credentials/*.env
!credentials/*.env.template
credentials/secrets/
.env
.env.secret
.env*.local
.devcontainer.env
Expand Down
2 changes: 1 addition & 1 deletion .zsh/configs/virtual/node.zsh
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ export NVM_DIR="$HOME/.nvm"

[ -s "$(brew --prefix)/opt/nvm/nvm.sh" ] && \. "$(brew --prefix)/opt/nvm/nvm.sh" # This loads nvm

export PNPM_HOME="/Users/keito/Library/pnpm"
export PNPM_HOME="$HOME/Library/pnpm"
case ":$PATH:" in
*":$PNPM_HOME:"*) ;;
*) export PATH="$PNPM_HOME:$PATH" ;;
Expand Down
Loading