app/ or pages/. Keep AI primitives at
the project root: agents/, tools/, prompts/, workflows/, resources/,
and skills/. Veryfront discovers those directories on startup.
The examples use the default app router. Set router: "pages" in
veryfront.config.ts to use the pages router.
Prerequisites
- A project created with
veryfront init(see Create project). - Familiarity with how a file path maps to a route in modern React frameworks.
Directory layout
Routing directories
app/
The app/ directory contains pages, layouts, and API routes. File paths map to
URLs.
Pages use
page.tsx or page.mdx. API routes use route.ts. Layouts use
layout.tsx.
If veryfront.config.ts sets router: "pages", use pages/ and pages/api/ instead.
Typical pages-router layout:
Auto-discovered directories
These directories are scanned automatically at startup. For TypeScript-based primitives, files with a default export are registered. For skills, directories containingSKILL.md are registered.
TypeScript primitives are registered from their exported definitions. Agents can
use the filename as the ID when no explicit ID is provided.
Agent discovery also supports
agents/assistant.md. Use frontmatter for
metadata and the markdown body for system instructions.
For skills, the directory name is the skill ID. For example, skills/incident-response/SKILL.md registers as "incident-response".
Verify discovery by starting the dev server after adding an agent, tool, or
workflow:
getAgent("assistant") should resolve after agents/assistant.ts exists and
the server reloads.
Customizing discovery paths
Override the default directories inveryfront.config.ts:
Convention directories
These directories are not auto-discovered. They are common project conventions.Special files
Verify it worked
Add a file in any auto-discovered directory and restartveryfront dev. For
example, add agents/hello.ts:
getAgent("hello")
should resolve from a route or test.