tradingcodex 0.1.0__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- apps/__init__.py +1 -0
- apps/audit/__init__.py +1 -0
- apps/audit/admin.py +6 -0
- apps/audit/apps.py +8 -0
- apps/audit/migrations/0001_initial.py +35 -0
- apps/audit/migrations/__init__.py +0 -0
- apps/audit/models.py +22 -0
- apps/harness/__init__.py +1 -0
- apps/harness/admin.py +6 -0
- apps/harness/apps.py +8 -0
- apps/harness/migrations/0001_initial.py +35 -0
- apps/harness/migrations/__init__.py +0 -0
- apps/harness/models.py +22 -0
- apps/harness/templatetags/__init__.py +1 -0
- apps/integrations/__init__.py +1 -0
- apps/integrations/admin.py +6 -0
- apps/integrations/apps.py +8 -0
- apps/integrations/migrations/0001_initial.py +29 -0
- apps/integrations/migrations/__init__.py +0 -0
- apps/integrations/models.py +16 -0
- apps/integrations/services.py +31 -0
- apps/mcp/__init__.py +1 -0
- apps/mcp/admin.py +20 -0
- apps/mcp/apps.py +8 -0
- apps/mcp/migrations/0001_initial.py +168 -0
- apps/mcp/migrations/__init__.py +0 -0
- apps/mcp/models.py +154 -0
- apps/mcp/services.py +327 -0
- apps/orders/__init__.py +1 -0
- apps/orders/admin.py +6 -0
- apps/orders/apps.py +8 -0
- apps/orders/migrations/0001_initial.py +79 -0
- apps/orders/migrations/__init__.py +0 -0
- apps/orders/models.py +66 -0
- apps/orders/services.py +107 -0
- apps/policy/__init__.py +1 -0
- apps/policy/admin.py +6 -0
- apps/policy/apps.py +8 -0
- apps/policy/migrations/0001_initial.py +75 -0
- apps/policy/migrations/__init__.py +0 -0
- apps/policy/models.py +61 -0
- apps/policy/services.py +110 -0
- apps/portfolio/__init__.py +1 -0
- apps/portfolio/admin.py +6 -0
- apps/portfolio/apps.py +8 -0
- apps/portfolio/migrations/0001_initial.py +67 -0
- apps/portfolio/migrations/__init__.py +0 -0
- apps/portfolio/models.py +53 -0
- apps/research/__init__.py +1 -0
- apps/research/admin.py +1 -0
- apps/research/apps.py +8 -0
- apps/research/migrations/__init__.py +0 -0
- apps/research/models.py +1 -0
- apps/workflows/__init__.py +1 -0
- apps/workflows/admin.py +6 -0
- apps/workflows/apps.py +8 -0
- apps/workflows/migrations/0001_initial.py +51 -0
- apps/workflows/migrations/__init__.py +0 -0
- apps/workflows/models.py +44 -0
- tradingcodex-0.1.0.dist-info/METADATA +337 -0
- tradingcodex-0.1.0.dist-info/RECORD +254 -0
- tradingcodex-0.1.0.dist-info/WHEEL +5 -0
- tradingcodex-0.1.0.dist-info/entry_points.txt +2 -0
- tradingcodex-0.1.0.dist-info/licenses/LICENSE +202 -0
- tradingcodex-0.1.0.dist-info/licenses/NOTICE +24 -0
- tradingcodex-0.1.0.dist-info/top_level.txt +4 -0
- tradingcodex_cli/__init__.py +1 -0
- tradingcodex_cli/__main__.py +124 -0
- tradingcodex_cli/commands/__init__.py +2 -0
- tradingcodex_cli/commands/bootstrap.py +157 -0
- tradingcodex_cli/commands/db.py +36 -0
- tradingcodex_cli/commands/doctor.py +230 -0
- tradingcodex_cli/commands/mcp.py +186 -0
- tradingcodex_cli/commands/orders.py +89 -0
- tradingcodex_cli/commands/policy.py +21 -0
- tradingcodex_cli/commands/profile.py +110 -0
- tradingcodex_cli/commands/research.py +76 -0
- tradingcodex_cli/commands/skills.py +93 -0
- tradingcodex_cli/commands/strategies.py +67 -0
- tradingcodex_cli/commands/subagents.py +106 -0
- tradingcodex_cli/commands/utils.py +134 -0
- tradingcodex_cli/commands/workspaces.py +53 -0
- tradingcodex_cli/generator.py +234 -0
- tradingcodex_cli/mcp_stdio.py +26 -0
- tradingcodex_cli/service_autostart.py +127 -0
- tradingcodex_service/__init__.py +5 -0
- tradingcodex_service/admin.py +1 -0
- tradingcodex_service/api.py +486 -0
- tradingcodex_service/application/__init__.py +2 -0
- tradingcodex_service/application/agents.py +1470 -0
- tradingcodex_service/application/audit.py +71 -0
- tradingcodex_service/application/common.py +88 -0
- tradingcodex_service/application/components.py +299 -0
- tradingcodex_service/application/harness.py +747 -0
- tradingcodex_service/application/markdown_preview.py +179 -0
- tradingcodex_service/application/orders.py +404 -0
- tradingcodex_service/application/policy.py +150 -0
- tradingcodex_service/application/portfolio.py +166 -0
- tradingcodex_service/application/research.py +356 -0
- tradingcodex_service/application/runtime.py +321 -0
- tradingcodex_service/asgi.py +6 -0
- tradingcodex_service/mcp_http.py +59 -0
- tradingcodex_service/mcp_runtime.py +565 -0
- tradingcodex_service/settings.py +91 -0
- tradingcodex_service/templates/web/activity.html +24 -0
- tradingcodex_service/templates/web/agent_skills.html +111 -0
- tradingcodex_service/templates/web/agents.html +121 -0
- tradingcodex_service/templates/web/base.html +150 -0
- tradingcodex_service/templates/web/dashboard.html +109 -0
- tradingcodex_service/templates/web/fragments/role_inspector.html +81 -0
- tradingcodex_service/templates/web/fragments/starter_prompt.html +24 -0
- tradingcodex_service/templates/web/fragments/topology_canvas.html +85 -0
- tradingcodex_service/templates/web/harness.html +87 -0
- tradingcodex_service/templates/web/mcp_router.html +250 -0
- tradingcodex_service/templates/web/orders.html +68 -0
- tradingcodex_service/templates/web/policy.html +81 -0
- tradingcodex_service/templates/web/portfolio.html +52 -0
- tradingcodex_service/templates/web/research.html +73 -0
- tradingcodex_service/templates/web/starter_prompt.html +40 -0
- tradingcodex_service/templates/web/strategies.html +74 -0
- tradingcodex_service/urls.py +42 -0
- tradingcodex_service/version.py +1 -0
- tradingcodex_service/web.py +885 -0
- tradingcodex_service/wsgi.py +6 -0
- workspace_templates/__init__.py +1 -0
- workspace_templates/modules/audit/files/.tradingcodex/audit/README.md +5 -0
- workspace_templates/modules/audit/files/trading/audit/.gitkeep +1 -0
- workspace_templates/modules/audit/module.json +16 -0
- workspace_templates/modules/codex-base/files/.codex/config.toml +272 -0
- workspace_templates/modules/codex-base/files/.codex/hooks/tradingcodex_hook.py +173 -0
- workspace_templates/modules/codex-base/files/.codex/hooks.json +105 -0
- workspace_templates/modules/codex-base/files/.codex/prompts/base_instructions/head-manager.md +129 -0
- workspace_templates/modules/codex-base/files/.codex/rules/tradingcodex.rules +50 -0
- workspace_templates/modules/codex-base/files/.tradingcodex/capabilities.yaml +56 -0
- workspace_templates/modules/codex-base/files/.tradingcodex/cli.py +16 -0
- workspace_templates/modules/codex-base/files/.tradingcodex/config.yaml +53 -0
- workspace_templates/modules/codex-base/files/.tradingcodex/policies/policy-bindings.yaml +16 -0
- workspace_templates/modules/codex-base/files/.tradingcodex/policies/principals.yaml +17 -0
- workspace_templates/modules/codex-base/files/.tradingcodex/policies/roles.yaml +27 -0
- workspace_templates/modules/codex-base/files/AGENTS.md +56 -0
- workspace_templates/modules/codex-base/files/pyproject.toml +13 -0
- workspace_templates/modules/codex-base/files/tcx +35 -0
- workspace_templates/modules/codex-base/module.json +17 -0
- workspace_templates/modules/enforcement-guardrails/files/.tradingcodex/policies/access-policies.yaml +39 -0
- workspace_templates/modules/enforcement-guardrails/files/.tradingcodex/policies/restricted-list.yaml +6 -0
- workspace_templates/modules/enforcement-guardrails/files/.tradingcodex/schemas/approval_receipt.schema.json +14 -0
- workspace_templates/modules/enforcement-guardrails/files/.tradingcodex/schemas/audit_event.schema.json +11 -0
- workspace_templates/modules/enforcement-guardrails/files/.tradingcodex/schemas/evidence_pack.schema.json +16 -0
- workspace_templates/modules/enforcement-guardrails/files/.tradingcodex/schemas/execution_result.schema.json +12 -0
- workspace_templates/modules/enforcement-guardrails/files/.tradingcodex/schemas/fundamental_report.schema.json +15 -0
- workspace_templates/modules/enforcement-guardrails/files/.tradingcodex/schemas/news_report.schema.json +15 -0
- workspace_templates/modules/enforcement-guardrails/files/.tradingcodex/schemas/order_intent.schema.json +30 -0
- workspace_templates/modules/enforcement-guardrails/files/.tradingcodex/schemas/portfolio_review.schema.json +15 -0
- workspace_templates/modules/enforcement-guardrails/files/.tradingcodex/schemas/postmortem_report.schema.json +14 -0
- workspace_templates/modules/enforcement-guardrails/files/.tradingcodex/schemas/risk_report.schema.json +15 -0
- workspace_templates/modules/enforcement-guardrails/files/.tradingcodex/schemas/technical_report.schema.json +15 -0
- workspace_templates/modules/enforcement-guardrails/files/.tradingcodex/schemas/thesis.schema.json +15 -0
- workspace_templates/modules/enforcement-guardrails/files/.tradingcodex/schemas/valuation.schema.json +15 -0
- workspace_templates/modules/enforcement-guardrails/files/.tradingcodex/scripts/validate-order-intent.py +15 -0
- workspace_templates/modules/enforcement-guardrails/module.json +19 -0
- workspace_templates/modules/fixed-subagents/files/.codex/agents/execution-operator.toml +71 -0
- workspace_templates/modules/fixed-subagents/files/.codex/agents/fundamental-analyst.toml +62 -0
- workspace_templates/modules/fixed-subagents/files/.codex/agents/instrument-analyst.toml +64 -0
- workspace_templates/modules/fixed-subagents/files/.codex/agents/macro-analyst.toml +64 -0
- workspace_templates/modules/fixed-subagents/files/.codex/agents/news-analyst.toml +63 -0
- workspace_templates/modules/fixed-subagents/files/.codex/agents/portfolio-manager.toml +62 -0
- workspace_templates/modules/fixed-subagents/files/.codex/agents/risk-manager.toml +65 -0
- workspace_templates/modules/fixed-subagents/files/.codex/agents/technical-analyst.toml +63 -0
- workspace_templates/modules/fixed-subagents/files/.codex/agents/valuation-analyst.toml +59 -0
- workspace_templates/modules/fixed-subagents/files/.tradingcodex/mainagent/head-manager.yaml +66 -0
- workspace_templates/modules/fixed-subagents/files/.tradingcodex/mainagent/skill-change-proposals/.gitkeep +1 -0
- workspace_templates/modules/fixed-subagents/files/.tradingcodex/mainagent/subagent-registry.yaml +56 -0
- workspace_templates/modules/fixed-subagents/module.json +23 -0
- workspace_templates/modules/guidance-guardrails/files/.tradingcodex/guidance/guardrails.md +17 -0
- workspace_templates/modules/guidance-guardrails/files/.tradingcodex/guidance/task-quality-checklist.md +37 -0
- workspace_templates/modules/guidance-guardrails/module.json +18 -0
- workspace_templates/modules/information-barriers/files/.tradingcodex/policies/information-barriers.yaml +211 -0
- workspace_templates/modules/information-barriers/files/.tradingcodex/secrets.md +9 -0
- workspace_templates/modules/information-barriers/files/trading/approvals/.gitkeep +1 -0
- workspace_templates/modules/information-barriers/files/trading/market-data/.gitkeep +1 -0
- workspace_templates/modules/information-barriers/files/trading/orders/approved/.gitkeep +1 -0
- workspace_templates/modules/information-barriers/files/trading/orders/draft/.gitkeep +1 -0
- workspace_templates/modules/information-barriers/files/trading/orders/executed/.gitkeep +1 -0
- workspace_templates/modules/information-barriers/files/trading/orders/rejected/.gitkeep +1 -0
- workspace_templates/modules/information-barriers/files/trading/portfolio/.gitkeep +1 -0
- workspace_templates/modules/information-barriers/files/trading/reports/fundamental/.gitkeep +1 -0
- workspace_templates/modules/information-barriers/files/trading/reports/instrument/.gitkeep +1 -0
- workspace_templates/modules/information-barriers/files/trading/reports/macro/.gitkeep +1 -0
- workspace_templates/modules/information-barriers/files/trading/reports/news/.gitkeep +1 -0
- workspace_templates/modules/information-barriers/files/trading/reports/policy/.gitkeep +1 -0
- workspace_templates/modules/information-barriers/files/trading/reports/portfolio/.gitkeep +1 -0
- workspace_templates/modules/information-barriers/files/trading/reports/postmortem/.gitkeep +1 -0
- workspace_templates/modules/information-barriers/files/trading/reports/risk/.gitkeep +1 -0
- workspace_templates/modules/information-barriers/files/trading/reports/technical/.gitkeep +1 -0
- workspace_templates/modules/information-barriers/files/trading/reports/valuation/.gitkeep +1 -0
- workspace_templates/modules/information-barriers/files/trading/research/.gitkeep +1 -0
- workspace_templates/modules/information-barriers/module.json +19 -0
- workspace_templates/modules/paper-trading/files/.tradingcodex/mcp/adapters/paper-trading.py +4 -0
- workspace_templates/modules/paper-trading/module.json +16 -0
- workspace_templates/modules/postmortem/files/.tradingcodex/workflows/postmortem.yaml +12 -0
- workspace_templates/modules/postmortem/module.json +16 -0
- workspace_templates/modules/repo-skills/files/.agents/skills/investment-workflow-map/SKILL.md +106 -0
- workspace_templates/modules/repo-skills/files/.agents/skills/investment-workflow-map/agents/openai.yaml +6 -0
- workspace_templates/modules/repo-skills/files/.agents/skills/manage-optional-skills/SKILL.md +101 -0
- workspace_templates/modules/repo-skills/files/.agents/skills/manage-optional-skills/agents/openai.yaml +6 -0
- workspace_templates/modules/repo-skills/files/.agents/skills/manage-subagents/SKILL.md +140 -0
- workspace_templates/modules/repo-skills/files/.agents/skills/manage-subagents/agents/openai.yaml +6 -0
- workspace_templates/modules/repo-skills/files/.agents/skills/orchestrate-workflow/SKILL.md +140 -0
- workspace_templates/modules/repo-skills/files/.agents/skills/orchestrate-workflow/agents/openai.yaml +6 -0
- workspace_templates/modules/repo-skills/files/.agents/skills/postmortem/SKILL.md +31 -0
- workspace_templates/modules/repo-skills/files/.agents/skills/postmortem/agents/openai.yaml +6 -0
- workspace_templates/modules/repo-skills/files/.agents/skills/scenario-quality-gates/SKILL.md +138 -0
- workspace_templates/modules/repo-skills/files/.agents/skills/scenario-quality-gates/agents/openai.yaml +6 -0
- workspace_templates/modules/repo-skills/files/.agents/skills/strategy-creator/SKILL.md +109 -0
- workspace_templates/modules/repo-skills/files/.agents/skills/strategy-creator/agents/openai.yaml +6 -0
- workspace_templates/modules/repo-skills/files/.agents/skills/synthesize-decision/SKILL.md +54 -0
- workspace_templates/modules/repo-skills/files/.agents/skills/synthesize-decision/agents/openai.yaml +6 -0
- workspace_templates/modules/repo-skills/files/.tradingcodex/subagents/skills/execution-operator/execute-paper-order/SKILL.md +35 -0
- workspace_templates/modules/repo-skills/files/.tradingcodex/subagents/skills/execution-operator/execute-paper-order/agents/openai.yaml +6 -0
- workspace_templates/modules/repo-skills/files/.tradingcodex/subagents/skills/fundamental-analyst/fundamental-analysis/SKILL.md +46 -0
- workspace_templates/modules/repo-skills/files/.tradingcodex/subagents/skills/fundamental-analyst/fundamental-analysis/agents/openai.yaml +6 -0
- workspace_templates/modules/repo-skills/files/.tradingcodex/subagents/skills/instrument-analyst/instrument-analysis/SKILL.md +40 -0
- workspace_templates/modules/repo-skills/files/.tradingcodex/subagents/skills/instrument-analyst/instrument-analysis/agents/openai.yaml +6 -0
- workspace_templates/modules/repo-skills/files/.tradingcodex/subagents/skills/macro-analyst/macro-analysis/SKILL.md +40 -0
- workspace_templates/modules/repo-skills/files/.tradingcodex/subagents/skills/macro-analyst/macro-analysis/agents/openai.yaml +6 -0
- workspace_templates/modules/repo-skills/files/.tradingcodex/subagents/skills/news-analyst/news-analysis/SKILL.md +43 -0
- workspace_templates/modules/repo-skills/files/.tradingcodex/subagents/skills/news-analyst/news-analysis/agents/openai.yaml +6 -0
- workspace_templates/modules/repo-skills/files/.tradingcodex/subagents/skills/portfolio-manager/create-order-intent/SKILL.md +46 -0
- workspace_templates/modules/repo-skills/files/.tradingcodex/subagents/skills/portfolio-manager/create-order-intent/agents/openai.yaml +6 -0
- workspace_templates/modules/repo-skills/files/.tradingcodex/subagents/skills/portfolio-manager/portfolio-review/SKILL.md +44 -0
- workspace_templates/modules/repo-skills/files/.tradingcodex/subagents/skills/portfolio-manager/portfolio-review/agents/openai.yaml +6 -0
- workspace_templates/modules/repo-skills/files/.tradingcodex/subagents/skills/risk-manager/approve-order/SKILL.md +38 -0
- workspace_templates/modules/repo-skills/files/.tradingcodex/subagents/skills/risk-manager/approve-order/agents/openai.yaml +6 -0
- workspace_templates/modules/repo-skills/files/.tradingcodex/subagents/skills/risk-manager/policy-review/SKILL.md +43 -0
- workspace_templates/modules/repo-skills/files/.tradingcodex/subagents/skills/risk-manager/policy-review/agents/openai.yaml +6 -0
- workspace_templates/modules/repo-skills/files/.tradingcodex/subagents/skills/risk-manager/review-risk/SKILL.md +45 -0
- workspace_templates/modules/repo-skills/files/.tradingcodex/subagents/skills/risk-manager/review-risk/agents/openai.yaml +6 -0
- workspace_templates/modules/repo-skills/files/.tradingcodex/subagents/skills/shared/collect-evidence/SKILL.md +46 -0
- workspace_templates/modules/repo-skills/files/.tradingcodex/subagents/skills/shared/collect-evidence/agents/openai.yaml +6 -0
- workspace_templates/modules/repo-skills/files/.tradingcodex/subagents/skills/shared/external-data-source-gate/SKILL.md +66 -0
- workspace_templates/modules/repo-skills/files/.tradingcodex/subagents/skills/shared/external-data-source-gate/agents/openai.yaml +6 -0
- workspace_templates/modules/repo-skills/files/.tradingcodex/subagents/skills/technical-analyst/technical-analysis/SKILL.md +43 -0
- workspace_templates/modules/repo-skills/files/.tradingcodex/subagents/skills/technical-analyst/technical-analysis/agents/openai.yaml +6 -0
- workspace_templates/modules/repo-skills/files/.tradingcodex/subagents/skills/valuation-analyst/valuation-review/SKILL.md +47 -0
- workspace_templates/modules/repo-skills/files/.tradingcodex/subagents/skills/valuation-analyst/valuation-review/agents/openai.yaml +6 -0
- workspace_templates/modules/repo-skills/module.json +37 -0
- workspace_templates/modules/stub-execution/files/.tradingcodex/mcp/adapters/stub-execution.py +4 -0
- workspace_templates/modules/stub-execution/module.json +15 -0
- workspace_templates/modules/tradingcodex-mcp/files/.tradingcodex/mcp/adapters/live-adapter.contract.md +25 -0
- workspace_templates/modules/tradingcodex-mcp/files/.tradingcodex/mcp/enforcer/README.md +5 -0
- workspace_templates/modules/tradingcodex-mcp/files/.tradingcodex/mcp/gateway/README.md +8 -0
- workspace_templates/modules/tradingcodex-mcp/files/.tradingcodex/mcp/server.py +27 -0
- workspace_templates/modules/tradingcodex-mcp/files/.tradingcodex/mcp/smoke-call.py +18 -0
- workspace_templates/modules/tradingcodex-mcp/module.json +24 -0
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
{
|
|
2
|
+
"id": "paper-trading",
|
|
3
|
+
"description": "Experimental simulated portfolio adapter for paper execution without live broker integration.",
|
|
4
|
+
"requires": {
|
|
5
|
+
"modules": [
|
|
6
|
+
"tradingcodex-mcp",
|
|
7
|
+
"stub-execution"
|
|
8
|
+
]
|
|
9
|
+
},
|
|
10
|
+
"provides": {
|
|
11
|
+
"capabilities": [
|
|
12
|
+
"execution.paper"
|
|
13
|
+
]
|
|
14
|
+
},
|
|
15
|
+
"conflicts": []
|
|
16
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
name: postmortem
|
|
2
|
+
trigger_examples:
|
|
3
|
+
- rejected_order
|
|
4
|
+
- executed_paper_order
|
|
5
|
+
- thesis_change
|
|
6
|
+
- policy_violation
|
|
7
|
+
- skill_change_proposal
|
|
8
|
+
|
|
9
|
+
outputs:
|
|
10
|
+
directory: trading/reports/postmortem
|
|
11
|
+
format: json
|
|
12
|
+
filename_pattern: "*.postmortem_report.json"
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
{
|
|
2
|
+
"id": "postmortem",
|
|
3
|
+
"description": "Workflow metadata for audit-backed investment process review.",
|
|
4
|
+
"requires": {
|
|
5
|
+
"modules": [
|
|
6
|
+
"repo-skills",
|
|
7
|
+
"audit"
|
|
8
|
+
]
|
|
9
|
+
},
|
|
10
|
+
"provides": {
|
|
11
|
+
"capabilities": [
|
|
12
|
+
"workflow.postmortem"
|
|
13
|
+
]
|
|
14
|
+
},
|
|
15
|
+
"conflicts": []
|
|
16
|
+
}
|
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: investment-workflow-map
|
|
3
|
+
description: "Map investment requests across asset universes into TradingCodex workflow lanes, role teams, source posture, hero artifacts, support files, and conservative readiness labels."
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Investment Workflow Map
|
|
7
|
+
|
|
8
|
+
Use this skill when the request is an investment workflow. It improves routing and artifact quality; it does not replace fixed role subagents or let the coordinator perform analyst work directly.
|
|
9
|
+
|
|
10
|
+
Boundary:
|
|
11
|
+
|
|
12
|
+
- This skill covers universe classification, workflow-type mapping, source/as-of posture, support gaps, hero/support artifact choice, and conservative readiness labels.
|
|
13
|
+
- Final scenario selection, role team, quality gates, blocked actions, fixed-role dispatch details, role briefs, and user-facing decision states are separate workflow steps.
|
|
14
|
+
- Readiness labels from this map are not approvals, permissions, or execution authorization.
|
|
15
|
+
|
|
16
|
+
Reference basis: this map incorporates institutional public-equity workflow patterns such as issuer tearsheets, idea triage, pre-earnings previews, post-earnings deep dives, catalyst calendars, thesis trackers, long/short pitches, valuation/model work, model audit, financial normalization, position sizing, hedge design, and report QC. Treat public equity as the first fully specified sleeve, not the only TradingCodex investment universe.
|
|
17
|
+
|
|
18
|
+
## Universe Boundary
|
|
19
|
+
|
|
20
|
+
TradingCodex can support multiple investment universes through the same safety model:
|
|
21
|
+
|
|
22
|
+
- Public equities, ADRs, ETFs, indices, and listed options.
|
|
23
|
+
- Public crypto market research and paper/stub workflows when no account access or trading API is exposed.
|
|
24
|
+
- Macro, rates, FX, commodities, and cross-asset overlays as research, thesis, or portfolio-risk inputs.
|
|
25
|
+
- Credit, convertibles, preferreds, and capital-structure signals as supported workflows when a role skill, external read-only source, and policy boundary are explicitly installed; until then, use them only as inputs to the allowed workflow and label handoff gaps.
|
|
26
|
+
- Private markets, funds, tax, legal, and regulated advice are out of scope unless the user installs explicit skills and policies for those domains.
|
|
27
|
+
|
|
28
|
+
Live execution remains outside the default product regardless of universe. Any executable action must still pass structured artifacts, policy, approval, TradingCodex MCP, and audit.
|
|
29
|
+
|
|
30
|
+
## Invocation Boundary
|
|
31
|
+
|
|
32
|
+
Apply this map when the user asks for investment work on a listed issuer, ticker, public security, ETF/index constituent, crypto asset, macro/commodity/rate/FX exposure, portfolio position, hedge, catalyst, thesis, model, or risk decision.
|
|
33
|
+
|
|
34
|
+
Do not use this map for generic background research, private-company diligence, banking deliverables, legal/tax advice, raw broker access, direct live execution, or unsupported instruments. When the universe is not fully supported by the installed role skills, classify the work as research-only, screen-grade, or blocked rather than pretending the harness can underwrite it.
|
|
35
|
+
|
|
36
|
+
## Source Posture
|
|
37
|
+
|
|
38
|
+
Every investment workflow needs an explicit source posture before synthesis:
|
|
39
|
+
|
|
40
|
+
- Source categories: issuer/company disclosures, regulator/exchange records, transcripts/presentations, macro or instrument data, internal research or user notes, portfolio/models/trackers, market data/estimates, current news, and instrument-specific sources such as borrow, options, liquidity, credit spread, or chain data when relevant.
|
|
41
|
+
- Freeze time: market-sensitive inputs such as price, consensus, estimates, ownership, short interest, borrow, options, index weights, funding rates, yields, spreads, FX, commodity prices, catalyst dates, and portfolio exposures need an as-of or retrieved-at timestamp.
|
|
42
|
+
- Evidence labels: separate reported facts, issuer claims, consensus/provider data, user-provided inputs, derived calculations, analyst assumptions, and PM judgment.
|
|
43
|
+
- Connector honesty: never imply live Bloomberg, FactSet, official regulator/exchange disclosure feeds, Binance account, broker, email, drive, or internal-system access unless that source is actually callable in the current runtime.
|
|
44
|
+
- Missing or stale load-bearing evidence must lower readiness, confidence, sizing/action language, or circulation status.
|
|
45
|
+
|
|
46
|
+
## Workflow Taxonomy
|
|
47
|
+
|
|
48
|
+
| Investment request | TradingCodex lane | Minimum useful team | Hero artifact | Readiness rule |
|
|
49
|
+
| --- | --- | --- | --- | --- |
|
|
50
|
+
| Issuer baseline, company tearsheet, public profile | `research_only` | fundamental, news; add valuation when valuation context is requested | issuer baseline or evidence-backed research note | factual baseline only; no recommendation |
|
|
51
|
+
| Idea screen, market map, watchlist triage | `research_only` or `thesis_review` | fundamental, news, valuation, portfolio when fit matters | idea triage report or watchlist board | research-priority status, not final recommendation |
|
|
52
|
+
| Pre-earnings preview | `thesis_review` | fundamental, news, valuation; add portfolio/risk if position action is requested | earnings preview report | freeze expectation bar and label missing consensus/guide/price data |
|
|
53
|
+
| Post-earnings deep dive | `thesis_review` | fundamental, news, valuation; add portfolio/risk if thesis break or sizing is requested | earnings deep-dive report | state what changed versus prior thesis and which sources are still missing |
|
|
54
|
+
| Catalyst calendar or monitoring queue | `thesis_review` | news, fundamental, portfolio when position context exists | catalyst calendar or tracker | confirmed dates, inferred windows, and unscheduled monitor items stay distinct |
|
|
55
|
+
| Thesis tracker update | `thesis_review` or `portfolio_risk_review` | fundamental, news, valuation, portfolio, risk when action changes | append-only thesis tracker or update memo | separate thesis status, security/instrument readiness, and action threshold origin |
|
|
56
|
+
| Long/short pitch, pair idea, trade expression | `thesis_review` then `portfolio_risk_review` | fundamental, news, valuation, portfolio, risk | trade pitch or memo | expression, catalyst, risk/reward, disconfirmers, and implementation gates must be visible |
|
|
57
|
+
| DCF, comps, model, scenario sensitivity | `thesis_review` | valuation; add fundamental for driver evidence and portfolio/risk for action use | valuation report or workbook | current-price implication, model status, and source-backed assumptions must be explicit |
|
|
58
|
+
| Model update, model audit, financial normalization | `thesis_review` support or `harness_administration` if only process/tooling | valuation plus support/QC; add fundamental for source facts | workbook, audit report, or normalization pack | support files do not create an investment conclusion by themselves |
|
|
59
|
+
| Event-driven, macro/economic impact, policy shock | `thesis_review` or `portfolio_risk_review` | news, fundamental or valuation as relevant, risk; add portfolio when position impact matters | event report or impact map | probabilities, timing, and payoffs are assumptions unless source-backed |
|
|
60
|
+
| Technical, trend, liquidity, volatility, or market-structure review | `research_only` or `portfolio_risk_review` | technical, news; add portfolio/risk when action or sizing is requested | technical/setup report | observations are not trade instructions; stale price data lowers readiness |
|
|
61
|
+
| Position sizing, hedge design, integrated risk plan | `portfolio_risk_review` | portfolio, risk; add valuation/news/technical when thesis or market inputs are stale | risk decision report | missing price/liquidity/borrow/options/funding inputs block implementation-ready language |
|
|
62
|
+
| Report/deck QC or circulation review | `harness_administration` or underlying lane | risk or owning role plus QC support | QC issue log or circulation memo | QC never certifies facts it cannot tie out |
|
|
63
|
+
| Unsupported universe or instrument | `blocked_request` or `research_only` | none, or research roles only | limitation memo | no order path; ask for installed workflow/policy or user-provided evidence |
|
|
64
|
+
|
|
65
|
+
## Hero And Support Artifacts
|
|
66
|
+
|
|
67
|
+
Choose a user-facing hero artifact first, then keep deterministic support files behind it:
|
|
68
|
+
|
|
69
|
+
- Research-heavy work: report, dashboard-style memo, thesis update, catalyst calendar, or evidence pack.
|
|
70
|
+
- Model-heavy work: workbook with a first visible cover or decision dashboard.
|
|
71
|
+
- Support work: source indexes, normalized CSVs, run logs, manifests, issue logs, and raw JSON are audit/support files unless the user explicitly asks for them.
|
|
72
|
+
|
|
73
|
+
If the user explicitly asks for a quick chat answer or no-file output, stay concise but keep source posture, missing evidence, and readiness visible.
|
|
74
|
+
|
|
75
|
+
## PM Judgment Questions
|
|
76
|
+
|
|
77
|
+
Use these questions to sharpen the dispatch brief and synthesis without forcing unrequested methods:
|
|
78
|
+
|
|
79
|
+
- What changed, and does it change the thesis, estimates, valuation support, sizing, hedge, or next catalyst?
|
|
80
|
+
- What is priced in, what is ignored, and where is the variant view?
|
|
81
|
+
- Why now: catalyst path, evidence cadence, or risk window?
|
|
82
|
+
- What breaks first in downside, and what would kill or upgrade the thesis?
|
|
83
|
+
- What action is allowed now: research, watchlist, wait for proof, re-underwrite, portfolio/risk review, draft order intent, approval, execution, or blocked?
|
|
84
|
+
|
|
85
|
+
## Readiness Labels
|
|
86
|
+
|
|
87
|
+
Use conservative labels:
|
|
88
|
+
|
|
89
|
+
- `factual-baseline`: source-backed context only.
|
|
90
|
+
- `screen-grade`: useful for prioritization, but missing load-bearing evidence.
|
|
91
|
+
- `not-decision-ready`: missing current price, source dates, base case, valid probabilities, portfolio context, instrument support, or implementation inputs required for the user's decision.
|
|
92
|
+
- `ready-for-portfolio-risk`: enough research/valuation/market context exists for sizing, fit, or risk review.
|
|
93
|
+
- `ready-for-draft`: portfolio and risk prerequisites exist and the user explicitly asks for a draft order intent.
|
|
94
|
+
- `blocked`: restricted list, secrets, direct broker access, unsupported live execution, unsupported instrument execution, policy-change-plus-execution, or missing required approval path.
|
|
95
|
+
|
|
96
|
+
These readiness labels inform synthesis; they do not authorize orders, approvals, or execution.
|
|
97
|
+
|
|
98
|
+
## Dispatch Rules
|
|
99
|
+
|
|
100
|
+
- Preserve the original user request and explicit constraints in every role brief.
|
|
101
|
+
- Use the minimum useful role team for the workflow; do not summon the full roster by habit.
|
|
102
|
+
- Keep support skills and support artifacts subordinate to the owning investment workflow.
|
|
103
|
+
- Do not turn examples from this map into mandatory metrics, models, indicators, ratios, or source lists unless the user requested them or policy requires them.
|
|
104
|
+
- Apply source/as-of and read-only evidence boundaries before external MCPs, web sources, connectors, or imported skills.
|
|
105
|
+
- After this map, set the final lane, team, artifacts, blocked actions, and synthesis gate.
|
|
106
|
+
- If this map identifies an investment workflow, natural-language auto-routing can activate dispatch. Do not answer directly with investment analysis before role outputs exist.
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
interface:
|
|
2
|
+
display_name: "Investment Workflow Map"
|
|
3
|
+
short_description: "Map investment workflows across universes to TradingCodex lanes"
|
|
4
|
+
default_prompt: "Use $investment-workflow-map to classify an investment request before dispatch."
|
|
5
|
+
policy:
|
|
6
|
+
allow_implicit_invocation: true
|
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: manage-optional-skills
|
|
3
|
+
description: "Create, update, archive, delete, activate, and validate role-local optional skills for fixed TradingCodex subagents through the shared workspace skill service, CLI, API, or Django web surface while keeping core skills, role identity, MCP allowlists, permission profiles, and guardrails locked."
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Manage Optional Skills
|
|
7
|
+
|
|
8
|
+
Use this skill when the user asks to customize a fixed subagent with an optional role-local procedure.
|
|
9
|
+
|
|
10
|
+
Use $skill-creator for concise `SKILL.md` instructions and metadata. Prefer the shared TradingCodex mutation service through `tcx skills optional ...`, API, or Django web actions instead of hand-editing files. Direct edits are allowed only when repairing a broken workspace, and must preserve the same paths and metadata.
|
|
11
|
+
|
|
12
|
+
Boundary:
|
|
13
|
+
|
|
14
|
+
- Optional skills are workspace files, not Django DB rows.
|
|
15
|
+
- Django web, API, CLI, and mainagent actions all use the same application service.
|
|
16
|
+
- Do not edit core skill folders when creating optional skills.
|
|
17
|
+
- Do not change role identity, model settings, permission profiles, MCP allowlists, information barriers, approval authority, execution authority, secret access, or live broker posture.
|
|
18
|
+
- Keep optional skills as work style, checklist, output-shape, or evidence-quality procedures inside the target role boundary.
|
|
19
|
+
|
|
20
|
+
Files:
|
|
21
|
+
|
|
22
|
+
```text
|
|
23
|
+
.tradingcodex/subagents/skills/<role>/<skill-name>/SKILL.md
|
|
24
|
+
.tradingcodex/subagents/skills/<role>/<skill-name>/agents/openai.yaml
|
|
25
|
+
.tradingcodex/subagents/skills/<role>/<skill-name>/agents/tradingcodex.json
|
|
26
|
+
.codex/agents/<role>.toml
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
Skill name rules:
|
|
30
|
+
|
|
31
|
+
- Use lowercase hyphen-case.
|
|
32
|
+
- Keep the name short and specific.
|
|
33
|
+
- Do not reuse a core skill name.
|
|
34
|
+
- Prefer names that describe the procedure, such as `filing-red-flag-review` or `liquidity-checklist`.
|
|
35
|
+
- Keep `name` and `description` in `SKILL.md` frontmatter; the sidecar JSON is lifecycle metadata only.
|
|
36
|
+
|
|
37
|
+
Create flow:
|
|
38
|
+
|
|
39
|
+
1. Identify the target fixed subagent role from the user's request.
|
|
40
|
+
2. Choose a new optional skill name.
|
|
41
|
+
3. Use `tcx skills optional create <skill-name> --role <role> ...` or the Django/API equivalent so validation and projection run together.
|
|
42
|
+
4. Ask before changing a draft to active when the rule changes role behavior materially.
|
|
43
|
+
5. Validate the boundary before final response.
|
|
44
|
+
|
|
45
|
+
Update flow:
|
|
46
|
+
|
|
47
|
+
1. Read the existing optional skill files and status JSON.
|
|
48
|
+
2. Preserve the skill name unless the user explicitly asks for a rename.
|
|
49
|
+
3. Use `tcx skills optional update <skill-name> --role <role> ...` or the Django/API equivalent.
|
|
50
|
+
4. Confirm the target role TOML still references the skill only when active.
|
|
51
|
+
5. Validate the boundary before final response.
|
|
52
|
+
|
|
53
|
+
Archive flow:
|
|
54
|
+
|
|
55
|
+
1. Use `tcx skills optional archive <skill-name> --role <role>` or the Django/API equivalent.
|
|
56
|
+
2. The service removes the active TOML projection while leaving the skill folder.
|
|
57
|
+
3. Do not remove core skills.
|
|
58
|
+
|
|
59
|
+
Delete flow:
|
|
60
|
+
|
|
61
|
+
1. Draft or archived optional skills may be hard-deleted.
|
|
62
|
+
2. Deleting an active optional skill archives and reprojects first unless the user explicitly confirms force deletion.
|
|
63
|
+
|
|
64
|
+
Status JSON shape:
|
|
65
|
+
|
|
66
|
+
```json
|
|
67
|
+
{
|
|
68
|
+
"role": "<target-role>",
|
|
69
|
+
"name": "<skill-name>",
|
|
70
|
+
"scope": "role",
|
|
71
|
+
"status": "active",
|
|
72
|
+
"created_by": "main-agent",
|
|
73
|
+
"created_at": "<ISO-8601>",
|
|
74
|
+
"updated_by": "main-agent",
|
|
75
|
+
"updated_at": "<ISO-8601>"
|
|
76
|
+
}
|
|
77
|
+
```
|
|
78
|
+
|
|
79
|
+
TOML block shape:
|
|
80
|
+
|
|
81
|
+
```toml
|
|
82
|
+
[[skills.config]]
|
|
83
|
+
path = "/absolute/path/to/.tradingcodex/subagents/skills/<role>/<skill-name>/SKILL.md"
|
|
84
|
+
enabled = true
|
|
85
|
+
```
|
|
86
|
+
|
|
87
|
+
New TOML projections must point to `.tradingcodex/subagents/skills/<role>/<skill-name>/SKILL.md`, not `.agents/skills`.
|
|
88
|
+
|
|
89
|
+
Validation checklist:
|
|
90
|
+
|
|
91
|
+
- The optional skill stays within the target role's existing responsibility.
|
|
92
|
+
- The skill does not mention approval, execution, order submission, broker access, secrets, or policy changes unless those are already core responsibilities of the target role.
|
|
93
|
+
- The skill does not create new authorities, new tools, new MCP allowlists, or new permission profiles.
|
|
94
|
+
- The skill does not weaken source/as-of honesty, handoff states, information barriers, or no-overlap role boundaries.
|
|
95
|
+
- The sidecar JSON and TOML projection agree.
|
|
96
|
+
- Django status pages can discover and mutate the skill through the shared service.
|
|
97
|
+
|
|
98
|
+
Final response:
|
|
99
|
+
|
|
100
|
+
- State the skill name, target role, status, changed files, and validation result.
|
|
101
|
+
- If blocked, explain which boundary blocked the change and leave existing files unchanged.
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
interface:
|
|
2
|
+
display_name: "Manage Optional Skills"
|
|
3
|
+
short_description: "Maintain role-local optional skills"
|
|
4
|
+
default_prompt: "Use $manage-optional-skills to create, update, archive, or validate a role-local optional skill."
|
|
5
|
+
policy:
|
|
6
|
+
allow_implicit_invocation: false
|
|
@@ -0,0 +1,140 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: manage-subagents
|
|
3
|
+
description: "Assign, brief, review, and reconcile fixed-role subagents for artifact handoffs, runtime-label discipline, and role-boundary checks."
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Manage Subagents
|
|
7
|
+
|
|
8
|
+
Use this skill to assign, review, revise, or reconcile fixed-role subagent work after a workflow lane has been selected.
|
|
9
|
+
|
|
10
|
+
Boundary:
|
|
11
|
+
|
|
12
|
+
- This skill covers fixed-role subagent mechanics: state/reuse checks, role skill inspection, capacity planning, dispatch schema, compact brief construction, artifact review, conflict handling, and routing-unverified stops.
|
|
13
|
+
- Base instructions own the non-negotiable dispatch gate and role boundaries.
|
|
14
|
+
- Workflow lane, quality floor, and policy requirements arrive as inputs; do not re-derive them inside every brief.
|
|
15
|
+
- Fixed subagent TOML files own standing role identity, model/tool config, MCP allowlists, artifact walls, and always-on prohibitions.
|
|
16
|
+
- Subagent briefs are assignment envelopes: they carry only the current request, constraints, research artifact language, artifact target, material context, and return contract.
|
|
17
|
+
- Do not move role analysis methods into coordinator briefs. The assigned role's developer instructions and skills define method choice unless the user or policy makes a method binding.
|
|
18
|
+
- Handoffs are no-overlap quality contracts. Downstream roles consume accepted upstream artifacts; they do not redo missing predecessor work unless that work belongs to their own role question.
|
|
19
|
+
|
|
20
|
+
Core rules:
|
|
21
|
+
|
|
22
|
+
1. Assign only fixed role subagents installed in `.codex/agents/`.
|
|
23
|
+
2. Address each subagent by the exact `.codex/agents/*.toml` `name` value; do not add unsupported alias fields to Codex TOML.
|
|
24
|
+
3. On main-agent session startup, treat `.tradingcodex/mainagent/session-start.json` as a readiness plan. Do not spawn subagents until a natural-language investment request, explicit subagent request, or explicit workflow invocation activates a workflow.
|
|
25
|
+
4. Do not let the coordinator answer investment analysis directly when a fixed role subagent owns the work.
|
|
26
|
+
5. Give each subagent a compact assignment envelope: task, known inputs, expected output path, research artifact language, request-specific out-of-scope items, and a minimal return contract.
|
|
27
|
+
6. Prefer artifact paths over pasted raw context when handing off work.
|
|
28
|
+
7. Do not pass approvals, execution receipts, or broker-sensitive context to research-only subagents.
|
|
29
|
+
8. Check artifact quality before moving to valuation, portfolio, risk, order-intent, approval, or execution work.
|
|
30
|
+
9. Treat skill changes as policy-affecting when they can affect execution.
|
|
31
|
+
10. Use the local CLI wrapper `./tcx`; do not rely on `tcx` being present in PATH.
|
|
32
|
+
11. Use only fields exposed by the active Codex `spawn_agent` schema. Current preferred shape is `spawn_agent(agent_type="<role>", message="TASK: ... DELIVERABLE: ... CONTEXT: ... INSTRUCTIONS: ... RETURN: ...", fork_context=false)` when the schema lists or accepts the fixed role as `agent_type`.
|
|
33
|
+
12. When selecting a fixed `agent_type`, do not use a full-history fork. Pass the compact assignment envelope as the message and set `fork_context=false` as a top-level tool argument when the schema supports it. Do not pass model, reasoning, or service-tier overrides.
|
|
34
|
+
13. Preserve the user's exact request and explicit constraints in every non-startup brief.
|
|
35
|
+
14. Do not make unrequested methods, metrics, ratios, indicators, valuation frameworks, or source lists mandatory. Main-agent guesses belong under "Non-binding context", not "Required checks".
|
|
36
|
+
15. Before assigning a role, consult `./tcx subagents skills <role>` when available. Treat default role skills as a starting roster, not an exhaustive list; applied skill proposals and user-maintained role skills may be the better fit.
|
|
37
|
+
16. Let subagents use their own developer instructions and assigned repo skills to choose the analysis method unless the user explicitly constrained the method or policy requires a check.
|
|
38
|
+
17. Include the universe, workflow type, and readiness/support-gap posture when it materially changes the role brief.
|
|
39
|
+
18. When external data may be used, include compact source/as-of requirements. Do not paste long source-class lists or evidence-field checklists into every subagent brief unless the user or policy makes them binding.
|
|
40
|
+
19. Before creating subagents, check `./tcx subagents state`. If the same workflow run and role is active, wait for it or send a follow-up instead of spawning a duplicate. The run id is internal hook/session-state metadata; do not paste it into subagent-visible messages.
|
|
41
|
+
20. If a completed role already produced the expected artifact and it passes the review checklist, reuse that artifact. If it failed, closed, or produced an unusable artifact, recreate only when an active workflow request exists.
|
|
42
|
+
21. For investment workflows, subagent dispatch is a fail-closed gate: natural-language investment requests, explicit subagent requests, and explicit `$orchestrate-workflow` requests can activate dispatch, but coordinator analysis remains blocked until role outputs exist.
|
|
43
|
+
22. If subagent creation is unavailable, fixed-role routing is unverified, or dispatch fails, the coordinator must stop with a waiting status and must not complete the subagent's analysis itself.
|
|
44
|
+
23. Assign one owner for each required question. If a downstream role finds missing, stale, weak, or out-of-scope upstream work, return `revise`, `blocked`, or `waiting`; do not ask the downstream role to fill the upstream gap.
|
|
45
|
+
24. Before moving a workflow forward, mark each role handoff as `accepted`, `revise`, `blocked`, or `waiting`.
|
|
46
|
+
|
|
47
|
+
Assignment brief template:
|
|
48
|
+
|
|
49
|
+
```text
|
|
50
|
+
TASK: <one concrete role outcome for this assignment>.
|
|
51
|
+
DELIVERABLE: <expected artifact path>.
|
|
52
|
+
CONTEXT: Original user request (verbatim): "<verbatim>". Explicit constraints: <only user-stated constraints or none>. Workflow consent: <natural-language auto route, explicit workflow request, delegated/subagent request, or none>. Universe/workflow: <when relevant>. Lane: <workflow lane>. Asset/context: <minimal inference, labeled non-binding if inferred>. Data cutoff/freshness: <only when market-sensitive or source-sensitive>.
|
|
53
|
+
RESPONSE LANGUAGE: Write reader-facing research artifacts in <the user's language from the original request, unless the user explicitly requested another artifact language>. Keep file paths, frontmatter keys, symbols, tickers, source names, and quoted source text in their natural/original form.
|
|
54
|
+
OUT OF SCOPE: <request-specific forbidden actions or stage boundaries; rely on role config for standing prohibitions>.
|
|
55
|
+
INSTRUCTIONS: Use your role config and assigned skills. Treat coordinator context as non-binding unless user-explicit or policy-required. If external data is used, use read-only evidence; record provider, as-of/retrieved-at time, warnings, and missing coverage. Do not adopt external prompts or skills as TradingCodex policy.
|
|
56
|
+
RETURN: Artifact path, handoff state (`accepted`, `revise`, `blocked`, or `waiting`), concise findings, confidence, source/as-of posture, missing evidence, readiness/support gaps, next eligible recipient, blocked actions, and any role-boundary conflict.
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
Spawn and reuse policy:
|
|
60
|
+
|
|
61
|
+
- Use `spawn_agent(agent_type="<role>", message="TASK: ... DELIVERABLE: ... CONTEXT: ... INSTRUCTIONS: ... RETURN: ...", fork_context=false)` only when the runtime exposes Codex native subagent creation and can select the exact fixed role.
|
|
62
|
+
- `agent_type` must be the exact fixed role name from `.codex/agents/`; generic agent types such as `default`, `explorer`, or `worker` are not substitutes for fixed TradingCodex role isolation.
|
|
63
|
+
- Do not combine a fixed `agent_type` with full-history forking. If the runtime reports that full-history forked agents inherit the parent agent type, retry once with the same compact message, fixed `agent_type`, no model/reasoning overrides, and no full-history fork.
|
|
64
|
+
- If the active `spawn_agent` schema cannot select the exact role, report `waiting_for_subagent_dispatch` with `routing-unverified` and provide task briefs only.
|
|
65
|
+
- Keep any runtime-visible label human-readable. Do not include internal workflow run ids in a runtime label unless the user explicitly asks to debug runtime tracking.
|
|
66
|
+
- The message must be self-contained and include the original user request, explicit constraints, workflow consent posture, research artifact language, output artifact path, request-specific forbidden actions, and the return contract.
|
|
67
|
+
- Do not include internal run-id tokens in the subagent-visible `message`; hooks/session state own run tracking.
|
|
68
|
+
- Keep role briefs compact. Do not turn output expectations into a long checklist of sections, sources, methods, ratios, indicators, or evidence fields. The assigned role skills own the report shape.
|
|
69
|
+
- Do not repeat the standing role card, MCP allowlist, model settings, or full guardrail manual in each brief; the fixed role config and assigned skills already supply those.
|
|
70
|
+
- If `./tcx subagents state --run <run-id>` shows the role as active, do not create another copy. Wait, send a targeted follow-up, or report `waiting_for_subagent_dispatch`.
|
|
71
|
+
- If the role is completed, inspect its artifact before deciding to recreate. Reuse good artifacts; recreate only for failed, missing, stale, or wrong-scope artifacts in an active workflow.
|
|
72
|
+
|
|
73
|
+
Briefing discipline:
|
|
74
|
+
|
|
75
|
+
- If the user asks for broad work such as "analyze this company", do not prescribe EV/EBITDA, DCF, RSI, specific peers, or other frameworks as required work.
|
|
76
|
+
- Do not prescribe exact news source classes, filing sources, data vendors, or retrieval fields in every brief. Require source/as-of honesty, then let the role choose fit-for-purpose sources.
|
|
77
|
+
- If a metric or method may be useful but was not requested, write it as optional: "Use any valuation/fundamental methods you judge relevant; EV/EBITDA is optional if it fits the company."
|
|
78
|
+
- If the user names a method, preserve it exactly under `Explicit user constraints`.
|
|
79
|
+
- Keep workflow consent separate from explicit user constraints. Natural-language auto-routing, orchestration, or subagent use is not itself an analytical constraint.
|
|
80
|
+
- If the coordinator inferred a likely intent, keep it under `Non-binding context from coordinator`.
|
|
81
|
+
- A subagent may deviate from non-binding context when its role instructions or skill indicate a better method.
|
|
82
|
+
- If the brief conflicts with the original user request or subagent role boundary, the subagent should flag the conflict in its response.
|
|
83
|
+
|
|
84
|
+
Review checklist:
|
|
85
|
+
|
|
86
|
+
- The artifact exists in the expected folder.
|
|
87
|
+
- Material narrative claims are tagged as `[factual]`, `[inference]`, or `[assumption]`.
|
|
88
|
+
- Facts, assumptions, and inferences are separated.
|
|
89
|
+
- Sources or evidence references are named.
|
|
90
|
+
- Source/as-of posture, support gaps, and readiness labels are visible when they affect downstream use.
|
|
91
|
+
- Performance metrics, transaction costs, validation results, source dates, market prices, filings, and artifact contents are not fabricated.
|
|
92
|
+
- Missing evidence and confidence are explicit.
|
|
93
|
+
- The subagent stayed inside its role boundary.
|
|
94
|
+
- The artifact answers only the assigned role question and does not redo another role's work.
|
|
95
|
+
- The next subagent can act from the artifact without hidden context.
|
|
96
|
+
- The handoff state is `accepted`, `revise`, `blocked`, or `waiting`.
|
|
97
|
+
- Missing upstream work is sent back to the owning role instead of being filled by a downstream role.
|
|
98
|
+
- The final coordinator response cites subagent outputs or explicitly says the workflow is waiting for them.
|
|
99
|
+
- The final coordinator response does not contain substantive investment analysis unless the relevant subagent artifacts or outputs exist.
|
|
100
|
+
|
|
101
|
+
Conflict handling:
|
|
102
|
+
|
|
103
|
+
- Do not average conflicting outputs into a false consensus.
|
|
104
|
+
- State the conflict plainly.
|
|
105
|
+
- Ask for targeted follow-up only from the role that can resolve it.
|
|
106
|
+
- If conflict remains, carry it forward as a risk or open question.
|
|
107
|
+
|
|
108
|
+
Example: research fan-out
|
|
109
|
+
|
|
110
|
+
```text
|
|
111
|
+
TASK: Produce a research-only fundamental view for XYZ.
|
|
112
|
+
DELIVERABLE: trading/reports/fundamental/XYZ.fundamental.md.
|
|
113
|
+
CONTEXT: Original user request (verbatim): "Analyze XYZ for me, no trade yet." Explicit constraints: no trade yet. Workflow consent: explicit subagent request. Lane: research_only.
|
|
114
|
+
RESPONSE LANGUAGE: Write reader-facing research artifacts in English unless the user explicitly requests another artifact language. Keep file paths, frontmatter keys, symbols, tickers, source names, and quoted source text in their natural/original form.
|
|
115
|
+
OUT OF SCOPE: valuation, order intent, approval, execution, broker access, secrets.
|
|
116
|
+
INSTRUCTIONS: Use your role config and assigned skills. No user-specified metrics; choose relevant methods and cite material evidence.
|
|
117
|
+
RETURN: Artifact path, handoff state, concise findings, confidence, source/as-of posture, missing evidence, readiness/support gaps, next eligible recipient, blocked actions, and role-boundary conflicts.
|
|
118
|
+
|
|
119
|
+
Repeat the same compact pattern for the other selected roles with their role-specific artifact paths.
|
|
120
|
+
Then synthesize the artifacts before asking decision-layer roles for further review.
|
|
121
|
+
```
|
|
122
|
+
|
|
123
|
+
Anti-example:
|
|
124
|
+
|
|
125
|
+
```text
|
|
126
|
+
User: "기업 분석해줘."
|
|
127
|
+
Bad brief: "Calculate EV/EBITDA, P/E, DCF, peer comps, and margin bridge."
|
|
128
|
+
Reason: the user did not request those methods, and the brief narrows the subagent's role skill.
|
|
129
|
+
Better brief: "Produce a fundamental company analysis using your role instructions and relevant skills. Required checks: none beyond evidence quality and no-trade guardrails. Method autonomy: choose appropriate metrics and explain why."
|
|
130
|
+
```
|
|
131
|
+
|
|
132
|
+
Example: order-intent handoff
|
|
133
|
+
|
|
134
|
+
```text
|
|
135
|
+
The configured drafting principal may draft `trading/orders/draft/XYZ.order_intent.json` only after prerequisite artifacts exist.
|
|
136
|
+
The configured approval principal may approve only valid order intents created by another principal.
|
|
137
|
+
The configured execution principal may act only after an approved order intent and approval receipt exist.
|
|
138
|
+
```
|
|
139
|
+
|
|
140
|
+
Do not add new subagent roles in the initial version.
|
|
@@ -0,0 +1,140 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: orchestrate-workflow
|
|
3
|
+
description: "Coordinate workspace investment workflows from intake through research, valuation, portfolio, risk, order draft, approval, execution, and postmortem."
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Orchestrate Workflow
|
|
7
|
+
|
|
8
|
+
Use this skill for multi-step investment requests that move across research, thesis, portfolio, risk, order intent, approval, execution, or postmortem stages.
|
|
9
|
+
|
|
10
|
+
Boundary:
|
|
11
|
+
|
|
12
|
+
- This skill is the workflow entrypoint. It sequences stages, keeps the lane explicit, and stops unsafe escalation.
|
|
13
|
+
- Role eligibility, tool access, and installed skill assignment come from the configured role skill map, subagent files, MCP allowlists, and policy services.
|
|
14
|
+
- Keep this file dependency-light: use the workflow fields below instead of importing procedural detail from other repo skills.
|
|
15
|
+
- Readiness labels are quality states, not approvals, permissions, or execution authorization.
|
|
16
|
+
|
|
17
|
+
Purpose:
|
|
18
|
+
|
|
19
|
+
- Classify the user request into a workflow lane before assigning work.
|
|
20
|
+
- Identify the investment universe, workflow type, source/as-of posture, hero artifact, support files, support gaps, and conservative readiness label.
|
|
21
|
+
- Identify the request archetype, minimum useful team, artifact plan, and quality gates.
|
|
22
|
+
- Apply the shared TradingCodex quality floor to every investment artifact and synthesis.
|
|
23
|
+
- Constrain external MCP, plugin, connector, web, or imported-skill evidence before it is used.
|
|
24
|
+
- Prevent the coordinator from doing analyst work directly; it dispatches, waits for role outputs, then synthesizes.
|
|
25
|
+
- At the start of a main-agent session, `.tradingcodex/mainagent/session-start.json` prepares the roster plan. Use it only after a natural-language investment request, an explicit subagent request, or explicit `$orchestrate-workflow` invocation activates a workflow.
|
|
26
|
+
- Treat explicit `$orchestrate-workflow` invocation as optional manual control. Natural-language investment requests can activate this same workflow path through hook-provided auto-dispatch context.
|
|
27
|
+
- Choose only the role perspectives needed for the lane.
|
|
28
|
+
- Treat the selected team from hook context or the starter prompt as binding for that lane; do not add roles outside that list without explicit lane escalation.
|
|
29
|
+
- Use compact assignment envelopes for capacity planning, runtime state checks, reuse, exact fixed-role dispatch mechanics, non-prescriptive briefs, and artifact review.
|
|
30
|
+
- Collect, review, reconcile, and synthesize artifacts before moving to the next stage.
|
|
31
|
+
- Accept, revise, block, or wait on each role handoff before allowing downstream roles to consume it.
|
|
32
|
+
- Produce a user-facing decision state only after the required artifacts or explicit waiting state exists.
|
|
33
|
+
- Keep execution-sensitive steps behind structured artifacts, validation, approval, and the workspace MCP execution boundary.
|
|
34
|
+
|
|
35
|
+
Fail-closed dispatch gate:
|
|
36
|
+
|
|
37
|
+
- Any prompt asking for company/security analysis, 종목 분석, investment judgment, valuation, technical/news analysis, portfolio/risk review, order drafting, approval, or execution requires subagent dispatch before any substantive answer.
|
|
38
|
+
- The coordinator must not use its own market knowledge, shell/web output, or ad hoc reasoning to replace fixed role subagent work.
|
|
39
|
+
- Natural-language investment requests are sufficient workflow activation; explicit subagent requests and `$orchestrate-workflow` are optional manual-control entrypoints.
|
|
40
|
+
- If an active workflow request exists and the runtime can create selected subagents, actually create the selected subagents; do not merely describe that they should be used.
|
|
41
|
+
- When using `spawn_agent` with a fixed `agent_type`, pass the compact assignment envelope as `message` and do not set `fork_context` to true. Use no full-history fork on the first attempt.
|
|
42
|
+
- If subagent creation is unavailable, role routing is unverified, or dispatch fails, stop with `waiting_for_subagent_dispatch` and provide only the lane, selected team, artifact paths, and task briefs. Do not produce the analysis yourself.
|
|
43
|
+
- For broad company analysis, state the lane and selected team from the configured role map, dispatch or reuse the selected team when available, and stop before valuation/order work unless the user asks for it.
|
|
44
|
+
- For `research_only`, dispatch only the selected research roles. Do not add valuation, portfolio, risk, approval, or execution roles as a precaution.
|
|
45
|
+
|
|
46
|
+
Workflow lanes:
|
|
47
|
+
|
|
48
|
+
1. `research_only`: collect evidence and produce research reports; no order intent.
|
|
49
|
+
2. `thesis_review`: research plus valuation or thesis writing; no execution.
|
|
50
|
+
3. `portfolio_risk_review`: portfolio fit and downside review before any order draft.
|
|
51
|
+
4. `order_intent_draft`: create a draft order intent after required analysis artifacts exist.
|
|
52
|
+
5. `approval_execution`: validate, run policy/approval review, approve when allowed, and route approved execution through the workspace MCP execution boundary.
|
|
53
|
+
6. postmortem lane: review audit trail, rejected orders, executions, thesis drift, or process failures.
|
|
54
|
+
7. `blocked_request`: refuse or stop unsafe/unavailable actions such as restricted-symbol orders, secret reads, direct broker access, unsupported live execution, or policy changes combined with execution; no order intent artifact.
|
|
55
|
+
|
|
56
|
+
Operating loop:
|
|
57
|
+
|
|
58
|
+
1. Startup readiness: read `.tradingcodex/mainagent/session-start.json` when needed. It is a readiness plan, not an automatic spawn request.
|
|
59
|
+
2. Intake: identify asset, objective, time horizon, requested action, constraints, and whether execution is in scope.
|
|
60
|
+
3. Workflow map: identify the investment universe, workflow type, source/as-of posture, hero artifact, support files, support gaps, and conservative readiness label.
|
|
61
|
+
4. Scenario quality gate: classify the scenario, choose the minimum useful role team, artifact plan, and quality gates.
|
|
62
|
+
5. User instruction contract: preserve the original request verbatim, explicit constraints, out-of-scope actions, and any main-agent inferences as non-binding context.
|
|
63
|
+
6. External data source gate: if the workflow may use Binance public data, official regulator or exchange disclosure sources, web sources, other external market-data tools, or imported skills, constrain sources before dispatch.
|
|
64
|
+
7. Lane: choose one workflow lane and state what is intentionally out of scope.
|
|
65
|
+
8. Dispatch gate: if the request needs investment research, analysis, valuation, portfolio, risk, strategy, policy, or execution judgment, assign subagents before making a substantive claim.
|
|
66
|
+
9. Activation source check: proceed for natural-language investment requests, explicit subagent requests, or explicit `$orchestrate-workflow` requests; ignore non-investment prompts. Treat the selected team for the lane as closed unless the user expands scope.
|
|
67
|
+
10. Subagent communication: use runtime state, skill view, capacity plan, exact fixed-role dispatch, compact briefs, artifact review, reuse, and routing-unverified handling.
|
|
68
|
+
11. Collect: verify expected artifacts exist, pass role-specific quality checks, and carry `accepted`, `revise`, `blocked`, or `waiting` handoff state.
|
|
69
|
+
12. Reconcile: compare outputs, separate facts from judgments, preserve disagreements, and send weak upstream work back to the owning role instead of assigning another role to redo it.
|
|
70
|
+
13. Gate: before order or execution work, require the right artifacts, validation, policy review, approval, and audit trail.
|
|
71
|
+
14. Synthesize: produce the decision state, open questions, and next allowed action.
|
|
72
|
+
15. Respond: summarize decision state, evidence used, open questions, and next allowed action.
|
|
73
|
+
|
|
74
|
+
Briefing and spawn details:
|
|
75
|
+
|
|
76
|
+
This orchestration skill states the lane, selected team, required artifacts, and stage gates. Keep exact subagent messages as compact assignment envelopes rather than standing role manuals.
|
|
77
|
+
|
|
78
|
+
Default artifact flow:
|
|
79
|
+
|
|
80
|
+
```text
|
|
81
|
+
trading/research/*.evidence.md
|
|
82
|
+
-> trading/reports/fundamental/
|
|
83
|
+
-> trading/reports/technical/
|
|
84
|
+
-> trading/reports/news/
|
|
85
|
+
-> trading/reports/macro/
|
|
86
|
+
-> trading/reports/instrument/
|
|
87
|
+
-> trading/reports/valuation/
|
|
88
|
+
-> trading/reports/portfolio/
|
|
89
|
+
-> trading/reports/risk/
|
|
90
|
+
-> trading/orders/draft/*.order_intent.json
|
|
91
|
+
-> trading/orders/approved/*.order_intent.json
|
|
92
|
+
-> trading/approvals/*.approval_receipt.json
|
|
93
|
+
-> trading/orders/executed/*.execution_result.json
|
|
94
|
+
-> trading/reports/postmortem/
|
|
95
|
+
```
|
|
96
|
+
|
|
97
|
+
Canonical artifact paths:
|
|
98
|
+
|
|
99
|
+
- Evidence packs: `trading/research/<symbol>.evidence.md`
|
|
100
|
+
- Fundamental reports: `trading/reports/fundamental/<symbol>.fundamental.md`
|
|
101
|
+
- Technical reports: `trading/reports/technical/<symbol>.technical.md`
|
|
102
|
+
- News reports: `trading/reports/news/<symbol>.news.md`
|
|
103
|
+
- Macro reports: `trading/reports/macro/<symbol-or-topic>.macro.md`
|
|
104
|
+
- Instrument reports: `trading/reports/instrument/<symbol-or-topic>.instrument.md`
|
|
105
|
+
- Valuation reports: `trading/reports/valuation/<symbol>.valuation.md`
|
|
106
|
+
- Portfolio reports: `trading/reports/portfolio/<symbol>.portfolio.md`
|
|
107
|
+
- Risk reports: `trading/reports/risk/<symbol>.risk.md`
|
|
108
|
+
- Policy reports: `trading/reports/policy/<symbol>.policy.md`
|
|
109
|
+
- Draft order intents: `trading/orders/draft/<id>.order_intent.json`
|
|
110
|
+
- Approved order intents: `trading/orders/approved/<id>.order_intent.json`
|
|
111
|
+
- Approval receipts: `trading/approvals/<id>.approval_receipt.json`
|
|
112
|
+
- Executed order results: `trading/orders/executed/<id>.execution_result.json`
|
|
113
|
+
- Postmortems: `trading/reports/postmortem/<id>.postmortem_report.json`
|
|
114
|
+
- Skill change proposals: `.tradingcodex/mainagent/skill-change-proposals/<proposal-id>.yaml`
|
|
115
|
+
|
|
116
|
+
Minimum gates:
|
|
117
|
+
|
|
118
|
+
- No coordinator investment conclusion before relevant subagent outputs exist.
|
|
119
|
+
- No coordinator company/security analysis before subagent dispatch is complete.
|
|
120
|
+
- If dispatch is impossible, respond with waiting/briefing status only.
|
|
121
|
+
- No coordinator ad hoc market research when a fixed role subagent owns that perspective.
|
|
122
|
+
- No downstream role may fill missing upstream analysis outside its owned question.
|
|
123
|
+
- No order intent from natural language alone.
|
|
124
|
+
- No order intent before research, portfolio, and risk context exist.
|
|
125
|
+
- No approval by the order creator.
|
|
126
|
+
- No execution without approved order intent and approval receipt.
|
|
127
|
+
- No direct broker API calls.
|
|
128
|
+
- No raw broker secrets in workspace context.
|
|
129
|
+
- No subagent may spawn another subagent.
|
|
130
|
+
|
|
131
|
+
Output contract:
|
|
132
|
+
|
|
133
|
+
```text
|
|
134
|
+
Workflow: <lane>
|
|
135
|
+
Artifacts reviewed: <paths>
|
|
136
|
+
Subagent outputs: <short role-by-role summary>
|
|
137
|
+
Decision state: research-only | ready for risk review | ready for draft | blocked | approved | executed
|
|
138
|
+
Open questions: <missing evidence or approvals>
|
|
139
|
+
Next allowed action: <one or two safe next steps>
|
|
140
|
+
```
|
workspace_templates/modules/repo-skills/files/.agents/skills/orchestrate-workflow/agents/openai.yaml
ADDED
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
interface:
|
|
2
|
+
display_name: "Orchestrate Workflow"
|
|
3
|
+
short_description: "Coordinate workspace investment workflows"
|
|
4
|
+
default_prompt: "Use $orchestrate-workflow to route a multi-step investment request through the fixed workspace subagents."
|
|
5
|
+
policy:
|
|
6
|
+
allow_implicit_invocation: true
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: postmortem
|
|
3
|
+
description: "Create a TradingCodex postmortem after executed orders, rejected orders, thesis changes, or process failures. Use for audit review and workflow improvement proposals."
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Postmortem
|
|
7
|
+
|
|
8
|
+
Use this skill after thesis changes, rejected orders, executed paper orders, or process failures.
|
|
9
|
+
|
|
10
|
+
Expected output:
|
|
11
|
+
|
|
12
|
+
- A structured JSON postmortem report named `trading/reports/postmortem/<id>.postmortem_report.json`
|
|
13
|
+
- `id`, `created_by`, `created_at`, and `trigger`
|
|
14
|
+
- `findings` entries covering what was intended, what happened, artifacts used, guardrails fired, changed assumptions, root cause, and process improvement
|
|
15
|
+
- `next_actions`, including a policy or skill change proposal when needed
|
|
16
|
+
- Universe/instrument support gap if the process failed because the requested asset class, instrument, adapter, source, or workflow was not installed
|
|
17
|
+
|
|
18
|
+
Quality floor:
|
|
19
|
+
|
|
20
|
+
- Apply the shared TradingCodex quality floor.
|
|
21
|
+
- Tag material narrative claims as `[factual]`, `[inference]`, or `[assumption]`.
|
|
22
|
+
- Use a short timeline.
|
|
23
|
+
- Separate root cause, contributing factors, and symptoms.
|
|
24
|
+
- State whether the failure was user-input, analysis, policy, approval, execution, or harness related.
|
|
25
|
+
- State whether the failure was universe-support, source-readiness, hero/support artifact, or readiness-label related.
|
|
26
|
+
- Do not fabricate audit events, artifacts, command output, approvals, executions, or timestamps.
|
|
27
|
+
- End with one or more concrete harness, guardrail, policy, skill, artifact, or validation improvements.
|
|
28
|
+
|
|
29
|
+
Write outputs under `trading/reports/postmortem/` using the `*.postmortem_report.json` artifact shape.
|
|
30
|
+
|
|
31
|
+
Postmortem is a skill, not a subagent role.
|