跪拜 Guibai
← All articles
Frontend · Backend · GitHub

DeepSeek Harness Doesn't Bet on AI Understanding Your Code — It Writes the Rules Down

By 小u ·
Read original on juejin.cn ↗ Google Translate ↗ Alt translation

Most teams stuff AI coding rules into one ever-growing prompt file that nobody reads. Separating permanent constraints, task procedures, and design rationale — and enforcing at least one rule through CI — turns AI development guidelines from aspirational text into actual engineering constraints.

Summary

The open-source DeepSeek Harness repository contains a hidden `.agents/` directory that reveals a systematic approach to AI-assisted development. Instead of relying on a single massive prompt, it separates long-term rules (AGENTS.md), task procedures (Skills), and design rationale (Agent Notes) into distinct, loadable units. The root AGENTS.md enforces concrete, verifiable rules like "Model-visible content must be logged," while directory-specific AGENTS.md files prevent context bloat by scoping rules to the relevant code area.

The 684 Agent Notes are categorized by status — proposed, implemented, rejected, archived — and each one must document alternatives considered, not just the final decision. This prevents AI (and new team members) from re-proposing solutions that were already evaluated and discarded. A detailed case study of the ACP snapshot testing Note shows how the system records not just what was built, but the explicit boundaries of what the solution does and doesn't cover.

For smaller projects, copying the full system would be overkill. The core insight worth adopting is the separation of concerns: rules that are always true, procedures for specific tasks, and short decision records that capture rejected paths. Even a minimal setup with one enforceable AGENTS.md, two Skills, and a decision template connected to CI is more effective than endlessly refining a single prompt.

Takeaways
DeepSeek Harness uses 684 Agent Notes across four status categories (proposed, implemented, rejected, archived) to record design decisions and explicitly document alternatives that were considered but not chosen.
The root AGENTS.md enforces concrete, verifiable rules like "Model-visible content must be reconstructable from Session Logs" rather than vague advice about code quality.
Directory-specific AGENTS.md files scope rules to relevant code areas, preventing context bloat when AI reads project constraints.
Skills are narrow, on-demand procedures (pre-push checks, code review, documentation maintenance) that tell the Coding Agent when to load them via a description field.
ACP snapshot testing records a real model run once, then replays the model stream deterministically in CI without needing API keys, catching wiring and assembly errors that unit tests miss.
The document translation Skill is restricted to explicit user invocation only, preventing AI from triggering expensive batch operations on its own.
A verification script checks that Claude Code and Codex have consistent invocation permissions for the same Skills.
Agent Notes must stay current with the implemented code — paths, names, and defaults that change require Note updates, and stale records get archived and frozen.
Conclusions

Separating AI development rules into permanent constraints, procedural Skills, and decision records solves a problem most teams don't even recognize: that a single massive prompt file becomes ignored background noise.

The mandatory "Alternatives considered" section in every Agent Note is more valuable than the final decision itself, because it prevents both humans and AI from re-litigating already-resolved trade-offs.

Snapshot replay testing that replaces only the unstable model layer while keeping the real Loader, Agent Loop, and persistence is a pragmatic middle ground between brittle mocks and expensive live API tests.

Restricting certain Skills to explicit user invocation acknowledges that AI agents lack the judgment to decide when a high-cost or high-impact operation is appropriate — a constraint most AI-coding setups ignore.

The system's value isn't in making AI write perfect code, but in making it hard for AI to bypass architecture, skip design records, or declare completion after minimal testing.

Starting with one enforceable AGENTS.md rule connected to CI is more effective than writing hundreds of Notes, because unenforced specifications decay into ignored files regardless of their quality.

Concepts & terms
Agent Note
A structured decision record (Problem, Decision, Alternatives considered, Consequences) that documents why a specific implementation choice was made and what was rejected. Categorized by status: proposed, implemented, rejected, or archived.
AGENTS.md
A repository-level or directory-level file containing permanent, always-valid rules for AI coding agents. Unlike prompts, it enforces concrete, verifiable constraints rather than stylistic advice.
Skill
An on-demand procedural document that tells a Coding Agent how to perform a specific narrow task (e.g., pre-push checks) and includes metadata specifying when the agent should load it.
ACP Snapshot Testing
A testing approach that records a real model interaction once into a Session log, then replays the model stream deterministically in CI using llm-replay, replacing only the unstable LLM layer while keeping the real Loader, Agent Loop, and tools.
llm-replay
A replay adapter that reads assistant/chunk events from a recorded Session log, groups them by turn and step, and replays them as a deterministic script during testing, detecting mismatches between expected and actual model calls.
Session Log
A persistent record of all model-visible content, including assistant/chunk events, tool calls, tool results, and turn boundaries, enabling full reconstruction of what the model saw during any interaction.
Source: juejin.cn ↗ Google Translate ↗ Backup ↗