AGENT SKILL

bisect-a-config-or-data-difference

Use when two runs of the same code disagree and the difference is in configuration, feature flags, or input rows. Binary-searches the config keys or data records to the one that flips the outcome.

License 许可
MIT
最近更新
2026-11-15
Stars
★ 81
Forks
17

01 前言 Front Matter

name
bisect-a-config-or-data-difference
description
Use when two runs of the same code disagree and the difference is in configuration, feature flags, or input rows. Binary-searches the config keys or data records to the one that flips the outcome.

02 资源文件 3

03 SKILL.md 正文

Bisect a Config or Data Difference

Code unchanged, results different: the variable is data. Treat the config map or the input rows like a commit range and halve it until one key or row is responsible.

Procedure

  1. Dump both sides to files so they can be diffed and replayed: failing curl localhost:8080/config > cfg-bad.json, working baseline > cfg-good.json.
  2. Filter to keys that actually differ: jq -S . cfg-good.json > a && jq -S . cfg-bad.json > b && diff a b.
  3. If the diff is small (under ~5 keys), test each directly. Otherwise bisect: apply the first half of bad's values onto good's config, run, note pass/fail.
  4. Halve again on the half that flipped the outcome, using git diff-style apply of the candidate keys. Each run must change only the keys under test, nothing else.
  5. When one key flips it, test plausible values of that key rather than just the two: for v in 0 1 100 true false; do ....
  6. For data rows, sort deterministically, then bisect the row set: head -n <half> plus tail -n <rest>. Keep the failing subset, discard the clean half.
  7. For feature flags, check the interaction: two flags that are individually safe may combine. If no single key flips, test pairs.
  8. Record the deciding key and its offending value in the bug note; write a test that pins it.

Pitfalls

  • Diffing raw JSON without sorting keys, so every line looks different and the real delta is buried.
  • Applying a whole "bad" config at once and concluding "the config", never naming the key.
  • Overlooking nested or inherited defaults: the key is absent in one config and defaulted silently.
  • Assuming the config file is the effective config — env vars, CLI flags, or a remote config service may override it (see capture-effective-runtime-config).
  • Bisecting data that is not deterministically ordered, so the split is different each run.
  • Chasing a whitespace or type difference ("false" vs false) as if it were semantic without checking how it is parsed.

Verification

jq -S . cfg-good.json > a; jq -S . cfg-bad.json > b; diff a b
# names the differing keys; the deciding one is candidate

./run.sh --config <good+the-one-key>; echo "exit=$?"
# passes when injecting just that key into the good config reproduces the failure

Report to the user: the single key or row that decides the outcome, its two values, and the value of every override source for that key.

04 同仓库更多 Skills

jiayaoqijia
jiayaoqijia/cryptoskill

troves

Deposit and withdraw from Troves DeFi yield vault strategies on Starknet. View available strategies, check positions, and manage vault deposits. Use this skill when the user mentions Troves, vault, yield vault, DeFi vault, strategy, yield farming, vault deposit, vault withdraw, earning yield through vaults, passive yield strategies, or wants to deposit into or withdraw from a yield strategy — even if they don't say "Troves" explicitly.

★ 81
jiayaoqijia
jiayaoqijia/cryptoskill

trade

Swap tokens on Starknet via Fibrous DEX aggregator. Supports per-provider selection (avnu, ekubo, or auto to race all). Use this skill when the user wants to swap, exchange, trade, convert, buy, or sell one token for another on Starknet. Also use when the user asks about token prices, exchange rates, DEX routing, best swap route, or wants to check how much they would receive for a given amount — even if they don't explicitly say "swap".

★ 81
jiayaoqijia
jiayaoqijia/cryptoskill

staking

Stake, unstake, claim, and compound rewards for STRK, WBTC, tBTC, SolvBTC, and LBTC on Starknet. View validators, pools, and staking positions. Use this skill when the user mentions staking, delegating, validators, staking pools, rewards, compounding, unstaking, earning yield, passive income on crypto, or wants to earn on their STRK or BTC tokens — even if they don't say "stake" explicitly.

★ 81
jiayaoqijia
jiayaoqijia/cryptoskill

send

Send STRK, ETH, or any ERC-20 token to a Starknet address. Supports simulation (dry-run) before execution. Use this skill when the user wants to send, transfer, pay, tip, or move tokens to another wallet address on Starknet. Also trigger when the user mentions sending funds to someone, making a payment, transferring assets, or moving crypto to a specific address — even if they just say "pay 10 STRK to 0x...".

★ 81
jiayaoqijia
jiayaoqijia/cryptoskill

portfolio

View a comprehensive DeFi portfolio dashboard and optimize portfolio allocation via automated rebalancing. Use this skill when the user wants an overview, summary, dashboard, total value, net worth, portfolio rebalancing, target allocation, or wants to see all their DeFi positions across Starknet at once. Also trigger when the user asks "what do I have", "show me everything", "how much am I worth", "my positions", "my investments", "rebalance my portfolio", "I want 50% ETH", "optimize my holdings", or any request for a holistic view of their Starknet holdings — even if they don't explicitly say "portfolio".

★ 81
jiayaoqijia
jiayaoqijia/cryptoskill

multi-swap

Execute multiple token swaps in a single Starknet transaction via Fibrous (default). Supports per-provider selection (avnu, ekubo, or auto to race all). Supports 2-3 swap pairs bundled into one multicall. Use this skill when the user wants to swap multiple token pairs at once, do batch swaps, execute several trades simultaneously, perform parallel swaps, or do bulk trading in one transaction. Also trigger when the user mentions "two swaps", "three swaps", "swap X and Y at the same time", or wants to convert multiple tokens in a single call.

★ 81