market-skills
AGENTS.md3 starsChanged 4 months agoMITView on GitHub
Every skill's --json mode emits the canonical AXI envelope (ADR-0004, docs/AXI-REFERENCE.md): The lib.py contracts (L1Result, L2Result, L3Result, L3Idea, RegimeSignal, RiskVerdict, FillConfirmation, Intent) are unchanged — the envelope wraps them at the scripts/run.py boundary. TOON ships as opt-in behind --toon; the default is indent-2 JSON. - docs/adr/ holds dated architecture decision records. Read the index at docs/adr/README.md before proposing new abstractions, refactors, or new shared modules — past "we considered X, chose not to" decisions live there. When you make a…
Where files are headingNew AGENTS.md files have more rules about keeping secrets out of the code, and fewer about code style.
Of the AGENTS.md files we read, the 31,542 first seen in the last six months, against the older ones: the kind of rule that gained most share, and the kind that lost most. About files like this in general, not this one, and an estimate, since a kind is a pattern in the words.
In this repository47 other files it gives its agents.
- beadsSkill
- backtest-engineSkill
- backtest-pipelineSkill
- backtest-trend-minerSkill
- bug-scanSkill
- daily-trade-pickSkill
- execution-kraken-perpsSkill
- execution-kraken-spotSkill
- l3-conviction-scanSkill
- market-accumulationSkill
- market-basisSkill
- market-breadthSkill
- market-breakoutSkill
- market-emaSkill
- market-exhaustionSkill
- market-fibonacciSkill
- market-liquidity-sweepSkill
- market-macdSkill
- market-macroSkill
- market-moversSkill
- market-notesSkill
- market-overviewSkill
- market-rsiSkill
- market-snapshotSkill
- market-squeezeSkill
- market-s-rSkill
- market-stateSkill
- market-trend-qualitySkill
- market-trendSkill
- market-valuationSkill
- market-volatilitySkill
- market-volumeSkill
- market-watchlistSkill
- portfolio-mgmtSkill
- position-watchdogSkill
- risk-engineSkill
- run-all-l2Skill
- run-all-l3Skill
- run-watchlistSkill
- strategy-accumulation-swingSkill
- strategy-breakout-confirmSkill
- strategy-exhaustion-fadeSkill
- strategy-fitness-heatmapSkill
- strategy-funding-carrySkill
- strategy-liquidity-sweepSkill
- strategy-mean-reversionSkill
- strategy-trend-followSkill
The file
We split this AGENTS.md into the rules it gives an agent
5 rules. About 0 are common, 1 is distinctive, and 4 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.
4
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 15
Every skill's --json mode emits the canonical AXI envelope (ADR-0004, docs/AXI-REFERENCE.md):
- Very specific: line 40
docs/adr/holds dated architecture decision records: Read the index at docs/adr/README.md before proposing new abstractions, refactors, … - Very specific: line 75
Never use l as a variable name — ambiguous with 1, triggers E741.
- Distinctive: line 85
No hardcoded paths to private repos.
- Very specific: line 86
Don't create __pycache__/, .venv/, .ruff_cache/, .pytest_cache/, *.egg-info/, dist/ — already in .gitignore.
≈ “Common” is an estimate: at least 1 in 5 of the 40,246 AGENTS.md 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.
Files
Market Skills — Agent Guide
Setup & verification
uv sync # install deps + dev
uv run ruff check # lint (py312, line-length 120, rules E/F/I/N/W/UP)
uv run ruff format # auto-format (double quotes)
uv run pytest tests/ # all tests
uv run pytest tests/test_X.py -v # single fileOutput conventions (AXI envelope)
Every skill's --json mode emits the canonical AXI envelope
(ADR-0004,
docs/AXI-REFERENCE.md):
{"data": <payload>, "count": N, "errors": [], "help": ["..."]}| Helper | Source | Use |
envelope(data, *, count, help, errors, fields) | analysis.output | Construct the envelope |
emit_envelope_json(data, ...) | analysis.output | Print the envelope to stdout |
project_fields(d, fields) | analysis.output | --fields= projection |
truncate(text, limit, hint) | analysis.output | Narrative / thesis capping |
empty_state(help, errors) | analysis.output | AXI principle 5 zero result |
render_home_view(skill_name) | analysis.output | No-arg mode dashboard |
write_state_cache(skill_name, payload) | analysis.output | Home-view state store |
The lib.py contracts (L1Result, L2Result, L3Result, L3Idea,
RegimeSignal, RiskVerdict, FillConfirmation, Intent) are
unchanged — the envelope wraps them at the scripts/run.py boundary.
TOON ships as opt-in behind --toon; the default is indent-2 JSON.
Architecture
docs/adr/holds dated architecture decision records. Read the index atdocs/adr/README.mdbefore proposing new abstractions, refactors, or new shared modules — past "we considered X, chose not to" decisions live there. When you make a new design decision, add a new ADR with the next number (0004-...), link it from the index, and reference it fromARCHITECTURE.mdif it's load-bearing. ADRs are append-only; to reverse one, write a new ADR withStatus: supersedes NNNN.ARCHITECTURE.mdis the descriptive "what the system is" doc; ADRs are the "why we built it this way" record.- L1/L2/L3 skills. L1 = pure-math indicators (
skills/market-*/lib.py, no I/O). L2 = pattern detectors that compose L1s and return{pattern, signals, input_scores, narrative}. L3 = strategies that compose L2s and return{ideas, narrative}— each idea carriesversion: "v1".."v5"viaconviction_version()and is validated byvalidate_l3_tp_ladder()before return. Read each skill'sSKILL.mdfor CLI flags andWhen to use / NOT to useboundaries. - Batch runners (
run-all-l2,run-all-l3,run-watchlist): fetch candles once per ticker, then run all skills in-process. analysis/registry.py— single source of truth for L2/L3 skill lists (l2_skills(),l3_strategies()). New skills go here once and all runners pick them up.analysis/skill_loader.py—load_skill(name)for cross-skill loads;load_lib_for_script(__file__)is what everyscripts/run.pyuses for its ownlib.py. Never reimplement theimportlib.util.spec_from_file_locationdance inline.analysis/contracts.py— TypedDict return shapes plus sanity helpersl2_fired(),l2_classification(),validate_l3_tp_ladder(),conviction_version().l2_fired()/l2_classification()are the single read site for "did the L2 actually fire?" — never inlinepattern.get("classification").analysis/risk/— advisoryvet(intent, ctx, *, policies=None).is_perps_intent(intent)+select_policies(intent, ...)pick the right set (spot: position size / drawdown / per-tier / daily budget / insufficient funds / per-pair cooldown; perps: leverage cap / liquidation distance / stop distance / funding drag / duplicate position). Pure function. Worst-case aggregation; SCALE picks min suggested_volume.analysis/providers/data/—ProviderProtocol +hl:/yf:/kraken:/ CCXT adapters. Registry onanalysis/data.py. Auto-detect order is pinned bytests/test_data.py::TestProviderRegistryOrder.analysis/providers/execution/—ExecutionProviderProtocol +Intent/FillConfirmationTypedDicts + Kraken spot/perps adapters. TheIntent/FillConfirmationcontracts are shared by Risk and Execution.analysis/macro/vsanalysis/chop.py— Macro fetches external cross-asset state (F&G, VIX, DXY, US10Y, BTC.D, total mcap) into aRegimeSignal. Chop reads the rolling L3 idea history into achop_score(conviction-calibration indicator). Different signals that share a name prefix in the L3 envelope.analysis/andportfolio/are installable packages (pyproject.toml→packages.find = {include = ["analysis*", "portfolio*"]}).uv syncmakesfrom analysis.X import Ywork everywhere — nosys.pathhacks.- Per-user data (
market-watchlist,market-notes,position-watchdog,portfolio-mgmt) lives underskills/<name>/data/(gitignored); samples ship underskills/<name>/examples/. CLI flag wins over env var, env var wins over default.
LLM is the agent brain
This repo does NOT own a Python orchestrator that auto-pipes signals to execution. The LLM agent reads SKILL.md, calls skills as tools, narrates, asks the user to confirm, and (with explicit approval) calls execution-kraken-spot or execution-kraken-perps. Cron is analytics-only (run-all-l3, position-watchdog).
Safety invariant: execution-kraken-spot submit / execution-kraken-perps submit always prompts for confirmation unless --yes is passed. That prompt is the safety layer — never bypassed silently. The LLM owns intent_id uniqueness within a session (--cl-ord-id plumbs the id to the venue for retry dedup).
Failure-mode contract: before narrating a
RiskVerdict, handling aFillConfirmation, recording a partial fill, or generating anintent_id, consultLLM-ORCHESTRATION.mdfor the per-status workflow and the things-you-must-NEVER list.
Conventions
- All
scripts/run.pyaccept--jsonfor machine output, require a ticker as first positional argument, and--source=<provider>. - Ruff:
skills/*/scripts/run.pyonly ignore E501 (long display f-strings). No E402 —analysis.skill_loader.load_lib_for_script(__file__)replaced thesys.path.insertdance. - Provider notation:
provider:ticker(e.g.hl:LIT,yf:AAPL,kraken:BTCUSD). - Never use
las a variable name — ambiguous with1, triggers E741. - No backward compatibility. When you change a public name, signature, or path, update every caller in the same commit. Do not add re-export shims, deprecation aliases, or
*_legacymodules. The repo is consumed by an LLM that reads freshSKILL.mdon every call — there is no installed-base to protect. - Bundle post-hoc fixups into the original commit. A
docs:orfix:patch that lands immediately after afeat:commit and only touches what that commit introduced belongs in the original commit, not as a follow-up. Hold the follow-up only when (a) it's independent of the original or (b) there's enough material for a real standalone change. Avoid the "feat + immediate docs fixup" two-step.
Per-fix test fixtures are required
Every fix: commit must include a test case in tests/test_<area>.py that reproduces the exact shape that triggered the bug. The test must fail on the pre-fix code and pass on the post-fix code. A fix: commit without a fixture is incomplete — follow up with a test: commit that adds the missing one.
What to avoid
- No hardcoded paths to private repos.
- Don't create
__pycache__/,.venv/,.ruff_cache/,.pytest_cache/,*.egg-info/,dist/— already in.gitignore. - No references to local filesystem structures in library code. Comments, docstrings, and
SKILL.mdfiles must only describe code that could ship to a fresh open-source consumer. Never mention host-specific paths (absolute paths under any user's home, profile-specific dirs, personal config files, paths to any particular machine's filesystem) in library code, docs, commit messages, or TODOs. Document only the env var / API contract, not the resolved path on any particular machine. **When the env var is unset, raise — don't fall back to a host-specific default. - Never commit SPEC/ or BUGS files. Planning artifacts (SPECS/*.md, BUGS, BUGS.md) are session-only and must never be included in a commit. Keep them untracked or add to .gitignore if needed.**
<!-- BEGIN BEADS INTEGRATION v:1 profile:minimal hash:970c3bf2 -->Beads Issue Tracker
This project uses bd (beads) for ALL issue tracking — no markdown TODOs, no TodoWrite/TaskCreate, no external trackers. Issues live in a local Dolt DB; sync uses bd dolt push/pull (refs/dolt/data on the git remote); .beads/issues.jsonl is a passive export, not the wire protocol.
Run bd prime before any beads work and before ending a session — it is the SSOT for commands, the session-close protocol and the git policy (commit/push only when explicitly authorized).
bd prime # full workflow context (SSOT)
bd ready # unblocked work
bd create "title" -t task -p 2 # new issue
bd update <id> --claim # claim atomically
bd close <id> # complete
bd dolt push # sync when authorized<!-- END BEADS INTEGRATION -->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
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.

