๐ Insomnia
๐ Table of Contentsโ
- ๐ Insomnia
This framework is Insomnia-first and optimized for fast API exploration, debugging, and individual developer flow: low ceremony, clear request history, and environment-driven configuration.
It combines 5W1H with Good Prompt principles
(Clear role ยท Clear format ยท Clear goal ยท Clear context ยท Clear constraints)
The key idea:
๐ Insomnia is a lightweight API client, not a testing platform
๐ Workspaces organize intent, environments provide context
๐ Speed and clarity beat ceremony
๐๏ธ Context-ownedโ
These sections are owned by the prompt context.
They ensure clean, fast, distraction-free Insomnia usage.
๐ค Who (Role / Persona)โ
Default Persona (Recommended)โ
- You are a backend or full-stack engineer
- You debug APIs frequently during development
- You value speed, clarity, and low overhead
- You prefer tools that stay out of your way
Expected Expertiseโ
- HTTP fundamentals (methods, headers, status codes)
- REST and/or GraphQL APIs
- Insomnia Workspaces
- Environment variables & templating
- Auth patterns (API keys, OAuth2, JWT)
- cURL-level understanding of requests
- Manual API debugging workflows
๐ ๏ธ How (Format / Constraints / Style)โ
๐ฆ Format / Outputโ
- Prefer:
- Simple, readable requests
- Environment-based configuration
- Show:
- One request = one intention
- Explain:
- what the request does
- what response is expected
- Use:
- Folders to group related endpoints
- Descriptions sparingly but clearly
โ๏ธ Constraints (Insomnia Best-Practice Rules)โ
- One workspace per API or bounded context
- Never hardcode:
- base URLs
- tokens
- secrets
- Use environments for:
- hosts
- auth tokens
- flags
- Avoid over-scripting
- Optimize for manual clarity, not test coverage
๐งฑ Workspaces, Environments & Architectureโ
- Workspace
- Represents one API or service
- Folder
- Groups related endpoints or flows
- Request
- Single HTTP interaction
- Environment
- Hierarchical configuration (base โ env-specific)
Clear separation:
- Workspace = scope
- Environment = configuration
- Request = behavior
โก Debugging, Automation & Focused Workflowsโ
- Use Insomnia primarily for:
- request exploration
- debugging headers / payloads
- validating auth flows
- Limited scripting is acceptable for:
- token reuse
- dynamic headers
- Prefer external tools for:
- large test suites
- CI automation
Insomnia excels at thinking with requests.
๐งช Reliability, Security & Portabilityโ
- Store secrets in:
- environment variables
- OS keychain
- Export workspaces for:
- backup
- sharing minimal repro cases
- Keep workspaces:
- environment-agnostic
- reproducible
- Avoid relying on local-only state
- Document setup assumptions briefly
๐ Explanation Styleโ
- HTTP-first language
- Minimal UI references
- Explain intent, not clicks
- Prefer reproducible request logic
- Assume reader understands APIs
โ๏ธ User-ownedโ
These sections must come from the user.
They define debugging goals and usage context.
๐ What (Task / Action)โ
Examples:
- Debug an API endpoint
- Explore a new API
- Validate authentication flows
- Reproduce a production issue
- Share a minimal API example
๐ฏ Why (Intent / Goal)โ
Examples:
- Faster debugging
- Understand API behavior
- Verify request/response shape
- Reduce backend guesswork
๐ Where (Context / Situation)โ
Examples:
- Local development
- Staging environments
- Third-party APIs
- Internal microservices
โฐ When (Time / Phase / Lifecycle)โ
Examples:
- During feature development
- While debugging incidents
- Early API exploration
- Ad-hoc verification
๐ Final Prompt Template (Recommended Order)โ
1๏ธโฃ Persistent Context (Put in team docs or repo README)โ
# Insomnia Usage Rules
You are using Insomnia as a fast, manual API client.
## Core Principles
- One workspace per API
- Environments hold all configuration
- Requests are simple and explicit
## Usage
- Optimize for debugging speed
- Avoid unnecessary scripting
- Prefer clarity over automation
## Security
- No secrets committed
- Use environment variables
- Separate environments per stage
2๏ธโฃ User Prompt Templateโ
What I want to do:
[Describe the API or debugging task.]
Why it matters:
[Speed, clarity, correctness.]
Where this applies:
[Local, staging, prod, third-party.]
(Optional)
When this is needed:
[Development, debugging, investigation.]
(Optional)
โ Fully Filled Exampleโ
What I want to do:
Debug a REST endpoint that requires JWT authentication.
Why it matters:
The backend returns inconsistent 401 errors.
Where this applies:
Local and staging environments.
When this is needed:
During feature development.
๐ง Why This Ordering Worksโ
- Workspace before requests keeps scope tight
- Environment before auth avoids secret sprawl
- Manual clarity before automation keeps Insomnia fast
Insomnia sharpens understanding.
Requests reveal truth.
Speed keeps you in flow.
Happy debugging with Insomnia ๐โก