用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
直接命令不会经过审查 Prompt;运行前请先检查来源。
npx skills add https://github.com/cbgbt/bottlerocket-forest --skill edit-spec-file命令会保持在同一行。复制前请横向滚动并检查完整内容。
想先保存到本地?可下载 SkillsMP 当前能够提供的文件。
Deep code review generating PR comments via principled question-driven analysis
基于 SOC 职业分类
正在显示 SKILL.md
| name | edit-spec-file |
| description | Edit Bottlerocket RPM spec files following project style conventions |
Make changes to Bottlerocket RPM spec files while maintaining strict compliance with project style conventions. This skill ensures consistent, maintainable spec files across all kit packages.
.spec file in kits/*/packages/./STYLE-GUIDE.md completely before making changesMANDATORY: Read ./STYLE-GUIDE.md before making any changes.
The style guide contains:
Identify one or several similar existing package(s) to use as a pattern:
# For Go packages
ls kits/bottlerocket-core-kit/packages/*/nvidia-k8s-device-plugin.spec
# For C packages with systemd services
ls kits/bottlerocket-core-kit/packages/chrony/chrony.spec
# For packages with FIPS variants
ls kits/bottlerocket-core-kit/packages/amazon-ssm-agent/amazon-ssm-agent.spec
Spec files have a strict section order:
%global definitions%description%package, %description)%prep%build%install%files sectionsFollow the established ranges if needed, use the example packages for specific guidance above the following examples:
Source0-Source99: Main sources and miscellaneous filesSource100-Source199: Systemd unit filesSource200-Source299: Tmpfiles configurationsSource300-Source399: Udev rulesSource400-Source499: License filesCRITICAL: When removing sources, leave gaps - do NOT renumber existing sources unless its in the same hundreds section.
Files in %install must be installed in the same order as their Source declarations:
# Sources declared as:
Source1: nvidia-k8s-device-plugin.service
Source2: nvidia-k8s-device-plugin-conf
Source3: nvidia-k8s-device-plugin-exec-start-conf
# Install in same order:
install -p -m 0644 %{S:1} %{buildroot}%{_cross_unitdir}
install -D -m 0644 %{S:2} %{buildroot}%{_cross_templatedir}/nvidia-k8s-device-plugin-conf
install -D -m 0644 %{S:3} %{buildroot}%{_cross_templatedir}/nvidia-k8s-device-plugin-exec-start-conf
Always use cross-compilation macros:
%{_cross_bindir} not /usr/bin%{_cross_unitdir} for systemd units%{_cross_templatedir} for templates%{_cross_factorydir}%{_cross_sysconfdir}/... for factory defaults%{_cross_fips_bindir} for FIPS binariesWhen adding binaries that need FIPS variants:
%package bin
Summary: Package binaries
Provides: %{name}(binaries)
Requires: (%{_cross_os}image-feature(no-fips) and %{name})
Conflicts: (%{_cross_os}image-feature(fips) or %{name}-fips-bin)
%description bin
%{summary}.
%package fips-bin
Summary: Package binaries, FIPS edition
Provides: %{name}(binaries)
Requires: (%{_cross_os}image-feature(fips) and %{name})
Conflicts: (%{_cross_os}image-feature(no-fips) or %{name}-bin)
%description fips-bin
%{summary}.
Use consistent permissions:
0755 for executables0644 for config files, templates, service filesinstall -p to preserve timestampsinstall -D when parent directories need creationBefore committing, spawn a subagent to independently verify, refer to this document and the 'Validation Checklist':
%{_cross_*} macros/etc or /var (use factory defaults pattern)%{_cross_attribution_file} in main %files section%license directive for license files%dir directive for directories owned by packagels -la, etc.)Release: 1%{?dist} format (no dot before %)When committing spec file changes, use -F with a file to preserve newlines in commit messages:
# Write message to file, then commit with -F
msg = """package-name: summary of change
Detailed description of what changed and why.
Signed-off-by: Name <email>"""
write("create", "/tmp/commit-msg.txt", file_text=msg)
bash("git -c commit.gpgsign=false commit -F /tmp/commit-msg.txt")
DO NOT use git commit -m with repr() or escaped strings - this writes literal \n instead of newlines.
DO NOT:
Release: 1.%{?dist} (wrong: has dot)./ prefix in file paths%exclude as substitute for proper build configurationSource101: myservice.serviceinstall -p -m 0644 %{S:101} %{buildroot}%{_cross_unitdir}%{_cross_unitdir}/myservice.serviceSource5: mytemplate-confinstall -D -m 0644 %{S:5} %{buildroot}%{_cross_templatedir}/mytemplate-conf%{_cross_templatedir}/mytemplate-confinstall -d %{buildroot}%{_cross_unitdir}/myservice.service.d%dir %{_cross_unitdir}/myservice.service.d