# SPARK

SPARK is a complete software development methodology for your coding agents, built on top of a set of composable skills and some initial instructions that make sure your agent uses them.


## Quickstart

Give your agent SPARK: [Claude Code](#claude-code), [Antigravity](#antigravity), [Codex App](#codex-app), [Codex CLI](#codex-cli), [Cursor](#cursor), [Factory Droid](#factory-droid), [Gemini CLI](#gemini-cli), [GitHub Copilot CLI](#github-copilot-cli), [Kimi Code](#kimi-code), [OpenCode](#opencode), [Pi](#pi).

## How it works

It starts from the moment you fire up your coding agent. As soon as it sees that you're building something, it *doesn't* just jump into trying to write code. Instead, it steps back and asks you what you're really trying to do. 

Once it's teased a spec out of the conversation, it shows it to you in chunks short enough to actually read and digest. 

After you've signed off on the design, your agent puts together an implementation plan that's clear enough for an enthusiastic junior engineer with poor taste, no judgement, no project context, and an aversion to testing to follow. It emphasizes true red/green TDD, YAGNI (You Aren't Gonna Need It), and DRY. 

Next up, once you say "go", it launches a *subagent-driven-development* process, having agents work through each engineering task, inspecting and reviewing their work, and continuing forward. It's not uncommon for your agent to work autonomously for a couple hours at a time without deviating from the plan you put together.

There's a bunch more to it, but that's the core of the system. And because the skills trigger automatically, you don't need to do anything special. Your coding agent just has SPARK.

## Installation

Installation differs by harness. If you use more than one, install SPARK separately for each one.

### Native Installer (Recommended)

The native installer auto-detects which coding agents you have installed and provides an interactive checklist menu to set up SPARK for them — skills AND hooks — with zero external dependencies.

**Interactive Install:**

```bash
bash bin/spark-install.sh
```
*By default, this opens an interactive 0–9 checkbox menu where detected agents are pre-selected. Press `Enter` to confirm.*

**Non-Interactive / CI Auto-Install:**

```bash
bash bin/spark-install.sh -y           # Auto-install to all detected agents
bash bin/spark-install.sh --agent=claude-code,cursor  # Target specific agents
```

**Global install** (applies to all projects):

```bash
bash bin/spark-install.sh -g
```

**Atomic Update:**

To compare your installed versions against the registry and perform an atomic reinstall across your agents:

```bash
bash bin/spark-update.sh
bash bin/spark-update.sh -g            # Update global install
```

**Clean Uninstall:**

To safely remove SPARK skills and hooks without deleting or damaging your host agent configuration directories:

```bash
bash bin/spark-uninstall.sh
bash bin/spark-uninstall.sh -g         # Uninstall global install
bash bin/spark-uninstall.sh --agent=claude-code  # Partial uninstall for specific agent
```

### NPM Meta-Installer

Alternative if you prefer using npm (requires Node.js). These commands act as thin wrappers around the native scripts (`bin/spark-*.sh`), executing the exact same bash automation and supporting the same options:

```bash
# Install (interactive menu by default, or use -y to auto-install)
npx @adityaaria/spark install
npx @adityaaria/spark install -g       # Install to global agent config
npx @adityaaria/spark install --force  # Re-install over existing installations

# Update
npx @adityaaria/spark update
npx @adityaaria/spark update -g        # Update global install

# Uninstall
npx @adityaaria/spark uninstall
npx @adityaaria/spark uninstall -g     # Uninstall global install
```

### Claude Code

SPARK is available via the [official Claude plugin marketplace](https://claude.com/plugins/spark)

#### Official Marketplace

- Install the plugin from Anthropic's official marketplace:

  ```bash
  /plugin install spark@claude-plugins-official
  ```

#### SPARK Marketplace

The SPARK marketplace provides SPARK and some other related plugins for Claude Code.

- Register the marketplace:

  ```bash
  /plugin marketplace add adityaaria/SPARK-marketplace
  ```

- Install the plugin from this marketplace:

  ```bash
  /plugin install spark@spark-marketplace
  ```

### Antigravity

Install SPARK as a plugin from this repository:

```bash
agy plugin install https://github.com/adityaaria/SPARK
```

Antigravity runs the plugin's session-start hook, so SPARK is active from
the first message. Reinstall with the same command to update.

### Codex App

SPARK is available via the [official Codex plugin marketplace](https://github.com/openai/plugins).

- In the Codex app, click on Plugins in the sidebar.
- You should see `SPARK` in the Coding section.
- Click the `+` next to SPARK and follow the prompts.

### Codex CLI

SPARK is available via the [official Codex plugin marketplace](https://github.com/openai/plugins).

- Open the plugin search interface:

  ```bash
  /plugins
  ```

- Search for SPARK:

  ```bash
  spark
  ```

- Select `Install Plugin`.

### Cursor

- In Cursor Agent chat, install from marketplace:

  ```text
  /add-plugin spark
  ```

- Or search for "spark" in the plugin marketplace.

### Factory Droid

- Register the marketplace:

  ```bash
  droid plugin marketplace add https://github.com/adityaaria/SPARK
  ```

- Install the plugin:

  ```bash
  droid plugin install spark@spark
  ```

### Gemini CLI

- Install the extension:

  ```bash
  gemini extensions install https://github.com/adityaaria/SPARK
  ```

- Update later:

  ```bash
  gemini extensions update spark
  ```

### GitHub Copilot CLI

- Register the marketplace:

  ```bash
  copilot plugin marketplace add adityaaria/SPARK-marketplace
  ```

- Install the plugin:

  ```bash
  copilot plugin install spark@spark-marketplace
  ```

### Kimi Code

SPARK is available in Kimi Code's plugin marketplace.

- Open Kimi Code's plugin manager:

  ```text
  /plugins
  ```

- Go to `Marketplace` > `SPARK` and install it.

- Or install directly from this repository:

  ```text
  /plugins install https://github.com/adityaaria/SPARK
  ```

- Detailed docs: [docs/README.kimi.md](docs/README.kimi.md)

### OpenCode

OpenCode uses its own plugin install; install SPARK separately even if you
already use it in another harness.

- Tell OpenCode:

  ```
  Fetch and follow instructions from https://raw.githubusercontent.com/adityaaria/SPARK/refs/heads/main/.opencode/INSTALL.md
  ```

- Detailed docs: [docs/README.opencode.md](docs/README.opencode.md)

### Pi

Install SPARK as a Pi package from this repository:

```bash
pi install git:github.com/adityaaria/SPARK
```

For local development, run Pi with this checkout loaded as a temporary package:

```bash
pi -e /path/to/spark
```

The Pi package loads the SPARK skills and a small extension that injects the `using-spark` bootstrap at session startup and again after compaction. Pi has native skills, so no compatibility `Skill` tool is required. Subagent and task-list tools remain optional Pi companion packages.

## The Basic Workflow

1. **brainstorming** - Activates before writing code. Refines rough ideas through questions, explores alternatives, presents design in sections for validation. Saves design document.

2. **using-git-worktrees** - Activates after design approval. Creates isolated workspace on new branch, runs project setup, verifies clean test baseline.

3. **writing-plans** - Activates with approved design. Breaks work into bite-sized tasks (2-5 minutes each). Every task has exact file paths, complete code, verification steps.

4. **subagent-driven-development** or **executing-plans** - Activates with plan. Dispatches fresh subagent per task with two-stage review (spec compliance, then code quality), or executes in batches with human checkpoints.

5. **test-driven-development** - Activates during implementation. Enforces RED-GREEN-REFACTOR: write failing test, watch it fail, write minimal code, watch it pass, commit. Deletes code written before tests.

6. **requesting-code-review** - Activates between tasks. Reviews against plan, reports issues by severity. Critical issues block progress.

7. **finishing-a-development-branch** - Activates when tasks complete. Verifies tests, presents options (merge/PR/keep/discard), cleans up worktree.

**The agent checks for relevant skills before any task.** Mandatory workflows, not suggestions.

## What's Inside

### Skills Library

**Testing**
- **test-driven-development** - RED-GREEN-REFACTOR cycle (includes testing anti-patterns reference)

**Debugging**
- **systematic-debugging** - 4-phase root cause process (includes root-cause-tracing, defense-in-depth, condition-based-waiting techniques)
- **verification-before-completion** - Ensure it's actually fixed

**Collaboration** 
- **brainstorming** - Socratic design refinement
- **writing-plans** - Detailed implementation plans
- **executing-plans** - Batch execution with checkpoints
- **dispatching-parallel-agents** - Concurrent subagent workflows
- **requesting-code-review** - Pre-review checklist
- **receiving-code-review** - Responding to feedback
- **using-git-worktrees** - Parallel development branches
- **finishing-a-development-branch** - Merge/PR decision workflow
- **subagent-driven-development** - Fast iteration with two-stage review (spec compliance, then code quality)

**Meta**
- **writing-skills** - Create new skills following best practices (includes testing methodology)
- **using-spark** - Introduction to the skills system

## Keeping Project Memory Fresh

`.docs/` project memory stays current automatically via Delta Scan Mode
(`project-scanner`) and a staleness gate built into `audit`/`bug-fix`/
`enhancement` — no setup needed. An optional scheduled CI workflow template
for your own project's repo is also available: see
[docs/auto-refresh-project-memory.md](docs/auto-refresh-project-memory.md).

## Philosophy

- **Test-Driven Development** - Write tests first, always
- **Systematic over ad-hoc** - Process over guessing
- **Complexity reduction** - Simplicity as primary goal
- **Evidence over claims** - Verify before declaring success

Read [the original release announcement](https://blog.fsck.com/2025/10/09/spark/).

## Contributing

The general contribution process for SPARK is below. Keep in mind that we don't generally accept contributions of new skills and that any updates to skills must work across all of the coding agents we support.

1. Fork the repository
2. Switch to the 'dev' branch
3. Create a branch for your work
4. Follow the `writing-skills` skill for creating and testing new and modified skills
5. Submit a PR, being sure to fill in the pull request template.

Skill-behavior tests use the drill eval harness from [spark-evals](https://github.com/prime-radiant-inc/spark-evals/), cloned into `evals/` — see `evals/README.md` for setup. Plugin-infrastructure tests live at `tests/` and run via the relevant `run-*.sh` or `npm test`.

See `skills/writing-skills/SKILL.md` for the complete guide.

## Updating

SPARK updates are somewhat coding-agent dependent, but are often automatic.

## License

MIT License - see LICENSE file for details

## Community

SPARK is built by [Aditya Aria](https://blog.fsck.com) and contributors.

- **Community**: Use the repository issues and discussions for support, questions, and sharing what you're building with SPARK
- **Issues**: https://github.com/adityaaria/SPARK/issues
