Next.js 14 App Router
The product is a Next.js App Router app with the page, root layout, global styling, and prompt-generation API route in one codebase.
A Next.js app that turns a task description, optional screenshots, and pasted code into one ready-to-use AI coding prompt. It uses React, TypeScript, Tailwind CSS, bilingual UI, editable Markdown output, .md/.docx export, and a provider-agnostic LLM backend.
Live at: https://prompt.sugiro.ai/
What powers the AI prompt generator and how the browser workflow connects to the LLM backend.
The product is a Next.js App Router app with the page, root layout, global styling, and prompt-generation API route in one codebase.
The interface is split into focused React components for task input, optional context upload, language switching, and the editable generated output panel.
The UI, API request shape, uploaded image metadata, LLM provider layer, and export helpers are typed in TypeScript.
A meticulously authored system prompt that transforms rough task descriptions into one specific, actionable prompt. The rules enforce a what → how → quality structure, scope discipline (extract intent, generalize content, never hardcode), clean Markdown formatting, and output language preservation — grounded in a single source-of-truth file.
The backend can target Anthropic, OpenRouter, DeepSeek, Moonshot/Kimi, or an OpenAI-compatible endpoint through environment variables.
Instead of manually assembling sections, users describe what they want, add screenshot or code context, generate one Markdown prompt, refine it, preview it, copy it, or export it.
The app turns rough task context into a finished prompt through one server-side generation route.
app/page.tsx renders the header, EN/BR language switcher, PromptBuilder component, and footer inside the App Router structure.
The builder keeps the task description, pasted code, uploaded image metadata, output text, active model label, loading state, and error state in client-side state.
The upload section accepts common image formats and a code/text area, so screenshots, mockups, existing code, or style examples can guide the generated prompt.
app/api/generate-prompt/route.ts validates the request, combines task, code, and image context, applies the prompt rules, and calls the configured LLM provider.
The generated Markdown appears in a textarea with preview, copy, .md download, .docx download, and model attribution.
The current version is a compact full-stack AI product with i18n, a provider adapter, and client-side export tools.
package.json next.config.js tailwind.config.ts tsconfig.json app/page.tsx app/layout.tsx app/globals.css app/api/generate-prompt/route.ts components/prompt-builder.tsx components/section-task.tsx components/section-upload.tsx components/generated-prompt.tsx components/language-switcher.tsx lib/llm/provider.ts lib/i18n/translations.ts lib/markdown-to-docx.ts
The architecture stays intentionally compact: App Router owns the page and API route, while shared library code handles provider access, i18n, and export support.
The product centers on producing one high-quality prompt while keeping provider details behind a small backend adapter.
Users describe the project, feature, or task in natural language.
They can add image context and paste existing code or patterns.
The generated prompt is editable after generation.
Preview, copy, Markdown export, and DOCX export all happen from the client UI.
The route accepts task text, pasted code, and base64 image data.
A system prompt enforces Markdown structure, scope discipline, formatting, and output language.
Provider presets choose base URLs, default models, and vision support.
Stable translated error codes keep raw provider errors out of the UI.
The local workflow is a standard Next.js app with environment-driven LLM configuration.
npm install npm run dev npm run build npm start npm run lint
The prompt generation path requires one configured LLM provider. Anthropic is the default, and OpenAI-compatible providers are supported through the same API layer.
LLM_PROVIDER selects anthropic, openrouter, deepseek, moonshot, or openai-compatible.
LLM_API_KEY, or ANTHROPIC_API_KEY when using the default Anthropic provider.
Optional LLM_MODEL, LLM_MODEL_LABEL, LLM_BASE_URL, and LLM_SUPPORTS_VISION overrides.
No database is required; frontend, API route, and export tools run from the same Next.js app.
Prompt Builder is now a task-first AI prompt generator with a provider-agnostic LLM backend. It takes task, screenshot, and code context and returns an editable Markdown prompt that can be previewed, copied, or exported as Markdown or DOCX.