clockwork AGENTS.md

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

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add instructions/forthends/clockwork/agents-md
Clone the repo
git clone --depth 1 https://github.com/forthends/clockwork

Made for: Codex, OpenCode.

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. Scan, not verified.
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 $0.01274 $0.01274
Opus 5 $0.00637 $0.00637
Sonnet 5 $0.00255 $0.00255
Haiku 4.5 $0.00127 $0.00127

Measured 2d ago against content hash 0547ab51028b, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, 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 2d 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_atartifacts
  • 校验通过时:设置 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. 2d 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 2mo ago), licensed MIT. It adds 1,274 tokens to every session, about $0.0064 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-31.

Related

Other instructions, from other repositories

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,182 tokens

buildNext

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

next.js 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

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

spec-kit 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,040 tokens

langchain 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,345 tokens