SuperAPI AI Directory

software-design

Design & creation

View repository

Updated 10-16 01:19

About this skill

Software Design and Coding Standards Skill System

Task Objectives

This skill system provides comprehensive software design and coding standards guidance, covering a complete knowledge system from basic terminology to architecture design. It supports a novice → advanced → architect learning path and can invoke corresponding sub-skills according to different scenarios.

Core Capabilities

  • Terminology and Concept Analysis: Basic concepts such as scope, closures, namespaces, and variable lifecycle
  • State Management Design: Local/global/shared state, immutable state, unidirectional data flow
  • Function Design Principles: Single responsibility, pure functions, method encapsulation, high cohesion and low coupling
  • Modular Architecture: Layered architecture, directory standards, code organization structure
  • Error Handling Mechanisms: Exception catching, error code design, exception throwing strategies
  • Performance Optimization: Memory management, resource release, performance bottleneck analysis
  • Code Quality: Readability, semantic naming, coding style, maintainability
  • Design Principles: SOLID principles, design patterns, refactoring techniques

Sub-skill List

Sub-skill Purpose Trigger Scenario
terminology Programming Terminology and Concept Analysis When encountering terminology or concepts that are not understood
state-management State Management Solution Design When state storage and management logic need to be designed
function-design Function Design and Splitting When functions need to be written or refactored
modularization Modularization and Architecture Design When code structure or layering needs to be organized
error-handling Error Handling Mechanisms When an exception handling strategy needs to be designed
performance Performance Optimization When encountering performance bottlenecks or memory issues
code-quality Code Quality Optimization When code readability and maintainability need to be improved
naming Naming and Commenting Standards When naming needs to be improved or comments need to be added

Three-Step Process Framework

All skill operations follow a unified three-step process:

┌─────────────────────────────────────────────────────────────┐
│  第一步:查阅信息 (Research)                                  │
│  ├── 理解用户问题和场景                                      │
│  ├── 调用相关子技能(如需要)                                │
│  └── 网络搜索最新实践(如需要)                              │
├─────────────────────────────────────────────────────────────┤
│  第二步:执行操作 (Execute)                                   │
│  ├── 应用设计原则和规范                                      │
│  ├── 提供具体代码示例                                        │
│  └── 解释设计决策和权衡                                      │
├─────────────────────────────────────────────────────────────┤
│  第三步:检查验收 (Validate)                                  │
│  ├── 验证方案符合 SOLID 原则                                  │
│  ├── 确认代码质量和可读性                                    │
│  └── 提供进一步优化建议                                      │
└─────────────────────────────────────────────────────────────┘

Usage Scenarios

Scenario 1: Novice Learning Path

Requirement: Learn software design from scratch

Invocation Method:

调用 software-design 技能,选择"新手学习路径"

Output:

  • Explanation of basic terminology (scope, variables, functions)
  • Introduction to coding standards
  • Simple examples and exercises

Scenario 2: Code Refactoring

Requirement: Optimize existing code structure

Invocation Method:

调用 software-design 技能,选择"代码重构"场景

Output:

  • Code problem analysis
  • Refactoring solution design
  • Specific implementation steps

Scenario 3: Architecture Design

Requirement: Design architecture for a large project

Invocation Method:

调用 software-design 技能,选择"架构设计"场景

Output:

  • Layered architecture design
  • Module division solution
  • Application of design patterns

Scenario 4: Performance Optimization

Requirements: Solve performance bottlenecks

Invocation Method:

调用 software-design 技能,选择"性能优化"场景

Output:

  • Performance Analysis Methods
  • Optimization Solution Design
  • Best Practice Recommendations

Core Concept System

I. Basic Terminology (Programmers Must Know)

  • Scope: Global variables / Local variables / Block scope
  • Variable Lifecycle: Declaration lifecycle, memory allocation, garbage collection
  • Namespace Pollution: Global namespace management, modularization solutions
  • Closure: Lexical scope, context preservation
  • State Management: Local state / Global state / Shared state
  • Immutable State: Data immutability, pure functions
  • Unidirectional Data Flow: Data flow control, state update mechanism

II. Design Principles (SOLID)

  1. Single Responsibility Principle (SRP): A class should have only one responsibility
  2. Open-Closed Principle (OCP): Open for extension, closed for modification
  3. Liskov Substitution Principle (LSP): Subclasses can replace parent classes
  4. Interface Segregation Principle (ISP): Interfaces should be small and specialized
  5. Dependency Inversion Principle (DIP): Depend on abstractions rather than concrete implementations

III. Code Quality Dimensions

  • Maintainability: Easy to understand, modify, and maintain
  • Scalability: Easy to add new features
  • Testability: Easy to write unit tests
  • Readability: Code is clear and easy to understand
  • Decoupling: Low coupling between modules

IV. Architectural Design Patterns

  • Layered Architecture: Controller / Service / DAO / Utils
  • Modular Design: High cohesion, low coupling
  • Design Patterns: 23 classic design patterns
  • Refactoring Techniques: Code refactoring methodology

Learning Roadmap

🌱 Beginner Stage (0-6 months)

Key Learning Content:

  1. Basic terminology: variables, scope, functions
  2. Coding standards: naming, comments, formatting
  3. Simple function design: single functionality, parameter design
  4. Basic error handling: try-catch, error prompts

Recommended Sub-skills:

  • terminology (terminology concepts)
  • naming (naming conventions)
  • function-design (basic function design)

🚀 Advanced Stage (6 months - 2 years)

Key Learning Content:

  1. Advanced function design: pure functions, side effect management
  2. State management: local state, global state
  3. Modularization: code organization, directory structure
  4. Error handling: error code design, exception chains
  5. Performance fundamentals: time complexity, space complexity

Recommended Sub-skills:

  • function-design (advanced function design)
  • state-management (state management)
  • modularization
  • error-handling

🏗️ Architect Stage (2+ years)

Key Learning Content:

  1. In-depth application of SOLID principles
  2. Design patterns: 23 patterns in practice
  3. Architecture design: layered architecture, microservices
  4. Performance optimization: memory management, concurrency handling
  5. Code refactoring: refactoring methodology
  6. Engineering quality: maintainability, scalability

Recommended Sub-skills:

  • code-quality
  • performance
  • modularization
  • Comprehensive application of all sub-skills

Web Search Configuration

This skill supports web search functionality, used to obtain the latest design patterns, best practices, and technology trends.

Search Trigger Conditions

  • The user explicitly requests a search for the latest practices
  • Need to verify the current usage of a certain design pattern
  • Need to understand the state management solution of a specific framework
  • Need to look up the latest technologies for performance optimization

Search Keyword Examples

  • "2025 state management best practices"
  • "SOLID principles real-world examples"
  • "code refactoring techniques 2025"
  • "performance optimization patterns"

Reference Documents

Document Purpose When to Use
references/terminology.md Detailed Explanation of Programming Terminology When basic concepts need to be understood
references/state-management.md State Management Solutions When designing state management logic
references/function-design.md Function Design Guide When writing or refactoring functions
references/modularization.md Modular Design When organizing code structure
references/error-handling.md Error Handling Mechanisms When designing exception handling
references/performance.md Performance Optimization When solving performance issues
references/code-quality.md Code Quality Standards When improving code quality
references/naming.md Naming Conventions When improving naming

Usage Examples

Example 1: Querying Terminology Concepts

User: "What is a closure? How is it used?"

Skill Invocation:

调用 software-design/terminology
查询:闭包(Closure)

Output:

  • Closure Definition
  • Working Principle
  • Use Cases
  • Code Examples
  • Precautions

Example 2: State Management Design

User: "How should the state of this component be managed?"

Skill Invocation:

调用 software-design/state-management
场景:组件状态设计

Output:

  • State Analysis (local/global/shared)
  • State Management Solutions
  • Code Implementation Examples
  • Best Practice Recommendations

Example 3: Function Refactoring

User: "This function is too complex, how should it be split?"

Skill Invocation:

调用 software-design/function-design
场景:函数重构
应用原则:单一职责、纯函数

Output:

  • Problem Analysis
  • Splitting Plan
  • Refactored Code
  • Explanation of Design Principles

Example 4: Architecture Design

User: "I want to develop an e-commerce system, how should the architecture be designed?"

Skill Invocation:

调用 software-design/modularization
场景:大型项目架构设计
网络搜索:电商系统架构最佳实践

Output:

  • Layered Architecture Design
  • Module Division Plan
  • Technology Selection Recommendations
  • Design Pattern Application

Notes

  • Sub-skill Invocation: Choose appropriate sub-skills based on the specific scenario, avoiding over-engineering
  • Web Search: Enable only when the latest information is needed, avoiding unnecessary searches
  • Learning Path: Recommend appropriate learning content and sub-skills based on the user's level
  • Code Examples: All recommendations should provide runnable code examples
  • Principle Application: When explaining design principles, combine them with actual scenarios and avoid dogmatism
  • Version Control: Important changes require updating the version number and recording the changes

Version History

  • v1.0.0 (2025-01-XX): Initial version
    • Created the complete skill system architecture
    • Defined 8 sub-skills
    • Configured web search capability
    • Provided a learning roadmap