metaphasor
Docs menu

Your first project

Create a small Snake project, adopt its requirements, connect an agent, and inspect the implementation and verification records it produces. The tutorial also resolves a question the requirements left open and traces a file to the decision behind it.

Before you start

The outputs shown are examples. Your identifiers and paths will differ.

  1. Define the requirements

    Create a folder named snake and save this file in it. Files at the project root are intent: the requirements, in prose. Any text format is accepted. In Markdown, each heading starts a section.

    snake/game.md
    # The game
    
    ## The board
    The board is 20 squares wide and 20 high. The snake starts in the middle, three squares long, moving right.
    
    ## Moving
    Each tick the snake moves one square in the direction it faces. The arrow keys turn it. It cannot turn straight back on itself.
    
    ## Walls
    If the head leaves the board the game is over.
  2. Initialize the project

    cd snake
    phasor init
    Started a Phasor project in /home/ada/snake: 1 intent file
    project rules go in memory: `phasor remember rules/project '<text>'` (a rules.md at the root is intent)

    phasor init creates .phasor/ in the folder: the record in .phasor/record/, and the work folder for code and tests, .phasor/work/. It also writes agent instructions to AGENTS.md at the root, with a pointer file, CLAUDE.md, for clients that look for that name.

    Record one project rule. Rules are kept in memory and delivered to agents with their work.

    phasor remember rules/project "Python standard library only. Tests use unittest and run from .phasor/work."
  3. Adopt the intent

    An intent file has no effect until it is adopted. Adoption records the file's current version and makes it open work.

    phasor adopt
    Adopted game.md (adoption a09e0c72b873)
    phasor status
    1 intent file, 1 open (game.md), nothing waiting on you, nothing changed in .phasor/work
    1 step, head a09e0c72b873
  4. Connect an agent

    phasor mcp serves the project's operations to an agent as MCP tools. If your MCP client reads .mcp.json from the project folder, save this there. For other clients, see Agent integration.

    snake/.mcp.json
    {"mcpServers": {"phasor": {
      "command": "phasor",
      "args": ["mcp", "-C", "C:\\Users\\ada\\snake"],
      "env": {"PHASOR_AGENT": "builder-1", "PHASOR_MODEL": "<the model id>"}
    }}}

    Start the agent in the folder and ask it to work on what is next. AGENTS.md describes the workflow. If your client does not load that file by itself, tell the agent to read it. The agent calls next and receives the open intent with its context.

  5. Inspect the implementation

    Following its instructions, the agent writes code and tests in .phasor/work/, adds a check that runs the tests, and lands the work with a rationale. The landing runs the check and records the result. Once it has landed, game.md is no longer open.

    phasor status
    1 intent file, nothing waiting on you, nothing changed in .phasor/work
    2 steps, head fd7c74069e90
    phasor audit game.md --paths
    .phasor/work/.checks/unit.json
    .phasor/work/snake/__init__.py
    .phasor/work/snake/game.py
    .phasor/work/tests/test_game.py

    phasor audit follows an intent file forward to the files that answer it. Without --paths it prints each landing's rationale and check results, as JSON.

  6. Resolve an open question

    game.md does not say what happens when the snake runs into itself. The agent instructions leave a point the intent does not decide to the agent, which records its decision in a thread. An agent can also ask. In this run it built what was written and opened a thread blocked on the owner. A thread is not a step, so the head is unchanged.

    phasor status
    1 intent file, 1 waiting on you, nothing changed in .phasor/work
      waiting on you: game.md does not say what happens when the snake runs into its own body. I built walls only; the sna... (thread 77b84a2fb424): the owner's call on the snake's own body
    2 steps, head fd7c74069e90
    phasor discuss post 77b84a2fb424 "Decision: yes. Running into its own body ends the game." --marker concluded

    The question and the decision are now in the record. Threads that reference game.md are delivered with later work on that file.

  7. Revise the intent

    The decision changes what the software is required to do, so it belongs in the intent. Add a section to game.md, then adopt it with the reason and the thread it answers.

    snake/game.md, added at the end
    ## Its own body
    If the head runs into any part of the snake's own body the game is over.
    phasor adopt --context "Answering the builder's question." --context-ref 77b84a2fb424
    Adopted game.md (adoption c36e7edbedee)
    phasor status
    1 intent file, 1 open (game.md), nothing waiting on you, nothing changed in .phasor/work
    3 steps, head c36e7edbedee

    The adoption opens only the section that changed. phasor next offers game.md#its-own-body, with the context given at adoption.

  8. Inspect implementation provenance

    After the agent has landed the change, phasor trace follows a file back through its versions.

    phasor trace .phasor/work/snake/game.py
    {
      "end": "creation",
      "ok": true,
      "walk": [
        {
          "content": "e9281d305177",
          "context": {
            "68a1f9c16656": {
              "refs": [
                "77b84a2fb424"
              ],
              "text": "Running into its own body ends the game, as the owner decided."
            }
          },
          "covers": {
            "68a1f9c16656": [
              "4f3e847d004c#its-own-body"
            ]
          },
          "producedBy": "68a1f9c16656",
          "version": "677c77c6bccf"
        },
        … the version before it, with its own rationale
      ]
    }

    The newest version of the file was produced by one landing. The entry gives that landing's rationale, the section of intent it covers, and the thread that held the decision. Provenance is recorded for each version of a file, not for each line.

Next steps