tradingcodex
AGENTS.md373 starsChanged 4 months agoApache-2.0View on GitHub
Read in this order: 1. This file for repository-wide non-negotiable rules and validation routing. 2. Architecture for the codebase map, ownership, and runtime boundaries. 3. Product documentation for durable behavior and rationale. 4. User guide only when setup or an everyday user journey changes. Keep each fact in one owning layer and link to it elsewhere: Update only the owning layer unless another audience's route actually changed. Do not mirror a rule across several documents merely to keep them textually…
Where files are headingNew AGENTS.md files have more rules about keeping secrets out of the code, and fewer about checking a change actually works.
Of the AGENTS.md files we read, the 11,773 first seen in the last six months, against the older ones: the kind of rule that gained most share, and the kind that lost most. About files like this in general, not this one, and an estimate, since a kind is a pattern in the words.
In this repositoryOne other file it gives its agents.
- guidebook/AGENTS.mdAGENTS.md
The file
Show its rules and text
We split this AGENTS.md into the rules it gives an agent
22 rules. About 0 are common, 14 are distinctive, and 8 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈14
Distinctive · estimate
This author's own choices. Worth a look.
8
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 5
Read in this order:
- Distinctive: line 14
Keep each fact in one owning layer and link to it elsewhere:
- Very specific: line 23
Update only the owning layer unless another audience's route actually changed.
- Very specific: line 24
Do not mirror a rule across several documents merely to keep them textually similar.
- Distinctive: line 35
Do not replace native Codex capabilities with a parallel router, workflow engine, capability registry, permission system, tool-discovery …
- Distinctive: line 42
Put behavior at the first layer that can own it:
- Distinctive: line 51
Keep one canonical owner for each rule.
- Very specific: line 54
Treat the skill directory, not one Markdown file or a prescribed resource taxonomy, as the canonical bundle.
- Distinctive: line 75
Prefer professional free-form analysis with sources, assumptions, confidence, and gaps over large schemas or regex-enforced prose.
- Very specific: line 77
Use native Codex permissions for ordinary workspace, shell, Git, web, skill, plugin, and MCP activity.
- Distinctive: line 80
Prefer deletion and direct composition over registries, compatibility layers, state machines, projection indexes, generic provider …
- Distinctive: line 83
Do not build an abstraction for a second implementation before a real second use case exists.
- Very specific: line 90
When the implementing Codex agent and TradingCodex runtime agents use the same GPT/Codex model family, use your own likely interpretation …
- Distinctive: line 95
Before changing prompts, skills, tool exposure, delegation, hooks, or services, trace the consequential path from the user request through …
- Distinctive: line 110
Use one relevant user-enabled skill, plugin, app, or MCP capability.
- Distinctive: line 111
Use the optional direct OpenBB MCP when enabled.
- Distinctive: line 113
Use other credible sources when primary coverage is unavailable.
- Very specific: line 159
Do not combine --dev with --from or convert a release workspace in place.
- Very specific: line 183
Keep prompts, skills, hooks, policies, and workspace contracts as ordinary files under workspace_templates/modules/*/files.
- Very specific: line 185
Use the repository's skill-creator workflow before adding or materially changing a generic skill.
- Distinctive: line 188
Use the smallest meaningful validation while iterating.
- Distinctive: line 194
Keep durable product copy in English unless a reviewed localization layer is explicitly introduced.
≈ “Common” is an estimate: at least 1 in 5 of the 16,595 AGENTS.md files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
TradingCodex Repository Guide
Read Order And Documentation Ownership
Read in this order:
- This file for repository-wide non-negotiable rules and validation routing.
- Architecture for the codebase map, ownership, and runtime boundaries.
- Product documentation for durable behavior and rationale.
- User guide only when setup or an everyday user journey changes.
Keep each fact in one owning layer and link to it elsewhere:
| Layer | Owns |
docs/ | Durable product behavior, architecture, safety, workflow, and release intent. |
guidebook/ | Concise, task-first user instructions. |
README.md / installation.md | Product entrypoint and installation path. |
AGENTS.md | Repository-wide development constraints. |
Update only the owning layer unless another audience's route actually changed.
Do not mirror a rule across several documents merely to keep them textually
similar. When layers disagree, correct the owning docs/ page first.
Product Direction
TradingCodex is a thin, local-first investment layer on top of native Codex. Codex owns reasoning, research strategy, tool selection, delegation, and use of the user's available skills, plugins, apps, and MCP servers. TradingCodex owns durable investment records and deterministic boundaries for provenance, policy, approval, execution, secrets, and audit.
Do not replace native Codex capabilities with a parallel router, workflow engine, capability registry, permission system, tool-discovery protocol, agent scheduler, or provider platform. Add TradingCodex machinery only when a durable cross-session invariant or sensitive final effect cannot be handled safely by native Codex, a canonical skill bundle with a concise entrypoint, or an existing application service.
Put behavior at the first layer that can own it:
- Native Codex and user-provided capabilities.
- One canonical skill bundle with a concise
SKILL.mdentrypoint for reusable agent guidance. - A prompt for stable role identity or a safety boundary.
- An application service for durable records or deterministic enforcement.
- A hook only when enforcement must surround a native tool call.
Keep one canonical owner for each rule. Do not duplicate the same procedure in prompts, skills, hooks, services, CLI, MCP, and documentation.
Treat the skill directory, not one Markdown file or a prescribed resource
taxonomy, as the canonical bundle. Keep default-loaded metadata and
SKILL.md focused; put optional detail or reusable resources in clearly named
bundle paths and route when to load or execute them. Do not impose a fixed byte
limit without a measured compatibility, safety, or latency failure.
Simplicity And Agent Autonomy
- Specify goals, evidence standards, authority, and safety boundaries. Do not prescribe exact reasoning steps, tool order, search counts, wait loops, artifact windows, or retry scripts without a demonstrated failure that needs deterministic enforcement.
- Head Manager may answer narrow factual, status, and explanation requests directly. Use subagents only when distinct expertise, independent evidence, or high-consequence review materially improves the result.
- Reuse an existing agent for corrections when practical. Fixed roles are optional expert profiles, not the only valid path. Inherit the user's Codex model and reasoning settings unless a documented compatibility or safety requirement proves otherwise.
- Persist research when it has reuse, provenance, decision, or audit value. Do not require an artifact for every narrow answer or intermediate thought.
- Prefer professional free-form analysis with sources, assumptions, confidence, and gaps over large schemas or regex-enforced prose.
- Use native Codex permissions for ordinary workspace, shell, Git, web, skill, plugin, and MCP activity. Reserve TradingCodex gates for secrets, brokers, orders, approvals, execution, and other sensitive effects.
- Prefer deletion and direct composition over registries, compatibility layers, state machines, projection indexes, generic provider frameworks, and speculative extension points.
- Do not build an abstraction for a second implementation before a real second use case exists. A new abstraction must name the current failure it fixes, explain why a smaller native solution is insufficient, and replace rather than duplicate the old path.
Model-Aware Consequence Tracing
When the implementing Codex agent and TradingCodex runtime agents use the same GPT/Codex model family, use your own likely interpretation and behavior as a concrete design signal. Do not assume identical behavior: prompts, context, skills, tools, permissions, model versions, and reasoning settings may differ.
Before changing prompts, skills, tool exposure, delegation, hooks, or services, trace the consequential path from the user request through model interpretation, guidance and context, tool or subagent selection, canonical service boundaries, generated output or external action, and finally durable, safety, latency, context, and user-visible effects. Improve the earliest layer that owns the cause. Validate consequential model-facing changes in the actual generated TradingCodex harness rather than inferring behavior only from unit tests or assumptions about the model.
Research Source Direction
External research uses a guidance-based fallback, not a TradingCodex-owned provider state machine:
- Reuse an adequate existing Snapshot or Dataset.
- Use one relevant user-enabled skill, plugin, app, or MCP capability.
- Use the optional direct OpenBB MCP when enabled.
- Research autonomously, preferring primary official sources.
- Use other credible sources when primary coverage is unavailable.
- Report an explicit evidence gap when adequate data cannot be obtained.
This is a collection preference, not a trust ranking. Preserve source and as-of context, verify material claims, avoid unchanged repeated calls, and fetch only missing coverage after partial success. OpenBB remains optional and direct: do not build an OpenBB proxy, runtime supervisor, provider router, compatibility state machine, or package manager. Store environment-variable names only, never credential values.
Safety And Product Boundaries
- Django application services are canonical for durable policy, portfolio, order, approval, broker, execution, and audit behavior. Interfaces call those services rather than fork them.
- The workspace viewer is read-only. It must not start Codex or mutate workspace, skill, order, broker, or execution state.
- Research artifacts, source snapshots, immutable datasets, and provenance hashes remain workspace-file-native. Execution-sensitive state belongs to the central service ledger.
- Sensitive final actions remain service-gated and idempotent. Never expose secrets in repository or workspace files, prompts, shell output, APIs, MCP responses, artifacts, or audit output.
- Generated workspaces remain Node-free. Node is a maintainer dependency only.
- Preserve development/release HOME, DB, and service isolation. A version or DB mismatch remains fail-closed.
Setup And Development Isolation
For an end-user workspace, do not clone this source repository. From the target directory run:
uvx --refresh --from tradingcodex tcx attach . && ./tcx doctorOn native Windows PowerShell, run the same attach command and then
.\tcx.cmd doctor. Clone this repository only for source development.
From this checkout create or refresh a development workspace with:
./install.sh --dev /path/to/empty-workspace
./install.sh --dev --update /path/to/existing-dev-workspaceDo not combine --dev with --from or convert a release workspace in place.
Development workspaces from this checkout share its derived
TRADINGCODEX_HOME, DB, and deterministic 20000-29999 loopback service;
release workspaces remain isolated at their own recorded identity. Use the
generated ./tcx service status|ensure|stop commands and never hard-code or
free another runtime's port.
Change Routing
| Change area | Read first | Minimum validation |
| CLI, attach/update, templates, hooks, generated files | docs/generated-workspaces.md | Focused tests and disposable workspace smoke. |
| Service, model, API, MCP, viewer | docs/architecture.md and docs/interfaces-and-surfaces.md | Focused tests; python manage.py check when Django wiring changes. |
| Roles, skills, workflow, research harness | docs/roles-skills-and-workflows.md | Generated workspace and Codex-native smoke when behavior changes. |
| Policy, broker, approval, execution, secrets | docs/safety-policy-and-execution.md | Focused safety tests and canonical service-path checks. |
| Documentation only | docs/README.md | Link/file checks and review of changed Markdown. |
| Package or release | docs/deployment.md | The release-readiness checks documented there. |
Implementation And Delivery
- Target Python
>=3.11,<3.15and Django5.2.x. Keep durable service behavior undertradingcodex_service/application/and use direct canonical imports. - Frontend source lives under
frontend/; compiled assets undertradingcodex_service/static/tradingcodex_web/are generated, not hand-edited. - Keep prompts, skills, hooks, policies, and workspace contracts as ordinary
files under
workspace_templates/modules/*/files. - Use the repository's
skill-creatorworkflow before adding or materially changing a generic skill; keep bundled TradingCodex skills in the reservedtcx-namespace. - Use the smallest meaningful validation while iterating. Harness changes need observed Codex behavior, not unit tests alone; run one integrated E2E after coupled changes stabilize.
- For a non-trivial architecture or harness change, state whether native Codex already covers it, what duplication is removed, and the expected effect on tool calls, spawned agents, context size, and latency.
- Keep durable product copy in English unless a reviewed localization layer is explicitly introduced.
- Preserve unrelated worktree changes. Commit only when requested, using small imperative commits that identify the validation actually run.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

