Skip to content
SkillScript-led2,959 tokens in use

Pre-Trade Discipline Gate

An offline Python checklist that tests a planned manual entry against plan, stop, size, revenge-risk, regime and circuit-breaker rules and journals a GO, NO_GO or REVIEW_REQUIRED decision.

7,428 stars on the repository MIT Licensetradermonty/claude-trading-skills · skills/pre-trade-discipline-gate

Skill label

measured from its files

What installing Pre-Trade Discipline Gate costs

51tokens idle
2,959tokens in use
5,221tokens, up to

Idle is what sits in context while the skill is installed. In use is its instructions, loaded when it runs. Up to adds the files its instructions link. Counts are approximate, made offline with cl100k_base.

Model dependence Script-led

Script-ledMixedModel-led

Most of this skill is scripts, so it behaves much the same whichever model runs it.

This describes the skill's structure, how much of it is scripts. It does not say how well it works. Scripts: scripts/approved_rules.py, scripts/check_pre_trade_discipline.py, scripts/manage_approved_rules.py, scripts/review_rule_experiment.py.

Touches

shelldetectednetworkdetectedwrites filesdetected

Declared tags come from the skill's frontmatter; detected ones from its scripts, its code blocks and the commands it names in inline code. This is detected, not audited.

How it scores

Quality

How well the skill is written, counted from its own files: its frontmatter, its steps, examples, stated output and constraints, its size and whether every file it ships is one it names.How we score it →
Good
  • Frontmatter8/15
  • Structure25/25
  • Examples9/15
  • Output10/15
  • Size15/15
  • Resources12/15

Security

Starts at 100 and loses points for each thing in the skill's files that a reader should look at first.How we score it →
Good
  • Runs shell commands−5

    does this on the machine, and the frontmatter does not say so

    SKILL.md, line 61
  • Writes files−8

    does this on the machine, and the frontmatter does not say so

    scripts/approved_rules.py, line 237
  • Reaches the network−10

    does this on the machine, and the frontmatter does not say so

    scripts/manage_approved_rules.py, line 38

Repository health

Pre-computed score based on development activity, maintenance, community, maturity, and trend momentum.How we score it →
Good
  • Development activity100
  • Maintenance52
  • Community68
  • Maturity36
  • Momentum40

Pre-Trade Discipline Gate reads a local JSON or YAML checklist of candidate entries and decides whether each planned manual order should proceed. It checks that the entry is in a written plan, the stop is predefined, the size is within plan and actual risk does not exceed planned risk. It also reads optional exposure, circuit-breaker and trader-memory artifacts.

It never places or cancels orders and never calls a broker or fetches market data. It writes a decision report and an optional journal row, and can carry a ledger of approved operating rules that each need a recorded acknowledgement.

What You Get

  • A pre_trade_discipline_decision JSON report with GO, REVIEW_REQUIRED, NO_GO or NO_ACTIONABLE_ORDERS
  • A matching Markdown report unless JSON only is requested
  • A JSONL journal row recording the checklist answers used for the decision
  • A link from the report back to the related thesis in trader-memory-core
  • An approved-rules ledger with activate, list, extend, retire, restore and supersede commands

Common Use Cases

  • Checking a planned entry against its written plan just before opening the broker
  • Blocking new entries during a post-loss cooldown window
  • Making checklist adherence visible in later monthly reviews
  • Running an exit-code gate in a shell pipeline with the fail-on-non-go option

What Makes It Unique

It is built for discipline and fails closed. Bad risk numbers, missing artifacts or an unreadable rules ledger all lead to REVIEW_REQUIRED, which sends the trader back to review before any order. The approved-rules feature lists each applicable rule and requires an acknowledgement, and it states that the acknowledgement is recorded and not verified. A two-week rule experiment script reviews one rule over 14 New York calendar days using the trader’s own observations.

Under The Hood

Claude runs Python scripts from the shell. The scripts read the answers file, optional JSON decision files from sibling skills and thesis state folders, then write the decision reports, journal rows and the approved-rules ledger as local files, with the ledger written atomically. They call no broker API and no web service. Reports can be linked into thesis files through the trader-memory-core link function, which leaves review dates alone. Everything uses the Python standard library and stays on your machine.

Join founders building with open source

Opinionated takes, migration guides, cost-saving tips, and insights from the open source ecosystem.

Subscribe on SubstackJoin 750+ subscribers