PROJECT 11 / 18AI PRODUCTTYPESCRIPT

Source implementation

Promptwell.

Turn a rough request into an executable specification.

85 / 100local score target
4maximum research rounds
5heuristic score dimensions
01 / IDEA02 / SYSTEM03 / PLAYGROUND04 / DECISIONS05 / SOURCE
01 / THE IDEA

A closer look.

A web application that researches a task, incorporates a saved tool-and-platform profile, asks targeted clarification questions and compiles the result into a structured prompt. WorkOS authentication and PostgreSQL keep profiles and prompt history scoped to the account.

A polished prompt can still omit the information needed to execute. Promptwell makes the missing decisions, research trail, available tools and verification contract visible before compiling the final request.

01

A task-aware interview

The research route generates questions, source links and a structured brief. Later rounds receive answered decisions and weak score dimensions, allowing the interview to target unresolved information.

02

Profiles that affect the result

Onboarding records platforms, tools and instruction-file formats. Workspace overrides take precedence over account defaults, and the server applies that effective profile to the research request.

03

A deterministic compilation step

compilePrompt combines the original request, clarified decisions, researched practices, available tools, verification checklist and source trail. The resulting prompt remains editable.

04

Bounded iteration and saved history

A local five-dimension score controls iteration toward 85, with at most four research rounds. The best compiled result is retained with an explicit warning when the gate is unmet.

02 / UNDER THE SURFACE

From rough request to execution contract

Inspect account scope, server-side research and the bounded clarification loop.

DRAG TO PAN · SELECT A NODE · + / − TO ZOOM

Read the architecture as text
  1. Rough request — The application holds the draft prompt, questions, answers, research brief and source trail, then derives the current score from these inputs.
  2. WorkOS session — POST calls withAuth and rejects requests without a signed-in user before provider configuration or research work.
  3. Account + workspace — Profile and workspace reads are scoped to the WorkOS user ID. Workspace overrides provide per-project platforms, tools and instruction formats.
  4. Request guards — The route validates configuration and prompt length, applies per-user rate limits and checks an in-process monthly successful-request counter before research.
  5. Bundled guide — MASTER_PROMPT_GUIDE supplies the bundled prompting guidance incorporated by the server research route. It is paired with the effective profile and the current task.
  6. Research request — The server sends the prompt, guide, profile and optional iteration context to the configured OpenAI endpoint. The key remains on the server.
  7. Structured response — The client validates questions, HTTPS sources and a ResearchBrief. The brief contains domain, task type, practices, tool plan and verification plan.
  8. Source trail — ResearchSource stores title, URL and the practice it supports. Sources accompany the final prompt rather than disappearing after the research step.
  9. Clarification set — The UI presents question choices or text fields and associates each answer with its question ID and principle. Subsequent requests carry answered decisions.
  10. Five-axis score — scoreSpecification measures artifact, context, constraints, verification and specificity using local textual signals, answers and research coverage. This is a heuristic score, not an outcome benchmark.
  11. Round controller — continueUntilQualityGate stops when the overall score reaches 85 or the round count reaches four. An unmet final gate produces the best available prompt with a visible warning.
  12. Prompt compiler — compilePrompt produces sections for environment, request, decisions, research, tools, execution, verification and handoff. Tool instructions are conditioned on the declared available tools.
  13. Editable prompt — The compiled artifact is presented for review and editing together with scores and sources. It is a prompt artifact; the app does not execute the downstream task.
  14. Account history — Saved sessions retain prompt, questions, answers, sources, research brief, compiled prompt and stage in PostgreSQL. Session access is scoped to the authenticated user.
03 / INTERACTIVE STUDY

Close the specification gaps

Explore an illustrative score trajectory and the hard stop imposed by a four-round clarification budget.

CHANGE THE INPUTS

Illustrative score progression only. The application’s real heuristic has five axes and uses prompt text, answers and research coverage. The 85-point target is a local gate, not a measured probability of success. No model is called.

ILLUSTRATIVE MODELLIVE

04 / ENGINEERING CHOICES

Why it works this way.

01

Compile from explicit inputs

Research and interview outputs are typed inputs to compilePrompt. Keeping compilation deterministic makes it clear which answers and sources shape the final artifact.

02

Use a stopping rule

The score target and four-round ceiling bound iteration. If the local score remains below target, the interface surfaces that limitation and stops requesting additional research.

03

Separate account data and provider secrets

PostgreSQL queries are scoped by authenticated user ID, while provider credentials are read in the server route. Available tools come from profile context instead of being assumed universally present.

05 / OPEN THE SOURCE

Trace it back.

Implementation details, examples, and project documentation.

Scope & limitations

  • The quality score is a textual heuristic, not an evaluation of whether a downstream agent will complete the task. Research sources and compiled instructions still need human review.
  • The request counter is in-process and resets with a server instance; it is not a durable spending ledger or a guarantee of a provider-side hard cost cap. Running the app requires configured authentication, database and model credentials.

Architecture and descriptions reflect the linked repository snapshot. The playground explains a mechanism; it does not execute the repository or report measured performance.