Skip to content
Back to skills

Principle Soc

ASecurity

实现关注点分离,确保不同职责模块化和边界清晰。当需要架构分层设计、模块职责划分、横切关注点处理时使用。覆盖层次分离、功能分离、横切关注点三大维度,提供分离检查清单和耦合问题的诊断修复方法。

  • 5 stars
  • 0 votes
  • 0 copies
  • 4 views
  • Added February 8, 2026
businessgo

Security analysis

A100/100

Scanned February 12, 2026

npx -y skills add tikazyq/agentic-spec-forge --skill principle-soc --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Principle Soc?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Principle Soc
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/tikazyq-principle-soc/badge)](https://www.skillsdirectory.com/skills/tikazyq-principle-soc)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: principle-soc
description: 实现关注点分离,确保不同职责模块化和边界清晰。当需要架构分层设计、模块职责划分、横切关注点处理时使用。覆盖层次分离、功能分离、横切关注点三大维度,提供分离检查清单和耦合问题的诊断修复方法。
stage: COMMON
level_supported: [L1-STREAMLINED, L2-BALANCED, L3-RIGOROUS]
---

# Separation of Concerns Skill

> **Scope**: COMMON(全阶段通用)
>
> **版本**: 0.1.0(占位)| **创建日期**: 2025-11-27

---

## 概述

SoC(Separation of Concerns)是软件架构的基础原则:

```
┌─────────────────────────────────────────────────────┐
│              🧩 Separation of Concerns              │
├─────────────────────────────────────────────────────┤
│  "Let me not be so vain to think that I am the     │
│   sole author of my work... We are all but         │
│   standing on the shoulders of giants."            │
│                              — Edsger W. Dijkstra  │
└─────────────────────────────────────────────────────┘
```

---

## 关注点分离维度

### 层次分离

- [ ] 表现层 / 业务层 / 数据层 清晰分离
- [ ] UI 不包含业务逻辑
- [ ] 数据访问不混入业务规则

### 功能分离

- [ ] 每个模块有明确的职责边界
- [ ] 模块间通过接口通信
- [ ] 跨模块依赖最小化

### 横切关注点

- [ ] 日志、安全、事务等是否独立处理
- [ ] 是否使用 AOP 或中间件
- [ ] 基础设施代码与业务代码分离

### 数据与行为分离

- [ ] DTO/Entity 职责清晰
- [ ] 数据传输与业务对象分离
- [ ] 配置与代码分离

---

## 常见模式

| 模式 | 关注点分离方式 |
|------|---------------|
| MVC/MVVM | Model / View / Controller |
| 分层架构 | Presentation / Business / Data |
| 微服务 | 按业务域分离 |
| 六边形架构 | 核心 / 端口 / 适配器 |

---

## 分级检查策略

### L1-STREAMLINED
- 每维度检查 1 个核心点(共 4 项)
- 关注明显的职责混淆
- 通过标准:4 项中 3 项通过(≥75%)

### L2-BALANCED
- 每维度检查 2-3 个关键点(共 8-12 项)
- 依赖图可视化分析
- 通过标准:8 项中 7 项通过(≥87.5%)

### L3-RIGOROUS
- 全面检查所有子项(12+ 项)
- 耦合度量化(目标:低耦合高内聚)
- 记录边界违反和重构建议
- 通过标准:12 项中 11 项通过(≥91.7%)

---

## >> 命令

```
>>soc_check_l1       # SoC 快速检查
>>soc_layer_review   # 层次分离审查
>>soc_boundary       # 边界识别
```

---

## 相关 Skills

- **同类**: principle-solid, principle-dry, principle-kiss(设计原则家族)
- **应用**: layer-design, component-boundary(架构分离)
- **验证**: vertical-slice(每个切片的关注点)
- **扩展**: microservice-thinking(微服务级别的 SoC)

---

**TODO**: 待细化各架构模式的 SoC 检查规则

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

Comments

Loading comments…