clockwork: Instructions file for Codex

AGENTS.md

clockwork AGENTS.md is an instructions file for Codex, OpenCode from forthends/clockwork. It costs 1,274 tokens per session, scanned A, original, MIT.

A workspace rulebook for Clockwork, an AI-assisted development environment. It tells coding agents how to identify their role, follow the project workflow, and use the repository structure.

In plain words
What is it for?
Use it to guide Analysts, PMs, Developers, Testers, and Reviewers through shared project work. It covers roles, workflow definitions, task records, templates, and repository organization.
Why use it?
It prevents agents from skipping required steps or acting outside their assigned responsibilities. It also keeps task documents and workflow status organized in one place.

Instructions file for CodexOpenCode

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

This is forthends/clockwork's own configuration. It tells Codex and OpenCode how to work on clockwork 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 clockwork configures →

Reuse

Borrowing it

Nothing to install: this file belongs to forthends/clockwork. 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/forthends/clockwork/main/AGENTS.md
Clone the repo
git clone --depth 1 https://github.com/forthends/clockwork

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 clockwork AGENTS.md

README.md
[![agentmods](https://agentmods.dev/badge/instructions/forthends/clockwork/agents-md/github.svg)](https://agentmods.dev/instructions/forthends/clockwork/agents-md)
Your own site
<a href="https://agentmods.dev/instructions/forthends/clockwork/agents-md"><img src="https://agentmods.dev/badge/instructions/forthends/clockwork/agents-md/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for clockwork AGENTS.md

Your own site · 80×15
<a href="https://agentmods.dev/instructions/forthends/clockwork/agents-md"><img src="https://agentmods.dev/badge/instructions/forthends/clockwork/agents-md.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 1,274 This file is loaded in full into every session.
When invoked 1,274 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.01274 $0.01274
Opus 5.5 $0.00510 $0.00510
Sonnet 5.5 $0.00255 $0.00255
Haiku 4.5 $0.00127 $0.00127

Measured 2mo ago against content hash 0547ab51028b, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

clockwork 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 2mo 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 · 147 lines

How it starts

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

Clockwork — 全局 Agent 治理规则

本文件是 Clockwork 治理框架的核心规则定义,所有 Agent 在本工作空间中工作时必须遵守以下约束。


1. 工作空间认知

你正在 Clockwork(机关术) 治理工作空间中工作。该工作空间为敏捷开发团队提供统一的 AI Agent 协作环境。

目录结构

clockwork/
├── agents/          # 角色 Agent 定义(Analyst / PM / Developer / Tester / Reviewer)
├── skills/          # 可复用技能定义
├── workflow/        # 工作流定义与需求产物
│   ├── _schemas/    # 工作流 YAML Schema
│   ├── _definitions/# 工作流定义文件
│   ├── _templates/  # 产物模板(黄金标准)
│   └── features/    # 需求实例及其产物
├── docs/            # 项目文档与质量标准
│   └── projects/    # 各代码仓库的项目简介(由 Analyst 生成)
├── repos/           # 代码仓库(git submodule)
├── AGENTS.md        # 本文件 — 全局治理规则
└── README.md        # 项目介绍

识别你的角色

在开始任何任务之前,你必须:

  1. 确认当前用户的角色(Analyst / PM / Developer / Tester / Reviewer)
  2. 读取 agents/<role>/AGENT.md 了解角色职责、约束和可用技能
  3. 仅在自己角色职责范围内操作,不得越权

2. 工作流感知

读取工作流定义

所有任务必须在工作流框架内执行:

  1. 读取 workflow/_definitions/<workflow-type>.yaml 了解流程定义
  2. 识别当前所处的阶段(stage)
  3. 读取该阶段声明的 inputs(上游产物)作为工作上下文
  4. 按照该阶段声明的 outputs 要求产出符合规范的产物

管理需求实例

每个需求实例存放在 workflow/features/FEAT-<id>-<name>/ 下:

  • manifest.yaml:记录该需求的工作流状态,是持久脉冲的核心载体
  • 产物文件(prd.md, tech-design.md 等):各阶段的输出产物

manifest.yaml 操作规范

  • 开始一个阶段时:将该阶段 status 更新为 in_progress
  • 完成一个阶段时:将该阶段 status 更新为 completed,记录 completed_at 和 artifacts
  • 校验通过时:设置 validation_passed: true
  • 永远不要跳过阶段,必须按工作流定义的顺序推进

3. 产物输出规范

模板使用

所有产物必须基于 workflow/_templates/ 中的模板创建:

  • 保持模板定义的章节结构,不得随意删减必填章节
  • 在模板的占位符处填写实际内容
  • 可在模板结构基础上扩展额外章节

文件命名

  • 产物文件名必须与工作流 YAML 中 outputs.id 一致
  • 使用小写字母和连字符:prd.md, tech-design.md, test-plan.md

内容质量底线

  • 所有产物必须使用中文撰写(除非该项目有其他语言要求)
  • 章节内容不得为空或仅含占位符
  • 涉及上游产物的引用必须准确,不得编造

4. 质量闸门(Quality Governors)

校验规则

每个阶段的 validation 字段定义了质量闸门:

  • required_sections:产物必须包含的章节
  • 其他自定义校验规则

校验流程

  1. 产物完成后,调用 validate-artifact 技能进行校验
  2. 校验通过后,更新 manifest.yaml 中的 validation_passed: true
  3. 校验未通过时,必须修正后重新校验,不得跳过

5. 技能调用

可用技能

技能定义在 skills/ 目录中,每个技能目录下包含 SKILL.md。

Read the full file on GitHub · 147 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. 2mo ago First seen · 147 lines · 1,274 tokens per session scan A 0547ab51028b

Subscribe to this mod's changes

clockwork AGENTS.md is an instructions file published in the GitHub repository forthends/clockwork (8 stars, last pushed 16d ago), licensed MIT. It adds 1,274 tokens to every session, about $0.0051 per session on Opus 5.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-31.

Related

Other instructions, from other repositories

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 · 9,715 tokens

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,461 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, cache eligibility and rollout and applying the notice (cutover).

microsoft/vscode · 5,262 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,680 tokens

vscode copilot-instructions.md

Copilot instructions for microsoft/vscode, covering vs code copilot instructions, project overview, root folders, core architecture (src/ folder) and built-in extensions (extensions/ folder).

microsoft/vscode · 2,750 tokens

deno copilot-instructions.md

Copilot instructions for denoland/deno, covering deno development guide for github copilot, network access, high level overview, key directories and key files to understand first.

denoland/deno · 3,077 tokens