OpenParable
Skip to content
← Back to skills

Hello Arch

Development
hello-arch

Hello Arch is an Agent Skill for development published in the hellowind777/helloagents repository on GitHub: a SKILL.md instruction file an AI agent can load to do this task.

重构代码、调整模块结构、管理依赖、拆分文件、提取组件、设计系统架构或做代码组织决策时使用。

View on GitHub ↗
QUICK START

How to use this skill

Bring this guide into your coding agent with a prompt tailored to the tool you use.

  1. Open your project in Codex.
  2. Copy and paste the prompt below.
  3. Review files and risks before approving any action.
Prompt to paste
Inspect the Agent Skill at https://github.com/hellowind777/helloagents/blob/HEAD/skills/hello-arch/SKILL.md and all supporting files. Report provenance, permissions, scripts, dependencies, and security risks. Propose an exact installation into .agents/skills/hello-arch, but wait for my approval before writing files or running scripts.

Copying this prompt does not install or run the skill. Review third-party files before use.

架构相关变更必须遵循以下规范。

编码前

先画出当前→目标依赖关系和变更路径,再写代码。

SOLID 原则

  • 单一职责:一个模块/类只做一件事,变更只有一个原因
  • 开闭原则:扩展开放,修改关闭——新功能通过扩展实现
  • 依赖倒置:高层不依赖低层,都依赖抽象(接口/协议)

边界与分层

  • 清晰的模块边界,通过接口通信
  • 依赖方向:外层 → 内层(UI → Service → Repository)
  • 循环依赖 = 架构问题,必须解决
  • 配置与代码分离,环境变量管理

代码组织

  • 按功能分组(feature-based),非按类型分组
  • 代码体积控制(同 HelloAGENTS 编码原则):文件/类预警 300 行、强制拆分 400 行,函数预警 40 行、强制拆分 60 行。例外:生成代码、大型测试夹具、迁移脚本、协议常量表
  • 公共逻辑提取到 shared/,但避免过早抽象
  • 三次重复才提取——两次相似不够

变更策略

  • 评估变更的影响范围(blast radius)
  • 大重构分步进行,每步可独立验证和回滚
  • 区分真实外部契约与内部实现惯性:公开 API、持久化数据、已文档化集成、用户承诺等真实契约要评估兼容与迁移;内部调用方、旧命名、旧目录结构和历史兼容层不自动保留,必要时先按核心规则判断目标模型,再按分阶段路径落地

交付检查

  • 无循环依赖
  • 文件/类不超过 400 行,函数不超过 60 行(例外类型除外,非压缩代码)
  • 依赖方向正确(外 → 内)
  • 变更范围可控
  • 技术方案符合 HelloAGENTS 技术选型原则;若当前模式未加载实现要求中的工程质量下限,则至少满足技术选型原则且新项目无过时依赖