---
name: spx-fspek
description: Use this skill when working on projects that need SPX deployment guidance, fspek product specification guidance, or a decision about when to use each.
---

# SPX and fspek

Use this skill to choose between fspek and SPX, then follow the right workflow.

## Main Sources

- Skill: https://runspx.com/skill.md
- SPX homepage: https://runspx.com/
- SPX docs: https://runspx.com/docs
- SPX CLI source: https://github.com/ab-10/spx
- SPX showcase: https://runspx.com/showcase

## Decision Rule

- If the question is "what should this product or UI do?", use fspek.
- If the question is "how do I run this backend live for users or reviewers?", use SPX.
- If both apply, write or update the fspek first, implement the behavior, then deploy the backend with SPX.

## SPX

Use SPX when you need to deploy a Python/FastAPI backend to a live, stable `.runspx.com` URL with minimal infrastructure work.

### SPX Workflow

1. Install the CLI: `brew install ab-10/spx/spx`
2. Authenticate: `spx login`
3. Create and deploy a new project: `spx new <project-name>`
4. Redeploy after changes: `spx run main.py`
5. Verify the live service: `curl https://<your-slug>.runspx.com`

### SPX Constraints

- Use Python 3.12 for uv project workflows.
- Entrypoints should start an HTTP server bound to `0.0.0.0` on a port in `8000-9000`, preferably `8080`.
- The FastAPI scaffold expects `main.py` and an app named `app`.
- Manage dependencies with `spx uv`, then redeploy with `spx run main.py`.
- Manage project environment values with `spx env` before deploying.

### When To Use SPX

- Use SPX for live backend deployments, deployed API endpoints, agent-built FastAPI services, demos, and production-like feedback loops.
- Do not use SPX as a general frontend hosting system or as a local-only test runner.

## fspek

Use fspek when you need to describe what a frontend or product surface should do before implementation.

### fspek Workflow

1. State the user goal and target surface.
2. Specify core states, interactions, data inputs, outputs, and error cases.
3. Define acceptance criteria that an agent or contributor can verify.
4. Use the resulting spec to guide implementation, review, or testing.

### When To Use fspek

- Use fspek before building or changing UI/product behavior, especially when the expected behavior is ambiguous.
- Use fspek to align agents and contributors on scope, states, and verification criteria.
- Do not use fspek as a deployment tool. After the behavior is implemented, use SPX when the result is a deployable Python/FastAPI backend.
