Skip to content
Back to skills

Skill

ASecurity

Use this skill whenever the user is building, debugging, scaffolding, or asking questions about Appweaver - a web development library. Triggers include: any mention of 'Appweaver', requests to create backend server logic, configurations, resources, models, routes, services and security policy, questions about the file conventions or config system. Use this skill if @appweaver npm package or Appweaver is detected anywhere in the project structure of Node.js (TypeScript) project.

  • 2 stars
  • 0 votes
  • 0 copies
  • 0 views
  • Added December 5, 2026
developmentjavascripttypescriptjavasqlnodedockertestingdebuggingapidatabase

Works with

  • cursor
  • cli
  • api
  • mcp

Security analysis

A100/100

Pro scans all 18 files and shows the line behind each finding

Scanned December 5, 2026

npx -y skills add lmatosevic/appweaver --skill skill --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Skill?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Skill
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/lmatosevic-skill/badge)](https://www.skillsdirectory.com/skills/lmatosevic-skill)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: appweaver
description: >
  Use this skill whenever the user is building, debugging, scaffolding, or
  asking questions about Appweaver - a web development library. Triggers
  include: any mention of 'Appweaver', requests to create backend server logic,
  configurations, resources, models, routes, services and security policy, 
  questions about the file conventions or config system. Use this skill
  if @appweaver npm package or Appweaver is detected anywhere in the project
  structure of Node.js (TypeScript) project.
---

# Appweaver skill

## Purpose

Appweaver is a library for building backend REST APIs with TypeScript and Node.js (or Bun). From a declarative
resource model it derives the database schema, the TypeScript types, and validated CRUD routes with an OpenAPI
specification, and it adds authentication, authorization, file storage, caching, queues, scheduling, and mailing on top,
all driven by a centralized configuration. It is built on Fastify for the web server and Prisma for the database ORM.
The library provides factory functions for creating resource models, services, policies, and routes with predefined
defaults, and a CLI tool for building the application, starting a server, generating schema and types, executing
migrations, running seeders, testing, and more.

## Project structure

The basic file structure of the Appweaver project:

- `database/` - database migrations, seeders, generated prisma client, and client used by the application
- `dist/` - the output directory for transpiled JavaScript files
- `locales/` - the translation files, a nested JSON file per locale (`en.json`, `de.json`, `locales` module)
- `public/` - publicly exposed files if static file serving is enabled
- `src/features/` - main application logic structured using vertical slice architecture (VSA)
- `src/resources/` - application resources (models, services, policies, and routes)
- `src/types/` - application types (generated and manually created)
- `src/main.ts` - the main application entrypoint
- `templates/` - the Handlebars templates of emails, HTML pages, XML exports or any other text (`*.<format>.hbs`,
  `templates` module)
- `test/e2e/` - the end-to-end tests root directory
- `test/unit/` - the unit tests root directory
- `.env` - override the central configuration (optional)
- `.env.{env}` - override the central configuration for a specific environment (optional)
- `appweaver.json` - central library configuration file, with the overrides of each environment under `environments`
- `appweaver.{env}.json` - environment specific configuration files, overriding the `environments` section (optional)
- `Dockerfile` - the dockerfile used for building a docker image for deploying the application (`docker` module)
- `tsconfig.json` - TypeScript 5.9 with `strict`, so `noImplicitAny` is on: type every parameter, and an object built
  key by key as `Record<string, unknown>`

**IMPORTANT:** `{env}` is controlled by `NODE_ENV` environment variable set before any command is executed (can also be
set in the `.env` file). The environment names are `test`, `local`, `dev`, `staging`, `qa`, and `prod`; `development`
resolves to `dev`, and `production` or an unset `NODE_ENV` to `prod`.

## How to use this skill

This file is the index: read [GUIDELINES.md](GUIDELINES.md) for the compact walkthrough of a project (entrypoint,
resources, custom routes, injection, seeders, tests), then only the reference of the task at hand from the table
below. [patterns.md](references/patterns.md) holds every pattern with its code, [workflow.md](references/workflow.md)
the daily commands.

## Workflow

```sh
weaver doctor                       # check the project first: packages, .env, config, generated files, migrations, skill
weaver resource new blog-post       # model.ts, service.ts, routes.ts and policy.ts in src/resources/blog-post/
weaver generate                     # types, Prisma schema and client, config schema, after any model change
weaver migration new add_blog_post  # create and apply the migration of the change (--create-only to edit its SQL)
weaver start --watch                # develop; npm run e2e for the end-to-end tests
weaver config check                 # validate the config, i.e. NODE_ENV=prod weaver config check in CI
```

Every report command takes `--json` (`doctor`, `config print`, `config check`, `module list`, `routes`, `run` without a
task): one JSON document on stdout, the logs and errors on stderr.

## Rules

- A resource is a directory of `src/resources/<name>/` with `model.ts` (`createModel`), `service.ts`
  (`createService`), `routes.ts` (`createRoutes`) and `policy.ts` (`createPolicy`), each a default export. Create all
  four unless asked otherwise, and run `weaver generate` after every change of a model, then
  `weaver migration new <name>`.
- Keep the defaults: don't set default values, `omit`/`pick`, `input`/`output`, file `mimeType` and `namePattern`, or
  index arrays without an explicit requirement.
- Every route needs an authenticated user unless it sets `public: true`; a policy narrows the records per user. A
  policy receives `null` for an anonymous request only: the application's own calls (jobs, seeders, tests) skip it.
- The config lives in `appweaver.json` (`config` and `environments.<env>`), overridden by `.env` and the environment;
  read it with the section objects (`serverConfig.PORT`), never `process.env`. A new key of a local module is declared
  with `defineConfig`.
- Throw the error classes of `@appweaver/common` with an `ErrorCode` (or the codes of `defineErrors`), never an HTTP
  error: the web module maps them to RFC 9457 problem details.
- Inject services with `inject`, `injectService('Model')` and `injectModel`, never by constructing them.
- The `totalCount` of a query is off unless asked (bounded by `resource.countLimit`), and a page deeper than
  `resource.maxOffset` uses the cursor.
- Tests: `weaver test setup`, then each e2e file registers `afterAll(resetTestData, 10_000)` after stopping the
  application; the e2e Jest config keeps `"maxWorkers": 1`. Run them with `npm run e2e`, which builds first: on Node
  the application loads the compiled `dist`.
- The auth routes are at `/auth` (`POST /auth/login`), never under the `/api` of the resource routes.
- A policy limiting writes to their creator compares `resource.createdById` with `user.id` in `checkAccess`
  ([patterns.md](./references/patterns.md#creating-a-resource-policy)).

## References

| Task                                                           | Reference                                                                                                       |
| -------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------- |
| Every pattern with its code                                    | [patterns.md](references/patterns.md)                                                                           |
| The daily commands; every CLI option                           | [workflow.md](references/workflow.md), [cli.md](references/cli.md)                                              |
| Models, services, routes, policies, filters, extending a model | [resources.md](references/resources.md)                                                                         |
| Config keys of every module, environments, providers           | [configuration.md](references/configuration.md)                                                                 |
| Authentication, roles, API keys, OAuth2, 2FA, captchas         | [security.md](references/security.md)                                                                           |
| Database, migrations, transactions, SQLite in production       | [database.md](references/database.md)                                                                           |
| Modules, drivers and providers, local modules                  | [modules.md](references/modules.md)                                                                             |
| Error codes and responses                                      | [errors.md](references/errors.md)                                                                               |
| Dependency injection                                           | [dependency-injection.md](references/dependency-injection.md)                                                   |
| Files and storage                                              | [storage.md](references/storage.md)                                                                             |
| Events and hooks                                               | [events.md](references/events.md)                                                                               |
| Cache, queue, scheduler                                        | [cache.md](references/cache.md), [queue.md](references/queue.md), [scheduler.md](references/scheduler.md)       |
| Emails, text messages, templates and translations              | [mailer.md](references/mailer.md), [sms.md](references/sms.md), [templates.md](references/templates.md)         |
| Realtime channels, resource events, actions and streams        | [realtime.md](references/realtime.md)                                                                           |
| AI models and tools, the MCP server                            | [ai.md](references/ai.md), [mcp.md](references/mcp.md)                                                          |
| Time series, spatial fields, audit log                         | [timeseries.md](references/timeseries.md), [spatial.md](references/spatial.md), [audit.md](references/audit.md) |
| Logging, OpenTelemetry                                         | [logging.md](references/logging.md), [telemetry.md](references/telemetry.md)                                    |
| A typed HTTP client of the API                                 | [client.md](references/client.md)                                                                               |

Files in this skill

  • GUIDELINES.md15.9 KB
  • SKILL.md9.9 KB
  • references/ai.md11.5 KB
  • references/audit.md12.2 KB
  • references/cache.md9 KB
  • references/cli.md42.6 KB
  • references/client.md42.4 KB
  • references/database.md16.7 KB
  • references/dependency-injection.md12.1 KB
  • references/errors.md32.4 KB
  • references/events.md7.7 KB
  • references/logging.md9.3 KB
  • references/mailer.md16.5 KB
  • references/mcp.md13 KB
  • references/modules.md33.7 KB
  • references/patterns.md60.3 KB
  • references/queue.md10.8 KB
  • references/realtime.md34.1 KB

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

View all in development →

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.