Token导航 LogoToken导航

Agent Skill · 研究检索

doc-ctr-autopilot(文档 CTR 自动驾驶仪)

用于辅助文档、README、Markdown、说明文和内容稿件的整理与改写。它适合让 Agent 提炼结构、补齐章节、统一术语、检查链接或把零散材料整理成可读文档。使用时应保留项目已有事实、命令和路径,不要把未确认的信息写成确定结论;涉及对外文案时,还需要控制语气,避免过度营销或夸大能力。

doc-ctr-autopilot 是研究检索类 Agent Skill,可用宿主为 Codex、Claude、Cursor、Gemini CLI,通过GitHub 仓库获取,权限为调用外部服务;许可证信息还不明确,第三方扫描已通过,按安装量在研究检索类的 73,675 个 Skill 里排第 48,205。

总安装 699周安装 28GitHub Stars 14下载 226核验 2026-05-01

安装说明

本站只整理中文说明,不托管安装包,也不代用户安装。
GitHub
许可证
unknown

安装方式

通过对话安装

复制提示词发给支持本地命令或 Skills 的 AI 助手,先确认命令和权限,再让它执行。

请帮我安装这个 Agent Skill:doc-ctr-autopilot(文档 CTR 自动驾驶仪)
来源仓库:https://github.com/vladm3105/aidoc-flow-framework
仓库路径:skills/doc-ctr-autopilot
安装命令:
npx skills add https://github.com/vladm3105/aidoc-flow-framework --skill doc-ctr-autopilot
安装前请先检查当前环境是否支持对应 CLI,并向我确认将要执行的命令、安装目录、联网范围和文件读写权限;确认后再执行。

命令行安装

复制命令到本机终端执行。该命令会通过 npx skills 从第三方来源获取 Skill;本站只展示命令,不托管安装包,也不自动执行。

skills.shnpx skills
npx skills add https://github.com/vladm3105/aidoc-flow-framework --skill doc-ctr-autopilot

这个 Skill 是做什么的

研究检索类 Skill 主要解决「找资料、核对事实、把来源整理清楚」的问题,通常会让助手先检索再总结。

用于自动化生成数据合同文档,分析模块需求并处理REQ文件以输出双格式合同。适合在API或数据规范开发中自动生成结构化合同文档,支持Markdown与YAML格式。通过指定路径或IPLAN计划调用,优先使用--iplan参数,自动处理上下游文档流转。

需确保上游REQ文档完整,避免在未确认信息时写入确定结论,适合技术文档场景。doc-ctr-autopilot 属于研究检索类 Skill,可作为该场景下的辅助能力补充。

来源仓库内路径:skills/doc-ctr-autopilot

上手步骤

4 步
  1. 1

    确认自己的宿主工具

    公开资料标注支持 Codex、Claude、Cursor、Gemini CLI;先确认自己用的是其中之一,再按对应工具的 Skills 目录放置。

  2. 2

    拿到安装命令

    可以直接复制的命令是 npx skills add https://github.com/vladm3105/aidoc-flow-framework --skill doc-ctr…;命令里的占位符换成自己的路径或密钥再执行。

  3. 3

    安装后重启宿主

    命令执行完要完全退出宿主工具再打开,让新装的 Skill 被重新扫描到,否则列表里可能看不到。

  4. 4

    按最小权限试用

    它需要调用外部服务,先在测试目录或测试账号里跑,确认没问题再放到正式项目。

常见问题

6 条

doc-ctr-autopilot 怎么安装?

在终端执行 npx skills add https://github.com/vladm3105/aidoc-flow-framework --skill doc-ctr-autopilot。装完完全退出宿主工具再打开,让它重新扫描本地 Skill。

doc-ctr-autopilot 支持哪些 AI 工具?

公开资料标注支持 Codex、Claude、Cursor、Gemini CLI。其他工具只要能读取本地 Skill 目录,一般也能手动放进去,但要自己确认触发方式是否一致。

doc-ctr-autopilot 需要什么权限?

权限级别是调用外部服务。该 Skill 可能调用第三方服务、云服务或外部模型 API,使用前需要确认账号、额度、数据发送范围和服务条款。

doc-ctr-autopilot 是免费的吗?

公开资料没有标注明确许可证,收费和商用限制都无法确认。正式使用前请到来源仓库核对授权说明。

doc-ctr-autopilot 用的人多吗?

公开数据是累计安装 699 次,近一周安装 28 次,下载 226 次,GitHub 14 星。这些数字来自第三方目录统计,只能当作热度参考,不代表质量或安全性。

doc-ctr-autopilot 安全吗?

第三方扫描结果为通过,但这只覆盖已知的静态检查项,不能替代自己读一遍源码和安装命令。

值得选的地方和要先想清楚的地方

值得选的地方

  • 同时适配 4 种工具,换客户端不用重新找替代品。
  • 第三方扫描已通过,常见的高风险行为没有命中。

先想清楚的地方

  • 许可证没有明确标注,能不能商用、能不能再分发都不确定。
  • 第三方目录整理,版本更新和行为细节以来源仓库为准。

适不适合你

更适合

  • 已经在用 Codex,想直接扩展它能力的人。
  • 需要处理研究检索类任务、又不想每次都手写提示词的人。

不太适合

  • 需要明确授权才能用到公司项目里的场景。
  • 需要厂商级技术支持和 SLA 的生产系统。

研究检索类 Skill 对比

6 个同类
Skill总安装GitHub 星权限许可证扫描
find-skills

寻找技能 · Codex、Claude

31,199,81316,486操作浏览器MIT有提醒
self-improving-agent

自我改进 Agent · OpenClaw

16,464,0023,396接触敏感数据MIT-0通过
soultrace

灵魂追踪 · Codex、Claude

7,588,94412需要联网未明确有提醒
self-improving

自我完善 · OpenClaw

6,829,2841,046需要联网MIT-0通过
microsoft-foundry

微软代工厂 · Codex、Claude

6,614,144764调用外部服务未明确有提醒
doc-ctr-autopilot

文档 CTR 自动驾驶仪 · 本页

69914调用外部服务未明确通过

按安装量取同分类前几名;数字来自第三方目录统计,只作热度参考,不代表质量结论。

SKILL.md 原文

doc-ctr-autopilot

Purpose

Automated Data Contracts (CTR) generation pipeline that first analyzes which modules require CTR documents, then processes REQ documents to generate dual-file contracts (markdown + YAML) with SPEC-Ready scoring.

Layer: 8 (Optional layer for API/data contracts)

Upstream: REQ (Layer 7) - Section 3 Interface Specifications, Section 4 Data Schemas

Downstream: SPEC (Layer 9), TSPEC (Layer 10), TASKS (Layer 11)


Input Contract (IPLAN-004 Standard)

  • Supported modes:

- --ref <path> - --prompt "<text>" - --iplan <path|IPLAN-NNN>

  • Precedence: --iplan > --ref > --prompt
  • IPLAN resolution order:

1. Use explicit file path when it exists 2. Resolve work_plans/IPLAN-NNN*.md 3. Resolve governance/plans/IPLAN-NNN*.md 4. If multiple matches exist, fail with disambiguation request

  • Merge conflict rule:

- Objective/scope conflicts between primary and supplemental sources are blocking and require user clarification.


Input Contract (IPLAN-004 Standard)

  • Supported modes:

- --ref <path> - --prompt "<text>" - --iplan <path|IPLAN-NNN>

  • Precedence: --iplan > --ref > --prompt
  • IPLAN resolution order:

1. Use explicit file path when it exists 2. Resolve work_plans/IPLAN-NNN*.md 3. Resolve governance/plans/IPLAN-NNN*.md 4. If multiple matches exist, fail with disambiguation request

  • Merge conflict rule:

- Objective/scope conflicts between primary and supplemental sources are blocking and require user clarification.


Skill Dependencies

SkillPurposePhase
doc-namingElement ID format (CTR.NN.xxxx, codes 16, 17, 20)All Phases
doc-req-validatorValidate REQ SPEC-Ready scorePhase 2
doc-ctrCTR creation rules, dual-file formatPhase 3
quality-advisorReal-time quality feedbackPhase 3
doc-ctr-validatorValidation with SPEC-Ready scoringPhase 4
doc-ctr-reviewerContent review, link validation, quality scoringPhase 5: Review
doc-ctr-fixerApply fixes from review report, create missing filesPhase 5: Fix

Document Type Contract (MANDATORY)

When generating CTR document instances, the autopilot MUST:

  1. Read instance_document_type from template:

- Source: ai_dev_ssd_flow/08_CTR/CTR-MVP-TEMPLATE.yaml - Field: metadata.instance_document_type: "ctr-document"

  1. Set document_type in generated document frontmatter: custom_fields: document_type: ctr-document # NOT "template" artifact_type: CTR layer: 8
  2. Validation: Generated documents MUST have document_type: ctr-document

- Templates have document_type: template - Instances have document_type: ctr-document - Schema validates both values

Error Handling: If instance_document_type is missing from template, default to ctr-document.


Smart Document Detection

The autopilot automatically determines the action based on the input document type.

Input Type Recognition

InputDetected AsAction
CTR-NNSelf typeReview existing CTR document
REQ-NNUpstream typeGenerate if missing, review if exists

Detection Algorithm

1. Parse input: Extract TYPE and NN from "{TYPE}-{NN}"
2. Determine action:
   - IF TYPE == "CTR": Review Mode
   - ELSE IF TYPE == "REQ": Generate/Find Mode
   - ELSE: Error (invalid type for this autopilot)
3. For Generate/Find Mode:
   - Check: Does CTR-{NN} exist in docs/08_CTR/?
   - IF exists: Switch to Review Mode for CTR-{NN}
   - ELSE: Proceed with Generation from REQ-{NN}

File Existence Check

# Check for nested folder structure (mandatory)
ls docs/08_CTR/CTR-{NN}_*/

Examples

# Review mode (same type - CTR input)
/doc-ctr-autopilot CTR-01           # Reviews existing CTR-01

# Generate/Find mode (upstream type - REQ input)
/doc-ctr-autopilot REQ-01           # Generates CTR-01 if missing, or reviews existing CTR-01

# Multiple inputs
/doc-ctr-autopilot REQ-01,REQ-02    # Generates/reviews CTR-01 and CTR-02
/doc-ctr-autopilot CTR-01,CTR-02    # Reviews CTR-01 and CTR-02

Action Determination Output

Input: REQ-01
├── Detected Type: REQ (upstream)
├── Expected CTR: CTR-01
├── CTR Exists: Yes → docs/08_CTR/CTR-01_f1_iam/
└── Action: REVIEW MODE - Running doc-ctr-reviewer on CTR-01

Input: REQ-05
├── Detected Type: REQ (upstream)
├── Expected CTR: CTR-05
├── CTR Exists: No
└── Action: GENERATE MODE - Creating CTR-05 from REQ-05

Input: CTR-03
├── Detected Type: CTR (self)
└── Action: REVIEW MODE - Running doc-ctr-reviewer on CTR-03

Workflow Overview

flowchart TD
    subgraph Phase0["Phase 0: CTR Requirement Analysis"]
        A0[Start] --> B0[Read All REQ Documents]
        B0 --> C0[Analyze Section 4: Interface Definition]
        C0 --> D0[Check CTR Requirement Criteria]
        D0 --> E0{Has External APIs?}
        E0 -->|Yes| F0[Mark: CTR REQUIRED]
        E0 -->|No| G0[Mark: CTR NOT REQUIRED]
        F0 --> H0[Generate CTR Requirement Matrix]
        G0 --> H0
        H0 --> I0[User Confirmation]
    end

    subgraph Phase1["Phase 1: REQ Analysis"]
        I0 --> A[Filter REQ by CTR Required]
        A --> B[Read CTR-Required REQ Documents]
        B --> C[Extract Section 3: Interface Specifications]
        C --> D[Extract Section 4: Data Schemas]
        D --> E[Identify Contract Candidates]
    end

    subgraph Phase2["Phase 2: CTR Readiness Check"]
        E --> F[Check REQ SPEC-Ready Score]
        F --> G{Score >= 90%?}
        G -->|No| H[Flag REQ Issues]
        H --> I{Auto-Fixable?}
        I -->|Yes| J[Fix REQ Issues]
        J --> F
        I -->|No| K[Abort - Manual Fix Required]
        G -->|Yes| L[Mark REQ Ready]
    end

    subgraph Phase3["Phase 3: CTR Generation"]
        L --> M[Generate CTR-NN.md]
        M --> N[Generate CTR-NN.yaml]
        N --> O[quality-advisor: Real-time Feedback]
        O --> P[Add Traceability Tags]
        P --> Q[Write Dual Files]
    end

    subgraph Phase4["Phase 4: CTR Validation"]
        Q --> R[Run doc-ctr-validator]
        R --> S{SPEC-Ready >= 90%?}
        S -->|No| T[Auto-Fix CTR Issues]
        T --> U[Re-validate CTR]
        U --> S
        S -->|Yes| V[Mark CTR Validated]
    end

    subgraph Phase5["Phase 5: Review & Fix Cycle"]
        V --> W[Run doc-ctr-reviewer]
        W --> W2{Score >= 90?}
        W2 -->|No| W3[Run doc-ctr-fixer]
        W3 --> W4{Iteration < Max?}
        W4 -->|Yes| W
        W4 -->|No| W5[Flag Manual Review]
        W2 -->|Yes| X[Verify Quality Checks]
        W5 --> X
        X --> Y[Update Traceability Matrix]
        Y --> Z[Generate Summary Report]
    end

    Z --> AA[Complete]
    K --> AB[Exit with Error]

Detailed Workflow

Phase 0: CTR Requirement Analysis (MANDATORY FIRST STEP)

Determine which REQ documents require CTR (Data Contracts) generation.

IMPORTANT: Not all modules need CTR documents. CTR is only required for modules with external-facing APIs or contracts.

CTR Requirement Criteria
CriterionDetection MethodCTR Required?
REST API EndpointsSection 4 contains Endpoint: or HTTP methods with /api/ paths✅ YES
SSE/Streaming APIsSection 4 contains SSE, streaming, or /chat endpoints✅ YES
Webhook ContractsSection 4 contains webhook configurations or /webhooks/✅ YES
A2A GatewaySection 4 contains /a2a/ or agent-to-agent protocols✅ YES
External IntegrationSection 4 references external service contracts✅ YES
Internal Protocol OnlySection 3.4 has Python Protocol, no HTTP endpoints❌ NO
Infrastructure OnlyNo client-facing APIs, internal infrastructure❌ NO
Prometheus /metricsOnly /metrics endpoint (standard Prometheus format)❌ NO
Frontend ConsumerConsumes APIs but doesn't define backend APIs❌ NO
Internal MiddlewareSecurity/validation middleware, no external API❌ NO
CTR Requirement Keywords (Detection Patterns)

POSITIVE Indicators (CTR Required):

# REST API patterns
Endpoint:\s*(POST|GET|PUT|DELETE|PATCH)
(POST|GET|PUT|DELETE|PATCH)\s+/api/
/api/v[0-9]+/

# Streaming patterns
SSE|Server-Sent Events
/chat|/stream
EventSource|text/event-stream

# Webhook patterns
/webhooks/
webhook.*configuration
webhook.*endpoint

# Contract patterns
OpenAPI|openapi:
Request:|Response:
Response \(Success\):|Response \(Error\):

NEGATIVE Indicators (CTR NOT Required):

# Internal only
internal only|internal interface|internal use
consumed by|consumer of

# Standard endpoints (no contract needed)
/metrics|/health|/ready|/live

# Infrastructure
infrastructure platform|internal platform
repository pattern|storage layer

# Middleware
middleware|security layer|validation layer
Phase 0 Execution Steps
  1. Read All REQ Documents # Read docs/07_REQ/REQ-*.md files
  2. For Each REQ Document, Check:

- Does Section 4 (Interface Definition) contain HTTP endpoints? - Does Section 4.1 (API Contract) define request/response formats? - Are there external-facing API surfaces?

  1. Generate CTR Requirement Matrix:
## CTR Requirement Analysis Matrix

| REQ ID | Module | Has External API? | Key Indicators | CTR Required? |
|--------|--------|-------------------|----------------|---------------|
| REQ-01 | F1 IAM | ✅ | `POST /api/v1/auth/login`, `POST /api/v1/auth/refresh` | ✅ YES |
| REQ-02 | F2 Session | ✅ | `POST /api/v1/sessions`, session management endpoints | ✅ YES |
| REQ-03 | F3 Observability | ❌ | Only `/metrics` (Prometheus standard) | ❌ NO |
| REQ-04 | F4 SecOps | ❌ | Internal security operations, audit APIs internal | ❌ NO |
| REQ-05 | F5 SelfOps | ❌ | Internal automation, health checks internal | ❌ NO |
| REQ-06 | F6 Infrastructure | ❌ | Internal infrastructure platform | ❌ NO |
| REQ-07 | F7 Config | ❌ | Internal configuration management | ❌ NO |
| REQ-08 | D1 Agent Orch | ✅ | AG-UI SSE `/api/v1/chat`, streaming protocol | ✅ YES |
| REQ-09 | D2 Cost Analytics | ✅ | `/api/v1/costs/*` query endpoints | ✅ YES |
| REQ-10 | D3 User Experience | ❌ | Frontend - consumes APIs, no backend | ❌ NO |
| REQ-11 | D4 Multi-Cloud | ❌ | Internal cloud integration layer | ❌ NO |
| REQ-12 | D5 Data Persistence | ❌ | Internal storage, repository pattern | ❌ NO |
| REQ-13 | D6 REST APIs | ✅ | Primary API gateway, all external endpoints | ✅ YES |
| REQ-14 | D7 Security | ❌ | Internal security middleware | ❌ NO |
  1. Present Summary and Request Confirmation:
## Phase 0 Complete: CTR Requirement Analysis

### Modules Requiring CTR (External APIs)

| CTR ID | Source REQ | Module | Key API Surfaces |
|--------|------------|--------|------------------|
| CTR-01 | REQ-01 | F1 IAM | Authentication, token refresh, session APIs |
| CTR-02 | REQ-02 | F2 Session | Session CRUD, context management |
| CTR-08 | REQ-08 | D1 Agent Orch | AG-UI SSE streaming, chat endpoints |
| CTR-09 | REQ-09 | D2 Cost Analytics | Cost query, breakdown, forecast endpoints |
| CTR-13 | REQ-13 | D6 REST APIs | Full API gateway (aggregates all endpoints) |

### Modules NOT Requiring CTR (Internal Only)

| REQ ID | Module | Reason |
|--------|--------|--------|
| REQ-03 | F3 Observability | Prometheus /metrics only (standard format) |
| REQ-04 | F4 SecOps | Internal security operations |
| REQ-05 | F5 SelfOps | Internal automation |
| REQ-06 | F6 Infrastructure | Internal platform |
| REQ-07 | F7 Config | Internal configuration |
| REQ-10 | D3 User Experience | Frontend consumer |
| REQ-11 | D4 Multi-Cloud | Internal integration |
| REQ-12 | D5 Data Persistence | Internal storage |
| REQ-14 | D7 Security | Internal middleware |

### Summary
- **CTR Required**: 5 modules
- **CTR Not Required**: 9 modules
- **Total CTR Documents to Generate**: 5 (dual-file: 10 files total)

Proceed with CTR generation for 5 modules? [Y/n]

Phase 1: REQ Analysis

Extract interface and data schema information from CTR-required REQ documents only.

REQ Sections to Extract:

REQ SectionContentCTR Element
Section 3.4: Interface ProtocolPython Protocol interfacesReference only
Section 4.1: API ContractHTTP endpoints, request/responseCTR.NN.16.SS (Interface)
Section 4.2: Data SchemaPydantic models, JSON SchemaCTR.NN.17.SS (Data Model)
Section 5: Error HandlingError responses, RFC 7807CTR.NN.20.SS (Contract Clause)

Phase 2: CTR Readiness Check

Validate that source REQ documents meet quality thresholds.

Validation Criteria:

  • REQ SPEC-Ready Score ≥ 90%
  • REQ CTR-Ready Score ≥ 90%
  • Section 4 (Interface Definition) complete
  • Error catalog defined in Section 5

Phase 3: CTR Generation

Generate dual-file contracts for each CTR-required module.

Dual-File Structure (ALWAYS use nested folders):

docs/08_CTR/
├── CTR-01_f1_iam_api/
│   ├── CTR-01_f1_iam_api.md         # Documentation file
│   ├── CTR-01_f1_iam_api.yaml       # OpenAPI specification
│   ├── CTR-01.R_review_report_v001.md
│   ├── CTR-01.F_fix_report_v001.md
│   └── .drift_cache.json
├── CTR-02_f2_session_api/
│   ├── CTR-02_f2_session_api.md
│   └── CTR-02_f2_session_api.yaml
├── CTR-08_d1_agent_api/
│   ├── CTR-08_d1_agent_api.md
│   └── CTR-08_d1_agent_api.yaml
└── ...

Nested Folder Rule: ALL CTRs use nested folders (CTR-NN_{slug}/) regardless of size. This keeps dual files (.md +.yaml) and companion files (review reports, fix reports, drift cache) organized together.

Markdown File Structure (CTR-NN_{slug}.md):

  • Document Control
  • Contract Overview
  • Business Context
  • Interface Documentation
  • Usage Examples
  • Error Handling
  • Traceability

YAML File Structure (CTR-NN_{slug}.yaml):

openapi: "3.0.3"
info:
  title: "Contract Title"
  version: "1.0.0"
  description: "Contract description"
  contact:
    name: "API Team"
servers:
  - url: "https://api.example.com/v1"
paths:
  /api/v1/resource:
    get:
      operationId: getResource
      summary: "Get resource"
      security:
        - bearerAuth: []
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ResourceModel'
        '401':
          $ref: '#/components/responses/Unauthorized'
components:
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT
  schemas:
    ResourceModel:
      type: object
      properties: {}
  responses:
    Unauthorized:
      description: Authentication required
      content:
        application/problem+json:
          schema:
            $ref: '#/components/schemas/ProblemDetails'

Cumulative Tags (7 Required)

@brd: BRD-NN
@prd: PRD-NN
@ears: EARS-NN
@bdd: BDD-NN
@adr: ADR-NN
@sys: SYS-NN
@req: REQ-NN

Phase 4: CTR Validation

Run doc-ctr-validator on each generated CTR document.

Validation Criteria:

  • SPEC-Ready Score ≥ 90%
  • OpenAPI schema valid
  • All endpoints documented
  • Error responses complete
  • Security schemes defined

Phase 5: Review & Fix Cycle (v2.3)

Iterative review and fix cycle to ensure CTR quality before completion.

flowchart TD
    A[Phase 5 Start] --> B[Run doc-ctr-reviewer]
    B --> C[Generate Review Report]
    C --> D{Review Score >= 90?}

    D -->|Yes| E[PASS - Proceed to Phase 6]
    D -->|No| F{Iteration < Max?}

    F -->|Yes| G[Run doc-ctr-fixer]
    G --> H[Apply Fixes]
    H --> I[Generate Fix Report]
    I --> J[Increment Iteration]
    J --> B

    F -->|No| K[Flag for Manual Review]
    K --> L[Generate Final Report with Remaining Issues]
    L --> E
5.1 Initial Review

Run doc-ctr-reviewer to identify issues.

/doc-ctr-reviewer CTR-NN

Output: CTR-NN.R_review_report_v001.md

5.2 Fix Cycle

If review score < 90%, invoke doc-ctr-fixer.

/doc-ctr-fixer CTR-NN --revalidate

Fix Categories:

CategoryFixes Applied
Missing FilesCreate glossary, reference docs
Broken LinksUpdate paths, create targets
Element IDsConvert legacy patterns, fix invalid type codes
OpenAPIFix schema references, add missing responses
Dual-File SyncSynchronize MD and YAML content
TraceabilityUpdate cumulative tags

Output: CTR-NN.F_fix_report_v001.md

5.3 Re-Review

After fixes, automatically re-run reviewer.

/doc-ctr-reviewer CTR-NN

Output: CTR-NN.R_review_report_v002.md

5.4 Iteration Control
ParameterDefaultDescription
max_iterations3Maximum fix-review cycles
target_score90Minimum passing score
stop_on_manualfalseStop if only manual issues remain

Iteration Example:

Iteration 1:
  Review v001: Score 85 (2 errors, 4 warnings)
  Fix v001: Fixed 5 issues, created 1 file

Iteration 2:
  Review v002: Score 94 (0 errors, 2 warnings)
  Status: PASS (score >= 90)
5.5 Quality Checks (Post-Fix)

After passing the fix cycle:

  1. Dual-File Consistency:

- MD and YAML files synchronized - All endpoints documented in both files - Schema definitions match

  1. OpenAPI Compliance:

- Valid OpenAPI 3.0.3 schema - All operations have operationId - Error responses complete (401, 403, 500)

  1. Element ID Compliance (per doc-naming skill):

- All IDs use CTR.NN.xxxx format - Element type codes valid for CTR (16, 17, 20) - No legacy patterns (IF-XXX, DM-XXX, CC-XXX)

  1. SPEC-Ready Report: SPEC-Ready Score Breakdown ========================= OpenAPI Validity: 25/25 Schema Completeness: 18/20 Error Responses: 15/15 Security Schemes: 15/15 Dual-File Consistency: 10/10 Traceability (7 tags): 10/10 Element IDs: 5/5 ---------------------------- Total SPEC-Ready Score: 98/100 (Target: >= 90) Status: READY FOR SPEC GENERATION
  2. Traceability Matrix Update: # Update CTR traceability python ai_dev_flow/scripts/update_traceability_matrix.py \ --ctr docs/08_CTR/CTR-NN_{slug}.md \ --matrix docs/08_CTR/CTR-00_TRACEABILITY_MATRIX.md

Element Type Codes

CodeElement TypeExample
16InterfaceCTR.01.1601
17Data ModelCTR.01.1701
20Contract ClauseCTR.01.2001

Configuration

Default Configuration

ctr_autopilot:
  version: "2.0"

  phase0:
    enabled: true  # Always analyze CTR requirements first
    user_confirmation: true  # Pause for user approval

  scoring:
    spec_ready_min: 90
    ctr_ready_min: 90
    strict_mode: false

  execution:
    max_parallel: 3        # HARD LIMIT - do not exceed
    chunk_size: 3          # Documents per chunk
    pause_between_chunks: true
    auto_fix: true
    continue_on_error: false
    timeout_per_req: 180  # seconds

  output:
    dual_file: true  # md + yaml
    report_format: markdown

  validation:
    skip_validation: false
    fix_iterations_max: 3

Context Management

Chunked Parallel Execution (MANDATORY)

CRITICAL: To prevent conversation context overflow errors ("Prompt is too long", "Conversation too long"), all autopilot operations MUST follow chunked execution rules:

Chunk Size Limit: Maximum 3 documents per chunk

Chunking Rules:

  1. Chunk Formation: Group CTR-required modules into chunks of maximum 3 at a time
  2. Sequential Chunk Processing: Process one chunk at a time, completing all documents in a chunk before starting the next
  3. Context Pause: After completing each chunk, provide a summary and pause for user acknowledgment
  4. Progress Tracking: Display chunk progress (e.g., "Chunk 2/2: Processing CTR-08, CTR-09, CTR-13...")

Why Chunking is Required:

  • Prevents "Conversation too long" errors during batch processing
  • Allows context compaction between chunks
  • Enables recovery from failures without losing all progress
  • Provides natural checkpoints for user review

Chunk Completion Template:

## Chunk N/M Complete

Generated:
- CTR-XX: SPEC-Ready Score 94% (md + yaml)
- CTR-YY: SPEC-Ready Score 92% (md + yaml)
- CTR-ZZ: SPEC-Ready Score 95% (md + yaml)

Proceeding to next chunk...

Command Usage

Analyze CTR Requirements Only

/doc-ctr-autopilot --analyze

Runs Phase 0 only, outputs CTR Requirement Matrix without generating files.

Generate CTR for Specific Modules

/doc-ctr-autopilot REQ-01 REQ-13

Generates CTR for specified REQ documents (skips Phase 0 analysis for these).

Generate All Required CTR

/doc-ctr-autopilot --all

Runs full workflow: Phase 0 analysis → user confirmation → generate all CTR-required modules.

Skip Phase 0 (Force Generate)

/doc-ctr-autopilot --all --skip-analysis

Skip Phase 0 and generate CTR for ALL REQ documents (not recommended).

Dry Run Mode

/doc-ctr-autopilot --all --dry-run

Preview execution plan without generating or modifying files.


Review Mode

Validate existing CTR documents and generate quality reports without modification.

Review Mode Command

/doc-ctr-autopilot --review docs/08_CTR/

Review Mode Process

flowchart TD
    A[Start Review] --> B[Scan CTR Directory]
    B --> C[Identify Dual-File Pairs]
    C --> D{For Each Pair}
    D --> E[Validate MD Structure]
    E --> F[Validate YAML/OpenAPI]
    F --> G[Check Consistency]
    G --> H[Calculate SPEC-Ready]
    H --> I[Categorize Issues]
    I --> J{More Pairs?}
    J -->|Yes| D
    J -->|No| K[Generate Report]
    K --> L[Complete]

Review Mode Output

No files modified - Read-only analysis with detailed report.

Review Report Template
## CTR Review Report

**Generated**: YYYY-MM-DD HH:MM:SS
**Mode**: Review (Read-Only)
**Scope**: docs/08_CTR/

### Document Summary

| CTR ID | Module | MD | YAML | Consistency | SPEC-Ready | Status |
|--------|--------|---|----|-------------|------------|--------|
| CTR-01 | F1 IAM | ✅ | ✅ | ✅ | 94% ✅ | Passed |
| CTR-02 | F2 Session | ✅ | 🟡 | 🟡 | 87% 🟡 | Needs Review |
| CTR-08 | D1 Agent | ✅ | ❌ | ❌ | 72% ❌ | Failed |
| CTR-09 | D2 Cost | ✅ | ✅ | ✅ | 92% ✅ | Passed |
| CTR-13 | D6 Gateway | ✅ | ✅ | ✅ | 95% ✅ | Passed |

### Score Breakdown (Aggregate)

| Component | Weight | Score | Status |
|-----------|--------|-------|--------|
| OpenAPI Validity | 25% | 23/25 | ✅ |
| Schema Completeness | 20% | 18/20 | ✅ |
| Error Responses | 15% | 12/15 | 🟡 |
| Security Schemes | 15% | 15/15 | ✅ |
| Dual-File Consistency | 10% | 8/10 | 🟡 |
| Traceability (7 tags) | 10% | 9/10 | ✅ |
| Element IDs | 5% | 5/5 | ✅ |
| **Total** | **100%** | **90/100** | **✅** |

### Issues Detected

#### Auto-Fixable Issues
| CTR | Issue | Fix Action |
|-----|-------|------------|
| CTR-02 | Missing @ears tag | Add placeholder reference |
| CTR-02 | YAML schema $ref mismatch | Sync with MD definitions |
| CTR-08 | Invalid OpenAPI operationId | Generate from path |
| CTR-08 | Missing 401 response | Add from error template |

#### Manual Review Required
| CTR | Issue | Reason |
|-----|-------|--------|
| CTR-08 | Incomplete streaming spec | Business logic unclear |
| CTR-08 | Missing SSE event types | Requires domain knowledge |

### Recommendations

1. Run Fix Mode to auto-repair 4 issues
2. Manual review needed for CTR-08 streaming specification
3. Consider regenerating CTR-08 from REQ-08

### Fix Mode Command

To auto-fix detected issues:
\`\`\`bash
/doc-ctr-autopilot --fix docs/08_CTR/
\`\`\`

Review Configuration

review_mode:
  enabled: true
  scope: directory  # single, directory, all
  report_output: tmp/ctr_review_report.md
  checks:
    openapi_validation: true
    schema_completeness: true
    error_responses: true
    security_schemes: true
    dual_file_consistency: true
    traceability: true
    element_ids: true
  thresholds:
    pass: 90
    warning: 85
    fail: 0

Review Command Options

OptionDefaultDescription
--review-Enable review mode (required)
--reporttmp/ctr_review_report.mdOutput report path
--formatmarkdownReport format (markdown, json)
--verbosefalseInclude detailed issue descriptions
--check-openapitrueValidate OpenAPI schema
--check-consistencytrueVerify md ↔ yaml sync

Fix Mode

Auto-repair existing CTR documents while preserving manually-created content.

Fix Mode Command

/doc-ctr-autopilot --fix docs/08_CTR/

Fix Mode Process

flowchart TD
    A[Start Fix] --> B[Run Review First]
    B --> C[Identify Fixable Issues]
    C --> D[Create Backups]
    D --> E{For Each Issue}
    E --> F{Issue Type?}
    F -->|openapi| G[Fix OpenAPI Schema]
    F -->|consistency| H[Sync MD ↔ YAML]
    F -->|element_ids| I[Migrate Legacy IDs]
    F -->|traceability| J[Add Missing Tags]
    F -->|sections| K[Add Missing Sections]
    F -->|responses| L[Add Error Responses]
    G --> M[Apply Fix]
    H --> M
    I --> M
    J --> M
    K --> M
    L --> M
    M --> N{More Issues?}
    N -->|Yes| E
    N -->|No| O[Re-validate]
    O --> P[Generate Fix Report]
    P --> Q[Complete]

Fix Categories

CategoryFixes AppliedRisk Level
openapiMissing operationId, invalid $refs, schema errorsLow
consistencyMD ↔ YAML endpoint mismatch, schema syncLow
element_idsCTR_XXX → CTR.NN.xxxx formatLow
traceabilityAdd missing cumulative tags (7 required)Low
sectionsAdd missing document sections from templateLow
responsesAdd standard error responses (401, 403, 500)Low
securityAdd missing security schemesMedium
pathsStandardize path naming conventionsMedium

Content Preservation Rules

NEVER Modified:

  • Manually written endpoint descriptions
  • Custom schema properties
  • Business-specific error messages
  • Existing operationIds (unless invalid)
  • Custom security scheme configurations
  • API versioning in paths

Always Preserved:

  • Existing endpoint definitions
  • Custom schema validators
  • Response examples
  • Manually added headers
  • Custom component definitions

Element ID Migration

Legacy patterns are converted to unified format:

Legacy PatternNew FormatExample
IF-XXXCTR.NN.16.SSIF-001 → CTR.01.1601
DM-XXXCTR.NN.17.SSDM-003 → CTR.01.1703
CC-XXXCTR.NN.20.SSCC-005 → CTR.01.2005
CTR_XXXCTR.NN.xxxxCTR_001 → CTR.01.1601

Dual-File Consistency Fixes

IssueAuto-Fix Action
Endpoint in MD not in YAMLAdd path stub to YAML
Endpoint in YAML not in MDAdd documentation to MD
Schema mismatchSync YAML schema to MD definitions
Response code mismatchAdd missing responses to YAML
Security scheme mismatchSync security definitions

OpenAPI Auto-Fixes

IssueFix Applied
Missing operationIdGenerate from HTTP method + path
Invalid $refCorrect path to components/schemas
Missing 401 responseAdd from standard template
Missing 500 responseAdd RFC 7807 ProblemDetails
Empty descriptionCopy from MD section
Missing tagsGenerate from path prefix

Fix Report Template

## CTR Fix Report

**Generated**: YYYY-MM-DD HH:MM:SS
**Mode**: Fix (Auto-Repair)
**Scope**: docs/08_CTR/

### Backup Created
Location: `tmp/ctr_backup_YYYYMMDD_HHMMSS/`

### Fixes Applied

| CTR | Category | Issue | Fix Applied | Result |
|-----|----------|-------|-------------|--------|
| CTR-02 | traceability | Missing @ears | Added @ears: EARS.02.2501 | ✅ |
| CTR-02 | consistency | Schema mismatch | Synced SessionModel | ✅ |
| CTR-08 | openapi | Missing operationId | Added getChatStream | ✅ |
| CTR-08 | responses | Missing 401 | Added Unauthorized | ✅ |
| CTR-08 | element_ids | IF-001 format | → CTR.08.1601 | ✅ |

### Before/After Scores

| CTR | Before | After | Change |
|-----|--------|-------|--------|
| CTR-02 | 87% | 94% | +7% ✅ |
| CTR-08 | 72% | 91% | +19% ✅ |

### Issues Requiring Manual Review

| CTR | Issue | Reason |
|-----|-------|--------|
| CTR-08 | SSE event type definitions | Requires business input |
| CTR-08 | Streaming protocol details | Domain-specific |

### Summary
- **Total Issues Detected**: 7
- **Auto-Fixed**: 5
- **Manual Review Required**: 2
- **Documents Modified**: 2 (CTR-02, CTR-08)
- **Documents Unchanged**: 3 (passed validation)

Fix Configuration

fix_mode:
  enabled: true
  create_backup: true  # Always backup before fix
  backup_location: tmp/ctr_backup_{timestamp}/
  categories:
    openapi: true
    consistency: true
    element_ids: true
    traceability: true
    sections: true
    responses: true
    security: false  # Requires review - medium risk
    paths: false     # Requires review - medium risk
  max_iterations: 3
  dry_run: false
  preserve_content: true

Fix Command Options

OptionDefaultDescription
--fix-Enable fix mode (required)
--backuptrueCreate backup before fixing
--categoryallSpecific fix category
--dry-runfalsePreview fixes without applying
--max-iter3Maximum fix iterations
--reporttmp/ctr_fix_report.mdOutput report path
--preservetruePreserve existing content
--forcefalseApply medium-risk fixes

Fix Mode Examples

# Fix all auto-fixable issues
/doc-ctr-autopilot --fix docs/08_CTR/

# Fix specific CTR document
/doc-ctr-autopilot --fix docs/08_CTR/CTR-08_d1_agent_api.md

# Preview fixes without applying
/doc-ctr-autopilot --fix docs/08_CTR/ --dry-run

# Fix only OpenAPI issues
/doc-ctr-autopilot --fix docs/08_CTR/ --category openapi

# Fix with force (includes medium-risk fixes)
/doc-ctr-autopilot --fix docs/08_CTR/ --force

# Fix and regenerate if needed
/doc-ctr-autopilot --fix docs/08_CTR/ --regenerate-on-fail

Related Resources

  • CTR Skill: .claude/skills/doc-ctr/SKILL.md
  • CTR Validator: .claude/skills/doc-ctr-validator/SKILL.md
  • Naming Standards: .claude/skills/doc-naming/SKILL.md
  • Quality Advisor: .claude/skills/quality-advisor/SKILL.md
  • CTR Template: ai_dev_ssd_flow/08_CTR/CTR-MVP-TEMPLATE.md

Review Document Standards (v2.2)

Review reports generated by this skill are formal project documents and MUST comply with shared standards.

Reference: See REVIEW_DOCUMENT_STANDARDS.md in the skills directory for complete requirements.

Key Requirements:

  1. Storage Location: Same folder as the reviewed CTR document
  2. File Naming: CTR-NN.R_review_report.md
  3. YAML Frontmatter: Required with artifact_type: CTR-REVIEW, layer: 8
  4. Score Field: spec_ready_score_claimed / spec_ready_score_validated
  5. Parent Reference: Must link to parent CTR document

Example Location:

docs/08_CTR/CTR-03-001_provider_api/
├── CTR-03-001.md
├── CTR-03-001.yaml
└── CTR-03-001.R_review_report.md    # ← Review stored here

Version History

VersionDateChanges
2.42026-02-11Smart Document Detection: Added automatic document type recognition; Self-type input (CTR-NN) triggers review mode; Upstream-type input (REQ-NN) triggers generate-if-missing or find-and-review; Updated input patterns table with type-based actions
2.32026-02-10Review & Fix Cycle: Replaced Phase 5 with iterative Review -> Fix cycle using doc-ctr-reviewer and doc-ctr-fixer; Added doc-ctr-fixer skill dependency; Added iteration control (max 3 cycles); Added quality checks (dual-file consistency, OpenAPI compliance, element ID compliance, SPEC-Ready report); Added traceability matrix update step
2.22026-02-10Added Review Document Standards section; Review reports now stored alongside reviewed documents with proper YAML frontmatter and parent references
2.12026-02-09Added Review Mode (read-only validation with dual-file consistency checks); Added Fix Mode (auto-repair with OpenAPI validation, element ID migration, traceability fixes); Added backup/restore capability; Content preservation rules
2.02026-02-09Added Phase 0: CTR Requirement Analysis; Added detection criteria for external APIs; Added user confirmation step; Renumbered phases; Added command options
1.02026-02-08Initial skill creation with 5-phase workflow; Integrated doc-naming, doc-ctr, quality-advisor, doc-ctr-validator

平台分布

Codex

38.8%
按下载量换算88

Claude

29.51%
按下载量换算67

Cursor

19.71%
按下载量换算45

Gemini CLI

9.4%
按下载量换算21

安全审计

Gen Agent Trust Hub

通过

Socket

通过

Snyk

通过

权限和风险

调用外部服务

该 Skill 可能调用第三方服务、云服务或外部模型 API,使用前需要确认账号、额度、数据发送范围和服务条款。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。目前只有一个公开来源,建议同时核对源仓库。

继续浏览同类 Skills