Skip to main content

Agent Prompting Best Practices

Benchmarked against: Anthropic — Prompting best practices Scope: How to configure and prompt SuperPortia agents effectively Key files: CLAUDE.md, .claude/rules/, .claude/skills/

SuperPortia agents are not chatbots — they are autonomous team members with specific roles, rules, and tools. Effective prompting means configuring the right context layers, not writing perfect single prompts.


Progressive Disclosure (PD)

Agent prompting in SuperPortia uses a 3-layer loading strategy:

LayerFileLoadingPurpose
L1CLAUDE.mdAlways loadedIdentity, boot sequence, minimal config
L2.claude/rules/*.mdAlways loadedBehavioral rules (constitution, cost awareness, tech freshness)
L3.claude/skills/*/On demandTask-specific SOPs, loaded only when needed

Why Progressive Disclosure?

Agent context windows have finite capacity. Loading everything at once wastes tokens and dilutes attention:

ApproachTokens at bootProblem
Monolithic prompt~15,000+Information overload, agents ignore details
PD 3-layer~3,000 (L1+L2)Only what's needed is loaded

L3 skills are loaded only when a specific task matches — a 66s review skill isn't loaded unless the agent is doing a review.


CLAUDE.md — the identity layer

CLAUDE.md is the most important file. It defines:

  1. Identity — who the agent is, who the Captain is
  2. Watch Rule — mandatory timestamp on every reply
  3. Boot Sequence — what to do when a new session starts
  4. Pre-Flight Check — 3D risk scoring before non-trivial tasks
  5. Information Retrieval flow — search UB → delegate search → ingest results
  6. Terminology pointer — link to glossary for unfamiliar terms

Design principles for CLAUDE.md

PrincipleDetail
MinimalOnly essentials. Everything else goes to L2 or L3
BehavioralDefines how the agent acts, not what it knows
Pointers, not contentLinks to full specs in UB or rules files
No hardcoded datesUse "current version", not "v1.2 released 2026-03-01"

Rules — the behavioral layer

Rules in .claude/rules/ define mandatory behaviors that apply to every session:

Rule fileWhat it enforces
company-constitution.md14 supreme articles — knowledge to UB, WO channel, HITL boundaries
agent-intelligence-protocol.md8 protocols — session start, pre-decision, correction capture
cost-awareness.mdOpus token discipline — delegate what can be delegated
tech-freshness.mdPerishable knowledge defense — verify before using
ub-governance.mdIngestion rules — English, tags, quality checklist
gsta-alignment.mdStrategic alignment — every report connects to GSTA
compaction-recovery-protocol.mdMemory cliff defense — what to do after context compaction
glossary.mdTerm navigation — unfamiliar term → definition + link

Writing effective rules

DoDon't
Define triggers — "When X happens, do Y"Write vague aspirations — "Try to be helpful"
Include consequences — "Violation = work incident"Write suggestions — "Consider checking UB"
Provide links to full specsDuplicate content from other rules
Keep under 60 lines per rule fileWrite encyclopedic rule files

Skills — the task layer

Skills in .claude/skills/ are loaded on demand when a specific task matches:

SkillTriggerWhat it provides
66s-reviewMajor decisions, specs, plansSix Hats + Six Shoes systematic review framework
hitl-decision-formatPresenting choices to CaptainStructured Q / Options / Recommendation template
createNew project scaffoldingProject structure templates
orchestratorMulti-agent coordinationCommunication scripts

Writing effective skills

# Skill: [name]
## Trigger: When to load this skill
## Steps: Numbered procedure
## Output: Expected deliverable format
## Quality criteria: How to know if it's done well

Prompt engineering patterns

1. Research-Before-Plan

Never let agents plan with stale training knowledge:

Agent receives task
↓ Classify knowledge needed: Timeless or Perishable?
↓ Perishable → search UB → stale? → delegate search → ingest → THEN plan
↓ Timeless → use directly

See Research-Before-Plan for full protocol.

2. Pre-Decision UB check

Before any important decision, search for precedents:

search_brain("decision <keyword>")
# Found → report precedent before deciding
# Not found → proceed, note "no UB precedent"

This prevents re-debating resolved decisions.

3. Correction capture (dual-write)

When Captain corrects an agent:

# 1. Personal memory (Memory MCP)
# CORRECTION: [what was wrong] → [what's correct]

# 2. Team memory (UB)
ingest_fragment(
path="CORRECTION: [description]",
input_type="text",
tags="correction,[project]"
)

Both writes are mandatory — personal memory alone means other agents can't see it.

4. HITL decision format

When presenting choices to Captain:

Q: Which engine should we use for intel analysis?
A) Groq — Free, fast, but prone to hallucination on important tasks
B) Gemini — $0.014/search, authoritative with citations
C) DeepSeek — Very cheap, good reasoning, no web search
Recommendation: B (Gemini) — this is important research, quality matters
Captain reply: [recorded after decision]

5. Watch Rule

Every reply starts with current Taipei time:

⏰ 2026-03-05 17:33 (Taipei)

Not a formatting preference — agents without time awareness make decisions on stale knowledge. The watch is a safety mechanism.


Anti-patterns

Anti-patternWhy it's badInstead
"Do your best"No measurable criteriaDefine acceptance criteria in WO
Loading all context upfrontToken waste, attention dilutionUse PD layers
Hardcoding version numbersBecomes staleUse "current version" + verification
Trusting training knowledge10+ month lagSearch UB, then verify perishable knowledge
One giant CLAUDE.mdSlow to load, hard to maintainSplit into rules + skills
Agent asks Captain what to doWastes Captain timeAgent proposes, Captain decides

PageRelationship
Agent Intelligence ProtocolThe 8 mandatory behaviors
Pre-Flight Check3D risk assessment before tasks
Research-Before-PlanKnowledge verification protocol
EGS SpecThe engineering rulebook
Cost AwarenessToken discipline for Opus agents