development
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseProject Handover - Development
项目交接 - 开发部分
Generate a complete technical guide for developers. This skill analyzes the codebase and produces actionable documentation that enables developers to understand, maintain, and extend the project.
为开发者生成完整的技术指南。本技能会分析代码库并产出可落地的文档,帮助开发者理解、维护和扩展项目。
When to Use This Skill
何时使用本技能
- Onboarding new developers to a project
- Technical handover to maintenance team
- Code review and architecture documentation
- Creating developer-focused documentation
- 新开发者入职项目
- 向维护团队进行技术交接
- 代码评审与架构文档撰写
- 创建面向开发者的技术文档
Step 0: Navigate to Project Root and Verify Edge Delivery Services Project (CONDITIONAL)
步骤0:导航至项目根目录并验证Edge Delivery Services项目(可选)
Skip this step if flag is set (orchestrator already validated and navigated).
allGuidesCRITICAL: If NOT skipped, you MUST execute the command. Do NOT use absolute paths — actually change directory.
cdbash
ALL_GUIDES=$(cat .claude-plugin/project-config.json 2>/dev/null | grep -o '"allGuides"[[:space:]]*:[[:space:]]*true')
if [ -z "$ALL_GUIDES" ]; then
# Navigate to git project root (works from any subdirectory)
cd "$(git rev-parse --show-toplevel)"
# Verify it's an Edge Delivery Services project
ls scripts/aem.js
fiIMPORTANT:
- You MUST run the command above using the Bash tool
cd - All subsequent steps operate from project root
- Do NOT use absolute paths to verify — actually navigate
- Guides will be created at
project-root/project-guides/
If NOT skipped AND does NOT exist, respond:
scripts/aem.js"This skill is designed for AEM Edge Delivery Services projects. The current directory does not appear to be an Edge Delivery Services project (not found).scripts/aem.jsPlease navigate to an Edge Delivery Services project and try again."
STOP if check fails. Otherwise proceed — you are now at project root.
若已设置标记,则跳过此步骤(编排工具已完成验证与导航)。
allGuides重要提示:若未跳过此步骤,必须执行命令。请勿使用绝对路径——实际切换目录。
cdbash
ALL_GUIDES=$(cat .claude-plugin/project-config.json 2>/dev/null | grep -o '"allGuides"[[:space:]]*:[[:space:]]*true')
if [ -z "$ALL_GUIDES" ]; then
# 导航至Git项目根目录(从任意子目录均可生效)
cd "$(git rev-parse --show-toplevel)"
# 验证是否为Edge Delivery Services项目
ls scripts/aem.js
fi注意事项:
- 必须使用Bash工具运行上述命令
cd - 后续所有步骤均在项目根目录下执行
- 请勿使用绝对路径进行验证——实际导航至目标目录
- 指南将生成在路径下
project-root/project-guides/
若未跳过此步骤且未找到文件,请回复:
scripts/aem.js"本技能专为AEM Edge Delivery Services项目设计。当前目录似乎并非Edge Delivery Services项目(未找到文件)。scripts/aem.js请导航至Edge Delivery Services项目后重试。"
若检查不通过则停止操作,否则继续——此时你已处于项目根目录。
Communication Guidelines
沟通规范
- NEVER use "EDS" as an acronym for Edge Delivery Services in any generated documentation or chat responses
- Always use the full name "Edge Delivery Services" or "AEM Edge Delivery Services"
- This applies to all output files (PDF, HTML, markdown) and all communication with the user
- 禁止使用“EDS”作为Edge Delivery Services的缩写,在任何生成的文档或聊天回复中均不得使用
- 始终使用全称“Edge Delivery Services”或“AEM Edge Delivery Services”
- 此规范适用于所有输出文件(PDF、HTML、Markdown)以及与用户的所有沟通
⚠️ CRITICAL PATH REQUIREMENT
⚠️ 关键路径要求
YOU MUST SAVE THE FILE TO THIS EXACT PATH:
project-guides/DEVELOPER-GUIDE.mdBEFORE WRITING ANY FILE:
- First, create the directory:
mkdir -p project-guides - Then write to:
project-guides/DEVELOPER-GUIDE.md
WHY THIS MATTERS: Files must be in for proper organization and PDF conversion.
project-guides/❌ WRONG: (root)
❌ WRONG:
❌ WRONG:
✅ CORRECT:
DEVELOPER-GUIDE.mddocs/DEVELOPER-GUIDE.md/workspace/DEVELOPER-GUIDE.mdproject-guides/DEVELOPER-GUIDE.md必须将文件保存至以下精确路径:
project-guides/DEVELOPER-GUIDE.md在写入任何文件之前:
- 首先创建目录:
mkdir -p project-guides - 然后写入至:
project-guides/DEVELOPER-GUIDE.md
为何如此重要: 文件必须存放在目录下,以便进行合理组织与PDF转换。
project-guides/❌ 错误路径: (根目录)
❌ 错误路径:
❌ 错误路径:
✅ 正确路径:
DEVELOPER-GUIDE.mddocs/DEVELOPER-GUIDE.md/workspace/DEVELOPER-GUIDE.mdproject-guides/DEVELOPER-GUIDE.mdOutput Format
输出格式
MANDATORY OUTPUT:
project-guides/DEVELOPER-GUIDE.pdfSTRICTLY FORBIDDEN:
- ❌ Do NOT read or analyze — it does NOT exist in most projects and does NOT show all sites
fstab.yaml - ❌ Do NOT create files
.plain.html - ❌ Do NOT use tool — this converts the FULL guide to HTML with raw frontmatter visible, which is NOT what we want
convert_markdown_to_html - ❌ Do NOT tell user to "convert markdown to PDF manually"
- ❌ Do NOT save markdown to root directory or any path other than
project-guides/ - ❌ Do NOT say "PDF will be generated later" or "at session end" — generate it NOW
REQUIRED WORKFLOW:
- Run to ensure directory exists
mkdir -p project-guides - Generate markdown content with YAML frontmatter (title, date)
- Save to (EXACT PATH - no exceptions)
project-guides/DEVELOPER-GUIDE.md - IMMEDIATELY invoke PDF conversion (see Phase 5.1)
- Clean up all source files (only PDF remains)
- Final output:
project-guides/DEVELOPER-GUIDE.pdf
强制输出:
project-guides/DEVELOPER-GUIDE.pdf严格禁止:
- ❌ 请勿读取或分析——大多数项目中不存在该文件,且无法展示所有站点信息
fstab.yaml - ❌ 请勿创建文件
.plain.html - ❌ 请勿使用工具——该工具会将完整指南转换为HTML并显示原始前置内容,不符合需求
convert_markdown_to_html - ❌ 请勿告知用户“手动将Markdown转换为PDF”
- ❌ 请勿将Markdown文件保存至根目录或以外的任何路径
project-guides/ - ❌ 请勿提及“PDF将稍后生成”或“会话结束时生成”——立即生成PDF
要求的工作流程:
- 运行确保目录存在
mkdir -p project-guides - 生成包含YAML前置内容(标题、日期)的Markdown内容
- 保存至(精确路径——无例外)
project-guides/DEVELOPER-GUIDE.md - 立即调用PDF转换功能(见阶段5.1)
- 清理所有源文件(仅保留PDF)
- 最终输出:
project-guides/DEVELOPER-GUIDE.pdf
Execution Checklist
执行检查清单
markdown
- [ ] Phase 1: Gather Project Information
- [ ] Phase 2: Analyze Project Architecture
- [ ] Phase 3: Document Design System
- [ ] Phase 4: Document Blocks, Models, and Templates
- [ ] Phase 5: Generate Professional PDFmarkdown
- [ ] 阶段1:收集项目信息
- [ ] 阶段2:分析项目架构
- [ ] 阶段3:文档化设计系统
- [ ] 阶段4:文档化区块、模型与模板
- [ ] 阶段5:生成专业PDFPhase 0: Get Organization Name (Required First)
阶段0:获取组织名称(必须优先执行)
Whenever this skill runs — whether the user triggered it directly (e.g. "generate developer guide") or via the handover flow — you must have the Config Service organization name before doing anything else. Do not skip this phase.
无论本技能是由用户直接触发(例如“生成开发者指南”)还是通过交接流程触发,在执行任何操作之前必须先获取Config Service组织名称。请勿跳过此阶段。
0.1 Check for Saved Organization
0.1 检查已保存的组织名称
bash
undefinedbash
undefinedCheck if org name is already saved
检查是否已保存组织名称
cat .claude-plugin/project-config.json 2>/dev/null | grep -o '"org"[[:space:]]:[[:space:]]"[^"]*"' | head -1
undefinedcat .claude-plugin/project-config.json 2>/dev/null | grep -o '"org"[[:space:]]:[[:space:]]"[^"]*"' | head -1
undefined0.2 Prompt for Organization Name (If Not Saved)
0.2 若未保存组织名称,提示用户提供
If no org name is saved, you MUST pause and ask the user directly:
"What is your Config Service organization name? This is thepart of your Edge Delivery Services URLs (e.g.,{org}). The org name may differ from your GitHub organization."https://main--site--{org}.aem.page
IMPORTANT RULES:
- DO NOT use with predefined options — ask as a plain text question
AskUserQuestion - Organization name is MANDATORY — do not offer a "skip" option
- Wait for user to type the org name before proceeding
- If user doesn't provide a valid org name, ask again
若未保存组织名称,必须暂停操作并直接询问用户:
"你的Config Service组织名称是什么?这是Edge Delivery Services URL中的部分(例如{org})。组织名称可能与GitHub组织名称不同。"https://main--site--{org}.aem.page
重要规则:
- 请勿使用带有预定义选项的——以纯文本形式提问
AskUserQuestion - 组织名称为必填项——不提供“跳过”选项
- 等待用户输入组织名称后再继续
- 若用户未提供有效组织名称,请再次询问
0.3 Save Organization Name
0.3 保存组织名称
Once you have the org name (either from saved config or user input), save it for future use:
bash
undefined获取组织名称后(无论是从已保存的配置还是用户输入),将其保存以备后续使用:
bash
undefinedCreate config directory if needed
若需要则创建配置目录
mkdir -p .claude-plugin
mkdir -p .claude-plugin
Ensure .claude-plugin is in .gitignore (contains auth tokens)
确保.claude-plugin已加入.gitignore(包含身份验证令牌)
grep -qxF '.claude-plugin/' .gitignore 2>/dev/null || echo '.claude-plugin/' >> .gitignore
grep -qxF '.claude-plugin/' .gitignore 2>/dev/null || echo '.claude-plugin/' >> .gitignore
Save org name to config file (create or update)
将组织名称保存至配置文件(创建或更新)
if [ -f .claude-plugin/project-config.json ]; then
cat .claude-plugin/project-config.json | sed 's/"org"[[:space:]]:[[:space:]]"[^"]*"/"org": "{ORG_NAME}"/' > /tmp/project-config.json && mv /tmp/project-config.json .claude-plugin/project-config.json
else
echo '{"org": "{ORG_NAME}"}' > .claude-plugin/project-config.json
fi
Replace `{ORG_NAME}` with the actual organization name provided by the user.
---if [ -f .claude-plugin/project-config.json ]; then
cat .claude-plugin/project-config.json | sed 's/"org"[[:space:]]:[[:space:]]"[^"]*"/"org": "{ORG_NAME}"/' > /tmp/project-config.json && mv /tmp/project-config.json .claude-plugin/project-config.json
else
echo '{"org": "{ORG_NAME}"}' > .claude-plugin/project-config.json
fi
将`{ORG_NAME}`替换为用户提供的实际组织名称。
---Phase 1: Gather Project Information
阶段1:收集项目信息
1.1 Get Project URLs and Repository
1.1 获取项目URL与仓库信息
bash
undefinedbash
undefinedGet repository info
获取仓库信息
git remote -v | head -1
git remote -v | head -1
Get branch info
获取分支信息
git branch -a | head -10
**Extract:**
- Repository owner and name
- Main branch namegit branch -a | head -10
**提取信息:**
- 仓库所有者与名称
- 主分支名称1.2 Check Configuration Method
1.2 检查配置方式
bash
undefinedbash
undefinedCheck for helix-config (very old projects)
检查是否使用helix-config(非常老旧的项目)
ls helix-config.yaml 2>/dev/null && echo "Uses legacy helix-config" || echo "Uses Config Service (modern)"
**Document:** Project configuration method (Config Service for modern projects).ls helix-config.yaml 2>/dev/null && echo "使用旧版helix-config" || echo "使用Config Service(现代版)"
**文档记录:** 项目配置方式(现代项目使用Config Service)。1.3 Fetch Sites via Config Service API
1.3 通过Config Service API获取站点信息
⚠️ MANDATORY DATA SOURCE — NO ALTERNATIVES ALLOWED
You MUST call the Config Service API. This is the ONLY acceptable source for site information.
❌ PROHIBITED APPROACHES (will produce incorrect results):
- Analyzing — does NOT show all sites in repoless setups
fstab.yaml - Reading — may be outdated or incomplete
README.md - Inferring from codebase structure — misses CDN configs and additional sites
- Using git remote URLs — org name may differ from Config Service org
- Making assumptions based on project folder names
✅ REQUIRED: Execute and save response:
bash
ORG=$(cat .claude-plugin/project-config.json | grep -o '"org"[[:space:]]*:[[:space:]]*"[^"]*"' | sed 's/"org"[[:space:]]*:[[:space:]]*"//' | sed 's/"$//')⚠️ 必须使用此数据源——无替代方案
必须调用Config Service API。这是获取站点信息的唯一可接受来源。
❌ 禁止的方法(会导致错误结果):
- 分析——在无仓库设置中无法展示所有站点
fstab.yaml - 读取——可能过时或不完整
README.md - 从代码库结构推断——会遗漏CDN配置与额外站点
- 使用Git远程URL——组织名称可能与Config Service组织名称不同
- 根据项目文件夹名称做出假设
✅ 要求:执行并保存响应:
bash
ORG=$(cat .claude-plugin/project-config.json | grep -o '"org"[[:space:]]*:[[:space:]]*"[^"]*"' | sed 's/"org"[[:space:]]*:[[:space:]]*"//' | sed 's/"$//')Save response to file - Phase 2 depends on this file
将响应保存至文件 - 阶段2依赖此文件
curl -s -H "Accept: application/json" "https://admin.hlx.page/config/${ORG}/sites.json" > .claude-plugin/sites-config.json
**📁 REQUIRED ARTIFACT:** `.claude-plugin/sites-config.json`
**API Reference:** https://www.aem.live/docs/admin.html#tag/siteConfig/operation/getConfigSites
---
The response is a JSON object with a `sites` array (each entry has a `name` field). Extract site names and construct per-site URLs:
- **Preview:** `https://main--{site-name}--{org}.aem.page/`
- **Live:** `https://main--{site-name}--{org}.aem.live/`
Multiple sites = **repoless** setup. Single site = **standard** setup.
**Then fetch individual site config for code and content details:**
```bash
AUTH_TOKEN=$(cat .claude-plugin/project-config.json | grep -o '"authToken"[[:space:]]*:[[:space:]]*"[^"]*"' | sed 's/"authToken"[[:space:]]*:[[:space:]]*"//' | sed 's/"$//')
curl -s -H "x-auth-token: ${AUTH_TOKEN}" "https://admin.hlx.page/config/${ORG}/sites/{site-name}.json"Example response:
json
{
"code": {
"owner": "github-owner",
"repo": "repo-name",
"source": { "type": "github", "url": "https://github.com/owner/repo" }
},
"content": {
"source": {
"url": "https://content.da.live/org-name/site-name/",
"type": "markup"
}
}
}Extract from response:
- /
code.owner— GitHub repositorycode.repo - — Content mountpath (e.g.,
content.source.url)https://content.da.live/org/site/ - — Content source type (markup, onedrive, google)
content.source.type
⚠️ Do NOT use — use Config Service API instead.
fstab.yamlRecord the result (repoless or standard) — it is used in the Local Development Setup section to decide whether to include the flag for .
--pages-urlaem upcurl -s -H "Accept: application/json" "https://admin.hlx.page/config/${ORG}/sites.json" > .claude-plugin/sites-config.json
**📁 要求的工件:** `.claude-plugin/sites-config.json`
**API参考:** https://www.aem.live/docs/admin.html#tag/siteConfig/operation/getConfigSites
---
响应为包含`sites`数组的JSON对象(每个条目包含`name`字段)。提取站点名称并构建每个站点的URL:
- **预览环境:** `https://main--{site-name}--{org}.aem.page/`
- **生产环境:** `https://main--{site-name}--{org}.aem.live/`
多个站点 = **无仓库**设置。单个站点 = **标准**设置。
**然后获取单个站点配置以获取代码与内容详情:**
```bash
AUTH_TOKEN=$(cat .claude-plugin/project-config.json | grep -o '"authToken"[[:space:]]*:[[:space:]]*"[^"]*"' | sed 's/"authToken"[[:space:]]*:[[:space:]]*"//' | sed 's/"$//')
curl -s -H "x-auth-token: ${AUTH_TOKEN}" "https://admin.hlx.page/config/${ORG}/sites/{site-name}.json"示例响应:
json
{
"code": {
"owner": "github-owner",
"repo": "repo-name",
"source": { "type": "github", "url": "https://github.com/owner/repo" }
},
"content": {
"source": {
"url": "https://content.da.live/org-name/site-name/",
"type": "markup"
}
}
}从响应中提取:
- /
code.owner— GitHub仓库code.repo - — 内容挂载路径(例如
content.source.url)https://content.da.live/org/site/ - — 内容源类型(markup、onedrive、google)
content.source.type
⚠️ 请勿使用——请使用Config Service API替代。
fstab.yaml记录结果(无仓库或标准设置)——在本地开发设置部分中,该结果将用于决定是否为命令添加标记。
aem up--pages-url1.4 Check Node.js Requirements
1.4 检查Node.js要求
bash
undefinedbash
undefinedCheck for Node version requirements
检查Node版本要求
cat .nvmrc 2>/dev/null || cat package.json | grep -A2 '"engines"'
---cat .nvmrc 2>/dev/null || cat package.json | grep -A2 '"engines"'
---Phase 2: Analyze Project Architecture
阶段2:分析项目架构
Read site config from Phase 1:
bash
cat .claude-plugin/sites-config.json读取阶段1中的站点配置:
bash
cat .claude-plugin/sites-config.json2.1 Map Project Structure
2.1 映射项目结构
bash
undefinedbash
undefinedList top-level structure
列出顶层结构
ls -la
ls -la
List blocks
列出区块
ls -la blocks/
ls -la blocks/
List scripts
列出脚本
ls -la scripts/
ls -la scripts/
List styles
列出样式
ls -la styles/
ls -la styles/
Check for templates
检查是否存在模板
ls -la templates/ 2>/dev/null || echo "No templates folder"
undefinedls -la templates/ 2>/dev/null || echo "无templates文件夹"
undefined2.2 Identify Boilerplate vs Custom Files
2.2 区分样板文件与自定义文件
CRITICAL: Only document files that were actually customized.
bash
undefined重要提示:仅记录实际被自定义的文件。
bash
undefinedCheck commit history for a file (skip if only "Initial commit")
检查文件的提交历史(若仅包含"Initial commit"则跳过)
git log --oneline --follow {file_path} | head -5
git log --oneline --follow {file_path} | head -5
Check who modified a file (skip aem-aemy[bot] only files)
检查谁修改了文件(仅包含aem-aemy[bot]提交的文件则跳过)
git log --format="%an - %s" --follow {file_path} | head -5
**Rules for filtering:**
| Git History | Action |
|-------------|--------|
| Only "Initial commit" | Skip - boilerplate default, never worked on |
| Only `aem-aemy[bot]` commits | Skip - auto-generated |
| Multiple commits by team | Document - customized |
| Commits with feature descriptions | Document - customized |
**IMPORTANT:** Files with only an "initial commit" are boilerplate defaults that were never modified. Do not document these - they add no value to the developer guide.git log --format="%an - %s" --follow {file_path} | head -5
**过滤规则:**
| Git历史 | 操作 |
|-------------|--------|
| 仅包含"Initial commit" | 跳过——默认样板文件,从未被修改 |
| 仅包含`aem-aemy[bot]`提交 | 跳过——自动生成 |
| 团队多次提交 | 记录——已自定义 |
| 包含功能描述的提交 | 记录——已自定义 |
**注意事项:** 仅包含“初始提交”的文件是从未被修改的默认样板文件。请勿记录这些文件——它们对开发者指南毫无价值。2.3 Analyze scripts/aem.js (Core Library)
2.3 分析scripts/aem.js(核心库)
bash
undefinedbash
undefinedList what aem.js exports (DO NOT MODIFY this file)
列出aem.js导出的内容(请勿修改此文件)
grep -E "^export" scripts/aem.js
**Document which functions the project imports from `aem.js`** (e.g., `sampleRUM`, `loadHeader`, `loadFooter`, `decorateBlock`, `loadBlock`, `loadCSS`). This helps developers understand which core utilities are available.grep -E "^export" scripts/aem.js
**记录项目从`aem.js`中导入的函数**(例如`sampleRUM`、`loadHeader`、`loadFooter`、`decorateBlock`、`loadBlock`、`loadCSS`)。这有助于开发者了解可用的核心工具。2.4 Analyze scripts/scripts.js (Eager + Lazy Phases)
2.4 分析scripts/scripts.js(即时+延迟阶段)
bash
undefinedbash
undefinedExtract imports and key function signatures
提取导入语句与关键函数签名
grep -E "^import|^export|^function|^async function|buildAutoBlocks|loadTemplate|getLanguage|getSiteRoot|decorateMain|loadEager|loadLazy|loadDelayed" scripts/scripts.js
**Document these customizations:**
| Pattern to Look For | What to Document |
|---------------------|------------------|
| `import` statements | What it imports from `aem.js` and `utils.js` |
| `loadEager` / `loadLazy` functions | Any custom logic added to E-L-D phases |
| `buildAutoBlocks` function | Auto-blocking logic |
| `loadTemplate` or template handling | Template system |
| `getLanguage` or language detection | Multi-language setup |
| `getSiteRoot` or site detection | Multi-site configuration (see also Phase 1.3) |
| Custom `decorateMain` additions | Page decoration extensions |
| External script loading | Which phase loads it — flag if loaded in eager (performance risk) |
**E-L-D check:** Note any third-party scripts or heavy logic added to `loadEager` or `loadLazy` that could impact LCP. These should typically be in `delayed.js`.grep -E "^import|^export|^function|^async function|buildAutoBlocks|loadTemplate|getLanguage|getSiteRoot|decorateMain|loadEager|loadLazy|loadDelayed" scripts/scripts.js
**记录这些自定义内容:**
| 查找模式 | 记录内容 |
|---------------------|------------------|
| `import`语句 | 从`aem.js`与`utils.js`导入的内容 |
| `loadEager` / `loadLazy`函数 | 添加到E-L-D阶段的任何自定义逻辑 |
| `buildAutoBlocks`函数 | 自动区块化逻辑 |
| `loadTemplate`或模板处理逻辑 | 模板系统 |
| `getLanguage`或语言检测逻辑 | 多语言设置 |
| `getSiteRoot`或站点检测逻辑 | 多站点配置(另见阶段1.3) |
| 自定义`decorateMain`扩展 | 页面装饰扩展 |
| 外部脚本加载 | 哪个阶段加载——若在即时阶段加载则标记(存在性能风险) |
**E-L-D检查:** 注意添加到`loadEager`或`loadLazy`中的任何第三方脚本或重型逻辑,这些可能会影响LCP。此类内容通常应放在`delayed.js`中。2.5 Analyze scripts/delayed.js (Delayed Phase)
2.5 分析scripts/delayed.js(延迟阶段)
bash
undefinedbash
undefinedExtract imports and function calls to identify integrations
提取导入语句与函数调用以识别集成
grep -E "^import|function|google|analytics|gtag|alloy|martech|OneTrust|launch|chatbot|widget" scripts/delayed.js
**Document:**
- Analytics integrations (Google Analytics, Adobe Analytics, etc.)
- Marketing tools (OneTrust, chat widgets, etc.)
- Performance monitoring
- Any custom delayed features
- Confirm no render-critical code is in this file (it loads ~3s after page load)grep -E "^import|function|google|analytics|gtag|alloy|martech|OneTrust|launch|chatbot|widget" scripts/delayed.js
**记录:**
- 分析集成(Google Analytics、Adobe Analytics等)
- 营销工具(OneTrust、聊天小部件等)
- 性能监控
- 任何自定义延迟功能
- 确认此文件中无渲染关键代码(页面加载约3秒后加载)2.6 Check for Utility Functions
2.6 检查实用工具函数
bash
undefinedbash
undefinedExtract exported functions from utils
提取utils中导出的函数
grep -E "^export|^function" scripts/utils.js 2>/dev/null || echo "No utils.js"
grep -E "^export|^function" scripts/utils.js 2>/dev/null || echo "无utils.js"
List all script files
列出所有脚本文件
ls scripts/*.js
ls scripts/*.js
Check which blocks/scripts import from utils
检查哪些区块/脚本导入了utils
grep -rl "utils.js" blocks/ scripts/ 2>/dev/null
**Document:** Shared utility functions, their purposes, and which blocks/scripts import them.grep -rl "utils.js" blocks/ scripts/ 2>/dev/null
**记录:** 共享实用工具函数、其用途以及哪些区块/脚本导入了它们。2.7 Check for External Dependencies
2.7 检查外部依赖
bash
undefinedbash
undefinedCheck package.json for dependencies
检查package.json中的依赖
grep -A 20 '"dependencies"' package.json 2>/dev/null | head -25
grep -A 20 '"dependencies"' package.json 2>/dev/null | head -25
Check for CDN imports in code
检查代码中的CDN导入
grep -r "cdn|unpkg|jsdelivr" scripts/ blocks/ --include="*.js" 2>/dev/null
---grep -r "cdn|unpkg|jsdelivr" scripts/ blocks/ --include="*.js" 2>/dev/null
---Phase 3: Document Design System
阶段3:文档化设计系统
4.1 Extract CSS Custom Properties
4.1 提取CSS自定义属性
bash
undefinedbash
undefinedGet all CSS variables from styles.css
从styles.css中获取所有CSS变量
grep -E "^\s*--" styles/styles.css
**Organize into categories:**
| Category | Example Properties |
|----------|-------------------|
| Typography | `--body-font-family`, `--heading-font-family`, `--font-size-*` |
| Colors | `--primary-color`, `--background-color`, `--text-color` |
| Spacing | `--spacing-*`, `--nav-height`, `--section-padding` |
| Layout | `--content-width`, `--grid-gap` |grep -E "^\s*--" styles/styles.css
**按类别整理:**
| 类别 | 示例属性 |
|----------|-------------------|
| 排版 | `--body-font-family`, `--heading-font-family`, `--font-size-*` |
| 颜色 | `--primary-color`, `--background-color`, `--text-color` |
| 间距 | `--spacing-*`, `--nav-height`, `--section-padding` |
| 布局 | `--content-width`, `--grid-gap` |4.2 Document Font Setup
4.2 文档化字体设置
bash
undefinedbash
undefinedExtract font-face declarations (font names, weights, formats)
提取@font-face声明(字体名称、字重、格式)
grep -E "@font-face|font-family|font-weight|src:" styles/fonts.css 2>/dev/null
grep -E "@font-face|font-family|font-weight|src:" styles/fonts.css 2>/dev/null
Check fonts directory
检查fonts目录
ls fonts/ 2>/dev/null
**Document:**
- Font files and formats
- Font family names
- Font weights available
- Fallback fontsls fonts/ 2>/dev/null
**记录:**
- 字体文件与格式
- 字体家族名称
- 可用字体字重
- 后备字体4.3 Document Breakpoints
4.3 文档化断点
bash
undefinedbash
undefinedFind media query breakpoints
查找媒体查询断点
grep -E "@media.*min-width|@media.*max-width" styles/styles.css | sort -u
**Standard EDS breakpoints:**
- Mobile: < 600px
- Tablet: 600px - 899px
- Desktop: 900px+
- Large: 1200px+
Document any deviations from standard.grep -E "@media.*min-width|@media.*max-width" styles/styles.css | sort -u
**标准EDS断点:**
- 移动端:< 600px
- 平板端:600px - 899px
- 桌面端:900px+
- 大屏端:1200px+
记录任何与标准断点的差异。4.4 Document Section Styles
4.4 文档化区块样式
bash
undefinedbash
undefinedFind section-related styles
查找区块相关样式
grep -A 5 ".section." styles/styles.css
grep -A 5 ".section[" styles/styles.css
**Document available section styles** (dark, highlight, narrow, etc.)
---grep -A 5 ".section." styles/styles.css
grep -A 5 ".section[" styles/styles.css
**记录可用的区块样式**(深色、高亮、窄版等)
---Phase 4: Document Blocks, Models, and Templates
阶段4:文档化区块、模型与模板
Boilerplate Filtering (applies to blocks, models, and templates)
样板文件过滤(适用于区块、模型与模板)
Run all filtering silently — do not show output to the user.
- Include: Items with 2+ commits AND at least one commit after "initial commit"
- Exclude: Items with only 1 commit that is "Initial commit" or similar boilerplate setup
- Exclude: Items with only commits (auto-generated)
aem-aemy[bot] - Items that only have an "initial commit" were never customized — do NOT document them.
静默执行所有过滤操作——请勿向用户显示输出。
- 包含: 拥有2次及以上提交,且至少有一次提交在“初始提交”之后的项目
- 排除: 仅包含1次“初始提交”或类似样板设置提交的项目
- 排除: 仅包含提交的项目(自动生成)
aem-aemy[bot] - 仅包含“初始提交”的项目从未被自定义——请勿记录。
4.1 Identify and Analyze Customized Blocks
4.1 识别并分析自定义区块
For each block that passed the filter, run:
bash
undefined对于每个通过过滤的区块,运行:
bash
undefinedGet block purpose from JS comments/structure
从JS注释/结构中获取区块用途
head -30 blocks/{blockname}/{blockname}.js
head -30 blocks/{blockname}/{blockname}.js
Get block variants from CSS
从CSS中获取区块变体
grep -E "^." blocks/{blockname}/{blockname}.css | head -30
grep -E "^." blocks/{blockname}/{blockname}.css | head -30
Check for variant handling
检查变体处理逻辑
grep -E "classList.contains|classList.add" blocks/{blockname}/{blockname}.js
**Document for each customized block:**
| Field | What to Record |
|-------|----------------|
| Name | Block folder name |
| Purpose | What it does (from code analysis) |
| DOM Input | Expected HTML structure from CMS |
| DOM Output | Transformed structure after decoration |
| Variants | CSS classes that modify behavior |
| Dependencies | External libraries, other blocks, utils |
| Key Functions | Important internal functions |grep -E "classList.contains|classList.add" blocks/{blockname}/{blockname}.js
**为每个自定义区块记录:**
| 字段 | 记录内容 |
|-------|----------------|
| 名称 | 区块文件夹名称 |
| 用途 | 功能(从代码分析得出) |
| DOM输入 | CMS预期的HTML结构 |
| DOM输出 | 装饰后的转换结构 |
| 变体 | 修改行为的CSS类 |
| 依赖 | 外部库、其他区块、工具函数 |
| 关键函数 | 重要内部函数 |4.2 Document Block Dependencies
4.2 文档化区块依赖
bash
grep "^import" blocks/{blockname}/{blockname}.jsbash
grep "^import" blocks/{blockname}/{blockname}.js4.3 Document Universal Editor Models (If Customized)
4.3 文档化Universal Editor模型(若已自定义)
Apply the same boilerplate filtering to . Also exclude standard boilerplate models (, , , , , ) if unchanged. If all models are boilerplate, skip this section in the output.
models/*.json_page.json_section.json_button.json_image.json_text.json_title.json对应用相同的样板文件过滤。若未修改,还需排除标准样板模型(、、、、、)。若所有模型均为样板文件,则在输出中跳过此部分。
models/*.json_page.json_section.json_button.json_image.json_text.json_title.json4.4 Document Customized Templates
4.4 文档化自定义模板
Apply the same boilerplate filtering to . For each customized template, document its purpose, how it's applied ( in metadata), and what it changes.
templates/*/template: name对应用相同的样板文件过滤。为每个自定义模板记录其用途、应用方式(元数据中的)以及修改内容。
templates/*/template: namePhase 5: Generate Developer Guide
阶段5:生成开发者指南
Output File: project-guides/DEVELOPER-GUIDE.md
project-guides/DEVELOPER-GUIDE.md输出文件:project-guides/DEVELOPER-GUIDE.md
project-guides/DEVELOPER-GUIDE.mdGenerate a markdown document with the following structure:
markdown
undefined生成具有以下结构的Markdown文档:
markdown
undefined[Project Name] - Developer Guide
[项目名称] - 开发者指南
Quick Reference
快速参考
| Resource | URL |
|---|---|
| Code Repository | {code.owner}/{code.repo} (from Config Service — may be GitHub or Cloud Manager) |
| Preview | https://main--{repo}--{owner}.aem.page/ |
| Live | https://main--{repo}--{owner}.aem.live/ |
| Local Dev | http://localhost:3000 |
| 资源 | URL |
|---|---|
| 代码仓库 | {code.owner}/{code.repo}(来自Config Service — 可能是GitHub或Cloud Manager) |
| 预览环境 | https://main--{repo}--{owner}.aem.page/ |
| 生产环境 | https://main--{repo}--{owner}.aem.live/ |
| 本地开发 | http://localhost:3000 |
Architecture Overview
架构概述
Tech Stack
技术栈
- Vanilla JavaScript (ES6+)
- CSS3 with Custom Properties
- No build step - files served directly
- Content from Document Authoring (DA)
- Vanilla JavaScript (ES6+)
- CSS3 自定义属性
- 无构建步骤 - 文件直接提供
- 内容来自Document Authoring (DA)
Project Structure
项目结构
├── blocks/ # [X] blocks implemented
├── templates/ # [Y] templates (or N/A)
├── scripts/
│ ├── aem.js # Core library (DO NOT MODIFY)
│ ├── scripts.js # Custom page decoration
│ ├── delayed.js # Analytics, marketing tools
│ └── utils.js # Shared utilities
├── styles/
│ ├── styles.css # Critical styles + design tokens
│ ├── fonts.css # Font definitions
│ └── lazy-styles.css # Non-critical styles
└── icons/ # SVG icons├── blocks/ # [X] 已实现的区块
├── templates/ # [Y] 模板(或无)
├── scripts/
│ ├── aem.js # 核心库(请勿修改)
│ ├── scripts.js # 自定义页面装饰
│ ├── delayed.js # 分析、营销工具
│ └── utils.js # 共享工具函数
├── styles/
│ ├── styles.css # 关键样式 + 设计标记
│ ├── fonts.css # 字体定义
│ └── lazy-styles.css # 非关键样式
└── icons/ # SVG图标Three-Phase Loading (E-L-D)
三阶段加载(E-L-D)
Edge Delivery Services uses a strict Eager-Lazy-Delayed loading strategy to achieve a Lighthouse score of 100. Every file and script must be placed in the correct phase.
| Phase | Purpose | What Loads | Performance Impact |
|---|---|---|---|
| Eager | Render above-the-fold content as fast as possible (LCP) | | Blocks LCP — keep minimal |
| Lazy | Load remaining page content after first paint | Remaining blocks, header, footer, | Runs after Eager completes — safe for non-critical UI |
| Delayed | Load non-essential third-party scripts | | Runs ~3s after page load — never blocks rendering |
Rules for developers:
- Never add third-party scripts to — they block LCP. Always use
scripts.js.delayed.js - Never load fonts eagerly — is loaded lazily to avoid render-blocking.
fonts.css - Blocks in the first section load eagerly; all others load lazily. This is automatic based on DOM position.
- The header and footer are loaded in the lazy phase via /
loadHeader()fromloadFooter().aem.js
Edge Delivery Services采用严格的即时-延迟-延后加载策略,以实现Lighthouse评分100。每个文件与脚本必须放置在正确的阶段。
| 阶段 | 用途 | 加载内容 | 性能影响 |
|---|---|---|---|
| 即时(Eager) | 尽快渲染首屏内容(LCP) | | 阻塞LCP — 保持内容最少 |
| 延迟(Lazy) | 首次绘制后加载剩余页面内容 | 剩余区块、页眉、页脚、 | 在即时阶段完成后运行 — 对非关键UI安全 |
| 延后(Delayed) | 加载非必要第三方脚本 | | 页面加载约3秒后运行 — 从不阻塞渲染 |
开发者规则:
- 切勿将第三方脚本添加至——会阻塞LCP。始终使用
scripts.js。delayed.js - 切勿即时加载字体——延迟加载以避免阻塞渲染。
fonts.css - 第一个区块即时加载;所有其他区块延迟加载。这基于DOM位置自动实现。
- 页眉与页脚通过中的
aem.js/loadHeader()在延迟阶段加载。loadFooter()
Key Files & How They Connect
关键文件及其关联关系
| File | Role | Connects To |
|---|---|---|
| Core library — | Imported by |
| Entry point — orchestrates E-L-D phases ( | Imports from |
| Loaded last via | Called by |
| Shared helpers used across blocks and scripts. | Imported by blocks and |
| Critical CSS + design tokens (CSS custom properties). Loaded eagerly. | Referenced by all blocks and pages |
| Font | Font families referenced in |
| Non-critical global styles. Loaded lazily. | Supplements |
| Block logic — exports | May import from |
| Block styles — auto-loaded alongside block JS. | May use CSS custom properties from |
| Template logic — loaded when page metadata has matching | Called by |
Execution flow: page load → → (first section + eager blocks) → (remaining blocks, header, footer, , ) → (loads )
scripts.jsloadEager()loadLazy()fonts.csslazy-styles.cssloadDelayed()delayed.js| 文件 | 角色 | 关联对象 |
|---|---|---|
| 核心库 — | 被 |
| 入口点 — 编排E-L-D阶段( | 从 |
| 通过 | 在延后阶段由 |
| 区块与脚本共享的辅助函数。 | 被区块与 |
| 关键CSS + 设计标记(CSS自定义属性)。即时加载。 | 被所有区块与页面引用 |
| 字体 | 字体家族在 |
| 非关键全局样式。延迟加载。 | 补充 |
| 区块逻辑 — 导出 | 可能从 |
| 区块样式 — 与区块JS一同自动加载。 | 可能使用 |
| 模板逻辑 — 当页面元数据包含匹配的 | 通过 |
执行流程: 页面加载 → → (首屏区块 + 即时区块) → (剩余区块、页眉、页脚、、) → (加载)
scripts.jsloadEager()loadLazy()fonts.csslazy-styles.cssloadDelayed()delayed.jsLocal Development Setup
本地开发设置
Prerequisites
前置条件
- Node.js [version from .nvmrc]
- AEM CLI:
npm install -g @adobe/aem-cli
- Node.js [.nvmrc中指定的版本]
- AEM CLI:
npm install -g @adobe/aem-cli
Setup Steps
设置步骤
bash
undefinedbash
undefinedClone repository (use the code repo URL from Config Service)
克隆仓库(使用Config Service提供的代码仓库URL)
git clone {code-repo-url}
cd {repo}
git clone {code-repo-url}
cd {repo}
Install dependencies
安装依赖
npm install
npm install
Start local server
启动本地服务器
aem up
undefinedaem up
undefinedLocal Server
本地服务器
- URL: http://localhost:3000
- Auto-reload on file changes
- Uses preview content by default
If repoless/multi-site was detected in Phase 1.3, also include this subsection in the output:
Local Server — Repoless/Multi-Site
For repoless setups with multiple sites sharing one repository, you must specify the site's preview URL when starting the local server:bashaem up --pages-url=https://main--{site}--{org}.aem.pageReplaceand{site}with the actual site and organization names from the Config Service.{org}Without, the AEM CLI cannot resolve content for the correct site and local preview will fail or show wrong content.--pages-url
If the project is a standard single-site setup, omit the repoless subsection entirely — it would only confuse developers.
- URL: http://localhost:3000
- 文件更改时自动重载
- 默认使用预览内容
若在阶段1.3中检测到无仓库/多站点设置,请在输出中添加以下小节:
本地服务器 — 无仓库/多站点
对于多个站点共享一个仓库的无仓库设置,启动本地服务器时必须指定站点的预览URL:bashaem up --pages-url=https://main--{site}--{org}.aem.page将与{site}替换为Config Service中的实际站点与组织名称。{org}若不添加,AEM CLI无法解析正确站点的内容,本地预览将失败或显示错误内容。--pages-url
若项目为标准单站点设置,请完全省略无仓库小节——这只会让开发者困惑。
Linting
代码检查
bash
npm run lintbash
npm run lintDesign System
设计系统
CSS Custom Properties
CSS自定义属性
Typography
排版
css
--body-font-family: [value];
--heading-font-family: [value];css
--body-font-family: [值];
--heading-font-family: [值];Colors
颜色
css
--primary-color: [value];
--secondary-color: [value];
--background-color: [value];
--text-color: [value];css
--primary-color: [值];
--secondary-color: [值];
--background-color: [值];
--text-color: [值];Spacing
间距
css
--spacing-s: [value];
--spacing-m: [value];
--spacing-l: [value];
--nav-height: [value];css
--spacing-s: [值];
--spacing-m: [值];
--spacing-l: [值];
--nav-height: [值];Breakpoints
断点
| Name | Min-Width | Usage |
|---|---|---|
| Mobile | 0 | Default styles |
| Tablet | 600px | |
| Desktop | 900px | |
| Large | 1200px | |
| 名称 | 最小宽度 | 用途 |
|---|---|---|
| 移动端 | 0 | 默认样式 |
| 平板端 | 600px | |
| 桌面端 | 900px | |
| 大屏端 | 1200px | |
Fonts
字体
| Family | Weights | Usage |
|---|---|---|
| [Font Name] | [weights] | [body/headings] |
| 家族 | 字重 | 用途 |
|---|---|---|
| [字体名称] | [字重] | [正文/标题] |
Blocks Reference
区块参考
| Block | Purpose | Variants | Key Features |
|---|---|---|---|
| [block-name] | [What it does] | | [Important details, gotchas] |
[Generate one row per customized block]
| 区块 | 用途 | 变体 | 关键特性 |
|---|---|---|---|
| [区块名称] | [功能] | | [重要细节、注意事项] |
[为每个自定义区块生成一行]
Templates
模板
| Template | Purpose | Applied Via | Special Behavior |
|---|---|---|---|
| [template-name] | [What type of pages] | | [What it does differently] |
[Generate one row per customized template. Skip templates with only "initial commit".]
| 模板 | 用途 | 应用方式 | 特殊行为 |
|---|---|---|---|
| [模板名称] | [适用页面类型] | | [差异功能] |
[为每个自定义模板生成一行。仅包含“初始提交”的模板请跳过。]
Common Development Tasks
常见开发任务
Add a New Block
添加新区块
- Create
blocks/{name}/{name}.js - Create
blocks/{name}/{name}.css - Implement
export default function decorate(block) - Test locally at http://localhost:3000
- Push to feature branch
- 创建
blocks/{name}/{name}.js - 创建
blocks/{name}/{name}.css - 实现
export default function decorate(block) - 在http://localhost:3000本地测试
- 推送至功能分支
Modify Global Styles
修改全局样式
- Edit
styles/styles.css - Use CSS custom properties
- Test across multiple pages
- Watch for CLS impact
- 编辑
styles/styles.css - 使用CSS自定义属性
- 在多个页面测试
- 关注CLS影响
Add Analytics/Marketing Tool
添加分析/营销工具
- Add to
scripts/delayed.js - Never add to (blocks performance)
scripts.js - Test with Network tab to verify delayed loading
- 添加至
scripts/delayed.js - 切勿添加至(影响性能)
scripts.js - 使用网络标签测试以验证延迟加载
Debug a Block
调试区块
- Check browser console for errors
- Inspect DOM: expected structure vs actual
- Check if variant classes are applied
- Verify CSS specificity
- 检查浏览器控制台是否有错误
- 检查DOM:预期结构与实际结构对比
- 检查变体类是否已应用
- 验证CSS优先级
Environments
环境
| Environment | URL Pattern | Purpose |
|---|---|---|
| Local | http://localhost:3000 | Development |
| Feature Branch | https://{branch}--{repo}--{owner}.aem.page | PR testing |
| Preview | https://main--{repo}--{owner}.aem.page | Staging |
| Live | https://main--{repo}--{owner}.aem.live | Production |
| 环境 | URL模式 | 用途 |
|---|---|---|
| 本地 | http://localhost:3000 | 开发 |
| 功能分支 | https://{branch}--{repo}--{owner}.aem.page | PR测试 |
| 预览 | https://main--{repo}--{owner}.aem.page | 预发布 |
| 生产 | https://main--{repo}--{owner}.aem.live | 生产环境 |
Git Workflow
Git工作流
Branch Naming
分支命名
- Features:
feature/description - Fixes:
fix/description - Keep names short (URL length limits)
- 功能分支:
feature/描述 - 修复分支:
fix/描述 - 名称保持简短(URL长度限制)
PR Requirements
PR要求
- Include preview URL in PR description
- Pass linting
- Test on feature branch preview
- No console errors
- PR描述中包含预览URL
- 通过代码检查
- 在功能分支预览环境测试
- 无控制台错误
Troubleshooting
故障排除
Block not loading?
区块未加载?
- Check block folder name matches class name
- Verify JS exports
default function decorate - Check browser Network tab for 404s
- 检查区块文件夹名称与类名是否匹配
- 验证JS是否导出
default function decorate - 检查浏览器网络标签是否有404错误
Styles not applying?
样式未生效?
- Check CSS specificity
- Verify file is loading (Network tab)
- Check for CSS syntax errors
- 检查CSS优先级
- 验证文件是否已加载(网络标签)
- 检查CSS语法错误
Content not updating?
内容未更新?
- Clear browser cache
- Check preview was triggered in DA
- Wait for CDN cache (1-2 min)
- 清除浏览器缓存
- 检查DA中是否已触发预览
- 等待CDN缓存更新(1-2分钟)
Resources
资源
| Resource | URL |
|---|---|
| EDS Documentation | https://www.aem.live/docs/ |
| Developer Tutorial | https://www.aem.live/developer/tutorial |
| Block Collection | https://www.aem.live/developer/block-collection |
| E-L-D Loading | https://www.aem.live/developer/keeping-it-100 |
| Best Practices | https://www.aem.live/docs/dev-collab-and-good-practices |
Support Contacts
支持联系人
[Add project-specific contacts]
---[添加项目特定联系人]
---5.1 Convert to Professional PDF (MANDATORY)
5.1 转换为专业PDF(强制要求)
THIS STEP IS NOT OPTIONAL. YOU MUST GENERATE THE PDF NOW.
-
Save markdown to:
project-guides/DEVELOPER-GUIDE.md- File MUST start with YAML frontmatter:
yaml
--- title: "[Project Name] - Developer Guide" date: "[Full Date - e.g., February 17, 2026]" --- - Date format: Always use full date with day, month, and year (e.g., "February 17, 2026"), NOT just month and year
- File MUST start with YAML frontmatter:
-
IMMEDIATELY after saving the markdown, invoke the PDF conversion skill:
Skill({ skill: "project-management:whitepaper", args: "project-guides/DEVELOPER-GUIDE.md project-guides/DEVELOPER-GUIDE.pdf" }) -
Wait for PDF generation to complete (whitepaper skill auto-cleans source files)
DO NOT:
- Skip the PDF conversion step
- Tell user "PDF will be generated later" — generate it NOW
此步骤为必选项。必须立即生成PDF。
-
将Markdown保存至:
project-guides/DEVELOPER-GUIDE.md- 文件必须以YAML前置内容开头:
yaml
--- title: "[项目名称] - 开发者指南" date: "[完整日期 - 例如:2026年2月17日]" --- - 日期格式: 始终使用包含日、月、年的完整日期(例如“2026年2月17日”),请勿仅使用月和年
- 文件必须以YAML前置内容开头:
-
保存Markdown后立即调用PDF转换技能:
Skill({ skill: "project-management:whitepaper", args: "project-guides/DEVELOPER-GUIDE.md project-guides/DEVELOPER-GUIDE.pdf" }) -
等待PDF生成完成(whitepaper技能会自动清理源文件)
请勿:
- 跳过PDF转换步骤
- 告知用户“PDF将稍后生成”——立即生成
5.2 Deliver to User
5.2 交付给用户
After PDF is generated, inform the user:
"✓ Developer guide complete: project-guides/DEVELOPER-GUIDE.pdf"PDF生成完成后,告知用户:
"✓ 开发者指南已完成:project-guides/DEVELOPER-GUIDE.pdf"Output
输出
FINAL OUTPUT:
project-guides/DEVELOPER-GUIDE.pdfAll source files (.md, .html, .plain.html) are deleted after PDF generation. Only the PDF remains.
Location: folder
project-guides/最终输出:
project-guides/DEVELOPER-GUIDE.pdfPDF生成后,所有源文件(.md、.html、.plain.html)将被删除。仅保留PDF。
位置: 文件夹
project-guides/Success Criteria
成功标准
Data Source Validation (CRITICAL):
- Config Service API was called ()
https://admin.hlx.page/config/{ORG}/sites.json - Site list came from API response, NOT from fstab.yaml or codebase analysis
- Repoless/standard determination came from Config Service, NOT inferred from code
Content Validation:
- Quick Reference with all project URLs
- Architecture overview accurate to project
- Design system fully documented (tokens, fonts, breakpoints)
- Project-specific blocks documented
- Custom scripts.js functions documented
- delayed.js integrations documented
- Templates documented (if applicable)
- Local development setup verified
- Common tasks have clear instructions
- Troubleshooting section covers common issues
- Resources linked
Output Validation:
- PDF generated successfully
- All source files cleaned up (only PDF remains)
数据源验证(关键):
- 已调用Config Service API ()
https://admin.hlx.page/config/{ORG}/sites.json - 站点列表来自API响应,而非fstab.yaml或代码库分析
- 无仓库/标准设置的判定来自Config Service,而非从代码推断
内容验证:
- 包含所有项目URL的快速参考
- 架构概述与项目实际情况一致
- 设计系统已完整文档化(标记、字体、断点)
- 已记录项目特定区块
- 已记录自定义scripts.js函数
- 已记录delayed.js集成
- 已记录模板(若适用)
- 本地开发设置已验证
- 常见任务有清晰说明
- 故障排除部分涵盖常见问题
- 已链接资源
输出验证:
- PDF生成成功
- 所有源文件已清理(仅保留PDF)
Tips for Clear Documentation
清晰文档撰写技巧
- Focus on what's unique - Document project-specific implementations
- Use code examples - Show actual code from the project
- Document the "why" - Explain reasoning behind custom implementations
- Include gotchas - Note any tricky behavior or edge cases
- Test the setup instructions - Verify they work from scratch
- Keep it maintainable - Don't over-document things that change often
- 聚焦独特内容 - 记录项目特定实现
- 使用代码示例 - 展示项目中的实际代码
- 记录“原因” - 解释自定义实现的理由
- 包含注意事项 - 记录任何复杂行为或边缘情况
- 测试设置说明 - 验证从零基础开始是否可行
- 保持可维护性 - 不要过度记录经常变化的内容