build-from-source
Use for tasks that require compiling, building, cross-compiling, porting, or repairing an existing codebase — "build X from source", "fix the build", "port to Y", "get the tests green". A failure-first protocol that avoids thrashing on long builds.
- License 许可
- Apache-2.0
- 最近更新
- 2026-11-12
- Stars
- ★ 394
- Forks
- 23
01 前言 Front Matter
- name
- build-from-source
- description
- Use for tasks that require compiling, building, cross-compiling, porting, or repairing an existing codebase — "build X from source", "fix the build", "port to Y", "get the tests green". A failure-first protocol that avoids thrashing on long builds.
03 SKILL.md 正文
Build / port / repair protocol
Long builds fail when the agent thrashes — retrying the same command or guessing at an error. Follow this order.
-
Read the build docs first. Find
HACKING.*,README*,INSTALL*,Makefiletargets, and CI config. Identify the exact configure / build / test commands and required toolchain versions. -
Install dependencies once, non-interactively.
DEBIAN_FRONTEND=noninteractive apt-get update && apt-get install -y <pkgs>. Confirm tools are on PATH before building. -
Configure → build → test, one stage at a time, capturing the FIRST error. Use
make -j$(nproc). Tee the log:<cmd> 2>&1 | tee /tmp/build.log. The first error is the real one; later lines are fallout. -
Watch memory on parallel builds.
-j$(nproc)can exhaust RAM and get the buildKilledwith no compiler error (common with Coq/OCaml/LLVM builds). If the build dies without an error message, re-run at-j4and monitorfree -h. A slower build that finishes beats a fast build that OOMs. -
Cross-compiling to another target/architecture: install the matching toolchain (e.g.
apt-get install -y gcc-mips-linux-gnu) and make the build use it — setCC/CXX/LD, or the project's--host/--target/CROSS_COMPILEvariables — instead of silently producing a host binary. Verify the output withfile(it must report the target architecture, e.g.ELF 32-bit … MIPS). -
Reproduce the stated failure with the exact command before changing anything, so you have a baseline to compare against.
-
Change one thing at a time, rebuild, check. If a fix does not change the error, revert it — do not stack guesses.
-
Verify with the task's stated acceptance command (the specific test target or binary invocation), not a proxy.
-
Checkpoint long builds — write a small script so a re-run resumes from the last successful stage instead of restarting from zero.
04 同仓库更多 Skills
dynamic-resources
Example skill loaded from resources_discover
hermes-agent
Use the FlashRSI Hermes Snapshot's headless Python runtime, tools, sessions, and compression paths.
skill-installer
Install Codex skills into $CODEX_HOME/skills from a curated list or a GitHub repo path. Use when a user asks to list installable skills, install a curated skill, or install a skill from another repo (including private repos).
skill-creator
Guide for creating effective skills. This skill should be used when users want to create a new skill (or update an existing skill) that extends Codex's capabilities with specialized knowledge, workflows, or tool integrations.
review-agent
Perform a read-only, defect-first review of a specified code change and return every actionable finding. Use when another agent delegates review of uncommitted changes, a base-branch diff, a commit, or custom review instructions.
plugin-creator
Create and scaffold plugin directories for Codex with a required `.codex-plugin/plugin.json`, optional plugin folders/files, valid manifest defaults, and personal-marketplace entries by default. Use when Codex needs to create a new personal plugin, add optional plugin structure, generate or update marketplace entries for plugin ordering and availability metadata, or update an existing local plugin during development with the CLI-driven cachebuster and reinstall flow.