azldev-overlays
できること
このスキルは、render時に適用されるオーバーレイで、上流のパッケージspecを変更する方法を説明します。azldevのディストリビューションでパッケージをカスタマイズし、問題を解決したい開発者が対象です。
使う場面
- ✓上流specの1行またはセクションだけを変更したいとき。
- ✓オーバーレイが失敗した、またはレンダリングされたspecが期待どおりでないとき。
- ✓specを丸ごとコピーせずに、ローカルのパッチを追加したいとき。
スキルのリンク
https://github.com/microsoft/azurelinux/blob/4.0/.agents/skills/azldev-overlays/SKILL.mdコピーしてAI(Claude、ChatGPT、Cursor)に貼り付け、指示に従うよう頼んでください。
使い方
いちばん簡単な方法:メッセージをコピーしてAIに貼り付けるだけ。AIがスキルを読んで指示に従います。
貼り付け用メッセージ
Claude Code、Codex、Cursorの場合:プロジェクトのフォルダで実行するとスキルがインストールされます。
SKILL.mdをダウンロードして、エージェントのスキル用フォルダに入れてください。
AIへの頼み方の例
“パッケージの上流specの設定を1つだけ、複製せずに変更したいです。オーバーレイの書き方を手伝ってください。”
毎週5つの新しいスキル。1分で読めます。
仕組み
エージェントは、コンポーネントの設定にオーバーレイを追加し、specをレンダリングして結果を確認します。差分の出力を使ってオーバーレイの失敗を見つけ、修正します。
技術的な内容(元のSKILL.md)
作者による元のテキスト(英語)をGitHubからそのまま表示しています。
Working with overlays
Overlays are semantic patches applied to a component's RPM spec and loose source files at render time. They let you make targeted changes to an upstream spec without forking it. Prefer an overlay over hand-editing a rendered spec: overlays are re-applied on every render, so a manual edit to a rendered spec is overwritten.
The inner loop
Overlays live in the component's TOML config — inline [[components.<name>.overlays]]
entries, or per-file overlay documents referenced by the component's overlay-files
glob. They apply in order and are non-atomic: if one fails part-way, the
overlays before it stay applied.
Add or edit the overlay in the component config.
Re-render and inspect the result:
azldev comp render -p <name>Read the rendered spec (under
specs/) to confirm the change landed where you intended, and iterate until it is correct.Finalize the lock and changelog with the normal end-of-work refresh (see the
azldev-update-componentskill): update the lock, commit, then re-render and amend.
Config errors reference the offending overlay by its description, so give every
overlay a short, specific description.
Diagnose common failures
Start with azldev comp diff-sources -p <name> to see the exact overlay effect.
Use separate pre/post prep-sources directories only when you need persistent trees
for deeper inspection.
| Symptom | Likely cause and fix |
|---|---|
spec-add-tag: tag already exists |
Upstream already has the tag. Use spec-set-tag, or spec-update-tag when its prior existence is an invariant. |
spec-search-replace: no match |
Inspect the current upstream line, check TOML regex quoting, and narrow the expression to the actual section/package. |
| Section or file not found | Inspect the upstream spec/source names; upstream may have renamed or removed the target. |
| Overlay applies but output/build is wrong | Inspect diff-sources for an over-broad match, malformed replacement, or a dependency/file change the overlay omitted. |
Choosing an overlay type
Match the change to the narrowest overlay type. Required fields are enforced when the config loads, so a missing field fails fast rather than at apply time.
Spec overlays (structured .spec edits)
| Type | Use for | Required |
|---|---|---|
spec-add-tag |
add a tag; fails if it already exists | tag, value |
spec-insert-tag |
add a tag next to its family (e.g. after the last Source*) |
tag, value |
spec-set-tag |
set a tag, replacing it if present or adding it if not | tag, value |
spec-update-tag |
change an existing tag; fails if it is missing | tag, value |
spec-remove-tag |
delete tag instances; without value, deletes every instance |
tag |
spec-prepend-lines |
insert lines at the top of a section (or the whole file) | lines |
spec-append-lines |
insert lines at the end of a section (or the whole file) | lines |
spec-search-replace |
regex replace within a section (or the whole spec) | regex |
spec-remove-section |
delete a whole section | section |
spec-remove-subpackage |
delete every section of a sub-package | package |
patch-add |
add a .patch file and register it in the spec |
source |
patch-remove |
remove a patch and its spec references | file |
File overlays (loose non-spec files; never .spec)
| Type | Use for | Required |
|---|---|---|
file-prepend-lines |
prepend lines to a file | file, lines |
file-search-replace |
regex replace in a file | file, regex |
file-add |
copy in a new file; fails if it already exists | file, source |
file-remove |
delete a file | file |
file-rename |
rename a file in place | file, replacement |
Rules that trip people up
spec-remove-tagwithoutvalueremoves every instance of the named tag. To remove one dependency, set bothtagand the exactvalueto match:[[components.mypackage.overlays]] description = "Remove an unavailable build dependency" type = "spec-remove-tag" tag = "BuildRequires" value = "unwanted-package"sectionis optional only forspec-prepend-lines,spec-append-lines, andspec-search-replace(omit it to target the whole spec). It is required forspec-remove-section.packageneedssectionon the whole-file-capable overlays — a sub-package is a sub-qualifi
よくある質問
レンダリングされたspecを直接編集してはいけないのはなぜですか?
スキルによると、オーバーレイは毎回のレンダリングで再適用されるため、レンダリングされたspecへの手作業の編集は上書きされます。
オーバーレイは順番に適用されますか?
はい。スキルによると、順番に適用され、途中で失敗すると、それより前のオーバーレイは適用されたままになります。
各オーバーレイに説明を付ける理由は何ですか?
設定エラーはオーバーレイの説明で示されるため、短く具体的な説明があると問題を見つけやすくなります。
詳細
作者による元の説明
Read this before adding, changing, or diagnosing any overlay; never edit a spec or rendered file from memory. Explains how to modify a component's RPM spec or loose source files with azldev overlays (semantic patches applied at render time) instead of forking the spec, covering overlay types, the render-and-inspect loop, common failures, pitfalls, and metadata. Triggers include overlay, overlay failed, no match, spec-add-tag, spec-remove-tag, patch-add, fix spec, backport, disable test, prune subpackage, edit spec.
repo: microsoft/azurelinux
人気
- GitHubのスター
- 5.4k
- ランキング
- #14966
- ライセンス
- MIT
- 更新日
- 2026/11/2
コメント
- …
このリポジトリの他のスキル
azldev-add-component
5.4kエージェントが、azldevのLinuxディストリビューションのビルドに新しいソフトウェアコンポーネントを追加し、上流のspec確認から結果の検証まで進められるよう支援します。
azldev-build-component
5.4kエージェントが、azldevのパッケージのビルドとデバッグを行えるよう支援します。render、build、テストの繰り返しと、失敗したビルドチェックの修正を含みます。
azldev-comp-toml
5.4kエージェントが、azldevで各パッケージのビルド方法を定めるコンポーネント定義ファイルを、作成、編集、確認できるよう支援します。
azldev-image
5.4kエージェントが、azldevのイメージコマンドを使い、コンテナや仮想マシンのLinuxイメージをビルド、起動、テストできるよう支援します。
似ているスキル
openclaw-update
394k既存のOpenClaw Gatewayを更新するようエージェントを支援します。インストール方法に合った更新方法を選び、セッションを動かし続けます。
diagnose-gateway
394k設定、チャンネル、ポートを確認して、OpenClaw Gatewayが失敗している理由を、何も変更せずに突き止めるようエージェントを支援します。
crabbox-apps
394k一時的なクラウドマシン上でアプリを開いて実行し、そのビューをチャットのサイドパネルに表示するようエージェントを支援します。