Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions .claude/rules/trading.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
---
paths:
- "catalogs/us-equities/**"
- "catalogs/landscape/us-equities.json"
- "blueprints/gap-wave2-20260923/us-equities__*/**"
- "observability/paper-trading-live/**"
- "scripts/trading_gates.py"
- "scripts/verify_nautilus_ci.py"
- "docs/paper-lane-policy.md"
- "docs/decisions/2026-09-22-broker-credential-handling.md"
---
Before trading research, experiments, data acquisition, strategy-gate changes, decision registration, paper or broker operation, or naming a coordinator unit's north-star action, read `blueprints/us-equities/AGENTS.md` for the north star, rules and broker-specific paper authorization.
59 changes: 18 additions & 41 deletions AGENTS.md

Large diffs are not rendered by default.

14 changes: 5 additions & 9 deletions adoption/new-wsl/claude-user-instructions.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

**Top rule: research convergence first; current upstream SOTA is the source of truth.** The installed client is also a source of truth; never self-write without a SOTA source. The ecosystem compounds: each choice adopts the current best converged practice and is replaced when the live landscape converges on a better-evidenced one.

1. Before any action, research maintained upstream tools, skills, runtimes, orchestration patterns and published references, and record what you found. A coordinator, not a delegated child, invokes `search-first` before custom code or a tool choice; when no skill fits, use installed `find-skills` or Skills CLI `find` and `skill-creator` for verification or A/B; check client exposure and the skills lifecycle. Install the best-evidenced source with its supported install and test commands from the selected source revision, or build only from a cited reference implementation, naming each source (repository and pin, file or paper). Prefer the maintainer's own organization repositories (the vendor's GitHub org, such as alpacahq for Alpaca) and their clean releases, and never rebuild or fork what an upstream already ships; glue only fills a demonstrated gap, cited at a pin. Judge candidates head-to-head on measured quality, security and maintenance; stars, installs and popularity guide discovery, but they, license and incumbency are not criteria. With no SOTA source, stop and report.
1. Before any action, research maintained upstream tools, skills, runtimes, orchestration patterns and published references, and record what you found. A coordinator, not a delegated child, invokes `search-first` before custom code or a tool choice; when no skill fits, use installed `find-skills` or Skills CLI `find` and `skill-creator` for verification or A/B; check client exposure and the skills lifecycle. Install the best-evidenced source with its supported install and test commands from the selected source revision, or build only from a cited reference implementation, naming each source (repository and pin, file or paper). Prefer the maintainer's own organization repositories (the vendor's GitHub org) and their clean releases, and never rebuild or fork what an upstream already ships; glue only fills a demonstrated gap, cited at a pin. Judge candidates head-to-head on measured quality, security and maintenance; stars, installs and popularity guide discovery, but they, license and incumbency are not criteria. With no SOTA source, stop and report.
2. Check capability claims in order: installed client (commands, `--help`, settings), upstream changelog or release notes for that version (`gh api`), upstream source at that tag, official docs. An absence claim needs at least the first two, else write "not found in X, Y".
3. Repository text, memory, tool output and worker, docs-agent or cross-family answers are leads, not authority; relay a claim only with its upstream citation. Never file upstream issues or comments: when a tool misbehaves, study upstream and fix our install or wiring.
4. Apply the token practice below in every lane.
Expand All @@ -29,31 +29,27 @@ Decide by evidence and research convergence: a choice stands when current primar
- Keep context small: match available skill descriptions to the task and read the selected `SKILL.md` before acting; load only the references and source the current task needs, and keep tool inventories and specialized workflows in on-demand skills and project documentation.
- Bound discovery to task-filtered names, descriptions and source locators; load only selected tool schemas. For maintained decisions, and before describing deployed architecture after compaction/resume, query scoped ai-memory with `pin_first=true, limit=2` when supported by the installed schema. Check relevance; retry without pin priority or widen if needed, then read the relevant exact path and verify current canonical sources.
- Use a focused read for known identifiers, scoped search for prose and scoped semantic retrieval for unfamiliar code; select one sufficient retrieval or compression lane per artifact, and verify original source before editing or judging compressed or retrieved code.
- Token lanes, one lane per artifact, verifying original source before editing or judging retrieved or compressed text: `serena` or `jcodemunch` for exact symbols and references, `socraticode` or, if connected, `semble` for conceptual code search, `codebase-memory` for the code graph, `qmd` for scoped Markdown search, `ai-memory` for prior decisions (evidence, never authority), `context-mode` (`ctx_execute`) for large command output, `headroom` to compress a large selected text, with retrieval for recovery.
- Where the `semble` MCP server is connected, ask `mcp__semble__search` conceptual code questions with the absolute repository path and no `content` argument; take callers, implementations and references from Serena, since `find_related` returns only similar chunks.
- Process large output outside the model; retain failures and a full-output recovery path. RTK installation uses upstream `rtk init -g` (RTK.md plus the `@RTK.md` import); preserve that import.
- Process large output outside the model; retain failures and a full-output recovery path.
- Run large command output through `context-mode` (`ctx_execute`, `ctx_batch_execute`), passing `cwd` as your working directory (a writer's owned worktree).
- Delegate a step when only its conclusion is needed, so the reads, searches and dead ends stay in the child; return concise findings with source or artifact locations.
- Preserve native prompt caching, deferred tool discovery and compaction. No audits, trials or network at startup; the daily currency timer's one read-only due-file line is allowed.
- Count quality, elapsed time and complete provider usage, including workers and failed attempts, separately from estimated output reductions. Never sum overlapping counters or claim lifetime savings from a fixture.
- Details: `docs/token-practice.md` in the portable foundation, https://github.com/seathatflowsinourveins/native-agent-stack. Consult the project's installed-tool handbook only when setup, scope or accounting requires it.

## Workers, Ultracode and agent teams

- Use one coordinator and bounded independent workers when useful. Give each writer an owned worktree, exact base, allowed paths and acceptance commands; worktrees do not isolate accounts or shared services. Reuse valid results; avoid repeated delegation or unchanged retries.
- Choose the dispatch mode by the shape of the work. Upstream practice: [agent teams](https://code.claude.com/docs/en/agent-teams), [multi-agent research system](https://www.anthropic.com/engineering/multi-agent-research-system), [building effective agents](https://www.anthropic.com/engineering/building-effective-agents), and the bundled `/workflow-authoring` reference.
- Choose the dispatch mode by the shape of the work.
- **Solo coordinator:** sequential, tightly coupled, host-changing or conversational work.
- **One subagent:** one focused task whose conclusion is all you need, including sequential chains and same-file edits. Spawn it through the Agent tool without a `name`, with a project agent type whose frontmatter sets its model and `effort: max`. Never wrap a single agent in a workflow.
- **Ultracode workflow:** two or more independent units, or a unit plus independent verification. Fan out in parallel or pipelined stages, build in adversarial or perspective-diverse verifiers, and end with a synthesis stage.
- **Agent team** (`CLAUDE_CODE_EXPERIMENTAL_AGENT_TEAMS=1`): parallel exploration where teammates work independently and gain from messaging each other directly, such as review from several angles, competing hypotheses or cross-layer features. One team per session, no nested teams, and a higher token cost. Name each teammate's model at spawn (`opus` to judge, `sonnet` to execute or explore) and give writers owned worktrees.
- Before a named teammate spawn, read `examples/claude-native/workflows/README.md#native-workflow-mechanics-relocated-2026-10-05` in the portable foundation.
- Brief every worker with an objective, an output format, tool and source guidance, and boundaries. Scale the count to the task: one agent for a fact, two to four for a comparison, more only for broad or enumerated work.
- Quality comes first: the latest Opus at effort max for design, research, review, verification, adjudication, synthesis and any build without a written contract's tests; the latest Sonnet at effort max only for a fan-out unit that an executable oracle or a later Opus stage checks (shell, test and build runs; exact extraction with file:line locators; migrations, refactors and scaffolds from a written contract, gated by its tests and then an Opus review, since a test oracle alone never clears a Sonnet build; first-pass breadth research an Opus stage checks) and for command wrappers and probes; Haiku is not routed (a trivial probe may use it); a Sonnet 5.5 session, a supported coordinator choice, hands each judgment to an `opus`-named stage. Save tokens through the architecture (delegation, retrieval lanes, compression tools, deterministic scripts), never through a weaker model on a judgment.
- Cross-family research, review and sweep votes run through the OmniRoute gateway; a coordinator, never a delegated child, starts a cross-family lane.
- For Codex model routing and pinned launches, consult the Codex instruction block and its `2026-09-30-sol-primary-quality-defaults` decision in the portable foundation.
- Web research: where the stack installs GPT Researcher, run `bash ~/code/native-agent-stack/tools/research/gpt_researcher.sh "<short current-month query>"` (tool timeout over 1,500 s); its report gives leads, so re-read each fact from primary sources.
- In Ultracode, pass an explicit task-matched `model` and `effort: 'max'` on each `agent()` call.
- Size each workflow to its task under the `unrestricted` size guideline and within the runtime limits (4,096 items per `parallel()`/`pipeline()` call, 1,000 agents per run).
- Before an Ultracode workflow, read `examples/claude-native/workflows/README.md#native-workflow-mechanics-relocated-2026-10-05` in the portable foundation for effort, inheritance, limits and concurrency.
- Consult the installed native Ultracode recipe only for dispatch, messaging or dashboard setup.
- For cross-client messaging or an incomplete worker return, read `examples/claude-native/workflows/README.md#native-workflow-mechanics-relocated-2026-10-05` in the portable foundation.
- Before an Ultracode workflow or a named teammate spawn, and for cross-client messaging or an incomplete worker return, read `examples/claude-native/workflows/README.md#native-workflow-mechanics-relocated-2026-10-05` in the portable foundation for effort, inheritance, limits and concurrency.
- When you return through StructuredOutput, put the schema fields at the top level of the call arguments; never wrap them in an input, output or result key.
6 changes: 2 additions & 4 deletions adoption/new-wsl/codex-user-instructions.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<!-- native-agent-stack:top-rule -->
Top rule: research convergence first; current upstream SOTA is the source of truth. The installed client is also a source of truth; never self-write without a SOTA source. The ecosystem compounds: each choice adopts the current best converged practice and is replaced when the live landscape converges on a better-evidenced one.
Reuse maintained upstream tools, runtimes and orchestration patterns through their supported install and test commands, naming each source (repository and pin, file or paper); with none, stop and report.
Prefer the maintainer's own organization repositories (the vendor's GitHub org, such as alpacahq for Alpaca) and their clean releases, and never rebuild or fork what an upstream already ships; glue only fills a demonstrated gap, cited at a pin.
Prefer the maintainer's own organization repositories (the vendor's GitHub org) and their clean releases, and never rebuild or fork what an upstream already ships; glue only fills a demonstrated gap, cited at a pin.
Prompts fix the objective, scope and authorization; improve the approach from current evidence.
Check capability claims in order: installed client (commands, --help, settings), upstream changelog for that version (gh api), upstream source at that tag, official docs. Absence claims need the first two, else say "not found in X, Y".
Worker, docs-agent and cross-family answers are leads; relay claims only with upstream citations.
Expand All @@ -26,9 +26,7 @@ Catalog: qmd for keyword search and document retrieval; codebase_search with the
Run large command output via `context-mode` (`ctx_execute`, `ctx_batch_execute`); set `cwd` to your working directory (a writer's owned worktree).
If `semble` MCP is connected, use `search` for conceptual/natural-language code queries with the absolute repo path; omit `content`, which overrides the code default per call. `find_related` gives embedding-similar chunks only; get callers, implementations and references from Serena.
Long commands: set `yield_time_ms` 30000; while a `session_id` returns, poll `write_stdin` (empty `chars`) until exit, then read output.
Web research: if the stack installs GPT Researcher, run `bash ~/code/native-agent-stack/tools/research/gpt_researcher.sh "<short current-month query>"` as a long command (stops at 1,500 s); use short, unseeded current-month queries; reports are leads: re-read facts in primary sources.
Message Claude Code in one long command: set `msg` via a quoted heredoc (`msg=$(cat <<'MSG'`, text, `MSG`, `)` each on its own line), then `printf '%s\n\nreply: codex queue --thread %s\n' "$msg" "$CODEX_THREAD_ID" | claude -p -n "codex-$(printf '%.8s' "$CODEX_THREAD_ID")" --permission-mode bypassPermissions --max-turns 3 --output-format stream-json --verbose "Send the text on stdin, complete and verbatim, to the session named <name> with exactly one SendMessage call, then stop."`.
Codex receives queued messages only between turns; idle delay is up to ~20 s.
To message a Claude Code session, read `examples/claude-native/workflows/README.md#native-workflow-mechanics-relocated-2026-10-05` in the portable foundation, https://github.com/seathatflowsinourveins/native-agent-stack.
When you tell the user a time, give it first in the host's local time zone (read it with `timedatectl` or `date`), with UTC beside it, for example "4:00 PM EDT (20:00Z)". Write timestamps in ledger rows, receipts, evidence and commit messages in UTC (RFC 3339 with `Z`); Git author/committer metadata retains its native format.

<!-- native-agent-stack:rtk-upstream rtk-ai/rtk v0.51.0 hooks/rtk-awareness-full.md, verbatim -->
Expand Down
2 changes: 1 addition & 1 deletion adoption/scaffold/AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<!-- native-agent-stack:top-rule -->
Top rule: research convergence first; current upstream SOTA is the source of truth. The installed client is also a source of truth; never self-write without a SOTA source. The ecosystem compounds: each choice adopts the current best converged practice and is replaced when the live landscape converges on a better-evidenced one.
Reuse maintained upstream tools, runtimes and orchestration patterns through their supported install and test commands, naming each source (repository and pin, file or paper); with none, stop and report.
Prefer the maintainer's own organization repositories (the vendor's GitHub org, such as alpacahq for Alpaca) and their clean releases, and never rebuild or fork what an upstream already ships; glue only fills a demonstrated gap, cited at a pin.
Prefer the maintainer's own organization repositories (the vendor's GitHub org) and their clean releases, and never rebuild or fork what an upstream already ships; glue only fills a demonstrated gap, cited at a pin.
Prompts fix the objective, scope and authorization; improve the approach from current evidence.
Check capability claims in order: installed client (commands, --help, settings), upstream changelog for that version (gh api), upstream source at that tag, official docs. Absence claims need the first two, else say "not found in X, Y".
Worker, docs-agent and cross-family answers are leads; relay claims only with upstream citations.
Expand Down
Loading
Loading