Write your team’s instructions so that Fistron understands them
Your team may already write instructions for its AI coding agents: an
Agent Skill (a folder with SKILL.md), AGENTS.md, CLAUDE.md, Cursor
rules (.cursor/rules/*.mdc), CONTRIBUTING.md. Fistron reads the same
files, so the instructions you write once hold for your agents and for
Fistron alike. From each file it proposes:
- rules for the review of changes, each checked the cheapest reliable way: by a command of the file or your CI, by Fistron itself from the change (the form of a path, a page’s H1 title, relative links, no secret), or by a model, which never blocks unless your team turns it on;
- procedures for Fistron’s own work in those repositories (Fix it, a repair, a proposed test, a change of documentation, a pull or merge request): its steps, the checks it runs before it proposes, and the conventions of its requests (squashed, the issue linked, never merged by Fistron);
- context for Fištrónek and the investigations (where the wiki is, which board is read, who approves);
- requirements: the tools and their versions, the environment variables by name, the network a run needs.
Each proposal names the file, the commit and the lines it was read from, and nothing is used before a person of your team confirms it.
Have Fistron read them
An admin of the project:
- Opens the project’s Analysis sources and, under Repositories of
team instructions, names the repository that holds them, on GitHub
or GitLab, then the paths to read separated by spaces
(
gitlab:acme/skills skills/); Save the sources. - Opens Team instructions (under the project’s settings) and clicks Read the instructions. The project’s agent reads them with its own tokens at the commit of their branch.
- Each proposal says what it is, its source and whether it is new, changed or confirmed. Click Confirm, Edit (its text, and a rule’s level) or Dismiss on each; a proposal its instructions no longer have is under No longer in the instructions, with Remove it.
- Click Keep the decisions. They are the project’s team instructions, each version kept and audited. A dismissed proposal is not proposed again from the same text; after a new commit of the instructions, Read the instructions proposes only what changed.
Once confirmed, the rules join your team’s code review rules for the
repositories and paths of their scope: a pull or merge request there
gets a finding of each rule it breaks, named by the rule’s id and the
instruction file’s line it came from (a new path not of the form, a page
without an H1 title, a link that is not relative, a value that looks like
a secret). A rule a model reads never blocks unless your team turns it
on. The code Fistron writes in those repositories is reviewed by the same
rules, and a coding assistant that asks Fistron for the team’s rules
(fistron mcp, the tool review_rules) gets them with the procedures
for the files it is about to change.
Free text
A paragraph without MUST, MUST NOT, SHOULD or NEVER is read as context
only, never as a rule. When your instructions have such paragraphs, Team
instructions says how many and what the project’s model of the role
reviewer would cost to read them for rules: about how many tokens, and at
most how much by its endpoint’s prices. Read the free text with the
model reads them once you click it, within that cost; a call that would
cost more is not made. Each rule it proposes comes from a paragraph you can
see, is checked like any other (a command the paragraph names, Fistron’s
own check of a change, or a model, which never blocks), is marked with the
model that read it, and waits for your decision. fistron instructions check never calls a model: rewrite such a paragraph as a rule to have it
read the same way everywhere.
How Fistron follows a procedure
When Fistron writes a fix in a repository and files a confirmed
procedure covers (Fix it of a failed build’s cause, Fix it of a step of
a ticket’s plan, Repair the test, a proposed test), it runs the
procedure’s checks with the fix applied before it proposes it; so do
fistron ci fix and fistron causes fix in a directory that has the
project’s team instructions (instructions/team.json, as the project’s
agent keeps them). The
checks run in a temporary worktree of the checkout when there is one,
else in a shallow clone of the repository at the branch the fix was
written from, made by the project’s agent with its own token and removed
after. Each check runs from the repository’s root with an environment of
its own: the variables a shell needs and those your requirements name,
never the agent’s tokens.
- A check that passes is said on the fix and in its request.
- A check that fails makes the fix one to read, not to merge: it is never sent as a request, and its page says which check failed and its output.
- A check whose tool the agent’s environment does not have is not a failure of the fix: the fix says which tool is missing and how to install it, with the version your requirements name, and the request asks to run that check before merging.
The request of the fix says which procedure it followed and from which lines, each check’s outcome and what the procedure asks of a request. Fistron keeps what it can: squashed when it is merged (set on a GitLab merge request; on GitHub, whoever merges chooses Squash and merge), a closing reference to the ticket of the plan, and never merged by Fistron.
Export them back
What your project confirmed can go back to your team’s repository as
Agent Skills, so that your team’s agents and Fistron hold the same rules.
On Team instructions, Export as SKILL.md gives a SKILL.md a
skill to download: each rule in its words, each procedure with its steps
and checks, and a line for what it asks of a request when no step says it.
A level your team changed in Fistron is kept in the skill’s front matter
(levels: [team.docs-wiki.page-say-who-owns-it=note]), and Fistron reads
it back. On the command line, in the project’s directory:
fistron instructions export --out .
fistron instructions check skills
The check reads the export back to the same rules. Commit the files to your team’s repository as any change, with its review: Fistron pushes nothing.
How to write a rule anyone can check
These hold for every team, whatever it builds:
- One rule a line, one requirement each. “Pages are lowercase and start with a title” is two rules.
- Start it with MUST, MUST NOT or SHOULD. MUST and MUST NOT ask for a change when they are broken; SHOULD is a warning.
- Say how it is checked: the command that checks it (in backticks, as you would run it from the repository’s root), or what to look at in the change (“a file’s path”, “the page’s first line”, “a link”). A rule no one can check is read by a model and never blocks.
- Say what it applies to: the paths (
docs/**), the language, the kind of change. A rule without a scope holds for every file of every repository the instructions apply to. - Write the rule, not its reason only. “We had outages from long timeouts” is context; “A request’s timeout MUST NOT exceed 30 s” is a rule.
- Write what is true of the change, not of a person: “The change MUST include a test”, never “Ada reviews the tests”.
- Keep rules and steps apart. A rule holds whatever the task; a step is one thing done in an order. “MUST NOT” inside a step is hard to find later: put it under Rules.
- What an agent may or may not do (merge, push, run against a live environment, approve) is a convention of the procedure, not a rule of the change: write it under Rules all the same, Fistron keeps it with the procedure (“never merge without an approval”: Fistron never merges).
- Prefer a check your CI already runs, and name the CI file as the source of truth, so that the rule and the build never disagree.
The format Fistron reads best
One skill a workflow, a folder of its own with its SKILL.md. Its front
matter names it and says when it is used:
---
name: docs-wiki
description: Use when asked to add or change a page of the team's wiki in acme/docs.
---
name is kebab-case. description starts “Use when …” and names the
tasks and the repositories or paths. Then, all optional, plain Markdown:
## Scope: the repositories and paths, one a line (repository: acme/docs,paths: docs/**, mkdocs.yml).## Rules: one a line, MUST, MUST NOT or SHOULD, each with how it is checked.## Procedure: the steps in order: where each runs, what it should give, and when to stop.## Checks: the exact commands in anshblock, run from the repository’s root.## Requirements: the tools and their versions, the environment variables by name (never their values), the hosts it reaches.## Examples: a good and a bad change, where a rule needs one.
Text that follows no section still works: a sentence with MUST, MUST NOT,
NEVER, ALWAYS or SHOULD is a rule, an ordered list a procedure, an sh
block its checks, a paragraph context. The check below says what would
make it unambiguous.
A complete example
skills/docs-wiki/SKILL.md:
---
name: docs-wiki
description: Use when asked to add or change a page of the team's wiki in acme/docs.
---
# The team's wiki
The wiki is built with MkDocs from `docs/`; the whole team reads the published site.
## Scope
- repository: acme/docs
- paths: docs/**, mkdocs.yml
## Rules
- Page paths MUST be lowercase with hyphens, under `docs/`.
- Every page MUST start with an H1 title.
- Links between pages MUST be relative links.
- The index MUST list every page: run `python scripts/check_index.py`.
- NEVER put a token or a password in a page or a merge request.
- NEVER merge without an approval.
- A page SHOULD say who owns it.
## Procedure
1. Create a branch from main.
2. Write or change the page under `docs/`.
3. Run the checks below; stop when one fails and say its output.
4. Open a merge request to your fork, squashed, and link the issue.
## Checks
```sh
mkdocs build --strict
python scripts/check_index.py
```
## Requirements
- mkdocs >= 1.5
- `GITLAB_TOKEN` to open the merge request
- https://git.example.test
skills/ci-diagnosis/SKILL.md, a workflow Fistron already does (a pull
request’s failed checks), with the team’s way of doing it:
---
name: ci-diagnosis
description: Use when asked why the checks of a pull request of acme/shop failed.
---
# Diagnose the failed checks of a pull request
## Scope
- repository: acme/shop
## Rules
- NEVER run a runbook against a live environment without authorisation.
## Procedure
1. Read the failed jobs of the pull request and their logs.
2. Find the first error of each failed job.
3. Say the cause with the lines it rests on, and the job's link.
Do not write
- A secret, a token, a password or a private key. Name the environment
variable that holds it (
GITLAB_TOKEN). A file with a value that looks like one is refused with its line, and the value is never kept. - Internal values of shared infrastructure (a host’s address that changes, an account) where a variable or a link to your documentation will do.
- A step that works on one person’s machine only (
/home/ada/...). - Old instructions without saying so: mark them as legacy, or remove them.
Check them before you commit
fistron instructions check skills/
For each file it says how Fistron reads it: its rules with their method
(a command, Fistron’s own check of the change, or a model that never
blocks), its procedures with their checks and the conventions of their
requests, its context and requirements, and what is unclear, with the
line (“this “NEVER” is inside a procedure’s step; move it to Rules”; “a
model reads it and it never blocks: say how it is checked”). No model is
called. It exits 1 when a file is refused for a secret, and with
--strict also when something is unclear; --json prints the reading.
The same as a job of your CI, on every change of the instructions.
GitHub Actions (.github/workflows/instructions.yml):
name: instructions
on:
pull_request:
paths: ["skills/**", "AGENTS.md", "CLAUDE.md", ".cursor/rules/**"]
jobs:
check:
runs-on: ubuntu-latest
container: ghcr.io/fistron-io/fistron-core:<version>
steps:
- uses: actions/checkout@v4
- run: fistron instructions check --strict .
GitLab CI (.gitlab-ci.yml):
instructions:
image: ghcr.io/fistron-io/fistron-core:<version>
rules:
- changes: ["skills/**/*", "AGENTS.md", "CLAUDE.md", ".cursor/rules/**/*"]
script:
- fistron instructions check --strict .
On your own machine, the command line installs with
curl -fsSL https://get.fistron.io | sh.