# agent-scripts — Shared Guardrail Scripts for Agents > Shared guardrail scripts and AGENTS rules you can sync across repos, including skill validation hooks and portable helpers for onboarding. ## Install Save the content below to `.claude/skills/` or append to your `CLAUDE.md`: ## Quick Use 1. Clone the repo: ```bash git clone https://github.com/steipete/agent-scripts ``` 2. Enable the tracked git hooks (runs skill validation on commit): ```bash cd agent-scripts git config core.hooksPath hooks ``` 3. Rebuild the compiled docs lister (requires Bun): ```bash bun build scripts/docs-list.ts --compile --outfile bin/docs-list ``` ## Intro Shared guardrail scripts and AGENTS rules you can sync across repos, including skill validation hooks and portable helpers for onboarding. - **Best for:** teams who want consistent guardrails across many repos: rules, validators, and helper scripts that stay byte-identical - **Works with:** git hooks, Bun/Node tooling (for some helpers), any repo that adopts pointer-style AGENTS - **Setup time:** 20–40 minutes ## Practical Notes - Quant: track how many repos adopt the pointer-style `AGENTS.MD` line; the goal is 1 shared source of truth, not copy/paste drift. - Quant: run the validator on every commit and measure “skills failing lint” rate over time (it should trend down). --- ## Why pointer-style AGENTS beats copy/paste Copying guardrails into every repo guarantees divergence. Pointer-style rules give you: - One canonical shared rule set. - Fast updates across the fleet. - Clear “local overrides” when a repo truly needs them. ## How to introduce safely 1. Start with one pilot repo. 2. Add the pointer line at the top of `AGENTS.MD`. 3. Keep repo-specific notes below it. ## Maintenance habit When a guardrail changes, update it once here, then roll it out like any dependency update: changelog + verification run. ### FAQ **Q: Is this only useful for one author’s repos?** A: The pattern generalizes well: shared scripts + shared rules are valuable in any multi-repo team. **Q: Do I need Bun?** A: Only for rebuilding certain compiled helpers; the guardrail text and hooks can still be used without it. **Q: What is the biggest failure mode?** A: Breaking changes to shared rules without a rollout plan—treat updates like dependency upgrades. ## Source & Thanks > Source: https://github.com/steipete/agent-scripts > License: MIT > GitHub stars: 2,546 · forks: 253 --- ## 快速使用 1. 克隆仓库: ```bash git clone https://github.com/steipete/agent-scripts ``` 2. 启用仓库自带 hooks(提交前会做 skill 校验): ```bash cd agent-scripts git config core.hooksPath hooks ``` 3. 重新构建编译版 docs lister(需要 Bun): ```bash bun build scripts/docs-list.ts --compile --outfile bin/docs-list ``` ## 简介 可在多个仓库同步复用的 Agent 护栏脚本与 AGENTS 规则:包含技能校验 hook、提交辅助脚本、文档索引工具等,适合把团队默认规范固化成可执行资产,并用指针式 AGENTS 保持一致。 - **适合谁:** 希望在多个仓库里共享一致护栏(规则/校验器/辅助脚本),并保持字节级一致的团队 - **可搭配:** git hooks、Bun/Node 工具(部分脚本需要)、采用指针式 AGENTS 的任意仓库 - **准备时间:** 20–40 分钟 ## 实战建议 - 量化建议:统计有多少仓库采用指针式 `AGENTS.MD`;目标是单一事实来源,而不是复制粘贴漂移。 - 量化建议:每次提交都跑 validator,记录“skill 校验失败率”的趋势(应逐步下降)。 ## 为什么指针式 AGENTS 更靠谱 把护栏复制到每个仓库,迟早会分叉。 指针式规则的好处是: - 共享规则只有一个“权威来源”。 - 全局更新快,且更容易回滚。 - 仓库确实需要个性化时,也能清晰地写在指针下方。 ## 安全落地方式 1. 先选一个试点仓库。 2. 在 `AGENTS.MD` 顶部加入指针行。 3. 仓库特有规则放在指针行之后。 ## 维护习惯 护栏变更只在这里改一次,然后像升级依赖一样推广:写变更点、做一次验证回放。 ### FAQ **这是只适合个人仓库的做法吗?** 答:不是。多仓库团队普遍需要共享脚本与共享规则;这种模式可泛化复用。 **必须装 Bun 吗?** 答:只有在需要重新构建编译版工具时才需要;规则文本与 hooks 仍可独立使用。 **最容易踩的坑是什么?** 答:共享规则改了却没有推广/回滚计划;更新应像依赖升级一样管理。 ## 来源与感谢 > Source: https://github.com/steipete/agent-scripts > License: MIT > GitHub stars: 2,546 · forks: 253 --- Source: https://tokrepo.com/en/workflows/agent-scripts-shared-guardrail-scripts-for-agents Author: Script Depot