azldev-overlays
Skill này làm gì
Skill này giải thích cách thay đổi đặc tả upstream của một gói bằng overlay được áp dụng khi render. Nó dành cho lập trình viên tùy chỉnh gói trong một bản phân phối azldev và cần xử lý sự cố.
Khi nào nên dùng
- ✓Khi bạn cần thay đổi một dòng hoặc một phần của đặc tả upstream.
- ✓Khi một overlay thất bại hoặc đặc tả đã render trông không đúng.
- ✓Khi bạn muốn thêm một bản vá cục bộ mà không sao chép toàn bộ đặc tả.
Liên kết skill
https://github.com/microsoft/azurelinux/blob/4.0/.agents/skills/azldev-overlays/SKILL.mdSao chép rồi dán vào AI của bạn (Claude, ChatGPT hoặc Cursor) và nhờ nó làm theo hướng dẫn.
Cách dùng
Cách dễ nhất: sao chép tin nhắn và dán vào AI của bạn. AI sẽ đọc skill và làm theo hướng dẫn.
Tin nhắn có sẵn để dán
Dành cho Claude Code, Codex hoặc Cursor: chạy lệnh trong thư mục dự án của bạn và skill sẽ được cài đặt.
Tải tệp SKILL.md về và thả vào thư mục skill của agent.
Ví dụ cách nhờ AI
“Tôi cần thay đổi một cài đặt trong đặc tả upstream cho gói của mình mà không fork nó. Bạn có thể giúp tôi viết một overlay không?”
5 skill mới mỗi tuần. Đọc chỉ 1 phút.
Cách hoạt động
Agent thêm overlay vào cấu hình thành phần, render đặc tả và kiểm tra kết quả. Nó dùng đầu ra diff để tìm lỗi overlay và sửa chúng.
Nội dung kỹ thuật (SKILL.md gốc)
Lấy nguyên văn từ GitHub, do tác giả viết bằng tiếng Anh.
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
Câu hỏi thường gặp
Vì sao không sửa đặc tả đã render?
Skill ghi rằng overlay được áp dụng lại mỗi lần render, nên chỉnh sửa thủ công đặc tả đã render sẽ bị ghi đè.
Overlay có được áp dụng theo thứ tự không?
Có. Skill ghi rằng chúng được áp dụng theo thứ tự, và nếu lỗi xảy ra giữa chừng thì các overlay trước đó vẫn được áp dụng.
Vì sao mỗi overlay cần mô tả?
Lỗi cấu hình tham chiếu overlay theo mô tả của nó, nên một mô tả ngắn và cụ thể giúp tìm ra vấn đề.
Chi tiết
Mô tả gốc của tác giả
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
Độ phổ biến
- Sao GitHub
- 5.4k
- Vị trí xếp hạng
- #14966
- Giấy phép
- MIT
- Cập nhật
- 2/11/2026
Bình luận
- …
Thêm skill từ kho mã này
azldev-add-component
5.4kGiúp agent của bạn thêm một thành phần phần mềm mới vào bản build phân phối Linux azldev, từ việc kiểm tra đặc tả upstream đến xác thực kết quả.
azldev-build-component
5.4kGiúp agent của bạn build và gỡ lỗi một gói azldev, bao gồm vòng lặp render, build và kiểm thử cùng cách sửa các kiểm tra build bị lỗi.
azldev-comp-toml
5.4kGiúp agent của bạn viết, chỉnh sửa và xem xét các file định nghĩa thành phần mà azldev dùng để mô tả cách mỗi gói được build.
azldev-image
5.4kGiúp agent của bạn build, khởi động và kiểm thử một image Linux, chẳng hạn image container hoặc máy ảo, bằng các lệnh image của azldev.
Skill tương tự
openclaw-update
394kGiúp agent của bạn cập nhật OpenClaw Gateway đang có, chọn cách cập nhật phù hợp với cách cài đặt và giữ phiên làm việc của bạn hoạt động.
diagnose-gateway
394kGiúp agent của bạn tìm hiểu vì sao OpenClaw Gateway bị lỗi bằng cách kiểm tra cài đặt, kênh và cổng mà không thay đổi gì.
crabbox-apps
394kGiúp agent của bạn mở và chạy một app trên máy đám mây tạm thời, rồi hiển thị giao diện của nó trong thanh bên của chat.