ninja
Use when diagnosing Ninja build failures, tuning parallelism, interpreting verbose output, or working with build.ninja files as a CMake-generated low-level build executor.
Install / Use
npx skills add OutlineDriven/outline-driven-development --skill ninjaInstalls into whichever agent you are using.
SKILL.md
Installable skill definition
Quality Score
Category
Development & EngineeringSupported Platforms
Tags
Our assessment of ninja
ninja scores 64/100 on our quality scale, 3971st of 4,609 Development & Engineering skills we index.
Its SKILL.md is 5.6 KB long, split into 7 sections with 6 code examples: a solid amount of guidance for an agent.
It has no GitHub stars yet, so there is no community track record; judge it on its content.
Maintenance, license and trust
- We could not determine when the repository was last updated.
- No license is declared. By default that means all rights are reserved: you can read it, but reusing or redistributing it is not clearly permitted. Ask the author before building on it commercially.
- Its trust signals score 68/100, with 3 cautions from licensing, adoption, age or documentation. These come from repository metadata, not a code audit — read the skill file before letting an agent act on it.
ninja compared with similar skills
All 4 of these similar skills score higher than ninja; compare them before choosing.
| Skill | Score | Stars | Updated | Format |
|---|---|---|---|---|
| ninja (this skill)by OutlineDriven | 64 | 0 | — | SKILL.md |
| taste-skillby Leonxlnx | 100 | 102.9k | today | CLAUDE.md |
| ai-job-searchby ai-job-search-dev | 100 | 66.3k | today | CLAUDE.md |
| claude-howtoby luongnv89 | 100 | 45.3k | 6d ago | CLAUDE.md |
| algorithmic-artby anthropics | 100 | 177.9k | 34d ago | SKILL.md |
Frequently asked questions
- How do I install ninja?
- Run
npx skills add OutlineDriven/outline-driven-development --skill ninja. The install tabs above show the steps for each supported agent. - Which AI agents does ninja work with?
- It is written for Universal, as a SKILL.md file. Other agents that read the same format can often use it too.
- Is ninja safe to use?
- It declares no license and scores 68/100 on trust signals. Skills are instructions an agent will follow, so read the file before installing it and do not approve commands you do not understand.
- Is ninja still maintained?
- We could not determine when the repository was last updated.
Skill content
View source on GitHubname: ninja description: 'Use when diagnosing Ninja build failures, tuning parallelism, interpreting verbose output, or working with build.ninja files as a CMake-generated low-level build executor.' disable-model-invocation: true
Ninja
Ninja is the low-level build executor that CMake, Meson, and other generators emit build.ninja for. Grounded against Ninja 1.13.2.
Contract
| Field | Bound contract |
|---|---|
| Trigger | The task diagnoses a Ninja build failure, tunes parallelism, interprets Ninja output, inspects or edits a build.ninja file, or uses Ninja as a CMake or Meson backend. |
| Authority | Reversible local: writes only build outputs inside the build directory; build.ninja itself is generated, so edits go to the generator's input files; rollback is version control plus ninja -t clean. No remote mutation. |
| Side effect | ninja runs build commands and writes outputs; ninja -t clean removes them. |
| Done | The build completes or the failing edge is identified with its cause, and the fix lands in the generator input rather than in build.ninja. |
Inputs
- A configured build directory (required):
build.ninjaproduced by CMake or Meson. - The failing target or error text (required for diagnosis).
- Parallelism constraints (optional): job count or load limit.
Procedure
- Generate Ninja files from the meta-build system. Done when:
build.ninjaexists in the build directory.
cmake -S . -B build -G Ninja
cmake --build build # invokes ninja internally
ninja -C build # or run ninja directly
# Multi-config variant
cmake -S . -B build -G "Ninja Multi-Config"
cmake --build build --config Release
- Control parallelism.
-jdefaults to a heuristic based on the machine's CPU count;-lthrottles on load average;-kcontrols how many failures stop the build. Done when: the build runs at the intended concurrency.
ninja -j4 # exactly 4 jobs
ninja -j"$(nproc)" # one per CPU
ninja -j0 # unlimited
ninja -l4.0 # no new jobs while load average exceeds 4.0
ninja -k5 # stop after 5 failures
ninja -k0 # never stop on failure
- Diagnose with verbose and debug output. Done when: the failing command or the rebuild reason is visible.
ninja -v # full command lines
ninja -n # dry run: what would run
ninja -d explain myapp # why myapp is considered dirty
ninja -d stats # operation counts and timing at end
ninja -d keepdepfile # keep .d files after reading
ninja -d keeprsp # keep @response files
- Inspect the graph with sub-tools. Done when: the query answers the question asked.
ninja -t targets all # every target
ninja -t targets rule cc # targets built by rule cc
ninja -t query myapp # inputs and outputs of one edge
ninja -t graph myapp | dot -Tsvg -o deps.svg # graphviz
ninja -t compdb cc cxx > compile_commands.json # compilation database
ninja -t rules # all rules
ninja -t clean # remove outputs
ninja -t clean -g # also remove generated files
- Produce
compile_commands.jsonfor clang-tidy and IDEs. Done when: the database exists at the expected path.
cmake -S . -B build -G Ninja -DCMAKE_EXPORT_COMPILE_COMMANDS=ON
ln -sf build/compile_commands.json .
- Read
build.ninjawhen debugging generated output. The file is generated; fix the generator input, not this file. Done when: the edge, rule, or variable causing the problem is identified.
cflags = -Wall -O2
rule cc
command = gcc $cflags -c $in -o $out
description = CC $in
depfile = $out.d
deps = gcc
build foo.o: cc foo.c
build all: phony foo.o
default all
Key concepts: a rule is a command template; a build edge instantiates it; $in and $out are the edge's inputs and outputs; deps = gcc tells Ninja to read Makefile-style depfiles; phony marks a target always out of date; default selects what a bare ninja builds.
- Diagnose common failures against this table. Done when: the error maps to a cause and a fix.
| Issue | Cause | Fix |
|---|---|---|
| missing and no known rule to make it | Source not in the generator's file list | Fix add_executable/sources and regenerate |
| Changes not picked up | Stale build.ninja | Re-run cmake -S . -B build or meson setup --reconfigure |
| build stopped: subcommand failed | A compile or link failed | Read the error above the line; -v shows the command |
| Slow parallel build | I/O-bound at high -j | Add -l"$(nproc)" to throttle on load |
| Circular dependency | Target depends on itself | Check the generator's dependency declarations |
For the full command, sub-tool, and build.ninja format reference see references/cheatsheet.md.
Failure and recovery
build.ninjaedited by hand: revert; the next generator run overwrites it. FixCMakeLists.txtormeson.buildinstead.ninja -t compdboutput is empty: the generator did not emitcompdbrules; useCMAKE_EXPORT_COMPILE_COMMANDS=ONinstead.- Dry run shows unexpected rebuilds: run
ninja -d explain <target>to see which input is newer. - Load throttling still saturates I/O: lower
-jexplicitly;-lonly stops starting new jobs, it does not slow running ones. ninja: error: loading 'build.ninja': the file is missing or corrupt; regenerate it.
Output
A diagnosed build failure with its root cause in the generator input, or a tuned ninja invocation (-j/-l/-k) with the reason for each flag. For format questions, the identified rule, edge, or variable in build.ninja traced back to its generator source.
Related Skills
taste-skill
102.9kAgent skills that give coding agents taste: art direction, reference images and a browser check instead of generic AI pages
ai-job-search
66.3kThe job search that runs on your machine. AI job application framework built on Claude Code: evaluate postings, tailor CVs, write cover letters, prep interviews. Fork it and own it.
claude-howto
45.3kA visual, example-driven guide to Claude Code — from basic concepts to advanced agents, with copy-paste templates that bring immediate value.
algorithmic-art
177.9kCreating algorithmic art using p5.js with seeded randomness and interactive parameter exploration. Use this when users request creating art using code, generative art, algorithmic art, flow fields, or particle systems.
Trust signals
From repository metadata: license, adoption, age and documentation. Not a code audit — see the Safety scan above for what the skill file itself contains.
