Skip to main content

๐ŸŒ™ Insomnia

๐Ÿ“š Table of Contentsโ€‹

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)โ€‹

  • 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

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 ๐ŸŒ™โšก