development

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Project 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
allGuides
flag is set
(orchestrator already validated and navigated).
CRITICAL: If NOT skipped, you MUST execute the
cd
command. Do NOT use absolute paths — actually change directory.
bash
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
fi
IMPORTANT:
  • You MUST run the
    cd
    command above using the Bash tool
  • 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
scripts/aem.js
does NOT exist
, respond:
"This skill is designed for AEM Edge Delivery Services projects. The current directory does not appear to be an Edge Delivery Services project (
scripts/aem.js
not found).
Please navigate to an Edge Delivery Services project and try again."
STOP if check fails. Otherwise proceed — you are now at project root.

若已设置
allGuides
标记,则跳过此步骤
(编排工具已完成验证与导航)。
重要提示:若未跳过此步骤,必须执行
cd
命令。请勿使用绝对路径——实际切换目录。
bash
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.md
BEFORE WRITING ANY FILE:
  1. First, create the directory:
    mkdir -p project-guides
  2. Then write to:
    project-guides/DEVELOPER-GUIDE.md
WHY THIS MATTERS: Files must be in
project-guides/
for proper organization and PDF conversion.
WRONG:
DEVELOPER-GUIDE.md
(root) ❌ WRONG:
docs/DEVELOPER-GUIDE.md
WRONG:
/workspace/DEVELOPER-GUIDE.md
CORRECT:
project-guides/DEVELOPER-GUIDE.md

必须将文件保存至以下精确路径:
project-guides/DEVELOPER-GUIDE.md
在写入任何文件之前:
  1. 首先创建目录:
    mkdir -p project-guides
  2. 然后写入至:
    project-guides/DEVELOPER-GUIDE.md
为何如此重要: 文件必须存放在
project-guides/
目录下,以便进行合理组织与PDF转换。
错误路径:
DEVELOPER-GUIDE.md
(根目录) ❌ 错误路径:
docs/DEVELOPER-GUIDE.md
错误路径:
/workspace/DEVELOPER-GUIDE.md
正确路径:
project-guides/DEVELOPER-GUIDE.md

Output Format

输出格式

MANDATORY OUTPUT:
project-guides/DEVELOPER-GUIDE.pdf
STRICTLY FORBIDDEN:
  • ❌ Do NOT read or analyze
    fstab.yaml
    — it does NOT exist in most projects and does NOT show all sites
  • ❌ Do NOT create
    .plain.html
    files
  • ❌ Do NOT use
    convert_markdown_to_html
    tool — this converts the FULL guide to HTML with raw frontmatter visible, which is NOT what we want
  • ❌ 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:
  1. Run
    mkdir -p project-guides
    to ensure directory exists
  2. Generate markdown content with YAML frontmatter (title, date)
  3. Save to
    project-guides/DEVELOPER-GUIDE.md
    (EXACT PATH - no exceptions)
  4. IMMEDIATELY invoke PDF conversion (see Phase 5.1)
  5. Clean up all source files (only PDF remains)
  6. Final output:
    project-guides/DEVELOPER-GUIDE.pdf

强制输出:
project-guides/DEVELOPER-GUIDE.pdf
严格禁止:
  • ❌ 请勿读取或分析
    fstab.yaml
    ——大多数项目中不存在该文件,且无法展示所有站点信息
  • ❌ 请勿创建
    .plain.html
    文件
  • ❌ 请勿使用
    convert_markdown_to_html
    工具——该工具会将完整指南转换为HTML并显示原始前置内容,不符合需求
  • ❌ 请勿告知用户“手动将Markdown转换为PDF”
  • ❌ 请勿将Markdown文件保存至根目录或
    project-guides/
    以外的任何路径
  • ❌ 请勿提及“PDF将稍后生成”或“会话结束时生成”——立即生成PDF
要求的工作流程:
  1. 运行
    mkdir -p project-guides
    确保目录存在
  2. 生成包含YAML前置内容(标题、日期)的Markdown内容
  3. 保存至
    project-guides/DEVELOPER-GUIDE.md
    (精确路径——无例外)
  4. 立即调用PDF转换功能(见阶段5.1)
  5. 清理所有源文件(仅保留PDF)
  6. 最终输出:
    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 PDF

markdown
- [ ] 阶段1:收集项目信息
- [ ] 阶段2:分析项目架构
- [ ] 阶段3:文档化设计系统
- [ ] 阶段4:文档化区块、模型与模板
- [ ] 阶段5:生成专业PDF

Phase 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
undefined
bash
undefined

Check if org name is already saved

检查是否已保存组织名称

cat .claude-plugin/project-config.json 2>/dev/null | grep -o '"org"[[:space:]]:[[:space:]]"[^"]*"' | head -1
undefined
cat .claude-plugin/project-config.json 2>/dev/null | grep -o '"org"[[:space:]]:[[:space:]]"[^"]*"' | head -1
undefined

0.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 the
{org}
part of your Edge Delivery Services URLs (e.g.,
https://main--site--{org}.aem.page
). The org name may differ from your GitHub organization."
IMPORTANT RULES:
  • DO NOT use
    AskUserQuestion
    with predefined options
    — ask as a plain text question
  • 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}
部分(例如
https://main--site--{org}.aem.page
)。组织名称可能与GitHub组织名称不同。"
重要规则:
  • 请勿使用带有预定义选项的
    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
undefined

Create 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
undefined
bash
undefined

Get 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 name
git branch -a | head -10

**提取信息:**
- 仓库所有者与名称
- 主分支名称

1.2 Check Configuration Method

1.2 检查配置方式

bash
undefined
bash
undefined

Check 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
    fstab.yaml
    — does NOT show all sites in repoless setups
  • Reading
    README.md
    — may be outdated or incomplete
  • 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
    /
    code.repo
    — GitHub repository
  • content.source.url
    — Content mountpath (e.g.,
    https://content.da.live/org/site/
    )
  • content.source.type
    — Content source type (markup, onedrive, google)
⚠️ Do NOT use
fstab.yaml
— use Config Service API instead.
Record the result (repoless or standard) — it is used in the Local Development Setup section to decide whether to include the
--pages-url
flag for
aem up
.
curl -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
    /
    code.repo
    — GitHub仓库
  • content.source.url
    — 内容挂载路径(例如
    https://content.da.live/org/site/
  • content.source.type
    — 内容源类型(markup、onedrive、google)
⚠️ 请勿使用
fstab.yaml
——请使用Config Service API替代。
记录结果(无仓库或标准设置)——在本地开发设置部分中,该结果将用于决定是否为
aem up
命令添加
--pages-url
标记。

1.4 Check Node.js Requirements

1.4 检查Node.js要求

bash
undefined
bash
undefined

Check 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.json

2.1 Map Project Structure

2.1 映射项目结构

bash
undefined
bash
undefined

List 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"
undefined
ls -la templates/ 2>/dev/null || echo "无templates文件夹"
undefined

2.2 Identify Boilerplate vs Custom Files

2.2 区分样板文件与自定义文件

CRITICAL: Only document files that were actually customized.
bash
undefined
重要提示:仅记录实际被自定义的文件。
bash
undefined

Check 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
undefined
bash
undefined

List 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
undefined
bash
undefined

Extract 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
undefined
bash
undefined

Extract 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
undefined
bash
undefined

Extract 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
undefined
bash
undefined

Check 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
undefined
bash
undefined

Get 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
undefined
bash
undefined

Extract 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 fonts
ls fonts/ 2>/dev/null

**记录:**
- 字体文件与格式
- 字体家族名称
- 可用字体字重
- 后备字体

4.3 Document Breakpoints

4.3 文档化断点

bash
undefined
bash
undefined

Find 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
undefined
bash
undefined

Find 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
    aem-aemy[bot]
    commits (auto-generated)
  • 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
undefined

Get 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}.js
bash
grep "^import" blocks/{blockname}/{blockname}.js

4.3 Document Universal Editor Models (If Customized)

4.3 文档化Universal Editor模型(若已自定义)

Apply the same boilerplate filtering to
models/*.json
. Also exclude standard boilerplate models (
_page.json
,
_section.json
,
_button.json
,
_image.json
,
_text.json
,
_title.json
) 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
)。若所有模型均为样板文件,则在输出中跳过此部分。

4.4 Document Customized Templates

4.4 文档化自定义模板

Apply the same boilerplate filtering to
templates/*/
. For each customized template, document its purpose, how it's applied (
template: name
in metadata), and what it changes.

templates/*/
应用相同的样板文件过滤。为每个自定义模板记录其用途、应用方式(元数据中的
template: name
)以及修改内容。

Phase 5: Generate Developer Guide

阶段5:生成开发者指南

Output File:
project-guides/DEVELOPER-GUIDE.md

输出文件:
project-guides/DEVELOPER-GUIDE.md

Generate a markdown document with the following structure:
markdown
undefined
生成具有以下结构的Markdown文档:
markdown
undefined

[Project Name] - Developer Guide

[项目名称] - 开发者指南

Quick Reference

快速参考

ResourceURL
Code Repository{code.owner}/{code.repo} (from Config Service — may be GitHub or Cloud Manager)
Previewhttps://main--{repo}--{owner}.aem.page/
Livehttps://main--{repo}--{owner}.aem.live/
Local Devhttp://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.
PhasePurposeWhat LoadsPerformance Impact
EagerRender above-the-fold content as fast as possible (LCP)
styles/styles.css
, first section's blocks,
scripts/scripts.js
Blocks LCP — keep minimal
LazyLoad remaining page content after first paintRemaining blocks, header, footer,
fonts.css
,
lazy-styles.css
Runs after Eager completes — safe for non-critical UI
DelayedLoad non-essential third-party scripts
scripts/delayed.js
(analytics, marketing tags, chat widgets)
Runs ~3s after page load — never blocks rendering
Rules for developers:
  • Never add third-party scripts to
    scripts.js
    — they block LCP. Always use
    delayed.js
    .
  • Never load fonts eagerly
    fonts.css
    is loaded lazily to avoid render-blocking.
  • 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()
    /
    loadFooter()
    from
    aem.js
    .
Edge Delivery Services采用严格的即时-延迟-延后加载策略,以实现Lighthouse评分100。每个文件与脚本必须放置在正确的阶段。
阶段用途加载内容性能影响
即时(Eager)尽快渲染首屏内容(LCP)
styles/styles.css
、第一个区块、
scripts/scripts.js
阻塞LCP — 保持内容最少
延迟(Lazy)首次绘制后加载剩余页面内容剩余区块、页眉、页脚、
fonts.css
lazy-styles.css
在即时阶段完成后运行 — 对非关键UI安全
延后(Delayed)加载非必要第三方脚本
scripts/delayed.js
(分析、营销标签、聊天小部件)
页面加载约3秒后运行 — 从不阻塞渲染
开发者规则:
  • 切勿将第三方脚本添加至
    scripts.js
    ——会阻塞LCP。始终使用
    delayed.js
  • 切勿即时加载字体——
    fonts.css
    延迟加载以避免阻塞渲染。
  • 第一个区块即时加载;所有其他区块延迟加载。这基于DOM位置自动实现。
  • 页眉与页脚通过
    aem.js
    中的
    loadHeader()
    /
    loadFooter()
    在延迟阶段加载。

Key Files & How They Connect

关键文件及其关联关系

FileRoleConnects To
scripts/aem.js
Core library —
loadBlock
,
loadCSS
,
decorateBlock
,
sampleRUM
,
loadHeader
/
loadFooter
. DO NOT MODIFY.
Imported by
scripts.js
and blocks
scripts/scripts.js
Entry point — orchestrates E-L-D phases (
loadEager
loadLazy
loadDelayed
). Contains
buildAutoBlocks
,
decorateMain
, template loading.
Imports from
aem.js
; may import
utils.js
scripts/delayed.js
Loaded last via
loadDelayed()
— analytics, marketing tags, third-party scripts.
Called by
scripts.js
in delayed phase
scripts/utils.js
Shared helpers used across blocks and scripts.Imported by blocks and
scripts.js
styles/styles.css
Critical CSS + design tokens (CSS custom properties). Loaded eagerly.Referenced by all blocks and pages
styles/fonts.css
Font
@font-face
declarations. Loaded lazily.
Font families referenced in
styles.css
styles/lazy-styles.css
Non-critical global styles. Loaded lazily.Supplements
styles.css
blocks/{name}/{name}.js
Block logic — exports
default function decorate(block)
. Auto-loaded when the block class appears in DOM.
May import from
utils.js
or
aem.js
blocks/{name}/{name}.css
Block styles — auto-loaded alongside block JS.May use CSS custom properties from
styles.css
templates/{name}/{name}.js
Template logic — loaded when page metadata has matching
template
value. Customizes page structure before blocks load.
Called by
scripts.js
via
loadTemplate()
Execution flow: page load →
scripts.js
loadEager()
(first section + eager blocks) →
loadLazy()
(remaining blocks, header, footer,
fonts.css
,
lazy-styles.css
) →
loadDelayed()
(loads
delayed.js
)
文件角色关联对象
scripts/aem.js
核心库 —
loadBlock
loadCSS
decorateBlock
sampleRUM
loadHeader
/
loadFooter
请勿修改。
scripts.js
与区块导入
scripts/scripts.js
入口点 — 编排E-L-D阶段(
loadEager
loadLazy
loadDelayed
)。包含
buildAutoBlocks
decorateMain
、模板加载逻辑。
aem.js
导入;可能导入
utils.js
scripts/delayed.js
通过
loadDelayed()
最后加载 — 分析、营销标签、第三方脚本。
在延后阶段由
scripts.js
调用
scripts/utils.js
区块与脚本共享的辅助函数。被区块与
scripts.js
导入
styles/styles.css
关键CSS + 设计标记(CSS自定义属性)。即时加载。被所有区块与页面引用
styles/fonts.css
字体
@font-face
声明。延迟加载。
字体家族在
styles.css
中引用
styles/lazy-styles.css
非关键全局样式。延迟加载。补充
styles.css
blocks/{name}/{name}.js
区块逻辑 — 导出
default function decorate(block)
。当区块类出现在DOM中时自动加载。
可能从
utils.js
aem.js
导入
blocks/{name}/{name}.css
区块样式 — 与区块JS一同自动加载。可能使用
styles.css
中的CSS自定义属性
templates/{name}/{name}.js
模板逻辑 — 当页面元数据包含匹配的
template
值时加载。在区块加载前自定义页面结构。
通过
scripts.js
中的
loadTemplate()
调用
执行流程: 页面加载 →
scripts.js
loadEager()
(首屏区块 + 即时区块) →
loadLazy()
(剩余区块、页眉、页脚、
fonts.css
lazy-styles.css
) →
loadDelayed()
(加载
delayed.js

Local 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
undefined
bash
undefined

Clone 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
undefined
aem up
undefined

Local Server

本地服务器

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:
bash
aem up --pages-url=https://main--{site}--{org}.aem.page
Replace
{site}
and
{org}
with the actual site and organization names from the Config Service.
Without
--pages-url
, the AEM CLI cannot resolve content for the correct site and local preview will fail or show wrong content.
If the project is a standard single-site setup, omit the repoless subsection entirely — it would only confuse developers.
若在阶段1.3中检测到无仓库/多站点设置,请在输出中添加以下小节:

本地服务器 — 无仓库/多站点

对于多个站点共享一个仓库的无仓库设置,启动本地服务器时必须指定站点的预览URL:
bash
aem up --pages-url=https://main--{site}--{org}.aem.page
{site}
{org}
替换为Config Service中的实际站点与组织名称。
若不添加
--pages-url
,AEM CLI无法解析正确站点的内容,本地预览将失败或显示错误内容。
若项目为标准单站点设置,请完全省略无仓库小节——这只会让开发者困惑。

Linting

代码检查

bash
npm run lint
bash
npm run lint

Design 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

断点

NameMin-WidthUsage
Mobile0Default styles
Tablet600px
@media (min-width: 600px)
Desktop900px
@media (min-width: 900px)
Large1200px
@media (min-width: 1200px)
名称最小宽度用途
移动端0默认样式
平板端600px
@media (min-width: 600px)
桌面端900px
@media (min-width: 900px)
大屏端1200px
@media (min-width: 1200px)

Fonts

字体

FamilyWeightsUsage
[Font Name][weights][body/headings]
家族字重用途
[字体名称][字重][正文/标题]

Blocks Reference

区块参考

BlockPurposeVariantsKey Features
[block-name][What it does]
variant1
,
variant2
[Important details, gotchas]
[Generate one row per customized block]
区块用途变体关键特性
[区块名称][功能]
variant1
,
variant2
[重要细节、注意事项]
[为每个自定义区块生成一行]

Templates

模板

TemplatePurposeApplied ViaSpecial Behavior
[template-name][What type of pages]
template: [name]
[What it does differently]
[Generate one row per customized template. Skip templates with only "initial commit".]
模板用途应用方式特殊行为
[模板名称][适用页面类型]
template: [名称]
[差异功能]
[为每个自定义模板生成一行。仅包含“初始提交”的模板请跳过。]

Common Development Tasks

常见开发任务

Add a New Block

添加新区块

  1. Create
    blocks/{name}/{name}.js
  2. Create
    blocks/{name}/{name}.css
  3. Implement
    export default function decorate(block)
  4. Test locally at http://localhost:3000
  5. Push to feature branch
  1. 创建
    blocks/{name}/{name}.js
  2. 创建
    blocks/{name}/{name}.css
  3. 实现
    export default function decorate(block)
  4. http://localhost:3000本地测试
  5. 推送至功能分支

Modify Global Styles

修改全局样式

  1. Edit
    styles/styles.css
  2. Use CSS custom properties
  3. Test across multiple pages
  4. Watch for CLS impact
  1. 编辑
    styles/styles.css
  2. 使用CSS自定义属性
  3. 在多个页面测试
  4. 关注CLS影响

Add Analytics/Marketing Tool

添加分析/营销工具

  1. Add to
    scripts/delayed.js
  2. Never add to
    scripts.js
    (blocks performance)
  3. Test with Network tab to verify delayed loading
  1. 添加至
    scripts/delayed.js
  2. 切勿添加至
    scripts.js
    (影响性能)
  3. 使用网络标签测试以验证延迟加载

Debug a Block

调试区块

  1. Check browser console for errors
  2. Inspect DOM: expected structure vs actual
  3. Check if variant classes are applied
  4. Verify CSS specificity
  1. 检查浏览器控制台是否有错误
  2. 检查DOM:预期结构与实际结构对比
  3. 检查变体类是否已应用
  4. 验证CSS优先级

Environments

环境

EnvironmentURL PatternPurpose
Localhttp://localhost:3000Development
Feature Branchhttps://{branch}--{repo}--{owner}.aem.pagePR testing
Previewhttps://main--{repo}--{owner}.aem.pageStaging
Livehttps://main--{repo}--{owner}.aem.liveProduction
环境URL模式用途
本地http://localhost:3000开发
功能分支https://{branch}--{repo}--{owner}.aem.pagePR测试
预览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要求

  1. Include preview URL in PR description
  2. Pass linting
  3. Test on feature branch preview
  4. No console errors
  1. PR描述中包含预览URL
  2. 通过代码检查
  3. 在功能分支预览环境测试
  4. 无控制台错误

Troubleshooting

故障排除

Block not loading?

区块未加载?

  1. Check block folder name matches class name
  2. Verify JS exports
    default function decorate
  3. Check browser Network tab for 404s
  1. 检查区块文件夹名称与类名是否匹配
  2. 验证JS是否导出
    default function decorate
  3. 检查浏览器网络标签是否有404错误

Styles not applying?

样式未生效?

  1. Check CSS specificity
  2. Verify file is loading (Network tab)
  3. Check for CSS syntax errors
  1. 检查CSS优先级
  2. 验证文件是否已加载(网络标签)
  3. 检查CSS语法错误

Content not updating?

内容未更新?

  1. Clear browser cache
  2. Check preview was triggered in DA
  3. Wait for CDN cache (1-2 min)
  1. 清除浏览器缓存
  2. 检查DA中是否已触发预览
  3. 等待CDN缓存更新(1-2分钟)

Resources

资源

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.
  1. 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
  2. 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" })
  3. 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。
  1. 将Markdown保存至:
    project-guides/DEVELOPER-GUIDE.md
    • 文件必须以YAML前置内容开头:
      yaml
      ---
      title: "[项目名称] - 开发者指南"
      date: "[完整日期 - 例如:2026年2月17日]"
      ---
    • 日期格式: 始终使用包含日、月、年的完整日期(例如“2026年2月17日”),请勿仅使用月和年
  2. 保存Markdown后立即调用PDF转换技能:
    Skill({ skill: "project-management:whitepaper", args: "project-guides/DEVELOPER-GUIDE.md project-guides/DEVELOPER-GUIDE.pdf" })
  3. 等待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.pdf
All source files (.md, .html, .plain.html) are deleted after PDF generation. Only the PDF remains.
Location:
project-guides/
folder

最终输出:
project-guides/DEVELOPER-GUIDE.pdf
PDF生成后,所有源文件(.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

清晰文档撰写技巧

  1. Focus on what's unique - Document project-specific implementations
  2. Use code examples - Show actual code from the project
  3. Document the "why" - Explain reasoning behind custom implementations
  4. Include gotchas - Note any tricky behavior or edge cases
  5. Test the setup instructions - Verify they work from scratch
  6. Keep it maintainable - Don't over-document things that change often
  1. 聚焦独特内容 - 记录项目特定实现
  2. 使用代码示例 - 展示项目中的实际代码
  3. 记录“原因” - 解释自定义实现的理由
  4. 包含注意事项 - 记录任何复杂行为或边缘情况
  5. 测试设置说明 - 验证从零基础开始是否可行
  6. 保持可维护性 - 不要过度记录经常变化的内容