Skip to content

chore: リポジトリ整理(セキュリティ・設定一貫性・ドキュメント品質) - #499

Merged
keito4 merged 2 commits into
mainfrom
chore/repo-cleanup
Feb 22, 2026
Merged

chore: リポジトリ整理(セキュリティ・設定一貫性・ドキュメント品質)#499
keito4 merged 2 commits into
mainfrom
chore/repo-cleanup

Conversation

@keito4

@keito4 keito4 commented Feb 22, 2026

Copy link
Copy Markdown
Owner

Summary

  • secret.jsoncredentials/google-oauth.json に移動し .gitignore を整理
  • .trivyignore のレビュー日を 2026-03-22(1ヶ月後)に更新(全5エントリ)
  • .devcontainer/claude-settings-README.md を新規作成し、CI用 vs ローカル用の設定差分を文書化
  • ルート CLAUDE.mdAGENTS.md 参照の意図を明記(シンボリックリンク → include形式)
  • .cursor/rules/base.mdc を Cursor Project Rules 形式で新規作成
  • script/code-complexity-check.sh(( var++ )) バグ修正(set -e 環境で初期値0のインクリメントが falsy 評価される問題)
  • grep -c のマッチ0件時に "0\n0" が代入されるバグ修正
  • Quality Gates の code-complexity-check を --strict なし(informational)に変更

Test plan

  • rg secret.json で残存参照がないことを確認
  • credentials/google-oauth.json の存在確認
  • .trivyignore 全5件のレビュー日が 2026-03-22 に更新されていること
  • code-complexity-check.sh が正常動作すること(--json で出力確認済み)
  • 全テスト(101件)パス済み
  • Prettier / ESLint パス済み

🤖 Generated with Claude Code

Summary by CodeRabbit

  • Configuration

    • Relaxed code complexity check invocation to be less strict.
    • Updated credential ignore patterns (adjusted secret handling and added OAuth credential ignore).
  • Documentation

    • Added development standards and quality guidelines.
    • Added Claude settings guide for DevContainer and CI.
    • Added project-level Claude configuration documentation.
  • Chores

    • Updated vulnerability scan review dates.
    • Refined script syntax for consistency.

- secret.json を credentials/google-oauth.json に移動し .gitignore を更新
- .trivyignore のレビュー日を 2026-03-22 に更新(全5エントリ)
- devcontainer の claude-settings 差分を文書化
- CLAUDE.md に AGENTS.md 参照の意図を明記
- Cursor Project Rules (.cursor/rules/base.mdc) を追加
- code-complexity-check.sh の (( var++ )) バグを修正(set -e 互換)
- Quality Gates の code-complexity-check を informational モードに変更

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.
To continue using code reviews, add credits to your account and enable them for code reviews in your settings.

@coderabbitai

coderabbitai Bot commented Feb 22, 2026

Copy link
Copy Markdown
📝 Walkthrough

Walkthrough

Removes strict flag from the code-complexity check invocation, refactors shell arithmetic logic, adds development standards and Claude settings docs, updates gitignore entries for credentials, and adjusts Trivy CVE review dates.

Changes

Cohort / File(s) Summary
Development standards & Claude docs
.cursor/rules/base.mdc, .devcontainer/claude-settings-README.md, CLAUDE.md
Adds company-wide prompting/process rules, DevContainer/CI Claude settings documentation, and a project-level CLAUDE.md intro.
Hook & complexity script
.claude/hooks/pre_git_quality_gates.py, script/code-complexity-check.sh
Removes the --strict argument from the code-complexity-check invocation; refactors shell arithmetic and defaulting in the complexity script (explicit $((...)) increments and conditional defaults).
Ignore / credentials
.gitignore, credentials/.gitignore
Removes secret.json from root .gitignore; adds google-oauth.json to credentials/.gitignore.
Security metadata
.trivyignore
Updates CVE review timestamps (dates changed from 2026-02-17 to 2026-03-22).

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~12 minutes

Possibly related PRs

Suggested labels

released, size/S

Poem

🐰 I nibble configs in the night,
I trim a flag, make checks less tight,
I tuck a secret out of sight,
I hop through docs with pure delight—
A tiny rabbit, setting things right. ✨

🚥 Pre-merge checks | ✅ 2 | ❌ 1

❌ Failed checks (1 inconclusive)

Check name Status Explanation Resolution
Title check ❓ Inconclusive The title is in Japanese and translates to 'chore: repository cleanup (security, configuration consistency, documentation quality)', which broadly aligns with the changeset's multiple infrastructure/config updates but lacks the specificity and clarity expected for primary issue identification in English-speaking repos. Clarify the title in the repository's primary language (English) to highlight the most critical change (e.g., 'chore: fix code-complexity-check script and update repository configuration'), or add a brief English translation in the description to aid discoverability.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch chore/repo-cleanup

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@keito4

keito4 commented Feb 22, 2026

Copy link
Copy Markdown
Owner Author

🔍 AI Code Review (Local Hook)

Models: Codex (default) / Gemini (default)

🤖 Codex Review

指摘事項

  • .gitignore:47-55
    secret.json の除外が削除されており、認証情報を含むファイルが誤ってコミットされるリスクが増えています。必要ファイルなら改めて除外ルールを追加してください。
  • .claude/hooks/pre_git_quality_gates.py:146-151
    script/code-complexity-check.sh--strict が外れており、複雑度ゲートが緩和されています。品質ゲートとして必須ならリグレッションです。意図した変更なら文書化または代替の厳格基準が必要です。

判定
patch is incorrect — セキュリティ上のリスク(.gitignore からの除外削除)と品質ゲートの緩和が導入されているため。信頼度 0.55


⚠️ 修正が必要です

上記のレビューで問題が指摘されています。修正してからマージしてください。


🤖 Generated by post_pr_ai_review.py hook

@keito4

keito4 commented Feb 22, 2026

Copy link
Copy Markdown
Owner Author

🔍 AI Code Review (Local Hook)

Models: Codex (default) / Gemini (default)

🤖 Codex Review

指摘事項(重大度順)

  1. 品質ゲートの実効性低下(複雑度チェックが失敗しなくなる)
    script/code-complexity-check.sh--strict 時のみ critical complexity で非ゼロ終了しますが、フック呼び出しから --strict が外れているため、critical が存在してもゲートが通過します。これにより複雑度の退行が検知されなくなります。
    影響ファイル/範囲: .claude/hooks/pre_git_quality_gates.py:148-160

  2. secret.json がコミット対象になり得る
    ルート .gitignore から secret.json が外れており、既存運用で秘密情報をこのファイル名に置いている場合に誤コミットのリスクが上がります。
    影響ファイル/範囲: .gitignore:47-56

結論: patch is incorrect
理由: 品質ゲートの実効性低下と、秘密情報の誤コミットリスク増加は安全性・保守性に直結するため。
信頼度: 0.61


⚠️ 修正が必要です

上記のレビューで問題が指摘されています。修正してからマージしてください。


🤖 Generated by post_pr_ai_review.py hook

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🧹 Nitpick comments (1)
.cursor/rules/base.mdc (1)

1-4: Missing alwaysApply: true for a universal base rule.

If alwaysApply is true, the rule will be applied to every chat session. With only globs: "**/*", these rules won't get attached unless the current file matches the glob; they are treated as auto-attach, but only triggered if there's an associated file path — if the glob doesn't match any file (or if the current session has no files), it's ignored.

For a "全社横断" base rule, alwaysApply: true is the reliable mechanism. The canonical frontmatter pattern for this rule type is:

🔧 Proposed fix
 ---
 description: 全社横断の開発品質・コミュニケーション基準
-globs: "**/*"
+globs: ""
+alwaysApply: true
 ---
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In @.cursor/rules/base.mdc around lines 1 - 4, Add the frontmatter key
alwaysApply: true to this base rule so it is attached to every session;
specifically, update the YAML frontmatter that currently contains description
and globs (the keys "description" and "globs: \"**/*\"") to include alwaysApply:
true (keeping the leading and trailing --- markers intact) so the rule is forced
to apply even when no file path matches.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@CLAUDE.md`:
- Line 6: The import token in CLAUDE.md uses a bare filename "AGENTS.md" which
will be treated as plain text; update that token to use the Claude import syntax
by replacing "AGENTS.md" with "@AGENTS.md" so the AGENTS.md file is actually
imported into CLAUDE.md (look for the literal "AGENTS.md" occurrence and change
it to "@AGENTS.md").

---

Nitpick comments:
In @.cursor/rules/base.mdc:
- Around line 1-4: Add the frontmatter key alwaysApply: true to this base rule
so it is attached to every session; specifically, update the YAML frontmatter
that currently contains description and globs (the keys "description" and
"globs: \"**/*\"") to include alwaysApply: true (keeping the leading and
trailing --- markers intact) so the rule is forced to apply even when no file
path matches.

Comment thread CLAUDE.md
このファイルは Claude Code がプロジェクトルートで最初に読み込む設定ファイルです。
詳細なガイドラインは AGENTS.md に集約しています。

AGENTS.md

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟡 Minor

Bare AGENTS.md won't be imported — use @AGENTS.md.

CLAUDE.md files import additional files using @path/to/import syntax, confirmed by the official Claude Code documentation. The bare AGENTS.md on line 6 is treated as plain text — AGENTS.md content will not be pulled into Claude's context, defeating the stated "include形式" intent.

🔧 Proposed fix
-AGENTS.md
+@AGENTS.md
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
AGENTS.md
`@AGENTS.md`
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@CLAUDE.md` at line 6, The import token in CLAUDE.md uses a bare filename
"AGENTS.md" which will be treated as plain text; update that token to use the
Claude import syntax by replacing "AGENTS.md" with "@AGENTS.md" so the AGENTS.md
file is actually imported into CLAUDE.md (look for the literal "AGENTS.md"
occurrence and change it to "@AGENTS.md").

git index がシンボリックリンク(mode 120000)のまま残っていたため、
CI環境でファイルが正しくチェックアウトされずテストが失敗していた。

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Duplicate comments:
In `@CLAUDE.md`:
- Line 6: Replace the bare filename reference "AGENTS.md" with the
include/import form that uses the @ prefix so the file is pulled into context
(i.e., change the reference in CLAUDE.md from AGENTS.md to `@AGENTS.md`); update
the occurrence where the plain text is used so Claude Code recognizes and
imports the AGENTS.md content.

@keito4
keito4 merged commit 7a1513e into main Feb 22, 2026
20 checks passed
@github-actions

Copy link
Copy Markdown
Contributor

🎉 This PR is included in version 1.81.0 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

@github-actions github-actions Bot added the released リリース済み label Feb 22, 2026
@keito4
keito4 deleted the chore/repo-cleanup branch March 1, 2026 09:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

released リリース済み

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant