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 agentmods add skills/chen3feng/agent-skills/python-indent-aware-editsnpx skills add chen3feng/agent-skills --skill python-indent-aware-editsgit clone --depth 1 https://github.com/chen3feng/agent-skillsWrote 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/chen3feng/agent-skills/python-indent-aware-edits)<a href="https://agentmods.dev/skills/chen3feng/agent-skills/python-indent-aware-edits"><img src="https://agentmods.dev/badge/skills/chen3feng/agent-skills/python-indent-aware-edits.svg" alt="Measured on agentmods" 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 | $0.00030 | $0.01858 |
| Opus 5 | $0.00015 | $0.00929 |
| Sonnet 5 | $0.00006 | $0.00372 |
| Haiku 4.5 | $0.00003 | $0.00186 |
Grade A, and why
python-indent-aware-edits 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 3d 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 — 188 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Python indent-aware edits: compileall won't catch a dropped with / try scope
When to use
You are making a multi-line edit inside a block-introducing
statement (with, try, for, if, def, class) using an
editor tool that does literal search-and-replace (e.g. replace_in_file,
multi_replace, sed -i with a multi-line pattern). The edit rewrites
or replaces a nested suite — not just a single token.
If the edit is purely mechanical in-line rename (e.g. iteritems(d)
→ d.items(), basestring → str) done by sed that never touches
the leading whitespace of any line, this skill does not apply.
Problem
Python's grammar treats any indentation greater than the enclosing
block as a valid new suite. That means an accidentally over-indented
line is still syntactically legal — compileall, ast.parse,
python -c 'import mymodule' all pass — but the semantic scope
has silently changed.
Concretely: an old_string that captured only the body lines of a
with block (not the with statement itself) can be replaced with
a new_string whose first line is indented to the with level. The
body lifts out of with, the file f closes, and the line below it
(still indented deeper) becomes the body of the outer statement
instead. The module still imports. The bug only fires when the
specific function is called.
Real symptom caught during a blade-build py2-shim cleanup:
# before (correct)
def dump(self, output_file_name):
with open(output_file_name, 'w') as f:
print('# header', file=f)
for name, value in sorted(iteritems(self.configs)):
self._dump_section(name, value, f)
A replace_in_file meant to rewrite only the for line used
old_string starting after the with, and the tool re-emitted the
for with the method-body indent (8 spaces) instead of the
with-body indent (12 spaces):
# after (broken but syntactically valid)
def dump(self, output_file_name):
with open(output_file_name, 'w') as f:
print('# header', file=f)
for name, value in sorted(self.configs.items()): # ← escaped the `with`
self._dump_section(name, value, f) # ← over-indented, still legal
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.
- 3d ago First seen · 188 lines · 30 tokens per session scan A f17b22b0afc8
python-indent-aware-edits is a skill published in the GitHub repository chen3feng/agent-skills (5 stars, last pushed 3mo ago), licensed Apache-2.0. It adds 30 tokens to every session and 1,858 once invoked, about $0.0002 per session on Opus 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
code-review-python
Deep Python-specific code review covering type annotations, async pitfalls, mutable defaults, threading safety, and domain modeling. Applied in addition to the generic code-review skill when Python code is detected. Invoked when reviewing Python PRs, Py changes, or performing Python-specific quality checks.
external-gitcode-ascend-python-refactoring
Python 代码重构技能,覆盖代码坏味道识别、设计模式应用、可读性改进和实战经验。当用户要求"重构代码"、"refactor"、"代码优化"、"改善代码质量"、"code smell review"、"应用设计模式"、"提升可读性",或提交代码审查请求时使用此技能。支持在重构完成后输出结构化重构文档("输出重构文档"、"生成重构报告")。包含基于 vllm-ascend 仓库 20+ 个真实重构 PR 提炼的实战模式。.
bump-dependency
Bumps a Python package dependency across Home Assistant Core integrations, regenerates core requirement files, runs verification tests and prek lint, and prepares a pull request with proper release/compare links.
mem0-vercel-ai-sdk
Mem0 provider for Vercel AI SDK (@mem0/vercel-ai-provider). TRIGGER when: user mentions "vercel ai sdk", "@mem0/vercel-ai-provider", "createMem0", "retrieveMemories", "addMemories", "getMemories", "searchMemories", "mem0 vercel", "AI SDK provider", "AI SDK memory", or is using generateText/streamText with mem0. Also…
schema-exploration
Lists tables, describes columns and data types, identifies foreign key relationships, and maps entity relationships in a database. Use when the user asks about database schema, table structure, column types, what tables exist, ERD, foreign keys, or how entities relate.
agent-framework-azure-ai-py
Build persistent agents on Azure AI Foundry using the Microsoft Agent Framework Python SDK.