Skip to content

macchant/stockwright

Repository files navigation

stockwright

Microstock production engine. A strongly-typed, deterministic pipeline that turns a niche + brief into an engine-ready prompt, a compliance report, a 5-question North Star verdict, tiered metadata, and multi-platform CSV exports — in a five-step wizard.

Built as a pure functional pipeline: schema → data → pipeline → UI. The domain logic ships with 35 passing tests; the UI is a thin rendering layer.

Why

The AI microstock market in 2026 is saturated with Midjourney-gloss. Buyers actively reject it. The differentiator is physical plausibility + buyer-intent metadata + platform-correct exports. stockwright encodes that discipline into a reusable pipeline so every asset you ship passes the same review gate.

What's inside

Layer Files Role
Types src/types/schema.ts Single-source-of-truth contract for every stage
Data src/data/ Engines, niches, lexicon, banned terms, platforms
Pipeline src/pipeline/ Pure stages: route, compose, compliance, northstar, metadata, export, run
UI src/ui/ DOM-only wizard, zero framework dependencies

Engines covered

Recraft V4 · Midjourney V8 (+ --tile) · Flux 2 Max · Nano Banana Pro · GPT Image 2 · Ideogram 3 · Leonardo · SDXL — each with its own formatter and quality-trigger profile.

Niches

A curated catalog across still-life, concept, background, non-photo, and video. Each niche encodes priority, suggested engines, palette hints, evergreen keywords, and a one-line buyer note.

The 8-layer prompt

L1 output → L2 subject → L3 style → L4 palette → L5 technical → L6 composition → L7 quality → L8 negatives

The composer produces these layers deterministically, then the engine-specific formatter joins them into the syntax that engine actually wants.

Physics & optics enhancers

Subsurface scattering, Fresnel rim, anisotropic highlight, halation, peripheral vignetting, chromatic aberration, micro grain, caustic light — plus Kelvin / aperture / focal-length presets for photo briefs.

Compliance gate

Four severity-tiered categories: artist names, brand references, protected persons/characters, AI-disclosure spam. Every issue carries a remediation hint.

North Star test

Five questions, three auto-evaluated (copy space, metadata quality) and two manual. Output score maps to upload | fix | delete.

Metadata

Title (≤ 120 chars, utility token auto-injected when copy space ≥ 30%), four keyword tiers (specific → style/mood → related → broad), alt text, IPTC block.

Exports

Adobe, Freepik, Pond5, Creative Fabrica, Shutterstock — each with correct CSV header + row.

Quick start

npm install
npm run dev       # local preview at http://localhost:5173
npm test          # 35 unit tests
npm run build     # production bundle to dist/

Read this next

How the pipeline thinks — one example brief walked through every stage with real intermediate output. Best read after npm test succeeds, so you know the code is honest.

Architecture principles

  1. Types are the contract. Every stage reads and writes a typed artifact — nothing leaks.
  2. Pipeline is pure. run() is deterministic; given the same brief it always produces the same output.
  3. UI is disposable. The wizard is a thin render layer; swap it for another UI and the pipeline is untouched.
  4. Tests gate the logic, not the chrome. 35 tests pin down compose, compliance, northstar, metadata, and route — the parts that actually earn money.

License

MIT

About

Microstock production engine — niche routing, 8-layer prompts, compliance gate, tiered metadata, multi-platform CSV export

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages