comment-length-lint
PostToolUse hook — flags oversized comment blocks and docstrings on every `.py` you Edit/Write and forwards them non-blockingly; fail-open, no manual invocation.
- License 许可
- MIT
- 所属仓库
- muratovv/ai-hats
- 最近更新
- 2026-11-05
- Stars
- ★ 3
- Forks
- 1
01 前言 Front Matter
- name
- comment-length-lint
- ai_hats
- { "type": "skill", "schema_version": 1 }
- license
- MIT
- description
- PostToolUse hook — flags oversized comment blocks and docstrings on every `.py` you Edit/Write and forwards them non-blockingly; fail-open, no manual invocation.
02 资源文件 2
- 脚本hooks/bypass_journal.py35 B
- 脚本hooks/comment_length_lint.py7.8 KB
03 SKILL.md 正文
comment-length-lint
Thin registration shell for a PostToolUse runtime-hook: after every agent
Edit/Write/MultiEdit of a .py, oversized comment blocks (> 3 consecutive
# lines) and bloated docstrings (> 10 lines or > 700 chars) on the file are
forwarded to the agent via non-blocking additionalContext. Backstop for
dev_rule_comment_discipline — the few-shot guide is the primary defense; this
catches the shapes that slip past it. A deliberate long contract
suppresses a single finding with # comment-length: allow (in the block, on the
def/class line, or inside a module docstring); the legacy
noqa: comment-length still works but trips ruff's # noqa: parser as a bare
comment. Fail-open, kill switch
AI_HATS_COMMENT_LINT_OFF=1; thresholds tune via AI_HATS_COMMENT_MAX_LINES /
AI_HATS_DOCSTRING_MAX_LINES / AI_HATS_DOCSTRING_MAX_CHARS. Full contract in
the hook header: hooks/comment_length_lint.py.
04 同仓库更多 Skills
tool-evaluation-protocol
Time-bounded protocol for evaluating new tools, libraries, or methodologies before adoption. Use when evaluating a candidate dependency for the project, researching a methodology (e.g. ML/LLM frameworks, testing approaches), or following up on a hype-driven recommendation.
systematic-debugging
4-phase bug-fix protocol (evidence, pattern, hypothesis, verify). Use when investigating any error, failure, or unexpected behavior, handling bug reports from users or monitoring, or diagnosing test failures with non-obvious causes.
skill-template
Canonical template and validation guide for ai-hats skills. Use when creating a new skill, reviewing an existing one for structural compliance, or deciding which pattern fits a new behavior.
skill-optimization
Audit and refactor library components to eliminate redundancy and staleness. Use during periodic library maintenance, after adding multiple new skills or rules, when a role's token budget is too high, or after retrospectives identify component issues.
silent-fallback-gate
PreToolUse hook — refuses an Edit or Write that adds an inert broad except. Use when a Python edit was blocked for a silent fallback.
retro-to-framework
Convert an observation about agent behavior — from a retrospective or from a single incident — into a framework-level change (hook, rule, skill, skill update). Use after a retrospective identifies problems that are not project-specific, after an incident where an agent misapplied a component it had read, when CLAUDE.md band-aids accumulate (more than 3 per-project rules that could be generic), or when the same problem recurs across multiple projects.