Skip to content

Commit c494ece

Browse files
committed
docs(formatting): split Claude guidance into task (XML) vs agent/system (markdown)
Lab product system prompts (Claude-for-Excel, Cursor-on-Claude) use markdown + MUST/NEVER imperatives, not XML, for long-lived behavioral policy. Adds an agent/system-prompt format profile alongside the existing task-prompt XML rule.
1 parent 209ed58 commit c494ece

1 file changed

Lines changed: 15 additions & 1 deletion

File tree

packages/skills/conduct/formatting.md

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,8 @@ Audience: any agent shaping prompts or responses for an LLM. How to format so th
66

77
| Target | Format | Why |
88
|--------|--------|-----|
9-
| Claude (any tier) | XML tags | Claude was trained on XML-heavy structured inputs |
9+
| Claude — task prompt | XML tags | Claude was trained on XML-heavy structured inputs; gradable I/O |
10+
| Claude — agent/system prompt | Markdown + MUST/NEVER policy blocks | Long-lived behavioral policy, not parseable I/O; matches lab system-prompt practice |
1011
| GPT-4 / GPT-5 | Markdown + sandwich method | GPT attends best to instructions at both ends |
1112
| o-series (o1, o3) | Stripped minimal | Long CoT prompts degrade; keep instructions tight |
1213
| Gemini | Always few-shot | Recall without examples is significantly weaker |
@@ -51,6 +52,19 @@ Example 2: …
5152

5253
These tags align with common quality assertions (has_role, has_task, has_format, has_constraints, has_edge_cases). Using them is not decoration; it's how downstream graders pass.
5354

55+
## Claude agent / system prompts (markdown mode)
56+
57+
The XML guidance above is for **task prompts** — gradable I/O with few-shot blocks and `<context>` retrieval. **Long-lived agent and system prompts are different**: they're behavioral policy, not parseable I/O, and the labs' own Claude system prompts (Claude-for-Excel, Claude-in-Cursor) use **markdown + categorical imperatives**, not XML.
58+
59+
Contract for a Claude agent/system prompt:
60+
61+
1. **Markdown sections**, not XML tags — `## Role`, `## Tools`, `## Rules`, `## Workflow`.
62+
2. **MUST / NEVER policy blocks** for hard rules — `"You MUST read a file before editing it"`, `"NEVER create files unless necessary"`. Categorical, non-negotiable framing; not prose suggestions.
63+
3. **Declare impossibilities upfront**, not as runtime failures — `"Cannot send emails, access the local filesystem, or run macros."`
64+
4. **Natural-language tool narration** — tell the user what a tool *does*, don't name it.
65+
66+
Use XML *inside* a markdown agent prompt only for embedded few-shot examples or a structured output schema — the surrounding policy stays markdown.
67+
5468
## Prefill
5569

5670
Start the assistant turn with a leading token to skip preamble.

0 commit comments

Comments
 (0)