pub const INITIAL_READ_PROMPT: &str = "# Initial-read prompt for the agent\n\nYou\'re stepping into a codebase. This prompt gives you a structure for the\nfirst read so the thinking you do here doesn\'t have to be redone next\nsession. The goal is **durable capture** \u{2014} every claim, model, failed\nattempt, and open question goes into ASD via `asd think` so the next\nagent (or you, tomorrow) inherits it without re-deriving.\n\nASD does not call an LLM. You do the reading and reasoning; ASD provides\nstructure for what to capture and the write commands.\n\n---\n\n## Before you start\n\n1. **Index the project** if it hasn\'t been already:\n ```sh\n asd index .\n ```\n2. **Seed structural tags** with the cheap pass:\n ```sh\n asd map\n ```\n This walks every symbol and writes `Ownership` entries with\n `package-boundary` / `fast-test` / `diagnostic-test` role tags. It\'s\n the substrate everything below builds on.\n3. **Set your task scope** so writes get auto-tagged:\n ```sh\n export CTX_ACTIVE_TASK=\'{\"task_id\":\"initial-read-2026-06-02\",\"scope\":[\".\"]}\'\n ```\n\n---\n\n## Section 1 \u{2014} Architecture\n\nWhat are the major subsystems? How do they connect?\n\nDon\'t enumerate every file. Pick the 3\u{2013}7 nodes that, if you understood\nthem well, would let you place any file in the project. Record each as\na **MentalModel**:\n\n```sh\nasd think model \"<short-name>\" \\\n --symbols pkg.subsys.entry1,pkg.subsys.entry2,pkg.subsys.entry3 \\\n --summary \"<one sentence on what this subsystem does + how data flows>\"\n```\n\n**Bias toward fewer, better models.** One model per major subsystem.\n\n---\n\n## Section 2 \u{2014} Hot spots\n\nWhat files are likely touched often? Look for:\n- Files at junction points (mentioned by many callers).\n- Files with recent dense git churn (`asd since <sha-N>` if you know a\n baseline; otherwise `asd status` for index health).\n- \"God objects\" \u{2014} large symbols with many effects.\n\nRecord each as a **Concept** (already a queryable kind) with a hint:\n\n```sh\nasd ledger append <qname> --kind concept \\\n --summary \"hot spot: changes here ripple through <list>\"\n```\n\n---\n\n## Section 3 \u{2014} Implicit constraints (invariants not written down)\n\nWhat does the code assume that isn\'t documented? Examples:\n- \"this function must be called before X\" \u{2014} sequencing\n- \"this map is never reentrant\" \u{2014} concurrency\n- \"input is always ASCII\" \u{2014} encoding\n- \"this struct may grow but never shrink\" \u{2014} schema migration\n\nFor each: record as **Invariant** (decision-class) **AND** an\n**OpenQuestion** if you\'re not sure:\n\n```sh\nasd ledger append <qname> --kind invariant \\\n --summary \"must be called before <other> \u{2014} depends on \u{2026}\"\n\nasd think question <qname> --q \"is this invariant load-bearing? \\\n what breaks if violated?\"\n```\n\n---\n\n## Section 4 \u{2014} Open questions\n\nMagic numbers, unexplained patterns, dead-looking code that might not be.\n\n```sh\nasd think question <qname> --q \"what does magic value <X> mean?\"\nasd think question <qname> --q \"is this dead code? no callers found\"\n```\n\n**Be generous here.** Every question recorded is a question the next\nsession doesn\'t have to re-ask.\n\n---\n\n## Section 5 \u{2014} Hypotheses with confidence\n\nThings you suspect but haven\'t verified. Confidence is `0.0\u{2013}1.0`:\n\n- `0.9` \u{2014} you\'re very confident; one test away from a Decision\n- `0.6` \u{2014} informed hunch; evidence points this way\n- `0.3` \u{2014} speculation; could go either way\n- `0.1` \u{2014} wild guess worth recording\n\n```sh\nasd think speculate <qname> --conf 0.7 \\\n --summary \"I think <X> causes <Y> because <observation>\"\n```\n\n**Anything below `0.3`** is excluded from auto-surface by default \u{2014}\nuseful for noting \"I considered X\" without polluting future\nprepare-change output.\n\n---\n\n## Section 6 \u{2014} Failed-path warnings\n\nPatterns that look reasonable but don\'t work. **Negative evidence is\nexpensive to produce and easy to lose** \u{2014} record it.\n\n```sh\nasd think failed <qname> --tried \"<approach>\" \\\n --because \"<why it didn\'t work>\"\n```\n\nExamples worth recording:\n- \"Tried wrapping in async; broke because the caller expects sync.\"\n- \"Tried caching the result; broke under concurrent invalidation.\"\n- \"Tried the obvious refactor; broke a test you wouldn\'t expect.\"\n\n---\n\n## Section 7 \u{2014} Commit your thinking\n\nWhen done, export so it commits with the repo:\n\n```sh\nasd conclusions export\ngit add .asd/conclusions/\ngit commit -m \"initial read: capture project mental model + open questions\"\n```\n\nThe thinking now travels with the repo. Next session that runs\n`asd conclusions import` (or `git pull` with the post-merge hook\ninstalled) gets your model + questions + warnings without re-deriving.\n\n---\n\n## Verifying the capture worked\n\n```sh\n# Show what you captured (filter by class or kind).\nasd think list\n\n# Confirm prepare-change now surfaces your work:\nasd prepare-change \"<a query relevant to one of your hypotheses>\"\n# The response should include a `prior_thinking` section with your\n# hypothesis/model/question.\n```\n\n---\n\n## Worked example \u{2014} examples/sample-py-repo\n\nRun against the small fixture project that ships with ASD:\n\n```sh\ncd examples/sample-py-repo\nasd index .\nasd map\n\n# Mental model \u{2014} payments module\nasd think model \"payments-pipeline\" \\\n --symbols payments.charge_card,payments.refund,payments.audit \\\n --summary \"charge_card writes to audit + posts to gateway; refund reverses but does NOT touch audit\"\n\n# Open question \u{2014} non-obvious behavior\nasd think question payments.audit \\\n --q \"why does refund skip audit? is this intentional or a bug?\"\n\n# Hypothesis \u{2014} performance suspect\nasd think speculate payments.audit --conf 0.6 \\\n --summary \"audit writes are synchronous; this is likely the bottleneck under load\"\n\n# Failed attempt \u{2014} record what didn\'t work\nasd think failed payments.refund \\\n --tried \"make refund call audit symmetrically\" \\\n --because \"broke test_refund_does_not_double_count \u{2014} auditing is suppressed by design\"\n```\n\nRun `asd prepare-change \"refund flow\"` \u{2014} your model + question + failed\nattempt now show up in `prior_thinking`.\n\n---\n\n## Re-running\n\nThe prompt is meant to be re-runnable. `asd think bootstrap --check`\n(Plan G t-005) reports gaps: \"no hypothesis on payments.refund yet\",\n\"mental model \'payments-pipeline\' exists, others missing\", etc. Use it\nas a checklist on subsequent sessions; the entries you already wrote\nstay.\n";Expand description
Initial-read prompt template, embedded at compile time so
asd think prompt works from any CWD (AcmeProj or any other
project that asd indexes — not just the AgentStateDeveloper
source checkout). The embedded copy lives inside the crate so the
published package builds; docs/initial-read-prompt.md is the copy
people read, and initial_read_prompt_matches_docs keeps them equal.