teach-a-concept-by-worked-example
Use when explaining a concept someone must apply, not just recognise. Builds one smallest runnable example that shows the rule, runs it for real, then varies a single input so the learner sees the boundary rather than a definition.
- License 许可
- MIT
- 最近更新
- 2026-11-15
- Stars
- ★ 81
- Forks
- 17
01 前言 Front Matter
- name
- teach-a-concept-by-worked-example
- description
- Use when explaining a concept someone must apply, not just recognise. Builds one smallest runnable example that shows the rule, runs it for real, then varies a single input so the learner sees the boundary rather than a definition.
02 资源文件 3
- 许可证LICENSE1.0 KB
- 参考文档SOURCE.md359 B
- 参考文档TRUST.auto.yaml2.2 KB
03 SKILL.md 正文
Teach a Concept by Worked Example
A definition teaches recognition; a worked example teaches application. One minimal runnable case, executed for real, plus one deliberate variation, teaches more than a page of prose because the learner watches the rule move.
Procedure
- Name the single rule the learner must apply, in one clause:
closures capture the variable, not its value. - Write the smallest program that shows it — one file, under 20 lines, no dependencies. Save it at
/tmp/teach/closures.py. - Run it with
python3 /tmp/teach/closures.pyand paste the real output. Never describe output you did not produce. - Add exactly one variation that flips one input — here
lambda i=i: i— and re-run it. - Annotate the diff between the two runs: which line changed, which behaviour changed, and in what direction.
- State the rule once, after both runs, in one sentence the learner could repeat back unprompted.
- Give the counter-case: an input where the naive reading of the rule fails, so the learner sees its edge.
- End with a predict-then-run task: an input whose output they must guess before executing.
- Ask the learner to write the rule from memory the next day; that is the retention check.
- Keep the example file in the notes repo under
examples/so the next learner gets the same run. - Show the same rule in a language or syntax they already know, then translate, so the concept is not tangled with new syntax.
- State the common wrong mental model explicitly and demonstrate why the example falsifies it.
- Cap the reading time at five minutes; if the explanation is longer, split the concept in two.
- Point at the exact line whose behaviour changed between runs, and nothing else.
- Ask the learner what they expected before revealing the second output.
- Note the runtime (well under a second) so the example can be re-run freely.
Pitfalls
- Showing output you assumed rather than captured; the learner copies a false fact forward.
- Using a 60-line example where 6 lines carry the whole rule; length hides the point.
- Varying two inputs at once so the learner cannot attribute the behaviour change.
- Starting from the abstract rule and never running anything, so it stays recognition.
- Naming the rule before the example, which pre-empts the learner noticing it themselves.
- Choosing an example that needs network, a database, or credentials, so it never runs on their laptop.
- Leaving the example uncommitted in a scratch path where it is lost the same day.
- Adding a second example before the first has been run, so neither is concrete.
- Explaining the mechanism when the learner only needs the rule to apply.
- Choosing an example whose output is obvious, so the rule is never actually tested.
- An example whose behaviour depends on the machine or interpreter version.
- Explaining before the learner has formed an expectation of their own.
- Skipping the second run because the first one 'worked'.
Verification
python3 /tmp/teach/closures.py
# passes when the printed output matches the annotated output in the explanation, byte for byte
Report to the user: the rule, the command that demonstrated it, and the exact output observed.
04 同仓库更多 Skills
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.
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".
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.
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...".
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".
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.