azldev-add-component
它能做什么
这项技能指导如何把一个软件包添加到基于 azldev 的 Linux 发行版构建中。它适用于为使用 azldev 构建的发行版打包软件的开发者。
适用场景
- ✓当你想把一个新软件包添加到 azldev 发行版构建中时。
- ✓当你需要导入上游软件包,并决定其改动是放在行内还是单独文件中时。
- ✓当你使用渲染、比对和构建步骤验证新组件时。
技能链接
https://github.com/microsoft/azurelinux/blob/4.0/.agents/skills/azldev-add-component/SKILL.md复制后粘贴给你的 AI(Claude、ChatGPT 或 Cursor),让它按照说明操作。
使用方法
最简单的方法:复制下面的消息,粘贴给你的 AI。它会读取这个技能并按说明操作。
可直接粘贴的消息
适用于 Claude Code、Codex 或 Cursor:在项目文件夹中运行,即可安装该技能。
下载 SKILL.md,放进智能体的技能文件夹。
可以这样问 AI
“请帮我把 jq 软件包添加到我们的 azldev 发行版中。请逐步指导我检查上游规格文件并验证构建。”
每周 5 个新技能,1 分钟读完。
工作原理
智能体会确认该组件尚不存在,锁定其来源,阅读上游规格文件,然后设置配置,并检查渲染和构建结果。它会遵循该工具自身工作流程中的步骤。
技术内容(原始 SKILL.md)
作者在 GitHub 上的英文原文。
Add a component
Before you start
Confirm the component does not already exist:
azldev comp list -p <name> -q -O json
Inspect the upstream spec first
The reliable way to see what you are importing (direct web fetches of upstream dist-git often fail bot detection):
Add a bare entry so azldev can resolve the component: run
azldev comp add <name>(it appends[components.<name>]to the root config file), or hand-add[components.<name>]to an included config file if you want it to live elsewhere. A bare root entry is perfect for initial testing, but real distros will usually segment the configuration into included files. Once the initial pass is done, ensure the component is in the right place and remove the root entry.Create the initial lock so source resolution is pinned before inspection:
azldev comp update -p <name>Pull the sources without overlays into a scratch dir under the work dir:
azldev comp prep-sources -p <name> --skip-overlays --force -o base/build/work/scratch/<name> -qRead the spec and plan any overlays.
Inline vs dedicated file
Inline — a bare upstream import with no changes stays in a shared config file:
[components.jq]Dedicated — anything that needs overlays, build config, or a local spec gets its own
<name>/<name>.comp.toml. Rule of thumb: more than[components.<name>]earns a dedicated file. Anincludes = ["**/*.comp.toml"]glob picks it up automatically.
azldev comp add <name> [<name>...] adds bare [components.<name>] entries that inherit
the distro defaults; it writes to the root config file and does not scaffold spec or
source files. If your distro keeps components in included or dedicated files, move the
entry there afterward.
Customize
For spec source types and overlays, read the azldev-comp-toml and azldev-overlays skills. Key
points when adding a component:
- Prefer overlays over forking the spec — overlays get upstream updates for free. Forking a spec is a last resort and a long-term maintenance commitment. Get explicit user sign-off first, document every change, and keep the delta minimal.
- Every overlay needs a
descriptionexplaining why it is needed. - Keep
%checkenabled. Disable it only as a last resort viabuild.check.skip = truewith a requiredbuild.check.skip_reason(see theazldev-build-componentskill).
Validate
The initial lock pins the upstream revision you inspected. Refresh it after the component inputs settle, then validate:
azldev comp update -p <name> # resolve the upstream commit and write the lock
azldev comp render -p <name> # apply overlays and write the rendered spec
azldev comp diff-sources -p <name> # see exactly what the overlays change
azldev comp build -p <name> # build the RPMs
Inspect the rendered spec under specs/. A new component always needs a
smoke test — see the azldev-build-component and azldev-mock skills.
After all component inputs are final, run azldev comp update -p <name> again and
re-render. Stage the component definition and sources, locks/<name>.lock, and
the rendered output before committing. Then re-render, stage
specs/<first-char>/<name>/, and amend the commit so %changelog and
Release: reflect it. See the azldev-update-component skill for the complete
finalization workflow.
Generated by azldev docs agent; do not hand-edit.
常见问题
我应该根据记忆猜测上游细节吗?
不应该。技能说明,应先检查上游规格文件,而不是凭记忆猜测。
什么时候需要单独的文件?
技能说明,需要覆盖层、构建设置或本地规格文件的组件,会拥有自己的配置文件夹。
它会在我的电脑上安装构建好的软件包吗?
不会。技能说明,构建好的软件包应在模拟构建环境中测试,而不是安装在主机上。
详情
作者的原始描述
Read this before adding or importing a component; follow the workflow instead of guessing. Explains how to add a new component to an azldev distro, covering inspecting the upstream spec, the inline-versus-dedicated-file decision, and validating with render, diff-sources, and build. Triggers include add component, new package, import package, create comp.toml, new component.
repo: microsoft/azurelinux
热度
- GitHub 星标
- 5.4k
- 排名
- #14960
- 许可证
- MIT
- 更新时间
- 2026/11/2
评论
- …
同一仓库的更多技能
azldev-build-component
5.4k帮你的智能体构建和调试 azldev 软件包,包括渲染、构建和测试循环,以及修复失败的构建检查。
azldev-comp-toml
5.4k帮你的智能体编写、编辑和审查 azldev 用来描述每个软件包如何构建的组件定义文件。
azldev-image
5.4k帮你的智能体使用 azldev 镜像命令构建、启动和测试 Linux 镜像,例如容器镜像或虚拟机镜像。
azldev-mock
5.4k帮你的智能体在模拟构建环境中测试和检查已构建的软件包,使它们不会触及你自己的电脑。