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
12 changes: 12 additions & 0 deletions .claude/bootstrap.sh
Original file line number Diff line number Diff line change
@@ -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

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Gate bootstrap installs to cloud sessions

This committed SessionStart hook also runs when someone opens the repo in a local Claude Code session, not just in Claude Code on the web. In a local checkout that has a Makefile but no ruff, this line silently runs pip install ruff codespell against whatever pip points at, mutating the developer's machine even though the new README frames the bootstrap as web/cloud readiness; add a CLAUDE_CODE_REMOTE=true guard or move this install to cloud setup.

Useful? React with 👍 / 👎.

Comment on lines +8 to +9

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Install shellcheck instead of keying off ruff

In environments where ruff is already present but shellcheck is not, this condition skips the only install step even though make check still fails in make lint because the Makefile invokes shellcheck directly and does not use ruff or codespell. The target web image documents ruff as preinstalled, so this bootstrap can leave the advertised /run-checks path broken; key the bootstrap on shellcheck and install that binary (or shellcheck-py) instead.

Useful? React with 👍 / 👎.

fi

exit 0
15 changes: 15 additions & 0 deletions .claude/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
"hooks": {
"SessionStart": [
{
"matcher": "startup|resume",
"hooks": [
{
"type": "command",
"command": "sh \"$CLAUDE_PROJECT_DIR/.claude/bootstrap.sh\""
}
]
}
]
}
}
11 changes: 11 additions & 0 deletions .claude/skills/run-checks/SKILL.md
Original file line number Diff line number Diff line change
@@ -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.
9 changes: 9 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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`)を自動ロード。

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Load AGENTS.md through CLAUDE.md

In Claude Code cloud sessions this line won't actually load the repo instructions: the current Claude Code memory docs state that Claude Code reads CLAUDE.md, not AGENTS.md, and this repo has no CLAUDE.md importing @AGENTS.md (checked with rg --files). As a result web sessions miss the repo's hard rules/build commands while the README says they are automatically loaded; add a CLAUDE.md import or change the claim.

Useful? React with 👍 / 👎.

- MCP は本リポジトリではローカル専用。詳細は
[`.github/docs/claude-code-web-readiness.md`](https://github.com/thinkyou0714/.github/blob/main/docs/claude-code-web-readiness.md)。
Loading