media-forge
Skill3 starsChanged 6 months agoMITView on GitHub
Generate image, video, and audio artifacts through Replicate or fal.ai and emit downloaded MediaArtifact JSON.
In this repository60 other files it gives its agents.
- CLAUDE.mdCLAUDE.md
- ad-copy-creatorSkill
- ad-performance-analyzerSkill
- analytics-collectorSkill
- blog-content-creatorSkill
- brand-architectSkill
- brand-os-architectSkill
- channel-validatorSkill
- cinematic-promptingSkill
- competitive-intelligence-analystSkill
- competitor-analyzerSkill
- constraint-eliminatorSkill
- content-atomizerSkill
- content-factory-operatorSkill
- content-geo-optimizerSkill
- content-loop-orchestratorSkill
- content-reviewerSkill
- content-seo-optimizerSkill
- content-strategistSkill
- copywriterSkill
- email-finderSkill
- expert-architectSkill
- expert-validatorSkill
- funnel-architectSkill
- funnel-validatorSkill
- genfeed-brand-osSkill
- genfeed-connectorSkill
- humanizerSkill
- image-prompt-engineerSkill
- instagram-content-creatorSkill
- instagram-warmupSkill
- internal-commsSkill
- launch-copy-creatorSkill
- lead-channel-optimizerSkill
- leads-researcherSkill
- linkedin-content-creatorSkill
- linkedin-warmupSkill
- newsletter-creatorSkill
- offer-architectSkill
- offer-validatorSkill
- outbound-optimizerSkill
- partnership-builderSkill
- positioning-anglesSkill
- pricing-strategistSkill
- prompt-generatorSkill
- retention-engineSkill
- search-domain-validatorSkill
- social-posterSkill
- startup-icp-definerSkill
- support-systems-architectSkill
- tiktok-warmupSkill
- traffic-architectSkill
- traffic-validatorSkill
- trend-scoutSkill
- visual-brand-kitSkill
- x-content-creatorSkill
- x-warmupSkill
- youtube-content-creatorSkill
- youtube-video-analystSkill
- youtube-warmupSkill
The file
Files
Media Forge
You turn a prompt into a file. Image, video, or audio — through Replicate or fal.ai, the two aggregators that front nearly every open and commercial generative model. You are the media half of produce in trend -> remix -> produce -> post -> analytic.
Pure worker: no state, no SDK, no persisted secret. You read one token from the environment, submit a job, wait for it, download the outputs, and print MediaArtifact JSON. The orchestrator resolves the token (gf token replicate|fal), runs you, and attaches your artifacts to a ContentItem through the seam.
Run It
bun run scripts/forge.ts \
--provider replicate|fal \
--modality image|video|audio \
--model <model-id> \
--prompt "..." \
[--input '{"aspect_ratio":"16:9","num_outputs":2}'] \
[--out .genfeed/artifacts]Requires Bun 1.1+. Zero dependencies — only Node built-ins and global fetch.
--input is merged over {prompt} and passed verbatim as the model's input object, so any model-specific parameter is reachable without code changes.
Providers
Replicate
- Token:
REPLICATE_API_TOKEN. - Uses the unified
POST /v1/predictionsendpoint, which acceptsowner/name,owner/name:version, or a bare version id as--model. - Sends
Prefer: waitfor synchronous completion, then pollsurls.getfor anything still running.
bun run scripts/forge.ts --provider replicate --modality image \
--model black-forest-labs/flux-1.1-pro --prompt "a t-rex on a skateboard, cinematic"fal.ai
- Token:
FAL_KEY. - Uses the async queue:
POST https://queue.fal.run/<model>, polls the returnedstatus_urluntilCOMPLETED, then fetchesresponse_url.
bun run scripts/forge.ts --provider fal --modality video \
--model fal-ai/ltx-video --prompt "neon city flyover at night"Both providers cap waiting at ~10 minutes (240 polls × 2.5s), enough for slow video jobs.
Output
Outputs are downloaded into --out (default .genfeed/artifacts), one file per result, named art_<uuid>.<ext> (extension inferred from the URL, else png/mp4/mp3 by modality). stdout is:
{
"count": 1,
"artifacts": [
{
"id": "art_2f1c...",
"modality": "image",
"provider": "replicate",
"model": "black-forest-labs/flux-1.1-pro",
"prompt": "a t-rex on a skateboard, cinematic",
"path": ".genfeed/artifacts/art_2f1c....png",
"meta": { "sourceUrl": "https://...", "index": 0, "createdAt": "..." }
}
]
}Each artifact matches the MediaArtifact shape in genfeed-connector/lib/schema.ts, so the orchestrator can push it straight onto ContentItem.artifacts[].
Output URLs are extracted by walking the provider's response JSON and collecting every http(s) URL, so it works across model output shapes (string, array, {images:[{url}]}, {video:{url}}, {audio:{url}}, …) without per-model branching.
How It Fits The Loop
# orchestrator resolves a scoped token through the seam, never seeing the raw vault credential
export REPLICATE_API_TOKEN="$(bun run ../genfeed-connector/gf.ts token replicate)"
# forge a hero image for an item, capture artifacts
ART=$(bun run scripts/forge.ts --provider replicate --modality image \
--model black-forest-labs/flux-1.1-pro --prompt "$THESIS")
# orchestrator merges $ART.artifacts into the ContentItem and advances the stageSecurity
- Tokens (
REPLICATE_API_TOKEN,FAL_KEY) are read from the environment, used in memory, and never written to any file. Resolve them through the connector so the long-lived credential stays in the env or the genfeed vault. - The only outbound calls are to the chosen provider's API and the output-file URLs it returns.
- Generated files are written only under
--out; nothing else touches the filesystem.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

