AgentSkillsCN

Reinforce

在已有文档的基础上,补充新信息以强化其完整性。 可在逆向技能完成后使用,或在新信息不断涌现时加以完善。 触发词:reinforce、fill gaps、complete documents、文档强化

SKILL.md
--- frontmatter
id: reinforce
name: Reinforce
description: |
  Reinforce existing documents with new information.
  Use after reverse skill to fill gaps or when new information becomes available.

  Triggers: reinforce, fill gaps, complete documents, 문서 보강
user-invocable: true
version: 2.0.0
triggers:
  - "reinforce"
  - "document reinforcement"
  - "add information"
  - "supplement document"
  - "fill gaps"
requires: ["reverse"]
platform: all
recommended_model: sonnet
allowed-tools:
  - Read
  - Write
  - Glob
  - LS
  - AskQuestion

Language: This skill is written in English for universal compatibility. Always respond in the user's language unless explicitly requested otherwise. If uncertain about the user's language, ask for clarification.

Reinforce Workflow

Reinforce existing documents by adding new information to incomplete documentation generated by reverse-engineering or manual creation.

💡 Recommended Model

Sonnet recommended (document merging task) / Opus for complex reasoning

→ Token-efficient: only processes documents + user input, no code analysis

🔄 Tool Fallback

ToolAlternative when unavailable
ReadRequest file path from user → ask for copy-paste
AskQuestion"Please select: 1) OptionA 2) OptionB 3) OptionC" format

📁 Document Structure

code
projectRoot/
  └── docs/
        └── {serviceName}/
              ├── spec.md   # ← Input/Output
              ├── arch.md      # ← Input/Output
              └── trace.md

⚠️ When to Use

  • After reverse: Fill gaps marked with ❓ in incomplete documents
  • New information acquired: Reflect information learned later
  • Error correction: Fix incorrectly inferred content

Phase 0: Skill Entry

0-0. Model Recommendation (Display at start)

💡 This skill recommends the Sonnet model. Document + new information merging task doesn't require high-performance model. Use Opus if complex reasoning is needed.

Input:

  • docs/{serviceName}/spec.md
  • docs/{serviceName}/arch.md
  • New information to add

Output: Updated spec.md, arch.md

0-1. Document Input

Use AskQuestion to check for existing documents:

json
{
  "title": "Start Document Reinforcement",
  "questions": [
    {
      "id": "has_docs",
      "prompt": "Do you have documents to reinforce?",
      "options": [
        {"id": "yes", "label": "Yes - I will provide file paths with @"},
        {"id": "no", "label": "No - I don't have documents"}
      ]
    }
  ]
}
  • no → Guide to reverse skill
  • yes → Request spec.md, arch.md file paths

0-2. Extract serviceName

Extract serviceName from input file path:

  • Input: docs/alert/spec.md
  • Extract: serviceName = "alert"

Phase 1: Analyze Existing Documents

1-1. Load Documents

Read spec.md and arch.md

1-2. Identify Unconfirmed Items

Extract items marked with:

  • ❓ Needs confirmation
  • ❓ Unconfirmed
  • ❓ Inferred
  • Items with "low" confidence
  • Empty sections

1-3. Report Current Status

markdown
## Current Document Status

### spec.md
| Section | Status |
|---------|--------|
| Goal | ✅ Confirmed / ❓ Inferred / ❌ Unconfirmed |
| Non-goals | {status} |
| Feature Specification | {status} |
| Priority | {status} |

### arch.md
| Section | Status |
|---------|--------|
| Summary | {status} |
| Code Mapping | ✅ Extracted |
| API Spec | ✅ Extracted |
| Risks & Tradeoffs | {status} |

### Items Needing Reinforcement
1. {Item 1} - {current status}
2. {Item 2} - {current status}

Phase 2: Collect New Information

2-1. Select Reinforcement Type

Use AskQuestion to determine information type:

json
{
  "title": "What information do you want to add?",
  "questions": [
    {
      "id": "reinforce_type",
      "prompt": "Select the type of content to reinforce",
      "options": [
        {"id": "fill_blank", "label": "Fill gaps - Items marked with ❓"},
        {"id": "correct", "label": "Fix errors - Correct incorrectly inferred content"},
        {"id": "add_new", "label": "Add new info - Information learned later"},
        {"id": "guided", "label": "Guided mode - Ask me questions one by one"}
      ]
    }
  ]
}

2-2. Process by Type

fill_blank (Fill gaps):

For each unconfirmed item, use AskQuestion:

json
{
  "title": "Fill Unconfirmed Items",
  "questions": [
    {
      "id": "item_1",
      "prompt": "Please provide information about {unconfirmed item 1}\nCurrent status: ❓ Needs confirmation",
      "options": [
        {"id": "answer", "label": "I'll provide the information"},
        {"id": "skip", "label": "I don't know yet - Skip"}
      ]
    }
  ]
}

correct (Fix errors):

"What content is incorrect? Please tell me the section to fix and the correct content."

add_new (Add new information):

"Please provide the information to add. Describe freely, and I will reflect it in the appropriate section."

guided (Guided mode): Ask about unconfirmed items in sequence


Phase 3: Classify Information

3-1. Analyze User Input

Analyze and classify user-provided information:

Information TypeTarget Document
Business purpose/intentspec.md - Goal, Non-goals
Feature description/behaviorspec.md - Feature Specification
Priority/importancespec.md - Priority
Technical decision rationalearch.md - Risks & Tradeoffs
Architecture changesarch.md - Architecture, Code Mapping
API changesarch.md - API Spec

3-2. Confirm Classification (If Ambiguous)

Use AskQuestion to clarify:

json
{
  "title": "Classify Information",
  "questions": [
    {
      "id": "classify",
      "prompt": "Your input:\n\"{user input summary}\"\n\nWhere should this information be reflected?",
      "options": [
        {"id": "requirements", "label": "Requirements (spec.md)"},
        {"id": "arch", "label": "Architecture (arch.md)"},
        {"id": "both", "label": "Both"},
        {"id": "auto", "label": "You decide"}
      ]
    }
  ]
}

Phase 4: Update Documents

4-1. Update spec.md (If Applicable)

SectionUpdate Method
GoalInferred → Confirmed (remove ❓)
Non-goalsEmpty → Fill with content
Feature SpecificationAdd/modify
PriorityEmpty → Fill with content
Unclear ItemsRemove resolved items

4-2. Update arch.md (If Applicable)

SectionUpdate Method
SummaryConfirm Goal/Non-goals
ScopeClarify scope
Risks & TradeoffsEmpty → Fill with content
OtherFix errors

4-3. Update Status Markers

  • ❓ Needs confirmation → Replace with content
  • ❓ Inferred → Change to ✅ Confirmed (if user confirmed)
  • Confidence "low" → Change to "high" (if user confirmed)

4-4. Add Reinforcement Record

Add reinforcement history at the bottom of documents:

markdown
---

## Reinforcement History

| Date | Type | Changes |
|------|------|---------|
| {date} | fill_blank | Confirmed Goal, Non-goals |
| {date} | add_new | Added Risks section |

Phase 5: Save and Complete

5-1. Confirm Changes

markdown
## Changes to be Applied

### spec.md
| Section | Before | After |
|---------|--------|-------|
| {section} | {previous state} | {new content} |

### arch.md
| Section | Before | After |
|---------|--------|-------|
| {section} | {previous state} | {new content} |

Ask user for confirmation:

"I will update the documents with these changes. Proceed?"

5-2. Save Files

code
docs/{serviceName}/spec.md (updated)
docs/{serviceName}/arch.md (updated)

5-3. Completion Report

markdown
## Document Reinforcement Complete

### Update Summary
| Document | Changed Sections | Change Type |
|----------|-----------------|-------------|
| spec.md | {sections} | {fill_blank/correct/add_new} |
| arch.md | {sections} | {fill_blank/correct/add_new} |

### Current Completion Rate
| Document | Before | After |
|----------|--------|-------|
| spec.md | {N}% | {N}% |
| arch.md | {N}% | {N}% |

### Remaining Unconfirmed Items
| Item | Document |
|------|----------|
| {item} | {document} |

### Next Steps
- **Need more reinforcement**: Run `reinforce` again
- **Documents complete**: Can now use sync/enhance/build

Integration Flow

code
[reverse] → Incomplete documents
               │
               ▼
         [reinforce] ←──┐
               │        │ (repeat)
               ▼        │
         Reinforced ────┘
         documents
               │
               ▼ (when complete)
         Can use sync/enhance/build

Important Notes

  1. Can be used without reverse

    • Also works on manually created documents
    • However, "fill gaps" mode unavailable if no ❓ markers
  2. Incremental reinforcement

    • No need to fill all information at once
    • Re-run reinforce whenever new information becomes available
  3. No code re-reading

    • Unlike reverse, no code analysis
    • Only processes existing documents + user input
    • Token-efficient
  4. Reinforcement history management

    • All reinforcements are logged
    • Can track change history later