Add AGENT.md, CLAUDE.md symlink, and pre-push git hook#156
Add AGENT.md, CLAUDE.md symlink, and pre-push git hook#156simianhacker wants to merge 4 commits intoelastic:mainfrom
Conversation
- AGENT.md: comprehensive agent guide covering architecture, data flow, verification commands, test conventions, code style, language system, common patterns, and gotchas - CLAUDE.md: symlink to AGENT.md - .husky/pre-push: new hook running build/test/lint/format:check as a safety net to block broken pushes - .husky/pre-commit: add format:check to existing hook
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yml Review profile: ASSERTIVE Plan: Pro Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthroughThis change updates Git hooks and adds documentation and ignore rules. The pre-commit hook now runs 🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. 📝 Coding Plan
Comment |
There was a problem hiding this comment.
Actionable comments posted: 2
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yml
Review profile: ASSERTIVE
Plan: Pro
Run ID: ed4add8c-69fe-4746-8d89-299eb7194739
📒 Files selected for processing (4)
.husky/pre-commit.husky/pre-pushAGENT.mdCLAUDE.md
There was a problem hiding this comment.
Pull request overview
Adds an agent-oriented guide for working in the Semantic Code Search Indexer repo and strengthens local safety checks by expanding Husky hooks to include formatting checks and a new pre-push gate.
Changes:
- Added
AGENT.mddocumenting architecture, verification commands, test conventions, formatting/linting rules, and operational gotchas. - Added
CLAUDE.mdas a symlink toAGENT.mdfor Claude Code compatibility. - Updated Husky hooks: pre-commit now includes
format:check, and added a new pre-push hook runningbuild → test → lint → format:check.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
| AGENT.md | New agent guide documenting repo architecture, workflows, and conventions |
| CLAUDE.md | Symlink to agent guide (Claude convention) |
| .husky/pre-push | New hook to block pushes when build/tests/lint/format checks fail |
| .husky/pre-commit | Adds format:check to existing pre-commit verification |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
- Add 'text' language specifier to architecture code block (CodeRabbit) - Add blank line before logging code block (CodeRabbit) - Fix Husky bypass wording to include HUSKY=0 (Copilot) - Fix .prettierrc → .prettierrc.json filename (Copilot) - Fix scaffold command to use actual scaffold-language CLI (Copilot)
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 4 out of 5 changed files in this pull request and generated 2 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| @@ -0,0 +1,5 @@ | |||
| #!/usr/bin/env sh | |||
| . "$(dirname -- "$0")/_/husky.sh" | |||
There was a problem hiding this comment.
Both hooks source .husky/_/husky.sh, but that file/directory doesn't exist in the repo right now. This causes a "not found" error on every hook run and also means Husky features like HUSKY=0 bypass may not work. Please either commit Husky’s ./.husky/_/husky.sh (and related files) or remove the sourcing line and implement the needed bypass logic directly in the hook scripts.
| . "$(dirname -- "$0")/_/husky.sh" | |
| # Allow bypassing this hook by setting HUSKY=0, similar to husky.sh | |
| if [ "${HUSKY:-1}" = "0" ]; then | |
| exit 0 | |
| fi |
| . "$(dirname -- "$0")/_/husky.sh" | ||
|
|
There was a problem hiding this comment.
This hook sources .husky/_/husky.sh, but that path isn’t present in the repository. This will emit a shell error on every commit and may break HUSKY=0 bypass behavior. Consider committing the Husky ./.husky/_ helper files or inlining the minimal logic (including honoring HUSKY=0) and removing the source line.
| . "$(dirname -- "$0")/_/husky.sh" | |
| # Honor Husky's HUSKY=0 bypass: skip the hook when explicitly disabled. | |
| if [ "${HUSKY-}" = "0" ]; then | |
| exit 0 | |
| fi | |
| # Run from the repository root when possible, for consistent behavior. | |
| if command -v git >/dev/null 2>&1; then | |
| cd -- "$(git rev-parse --show-toplevel)" || exit 0 | |
| fi |
There was a problem hiding this comment.
should be AGENTS.md instead of AGENT.md
maybe this is the reason sonnet is not listening
| ## Git Hooks (Husky) | ||
|
|
||
| > **🚨 CRITICAL: NEVER bypass Husky hooks.** Do not use `--no-verify`, `HUSKY=0`, or any | ||
| > other mechanism to skip hooks. No exceptions. If a hook fails, **fix the issue** — do not | ||
| > work around the hook. Broken code must never be committed or pushed. This is a hard rule. | ||
|
|
||
| Two hooks gate every commit and push: | ||
|
|
||
| | Hook | Runs | Purpose | | ||
| |------|------|---------| | ||
| | **pre-commit** | `build → test → lint → format:check` | Catches errors before they enter history | | ||
| | **pre-push** | `build → test → lint → format:check` | Safety net — blocks pushes even if commit hooks were skipped | | ||
|
|
||
| Both hooks run the same four checks. If any step fails, the operation is aborted. |
There was a problem hiding this comment.
I think this is better in personal agent hooks actually enforced for dumb models
There was a problem hiding this comment.
also honestly I'd remove almost all overview/architectural guidance everything. Almost all of it is inferrable by agent. I would only leave a couple of commands and instructions when to use them that's it ultra thin.
And the overview thing we can add a marble diagram to compress the data for agents.
Wdyt?
Summary
Adds comprehensive agent documentation and strengthens the git hook safety net.
Changes
AGENT.md— Comprehensive guide for AI coding agents covering:CLAUDE.md— Symlink toAGENT.md(Claude Code convention).husky/pre-push— New hook runningbuild → test → lint → format:checkas a safety net to block broken pushes, even if pre-commit was bypassed with--no-verify.husky/pre-commit— Addedformat:checkto the existing hook (was previously missing formatting verification)