contract-coding

contract-coding is a skill for Claude Code from baixinghao/intent-gate. It costs 0 tokens per session (1,121 once invoked), scanned A, original, MIT.

An extra coding workflow that uses an approved written requirement as the source for implementation. It checks which requirement applies and maps diagrams, rules, and database tables to code.

In plain words
What is it for?
It is for implementing or changing code when the project has intent-gate requirement folders under .harness/requests/.
Why use it?
It prevents the agent from guessing which requirement to follow or implementing against an unapproved or inconsistent specification.

Skill for Claude Code

Written for Claude Code: shipped in a Claude Code plugin. Also seen: mentions CLAUDE.md; mentions AGENTS.md.

Part of the intent-gate plugin — 4 skills, 1 hook, 1 MCP server shipped together

Good fit It is for implementing or changing code when the project has intent-gate requirement folders under .harness/requests/.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/baixinghao/intent-gate/contract-coding
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.

Any agent
npx skills add baixinghao/intent-gate --skill contract-coding
Clone the repo
git clone --depth 1 https://github.com/baixinghao/intent-gate

Made for: Claude Code.

Or install intent-gate, the plugin that ships this one along with the rest of its 4 skills, 1 hook, 1 MCP server.

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 contract-coding

README.md
[![agentmods](https://agentmods.dev/badge/skills/baixinghao/intent-gate/contract-coding/github.svg)](https://agentmods.dev/skills/baixinghao/intent-gate/contract-coding)
Your own site
<a href="https://agentmods.dev/skills/baixinghao/intent-gate/contract-coding"><img src="https://agentmods.dev/badge/skills/baixinghao/intent-gate/contract-coding/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 contract-coding

Your own site · 80×15
<a href="https://agentmods.dev/skills/baixinghao/intent-gate/contract-coding"><img src="https://agentmods.dev/badge/skills/baixinghao/intent-gate/contract-coding.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 0 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,121 The whole file, excluding the scripts and references it only reads on demand.
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.00000 $0.01121
Opus 5.5 $0.00000 $0.00448
Sonnet 5.5 $0.00000 $0.00224
Haiku 4.5 $0.00000 $0.00112

Measured 4d ago against content hash 7f2c37c3a369, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

contract-coding 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 4d 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.

skills/contract-coding/SKILL.md · 62 lines

What it actually says

Contract-Driven Coding(附加层,非编码 skill)

本 skill 是附加层,不是编码 skill。 你的项目自有编码 skill、superpowers、 CLAUDE.md/AGENTS.md 规约继续拥有"怎么写代码"(架构、风格、模式)的全部决定权。 本 skill 只管一件事:当 intent-gate 契约存在时,代码从契约生成,且绝不违背契约。 代码风格/结构上的任何冲突,以项目自有规则为准;契约保真这件事,本 skill 不让步。

契约路由(多需求并存,🔴 禁止猜)

  1. 人类点名了需求 → 精确匹配 .harness/requests/{需求名}/。没有同名目录 = 该需求没有契约,走第 3 条——🔴 禁止模糊匹配到别需求的契约 ("授信提交"套"提现确认"的 mermaid 是事故,不是便捷)。文件夹名即唯一标识, 文件系统保证不重名,无需另造 ID。
  2. 人类没点名 → 列出 .harness/requests/ 下的契约清单让人类选,禁止自己挑。
  3. 点名的需求无契约、但项目里已有其他契约(说明本工作流已启用)→ 告知人类"该需求还没有契约",给两条路:先跑 requirement-alignment 出契约, 或人类明确说"不要契约直接写"——后者合法,人类指令优先。 (仅当整个项目没有任何 .harness/requests/ 时才完全静默、按原方式编码。)
  4. 采用契约前交叉验证:任务的领域词汇(实体/动作)应命中契约的术语表; 明显对不上 → 停,向人类确认是否拿错了契约。

开工门禁(机械项,无商量)

  1. 路由确认契约后读 frontmatter:status: approved 才动工; pending_review / blocked → 停下报回人类。approved 只有两条合法来源: 蓝军 PASS 或人类直接拍板——红蓝评审是可选项,人类说"不用评审,我拍板" 即合法开工,任何人不得强制走红蓝。
  2. 读 _review/lint-report.md:CRITICAL > 0 → 契约自身带机械错误, 禁止对着它编码,报回人类先修契约。

🔴 门禁拒绝的正确动作是停下报回人类——契约状态是人类拍板的事, 不是"再分析一遍"的事。禁止因为 status ≠ approved 或 lint 未归零就转入 requirement-alignment 重启/续跑意图对齐流程。

从契约施工

  • mermaid 状态机 / 时序图 / 决策表 + DDL 就是规格。每个实现任务可回溯到锚点: 哪条边 → 哪个接口/方法;哪条 BR 规则 → 哪个校验分支;哪张表 → 哪个实体/Mapper。
  • 只实现契约里有的。 图里没有的逻辑不许出现在代码里——无契约逻辑就是 意图对齐要消灭的"静默猜测"在编码期的复活。
  • 术语沿用契约词汇表(wiki 对齐版),禁止新造命名。

漂移 = 停线

编码中发现契约错了/不够用(现实逼着偏离图):

  1. 停下,禁止顺手绕过去;
  2. 走 dispatch_question 升级(对话框通道直接向人类提问);
  3. 先改契约(重新对齐 + 重跑 lint),再改代码。

mermaid 与代码漂移即 bug——无论哪个方向。

完工

  • 契约若有修订,重跑 lint_summary(CRITICAL 归零)。
  • 说明每处改动实现了契约的哪些锚点,让评审能从代码回溯到契约。
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. 4d ago Changed 7f2c37c3a369
  2. 1mo ago First seen · 62 lines · 0 tokens per session scan A f9712fbf8c5d

Subscribe to this mod's changes

contract-coding is a skill published in the GitHub repository baixinghao/intent-gate (3 stars, last pushed 4d ago), licensed MIT. It costs nothing until one of its globs matches a file; then it loads 1,121 tokens. 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 skills, from other repositories

build-teaql-app

Build or change a TeaQL application in Java, Rust, Go, Swift, Python, C#/.NET, or TypeScript, including Kotlin/JVM applications that consume Java-generated libraries. Mandatory order: first draft and save a complete KSML model, then verify the client and evaluate that saved model, repair it through repeated evaluation…

teaql/teaql-agent-kit · 112 tokens

video-perception

Use when the user mentions a video file (.mp4, .mov, .avi, .mkv, .webm), a YouTube URL, asks to watch/analyze/review a video, or references video content in conversation.

jordanrendric/claude-video-vision · 51 tokens

sanity-singletons

Configure singleton documents in a Sanity Studio using the document.singletons registry. Use when a developer wants a fixed-id document (settings, navigation, footer) edited in place, hidden from the default content list, with no "create new" or "duplicate" affordances — or when migrating a userland singleton…

sanity-io/agent-toolkit · 90 tokens

sanity-best-practices

Sanity development best practices for schema design, GROQ queries, TypeGen, Visual Editing, images, Portable Text, Studio structure, localization, migrations, Sanity Functions, webhooks, Blueprints, and framework integrations such as Next.js, Nuxt, Astro, Remix, SvelteKit, Angular, Hydrogen, the App SDK, and Studios…

sanity-io/agent-toolkit · 177 tokens

seo-aeo-best-practices

SEO and AEO best practices for metadata, Open Graph, sitemaps, robots.txt, hreflang, JSON-LD structured data, EEAT, and content optimized for search engines and AI answer surfaces. Use this skill when implementing page SEO, technical SEO, schema markup, international SEO, AI-overview readiness, or improving content…

sanity-io/agent-toolkit · 90 tokens

raindrop-mcp

Connect Raindrop.io to your AI assistant with a simple MCP server. Use it to organize, search, and manage bookmarks with natural language.

adeze/raindrop-mcp · 0 tokens