"Review this code" gives an opinion. The opinion changes from one run to the next, and it
talks about old code that the change did not touch. A team cannot track an opinion. This
skill gives each metric an ID and a threshold, and it applies them to new and changed code
only. The numbers come from tools that you can run without skillsaw.
When to use it
Use it when you plan, write or review code, and before a pull request. It has three roles:
Plan. The agent uses the rules and the limits while it designs a change.
Code. The agent keeps new code in the limits while it writes.
Review. The agent measures the change, reads the diff, and builds the report. It does not change source files in this role.
The Review role, step by step:
Find the tools.quality doctor shows each tool as present or missing, with its install command. A missing tool is not a failure: its metrics show as "not measured".
Measure.quality measure runs lizard, the linter of the language and a dependency tool on the changed files, and joins their output.
Read the diff. The agent looks for what tools cannot see: an implicit state machine, a string comparison where an enum is necessary, a query in a loop, a change of behaviour with no test.
Write the findings. Each finding has a metric ID, a level (Important, Nit or Good), a file, evidence and a fix.
Build the report.quality report writes the page, adds one point to the history, and writes the index.
ID
Metric
Default limit
Measured by
CQ-HEALTH
Health of the change, 0 to 100
Does not go down
skillsaw, from the lizard values
CQ-CC
Cyclomatic complexity of a function
10
lizard
CQ-FLOC
Code lines of a function
50
lizard
CQ-PARAM
Parameters of a function
5
lizard
CQ-NEST
Nested control structures
5
lizard
CQ-LOC
Code lines of a file
A file does not grow past 400
lizard
CQ-BRANCH, CQ-SIMP
Branches and simplification smells
0 new findings
The linter of the language
CQ-COUP
Coupling of a module
Instability goes up by 0.05 or less
The dependency tool of the language
SM-RULE, CQ-ENUM, CQ-N1, CQ-COV, CQ-LCOM4
State machines, enums, query counts, tests, cohesion
0 new
The agent, by review
Some languages have other defaults. For example, a Ruby function has a limit of 25 code lines, and Go has a complexity limit of 15.
Hints after each edit
npx @skillsaw/cli hints <file> gives hints on the lines that the agent just
changed: a function above a limit, a file that grows too long. The Claude Code plugin runs it
as a hook after an edit. A hint is advice. It never stops the agent.
The limits of the measurement
The thresholds cover 8 languages: TypeScript and JavaScript, Python, Ruby, Go, Java, Kotlin, C# and Rust.
The linter step is verified against a real tool run for TypeScript and JavaScript (ESLint), Python (ruff), Ruby (RuboCop) and Rust (Clippy).
The linter step is not verified against a real tool run for Go (staticcheck), Java (PMD), Kotlin (detekt) and C#.
Coupling is measured for TypeScript and JavaScript, Python and Go only. For the other languages the agent reviews the imports by hand.
.gts, .mts, .cts and .vue files get no numbers from lizard. The agent reviews them by reading only, and the report says so.
The health score is a formula. A function at two times its limit and a function at ten times its limit have the same score: 0.
The interview from a real run
The request named the role and the base, so the agent asked only about the missing tools and
about where to keep the report. The third question is the livery question: it was asked one
time, in the planning chain.
The request
Review the quality of this branch against main.
The agent found these answers in the repo. It did not ask these questions.
Which role do you want: plan, code or review?
Review.
Source The request names the role ("Review the quality of this branch").
Which base do you want for the comparison?
origin/main (28deb79). The head is feat/design-skill at 6929aff.
Source The request ("against main"), git rev-parse origin/main, and the base that quality measure found.
Does the change go through a state machine or a domain value?
Yes. The diff adds two Machine classes (docs-app/designs/order/machine.ts, docs-app/designs/text-editor/machine.ts), a status field of a design, and comparisons of state types with string literals. The review read the full diff for SM-RULE and CQ-ENUM.
Source git diff origin/main...HEAD
Which name, accent colour and logo do the pages of this repo get? (the name and the logo)
Name: Switchyard. Logo: docs/logo.svg (the same file as docs/site/logo.svg).
Source README.md title, docs/logo.svg. livery show gave exit code 1, so the procedure of skillsaw-interviews.md section 6 ran.
A skip rule of the question bank removed these questions.
Which thresholds does the team want different from the defaults?
Skip when the role is Review of one change. The repo had no .skillsaw/config.json; the defaults apply.
A changed function breaks a threshold. What do you want to do with it?
Skip when the role is Review.
Who is the owner of the report?
Always skip, unless the user asks for a name on the report. The owner is the git user (Joe Gaudet).
The maintainer saw these questions. The first option is the recommended one.
Question 1 of 3
skillsaw quality doctor shows that lizard and dependency-cruiser are missing for switchyard. Which tools do you want to install for the quality review of the design-skill change?
lizard onlyRecommendedChosen
lizard gives the health score and all function metrics; without it, quality measure shows 'not measured' for each of the 24 files of this change.
All missing tools
lizard and dependency-cruiser: the report then also has the coupling graph; dependency-cruiser becomes a dev dependency of the repo.
None
Nothing is installed; the report has only the eslint findings and the findings of the reviewer, with no health score.
Question 2 of 3
Do you want the skillsaw quality report of the design-skill change in the switchyard repo?
Yes, in the repoRecommendedChosen
docs/quality/ and .skillsaw/quality-history.json are ready to commit, so the trend of the branch works; the agent does not commit them.
Keep them local
The agent adds the quality folder and the history file to .gitignore, and the report stays on this machine.
Summary only
The agent prints the summary and keeps no page.
Question 3 of 3
The switchyard repo has no skillsaw livery. Which accent colour do you want for the skillsaw pages of switchyard (project name: Switchyard)?
Indigo #4f46e5RecommendedChosen
It is --brand-indigo, the primary colour of the Switchyard site (docs/site/site.css:5), so the pages agree with the site.
Amber #f59e0b
It is --brand-amber, the second brand colour of the site; it gives less contrast for links and tags.
Slate #475569
It is the default of skillsaw; the pages then do not look like Switchyard.
Note. Asked one time, in the feature-one-pager interview of the planning chain. This clone had no livery, so the code-quality skill did the livery procedure and used that answer.
The agent recorded these assumptions. Nobody answered them.
Folders (skillsaw-interviews.md section 7): docs/ of switchyard has a different use (docs/site is the published site, docs/api is generated). The maintainer was not asked the folder question. The recommended option applies: a folder that the site does not publish. The workflow .github/workflows/pages.yml publishes only docs/site and docs/api, so the default folders (docs/quality and the four others) are such folders. The agent wrote them with skillsaw docs set.
Format check (section 7, step 6): the repo has a Prettier gate (pnpm format:check). The agent added the five artifact folders to .prettierignore.
lizard: quality doctor gave the install command pipx install lizard. This machine has no pipx. The agent made a virtualenv outside the clone (python3 -m venv, then pip install lizard) and put its bin folder first on PATH.
The answer "Yes, in the repo" lets the report, the index and .skillsaw/quality-history.json stay in the tree as files that are not ignored. The code-quality skill itself made no commit; the pr skill committed them in its step 4.
Each run writes a new folder: 2026-12-02-feat-design-skill for the review, then 2026-12-02-feat-design-skill-02 and -03 for the two polish rounds. The output also has them as review/, round-1/ and round-2/.
The artifact from that run
The change is the branch feat/design-skill of switchyard: 52 files and 7,467 added
lines. There are three reports, one for each point: the review, and the two
polish rounds. Each report has its own folder, and the history
table of a report links the other two. Use the filters by level and by file in the findings.
Point
Head
Health
Direction
Important
Nit
Good
Accepted
Review
6929aff
64
UP
24
15
5
0
After round 1
debe71e
69
UP
25
14
9
6
After round 2
38a5b0f
74
UP
5
12
9
16
The broken limits were 29 at the review, 37 after round 1 and 26 after round 2. The
report of round 1
is a page too.
These scores were computed again. The first run showed 63, then 68, then 74,
and the direction of the report changed from DOWN to UP between two runs with the same base.
This was a defect in the base score: the set of functions for the score before changed with
each head, so the base was 70, 70 and 48. After the fix, the base score is 63 at each point,
and the scores are 64, 69 and 74. The findings and the fixes are from the first rounds.
dependency-cruiser was missing and the maintainer chose "lizard only", so the coupling metric shows as "not measured" in this run.
$ skillsaw quality doctor # before the install: lizard and depcruise missing$ python3 -m venv <S>/examples/venv && <S>/examples/venv/bin/pip install -q lizard
$ export PATH=<S>/examples/venv/bin:$PATH
$ skillsaw quality doctor # lizard present, depcruise missing$ git status --short && git branch --show-current
$ git diff --stat origin/main...HEAD
$ skillsaw quality measure --base origin/main
$ skillsaw quality measure --base origin/main --json
$ skillsaw livery show # exit code 1: no livery$ skillsaw livery set --name "Switchyard" --accent '#4f46e5' --logo docs/logo.svg
$ skillsaw docs show
$ skillsaw docs set --adr docs/adr --prd docs/prd --one-pager docs/one-pagers --walkthrough docs/walkthroughs --quality docs/quality
$ git diff origin/main...HEAD # read in full for each TypeScript source file; the tests, ui.html, player.html, the Markdown files and pnpm-lock.yaml were skimmed$ node packages/cli/dist/cli.js design new|check <a probe design> # to make sure that two findings are real; the probe folder was removed$ printf ... >> .prettierignore # the five artifact folders$ skillsaw quality report --base origin/main --findings <S>/examples/tmp/review-findings.json
$ skillsaw quality check docs/quality/2026-12-02-feat-design-skill/index.html # correct$ node <S>/examples/tmp/shots.mjs <report> <index> <out>/screens review # headless Chromium: no console errors, filters used
<S> and <out> are the scratch folders of the run.
What we learned from this run
The review took 20 minutes of agent time. Most of that was the read of 4,600 lines of TypeScript. The quality runs found 23 problems.
Fixed: the score before was not stable for one base commit.
It was 70 in two runs and 48 in the third, so the direction went from DOWN to UP with no
change of the base. The score before is now the mean of each function, at the base, of the
files that the change touches. The score after is the mean of each function, now, of the
same files and of the new files. One base and one set of files always give the same number.
Fixed: there was no way to accept a broken limit.
Each broken limit was an Important finding, and the polish skill had to give a reason again
in each round. The findings file can now have an accepted list, with a reason
for each item. The report after round 2 shows 16 accepted findings.
Fixed: a linter rule that the repo does not use made Important findings.
11 of the first 33 broken limits were nested ternaries, from a rule that the ESLint config
of switchyard does not have. Such a finding is now a Nit, with the mark "rule from
skillsaw". This applies to ESLint only.
Fixed: two reports of one day had one folder, and the health of a file had its length in it.
The second report replaced the first page. Each run now writes a new folder:
-02, -03. The health of a file is now the mean of its functions
only, and CQ-LOC reports the length.
Fixed: the install hint did not fit the machine.quality doctor said pipx install lizard, and the machine had no
pipx. The command now gives the hint for what is present: pipx, then uv, then a virtual
environment.
Still open: the linter step for Go, Java, Kotlin and C# is not verified against a real tool
run, and a finding of the level Good can replace a measured limit in the report.
Config keys
All keys are optional. The livery keys apply to the report.
Key
Default
Meaning
Who reads it
docs.quality
docs/quality
The folder of the quality reports.
CLI
quality.base
The base of the pull request, then origin/main, origin/master, main, master
The git ref that quality measure and quality report compare with. --base wins.
CLI: src/quality/measure.ts
quality.thresholds.<key>
cc 10, floc 50, param 5, nest 5, loc 400, coupDelta 0.05, coupImporters 10, with other defaults for some languages
A threshold for all languages.
CLI: src/quality/spec.ts, for quality and hints
quality.thresholds.<language>.<key>
None
A threshold for one language: typescript, python, ruby, go, java, kotlin, csharp, rust.