Setup with AI
One prompt. Full setup.
Paste the prompt below into an AI coding agent (Cursor, Claude Code, Codex, Windsurf, Copilot agent mode). It detects your framework, installs and verifies OneMinute Logs, learns our event conventions, and proposes an instrumentation plan for you to approve before it changes any code.
Supported frameworks
Express.js
Node.js APIs and backend services.
NestJS
Structured APIs with controllers and services.
Next.js
App Router products with route handlers and dashboards.
Anything else and the agent stops with a message instead of guessing.
What the agent does
- 1Detects your framework — Express, NestJS, or Next.js — and stops with a clear message if it's something else.
- 2Walks you through creating an account and API key, and adds it to your env file.
- 3Installs and configures the SDK, then verifies the connection with a test event.
- 4Proposes an instrumentation plan in .oneminutelogs/ for you to review — no code changes yet.
- 5Applies the approved plan and writes a report of everything it changed.
Safe to run again. It checks what's already there first — resuming an interrupted run, or upgrading an existing install (SDK version, renamed config, new events) without touching your instrumentation or asking for a new API key.
The master prompt
Set up OneMinute Logs in this project. Work through the phases in order. Stop and wait for me wherever it says to. This prompt is safe to re-run — start with Phase 0 every time.
────────────────────────────
PHASE 0 — Assess current state (always run this first)
────────────────────────────
Without changing anything, check:
a. Is an OML SDK package (@oneminutelogs/express | @oneminutelogs/nestjs | @oneminutelogs/next) in package.json? Note the installed version.
b. Is ONE_MINUTE_LOGS_API_KEY present AND non-empty in the env file?
c. Is the SDK wired up in code (logger created / middleware registered / module imported)?
d. Does .oneminutelogs/ exist? Find the highest-numbered implementation-NNN.md and report-NNN.md. A plan is "done" only if a report with the same number exists.
e. Grep the codebase for existing OML calls (logger.info/error/warn/…, req.logger, OneMinuteLogsService).
Pick a mode and tell me which one and why before continuing:
• FRESH — no package, no wiring → run Phases 1-9 in full.
• RESUME — a package/env/wiring exists but the last run didn't finish (no matching report, or a plan-NNN with no report-NNN) → skip every phase whose outcome already exists and continue from the first incomplete one. Always re-run the Phase 4 verify probe before any instrumentation. If an implementation-NNN.md has no report, ask me: continue that plan, or supersede it with a new one.
• UPDATE — package + non-empty key + wiring + at least one completed report → go to UPDATE MODE below. Do NOT reinstall from scratch and do NOT ask me for a new API key.
────────────────────────────
UPDATE MODE
────────────────────────────
1. Fetch the current framework guide (Phase 2 URLs).
2. Compare the installed SDK version to the guide's sdk_version; upgrade the package if a newer one is available.
3. Reconcile the existing config against the guide. Option names and the logger API can change between versions (e.g. an older `appName` option is now `projectName`). Apply only the differences. Keep the existing projectName value so it stays the same project.
4. Fix any renamed or removed SDK calls in the existing instrumentation.
5. Run the Phase 4 verify probe.
6. Fetch conventions.md and examples.md (Phase 5).
7. Audit existing OML calls against the vocabulary; list any with a non-canonical name/level/message as "to fix".
8. Optionally scan for NEW meaningful workflows that aren't instrumented yet.
9. Write a delta plan to the next .oneminutelogs/implementation-NNN.md with sections: "SDK / config changes", "Existing events to fix", "New events proposed". Do NOT touch code. Show me the plan and STOP.
10. On "approve" → apply exactly that; then write .oneminutelogs/report-NNN.md (same number). On "change: <details>" → update the plan and re-ask.
Everything below is FRESH / RESUME mode.
────────────────────────────
PHASE 1 — Check framework support
────────────────────────────
Inspect package.json and the project structure.
- Next.js (App Router) → the "next" dependency AND an app/ directory
- NestJS → the "@nestjs/core" dependency
- Express.js → the "express" dependency
If exactly one matches, continue with that framework.
If it is Next.js without an app/ directory (Pages Router only), treat it as unsupported.
If none match, STOP and tell me:
"OneMinute Logs currently supports Express.js, NestJS, and Next.js (App Router).
This project uses <what you found>, which isn't supported yet.
Email contact@oneminutelogs.com to request it."
Do not attempt a generic or partial integration for an unsupported framework.
────────────────────────────
PHASE 2 — Read the setup guide
────────────────────────────
Fetch the guide for the detected framework and treat it as the source of truth for
install commands, config shape, and the logger API:
- Express.js → https://www.oneminutelogs.com/docs/agents-docs/expressjs.md
- NestJS → https://www.oneminutelogs.com/docs/agents-docs/nestjs.md
- Next.js → https://www.oneminutelogs.com/docs/agents-docs/nextjs.md
Detect the package manager from the lockfile: pnpm-lock.yaml → pnpm, yarn.lock → yarn,
bun.lock / bun.lockb → bun, package-lock.json → npm.
────────────────────────────
PHASE 3 — Account + API key (BEFORE installing)
────────────────────────────
Skip this phase if ONE_MINUTE_LOGS_API_KEY is already set and non-empty (RESUME mode).
Otherwise, tell me to:
1. Open https://www.oneminutelogs.com/sign-up and create an account (or sign in).
2. Create an API key.
3. Copy it.
In the project:
- Find or create the env file (.env, or .env.local for Next.js).
- Add the line ONE_MINUTE_LOGS_API_KEY= (leave it empty — never invent a key).
- Ensure that file is gitignored; add the pattern to .gitignore if missing.
Ask me to paste the key into the env file and reply "done". STOP and wait — do not
continue until I confirm.
────────────────────────────
PHASE 4 — Install and verify
────────────────────────────
1. Install the SDK package named in the guide, with the detected package manager.
Skip if it's already installed at the guide's version.
2. Wire it up exactly as the guide shows. Server-side only; the API key never
goes into source code. Skip if wiring already matches the guide.
3. Set projectName to the project name from package.json (keep an existing value).
4. Verify the key: send ONE probe event through the SDK —
level "info", eventName "system.process.started", message "OneMinute Logs connected".
Confirm the call resolves with no transport error and the ingest endpoint
returns HTTP 200. If it returns 401, the key is wrong — tell me and stop.
Report: "OneMinute Logs is connected." Do NOT instrument anything else yet.
────────────────────────────
PHASE 5 — Learn the event vocabulary
────────────────────────────
Fetch and read, in this order:
1. https://www.oneminutelogs.com/docs/agents-docs/conventions.md (the rules — authority)
2. https://www.oneminutelogs.com/docs/agents-docs/examples.md (the catalogue)
Every event you propose must use the canonical name, level, and message from
conventions.md (§7 registry) or examples.md. Do not invent event names, outcome
verbs, or message wording.
────────────────────────────
PHASE 6 — Propose an implementation plan
────────────────────────────
Scan the codebase for meaningful workflows: authentication, payments, subscriptions,
orders, background jobs, queue workers, webhooks, external API calls, uploads, admin
actions, security events, scheduled tasks.
For each one worth logging (a real business outcome or a useful failure — not noise):
- the exact call site (file + function)
- eventName / level / message — from the canonical vocabulary
- attributes — values only, OTel semantic-convention names first; never secrets,
raw SQL, request bodies, tokens, or PII beyond stable identifiers
Skip a workflow if that exact eventName is already emitted at that call site.
Write the plan to the next unused .oneminutelogs/implementation-NNN.md (001, then
002, …). Structure:
# OneMinute Logs — Implementation Plan NNN
Framework · SDK package · package manager · date
## Proposed events
| File · function | eventName | level | message | attributes | status (new / already present) |
## Workflows deliberately skipped
Do NOT modify any application code in this phase. Show me the table and STOP.
────────────────────────────
PHASE 7 — Review
────────────────────────────
Ask me to reply with one of:
- "approve" → instrument exactly the approved plan
- "change: <details>" → update the plan file and ask again
STOP and wait.
────────────────────────────
PHASE 8 — Instrument
────────────────────────────
Apply the approved plan and nothing more:
- Before adding a call, re-check the call site — if that exact eventName is
already emitted there, skip it. Never create a duplicate.
- Add the SDK calls using the planned name/level/message and attributes exactly.
- Do not change unrelated business logic.
- Do not remove or rewrite existing logging.
- Use only SDK methods the guide documents.
If you are interrupted, the next run's Phase 0 will see the plan without a report
and resume here.
────────────────────────────
PHASE 9 — Report
────────────────────────────
Write .oneminutelogs/report-NNN.md (same number as the plan you applied):
- Events instrumented (count + list)
- Files changed
- Anything skipped and why
- How to see the events (dashboard, or getLogs filters)
Then tell me setup is complete.Need help with setup?
If the agent gets stuck or your project needs a custom setup, contact support and we will help you get OneMinute Logs running.