一键导入
flint-generate
Generate flint rules from CLAUDE.md, AGENTS.md, or other project documentation. Use to bootstrap rules from existing conventions.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Generate flint rules from CLAUDE.md, AGENTS.md, or other project documentation. Use to bootstrap rules from existing conventions.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
Scans code for potential violations using fast heuristics (regex, ruff). Use when asked to check code quality, find issues, lint code, or generate a violation checklist.
Execute a fix task from the planner. Use to apply specific fixes to a single file as a parallel worker.
Plan fixes for confirmed violations. Use after flint-review to create independent fix tasks for parallel execution.
Fast triage of flint checklist. Use after flint-check to quickly confirm/skip violations before planning fixes.
Orchestrates checklist-driven linting for code. Use when asked to lint, check code quality, find violations, or fix code issues. Coordinates check, review, plan, and fix phases using optimal models.
| name | flint-generate |
| description | Generate flint rules from CLAUDE.md, AGENTS.md, or other project documentation. Use to bootstrap rules from existing conventions. |
| allowed-tools | Read, Glob, Write |
| context | fork |
| agent | general-purpose |
| model | sonnet |
Extract linting rules from project documentation for Flint, a checklist-driven linting tool.
CLAUDE.mdAGENTS.md.cursorrules.claude/rules/*.mdOutput a YAML list of rules. NO top-level rules: key - just the list directly.
- Prefer pathlib over os.path
- description: Use 'is None' not '== None'
severity: warn
tags: [comparisons, style]
check:
any:
- contains: "== None"
- contains: "!= None"
fix: "Replace '== None' with 'is None'"
| Field | Required | Description |
|---|---|---|
| description | Yes | What the rule checks for (imperative: "Use X", "Avoid Y") |
| severity | No | error (must fix), warn (should fix, default), note (consider) |
| tags | No | Categories like [style], [security], [performance] |
| check | No | Pattern string or composable check object for detection |
| fix | No | How to fix violations of this rule |
| paths | No | Glob pattern to limit scope, e.g., "**/*.py" |
Checks can be:
check: "except\\s*:"
any, all, none:check:
any:
- matches: "\\beval\\s*\\("
- matches: "\\bexec\\s*\\("
check:
all:
- contains: "MIT"
- not_contains: "GPL"
Rules without checks require manual LLM review for every file.
error: "never", "must not", "always", "required" → strong mandateswarn: "should", "prefer", "avoid", "recommended" → best practices (default)note: "consider", "may want to", "optionally" → suggestions\\. for literal dot\\s* for optional whitespace\\b for word boundaries[^)]* for "anything except closing paren"# Function calls
"\\beval\\s*\\(" # eval(
"os\\.path\\.join\\(" # os.path.join(
# Imports
"from typing import.*List" # typing List import
"import os\\.path" # os.path import
# Comparisons
"== None" # None comparison
"== True" # Boolean comparison
# Definitions
"def \\w+\\([^)]*=\\s*\\[\\]" # Mutable default []
"class \\w+:" # Class definition
## Code Style
- Always use pathlib instead of os.path for file operations
- Prefer f-strings over .format() for string formatting
- Never use bare except clauses - always catch specific exceptions
## Security
- Never use eval() or exec() with user input
# Code Style
- description: Use pathlib instead of os.path
severity: warn
tags: [style, pathlib]
check: "os\\.path\\.(join|dirname|basename|exists)"
fix: "Replace os.path.X with pathlib.Path equivalents"
- description: Use f-strings instead of .format()
severity: warn
tags: [style, strings]
check: "\\.format\\("
fix: "Convert to f-string: f\"text {var}\""
- description: Never use bare except clauses
severity: error
tags: [exceptions, error-handling]
check: "except\\s*:"
fix: "Catch specific exception types"
# Security
- description: Never use eval() with untrusted input
severity: error
tags: [security]
check:
any:
- matches: "\\beval\\s*\\("
- matches: "\\bexec\\s*\\("
fix: "Use ast.literal_eval() or safer alternatives"
# 1. Initialize flint
flint init
# 2. Generate rules from docs
flint generate rules
# 3. Review generated rules
cat rules/generated.yaml
# 4. Run check
flint check src/
After generation, refine rules: