Token导航 LogoToken导航TokenDH.com
前端设计external-servicegithub未标认证来源可访问许可证需确认审计异常

doc-ctr-reviewer文档 CTR 审稿人

Agent Skill

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

总安装

710

周安装

29

GitHub Stars

14

下载量

230
CodexClaudeCursorGemini CLI

安装说明

本站只整理中文说明和来源信息,不托管安装包,也不代用户安装。

GitHub

来源数

2

许可证

unknown

最后核验

2026-05-01

来源状态

来源可访问

安装方式

通过对话安装

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

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

命令行安装

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

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

简介

用于全面审查数据合同文档的内容质量与合规性。

  • 适合检查合同完整性、双文件格式一致性、OpenAPI兼容性及REQ对齐情况。
  • 在doc-ctr-autopilot完成后立即运行,作为最终质量保障环节。
  • 需保留项目原始事实,不擅自改写命令或路径,避免误导性结论。
  • doc-ctr-reviewer 属于前端设计类 Skill,可作为该场景下的辅助能力补充。

SKILL.md

doc-ctr-reviewer

Purpose

Comprehensive content review and quality assurance for Data Contract (CTR) documents. This skill performs deep content analysis beyond structural validation, checking contract completeness, dual-file consistency (MD + YAML), OpenAPI compliance, REQ alignment, and identifying issues that require manual review.

Layer: 8 (CTR Quality Assurance)

Upstream: CTR (from doc-ctr-autopilot or doc-ctr)

Downstream: None (final QA gate before SPEC generation)


When to Use This Skill

Use doc-ctr-reviewer when:

  • After CTR Generation: Run immediately after doc-ctr-autopilot completes
  • Manual CTR Edits: After making manual changes to CTR
  • Pre-SPEC Check: Before running doc-spec-autopilot
  • API Changes: When external APIs are modified
  • Periodic Review: Regular quality checks on existing CTRs

Do NOT use when:

  • CTR does not exist yet (use doc-ctr or doc-ctr-autopilot first)
  • Need structural/schema validation only (use doc-ctr-validator)
  • Generating new CTR content (use doc-ctr)

Skill vs Validator: Key Differences

Aspectdoc-ctr-validatordoc-ctr-reviewer
FocusSchema compliance, SPEC-Ready scoreContent quality, API consistency
ChecksRequired sections, OpenAPI schemaDual-file sync, endpoint coverage
Auto-FixStructural issues onlyContent issues (sync, formatting)
OutputSPEC-Ready score (numeric)Review score + issue list
PhasePhase 4 (Validation)Phase 5 (Final Review)
BlockingSPEC-Ready < threshold blocksReview score < threshold flags

Review Workflow

flowchart TD
    A[Input: CTR Path] --> B[Load CTR Files]
    B --> C{MD + YAML Present?}

    C -->|Both| D[Load Both Files]
    C -->|Single| E[Load Available File]

    D --> F[Run Review Checks]
    E --> F

    subgraph Review["Review Checks"]
        F --> G[1. Dual-File Consistency]
        G --> H[2. OpenAPI Compliance]
        H --> I[3. REQ Alignment]
        I --> J[4. Endpoint Coverage]
        J --> K[5. Security Definition]
        K --> L[6. Placeholder Detection]
        L --> M[7. Naming Compliance]
        M --> M2[8. Upstream Drift Detection]
    end

    M2 --> N{Issues Found?}
    N -->|Yes| O[Categorize Issues]
    O --> P{Auto-Fixable?}
    P -->|Yes| Q[Apply Auto-Fixes]
    Q --> R[Re-run Affected Checks]
    P -->|No| S[Flag for Manual Review]
    R --> N
    S --> T[Generate Report]
    N -->|No| T
    T --> U[Calculate Review Score]
    U --> V{Score >= Threshold?}
    V -->|Yes| W[PASS]
    V -->|No| X[FAIL with Details]

Review Checks

0. Structure Compliance (12/12) - BLOCKING

Validates CTR follows the mandatory nested folder rule.

Nested Folder Rule: ALL CTR documents MUST be in nested folders.

Required Structure:

CTR TypeRequired Location
Dual-Filedocs/08_CTR/CTR-NN_{slug}/CTR-NN_{slug}.md + .yaml

Error Codes:

CodeSeverityDescription
REV-STR001ErrorCTR not in nested folder (BLOCKING)
REV-STR002ErrorFolder name doesn't match CTR ID
REV-STR003WarningFile name doesn't match folder name

This check is BLOCKING - CTR must pass structure validation before other checks proceed.


1. Dual-File Consistency

Validates MD and YAML files are synchronized.

Scope:

  • Endpoint definitions match
  • Schema definitions aligned
  • Version numbers consistent
  • Descriptions synchronized

Error Codes:

CodeSeverityDescription
REV-DF001ErrorEndpoint in YAML not in MD
REV-DF002ErrorSchema mismatch between files
REV-DF003WarningVersion number inconsistent
REV-DF004InfoDescription differs (may be intentional)

2. OpenAPI Compliance

Validates YAML follows OpenAPI 3.x specification.

Scope:

  • Valid OpenAPI version
  • Required fields present
  • Schema types correct
  • Response codes documented

Error Codes:

CodeSeverityDescription
REV-OA001ErrorInvalid OpenAPI version
REV-OA002ErrorRequired OpenAPI field missing
REV-OA003ErrorInvalid schema type
REV-OA004WarningResponse code not documented
REV-OA005InfoExample values missing

3. REQ Alignment

Validates CTR traces to REQ requirements.

Scope:

  • Every endpoint maps to REQ
  • External API requirements covered
  • Interface contracts complete

Error Codes:

CodeSeverityDescription
REV-RA001ErrorEndpoint without REQ source
REV-RA002WarningREQ interface not in CTR
REV-RA003InfoMultiple CTRs from single REQ (acceptable)

4. Endpoint Coverage

Validates all expected endpoints documented.

Scope:

  • CRUD operations complete
  • Error endpoints defined
  • Health check endpoints present
  • Versioning strategy documented

Error Codes:

CodeSeverityDescription
REV-EC001WarningMissing CRUD operation
REV-EC002WarningNo error endpoint defined
REV-EC003InfoHealth check endpoint missing
REV-EC004InfoAPI versioning not documented

5. Security Definition

Validates security schemes documented.

Scope:

  • Authentication method defined
  • Authorization scopes documented
  • Security schemes in OpenAPI
  • Rate limiting documented

Error Codes:

CodeSeverityDescription
REV-SD001ErrorNo security scheme defined
REV-SD002WarningAuthorization scopes missing
REV-SD003WarningRate limiting not documented
REV-SD004InfoSecurity examples missing

6. Placeholder Detection

Identifies incomplete content requiring replacement.

Error Codes:

CodeSeverityDescription
REV-P001Error[TODO] placeholder found
REV-P002Error[TBD] placeholder found
REV-P003WarningTemplate value not replaced

7. Naming Compliance

Validates element IDs follow doc-naming standards.

Scope:

  • Element IDs use CTR.NN.xxxx format
  • Element type codes valid for CTR (16, 17, 20)
  • Contract naming convention

Error Codes:

CodeSeverityDescription
REV-N001ErrorInvalid element ID format
REV-N002ErrorElement type code not valid for CTR
REV-N003ErrorLegacy pattern detected

8. Upstream Drift Detection (Mandatory Cache)

Detects when upstream REQ documents have been modified after the CTR was created or last updated.

The drift cache is mandatory. All CTR reviewer operations must maintain the drift cache to enable reliable change detection across sessions.

Purpose: Identifies stale CTR content that may not reflect current REQ documentation. When REQ documents (interface requirements, external API specifications) change, the CTR may need updates to maintain alignment.

Scope:

  • @req: tag targets (REQ documents)
  • Traceability section upstream artifact links
  • Any markdown links to ../07_REQ/ or REQ source documents

Drift Cache File (MANDATORY)

Location: docs/08_CTR/.drift_cache.json

Schema:

{
  "schema_version": "1.0",
  "last_updated": "2026-02-10T17:00:00",
  "documents": {
    "CTR-03-001": {
      "ctr_path": "docs/08_CTR/CTR-03-001_provider_api/CTR-03-001.md",
      "ctr_updated": "2026-02-10T14:30:00",
      "upstream_hashes": {
        "docs/07_REQ/REQ-03.md": {
          "full_hash": "a1b2c3d4e5f6...",
          "section_hashes": {
            "interfaces": "1a2b3c4d...",
            "external_apis": "5e6f7g8h..."
          },
          "last_checked": "2026-02-10T17:00:00"
        }
      }
    }
  }
}

Three-Phase Detection Algorithm

Phase 1: Cache Initialization
  1. Check if docs/08_CTR/.drift_cache.json exists
  2. If not exists → create with schema_version: "1.0"
  3. Load cache into memory

Phase 2: Reference Extraction and Hash Comparison
  1. Extract all upstream references from CTR:
     - @req: tags → [path, section anchor]
     - Links to ../07_REQ/ → [path]
     - Traceability table upstream artifacts → [path]

  2. For each upstream reference:
     a. Resolve path to absolute file path
     b. Check file exists (already covered by Check #3)
     c. Compute SHA-256 hash of full file content
     d. If section anchor specified → compute section hash
     e. Compare hashes against cached values
     f. If hash differs → flag as DRIFT

Phase 3: Cache Update
  1. Update upstream_hashes with current values
  2. Set last_checked timestamp
  3. Write cache to disk
  4. Report cache status in output

Hash Calculation (MANDATORY BASH EXECUTION)

CRITICAL: Execute actual bash commands. DO NOT write placeholder values.

Full File Hash:

sha256sum <file_path> | cut -d' ' -f1

Store as: "hash": "sha256:<64_hex_characters>"

Section Hash (for anchor-specific tracking):

sed -n '/^## Section Name/,/^## /p' <file_path> | head -n -1 | sha256sum | cut -d' ' -f1

REJECTED VALUES (re-compute immediately):

  • sha256:verified_no_drift
  • sha256:pending_verification
  • Any value where hex portion!= 64 characters

Verification:

grep -oP '"hash":\s*"sha256:[0-9a-f]{64}"' .drift_cache.json

Error Codes:

CodeSeverityDescription
REV-D001WarningUpstream REQ document modified after CTR creation
REV-D002WarningReferenced section content has changed (hash mismatch)
REV-D003InfoUpstream document version incremented
REV-D004InfoNew content added to upstream document
REV-D005ErrorCritical upstream document substantially modified (>20% change)
REV-D006ErrorDrift cache missing or corrupted - regenerating
REV-D009ErrorInvalid hash placeholder detected (verified_no_drift, pending_verification)

Report Output:

## Upstream Drift Analysis

**Cache Status**: Active | Last Updated: 2026-02-10T17:00:00

| Upstream Document | CTR Reference | Hash Status | Last Modified | Days Stale | Severity |
|-------------------|---------------|-------------|---------------|------------|----------|
| REQ-03.md | @req interfaces | CHANGED | 2026-02-08 | 3 | Warning |
| REQ-03.md | Traceability | UNCHANGED | 2026-02-05 | 0 | OK |

**Drift Summary**:
- Total References: 5
- Unchanged: 3
- Changed: 2
- New (uncached): 0

**Recommendation**: Review upstream REQ changes and update CTR if interface requirements have changed.

Auto-Actions:

  • Create .drift_cache.json if not exists
  • Update cache with current hashes after every review
  • Add [DRIFT] marker to affected @req tags (optional)
  • Generate drift summary in review report

Configuration:

SettingDefaultDescription
cache_enabledtrueDrift cache (Mandatory - cannot be disabled)
drift_threshold_days7Days before drift becomes Warning
critical_threshold_days30Days before drift becomes Error
tracked_patterns@req:Patterns to track for drift

Review Score Calculation

Scoring Formula:

CategoryWeightCalculation
Dual-File Consistency24%(consistent_elements / total) × 24
OpenAPI Compliance19%(valid_fields / required_fields) × 19
REQ Alignment14%(aligned_endpoints / total) × 14
Endpoint Coverage14%(covered / expected) × 14
Security Definition10%(security_score) × 10
Placeholder Detection5%(no_placeholders? 5: 5 - count)
Naming Compliance9%(valid_ids / total_ids) × 9
Upstream Drift5%(fresh_refs / total_refs) × 5

Total: Sum of all categories (max 100)

Thresholds:

  • PASS: >= 90
  • WARNING: 80-89
  • FAIL: < 80

Command Usage

# Review specific CTR
/doc-ctr-reviewer CTR-03-001

# Review CTR by path
/doc-ctr-reviewer docs/08_CTR/CTR-03-001_provider_api/

# Review all CTRs
/doc-ctr-reviewer all

Output Report

Review reports are stored alongside the reviewed document per project standards.

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

File Naming: CTR-NN-SSS.R_review_report_vNNN.md

Location: Inside the CTR nested folder: docs/08_CTR/CTR-NN_{slug}/

Versioning Rules

  1. First Review: Creates CTR-NN-SSS.R_review_report_v001.md
  2. Subsequent Reviews: Auto-increments version (v002, v003, etc.)
  3. Same-Day Reviews: Each review gets unique version number

Version Detection: Scans folder for existing CTR-NN-SSS.R_review_report_v*.md files and increments.

Example:

docs/08_CTR/CTR-03-001_provider_api/
├── CTR-03-001.md
├── CTR-03-001.yaml
├── CTR-03-001.R_review_report_v001.md    # First review
├── CTR-03-001.R_review_report_v002.md    # After fixes
└── .drift_cache.json

Delta Reporting

When previous reviews exist, include score comparison in the report.

See REVIEW_DOCUMENT_STANDARDS.md for complete versioning requirements.


Integration with doc-ctr-autopilot

This skill is invoked during Phase 5 of doc-ctr-autopilot:

flowchart LR
    A[Phase 4: Validation] --> B[Phase 5: Final Review]
    B --> C{doc-ctr-reviewer}
    C --> D[Phase 6: Continue]

Related Skills

SkillRelationship
doc-namingNaming standards for Check #7
doc-ctr-autopilotInvokes this skill in Phase 5
doc-ctr-validatorStructural validation (Phase 4)
doc-ctr-fixerApplies fixes based on review findings
doc-ctrCTR creation rules
doc-req-reviewerUpstream QA
doc-spec-autopilotDownstream consumer

Version History

VersionDateChanges
1.42026-02-11Added Check #0: Structure Compliance (BLOCKING) - validates nested folder rule; REV-STR001-003 error codes; BLOCKING behavior prevents other checks until structure passes
1.32026-02-10Mandatory drift cache implementation - cache now required; Three-Phase Detection Algorithm; SHA-256 hash calculation with Python examples; REV-D006 error code for missing/corrupted cache; cache status in report output; centralized cache at docs/08_CTR/.drift_cache.json
1.22026-02-10Added Check #8: Upstream Drift Detection - detects when REQ documents modified after CTR creation; REV-D001-D005 error codes; drift cache support; configurable thresholds; added doc-ctr-fixer to related skills
1.12026-02-10Added review versioning support (_vNNN pattern); Delta reporting for score comparison
1.02026-02-10Initial skill creation with 7 review checks; Dual-file consistency; OpenAPI compliance; Security definition

Implementation Plan Consistency (IPLAN-004)

  • Treat plan-derived outputs as valid source mode and verify intent preservation from implementation plan scope/objectives.
  • Validate upstream autopilot precedence assumption: --iplan > --ref > --prompt.
  • Flag objective/scope conflicts between plan context and artifact output as blocking issues requiring clarification.
  • Do not introduce legacy fallback paths such as docs-v2.0/00_REF.

适合场景

01

用户想查找某类 Agent Skill 时

02

需要根据任务场景推荐可安装能力包时

03

需要对比不同来源的安装命令和来源信息时

能力概览

能力 1

按任务关键词查找相关 Skills

能力 2

展示可复制的安装命令

能力 3

保留来源站点、仓库和原始说明,方便继续核验

能力 4

展示第三方安全扫描或审计结果

安装后应在对应宿主中按原始 README 的触发条件使用;具体调用方式请以来源页面和 README 为准。

平台分布

Codex

33.74%
按下载量换算78

Claude

29.37%
按下载量换算68

Cursor

18.73%
按下载量换算43

Gemini CLI

9.69%
按下载量换算22

安全审计

Gen Agent Trust Hub

未通过

Socket

通过

Snyk

通过

权限和风险

external-service

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

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。来源安全扫描存在 warning/failed 结果,不能写成本站确认安全。当前只有一个来源,正式发布前建议补源仓库或其他目录站核验。

来源信息

继续浏览同类 Skills