storyforge: Instructions file for Codex

AGENTS.md

storyforge AGENTS.md is an instructions file for Codex, OpenCode from yuanbw2025/storyforge. It costs 2,050 tokens per session, scanned A, original, MIT.

A project guide for coding agents working on StoryForge, a local-first storytelling application. It defines the product boundaries, official documents, data registries, and approved ways for AI features to read and change project data.

In plain words
What is it for?
Use it when planning or changing StoryForge features, especially AI workflows, database tables, imports, exports, and links to versioned world content.
Why use it?
It prevents agents from treating separate products as one system or adding code that bypasses the project’s rules. It also reduces inconsistent data handling and undocumented changes.

Instructions file for CodexOpenCode

Written for Codex and OpenCode: the file is AGENTS.md. Also seen: mentions AGENTS.md.

This is yuanbw2025/storyforge's own configuration. It tells Codex and OpenCode how to work on storyforge itself, so it is not a mod to install elsewhere. Copy it as a starting point and replace the rules that are about this project. Everything storyforge configures →

Reuse

Borrowing it

Nothing to install: this file belongs to yuanbw2025/storyforge. Take a copy, put it at the same path in your own repository, and replace the rules that are about this project with yours.

Copy the file
curl -O https://raw.githubusercontent.com/yuanbw2025/storyforge/main/AGENTS.md
Clone the repo
git clone --depth 1 https://github.com/yuanbw2025/storyforge

Made for: Codex, OpenCode.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for storyforge AGENTS.md

README.md
[![agentmods](https://agentmods.dev/badge/instructions/yuanbw2025/storyforge/agents-md.svg)](https://agentmods.dev/instructions/yuanbw2025/storyforge/agents-md)
Your own site
<a href="https://agentmods.dev/instructions/yuanbw2025/storyforge/agents-md"><img src="https://agentmods.dev/badge/instructions/yuanbw2025/storyforge/agents-md.svg" alt="Measured on agentmods" height="20"></a>
Per session 2,050 This file is loaded in full into every session.
When invoked 2,050 The same file — it is already loaded in full.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.02050 $0.02050
Opus 5 $0.01025 $0.01025
Sonnet 5 $0.00410 $0.00410
Haiku 4.5 $0.00205 $0.00205

Measured 3d ago against content hash fbadb804fb75, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-08, from the pricing page.

Security

Grade A, and why

storyforge AGENTS.md scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 3d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

AGENTS.md · 86 lines

How it starts

The opening of the file, as written. The whole thing — 86 lines — stays where its author put it; the contents beside it link to each section on GitHub.

AGENTS.md · StoryForge 开发入口

普通任务唯一自动加载的项目文档。先按本文建立关联闭包,再通过 docs/CONTEXT-ROUTING.md 按任务读取现行文档片段。 项目方向以 docs/PROJECT-MASTER-CHARTER.md 为最高权威; 未列入 docs/DOCUMENT-AUTHORITY.md 的旧文档不得作为施工依据。

先确定产品边界

StoryForge 是多个独立叙事产品、世界引擎和共享工程底座的组合,不是一个不断膨胀的单体模块。

  • 分步骤长篇是独立核心产品;不以世界引擎为前置条件。作者可显式把已确认的长篇内容一键派生为世界草稿或封存版本,原作品 owner 不变、后续修改不自动同步。
  • 节点模式是同一长篇能力更自由、更细粒度、更可视和可组合的表达;它可以拆解、替换、连接和检查中间产物,但不得复制第二套生成、记忆或数据体系。
  • 短篇、小说转剧本、小说转漫画分别是独立端到端产品。
  • 短篇也可由作者显式派生世界;小说转剧本、小说转漫画当前不提供“封装为世界”路径。
  • 世界引擎只保存可版本化语义内容,不拥有产品媒资或上层运行状态。
  • 跑团、角色聊天、AI 小镇和文字游戏只读引用冻结的世界版本;各自拥有生产、媒资、发布、运行与私域演化,运行结果不得自动回写世界引擎。
  • 世界衍生产品统一经过“世界封存 → 产品内交互/配置/用户明确开始 → 产品生产/发布/运行/演化”;不得从世界页面直达正式 runtime。
  • 世界出口统一 describe/search/read、版本和来源语义,不统一固定 payload;每个产品用自己的需求适配器声明必读、选读、条件读取和禁止读取,冻结 SourcePlan,每次渐进读取留 Context Manifest,发布时聚合 SourceManifest。Skill/Prompt 可辅助语义选择,但不得单独承担版本、权限和必读约束。
  • Project 只是 LocalWorkspace 壳:只保存稳定身份、用途、活动 World/Work 指针和工作区级开关;作品标题、简介、流派、状态、字数、文风和活动叙事计划只允许存在于 Work。禁止镜像、双写、回退读取和导入时展开旧 Project 对象。

开始功能前先声明:它属于哪个产品、三阶段中的哪一阶段(独立产品则声明自己的生产阶段)、数据由谁拥有、接收和产出什么交接物、是否引用世界版本、媒资归哪个产品实例。边界不清时先补产品契约,不用代码制造既成事实。

守住三注册表

StoryForge 是 React + TypeScript + IndexedDB 的本地优先生产项目。用户手稿主要存在浏览器中, main 直接进入生产部署,没有 staging。任何扩展必须收口到三个单一事实源:

  1. CONTEXT_SOURCES + assembleContext():AI 读什么。
  2. FIELD_REGISTRY + AdoptionSchema + adopt():AI 可以正式写什么。
  3. PROJECT_TABLES:表的导出、导入、删除、迁移、作用域和引用重映射生命周期。

动手前依次回答:

  1. 入口和用户结果是什么?
  2. AI/代码读取哪些来源,是否已登记在 CONTEXT_SOURCES
  3. 候选最终写入哪些字段,是否已登记在 FIELD_REGISTRY / AdoptionSchema
  4. 涉及哪些表,是否由 PROJECT_TABLES 派生完整生命周期?
  5. 哪些调用方、下游、反例和真实用户路径会受影响?

登记缺失时,先补注册表、契约与测试,再写功能。禁止在组件或 service 中手拼上下文、散写受治理表、手写表清单、复制 AI/DB/导入导出入口。

正式 AI 与 Harness

正式模型调用必须进入登记的 Agent Skill / Run Contract / durable Harness,或在 AI 入口注册表中明确标注只读、内存草稿、评测、模拟等有限边界。

  • 上下文由注册源、Context Gateway 和渐进式披露选择;固定条数裁剪只能是最终预算保护。
  • 模型输出先成为 CreativeArtifact 候选;作者确认后才可 adopt()
  • durable run 保存 contract、manifest、事件、checkpoint、stale 证据、repair 与终态 receipt。
  • 重试必须有界且可见;授权、余额、非重试型 4xx、结果未知或 stale 不得隐藏重发。
  • 可验证的 schema、事务、作用域、版本、权限、预算和状态机不得只写进提示词。

Read the full file on GitHub · 86 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 3d ago Changed · +8 lines · +525 tokens per session fbadb804fb75
  2. 8d ago First seen · 78 lines · 1,525 tokens per session scan A 3276476885c8

Subscribe to this mod's changes

storyforge AGENTS.md is an instructions file published in the GitHub repository yuanbw2025/storyforge (635 stars, last pushed today), licensed MIT. It adds 2,050 tokens to every session, about $0.0103 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.

Related

Other instructions, from other repositories

next.js AGENTS.md

AGENTS.md instructions for vercel/next.js, covering next.js development guide, codebase structure, monorepo overview, core package: packages/next and other important packages.

vercel/next.js · 7,296 tokens

codex AGENTS.md

AGENTS.md instructions for openai/codex, covering rust/codex-rs, the codex-core crate, code review rules, crate api surface and model visible context.

openai/codex · 5,153 tokens

vscode buildNext.instructions.md

Working notes and architecture documentation for the new esbuild-based build system in build/next. Use when making changes to the new build pipeline (transpile/bundle commands, NLS plugin, source-map handling, resource copying, or self-hosting watch tasks).

microsoft/vscode · 6,785 tokens

vscode oss-third-party-notices.instructions.md

Instructions for microsoft/vscode, covering vs code oss third-party-notices pipeline, architecture, pipeline flow in ci, applying the notice (cutover) and fallback chain (never fail the build).

microsoft/vscode · 5,001 tokens

langchain AGENTS.md

AGENTS.md instructions for langchain-ai/langchain, covering global development guidelines for the langchain monorepo, corridor security analysis, project architecture and context, monorepo structure and development tools & commands.

langchain-ai/langchain · 4,469 tokens

spec-kit AGENTS.md

AGENTS.md instructions for github/spec-kit, covering agents.md, about spec kit and specify, quickstart — add a new integration in 5 steps, integration architecture and integrationmanifest — file tracking.

github/spec-kit · 7,104 tokens