agentuity-frameworks
/agentuity-frameworks
Use when adding Agentuity code to a framework app and choosing where routes, pages, server functions, config, or service clients belong. Covers Next.js, Nuxt, SvelteKit, Astro, Hono, React Router, Vite with React, and TanStack Start file placement.
- Author
- agentuity ↗
- Repository
- sdk ↗
- Licence
- Apache-2.0
- Last repository change
- 31.07.2026
Assessment and security
- Files in this package
- 1
- Scripts
- 0
- HTML comments
- 0
- URLs in SKILL.md
- 4
No signals detected. Repository changed on 31.07.2026, without references to retired models or APIs.
Apache-2.0, otwarta: można używać i zmieniać, z zachowaniem licencji i informacji o zmianach.
What it does and when to use it
Use when adding Agentuity code to a framework app and choosing where routes, pages, server functions, config, or service clients belong. Covers Next.js, Nuxt, SvelteKit, Astro, Hono, React Router, Vite with React, and TanStack Start file placement.
Original author description
Use when adding Agentuity code to a framework app and choosing where routes, pages, server functions, config, or service clients belong. Covers Next.js, Nuxt, SvelteKit, Astro, Hono, React Router, Vite with React, and TanStack Start file placement.
How it works
- Create-Supported Frameworks
- Existing-App Adoption
- Server-Only Rule
- Thin Route, Shared Function
- Hono Middleware Option
- Common Mistakes
- Useful Docs
SKILL.md preview
---
name: agentuity-frameworks
description: >-
Use when adding Agentuity code to a framework app and choosing where routes,
pages, server functions, config, or service clients belong. Covers Next.js,
Nuxt, SvelteKit, Astro, Hono, React Router, Vite with React, and TanStack Start
file placement.
license: Apache-2.0
metadata:
author: agentuity
version: "1.0.0"
---
# Agentuity Framework Placement
Agentuity works with your framework's normal file layout. Put routes, pages,
server functions, and config where the framework expects them. Add Agentuity
clients only in server-side code.
## Create-Supported Frameworks
`agentuity create` can scaffold these frameworks:
| Framework | API route location | App UI location | Dev script owner |
|---|---|---|---|
| Next.js | `src/app/api/<name>/route.ts` | `src/app/page.tsx` | Next.js |
| Nuxt | `server/api/<name>.get.ts` or `.post.ts` | `app/app.vue` | Nuxt |
| SvelteKit | `src/routes/<path>/+server.ts` | `src/routes/+page.svelte` | Vite/SvelteKit |
| Astro | `src/pages/api/<name>.ts` | `src/pages/index.astro` | Astro |
| Hono | `src/index.ts` route handlers | `src/landing.tsx` when scaffolded | Hono server script |
Use the framework's route handler to validate the request, then call a shared function for the real work.
## Existing-App Adoption
For apps you already have, install the CLI and import the project without changing the app shape:
```bash
npm install -D @agentuity/cli
agentuity project import --name existing-app --confirm
```
Useful route locations:
| Framework | Server route shape |
|---|---|
| React Router | `app/routes/api.agentuity.ts`, registered in `app/routes.ts` |
| TanStack Start | `src/routes/api.agentuity.tsx` with server handlers |
| Vite + React | A server boundary such as `server.ts`; browser code calls that server |
| Express or other routers | Existing route module; import Agentuity clients server-side |
## Server-Only Rule
Do not expose Agentuity SDK keys to browser bundles. Service clients belong in
routes, server actions, workers, scripts, or other server-only modules.
```typescript
import { KeyValueClient } from '@agentuity/keyvalue';
const kv = new KeyValueClient();
export async function GET(): Promise<Response> {
const result = await kv.get<{ checkedAt: string }>('health', 'latest');
return Response.json({ ok: true, exists: result.exists });
}
```
Browser components should call your server route:
```typescript
const response = await fetch('/api/agentuity-health');
const status = await response.json();
```
## Thin Route, Shared Function
Prefer this split for AI features, background work, and service calls:
```typescript
// lib/triage.ts
export async function triageMessage(message: string): Promise<{ priority: string }> {
return { priority: message.includes('urgent') ? 'high' : 'normal' };
}
```
```typescript
// framework route file
import { triageMessage } from '@/lib/triage';
export async function POST(request: Request): Promise<Response> {
const body = (await request.json()) as { message?: string };
if (!body.message) {
return Response.json({ error: 'message is required' }, { status: 400 });
}
const result = await triageMessage(body.message);
return Response.json(result);
}
```
This keeps route-specific code small and lets the core function move between
frameworks, tests, queues, schedules, and scripts.
## Hono Middleware Option
In Hono apps, use direct clients by default when portability matters. Use
`@agentuity/hono` when accessing clients through Hono context improves
readability:
```typescript
import { Hono } from 'hono';
import { agentuity } from '@agentuity/hono';
import type { Services } from '@agentuity/hono';
const app = new Hono<{ Variables: Pick<Services, 'kv'> }>();
app.use('*', agentuity());
app.get('/api/preferences/:userId', async (c) => {
const result = await c.var.kv.get('preferences', c.req.param('userId'));
return c.json({ exists: result.exists });
});
```
AI Gateway, database, object storage, webhooks, and Coder are direct clients.
## Common Mistakes
| Mistake | Better approach |
|---|---|
| Putting service clients in browser components | Call a server route that owns the client |
| Adding new folders that bypass framework conventions | Use the framework's route/page locations |
| Duplicating AI or service logic in every route | Put shared work in a plain function and import it |
| Assuming every framework uses the same API route path | Check the route table before editing |
| Putting SDK keys in public env prefixes | Keep `AGENTUITY_SDK_KEY` server-side |
## Useful Docs
- Frameworks: https://agentuity.dev/frameworks
- Project structure: https://agentuity.dev/get-started/project-structure
- Add to existing app: https://agentuity.dev/get-started/import-existing-app
- Standalone packages: https://agentuity.dev/reference/standalone-packages
Versions
The database has no other skills named agentuity-frameworks.
Identical content appears in 1 other GitHub folders. We show one copy with the highest score.
Database snapshot: 13.11.2026 · package version c6e4e4ae111b (SHA-256 digest of the entire package)
Downloads in the last 30 days: 0 · ranking
Report a problem with this skill: harmful content, incorrect descriptions or an author’s removal request.
Similar skills
- 100agentuity-services
Use when selecting or using Agentuity service clients from app code. Covers standalone clients for key-value, vector, object storage, durable streams, queues, email, schedules, tasks, webhooks, sandbox, Coder, telemetry, direct clients versus Hono middleware, and service environment configuration. - 90frameworks-on-cloudflare
Build, migrate, and deploy web-framework applications on Cloudflare Workers. Use when a framework project such as Astro, SvelteKit, React Router, TanStack Start, Nuxt, Hono, or a React or Vue SPA targets Cloudflare, or when a framework repository contains Workers deployment configuration. - 100agentuity-project
Use when creating, importing, running, building, or deploying an Agentuity app. Covers framework-first project structure, agentuity.json, .env setup, agentuity dev, agentuity build, agentuity deploy, monorepo --dir usage, and deployment bundle inspection. - 100netlify-frameworks
在 Netlify 上部署 Web 框架的指南。在为 Netlify 部署设置框架项目(Vite/React、Astro、TanStack Start、Next.js、Nuxt、SvelteKit、Remix)、配置适配器或插件,或排查框架与 Netlify 集成的特定问题时使用。涵盖每个框架对 Netlify 的要求,以及适配器如何处理服务端渲染。 - 100scaffold-project
Scaffold a new app, API, backend, fullstack project, monorepo or starter with Better-T-Stack, including projects on a named framework such as Hono, Express, Fastify, Elysia, Convex, Next.js, TanStack Router or Start, React Router, Nuxt, Svelte, Solid, Astro or React Native. Use… - 95netlify-frameworks
Guide for deploying web frameworks on Netlify. Use when setting up a framework project (Vite/React, Astro, TanStack Start, Next.js, Nuxt, SvelteKit, Remix) for Netlify deployment, configuring adapters or plugins, or troubleshooting framework-specific Netlify integration. Covers…