Getting it into your agent
One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.
npx skills add SWHee/diffscope --skill python-syntax-tutorgit clone --depth 1 https://github.com/SWHee/diffscopeWrote this? Show the measurements
A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.
[](https://agentmods.dev/skills/swhee/diffscope/python-syntax-tutor)<a href="https://agentmods.dev/skills/swhee/diffscope/python-syntax-tutor"><img src="https://agentmods.dev/badge/skills/swhee/diffscope/python-syntax-tutor/github.svg" alt="Measured on agentmods" height="20"></a>Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.
<a href="https://agentmods.dev/skills/swhee/diffscope/python-syntax-tutor"><img src="https://agentmods.dev/badge/skills/swhee/diffscope/python-syntax-tutor.svg" alt="Reviewed on agentmods" width="80" height="20"></a>What it costs to keep this loaded
Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5.1 | $0.00238 | $0.01673 |
| Opus 5.5 | $0.00095 | $0.00669 |
| Sonnet 5.5 | $0.00048 | $0.00335 |
| Haiku 4.5 | $0.00024 | $0.00167 |
Grade A, and why
python-syntax-tutor scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 1mo ago.
A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.
Nothing flagged
None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.
How it starts
The opening of the file, as written. The whole thing — 105 lines — stays where its author put it; the contents beside it link to each section on GitHub.
python-syntax-tutor — Python 문법 해설
Python 코드를 읽다 막힌 사람에게 그 자리에서 필요한 만큼만 설명한다. 문법 강의가 아니라 눈앞의 코드에 붙이는 주석에 가깝다.
왜 이 스킬이 필요한가
코딩 에이전트가 쓴 Python은 숙련자용 이디엄을 거리낌 없이 쓴다. 데코레이터가
제어 흐름을 감추고, 타입 힌트가 실제 동작과 무관해 보이고, yield가 함수의 반환
개념을 바꿔 놓는다. 로직은 따라가도 표기에서 막히면 코드가 통째로 불투명해진다.
이 스킬은 그 표기만 걷어낸다.
해설 원칙
1. 일반론이 아니라 이 코드의 설명
@lru_cache를 만나면 캐시 이론이 아니라 이 함수에 왜 붙었는지부터 말한다.
일반화는 그 뒤에 한 줄로 붙인다. 순서를 뒤집으면 학습자는 자기 코드와 설명을
연결하지 못한다.
1. 이 자리에서 하는 일 ← 2~3줄
2. 안 썼으면 어떻게 됐을지 ← 1줄
3. 최소 예시 ← 3~6줄
4. 언제 쓰는 문법인가 ← 1줄
2. 고를 줄 아는 것이 실력
전부 설명하면 아무것도 설명하지 않은 것과 같다. 모르면 코드 흐름을 잘못 읽게 되는
것만 고른다. for, if, def, 단순한 표준 라이브러리 호출은 설명하지 않는다.
우선순위:
- 제어 흐름을 숨기는 것 — 데코레이터, 컨텍스트 매니저, 제너레이터, async
- 함정 — 가변 기본 인자, 늦은 바인딩, 얕은 복사,
isvs== - 이름으로 동작을 알 수 없는 것 — dunder, 디스크립터, 메타클래스
- 타입 표기 —
Protocol,TypeVar,Literal,overload - 최신 문법 —
match,:=,dataclass옵션
한 번에 3~5개. 함정은 개수 제한과 무관하게 반드시 포함한다.
3. 예시는 그 코드의 이름으로
foo/bar로 쓴 예시는 원본과 연결되지 않아 기억에 남지 않는다. 설명 중인 코드의
함수명·변수명을 그대로 써서, 예시가 곧 그 코드의 축소판이 되게 한다.
4. 추측하지 말고 실행한다
"아마 이렇게 될 것"이라고 쓰고 싶어지면 python3 -c '...'로 확인한다.
Python은 직관을 배신하는 구석이 많다(스코프, 평가 시점, 복사 깊이). 틀린 문법 설명은
아무 설명도 없는 것보다 나쁘다 — 학습자가 그걸 믿고 계속 간다.
확인할 수 없으면 "확실하지 않음"이라고 밝힌다.
5. 프로젝트 고유 문법은 정의부를 읽는다
@retry, @app.route 같은 것은 Python 문법이 아니라 그 프로젝트/라이브러리의
데코레이터다. 일반론으로 넘기지 말고 Grep으로 정의부를 찾아 실제로 무슨 일을
하는지 읽고 설명한다. 찾지 못하면 그 사실을 밝힌다.
참조 자료
깊이가 필요할 때만 해당 파일을 읽는다. 전부 읽지 않는다 — 대부분의 해설은 이 SKILL.md만으로 충분하고, 참조는 설명이 얕아질 때만 연다.
| 등장 요소 | 파일 |
|---|---|
데코레이터, @property, functools, 디스크립터, 메타클래스 |
references/decorators-and-descriptors.md |
타입 힌트, 제네릭, Protocol, TypeVar, overload, Self |
references/typing-and-generics.md |
async/await, 이벤트 루프, gather, 스레드/GIL |
references/async-and-concurrency.md |
제너레이터, yield, 이터레이터, 컴프리헨션, itertools |
references/iterators-and-comprehensions.md |
dunder 메서드, dataclass, 연산자 오버로딩, __slots__ |
references/dunder-and-data-model.md |
가변 기본 인자, 늦은 바인딩, 복사, 스코프, is vs == |
references/gotchas.md |
What ships with it
6 files beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.
What this file has done since we first saw it
Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.
- 1mo ago First seen · 105 lines · 238 tokens per session scan A 8a2fd1387d24
python-syntax-tutor is a skill published in the GitHub repository SWHee/diffscope (1 stars, last pushed 2mo ago), licensed MIT. It adds 238 tokens to every session and 1,673 once invoked, about $0.0010 per session on Opus 5.5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.
Other skills, from other repositories
modelcontextprotocol-python-sdk-context
Answers questions about the official Model Context Protocol (MCP) Python SDK (mcp package on PyPI, modelcontextprotocol/python-sdk on GitHub). Tracks the main branch (v2 pre-alpha — MCPServer/snakecase/constructor-on handlers). Use when working with MCP servers or clients in Python, debugging v1→v2 migrations, or…
string-algorithms
Reference for string algorithm patterns — KMP, Z-function, Rabin-Karp, Manacher's, string hashing, suffix arrays, and Aho-Corasick. Covers recognition signals, core ideas, Python templates, edge cases, and common mistakes for each technique.
programming
MUST USE for ANY work on .py .pyi .rs .ts .tsx .mts .cts .go files. One philosophy: strict types, modern stacks (Pydantic v2 / serde+thiserror / Zod / gin+sqlc+pgx+slog), modern toolchains (uv+basedpyright+ruff / cargo+clippy+miri / Bun+Biome+tsc / gofumpt+golangci-lint v2+nilaway+go-race), parse-don't-validate…
course
A Python helper that displays tutorials, group information, source-code links, and other resources for the python-office library in a terminal.
shiny-py-optimize
Diagnose and fix performance problems in Shiny for Python apps — slow startup, sluggish interactions, blocking operations, and apps that struggle beyond a handful of concurrent users. Use when a Shiny for Python app is slow, hangs, recomputes too much, times out, or must support more users; when the user asks to…
triton-cuda-api
A reference for Triton CUDA's core programming functions and their parameters. It explains how to identify program blocks, load and store memory, reduce values, perform dot products, and use atomic updates.