Skip to main content
Back to projects

Minto is a deterministic, browser-local prompt enhancement workspace that turns rough instructions into structured Markdown prompts without a backend.

TypeScriptNext.jsDexie
Role
Product design + frontend development
Outcome
Deterministic prompt enhancement that works offline.
Stack
TypeScript · Next.js · Dexie
01

Project Overview

Minto banner
Project Overview
Minto is a web application that turns rough, informal instructions into clear, structured prompts formatted in Markdown. The Prompt Enhancement Engine is its core capability — a deterministic, browser-local system that analyzes a user's raw text and generates a well-organized prompt without requiring a backend service. The engine is built as a pure TypeScript module with no framework or storage dependencies. It runs entirely in the browser, supports 13 distinct task types across four categories, and offers three enhancement strengths. It is complemented by a simple web workspace where users can paste a prompt, choose options, and immediately view, edit, copy, and save the result. An optional AI enhancement path can be enabled when a secure enhancement endpoint is configured, but the deterministic engine works fully offline and is the default privacy-preserving path.

Tech Stack

TypeScriptNext.jsDexie
02

Problem and Solution

Problem
Vague prompts, inconsistent results
Unstructured instructions lead to unpredictable outputs
Hard to express completely
Requirements, constraints, and verification steps are often missing
Privacy and offline risk
Cloud-only tools expose content and fail without a network
No consistent format
Teams lack a reproducible structure for prompts
Solution
Local-first deterministic engine
Same input always produces same Markdown with no network call
Extract and infer structure
Action, subject, technologies, constraints, and requirements
Template-driven Markdown
13 types and 24 sections with light, standard, and detailed strengths
Validated optional AI path
Single HTTPS endpoint with timeout, abort, and Zod checks when configured
03

Role & Responsibilities

  • Inspected the completed engine implementation across parsing, classification, templating, rule selection, and Markdown generation.
  • Traced the engine's integration with the workspace, state management, preferences, and local persistence.
  • Verified the absence of backend, API, database, and external service usage for the core deterministic flow.
  • Distinguished confirmed implementation facts from reasonable product interpretations.
  • Authored a portfolio-ready narrative that follows the required structure and avoids unsupported claims.
04

Design Process

Design Process
5 Principles
01
Principle
Start from the public contract
One synchronous function text plus options returns analysis and Markdown
Contract
02
Principle
Normalize and allow-list
Whitespace and casing normalized with explicit verb, tech, and constraint lists
Parsing
03
Principle
Score with confidence gating
Weighted signals and suffix stripping with margin and strength mapped to bands
Classification
04
Principle
Templates own structure
13 templates define light, standard, and detailed orders as validated subsets
Structure
05
Principle
Rules handle only emptiness
Drops list-based sections when slots are empty to avoid hollow headings
Clarity
05

Key Features

01
Structured Slot Extraction
Identifies an opening action, a subject phrase, mentioned technologies from an explicit allow-list, preservation constraints, and bulleted or implied requirements from raw text.
02
Weighted Classification with Confidence Gating
Scores text against curated signal tables for each task type, computes a 0–100 confidence score from top margin and absolute strength, falls back to the general category when evidence is weak or contested, and surfaces guidance when multiple types matched closely.
03
13 Task Templates Across 4 Categories
Covers development tasks like bug fixes, features, code review, refactoring, testing, and documentation; writing tasks like rewriting and summarization; research tasks like investigation and comparison; and design tasks like interface review and image prompts.
04
24 Reusable Sections with Three Strengths
Light returns a single polished sentence, standard adds requirements and verification, and detailed expands to a full structured document. The exact section order is owned by the template and validated as order-preserving subsets.
05
Smart Section Selection
Drops list-based sections when the corresponding extracted slot is empty, so a prompt without constraints does not generate an empty heading, while narrative sections receive default content downstream.
06
Light Polish and Grammar Correction
Rewrites a prompt into a single clear sentence that honors constraints and preserves intent, with a separate grammar-only mode when no sections are selected.
07
Auto-Detect or Manual Control
Users can let the engine infer the task type or choose it explicitly, toggle which of the five user-facing sections to include, and pick from 17 presets that preconfigure type, level, and sections.
08
Integrated Workspace
A two-tab Enhance and Result experience with live character count, stale-state notice when controls change, progress indication with cancel, copy, export, and save actions, plus retry handling and dirty-state confirmation for edits.
09
Validation and Safety Limits
Rejects empty prompts and enforces a 15,000-character maximum before enhancement begins, preventing oversized or empty submissions.
10
Local History and Library
Successful results can be kept in on-device history and promoted to a personal library with folders and tags, both stored in IndexedDB and capped by a history-size preference.
06

Tech Stack

TypeScript (strict)Primary language for the engine and application, providing shared types for analysis results and templates and keeping the engine pure and predictable.
Next.js 16 (App Router) with React 19Hosts the workspace UI, static export for hosting, and a local development API route; the engine itself does not depend on either.
Prompt Engine module (pure TypeScript)Self-contained pipeline of parser, classifier, templates, rules, and generator with no imports from React, Next.js, browser storage, or network code, which guarantees offline and testable behavior.
ZodValidates enhancement requests and responses when the optional AI path is used, ensuring shape and size limits are enforced.
Zustand (with preferences provider)Stores user preferences such as default enhancement level, default prompt type, included sections, and history limits, and persists them to cookies or local storage.
Dexie (IndexedDB wrapper)Persists history, saved prompts, and folders entirely in the browser with no server database involved.
Tailwind CSS v4, shadcn/ui, Radix UIProvide styling and accessible interface components for the workspace panels and controls.
Verification scripts (Node.js)Hand-rolled harnesses that check parser, classifier, template, rules, generator, and full-pipeline behavior, including that the same input always yields byte-identical output.
PWA and static export toolingGenerate an installable offline build that excludes server-only routes, so the engine remains usable without a network.

No backend, database, or external service is required for the core deterministic flow. The optional AI path uses a single validated HTTPS endpoint with timeout, abort, and schema checks, and never runs unless explicitly configured.

07

Challenges & Solutions

Ambiguity in natural language

Free-form prompts vary widely in phrasing and punctuation. The solution normalizes whitespace and casing, uses allow-lists for verbs, technologies, and constraint phrases, and applies simple word-boundary matching rather than attempting full language understanding.

Overconfident misclassification

Thin evidence or near ties could lead to the wrong specialization. The engine computes both the margin between the top two scores and the absolute evidence strength, rounds to a confidence value, maps it to high, medium, or low bands, falls back to the general template on low confidence, and surfaces guidance to choose manually.

Stemming trade-offs

To match variations like failing and fails without a full natural-language library, the classifier strips a small set of suffixes iteratively. This is intentionally limited and documented, so some irregular forms remain unmatched rather than guessed.

Avoiding empty headings

Generating a heading with no content confuses users. The rule layer drops list-based sections when their extracted slot is empty while keeping narrative sections that receive default content downstream.

Keeping templates consistent

With 13 templates each defining three levels, ordering mistakes would be hard to spot. Invariants are enforced: every level opens with Objective, contains no duplicates, and lighter levels are order-preserving subsets of stronger levels, checked by a validation routine across the registry.

Reproducibility vs. creativity

Users expect the same prompt to give the same result locally, but may also want AI creativity. The architecture separates the two: the deterministic path is synchronous and pure, while the AI path goes through a single validated HTTPS endpoint with timeout, abort, and schema checks.

08

Final Product

  1. 01

    The user opens the home page and lands on the Enhance tab, which shows a greeting and a rounded input card.

    The workspace is ready immediately with no authentication required.

  2. 02

    They paste a rough instruction, see the live character count toward the 15,000 limit, and optionally choose a task type, an enhancement level of light, standard, or detailed, and which sections to include.

    A preset can apply these choices in one click, and changing controls after enhancement marks the result as stale.

  3. 03

    Selecting Enhance runs the deterministic engine immediately or, when configured, calls the enhancement service with the chosen options.

    A progress indicator appears and the request can be canceled, with validation rejecting empty or oversized prompts before work begins.

  4. 04

    On success the view switches to the Result tab.

    The generated Markdown appears in three interchangeable views: raw result, rendered preview, and editable Markdown; a badge indicates whether the result came from local rules or AI, and classification notes appear when confidence was low or multiple types matched.

  5. 05

    From the result the user can copy to clipboard, export as a Markdown file, re-enhance with updated input, or save to the local library.

    Saving and history pruning respect the history-size preference, edits are tracked as dirty state and confirmed before being replaced, and all history and library data stays on device.

09

Results / Outcome

Delivered outcomes
What the feature supports in practice
  • Fully offline, private enhancement with no backend, database, or external service required for the core flow; engine isolation from framework, storage, and network imports confirms this.
  • Deterministic output: repeated calls with the same prompt and options produce byte-identical Markdown, verified by a dual-run byte-equality harness across parser, classifier, template, rules, generator, and full pipeline.
  • Real usage coverage with 13 task types, 24 sections, 17 presets, three levels, and five user-selectable sections, plus validation that rejects empty submissions and enforces the 15,000-character limit.
  • Local-first storage via IndexedDB keeps history and library available across sessions without a server, capped by a user preference.
  • No adoption numbers, performance benchmarks, or business impact figures are reported because none are established by the codebase itself.
  • Cross-browser offline behavior, accessibility beyond the component library defaults, and performance under the maximum character limit remain not physically tested.
10

Lessons Learned

Lessons learned
13 takeaways
What worked
What could improve
Future considerations
What worked5
  • Strict separation between a pure engine and the surrounding application keeps behavior easy to reason about and verify.
  • Letting templates own structure as data and reserving rules for dropping empty list sections avoids reordering bugs and makes subset invariants straightforward.
  • An explicit allow-list approach is more maintainable than guessing intent and makes unsupported technologies visibly ignored.
  • Confidence gating with fallback to the general template builds trust compared to confidently choosing the wrong specialization.
  • A thorough harness with dual-run byte-equality checks catches subtle non-determinism that unit assertions alone miss.
What could improve4
  • Grow the technology and constraint allow-lists intentionally as new domains appear rather than hallucinating support.
  • Surface low-confidence and near-tie guidance more prominently in the workspace to encourage manual type selection.
  • Verify offline behavior, accessibility, and performance at the 15,000-character limit across browsers and devices.
  • Add clearer feedback when list-based sections are dropped due to empty slots so users understand why headings are absent.
Future considerations4
  • Keep the deterministic path synchronous and pure while the optional AI path remains a single validated HTTPS endpoint with timeout and abort.
  • Consider PWA installability and static export as the default offline distribution, excluding server-only routes.
  • Preserve local-first history and library with user-capped preferences and portable export where appropriate.
  • Maintain template subset invariants with automated validation as new task types or sections are added.