my-skills
CLAUDE.md1 starsChanged 3 months agoMITView on GitHub
A portable Agent Skills repo, not an application. Skills follow the open SKILL.md spec (https://agentskills.io/specification) so they work across compatible agents and are installable via npx skills add. There is no build, no lint, and no test suite. Nothing compiles. Changes are verified by running the skills' scripts directly (see below). Skills live at skills/<skill-name>/SKILL.md, with optional siblings: references/ (on-demand docs), scripts/ (helper executables), assets/ (templates and data). docs/solutions/ holds documented solutions to past problems — bugs, conventions, workflow fixes…
- Reads credentials
- Commits and pushes
In this repository4 other files it gives its agents.
- ai-industry-weeklySkill
- ai-pullback-dailySkill
- daily-risk-monitorSkill
- rust-best-practicesSkill
The file
We split this CLAUDE.md into the rules it gives an agent
11 rules. About 0 are common, 2 are distinctive, and 9 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈2
Distinctive · estimate
This author's own choices. Worth a look.
9
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 25
Every SKILL.md starts with frontmatter in this shape — match it when adding a skill:
- Very specific: line 269
All three daily scripts that need the weekly install (industry_table.py, technicals.py, perp_quotes.py) resolve it through one shared …
- Very specific: line 295
Do not resolve this coupling by copying the table into ai-pullback-daily.
- Very specific: line 300
Only *sibling-skill location* has been pulled into _weekly.py.
- Very specific: line 318
Treat these as fourteen and six separate implementations: a fix to path scrubbing (the public-repo leak rule below) is an N-place edit, and …
- Distinctive: line 379
The order is fixed and written down: Not chosen at call time, not "whichever answers first".
- Distinctive: line 440
Every prohibition in the text branch is also a field: If the human output says "do not divide these two", the JSON says so too.
- Very specific: line 478
Treat it the way the two TH threshold dicts are treated: a change to the common envelope is a two-place edit.
- Very specific: line 532
SKILL.mdnames the capability, never the mechanism: Keep the repo's existing neutral wording (WebSearch / web_fetch, a Slack MCP server, … - Very specific: line 716
When touching write, prove assets/baseline.md is byte-identical after a rejected write (md5 before and after) — a partially written …
- Very specific: line 729
All three notifying skills (ai-industry-weekly, ai-pullback-daily, daily-risk-monitor) read that single name, and a new skill that pushes …
≈ “Common” is an estimate: at least 1 in 5 of the 12,729 CLAUDE.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
CLAUDE.md
This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
What this repo is
A portable Agent Skills repo, not an application. Skills follow the open
SKILL.md spec (https://agentskills.io/specification) so they work across
compatible agents and are installable via npx skills add.
There is no build, no lint, and no test suite. Nothing compiles. Changes are verified by running the skills' scripts directly (see below).
Layout and conventions
Skills live at skills/<skill-name>/SKILL.md, with optional siblings:
references/ (on-demand docs), scripts/ (helper executables), assets/
(templates and data).
docs/solutions/ holds documented solutions to past problems — bugs,
conventions, workflow fixes — organized by category, each carrying YAML
frontmatter (module, tags, problem_type) so they can be searched.
Relevant when implementing or debugging in an area one of them covers.
Every SKILL.md starts with frontmatter in this shape — match it when adding a
skill:
name: <dir name, must match>
description: <written so an agent auto-invokes it; pack in trigger words>
license: MIT
compatibility: <runtime requirements, or "no script/package/network requirements">
metadata:
author: BigtoC
version: "0.1.0"
tags: "comma,separated"
triggers: "optional glob hints"README.md has a skills table that must gain a row when a skill is added.
.claude/settings.json holds a PreToolUse hook that nudges toward the
rust-best-practices skill on .rs edits. Adding a similar hook is the
documented way to force auto-invocation regardless of context.
Skills
rust-best-practices — pure documentation, no runtime.
ai-industry-weekly — a weekly equity-research routine with scripts and
persistent state. Most of what follows concerns it.
ai-pullback-daily — a daily routine over the same universe, answering
when to buy rather than what. It runs every calendar day (weekends and US
market holidays included): thesis tripwires, 24/7 perp implied moves, and a
four-layer neocloud credit read update daily; per-ticker T1/T2/T3 technicals
update only on complete trading days and are carried forward, clearly labelled,
otherwise. Its references/*.md are verbatim migrations from the same kind of
private source document and carry the same edit-only-what-you-must rule.
scripts/neocloud_credit_monitor.py owns tripwire ④ outright — the report
quotes its verdict and never second-guesses it.
Its thresholds live in a TH dict — but there are two of them, with different key names, so a recalibration cannot be copy-pasted between them; one in
neocloud_credit_monitor.py and one in neocloud_credit_lite.py (the
standard-library cloud variant). They must stay in sync: a recalibration is a
two-place edit, and the two scripts silently disagreeing about tripwire ④
is the worst failure this skill has, because whichever one ran that day is what
the report quotes as fact. TH also carries rules the reference tables do not
spell out — L1_primary_window_days = 30 caps how long a primary-market
repricing counts toward L1 — so changing one has to be reflected in
references/neocloud-credit.md too.
daily-risk-monitor — a daily cross-market risk sweep (macro/credit, positioning,
crypto, an anti-emotion layer, long-run valuation) feeding 7 hard sell thresholds
and a two-track decision layer. It is standalone: no sibling-skill dependency,
its own scripts, its own state file. Its references/*.md are verbatim migrations
from a private source document and carry the same edit-only-what-you-must rule.
Three things about it are load-bearing and easy to erode:
Fetching is split so each source can be run and debugged alone. Every fetch lives in its own standalone script. Standalone invocation is the requirement; the language is not. The real constraints are per-host headers, and they are language-independent (all measured 2026-09-05 on this machine):
host rule evidence FRED never send a browser User-Agent Chrome UA → 25–30s ReadTimeout, from curl and requests. curl-like orrequests' default UA → HTTP 200 in ~0.5sYahoo always send one a bare requests.Sessiongets throttled (market.py「多半是 Yahoo 限流挡了裸 Session」);stock_perp.py「Yahoo chart 端点本机实测稳定回」 records a stable 429 from the chart endpointCNN F&G needs full browser UA + Referer + Origin otherwise HTTP 418 「I'm a teapot. You're a bot.」 These do not conflict at the language level — only per-host, which one program handles with per-host headers.
stock_perp.pyalready straddles both (Hyperliquid JSON + FRED CSV).An earlier version of this bullet claimed "FRED must use curl (python
requeststimes out in this environment)". That is false:requestsreturns FRED in 0.50s versus curl's 1.16s. The failing transport is stdliburllib, which hitsCERTIFICATE_VERIFY_FAILEDagainst FRED, multpl.com and CNN alike — this environment's Python has no CA bundle wired to the system store, so it is not a yfinance-specific fault.urllib+certifiworks (0.48s). Do not restore the old claim; it misdirects anyone debugging FRED.What the language choice does turn on is dependencies:
fred.shandcape.shneed only bash + curl + awk and no Python packages at all. Porting those two would trade a satisfied dependency forrequests— a portability loss for a repo whose purpose is portable skills. Keep them shell. Concurrency is not a reason to port either:curl --parallelwith-w '%{url_effective} %{http_code}'fetches six FRED series in 1.08s versus 3.26s serial and keeps per-URL status attribution, so the ⚪️ per-series accounting andfred.sh's three-way ordering invariant survive with the reduction loop staying serial in the parent.assets/last_run.jsonis the day-over-day baseline.snapshot.py writerewrites it each run with every signal's tier plus both track readings, and it lands before the Slack push so a failed push cannot lose the tiers. Reading Slack history is only the fallback path when the file is absent — the skill must stay usable with no Slack at all.- Missing data is never quietly safe.
⚪️ 数据暂缺counts toward neither the numerator nor the denominator of the 7-threshold tally, and every one of them must carry a staleness figure in weeks. Signals 3 (BofA Bull & Bear) and 12 (insider buy/sell) have no stable source yet are thresholds 6 and 7, so a fabricated number there moves the strategic position baseline directly.
It shares no code with ai-pullback-daily even though both read Hyperliquid's
xyz pool — each keeps its own fetcher, and they must not be merged.
fetch_all.sh owns the ten fetch invocations — and why they left SKILL.md
Step 1.1 used to be a ~20-line block pasted into one Bash call: a bg() function
definition, mkdir + rm -f "$RUN"/*.json, and ten ( … ) & background
subshells. It is now one command, scripts/fetch_all.sh launch, with join
and list beside it. The ten argv lines and their rationale live in that
script and nowhere else — SKILL.md does not restate them, because two copies
of the unit list is the two-TH-dicts trap moved to the scheduling layer.
The reason it had to move is a host rule that no configuration can reach, and it
is worth writing down because it is invisible from the docs. Claude Code parses
the command string the agent types, not the script it runs. Verified by
reading the shipped binary (~/.local/share/claude/versions/2.1.274, 2026-09-17):
- A command whose AST contains a real background operator — a
&node whose parent is not abinary_expression, so&&and2>&1are excluded — is forced tobehavior: "ask"withcircuitBreaker: "backgroundOperator"andclassifierApprovable: false, after rule matching has already returnedallow. So nopermissions.allowentry can ever cover it, and the dialog drops the "don't ask again" row (suppressAlwaysAllowRule). Its registry entry isbypassImmune: false, so bypass-permissions mode does skip it — which is why this is invisible locally and fires in the cloud container. - The sibling breaker
dangerousRemoval(glob/variablermtargets) isbypassImmune: true— that one asks even in bypass mode. - The only escape is
sandbox.autoAllowBashIfSandboxed(defaults true), which is checked before the&rule — but it needs the command to be sandboxable, and these units need broad network egress.
So: keep &, rm with globs, shell function definitions and for/while
loops out of anything SKILL.md tells an agent to type. Put them in a script.
That is a portability-neutral move — SKILL.md still names a capability, not a
mechanism — and it is why ai-pullback-daily's step 1.1 (one ( … ) &) and its
join loop have the same defect, still unfixed.
Two properties of fetch_all.sh are load-bearing and easy to erode:
listmust print commands that are runnable exactly as printed — the real redirections (>"$RUN/<unit>.json",2>"$RUN/<unit>.err",echo $? >"$RUN/<unit>.rc") plus theSCRIPTS=/RUN=lines that bind them. Those three redirections are the implementation of 守则 1–3, andlistis the only remaining place a reader can see them now that SKILL.md does not carry the block. Print a prettified summary instead and the documented "run one unit alone to debug" and "serial by hand" paths silently stop working.- The units table's 2nd and 3rd columns are different on purpose. Column 2 is
the stdout target, column 3 is the file that carries the payload. They differ
only for
market(market.outvsmarket.json), andjoinverifies column 3. Merge them and a run wheremarket.pywrote nothing still passes the "file exists and is non-empty" check on a one-line 「已写入 …」 stub.
One measured caveat for anyone promising fewer prompts: clicking "don't ask
again" on a path-invoked script saves the exact full command line, not a
:* prefix — measured across this machine's own accumulated rules
(~/Documents/env/futu/.claude/settings.local.json holds five separate exact
rules for one get_kline.py, differing only in flags, while cargo build:* and
git add:* in the same files are wildcarded because those are recognized tools).
So launch and join persist as two separate rules unless a wildcard rule is
hand-written. .claude/settings.local.json is now in this repo's own
.gitignore — it was previously covered only by the operator's machine-local
~/.config/git/ignore, which a fresh clone or CI does not have, and any rule in
it contains an absolute home path.
crypto / stock_perp are Python now — the shell versions are gone
scripts/crypto.py and scripts/stock_perp.py are the only implementations
of signals 14–18. scripts/crypto.sh and scripts/stock_perp.sh were deleted
on 2026-09-07 when SKILL.md step 1.1 switched its two bg lines to
python3 "$SKILL_DIR/scripts/crypto.py" all --json and
python3 "$SKILL_DIR/scripts/stock_perp.py" --from-fred --json. Rollback is
git alone — the deleted files are in history; do not restore them into the
tree. Two implementations silently disagreeing about the same verdict is the
worst failure this skill family has (see the neocloud credit twins, whose two
TH dicts make every recalibration a two-place edit), and a second copy of
crypto / stock_perp would be that trap over signals 14–18.
The switch moved jq off the critical path: cnn_fng.sh is now the only
script that needs it (measured: 10 invocations; fred.sh and cape.sh have
zero — their sources are CSV and HTML). crypto.py / stock_perp.py need
python3 + requests and no jq / awk / curl.
Where the language split falls, and why — settled, not to be re-litigated:
fred.shandcape.shstay shell. They need nojqand no Python packages at all, and this environment's stdliburllibcannot reach these hosts, so porting them would addrequestsfor no gain — a portability loss in a repo whose purpose is portable skills.- Concurrency is not a reason to port.
curl --parallelwith-w '%{url_effective} %{http_code}'keeps per-URL status attribution, so the ⚪️ per-series accounting andfred.sh's ordering invariant survive in shell. - What Python uniquely bought is two things curl cannot express.
Heterogeneous-block parallelism:
crypto.pyfires its four blocks at four different hosts, fences each future separately, and reducesOKCOUNT/MISSINGin fixed submission order — one bad field can no longer discard three good blocks. And named fields replacing the old positional TSV, whose one row was addressed under three incompatible index bases (awk$1…$16, jq.[0]…[15], and aread -rvariable list).
The divergence that made lingering untenable is now closed. When Hyperliquid's
assetCtxs array is shorter than universe, the shell version let jq's
transpose pad with null, the empty fields survived into the --json branch's
tonumber, and set -euo pipefail propagated jq's exit 5 — a code this
repo does not reserve — with unparseable JSON on stdout. stock_perp.py records
that market as MissingMarket with a reason, keeps both markets in the output,
and exits 3. That defect is therefore gone rather than fixed; the record of
it stays in skills/daily-risk-monitor/references/known-traps.md, marked
resolved-by-migration, because it documents a failure that really happened.
A migration oracle is not sufficient evidence to switch. Run a live
interleaved comparison first. The oracle — frozen upstream payloads plus a
golden stdout / stderr / exit code per case, replayed offline through the
RISK_FIXTURE_DIR / RISK_FIXTURE_NOW hook both versions carry — reached
119/130 green while stock_perp.py was 100% broken against the real
network: its http_request returned False on success, but the contract is
"a non-None fail_reason means failure", so every successful fetch was read
as a transport-layer failure. The fixture path returned None there, so the
oracle never exercised it. The oracle covers parsing and rendering; it cannot
cover the transport layer it replaces. So for any future port: alternate
sh → py → sh → py against live upstreams and diff every decision-relevant
field before deleting anything. The oracle still currently lives outside the
repo, in scratch space — no fixture or golden file is checked in, so a fresh
clone cannot replay it.
How the two AI-compute skills couple
The industry rating table is maintained in exactly one place:
skills/ai-industry-weekly/assets/baseline.md, written only by
baseline.py write. ai-pullback-daily reads it (via its
scripts/industry_table.py), reads universe.json for the ticker set, and
calls ai-industry-weekly/scripts/hk_quote.py for HK prices — always read-only,
never writing into the weekly skill. The daily skill therefore hard-depends on
the weekly one being installed as a sibling directory (AI_INDUSTRY_WEEKLY_DIR
overrides the lookup), and its preflight industry_table.py --check fails
loudly rather than falling back to a stale copy: the rating is the quality gate
in the daily bucketing, so a missing table silently disables half the framework.
That check also warns when the baseline is more than 10 days old. The ratings are a deliberately slow variable read verbatim each day, so staleness is invisible at the daily level — nothing errors, the numbers just quietly stop reflecting the last earnings season. The warning is the only signal that the weekly run is overdue; it does not block the daily report.
All three daily scripts that need the weekly install (industry_table.py,
technicals.py, perp_quotes.py) resolve it through one shared module,
skills/ai-pullback-daily/scripts/_weekly.py — same candidate order, same
probe, same error text. AI_INDUSTRY_WEEKLY_DIR, when set but not a valid
weekly install, always errors out; it never silently falls back to the
default locations. Three independent lookups drifting apart is how one run's
rating table and ticker list end up coming from two different installs, both
exiting 0, producing a self-contradictory report. Add a new daily script that
needs the sibling and it goes through _weekly.py too.
industry_table.py --check additionally cross-checks the baseline's row
count against universe.json's ticker count and warns loudly when they
disagree. Those two numbers come from different files with different writers, so
they drift for a real and common reason: someone edited universe.json in the
weekly skill and has not re-run baseline.py write yet. In that window the
daily report's step 1 (reads baseline.md) and step 2 (technicals.py /
perp_quotes.py, read universe.json) report different ticker counts. Before
this check all three scripts exited 0 and said nothing. The pre-existing
"declared 标的数 vs actual rows" check does not catch it — both of those numbers
live in baseline.md, so they are consistent by construction.
Like the staleness warning, the count mismatch and the "baseline date is in the
future" warning are banners, not failures: --check still exits 0. All three
describe something broken on the weekly side, and the daily skill is read-only
there, so warning is the only thing it can do.
Do not resolve this coupling by copying the table into ai-pullback-daily. A
second copy reintroduces exactly the drift the single-writer design removes.
Known duplication in the daily scripts — not yet converged
Only sibling-skill location has been pulled into _weekly.py. The other
shared helpers are still copy-pasted, and that is the current state of the code,
not an oversight waiting to be discovered:
scrub()(folds$HOME-ish absolute paths out of error text) is defined fourteen times (measured 2026-09-15 bygrep -rl _HOMEISH_RE --include='*.py' skills/— not a remembered number; re-run the grep):etf_holdings.py,bars_fallback.py,industry_table.py,neocloud_credit_lite.py,neocloud_credit_monitor.py,perp_quotes.py,run_state.py,source_probe.py,technicals.py,crypto.py,market_fallback.py,market.py,snapshot.py,stock_perp.py.rel_display()exists in six copies: the shared one in_weekly.py(imported by the scripts that need the weekly install) plus private definitions inneocloud_credit_lite.py,neocloud_credit_monitor.py,run_state.py,market.pyandsnapshot.py. The credit scripts do not import_weeklyat all — they read only this skill's ownassets/, so they have no reason to depend on the weekly lookup.
Treat these as fourteen and six separate implementations: a fix to path scrubbing
(the public-repo leak rule below) is an N-place edit, and grepping for
_HOMEISH_RE finds every copy.
⚠️ Count the grep, do not trust this list. It said five and three until
2026-09-07 and ten and five until 2026-09-15, by which point the real numbers were
fourteen and six — each time, new scripts had been added without updating it. Path
scrubbing is the public-repo leak rule, so a missed copy publishes a home
directory into a Slack-pushed report; a stale count here is the most expensive
kind of documentation rot in this file. Converging them is fine, but neocloud_credit_lite.py
is the standard-library cloud variant and must not gain an import that ties it
to the rest of the script directory.
Fallback chains — the rule
Several data points in this repo have no single reliable source, so they are
fetched through an ordered chain. Seven exist today: HK prices (hk_quote.py →
yfinance, derived indicators only, never the price), VIX (FRED VIXCLS →
yfinance ^VIX), funding rates (Binance → Hyperliquid → coinglass search), BTC
dominance (CoinGecko → CoinPaprika), ETF holdings (Alpha Vantage → yfinance
→ issuer page), and daily OHLCV bars (technicals.py: yfinance →
bars_fallback.py — stockanalysis.com for US, Naver siseJson for KR; HK stays on
yfinance + hk_quote.py; indices have no second tier and go N/A).
The sixth was added 2026-09-11 for a reason worth stating, because it is the only
one where changing the transport cannot help: yfinance is structurally
unreachable from the Routines container. Its data host is hardcoded
(yfinance/const.py: _BASE_URL_ = query2.finance.yahoo.com, used by base.py and
scrapers/history.py), and that container's egress proxy kills every query2 tunnel
(~1.8KB ClientHello out, 39 bytes back, code 1006 at ~6s). Both engines —
requests.Session and curl_cffi — hit that same blocked host, so only a
different upstream fixes it. Its two tiers share a price caliber
(split-adjusted, dividend-unadjusted; verified across 7 in-window splits, and
across all 46 tickers 0 differing T1/T2/T3 verdicts) but not a volume
caliber, so fallback rows carry vol_ratio_comparable: false and the
「放量 ≥1.5x」 label is suppressed on them — rule 4 in action.
A seventh chain, added the same day, is daily-risk-monitor's
market.py → market_fallback.py (SPY/RSP/TLT/GLD/UUP → stockanalysis;
^GSPC → Tencent us.INX; BTC-USD → Binance BTCUSDT). It is a separate
implementation from bars_fallback.py on purpose — daily-risk-monitor is
standalone by design and must not import from ai-pullback-daily, so this is a
two-place edit in the same sense as the two TH dicts. Two things about it are
load-bearing:
- It refuses two tickers rather than failing on them.
DX-Y.NYBhas no same-magnitude substitute (market.py's own docstring already forbidsDTWEXBGS), and Tencent'susDXis a name-collision trap — it returns 「德尼克斯投资」(DX.N), a company, not the dollar index.GC=Fhas none either (GLD is an ETF with fees and premium/discount, PAXG is tokenized gold; swapping the numerator redefines the Gold/SPX ratio). Both are refused with the reason written into the module, so nobody later wires up a wrong-magnitude source. - Its tiers have different as-of dates. Measured: stockanalysis's ETFs lag
Tencent/Binance by one trading day, so signals 21/22 land on D-1 while 19/26
land on D. Each signal is internally date-aligned (
anchor+pct_change_on), but cross-signal comparison is not, so the fallback emits an explicit date-skew warning intodegraded_reasons. This is rule 3 in its sharpest form.
They were each written separately; these constraints are common to all of them, and an eighth chain should follow them rather than reinvent one.
- The order is fixed and written down. Not chosen at call time, not "whichever answers first".
- Label which tier produced the value — in the human output and in
--json. A number whose source is unknown cannot be checked later. - Never merge tiers into one table. Different tiers are different snapshots at different times under different definitions. Two of them side by side in one row is the error every caliber rule here exists to prevent.
- Thresholds do not travel between tiers. A threshold calibrated on tier
one (GuruFocus's
0.17, CBOE's put/call bands) cannot be compared against a tier-two number. Either recalibrate and record the switch date, or record N/A. Reusing it silently is the single most expensive mistake available here. - Whatever a degraded tier cannot support, record as N/A with the reason —
never compute it from partial data. yfinance returns only top-N holdings, so
a cash/T-bill total derived from it would read 0.00% and look entirely
normal while reproducing the exact "36% of T-bills counted as holdings"
trap that
rating-rules.mddocuments. - Falling back must be loud. A silent downgrade records "don't know" as "checked, fine" — the same failure the ⚪️ accounting rules exist to stop.
- A fresh lower tier beats a stale higher one. This is why
etf_holdings.pykeeps no cache: holdings move (the three Roundhill funds are actively managed), so a stale snapshot of the preferred source is more dangerous than a fresh reading from a weaker one. Do not reintroduce a holdings cache.
One corollary worth stating separately: a tier being available does not make
it authoritative. rating-rules.md requires ETF holdings to come from the
issuer's own sheet. Alpha Vantage is convenient, not authoritative — so the
issuer sheet must still be pulled on its own schedule, otherwise "official wins
on conflict" can never fire, because nothing is ever there to conflict with.
JSON equivalence — the rule
A script's --json must carry everything its human output carries. Every
warning, prohibition, verdict and caliber declaration that the text branch
prints must exist as a field. Exit codes and stderr are redundant
channels, never the only one: any narrow read, any handoff between steps, and
any concurrent run sees stdout alone.
This was audited across all 16 scripts (2026-09-05) and 9 of them failed. The defects came in two shapes, and the first is the dangerous one because it looks fine:
- Self-contradictory — the obvious field lies while the truth sits in a
less obvious one.
cnn_fng.shemittedtriggers.hard_threshold_4_greed_burst: falsewhen it could not evaluate the trigger at all (onlypeak.value: nullgave it away) — and that is hard threshold #4, where ⚪️ must be deducted from the denominator (N = 7 − M) andfalseis not.fred.sh,cape.shandstock_perp.sh(the since-deleted shell version — this bullet is the 2026-09-05 audit record, kept as written) all hardcoded"ok":truewhile a conditionalsanity.passsaid otherwise. - Genuinely absent — no field at all.
neocloud_credit_monitor.pypopped thecfgkey its own "no live CDS data (this layer's biggest blind spot)" line derives from;snapshot.py show --jsondumped raw state and skipped every derived banner, making--jsonstrictly less thanshow.
Four rules follow:
okis never a literal. It is false whenever a self-check failed.- A trigger that could not be evaluated is
null, neverfalse.falsemeans "checked, did not fire". Pair it with a reason string. This is the JSON form of the ⚪️ / ❌ distinction the reference docs already insist on. - Every prohibition in the text branch is also a field. If the human output says "do not divide these two", the JSON says so too.
--quietmeans "no human-readable rendering on stdout". It never means "no warnings". stderr stays live, and every degradation is additionally a structured field plus a top-leveldegraded: bool/degraded_reasons[].
Rule 4 matters most under concurrency, which is exactly what provokes
throttling: if --quiet silenced the ⚠ lines and a caller read only a summary
field, a throttled run would become a silently normalised one — the failure
mode fallback-rule 6 and the ⚪️ accounting exist to prevent, triggered by the
change meant to make things faster.
Design record: docs/superpowers/specs/2026-09-05-skill-handoff-and-concurrency-design.md.
Retrieval transport layer
The two daily routines fetch a large part of their signals with WebSearch /
web_fetch. Raw search results are prose, ads and stale reposts — tens of KB per
item — and letting them into the context that writes the report both drags the
verdict toward the snippet's own wording and dilutes the source and as-of date
that output-format.md requires on every line. So retrieval is split into
transport and judgement: the transport side returns readings and
provenance as structured fields, never a 🟢🟡🔴 state, a threshold comparison, a
「一句話解讀」, or narrative. The shape is enforced by the schema having no such
fields, not by a prompt asking nicely.
The contract is deliberately duplicated — a TWO-PLACE EDIT
The contract lives in two files, one per skill:
skills/ai-pullback-daily/references/search-contract.mdskills/daily-risk-monitor/references/search-contract.md
This is not drift waiting to be cleaned up. daily-risk-monitor is standalone
by design — the rule above says it shares no code and no sibling-skill
dependency with ai-pullback-daily — so the contract cannot be hoisted into
one shared file without creating exactly the dependency that rule forbids.
Treat it the way the two TH threshold dicts are treated: a change to the
common envelope is a two-place edit. The common part is §2 (the envelope
fields), §3 (threshold_comparable, carry_forward_policy), §4 (the sentinel
is chosen by the caller, not the fetcher), §5 (what is excluded), and the
one-line handoff receipt. The per-skill parts — the group tables, the dispatch
lists, the payload families actually used, the per-group caliber notes — are
genuinely different and must not be homogenised. Two copies silently disagreeing
about the envelope is the same failure mode as the two TH dicts disagreeing
about tripwire ④: whichever copy the day's run happened to read is what the
report presents as fact.
Note the copies use different sentinel sets (daily-risk-monitor has three,
ai-pullback-daily four, including (无)), so a sentinel change is a real
per-skill decision, not a copy-paste.
Unlike references/*.md, these two files are not verbatim migrations from
the private source document — they are the skills' own handoff contracts and can
be edited normally. But a contract may only say how a caliber is carried,
never restate or amend the caliber itself; every rule it cites has to be checked
back against the migrated signals-*.md / tripwires.md / neocloud-credit.md
files that own it.
Those citations are written as anchors, never line numbers:
`file.md`「verbatim phrase」 or `file.md` §「heading」. Both quote bytes
that exist in the target, so every citation in the file can be re-checked by
grepping for it — which is the same "count the grep, do not trust the list"
discipline the scrub() / rel_display() counts above are under.
This was not free advice. On 2026-09-17 daily-risk-monitor's contract held 59
line-number citations and 19 of them had rotted — SKILL.md:140 and :174
pointed at blank lines, and signals-a-macro.md:40-41 was cited for 「无历史基准」
while actually pointing at the HY/IG/BBB caliber trap. Most had been wrong since
before that day's edits; a rewrite of SKILL.md step 1.1 then moved several more.
A rotted line number is the expensive kind of wrong because it looks exactly
like a correct one: the reader jumps, lands on something unrelated, and
concludes they looked in the wrong place rather than that the document is wrong.
The sibling ai-pullback-daily contract never used line numbers and so never
rotted — that is the form to copy.
One scoping note for anyone repeating this: it was a one-place edit despite
the two-place rule, because the 依据 citation column exists only in the
daily-risk-monitor copy, and the §2 envelope field list is identical in both
set and order across the two files. Verify that before assuming either way.
Still open, and genuinely two-place: the daily-risk-monitor copy's as_of
field has lost the comment # 数据自身的日期,不是取数日 that the
ai-pullback-daily copy still carries.
.claude/agents/ is optional and must stay that way
.claude/agents/search-transport.md is the Claude Code mechanism that executes
one group of the contract. It is a Claude Code-only optional enhancement:
it is not part of the portable SKILL.md layer, and the README's own documented
install path (cp -r skills/<name> ~/.claude/skills/) does not carry it.
SKILL.mdnames the capability, never the mechanism. Keep the repo's existing neutral wording (WebSearch / web_fetch,a Slack MCP server,python3 + yfinance,jq). The moment an@agent-nameor anmcp__…identifier appears in aSKILL.md, the portable layer is dead. Do not add this agent to anySKILL.mdby name.- Degrading means the parent searches for itself — same contract, same JSON file, same report bytes.
isolation: worktreeis forbidden in that definition, and the reason is in a comment there: the daily state files have inconsistent git status.last_run.jsonanddominance_history.jsonlare untracked, so a worktree shows a "first run" world;neocloud_credit_history.jsonlis tracked, so a worktree shows the last committed state and the day's append evaporates with the tree. The tracked one is the more dangerous of the two failures precisely because it looks normal.
Where a missing transport layer gets announced — a deliberate exception
The absence of the transport layer goes into run output, not the report body. That deviates from the repo's "falling back must be loud" rule, so the criterion is written down here to stop it eroding into "no fallback needs announcing":
Announce a fallback in the report body when it changes the data's caliber; announce it only in run output when the data is byte-identical.
AV_API_KEYS being unset changes the caliber (full holdings → top-N), so it must
appear in the body. The transport layer being absent changes only where the
searching happened, so putting it in the body is noise. Every other fallback in
this repo changes caliber and therefore still goes in the body.
ai-industry-weekly architecture
A weekly re-rating of an AI-compute supply-chain quality table. Three files carry the design and none makes sense alone:
assets/universe.jsonis the single source of truth for the ticker set and the row order. Row count is never hardcoded — everything derives fromtickerslength. Adding or removing a ticker means editing only this file. Per-ticker flags drive behavior:hk_quoteroutes price fields tohk_quote.py,ratio_distortedandcurrencymark ADR/FX rows whose PS/PB/cash-flow ratios are meaningless.assets/baseline.mdis rolling state, rewritten by every run. It is also its own seed — there is deliberately nobaseline.seed.mdand nohistory/directory. Rollback is git alone. Do not add backup, snapshot, or.bakfiles; that was an explicit decision.scripts/baseline.pyis the guardrail that makes automatic overwriting safe.
The run order matters and is enforced by SKILL.md: fetch → re-rate → validate
→ diff → write the full report body → write the new baseline → Slack push.
The baseline write lands before the Slack push so a Slack failure cannot lose
the rolled baseline.
baseline.py invariants — do not weaken these
writeruns full validation first and, on any failure, exits 1 without touchingbaseline.md. There is no--forceand none should be added.diffalso validates before comparing. This is not redundant: an unvalidated diff silently emitted a plausible-but-wrong change summary (a dropped row read as a deliberate delisting) that would be published one step beforewritecaught it. Malformed input exits 1 with zero bytes on stdout — with one deliberate exception added 2026-09-07:diff --jsonon malformed input exits 1 and writes an error object carryingok: false/summary_produced: false/result: null. That is not a diff result and cannot be mistaken for one, and it exists because a caller narrow-reading stdout could not otherwise tell "refused" from "ran and found nothing". The plain (non---json) branch is still byte-for-byte silent.- Validation covers header, row count, ticker set and order against
universe.json, rating vocabulary, empty cells, and lazy placeholders like 「见 Slack thread」. universe.jsonis validated too, with errors that name the manifest. Duplicate or ticker-less entries otherwise create an unbreakable loop: add a row → "duplicate" → remove it → "missing row".writerenders the table itself in compact| a | b |form rather than echoing the caller's layout. Preserving caller formatting made one week's padded table force a full 46-row rewrite the next week — a 96-line diff for one row of real change, which destroys the git-based audit the design rests on.- Table parsing is deliberately lenient: it takes every line starting with
|and ignores prose and<<<产业表开始>>>markers, so a report body can be piped in directly. The cost is that a temp file must contain only one table. - Paths in output are relativized (
rel_path). Script output is pasted into the report body and pushed to Slack, so a local absolute path would leak the machine's username.
Other non-obvious constraints
references/*.mdare verbatim migrations from a private source document. They encode hard-won caveats (per-ticker rating special cases, ETF holdings traps, HK price adjustment pitfalls). Edit only the specific line you must; never paraphrase or "tidy" them.- HK tickers must take price / 52-week-high / drawdown from
hk_quote.py, never from yfinance — yfinance'shistory()dividend-adjusts and corrupts those fields. This is a correctness rule, not a preference. fetch_fundamentals.pyimportsyfinancelazily insidemain()(not in the top import block) so--helpworks without the package and a missing install yields a hint instead of a traceback. It must userequests.Session, not yfinance's default curl_cffi engine, which fails TLS behind a proxy and silently returns all-null.info.- Missing data is recorded as
N/Aand never estimated. etf_holdings.pyfetches ETF holdings, weights, expense ratio and inception date for theetf: truerows inuniverse.jsonthrough a three-tier fallback: Alpha VantageETF_PROFILE→ yfinancefunds_data.top_holdings→ the issuer's own holdings page. It caches nothing — every run re-fetches. That is deliberate: holdings change (the three Roundhill funds are actively managed and rebalance quarterly), so a stale snapshot is more dangerous than no snapshot, and falling back to a fresher second-choice source beats falling back to an expired first-choice one. Do not reintroduce a holdings cache file. The tiers do not share a caliber, and that is the thing to get right when touching this: Alpha Vantage returns the full holdings list, yfinance returns only the top N (measured 2026-09-03: LYTE 0, NCLD 0, DRAM 5, SMH 10, SOXX 10), the issuer page is authoritative. Under a top-N tier the "top three combined" figure is still meaningful, but "top ten combined" needs N≥10, and "swap total", "non-US holdings total" and "cash/T-bill total" are not computable at all — they must be recorded asN/A. Computing them from a top-N list reproduces the exact trapreferences/rating-rules.mdwarns about (a marketing page counting 36% T-bills as holdings), which only the full list exposes. For the same reason numbers from different tiers must never be combined into one table, and every output carries asourcelabel that report text has to quote alongside the fetch date. Keys come fromAV_API_KEYS(comma-separated; the script rotates to the next key when one is rate limited) and never from a file in the repo. Rate limiting comes back as HTTP 200 with a{"Information": "...spreading out your free API requests..."}body — this is the easiest thing to get wrong here: branching on the status code reads a throttle as real data, so every response body has to be inspected before it is trusted. The free tier also caps at 25 calls a day, worded differently again — and the per-second message also contains "per day" and "rate limit", so classification must test the burst wording first and the daily wording second; reversed, one per-second throttle is read as an exhausted quota and burns every key at once. An invalid key and an exhausted key return an identical message (Alpha Vantage echoes the key back in both), so a "daily quota exhausted" verdict cannot distinguish "used up" from "mistyped" — the wording must say so, and every key failing on its first call means suspect the key, not the quota. Alpha Vantage and yfinance are both convenience sources, not the issuer's official holdings sheet — where they disagree the official sheet wins, and any holdings figure quoted in a report must name its source. The whole step is optional: withAV_API_KEYSunset the skill starts at the yfinance tier, records what it cannot get asN/A, and still prints its full report.
Working on ai-industry-weekly
Scripts resolve their own data via __file__, so they run from any cwd — but
the invocation still needs a real path:
S=skills/ai-industry-weekly
python3 $S/scripts/baseline.py show # current table (header + separator + rows)
python3 $S/scripts/baseline.py meta # {date, updated_at, count, path}
python3 $S/scripts/baseline.py validate <table.md> # check only; exit 1 lists every problem
python3 $S/scripts/baseline.py diff <table.md> # rating changes + field drift
python3 $S/scripts/baseline.py write <table.md> --date YYYY-MM-DD
python3 $S/scripts/fetch_fundamentals.py # all tickers
python3 $S/scripts/fetch_fundamentals.py --tickers NVDA,TSM # subset, for debugging
python3 $S/scripts/fetch_fundamentals.py --json out.json --quiet
python3 $S/scripts/hk_quote.py 0700.HK 1810.HK 0941.HK --json
python3 $S/scripts/etf_holdings.py # every `etf: true` row
python3 $S/scripts/etf_holdings.py --tickers LYTE,NCLD # subset, for debugging
python3 $S/scripts/etf_holdings.py --check # pre-fetch self-check
python3 $S/scripts/etf_holdings.py --json out.json --sleep 1Requires python3 with yfinance and requests, plus outbound network.
etf_holdings.py uses AV_API_KEYS for its first tier; without it that tier is
skipped, the fetch starts at yfinance (top-N only, and nothing at all for LYTE /
NCLD), and the rest of the skill is unaffected.
Verifying changes to these scripts
There is no test suite, so exercise them live rather than reading the code:
# round-trip must be lossless
python3 $S/scripts/baseline.py show > /tmp/t.md
python3 $S/scripts/baseline.py validate /tmp/t.md # expect exit 0
python3 $S/scripts/baseline.py diff /tmp/t.md # expect "本周评级无变动"
# every malformed shape must be refused with empty stdout (plain branch;
# `--json` returns an error object with summary_produced:false instead)
grep -v '^| ASML ' /tmp/t.md > /tmp/bad.md
python3 $S/scripts/baseline.py diff /tmp/bad.md # expect exit 1, 0 bytes on stdoutWhen touching write, prove assets/baseline.md is byte-identical after a
rejected write (md5 before and after) — a partially written baseline poisons
every later week. Test from a foreign cwd (cd /tmp, absolute paths) and check
no output contains a local absolute path.
Public repo
BigtoC/my-skills is public. The skills intentionally ship no config file and
contain no channel or routine ids — Slack channel ids come from the environment,
and no real channel id, absolute home path, or username may appear in a report
body either.
One variable for every skill that notifies: NOTIFICATION_SLACK_CHANNEL_ID.
All three notifying skills (ai-industry-weekly, ai-pullback-daily,
daily-risk-monitor) read that single name, and a new skill that pushes to Slack
reuses it rather than minting its own. With it unset a skill still runs and
prints its full report, skipping only the push.
It replaced a pair grouped by routine family — AI_INDUSTRY_SLACK_CHANNEL_ID for
the two AI-compute skills, RISK_MONITOR_SLACK_CHANNEL_ID for
daily-risk-monitor, which was deliberately kept off the AI_INDUSTRY_ prefix
because it is not part of that pair. Neither name may come back. Grouping by
family read as tidy and cost real usability: the notification target is a
property of the operator, not of the routine, so configuring a skill meant
first knowing which family it belonged to, and a skill fitting no existing family
meant another export pointing at the same channel. A skill that genuinely needs a
different destination is a deliberate exception to argue for, not a default to
reach for.
The rule covers Slack notification targets only. Non-notification variables keep
their own descriptive names — AI_INDUSTRY_WEEKLY_DIR (sibling-skill location),
AV_API_KEYS (Alpha Vantage keys) — and renaming those is not part of it.
git push uses the SSH host alias github.com-personal, while gh may be
authenticated as a different account — check gh auth status before assuming
PR creation will work.
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.

