SkillAgentSearch skills...

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 ninja

Installs into whichever agent you are using.

About this skill
📄

SKILL.md

Installable skill definition

Quality Score

64/100

Supported Platforms

Universal

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.

Substance
26/30
Structure
18/20
Description
15/15
Adoption
0/20
Freshness
5/15

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.

SkillScoreStarsUpdatedFormat
ninja (this skill)by OutlineDriven640—SKILL.md
taste-skillby Leonxlnx100102.9ktodayCLAUDE.md
ai-job-searchby ai-job-search-dev10066.3ktodayCLAUDE.md
claude-howtoby luongnv8910045.3k6d agoCLAUDE.md
algorithmic-artby anthropics100177.9k34d agoSKILL.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.

name: 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.ninja produced by CMake or Meson.
  • The failing target or error text (required for diagnosis).
  • Parallelism constraints (optional): job count or load limit.

Procedure

  1. Generate Ninja files from the meta-build system. Done when: build.ninja exists 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
  1. Control parallelism. -j defaults to a heuristic based on the machine's CPU count; -l throttles on load average; -k controls 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
  1. 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
  1. 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
  1. Produce compile_commands.json for 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 .
  1. Read build.ninja when 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.

  1. 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.ninja edited by hand: revert; the next generator run overwrites it. Fix CMakeLists.txt or meson.build instead.
  • ninja -t compdb output is empty: the generator did not emit compdb rules; use CMAKE_EXPORT_COMPILE_COMMANDS=ON instead.
  • Dry run shows unexpected rebuilds: run ninja -d explain <target> to see which input is newer.
  • Load throttling still saturates I/O: lower -j explicitly; -l only 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

View on GitHub
GitHub Stars0
CategoryDevelopment
UpdatedNaNy ago
Forks0

Trust signals

68/100

From repository metadata: license, adoption, age and documentation. Not a code audit — see the Safety scan above for what the skill file itself contains.

2 medium1 low