More
The rules
A rule is a Markdown file that the agent reads when it plans, writes and reviews. The skills name each rule by its file name.
- Why
- Where the files are
- Simplified Technical English
- State machines
- Enum comparisons
- Interviews
- Config keys
Why rules ship with the skills
A metric finds a long function. It does not find a design problem, such as a status field that five functions assign. A person finds such a problem in a review, if the person has time. A rule tells the agent what to look for, how to recognise it, and what to write. The same rule applies in a plan, in the code and in a review. When a rule and a metric do not agree, the rule wins.
Where the files are
.claude/rules/afternpx @skillsaw/cli install, for Claude Code..agents/rules/after the same command, for other agents.rules/of the skillsaw plugin, when you use the Claude Code plugin.
The files in your repo are yours. You can change each rule, and the skills then use your text.
Simplified Technical English
simplified-technical-english.md
The agent writes all text for people in ASD-STE100: comments, commit messages, pull request text, documents and the pages of the skills. Many readers of a codebase do not have English as a first language, and many read through a translation tool. STE text is clear to them.
- Use a word with one meaning only: "show", not "display"; "make sure", not "ensure".
- Use the active voice and the simple tenses. Use the imperative for an instruction.
- Write one topic in each sentence: 20 words or fewer for an instruction, 25 for a description.
- Do not use a phrasal verb, or the
-ingform of a verb as a noun. - Write the fewest words that do the job. Say each fact one time, and point to it after that.
Code, commands, error messages and the UI text of a product are not in scope. This guide obeys the rule too.
Why the skills are short
An agent reads the whole skill each time that it runs. Each word that does not change what the
agent does costs time and tokens, and it hides the words that do. Each skill thus has a budget:
1500 words for SKILL.md, 1500 for each reference file, and 5000 for the whole
skill. A test in the skillsaw repo fails when a skill is over its budget. The skills keep their
articles and their full STE grammar: they are short because they say each fact one time, not
because they drop words.
State machines
state-machines.md
An implicit state machine is code that has states and permitted changes, but no one place that says which changes are valid. A status field that many functions assign is one. Three booleans where only some combinations are possible is one. Such code permits states that must not exist, and a line-by-line review does not find them.
The rule tells the agent how to recognise the smell and what to do: write the states as an enum, write one definition with each permitted transition, and change the state only with an event. It has a table with one library for each language. It also says when not to make a machine: when the values are independent.
For TypeScript and JavaScript, the full rule is switchyard-state-machines.md,
from the Switchyard project.
Enum comparisons
enum-comparisons.md
A comparison with a string literal, such as status == "failed", is an enum that
the code does not declare. A wrong letter in the string is not an error. A rename does not
find each use. Nothing tells you which values exist. The rule tells the agent to declare the
enum and to compare its members.
A rule can be more strict than you think is necessary. In the example review, the status of a design was a TypeScript union, which the compiler checks. The rule made it an Important finding. The agent kept the level, because "the rule wins", and said the real cost in the evidence: the list of values was in two places. You can change the rule in your repo.
Interviews
skillsaw-interviews.md
This rule is the method that each skill uses for its interview. The start page gives the method. The rule also has two procedures that run one time for each repo:
- The livery. Find the name, the accent colour and the logo in the repo. Ask only for a value that is not there, or that has two candidates.
- The folders. Look at
docs/before the first page. If it has a different use, ask where the pages go.
The first real runs changed this rule more than each other file. Each skill page of this guide says what changed.
Config keys
A team can name its own library for a language. The agent reads these keys. The CLI does not read them.
| Key | Default | Meaning | Who reads it |
|---|---|---|---|
rules.libraries.<language>.stateMachine | The table in state-machines.md | The state machine library of one language. | Agent: the rule state-machines.md |
rules.libraries.<language>.enum | The table in enum-comparisons.md | The enum library or feature of one language. | Agent: the rule enum-comparisons.md |