Skip to content
Merged
Show file tree
Hide file tree
Changes from all 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
21 changes: 17 additions & 4 deletions .claude/settings.local.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,26 @@
"Bash(git config:*)",
"Bash(gh auth:*)",
"Bash(brew bundle:*)",
"mcp__slack__slack_list_channels",
"mcp__slack__slack_post_message",
"mcp__filesystem__list_allowed_directories",
"Bash(claude config get:*)",
"Bash(bash:*)",
"Bash(./script/export.sh:*)"
],
"deny": []
},
"env": {
"CLAUDE_CODE_PROJECT_NAME": "keito4/config"
},
"hooks": {
"Stop": [
{
"matcher": "",
"hooks": [
{
"type": "command",
"command": "curl -X POST http://host.docker.internal:5678/webhook/notify -H \\\"Content-Type: application/json\\\" -d '{\\\"project_name\\\":\\\"keito4/config\\\",\\\"task_name\\\":\\\"${CLAUDE_TASK}\\\",\\\"request_detail\\\":\\\"${CLAUDE_REQUEST}\\\"}'"
}
]
}
Comment on lines +31 to +41

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

Quote-handling & injection risk in Stop-hook payload

${CLAUDE_TASK} and ${CLAUDE_REQUEST} are interpolated directly into a one-liner curl command.
If either variable contains double quotes, newlines, or shell metacharacters, the JSON becomes invalid or, worse, allows command injection once the string reaches a shell.

Safer pattern: build the JSON with jq -n (or printf) and pass it to curl via stdin; this removes the need for heavy escaping and prevents shell injection.

-            "command": "curl -X POST http://host.docker.internal:5678/webhook/notify -H \\\"Content-Type: application/json\\\" -d '{\\\"project_name\\\":\\\"keito4/config\\\",\\\"task_name\\\":\\\"${CLAUDE_TASK}\\\",\\\"request_detail\\\":\\\"${CLAUDE_REQUEST}\\\"}'"
+            "command": "jq -n --arg project \"${CLAUDE_CODE_PROJECT_NAME}\" --arg task \"${CLAUDE_TASK}\" --arg detail \"${CLAUDE_REQUEST}\" '{project_name:$project,task_name:$task,request_detail:$detail}' | curl -X POST -H \"Content-Type: application/json\" --data @- http://host.docker.internal:5678/webhook/notify"
📝 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
"hooks": {
"Stop": [
{
"matcher": "",
"hooks": [
{
"type": "command",
"command": "curl -X POST http://host.docker.internal:5678/webhook/notify -H \\\"Content-Type: application/json\\\" -d '{\\\"project_name\\\":\\\"keito4/config\\\",\\\"task_name\\\":\\\"${CLAUDE_TASK}\\\",\\\"request_detail\\\":\\\"${CLAUDE_REQUEST}\\\"}'"
}
]
}
"hooks": {
"Stop": [
{
"matcher": "",
"hooks": [
{
"type": "command",
"command": "jq -n --arg project \"${CLAUDE_CODE_PROJECT_NAME}\" --arg task \"${CLAUDE_TASK}\" --arg detail \"${CLAUDE_REQUEST}\" '{project_name:$project,task_name:$task,request_detail:$detail}' | curl -X POST -H \"Content-Type: application/json\" --data @- http://host.docker.internal:5678/webhook/notify"
}
]
}
🤖 Prompt for AI Agents
In .claude/settings.local.json around lines 31 to 41, the Stop-hook curl command
directly interpolates ${CLAUDE_TASK} and ${CLAUDE_REQUEST} into a JSON string,
risking invalid JSON or shell injection if these variables contain quotes or
special characters. To fix this, refactor the command to build the JSON payload
safely using a tool like jq -n or printf, then pass the JSON to curl via stdin
instead of embedding it inline. This avoids complex escaping and prevents
injection vulnerabilities.

]
}
}
}
4 changes: 3 additions & 1 deletion .devcontainer/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,9 @@ RUN echo "alias gco='git checkout'" >> /home/vscode/.bashrc \
RUN mkdir -p /home/vscode/.claude /home/vscode/.cursor \
&& chown -R vscode:vscode /home/vscode/.claude /home/vscode/.cursor

# Copy default Claude settings
COPY --chown=vscode:vscode .devcontainer/claude-settings.json /home/vscode/.claude/settings.json

# Change default shell to bash
RUN chsh -s /bin/bash vscode

Expand All @@ -48,5 +51,4 @@ RUN echo 'source ~/.bashrc' >> /home/vscode/.bash_profile \
# Husky用の設定
COPY package.json package-lock.json /tmp/
COPY .husky /tmp/.husky/
COPY commitlint.config.js /tmp/
RUN cd /tmp && npm ci && npm run prepare || true
45 changes: 45 additions & 0 deletions .devcontainer/claude-settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
{
"permissions": {
"allow": [
"Bash(ls:*)",
"Bash(cat:*)",
"Bash(find:*)",
"Bash(grep:*)",
"Bash(rg:*)",

"Bash(gh issue list:*)",
"Bash(gh issue view:*)",
"Bash(gh repo view:*)",

"Bash(kubectl get:*)",
"Bash(kubectl describe:*)",
"Bash(kubectl logs:*)",
"Bash(kubectl top:*)",
"Bash(kubectl wait:*)",
"Bash(kubectl rollout status:*)",

"Bash(helm list:*)",
"Bash(helm status:*)",

"Bash(gcloud container operations list:*)",

"Bash(DISPLAY=:99 xwininfo -root -tree)",
"Bash(DISPLAY=:99 xrandr)",

"Bash(supabase status:*)",
"Bash(claude config get:*)",
"Bash(git status:*)",
"Bash(git diff:*)",
"Bash(git add:*)",
"Bash(git commit:*)",
"Bash(git push:*)",

"WebFetch(domain:github.com)",
"WebFetch(domain:docs.n8n.io)",
"WebFetch(domain:community.n8n.io)",
"WebFetch(domain:raw.githubusercontent.com)",
"WebFetch(domain:www.green-japan.com)"
],
"deny": []
}
}
9 changes: 9 additions & 0 deletions commitlint.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
module.exports = {
extends: ['@commitlint/config-conventional'],
rules: {
'subject-case': [2, 'never', ['sentence-case', 'start-case', 'pascal-case', 'upper-case']],
'subject-empty': [2, 'never'],
'type-empty': [2, 'never'],
'scope-empty': [0]
}
};
2 changes: 1 addition & 1 deletion supabase/.temp/cli-latest
Original file line number Diff line number Diff line change
@@ -1 +1 @@
v2.31.4
v2.31.8