agentleFS
MicrosoftKnown publishermicrosoft/TypeAgent/ts/examples/planValidationDemo/CLAUDE.md

TypeAgent / planValidationDemo

CLAUDE.md745 starsChanged 5 months agoMITView on GitHub

This project is governed by a plan-validation MCP server. Every file access and shell call you make must go through the validated_* tools. The built-in Read, Write, Edit, Bash, Glob, Grep tools are NOT available in this session — only the MCP tools provided by the plan-validation server. A live dashboard is running at http://localhost:3100 — every tool call you make is visible there, including blocks. Call get_plan_schema. Read it carefully — the AgentPlan DSL has strict shape requirements and…

The file

We split this CLAUDE.md into the rules it gives an agent

10 rules. About 0 are common, 3 are distinctive, and 7 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈3

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 7

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    Call get_plan_schema. Read it carefully — the AgentPlan DSL has strict shape requirements and the validator runs 13 passes.

    line 15
  2. Very specific:

    Use validated_read on brief.md and design-tokens.json.

    line 20
  3. Very specific:

    Call submit_plan with an AgentPlan JSON that lists every tool call you intend to make, in order.

    line 25
  4. Very specific:

    If submit_plan returns errors, fix them and resubmit.

    line 43
  5. Distinctive:

    Use only these tools, in the exact order your plan declares:

    line 47
  6. Very specific:

    After the last step, call check_postconditions.

    line 66
  7. Very specific:

    NEVER use built-in Read, Write, Edit, Bash, Glob, Grep — only validated_*.

    line 81
  8. Distinctive:

    NEVER try to fetch from the network — policy denies it and it would be blocked anyway.

    line 82
  9. Very specific:

    NEVER skip submit_plan. No plan → no execution.

    line 84
  10. Distinctive:

    Keep the plan tight — fewer steps means less that can drift.

    line 85

≈ “Common” is an estimate: at least 1 in 5 of the 12,729 CLAUDE.md files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
CLAUDE.md

Plan-Validated Agent Execution

This project is governed by a plan-validation MCP server. Every file access and shell call you make must go through the validated_* tools. The built-in Read, Write, Edit, Bash, Glob, Grep tools are NOT available in this session — only the MCP tools provided by the plan-validation server.

A live dashboard is running at http://localhost:3100 — every tool call you make is visible there, including blocks.

Required Workflow

1. Read the plan schema

Call get_plan_schema. Read it carefully — the AgentPlan DSL has strict shape requirements and the validator runs 13 passes.

2. Read the task inputs

Use validated_read on brief.md and design-tokens.json. These files describe what to build.

3. Submit a plan

Call submit_plan with an AgentPlan JSON that lists every tool call you intend to make, in order. The plan must include:

  • version: "1.1", unique id, and a goal describing the landing page
  • steps: ordered array of PlanStep nodes. Each step needs tool, inputSpec (input constraints — use { type: "exact", value: "..." } or { type: "regex", pattern: "..." }), dependsOn, and effect.
  • limits: resource limits — must fit under the org policy caps (maxTotalSteps ≤ 20, maxFileWrites ≤ 10, maxBytesWritten ≤ 524288)
  • permissions.allowedWritePaths: use a glob covering this directory, e.g. <absolute path of this dir>/** with forward slashes.
  • postconditions: predicates checked after the last step. At minimum include:
    • file_contains on index.html for Decisions, measured.
    • file_contains on index.html for Start a free trial
    • file_contains on style.css for --color-primary
    • file_contains on script.js for cta_click
  • metadata.allowedTools: list every distinct tool used by the steps.

If submit_plan returns errors, fix them and resubmit. The errors are specific.

4. Execute

Use only these tools, in the exact order your plan declares:

ToolPurpose
validated_readRead file contents
validated_writeCreate or overwrite a file
validated_editString replacement in a file
validated_globFind files by pattern
validated_grepSearch file contents
validated_npmRun npm/pnpm (structured, safe)
validated_gitRun git (structured, safe)
validated_nodeRun a node script (structured, safe)
validated_tscRun tsc (structured, safe)

validated_bash is blocked by policy (capabilities-only mode). Any attempt to use it will be visible on the dashboard as a block event.

5. Verify

After the last step, call check_postconditions. Every declared predicate must pass. Then call plan_trace to see the hash-chained audit log.

Failure handling

  • Plan violation (wrong tool, wrong inputs): the plan aborts. Call plan_reset and build a corrected plan.
  • Policy violation (blocked bash command, denied path): the call is blocked but the plan continues. Adjust the next step.
  • Permission denied (path outside your declared allowedWritePaths): the call is blocked. Either widen the plan's permissions (requires plan_reset) or use a path inside the declared set.

Rules

  • NEVER use built-in Read, Write, Edit, Bash, Glob, Grep — only validated_*.
  • NEVER try to fetch from the network — policy denies it and it would be blocked anyway.
  • NEVER skip submit_plan. No plan → no execution.
  • Keep the plan tight — fewer steps means less that can drift.

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.