---
title: "Your first Spell Loop: from a feature description to an open pull request"
type: tutorials
kind: tutorial
documentedFor: "1.14.0"
updated: "2026-10-30"
canonical: "https://arcaneai.net/docs/tutorials/first-spell-loop"
---

# Your first Spell Loop: from a feature description to an open pull request

In this tutorial you take one small feature from a sentence to an open pull request, running each phase of the Spell Loop yourself and checking what each spell leaves in the repository. The feature is a `wordcount` command-line tool in plain Node.js, small enough to finish in one sitting.

## Prerequisites

- The [Quickstart](/docs/tutorials/quickstart) done: the `spell` command installed and an AI client that runs spells.
- Node.js 20 or later, and git with your name and email set.
- A GitHub account, and the GitHub CLI (`gh`) signed in. The tutorial creates a private repository you can delete afterwards.

## Step 1: Create a repository with Arcane

Create an empty private repository on GitHub and clone it.

```bash
gh repo create arcane-tutorial --private --clone
cd arcane-tutorial
```

Install Arcane, keeping work tracking inside the repository, and commit.

```arcane
spell init --profile full --tracking-mode internal
```

```bash
git add -A
git commit -m "Add Arcane"
git push -u origin main
```

Checkpoint: `git log --oneline` shows one commit, `Add Arcane`, and `.arcane.json` records `"tracking_mode": "internal"`.

## Step 2: Open a session

Open the folder in your AI client and start a session, naming what you are about to work on.

```arcane
/spell-open-session wordcount CLI
```

The spell reads the repository (the README, `TODO.md`, `DECISIONS.md`, the handoff and the journal) and checks for drift before it suggests anything. It changes no files.

Checkpoint: the report has a State Snapshot, a Next Session Plan and a Suggested Session Name, with a branch name in the form `sessions/YYYY-MM-DD-wordcount-cli`. The spell does not create the branch; Step 5 does.

## Step 3: Plan the feature

Run the planning spell and describe the feature when it asks.

```arcane
/spell-plan
```

Use this description: "Add a `wordcount` command-line tool: `node wordcount.js <file>` prints the number of words in the file, and prints an error and exits 1 when the file does not exist. Plain Node.js 20, no dependencies, tests with `node --test`." The spell asks a few questions about the problem, the users and the constraints, then asks you to approve the PRD. Answer in your own words; the run behind this page said that words are separated by whitespace, that an empty file prints 0, and that a missing argument prints usage and exits 1.

Checkpoint: `features/wordcount-cli/PRD.md` exists, with sections for the problem statement, target users, requirements, constraints and acceptance criteria.

## Step 4: Design it

```arcane
/spell-architect
```

The spell reads the PRD, asks about anything the PRD leaves open, records its decisions, and splits the work into stories. Approve them when it asks.

Checkpoint: `features/wordcount-cli/architecture.md` and `features/wordcount-cli/stories.json` exist, and every story in `stories.json` has `"passes": false`.

## Step 5: Build it

```arcane
/spell-implement
```

Before its first commit, the spell asks to create the session branch named in Step 2; approve it. If it asks for a domain for the commit author's email, give one you use, or `example.com`. It commits the planning files from Steps 3 and 4 first, on their own, then takes one story at a time: it writes the test, then the code, runs the tests, and asks you to approve each commit, showing the diff and the message first.

Checkpoint: you are on the session branch, every story in `stories.json` has `"passes": true` with its test evidence, `features/wordcount-cli/progress.txt` has one entry per story, and `git log` shows the planning commit and then one commit per story.

## Step 6: Test it

```arcane
/spell-test all
```

The spell runs the whole suite, checks coverage against the project's thresholds, and maps each acceptance criterion to the test that proves it.

Checkpoint: the spell reports every test passing, the coverage it measured, and each acceptance criterion mapped to a passing test or a manual check.

## Step 7: Review it

Start a new session in your client for the review, so the code is not reviewed by the session that wrote it.

```arcane
/spell-review
```

The spell reviews the change through every lens (correctness, security, performance, tests, naming and architecture) and rates each finding high, medium or low. When it asks for the feature folder, answer `features/wordcount-cli`.

Checkpoint: `features/wordcount-cli/assessments/review-YYYY-MM-DD.md` exists with a Verdict section. If the verdict is not to approve, go back to Step 5 with the findings.

## Step 8: Open the pull request

The review report is not committed yet. Commit it, and approve the commit when asked.

```arcane
/spell-commit-work
```

Then open the pull request.

```arcane
/spell-create-pull-request
```

The spell checks the branch, pushes it, writes the title and description from the commit log, and creates the pull request on GitHub.

Checkpoint: the spell prints the pull request's URL, and the pull request is open on GitHub.

## Step 9: Prepare to ship

```arcane
/spell-ship
```

The spell checks that every phase is complete, runs its pre-deploy checklist and presents a ship report. This repository has no CI pipeline, so the report marks the CI checks as not applicable and the deployment gate as not met. It does not merge until you approve.

Checkpoint: the ship report lists each check, and the spell is waiting for your approval.

## Finish

To merge, answer yes to the spell's approval question in the chat. It merges the pull request without squashing, so each commit keeps its author. You can also stop here and delete the repository.

## Next steps

- Understand why the loop is shaped this way in [Methodology: the Spell Loop](/docs/explanation/methodology).
- Read what each spell does in full: [`spell-plan`](/docs/reference/spell-plan), [`spell-architect`](/docs/reference/spell-architect), [`spell-implement`](/docs/reference/spell-implement), [`spell-test`](/docs/reference/spell-test), [`spell-review`](/docs/reference/spell-review), [`spell-ship`](/docs/reference/spell-ship).
