← 返回 Skills 市场
jjflydudu

python-arch-optimizer

作者 test_heng · GitHub ↗ · v1.0.2 · MIT-0
cross-platform ✓ 安全检测通过
230
总下载
0
收藏
1
当前安装
3
版本数
在 OpenClaw 中安装
/install python-arch-optimizer
功能描述
Python 项目架构优化技能。用于分析和重构 Python 项目结构,使其符合最佳实践。使用场景:(1) 评估现有项目架构,(2) 重构目录结构,(3) 优化依赖管理,(4) 改进代码组织,(5) 建立测试架构,(6) 配置 CI/CD
安全使用建议
This skill appears coherent and implements the behaviors it promises. Before running migrations: (1) always run with --dry-run and/or save the migration plan and review it, (2) ensure you point the scripts at the correct project path (don't run on / or system directories), (3) keep an external backup or commit changes to git before actual migration, and (4) prefer running initial tests in a disposable environment (container/VM) since the scripts will move/create files. Note the skill source/homepage is unknown — if provenance matters, review the included scripts yourself before use.
功能分析
Type: OpenClaw Skill Name: python-arch-optimizer Version: 1.0.2 The bundle is a legitimate utility designed to analyze and refactor Python project structures according to best practices. It includes scripts for project analysis (analyze_project.py), template generation (generate_structure.py), and automated migration (migrate_project.py). The migration logic incorporates robust safety features, including mandatory user confirmation, dry-run modes, automatic directory backups using shutil.copytree, and a rollback mechanism in case of failure. No evidence of data exfiltration, malicious execution, or prompt injection was found; the code is transparent and strictly follows its stated purpose.
能力评估
Purpose & Capability
Name/description (Python project architecture analysis and refactor) align with provided scripts: analyze_project.py, generate_structure.py, migrate_project.py and a best-practices doc. All required behaviors (scan, generate template, migrate) are implemented and there are no unrelated requirements (no cloud creds, no unrelated binaries).
Instruction Scope
SKILL.md describes running the three scripts and warns about file changes; the scripts implement analysis, plan generation, dry-run, backup, user confirmation, execution and rollback as documented. The instructions do not request reading other system secrets or sending data externally.
Install Mechanism
There is no install specification (instruction-only with bundled scripts). No downloads or external installers are used. The code is present in the package and executed locally.
Credentials
The skill requires no environment variables, credentials, or config-path access. The scripts operate only on the project path provided by the user and generate local backups; they do not read or transmit secrets.
Persistence & Privilege
The skill is not always-enabled and does not modify other skills or system-wide agent settings. It performs file-system writes to the project directory chosen by the user and writes backups alongside that directory — behavior is proportional to its purpose.
如何使用
  1. 确保已安装 OpenClaw(本地或 Docker 部署)
  2. 在对话框中输入安装命令:/install python-arch-optimizer
  3. 安装完成后,直接呼叫该 Skill 的名称或使用 /python-arch-optimizer 触发
  4. 根据 Skill 的参数说明提供必要输入,即可获得结构化输出
版本历史
v1.0.2
- 迁移脚本的执行确认方式,新增支持 "yes"、"y"、"确认"、"是" 等多种表达。 - 其余内容无变更。
v1.0.1
- 增加 scripts/migrate_project.py 迁移脚本,支持执行目录重组与结构迁移。 - 新增迁移操作安全机制:自动备份、--dry-run 预览、失败自动回滚、迁移需用户确认。 - SKILL.md 优化:详细说明迁移步骤与脚本使用方法,加强安全警告与回滚策略说明。
v1.0.0
--- name: python-arch-optimizer description: Python 项目架构优化技能。用于分析和重构 Python 项目结构,使其符合最佳实践。使用场景:(1) 评估现有项目架构,(2) 重构目录结构,(3) 优化依赖管理,(4) 改进代码组织,(5) 建立测试架构,(6) 配置 CI/CD --- # Python 架构优化器 本技能帮助优化 Python 项目的整体架构,使其更符合现代 Python 工程最佳实践。 ## 核心能力 ### 1. 目录结构优化 - 按功能/模块划分项目 - 分离配置、业务逻辑、测试 - 符合 PEP 8 和 Python 社区惯例 ### 2. 依赖管理 - `requirements.txt` / `pyproject.toml` / `poetry` 配置 - 依赖分类(生产/开发/可选) - 版本锁定策略 ### 3. 代码组织 - 包/模块设计 - 导入结构优化 - 关注点分离 ### 4. 测试架构 - pytest 配置 - 测试目录结构 - 覆盖率配置 ### 5. 工程化配置 - pre-commit 钩子 - linting 配置(ruff/black/mypy) - CI/CD 模板 ## 工作流程 ### 步骤 1: 分析现有架构 ```bash # 使用分析脚本 python scripts/analyze_project.py <project-path> ``` 读取项目结构,识别问题: - 循环依赖 - 过深的嵌套 - 缺失的 `__init__.py` - 测试覆盖率低 - 配置硬编码 ### 步骤 2: 生成优化建议 参考 `references/best-practices.md` 生成具体建议。 ### 步骤 3: 执行重构 根据用户确认,执行: - 目录重组 - 文件移动 - 配置文件生成 ### 步骤 4: 验证 运行测试和 lint 检查确保重构后功能正常。 ## 参考文档 - **最佳实践**: `references/best-practices.md` - Python 项目架构详细指南 - **模板**: `references/templates.md` - 标准项目模板 ## 脚本工具 - `scripts/analyze_project.py` - 项目结构分析 - `scripts/generate_structure.py` - 生成推荐结构 - `scripts/migrate_project.py` - 执行迁移 ## 触发条件 当用户提到: - "优化 Python 项目结构" - "重构 Python 代码架构" - "Python 项目目录怎么组织" - "改进 Python 工程化" - "Python 最佳实践"
元数据
Slug python-arch-optimizer
版本 1.0.2
许可证 MIT-0
累计安装 1
当前安装数 1
历史版本数 3
常见问题

python-arch-optimizer 是什么?

Python 项目架构优化技能。用于分析和重构 Python 项目结构,使其符合最佳实践。使用场景:(1) 评估现有项目架构,(2) 重构目录结构,(3) 优化依赖管理,(4) 改进代码组织,(5) 建立测试架构,(6) 配置 CI/CD. 它是一个面向 Claude Code / OpenClaw 的 AI Agent Skill 插件,目前累计下载 230 次。

如何安装 python-arch-optimizer?

在 OpenClaw 或 Claude Code 对话框中运行命令「/install python-arch-optimizer」即可一键安装,无需额外配置。

python-arch-optimizer 是免费的吗?

是的,python-arch-optimizer 完全免费,采用 MIT-0 许可证,可自由下载、安装和使用。

python-arch-optimizer 支持哪些平台?

python-arch-optimizer 跨平台运行,可在任意部署了 OpenClaw / Claude Code 的环境中使用(cross-platform)。

谁开发了 python-arch-optimizer?

由 test_heng(@jjflydudu)开发并维护,当前版本 v1.0.2。

💬 留言讨论