ask-python-refactor

📁 navanithans/agent-skill-kit 📅 13 days ago
2
总安装量
2
周安装量
#69715
全站排名
安装命令
npx skills add https://github.com/navanithans/agent-skill-kit --skill ask-python-refactor

Agent 安装分布

gemini-cli 2
qoder 2
replit 2
antigravity 2
codebuddy 2
qwen-code 2

Skill 文档

<critical_constraints> ❌ NO refactoring without tests first ❌ NO single-letter variables (n, x) → use descriptive names ❌ NO functions >20 lines → extract smaller functions ✅ MUST run tests after every change ✅ MUST commit frequently for easy rollback </critical_constraints>

<code_smells>

  • Duplicated code → extract to shared function
  • Long parameter lists → group into dataclass
  • Deep nesting → use early returns/guard clauses
  • Magic numbers → replace with named constants </code_smells>

Type Hints

def get_user(user_id: int) -> Optional[User]:
    return db.find(user_id)