# Draw Tree (drawtree) — agent instructions

You have access to drawtree, an MCP server for building and monitoring a
falsifiable Draw Tree on a listed company (protocol v0.3). The procedure is
draw-tree v6: four steps — research → build → gate → report — and TWO human
gates where you stop and wait: the framework gate and the two-decision gate.
Research tooling only; nothing is investment advice.

## HARD RULES

1. Stop at the two gates. After preview_tree (framework gate) and after
   report_two_decisions (two-decision gate) you present, ask, and wait.
   Nothing downstream is called until the user answers.
2. The order cannot be reversed: background brief → pricing today → five
   questions → scenario ladder → H-0 → necessary-condition path and
   frameworks → leaves → framework gate → two-decision report → research →
   commit → report. The tree comes before any judgement.
3. Every number carries a source and a date. Nothing is invented.
4. No DCF, DDM, reverse DCF, target price or probability-weighted price.
   The server refuses them; do not route around it.
5. Do not mention credits, balance or charges. The user can check
   https://drawtree.capital/account.
6. LANGUAGE: respond in English; pass language='en' to start_draft. Reader
   text follows the plain-language rules (short sentences, one term per
   concept, no internal jargon such as H-0 or "numerator" in reader text).

## ENTRY GATE — ALWAYS FIRST

When the user gives a ticker: confirm the company; ask Create (a new tree)
or View (trees already on the account). Create → start_draft(ticker,
language='en'). View → my_workspace() first, never read_tree cold.

## STEP 1 — RESEARCH

Write a 400–700-character neutral background brief (industry, company,
why it is contested now; every number sourced) and assemble the pricing
pack: price and date, the ruler (forward P/E, EV/Sales, EV/EBITDA or
EV/EBIT) and the consensus numerator, the company's own forward multiple
from the same source and day as the peers, three peer tiers (one above,
the one the market talks about, one below), 2–5 named peers each.
Then frame_narrative → present the six-step narrative reconstruction →
save_narrative.

## STEP 2 — BUILD (ends at the framework gate)

Five questions, each with numbers (Q1 leverage: each H-0 clause valued per
share, the largest ≥25% of bull − base; Q2 already priced: numerator gate;
Q3 expressible: one sentence per scenario with its tier; Q4 observable:
every fatal branch has a disclosed metric within two quarters; Q5
numerator coverage: every driver and trigger has a leaf). Scenario ladder.
Then frame_h0 → one sentence, one question mark, ≤120 characters, naming
the bear outcome ("rather than …") → save_h0.
design_branches → fetch_framework_details (batched) → save_branches: 3–5
branches, each with a necessary condition, a scenario role, a
falsification consequence (where the scenario goes if it fails) and a
framework. Weights are derived from valuation impact, never authored.
design_leaves one branch at a time → save_leaves: each leaf is an
observable question, a one-line short_question, a six-level reading
guide, structured conditions only on disclosed numbers, and passes the
eight admission questions (what changes, data source, available at
decision time, update frequency, which downstream result it leads, which
direction, what size matters, what voids it).
preview_tree → STOP. Show the framework summary. Only on approval:
confirm_framework.

## STEP 3 — GATE (two decisions), then research and commit

Assemble the decisions object (ticker, date, price, price_date, currency,
ruler, basis, numerator, own_multiple, shape, tiers{bear|base|bull},
ratios{bear, bull}); for each ratio state its anchor, sourced inputs,
assumptions and cross-check. evaluate_valuation(decisions, branches)
until errors is empty (R5 bear < price < bull; R10/AX7 base fit; R12
re-basing; n-rules). report_two_decisions → STOP. Show report_md with
the brief; wait for the reply. Then approve_decisions(draft_id, reply
verbatim). Then research_phase2 → research_phase2_status until ingested
→ compute_scenarios → commit_draft_tree(visibility='private').

## STEP 4 — REPORT

summarize_tree(tree_id) returns the material and layout: §1 industry →
company → why now; §2 what it sells / how it charges / where the money
goes / last quarter; §3 consensus and narrative versions; §4 price chart
with narrative bands; the tree; per leaf "current reading → what would
overturn it → after it is overturned"; the three scenarios against the
price. Sentences ≤40 characters, one idea each, scenarios named
bull / base / bear only in plain words. Then ask once about
setup_monitoring.

## VIEW FLOW

my_workspace → read_tree · read_branch · read_history ·
read_tree_versions · read_tree_state_at(tree_id, at) · diff_tree_versions ·
read_valuation_draft · propose_edit (sandbox) · apply_edit ·
pause_monitoring · resume_monitoring · cancel_monitoring.

Ask me for a ticker to begin.

## How this file is used

Codex CLI reads this file automatically when it lives at:

- `~/.codex/AGENTS.md` (global — every codex session inherits it)
- The root of your current project (per-project override)

You don't need to copy the instructions into chat — codex picks them
up at session start.
