agentleFS
austin-starksaustin-starks/Public-Portfolio-Challenge/skills/deploy-gate/SKILL.md

deploy-gate

Skill82 starsChanged 3 months agoMITView on GitHub

The GATED deploy + cleanup flow for a NexusTrade live book — clone the finalist, preview a delta reconcile, stage UNAPPROVED orders, verify fills. Use ONLY after the human explicitly says \"deploy + clean up\" and names a finalist. Covers the clone-before-reconcile ordering, the single-tick reconcile expectation, stale-pending-order hygiene, the signal-freshness gate, and why you can never approve orders yourself. Nothing here runs during certification.

1 other project uses a version of this.

Adopted by

Most recently taken up by

The file

We split this skill into the rules it gives an agent

3 rules. About 0 are common, 1 is distinctive, and 2 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈1

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 2

    Very specific

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

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

    Stale pending orders FIRST: Check the live book for pending/Pending User Approval → Canceled orders — they block new staging.

    line 27
  2. Very specific:

    Default mode: "delta". Only use "liquidate_all" if the human explicitly asks for a clean cost-basis reset.

    line 57
  3. Distinctive:

    Never run this without an explicit go for that specific finalist.

    line 59

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

Deploy Gate (Stage E — GATED)

Nothing deploys and no orders are placed until the human explicitly says "deploy + clean up" and names the specific finalist. This skill only runs then. Goal: make the live positions equal a fresh deploy of the chosen finalist today via delta trades (don't round-trip overlaps).

Pre-deploy gates (hard)

  1. Signal-freshness gate. A finalist whose alt-data series does not extend to the present with a working refresh path may NOT deploy, whatever its cert says — a stale rank series is a dead book.
  2. Stale pending orders FIRST. Check the live book for pending/Pending User Approval → Canceled orders — they block new staging. Surface them; the human cancels in the UI. Note automaticOrderApproval state (default: leave as-is unless told to flip it at deploy).

The five steps

  1. Clone the finalist onto the live book FIRST — clone_strategies_to_portfolio (source = finalist, target = live book), then field-verify the clone. This IS the "deploy": it sets the live book's strategies that the next step reconciles against. reconcile_portfolio_to_strategy has no strategy_source arg — it reconciles the live book against its own strategies, so the clone must happen first. If the finalist is the already-deployed live book unchanged, no clone is needed — say so.
  2. Reconcile preview — reconcile_portfolio_to_strategy({ portfolio_id: "<live>", mode: "delta" }). Preview-only — it never places orders. Returns target, current, orders (already in create_orders shape), estimated cost, realized P&L, and wash-sale flags. Expect a single-tick target — the live strategy accretes the rest over daily rebalances. Say so; don't re-diagnose it as a bug.
  3. Show the human the preview and get explicit approval. Sanity-check: orders touch only the delta (overlaps untouched), costs sane, target == a fresh deploy, and — for a participation fix — the target spans multiple names, not just one.
  4. Stage the orders — create_orders({ portfolio_id: "<live>", orders: <the orders array from step 2> }). Staged UNAPPROVED; the tool never submits to the broker. The human approves them manually in the NexusTrade UI — there is no approval tool and you cannot approve them. Options auto-stage as LIMIT.
  5. Verify after fills — re-run the reconcile preview; the delta orders array should be ~empty. Report fills, any remainder, realized P&L, wash-sale flags, and the resulting live participation (distinct names held).

Rules

  • Default mode: "delta". Only use "liquidate_all" if the human explicitly asks for a clean cost-basis reset.
  • Never run this without an explicit go for that specific finalist.
  • Discover the live target via fetch_portfolios when it isn't already pinned in the run — never hardcode a live portfolio id you haven't confirmed by field/posture.
  • On sign-off, re-attach any weekly monitor agent the deploy expects.

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.