$npx -y skills add mphinance/alpha-skills --skill edge-candidate-agentGenerate and prioritize US equity long-side edge research tickets from EOD observations, then export pipeline-ready candidate specs for trade-strategy-pipeline Phase I. Use when users ask to turn hypotheses/anomalies into reproducible research tickets, convert validated ideas int
| 1 | # Edge Candidate Agent |
| 2 | |
| 3 | ## Overview |
| 4 | |
| 5 | Convert daily market observations into reproducible research tickets and Phase I-compatible candidate specs. |
| 6 | Prioritize signal quality and interface compatibility over aggressive strategy proliferation. |
| 7 | This skill can run end-to-end standalone, but in the split workflow it primarily serves the final export/validation stage. |
| 8 | |
| 9 | ## When to Use |
| 10 | |
| 11 | - Convert market observations, anomalies, or hypotheses into structured research tickets. |
| 12 | - Run daily auto-detection to discover new edge candidates from EOD OHLCV and optional hints. |
| 13 | - Export validated tickets as `strategy.yaml` + `metadata.json` for `trade-strategy-pipeline` Phase I. |
| 14 | - Run preflight compatibility checks for `edge-finder-candidate/v1` before pipeline execution. |
| 15 | |
| 16 | ## Prerequisites |
| 17 | |
| 18 | - Python 3.9+ with `PyYAML` installed. |
| 19 | - Access to the target `trade-strategy-pipeline` repository for schema/stage validation. |
| 20 | - `uv` available when running pipeline-managed validation via `--pipeline-root`. |
| 21 | |
| 22 | ## Output |
| 23 | |
| 24 | - `strategies/<candidate_id>/strategy.yaml`: Phase I-compatible strategy spec. |
| 25 | - `strategies/<candidate_id>/metadata.json`: provenance metadata including interface version and ticket context. |
| 26 | - Validation status from `scripts/validate_candidate.py` (pass/fail + reasons). |
| 27 | - Daily detection artifacts: |
| 28 | - `daily_report.md` |
| 29 | - `market_summary.json` |
| 30 | - `anomalies.json` |
| 31 | - `watchlist.csv` |
| 32 | - `tickets/exportable/*.yaml` |
| 33 | - `tickets/research_only/*.yaml` |
| 34 | |
| 35 | ## Position in Split Workflow |
| 36 | |
| 37 | Recommended split workflow: |
| 38 | |
| 39 | 1. `skills/edge-hint-extractor`: observations/news -> `hints.yaml` |
| 40 | 2. `skills/edge-concept-synthesizer`: tickets/hints -> `edge_concepts.yaml` |
| 41 | 3. `skills/edge-strategy-designer`: concepts -> `strategy_drafts` + exportable ticket YAML |
| 42 | 4. `skills/edge-candidate-agent` (this skill): export + validate for pipeline handoff |
| 43 | |
| 44 | ## Workflow |
| 45 | |
| 46 | 1. Run auto-detection from EOD OHLCV: |
| 47 | - `skills/edge-candidate-agent/scripts/auto_detect_candidates.py` |
| 48 | - Optional: `--hints` for human ideation input |
| 49 | - Optional: `--llm-ideas-cmd` for external LLM ideation loop |
| 50 | 2. Load the contract and mapping references: |
| 51 | - `references/pipeline_if_v1.md` |
| 52 | - `references/signal_mapping.md` |
| 53 | - `references/research_ticket_schema.md` |
| 54 | - `references/ideation_loop.md` |
| 55 | 3. Build or update a research ticket using `references/research_ticket_schema.md`. |
| 56 | 4. Export candidate artifacts with `skills/edge-candidate-agent/scripts/export_candidate.py`. |
| 57 | 5. Validate interface and Phase I constraints with `skills/edge-candidate-agent/scripts/validate_candidate.py`. |
| 58 | 6. Hand off candidate directory to `trade-strategy-pipeline` and run dry-run first. |
| 59 | |
| 60 | ## Quick Commands |
| 61 | |
| 62 | Daily auto-detection (with optional export/validation): |
| 63 | |
| 64 | ```bash |
| 65 | python3 skills/edge-candidate-agent/scripts/auto_detect_candidates.py \ |
| 66 | --ohlcv /path/to/ohlcv.parquet \ |
| 67 | --output-dir reports/edge_candidate_auto \ |
| 68 | --top-n 10 \ |
| 69 | --hints path/to/hints.yaml \ |
| 70 | --export-strategies-dir /path/to/trade-strategy-pipeline/strategies \ |
| 71 | --pipeline-root /path/to/trade-strategy-pipeline |
| 72 | ``` |
| 73 | |
| 74 | Create a candidate directory from a ticket: |
| 75 | |
| 76 | ```bash |
| 77 | python3 skills/edge-candidate-agent/scripts/export_candidate.py \ |
| 78 | --ticket path/to/ticket.yaml \ |
| 79 | --strategies-dir /path/to/trade-strategy-pipeline/strategies |
| 80 | ``` |
| 81 | |
| 82 | Validate interface contract only: |
| 83 | |
| 84 | ```bash |
| 85 | python3 skills/edge-candidate-agent/scripts/validate_candidate.py \ |
| 86 | --strategy /path/to/trade-strategy-pipeline/strategies/my_candidate_v1/strategy.yaml |
| 87 | ``` |
| 88 | |
| 89 | Validate both interface contract and pipeline schema/stage rules: |
| 90 | |
| 91 | ```bash |
| 92 | python3 skills/edge-candidate-agent/scripts/validate_candidate.py \ |
| 93 | --strategy /path/to/trade-strategy-pipeline/strategies/my_candidate_v1/strategy.yaml \ |
| 94 | --pipeline-root /path/to/trade-strategy-pipeline \ |
| 95 | --stage phase1 |
| 96 | ``` |
| 97 | |
| 98 | ## Export Rules |
| 99 | |
| 100 | - Keep `validation.method: full_sample`. |
| 101 | - Keep `validation.oos_ratio` omitted or `null`. |
| 102 | - Export only supported entry families for v1: |
| 103 | - `pivot_breakout` with `vcp_detection` |
| 104 | - `gap_up_continuation` with `gap_up_detection` |
| 105 | - Mark unsupported hypothesis families as research-only in ticket notes, not as export candidates. |
| 106 | |
| 107 | ## Guardrails |
| 108 | |
| 109 | - Reject candidates that violate schema bounds (risk, exits, empty conditions). |
| 110 | - Reject candidate when folder name and `id` mismatch. |
| 111 | - Require deterministic metadata with `interface_version: edge-finder-candidate/v1`. |
| 112 | - Use `--dry-run` in pipeline before full execution. |
| 113 | |
| 114 | ## Resources |
| 115 | |
| 116 | ### `skills/edge-candidate-agent/scripts/export_candidate.py` |
| 117 | Generate `strategies/<candidate |