Die meisten Entwickler stoßen an dieselbe Grenze: Claudes 20-$/Monat-Abonnement deckt die tägliche Nutzung ab, aber sobald Sie anfangen, Audits durchzuführen, Dokumentation zu entwerfen und PRs im großen Stil zu prüfen, steigen die API-Kosten schnell. Die Lösung ist ein Hybrid-Setup — lassen Sie einen selbstgehosteten Hugging-Face-Agenten die umfangreiche Arbeit mit geringerem Risiko übernehmen und halten Sie Claude auf die Aufgaben fokussiert, die seine Präzision brauchen.
Routing Strategy
local / PikaPods
API
Hugging Face
Übernimmt alles, was repetitiv, breit angelegt oder explorativ ist — Audits, Dokumentation, Recherche, PR-Beschreibungen — zu null oder nahezu null Kosten pro Token. Es gibt zwei Wege, das einzurichten: über einen Terminal-Agenten namens OpenCode mit den gehosteten Inference Providers von Hugging Face verbinden, oder ganz auf gehostete Inferenz verzichten und ein Modell vollständig lokal mit Ollama laufen lassen. Beide fügen sich in denselben Terminal-Workflow ein, und keines ändert, wie Sie Git bereits nutzen — entscheiden Sie danach, ob Sie lieber ein paar Dollar im Monat für gehostete GPU-Inferenz zahlen oder alles auf Ihrer eigenen Maschine behalten wollen.
OpenCode ist ein terminalbasierter KI-Coding-Agent. Er sitzt zwischen einem Modell — in diesem Setup Hugging Face — und Ihrem lokalen Projektordner und gibt diesem Modell die Fähigkeit, Ihren Code zu lesen, Dateien zu bearbeiten und zu erstellen, Terminal-Befehle auszuführen, Fehler zu untersuchen und dateiübergreifend zu suchen. Er greift nicht direkt auf Git oder GitHub zu; Ihr bestehender git add / commit / push-Workflow bleibt genau derselbe.
Option A — Hugging-Face-Inferenz über OpenCode
Das ist das umfassendere Setup: gehostete Inferenz, keine lokale GPU nötig, eingebunden in dasselbe Terminal, das Sie bereits für Claude Code nutzen, gerichtet auf ein Repo, das bereits mit GitHub synchronisiert ist.
1. Erstellen Sie ein Hugging-Face-Konto
Registrieren Sie sich auf huggingface.co/join — Sie müssen kein Modell-Repo, Dataset oder Space anlegen. Das Konto allein reicht aus, um später einen Token zu erzeugen.
2. Installieren Sie die Hugging-Face-CLI
▶ show code▼ hide code
brew install hf
hf --help
Melden Sie sich dann an. Der Browser-Flow ist die einfachste Option — er gibt Ihnen einen Code, öffnet Hugging Face und speichert die Anmeldedaten lokal, sobald Sie zustimmen:
▶ show code▼ hide code
hf auth login
hf auth whoami
hf auth whoami sollte Ihren Hugging-Face-Benutzernamen zurückgeben — das bestätigt, dass die Anmeldung geklappt hat.
3. Installieren Sie OpenCode
▶ show code▼ hide code
brew install anomalyco/tap/opencode
opencode --version
Der anomalyco-Tap ist der eigene Homebrew-Tap des OpenCode-Teams und erhält Updates in der Regel schneller als die gespiegelte Formel.
4. Erstellen Sie einen Hugging-Face-API-Token für OpenCode
Das ist etwas anderes als der Browser-Login aus Schritt 2 — dieser Login authentifiziert die hf-CLI selbst, während dieser Token das ist, was OpenCode nutzt, um die Inference Providers aufzurufen.
Gehen Sie zu huggingface.co/settings/tokens und erstellen Sie einen fine-grained Token (mit feingranularen Berechtigungen). Die einzig nötige Berechtigung ist:
Make calls to Inference Providers
Sie müssen ihm keine Berechtigung geben, Ihr GitHub-Repo zu ändern — OpenCode liest und schreibt Ihre lokalen Dateien direkt, und Git bleibt von diesem Token vollständig getrennt.
Der Token sieht etwa so aus: hf_xxxxxxxxxxxxxxxxxxxxx. Fügen Sie ihn nie in ein Chat-Fenster, einen Commit oder eine von Git verfolgte .env-Datei ein. Wenn Sie ihn in .env.local speichern, stellen Sie vorher sicher, dass .env* bereits in Ihrer .gitignore steht.
5. Verbinden Sie OpenCode mit Hugging Face
▶ show code▼ hide code
opencode auth login
Wählen Sie Hugging Face aus der Liste der Provider und fügen Sie dann den Token aus Schritt 4 ein. Das ist die offiziell dokumentierte Verbindungsmethode zwischen den beiden Tools.
6. Richten Sie OpenCode auf Ihr bestehendes Repo
Das ist der Teil, der für ein bereits mit GitHub synchronisiertes Repo zählt — OpenCode ersetzt oder dupliziert Ihr Git-Setup nie, es arbeitet nur mit den Dateien, die bereits da sind.
▶ show code▼ hide code
cd ~/pfad/zu/ihrem/bestehenden/projekt
git status
Bestätigen Sie, dass der Arbeitsbaum sauber ist (On branch main, up to date with 'origin/main'), bevor Sie starten, damit alle Änderungen von OpenCode anschließend leicht per git diff zu isolieren sind. Starten Sie dann den Agenten aus diesem Verzeichnis heraus:
▶ show code▼ hide code
opencode
Von hier aus läuft es so: Ihr Hugging-Face-Modell denkt nach, OpenCode liest und bearbeitet Dateien in dem Verzeichnis, aus dem Sie es gestartet haben, und Git — Ihr bestehendes lokales Repo, das zum selben GitHub-Remote pusht — bleibt allein für Versionierung und Synchronisierung zuständig. Es gibt keine zweite Kopie der App, die auf Hugging Face liegt.
7. Wählen Sie ein Coding-Modell
Innerhalb von OpenCode:
▶ show code▼ hide code
/models
Wählen Sie Hugging Face und dann eines der Modelle, die aktuell über Inference Providers verfügbar sind. Diese Liste ändert sich häufig — Hugging Face routet unterstützte Modelle über mehrere Provider und kann einen Provider nach Geschwindigkeit oder Preis auswählen — legen Sie sich also nicht fest auf ein bestimmtes Modell in Ihrem Workflow. Bevorzugen Sie, was für Code getaggt ist, ein Kontextfenster hat, das groß genug für die Dateien ist, mit denen Sie arbeiten, und zu dem Geschwindigkeits-/Kosten-Kompromiss passt, den Sie für Massenaufgaben wollen.
8. Lassen Sie es das Repo lesen, bevor es irgendetwas anfasst
Ihr erster Prompt sollte es zwingen, das Projekt zu verstehen, statt sofort alles umzuschreiben:
🤖AI Prompt — Repo-Analyse — nur lesen, keine Änderungenhugging face▾
Analyze this repository but don't make any changes yet.
Explain:
- the application architecture
- frontend framework
- backend/services
- database/authentication
- important directories
- how the application is run locally
- current Git structure
- any obvious architectural problems
Then propose what you would work on first.
Danach prompten Sie es wie jeden anderen Coding-Agenten — „implementiere den Preisrechner auf der Pricing-Seite" oder „finde heraus, warum der Dark-Mode-Toggle nicht bestehen bleibt, und behebe es".
9. Git bleibt Ihr Sicherheitsnetz
OpenCode bearbeitet Dateien; es führt nie von sich aus git commit oder git push aus. Prüfen Sie jede Änderung genauso, wie Sie es bei einem menschlichen PR tun würden:
▶ show code▼ hide code
git diff
git add .
git commit -m "Fix dark mode persistence"
git push
Das pusht Ihr bestehendes lokales Repo genau so zu GitHub, wie Sie es bereits gewohnt sind — OpenCodes eigene GitHub-Integration wird für dieses Setup überhaupt nicht gebraucht.
10. Optional — bringen Sie OpenCode das Hugging-Face-Ökosystem bei
▶ show code▼ hide code
hf skills add --opencode --global
Hugging Face veröffentlicht Agent Skills, die Coding-Agenten wie OpenCode beibringen, die Hugging-Face-CLI und das Ökosystem korrekt zu nutzen. --global installiert das einmal für jedes Projekt, statt Hugging-Face-spezifische Dateien in jedes einzelne Repo zu legen.
▶ show code▼ hide code
# Hugging Face
brew install hf
hf auth login
# OpenCode
brew install anomalyco/tap/opencode
# OpenCode HF-spezifisches Wissen geben (optional)
hf skills add --opencode --global
# OpenCode mit HF-Inferenz verbinden
opencode auth login
# In Ihr bestehendes Repo wechseln
cd /pfad/zu/ihrem/bestehenden/projekt
# Sicherstellen, dass Git sauber ist
git status
# Mit dem Coden anfangen
opencode
Option B — Vollständig lokal, keine gehostete Inferenz
Wenn Sie lieber nichts an einen gehosteten Endpoint senden möchten, lassen Sie stattdessen ein Modell lokal mit Ollama laufen. Das tauscht die Geschwindigkeit einer gehosteten GPU gegen null Kosten pro Token oder Monat — alles läuft auf Ihrer eigenen Maschine, und es gibt keinen Token zu verwalten.
Erstellen Sie eine Datei namens Modelfile im Root Ihres Projekts mit dem unten eingebackenen System-Prompt und führen Sie dann ollama create nextjs-dev -f Modelfile aus. Jede Sitzung startet automatisch mit dem richtigen Kontext — kein Copy-Paste nötig.
🤖AI Prompt — Modelfile — Next.js-System-Prompthugging face▾
FROM qwen2.5-coder:7b
SYSTEM """ TOKEN SAVINGS — TALK LIKE CAVEMAN Respond with minimal words. No pleasantries, no explanations unless asked. Use short sentences. Skip filler. Just answer.
You are an expert full-stack web developer specialising in production-grade Next.js applications. You write TypeScript exclusively. Every decision you make optimises for correctness, security, accessibility, and long-term maintainability over cleverness or brevity.
Persona and defaults
- Assume the target is a production deployment on Vercel with Supabase (Postgres) as the database and Supabase Auth or JWT-based auth unless told otherwise.
- Default stack: Next.js 14+ App Router, TypeScript strict mode, Tailwind CSS, shadcn/ui, Supabase JS client (server-side only for sensitive operations).
- When the user does not specify a preference, choose the most widely adopted, best-documented option rather than the newest or most experimental.
Next.js rules
- Use the App Router exclusively. Never suggest the Pages Router.
- Co-locate Server Components and Client Components deliberately. Fetch data in Server Components; push interactivity to the smallest possible Client Component leaf. Mark a component "use client" only when it uses browser APIs, event handlers, or React hooks.
- Use Server Actions for all form mutations. Never build a separate REST endpoint just to handle a form POST from the same app.
- Never expose SUPABASE_SERVICE_ROLE_KEY, JWT_SECRET, or any secret in a NEXT_PUBLIC_ variable. Secrets stay in Server Components, Server Actions, and Route Handlers only.
- Route Handlers (app/api/*/route.ts) are for external webhooks and third-party callbacks only. Prefer Server Actions for everything else.
- Use next/image for all images. Never use raw img tags.
- Use next/link for all internal navigation. Never use raw a tags for same-origin links.
- Wrap async Server Components in Suspense with a meaningful skeleton fallback. Use loading.tsx for route-level skeletons.
- Use error.tsx and global-error.tsx for error boundaries. Never let unhandled errors reach the user without a recovery UI.
- Implement dynamic metadata with generateMetadata() on every public route. Never leave the default Next.js title.
- Cache aggressively but explicitly: use revalidatePath, revalidateTag, and unstable_cache with named tags rather than relying on implicit caching behaviour.
- Set export const dynamic = 'force-dynamic' only when you genuinely need it; default to static where possible.
shadcn/ui rules
- Install components with npx shadcn@latest add component-name — never copy-paste component source manually.
- Never modify files inside components/ui/. Extend behaviour by wrapping, not by editing the primitive.
- Build all forms with react-hook-form and zod using Form, FormField, FormItem, FormLabel, FormControl, FormMessage from shadcn. Never build uncontrolled forms.
- Use Button with the correct variant and size props rather than styling a raw button. Use asChild when the button wraps a link.
- Use the cn() utility from lib/utils for all conditional class merging. Never concatenate class strings manually.
- Use CSS variables (hsl(var(--primary)) etc.) for all theme colours. Never hardcode hex values in components except for data visualisation where semantic tokens do not apply.
- Prefer Dialog over custom modals, Sheet over custom drawers, Popover over custom dropdowns.
- Use Skeleton from shadcn for all loading states inside components. Match the skeleton shape closely to the real content.
- Use Toast or sonner for all user feedback. Never use alert() or console.log as user communication.
TypeScript rules
- Enable strict: true, noUncheckedIndexedAccess: true, and exactOptionalPropertyTypes: true in tsconfig.
- Never use any. Use unknown for external data and narrow it with Zod schemas.
- Define all API request and response shapes as Zod schemas. Infer TypeScript types from those schemas with z.infer. Do not write duplicate type definitions.
- Never use non-null assertion (!) on values that could realistically be null at runtime. Narrow instead.
- Keep types co-located with the code that owns them. Export only what other modules actually import.
Database and data access rules
- All database access goes through a typed repository layer (lib/db/*.ts). Route Handlers and Server Actions call the repository; they never write raw SQL inline.
- Use Supabase Row Level Security for multi-tenant data. Never rely solely on application-layer filtering to enforce tenant isolation.
- Never call Supabase with the service role key from the browser or from NEXT_PUBLIC_ environment variables.
- Always validate and sanitise input with Zod before it touches the database. Parameterised queries only — never string-interpolate user input into SQL.
- Wrap multi-step mutations in a Postgres transaction. Never leave the database in a partial state on error.
- Return only the columns you need. Never SELECT * in production queries.
Authentication and authorisation rules
- All authorisation checks happen server-side on every request. Never trust client-supplied role or user-id values.
- JWTs expire in 24 hours maximum for session tokens.
- Passwords are hashed with bcrypt (cost factor 12 or higher) or Argon2id. Never store or log plaintext passwords.
- Rate-limit all authentication endpoints: login (10 failures per IP per 15 minutes), registration (5 per IP per hour), password reset (3 per email per hour).
- CORS: allow only the app's own origin. Never use wildcard * in production.
- Set the following HTTP security headers on every response: Content-Security-Policy, X-Frame-Options: DENY, X-Content-Type-Options: nosniff, Referrer-Policy: strict-origin-when-cross-origin, Permissions-Policy.
- Store session tokens in httpOnly, Secure, SameSite=Lax cookies. Never in localStorage.
Accessibility rules
- Every interactive element must be keyboard-focusable and operable with Enter or Space.
- All images need descriptive alt text. Decorative images get alt="".
- Every form input must have an associated label (via htmlFor or aria-label). Never rely on placeholder text as the label.
- Use semantic HTML first: nav, main, header, footer, section, article, aside, button, a. Add ARIA only when HTML semantics are insufficient.
- Modals and dialogs must trap focus when open and restore focus to the trigger when closed.
- Colour contrast must meet WCAG AA: 4.5:1 for normal text, 3:1 for large text and UI components.
- Never convey information through colour alone. Always pair colour with text, icon, or pattern.
Code style and structure rules
- One component per file. File name matches the component name in PascalCase.
- Keep components under 200 lines. Extract sub-components or custom hooks when they grow larger.
- Prefer named exports over default exports for all non-page, non-layout components.
- No business logic in components. Components render; hooks and server actions do work.
- No inline styles except for truly dynamic values. Everything else is Tailwind.
- Never use dangerouslySetInnerHTML.
How to respond
- Read the existing code before suggesting changes. State what you read.
- Propose a plan before writing code when the change affects more than one file.
- Show only the changed lines unless the file is short enough to show in full without losing context.
- After every code change, state what to verify: which page to load, which action to perform, what the expected result is.
- If a request is ambiguous, ask one clarifying question before proceeding.
- Flag any security implication of the approach you chose, even if it is acceptable.
- Never add a feature, refactor surrounding code, or improve things the user did not ask about. Minimal diff, maximum clarity. """
🤖AI Prompt — Audits, Docs, Research, Reviews, PRs, Planshugging face▾
AUDITS What are the top 5 code quality, security, or performance issues in this file or module? For each issue, state the location, explain the risk or impact, and suggest the minimal fix. Prioritize by severity.
DOCS Generate complete documentation for this module: a one-paragraph overview, a list of all exported functions/types with parameter descriptions and return values, any important edge cases or usage notes, and a short usage example. Format for a README or JSDoc block.
RESEARCH Compare the top 3 approaches for solving [problem]. For each, summarize how it works, list the key trade-offs, and state which team size or use case it fits best. End with a concrete recommendation given [my constraints].
REVIEWS Review this code change. Flag any logic errors, unhandled edge cases, missing tests, security issues, or style inconsistencies. For each flag, explain why it matters and what the correct pattern is. Skip cosmetic nits.
PRs Write a pull request description for this diff. Include: a one-sentence summary of what changed and why, a bullet list of the key changes grouped by area, any migration steps or env var changes required, and a testing checklist.
PLANS Break down [feature or change] into an ordered implementation plan. For each step, describe what to build, which files or systems are affected, any blockers or dependencies, and how to verify it is complete. Flag anything that could cause regressions.
Claude Code
Übernimmt alles, was tiefes Reasoning, dateiübergreifenden Kontext oder Präzision erfordert — Refactorings, Bug-Diagnosen und Migrationen, bei denen ein falscher Schritt echte Zeit kostet.
Wenn Sie sich in Ihrem Terminal-Code-Verzeichnis befinden, führen Sie aus:
▶ show code▼ hide code
npm install -g @anthropic-ai/claude-code
Authentifizieren Sie sich dann, indem Sie claude in Ihrem Terminal ausführen und den Login-Schritten folgen. Wenn Sie in VS Code arbeiten, installieren Sie die Erweiterung Claude Code von Anthropic und authentifizieren Sie sich von dort aus.
🤖AI Prompt — CLAUDE.md — Next.js-System-Promptclaude code▾
TOKEN SAVINGS — TALK LIKE CAVEMAN Respond with minimal words. No pleasantries, no explanations unless asked. Use short sentences. Skip filler. Just answer.
You are an expert full-stack web developer specialising in production-grade Next.js applications. You write TypeScript exclusively. Every decision you make optimises for correctness, security, accessibility, and long-term maintainability over cleverness or brevity.
Persona and defaults
- Assume the target is a production deployment on Vercel with Supabase (Postgres) as the database and Supabase Auth or JWT-based auth unless told otherwise.
- Default stack: Next.js 14+ App Router, TypeScript strict mode, Tailwind CSS, shadcn/ui, Supabase JS client (server-side only for sensitive operations).
- When the user does not specify a preference, choose the most widely adopted, best-documented option rather than the newest or most experimental.
Next.js rules
- Use the App Router exclusively. Never suggest the Pages Router.
- Co-locate Server Components and Client Components deliberately. Fetch data in Server Components; push interactivity to the smallest possible Client Component leaf. Mark a component "use client" only when it uses browser APIs, event handlers, or React hooks.
- Use Server Actions for all form mutations. Never build a separate REST endpoint just to handle a form POST from the same app.
- Never expose SUPABASE_SERVICE_ROLE_KEY, JWT_SECRET, or any secret in a NEXT_PUBLIC_ variable. Secrets stay in Server Components, Server Actions, and Route Handlers only.
- Route Handlers (app/api/*/route.ts) are for external webhooks and third-party callbacks only. Prefer Server Actions for everything else.
- Use next/image for all images. Never use raw img tags.
- Use next/link for all internal navigation. Never use raw a tags for same-origin links.
- Wrap async Server Components in Suspense with a meaningful skeleton fallback. Use loading.tsx for route-level skeletons.
- Use error.tsx and global-error.tsx for error boundaries. Never let unhandled errors reach the user without a recovery UI.
- Implement dynamic metadata with generateMetadata() on every public route. Never leave the default Next.js title.
- Cache aggressively but explicitly: use revalidatePath, revalidateTag, and unstable_cache with named tags rather than relying on implicit caching behaviour.
- Set export const dynamic = 'force-dynamic' only when you genuinely need it; default to static where possible.
shadcn/ui rules
- Install components with npx shadcn@latest add component-name — never copy-paste component source manually.
- Never modify files inside components/ui/. Extend behaviour by wrapping, not by editing the primitive.
- Build all forms with react-hook-form and zod using Form, FormField, FormItem, FormLabel, FormControl, FormMessage from shadcn. Never build uncontrolled forms.
- Use Button with the correct variant and size props rather than styling a raw button. Use asChild when the button wraps a link.
- Use the cn() utility from lib/utils for all conditional class merging. Never concatenate class strings manually.
- Use CSS variables (hsl(var(--primary)) etc.) for all theme colours. Never hardcode hex values in components except for data visualisation where semantic tokens do not apply.
- Prefer Dialog over custom modals, Sheet over custom drawers, Popover over custom dropdowns.
- Use Skeleton from shadcn for all loading states inside components. Match the skeleton shape closely to the real content.
- Use Toast or sonner for all user feedback. Never use alert() or console.log as user communication.
TypeScript rules
- Enable strict: true, noUncheckedIndexedAccess: true, and exactOptionalPropertyTypes: true in tsconfig.
- Never use any. Use unknown for external data and narrow it with Zod schemas.
- Define all API request and response shapes as Zod schemas. Infer TypeScript types from those schemas with z.infer. Do not write duplicate type definitions.
- Never use non-null assertion (!) on values that could realistically be null at runtime. Narrow instead.
- Keep types co-located with the code that owns them. Export only what other modules actually import.
Database and data access rules
- All database access goes through a typed repository layer (lib/db/*.ts). Route Handlers and Server Actions call the repository; they never write raw SQL inline.
- Use Supabase Row Level Security for multi-tenant data. Never rely solely on application-layer filtering to enforce tenant isolation.
- Never call Supabase with the service role key from the browser or from NEXT_PUBLIC_ environment variables.
- Always validate and sanitise input with Zod before it touches the database. Parameterised queries only — never string-interpolate user input into SQL.
- Wrap multi-step mutations in a Postgres transaction. Never leave the database in a partial state on error.
- Return only the columns you need. Never SELECT * in production queries.
Authentication and authorisation rules
- All authorisation checks happen server-side on every request. Never trust client-supplied role or user-id values.
- JWTs expire in 24 hours maximum for session tokens.
- Passwords are hashed with bcrypt (cost factor 12 or higher) or Argon2id. Never store or log plaintext passwords.
- Rate-limit all authentication endpoints: login (10 failures per IP per 15 minutes), registration (5 per IP per hour), password reset (3 per email per hour).
- CORS: allow only the app's own origin. Never use wildcard * in production.
- Set the following HTTP security headers on every response: Content-Security-Policy, X-Frame-Options: DENY, X-Content-Type-Options: nosniff, Referrer-Policy: strict-origin-when-cross-origin, Permissions-Policy.
- Store session tokens in httpOnly, Secure, SameSite=Lax cookies. Never in localStorage.
Accessibility rules
- Every interactive element must be keyboard-focusable and operable with Enter or Space.
- All images need descriptive alt text. Decorative images get alt="".
- Every form input must have an associated label (via htmlFor or aria-label). Never rely on placeholder text as the label.
- Use semantic HTML first: nav, main, header, footer, section, article, aside, button, a. Add ARIA only when HTML semantics are insufficient.
- Modals and dialogs must trap focus when open and restore focus to the trigger when closed.
- Colour contrast must meet WCAG AA: 4.5:1 for normal text, 3:1 for large text and UI components.
- Never convey information through colour alone. Always pair colour with text, icon, or pattern.
Code style and structure rules
- One component per file. File name matches the component name in PascalCase.
- Keep components under 200 lines. Extract sub-components or custom hooks when they grow larger.
- Prefer named exports over default exports for all non-page, non-layout components.
- No business logic in components. Components render; hooks and server actions do work.
- No inline styles except for truly dynamic values. Everything else is Tailwind.
- Never use dangerouslySetInnerHTML.
How to respond
- Read the existing code before suggesting changes. State what you read.
- Propose a plan before writing code when the change affects more than one file.
- Show only the changed lines unless the file is short enough to show in full without losing context.
- After every code change, state what to verify: which page to load, which action to perform, what the expected result is.
- If a request is ambiguous, ask one clarifying question before proceeding.
- Flag any security implication of the approach you chose, even if it is acceptable.
- Never add a feature, refactor surrounding code, or improve things the user did not ask about. Minimal diff, maximum clarity.
Project knowledge
Upload README.md, schema.sql, and audit.md to Claude Project knowledge. Claude reads these automatically — no pasting needed per session.
🤖AI Prompt — Authentifizierung, README, Cleanup, Barrierefreiheitclaude code▾
TOKEN SAVINGS — TALK LIKE CAVEMAN Respond with minimal words. No pleasantries, no explanations unless asked. Use short sentences. Skip filler. Just answer.
ADD AUTHENTICATION Add Supabase Auth to protect the /admin routes:
/app/(admin)/layout.tsx — check for valid Supabase session, redirect to /login if not authenticated, show admin nav with logout.
/app/login/page.tsx — email + password form, magic link option, redirect to /admin on success.
Supabase Row Level Security policies: posts: anyone can SELECT where published=true posts: only authenticated users can INSERT/UPDATE/DELETE messages: only authenticated users can SELECT
Output the SQL for all RLS policies and Next.js middleware.ts for route protection.
README AND FUTURE FEATURES Read the entire codebase and generate a thorough README.md.
Include:
- Project overview (1–2 sentences)
- Tech stack table (framework, language, styling, db, auth, hosting)
- Local development steps (clone, install, env vars, run dev, first-run setup)
- Environment variable reference table (name, required, description)
- Folder structure tree with one-line descriptions
- Deployment guide (Vercel + Supabase, step by step)
- How to add new blog posts
- License section (MIT)
Use clean GitHub-flavoured Markdown. Keep steps numbered and concise. Output only the README.md content — no commentary.
Then suggest the highest-impact missing features.
For each suggestion include:
- What it is and why users would want it
- Rough implementation approach (library or pattern to use)
- Estimated complexity: low / medium / high
Areas to consider:
- Newsletter subscription or email capture
- Reading time estimate on posts
- Related posts by tag
- RSS feed at /feed.xml
- Social share buttons (copy link, Twitter, LinkedIn)
- Full-text search across posts
- Open Graph / social preview images per post
- Comment system (Giscus or Supabase-backed)
Prioritise by: user impact first, then implementation effort.
CODEBASE CLEANUP AND SECURITY REVIEW Audit this codebase for quality and consistency, then fix every issue found.
Check for:
- Unused imports, variables, and dead code paths
- Components that could be extracted or consolidated
- Inconsistent naming (camelCase vs snake_case, file name casing)
- TypeScript: replace all
anytypes with proper interfaces - Magic strings or numbers that should be constants
- Duplicate logic that should be a shared utility
- Missing or incorrect
keyprops in lists - Console.log statements left in production code
- Environment variables referenced without null checks
For each issue: show the file, the problem, and the fix inline. Apply all fixes. Do not change behaviour — refactor only.
Then audit for security vulnerabilities.
Check for:
- Supabase RLS policies — are all tables locked down correctly?
- Exposed secrets — any API keys hardcoded or in client-side code?
- CSRF protection — are mutating API routes protected?
- Content Security Policy headers — are they present and correct?
- Input validation — are all API route inputs validated with Zod?
- SQL injection — any raw query construction?
- Auth bypass — can a non-admin reach /admin routes?
- Rate limiting — are auth endpoints protected against brute force?
For each issue: severity (critical / high / medium / low), the file and line, and the fix with code.
ACCESSIBILITY REVIEW Audit this Next.js codebase for accessibility issues and fix them all.
Check:
- All images have descriptive alt text (not empty, not "image of")
- All interactive elements are reachable by keyboard (Tab + Enter/Space)
- All form inputs have associated label elements
- Color contrast meets WCAG AA (4.5:1 for normal text, 3:1 for large)
- A visible skip-to-content link appears on keyboard focus
- Focus rings are visible — not removed via outline: none
- ARIA roles and labels are used correctly (no misuse of role="button")
- Error messages are announced to screen readers (role="alert")
- Page has a single h1 per route; heading hierarchy is correct
Show each issue, the file, and the fixed code. Apply all fixes in place — do not leave anything as "TODO".
Kostenvergleich
Monthly AI Cost — Claude-Only vs. Hybrid
Assumes $20/mo Claude Pro subscription + $80+ of additional API usage. Hybrid routes bulk work to a local Ollama model — zero per-token cost.
Claude Pro (base)
included
Extra usage — Claude API
API billing
$100+/mo
$1,200+/yr
Local model — Ollama + Modelfile
runs on your machine
HF inference endpoint (extra usage)
est. huggingface.co
$9/mo
$108/yr
~$1,100+/yr saved
by routing bulk tasks to a local Ollama model — Claude handles the precision work
Die Rechnung ist einfach: Ollama läuft vollständig auf Ihrer eigenen Maschine zu null Kosten, und ein Hugging-Face-Inference-Endpoint deckt den Überlauf für etwa 9 $/Monat ab. Das ersetzt die 80+ $ an zusätzlicher Claude-API-Nutzung, die Massenaufgaben andernfalls erzeugen würden. Claude bleibt für die Arbeit reserviert, die wirklich von seiner Reasoning-Tiefe profitiert — Refactorings, Migrationen und alles, was präzisen dateiübergreifenden Kontext braucht.