# Defect driven specification

> Defect driven specification is an open-source agent skill for developer tools. Guides agents to turn each bug into a named, tested spec before fixing it. It is available on Claude Code.

- **Kind:** Skill
- **Pricing:** Open source
- **Platforms:** Claude Code
- **Website:** https://github.com/zerotechdebt/ffflow/tree/main/plugin/skills/defect-driven-specification
- **Repository:** https://github.com/zerotechdebt/ffflow
- **GitHub stars:** 6
- **License:** Apache-2.0
- **Skill name:** defect-driven-specification
- **Collection:** https://github.com/zerotechdebt/ffflow
- **Categories:** [developer tools](https://ai-powered.com/categories/developer-tools)
- **Listing updated:** 2026-12-04

## About

This is a reference rulebook for handling bug-driven changes. It lays out a loop in which a reported defect is first written down as an explicit invariant, then captured as a scenario tagged as a known defect, and only then fixed, so the corrected behavior stays specified and enforced over time.

The rulebook defines three annotation tags for scenarios: one for behavior believed to be a bug, one for behavior that looks wrong but is deliberate, and one for behavior whose correctness cannot be determined. Each tag comes with a comment convention, such as BUG, LIKELY INTENT and ACTUAL for known defects, or RATIONALE for accepted risks. It also describes how annotations should be treated as work items, with counts trending toward zero and unresolved ambiguities reviewed within a set window.

The skill is described as loaded into context by other planning and change workflows rather than invoked directly. It notes that annotation form varies by specification level and gives an example audit configuration with limits on known-defect counts and the maximum age of unverified intent. It has no scripts and sets no tool permissions.

## When your agent uses it

> Every bug becomes a spec before it becomes a fix — the defect-driven loop with @known-defect, @accepted-risk, @unverified-intent annotations. L1+ reference rulebook.

## What it can access

From a static check of the files on GitHub; nothing was run.

- [Instructions only, no scripts](https://github.com/zerotechdebt/ffflow/tree/HEAD/plugin/skills/defect-driven-specification)
- [License: Apache-2.0](https://github.com/zerotechdebt/ffflow/tree/HEAD/plugin/skills/defect-driven-specification)

## Features

- **Invariant-first bug workflow:** Lays out a step-by-step loop that starts by naming the violated invariant before any code change.
- **Defect annotation tags:** Defines three tags for known defects, accepted risks and unverified intent, each with a comment format.
- **Annotation hygiene rules:** Explains how annotation counts and ages should be tracked and resolved as work items.
- **Per-level annotation forms:** Shows how annotations are written across specification levels from inline comments to Gherkin tags.
- **Anti-pattern checklist:** Lists common mistakes such as fixing bugs without recording the invariant or misusing accepted-risk tags.

## Good for

- Write a spec entry for a bug before fixing it
- Tag a failing scenario as a known defect
- Document why a surprising behavior is intentional
- Flag ambiguous behavior for stakeholder review
- Set up audit limits on known-defect counts

## Install

### Claude Code

This skill ships in the `fff` plugin. In Claude Code, add the marketplace and install the plugin (it may include other skills too):

```sh
/plugin marketplace add zerotechdebt/ffflow
/plugin install fff@ffflow
```

Or copy only this skill to `~/.claude/skills/defect-driven-specification`:

```sh
tmp=$(mktemp -d) &&
git clone --depth 1 https://github.com/zerotechdebt/ffflow.git "$tmp" &&
mkdir -p ~/.claude/skills &&
rm -rf ~/.claude/skills/defect-driven-specification &&
cp -R "$tmp/plugin/skills/defect-driven-specification" ~/.claude/skills/defect-driven-specification &&
rm -rf "$tmp"
```

For one project only, put the folder in `.claude/skills/defect-driven-specification` inside it instead.

### Codex

Copy the skill folder to `~/.agents/skills/defect-driven-specification` to use it in every repository:

```sh
tmp=$(mktemp -d) &&
git clone --depth 1 https://github.com/zerotechdebt/ffflow.git "$tmp" &&
mkdir -p ~/.agents/skills &&
rm -rf ~/.agents/skills/defect-driven-specification &&
cp -R "$tmp/plugin/skills/defect-driven-specification" ~/.agents/skills/defect-driven-specification &&
rm -rf "$tmp"
```

For one repository only, put the folder in `.agents/skills/defect-driven-specification` inside it instead.

### Cursor

Copy the skill folder to `~/.cursor/skills/defect-driven-specification` to use it in every project:

```sh
tmp=$(mktemp -d) &&
git clone --depth 1 https://github.com/zerotechdebt/ffflow.git "$tmp" &&
mkdir -p ~/.cursor/skills &&
rm -rf ~/.cursor/skills/defect-driven-specification &&
cp -R "$tmp/plugin/skills/defect-driven-specification" ~/.cursor/skills/defect-driven-specification &&
rm -rf "$tmp"
```

For one project only, put the folder in `.cursor/skills/defect-driven-specification` inside it instead.

### Gemini CLI

Run in a terminal (add `--scope workspace` to install it for the current workspace only):

```sh
gemini skills install https://github.com/zerotechdebt/ffflow.git --path plugin/skills/defect-driven-specification
```

Or copy the folder to `~/.gemini/skills/defect-driven-specification` yourself.

### VS Code

For GitHub Copilot in VS Code, copy the skill folder to `~/.copilot/skills/defect-driven-specification`:

```sh
tmp=$(mktemp -d) &&
git clone --depth 1 https://github.com/zerotechdebt/ffflow.git "$tmp" &&
mkdir -p ~/.copilot/skills &&
rm -rf ~/.copilot/skills/defect-driven-specification &&
cp -R "$tmp/plugin/skills/defect-driven-specification" ~/.copilot/skills/defect-driven-specification &&
rm -rf "$tmp"
```

For one project only, put the folder in `.github/skills/defect-driven-specification` inside it instead.

### Other agents

Get the folder:

```sh
git clone --depth 1 https://github.com/zerotechdebt/ffflow.git
```

Then copy `ffflow/plugin/skills/defect-driven-specification` into your agent's skills folder as `defect-driven-specification`. Agents that support SKILL.md read one folder per skill.

## FAQ

### Does Defect driven specification run any scripts or tools?

No. It has no scripts and is described as a reference rulebook that other workflows load as context, not a tool that is invoked directly.

### Which workflows load Defect driven specification?

The skill says it is loaded as context by plan-chat, characterize and work-issue when a bug-driven change is in scope.

### What are the three annotation tags?

@known-defect marks behavior believed to be a bug, @accepted-risk marks intentional behavior that looks wrong, and @unverified-intent marks behavior whose correctness is unclear.

### Is there a default review window for unverified intent?

Yes, the rulebook's default is 30 days, and the example audit configuration sets an age limit in days for these tags.

### How do I install Defect driven specification in Claude Code?

Copy the skill folder from GitHub to ~/.claude/skills/defect-driven-specification to use it in all your projects, or to .claude/skills/defect-driven-specification in one project. Or install the fff plugin, which includes it: /plugin marketplace add zerotechdebt/ffflow, then /plugin install fff@ffflow.

### Does Defect driven specification run scripts?

No. It is instructions only, with no scripts. This comes from a static check of the files on GitHub; nothing was run. Read the files before you install it.

### Which AI agents can use Defect driven specification?

Claude Code. It reads skills in the SKILL.md format; the install steps on this page show where to put the folder.

### What are the best alternatives to Defect driven specification?

The closest alternatives to Defect driven specification are Spec first development, Bug hunt, Spec driven development, Spec driven development and Total specification.

## Where this comes from

- Description: from the skill's own SKILL.md.

## Alternatives

- [Spec first development](https://ai-powered.com/skills/spec-first-development): Spec first development is an open-source agent skill for developer tools.
- [Bug hunt](https://ai-powered.com/skills/bug-hunt): Bug hunt is an open-source agent skill for developer tools.
- [Spec driven development](https://ai-powered.com/skills/spec-driven-development-addyosmani): Spec driven development is an open-source agent skill for developer tools.
- [Spec driven development](https://ai-powered.com/skills/spec-driven-development-ajyadav013-2): Spec driven development is an open-source agent skill for developer tools.
- [Total specification](https://ai-powered.com/skills/total-specification): Total specification is an open-source agent skill for developer tools.
- [Debugging](https://ai-powered.com/skills/debugging): Debugging is an open-source agent skill for developer tools.
- [Semgrep rule author](https://ai-powered.com/skills/semgrep-rule-author): Semgrep rule author is an open-source agent skill for security.
- [Mt spec](https://ai-powered.com/skills/mt-spec): Mt spec is an open-source agent skill for developer tools.

---
Source: https://ai-powered.com/skills/defect-driven-specification
