docs: 调整附录与第二章排版,补充模块/包说明

- AGENTS.md: 新增 Codex 代理说明文件
- .gitignore: 屏蔽第三方工具目录 (.prism/, .claudeprism/, .agents/)
- preamble: 启用 xcolor dvipsnames 选项,新增 GREEN 颜色与 \greenheading 命令
- ch02-framework: 修正智能体段落引号格式
- ap01-programming: 补充 Python 模块与包的对比说明(esp_engine 示例)
- ap02-vibe-coding: 应用 \greenheading 标题样式,强调 commit 作为审核检查点
- 移除 2026_DesignAI.code-workspace(放弃 workspace 持久化方案)

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
2026-06-14 11:31:25 +08:00
parent 979b5128dc
commit c85bbd3c55
8 changed files with 174 additions and 14 deletions
+4
View File
@@ -32,3 +32,7 @@ output/
*.synctex.gz
*.pdf
# 第三方软件
.prism/
.claudeprism/
.agents/
-11
View File
@@ -1,11 +0,0 @@
{
"folders": [
{
"path": "."
},
{
"path": "../2026_WritingAgent"
}
],
"settings": {}
}
+119
View File
@@ -0,0 +1,119 @@
# AGENTS.md
This file provides guidance to Codex (Codex.ai/code) when working with code in this repository.
## Project Overview
This is **设计人工智能:基础与应用** — a textbook project for design AI education. The book covers AI fundamentals (principles, perception, generation, agents) and their applications across design domains (digital media, industrial design, environmental design, urban planning).
A supplementary volume, **CC4SI (Codex for Spatial Intelligence)**, is preserved in `officefile/supplements/` and focuses on spatial intelligence and autonomous design using Codex.
**Key Characteristics:**
- Educational content organized as a book with 12 chapters + 9 appendices
- Mixed Chinese/English documentation and code
- Git-based workflow with Obsidian integration for content editing
- Pandoc-based export to Word (DOCX) with publisher template
- Standard research project directory structure
## Directory Structure
```
2026_DesignAI/
├── data/ # Data and resources
│ ├── pics/ # Book illustrations
│ └── references/ # Bibliography data
├── dofile/ # Code and scripts
│ └── examples/ # Python code examples
│ ├── 00-introduction/ # Setup first assistant
│ ├── 01-foundations/ # State machines, modularity, etc.
│ └── 02-spatial-intelligence/ # Spatial analysis examples
├── officefile/ # Main book content
│ ├── 00-frontmatter/ # 自序 (Preface), 目录 (TOC)
│ ├── 01-introduction/ # Ch1: AI development history
│ ├── 02-framework/ # Ch2: AI theoretical framework
│ ├── 03-1d-sequence/ # Ch3: Sequence & text (RNN→LLM)
│ ├── 04-2d-vision/ # Ch4: Images & vision (CNN)
│ ├── 05-3d-spatial/ # Ch5: Spatial & 3D (PointNet)
│ ├── 06-reinforcement/ # Ch6: Reinforcement learning
│ ├── 07-generative-ai/ # Ch7: Generative AI (Diffusion)
│ ├── 08-agent/ # Ch8: AI Agent
│ ├── 09-digital-media/ # Ch9: Digital media design
│ ├── 10-industrial-design/ # Ch10: Industrial design
│ ├── 11-environmental-landscape/ # Ch11: Environmental & landscape
│ ├── 12-urban-ecology/ # Ch12: Urban & ecological planning
│ ├── appendix/ # Appendices 1-9
│ └── supplements/ # CC4SI supplementary material
│ ├── 00-05/ # Spatial intelligence chapters
│ └── appendix/ # Academic writing workflow
├── output/ # Generated outputs
│ └── docx/ # Word exports
├── Archive/ # Archived original directories
├── .Codex/skills/markdown-to-docx/ # DOCX conversion skill
├── .pandoc/ # Pandoc config (CSL, Zotero JSON)
└── .obsidian/ # Obsidian vault configuration
```
## Book Structure
### Upper Volume: Principles & Technology
| Chapter | Topic | Lines | Status |
|---------|-------|-------|--------|
| 01 | AI development history & paradigm evolution | 367 | Complete |
| 02 | Theoretical framework (functional perspective, MLP) | 897 | Complete |
| 03 | 1D data: Sequence & text (RNN → LLM) | 1595 | Complete |
| 04 | 2D data: Images & vision (CNN → ViT) | 867 | Complete |
| 05 | 3D data: Spatial & 3D (PointNet → Spatial AI) | 1421 | Complete |
| 06 | Generative AI (VAE/GAN → Diffusion) | 496 | Complete |
| 07 | AI Agent (rules → LLM Agent) | 581 | Complete |
| 08 | Reinforcement learning (Q-Learning → RLHF) | 896 | Complete |
### Lower Volume: Design Applications
| Chapter | Topic | Lines | Status |
|---------|-------|-------|--------|
| 09 | Digital media design | 161 | Thin |
| 10 | Industrial & product design | 145 | Thin |
| 11 | Environmental & landscape design | 153 | Thin |
| 12 | Urban & ecological planning | 317 | Moderate |
### Appendices
9 appendices covering programming basics, Vibe Coding, academic writing, web tools, references, glossary, and tips.
## Working with This Repository
### For Content Editing
- Edit `.md` files in `officefile/` — they are the book source
- Use Obsidian for rich editing (vault at project root)
- Git commits follow conventional format: `docs(ch01): description`
### For DOCX Export
- Use the `markdown-to-docx` skill in `.Codex/skills/`
- Publisher template: `machinery-industry-press-writing-template.dotx`
- Output goes to `output/docx/`
### For Python Examples
- Examples in `dofile/examples/` are self-contained
- Run directly: `python dofile/examples/01-foundations/state_machine.py`
- No global test suite — verify examples individually
## Language Considerations
- **Documentation**: Primarily Chinese with English technical terms
- **Code**: Variable names and comments in English
- **File names**: Mix of Chinese and English — use proper encoding
## Commit Convention
```
<type>(<scope>): <subject>
Types: feat, fix, docs, style, refactor, chore
Scopes: ch01-ch12, appendix, supplements, examples
Examples:
- docs(ch03): 补充 Transformer 注意力机制详解
- feat(examples): 新增空间推理示例
- fix(ch05): 修正 PointNet 结构描述
```
@@ -494,6 +494,47 @@ train\_model(100, optimizer="SGD", lr=0.1)
导入模块
Python 通过\textbf{模块}module)和\textbf{}package)组织代码复用:一个 \texttt{.py} 文件就是一个模块,含有 \texttt{\_\_init\_\_.py} 的文件夹就是一个包,使用 \texttt{from 包.包.模块 import 函数/类} 的语法导入。
以本书生态安全格局项目中的 \texttt{esp\_engine/} 为例:
\begin{verbatim}
esp_engine/
├── data_manager.py ← 模块(1个文件,7个函数)
├── io/ ← 包(文件夹,2个模块)
│ ├── __init__.py
│ ├── raster_io.py ← 7个函数
│ └── vector_io.py ← 5个函数
├── steps/ ← 包(文件夹,10个模块)
│ ├── __init__.py
│ ├── reclassify.py
│ ├── cost_distance.py
│ └── ...8个文件)
└── workflows/ ← 包(文件夹,6个模块)
├── __init__.py
├── suitability.py
└── ...5个文件)
\end{verbatim}
何时用模块、何时用包?原则很简单——看体量(表\ref{tab:module-vs-package})。
\begin{table}[htbp]
\centering
\caption{模块与包的选择原则}
\label{tab:module-vs-package}
\begin{tabular}{@{} l l l @{}}
\toprule
\textbf{情况} & \textbf{做法} & \textbf{项目中的例子} \\
\midrule
功能集中,一个文件装得下 & 模块(单个 .py & data\_manager.py:7个函数全是数据预处理 \\[3pt]
功能分多个领域,各有独立逻辑 & 包(文件夹+子模块) & steps/:10个文件,每个是一种 GIS 操作 \\[3pt]
拿捏不准 & 先做模块,膨胀了再拆 &\\
\bottomrule
\end{tabular}
\end{table}
一句话:\textbf{模块是``够用就好的最小单位'',包是``需要分家时的组织方式''}
\emph{\# 导入标准库}
\textbf{import} os
@@ -5,7 +5,7 @@ Code、Markdown/Obsidian、Git/GitHub等核心工具的使用方法。
\section{Vibe Coding的概念与工具}
\subsection{什么是Vibe Coding}
\subsection{\greenheading{什么是Vibe Coding}}
传统编程遵循``明确需求 → 设计算法 → 编写代码''的线性流程,而 Vibe Coding 则转变为``\textbf{模糊想法 → AI辅助 → 迭代完善}''。这是一种以AI为核心的编程新模式:开发者用自然语言描述意图,AI生成代码,再通过迭代对话逐步完善。对于编程经验较少的设计专业读者而言,这种模式大幅降低了技术门槛——不需要记住语法细节,只需要清楚地表达”想要什么”。
@@ -47,6 +47,8 @@ Vibe Coding 的基本流程是:\textbf{描述意图}→AI生成代码→运行
EPCC 的核心理念是\textbf{先理解、再规划、后动手、常存档}——这与传统的"边写边想"形成对比,特别适合设计专业读者在 AI 辅助下管理复杂项目。
值得强调的是,Commit 阶段并非简单的``保存'',而是\textbf{人工审核的检查点}。每一次 commit 都意味着开发者已经阅读、理解并确认了 AI 生成的代码——只有审核无误的内容才应当提交。因此,在 Vibe Coding 中不宜一次性让 AI 生成大量代码,而应将任务拆分为小步骤,每一步都以一次成功的 commit 为目标。从这个意义上说,Vibe Coding 的过程就是\textbf{不断 commit 的过程}:生成一小段代码 → 审核确认 → commit → 进入下一轮。这种``小步快跑''的节奏既保证了代码质量,也帮助开发者在每次 commit 中逐步积累对项目的理解。
\subsection{工具生态}
当前 AI 编程工具已形成多种产品形态,各有侧重(表\ref{tab:ai-tools})。
+1 -1
View File
@@ -970,7 +970,7 @@ print(f"真实参数: W = [2.0, 3.0], b = [1.0]")
\subsection{智能体与环境概念}
在《人工智能——计算Agent基础》一书\cite{MGDW8DPN}中,人工智能被定义为“一个研究能够产生智能行为的计算Agent的分析与综合的领域”,可见Agent这一概念在AI领域中的核心地位。书中进一步将Agent定义为“在某个环境中进行某种行为的个体——它完成了某件事”。由此,``人工智能的核心科学目标是理解自然系统或人工系统中一些智能行为的原理,而人工智能的核心工程目标是设计和合成有用且智能的产品''
在《人工智能——计算Agent基础》一书\cite{MGDW8DPN}中,人工智能被定义为“一个研究能够产生智能行为的计算Agent的分析与综合的领域”,可见Agent这一概念在AI领域中的核心地位。书中进一步将Agent定义为“在某个环境中进行某种行为的个体——它完成了某件事”。由此,人工智能的核心科学目标是理解自然系统或人工系统中一些智能行为的原理,而人工智能的核心工程目标是设计和合成有用且智能的产品
因此,AI领域的基本要素便是在不同类型环境(Environment)中行动的各类智能体(Agent),执行从科学发现到实践应用等不同场景中的多种任务(Task)。总体上,环境可分为物理环境与虚拟或数字环境两大类,智能体可分为人类(含具有不同程度智能的动物)、AI与具身智能三大类(表2.1)。
+1
View File
@@ -1,3 +1,4 @@
\PassOptionsToPackage{dvipsnames}{xcolor}
\documentclass[a4paper,openany,12pt]{ctexbook}
% ========== 宏包与全局设置 ==========
+5 -1
View File
@@ -49,7 +49,8 @@
}
% ========== 颜色 ==========
\usepackage{xcolor}
\usepackage[dvipsnames]{xcolor}
\definecolor{GREEN}{RGB}{0,128,0}
% ========== 超链接 ==========
\usepackage{hyperref}
@@ -98,3 +99,6 @@
% ========== 章节编号深度 ==========
\setcounter{secnumdepth}{3}
% ========== 绿色底色标题 ==========
\newcommand{\greenheading}[1]{\texorpdfstring{\colorbox{green!20}{\ #1\ }}{#1}}