ogt-docs-create

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

OGT 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

快速参考

CreatingSub-SkillTarget
Task
ogt-docs-create-task
docs/todo/pending/
Feature
ogt-docs-define-feature
docs/define/features/
Business def
ogt-docs-define-business
docs/define/business/
Code def
ogt-docs-define-code
docs/define/code/
Marketing def
ogt-docs-define-marketing
docs/define/marketing/
Branding def
ogt-docs-define-branding
docs/define/branding/
Tool doc
ogt-docs-define-tools
docs/define/tools/
Code rule
ogt-docs-rules-code
docs/rules/code/
Git rule
ogt-docs-rules-git
docs/rules/git/
Social post
ogt-docs-create-social
docs/content/social/
Changelog
ogt-docs-changelog
CHANGELOG.md

要创建的内容子技能目标路径
任务
ogt-docs-create-task
docs/todo/pending/
功能
ogt-docs-define-feature
docs/define/features/
业务定义
ogt-docs-define-business
docs/define/business/
代码定义
ogt-docs-define-code
docs/define/code/
营销定义
ogt-docs-define-marketing
docs/define/marketing/
品牌定义
ogt-docs-define-branding
docs/define/branding/
工具文档
ogt-docs-define-tools
docs/define/tools/
代码规则
ogt-docs-rules-code
docs/rules/code/
Git规则
ogt-docs-rules-git
docs/rules/git/
社交帖子
ogt-docs-create-social
docs/content/social/
变更日志
ogt-docs-changelog
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 doTaskdocs/todo/pending/
Document a product featureFeaturedocs/define/features/
Document code architectureCode definitiondocs/define/code/
Establish coding standardCode ruledocs/rules/code/
Record what changedChangelog entryCHANGELOG.md
明确你要创建的内容类型:
如果你需要...创建...存储位置
跟踪待办工作任务docs/todo/pending/
记录产品功能功能docs/define/features/
记录代码架构代码定义docs/define/code/
制定编码标准代码规则docs/rules/code/
记录变更内容变更日志条目CHANGELOG.md

Step 2: Create Folder

步骤2:创建文件夹

bash
undefined
bash
undefined

Use 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
undefined
mkdir -p docs/todo/pending/user-auth-flow mkdir -p docs/define/features/dark-mode mkdir -p docs/rules/code/error-handling
undefined

Step 3: Copy Template

步骤3:复制模板

bash
undefined
bash
undefined

Copy 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
undefined
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
undefined

Step 4: Fill Content

步骤4:填充内容

Edit the template with actual content. See sub-skill documentation for required sections.
编辑模板并填入实际内容。具体必填章节请参考对应子技能的文档。

Step 5: Add Signals

步骤5:添加标记信息

bash
undefined
bash
undefined

Common 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
undefined
echo "high" > docs/todo/pending/{task}/.priority touch docs/rules/code/{rule}/.enforced_by
undefined

Step 6: Verify Structure

步骤6:验证结构

bash
undefined
bash
undefined

Verify 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
undefined
markdown
undefined

Task: {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
{规模}({时长})
undefined

Feature Template

功能模板

markdown
undefined
markdown
undefined

Feature: {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
undefined

Definition Template

定义模板

markdown
undefined
markdown
undefined

{Name}

{Name}

Summary

摘要

{One paragraph}
{一段描述}

Details

详情

{Full explanation}
{完整说明}

Examples

示例

{Examples}
{示例内容}

Related

相关链接

  • {Links}
undefined
  • {链接}
undefined

Rule Template

规则模板

markdown
undefined
markdown
undefined

Rule: {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/bash

create-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-mode

Naming Conventions

命名规范

Slug Format

Slug格式

All folder names use slug format:
RuleExample
Lowercase
user-auth
not
User-Auth
Hyphens for spaces
dark-mode
not
dark_mode
No special chars
oauth2
not
oauth2.0
Descriptive
steam-oauth-provider
not
sop
Under 30 charsKeep it readable
所有文件夹名称都使用slug格式:
规则示例
全小写
user-auth
而非
User-Auth
用连字符代替空格
dark-mode
而非
dark_mode
无特殊字符
oauth2
而非
oauth2.0
描述性强
steam-oauth-provider
而非
sop
长度不超过30字符保持可读性

Good Names

规范名称示例

docs/todo/pending/add-steam-oauth
docs/define/features/dark-mode-toggle
docs/rules/code/no-implicit-any
docs/todo/pending/add-steam-oauth
docs/define/features/dark-mode-toggle
docs/rules/code/no-implicit-any

Bad Names

不规范名称示例

docs/todo/pending/Add Steam OAuth          # Spaces, caps
docs/define/features/dark_mode_toggle      # Underscores
docs/rules/code/rule1                      # Not descriptive

docs/todo/pending/Add Steam OAuth          # 包含空格和大写字母
docs/define/features/dark_mode_toggle      # 使用下划线
docs/rules/code/rule1                      # 描述性不足

Validation

验证

After creating any document:
创建任何文档后:

Check Required Files

检查必填文件

bash
undefined
bash
undefined

Task

任务类型

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"
undefined
test -f docs/rules/{category}/{slug}/rule.md || echo "MISSING: rule.md" test -f docs/rules/{category}/{slug}/.enforced_by || echo "MISSING: .enforced_by"
undefined

Check Required Sections

检查必填章节

bash
undefined
bash
undefined

For 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

新功能创建流程

  1. Create feature definition
  2. Create mvp.md defining scope
  3. Create phase_0.md for initial work
  4. Create tasks for phase_0
bash
undefined
  1. 创建功能定义
  2. 创建mvp.md定义范围
  3. 创建phase_0.md记录初始工作
  4. 为phase_0创建对应任务
bash
undefined

1. 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

... 创建任务文档

undefined
undefined

New Rule Flow

新规则创建流程

  1. Identify pattern to standardize
  2. Create rule folder
  3. Write rule with examples
  4. Configure enforcement
  5. Announce to team
bash
undefined
  1. 确定需要标准化的模式
  2. 创建规则文件夹
  3. 编写规则及示例
  4. 配置执行方式
  5. 向团队公告
bash
undefined

1. 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

标记信息文件速查

SignalUsed ForContent
.version
AllJSON schema version
.priority
Taskscritical/high/medium/low
.enforced_by
RulesList of tools
.status
Definitionsdraft/review/approved
.created_at
AllISO timestamp
.created_by
AllAuthor name

标记文件适用类型内容
.version
所有类型JSON格式的 schema 版本
.priority
任务critical/high/medium/low
.enforced_by
规则执行工具列表
.status
定义draft/review/approved
.created_at
所有类型ISO时间戳
.created_by
所有类型作者名称

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占位符
  • 链接有效
  • 拼写/语法已检查
  • 已关联相关文档