Command reference
stax init
Scaffold a new agent or package project with starter files
Scaffold a new agent or package project. Creates a ready-to-build directory structure with starter files for definitions, prompts, rules, and skills.
Usage
stax init
stax init --agent
stax init --package
stax init --template github-workflowWhen run without flags, stax init prompts you to choose between an agent or package project interactively.
Options
| Flag | Description |
|---|---|
--agent | Initialize an agent project (skip prompt) |
--package | Initialize a package project (skip prompt) |
--template <id> | Use a specific starter template |
What gets created
Agent project
my-agent/
├── agent.ts # defineAgent() entry point
├── prompt.md # System prompt
├── rules/ # Behavioral rules (Markdown with frontmatter)
│ └── code-style.md
├── skills/ # Reusable skill definitions
├── knowledge/ # Static reference documents
└── tsconfig.jsonPackage project
my-package/
├── package.ts # definePackage() entry point
├── rules/ # Shared rules
├── skills/ # Shared skills
└── tsconfig.jsonTemplates
Templates provide opinionated starter configurations for specific use cases:
stax init --template github-workflowTemplates may scaffold additional files such as CI configurations, pre-populated rules for specific domains, or MCP server declarations.
After scaffolding
Once initialized, the typical workflow is:
- Edit
agent.tsto set your agent's identity, runtime, and model - Write your system prompt in
prompt.md - Add rules and skills as Markdown files
- Run
stax buildto produce an artifact
See Getting Started for a complete walkthrough.
Related commands
stax build— Build the scaffolded project into an artifactstax validate— Check definitions without building