
rulesyncとagmsgの配信設定はどこで管理するかWhen using agmsg and rulesync together, running rulesync generate can silently…
匿名の公開いいねです。記事の保存・お気に入りではなく、Featured、Top 3、重要度、掲載順位には影響しません。仕組みとプライバシーAnonymous public likes are reactions, not saved articles or bookmarks. They do not affect Featured, Top 3, importance, or listing order.How it works and privacy
- agmsgで設定したエージェント間の配信設定が、rulesync generateの実行後に消える問題の原因と対策を解説。
- 両ツールが同じ設定ファイルを管理するため競合が起きる。
- When using agmsg and rulesync together, running rulesync generate can silently delete agmsg delivery settings because both tools manage overlapping config files.
- The article explains the conflict and how to resolve it.
本ページの本文と要約は AI による自動生成です。日本語版と英語版は言語ごとに独立して生成されるため、表現や詳しさが異なる場合があります。正確性は元記事 (zenn.dev) をご確認ください。The body and summaries are AI-generated independently for each language, so wording and detail may differ. Verify accuracy at the original source (zenn.dev).
要約と収集メタデータに基づく AI 解説。元記事全文の転載・翻訳ではありません。AI explainer based on the summaries and collected metadata, not a copy or translation of the full source article.
agmsgでエージェント間の配信を設定していても、rulesync generateの実行後に自動受信が止まることがある。agmsgとrulesyncを併用する場合、両者が管理するファイルの重複を整理する必要がある。
自動受信の停止
この現象は、agmsgで配信設定を行った後にrulesync generateを実行すると発生する。設定操作自体ではなく、生成処理を境に自動受信が止まる点が問題となる。
原因は、agmsgとrulesyncが同じファイルを管理していることにある。agmsgは、配信設定を各ツールの設定ディレクトリへ直接書き込む。一方のrulesyncも、targetsとfeaturesに該当するファイルを管理するため、管理範囲が重なる。
deleteの動作
rulesyncでdelete: trueを設定している場合、生成元のないファイルは削除される。この設定では、agmsgが書き込んだ.cursor/rules/agmsg.mdcや.opencode/rules/が削除対象になる。
つまり、agmsgが必要な設定ファイルを作成しても、rulesync側から見て生成元がなければ、rulesync generateの処理によって残らない。両ツールが同じ出力先をそれぞれ管理する構成が、競合につながる。
書き込み元の分担
対処では、ファイルごと、出力先ごとに「どちらが書くか」を一つに決める。すべての設定をrulesyncへ寄せるのではなく、agmsgとrulesyncの担当範囲を分けることが要点となる。
hooksの定義
続いて.rulesync/hooks.jsoncへ定義を書く。引数として渡すエージェント種別はツールごとに異なるため、共有のhooksではなく、ツール別のオーバーライドキーを使用する。これにより、出力先の書き込み元を分担した構成に合わせて定義できる。
agmsg and rulesync together
When agmsg and rulesync are used together, running rulesync generate can silently remove delivery settings created by agmsg. The visible result is that automatic reception stops even though inter-agent delivery was previously configured.
The problem is not the agmsg reception mode itself. It arises because agmsg and rulesync can manage the same configuration files, allowing one tool’s generation process to delete files written by the other.
Overlapping config files
agmsg writes its delivery settings directly into each tool’s configuration directory. At the same time, rulesync manages files that correspond to its targets and features.
When delete: true is configured, rulesync removes files that do not have a generation source. As a result, a file created directly by agmsg may appear to rulesync as an unmanaged file that should be deleted during rulesync generate.
This overlap explains why the delivery configuration can disappear without an explicit change to the agmsg setup. The generation command applies rulesync’s file-management behavior to locations that also contain agmsg output.
Files targeted for deletion
Under the described configuration, files and directories written by agmsg can become deletion targets. These include .cursor/rules/agmsg.mdc and .opencode/rules/.
Once those files are removed, the delivery settings they contained are no longer available, which causes automatic reception to stop. The conflict therefore needs to be addressed at the level of individual files and output destinations.
Decide who writes
The remedy is to decide which tool writes each file. This does not mean moving every configuration into rulesync. Instead, each output destination should have exactly one writer so that agmsg and rulesync do not manage the same file.
Definitions are then added to .rulesync/hooks.jsonc. Because the agent type passed as an argument differs by tool, the configuration should use tool-specific override keys rather than shared hooks. This preserves separate ownership of the relevant outputs while avoiding the deletion conflict triggered by rulesync generate.
ポコとTECHガイドPoko & TECH Guide
ポコと当サイトのTECHガイドが、記事の要約と収集した情報から読みどころを語るAI生成の対話です。Poko and TECH Dashboard's own TECH Guide discuss the article's highlights in an AI-generated conversation based on its summary and collected source details.
- ポコPokorulesync generateを実行した後に、agmsgの自動受信が止まることがあるって驚いた。これって大きいこと?I was surprised that running rulesync generate can stop agmsg from receiving messages automatically. Is that a big deal?
- TECHガイドTECH Guideこの記事では、両方が同じ設定ファイルを管理し、配信設定が消えるため受信が止まるとしておる。併用時には見過ごせない競合じゃな。The article says both tools manage the same config files, so delivery settings can disappear and receiving stops. That’s a significant conflict if you use them together.
- ポコPoko「delete: true」が生成元のないファイルを削除するって、つまりどういうこと?It says “delete: true” removes files with no source. What does that actually mean?
- TECHガイドTECH Guide管理対象なのにrulesync側に元データがないファイルを、不要とみなして消す設定じゃ。ここではagmsgが書いたファイルも対象になるのう。It tells rulesync to treat managed files without source data as unnecessary and delete them. In this case, that can include files written by agmsg.
- ポコPoko自分なら、出力先ごとに担当を決めて、必要な定義をhooks.jsoncへ書くかな。これなら共存できそう!I’d assign one tool to each output location and put the needed definitions in hooks.jsonc. That sounds like a workable way to keep both!
- TECHガイドTECH Guide本文の対策もその方針じゃ。ただし全部をrulesyncへ寄せず、引数の違いに合わせて共有hooksではなくツール別のオーバーライドキーを使うんじゃよ。That matches the proposed fix. Don’t move everything into rulesync; because agent arguments differ by tool, use tool-specific override keys rather than shared hooks.
