diff --git a/.claude/bootstrap.sh b/.claude/bootstrap.sh new file mode 100644 index 0000000..4d5a421 --- /dev/null +++ b/.claude/bootstrap.sh @@ -0,0 +1,12 @@ +#!/bin/sh +# Idempotent dev-tooling bootstrap for Makefile-based (shell/python) repos. +# Installs the pip-installable lint tools `make check` needs so it works in a cloud session. +# (ShellCheck itself is usually pre-installed in the web sandbox.) No-op once ruff is present. +dir="${CLAUDE_PROJECT_DIR:-$(cd "$(dirname "$0")/.." && pwd)}" +cd "$dir" || exit 0 + +if [ -f Makefile ] && ! command -v ruff >/dev/null 2>&1; then + pip install --quiet ruff codespell 2>/dev/null || true +fi + +exit 0 diff --git a/.claude/settings.json b/.claude/settings.json new file mode 100644 index 0000000..a844622 --- /dev/null +++ b/.claude/settings.json @@ -0,0 +1,15 @@ +{ + "hooks": { + "SessionStart": [ + { + "matcher": "startup|resume", + "hooks": [ + { + "type": "command", + "command": "sh \"$CLAUDE_PROJECT_DIR/.claude/bootstrap.sh\"" + } + ] + } + ] + } +} diff --git a/.claude/skills/run-checks/SKILL.md b/.claude/skills/run-checks/SKILL.md new file mode 100644 index 0000000..3e66b51 --- /dev/null +++ b/.claude/skills/run-checks/SKILL.md @@ -0,0 +1,11 @@ +--- +name: run-checks +description: Run agmsg-kit's checks (smoke roundtrip, safety, shell lint). Use when asked to test, lint, verify, or check the installer/patches. +--- + +Run the repo checks and report results concisely. + +1. Ensure lint tools are present (SessionStart bootstrap pip-installs `ruff`+`codespell`; `shellcheck` is usually pre-installed on web). +2. Targets: `make test` (smoke roundtrip + patch regressions), `make safety` (secret_redact + SQL-escaping/suggest regressions), `make check` (= lint + test + safety). Patch integrity: `make verify-patches`. +3. Summarize: which target passed/failed and the first failing assertion/file per failure. +4. Do not edit scripts or patches unless asked; the upstream pin + patch set are load-bearing. diff --git a/README.md b/README.md index 2d64cfc..e81236a 100644 --- a/README.md +++ b/README.md @@ -68,3 +68,12 @@ the chain. See `docs/GOVERNANCE.md` and `SECURITY.md`. MIT. Upstream agmsg (MIT) is fetched at install time at the pinned commit in `VENDORED.md`, not redistributed here. + +## Claude Code で使う (web / cloud 対応) + +このリポジトリは **Claude Code on the web** に対応しています。 + +- lint ツール(ruff/codespell)は `.claude/bootstrap.sh`(SessionStart)が pip で自動インストール。`make test`(smoke roundtrip)は追加依存なし。 +- クラウドセッションは `AGENTS.md` と `.claude/skills/`(例: `run-checks`)を自動ロード。 +- MCP は本リポジトリではローカル専用。詳細は + [`.github/docs/claude-code-web-readiness.md`](https://github.com/thinkyou0714/.github/blob/main/docs/claude-code-web-readiness.md)。