Guidelines for Agents to Follow

The Core 4-Layer Constraint System (Must be used together)

The following 4 layers are currently the highest success rate combination.

🛡️ Layer 1: System Prompt = Constitution (Non-negotiable)

Practice

You must have a System Prompt that never changes and is injected into every conversation.

Example (You can use this directly)

SYSTEM LAW (NON-NEGOTIABL

You are an AI coding agent working inside a constrained repository.

You MUST obey all rules defined in: 1. Code Zones 2. Contracts 3. Agent Operation Docs

You are ONLY allowed to modify files explicitly permitted. You MUST NOT modify core runtime, routing, or contracts unless explicitly instructed.

If a task requires changes outside allowed zones: STOP. Explain why. DO NOT guess or workaround.

Violation of these rules is considered task failure. ```

📌 The keyword for this layer is: Non-negotiable

🛡️ Layer 2: Pre-task "Intent Declaration + Self-check"

This is a very critical step that many people skip.

Mandatory Process (You must require the Agent to do this first)

Before writing any code, you MU

1. Summarize the task in one sentence. 2. List which code zone(s) you will touch. 3. List which files you will modify. 4. Confirm that all changes are within allowed zones.

Only after this checklist is completed and approved, you may proceed. ```

If the Agent gets this step wrong,

interrupt immediately and don't let it write code.

👉 This step can catch 70% of potential accidents.

🛡️ Layer 3: File Visibility = Strongest Constraint (If you can do it)

This is a physical level constraint, highest priority.

Principle

Files the Agent cannot see can never be mistakenly modified.

Practice

  • Only expose:
src/zones/content-render/**
  • to the Agent
  • Core directories:
core-runtime/
routing/
contracts/
  • Provide absolutely no context

📌 This is a constraint 10 times stronger than a Prompt.

🛡️ Layer 4: Violation means Failure (Hard Stop)

You must explicitly write failure conditions in the Prompt.

Example

Failure Conditio
  • Modifying files outside allowed zones - Introducing new abstractions not defined in contracts - Refactoring unrelated code - Changing behavior without explicit instruction

If any failure condition is met: STOP and report failure. ```

This will significantly reduce:

  • "I optimized it for you by the way"
  • "I think this is better"

III. What should every interaction with the Agent look like? (Standard Template)

I'll give you a complete replicable interaction template.

🧩 1️⃣ System Prompt (Fixed, Unchanging)

Put your "Constitution + Blocks + Restricted Areas" here.

🧩 2️⃣ Context Injection (Automatic)

  • Current zone README
  • Current contract
  • Current agent operation docs

👉 Only inject documentation for "relevant blocks"

🧩 3️⃣ Task Prompt (What you write each time)

Task:
Add support for rendering Notion "callout" bloc

Constraints: - Only modify files under: src/zones/content-render/ - Follow contract: contracts/content-render.ts - Do not modify routing or data fetching.

Required Process: 1. Pre-flight checklist 2. Then code 3. Then summarize changes ```

🧩 4️⃣ Post-flight Summary (Mandatory)

After completing the task, provide:
1. Files changed
2. Lines changed
3. Why this change is safe
4. What was NOT changed

👉 Your review cost will be extremely low.

🧠 Vibe Coding Maintainability · Full Practice Table (2025)

Core Goal:
Let the Agent "write fast", but "never break the system".

I. Code Structure Layer (Architecture / Repo Design)

II. Contract Layer (Contract / Boundary Design)

III. Agent Operation Constraint Layer (Agent Control)

IV. Documentation Layer (Docs for Agent, not Human)

V. Change Management Layer (Change Management)

VI. Test and Validation Layer (Validation)

VII. Prompt Engineering Layer (Meta Control)

VIII. Organization and Mindset Layer (Most overlooked, but most important)

IX. Condensed into 5 "Non-violable Principles" (You can stick on wall)

1. Agent can only write code in authorized blocks

1. All important behaviors must have a Contract

1. Any "casual optimization" is a potential accident

1. Documentation is written for Agent, not for humans

1. Architecture determines the ceiling, model is just the executor