Agent-First Development

Open source, MIT

Commands are the product.

A method
Define a command, prove it from the command line, then put any interface on it.
Four languages
TypeScript, Python, Rust and C++, each tested against the same contract.
A family of tools
Violet, Specimen, FAST-AF and more: the same idea taken to tokens, components and whole apps.

Change the interface.
Keep the software.

Live / local to this tab

Try itCheck a task off, or add one. Then open the Board.

Launch list Empty
    COMMAND LAYER
    Screentodo-listsuccess

    Ready.

      Fig. 01The inversion

      Your app isn't
      its buttons.

      It's what those buttons do. Put that capability in a command, and a screen becomes a choice. So does a terminal. So does an agent.

      Keep business logic out of the screen. Serve the same commands to agents over MCP, with no second API to build.

      Read the thinking
      todo-create.tsThe product
      export const createTodo = defineCommand({
        name: 'todo-create',
        description: 'Create a todo item from a title',
        mutation: true,
        expose: { mcp: true },
        input: z.object({
          title: z.string().min(1, 'Add a title').max(80),
          priority: z.enum(['low', 'medium', 'high']).default('medium'),
        }),
        async handler({ title, priority }) {
          const todo = await store.create({ title, priority });
          return success(todo, {
            reasoning: `Created "${title}" at ${priority} priority`,
            confidence: 1,
          });
        },
      });
      The demo's todo-create, as you'd write it with the TypeScript library. The list, the board, the terminal and the agent all call it.
      Fig. 02The handoff

      Your turn.
      Their turn.

      An agent shouldn't have to pretend to be a person clicking a button. Give it the same capability, directly.

      Scripted agent. Real commands. No model or account needed.

      Agent sessionSTANDBY

      “Give me a capability.
      I'll take it from here.”

      1. 01
        todo-list

        Read the shared state.

        waiting
      2. 02
        todo-create

        Create the requested task.

        waiting
      3. 03
        todo-list

        Verify the result.

        waiting

      Waiting for your handoff.

      Back to the shared list
      Fig. 03Design for the agent

      Access isn't enough.
      Agents need good UX.

      An agent asks four things of any capability: what can I do, what do you need, what comes back, and did it work. Answer them in the contract, with the care you'd give a screen.

      01 / Discover

      Make intent legible.

      A person scans the menus. An agent reads the contract: named capabilities, typed inputs, declared effects.

      People getA menu
      Agents get
      Purpose
      Inputs
      Effects
      Full command contract

      Know what a command takes, what it does and whether it changes state before calling it.

      02 / Understand

      Return more than data.

      A person gets a message on screen. An agent gets the outcome, the reasoning and a next step.

      People getA message
      Agents gettodo-list
      Outcome
      Reasoning
      Confidence
      Full command result

      Reasoning explains the outcome. Confidence is a signal, not permission to act.

      03 / Keep control

      Keep people in control.

      A person gets a confirmation dialog. An agent's caller gets the same pause, for what matters.

      People getA dialog
      Agents gettodo-clear / destructive

      A pause before the point of no return.

      Delete the shared demo tasks in this tab. There is no undo.

      No deletion requested.

      This caller asks before execution. Destructive metadata describes risk; it doesn't enforce authorization.

      Fig. 04The recovery

      A dead end.
      Or a way forward.

      “Something went wrong” isn't an answer. A useful error tells the next operator what to do.

      THE DIFFERENCE

      An error can be the next step, not the last one.

      REQUEST / READYtodo-create
      {
        "title": "",
        "priority": "high"
      }
      What comes back matters.
      // No title. No task.
      // The command will explain what's missing.
      Fig. 05The honesty check

      “If it can’t be done via CLI, the architecture is wrong.”

      One rule, applied to every feature. No UI-only code paths.

      Fig. 06Build with an agent

      Before it draws a screen,
      give it something to prove.

      A BRIEF FOR YOUR CODING AGENT
      Build the capability.
      Prove the job works.
      Then design the interface.

      A coding agent can implement a typed command, call it from the terminal and verify the result before a single component exists. The UI comes after the behavior is real.

      Read the workflow
      1. 01

        Define the contract.

        todo-create takes a title and priority, returns a structured result, and rejects missing input.

      2. 02

        Exercise both paths.

        Call the command with an empty title, then a valid one. Verify the error is actionable and the task is created.

      3. 03

        Test the whole job.

        Create a task, list it, check the outcome. A scenario tests the user's goal across commands.

      4. 04

        Give it a surface.

        Connect the form to the proven command. Keep the rules in the command layer, not in the component.

      Inspect the work

      Don't take it
      on faith.

      50 / 4

      Four backends pass one contract.

      50 shared test cases, and a CI workflow that runs them against the TypeScript, Python, Rust and C++ todo backends.

      A → B

      Scenarios that read like the job.

      Readable YAML scenarios express a goal, command steps and expected outcomes. Start with creating and verifying a task.

      Read the scenario

      Used to build its own tools.

      Alfred checks AFD architecture, language parity and command quality through CLI and MCP, returning CommandResult.

      Meet Alfred
      The AFD family

      The same rule,
      one layer up.

      AFD started as a method and a set of libraries. The projects around them take the same idea to components, design tokens, agent tooling and whole applications. All of them live in one repository, arranged here by what you want to do.

      Build commands

      • TypeScript

        The reference library: commands, an MCP server, a CLI and an in-process client, as nine npm packages.

        Beta, on npm

        Read more
      • Python

        The afd package: commands, an MCP server and a CLI, on the same contract.

        Beta, on PyPI

        Read more
      • Rust

        The afd crate: commands, an optional MCP server, and a build for WebAssembly.

        Preview, on crates.io

        Read more
      • C++

        A C++20 library for running commands inside an application, engine or tool.

        Preview, as a git tag

        Read more

      Design for agents

      • Violet

        A design token engine. Tokens live on a tree; each node inherits, overrides or removes, and one source exports to CSS, Swift, Kotlin and more.

        Preview, on npm Stands alone

        Open the terminal
      • FAST-AF

        A web component runtime and the component library built on it, violet-elements. The library is part of FAST-AF; it takes its look from Violet tokens. Each component has a record an agent reads before using it.

        Preview, on npm Stands alone

        See every component
      • Specimen

        A component bench. It renders in Chromium and records what actually happened, so two versions are compared on evidence.

        Preview, on npm Stands alone

        Compare two captures

      Run and operate

      • Umbel

        A server you run for agents, built from plugins: knowledge, memory and your own commands, over MCP and a command line, with every answer traced to its source.

        In development

        See a real run
      • Loam

        An application shell. Apps land in one chrome as plugins, and the shell's own state is commands, so agents drive it the way people do.

        In development

        Read more
      • Botcore

        A Python package of developer tooling. A repository installs it so its coding agent gets the same lint, test and skill commands as every other repository.

        Beta, on PyPI

        See a real session

      This repository's tools

      • Alfred

        This repository's quality bot: architecture, language parity and command-description checks.

        Internal

        Read more
      • Health

        Repository health audits with a versioned JSON report and a static dashboard.

        Internal

        Read more

      A part that stands alone has foundation packages that depend on nothing in AFD, so it can be adopted on its own; its CLI, server and command packages add AFD on top.

      See how they fit together
      Fig. 07Start small

      Start with one command.
      Keep your stack.

      Packages, not a platform. Add AFD to the stack you have, one capability at a time.

      Install the library.

      Four languages, each tested against the same contract.

      npm install @lushly-dev/afd-server @lushly-dev/afd-cli zod

      Teach your agent the method.

      Command design, validation and the define-validate-surface workflow, pinned to the current release.

      Skill / .claude/skills/afd
      npx degit "lushly-dev/afd/.claude/skills/afd#@lushly-dev/afd-core@2.5.0" .claude/skills/afd

      Fig. 08Your turn

      Ready when you are.

      CommandResult

      LOCAL DEMO / DESTRUCTIVE ACTION

      Delete the demo tasks?

      No undo. Nothing outside this browser tab is affected.