Add agent bootstrap hook and consolidate instructions into AGENTS.md#373
Open
kraenhansen wants to merge 5 commits into
Open
Add agent bootstrap hook and consolidate instructions into AGENTS.md#373kraenhansen wants to merge 5 commits into
kraenhansen wants to merge 5 commits into
Conversation
Add a SessionStart hook and settings so Claude Code on the web workers install and build the repo automatically, plus a CLAUDE.md that points at the existing shared instructions and documents environment specifics. - .claude/hooks/session-start.sh: selects Node 24 via nvm (required by devEngines), runs npm install and npm run build; remote-only and idempotent - .claude/settings.json: registers the SessionStart hook - CLAUDE.md: imports .github/copilot-instructions.md and documents bootstrap, common commands, and that native iOS/Android builds need mobile SDKs Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01NvxEaPhyEq2HCZ6XFjEAde
Promote the tool-agnostic instructions to a top-level AGENTS.md (the general cross-agent standard) and add environment/bootstrap notes. CLAUDE.md now imports AGENTS.md, and .github/copilot-instructions.md redirects to it so the content has a single source of truth. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01NvxEaPhyEq2HCZ6XFjEAde
Agents pick up nested AGENTS.md files in subdirectories, so align the package-level instructions with the same convention as the root. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01NvxEaPhyEq2HCZ6XFjEAde
Add a .nvmrc set to lts/krypton (matching CI's setup-node) and have the SessionStart hook run `nvm install`/`nvm use` without a version argument so the pinned version is the single source of truth. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01NvxEaPhyEq2HCZ6XFjEAde
CI resolved Rust dependencies fresh on every run because Cargo.lock was gitignored (a leftover from the initial `cargo new --lib` scaffolding in #43 — the stock library-crate convention). That let `napi-derive-backend` float to 5.1.2, which expands the `#[napi]` attribute macro into a broken `ctor` `unify_features` invocation ("expected `(`, found `]`"), failing the bootstrap build of every CI job that compiles ferric-example. ferric-example is a `crate-type = ["cdylib"]` that builds a final `.node` artifact, not a library published to crates.io, so committing Cargo.lock is the recommended practice — the direct analogue of package-lock.json. The committed lock pins napi-derive-backend 5.0.2 (last known-good). Verified with `cargo build --locked`. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> (cherry picked from commit 050464b)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Sets this repo up so AI coding agents (Claude Code on the web in particular) can install and bootstrap a fresh worker automatically, and consolidates the tool-agnostic instructions under the general
AGENTS.mdconvention.Changes
Worker bootstrap
.claude/hooks/session-start.sh— aSessionStarthook that selects Node.js 24 vianvm(required bypackage.json'sdevEngines; workers default to Node 22, which npm rejects), then runsnpm installandnpm run build. It's remote-only (guarded by$CLAUDE_CODE_REMOTE), idempotent, non-interactive, and persists the Node 24 toolchain ontoPATHvia$CLAUDE_ENV_FILE..claude/settings.json— registers the hook.Instructions consolidation
AGENTS.md(new, top-level) — canonical, tool-agnostic agent instructions. Carries the former Copilot content plus a new "Environment & Bootstrap" section (Node 24 requirement, install/build steps, and why native iOS/Android builds are intentionally excluded — they need the Android NDK / Apple toolchains absent on a generic Linux worker)..github/copilot-instructions.md— slimmed to a redirect atAGENTS.md, keeping the conventional Copilot path working with a single source of truth.packages/cmake-file-api/copilot-instructions.md→packages/cmake-file-api/AGENTS.md— package-level instructions renamed to the same convention (agents pick up nestedAGENTS.mdfiles).CLAUDE.md(new) — thin file that imports@AGENTS.mdand documents the webSessionStarthook.Design notes
AGENTS.md, the bootstrap is a plain shell script, andCLAUDE.mdonly holds what's genuinely Claude-web-specific.npx ferric --apple) for when the right SDK is available.Validation
PATHfirst): installs Node 24.18.0 / npm 11.16.0, installs deps, builds cleanly (exit 0). Non-remote guard verified as a clean no-op.eslintruns clean on the Node tooling packages under Node 24.npm test --workspace gyp-to-cmakepasses (20/20).After merging into the default branch, all future Claude Code web sessions on this repo will use the hook.
🤖 Generated with Claude Code
https://claude.ai/code/session_01NvxEaPhyEq2HCZ6XFjEAde
Generated by Claude Code