c4-context

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

C4 Context Level: System Context

C4上下文级别:系统上下文

Use this skill when

使用场景

  • Working on c4 context level: system context tasks or workflows
  • Needing guidance, best practices, or checklists for c4 context level: system context
  • 处理C4上下文级别:系统上下文相关任务或工作流时
  • 需要C4上下文级别:系统上下文的指导、最佳实践或检查清单时

Do not use this skill when

请勿使用场景

  • The task is unrelated to c4 context level: system context
  • You need a different domain or tool outside this scope
  • 任务与C4上下文级别:系统上下文无关时
  • 需要此范围外的其他领域或工具时

Instructions

操作说明

  • Clarify goals, constraints, and required inputs.
  • Apply relevant best practices and validate outcomes.
  • Provide actionable steps and verification.
  • If detailed examples are required, open
    resources/implementation-playbook.md
    .
  • 明确目标、约束条件及所需输入。
  • 应用相关最佳实践并验证结果。
  • 提供可执行步骤及验证方法。
  • 若需要详细示例,请打开
    resources/implementation-playbook.md

System Overview

系统概述

Short Description

简短描述

[One-sentence description of what the system does]
[系统功能的一句话描述]

Long Description

详细描述

[Detailed description of the system's purpose, capabilities, and the problems it solves]
[系统的用途、功能及解决问题的详细说明]

Personas

角色

[Persona Name]

[角色名称]

  • Type: [Human User / Programmatic User / External System]
  • Description: [Who this persona is and what they need]
  • Goals: [What this persona wants to achieve]
  • Key Features Used: [List of features this persona uses]
  • 类型:[人类用户 / 程序化用户 / 外部系统]
  • 描述:[该角色的身份及需求]
  • 目标:[该角色想要达成的目标]
  • 常用功能:[该角色使用的功能列表]

System Features

系统功能

[Feature Name]

[功能名称]

  • Description: [What this feature does]
  • Users: [Which personas use this feature]
  • User Journey: [Link to user journey map]
  • 描述:[该功能的作用]
  • 使用者:[使用该功能的角色]
  • 用户旅程:[用户旅程图链接]

User Journeys

用户旅程

[Feature Name] - [Persona Name] Journey

[功能名称] - [角色名称] 旅程

  1. ...
  1. [步骤1]:[描述]
  2. [步骤2]:[描述]
  3. [步骤3]:[描述] ...

[External System] Integration Journey

[外部系统] 集成旅程

  1. ...
  1. [步骤1]:[描述]
  2. [步骤2]:[描述] ...

External Systems and Dependencies

外部系统与依赖

[External System Name]

[外部系统名称]

  • Type: [Database, API, Service, Message Queue, etc.]
  • Description: [What this external system provides]
  • Integration Type: [API, Events, File Transfer, etc.]
  • Purpose: [Why the system depends on this]
  • 类型:[数据库、API、服务、消息队列等]
  • 描述:[该外部系统提供的服务]
  • 集成方式:[API、事件、文件传输等]
  • 用途:[系统依赖该外部系统的原因]

System Context Diagram

系统上下文图

[Mermaid diagram showing system, users, and external systems]
[展示系统、用户及外部系统的Mermaid图]

Related Documentation

相关文档

  • Container Documentation
  • Component Documentation
undefined
  • 容器文档
  • 组件文档

Context Diagram Template

上下文图模板

According to the C4 model, a System Context diagram shows the system as a box in the center, surrounded by its users and the other systems that it interacts with. The focus is on people (actors, roles, personas) and software systems rather than technologies, protocols, and other low-level details.
Use proper Mermaid C4 syntax:
mermaid
C4Context
    title System Context Diagram

    Person(user, "User", "Uses the system to accomplish their goals")
    System(system, "System Name", "Provides features X, Y, and Z")
    System_Ext(external1, "External System 1", "Provides service A")
    System_Ext(external2, "External System 2", "Provides service B")
    SystemDb(externalDb, "External Database", "Stores data")

    Rel(user, system, "Uses")
    Rel(system, external1, "Uses", "API")
    Rel(system, external2, "Sends events to")
    Rel(system, externalDb, "Reads from and writes to")
Key Principles (from c4model.com):
  • Focus on people and software systems, not technologies
  • Show the system boundary clearly
  • Include all users (human and programmatic)
  • Include all external systems the system interacts with
  • Keep it stakeholder-friendly - understandable by non-technical audiences
  • Avoid showing technologies, protocols, or low-level details
根据C4 model,系统上下文图将系统展示为中心的一个方框,周围环绕着其用户和与之交互的其他系统。重点是人员(参与者、角色、用户画像)和软件系统,而非技术、协议及其他底层细节。
使用标准的Mermaid C4语法:
mermaid
C4Context
    title System Context Diagram

    Person(user, "User", "Uses the system to accomplish their goals")
    System(system, "System Name", "Provides features X, Y, and Z")
    System_Ext(external1, "External System 1", "Provides service A")
    System_Ext(external2, "External System 2", "Provides service B")
    SystemDb(externalDb, "External Database", "Stores data")

    Rel(user, system, "Uses")
    Rel(system, external1, "Uses", "API")
    Rel(system, external2, "Sends events to")
    Rel(system, externalDb, "Reads from and writes to")
核心原则(来自c4model.com):
  • 聚焦人员和软件系统,而非技术
  • 清晰展示系统边界
  • 包含所有用户(人类和程序化)
  • 包含所有与系统交互的外部系统
  • 保持面向利益相关者——便于非技术受众理解
  • 避免展示技术、协议或底层细节

Example Interactions

示例交互

  • "Create C4 Context-level documentation for the system"
  • "Identify all personas and create user journey maps for key features"
  • "Document external systems and create a system context diagram"
  • "Analyze system documentation and create comprehensive context documentation"
  • "Map user journeys for all key features including programmatic users"
  • "为系统创建C4上下文级别文档"
  • "识别所有角色并为核心功能创建用户旅程图"
  • "记录外部系统并创建系统上下文图"
  • "分析系统文档并创建全面的上下文文档"
  • "为所有核心功能(包括程序化用户)绘制用户旅程"

Key Distinctions

核心差异

  • vs C4-Container agent: Provides high-level system view; Container agent focuses on deployment architecture
  • vs C4-Component agent: Focuses on system context; Component agent focuses on logical component structure
  • vs C4-Code agent: Provides stakeholder-friendly overview; Code agent provides technical code details
  • 与C4-Container agent对比:提供高层级系统视图;Container agent聚焦部署架构
  • 与C4-Component agent对比:聚焦系统上下文;Component agent聚焦逻辑组件结构
  • 与C4-Code agent对比:提供面向利益相关者的概览;Code agent提供技术代码细节

Output Examples

输出示例

When creating context documentation, provide:
  • Clear system descriptions (short and long)
  • Comprehensive persona documentation (human and programmatic)
  • Complete feature lists with descriptions
  • Detailed user journey maps for all key features
  • Complete external system and dependency documentation
  • Mermaid context diagram showing system, users, and external systems
  • Links to container and component documentation
  • Stakeholder-friendly documentation understandable by non-technical audiences
  • Consistent documentation format
创建上下文文档时,需包含:
  • 清晰的系统描述(简短和详细版)
  • 全面的角色文档(人类和程序化)
  • 完整的功能列表及描述
  • 所有核心功能的详细用户旅程图
  • 完整的外部系统及依赖文档
  • 展示系统、用户及外部系统的Mermaid上下文图
  • 指向容器和组件文档的链接
  • 便于非技术利益相关者理解的文档
  • 统一的文档格式