Agent Rules Sync
Agent Buildingagent-rules-syncAgent Rules Sync is an Agent Skill for agent building published in the ryfineZ/my-ai-skills repository on GitHub: a SKILL.md instruction file an AI agent can load to do this task.
统一多平台全局规则管理(AGENTS/CLAUDE/GEMINI)。触发语义包含“新增一条全局规则”“新增全局规则”“把这句话写入全局规则”等明确写入指令;用于新增/修改规则并同步到 Claude/Codex/Gemini/Antigravity。若是讨论性提问(如“要不要写入全局规则?”)则不触发。
QUICK START
How to use this skill
Bring this guide into your coding agent with a prompt tailored to the tool you use.
- Open your project in Codex.
- Copy and paste the prompt below.
- Review files and risks before approving any action.
Prompt to paste
Inspect the Agent Skill at https://github.com/ryfineZ/my-ai-skills/blob/HEAD/packages/core/agent-rules-sync/SKILL.md and all supporting files. Report provenance, permissions, scripts, dependencies, and security risks. Propose an exact installation into .agents/skills/agent-rules-sync, but wait for my approval before writing files or running scripts.
Copying this prompt does not install or run the skill. Review third-party files before use.
Agent Rules Sync
Scope
本技能仅用于同步/生成/链接多平台全局规则文件,不处理一次性初始化工作。
When to use
- 用户请求新增/修改全局规则并同步到多平台
- 用户要求重新生成各平台规则文件
- 修复或重建全局规则文件的软链接
Trigger Examples
触发示例:
- “新增一条全局规则:每天先检查 git status”
- “新增全局规则:回复尽量简短”
- “把这句话写入全局规则:禁止提交敏感信息”
不触发(讨论性):
- “要不要把这条规则写入全局规则?”
- “我需要把这条规则写入全局规则吗?”
Rules Hub
- 位置:
~/Workspace/agent-rules - 通用规则:
AGENTS.md - 平台覆写:
agents/claude.mdagents/codex.mdagents/gemini.mdagents/antigravity.md
- 生成产物:
generated/CLAUDE.mdgenerated/AGENTS.mdgenerated/GEMINI.md
Workflow
- 更新通用规则或平台覆写文件(按用户要求)
- 运行
~/Workspace/agent-rules/scripts/sync.sh生成各平台规则文件 - 运行
~/Workspace/agent-rules/scripts/link.sh修复/创建软链接 - 可选:运行
agent-rules-sync/scripts/verify.sh验证当前状态
Compatibility Rules
- 通用规则中避免出现平台专用工具名或文件名
- 平台差异写入对应覆写文件
- Gemini 与 Antigravity 共用
~/.gemini/GEMINI.md
Notes
link.sh会为原文件创建带时间戳的.bak备份