docs: remove duplicate and unused files from .codex/prompts/ - #280
Conversation
Issue #277で提案されたPR自動作成機能をclaude.ymlに追加しました。 ## Changes ### 1. settings パラメータ追加 `permissions.allowedTools`で必要なBashツールを許可: - Bash(gh:*) - GitHub CLIコマンド - Bash(npm:*) - npmコマンド - Bash(pnpm:*) - pnpmコマンド - Bash(npx:*) - npxコマンド ### 2. claude_args にシステムプロンプト追加 Issueから作業する際、コード変更完了後にPRを自動作成するよう指示 ## Benefits ### Before - Issueからの作業完了後、手動でPR作成URLをクリック - PRのタイトルや本文を手動で入力 - ワークフローの中断 ### After - Issueからの作業完了後、自動的にPRが作成される - gh pr createコマンドが自動実行される - シームレスなワークフロー ## Behavior Issueから@claude: コード変更完了後、自動的にPR作成 PRコメントで@claude: PR作成不要(既にPR内) ## Type of Change - New feature (non-breaking change which adds functionality) - CI/CD changes ## Source This feature was discovered from keito4-org/n8n_custom_node repository using the config-contribution-discover command. Closes #277 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
- 完全重複ファイル削除: git-sync.md, setup-husky.md, README.md (.claude/commands/に存在) - 未使用のNext.js特化ファイル削除: next-security-*.md (このリポジトリはNext.jsプロジェクトではない) - 未使用のリファクタリングプロンプト削除: refactor:*.md (実際に使用されていない) - その他の未使用ファイル削除: setup-recommended-ci.md - 空ディレクトリ削除: .codex/prompts/ - ドキュメント更新: README.mdと.claude/commands/README.mdから.codex/prompts/への参照を削除 削減効果: - 13ファイル削除 - 約31.9K削減 - 重複コード534行削除 (2.78%の重複率を解消) 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
📝 WalkthroughWalkthroughThis PR consolidates documentation and workflow configuration by removing extensive Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Possibly related issues
Possibly related PRs
Suggested labels
Poem
Pre-merge checks✅ Passed checks (3 passed)
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. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🧹 Nitpick comments (1)
.github/workflows/claude.yml (1)
63-65: Test the automatic PR creation behavior in a controlled environment.The new system prompt instructs Claude to automatically run
gh pr createafter completing work on Issues. While this implements the desired automation from Issue #277, the imperative phrasing and lack of explicit safeguards should be validated in practice to ensure Claude doesn't create PRs prematurely or in unintended scenarios.Recommendations for safe rollout:
- Monitor initial executions - Watch the first few automatic PR creations to verify the behavior matches expectations
- Consider adding confirmation - For high-stakes workflows, you might want Claude to ask for confirmation before running
gh pr create- Document the behavior - Update
.claude/CLAUDE.mdor workflow documentation to inform users that PRs will be created automatically when working on Issues- Fallback handling - Ensure the workflow handles cases where PR creation fails (e.g., branch already has PR, permissions issues)
Based on the commit message referencing Issue #277, this appears to be an intentional workflow automation enhancement.
📜 Review details
Configuration used: defaults
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (16)
.claude/commands/README.md.codex/prompts/README.md.codex/prompts/git-sync.md.codex/prompts/next-security-check.md.codex/prompts/next-security:authz-review.md.codex/prompts/next-security:config-audit.md.codex/prompts/next-security:deps-scan.md.codex/prompts/refactor:decouple.md.codex/prompts/refactor:dedupe.md.codex/prompts/refactor:reorganize.md.codex/prompts/refactor:simplify.md.codex/prompts/refactor:split.md.codex/prompts/setup-husky.md.codex/prompts/setup-recommended-ci.md.github/workflows/claude.ymlREADME.md
💤 Files with no reviewable changes (13)
- .codex/prompts/refactor:dedupe.md
- .codex/prompts/next-security-check.md
- .codex/prompts/refactor:decouple.md
- .codex/prompts/setup-husky.md
- .codex/prompts/next-security:deps-scan.md
- .codex/prompts/refactor:simplify.md
- .codex/prompts/next-security:config-audit.md
- .codex/prompts/refactor:split.md
- .codex/prompts/refactor:reorganize.md
- .codex/prompts/README.md
- .codex/prompts/setup-recommended-ci.md
- .codex/prompts/next-security:authz-review.md
- .codex/prompts/git-sync.md
🧰 Additional context used
📓 Path-based instructions (1)
.github/workflows/claude.yml
📄 CodeRabbit inference engine (CLAUDE.md)
Trigger automatic AI assistance on @claude mentions in issues, PRs, and comments using .github/workflows/claude.yml
Files:
.github/workflows/claude.yml
🧠 Learnings (4)
📓 Common learnings
Learnt from: CR
Repo: keito4/config PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-12-01T03:45:17.253Z
Learning: Applies to .github/workflows/claude.yml : Trigger automatic AI assistance on claude mentions in issues, PRs, and comments using .github/workflows/claude.yml
Learnt from: CR
Repo: keito4/config PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-12-01T03:45:17.253Z
Learning: Applies to {.codex/**,.devcontainer/codex*,package*.json,npm/global.json} : Use Conventional Commits format with release-triggering types (feat/fix/perf/revert/docs) for commits touching .codex/**, .devcontainer/codex*, package*.json, or npm/global.json
📚 Learning: 2025-12-01T03:45:17.253Z
Learnt from: CR
Repo: keito4/config PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-12-01T03:45:17.253Z
Learning: Applies to .github/workflows/claude.yml : Trigger automatic AI assistance on claude mentions in issues, PRs, and comments using .github/workflows/claude.yml
Applied to files:
.claude/commands/README.md.github/workflows/claude.yml
📚 Learning: 2025-12-09T08:39:14.049Z
Learnt from: CR
Repo: keito4/config PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-12-09T08:39:14.049Z
Learning: Follow development quality standards defined in `CLAUDE.md` when using Claude Code for development assistance
Applied to files:
.claude/commands/README.md.github/workflows/claude.ymlREADME.md
📚 Learning: 2025-12-01T03:45:17.253Z
Learnt from: CR
Repo: keito4/config PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-12-01T03:45:17.253Z
Learning: Applies to {.codex/**,.devcontainer/codex*,package*.json,npm/global.json} : Use Conventional Commits format with release-triggering types (feat/fix/perf/revert/docs) for commits touching .codex/**, .devcontainer/codex*, package*.json, or npm/global.json
Applied to files:
README.md
🔇 Additional comments (2)
.claude/commands/README.md (1)
3-3: LGTM! Documentation updated to reflect cleanup.The removal of the reference to
.codex/prompts/correctly reflects the PR's deletion of those files, making the documentation accurate and focused on the commands actually present in this directory.README.md (1)
15-15: LGTM! Accurately reflects the streamlined .codex/ directory purpose.The updated description correctly focuses on MCP server configuration after the cleanup of
.codex/prompts/. The PR objectives confirm that.codex/config.tomlis preserved, making this documentation accurate.
| # Settings for allowed tools and permissions | ||
| settings: | | ||
| { | ||
| "permissions": { | ||
| "allowedTools": [ | ||
| "Bash(gh:*)", | ||
| "Bash(npm:*)", | ||
| "Bash(pnpm:*)", | ||
| "Bash(npx:*)" | ||
| ] | ||
| } | ||
| } |
There was a problem hiding this comment.
🧩 Analysis chain
🏁 Script executed:
#!/bin/bash
# First, verify the file exists and show the settings block
echo "=== Checking .github/workflows/claude.yml exists ==="
if [ -f ".github/workflows/claude.yml" ]; then
echo "File found. Showing lines around 50-61:"
sed -n '45,65p' .github/workflows/claude.yml
else
echo "File not found"
git ls-files | grep claude
fi
echo ""
echo "=== Checking for .claude/ directory ==="
if [ -d ".claude" ]; then
echo ".claude directory exists. Contents:"
find .claude -type f | head -20
else
echo ".claude directory does not exist"
fi
echo ""
echo "=== Checking repository structure ==="
ls -la .github/workflows/ | head -20Repository: keito4/config
Length of output: 2823
🏁 Script executed:
#!/bin/bash
# Search for references to bash/shell/curl/wget/python/ruby/docker in various files
echo "=== Searching for potential tool usage in YAML workflow files ==="
rg -n 'curl|wget|python|ruby|docker|perl|java|go|rust' .github/workflows/ -t yaml || echo "No additional tool usage found in workflows"
echo ""
echo "=== Searching for bash command patterns in workflow files ==="
rg -n 'run:.*|bash|shell' .github/workflows/ -A 2 -t yaml | head -100
echo ""
echo "=== Checking if there's any documentation about Claude tool restrictions ==="
rg -n 'allowedTools|Bash\(|permission|tool' . --type=md --type=txt | head -30Repository: keito4/config
Length of output: 143
🏁 Script executed:
#!/bin/bash
# The second script timed out, let's do targeted searches instead
echo "=== Checking CLAUDE.md for tool requirements ==="
if [ -f ".claude/CLAUDE.md" ]; then
wc -l .claude/CLAUDE.md
echo "First 100 lines:"
head -100 .claude/CLAUDE.md
fi
echo ""
echo "=== Checking a few agent files for tool references ==="
for agent in .claude/agents/issue-resolver-orchestrator.md .claude/agents/issue-resolver-code-quality.md; do
if [ -f "$agent" ]; then
echo "=== $agent ==="
wc -l "$agent"
head -50 "$agent"
fi
doneRepository: keito4/config
Length of output: 5168
🏁 Script executed:
#!/bin/bash
# Search for tool usage in .claude/ files more carefully
echo "=== Searching for bash/command patterns in .claude/ ==="
rg -i 'bash|run:|npm|pnpm|npx|gh|curl|wget|python|ruby|docker|shell' .claude/ --max-count=50
echo ""
echo "=== Checking if system_prompt mentions any tools ==="
grep -n "system.prompt\|System.prompt\|SYSTEM" .github/workflows/claude.yml -A 5 -B 5Repository: keito4/config
Length of output: 50371
🏁 Script executed:
#!/bin/bash
# Check what tools are actually used in .claude/ agents and commands
echo "=== Tools referenced in .claude agents that are NOT in allowlist ==="
rg -o 'jq|curl|python|grep|sed|awk|find|rg' .claude/agents/ .claude/commands/ --no-filename | sort | uniq -c | sort -rn
echo ""
echo "=== Checking .claude/settings.json for comparison ==="
grep -A 80 '"allowedTools"' .claude/settings.json | head -100Repository: keito4/config
Length of output: 265
The allowedTools configuration is too restrictive and will break existing Claude agents.
The allowlist restricts Claude to only gh:*, npm:*, pnpm:*, and npx:*, but existing agents in .claude/agents/ and .claude/commands/ depend on tools not included:
- jq (56 references) — Required for JSON parsing in issue resolvers and dependency agents
- rg (115 references) — Used throughout agents for codebase searching
- sed (78 references) — Text transformation in multiple agents
- grep (26 references) — Pattern matching across agents
- find (19 references) — File discovery in commands
- curl (4 references) — Webhook notifications (documented in
.claude/settings.local.json.template)
Add these tools to allowedTools to prevent agent failures:
"allowedTools": [
"Bash(gh:*)",
"Bash(npm:*)",
"Bash(pnpm:*)",
"Bash(npx:*)",
"Bash(jq:*)",
"Bash(rg:*)",
"Bash(curl:*)",
"Bash(grep:*)",
"Bash(sed:*)",
"Bash(find:*)"
]🤖 Prompt for AI Agents
.github/workflows/claude.yml around lines 50 to 61: the current allowedTools
list is too restrictive and omits utilities used by existing Claude agents
(.claude/agents and .claude/commands) such as jq, rg, sed, grep, find and curl;
update the allowedTools array to include these tools (Bash(jq:*), Bash(rg:*),
Bash(curl:*), Bash(grep:*), Bash(sed:*), Bash(find:*)) alongside the existing
gh/npm/pnpm/npx entries so agents relying on those commands do not fail at
runtime.
|
(aside) |
|
Claude encountered an error —— View job I'll analyze this and get back to you. |
Summary
リポジトリ内の重複ファイルと未使用ファイルを削除し、ドキュメントを更新しました。
削除されたファイル
完全重複ファイル (3ファイル)
.codex/prompts/git-sync.md→.claude/commands/git-sync.mdと完全に同一.codex/prompts/setup-husky.md→.claude/commands/setup-husky.mdと完全に同一.codex/prompts/README.md→.claude/commands/README.mdの古いバージョンNext.js特化ファイル (4ファイル)
このリポジトリはNext.jsプロジェクトではないため、以下を削除:
.codex/prompts/next-security-check.md.codex/prompts/next-security:authz-review.md.codex/prompts/next-security:config-audit.md.codex/prompts/next-security:deps-scan.md未使用のリファクタリングプロンプト (5ファイル)
実際に参照・使用されていないため削除:
.codex/prompts/refactor:decouple.md.codex/prompts/refactor:dedupe.md.codex/prompts/refactor:reorganize.md.codex/prompts/refactor:simplify.md.codex/prompts/refactor:split.mdその他 (1ファイル)
.codex/prompts/setup-recommended-ci.md- 既存のコマンドと重複空ディレクトリ
.codex/prompts/- すべてのファイルが削除されたためドキュメント更新
README.md:.codex/の説明をMCP設定のみに簡素化.claude/commands/README.md:.codex/prompts/への参照を削除削減効果
分析結果
以下のツールで分析を実施:
jscpd: 重複コード検出dependency-health-check: 依存関係ヘルスチェック (結果: 100/100、脆弱性なし)Test plan
.codex/config.tomlは保持されている(MCP設定として必要)🤖 Generated with Claude Code
Summary by CodeRabbit
Documentation
Chores
✏️ Tip: You can customize this high-level summary in your review settings.