Skip to content

chore(scaffold): add Claude Code AI environment and commands#885

Merged
YusukeHirao merged 8 commits intodevfrom
ai-settings
Apr 7, 2026
Merged

chore(scaffold): add Claude Code AI environment and commands#885
YusukeHirao merged 8 commits intodevfrom
ai-settings

Conversation

@YusukeHirao
Copy link
Copy Markdown
Member

@YusukeHirao YusukeHirao commented Apr 1, 2026

概要

scaffoldパッケージにClaude Code / Cursor対応のAI環境設定とカスタムコマンドを追加。

Claude Code

  • CLAUDE.md — プロジェクトルール定義(ガイドラインへのリンク含む)
  • .claude/settings.json — パーミッション・MCPサーバー有効化設定
  • .mcp.json — chrome-devtools / figma-remote-mcp サーバー定義
  • .claude/commands/git.md — コミットルール・diff確認手順・安全ガイドライン
  • .claude/commands/release.md — リリースブランチ作成フロー
  • .claude/commands/fix-component.md — コンポーネント修正ワークフロー(DevTools MCP連携)
  • .claude/commands/debug-diff.md — 2環境間のページ比較デバッグ(archaeologist / filematch連携)

Cursor

  • .cursor/mcp.json — chrome-devtools MCPサーバー定義
  • CursorはCLAUDE.mdをサードパーティルールとして自動読み取りするため .cursor/rules/ は不要
  • Cursorは .claude/commands/ をスラッシュコマンドとして認識するため .cursor/commands/ は不要

セキュリティ

  • chrome-devtools-mcp を devDependencies にバージョン固定(0.21.0)で追加し、MCP設定から @latest を削除

その他

  • cspell.json / package.json.claude/ ディレクトリのlint対応
  • README.md — AIコマンド一覧を追記

Note

Medium Risk
Medium risk because it changes the scaffolded project output and developer tooling configuration (permissions, MCP servers, lint/format patterns) and introduces a new devDependency (chrome-devtools-mcp), which could impact generated repos’ tooling behavior.

Overview
Adds a Claude Code/Cursor AI environment to the @d-zero/scaffold template: new CLAUDE.md, .claude/settings.json, .claude/commands/* (git/release/fix/debug workflows), and MCP server configs via .mcp.json and .cursor/mcp.json.

Updates tooling to accommodate the new .claude/ directory (cspell ignore paths, prettier target globs) and pins/introduces chrome-devtools-mcp@0.21.0 in devDependencies (+ lockfile).

Adjusts @d-zero/create-frontend CLI tests to expect these new scaffolded files for npx, static, and basercms4 outputs.

Written by Cursor Bugbot for commit f61a565. Configure here.

yusasa16
yusasa16 previously approved these changes Apr 2, 2026
dz-furukawa
dz-furukawa previously approved these changes Apr 2, 2026
Copy link
Copy Markdown

@cursor cursor bot left a comment

Choose a reason for hiding this comment

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

Cursor Bugbot has reviewed your changes and found 3 potential issues.

Fix All in Cursor

Bugbot Autofix prepared fixes for all 3 issues found in the latest run.

  • ✅ Fixed: Missing emulate permission in MCP allow list
    • Added mcp__chrome-devtools__emulate to the allow list to enable responsive viewport testing as required by fix-component.md command.
  • ✅ Fixed: Incorrect colon syntax in gh CLI permission patterns
    • Changed gh CLI patterns from colon syntax (gh repo list:*) to space syntax (gh repo list *) to match actual gh command structure.
  • ✅ Fixed: Deny rules for sed and npm use ineffective colon syntax
    • Changed sed and npm deny patterns from colon syntax to space syntax (sed *, npm *) to properly block these commands.

Create PR

Or push these changes by commenting:

@cursor push aa191535b7
Preview (aa191535b7)
diff --git a/packages/@d-zero/scaffold/.claude/settings.json b/packages/@d-zero/scaffold/.claude/settings.json
--- a/packages/@d-zero/scaffold/.claude/settings.json
+++ b/packages/@d-zero/scaffold/.claude/settings.json
@@ -1,23 +1,24 @@
 {
 	"permissions": {
 		"allow": [
-			"Bash(yarn build:*)",
-			"Bash(yarn install)",
-			"Bash(yarn lint:*)",
-			"Bash(yarn test:*)",
-			"Bash(gh repo list:*)",
-			"Bash(gh repo view:*)",
-			"Bash(gh repo gitignore:*)",
-			"Bash(gh repo license:*)",
-			"mcp__chrome-devtools__click",
-			"mcp__chrome-devtools__evaluate_script",
-			"mcp__chrome-devtools__list_console_messages",
-			"mcp__chrome-devtools__list_pages",
-			"mcp__chrome-devtools__navigate_page",
-			"mcp__chrome-devtools__new_page",
-			"mcp__chrome-devtools__take_screenshot",
-			"mcp__chrome-devtools__take_snapshot",
-			"mcp__chrome-devtools__wait_for",
+		"Bash(yarn build:*)",
+		"Bash(yarn install)",
+		"Bash(yarn lint:*)",
+		"Bash(yarn test:*)",
+		"Bash(gh repo list *)",
+		"Bash(gh repo view *)",
+		"Bash(gh repo gitignore *)",
+		"Bash(gh repo license *)",
+		"mcp__chrome-devtools__click",
+		"mcp__chrome-devtools__emulate",
+		"mcp__chrome-devtools__evaluate_script",
+		"mcp__chrome-devtools__list_console_messages",
+		"mcp__chrome-devtools__list_pages",
+		"mcp__chrome-devtools__navigate_page",
+		"mcp__chrome-devtools__new_page",
+		"mcp__chrome-devtools__take_screenshot",
+		"mcp__chrome-devtools__take_snapshot",
+		"mcp__chrome-devtools__wait_for",
 			"Skill(git)",
 			"WebFetch(domain:github.com)",
 			"WebFetch(domain:guidelines.d-zero.co.jp)",
@@ -27,8 +28,8 @@
 			"Bash(rm --force)",
 			"Bash(rm -rf)",
 			"Bash(rm -f)",
-			"Bash(sed:*)",
-			"Bash(npm:*)"
+			"Bash(sed *)",
+			"Bash(npm *)"
 		]
 	},
 	"enabledMcpjsonServers": ["chrome-devtools", "figma-remote-mcp"]

This Bugbot Autofix run was free. To enable autofix for future PRs, go to the Cursor dashboard.

Comment thread packages/@d-zero/scaffold/.claude/settings.json
Comment thread packages/@d-zero/scaffold/.claude/settings.json Outdated
Comment thread packages/@d-zero/scaffold/.claude/settings.json Outdated
…ulate tool

- Replace deprecated `:*` suffix with ` *` in Bash permission patterns
- Add missing mcp__chrome-devtools__emulate to allow list

SEE: https://code.claude.com/docs/en/permissions.md
@YusukeHirao
Copy link
Copy Markdown
Member Author

YusukeHirao commented Apr 6, 2026

Cursor Bugbotの指摘修正済み

@YusukeHirao YusukeHirao merged commit 482b27c into dev Apr 7, 2026
1 check passed
@YusukeHirao YusukeHirao deleted the ai-settings branch April 7, 2026 01:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants