Fistron docs

fistron.io

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:

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:

  1. 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.
  2. 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.
  3. 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.
  4. 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.

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:

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:

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

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.