agentleFS
codyraocodyrao/agent-skills/code-architecture/SKILL.md

code-architecture

Skill1 starsChanged 10 months agoMITView on GitHub

当用户需要生成代码或修改代码时,此技能用于指导代码的文件结构组织。根据代码语言和项目类型(Go、JavaScript、Vue、React、Angular、Electron、Node.js等),按照各语言的官方规范和最佳实践来组织代码文件结构,确保代码结构清晰、易于维护和扩展。

7 other projects use a version of this.

Adopted by

Most recently taken up by

Used with

Projects with it also use debugging.

Other files people use alongside this one.

Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
  • BlockSkill

    debugging

    Debugging guidelines and best practices

    Also in 3 projects that use this

The file

Files
SKILL.md

代码架构技能

概述

本技能用于指导代码生成和代码修改时的文件结构组织。代码架构即文件组织架构遵循以下原则:

  1. 代码结构清晰:文件和目录的命名和组织应该清晰明了,易于理解
  2. 按各自语言的组织规范划分目录和文件名:遵循各编程语言的官方规范和最佳实践

工作流程

1. 识别代码语言和项目类型

  • 分析用户请求,确定代码语言(Go、JavaScript、Vue、React、Angular、Electron、Node.js 等)
  • 识别项目类型(前端、后端、桌面应用等)

2. 选择对应的架构规范

根据代码语言和项目类型,选择对应的 reference 文件:

  • Go 项目:使用 references/go.md
  • JavaScript 项目:使用 references/js.md
  • Vue 项目:使用 references/vue.md
  • React 项目:使用 references/react.md
  • Angular 项目:使用 references/angular.md
  • Electron 项目:使用 references/electron.md
  • Node.js 项目:使用 references/nodejs.md

3. 生成或调整代码结构

  • 按照选定的架构规范,生成新的代码文件结构
  • 对于代码修改,调整现有文件结构以符合规范
  • 确保所有文件和目录的命名符合规范

4. 验证代码结构

  • 检查生成的代码结构是否符合规范
  • 确保代码结构清晰、易于维护和扩展
  • 验证文件和目录的命名是否正确

输出格式

代码结构说明

项目根目录/
├── 目录1/
│   ├── 文件1
│   └── 文件2
├── 目录2/
│   └── 文件3
└── 文件4

文件说明

对于每个目录和文件,提供以下说明:

  • 目录/文件名
  • 功能说明
  • 放置的代码类型

注意事项

  1. 遵循语言规范:严格按照各编程语言的官方规范和最佳实践
  2. 保持一致性:整个项目的代码结构应保持一致
  3. 易于扩展:代码结构应支持未来的扩展和修改
  4. 模块化设计:合理划分模块,避免耦合度过高
  5. 文档同步:代码结构变更时,同步更新相关文档
  6. 测试分离:测试代码应与业务代码分离
  7. 配置管理:配置文件应统一管理
  8. 依赖管理:第三方依赖应统一管理

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

Reviews can't be read right now.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.