agentleFS
lucaswychanlucaswychan/quant-paper-agent/.agents/skills/strategy-translate/SKILL.md

strategy-translate

Skill0 starsChanged 3 months agoMITView on GitHub

Translate an immutable quantitative replication with a replicated or partially replicated verdict into framework-specific event-driven research or paper-trading code with trace equivalence and failure-mode tests. Use after a finalized run and benchmark exist and an import-probed framework contract defines events, APIs, positions, contracts, risk, persistence, testing, and clock semantics. A direct bounded translation request authorizes local execution without a second acceptance prompt.

The file

We split this skill into the rules it gives an agent

9 rules. About 0 are common, 6 are distinctive, and 3 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈6

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 3

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    Create review.json conforming to references/review.schema.json.

    line 37
  2. Distinctive:

    Keep signal logic, portfolio intent, execution, sizing, persistence, and risk checks separate.

    line 40
  3. Very specific:

    Use size_contracts only for conservative single-position conversion.

    line 41
  4. Distinctive:

    All machine-readable inputs and outputs are checked against their bundled current JSON Schemas.

    line 67
  5. Distinctive:

    Do not translate an unauthorized, changed, or unfinalized benchmark.

    line 71
  6. Distinctive:

    Do not infer framework APIs from examples.

    line 73
  7. Distinctive:

    Do not treat one-day or NAV-only agreement as equivalence.

    line 74
  8. Very specific:

    Use only research or paper_trading deployment mode.

    line 75
  9. Distinctive:

    Keep credentials, connectivity, live deployment, and operational authorization outside this skill.

    line 76

≈ “Common” is an estimate: at least 1 in 5 of the 364,980 skill 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.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Strategy translate

Translate a validated research implementation. Never claim generated code is production-ready or authorize live trading.

Preconditions

Resolve the absolute workspace root and this skill's directory. Require:

  • a valid finalized run_manifest.json;
  • a replicated or partially replicated benchmark and a framework contract authorized by the direct request or explicit acceptance;
  • workspace-root frameworks/<framework-id>/spec.json conforming to references/framework_spec.md and references/framework_spec.schema.json;
  • successful structural, installed-version, and declared API probes;
  • an unchanged vectorized run, benchmark, and framework specification.

Validate the framework contract and record hash-bound request authorization:

QPA_TRANSLATE_SKILL_DIR="/absolute/path/to/strategy-translate"
QPA_WORKSPACE_ROOT="/absolute/path/to/workspace"
python3 "$QPA_TRANSLATE_SKILL_DIR/scripts/check_spec.py" \
  "$QPA_WORKSPACE_ROOT/frameworks/<framework-id>/spec.json"
python3 "$QPA_TRANSLATE_SKILL_DIR/scripts/record_acceptance.py" \
  <paper-id> <run-id> <framework-id> --root "$QPA_WORKSPACE_ROOT/papers" \
  --expected-benchmark-sha256 <sha> --expected-run-manifest-sha256 <sha> \
  --expected-framework-spec-sha256 <sha> --confirm-user-accepted

For a direct translation request, replace --confirm-user-accepted with --confirm-translation-request and continue without presenting hashes. When invoked by $quant-paper, use --workflow-request <absolute-workflow.json>; the recorder verifies that translation is authorized and binds the workflow ID and request hash. Retain --confirm-user-accepted for separately reviewed handoffs.

Workflow

  1. Create review.json conforming to references/review.schema.json; bind it to acceptance, declare per-field equivalence tolerances, and map every required failure-mode scenario to an exact unittest ID.
  2. Map observation, signal, decision, submission, fill, position update, P&L recognition, rebalance, session, and restart semantics explicitly.
  3. Translate rolling state, pending orders, fills, positions, capital, contract metadata, and duplicate/out-of-order event handling.
  4. Keep signal logic, portfolio intent, execution, sizing, persistence, and risk checks separate.
  5. Use size_contracts only for conservative single-position conversion; enforce portfolio margin, limits, fees, reserved capital, and framework risk APIs separately.
  6. Generate:
strategy/<framework-id>/
├── strategy.py
├── sizing.py
├── review.json
├── traces/{vectorized.json,event_driven.json}
├── equivalence_report.json
├── test_report.json
├── tests/{test_equivalence.py,test_sizing.py,test_event_ordering.py}
└── translation_manifest.json

Required validation

Replay a representative multi-day window through both implementations. Record signals, target and filled positions, turnover, costs, P&L, and NAV using references/trace.schema.json, then run:

python3 "$QPA_TRANSLATE_SKILL_DIR/scripts/compare_traces.py" <paper-id> <run-id> <framework-id> --root "$QPA_WORKSPACE_ROOT/papers"
python3 "$QPA_TRANSLATE_SKILL_DIR/scripts/run_translation_tests.py" <paper-id> <run-id> <framework-id> --root "$QPA_WORKSPACE_ROOT/papers"
python3 "$QPA_TRANSLATE_SKILL_DIR/scripts/finalize_translation.py" <paper-id> <run-id> <framework-id> --root "$QPA_WORKSPACE_ROOT/papers"

Tests must cover partial fills, rejections, duplicates/out-of-order bars, missing bars, sessions, rolls where applicable, restart/restoration, actual risk APIs, and sizing. All machine-readable inputs and outputs are checked against their bundled current JSON Schemas. Finalization also rechecks lineage against the current review, traces, strategy, and tests.

Rules

  • Do not translate an unauthorized, changed, or unfinalized benchmark.
  • Reject not replicated and inconclusive verdicts; a new conversational approval does not override this scientific eligibility rule.
  • Do not infer framework APIs from examples; probe installed authoritative contracts.
  • Do not treat one-day or NAV-only agreement as equivalence.
  • Use only research or paper_trading deployment mode.
  • Keep credentials, connectivity, live deployment, and operational authorization outside this skill.

Download now (ZIP)

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
What did you use it for? e.g. Reviewing pull requests in a Rails app

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.