← Back to Skills Marketplace
jjflydudu

python-arch-optimizer

by test_heng · GitHub ↗ · v1.0.2 · MIT-0
cross-platform ✓ Security Clean
230
Downloads
0
Stars
1
Active Installs
3
Versions
Install in OpenClaw
/install python-arch-optimizer
Description
Python 项目架构优化技能。用于分析和重构 Python 项目结构,使其符合最佳实践。使用场景:(1) 评估现有项目架构,(2) 重构目录结构,(3) 优化依赖管理,(4) 改进代码组织,(5) 建立测试架构,(6) 配置 CI/CD
Usage Guidance
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.
Capability Analysis
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.
Capability Assessment
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.
How to Use
  1. Make sure OpenClaw is installed (local or Docker)
  2. Run the install command in chat: /install python-arch-optimizer
  3. After installation, invoke the skill by name or use /python-arch-optimizer
  4. Provide required inputs per the skill's parameter spec and get structured output
Version History
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 最佳实践"
Metadata
Slug python-arch-optimizer
Version 1.0.2
License MIT-0
All-time Installs 1
Active Installs 1
Total Versions 3
Frequently Asked Questions

What is python-arch-optimizer?

Python 项目架构优化技能。用于分析和重构 Python 项目结构,使其符合最佳实践。使用场景:(1) 评估现有项目架构,(2) 重构目录结构,(3) 优化依赖管理,(4) 改进代码组织,(5) 建立测试架构,(6) 配置 CI/CD. It is an AI Agent Skill for Claude Code / OpenClaw, with 230 downloads so far.

How do I install python-arch-optimizer?

Run "/install python-arch-optimizer" in the OpenClaw or Claude Code chat to install it in one step — no extra setup required.

Is python-arch-optimizer free?

Yes, python-arch-optimizer is completely free, licensed under MIT-0. You can download, install and use it at no cost.

Which platforms does python-arch-optimizer support?

python-arch-optimizer is cross-platform and runs anywhere OpenClaw / Claude Code is available (cross-platform).

Who created python-arch-optimizer?

It is built and maintained by test_heng (@jjflydudu); the current version is v1.0.2.

💬 Comments