skills/watt/SKILL.md
Integrate, configure, and deploy Platformatic Watt for Node.js and PHP applications. Use when users ask to: - "add watt", "setup watt", "integrate watt", "configure watt" - "deploy with watt", "containerize my app", "deploy to kubernetes" - "migrate to watt", "port my app to watt" - "create watt.json", "configure platformatic" - "wattpm", "wattpm create", "wattpm inject", "wattpm logs" - use wattpm CLI commands, manage running applications - work with Node.js application servers - run PHP, WordPress, or Laravel in Node.js Supports Next.js, Express, Fastify, Koa, Remix, Astro, NestJS, PHP, WordPress, and Laravel.
npx skillsauth add platformatic/skills wattInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
You are an expert in Platformatic Watt, the Node.js Application Server. Help users integrate, configure, and deploy Watt in their projects.
Before any Watt operation, verify:
Node.js Version: Watt requires Node.js v22.19.0+
node --version
If below v22.19.0, inform user they must upgrade Node.js first.
Existing Watt Config: Check if watt.json already exists
ls watt.json 2>/dev/null
Based on user input ($ARGUMENTS), route to the appropriate workflow:
| Input Pattern | Action |
|--------------|--------|
| init, setup, integrate, (empty) | Run Integration Workflow |
| multi-service, enterprise, composer | Run Multi-Service Setup |
| migrate, port, onboard, poc | Run Migration/POC Workflow |
| observability, logging, tracing, metrics | Run Observability Setup |
| performance, profile, profiling, flame, flamegraph, pprof, cpu, heap-snapshot | Run Performance Profiling |
| scheduler, cron, jobs | Run Scheduler Setup |
| cms, contentful, sanity, headless | Run CMS Integration Setup |
| deploy docker | Run Docker Deployment |
| deploy k8s, deploy kubernetes | Run Kubernetes Deployment |
| deploy cloud, deploy fly, deploy railway | Run Cloud Deployment |
| cli, wattpm, commands | Run wattpm CLI Workflow |
| create, scaffold | Run wattpm CLI Workflow (create) |
| inject, test endpoint | Run wattpm CLI Workflow (inject) |
| logs | Run wattpm CLI Workflow (logs) |
| ps, applications, services | Run wattpm CLI Workflow (ps) |
| admin, dashboard | Run wattpm CLI Workflow (admin) |
| resolve, import | Run wattpm CLI Workflow (resolve/import) |
| status, check | Run Status Check |
Analyze the project to identify the framework. Use this priority order:
Priority 1 - Config Files:
| File | Framework | Package |
|------|-----------|---------|
| next.config.js, next.config.ts, next.config.mjs | Next.js | @platformatic/next |
| remix.config.js | Remix | @platformatic/remix |
| astro.config.mjs, astro.config.ts | Astro | @platformatic/astro |
| nest-cli.json | NestJS | @platformatic/node |
| wp-config.php | WordPress | @platformatic/php |
| artisan + composer.json | Laravel | @platformatic/php |
| composer.json + public/index.php | PHP | @platformatic/php |
Priority 2 - Dependencies (check package.json):
| Dependency | Framework | Package |
|------------|-----------|---------|
| @nestjs/core | NestJS | @platformatic/node |
| fastify | Fastify | @platformatic/node |
| express | Express | @platformatic/node |
| koa | Koa | @platformatic/node |
Priority 3 - Fallback:
If no framework detected, use generic Node.js with @platformatic/node.
For framework-specific configuration, read the appropriate reference file:
Create watt.json based on detected framework. Use the schema URL:
https://schemas.platformatic.dev/@platformatic/{package}/3.0.0.json
Where {package} is: next, remix, astro, node, or php.
Runtime placement rule:
@platformatic/node, @platformatic/next, etc.), put runtime settings under runtime.watt / @platformatic/runtime with services/web/autoload), keep a top-level runtime block in the root watt.json.Install wattpm:
npm install wattpm
For Next.js, Remix, Astro, or PHP, also install the specific stackable:
npm install @platformatic/next # for Next.js
npm install @platformatic/remix # for Remix
npm install @platformatic/astro # for Astro
npm install @platformatic/php # for PHP/WordPress/Laravel
Add or update these scripts in package.json:
{
"scripts": {
"dev": "wattpm dev",
"build": "wattpm build",
"start": "wattpm start"
}
}
Create .env if it doesn't exist:
PLT_SERVER_HOSTNAME=0.0.0.0
PLT_SERVER_LOGGER_LEVEL=info
PORT=3000
Run a quick verification:
wattpm --version
Inform the user they can now run:
npm run dev for developmentnpm run build && npm run start for productionWhen user requests enterprise/multi-service setup:
watt.json with service definitionsweb/composer/ - API gateway (Platformatic Composer)web/frontend/ - Next.js or other frontendweb/api/ - Fastify API serviceweb/db/ - Platformatic DB service (optional){service-id}.plt.localServices communicate internally without network overhead:
// From api service, call db service
const response = await fetch('http://db.plt.local/users');
When user wants to migrate an existing app or prepare for a POC:
npm install wattpm (or use npx wattpm)watt.json with application entrypointcreate function (returns the app/server). If an @platformatic/node entrypoint listens by itself, also export a close function or register a close handler via @platformatic/globals so Watt can stop it cleanly without shutdown warnings.npx wattpm dev and npx wattpm startasync function create() {
const app = express()
app.get('/health', (req, res) => res.json({ status: 'ok' }))
return app
}
module.exports = { create }
When user requests logging, tracing, or metrics setup:
Logging + Tracing + Metrics:
{
"logger": {
"level": "{PLT_SERVER_LOGGER_LEVEL}"
},
"telemetry": {
"serviceName": "my-service",
"exporter": {
"type": "otlp",
"options": { "url": "{OTEL_EXPORTER_OTLP_ENDPOINT}/v1/traces" }
}
},
"metrics": {
"port": 9090
}
}
When user requests cron/scheduled jobs setup:
scheduler array to watt.json{
"scheduler": [
{
"name": "daily-cleanup",
"cron": "0 0 3 * * *",
"callbackUrl": "http://api.plt.local/cron/cleanup",
"method": "POST",
"maxRetries": 3
}
]
}
http://{service-id}.plt.localWhen users ask about performance profiling, CPU profiles, flamegraphs, heap profiling, or heap snapshots:
wattpm:
wattpm pprof start [id] [application] to start CPU profilingwattpm pprof stop [id] [application] to save pprof-{application}-{timestamp}.pbwattpm heap-snapshot [id] [application] for memory snapshots@platformatic/flame to generate HTML flamegraphs and markdown analysis from .pb files:
npm install -g @platformatic/flameflame generate pprof-api-application-2026-06-15T10-00-00-000Z.pbflame generate --md-format=detailed pprof-api-application-2026-06-15T10-00-00-000Z.pbflame run server.js only for standalone Node.js scripts outside Watt.wattpm ps and wattpm applications to identify runtime and application IDs before profiling multi-application setups.wattpm start for production-like CPU behavior.Start the app in one terminal:
wattpm build
wattpm start
Then collect the profile from another terminal:
wattpm ps
wattpm applications
wattpm pprof start my-app api-application
# Exercise the slow workload
wattpm pprof stop my-app api-application
flame generate pprof-api-application-2026-06-15T10-00-00-000Z.pb
When user requests headless CMS integration (Contentful, Sanity, Strapi, etc.):
revalidateTag()When user requests Docker deployment:
Dockerfile optimized for Watt.dockerignore filedocker-compose.yml for developmentWhen user requests Kubernetes deployment:
deployment.yaml with health checksservice.yamlconfigmap.yaml for environment variableshpa.yaml for autoscalingWhen user requests cloud deployment:
fly.tomlrailway.jsonrender.yamlWhen user runs /watt status:
Node.js Version
node --version
Check if >= v22.19.0
watt.json Exists
ls watt.json
watt.json Valid
node -e "JSON.parse(require('fs').readFileSync('watt.json'))"
wattpm Installed
npx wattpm --version
package.json Scripts Check for dev, build, start scripts
Report findings in a clear format:
Watt Configuration Status
========================
Node.js Version: vX.X.X [OK/UPGRADE NEEDED]
watt.json: [Found/Missing]
Configuration: [Valid/Invalid]
wattpm: [Installed vX.X.X/Not installed]
Scripts: [Configured/Missing]
[Next steps if any issues found]
When users ask about wattpm commands, CLI usage, or managing running applications:
Scaffolding a new project:
wattpm create
wattpm create --module @platformatic/next
Testing endpoints on a running app:
wattpm inject --path /health
wattpm inject my-app api-service --method POST --path /users \
--header "Content-Type: application/json" \
--data '{"name": "Alice"}'
Monitoring a running app:
wattpm ps # list running instances
wattpm logs my-app # stream all logs
wattpm logs my-app api-service # stream logs from a sub-application
wattpm env my-app --table # view environment variables
wattpm config my-app # view configuration
Profiling a running app:
wattpm applications my-app
wattpm pprof start my-app api-service
wattpm pprof stop my-app api-service
wattpm heap-snapshot my-app api-service
Working with external applications:
wattpm import . platformatic/acme-base --id base-app
wattpm resolve # clone all external apps defined in watt.json
Administration:
wattpm admin # launch Watt admin UI
wattpm patch-config . patches/production.js # apply config patches
{app-name}.plt.local for inter-service communicationwattpm CLI replaces older individual CLIswattpm build before production deploymentFor production performance tuning, read references/performance.md
Key optimizations:
PLT_NEXT_WORKERS for multi-threaded SSRoutput: 'standalone' for Next.jswattpm pprof start and wattpm pprof stop to capture CPU profiles for flamegraph analysisFor common issues, read references/troubleshooting.md
tools
Build applications that use the Vercel Workflow SDK against a self-hosted Platformatic Workflow Service via `@platformatic/world`. Use when users ask to: - "add workflow to my app", "use workflow sdk", "self-host vercel workflow" - "set up @platformatic/world", "platformatic world", "PLT_WORLD_SERVICE_URL" - "trigger a workflow run", "start a workflow", "resume a hook" - "wire workflow in Next.js", "instrumentation.ts for workflow" - "use workflow with Fastify", "@platformatic/workflow-fastify" - "workflow build --target standalone", "callback handlers", ".well-known/workflow" - "queue handler", "world.start()", "register handlers" Covers `@platformatic/world` (the World adapter), the Vercel Workflow SDK `'use workflow'` / `'use step'` authoring model, framework wiring (Next.js via `instrumentation.ts`, Node/Express/etc. via explicit `world.start()`), and the optional `@platformatic/workflow-fastify` plugin for mounting standalone-build handlers on Fastify. Does NOT cover deploying or operating the Workflow Service itself — assumes one is already reachable at `PLT_WORLD_SERVICE_URL`.
development
Set up Kafka-based event-driven microservices with Platformatic Watt. Use when users ask about: - "kafka", "event-driven", "messaging" - "kafka hooks", "kafka webhooks" - "kafka producer", "kafka consumer" - "dead letter queue", "DLQ" - "request response pattern" with Kafka - "migrate from kafkajs", "kafkajs migration", "replace kafkajs" - "node-rdkafka", "node rdkafka", "rdkafka", "librdkafka" - "migrate from node-rdkafka", "replace node-rdkafka" - "Kafka.Producer", "Kafka.KafkaConsumer", "ProducerStream", "ConsumerStream" Covers @platformatic/kafka, @platformatic/kafka-hooks, consumer lag monitoring, OpenTelemetry instrumentation, and migrations from KafkaJS or node-rdkafka.
tools
Use when work should span one or more detached tasks but still behave like one job with a single owner context. TaskFlow is the durable flow substrate under authoring layers like Lobster, ACPX, plugins, or plain code. Keep conditional logic in the caller; use TaskFlow for flow identity, child-task linkage, waiting state, revision-checked mutations, and user-facing emergence.
tools
# Lobster Lobster executes multi-step workflows with approval checkpoints. Use it when: - User wants a repeatable automation (triage, monitor, sync) - Actions need human approval before executing (send, post, delete) - Multiple tool calls should run as one deterministic operation ## When to use Lobster | User intent | Use Lobster? | | ------------------------------------------------------ | --------------------------