ogt-docs-create
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseOGT Docs - Create
OGT Docs - 文档创建
Root skill for creating new documentation entities.
用于创建新文档实体的核心技能。
Overview
概述
This skill routes to specialized creation workflows based on what type of document you're creating. Every entity becomes a folder with appropriate files and signals.
mermaid
flowchart TB
CREATE["ogt-docs-create"] --> TASK["ogt-docs-create-task"]
CREATE --> DEF["ogt-docs-define"]
CREATE --> RULE["ogt-docs-rules"]
CREATE --> SOCIAL["ogt-docs-create-social"]
CREATE --> CHANGE["ogt-docs-changelog"]
TASK --> |folder| PENDING["docs/todo/pending/"]
DEF --> |folder| DEFINE["docs/define/"]
RULE --> |folder| RULES["docs/rules/"]
SOCIAL --> |folder| CONTENT["docs/content/"]
CHANGE --> |file| CHANGELOG["CHANGELOG.md"]此技能会根据你要创建的文档类型,路由至对应的专项创建工作流。每个实体都会成为一个包含对应文件和标记信息的文件夹。
mermaid
flowchart TB
CREATE["ogt-docs-create"] --> TASK["ogt-docs-create-task"]
CREATE --> DEF["ogt-docs-define"]
CREATE --> RULE["ogt-docs-rules"]
CREATE --> SOCIAL["ogt-docs-create-social"]
CREATE --> CHANGE["ogt-docs-changelog"]
TASK --> |folder| PENDING["docs/todo/pending/"]
DEF --> |folder| DEFINE["docs/define/"]
RULE --> |folder| RULES["docs/rules/"]
SOCIAL --> |folder| CONTENT["docs/content/"]
CHANGE --> |file| CHANGELOG["CHANGELOG.md"]When to Use
使用场景
- Creating new tasks
- Adding definitions (features, code, business, etc.)
- Establishing new rules
- Creating social/marketing content
- Updating changelog
- 创建新任务
- 添加定义(功能、代码、业务等)
- 制定新规则
- 创建社交/营销内容
- 更新变更日志
Quick Reference
快速参考
| Creating | Sub-Skill | Target |
|---|---|---|
| Task | | docs/todo/pending/ |
| Feature | | docs/define/features/ |
| Business def | | docs/define/business/ |
| Code def | | docs/define/code/ |
| Marketing def | | docs/define/marketing/ |
| Branding def | | docs/define/branding/ |
| Tool doc | | docs/define/tools/ |
| Code rule | | docs/rules/code/ |
| Git rule | | docs/rules/git/ |
| Social post | | docs/content/social/ |
| Changelog | | CHANGELOG.md |
| 要创建的内容 | 子技能 | 目标路径 |
|---|---|---|
| 任务 | | docs/todo/pending/ |
| 功能 | | docs/define/features/ |
| 业务定义 | | docs/define/business/ |
| 代码定义 | | docs/define/code/ |
| 营销定义 | | docs/define/marketing/ |
| 品牌定义 | | docs/define/branding/ |
| 工具文档 | | docs/define/tools/ |
| 代码规则 | | docs/rules/code/ |
| Git规则 | | docs/rules/git/ |
| 社交帖子 | | docs/content/social/ |
| 变更日志 | | CHANGELOG.md |
Creation Workflow
创建工作流
All creation follows the same pattern:
mermaid
flowchart LR
A[Identify Type] --> B[Create Folder]
B --> C[Copy Template]
C --> D[Fill Content]
D --> E[Add Signals]
E --> F[Verify Structure]所有创建操作都遵循以下统一流程:
mermaid
flowchart LR
A[Identify Type] --> B[Create Folder]
B --> C[Copy Template]
C --> D[Fill Content]
D --> E[Add Signals]
E --> F[Verify Structure]Step 1: Identify Type
步骤1:确定文档类型
Determine what you're creating:
| If you need to... | Create a... | Location |
|---|---|---|
| Track work to do | Task | docs/todo/pending/ |
| Document a product feature | Feature | docs/define/features/ |
| Document code architecture | Code definition | docs/define/code/ |
| Establish coding standard | Code rule | docs/rules/code/ |
| Record what changed | Changelog entry | CHANGELOG.md |
明确你要创建的内容类型:
| 如果你需要... | 创建... | 存储位置 |
|---|---|---|
| 跟踪待办工作 | 任务 | docs/todo/pending/ |
| 记录产品功能 | 功能 | docs/define/features/ |
| 记录代码架构 | 代码定义 | docs/define/code/ |
| 制定编码标准 | 代码规则 | docs/rules/code/ |
| 记录变更内容 | 变更日志条目 | CHANGELOG.md |
Step 2: Create Folder
步骤2:创建文件夹
bash
undefinedbash
undefinedUse slug format: lowercase, hyphens, no spaces
使用slug格式:小写字母、连字符分隔、无空格
mkdir -p docs/{section}/{category}/{slug}
mkdir -p docs/{section}/{category}/{slug}
Examples
示例
mkdir -p docs/todo/pending/user-auth-flow
mkdir -p docs/define/features/dark-mode
mkdir -p docs/rules/code/error-handling
undefinedmkdir -p docs/todo/pending/user-auth-flow
mkdir -p docs/define/features/dark-mode
mkdir -p docs/rules/code/error-handling
undefinedStep 3: Copy Template
步骤3:复制模板
bash
undefinedbash
undefinedCopy appropriate template
复制对应的模板
cp docs/_templates/{type}.md docs/{path}/{slug}/{type}.md
cp docs/_templates/{type}.md docs/{path}/{slug}/{type}.md
Examples
示例
cp docs/_templates/task.md docs/todo/pending/user-auth-flow/task.md
cp docs/_templates/feature.md docs/define/features/dark-mode/feature.md
cp docs/_templates/rule.md docs/rules/code/error-handling/rule.md
undefinedcp docs/_templates/task.md docs/todo/pending/user-auth-flow/task.md
cp docs/_templates/feature.md docs/define/features/dark-mode/feature.md
cp docs/_templates/rule.md docs/rules/code/error-handling/rule.md
undefinedStep 4: Fill Content
步骤4:填充内容
Edit the template with actual content. See sub-skill documentation for required sections.
编辑模板并填入实际内容。具体必填章节请参考对应子技能的文档。
Step 5: Add Signals
步骤5:添加标记信息
bash
undefinedbash
undefinedCommon signals
通用标记信息
echo '{"schema": "1.0", "created": "'$(date -Iseconds)'"}' > {folder}/.version
echo '{"schema": "1.0", "created": "'$(date -Iseconds)'"}' > {folder}/.version
Type-specific signals
类型专属标记信息
echo "high" > docs/todo/pending/{task}/.priority
touch docs/rules/code/{rule}/.enforced_by
undefinedecho "high" > docs/todo/pending/{task}/.priority
touch docs/rules/code/{rule}/.enforced_by
undefinedStep 6: Verify Structure
步骤6:验证结构
bash
undefinedbash
undefinedVerify folder has required files
验证文件夹包含所需文件
ls -la docs/{path}/{slug}/
ls -la docs/{path}/{slug}/
Expected output example for task:
任务类型的预期输出示例:
task.md
task.md
.version
.version
.priority
.priority
---
---Templates Overview
模板概述
Task Template
任务模板
markdown
undefinedmarkdown
undefinedTask: {Title}
Task: {Title}
Summary
摘要
{What and why}
{任务内容与目的}
Objectives
目标
- Objective 1
- Objective 2
- 目标1
- 目标2
Acceptance Criteria
验收标准
- Criterion 1
- Criterion 2
- 标准1
- 标准2
Dependencies
依赖项
{None or list}
{无或列出依赖}
Estimated Effort
预估工作量
{Size} ({time})
undefined{规模}({时长})
undefinedFeature Template
功能模板
markdown
undefinedmarkdown
undefinedFeature: {Name}
Feature: {Name}
Summary
摘要
{What the feature does}
{功能描述}
User Stories
用户故事
As a {user}, I want to {action}, so that {benefit}.
作为{用户角色},我希望{执行操作},以便{获得收益}。
Scope
范围
In Scope
包含范围
- Item 1
- 内容1
Out of Scope
排除范围
- Item 1
- 内容1
Success Metrics
成功指标
- Metric 1
undefined- 指标1
undefinedDefinition Template
定义模板
markdown
undefinedmarkdown
undefined{Name}
{Name}
Summary
摘要
{One paragraph}
{一段描述}
Details
详情
{Full explanation}
{完整说明}
Examples
示例
{Examples}
{示例内容}
Related
相关链接
- {Links}
undefined- {链接}
undefinedRule Template
规则模板
markdown
undefinedmarkdown
undefinedRule: {Name}
Rule: {Name}
Summary
摘要
{One sentence}
{一句话概述}
Rationale
理由
{Why}
{制定规则的原因}
The Rule
规则内容
{MUST/SHOULD/MAY statements}
{MUST/SHOULD/MAY类型的规则语句}
Examples
示例
Correct
正确示例
{example}
{示例}
Incorrect
错误示例
{example}
{示例}
Enforcement
执行方式
{How enforced}
---{规则的执行方式}
---Batch Creation
批量创建
Create multiple related items at once:
bash
#!/bin/bash可一次性创建多个相关内容:
bash
#!/bin/bashcreate-feature-with-tasks.sh
create-feature-with-tasks.sh
FEATURE=$1
FEATURE=$1
Create feature definition
创建功能定义
mkdir -p docs/define/features/$FEATURE
cat > docs/define/features/$FEATURE/feature.md << EOF
mkdir -p docs/define/features/$FEATURE
cat > docs/define/features/$FEATURE/feature.md << EOF
Feature: $(echo $FEATURE | tr '-' ' ' | sed 's/\b(.)/\u\1/g')
Feature: $(echo $FEATURE | tr '-' ' ' | sed 's/\b(.)/\u\1/g')
Summary
摘要
TODO: Add summary
TODO: 添加摘要
User Stories
用户故事
As a user, I want to TODO, so that TODO.
EOF
As a user, I want to TODO, so that TODO.
EOF
Create initial tasks
创建初始任务
for task in "design" "implement" "test" "document"; do
mkdir -p docs/todo/pending/${FEATURE}-${task}
cat > docs/todo/pending/${FEATURE}-${task}/task.md << EOF
for task in "design" "implement" "test" "document"; do
mkdir -p docs/todo/pending/${FEATURE}-${task}
cat > docs/todo/pending/${FEATURE}-${task}/task.md << EOF
Task: $(echo $FEATURE | tr '-' ' ' | sed 's/\b(.)/\u\1/g') - $(echo $task | sed 's/\b(.)/\u\1/g')
Task: $(echo $FEATURE | tr '-' ' ' | sed 's/\b(.)/\u\1/g') - $(echo $task | sed 's/\b(.)/\u\1/g')
Summary
摘要
${task^} the $FEATURE feature.
${task^} the $FEATURE feature.
Objectives
目标
- TODO
- TODO
Acceptance Criteria
验收标准
- TODO EOF echo "medium" > docs/todo/pending/${FEATURE}-${task}/.priority done
echo "Created feature: $FEATURE"
echo "Created tasks: ${FEATURE}-design, ${FEATURE}-implement, ${FEATURE}-test, ${FEATURE}-document"
Usage:
```bash
./create-feature-with-tasks.sh dark-mode- TODO EOF echo "medium" > docs/todo/pending/${FEATURE}-${task}/.priority done
echo "Created feature: $FEATURE"
echo "Created tasks: ${FEATURE}-design, ${FEATURE}-implement, ${FEATURE}-test, ${FEATURE}-document"
使用方式:
```bash
./create-feature-with-tasks.sh dark-modeNaming Conventions
命名规范
Slug Format
Slug格式
All folder names use slug format:
| Rule | Example |
|---|---|
| Lowercase | |
| Hyphens for spaces | |
| No special chars | |
| Descriptive | |
| Under 30 chars | Keep it readable |
所有文件夹名称都使用slug格式:
| 规则 | 示例 |
|---|---|
| 全小写 | |
| 用连字符代替空格 | |
| 无特殊字符 | |
| 描述性强 | |
| 长度不超过30字符 | 保持可读性 |
Good Names
规范名称示例
docs/todo/pending/add-steam-oauth
docs/define/features/dark-mode-toggle
docs/rules/code/no-implicit-anydocs/todo/pending/add-steam-oauth
docs/define/features/dark-mode-toggle
docs/rules/code/no-implicit-anyBad Names
不规范名称示例
docs/todo/pending/Add Steam OAuth # Spaces, caps
docs/define/features/dark_mode_toggle # Underscores
docs/rules/code/rule1 # Not descriptivedocs/todo/pending/Add Steam OAuth # 包含空格和大写字母
docs/define/features/dark_mode_toggle # 使用下划线
docs/rules/code/rule1 # 描述性不足Validation
验证
After creating any document:
创建任何文档后:
Check Required Files
检查必填文件
bash
undefinedbash
undefinedTask
任务类型
test -f docs/todo/pending/{slug}/task.md || echo "MISSING: task.md"
test -f docs/todo/pending/{slug}/.priority || echo "MISSING: .priority"
test -f docs/todo/pending/{slug}/task.md || echo "MISSING: task.md"
test -f docs/todo/pending/{slug}/.priority || echo "MISSING: .priority"
Feature
功能类型
test -f docs/define/features/{slug}/feature.md || echo "MISSING: feature.md"
test -f docs/define/features/{slug}/mvp.md || echo "MISSING: mvp.md"
test -f docs/define/features/{slug}/feature.md || echo "MISSING: feature.md"
test -f docs/define/features/{slug}/mvp.md || echo "MISSING: mvp.md"
Rule
规则类型
test -f docs/rules/{category}/{slug}/rule.md || echo "MISSING: rule.md"
test -f docs/rules/{category}/{slug}/.enforced_by || echo "MISSING: .enforced_by"
undefinedtest -f docs/rules/{category}/{slug}/rule.md || echo "MISSING: rule.md"
test -f docs/rules/{category}/{slug}/.enforced_by || echo "MISSING: .enforced_by"
undefinedCheck Required Sections
检查必填章节
bash
undefinedbash
undefinedFor any markdown file, check for required headings
对于任何Markdown文件,检查是否包含必填标题
file=$1
required=("## Summary" "## Objectives" "## Acceptance Criteria")
for section in "${required[@]}"; do
grep -q "$section" "$file" || echo "MISSING: $section in $file"
done
---file=$1
required=("## Summary" "## Objectives" "## Acceptance Criteria")
for section in "${required[@]}"; do
grep -q "$section" "$file" || echo "MISSING: $section in $file"
done
---Common Creation Patterns
常见创建模式
New Feature Flow
新功能创建流程
- Create feature definition
- Create mvp.md defining scope
- Create phase_0.md for initial work
- Create tasks for phase_0
bash
undefined- 创建功能定义
- 创建mvp.md定义范围
- 创建phase_0.md记录初始工作
- 为phase_0创建对应任务
bash
undefined1. Feature folder
1. 创建功能文件夹
mkdir -p docs/define/features/search
mkdir -p docs/define/features/search
2. Feature definition
2. 功能定义
cat > docs/define/features/search/feature.md << 'EOF'
cat > docs/define/features/search/feature.md << 'EOF'
Feature: Global Search
Feature: Global Search
Summary
摘要
Fuzzy search across all content types.
EOF
对所有内容类型进行模糊搜索。
EOF
3. MVP scope
3. MVP范围
cat > docs/define/features/search/mvp.md << 'EOF'
cat > docs/define/features/search/mvp.md << 'EOF'
MVP: Global Search
MVP: Global Search
In MVP
MVP包含内容
- Phase 0 only
- 仅Phase 0阶段
Definition of Done
完成定义
- Search returns results in <100ms
- Fuzzy matching works EOF
- 搜索结果返回时间<100ms
- 模糊匹配功能可用 EOF
4. Phase 0
4. Phase 0阶段
cat > docs/define/features/search/phase_0.md << 'EOF'
cat > docs/define/features/search/phase_0.md << 'EOF'
Phase 0: Basic Search
Phase 0: Basic Search
Deliverables
交付物
- MiniSearch integration
- Global search component EOF
- MiniSearch集成
- 全局搜索组件 EOF
5. Tasks
5. 创建任务
mkdir -p docs/todo/pending/search-minisearch-setup
mkdir -p docs/todo/pending/search-minisearch-setup
... create task
... 创建任务文档
undefinedundefinedNew Rule Flow
新规则创建流程
- Identify pattern to standardize
- Create rule folder
- Write rule with examples
- Configure enforcement
- Announce to team
bash
undefined- 确定需要标准化的模式
- 创建规则文件夹
- 编写规则及示例
- 配置执行方式
- 向团队公告
bash
undefined1. Rule folder
1. 创建规则文件夹
mkdir -p docs/rules/code/async-await
mkdir -p docs/rules/code/async-await
2. Rule definition
2. 规则定义
cat > docs/rules/code/async-await/rule.md << 'EOF'
cat > docs/rules/code/async-await/rule.md << 'EOF'
Rule: Prefer async/await
Rule: Prefer async/await
Summary
摘要
SHOULD use async/await over .then() chains.
SHOULD 使用async/await替代.then()链式调用。
Rationale
理由
Improved readability and error handling.
提升可读性和错误处理能力。
The Rule
规则内容
...
EOF
...
EOF
3. Examples
3. 示例
cat > docs/rules/code/async-await/examples.md << 'EOF'
cat > docs/rules/code/async-await/examples.md << 'EOF'
Examples
Examples
...
EOF
...
EOF
4. Enforcement
4. 配置执行方式
echo "eslint prefer-async-await" > docs/rules/code/async-await/.enforced_by
echo "eslint prefer-async-await" > docs/rules/code/async-await/.enforced_by
5. Configure ESLint
5. 配置ESLint
Edit .eslintrc.js
编辑 .eslintrc.js
---
---Signal Files Quick Reference
标记信息文件速查
| Signal | Used For | Content |
|---|---|---|
| All | JSON schema version |
| Tasks | critical/high/medium/low |
| Rules | List of tools |
| Definitions | draft/review/approved |
| All | ISO timestamp |
| All | Author name |
| 标记文件 | 适用类型 | 内容 |
|---|---|---|
| 所有类型 | JSON格式的 schema 版本 |
| 任务 | critical/high/medium/low |
| 规则 | 执行工具列表 |
| 定义 | draft/review/approved |
| 所有类型 | ISO时间戳 |
| 所有类型 | 作者名称 |
Creation Checklist
创建检查清单
Before finalizing any created document:
- Folder uses slug format
- Primary file exists (task.md, feature.md, etc.)
- .version signal added
- Required sections present
- No TODO placeholders remain
- Links are valid
- Spelling/grammar checked
- Related documents cross-referenced
在完成任何文档创建前,请确认:
- 文件夹使用slug格式
- 主文件已存在(task.md、feature.md等)
- 已添加.version标记文件
- 包含所有必填章节
- 无剩余TODO占位符
- 链接有效
- 拼写/语法已检查
- 已关联相关文档