docs: add git hook automation guide for apply#281
Conversation
|
Warning Rate limit exceeded
Your organization is not enrolled in usage-based pricing. Contact your admin to enable usage-based pricing to continue reviews beyond the rate limit, or try again in 3 minutes and 55 seconds. ⌛ How to resolve this issue?After the wait time has elapsed, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout. Please see our FAQ for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: Organization UI Review profile: ASSERTIVE Plan: Pro Run ID: ⛔ Files ignored due to path filters (1)
📒 Files selected for processing (2)
📝 WalkthroughWalkthroughAdds a new "Git Hook Automation" guide and cross-references across docs and READMEs; updates website sidebar, several docs, package manifests, and Changes
Estimated code review effort🎯 4 (Complex) | ⏱️ ~45 minutes Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@website/docs/src/content/docs/guides/gitignore-team-workflows.mdx`:
- Line 16: Replace the repetitive sentence that begins with three "For ..."
phrases by combining the links into one smoother sentence: e.g., "See the
configuration reference (field-by-field details), the CLI reference (command
semantics), and Git Hook Automation (hook-manager and native Git hook examples)
for more information." Update the sentence in the gitignore-team-workflows.mdx
content where the triple "For field-by-field details, ... For command semantics,
... For hook-manager ..." appears so it reads as a single, concise sentence
referencing the three links.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: ASSERTIVE
Plan: Pro
Run ID: 012eaff4-24b8-4455-8818-f7783b44871b
📒 Files selected for processing (7)
README.mdnpm/agentsync/README.mdwebsite/docs/astro.config.mjswebsite/docs/src/content/docs/guides/getting-started.mdxwebsite/docs/src/content/docs/guides/git-hook-automation.mdxwebsite/docs/src/content/docs/guides/gitignore-team-workflows.mdxwebsite/docs/src/content/docs/reference/cli.mdx
website/docs/src/content/docs/guides/gitignore-team-workflows.mdx
Outdated
Show resolved
Hide resolved
|
There was a problem hiding this comment.
Actionable comments posted: 3
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In @.agents/agentsync.toml:
- Around line 207-209: The mcp_servers.filesystem entry currently runs npx with
the unpinned package name "@modelcontextprotocol/server-filesystem"; update the
args array so the package is pinned to a tested version (e.g., change
"@modelcontextprotocol/server-filesystem" to
"@modelcontextprotocol/server-filesystem@<version>") so npx installs a fixed
release; locate the mcp_servers.filesystem block (the command "npx" and its
args) and replace the package string with the chosen semver or date-based tag.
In `@npm/agentsync/package.json`:
- Line 47: The devDependency "@types/node" in package.json is set to "^25.5.0"
but engines.node declares ">=18"; change the "@types/node" entry under
devDependencies to the matching minimum major (e.g., "^18.0.0") or alternatively
raise engines.node to match the types major (e.g., ">=25") so the TypeScript
types align with the supported runtime; update the package.json devDependencies
"@types/node" line and/or the "engines.node" field accordingly and run npm
install to refresh lock files.
In `@pnpm-workspace.yaml`:
- Line 6: Update the cataloged CLI version for `@dallay/agentsync` in
pnpm-workspace.yaml to match the workspace package (change the listed version
from 1.35.0 to 1.35.2), ensuring it aligns with npm/agentsync/package.json's
catalog entry; after changing the version, run your package manager (pnpm
install) to refresh the workspace lockfiles so pnpm exec uses the updated CLI.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: ASSERTIVE
Plan: Pro
Run ID: 05267b1c-39d7-4553-8d2f-49cf65755367
⛔ Files ignored due to path filters (1)
pnpm-lock.yamlis excluded by!**/pnpm-lock.yaml
📒 Files selected for processing (6)
.agents/agentsync.tomlnpm/agentsync/package.jsonpackage.jsonpnpm-workspace.yamlwebsite/docs/package.jsonwebsite/docs/src/content/docs/guides/gitignore-team-workflows.mdx
| [mcp_servers.filesystem] | ||
| command = "npx" | ||
| args = ["-y", "@modelcontextprotocol/server-filesystem", "."] No newline at end of file |
There was a problem hiding this comment.
🧹 Nitpick | 🔵 Trivial
🧩 Analysis chain
🌐 Web query:
Does npx -y @modelcontextprotocol/server-filesystem`` run the latest published version when no @Version is specified, and what is the recommended way to pin a specific version in a committed configuration file?
💡 Result:
Yes, npx -y @modelcontextprotocol/server-filesystem runs the latest published version of the package when no version specifier (like @version or @latest) is provided. npx resolves bare package names (without @) to the latest version available on the npm registry by default, installing a temporary copy if necessary. The -y flag bypasses the installation confirmation prompt. The recommended way to pin a specific version in a committed configuration file (such as .vscode/mcp.json, ~/.cursor/mcp.json, or similar MCP client configs) is to append the version specifier directly to the package name in the args array, e.g.: { "mcpServers": { "filesystem": { "command": "npx", "args": [ "-y", "@modelcontextprotocol/server-filesystem@2026.1.14", "/path/to/allowed/dir" ] } } } This uses standard npm package specifiers (@, @latest, etc.), ensuring reproducible builds across environments. Official package docs and MCP examples consistently show bare package names for latest usage and support version pinning this way.
Citations:
- 1: https://www.npmjs.com/package/@modelcontextprotocol/server-filesystem
- 2: https://registry.npmjs.org/%40modelcontextprotocol%2Fserver-filesystem
- 3: https://www.npmjs.com/package/npx?activeTab=versions
- 4: https://www.npmjs.com/package/npx
- 5: http://www.npmjs.cn/cli/v11/commands/npx
- 6: https://docs.npmjs.com/cli/v7/commands/npx
Pin the MCP server package version in the committed configuration.
Line 209 references @modelcontextprotocol/server-filesystem without a version specifier. This causes npx to always fetch the latest published version, creating drift in contributor setups and supply-chain instability. Pin a tested version directly in the package name using standard npm notation.
Suggested change
-args = ["-y", "@modelcontextprotocol/server-filesystem", "."]
+args = ["-y", "@modelcontextprotocol/server-filesystem@<tested-version>", "."]Example: @modelcontextprotocol/server-filesystem@2026.1.14
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.
In @.agents/agentsync.toml around lines 207 - 209, The mcp_servers.filesystem
entry currently runs npx with the unpinned package name
"@modelcontextprotocol/server-filesystem"; update the args array so the package
is pinned to a tested version (e.g., change
"@modelcontextprotocol/server-filesystem" to
"@modelcontextprotocol/server-filesystem@<version>") so npx installs a fixed
release; locate the mcp_servers.filesystem block (the command "npx" and its
args) and replace the package string with the chosen semver or date-based tag.
| }, | ||
| "devDependencies": { | ||
| "@types/node": "^24.1.0", | ||
| "@types/node": "^25.5.0", |
There was a problem hiding this comment.
🧩 Analysis chain
🏁 Script executed:
#!/bin/bash
set -euo pipefail
python - <<'PY'
import json
import pathlib
import re
pkg = json.loads(pathlib.Path("npm/agentsync/package.json").read_text())
engine = pkg["engines"]["node"]
types = pkg["devDependencies"]["@types/node"]
engine_floor_major = int(re.search(r"(\d+)", engine).group(1))
types_major = int(re.search(r"(\d+)", types).group(1))
print({
"engines.node": engine,
"engine_floor_major": engine_floor_major,
"@types/node": types,
"@types/node_major": types_major,
"types_exceed_engine_floor": types_major > engine_floor_major,
})
PYRepository: dallay/agentsync
Length of output: 196
Align @types/node with the minimum supported Node runtime version.
The @types/node version is ^25.5.0 while engines.node specifies >=18. This 7-version gap means Node 25 APIs will pass type-checking even though they are unavailable in Node 18, which is still a supported runtime. Align the types package to the minimum supported major version (18) or raise the engine floor accordingly.
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.
In `@npm/agentsync/package.json` at line 47, The devDependency "@types/node" in
package.json is set to "^25.5.0" but engines.node declares ">=18"; change the
"@types/node" entry under devDependencies to the matching minimum major (e.g.,
"^18.0.0") or alternatively raise engines.node to match the types major (e.g.,
">=25") so the TypeScript types align with the supported runtime; update the
package.json devDependencies "@types/node" line and/or the "engines.node" field
accordingly and run npm install to refresh lock files.
|
|
||
| catalog: | ||
| '@dallay/agentsync': 1.34.0 | ||
| '@dallay/agentsync': 1.35.0 |
There was a problem hiding this comment.
🧩 Analysis chain
🏁 Script executed:
#!/bin/bash
set -euo pipefail
python - <<'PY'
import json
import pathlib
import re
catalog_text = pathlib.Path("pnpm-workspace.yaml").read_text()
catalog_version = re.search(r"['\"]@dallay/agentsync['\"]:\s*([0-9.]+)", catalog_text).group(1)
root_pkg = json.loads(pathlib.Path("package.json").read_text())
workspace_pkg = json.loads(pathlib.Path("npm/agentsync/package.json").read_text())
print({
"root_dependency_spec": root_pkg["devDependencies"]["@dallay/agentsync"],
"catalog_version": catalog_version,
"workspace_package_version": workspace_pkg["version"],
"catalog_matches_workspace_package": catalog_version == workspace_pkg["version"],
})
PYRepository: dallay/agentsync
Length of output: 208
Align the cataloged CLI version with the workspace package.
package.json resolves @dallay/agentsync through catalog:, but Line 6 leaves repo-level scripts on 1.35.0 while npm/agentsync/package.json is already 1.35.2. This means pnpm exec agentsync ... runs an older CLI than the one defined in the workspace.
Suggested fix
- '@dallay/agentsync': 1.35.0
+ '@dallay/agentsync': 1.35.2📝 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.
| '@dallay/agentsync': 1.35.0 | |
| '@dallay/agentsync': 1.35.2 |
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.
In `@pnpm-workspace.yaml` at line 6, Update the cataloged CLI version for
`@dallay/agentsync` in pnpm-workspace.yaml to match the workspace package (change
the listed version from 1.35.0 to 1.35.2), ensuring it aligns with
npm/agentsync/package.json's catalog entry; after changing the version, run your
package manager (pnpm install) to refresh the workspace lockfiles so pnpm exec
uses the updated CLI.



This pull request adds comprehensive documentation and guidance for automating
agentsync applyusing Git hooks and hook managers. The changes introduce a new "Git Hook Automation" guide, update existing documentation to reference this automation, and improve the discoverability of automation patterns for different team workflows.Documentation enhancements for automation:
git-hook-automation.mdx, detailing how to automateagentsync applywith various Git hook managers (Lefthook, Husky, simple-git-hooks) and native Git hooks, including copy-pasteable examples and best practices.astro.config.mjsto include the new "Git Hook Automation" guide, making it easily accessible from the docs sidebar.References and cross-links in existing docs:
README.md, npm package README, Getting Started guide, CLI reference, and Gitignore Team Workflows guide, ensuring users can find automation instructions from all relevant entry points. [1] [2] [3] [4] [5] [6] [7]These changes make it much easier for teams to discover and implement automation for
agentsync apply, improving onboarding and reducing manual steps across different Git workflows.Closes: #279