File contents 核心任务
生成实用操作类教程 (.rmd/.qmd),涵盖数据处理、工具使用、工作流优化,强调 "任务目标 → 工具选择 → 操作步骤 → 结果验证"。
快速启动 (Quick Start)
确定任务 : 如 "正则表达式处理字符串 (Regex)"。
加载模板 : 阅读 content-structure.md 获取 YAML 和标题结构。
生成内容 : 遵循 "目标 -> 准备 -> 基础操作 -> 实战案例 -> 进阶技巧" 流程。
视觉设计 : 参考 visual-templates.md 生成封面图和流程示意图。
质量检查 : 验证路径规范与导航更新。
完整工作流程
步骤1: 生成教程内容与封面
按 content-structure.md 结构生成文件。
必须包含 : 任务目标、准备工作、分步骤操作流程、至少一个实战案例。
操作导向 : 每步都应可直接操作,并提供预期输出说明。
封面图 (MANDATORY) : 必须生成 doc/images/[number]-[topic]-cover.svg。
原理图 : 复杂逻辑,结构图,代码不好展现的,必须AI生图生成 doc/images/diagrams/stat-*.svg(或者png),由AI直接生成,比如一些思维导图,可视化内容。使用md语法在文章内引用
步骤2: 验证渲染 (CRITICAL)
在提交前必须进行本地渲染验证,确保代码可运行且格式正确。
# 渲染单文件验证内容
quarto render doc/[number]-[topic].rmd
# 确保无报错、包缺失或格式问题
步骤3: 更新导航系统 (CRITICAL)
必须执行以下步骤,否则新文章无法在网站侧边栏和分类页显示。
更新 doc/_quarto.yml :
更新 doc/0001-guide.rmd :
运行自动生成脚本 (MANDATORY) :
此脚本会根据 _quarto.yml 更新 sections/operation.qmd 等分类索引页。
# 在项目根目录下运行
workdir="doc" Rscript doc/generate_sections.R
更新 README.md :
在 🧭 内容导航 -> 🛠️ 实用操作 的对应折叠块中添加链接。
步骤4: 最终渲染与提交
重新渲染受影响页面 :
quarto render doc/sections/operation.qmd
quarto render doc/index.qmd
提交代码 :
git add doc/[number]-[topic].rmd doc/images/[number]-[topic]-cover.svg
git add doc/_quarto.yml doc/0001-guide.rmd README.md doc/sections/operation.qmd
git commit -m "feat(ops): 新增[主题]实用操作教程"
写作规范
内容标准 :
详细度 : 内容必须详尽,起到深入教程的作用。
篇幅 : 不少于 300 行 (Not less than 300 lines)。
比例 : 文字说明约占 70%,代码约占 30% (70% text, 30% code)。
结构 : 必须提前构建全面的内容框架,然后根据框架填充详细内容。
路径 : 优先使用相对路径 + here 包,避免硬编码绝对路径。
验证 : 每个关键步骤提供验证代码和检查清单。
风格 : 遵循 tidyverse 风格指南,适当添加注释。
参考资源
content-structure.md: 详细内容模板与标题规范。
visual-templates.md: SVG 封面与示意图模板库。
data-cleaning-workflow.md: 数据清洗标准工作流。
1 --- 2 name: section-operations-2 3 description: 核心任务 4 --- 5 ## 核心任务 6 7 生成实用操作类教程 (.rmd/.qmd),涵盖数据处理、工具使用、工作流优化,强调 "任务目标 → 工具选择 → 操作步骤 → 结果验证"。 8 9 ## 快速启动 (Quick Start) 10 11 1. **确定任务**: 如 "正则表达式处理字符串 (Regex)"。 12 2. **加载模板**: 阅读 [content-structure.md](references/content-structure.md) 获取 YAML 和标题结构。 13 3. **生成内容**: 遵循 "目标 -> 准备 -> 基础操作 -> 实战案例 -> 进阶技巧" 流程。 14 4. **视觉设计**: 参考 [visual-templates.md](references/visual-templates.md) 生成封面图和流程示意图。 15 5. **质量检查**: 验证路径规范与导航更新。 16 17 ## 完整工作流程 18 19 ### 步骤1: 生成教程内容与封面 20 21 按 [content-structure.md](references/content-structure.md) 结构生成文件。 22 23 - **必须包含**: 任务目标、准备工作、分步骤操作流程、至少一个实战案例。 24 - **操作导向**: 每步都应可直接操作,并提供预期输出说明。 25 - **封面图 (MANDATORY)**: 必须生成 `doc/images/[number]-[topic]-cover.svg`。 26 - **原理图**: 复杂逻辑,结构图,代码不好展现的,必须AI生图生成 `doc/images/diagrams/stat-*.svg(或者png),由AI直接生成`,比如一些思维导图,可视化内容。使用md语法在文章内引用 27 28 ### 步骤2: 验证渲染 (CRITICAL) 29 30 在提交前必须进行本地渲染验证,确保代码可运行且格式正确。 31 32 ```bash 33 # 渲染单文件验证内容 34 quarto render doc/[number]-[topic].rmd 35 36 # 确保无报错、包缺失或格式问题 37 ``` 38 39 ### 步骤3: 更新导航系统 (CRITICAL) 40 41 必须执行以下步骤,否则新文章无法在网站侧边栏和分类页显示。 42 43 1. **更新 `doc/_quarto.yml`**: 44 45 - 找到 `sidebar` -> `contents` -> `实用操作` 部分。 46 - 添加新条目,**注意缩进**: 47 ```yaml 48 - text: "文章标题" 49 href: "[number]-[topic].rmd" 50 ``` 51 2. **更新 `doc/0001-guide.rmd`**: 52 53 - 在对应分类的表格中添加一行: 54 ```markdown 55 | [主题名] | [文章标题]([number]-[topic].html) | [简短说明] | 56 ``` 57 3. **运行自动生成脚本 (MANDATORY)**: 58 59 - 此脚本会根据 `_quarto.yml` 更新 `sections/operation.qmd` 等分类索引页。 60 61 ```bash 62 # 在项目根目录下运行 63 workdir="doc" Rscript doc/generate_sections.R 64 ``` 65 4. **更新 `README.md`**: 66 67 - 在 `🧭 内容导航` -> `🛠️ 实用操作` 的对应折叠块中添加链接。 68 69 ### 步骤4: 最终渲染与提交 70 71 1. **重新渲染受影响页面**: 72 73 ```bash 74 quarto render doc/sections/operation.qmd 75 quarto render doc/index.qmd 76 ``` 77 2. **提交代码**: 78 79 ```bash 80 git add doc/[number]-[topic].rmd doc/images/[number]-[topic]-cover.svg 81 git add doc/_quarto.yml doc/0001-guide.rmd README.md doc/sections/operation.qmd 82 git commit -m "feat(ops): 新增[主题]实用操作教程" 83 ``` 84 85 ## 写作规范 86 87 - **内容标准**: 88 - **详细度**: 内容必须详尽,起到深入教程的作用。 89 - **篇幅**: 不少于 300 行 (Not less than 300 lines)。 90 - **比例**: 文字说明约占 70%,代码约占 30% (70% text, 30% code)。 91 - **结构**: 必须提前构建全面的内容框架,然后根据框架填充详细内容。 92 - **路径**: 优先使用相对路径 + `here` 包,避免硬编码绝对路径。 93 - **验证**: 每个关键步骤提供验证代码和检查清单。 94 - **风格**: 遵循 tidyverse 风格指南,适当添加注释。 95 96 ## 参考资源 97 98 - [content-structure.md](references/content-structure.md): 详细内容模板与标题规范。 99 - [visual-templates.md](references/visual-templates.md): SVG 封面与示意图模板库。 100 - [data-cleaning-workflow.md](references/data-cleaning-workflow.md): 数据清洗标准工作流。
kangwang42/r_note_for_epidemiology/tree/main/.opencode/skills/section-operations commit b315351559
Frequently asked questions How do I install the Section Operations skill? Run npx skillmds@latest add kangwang42/section-operations-2 in your terminal (requires Node.js), paste this page's agent-chat prompt into Claude, Cursor, or any MCP-connected agent, or download the SKILL.md file and copy it into your agent's skills directory.
What does the Section Operations skill do? 核心任务 It is listed under Coding & Dev Tools on SkillMD.
Is Section Operations safe to use? This skill has not completed SkillMD's automated safety review yet. SkillMD never runs a skill's scripts for you; review the SKILL.md before installing.
Which AI agents work with Section Operations? This skill is tagged as working with Claude Code, Claude.ai, OpenAI Codex. SKILL.md is an open format, so most agents that read a skills directory can load it too.
Is Section Operations free to use? Yes. Installing skills from SkillMD is free, and the skill stays under its author's original license.
Who published Section Operations? kangwang42 (@kangwang42) published this skill. Their other Agent Skills are listed on their SkillMD profile.