AgentSkillsCN

Enhance

基于同步后的设计文档,对现有功能进行优化与增强。 深入分析现有的 arch.md 文件,提出改进方案与优化措施。 触发词:enhance、improve、extend、功能优化、功能扩展

SKILL.md
--- frontmatter
id: enhance
name: Enhance
description: |
  Design enhancement for existing features based on synced arch document.
  Analyzes existing arch.md and designs improvements.

  Triggers: enhance, improve, extend, 기능 개선, 확장
user-invocable: true
version: 2.0.0
triggers:
  - "enhance"
  - "improve"
  - "extend"
  - "feature enhancement"
requires: ["arch"]
platform: all
recommended_model: opus
agents:
  debate: archflow:domain-architect, archflow:best-practice-advisor
allowed-tools:
  - Read
  - Write
  - Glob
  - Grep
  - LS
  - Task
  - 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.

Enhance Workflow

Add enhancement requirements to existing arch document and update the design accordingly.

💡 Recommended Model

Opus Required - Consistency analysis with existing design is critical

→ Existing arch + new requirements + conflict validation = complex analysis

🔄 Tool Fallback

ToolAlternative when unavailable
Read/GrepRequest file path from user → ask for copy-paste
AskQuestion"Please select: 1) OptionA 2) OptionB 3) OptionC" format
TaskUse step-by-step analysis without sub-agents, request user confirmation at each step

📁 Document Structure

code
projectRoot/
  └── docs/
        └── {serviceName}/
              ├── spec.md        # Original requirements
              ├── requirements-v2.md     # ← Enhancement requirements (spec output)
              ├── arch.md           # ← Existing design (synced state recommended)
              └── trace.md

⚠️ Prerequisites

  1. Existing arch.md is up-to-date (sync completed after debug)
  2. Enhancement requirements refined through spec

Phase 0: Skill Entry

0-0. Model Guidance

⚠️ This skill strongly recommends using the Opus model. Consistency analysis with existing design is critical, requiring a high-performance model.

Input:

  • Enhancement requirements (requirements-v2.md or similar)
  • Existing arch.md (synced state recommended)

Output: Updated arch.md

0-1. Collect Input Information

json
{
  "title": "Feature Enhancement Design",
  "questions": [
    {
      "id": "has_enhance_req",
      "prompt": "Do you have an enhancement requirements document? (generated by spec)",
      "options": [
        {"id": "yes", "label": "Yes - I will provide via @filepath"},
        {"id": "no", "label": "No - Need requirements refinement first"}
      ]
    }
  ]
}
  • no → Guide to spec skill
  • yes → Request file path
json
{
  "title": "Existing Design Document",
  "questions": [
    {
      "id": "has_arch",
      "prompt": "Do you have an existing arch.md?",
      "options": [
        {"id": "yes", "label": "Yes - I will provide via @filepath"},
        {"id": "no", "label": "No - This is a new feature"}
      ]
    },
    {
      "id": "is_synced",
      "prompt": "Is arch.md up-to-date (debuges reflected)?",
      "options": [
        {"id": "yes", "label": "Yes - It's up-to-date"},
        {"id": "no", "label": "No - Sync required"},
        {"id": "unsure", "label": "Not sure"}
      ]
    }
  ]
}
  • is_synced: no → Recommend running sync first
  • has_arch: no → Guide to regular arch skill (new feature)

0-2. Infer serviceName

Extract serviceName from input file path:

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

0-3. Git Commit Strategy

json
{
  "title": "Git Commit Before Modification",
  "questions": [
    {
      "id": "git_strategy",
      "prompt": "Would you like to commit the current arch.md before modification?",
      "options": [
        {"id": "commit", "label": "Yes - Commit then proceed (recommended)"},
        {"id": "skip", "label": "No - Proceed directly"}
      ]
    }
  ]
}
  • commit selected:
    bash
    git add docs/{serviceName}/arch.md
    git commit -m "backup: arch.md before enhance"
    
  • skip selected: Proceed directly to Phase 1

Phase 1: Document Analysis

1-1. Analyze Existing Architect

Extract core information from existing design:

SectionInformation to Extract
SummaryCurrent Goal, Non-goals
ScopeCurrent implementation scope
ArchitectureComponent structure, DB schema
Code MappingCurrent file/class/method structure
API SpecCurrent API list

1-2. Analyze Enhancement Requirements

Extract from enhancement requirements:

ItemContent
New featuresFeatures to implement
Modified featuresExisting feature modifications
Removed featuresFeatures no longer needed
Non-functional requirementsPerformance/security improvements

1-3. Impact Analysis

markdown
## Impact Analysis

### Additions Required
| Item | Content | Affected Sections |
|------|---------|------------------|
| New API | {endpoint} | API Spec, Code Mapping |
| New table | {table name} | DB Schema, Architecture |

### Modifications Required
| Item | Current | After | Affected Sections |
|------|---------|-------|------------------|
| API change | {current spec} | {new spec} | API Spec |
| Schema change | {current columns} | {new columns} | DB Schema |

### Deletions
| Item | Reason |
|------|--------|
| {item to delete} | {reason} |

Phase 2: Enhancement Design (Sub-agent Collaboration)

2-A: Invoke Domain Architect

Use Task tool to call domain-architect sub-agent:

code
Task(
  subagent_type: "domain-architect",
  description: "Enhancement design based on existing design",
  prompt: """
    Existing arch.md: {existing design content}
    Enhancement requirements: {enhancement requirements}

    Provide enhancement design that maintains consistency with existing design.
    - Maintain existing patterns/structure
    - Minimize changes
    - Consider migration
  """
)

2-B: Invoke Best Practice Advisor

Use Task tool to call best-practice-advisor sub-agent:

code
Task(
  subagent_type: "best-practice-advisor",
  description: "Enhancement best practices",
  prompt: """
    Enhancement requirements: {enhancement requirements}

    Provide ideal design for this enhancement.
    (No knowledge of existing design - no context)
  """
)

2-C: Collaboration (Same as arch skill)

Round 1-2 collaboration → User checkpoint → Decision


Phase 3: Integration with Existing Architect

3-1. Integration Strategy

Change TypeIntegration Method
AdditionAdd new items to relevant sections
ModificationReplace existing items with new content
DeletionApply strikethrough to existing items or remove

3-2. Section-by-Section Integration

Summary Section:

  • Modify/expand Goal
  • Update Non-goals

Scope Section:

  • Add In scope items
  • Review Out of scope

Architecture Impact Section:

  • Add/modify Components
  • Add/modify DB Schema

Code Mapping Section:

  • Add new file/class/method
  • Mark modifications to existing items

API Spec Section:

  • Add new endpoints
  • Modify existing endpoints

Implementation Plan Section:

  • Add enhancement implementation steps

3-3. Enhancement Marking

Mark integrated content as enhancement:

markdown
## 6. API Specification

### Existing APIs
(Keep existing content)

### 🆕 Enhanced APIs (v2 - {date})
| Endpoint | Method | Description |
|----------|--------|-------------|
| /api/v1/alerts/batch | POST | Batch alert processing (enhancement) |

Phase 4: Quality Gate Validation

Perform same quality validation as Phase 5.5 in arch skill:

Required Validation Items

ItemValidation Criteria
Existing feature impactCheck existing API/schema compatibility
New feature completenessVerify all enhancement requirements reflected
MigrationVerify migration plan for DB changes

Phase 5: Save and Complete

5-1. Update arch.md

Save existing arch.md with integrated enhancement content.

5-2. Add Sync History

markdown
---

## Sync History

| Date | Type | Source | Changes |
|------|------|--------|---------|
| {date} | enhance | requirements-v2 | {enhancement summary} |

5-3. Completion Report

markdown
## Enhancement Design Complete

### Summary
| Item | Content |
|------|---------|
| Service | {serviceName} |
| Enhancement Requirements | {requirements file} |
| Modified Sections | {section list} |

### Key Changes
- **Added**: {added features/APIs/tables}
- **Modified**: {modified items}
- **Removed**: {removed items}

### Files
- Updated: `docs/{serviceName}/arch.md`

### Next Steps
1. Review arch.md
2. Start implementation with `build` skill

Integration Flow

code
[spec] → existing spec.md

(Enhancement needed)
        ↓
[spec] → requirements-v2.md (enhancement requirements)
        ↓
[enhance] ← synced arch.md
        ↓
Updated arch.md
        ↓
[build] → Enhancement implementation

Important Notes

  1. Run sync first (recommended)

    • Existing arch must be up-to-date for accurate analysis
  2. Existing feature compatibility

    • Must verify enhancement doesn't break existing features
    • Explicitly warn on breaking changes
  3. Incremental enhancement

    • Avoid too many changes at once
    • Recommend step-by-step enhancement
  4. Consider migration

    • Migration plan required for DB schema changes
    • Validate data compatibility