refactor(i18n): 重构中文文档结构并同步更新链接
主要变更:
1. **目录重命名**:
* 将 下的 , , 重命名为中文的 , , 。
2. **新增新手入门**:
* 创建 目录,为新用户提供入门指南。
3. **文件迁移与清理**:
* 将原有文档迁移到新的中文目录结构下。
* 删除了部分过时或重复的中文文档。
4. **链接与脚本同步**:
* 更新了根 , 以及 中所有指向旧路径的链接。
* 修改了 下的英文文档,以反映中文文档的结构变化。
* 更新了 翻译脚本,使其能够处理新的中文路径。
此次重构统一了中文文档的目录命名,使其更符合中文用户的习惯,并优化了整体文档的组织结构,提升了可维护性。
This commit is contained in:
parent
9b42dd10dd
commit
e239f9e4b8
|
|
@ -3,7 +3,7 @@
|
|||
## Project Structure & Module Organization
|
||||
- 根目录:`README.md` 给出全貌,`Makefile` 封装日常命令,`CONTRIBUTING.md` 说明贡献流程,`LICENSE` 载明协议。保持根目录扁平,避免巨石文件。
|
||||
- 多语言 i18n:`i18n/<lang>/` 统一三层结构(documents / prompts / skills)。现有语言:中文 `zh`、英文 `en`、希伯来语 `he`,以及高频/常用的 `es`、`hi`、`ar`、`pt`、`ru`、`fr`、`de`、`ja`、`ko`、`it`、`tr`、`nl`、`pl`、`id`、`vi`、`th`、`fa`、`uk`、`bn`、`ta`、`ur`、`ms`、`sw`、`ha`;新增语言遵循同样层级。
|
||||
- 文档库:`i18n/zh/documents/` 仍是默认中文方法论入口(如 `i18n/zh/documents/Templates and Resources/代码组织.md` 等),新增语言文档按需在对应 `documents/` 下创建并保持同步。
|
||||
- 文档库:`i18n/zh/documents/` 仍是默认中文方法论入口(如 `i18n/zh/documents/模板与资源/代码组织.md` 等),新增语言文档按需在对应 `documents/` 下创建并保持同步。
|
||||
- 提示词资产:`i18n/zh/prompts/` 按角色拆分(system / assistant / coding / user),`libs/external/prompts-library/` 提供 Excel ↔ Markdown 互转工具与脚本目录,便于批量维护提示词,适合作为“单一真实来源”。
|
||||
- 代码与集成:`libs/` 预留核心实现骨架,`common/`、`database/`、`external/` 分别对应通用模型、存储适配与外部依赖登记;新增模块需保持分层边界与单一职责,避免跨层调用。
|
||||
- 备份:`backups/` 内含 `一键备份.sh` 与 `快速备份.py`,用于本地快照或同步,请先在隔离目录试跑,确认输出路径与权限。
|
||||
|
|
@ -18,7 +18,7 @@
|
|||
- 文字层:文档、注释、日志使用中文;代码符号(函数 / 变量 / 模块)统一英文且语义直白,避免晦涩缩写。
|
||||
- 缩进与排版:全仓保持空格缩进(2 或 4 空格任选其一但不得混用);Markdown 列表、代码块与表格对齐清晰,行宽控制在 120 列内。Git diff 可读性优先。
|
||||
- 设计品味:优先消除分支与重复;函数力求单一职责且短小;命名遵循小写加中划线或下划线,不使用空格与特殊字符;跨模块接口保持稳定签名。
|
||||
- 依赖管理:新增工具或库时记录安装方式、最小版本与来源,必要时在 `i18n/zh/documents/Templates and Resources/工具集.md` 或 README 中补充,并说明为何需要它(性能、兼容、功能)。
|
||||
- 依赖管理:新增工具或库时记录安装方式、最小版本与来源,必要时在 `i18n/zh/documents/模板与资源/工具集.md` 或 README 中补充,并说明为何需要它(性能、兼容、功能)。
|
||||
|
||||
## Testing Guidelines
|
||||
- 当前无实测用例;引入代码时请至少提供最小可复现测试。推荐 Python 使用 `pytest`,文件命名 `test_*.py`,夹具精简可读,遵循 red-green-refactor 循环。
|
||||
|
|
|
|||
38
README.md
38
README.md
|
|
@ -95,7 +95,7 @@
|
|||
|
||||
该思想的核心是构建一个能够**自我优化**的 AI 系统。其递归本质可分解为以下步骤:
|
||||
|
||||
> 延伸阅读:[A Formalization of Recursive Self-Optimizing Generative Systems](./i18n/zh/documents/Methodology%20and%20Principles/A%20Formalization%20of%20Recursive%20Self-Optimizing%20Generative%20Systems.md)
|
||||
> 延伸阅读:[A Formalization of Recursive Self-Optimizing Generative Systems](./i18n/zh/documents/方法论与原则/A%20Formalization%20of%20Recursive%20Self-Optimizing%20Generative%20Systems.md)
|
||||
|
||||
#### 1. 定义核心角色:
|
||||
|
||||
|
|
@ -199,10 +199,10 @@
|
|||
* [**第三方系统提示词学习库**](https://github.com/x1xhlol/system-prompts-and-models-of-ai-tools): 用于学习和参考其他 AI 工具的系统提示词。
|
||||
* [**Skills 制作器**](https://github.com/yusufkaraaslan/Skill_Seekers): 可根据需求生成定制化 Skills 的工具。
|
||||
* [**元提示词**](https://docs.google.com/spreadsheets/d/1ngoQOhJqdguwNAilCl1joNwTje7FWWN9WiI2bo5VhpU/edit?gid=1770874220#gid=1770874220): 用于生成提示词的高级提示词。
|
||||
* [**通用项目架构模板**](./i18n/zh/documents/Templates%20and%20Resources/通用项目架构模板.md): 可用于快速搭建标准化的项目目录结构。
|
||||
* [**通用项目架构模板**](./i18n/zh/documents/模板与资源/通用项目架构模板.md): 可用于快速搭建标准化的项目目录结构。
|
||||
* [**元技能:Skills 的 Skills**](./i18n/zh/skills/claude-skills/SKILL.md): 用于生成 Skills 的元技能。
|
||||
* [**tmux快捷键大全**](./i18n/zh/documents/Tutorials%20and%20Guides/tmux快捷键大全.md): tmux 的快捷键参考文档。
|
||||
* [**LazyVim快捷键大全**](./i18n/zh/documents/Tutorials%20and%20Guides/LazyVim快捷键大全.md): LazyVim 的快捷键参考文档。
|
||||
* [**tmux快捷键大全**](./i18n/zh/documents/教程与指南/tmux快捷键大全.md): tmux 的快捷键参考文档。
|
||||
* [**LazyVim快捷键大全**](./i18n/zh/documents/教程与指南/LazyVim快捷键大全.md): LazyVim 的快捷键参考文档。
|
||||
* [**二哥的Java进阶之路**](https://javabetter.cn/): 包含多种开发工具的详细配置教程。
|
||||
* [**虚拟卡**](https://www.bybit.com/cards/?ref=YDGAVPN&source=applet_invite): 可用于注册云服务等需要国际支付的场景。
|
||||
|
||||
|
|
@ -224,8 +224,8 @@
|
|||
* [Telegram 交流群](https://t.me/glue_coding)
|
||||
* [Telegram 频道](https://t.me/tradecat_ai_channel)
|
||||
* **个人分享**:
|
||||
* [我的学习经验](./i18n/zh/documents/Methodology%20and%20Principles/学习经验.md)
|
||||
* [编程书籍推荐](./i18n/zh/documents/Templates%20and%20Resources/编程书籍推荐.md)
|
||||
* [我的学习经验](./i18n/zh/documents/方法论与原则/学习经验.md)
|
||||
* [编程书籍推荐](./i18n/zh/documents/模板与资源/编程书籍推荐.md)
|
||||
* **核心资源**:
|
||||
* [**元提示词库**](https://docs.google.com/spreadsheets/d/1ngoQOhJqdguwNAilCl1joNwTje7FWWN9WiI2bo5VhpU/edit?gid=1770874220#gid=1770874220): 用于生成提示词的高级提示词集合。
|
||||
* [**元技能 (Meta-Skill)**](./i18n/zh/skills/claude-skills/SKILL.md): 用于生成 Skills 的 Skill。
|
||||
|
|
@ -236,10 +236,10 @@
|
|||
* **项目内部文档**:
|
||||
* [**prompts-library 工具说明**](./libs/external/prompts-library/): 该工具支持在 Excel 和 Markdown 格式之间转换提示词,并包含数百个精选提示词。
|
||||
* [**coding_prompts 集合**](./i18n/zh/prompts/coding_prompts/): 适用于 Vibe Coding 流程的专用提示词。
|
||||
* [**系统提示词构建原则**](./i18n/zh/documents/Methodology%20and%20Principles/系统提示词构建原则.md): 关于如何构建高效、可靠的 AI 系统提示词的综合指南。
|
||||
* [**开发经验总结**](./i18n/zh/documents/Methodology%20and%20Principles/开发经验.md): 包含变量命名、文件结构、编码规范、架构原则等实践经验。
|
||||
* [**通用项目架构模板**](./i18n/zh/documents/Templates%20and%20Resources/通用项目架构模板.md): 提供多种项目类型的标准目录结构与最佳实践。
|
||||
* [**Augment MCP 配置文档**](./i18n/zh/documents/Tutorials%20and%20Guides/auggie-mcp配置文档.md): Augment 上下文引擎的详细配置说明。
|
||||
* [**系统提示词构建原则**](./i18n/zh/documents/方法论与原则/系统提示词构建原则.md): 关于如何构建高效、可靠的 AI 系统提示词的综合指南。
|
||||
* [**开发经验总结**](./i18n/zh/documents/方法论与原则/开发经验.md): 包含变量命名、文件结构、编码规范、架构原则等实践经验。
|
||||
* [**通用项目架构模板**](./i18n/zh/documents/模板与资源/通用项目架构模板.md): 提供多种项目类型的标准目录结构与最佳实践。
|
||||
* [**Augment MCP 配置文档**](./i18n/zh/documents/教程与指南/auggie-mcp配置文档.md): Augment 上下文引擎的详细配置说明。
|
||||
* [**system_prompts 集合**](./i18n/zh/prompts/system_prompts/): 用于指导 AI 开发的系统提示词,包含多个版本的开发规范与思维框架。
|
||||
|
||||
---
|
||||
|
|
@ -261,9 +261,9 @@
|
|||
├── CLAUDE.md # AI 助手的核心行为准则或配置。
|
||||
│
|
||||
├── i18n/zh/documents/ # 存放各类说明文档、经验总结和配置详细说明。
|
||||
│ ├── Methodology and Principles/ # 方法论与原则
|
||||
│ ├── Templates and Resources/ # 模板与资源
|
||||
│ └── Tutorials and Guides/ # 教程与指南
|
||||
│ ├── 方法论与原则/ # 方法论与原则
|
||||
│ ├── 模板与资源/ # 模板与资源
|
||||
│ └── 教程与指南/ # 教程与指南
|
||||
│
|
||||
├── libs/ # 通用库代码,用于项目内部模块化。
|
||||
│ ├── common/ # 通用功能模块。
|
||||
|
|
@ -323,7 +323,7 @@ i18n/zh/prompts/
|
|||
assistant_prompts/ # 辅助/配合型提示
|
||||
user_prompts/ # 可复用的用户侧提示词
|
||||
i18n/zh/documents/
|
||||
Templates and Resources/代码组织.md, Templates and Resources/通用项目架构模板.md, Methodology and Principles/开发经验.md, Methodology and Principles/系统提示词构建原则.md 等知识库
|
||||
模板与资源/代码组织.md, 模板与资源/通用项目架构模板.md, 方法论与原则/开发经验.md, 方法论与原则/系统提示词构建原则.md 等知识库
|
||||
backups/
|
||||
一键备份.sh, 快速备份.py # 本地/远端快照脚本
|
||||
```
|
||||
|
|
@ -428,7 +428,15 @@ gantt
|
|||
|
||||
---
|
||||
|
||||
## 🚀 入门指南(这里是原作者的,不是我写的,我更新了一下我认为最好的模型)
|
||||
## 🚀 入门指南
|
||||
|
||||
### 🆕 完全新手?从这里开始!
|
||||
|
||||
1. [01-网络环境配置](./i18n/zh/documents/从零开始vibecoding/01-网络环境配置.md) - 配置网络访问
|
||||
2. [02-开发环境搭建](./i18n/zh/documents/从零开始vibecoding/02-开发环境搭建.md) - 复制提示词给 AI,让 AI 指导你搭建环境
|
||||
|
||||
### 已有开发环境?
|
||||
|
||||
要开始 Vibe Coding,你只需要以下两种工具之一:
|
||||
- **Claude Opus 4.5**,在 Claude Code 中使用
|
||||
- **gpt-5.1-codex.1-codex (xhigh)**,在 Codex CLI 中使用
|
||||
|
|
|
|||
|
|
@ -1,9 +1,8 @@
|
|||
TRANSLATED CONTENT:
|
||||
# 📖 文档库 (Documents)
|
||||
# 📖 Document Library (Documents)
|
||||
|
||||
`i18n/zh/documents/` 目录汇总项目的流程文档、架构说明、开发经验与最佳实践,是理解方法论与协作规则的首选入口。
|
||||
The `i18n/zh/documents/` directory summarizes project process documents, architecture descriptions, development experiences, and best practices, serving as the primary entry point for understanding methodologies and collaboration rules.
|
||||
|
||||
## 目录结构
|
||||
## Directory Structure
|
||||
|
||||
```
|
||||
i18n/zh/documents/
|
||||
|
|
@ -12,69 +11,69 @@ i18n/zh/documents/
|
|||
├── Methodology and Principles/
|
||||
│ ├── A Formalization of Recursive Self-Optimizing Generative Systems.md
|
||||
│ ├── gluecoding.md
|
||||
│ ├── vibe-coding-经验收集.md
|
||||
│ ├── 学习经验.md
|
||||
│ ├── 开发经验.md
|
||||
│ ├── 编程之道.md
|
||||
│ ├── 胶水编程.md
|
||||
│ └── 系统提示词构建原则.md
|
||||
│ ├── vibe-coding-Experience_Collection.md
|
||||
│ ├── Learning_Experience.md
|
||||
│ ├── Development_Experience.md
|
||||
│ ├── The_Way_of_Programming.md
|
||||
│ ├── Glue_Programming.md
|
||||
│ └── System_Prompt_Construction_Principles.md
|
||||
│
|
||||
├── Tutorials and Guides/
|
||||
│ ├── auggie-mcp配置文档.md
|
||||
│ ├── LazyVim快捷键大全.md
|
||||
│ ├── tmux快捷键大全.md
|
||||
│ ├── 关于手机ssh任意位置链接本地计算机,基于frp实现的方法.md
|
||||
│ ├── auggie-mcp_Configuration_Document.md
|
||||
│ ├── LazyVim_Shortcut_Cheatsheet.md
|
||||
│ ├── tmux_Shortcut_Cheatsheet.md
|
||||
│ ├── Method_for_SSH_Linking_Mobile_Phone_to_Local_Computer_Anywhere_Based_on_FRP_Implementation.md
|
||||
│ └── telegram-dev/
|
||||
│
|
||||
└── Templates and Resources/
|
||||
├── 代码组织.md
|
||||
├── 工具集.md
|
||||
├── 编程书籍推荐.md
|
||||
└── 通用项目架构模板.md
|
||||
├── Code_Organization.md
|
||||
├── Tool_Set.md
|
||||
├── Recommended_Programming_Books.md
|
||||
└── General_Project_Architecture_Template.md
|
||||
```
|
||||
|
||||
## 文档分类
|
||||
## Document Classification
|
||||
|
||||
### Methodology and Principles
|
||||
|
||||
此类别存放关于编程思想、开发哲学和项目核心原则的文档。
|
||||
This category contains documents about programming philosophy, development philosophy, and core project principles.
|
||||
|
||||
* `A Formalization of Recursive Self-Optimizing Generative Systems.md`
|
||||
* `gluecoding.md`
|
||||
* `vibe-coding-经验收集.md`
|
||||
* `学习经验.md`
|
||||
* `开发经验.md`
|
||||
* `编程之道.md`
|
||||
* `胶水编程.md`
|
||||
* `系统提示词构建原则.md`
|
||||
* `vibe-coding-Experience_Collection.md`
|
||||
* `Learning_Experience.md`
|
||||
* `Development_Experience.md`
|
||||
* `The_Way_of_Programming.md`
|
||||
* `Glue_Programming.md`
|
||||
* `System_Prompt_Construction_Principles.md`
|
||||
|
||||
### Tutorials and Guides
|
||||
|
||||
此类别存放具体工具的配置、使用指南和操作教程。
|
||||
This category contains configuration, usage guides, and operation tutorials for specific tools.
|
||||
|
||||
* `auggie-mcp配置文档.md`
|
||||
* `LazyVim快捷键大全.md`
|
||||
* `tmux快捷键大全.md`
|
||||
* `关于手机ssh任意位置链接本地计算机,基于frp实现的方法.md`
|
||||
* `auggie-mcp_Configuration_Document.md`
|
||||
* `LazyVim_Shortcut_Cheatsheet.md`
|
||||
* `tmux_Shortcut_Cheatsheet.md`
|
||||
* `Method_for_SSH_Linking_Mobile_Phone_to_Local_Computer_Anywhere_Based_on_FRP_Implementation.md`
|
||||
* `telegram-dev/`
|
||||
|
||||
### Templates and Resources
|
||||
|
||||
此类别存放可复用的项目模板、代码结构规范和资源列表。
|
||||
This category contains reusable project templates, code structure specifications, and resource lists.
|
||||
|
||||
* `代码组织.md`
|
||||
* `工具集.md`
|
||||
* `编程书籍推荐.md`
|
||||
* `通用项目架构模板.md`
|
||||
* `Code_Organization.md`
|
||||
* `Tool_Set.md`
|
||||
* `Recommended_Programming_Books.md`
|
||||
* `General_Project_Architecture_Template.md`
|
||||
|
||||
## 贡献新文档
|
||||
## Contribute New Documents
|
||||
|
||||
1. 将文档放置在最合适的分类目录中。
|
||||
2. 如果需要,可以创建新的分类目录。
|
||||
3. 更新本 README 文件以反映变更。
|
||||
1. Place documents in the most appropriate category directory.
|
||||
2. Create new category directories if needed.
|
||||
3. Update this README file to reflect changes.
|
||||
|
||||
## 相关资源
|
||||
## Related Resources
|
||||
|
||||
- [提示词库](../prompts/) - AI 提示词集合
|
||||
- [技能库](../skills/) - AI Skills 技能
|
||||
- [通用库](../libs/) - 工具与外部集成
|
||||
- [Prompt Library](../prompts/) - AI Prompt Collection
|
||||
- [Skill Library](../skills/) - AI Skills
|
||||
- [General Library](../libs/) - Tools and External Integrations
|
||||
|
|
@ -1,461 +1,71 @@
|
|||
TRANSLATED CONTENT:
|
||||
# 通用项目架构模板
|
||||
# General Project Architecture Template
|
||||
|
||||
## 1️⃣ Python Web/API 项目标准结构
|
||||
## 1️⃣ Standard Structure for Python Web/API Projects
|
||||
|
||||
```
|
||||
项目名称/
|
||||
├── README.md # 项目说明文档
|
||||
├── LICENSE # 开源协议
|
||||
├── requirements.txt # 依赖管理(pip)
|
||||
├── pyproject.toml # 现代Python项目配置(推荐)
|
||||
├── setup.py # 包安装脚本(如果做成库)
|
||||
├── .gitignore # Git忽略文件
|
||||
├── .env # 环境变量(不提交到Git)
|
||||
├── .env.example # 环境变量示例
|
||||
├── CLAUDE.md # claude持久上下文
|
||||
├── AGENTS.md # codex持久上下文
|
||||
├── Sublime-Text.txt # 放需求和注意事项,给自己看的,和cli的会话恢复指令^_^
|
||||
ProjectName/
|
||||
├── README.md # Project description document
|
||||
├── LICENSE # Open-source license
|
||||
├── requirements.txt # Dependency management (pip)
|
||||
├── pyproject.toml # Modern Python project configuration (recommended)
|
||||
├── setup.py # Package installation script (if used as a library)
|
||||
├── .gitignore # Git ignore file
|
||||
├── .env # Environment variables (not committed to Git)
|
||||
├── .env.example # Example environment variables
|
||||
├── CLAUDE.md # Claude persistent context
|
||||
├── AGENTS.md # Codex persistent context
|
||||
├── Sublime-Text.txt # For demands and notes, for myself, and CLI session recovery commands ^_^
|
||||
│
|
||||
├── docs/ # 文档目录
|
||||
│ ├── api.md # API文档
|
||||
│ ├── development.md # 开发指南
|
||||
│ └── architecture.md # 架构说明
|
||||
├── docs/ # Documentation directory
|
||||
│ ├── api.md # API documentation
|
||||
│ ├── development.md # Development guide
|
||||
│ └── architecture.md # Architecture description
|
||||
│
|
||||
├── scripts/ # 脚本工具
|
||||
│ ├── deploy.sh # 部署脚本
|
||||
│ ├── backup.sh # 备份脚本
|
||||
│ └── init_db.sh # 数据库初始化
|
||||
├── scripts/ # Script tools
|
||||
│ ├── deploy.sh # Deployment script
|
||||
│ ├── backup.sh # Backup script
|
||||
│ └── init_db.sh # Database initialization
|
||||
│
|
||||
├── tests/ # 测试代码
|
||||
├── tests/ # Test code
|
||||
│ ├── __init__.py
|
||||
│ ├── conftest.py # pytest配置
|
||||
│ ├── unit/ # 单元测试
|
||||
│ ├── integration/ # 集成测试
|
||||
│ └── test_config.py # 配置测试
|
||||
│ ├── conftest.py # Pytest configuration
|
||||
│ ├── unit/ # Unit tests
|
||||
│ ├── integration/ # Integration tests
|
||||
│ └── test_config.py # Configuration tests
|
||||
│
|
||||
├── src/ # 源代码(推荐方式)
|
||||
├── src/ # Source code (recommended)
|
||||
│ ├── __init__.py
|
||||
│ ├── main.py # 程序入口
|
||||
│ ├── app.py # Flask/FastAPI应用
|
||||
│ ├── config.py # 配置管理
|
||||
│ ├── main.py # Program entry point
|
||||
│ ├── app.py # Flask/FastAPI application
|
||||
│ ├── config.py # Configuration management
|
||||
│ │
|
||||
│ ├── core/ # 核心业务逻辑
|
||||
│ ├── core/ # Core business logic
|
||||
│ │ ├── __init__.py
|
||||
│ │ ├── models/ # 数据模型
|
||||
│ │ ├── services/ # 业务服务
|
||||
│ │ └── utils/ # 工具函数
|
||||
│ │ ├── models/ # Data models
|
||||
│ │ ├── services/ # Business services
|
||||
│ │ └── utils/ # Utility functions
|
||||
│ │
|
||||
│ ├── api/ # API接口层
|
||||
│ ├── api/ # API interface layer
|
||||
│ │ ├── __init__.py
|
||||
│ │ ├── v1/ # 版本1
|
||||
│ │ ├── v1/ # Version 1
|
||||
│ │ └── dependencies.py
|
||||
│ │
|
||||
│ ├── data/ # 数据处理
|
||||
│ ├── data/ # Data processing
|
||||
│ │ ├── __init__.py
|
||||
│ │ ├── repository/ # 数据访问层
|
||||
│ │ └── migrations/ # 数据库迁移
|
||||
│ │ ├── repository/ # Data access layer
|
||||
│ │ └── migrations/ # Database migrations
|
||||
│ │
|
||||
│ └── external/ # 外部服务
|
||||
│ └── external/ # External services
|
||||
│ ├── __init__.py
|
||||
│ ├── clients/ # API客户端
|
||||
│ └── integrations/ # 集成服务
|
||||
│ ├── clients/ # API clients
|
||||
│ └── integrations/ # Integration services
|
||||
│
|
||||
├── logs/ # 日志目录(不提交到Git)
|
||||
├── logs/ # Log directory (not committed to Git)
|
||||
│ ├── app.log
|
||||
│ └── error.log
|
||||
│
|
||||
└── data/ # 数据目录(不提交到Git)
|
||||
├── raw/ # 原始数据
|
||||
├── processed/ # 处理后的数据
|
||||
└── cache/ # 缓存
|
||||
```
|
||||
|
||||
**使用场景**:Flask/FastAPI Web应用、RESTful API服务、Web后端
|
||||
|
||||
---
|
||||
|
||||
## 2️⃣ 数据科学/量化项目标准结构
|
||||
|
||||
```
|
||||
项目名称/
|
||||
├── README.md
|
||||
├── LICENSE
|
||||
├── requirements.txt
|
||||
├── .gitignore
|
||||
├── .env
|
||||
├── .env.example
|
||||
├── CLAUDE.md # claude持久上下文
|
||||
├── AGENTS.md # codex持久上下文
|
||||
├── Sublime-Text.txt # 放需求和注意事项,给自己看的,和cli的会话恢复指令^_^
|
||||
│
|
||||
├── docs/ # 文档目录
|
||||
│ ├── notebooks/ # Jupyter文档
|
||||
│ └── reports/ # 分析报告
|
||||
│
|
||||
├── notebooks/ # Jupyter Notebook
|
||||
│ ├── 01_data_exploration.ipynb
|
||||
│ ├── 02_feature_engineering.ipynb
|
||||
│ └── 03_model_training.ipynb
|
||||
│
|
||||
├── scripts/ # 脚本工具
|
||||
│ ├── train_model.py # 训练脚本
|
||||
│ ├── backtest.py # 回测脚本
|
||||
│ ├── collect_data.py # 数据采集
|
||||
│ └── deploy_model.py # 模型部署
|
||||
│
|
||||
├── tests/ # 测试
|
||||
│ ├── test_data/
|
||||
│ └── test_models/
|
||||
│
|
||||
├── configs/ # 配置文件
|
||||
│ ├── model.yaml
|
||||
│ ├── database.yaml
|
||||
│ └── trading.yaml
|
||||
│
|
||||
├── src/ # 源代码
|
||||
│ ├── __init__.py
|
||||
│ │
|
||||
│ ├── data/ # 数据处理模块
|
||||
│ │ ├── __init__.py
|
||||
│ │ ├── collectors/ # 数据采集器
|
||||
│ │ ├── processors/ # 数据清洗
|
||||
│ │ ├── features/ # 特征工程
|
||||
│ │ └── loaders.py # 数据加载
|
||||
│ │
|
||||
│ ├── models/ # 模型模块
|
||||
│ │ ├── __init__.py
|
||||
│ │ ├── strategies/ # 交易策略
|
||||
│ │ ├── backtest/ # 回测引擎
|
||||
│ │ └── risk/ # 风险管理
|
||||
│ │
|
||||
│ ├── utils/ # 工具模块
|
||||
│ │ ├── __init__.py
|
||||
│ │ ├── logging.py # 日志配置
|
||||
│ │ ├── database.py # 数据库工具
|
||||
│ │ └── api_client.py # API客户端
|
||||
│ │
|
||||
│ └── core/ # 核心模块
|
||||
│ ├── __init__.py
|
||||
│ ├── config.py # 配置管理
|
||||
│ ├── signals.py # 信号生成
|
||||
│ └── portfolio.py # 投资组合
|
||||
│
|
||||
├── data/ # 数据目录(Git忽略)
|
||||
│ ├── raw/ # 原始数据
|
||||
│ ├── processed/ # 处理后数据
|
||||
│ ├── external/ # 外部数据
|
||||
│ └── cache/ # 缓存
|
||||
│
|
||||
├── models/ # 模型文件(Git忽略)
|
||||
│ ├── checkpoints/ # 检查点
|
||||
│ └── exports/ # 导出模型
|
||||
│
|
||||
└── logs/ # 日志(Git忽略)
|
||||
├── trading.log
|
||||
└── errors.log
|
||||
```
|
||||
|
||||
**使用场景**:量化交易、机器学习、数据分析、AI研究
|
||||
|
||||
---
|
||||
|
||||
## 3️⃣ Monorepo(多项目仓库)标准结构
|
||||
|
||||
```
|
||||
项目名称-monorepo/
|
||||
├── README.md
|
||||
├── LICENSE
|
||||
├── .gitignore
|
||||
├── .gitmodules # Git子模块
|
||||
├── docker-compose.yml # Docker编排
|
||||
├── CLAUDE.md # claude持久上下文
|
||||
├── AGENTS.md # codex持久上下文
|
||||
├── Sublime-Text.txt # 这个是文件,放需求和注意事项,给自己看的,和cli的会话恢复指令^_^
|
||||
│
|
||||
├── docs/ # 全局文档
|
||||
│ ├── architecture.md
|
||||
│ └── deployment.md
|
||||
│
|
||||
├── scripts/ # 全局脚本
|
||||
│ ├── build_all.sh
|
||||
│ ├── test_all.sh
|
||||
│ └── deploy.sh
|
||||
│
|
||||
├── backups/ # 放备份文件
|
||||
│ ├── archive/ # 放旧的备份文件
|
||||
│ └── gz/ # 放备份文件的gz
|
||||
│
|
||||
├── services/ # 微服务目录
|
||||
│ │
|
||||
│ ├── user-service/ # 用户服务
|
||||
│ │ ├── Dockerfile
|
||||
│ │ ├── requirements.txt
|
||||
│ │ ├── src/
|
||||
│ │ └── tests/
|
||||
│ │
|
||||
│ ├── trading-service/ # 交易服务
|
||||
│ │ ├── Dockerfile
|
||||
│ │ ├── requirements.txt
|
||||
│ │ ├── src/
|
||||
│ │ └── tests/
|
||||
│ ...
|
||||
│ └── data-service/ # 数据服务
|
||||
│ ├── Dockerfile
|
||||
│ ├── requirements.txt
|
||||
│ ├── src/
|
||||
│ └── tests/
|
||||
│
|
||||
├── libs/ # 共享库
|
||||
│ ├── common/ # 公共模块
|
||||
│ │ ├── utils/
|
||||
│ │ └── models/
|
||||
│ ├── external/ # 第三方库(不可修改,只调用)
|
||||
│ └── database/ # 数据库访问库
|
||||
│
|
||||
├── infrastructure/ # 基础设施
|
||||
│ ├── terraform/ # 云资源定义
|
||||
│ ├── kubernetes/ # K8s配置
|
||||
│ └── nginx/ # 反向代理配置
|
||||
│
|
||||
└── monitoring/ # 监控系统
|
||||
├── prometheus/ # 指标收集
|
||||
├── grafana/ # 可视化
|
||||
└── alertmanager/ # 告警
|
||||
```
|
||||
|
||||
**使用场景**:微服务架构、大型项目、团队协作
|
||||
|
||||
---
|
||||
|
||||
## 4️⃣ Full-Stack Web 应用标准结构
|
||||
|
||||
```
|
||||
项目名称/
|
||||
├── README.md
|
||||
├── LICENSE
|
||||
├── .gitignore
|
||||
├── docker-compose.yml # 前后端一起编排
|
||||
├── CLAUDE.md # claude持久上下文
|
||||
├── AGENTS.md # codex持久上下文
|
||||
├── Sublime-Text.txt # 放需求和注意事项,给自己看的,和cli的会话恢复指令^_^
|
||||
│
|
||||
├── frontend/ # 前端目录
|
||||
│ ├── public/ # 静态资源
|
||||
│ ├── src/ # 源码
|
||||
│ │ ├── components/ # React/Vue组件
|
||||
│ │ ├── pages/ # 页面
|
||||
│ │ ├── store/ # 状态管理
|
||||
│ │ └── utils/ # 工具
|
||||
│ ├── package.json # NPM依赖
|
||||
│ └── vite.config.js # 构建配置
|
||||
│
|
||||
└── backend/ # 后端目录
|
||||
├── requirements.txt
|
||||
├── Dockerfile
|
||||
├── src/
|
||||
│ ├── api/ # API接口
|
||||
│ ├── core/ # 业务逻辑
|
||||
│ │ └── models/ # 数据模型
|
||||
└── tests/
|
||||
```
|
||||
|
||||
**使用场景**:全栈应用、SPA单页应用、前后端分离项目
|
||||
|
||||
---
|
||||
|
||||
## 📌 核心设计原则
|
||||
|
||||
### 1. 关注点分离(Separation of Concerns)
|
||||
```
|
||||
API → 服务 → 数据访问 → 数据库
|
||||
一目了然,层级清晰
|
||||
```
|
||||
|
||||
### 2. 可测试性(Testability)
|
||||
```
|
||||
每个模块可独立测试
|
||||
依赖可mock
|
||||
```
|
||||
|
||||
### 3. 可配置性(Configurability)
|
||||
```
|
||||
配置与代码分离
|
||||
环境变量 > 配置文件 > 默认值
|
||||
```
|
||||
|
||||
### 4. 可维护性(Maintainability)
|
||||
```
|
||||
代码自解释
|
||||
合理的文件命名
|
||||
清晰的目录结构
|
||||
```
|
||||
|
||||
### 5. 版本控制友好(Git-Friendly)
|
||||
```
|
||||
data/、logs/、models/ 添加到 .gitignore
|
||||
只提交源代码和配置示例
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## 🎯 最佳实践建议
|
||||
|
||||
1. **使用 `src/` 目录**:把源代码放在专门的src目录,避免顶级目录混乱
|
||||
2. **相对导入**:统一使用 `from src.module import thing` 的导入方式
|
||||
3. **测试覆盖**:保证核心业务逻辑有单元测试和集成测试
|
||||
4. **文档先行**:重要模块都要写README.md说明
|
||||
5. **环境隔离**:使用virtualenv或conda创建独立环境
|
||||
6. **依赖明确**:所有依赖都写入requirements.txt,并锁定版本
|
||||
7. **配置管理**:使用环境变量 + 配置文件的组合方式
|
||||
8. **日志分级**:DEBUG、INFO、WARNING、ERROR、FATAL
|
||||
9. **错误处理**:不要吞掉异常,要有完整的错误链
|
||||
10. **代码规范**:使用black格式化,flake8检查
|
||||
|
||||
---
|
||||
|
||||
## 🔥 .gitignore 推荐模板
|
||||
|
||||
```gitignore
|
||||
# Python
|
||||
__pycache__/
|
||||
*.py[cod]
|
||||
*$py.class
|
||||
*.so
|
||||
.Python
|
||||
*.egg-info/
|
||||
dist/
|
||||
build/
|
||||
|
||||
# 环境
|
||||
.env
|
||||
.venv/
|
||||
env/
|
||||
venv/
|
||||
ENV/
|
||||
|
||||
# IDE
|
||||
.vscode/
|
||||
.idea/
|
||||
*.swp
|
||||
*.swo
|
||||
*~
|
||||
|
||||
# 数据
|
||||
data/
|
||||
*.csv
|
||||
*.json
|
||||
*.db
|
||||
*.sqlite
|
||||
*.duckdb
|
||||
|
||||
# 日志
|
||||
logs/
|
||||
*.log
|
||||
|
||||
# 模型
|
||||
models/
|
||||
*.h5
|
||||
*.pkl
|
||||
|
||||
# 临时文件
|
||||
tmp/
|
||||
temp/
|
||||
*.tmp
|
||||
.DS_Store
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## 📚 技术选型参考
|
||||
|
||||
| 场景 | 推荐技术栈 |
|
||||
|-----|----------|
|
||||
| Web API | FastAPI + Pydantic + SQLAlchemy |
|
||||
| 数据处理 | Pandas + NumPy + Polars |
|
||||
| 机器学习 | Scikit-learn + XGBoost + LightGBM |
|
||||
| 深度学习 | PyTorch + TensorFlow |
|
||||
| 数据库 | PostgreSQL + Redis |
|
||||
| 消息队列 | RabbitMQ / Kafka |
|
||||
| 任务队列 | Celery |
|
||||
| 监控 | Prometheus + Grafana |
|
||||
| 部署 | Docker + Docker Compose |
|
||||
| CI/CD | GitHub Actions / GitLab CI |
|
||||
|
||||
---
|
||||
|
||||
## 📝 文件模板示例
|
||||
|
||||
### requirements.txt
|
||||
```txt
|
||||
# 核心依赖
|
||||
fastapi==0.104.1
|
||||
uvicorn[standard]==0.24.0
|
||||
pydantic==2.5.0
|
||||
|
||||
# 数据库
|
||||
sqlalchemy==2.0.23
|
||||
alembic==1.12.1
|
||||
psycopg2-binary==2.9.9
|
||||
|
||||
# 测试
|
||||
pytest==7.4.3
|
||||
pytest-cov==4.1.0
|
||||
pytest-asyncio==0.21.1
|
||||
|
||||
# 工具
|
||||
python-dotenv==1.0.0
|
||||
loguru==0.7.2
|
||||
|
||||
# 开发(可选)
|
||||
black==23.11.0
|
||||
flake8==6.1.0
|
||||
mypy==1.7.1
|
||||
```
|
||||
|
||||
### pyproject.toml(现代Python项目推荐)
|
||||
```toml
|
||||
[project]
|
||||
name = "项目名称"
|
||||
version = "0.1.0"
|
||||
description = "项目描述"
|
||||
authors = [{name = "作者", email = "邮箱@example.com"}]
|
||||
dependencies = [
|
||||
"fastapi>=0.104.0",
|
||||
"uvicorn[standard]>=0.24.0",
|
||||
"sqlalchemy>=2.0.0",
|
||||
]
|
||||
|
||||
[project.optional-dependencies]
|
||||
dev = ["pytest", "black", "flake8", "mypy"]
|
||||
|
||||
[build-system]
|
||||
requires = ["setuptools", "wheel"]
|
||||
build-backend = "setuptools.build_meta"
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## ✅ 新项目检查清单
|
||||
|
||||
启动新项目时,确保完成以下事项:
|
||||
|
||||
- [ ] 创建README.md,包含项目简介和使用说明
|
||||
- [ ] 创建LICENSE文件,明确开源协议
|
||||
- [ ] 设置Python虚拟环境(venv/conda)
|
||||
- [ ] 创建requirements.txt并锁定依赖版本
|
||||
- [ ] 创建.gitignore,排除敏感和不必要的文件
|
||||
- [ ] 创建.env.example,说明需要的环境变量
|
||||
- [ ] 设计目录结构,符合关注点分离原则
|
||||
- [ ] 创建基础的配置文件
|
||||
- [ ] 设置代码格式化工具(black)
|
||||
- [ ] 设置代码检查工具(flake8/ruff)
|
||||
- [ ] 编写第一个测试用例
|
||||
- [ ] 设置Git仓库并提交初始代码
|
||||
- [ ] 创建CHANGELOG.md,记录版本变更
|
||||
|
||||
---
|
||||
|
||||
**版本**: 1.0
|
||||
**更新日期**: 2025-11-24
|
||||
**维护**: CLAUDE,CODEX,KIMI
|
||||
└── data/ # Data directory (not committed to Git)
|
||||
├── raw/ # Raw data
|
||||
├── processed/ # Processed data
|
||||
└── cache/ # Cache
|
||||
```
|
||||
|
|
@ -1,152 +1,151 @@
|
|||
TRANSLATED CONTENT:
|
||||
# z-lib 里面全部都可以免费下载
|
||||
# All available for free download on z-lib
|
||||
|
||||
从零开始大模型开发与微调:基于PyTorch与ChatGLM - 王晓华
|
||||
From Zero to Large Model Development and Fine-tuning: Based on PyTorch and ChatGLM - Wang Xiaohua
|
||||
|
||||
编程的原则:改善代码质量的101个方法 - 上田勋
|
||||
The Principles of Programming: 101 Ways to Improve Code Quality - Isao Ueda
|
||||
|
||||
生成式 AI 设计模式 - Valliappa Lakshmanan & Hannes Hapke
|
||||
Generative AI Design Patterns - Valliappa Lakshmanan & Hannes Hapke
|
||||
|
||||
人月神话 - 弗雷德里克·布鲁克斯
|
||||
The Mythical Man-Month - Frederick Brooks
|
||||
|
||||
人件(原书第3版) - Tom DeMarco & Timothy Lister
|
||||
Peopleware (3rd Edition) - Tom DeMarco & Timothy Lister
|
||||
|
||||
高效程序员的45个习惯:敏捷开发修炼之道 - Andy Hunt & Venkat Subramaniam
|
||||
The 45 Habits of Highly Effective Programmers: Agile Development Practice - Andy Hunt & Venkat Subramaniam
|
||||
|
||||
项目管理修炼之道 - 罗斯曼
|
||||
The Art of Project Management Practice - Rothman
|
||||
|
||||
编程珠玑(续) - 乔恩·本特利
|
||||
Programming Pearls (Continued) - Jon Bentley
|
||||
|
||||
编程珠玑(第2版) - 乔恩·本特利
|
||||
Programming Pearls (2nd Edition) - Jon Bentley
|
||||
|
||||
编程原则:来自代码大师Max Kanat-Alexander的建议(让简约设计的思想回归到计算机编程,适合软件开发者、开发团队管理者和软件相关专业学生阅读) (华章程序员书库) - Max Kanat-Alexande
|
||||
Programming Principles: Advice from Code Master Max Kanat-Alexander (Bringing the idea of minimalist design back to computer programming, suitable for software developers, development team managers, and students majoring in software-related fields) (Huazhang Programmer Library) - Max Kanat-Alexander
|
||||
|
||||
编写可读代码的艺术 - Dustin Boswell & Trevor Foucher
|
||||
The Art of Readable Code - Dustin Boswell & Trevor Foucher
|
||||
|
||||
统计思维:程序员数学之概率统计(第2版) - Allen B.Downey
|
||||
Statistical Thinking: Probability and Statistics for Programmers (2nd Edition) - Allen B. Downey
|
||||
|
||||
精通Rust(第2版) - Rahul Sharma & Vesa Kaihlavirta
|
||||
Mastering Rust (2nd Edition) - Rahul Sharma & Vesa Kaihlavirta
|
||||
|
||||
程序员超强大脑(图灵程序设计丛书·程序员修炼系列) - 费莉安·赫尔曼斯
|
||||
Programmer's Super Brain (Turing Programming Series: Programmer's Cultivation Series) - Felian Hermans
|
||||
|
||||
程序员必读之软件架构 - Simon Brown
|
||||
Software Architecture for Programmers - Simon Brown
|
||||
|
||||
程序员修炼之道:专业程序员必知的33个技巧 - Josh·Carter
|
||||
The Pragmatic Programmer: Thirty-three Tips for Professional Developers - Josh Carter
|
||||
|
||||
看漫画学Python:有趣、有料、好玩、好用 - 关东升
|
||||
Learn Python with Comics: Fun, Informative, Interesting, and Useful - Guan Dongsheng
|
||||
|
||||
混沌工程:通过可控故障实验提升软件系统可靠性 - 米科拉吉·帕利科夫斯基_1
|
||||
Chaos Engineering: Improving Software System Reliability Through Controlled Fault Experiments - Mikolaj Palikowski_1
|
||||
|
||||
深入理解Python特性 - 达恩·巴德尔
|
||||
Deep Dive into Python Features - Dann Bader
|
||||
|
||||
微服务实战(覆盖从微服务设计到部署的各个阶段的技术实战书)(异步图书) - 摩根·布鲁斯 & 保罗·A·佩雷拉
|
||||
Microservices in Action (A practical book covering technical practices from microservice design to deployment) (Async Books) - Morgan Bruce & Paul A. Pereira
|
||||
|
||||
大数据系统构建:可扩展实时数据系统构建原理与最佳实践 - NathanMarz & JamesWarren
|
||||
Building Big Data Systems: Principles and Best Practices for Building Scalable Real-time Data Systems - Nathan Marz & James Warren
|
||||
|
||||
图解性能优化(图灵程序设计丛书) - 小田圭二 & 榑松谷仁 & 平山毅 & 冈田宪昌
|
||||
Illustrated Performance Optimization (Turing Programming Series) - Keiji Oda & Jin Kurematsutani & Takeshi Hirayama & Norichika Okada
|
||||
|
||||
图灵程序设计丛书:大规模数据处理入门与实战(套装全10册)【图灵出品!一套囊括SQL、Python、Spark、Hadoop、妮哈·纳克海德 & 格温·沙皮拉托德 & 帕利诺 & 本杰明·班福特 & 珍妮·基姆 & 埃伦·弗里德曼 & 科斯塔斯·宙马斯
|
||||
Turing Programming Series: Large-Scale Data Processing Introduction and Practice (Set of 10 Books) [Turing Edition! A set encompassing SQL, Python, Spark, Hadoop, Neha Narkhede & Gwen Shapira Todd & Palino & Benjamin Banford & Jenny Kim & Ellen Friedman & Kostas Tzoumas
|
||||
|
||||
代码整洁之道 - Robert C. Martin
|
||||
Clean Code - Robert C. Martin
|
||||
|
||||
代码之髓:编程语言核心概念(图灵程序设计丛书) - 西尾泰和
|
||||
The Essence of Code: Core Concepts of Programming Languages (Turing Programming Series) - Taiwa Nishio
|
||||
|
||||
人人都懂设计模式:从生活中领悟设计模式 - 罗伟富
|
||||
Design Patterns for Everyone: Understanding Design Patterns from Real Life - Luo Weifu
|
||||
|
||||
Rust权威指南(第2版) - Steve Klabnik & Carol Nichols
|
||||
The Rust Programming Language (2nd Edition) - Steve Klabnik & Carol Nichols
|
||||
|
||||
Python金融大数据分析(第2版) - 伊夫·希尔皮斯科
|
||||
Python for Financial Big Data Analysis (2nd Edition) - Yves Hilpisch
|
||||
|
||||
Python科学计算基础教程 - Hemant Kumar Mehta_1
|
||||
Python Scientific Computing Fundamentals Tutorial - Hemant Kumar Mehta_1
|
||||
|
||||
Python数据挖掘入门与实践 - Robert Layton
|
||||
Python Data Mining Introduction and Practice - Robert Layton
|
||||
|
||||
Python数据分析与算法指南(套装共8册) - 江雪松 & 邹静 & 邓立国 & 翟锟 & 胡锋 & 周晓然 & 王国平 & 白宁超 & 唐聃 & 文俊 & 张若愚 & 洪锦魁
|
||||
Python Data Analysis and Algorithm Guide (Set of 8 Books) - Jiang Songsong & Zou Jing & Deng Liguo & Zhai Kun & Hu Feng & Zhou Xiaoran & Wang Guoping & Bai Ningchao & Tang Dan & Wen Jun & Zhang Ruoyu & Hong Jinkui
|
||||
|
||||
Python性能分析与优化 - Fernando Doglio
|
||||
Python Performance Analysis and Optimization - Fernando Doglio
|
||||
|
||||
Python函数式编程(第2版)(图灵图书) - 史蒂文·洛特_1
|
||||
Python Functional Programming (2nd Edition) (Turing Books) - Steven Lott_1
|
||||
|
||||
GPT时代的量化交易:底层逻辑与技术实践 - 罗勇 & 卢洪波_1
|
||||
Quantitative Trading in the GPT Era: Underlying Logic and Technical Practice - Luo Yong & Lu Hongbo_1
|
||||
|
||||
ChatGPT数据分析实践 - 史浩然 & 赵辛 & 吴志成
|
||||
ChatGPT Data Analysis Practice - Shi Haoran & Zhao Xin & Wu Zhicheng
|
||||
|
||||
AI时代Python金融大数据分析实战:ChatGPT让金融大数据分析插上翅膀 - 关东升
|
||||
AI Era Python Financial Big Data Analysis Practice: ChatGPT Makes Financial Big Data Analysis Soar - Guan Dongsheng
|
||||
|
||||
跨市场交易策略 - John J. Murphy
|
||||
Cross-Market Trading Strategies - John J. Murphy
|
||||
|
||||
资产定价与机器学习 - 吴轲
|
||||
Asset Pricing and Machine Learning - Wu Ke
|
||||
|
||||
工程思维 - 马克 N. 霍伦斯坦
|
||||
Engineering Thinking - Marc N. Holenstein
|
||||
|
||||
程序员的思维修炼:开发认知潜能的九堂课(图灵程序设计丛书) - Andy Hunt
|
||||
The Programmer's Brain: Develop Cognitive Potential with Nine Lessons (Turing Programming Series) - Andy Hunt
|
||||
|
||||
程序员修炼之道:通向务实的最高境界(第2版)【这本书颠覆了无数人的软件生涯!并推动整个IT行业走到今天!时隔20年的再版重磅来袭!】 - 大卫·托马斯 & 安德鲁·亨特
|
||||
The Pragmatic Programmer: Your Journey to Mastery (2nd Edition) [This book has revolutionized countless software careers! And propelled the entire IT industry to where it is today! A heavy-hitting re-release after 20 years!] - David Thomas & Andrew Hunt
|
||||
|
||||
不确定状况下的判断:启发式和偏差 - 丹尼尔·卡尼曼
|
||||
Thinking, Fast and Slow (original: Judgment Under Uncertainty: Heuristics and Biases) - Daniel Kahneman
|
||||
|
||||
简约之美:软件设计之道 - Max Kanant-Alexander
|
||||
The Beauty of Simplicity: The Art of Software Design - Max Kanant-Alexander
|
||||
|
||||
程序员的底层思维 - 张建飞
|
||||
The Programmer's Underlying Logic - Zhang Jianfei
|
||||
|
||||
程序员的三门课:技术精进、架构修炼、管理探秘 - 于君泽
|
||||
The Programmer's Three Courses: Technical Advancement, Architecture Cultivation, Management Exploration - Yu Junze
|
||||
|
||||
机器学习系统设计(图灵程序设计丛书) - Willi Richert & Luis Pedro Coelho
|
||||
Machine Learning System Design (Turing Programming Series) - Willi Richert & Luis Pedro Coelho
|
||||
|
||||
思维工程导论 - 钱小一
|
||||
Introduction to Mind Engineering - Qian Xiaoyi
|
||||
|
||||
算法精粹:经典计算机科学问题的Python实现 - David Kopec
|
||||
Algorithmic Essentials: Python Implementations of Classic Computer Science Problems - David Kopec
|
||||
|
||||
函数式编程思维 (图灵程序设计丛书) - Neal Ford
|
||||
Functional Programming Thinking (Turing Programming Series) - Neal Ford
|
||||
|
||||
Python函数式编程(第2版)(图灵图书) - 史蒂文·洛特
|
||||
Python Functional Programming (2nd Edition) (Turing Books) - Steven Lott
|
||||
|
||||
Effective Python 编写高质量Python代码的90个有效方法(原书第2版) (Effective系列丛书) - Brett Slatkin
|
||||
Effective Python: 90 Specific Ways to Write Better Python (2nd Edition) (Effective Series) - Brett Slatkin
|
||||
|
||||
高频交易(原书第2版) - Irene Aldridge
|
||||
High-Frequency Trading (2nd Edition) - Irene Aldridge
|
||||
|
||||
高频交易员:华尔街的速度游戏 - 迈克尔·刘易斯
|
||||
Flash Boys: A Wall Street Revolt - Michael Lewis
|
||||
|
||||
金融学原理(第6版) - 彭兴韵
|
||||
Principles of Finance (6th Edition) - Peng Xinyun
|
||||
|
||||
聪明投资者的第一本金融学常识书 - 肖玉红
|
||||
Financial Literacy for the Smart Investor - Xiao Yuhong
|
||||
|
||||
可视化量化金融 - Michael Lovelady
|
||||
Visualizing Quantitative Finance - Michael Lovelady
|
||||
|
||||
GPT时代的量化交易:底层逻辑与技术实践 - 罗勇 & 卢洪波
|
||||
Quantitative Trading in the GPT Era: Underlying Logic and Technical Practice - Luo Yong & Lu Hongbo
|
||||
|
||||
图灵经典计算机基础系列(套装全4册) - 矢泽久雄 & 户根勤 & 平泽章
|
||||
Turing Classic Computer Science Series (Set of 4 Books) - Hisao Yazawa & Tsutomu Togen & Takeshi Hirayama & Norichika Okada
|
||||
|
||||
软件开发的201个原则 - Alan M· Davis
|
||||
201 Principles of Software Development - Alan M. Davis
|
||||
|
||||
程序员的AI书:从代码开始 - 张力柯 & 潘晖
|
||||
The Programmer's AI Book: Starting from Code - Zhang Like & Pan Hui
|
||||
|
||||
计算的本质:深入剖析程序和计算机 - Tom Stuart
|
||||
The Nature of Computation: An In-depth Look at Programs and Computers - Tom Stuart
|
||||
|
||||
程序员投资指南 - Stefan Papp
|
||||
The Programmer's Investment Guide - Stefan Papp
|
||||
|
||||
精通正则表达式(第3版) - Jeffrey E.F.Friedl
|
||||
Mastering Regular Expressions (3rd Edition) - Jeffrey E.F. Friedl
|
||||
|
||||
巧用ChatGPT进行数据分析与挖掘 - 谢佳标
|
||||
Leveraging ChatGPT for Data Analysis and Mining - Xie Jiabiao
|
||||
|
||||
工业人工智能三部曲(套装共三册)(世界一流的智能制造专家著作合辑)(2016年被美国制造工程师学会(SME)评选为“美国30位最有远见的智能制造人物”) - 李杰
|
||||
Industrial AI Trilogy (Set of 3 Books) (Collection of Works by World-Class Intelligent Manufacturing Experts) (Named "30 Most Visionary Intelligent Manufacturing Figures in the US" by SME in 2016) - Li Jie
|
||||
|
||||
从零构建大模型:算法、训练与微调 - 梁楠
|
||||
Building Large Models from Scratch: Algorithms, Training, and Fine-tuning - Liang Nan
|
||||
|
||||
Vibe Coding_ Building Production-Grade Software With GenAI, Chat, Agents, and Beyond - Gene Kim & Steve Yegge
|
||||
Vibe Coding: Building Production-Grade Software With GenAI, Chat, Agents, and Beyond - Gene Kim & Steve Yegge
|
||||
|
||||
Vibe Coding AI 编程完全手册 - 谭星星
|
||||
Vibe Coding AI Programming Manual - Tan Xingxing
|
||||
|
||||
计算机科学概论(第13版) - J. 格伦·布鲁克希尔 & 丹尼斯·布里罗
|
||||
Computer Science: An Overview (13th Edition) - J. Glenn Brookshear & Dennis Brylow
|
||||
|
||||
Pro Git (中文版) - Scott Chacon & Ben Straub
|
||||
Pro Git (Chinese Edition) - Scott Chacon & Ben Straub
|
||||
|
||||
像程序员一样思考 - V.Anton Spraul
|
||||
Think Like a Programmer - V. Anton Spraul
|
||||
|
||||
Python核心编程(第3版) - Wesley Chun_1
|
||||
Core Python Programming (3rd Edition) - Wesley Chun_1
|
||||
|
||||
AI 工程:从基础模型建构应用 - Chip Huyen
|
||||
AI Engineering: Building Applications from Foundation Models - Chip Huyen
|
||||
|
||||
AI辅助编程实战 - 汤姆·陶利
|
||||
AI-Assisted Programming in Practice - Tom Taulli
|
||||
|
||||
编码:隐匿在计算机软硬件背后的语言 - Charles Petzold
|
||||
Code: The Hidden Language of Computer Hardware and Software - Charles Petzold
|
||||
|
|
|
|||
|
|
@ -1,6 +1,5 @@
|
|||
TRANSLATED CONTENT:
|
||||
ide与插件;vscode ,Windsurf(白嫖用),闪电说(输出用),Continue - open-source AI code agent,Local History,Partial Diff
|
||||
IDE and Plugins; VSCode, Windsurf (for free use), Sparkle Talk (for output), Continue - open-source AI code agent, Local History, Partial Diff
|
||||
|
||||
模型;codex,gemini,kimik2,grok
|
||||
Models; Codex, Gemini, KimiK2, Grok
|
||||
|
||||
网站;https://aistudio.google.com/;https://zread.ai/;https://chatgpt.com/;https://github.com;https://www.bilibili.com;https://www.mermaidchart.com/app/dashboard;https://notebooklm.google.com/;https://z-lib.fm/;https://docs.google.com/spreadsheets/u/0/;https://script.google.com/home?pli=1
|
||||
Websites; https://aistudio.google.com/; https://zread.ai/; https://chatgpt.com/; https://github.com; https://www.bilibili.com; https://www.mermaidchart.com/app/dashboard; https://notebooklm.google.com/; https://z-lib.fm/; https://docs.google.com/spreadsheets/u/0/; https://script.google.com/home?pli=1
|
||||
|
|
@ -1,21 +1,20 @@
|
|||
TRANSLATED CONTENT:
|
||||
# telegram Markdown 代码块格式修复记录 2025-12-15
|
||||
# Telegram Markdown Code Block Format Fix Log 2025-12-15
|
||||
|
||||
## 问题
|
||||
## Problem
|
||||
|
||||
排盘完成后发送消息报错:
|
||||
After completing the astrological chart generation, sending a message reports an error:
|
||||
```
|
||||
❌ 排盘失败: Can't parse entities: can't find end of the entity starting at byte offset 168
|
||||
❌ Chart generation failed: Can't parse entities: can't find end of the entity starting at byte offset 168
|
||||
```
|
||||
|
||||
## 原因
|
||||
## Cause
|
||||
|
||||
`bot.py` 中 `header` 消息的 Markdown 代码块格式错误。
|
||||
The Markdown code block format for the `header` message in `bot.py` is incorrect.
|
||||
|
||||
原代码使用字符串拼接,在 ``` 后面加了 `\n`,导致 Telegram Markdown 解析器无法正确识别代码块边界:
|
||||
The original code used string concatenation, adding `\n` after ```, which caused the Telegram Markdown parser to incorrectly identify the code block boundary:
|
||||
|
||||
```python
|
||||
# 错误写法
|
||||
# Incorrect way
|
||||
header = (
|
||||
"```\n"
|
||||
f"{filename}\n"
|
||||
|
|
@ -23,13 +22,13 @@ header = (
|
|||
)
|
||||
```
|
||||
|
||||
## 修复
|
||||
## Fix
|
||||
|
||||
改用三引号字符串,确保 ``` 单独成行:
|
||||
Changed to a triple-quoted string to ensure ``` is on a separate line:
|
||||
|
||||
```python
|
||||
# 正确写法
|
||||
header = f"""报告见附件
|
||||
# Correct way
|
||||
header = f"""Report attached
|
||||
```
|
||||
{filename}
|
||||
{ai_filename}
|
||||
|
|
@ -37,6 +36,8 @@ header = f"""报告见附件
|
|||
"""
|
||||
```
|
||||
|
||||
## 修改文件
|
||||
## Modified File
|
||||
|
||||
- `services/telegram-service/src/bot.py` 第 293-308 行
|
||||
- `services/telegram-service/src/bot.py` lines 293-308
|
||||
|
||||
```
|
||||
|
|
@ -1,50 +1,49 @@
|
|||
TRANSLATED CONTENT:
|
||||
## tmux快捷键大全(前缀 Ctrl+b)
|
||||
## tmux Shortcut Cheatsheet (Prefix Ctrl+b)
|
||||
|
||||
### 会话
|
||||
| 操作 | 快捷键 |
|
||||
|------|--------|
|
||||
| 脱离会话 | d |
|
||||
| 列出会话 | s |
|
||||
| 重命名会话 | $ |
|
||||
### Sessions
|
||||
| Operation | Shortcut |
|
||||
|-----------|----------|
|
||||
| Detach Session | d |
|
||||
| List Sessions | s |
|
||||
| Rename Session | $ |
|
||||
|
||||
### 窗口
|
||||
| 操作 | 快捷键 |
|
||||
|------|--------|
|
||||
| 新建窗口 | c |
|
||||
| 关闭窗口 | & |
|
||||
| 下一个窗口 | n |
|
||||
| 上一个窗口 | p |
|
||||
| 切换到第N个窗口 | 0-9 |
|
||||
| 重命名窗口 | , |
|
||||
| 列出窗口 | w |
|
||||
### Windows
|
||||
| Operation | Shortcut |
|
||||
|-----------|----------|
|
||||
| New Window | c |
|
||||
| Close Window | & |
|
||||
| Next Window | n |
|
||||
| Previous Window | p |
|
||||
| Switch to Window N | 0-9 |
|
||||
| Rename Window | , |
|
||||
| List Windows | w |
|
||||
|
||||
### 窗格
|
||||
| 操作 | 快捷键 |
|
||||
|------|--------|
|
||||
| 左右分屏 | % |
|
||||
| 上下分屏 | " |
|
||||
| 切换窗格 | 方向键 |
|
||||
| 关闭窗格 | x |
|
||||
| 显示窗格编号 | q |
|
||||
| 窗格全屏/还原 | z |
|
||||
| 调整大小 | Ctrl+方向键 |
|
||||
| 交换窗格位置 | { / } |
|
||||
| 窗格转为独立窗口 | ! |
|
||||
### Panes
|
||||
| Operation | Shortcut |
|
||||
|-----------|----------|
|
||||
| Split Pane Horizontal | % |
|
||||
| Split Pane Vertical | " |
|
||||
| Switch Pane | Arrow keys |
|
||||
| Close Pane | x |
|
||||
| Display Pane Numbers | q |
|
||||
| Toggle Pane Fullscreen/Restore | z |
|
||||
| Resize | Ctrl+Arrow keys |
|
||||
| Swap Panes | { / } |
|
||||
| Break Pane to New Window | ! |
|
||||
|
||||
### 其他
|
||||
| 操作 | 快捷键 |
|
||||
|------|--------|
|
||||
| 进入复制模式 | [ |
|
||||
| 粘贴 | ] |
|
||||
| 显示时间 | t |
|
||||
| 命令模式 | : |
|
||||
| 列出快捷键 | ? |
|
||||
### Others
|
||||
| Operation | Shortcut |
|
||||
|-----------|----------|
|
||||
| Enter Copy Mode | [ |
|
||||
| Paste | ] |
|
||||
| Show Time | t |
|
||||
| Command Mode | : |
|
||||
| List Shortcuts | ? |
|
||||
|
||||
### 命令行
|
||||
### Command Line
|
||||
bash
|
||||
tmux # 新建会话
|
||||
tmux new -s 名字 # 新建命名会话
|
||||
tmux ls # 列出会话
|
||||
tmux attach -t 名字 # 连接会话
|
||||
tmux kill-session -t 名字 # 杀掉会话
|
||||
tmux # New session
|
||||
tmux new -s name # New named session
|
||||
tmux ls # List sessions
|
||||
tmux attach -t name # Attach session
|
||||
tmux kill-session -t name # Kill session
|
||||
|
|
@ -82,7 +82,7 @@
|
|||
|
||||
该思想的核心是构建一个能够**自我优化**的 AI 系统。其递归本质可分解为以下步骤:
|
||||
|
||||
> 延伸阅读:[A Formalization of Recursive Self-Optimizing Generative Systems](./i18n/zh/documents/Methodology%20and%20Principles/A%20Formalization%20of%20Recursive%20Self-Optimizing%20Generative%20Systems.md)
|
||||
> 延伸阅读:[A Formalization of Recursive Self-Optimizing Generative Systems](./documents/方法论与原则/A%20Formalization%20of%20Recursive%20Self-Optimizing%20Generative%20Systems.md)
|
||||
|
||||
#### 1. 定义核心角色:
|
||||
|
||||
|
|
@ -186,10 +186,10 @@
|
|||
* [**第三方系统提示词学习库**](https://github.com/x1xhlol/system-prompts-and-models-of-ai-tools): 用于学习和参考其他 AI 工具的系统提示词。
|
||||
* [**Skills 制作器**](https://github.com/yusufkaraaslan/Skill_Seekers): 可根据需求生成定制化 Skills 的工具。
|
||||
* [**元提示词**](https://docs.google.com/spreadsheets/d/1ngoQOhJqdguwNAilCl1joNwTje7FWWN9WiI2bo5VhpU/edit?gid=1770874220#gid=1770874220): 用于生成提示词的高级提示词。
|
||||
* [**通用项目架构模板**](./i18n/zh/documents/Templates%20and%20Resources/通用项目架构模板.md): 可用于快速搭建标准化的项目目录结构。
|
||||
* [**元技能:Skills 的 Skills**](./i18n/zh/skills/claude-skills/SKILL.md): 用于生成 Skills 的元技能。
|
||||
* [**tmux快捷键大全**](./i18n/zh/documents/Tutorials%20and%20Guides/tmux快捷键大全.md): tmux 的快捷键参考文档。
|
||||
* [**LazyVim快捷键大全**](./i18n/zh/documents/Tutorials%20and%20Guides/LazyVim快捷键大全.md): LazyVim 的快捷键参考文档。
|
||||
* [**通用项目架构模板**](./documents/模板与资源/通用项目架构模板.md): 可用于快速搭建标准化的项目目录结构。
|
||||
* [**元技能:Skills 的 Skills**](./skills/claude-skills/SKILL.md): 用于生成 Skills 的元技能。
|
||||
* [**tmux快捷键大全**](./documents/教程与指南/tmux快捷键大全.md): tmux 的快捷键参考文档。
|
||||
* [**LazyVim快捷键大全**](./documents/教程与指南/LazyVim快捷键大全.md): LazyVim 的快捷键参考文档。
|
||||
* [**二哥的Java进阶之路**](https://javabetter.cn/): 包含多种开发工具的详细配置教程。
|
||||
* [**虚拟卡**](https://www.bybit.com/cards/?ref=YDGAVPN&source=applet_invite): 可用于注册云服务等需要国际支付的场景。
|
||||
|
||||
|
|
@ -211,8 +211,8 @@
|
|||
* [Telegram 交流群](https://t.me/glue_coding)
|
||||
* [Telegram 频道](https://t.me/tradecat_ai_channel)
|
||||
* **个人分享**:
|
||||
* [我的学习经验](./i18n/zh/documents/Methodology%20and%20Principles/学习经验.md)
|
||||
* [编程书籍推荐](./i18n/zh/documents/Templates%20and%20Resources/编程书籍推荐.md)
|
||||
* [我的学习经验](./documents/方法论与原则/学习经验.md)
|
||||
* [编程书籍推荐](./documents/模板与资源/编程书籍推荐.md)
|
||||
* **核心资源**:
|
||||
* [**元提示词库**](https://docs.google.com/spreadsheets/d/1ngoQOhJqdguwNAilCl1joNwTje7FWWN9WiI2bo5VhpU/edit?gid=1770874220#gid=1770874220): 用于生成提示词的高级提示词集合。
|
||||
* [**元技能 (Meta-Skill)**](./i18n/zh/skills/claude-skills/SKILL.md): 用于生成 Skills 的 Skill。
|
||||
|
|
@ -223,10 +223,10 @@
|
|||
* **项目内部文档**:
|
||||
* [**prompts-library 工具说明**](./libs/external/prompts-library/): 该工具支持在 Excel 和 Markdown 格式之间转换提示词,并包含数百个精选提示词。
|
||||
* [**coding_prompts 集合**](./i18n/zh/prompts/coding_prompts/): 适用于 Vibe Coding 流程的专用提示词。
|
||||
* [**系统提示词构建原则**](./i18n/zh/documents/Methodology%20and%20Principles/系统提示词构建原则.md): 关于如何构建高效、可靠的 AI 系统提示词的综合指南。
|
||||
* [**开发经验总结**](./i18n/zh/documents/Methodology%20and%20Principles/开发经验.md): 包含变量命名、文件结构、编码规范、架构原则等实践经验。
|
||||
* [**通用项目架构模板**](./i18n/zh/documents/Templates%20and%20Resources/通用项目架构模板.md): 提供多种项目类型的标准目录结构与最佳实践。
|
||||
* [**Augment MCP 配置文档**](./i18n/zh/documents/Tutorials%20and%20Guides/auggie-mcp配置文档.md): Augment 上下文引擎的详细配置说明。
|
||||
* [**系统提示词构建原则**](./documents/方法论与原则/系统提示词构建原则.md): 关于如何构建高效、可靠的 AI 系统提示词的综合指南。
|
||||
* [**开发经验总结**](./documents/方法论与原则/开发经验.md): 包含变量命名、文件结构、编码规范、架构原则等实践经验。
|
||||
* [**通用项目架构模板**](./documents/模板与资源/通用项目架构模板.md): 提供多种项目类型的标准目录结构与最佳实践。
|
||||
* [**Augment MCP 配置文档**](./documents/教程与指南/auggie-mcp配置文档.md): Augment 上下文引擎的详细配置说明。
|
||||
* [**system_prompts 集合**](./i18n/zh/prompts/system_prompts/): 用于指导 AI 开发的系统提示词,包含多个版本的开发规范与思维框架。
|
||||
|
||||
---
|
||||
|
|
@ -248,9 +248,9 @@
|
|||
├── CLAUDE.md # AI 助手的核心行为准则或配置。
|
||||
│
|
||||
├── i18n/zh/documents/ # 存放各类说明文档、经验总结和配置详细说明。
|
||||
│ ├── Methodology and Principles/ # 方法论与原则
|
||||
│ ├── Templates and Resources/ # 模板与资源
|
||||
│ └── Tutorials and Guides/ # 教程与指南
|
||||
│ ├── 方法论与原则/ # 方法论与原则
|
||||
│ ├── 模板与资源/ # 模板与资源
|
||||
│ └── 教程与指南/ # 教程与指南
|
||||
│
|
||||
├── libs/ # 通用库代码,用于项目内部模块化。
|
||||
│ ├── common/ # 通用功能模块。
|
||||
|
|
@ -310,7 +310,7 @@ i18n/zh/prompts/
|
|||
assistant_prompts/ # 辅助/配合型提示
|
||||
user_prompts/ # 可复用的用户侧提示词
|
||||
i18n/zh/documents/
|
||||
Templates and Resources/代码组织.md, Templates and Resources/通用项目架构模板.md, Methodology and Principles/开发经验.md, Methodology and Principles/系统提示词构建原则.md 等知识库
|
||||
模板与资源/代码组织.md, 模板与资源/通用项目架构模板.md, 方法论与原则/开发经验.md, 方法论与原则/系统提示词构建原则.md 等知识库
|
||||
backups/
|
||||
一键备份.sh, 快速备份.py # 本地/远端快照脚本
|
||||
```
|
||||
|
|
@ -415,7 +415,15 @@ gantt
|
|||
|
||||
---
|
||||
|
||||
## 🚀 入门指南(这里是原作者的,不是我写的,我更新了一下我认为最好的模型)
|
||||
## 🚀 入门指南
|
||||
|
||||
### 🆕 完全新手?从这里开始!
|
||||
|
||||
1. [01-网络环境配置](./documents/从零开始vibecoding/01-网络环境配置.md) - 配置网络访问
|
||||
2. [02-开发环境搭建](./documents/从零开始vibecoding/02-开发环境搭建.md) - 复制提示词给 AI,让 AI 指导你搭建环境
|
||||
|
||||
### 已有开发环境?
|
||||
|
||||
要开始 Vibe Coding,你只需要以下两种工具之一:
|
||||
- **Claude Opus 4.5**,在 Claude Code 中使用
|
||||
- **gpt-5.1-codex.1-codex (xhigh)**,在 Codex CLI 中使用
|
||||
|
|
|
|||
|
|
@ -8,7 +8,11 @@
|
|||
i18n/zh/documents/
|
||||
├── README.md
|
||||
│
|
||||
├── Methodology and Principles/
|
||||
├── 从零开始vibecoding/ # 🚀 新手入门必读
|
||||
│ ├── 01-网络环境配置.md
|
||||
│ └── 02-开发环境搭建.md
|
||||
│
|
||||
├── 方法论与原则/
|
||||
│ ├── A Formalization of Recursive Self-Optimizing Generative Systems.md
|
||||
│ ├── gluecoding.md
|
||||
│ ├── vibe-coding-经验收集.md
|
||||
|
|
@ -18,14 +22,14 @@ i18n/zh/documents/
|
|||
│ ├── 胶水编程.md
|
||||
│ └── 系统提示词构建原则.md
|
||||
│
|
||||
├── Tutorials and Guides/
|
||||
├── 教程与指南/
|
||||
│ ├── auggie-mcp配置文档.md
|
||||
│ ├── LazyVim快捷键大全.md
|
||||
│ ├── tmux快捷键大全.md
|
||||
│ ├── 关于手机ssh任意位置链接本地计算机,基于frp实现的方法.md
|
||||
│ └── telegram-dev/
|
||||
│
|
||||
└── Templates and Resources/
|
||||
└── 模板与资源/
|
||||
├── 代码组织.md
|
||||
├── 工具集.md
|
||||
├── 编程书籍推荐.md
|
||||
|
|
@ -34,7 +38,14 @@ i18n/zh/documents/
|
|||
|
||||
## 文档分类
|
||||
|
||||
### Methodology and Principles
|
||||
### 🚀 从零开始vibecoding(新手入门)
|
||||
|
||||
完全零基础?从这里开始!
|
||||
|
||||
* [01-网络环境配置](./从零开始vibecoding/01-网络环境配置.md) - 配置网络访问
|
||||
* [02-开发环境搭建](./从零开始vibecoding/02-开发环境搭建.md) - 搭建开发环境(提示词版)
|
||||
|
||||
### 方法论与原则
|
||||
|
||||
此类别存放关于编程思想、开发哲学和项目核心原则的文档。
|
||||
|
||||
|
|
@ -47,7 +58,7 @@ i18n/zh/documents/
|
|||
* `胶水编程.md`
|
||||
* `系统提示词构建原则.md`
|
||||
|
||||
### Tutorials and Guides
|
||||
### 教程与指南
|
||||
|
||||
此类别存放具体工具的配置、使用指南和操作教程。
|
||||
|
||||
|
|
@ -57,7 +68,7 @@ i18n/zh/documents/
|
|||
* `关于手机ssh任意位置链接本地计算机,基于frp实现的方法.md`
|
||||
* `telegram-dev/`
|
||||
|
||||
### Templates and Resources
|
||||
### 模板与资源
|
||||
|
||||
此类别存放可复用的项目模板、代码结构规范和资源列表。
|
||||
|
||||
|
|
|
|||
|
|
@ -0,0 +1,93 @@
|
|||
# 网络环境配置指南
|
||||
|
||||
> Vibe Coding 的前置条件:确保能正常访问 GitHub、Google、Claude 等服务。
|
||||
|
||||
---
|
||||
|
||||
## 你需要
|
||||
|
||||
1. **网络服务订阅** - 提供节点的服务商
|
||||
2. **FlClash** - 跨平台网络配置客户端
|
||||
|
||||
---
|
||||
|
||||
## 第一步:购买网络服务
|
||||
|
||||
访问服务商:https://xn--9kqz23b19z.com/#/register?code=35BcnKzl
|
||||
|
||||
- 注册账号
|
||||
- 选择套餐(约 6 元/月起)
|
||||
- 付款后在用户面板找到 **订阅链接**,复制备用
|
||||
|
||||
---
|
||||
|
||||
## 第二步:下载 FlClash
|
||||
|
||||
GitHub 下载:https://github.com/chen08209/FlClash/releases
|
||||
|
||||
根据系统选择:
|
||||
- Windows: `FlClash-x.x.x-windows-setup.exe`
|
||||
- macOS: `FlClash-x.x.x-macos.dmg`
|
||||
- Linux: `FlClash-x.x.x-linux-amd64.AppImage`
|
||||
- Android: `FlClash-x.x.x-android.apk`
|
||||
|
||||
---
|
||||
|
||||
## 第三步:导入订阅
|
||||
|
||||
1. 打开 FlClash
|
||||
2. 点击 **配置** → **添加**
|
||||
3. 选择 **URL 导入**
|
||||
4. 粘贴第一步复制的订阅链接
|
||||
5. 点击确认,等待节点加载
|
||||
|
||||
---
|
||||
|
||||
## 第四步:开启代理
|
||||
|
||||
依次设置以下三项:
|
||||
|
||||
| 设置项 | 操作 |
|
||||
|:---|:---|
|
||||
| **虚拟网卡 (TUN)** | 开启 - 实现全局流量代理 |
|
||||
| **系统代理** | 开启 - 让系统应用走代理 |
|
||||
| **代理模式** | 选择 **全局模式** |
|
||||
|
||||
设置完成后,FlClash 主界面显示已连接即可。
|
||||
|
||||
---
|
||||
|
||||
## 验证
|
||||
|
||||
```bash
|
||||
# 测试 Google 连通性
|
||||
curl -I https://www.google.com
|
||||
|
||||
# 测试 GitHub 连通性
|
||||
curl -I https://github.com
|
||||
```
|
||||
|
||||
返回 `HTTP/2 200` 表示配置成功。
|
||||
|
||||
---
|
||||
|
||||
## 常见问题
|
||||
|
||||
**Q: 节点连不上?**
|
||||
A: 切换其他节点试试,或检查订阅是否过期。
|
||||
|
||||
**Q: 部分应用不走代理?**
|
||||
A: 确保 TUN 模式(虚拟网卡)已开启。
|
||||
|
||||
**Q: 想让终端也走代理?**
|
||||
A: TUN 模式开启后终端自动走代理;或手动设置:
|
||||
```bash
|
||||
export https_proxy=http://127.0.0.1:7890
|
||||
export http_proxy=http://127.0.0.1:7890
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## 下一步
|
||||
|
||||
网络配置完成后,继续阅读 [02-开发环境搭建](./02-开发环境搭建.md)。
|
||||
|
|
@ -0,0 +1,124 @@
|
|||
# 开发环境搭建提示词
|
||||
|
||||
> 使用方法:复制下方对应你设备的提示词,粘贴到任意 AI 对话框(ChatGPT、Claude、Gemini 网页版等),AI 会一步步指导你完成配置。
|
||||
|
||||
**前置条件**:请先完成 [01-网络环境配置](./01-网络环境配置.md)
|
||||
|
||||
---
|
||||
|
||||
## 🪟 Windows 用户提示词
|
||||
|
||||
### 方案 A:WSL2 + Linux 环境(推荐)
|
||||
|
||||
> 适合:想要完整 Linux 开发体验,兼容性最好
|
||||
|
||||
```
|
||||
你是一个耐心的开发环境配置助手。我是一个完全的新手,使用 Windows 系统,需要你一步一步指导我通过 WSL2 搭建 Linux 开发环境。
|
||||
|
||||
请按以下顺序指导我,每次只给我一个步骤,等我确认完成后再进行下一步:
|
||||
|
||||
1. 安装 WSL2(Windows Subsystem for Linux)
|
||||
2. 在 WSL2 中安装 Ubuntu
|
||||
3. 配置 Ubuntu 基础环境(更新系统)
|
||||
4. 安装 nvm 和 Node.js
|
||||
5. 安装 Gemini CLI 或其他免费 AI CLI 工具
|
||||
6. 安装基础开发工具(git, python, build-essential, tmux)
|
||||
7. 配置 Git 用户信息
|
||||
8. 安装代码编辑器(VS Code 并配置 WSL 插件)
|
||||
9. 验证所有工具是否正常工作
|
||||
|
||||
要求:
|
||||
- 每个步骤给出具体的命令,告诉我在哪里运行(PowerShell 还是 Ubuntu 终端)
|
||||
- 用简单易懂的语言解释每个命令的作用
|
||||
- 如果我遇到错误,帮我分析原因并给出解决方案
|
||||
- 每完成一步,问我是否成功,然后再继续下一步
|
||||
|
||||
现在开始第一步吧。
|
||||
```
|
||||
|
||||
### 方案 B:Windows 原生终端
|
||||
|
||||
> 适合:不想装 WSL,直接在 Windows 上开发
|
||||
|
||||
```
|
||||
你是一个耐心的开发环境配置助手。我是一个完全的新手,使用 Windows 系统,需要你一步一步指导我在 Windows 原生环境下搭建开发环境(不使用 WSL)。
|
||||
|
||||
请按以下顺序指导我,每次只给我一个步骤,等我确认完成后再进行下一步:
|
||||
|
||||
1. 安装 Windows Terminal(如果还没有)
|
||||
2. 安装 Node.js(通过官网安装包或 winget)
|
||||
3. 安装 Git for Windows
|
||||
4. 安装 Python
|
||||
5. 安装 Gemini CLI 或其他免费 AI CLI 工具
|
||||
6. 配置 Git 用户信息
|
||||
7. 安装代码编辑器(VS Code)
|
||||
8. 验证所有工具是否正常工作
|
||||
|
||||
要求:
|
||||
- 每个步骤给出具体的命令或操作步骤
|
||||
- 用简单易懂的语言解释每个步骤的作用
|
||||
- 如果我遇到错误,帮我分析原因并给出解决方案
|
||||
- 每完成一步,问我是否成功,然后再继续下一步
|
||||
|
||||
现在开始第一步吧。
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## 🍎 macOS 用户提示词
|
||||
|
||||
```
|
||||
你是一个耐心的开发环境配置助手。我是一个完全的新手,使用 macOS 系统,需要你一步一步指导我从零搭建 Vibe Coding 开发环境。
|
||||
|
||||
请按以下顺序指导我,每次只给我一个步骤,等我确认完成后再进行下一步:
|
||||
|
||||
1. 安装 Homebrew 包管理器
|
||||
2. 使用 Homebrew 安装 Node.js
|
||||
3. 安装 Gemini CLI 或其他免费 AI CLI 工具
|
||||
4. 安装基础开发工具(git, python, tmux)
|
||||
5. 配置 Git 用户信息
|
||||
6. 安装代码编辑器(VS Code 或 Neovim)
|
||||
7. 验证所有工具是否正常工作
|
||||
|
||||
要求:
|
||||
- 每个步骤给出具体的命令
|
||||
- 用简单易懂的语言解释每个命令的作用
|
||||
- 如果我遇到错误,帮我分析原因并给出解决方案
|
||||
- 每完成一步,问我是否成功,然后再继续下一步
|
||||
|
||||
现在开始第一步吧。
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## 🐧 Linux 用户提示词
|
||||
|
||||
```
|
||||
你是一个耐心的开发环境配置助手。我是一个完全的新手,使用 Linux 系统(Ubuntu/Debian),需要你一步一步指导我从零搭建 Vibe Coding 开发环境。
|
||||
|
||||
请按以下顺序指导我,每次只给我一个步骤,等我确认完成后再进行下一步:
|
||||
|
||||
1. 更新系统并安装基础依赖(curl, build-essential)
|
||||
2. 安装 nvm 和 Node.js
|
||||
3. 安装 Gemini CLI 或其他免费 AI CLI 工具
|
||||
4. 安装开发工具(git, python, tmux)
|
||||
5. 配置 Git 用户信息
|
||||
6. 安装代码编辑器(VS Code 或 Neovim)
|
||||
7. 验证所有工具是否正常工作
|
||||
|
||||
要求:
|
||||
- 每个步骤给出具体的命令
|
||||
- 用简单易懂的语言解释每个命令的作用
|
||||
- 如果我遇到错误,帮我分析原因并给出解决方案
|
||||
- 每完成一步,问我是否成功,然后再继续下一步
|
||||
|
||||
现在开始第一步吧。
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## 配置完成后
|
||||
|
||||
环境搭建完成后,继续下一步:
|
||||
|
||||
→ [03-IDE配置](./03-IDE配置.md) - 配置 VS Code 开发环境
|
||||
|
|
@ -0,0 +1,132 @@
|
|||
# IDE 配置提示词
|
||||
|
||||
> 使用方法:复制下方对应你设备的提示词,粘贴到任意 AI 对话框,AI 会一步步指导你完成 VS Code 配置。
|
||||
|
||||
**前置条件**:请先完成 [02-开发环境搭建](./02-开发环境搭建.md)
|
||||
|
||||
---
|
||||
|
||||
## 🪟 Windows + WSL 用户提示词
|
||||
|
||||
```
|
||||
你是一个耐心的 VS Code 配置助手。我已经安装好了 WSL2 和 Ubuntu,现在需要你一步一步指导我配置 VS Code 以获得最佳的 WSL 开发体验。
|
||||
|
||||
请按以下顺序指导我,每次只给我一个步骤,等我确认完成后再进行下一步:
|
||||
|
||||
1. 在 Windows 上安装 VS Code(如果还没装)
|
||||
2. 安装 Remote - WSL 扩展
|
||||
3. 通过 WSL 打开项目文件夹
|
||||
4. 安装基础开发扩展:
|
||||
- GitLens(Git 增强)
|
||||
- Prettier(代码格式化)
|
||||
- ESLint(代码检查)
|
||||
- Local History(本地历史记录)
|
||||
5. 配置终端默认使用 WSL
|
||||
6. 配置自动保存和格式化
|
||||
7. 验证配置是否正常工作
|
||||
|
||||
要求:
|
||||
- 每个步骤给出具体的操作方法
|
||||
- 用简单易懂的语言解释每个配置的作用
|
||||
- 如果我遇到问题,帮我分析原因并给出解决方案
|
||||
- 每完成一步,问我是否成功,然后再继续下一步
|
||||
|
||||
现在开始第一步吧。
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## 🪟 Windows 原生用户提示词
|
||||
|
||||
```
|
||||
你是一个耐心的 VS Code 配置助手。我使用 Windows 系统(不使用 WSL),现在需要你一步一步指导我配置 VS Code。
|
||||
|
||||
请按以下顺序指导我,每次只给我一个步骤,等我确认完成后再进行下一步:
|
||||
|
||||
1. 安装 VS Code(如果还没装)
|
||||
2. 安装基础开发扩展:
|
||||
- GitLens(Git 增强)
|
||||
- Prettier(代码格式化)
|
||||
- ESLint(代码检查)
|
||||
- Local History(本地历史记录)
|
||||
- Python(如果写 Python)
|
||||
3. 配置终端使用 PowerShell 或 Git Bash
|
||||
4. 配置自动保存和格式化
|
||||
5. 配置 Git 集成
|
||||
6. 验证配置是否正常工作
|
||||
|
||||
要求:
|
||||
- 每个步骤给出具体的操作方法
|
||||
- 用简单易懂的语言解释每个配置的作用
|
||||
- 如果我遇到问题,帮我分析原因并给出解决方案
|
||||
- 每完成一步,问我是否成功,然后再继续下一步
|
||||
|
||||
现在开始第一步吧。
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## 🍎 macOS 用户提示词
|
||||
|
||||
```
|
||||
你是一个耐心的 VS Code 配置助手。我使用 macOS 系统,现在需要你一步一步指导我配置 VS Code。
|
||||
|
||||
请按以下顺序指导我,每次只给我一个步骤,等我确认完成后再进行下一步:
|
||||
|
||||
1. 安装 VS Code(通过 Homebrew 或官网)
|
||||
2. 配置 code 命令行工具(在终端中用 code 打开文件)
|
||||
3. 安装基础开发扩展:
|
||||
- GitLens(Git 增强)
|
||||
- Prettier(代码格式化)
|
||||
- ESLint(代码检查)
|
||||
- Local History(本地历史记录)
|
||||
4. 配置自动保存和格式化
|
||||
5. 配置快捷键(可选:Vim 模式)
|
||||
6. 验证配置是否正常工作
|
||||
|
||||
要求:
|
||||
- 每个步骤给出具体的操作方法
|
||||
- 用简单易懂的语言解释每个配置的作用
|
||||
- 如果我遇到问题,帮我分析原因并给出解决方案
|
||||
- 每完成一步,问我是否成功,然后再继续下一步
|
||||
|
||||
现在开始第一步吧。
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## 🐧 Linux 用户提示词
|
||||
|
||||
```
|
||||
你是一个耐心的 VS Code 配置助手。我使用 Linux 系统(Ubuntu/Debian),现在需要你一步一步指导我配置 VS Code。
|
||||
|
||||
请按以下顺序指导我,每次只给我一个步骤,等我确认完成后再进行下一步:
|
||||
|
||||
1. 安装 VS Code(通过 apt 或 snap)
|
||||
2. 安装基础开发扩展:
|
||||
- GitLens(Git 增强)
|
||||
- Prettier(代码格式化)
|
||||
- ESLint(代码检查)
|
||||
- Local History(本地历史记录)
|
||||
3. 配置自动保存和格式化
|
||||
4. 配置终端集成
|
||||
5. 配置快捷键(可选:Vim 模式)
|
||||
6. 验证配置是否正常工作
|
||||
|
||||
要求:
|
||||
- 每个步骤给出具体的操作方法
|
||||
- 用简单易懂的语言解释每个配置的作用
|
||||
- 如果我遇到问题,帮我分析原因并给出解决方案
|
||||
- 每完成一步,问我是否成功,然后再继续下一步
|
||||
|
||||
现在开始第一步吧。
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## 配置完成后
|
||||
|
||||
VS Code 配置完成后,你可以:
|
||||
|
||||
1. 继续阅读 [04-AI编程工具](./04-AI编程工具.md) 安装 AI CLI 工具
|
||||
2. 或直接阅读 [README.md](../../../../README.md) 了解 Vibe Coding 工作流
|
||||
|
|
@ -0,0 +1,28 @@
|
|||
# 🚀 从零开始 Vibe Coding
|
||||
|
||||
> 完全零基础?按顺序完成以下步骤,即可开始 AI 编程之旅。
|
||||
|
||||
---
|
||||
|
||||
## 学习路径
|
||||
|
||||
| 序号 | 文档 | 说明 |
|
||||
|:---:|:---|:---|
|
||||
| 01 | [网络环境配置](./01-网络环境配置.md) | 配置网络,确保能访问 GitHub、Google 等服务 |
|
||||
| 02 | [开发环境搭建](./02-开发环境搭建.md) | 复制提示词给 AI,让 AI 指导你安装开发工具 |
|
||||
| 03 | [IDE配置](./03-IDE配置.md) | 配置 VS Code 编辑器 |
|
||||
|
||||
---
|
||||
|
||||
## 使用方法
|
||||
|
||||
1. 按顺序阅读每个文档
|
||||
2. 文档中的提示词可以直接复制到 AI 对话框(ChatGPT、Claude、Gemini 网页版)
|
||||
3. AI 会一步步指导你完成配置
|
||||
4. 遇到问题直接问 AI
|
||||
|
||||
---
|
||||
|
||||
## 完成后
|
||||
|
||||
全部配置完成后,阅读 [主文档](../../../../README.md) 了解 Vibe Coding 工作流。
|
||||
|
|
@ -4,7 +4,11 @@ import json
|
|||
from pathlib import Path
|
||||
|
||||
# Load PATH_TRANSLATION_MAP from JSON
|
||||
with open('path_translation_map.json', 'r', encoding='utf-8') as f:
|
||||
# Ensure the path is relative to the script's location or absolute
|
||||
script_dir = Path(__file__).parent
|
||||
path_translation_map_path = script_dir / 'path_translation_map.json'
|
||||
|
||||
with open(path_translation_map_path, 'r', encoding='utf-8') as f:
|
||||
PATH_TRANSLATION_MAP = json.load(f)
|
||||
|
||||
def translate_path_component(component):
|
||||
|
|
@ -23,95 +27,96 @@ def translate_path_component(component):
|
|||
return re.sub(r"[^a-zA-Z0-9]+", "_", cleaned_component).strip("_")
|
||||
|
||||
# If it's a very long Chinese filename that might have specific terms
|
||||
if "代码" in component:
|
||||
return component.replace("代码", "Code").replace("组织", "Organization").replace(" ", "_")
|
||||
if "编程" in component:
|
||||
return component.replace("编程", "Programming").replace("书籍推荐", "Books_Recommendation").replace(" ", "_")
|
||||
if "通用项目架构模板" in component:
|
||||
# These were added to PATH_TRANSLATION_MAP now, so this generic logic might not be hit as often
|
||||
if "代码组织" == component: # Exact match for a known common Chinese filename part
|
||||
return "Code_Organization"
|
||||
if "编程书籍推荐" == component:
|
||||
return "Recommended_Programming_Books"
|
||||
if "通用项目架构模板" == component:
|
||||
return "General_Project_Architecture_Template"
|
||||
if "工具集" in component:
|
||||
if "工具集" == component:
|
||||
return "Tool_Set"
|
||||
if "系统提示词构建原则" in component:
|
||||
if "系统提示词构建原则" == component:
|
||||
return "System_Prompt_Construction_Principles"
|
||||
if "胶水编程" in component:
|
||||
if "胶水编程" == component:
|
||||
return "Glue_Programming"
|
||||
if "vibe-coding-经验收集" in component:
|
||||
if "vibe-coding-经验收集" == component:
|
||||
return "vibe-coding-Experience_Collection"
|
||||
if "开发经验" in component:
|
||||
if "开发经验" == component:
|
||||
return "Development_Experience"
|
||||
if "学习经验" in component:
|
||||
if "学习经验" == component:
|
||||
return "Learning_Experience"
|
||||
if "编程之道" in component:
|
||||
if "编程之道" == component:
|
||||
return "The_Way_of_Programming"
|
||||
if "客观分析" in component:
|
||||
if "客观分析" == component:
|
||||
return "Objective_Analysis"
|
||||
if "精华技术文档生成提示词" in component:
|
||||
if "精华技术文档生成提示词" == component:
|
||||
return "Essential_Technical_Document_Generation_Prompt"
|
||||
if "智能需求理解与研发导航引擎" in component:
|
||||
if "智能需求理解与研发导航引擎" == component:
|
||||
return "Intelligent_Requirement_Understanding_and_R_D_Navigation_Engine"
|
||||
if "软件工程分析" in component:
|
||||
if "软件工程分析" == component:
|
||||
return "Software_Engineering_Analysis"
|
||||
if "系统架构可视化生成Mermaid" in component:
|
||||
if "系统架构可视化生成Mermaid":
|
||||
return "System_Architecture_Visualization_Generation_Mermaid"
|
||||
if "系统架构" in component:
|
||||
if "系统架构":
|
||||
return "System_Architecture"
|
||||
if "简易提示词优化器" in component:
|
||||
if "简易提示词优化器":
|
||||
return "Simple_Prompt_Optimizer"
|
||||
if "提示工程师任务说明" in component:
|
||||
if "提示工程师任务说明":
|
||||
return "Prompt_Engineer_Task_Description"
|
||||
if "高质量代码开发专家" in component:
|
||||
if "高质量代码开发专家":
|
||||
return "High_Quality_Code_Development_Expert"
|
||||
if "标准项目目录结构" in component:
|
||||
if "标准项目目录结构":
|
||||
return "Standard_Project_Directory_Structure"
|
||||
if "分析1" in component:
|
||||
if "分析1":
|
||||
return "Analysis_1"
|
||||
if "分析2" in component:
|
||||
if "分析2":
|
||||
return "Analysis_2"
|
||||
if "执行纯净性检测" in component:
|
||||
if "执行纯净性检测":
|
||||
return "Perform_Purity_Test"
|
||||
if "标准化流程" in component:
|
||||
if "标准化流程":
|
||||
return "Standardized_Process"
|
||||
if "项目上下文文档生成" in component:
|
||||
if "项目上下文文档生成":
|
||||
return "Project_Context_Document_Generation"
|
||||
if "人机对齐" in component:
|
||||
if "人机对齐":
|
||||
return "Human_AI_Alignment"
|
||||
if "plan提示词" in component:
|
||||
if "plan提示词":
|
||||
return "Plan_Prompt"
|
||||
if "Claude Code 八荣八耻" in component:
|
||||
if "Claude Code 八荣八耻":
|
||||
return "Claude_Code_Eight_Honors_and_Eight_Shames"
|
||||
if "任务描述,分析与补全任务" in component:
|
||||
if "任务描述,分析与补全任务":
|
||||
return "Task_Description_Analysis_and_Completion"
|
||||
if "前端设计" in component:
|
||||
if "前端设计":
|
||||
return "Frontend_Design"
|
||||
if "输入简单的日常行为的研究报告摘要" in component:
|
||||
if "输入简单的日常行为的研究报告摘要":
|
||||
return "Summary_of_Research_Report_on_Simple_Daily_Behaviors"
|
||||
if "胶水开发" in component:
|
||||
if "胶水开发":
|
||||
return "Glue_Development"
|
||||
if "sh控制面板生成" in component:
|
||||
if "sh控制面板生成":
|
||||
return "SH_Control_Panel_Generation"
|
||||
if "角色定义" in component:
|
||||
if "角色定义":
|
||||
return "Role_Definition"
|
||||
if "CLAUDE 记忆" in component:
|
||||
if "CLAUDE 记忆":
|
||||
return "CLAUDE_Memory"
|
||||
if "Docs文件夹中文命名提示词" in component:
|
||||
if "Docs文件夹中文命名提示词":
|
||||
return "Docs_Folder_Chinese_Naming_Prompt"
|
||||
if "通用项目架构综合分析与优化框架" in component:
|
||||
if "通用项目架构综合分析与优化框架":
|
||||
return "General_Project_Architecture_Comprehensive_Analysis_and_Optimization_Framework"
|
||||
if "执行📘_文件头注释规范(用于所有代码文件最上方)" in component:
|
||||
if "执行📘_文件头注释规范(用于所有代码文件最上方)" == component:
|
||||
return "Execute_File_Header_Comment_Specification_for_All_Code_Files"
|
||||
if "数据管道" in component:
|
||||
if "数据管道" == component:
|
||||
return "Data_Pipeline"
|
||||
if "项目变量与工具统一维护" in component:
|
||||
if "项目变量与工具统一维护" == component:
|
||||
return "Unified_Management_of_Project_Variables_and_Tools"
|
||||
if "ASCII图生成" in component:
|
||||
if "ASCII图生成" == component:
|
||||
return "ASCII_Art_Generation"
|
||||
if "Kobe's Diary of Saving Mother, Father, Fiancee, and In-laws × OTE Model Trading Mode × M.I.T White Professor (Accused of Sexual Harassment by Female Student) v2" in component:
|
||||
if "Kobe's Diary of Saving Mother, Father, Fiancee, and In-laws × OTE Model Trading Mode × M.I.T White Professor (Accused of Sexual H_arassment by Female Student) v2" == component:
|
||||
return "Kobe_s_Diary_of_Saving_Mother_Father_Fiancee_and_In_laws_OTE_Model_Trading_Mode_M_I_T_White_Professor_Accused_of_Sexual_Harassment_by_Female_Student_v2" # Simplified for filename
|
||||
if "动态视图对齐实现文档" in component:
|
||||
if "动态视图对齐实现文档" == component:
|
||||
return "Dynamic_View_Alignment_Implementation_Document"
|
||||
if "Telegram_Bot_按钮和键盘实现模板" in component:
|
||||
if "Telegram_Bot_按钮和键盘实现模板" == component:
|
||||
return "Telegram_Bot_Button_and_Keyboard_Implementation_Template"
|
||||
if "README" in component:
|
||||
if "README" == component:
|
||||
return "README" # Keep README as is
|
||||
|
||||
# Default: simply replace spaces with underscores and remove problematic characters for filenames
|
||||
|
|
@ -139,40 +144,39 @@ def get_translated_path(chinese_path_str): # Accept string
|
|||
return Path(*translated_parts) # Reconstruct path using pathlib
|
||||
|
||||
# Load chinese_files from JSON
|
||||
with open('chinese_files_list.json', 'r', encoding='utf-8') as f:
|
||||
chinese_files_list_path = script_dir / 'chinese_files_list.json'
|
||||
with open(chinese_files_list_path, 'r', encoding='utf-8') as f:
|
||||
chinese_files_str_list = json.load(f)
|
||||
|
||||
for chinese_file_path_str in chinese_files_str_list:
|
||||
chinese_file_path = Path(chinese_file_path_str) # Convert string to Path object
|
||||
files_to_translate_content = []
|
||||
|
||||
# Construct the corresponding English directory path
|
||||
english_file_path = get_translated_path(chinese_file_path_str) # Pass string to get_translated_path for component splitting
|
||||
english_dir = english_file_path.parent # Get parent directory from Path object
|
||||
for chinese_file_path_str in chinese_files_str_list:
|
||||
english_file_path = get_translated_path(chinese_file_path_str) # Get translated Path object
|
||||
|
||||
# Create the English directory if it doesn't exist
|
||||
os.makedirs(english_dir, exist_ok=True)
|
||||
|
||||
# Read the content of the Chinese file
|
||||
# Read the content of the English placeholder file
|
||||
try:
|
||||
# Use pathlib.Path.open() which is generally more robust
|
||||
with chinese_file_path.open('r', encoding='utf-8') as f:
|
||||
chinese_content = f.read()
|
||||
with english_file_path.open('r', encoding='utf-8') as f:
|
||||
content = f.read()
|
||||
|
||||
if content.startswith("TRANSLATED CONTENT:\n"):
|
||||
chinese_content = content.replace("TRANSLATED CONTENT:\n", "")
|
||||
files_to_translate_content.append({
|
||||
"chinese_content": chinese_content,
|
||||
"english_target_path": str(english_file_path) # Store as string for easy display
|
||||
})
|
||||
|
||||
except FileNotFoundError:
|
||||
print(f"Error: File not found - {chinese_file_path_str}. Skipping.")
|
||||
# This can happen if the previous script run failed for this file
|
||||
print(f"Warning: English placeholder file not found for {english_file_path}. Skipping content extraction for this file.")
|
||||
continue
|
||||
except Exception as e:
|
||||
print(f"Error reading {chinese_file_path_str}: {e}. Skipping.")
|
||||
print(f"Error reading {english_file_path} for content extraction: {e}. Skipping.")
|
||||
continue
|
||||
|
||||
# Simulate content translation (actual LLM translation will be done manually later)
|
||||
# For now, just copy content with a prefix.
|
||||
# THIS WILL BE REPLACED BY LLM-BASED TRANSLATION IN A LATER STEP.
|
||||
translated_content = f"TRANSLATED CONTENT:\n{chinese_content}"
|
||||
|
||||
# Write the translated content to the English file path
|
||||
try:
|
||||
with english_file_path.open('w', encoding='utf-8') as f:
|
||||
f.write(translated_content)
|
||||
print(f"Processed: {chinese_file_path_str} -> {english_file_path}")
|
||||
except Exception as e:
|
||||
print(f"Error writing to {english_file_path}: {e}. Skipping.")
|
||||
|
||||
# Output the list of files to translate content for
|
||||
print("--- Files for Content Translation ---")
|
||||
for item in files_to_translate_content:
|
||||
print(f"Target Path: {item['english_target_path']}")
|
||||
print(f"Chinese Content:\n```markdown\n{item['chinese_content'].strip()}\n```\n{'='*50}\n")
|
||||
|
||||
print(f"Total files requiring content translation: {len(files_to_translate_content)}")
|
||||
Loading…
Reference in New Issue