Claude Code Prompt Template

Turn your app idea into structured, build-ready instructions for Claude Code's CLI agent — so it generates the right files the first time instead of guessing what you meant.

Why your Claude Code prompt needs structure

Claude Code is Anthropic's CLI-based coding agent. You run it in your terminal, describe what you want to build, and it creates and edits files directly in your project. It's powerful — but like any AI coding tool, the output quality depends entirely on the prompt.

A vague prompt like "build me a habit tracker" gives Claude Code nothing to anchor on. It guesses at the database schema, invents API routes, and skips features you assumed were obvious. You spend the next hour correcting it.

A structured prompt tells Claude Code exactly what to build: which pages exist, what each API endpoint does, what the database schema looks like, what the AI prompts are, and where humans need to approve things. When the prompt is specific, Claude Code builds the right app in a single run.

The same blueprint export works for both Cursor and Claude Code. The structure is identical — the only difference is where you paste it. See our Cursor prompt template for the IDE-based workflow.

The Claude Code prompt template

Every Claude Code app prompt should include these sections, in this order:

Template
Build this app exactly as described.
Start with database schema and auth, then APIs, then frontend pages.

## [Page Name] (Frontend Page)
What this page shows and what actions users can take.

## [API Name] (REST Endpoint)
- GET /api/endpoint — what it returns
- POST /api/endpoint — what it creates

## [Database Name] (PostgreSQL)
- table_name: field1, field2, field3

## [AI Task Name] (AI Prompt)
Input: what goes in
Task: what the AI does
Output: what comes out

## [Checkpoint Name] (Human Checkpoint)
What a human reviews before something goes live.

Five section types — pages, APIs, databases, AI prompts, checkpoints — each describing one piece of your app. For the full node structure behind each section, see our AI app blueprint template.

Anatomy of each section

The opening line

Always start with:

Build this app exactly as described. Start with database
schema and auth, then APIs, then frontend pages.

This tells Claude Code the build order: foundation first, then logic, then UI. Without it, the agent may start with the frontend and rewrite everything when the database schema changes later.

Frontend page sections

Describe what each page shows and what users can do. Include data displayed and actions available:

## Daily Check-in (Frontend Page)
Simple, fast screen for logging daily habits. One tap to mark
complete, optional notes field. Shows current streak count and
today's AI coaching message. Mobile-first PWA design.

API sections

List each endpoint with its HTTP method, path, and purpose:

## Habits API (REST Endpoint)
- GET /api/habits — list user's habits
- POST /api/habits — create new habit
- POST /api/habits/:id/checkin — log daily check-in

Database sections

List each table with its columns:

## Progress DB (PostgreSQL)
- habits: id, user_id, name, frequency, color, created_at
- check_ins: id, habit_id, date, completed, note, created_at
- streaks: id, habit_id, current_count, longest_count, updated_at

AI prompt sections

Define each AI task with its input, task, and expected output:

## AI Coach Prompt (AI Prompt)
Input: habit name, current streak, last 7 days of check-ins
Task: generate a personalized coaching message for today
Output: 1-2 sentence encouraging message tailored to streak status

Checkpoint sections

Describe where humans review before things go live:

## Approval Gate (Human Checkpoint)
Before any AI-drafted reply is sent to the customer, a human
reviews and approves it. Show pending drafts with approve,
edit, and reject actions.

Full example: Habit Coach app

Here's a complete, ready-to-paste Claude Code prompt. This is based on the Habit Coach community blueprint:

Ready to paste
Build this app exactly as described.
Start with database schema and auth, then APIs, then frontend pages.

## Daily Check-in (Frontend Page)
Simple, fast screen for logging daily habits. One tap to mark complete,
optional notes field. Shows current streak count and today's AI coaching
message. Mobile-first PWA design.

## Progress Dashboard (Frontend Page)
Visual overview: calendar heatmap, streak statistics, longest streak,
completion rate, and weekly AI review summaries. Charts for 7/30/90 days.

## Settings (Frontend Page)
Manage habit list (add/edit/remove), set reminder times, configure
coaching tone (encouraging, direct, humorous), set weekly review day.

## Habits API (REST Endpoint)
- GET /api/habits — list user's habits
- POST /api/habits — create new habit
- POST /api/habits/:id/checkin — log daily check-in
- GET /api/habits/:id/history — paginated check-in history

## Streaks API (REST Endpoint)
- GET /api/streaks — current streaks for all habits
- GET /api/streaks/:habitId — detailed streak data
- POST /api/streaks/recalculate — recompute from check-in history

## Progress DB (PostgreSQL)
- habits: id, user_id, name, frequency, color, created_at
- check_ins: id, habit_id, date, completed, note, created_at
- streaks: id, habit_id, current_count, longest_count, last_completed_date, updated_at
- users: id, email, name, coaching_tone, reminder_time, review_day, created_at
- weekly_reviews: id, user_id, week_start, summary_text, suggestion, created_at

## AI Coach Prompt (AI Prompt)
Input: habit name, current streak, last 7 days of check-ins, tone preference
Task: generate a personalized coaching message for today
Output: 1-2 sentence encouraging message tailored to streak status

## Weekly Review (AI Prompt)
Input: 7 days of check-in data, streak changes, completion rates, user notes
Task: generate weekly summary with insights and one actionable suggestion
Output: 3-4 paragraph review with what went well, what slipped, and focus area

## Reminder Scheduler (Cron Job)
Daily job at user's configured reminder time. Triggers AI Coach Prompt
to generate the day's message, then sends push notification.

Pro tip: Save your blueprint JSON from Bluemoonkey. If Claude Code goes off track, copy any individual node's description and paste it back: "Fix [component] to match this spec: [paste]." Your blueprint is your source of truth.

Step-by-step: blueprint to Claude Code

  1. Set up your project. Create a project directory and initialize it (npm init or your preferred framework's setup command).
  2. Start Claude Code. Open your terminal in the project directory and run claude to launch the CLI agent.
  3. Paste your exported prompt. Paste the full blueprint export. Make sure it starts with Build this app exactly as described.
  4. Let Claude Code work. It will create files, write code, and set up your project structure. It may create 10-20 files — that's normal.
  5. Iterate with your blueprint. If something isn't right, go back to Bluemoonkey, click the specific node, copy its description, and tell Claude Code: Fix [component] to match this spec: [paste]

Claude Code vs Cursor: which should you use?

Both tools build apps from structured prompts. The difference is the interface:

The blueprint export from Bluemoonkey works with both. The prompt structure is identical — you just paste it into a different tool. See our Cursor prompt template for the IDE workflow.

Tips for better Claude Code results

Name external services by name

Subscribe via Stripe produces real payment integration. Handle payments is too vague. Same for SendGrid, Twilio, Supabase — name them by name.

Describe schedulers explicitly

Send a summary every morning at 9am produces a cron job. Keep users updated does not — Claude Code has no way to know you need a daily scheduled task.

Be specific about AI tasks

Summarize unread emails into 3 bullet points produces a real AI prompt node. Use AI to help does not — mention the task, the input, and the output.

Use plain English

You don't need technical terms. "When someone leaves a bad review, have AI draft a polite reply for me to approve before it posts" is exactly the right level of detail.

Note: Claude Code creates files directly in your project directory. Make sure you're in the right directory before running it, and use version control (git init) so you can rollback if needed.

Generate your Claude Code prompt

Describe your app idea, get a structured blueprint, and export it as a Claude Code-ready prompt — all free.

Open Canvas — Free →

FAQ

How do I prompt Claude Code to build an app?

Open your terminal in your project directory, run claude to start the CLI agent, and paste a structured prompt that describes your app's frontend pages, backend APIs, database schema, AI prompts, and human checkpoints. Claude Code reads the prompt and generates files directly in your project.

What makes a good Claude Code prompt?

A good Claude Code prompt is specific and structured. Instead of "build a habit tracker," it lists each frontend page, each API endpoint, each database table with columns, each AI prompt with input/task/output, and each human checkpoint. The more structure your prompt has, the less Claude Code guesses.

Can I generate a Claude Code prompt from a blueprint?

Yes. Bluemoonkey exports your visual blueprint as a structured prompt formatted for Claude Code. Every node — pages, APIs, databases, AI prompts, checkpoints — becomes a section in the exported prompt. Paste it into the Claude Code CLI and it builds the full app.

How is Claude Code different from Cursor for app building?

Claude Code runs in the terminal as a CLI agent, while Cursor is a full IDE with an integrated AI chat. Both can build apps from structured prompts. Claude Code is better for developers who prefer the terminal; Cursor is better for those who want a visual editor. Both work with Bluemoonkey's blueprint exports.

What if Claude Code builds something wrong?

Go back to your blueprint in Bluemoonkey, click the specific node that's wrong, copy its description, and tell Claude Code: Fix [component] to match this spec: [paste]. Your blueprint JSON is your source of truth — it stays consistent even when the AI's output drifts.