Writing

Bug fix

Describe a bug so your agent can fix it in one pass: symptom, expected behaviour, steps, cause and what must keep working, plus a regression scenario.

The Bug fix creator collects what an agent needs to fix a bug without guessing. You say what happens now, what should happen, how to trigger it, where you think the cause is and what must keep working. Kitsune writes that into the project's planning files. Your agent then plans the fix, and the first task is a test that reproduces the bug.

To start one, choose New doc in the sidebar or on Home, then Bug fix. If a project is open when you press New doc, that project is already picked. The project has to be on this computer. The Bug fix creator is free on every plan.

The steps#

The step indicator shows "Step N of 8" for OpenSpec and "Step N of 7" for Kitsune docs, which has no Affected spec step. You can open any step at any time. A step with something missing is marked incomplete. It never blocks you.

Basics#

Choose the project and a title that says what breaks and where ("Export fails for empty invoices"). Kitsune proposes the name as fix- plus the title in kebab-case (fix-export-fails-for-empty-invoices). No other change or work unit may use it.

Symptom#

Describe what happens now (required), who or what it hits and how often. You can also paste logs or a stack trace. The logs field keeps up to 200 lines. Paste more and it keeps the first 200 and tells you. The logs end up in Git, so Review warns when they look like they contain a password, a token or a key: "These logs may hold a secret — remove it before you create".

Expected#

Write what should happen instead, as one EARS sentence. Unwanted (If … then the system shall …) and Event (When …, the system shall …) are at the top of the list because they fit most bugs:

If an invoice has no lines, then the system shall export it with a zero total.

This sentence becomes the regression scenario.

Reproduce#

List the steps, at least one. Enter adds the next step, and Backspace in an empty step removes it. Then give the environment (version, platform, data) and how often it happens: always, sometimes or once so far.

Cause (optional)#

Write what you think causes the bug and mark it Hypothesis (the default) or Confirmed. Add the files or the area where the fix probably belongs. The mark goes into the files, so the agent checks a hypothesis before it relies on it. If you leave the cause empty, the files say it is unknown.

Unchanged (optional)#

List the behaviours that must keep working after the fix. If you leave this empty, Review warns: "Say what must keep working — agents break neighbours".

Affected spec (OpenSpec only)#

The Bug fix creator on the Affected spec step: the requirement Partial refund chosen, its text, and the regression scenario Kitsune adds

Choose a capability from the project's specs, then the requirement the bug breaks. Kitsune shows the requirement's text and the scenario it will add. If no requirement covers the bug, choose No requirement covers this.

Review#

Review lists blocking problems and warnings, each linked to its field, and shows every file exactly as it will be written.

What gets written#

  • OpenSpec: Create runs openspec new change <name> and writes proposal.md from the CLI's template:

    • Why comes from the symptom and who is affected;
    • What Changes from the expected behaviour and the cause;
    • Impact from the files or area;
    • then Symptom (with the logs), Reproduce, Cause, Unchanged Behaviour and Regression Test.

    If you chose a requirement, Create also writes specs/<capability>/spec.md in the change. It copies the whole requirement from the spec under ## MODIFIED Requirements and adds a scenario Regression: <title> at the end. The change passes openspec validate --strict. If someone removed the requirement from the spec after you chose it, nothing is created and you choose again.

  • Kitsune docs: Create makes docs/work/<YYYY-MM-DD>-<name>/ and writes only spec.md, with type: bugfix and status: draft. Context holds the symptom, Scope the expected behaviour, and Out of scope what must keep working. Reproduce, Cause and Regression Test follow.

Once the change is archived, the regression scenario is part of the spec. The Tests tab then lists it as a test case under its requirement.

Create never overwrites a file, and it writes only inside the new change or unit folder. Until you create it, the bug fix is a draft on this computer, listed in Drafts as "Bug fix".

Start from a Jira issue#

On Home, Start a change on a Bug in My issues opens this creator filled in from the issue. A description section named Steps to reproduce fills Reproduce. Expected or Expected result fills Expected, as a sentence for you to rewrite. Everything else goes into Symptom. The created file gets a Source issue section with the link to the bug. See Start work from a Jira issue.

Hand to your agent#

After Create, Hand to your agent works as it does for a change brief. Start runs your agent CLI on the change, or you copy the prompt under Prefer to run your agent yourself?. Either way, the agent plans the fix in this order:

  1. A test that reproduces the bug and fails.
  2. The fix, kept to the files you named. If the agent finds the cause elsewhere, it says so.
  3. A check of every behaviour that must keep working.

For OpenSpec the agent writes only tasks.md, without design.md. For Kitsune docs it first reviews the bug while the spec is draft.

The Assistant can help on every step of the creator. It can summarise logs, write the expected behaviour or look for where the cause might be. Filling in fields with Apply needs Solo Pro.