Skip to content

The creation contract

POST /v1/generate accepts a layered set of fields. Each layer has a different lifetime and a different job, so a client can compose exactly the guidance it needs - from a one-line prompt to a fully-directed, persona-driven, research-backed brief with proven code attached.

FieldPersisted?Purpose
promptnoThe per-job brief: what to build or change right now.
instructionsyes - project AGENTS.mdPersistent direction, persona, or style guide for the whole project.
contextnoPer-job blocks injected verbatim - the accuracy lever.
skillsyes - .klik/skills/Reusable proven code, stored and force-injected for this job.
settingsstickyEngine options (game type, model, reasoning level, ...).

prompt (required)

Free text describing what to build or change in this job. On a fresh project it is the game brief; on later jobs it is the change request ("make the obstacles faster, add a combo counter").

instructions - persistent direction

A string persisted to the project's AGENTS.md file. Every future job on the project inherits it as <project_conventions> in the system prompt - send it once, and all follow-up jobs stay on-style.

  • Re-sending instructions replaces the previous value.
  • Omitting it leaves the existing value untouched.

Use it for anything that should hold across the project's lifetime: a creator persona and voice, an art direction, hard rules ("always show a restart button within 1 second of death"), disclosure requirements, or brand constraints.

json
{
  "instructions": "You are DreamCast, an autonomous creator. Bold flat-color art, punchy game feel, always a 30-60 second short. Be transparent that games are AI-made."
}

context - per-job accuracy blocks

An array of named blocks injected verbatim into the system prompt as <api_context>, visible only for this job. This is the precision lever: research notes, design documents, reference mechanics, playtest feedback, level data - anything the model should read before building.

json
{
  "context": [
    { "name": "research", "content": "Top-performing runners restart within 3 seconds of failure..." },
    { "name": "playtest-feedback", "content": "Players said the jump felt floaty; tighten gravity." }
  ]
}

Because context is not persisted, iterating clients can send fresh findings with each job without accumulating stale guidance.

skills - reusable proven code

An array of skill objects. Skills serve two purposes at once:

  1. Stored in the project's skill store (.klik/skills/), where they become available for similarity-based reuse in later jobs.
  2. Force-injected into this job's prompt as <proven_skills>, so the model treats the attached code as a known-good starting point.
json
{
  "skills": [
    {
      "key": "one-button-runner",
      "title": "One-button runner core loop",
      "prompt": "endless runner, tap to jump",
      "mechanics": ["gravity", "obstacle spawn", "score on distance"],
      "engine": "phaser",
      "files": [
        { "path": "src/scenes/GameScene.js", "content": "// proven code ..." }
      ]
    }
  ]
}
Skill fieldRequiredMeaning
keyyesStable identifier; re-sending the same key updates the stored skill.
titleyesHuman-readable name.
promptnoThe kind of request this skill solves (used for similarity matching).
mechanicsnoMechanic tags ("gravity", "obstacle spawn", ...).
enginenoTarget engine, e.g. phaser, three, pixi.
filesyes to storeThe proven code itself. Skills without files are injected for this job but not stored.

settings - engine options

Sticky per-project engine options. Send only what you want to change; values persist across jobs until changed again.

SettingValuesMeaning
gameTypeklik-short, platformklik-short targets 15-60s one-mechanic portrait games; platform removes the short-game framing.
modele.g. openrouter/claude-fable-5The LLM used for generation.
reasoningLevellow, medium, highReasoning effort; higher is slower and more expensive but better on complex briefs.
dimensionMode2d, 3d3d sets up Three.js and 3D editor support.
aiImagestrue, falseGenerate sprite/background art with AI (billed in TIK). false uses placeholders.
aiAudiotrue, falseGenerate sound effects and music with AI (billed in TIK).
visualQaActivetrue, falseRun the visual QA pass after generation.
chatModeagent, planagent builds; plan produces a plan/analysis without writing game code.

How the layers combine

For a given job the engine assembles, in order: the project's persistent instructions (as <project_conventions>), the job's context blocks (as <api_context>), the injected skills (as <proven_skills>), and finally your prompt. A typical autonomous-creator loop:

  1. First job: send instructions (persona), context (research), skills (proven mechanics), settings, and the game brief prompt.
  2. Follow-up jobs: send only prompt (and fresh context such as playtest feedback) - the persona and skills are already in place.

Klik Engine - AI game creation.