agentleFS
chrbaileychrbailey/promptspeak-mcp-server/CLAUDE.md

promptspeak-mcp-server

CLAUDE.md1 starsChanged 8 months agoMITView on GitHub

Pre-execution governance layer for AI agents. Intercepts MCP tool calls, validates against deterministic rules, blocks or holds risky operations for human approval. Validation latency: 0.164ms avg (P95: 0.368ms). v0.4.1 — 886 tests, 56 MCP tools, MIT licensed, published as @chrbailey/promptspeak-mcp-server. Execution model: STEP 6 of the pipeline runs a pluggable ToolExecutor when registered (gatekeeper.setExecutor), otherwise it simulates (safe default — unchanged behavior). For async tools, gatekeeper.executeAsync() awaits an AsyncToolExecutor (setAsyncExecutor) through the same pipeline; ps_execute uses it. Pre-checks (STEP 1–5)…

The file

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

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

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈4

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 3

    Very specific

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

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Prefer simplicity over cleverness: Before building new infrastructure or multi-layer abstractions, ask whether updating existing files …

    line 16
  2. Distinctive:

    Always produce complete output: Never return "No response requested" or truncated results.

    line 17
  3. Distinctive:

    Confirm the target before each phase: When generating dossiers or research reports, always confirm the target company/entity name before …

    line 22
  4. Distinctive:

    Verify tool access before starting: Before web research tasks, verify that WebSearch and WebFetch tool permissions are granted.

    line 23
  5. Very specific:

    Write actions (write_file, edit_file, create_file, patch_file) are scanned for vulnerabilities.

    line 37
  6. Very specific:

    Semantic: No conflicting modes (⊕⊖), no forbidden+execute (⊗▶)

    line 67
  7. Very specific:

    Don't add tools without tests: Every tool in src/tools/ needs coverage.

    line 77

≈ “Common” is an estimate: at least 1 in 5 of the 26,980 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

PromptSpeak - Claude Instructions

Overview

Pre-execution governance layer for AI agents. Intercepts MCP tool calls, validates against deterministic rules, blocks or holds risky operations for human approval. Validation latency: 0.164ms avg (P95: 0.368ms).

v0.4.1 — 886 tests, 56 MCP tools, MIT licensed, published as @chrbailey/promptspeak-mcp-server.

Execution model: STEP 6 of the pipeline runs a pluggable ToolExecutor when registered (gatekeeper.setExecutor), otherwise it simulates (safe default — unchanged behavior). For async tools, gatekeeper.executeAsync() awaits an AsyncToolExecutor (setAsyncExecutor) through the same pipeline; ps_execute uses it. Pre-checks (STEP 1–5) and post-audit (STEP 7–9) are shared via prepareExecution/finalizeExecution so the sync and async paths stay identical. Drift embeddings are content-aware via the EmbeddingProvider seam (deterministic-local by default; inject a real model with setEmbeddingProvider). The handshake supports HMAC-SHA256 challenge–response (PROMPTSPEAK_HANDSHAKE_SECRET).

HTTPS live at https://promptspeak.admin-as-a-service.com/mcp (Cloudflare Tunnel → Mac Mini). Safety annotations on all 56 tools. Streamable HTTP transport. Connectors submission: all requirements met, form submitted 2026-03-21.

General Principles

  • Prefer simplicity over cleverness. Before building new infrastructure or multi-layer abstractions, ask whether updating existing files (CLAUDE.md, MEMORY.md) or a simpler approach would suffice. The codebase was cut from 82K to 16K lines by following this principle.
  • Always produce complete output. Never return "No response requested" or truncated results. If output will be long, break it into clearly labeled parts and continue without being asked.

Pipeline Execution Rules

  • Validate phase output before proceeding. Each phase must produce non-empty output before passing to the next phase. If upstream data is None/empty, halt and report the failure clearly rather than silently continuing with training knowledge.
  • Confirm the target before each phase. When generating dossiers or research reports, always confirm the target company/entity name before each phase and never mix up targets mid-pipeline.
  • Verify tool access before starting. Before web research tasks, verify that WebSearch and WebFetch tool permissions are granted. If denied, immediately inform the user rather than repeatedly attempting and failing silently.

Architecture

Request → Circuit Breaker → Validation → Drift Check → Hold Check → Security Scan → Execute
              ↓                ↓             ↓             ↓              ↓
         (blocked?)      (valid frame?)  (drifting?)   (needs human?)  (vuln found?)

Circuit breaker is FIRST — halted agents are blocked before any validation runs.

Security Enforcement (Check 6)

Write actions (write_file, edit_file, create_file, patch_file) are scanned for vulnerabilities.

SeverityEnforcementAction
CRITICALBlockSQL injection, hardcoded secrets
HIGHHoldSecurity TODOs, logging secrets, insecure defaults
MEDIUMWarnEmpty catch blocks, hedging comments, disabled tests
LOW/INFOLogDestructive DB/filesystem operations

Tools: ps_security_scan, ps_security_gate, ps_security_config

Symbol Frame Syntax

Frames are 2-12 symbols. Mode MUST be first.

Structure: [Mode][Domain][Constraint?][Action][Entity?]

Example: ⊕◊▶β = "strict financial execute secondary-agent"

CategorySymbols
Modes⊕ strict, ⊘ neutral, ⊖ flexible, ⊗ forbidden
Domains◊ financial, ◈ technical, ◇ legal, ◆ medical, ◐ operational
Actions▶ execute, ◀ retrieve, ▲ analyze, ▼ transform, ● validate, ○ create
Constraints⛔ forbidden (inherits), ✗ rejected, ⚠ warning, ✓ approved
Entitiesα primary, β secondary, γ tertiary, ω terminal

Validation Rules

  1. Structural: Mode first, length 2-12, no duplicate singletons
  2. Semantic: No conflicting modes (⊕⊖), no forbidden+execute (⊗▶)
  3. Chain: Child cannot weaken parent mode, ⛔ must propagate

Don't (Learned the Hard Way)

  • Don't reorder the pipeline. Circuit breaker → validation → drift → hold → security scan. Changing this breaks safety guarantees.
  • Don't add new modules. v0.2.0 removed 6 modules (swarm, recon, multi-agent, translation, legal, boot-camp). Ask before adding anything back.
  • Don't weaken validation to make tests pass. Fix the test or the code — never loosen a rule.
  • Don't create ⊗▶ frames. Forbidden + execute is an invalid semantic combination.
  • Don't skip chain inheritance checks. ⛔ must propagate to all descendants.
  • Don't add tools without tests. Every tool in src/tools/ needs coverage.
  • Don't touch src/gatekeeper/ casually. 6-stage pipeline is load-bearing — needs integration tests.
  • Don't add abstractions "for later." Codebase was cut from 82K to 16K lines for a reason.

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.