Token导航 LogoToken导航TokenDH.com
研究检索需要联网github未标认证来源可访问许可证需确认审计提醒

doc-ctr-fixer文档 CTR 修复程序

Agent Skill

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

总安装

612

周安装

26

GitHub Stars

14

下载量

214
CodexClaudeCursorGemini CLI

安装说明

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

GitHub

来源数

2

许可证

unknown

最后核验

2026-05-01

来源状态

来源可访问

安装方式

通过对话安装

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

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

命令行安装

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

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

简介

用于修复已审核的数据合同文档,根据审查报告自动修正内容问题。

  • 适用于CTR文档的迭代优化,提升合同质量和可读性。
  • 运行于doc-ctr-reviewer之后,自动应用修复建议并生成修复报告。
  • 需配合审查报告使用,确保修改基于事实依据,不夸大能力或虚构信息。
  • doc-ctr-fixer 属于研究检索类 Skill,可作为该场景下的辅助能力补充。

SKILL.md

doc-ctr-fixer

Purpose

Automated fix skill that reads the latest review report and applies fixes to CTR (Contract) documents. This skill bridges the gap between doc-ctr-reviewer (which identifies issues) and the corrected CTR, enabling iterative improvement cycles.

Layer: 8 (CTR Quality Improvement)

Upstream: REQ documents, CTR document, Review Report (CTR-NN-SSS.R_review_report_vNNN.md)

Downstream: Fixed CTR (MD + YAML), Fix Report (CTR-NN-SSS.F_fix_report_vNNN.md)


When to Use This Skill

Use doc-ctr-fixer when:

  • After Review: Run after doc-ctr-reviewer identifies issues
  • Iterative Improvement: Part of Review -> Fix -> Review cycle
  • Automated Pipeline: CI/CD integration for quality gates
  • Batch Fixes: Apply fixes to multiple CTRs based on review reports
  • Dual-File Sync Issues: MD and YAML content has diverged

Do NOT use when:

  • No review report exists (run doc-ctr-reviewer first)
  • Creating new CTR (use doc-ctr or doc-ctr-autopilot)
  • Only need validation (use doc-ctr-validator)

Skill Dependencies

SkillPurposeWhen Used
doc-ctr-reviewerSource of issues to fixInput (reads review report)
doc-namingElement ID standardsFix element IDs
doc-ctrCTR creation rulesCreate missing sections
doc-reqREQ traceabilityValidate upstream links

Workflow Overview

flowchart TD
    A[Input: CTR Path] --> B[Find Latest Review Report]
    B --> C{Review Found?}
    C -->|No| D[Run doc-ctr-reviewer First]
    C -->|Yes| E[Parse Review Report]

    E --> F[Categorize Issues]

    subgraph FixPhases["Fix Phases"]
        F --> F0[Phase 0: Fix Structure Violations]
        F0 --> G[Phase 1: Create Missing Files]
        G --> H[Phase 2: Fix Broken Links]
        H --> I[Phase 3: Fix Element IDs]
        I --> J[Phase 4: Fix Content Issues]
        J --> K[Phase 5: Update References]
        K --> K2[Phase 6: Handle Upstream Drift]
    end

    subgraph DualFileSync["Dual-File Synchronization"]
        K2 --> L1{MD + YAML Exist?}
        L1 -->|Yes| L2[Sync MD <-> YAML]
        L1 -->|No| L3[Create Missing File]
        L2 --> L4[Validate Consistency]
        L3 --> L4
    end

    L4 --> M[Write Fixed CTR Files]
    M --> N[Generate Fix Report]
    N --> O{Re-run Review?}
    O -->|Yes| P[Invoke doc-ctr-reviewer]
    P --> Q{Score >= Threshold?}
    Q -->|No, iterations < max| F
    Q -->|Yes| R[COMPLETE]
    O -->|No| R

Fix Phases

Phase 0: Fix Structure Violations (CRITICAL)

Fixes CTR documents that are not in nested folders. This phase runs FIRST because all subsequent phases depend on correct folder structure.

Nested Folder Rule: ALL CTR documents MUST be in nested folders regardless of document size.

Required Structure:

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

Fix Actions:

Issue CodeIssueFix Action
REV-STR001CTR not in nested folderCreate folder, move both files, update all links
REV-STR002CTR folder name doesn't match CTR IDRename folder to match
REV-STR003CTR >25KB should be sectionedFlag for manual review

Structure Fix Workflow:

def fix_ctr_structure(ctr_path: str) -> list[Fix]:
    """Fix CTR structure violations."""
    fixes = []

    filename = os.path.basename(ctr_path)
    parent_folder = os.path.dirname(ctr_path)

    # Extract CTR ID and slug from filename
    match = re.match(r'CTR-(\d+)_([^/]+)\.(md|yaml)', filename)
    if not match:
        return []  # Cannot auto-fix invalid filename

    ctr_id = match.group(1)
    slug = match.group(2)
    expected_folder = f"CTR-{ctr_id}_{slug}"

    # Check if already in nested folder
    if os.path.basename(parent_folder) != expected_folder:
        # Create nested folder
        new_folder = os.path.join(os.path.dirname(parent_folder), expected_folder)
        os.makedirs(new_folder, exist_ok=True)

        # Move both .md and .yaml files
        base_name = f"CTR-{ctr_id}_{slug}"
        for ext in ['.md', '.yaml']:
            old_file = os.path.join(parent_folder, base_name + ext)
            if os.path.exists(old_file):
                new_file = os.path.join(new_folder, base_name + ext)
                shutil.move(old_file, new_file)
                fixes.append(f"Moved {old_file} to {new_file}")

        # Update upstream links in moved .md file
        md_path = os.path.join(new_folder, base_name + '.md')
        if os.path.exists(md_path):
            content = Path(md_path).read_text()
            updated_content = content.replace('../07_REQ/', '../../07_REQ/')
            updated_content = updated_content.replace('../06_SYS/', '../../06_SYS/')
            Path(md_path).write_text(updated_content)
            fixes.append(f"Updated relative links for nested folder structure")

    return fixes

Link Path Updates After Move:

Original PathUpdated Path
../07_REQ/REQ-01_slug/REQ-01.md../../07_REQ/REQ-01_slug/REQ-01.md

Phase 1: Create Missing Files

Creates files that are referenced but don't exist.

Scope:

Missing FileActionTemplate Used
CTR-NN-SSS.yamlCreate YAML contract from MDYAML contract template
CTR-NN-SSS.mdCreate MD documentation from YAMLMD contract template
Schema files (*_schema.json)Create placeholder schemaJSON Schema template
Reference docsCreate placeholderREF template

YAML Contract Template:

# CTR-NN-SSS: [Contract Name]
# Auto-generated by doc-ctr-fixer - requires completion

contract:
  id: CTR-NN-SSS
  name: "[Contract Name]"
  version: "1.0.0"
  status: draft
  created: "YYYY-MM-DD"

metadata:
  layer: 8
  artifact_type: CTR
  upstream_req: REQ-NN

interface:
  type: "[API|EVENT|DATA|SERVICE]"
  protocol: "[HTTP|gRPC|AMQP|Kafka]"

endpoints: []
  # TODO: Define endpoints

schemas: []
  # TODO: Define schemas

validation:
  # TODO: Define validation rules

MD Contract Template:

---
title: "CTR-NN-SSS: [Contract Name]"
tags:
  - ctr
  - contract
  - layer-8
custom_fields:
  document_type: contract
  artifact_type: CTR
  layer: 8
  upstream_req: REQ-NN
  yaml_companion: CTR-NN-SSS.yaml
---

# CTR-NN-SSS: [Contract Name]

> **Status**: Placeholder - Requires completion

## 1. Contract Overview

[TODO: Document contract purpose and scope]

## 2. Interface Definition

[TODO: Define interface specifications]

## 3. Data Schemas

[TODO: Document data schemas]

## 4. Validation Rules

[TODO: Define validation rules]

---

*Created by doc-ctr-fixer as placeholder. Complete this document to resolve issues.*

Phase 2: Fix Broken Links

Updates links to point to correct locations.

Fix Actions:

Issue CodeIssueFix Action
REV-L001Broken internal linkUpdate path or create target file
REV-L002External link unreachableAdd warning comment, keep link
REV-L003Absolute path usedConvert to relative path
REV-L004YAML reference brokenUpdate YAML $ref path
REV-L005Schema reference invalidFix JSON Schema $ref

Path Resolution Logic:

def fix_link_path(ctr_location: str, target_path: str) -> str:
    """Calculate correct relative path based on CTR location."""

    # CTR files: docs/08_CTR/CTR-01-API.md + CTR-01-API.yaml
    # Schema files: docs/08_CTR/schemas/

    if is_yaml_reference(target_path):
        return fix_yaml_ref(ctr_location, target_path)
    elif is_schema_reference(target_path):
        return fix_schema_ref(ctr_location, target_path)
    else:
        return calculate_relative_path(ctr_location, target_path)

YAML Reference Fix:

Reference TypeOriginalFixed
Schema ref$ref: schema.json$ref:./schemas/schema.json
Component ref$ref: #/components/Validate path exists
External ref$ref: http://...Add warning if unreachable

Phase 3: Fix Element IDs

Converts invalid element IDs to correct format.

Conversion Rules:

PatternIssueConversion
CTR.NN.XX.SSInvalid type codeConvert to valid CTR code
API-XXXLegacy patternCTR.NN.16.SS
INT-XXXLegacy patternCTR.NN.16.SS
MODEL-XXXLegacy patternCTR.NN.17.SS
SCHEMA-XXXLegacy patternCTR.NN.17.SS
CLAUSE-XXXLegacy patternCTR.NN.20.SS

Type Code Mapping (CTR-specific per ID_NAMING_STANDARDS.md):

Invalid CodeValid CodeElement Type
0116Interface
0217Data Model
2816Interface (legacy)
2917Data Model (legacy)
Any other16/17/20Map to interface, data model, or clause

Valid CTR Type Codes:

CodeElement TypeDescription
16InterfaceAPI endpoints, service interfaces
17Data ModelSchemas, data structures
20Contract ClauseContract terms, validation rules

Regex Patterns:

# Find element IDs with invalid type codes for CTR
invalid_ctr_type = r'CTR\.(\d{2})\.(?!16|17|20)(\d{2})\.(\d{2})'

# Find legacy patterns
legacy_api = r'###\s+API-(\d+):'
legacy_evt = r'###\s+EVT-(\d+):'
legacy_schema = r'###\s+SCHEMA-(\d+):'

Phase 4: Fix Content Issues

Addresses placeholders and incomplete content.

Fix Actions:

Issue CodeIssueFix Action
REV-P001[TODO] placeholderFlag for manual completion (cannot auto-fix)
REV-P002[TBD] placeholderFlag for manual completion (cannot auto-fix)
REV-P003Template date YYYY-MM-DDReplace with current date
REV-P004Template name [Name]Replace with metadata author or flag
REV-P005Empty sectionAdd minimum template content
REV-Y001Invalid YAML syntaxAttempt YAML repair
REV-Y002Missing required YAML fieldAdd field with placeholder

Auto-Replacements:

replacements = {
    'YYYY-MM-DDTHH:MM:SS': datetime.now().strftime('%Y-%m-%dT%H:%M:%S'),
    'YYYY-MM-DD': datetime.now().strftime('%Y-%m-%d'),
    'MM/DD/YYYY': datetime.now().strftime('%m/%d/%Y'),
    '[Current date]': datetime.now().strftime('%Y-%m-%dT%H:%M:%S'),
    '"1.0.0"': f'"{calculate_version()}"',
}

YAML Repair Actions:

YAML IssueRepair Action
Missing quotesAdd quotes around string values
Invalid indentationFix to 2-space indent
Duplicate keysKeep first, comment duplicates
Missing colonsAdd colons after keys

Phase 5: Update References

Ensures traceability and cross-references are correct.

Fix Actions:

IssueFix Action
Missing @req: referenceAdd REQ traceability tag
Incorrect REQ pathUpdate to correct relative path
Missing traceability entryAdd to traceability matrix
Orphan YAML companionLink MD and YAML files

REQ Traceability Fix:

<!-- Before -->
## 3. Interface Endpoints

<!-- After -->
## 3. Interface Endpoints

@req: [REQ-01.28.01](../07_REQ/REQ-01.md#req-01-28-01)

Phase 6: Handle Upstream Drift (Auto-Merge)

Addresses issues where upstream REQ documents have changed since CTR creation using a tiered auto-merge system.

6.0.1 Hash Validation Fixes

FIX-H001: Invalid Hash Placeholder

Trigger: Hash contains placeholder instead of SHA-256

Fix:

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

Update cache with: sha256:<64_hex_output>

FIX-H002: Missing Hash Prefix

Trigger: 64 hex chars but missing sha256: prefix

Fix: Prepend sha256: to value

FIX-H003: Upstream File Not Found

Trigger: Cannot compute hash (file missing)

Fix: Set drift_detected: true, add to manual review

CodeDescriptionAuto-FixSeverity
FIX-H001Replace placeholder hash with actual SHA-256YesError
FIX-H002Add missing sha256: prefixYesWarning
FIX-H003Upstream file not foundPartialError

Upstream: REQ (Layer 7) Downstream: SPEC (Layer 9)

Contract ID Pattern

Format: CTR-NN-TYPE-SS

ComponentDescriptionExamples
CTRArtifact prefixCTR
NNDocument number (01-99)01, 02, 15
TYPEContract typeAPI, DATA, EVENT, SERVICE
SSSequence within type (01-99)01, 02, 13

Auto-Generated ID Examples:

  • CTR-01-API-01 - First API contract in document 01
  • CTR-01-API-13 - 13th API contract in document 01
  • CTR-02-DATA-05 - 5th data contract in document 02
  • CTR-03-EVENT-02 - 2nd event contract in document 03

Tiered Auto-Merge System

Change percentage is calculated by comparing upstream REQ content hash at CTR creation vs current:

def calculate_drift_percentage(ctr_path: str, req_path: str) -> float:
    """Calculate percentage of upstream REQ changes affecting CTR."""
    drift_cache = load_drift_cache(ctr_path)
    original_hash = drift_cache.get('req_content_hash')
    current_hash = compute_content_hash(req_path)

    if original_hash == current_hash:
        return 0.0

    # Line-by-line diff comparison
    original_lines = drift_cache.get('req_snapshot_lines', [])
    current_lines = read_file_lines(req_path)

    changed_lines = len(set(original_lines) ^ set(current_lines))
    total_lines = max(len(original_lines), len(current_lines))

    return (changed_lines / total_lines) * 100
TierChange %ActionVersion Impact
Tier 1< 5%Auto-merge contract updatesPatch increment (1.0.0 → 1.0.1)
Tier 25-15%Auto-merge with detailed changelogMinor increment (1.0.0 → 1.1.0)
Tier 3> 15%Archive current, trigger regenerationMajor increment (1.0.0 → 2.0.0)

Tier 1: Minor Drift (< 5%)

Auto-merge with minimal disruption:

Actions:

  1. Update @req: references to current REQ version
  2. Sync metadata fields from REQ
  3. Increment contract patch version
  4. Update drift cache

Example Update:

# Before (CTR-01-API-05.yaml)
contract:
  id: CTR-01-API-05
  version: "1.0.0"
  req_version: "1.0.0"

# After auto-merge
contract:
  id: CTR-01-API-05
  version: "1.0.1"
  req_version: "1.0.1"
  last_merge: "2026-02-10T16:00:00"

Tier 2: Moderate Drift (5-15%)

Auto-merge with detailed changelog:

Actions:

  1. All Tier 1 actions
  2. Generate detailed changelog entry
  3. Add [MERGED] markers to affected sections
  4. Increment contract minor version
  5. Update companion MD file with changelog

Changelog Format:

## Changelog

### v1.1.0 (2026-02-10) - Auto-Merged

**Upstream Changes** (REQ-01.md v1.0.0 → v1.1.0):
- Modified: REQ-01.28.03 - Updated validation rules
- Added: REQ-01.28.07 - New authentication requirement
- Drift: 8.5%

**Contract Updates**:
- [MERGED] Section 3.2: Updated schema validation
- [MERGED] Section 4.1: Added auth contract reference

Tier 3: Significant Drift (> 15%)

Archive and regenerate:

Actions:

  1. Create archive manifest
  2. Move current CTR to archive
  3. Trigger CTR regeneration via doc-ctr-autopilot
  4. Increment major version
  5. Link archive in new CTR

Archive Manifest (CTR-NN-TYPE_archive_manifest.yaml):

# CTR Archive Manifest
archive:
  original_id: CTR-01-API-05
  archived_version: "1.1.0"
  archive_date: "2026-02-10T16:00:00"
  archive_reason: "upstream_drift_exceeded_15%"
  drift_percentage: 23.5

upstream_trigger:
  document: REQ-01.md
  original_version: "1.0.0"
  current_version: "2.0.0"

archived_files:
  - path: "archive/CTR-01-API-05_v1.1.0.md"
    hash: "sha256:abc123..."
  - path: "archive/CTR-01-API-05_v1.1.0.yaml"
    hash: "sha256:def456..."

regeneration:
  new_id: CTR-01-API-05
  new_version: "2.0.0"
  trigger_skill: doc-ctr-autopilot
  regenerated: "2026-02-10T16:05:00"

No Deletion Policy

Contracts are NEVER deleted. When a contract becomes obsolete:

Deprecation Marker:

# CTR-01-API-03.yaml
contract:
  id: CTR-01-API-03
  status: "[DEPRECATED]"
  deprecated_date: "2026-02-10"
  deprecated_reason: "Superseded by CTR-01-API-15"
  successor: CTR-01-API-15

MD Deprecation Header:

---
status: deprecated
deprecated_date: "2026-02-10"
successor: CTR-01-API-15
---

# CTR-01-API-03: Legacy User Authentication Contract

> **[DEPRECATED]** This contract has been superseded by [CTR-01-API-15](./CTR-01-API-15.md).
> Retained for historical reference and backward compatibility documentation.

Enhanced Drift Cache

The drift cache tracks merge history for audit purposes:

File: .drift_cache.json (per CTR directory)

{
  "CTR-01-API-05": {
    "current_version": "1.1.0",
    "req_content_hash": "sha256:abc123...",
    "req_snapshot_lines": ["line1", "line2", "..."],
    "last_checked": "2026-02-10T16:00:00",
    "last_modified": "2026-02-10T15:30:00",
    "merge_history": [
      {
        "date": "2026-02-08T14:00:00",
        "tier": 1,
        "drift_percentage": 3.2,
        "version_before": "1.0.0",
        "version_after": "1.0.1",
        "req_version": "1.0.1"
      },
      {
        "date": "2026-02-10T16:00:00",
        "tier": 2,
        "drift_percentage": 8.5,
        "version_before": "1.0.1",
        "version_after": "1.1.0",
        "req_version": "1.1.0",
        "changelog_entries": 3
      }
    ],
    "archive_history": []
  }
}

File Type Handling

Both .md and .yaml contract files are processed:

File TypeMerge Actions
.mdUpdate frontmatter, @req references, changelog section
.yamlUpdate contract metadata, version, timestamps
BothSync version numbers, maintain dual-file consistency

Sync Order:

  1. Process YAML first (authoritative for contract data)
  2. Sync changes to MD companion
  3. Update drift cache
  4. Generate fix report entry

Drift Issue Codes

CodeSeverityTierDescriptionAction
REV-D001Info1Minor REQ modification (< 5%)Auto-merge, patch version
REV-D002Warning2Moderate REQ modification (5-15%)Auto-merge with changelog, minor version
REV-D003Error3Major REQ modification (> 15%)Archive and regenerate, major version
REV-D004Info1-2New requirements addedAdd contract stubs
REV-D005WarningN/ADeprecated contract referencedUpdate reference to successor

Dual-File Synchronization

CTR documents consist of paired MD + YAML files that must remain synchronized.

Sync Detection

Sync IssueDetectionResolution
MD exists, YAML missingCheck for companion fileGenerate YAML from MD
YAML exists, MD missingCheck for companion fileGenerate MD from YAML
Content mismatchCompare key fieldsReconcile differences
Version mismatchCompare version fieldsUpdate to latest

Sync Actions

MD to YAML Sync:

MD SectionYAML Field
Titlecontract.name
Versioncontract.version
Interface endpointsendpoints[]
Data schemasschemas[]
Validation rulesvalidation

YAML to MD Sync:

YAML FieldMD Section
contract.nameTitle
endpoints[]Interface Endpoints section
schemas[]Data Schemas section
validationValidation Rules section

Conflict Resolution

Conflict TypeResolution Strategy
Both modified same fieldFlag for manual review
YAML has newer dataUpdate MD from YAML
MD has newer dataUpdate YAML from MD
Structural differenceKeep MD structure, sync data

Command Usage

Basic Usage

# Fix CTR based on latest review
/doc-ctr-fixer CTR-01-API

# Fix with explicit review report
/doc-ctr-fixer CTR-01-API --review-report CTR-01-API.R_review_report_v001.md

# Fix and re-run review
/doc-ctr-fixer CTR-01-API --revalidate

# Fix with iteration limit
/doc-ctr-fixer CTR-01-API --revalidate --max-iterations 3

# Sync dual files only
/doc-ctr-fixer CTR-01-API --sync-only

Options

OptionDefaultDescription
--review-reportlatestSpecific review report to use
--revalidatefalseRun reviewer after fixes
--max-iterations3Max fix-review cycles
--fix-typesallSpecific fix types (comma-separated)
--create-missingtrueCreate missing reference files
--backuptrueBackup CTR before fixing
--dry-runfalsePreview fixes without applying
--sync-onlyfalseOnly sync MD/YAML, skip other fixes
--acknowledge-driftfalseInteractive drift acknowledgment mode
--update-drift-cachetrueUpdate.drift_cache.json after fixes

Fix Types

TypeDescription
missing_filesCreate missing YAML, MD, schema docs
broken_linksFix link paths and YAML refs
element_idsConvert invalid/legacy element IDs
contentFix placeholders, dates, YAML syntax
referencesUpdate REQ traceability and cross-references
driftHandle upstream drift detection issues
syncSynchronize MD and YAML companion files
allAll fix types (default)

Output Artifacts

Fix Report

Nested Folder Rule: ALL CTR use nested folders (CTR-NN_{slug}/) regardless of size. Fix reports are stored alongside the CTR dual files (.md +.yaml) in the nested folder.

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

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

Structure:

---
title: "CTR-NN-SSS.F: Fix Report v001"
tags:
  - ctr
  - fix-report
  - quality-assurance
custom_fields:
  document_type: fix-report
  artifact_type: CTR-FIX
  layer: 8
  parent_doc: CTR-NN-SSS
  source_review: CTR-NN-SSS.R_review_report_v001.md
  fix_date: "YYYY-MM-DDTHH:MM:SS"
  fix_tool: doc-ctr-fixer
  fix_version: "1.0"
---

# CTR-NN-SSS Fix Report v001

## Summary

| Metric | Value |
|--------|-------|
| Source Review | CTR-NN-SSS.R_review_report_v001.md |
| Issues in Review | 15 |
| Issues Fixed | 12 |
| Issues Remaining | 3 (manual review required) |
| Files Created | 1 |
| Files Modified | 2 |
| Dual-File Sync | Completed |

## Files Created

| File | Type | Location |
|------|------|----------|
| CTR-01-API.yaml | YAML Contract | docs/08_CTR/ |

## Dual-File Sync Status

| MD File | YAML File | Sync Status | Action |
|---------|-----------|-------------|--------|
| CTR-01-API.md | CTR-01-API.yaml | Synchronized | Generated YAML from MD |

## Fixes Applied

| # | Issue Code | Issue | Fix Applied | File |
|---|------------|-------|-------------|------|
| 1 | REV-L004 | Broken YAML ref | Updated schema path | CTR-01-API.yaml |
| 2 | REV-N004 | Invalid element type | Converted to type 16 | CTR-01-API.md |
| 3 | REV-Y001 | Invalid YAML syntax | Fixed indentation | CTR-01-API.yaml |

## Issues Requiring Manual Review

| # | Issue Code | Issue | Location | Reason |
|---|------------|-------|----------|--------|
| 1 | REV-P001 | [TODO] placeholder | CTR-01-API.md:L45 | Domain knowledge needed |
| 2 | REV-D002 | REQ content changed | REQ-01.28.01 | Review requirement update |

## Upstream Drift Summary

| Upstream Document | Reference | Modified | CTR Updated | Days Stale | Action Required |
|-------------------|-----------|----------|-------------|------------|-----------------|
| REQ-01.md | CTR-01-API:L57 | 2026-02-08 | 2026-02-05 | 3 | Review for changes |

## Validation After Fix

| Metric | Before | After | Delta |
|--------|--------|-------|-------|
| Review Score | 88 | 96 | +8 |
| Errors | 3 | 0 | -3 |
| Warnings | 5 | 2 | -3 |

## Next Steps

1. Complete [TODO] placeholders in CTR-01-API.md
2. Review upstream REQ drift
3. Run `/doc-ctr-reviewer CTR-01-API` to verify fixes

Integration with Autopilot

This skill is invoked by doc-ctr-autopilot in the Review -> Fix cycle:

flowchart LR
    subgraph Phase5["Phase 5: Review & Fix Cycle"]
        A[doc-ctr-reviewer] --> B{Score >= 90?}
        B -->|No| C[doc-ctr-fixer]
        C --> D{Iteration < Max?}
        D -->|Yes| A
        D -->|No| E[Flag for Manual Review]
        B -->|Yes| F[PASS]
    end

Autopilot Integration Points:

PhaseActionSkill
Phase 5aRun initial reviewdoc-ctr-reviewer
Phase 5bApply fixes if issues founddoc-ctr-fixer
Phase 5cRe-run reviewdoc-ctr-reviewer
Phase 5dRepeat until pass or max iterationsLoop

Error Handling

Recovery Actions

ErrorAction
Review report not foundPrompt to run doc-ctr-reviewer first
Cannot create file (permissions)Log error, continue with other fixes
Cannot parse review reportAbort with clear error message
YAML parse errorAttempt repair, flag if unrecoverable
Max iterations exceededGenerate report, flag for manual review
Dual-file conflictFlag for manual resolution

Backup Strategy

Before applying any fixes:

  1. Create backup in tmp/backup/CTR-NN-SSS_YYYYMMDD_HHMMSS/
  2. Copy all CTR files (MD + YAML) to backup location
  3. Apply fixes to original files
  4. If error during fix, restore from backup

Related Skills

SkillRelationship
doc-ctr-reviewerProvides review report (input)
doc-ctr-autopilotOrchestrates Review -> Fix cycle
doc-ctr-validatorStructural validation
doc-namingElement ID standards
doc-ctrCTR creation rules
doc-reqREQ upstream traceability

Version History

VersionDateChanges
2.22026-02-26Element Type Code Alignment: Updated type codes from 28, 29 to 16, 17, 20 per ID_NAMING_STANDARDS.md; Fixed paths from ai_dev_flow/CTR/ to ai_dev_ssd_flow/08_CTR/
2.12026-02-11Structure Compliance: Added Phase 0 for nested folder rule enforcement (REV-STR001-STR003); Runs FIRST before other fix phases
2.02026-02-10Enhanced Phase 6 with tiered auto-merge system; Added Tier 1/2/3 thresholds (<5%, 5-15%, >15%); Contract ID pattern CTR-NN-TYPE-SS; No deletion policy with [DEPRECATED] markers; Archive manifest for Tier 3; Enhanced drift cache with merge history; Support for both.md and.yaml contract files
1.02026-02-10Initial skill creation; 6-phase fix workflow; Dual-file (MD + YAML) synchronization; Element ID conversion (types 28, 29); YAML syntax repair; REQ drift handling; Integration with autopilot Review->Fix cycle

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

32.95%
按下载量换算71

Claude

33.18%
按下载量换算71

Cursor

17.6%
按下载量换算38

Gemini CLI

10.22%
按下载量换算22

安全审计

Gen Agent Trust Hub

通过

Socket

可疑

Snyk

通过

权限和风险

需要联网

该 Skill 可能需要联网访问来源站点、仓库或外部 API;具体网络访问范围需要结合源码和 README 复核。

安装前确认

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

来源信息

继续浏览同类 Skills