Communitygithub.com

majiayu000/claude-skill-registry-data

用于梳理和可视化代码流程,生成清晰的 ASCII 流程图、数据流图和表格分析。适用于已有代码的梳理、新功能设计的说明、以及技术文档的编写。

claude-skill-registry-data 是什么?

claude-skill-registry-data is a Claude Code agent skill that 用于梳理和可视化代码流程,生成清晰的 ASCII 流程图、数据流图和表格分析。适用于已有代码的梳理、新功能设计的说明、以及技术文档的编写。.

兼容平台✓Claude Code~Codex CLI~Cursor
npx skills add https://github.com/majiayu000/claude-skill-registry-data/tree/HEAD/analysis/code-flow-viz-mmorit00-fund-portfolio-bot-2

在你喜欢的 AI 中提问

打开一个已预加载此 Agent Skill 的新对话。

文档

Code Flow Visualization Standards

This Skill provides a set of reusable templates and methods for organizing code flows and generating visual documentation.

Core Principle: Use text and ASCII diagrams to clearly explain "where does the data come from, which layers does it pass through, and where does it end up."

When to Use

Use this skill in the following scenarios:

  • The user asks "how does a certain feature work"
  • A new feature requires data flow design
  • Refactoring requires auditing existing logic
  • Writing technical documentation or architecture explanations
  • Code review requires visualizing the call chain

Core Templates

1. Complete Flowchart (Multi-Scenario Comparison)

Suitable for: Organizing multiple usage scenarios of a feature (e.g., manual vs. automatic, success vs. failure)

┌─────────────────────────────────────────────────────────────────────┐
│                    Feature Name (e.g., Full Limit Management Lifecycle) │
└─────────────────────────────────────────────────────────────────────┘

═══════════════════════════════════════════════════════════════════════
Scenario 1: Scenario Name (e.g., Automatically Query Limit Status)
═══════════════════════════════════════════════════════════════════════

  User Command
     │
     ▼
┌─────────────────────────────────────────────────────────────────┐
│  uv run python -m src.cli.xxx ...                               │
└────────────────┬────────────────────────────────────────────────┘
                 │
                 ▼
        ┌────────────────┐
        │  CLI Layer       │  Call Flow Function
        │  _do_xxx()      │ ────────────────────┐
        └────────────────┘                      │
                                                ▼
                                   ┌──────────────────────────┐
                                   │  Flow Layer               │
                                   │  xxx_flow()               │
                                   └───────┬──────────────────┘
                                           │
                                           ▼
                              ┌─────────────────────────────┐
                              │  Data Layer                  │
                              │  XxxRepo / XxxClient          │
                              └────────┬─────────────────────┘
                                       │
                                       ▼
                          ┌────────────────────────────┐
                          │  External System / Database │
                          │  (SQLite / API / etc)      │
                          └──────────┬─────────────────┘
                                     │  Return Data
                                     ▼
                    ┌──────────────────────────────────┐
                    │  Data Processing (Parse/Transform) │
                    └─────────────┬────────────────────┘
                                  │
                                  ▼
                        ┌──────────────────────┐
                        │  Return Value Data Class │  ← Explain why kept/simplified
                        │  (Result / Item / ...)│
                        └──────────┬───────────┘
                                   │
                                   ▼
                        ┌──────────────────────┐
                        │  CLI Layer Formatted Output│
                        └──────────────────────┘
                                   │
                                   ▼
    ╔══════════════════════════════════════════════════╗
    ║  Terminal Output Example                          ║
    ║  (Use box borders to highlight what the end user sees) ║
    ╚══════════════════════════════════════════════════╝

═══════════════════════════════════════════════════════════════════════
Scenario 2: Another Scenario
═══════════════════════════════════════════════════════════════════════
(Repeat the above structure, highlighting differences)

2. Database Table Structure Explanation

Suitable for: Explaining database tables involved in a feature

CREATE TABLE table_name (
    id INTEGER PRIMARY KEY AUTOINCREMENT,  -- ← Explain primary key purpose
    field1 TEXT NOT NULL,                  -- Explain field meaning
    field2 TEXT,                           -- Business meaning of NULL
    ...
);

-- Index (explain why this index is needed)
CREATE INDEX idx_xxx ON table_name(field1, field2);

Example Data Table:

idfield1field2field3Description
42value1value2value3Explain the business meaning of this record
43............

Typical Queries:

-- Scenario explanation: When is this query needed?
SELECT * FROM table_name 
WHERE condition1 = ? 
  AND (condition2 IS NULL OR condition2 >= ?);

3. Layered Call Chain Diagram (Simplified)

Suitable for: Quickly explaining function call relationships

CLI Layer (_do_xxx)
    │
    └─> Flow Layer (xxx_flow)
            │
            ├─> Data/Repo (xxx_repo.get)
            │       │
            │       └─> SQLite (SELECT ...)
            │
            └─> Data/Client (xxx_client.fetch)
                    │
                    └─> External API (HTTP GET ...)

4. Data Class Design Analysis Table

Suitable for: Evaluating whether intermediate data classes are necessary

Class NameNumber of FieldsPurposeVerdictReason
XxxResult6Multi-field aggregation + CLI display✅ KeepSatisfies "minimum necessary principle"
XxxWrapper1Single-field wrapper❌ RemoveOver-wrapping, return raw type directly
XxxItem3List detail item✅ KeepHas business semantics

Comparison Example:

# ❌ Over-wrapping
@dataclass
class XxxResult:
    field: SomeType  # Only one field

def xxx_flow() -> XxxResult:
    return XxxResult(field=value)

# ✅ Simplified
def xxx_flow() -> SomeType:  # Return directly
    return value

5. Business Key Point Annotations

Suitable for: Highlighting business rules and design decisions

┌─────────────────────────────────────────────────────────────┐
│                     Business Key Points                      │
├──────────────────────┬──────────────────────────────────────┤
│   Why was it designed this way?  │   Specific Decision       │
├──────────────────────┼──────────────────────────────────────┤
│ • Data Precision     │ Monetary values use Decimal, 2 decimals│
│ • Idempotency       │ Unique constraint on (fund_code, date)│
│ • Traceability      │ record_id as global unique identifier │
└──────────────────────┴──────────────────────────────────────┘

Usage Instructions

Step 1: Define the Analysis Goal

Answer these questions:

  1. Which feature's flow does the user want to understand?
  2. How many scenarios does this feature have? (success/failure, manual/automatic, etc.)
  3. Which layers are involved? (CLI → Flow → Data → DB/API)
  4. What are the key data classes? Why are they designed this way?

Step 2: Choose the Appropriate Template

  • Multi-scenario comparison → Template 1 (Complete flowchart)
  • Single flow → Template 3 (Layered call chain)
  • Database design → Template 2 (Table structure + example data)
  • Data class evaluation → Template 4 (Analysis table)

Step 3: Fill in the Content

Guidelines:

  • Use ASCII diagrams instead of long text descriptions
  • Use arrows (│ ▼ ┐ ┘ └ ├ ─) to connect data flows
  • Use box borders (┌ ┐ └ ┘ │ ─) to separate layers
  • Use double-line boxes (╔ ╗ ╚ ╝ ║ ═) to highlight user-visible parts
  • Add comments at key nodes (← explanation)

Symbol Usage Conventions:

SymbolPurposeExample
│ ▼Vertical flowData from top to bottom
→ ←Horizontal explanationrecord_id: int ← Database primary key
┌ ┐ └ ┘Single-line boxSurround code blocks, commands
╔ ╗ ╚ ╝Double-line boxHighlight terminal output, important results
═══Separator lineSeparate different scenarios

Step 4: Add Comparison Analysis

Before vs After (refactoring scenario):

# Before (problematic version)
...code...

# Issues:
# - Over-wrapping
# - Redundant fields
# - Increased cognitive load

# After (improved version)
...code...

# Improvements:
# - Directly return meaningful types
# - Reduce intermediate layers
# - Lower maintenance cost

Practical Examples

Example 1: Limit Management Flow (Full Version)

(See template 1 example above, expand all 4 scenarios with complete flows)

Example 2: Data Class Evaluation (fund_restriction module)

FunctionPrevious ReturnCurrent ReturnVerdictReason
add_restrictionAddRestrictionResult (6 fields)Keep✅CLI needs all fields displayed
end_restrictionEndRestrictionResult (4 fields)bool❌Only success/failure needed
check_trading_statusCheckStatusResult (2 fields)ParsedRestriction | None❌Simple wrapper

Output Checklist

When generating flow visualization documentation, ensure it includes:

  • Top-level overview (feature goal, modules involved)
  • Scenario enumeration (success/failure, manual/automatic, etc.)
  • Layered flowchart (CLI → Flow → Data → External)
  • Database table structure (if applicable)
  • Example data and queries (for understanding)
  • Key data class explanation (why kept/simplified)
  • Design reasoning (why was it done this way?)
  • Future extension points (TODO or reserved interfaces)

Anti-Patterns (Avoid Doing This)

❌ Pure textual description of flow

First, call the CLI layer's _do_xxx function, then _do_xxx calls the Flow layer's xxx_flow function,
xxx_flow then calls the Data layer's xxx_repo.get method...

✅ Use ASCII diagrams

CLI (_do_xxx) → Flow (xxx_flow) → Data (xxx_repo.get) → SQLite

❌ Tables without emphasis

FieldType
idint
namestr

✅ Highlight business meaning

FieldTypeDescriptionBusiness Constraint
idintPrimary keyAuto-generated, globally unique
namestrFund nameNon-null, used for display

❌ SQL without scenario explanation

SELECT * FROM table WHERE id = ?;

✅ With business scenario

-- Scenario: User queries details of a specific restriction record
SELECT * FROM fund_restrictions WHERE id = ?;

-- Scenario: Check if a specific day is restricted during DCA analysis
SELECT * FROM fund_restrictions
WHERE fund_code = ? AND start_date <= ? AND (end_date IS NULL OR end_date >= ?);

Collaboration with Other Skills

  • code-style: Adhere to coding standards when outputting code examples
  • architecture: Flowcharts must comply with layered architecture constraints
  • dev-workflow: Read relevant code and documentation before organizing flows

Summary

Core value of this skill:

  1. Reusable templates: Reduces time starting from scratch
  2. Unified visual style: ASCII diagrams + tables + box borders
  3. Business perspective: Not just code flow, but focusing on "why"
  4. Comparison analysis: Before/after refactoring, multi-scenario comparison
  5. Checklist review: Ensures no key information is missed

Usage Frequency: Use whenever you need to explain "how a certain feature works."

Individual skills in this repo

This repo contains 20 individual skills — each has its own dedicated page.

majiayu000/claude-skill-registry-data

Edit existing BMAD agents while maintaining compliance

majiayu000/claude-skill-registry-data

Edit existing BMAD agents while maintaining compliance

majiayu000/claude-skill-registry-data

Edit existing BMAD modules while maintaining coherence

majiayu000/claude-skill-registry-data

Edit existing BMAD modules while maintaining coherence

majiayu000/claude-skill-registry-data

Analyzes current state and user query to answer BMad questions or recommend the next workflow or agent. Use when user says what should I do next, what do I do now, or asks a question about BMad

majiayu000/claude-skill-registry-data

Build AI agents with Google ADK Python (Agent Development Kit). Use for multi-agent systems, workflow agents (sequential/parallel/loop), Vertex AI deployment, tool integration, human-in-the-loop.

majiayu000/claude-skill-registry-data

Build AI agents with Google ADK Python (Agent Development Kit). Use for multi-agent systems, workflow agents (sequential/parallel/loop), Vertex AI deployment, tool integration, human-in-the-loop.

majiayu000/claude-skill-registry-data

Portfolio allocation and rebalancing optimizer. Manages asset allocation across stocks/cash/bonds, performs periodic rebalancing, and ensures diversification according to market regime and risk tolerance.

majiayu000/claude-skill-registry-data

Create a hilarious and ultra-realistic video of an anthropomorphic animal acting like a human vlogger in a real-world setting.

majiayu000/claude-skill-registry-data

Speech-to-text transcription and translation via OpenAI Audio API -- models, response formats, timestamps, prompting, streaming, chunking, and diarization

majiayu000/claude-skill-registry-data

This skill should be used when the user asks about libraries, frameworks, API references, or needs code examples. Activates for setup questions, code generation involving libraries, or mentions of specific frameworks like React, Vue, Next.js, Prisma, Supabase, etc.

majiayu000/claude-skill-registry-data

小省导购员数字人带货版即梦视频提示词生成系统,基于四大智能体协同(提示词生成师、质量管控师、知识库运维师、跨环节适配师),按照"主体+运动+场景+(镜头语言+光影+氛围)"公式输出中英文双版提示词,适配5s短视频。确保人物一致性、视觉连贯性、情绪连贯性,支持知识库智能复用和跨工具适配(Suno音乐、AI绘画),为数字人带货视频提供高质量提示词生成服务。

majiayu000/claude-skill-registry-data

Upload and manage files using Google Gemini File API via scripts/. Use for uploading images, audio, video, PDFs, and other files for use with Gemini models. Supports file upload, status checking, and file management. Triggers on "upload file", "file API", "upload image", "upload PDF", "upload video", "file management".

majiayu000/claude-skill-registry-data

Analyze images/audio/video with Gemini API (better vision than Claude). Generate images (Imagen 4), videos (Veo 3). Use for vision analysis, transcription, OCR, design extraction, multimodal AI.

majiayu000/claude-skill-registry-data

Analyze images/audio/video with Gemini API (better vision than Claude). Generate images (Imagen 4), videos (Veo 3). Use for vision analysis, transcription, OCR, design extraction, multimodal AI.

majiayu000/claude-skill-registry-data

Skill for discovering and researching autonomous AI agents, tools, and ecosystems using the AgentFolio directory.

majiayu000/claude-skill-registry-data

Conduct domain and industry research. Use when the user says "lets create a research report on [domain or industry]

majiayu000/claude-skill-registry-data

Conduct market research on competition and customers. Use when the user says "create a market research report about [business idea]".

majiayu000/claude-skill-registry-data

Conduct technical research on technologies and architecture. Use when the user says "create a technical research report on [topic]".

majiayu000/claude-skill-registry-data

Builds, edit or validate Agent Skill through conversational discovery. Use when the user requests to "Create an Agent", "Optimize an Agent" or "Edit an Agent".

相关技能