prd2plan-crosscut

[PRD2PLAN] sub-Skill — cross-cutting mechanism scenario. Responsible for Phase 7 (mechanism design document template output), Phase 8 (cross audit), and Phase 10 (primarily DDL/SQL alter). No API changes, does not generate YAML, and is auto-loaded by the prd2plan scheduler.

Installation

Review the source and dependencies with a prompt. A package is available to download.

Install with an AI assistant

Copy the prompt so your assistant can review the pinned revision and dependencies first.

View promptHide prompt
Check whether SkillPI Skill Finder is installed for your current agent. If it is missing, install and enable it using the official instructions at https://github.com/Findskills/skillpi. Then use Skill Finder to locate and install "prd2plan-crosscut" from this exact SkillPI detail page: https://skillpi.com/skills/deepskill-d6c0b1ed79b5bddc7c73bba8034654dd816df10560230c78b971ef417df04962. Verify the upstream source and version against https://skillhub.cn/skills/user_a4c2f3d2/prd2plan-crosscut before installing. If they do not match, stop and report the mismatch. Report the installed path and source version.

Source and setup

skillhub.cn

Setup guidance pending

See the original source for supported tools, dependencies, and permissions.

Installation test pending

[PRD2PLAN] sub-Skill — cross-cutting mechanism scenario. Responsible for Phase 7 (mechanism design document template output), Phase 8 (cross audit), and Phase 10 (primarily DDL/SQL alter). No API changes, does not generate YAML, and is auto-loaded by the prd2plan scheduler.

0 Downloads

Introduction source: third_party · user_a4c2f3d2 · 1.0.1 Reference

SkillPi interpretation

Tasks
Translation pending; see source documentation.
Inputs and outputs
Translation pending; see source documentation.
Testing
Not tested

Browse files

Browse files at the source ↗

Original SKILL.md

Open original ↗
Frontmatter
name: prd2plan-crosscut
description: "[PRD2PLAN] 子 Skill —— 🔵横切机制场景。负责 Phase 7(机制设计文档模板输出)、Phase 8(交叉审计)、Phase 10(DDL SQL alter/ 为主)。无 API 变更,不生成 YAML。由 prd2plan 调度器自动加载。"

🔵 横切机制 —— 输出与交付

前置条件:prd2plan 调度器已完成 Phase 1~10,场景判定为 🔵 横切机制。

本 Skill 职责:Phase 10(接收设计资产) → Phase 7(机制设计文档) → Phase 8(审计) → Phase 10(ALTER TABLE SQL)。无 API 暴露,不生成 OpenAPI YAML。


Phase 10:获取设计资产 【强制】

在开始 Phase 7 前,必须从调度器获取以下资产——不得重新推导或猜测:

资产 用途 来源 Phase
项目感知卡片 URL 前缀、框架 AOP 约定、审计字段约定、现有模块清单 Phase 3
场景判定结论 生效范围、跳过模块列表 Phase 4
切面/拦截器设计 文档 §2 切面设计 Phase 6
数据模型(ALTER TABLE 加通用列) 文档 §3 数据模型变更 Phase 8
架构设计(切面/拦截器调用链、性能分析) 文档 §5 架构变更 Phase 9
澄清记录(含生效范围、性能、存量数据讨论) 附录 A Phase 5

若缺少任一项,暂停并向调度器索取。


Phase 7:输出机制设计文档

7.1 文件命名

{feature-name}机制设计.md

7.2 机制设计模板

重点在切面/拦截器/事件设计,无需写 API 和业务表:

# [机制名称] 机制设计文档

> 基于 PRD: [文件名] | 日期: YYYY-MM-DD | 版本: v1.0 | 场景: 横切机制

---

## 0. 机制概览

### 0.1 生效范围

| 模块 | 是否需要此机制 | 实现方式 |
|------|--------------|----------|
| 任务管理 | ✅ | 切面/拦截器自动切入 |
| 项目管理 | ✅ | 切面/拦截器自动切入 |
| 报告管理 | ❌ | 暂不启用 |

### 0.2 机制原理(文字 + 流程图)

## 1. 需求概述

## 2. 切面 / 拦截器设计

### 2.1 切入点定义
### 2.2 通知类型(Before / Around / After)
### 2.3 切面调用链(时序图,含正常 + 异常)

## 3. 数据模型变更(通常只需 ALTER TABLE 加通用列)

| 表 | 新增列 | 类型 | 默认值 | 说明 |
|----|--------|------|--------|------|
| tasks | is_deleted | TINYINT | 0 | 软删除标记 |
| projects | is_deleted | TINYINT | 0 | 软删除标记 |
| reports | is_deleted | TINYINT | 0 | 软删除标记 |

## 4. 配置与开关

- 全局开关配置
- 按模块灰度配置
- 降级策略

## 5. 性能影响评估

| 指标 | Before | After | 差异 | 估算依据 |
|------|--------|-------|------|----------|
| 单次查询 | {X}ms | {X+Δ}ms | +{Δ}ms | 切面匹配 + 通知执行开销 |
| 单次写入 | {Y}ms | {Y+Δ}ms | +{Δ}ms | 通知中是否含同步写库操作 |

(注:具体数值需上线后实测。此处给出合理估算数量级和推算逻辑。)

## 6. 存量数据处理

## 附录 A:澄清记录(引用 Phase 10 澄清记录)
## 附录 B:变更记录

7.3 质量标准

A. 完整性检查

  • [ ] 生效范围明确(哪些模块启用、哪些跳过)
  • [ ] 切入点表达式/拦截规则清晰可执行
  • [ ] 有完整的调用链时序图(正常 + 异常)
  • [ ] 配置开关和降级策略已定义

B. 规范符合性检查

  • [ ] 切面设计符合 Phase 3 感知卡片中的框架约定(如注解驱动 AOP / 中间件 / 拦截器)
  • [ ] ALTER TABLE 遵守 design-db(回滚注释 + DEFAULT 值)
  • [ ] 执行顺序考虑了多切面/多中间件并发场景

C. 一致性检查

  • [ ] 生效范围与 Phase 3 感知卡片中现有模块清单一致
  • [ ] 性能评估有合理推算依据(标注推算逻辑,不写"影响很小")
  • [ ] 存量数据处理方案覆盖所有已有数据

D. PRD 忠实度检查

  • [ ] 机制行为与 PRD 描述一致
  • [ ] 没有过度设计——不添加 PRD 未要求的切面行为

Phase 8:交叉验证与质量审计

Phase 7 产出 {feature-name}机制设计.md 后,必须执行本阶段。

8.1 机制 ↔ 表变更 ↔ 模块 三方对齐

| 模块 | 机制切入方式 | 表变更 | 状态 |
|------|------------|--------|------|
| 任务管理 | 切面/拦截器切入 Service | tasks + is_deleted | ✅ |
| 项目管理 | 切面/拦截器切入 Service | projects + is_deleted | ✅ |
| 报告管理 | 跳过(配置关闭) | reports + is_deleted(预留) | ✅ |

8.2 切面一致性扫描

  • [ ] 所有启用模块的切入点一致(统一的注解 or 表达式 or 中间件规则)
  • [ ] 异常处理路径在时序图中有覆盖
  • [ ] 多切面/多中间件执行顺序合理(标注优先级/Order)

8.3 边界条件遍历

□ 并发:切面在高并发下是否线程安全?
□ 开关:运行时切换配置开关后行为是否正确?
□ 降级:机制故障时是否影响核心业务?
□ 存量:旧数据在机制启用后的行为是否合理?

8.4 性能校验

  • [ ] 性能评估给出了合理的数量级预估和推算依据(不写"影响很小")
  • [ ] 评估了是否需要异步化(如通知类操作)
  • [ ] 评估了热点路径上的切面开销是否可接受

8.5 审计签章

---
## 审计记录

| 审计项 | 结果 | 审计人 | 时间 |
|--------|------|--------|------|
| 机制↔表变更↔模块 三方对齐 | ✅ / ⚠️ 待修复 | AI | YYYY-MM-DD |
| 切面一致性 | ✅ / ⚠️ 待修复 | AI | YYYY-MM-DD |
| 边界条件覆盖 | ✅ / ⚠️ 待修复 | AI | YYYY-MM-DD |
| 性能校验 | ✅ / ⚠️ 待修复 | AI | YYYY-MM-DD |

只有 全部 ✅ 才能交付。


Phase 9:跳过

横切机制不暴露新 API,不生成 OpenAPI YAML。× 跳过。


Phase 10:拆分 ALTER TABLE SQL 文件(Flyway 命名)

10.1 输出结构

遵循 Flyway 命名规范(Java 生态标准),按版本号保证执行顺序:

sql/{feature-slug}/
├── alter/
│   ├── V{major}.{minor}__alter_{table1}_add_columns.sql
│   ├── V{major}.{minor}__alter_{table2}_add_columns.sql
│   └── ...
└── data_migration.sql           ← 存量数据刷数据脚本(如有,通常手动执行)
  • {feature-slug} 使用英文短横线命名,避免 CI/CD 编码问题

10.2 拆分规则

  1. 每个受影响的表一个 alter/ SQL 文件
  2. 每个 ALTER TABLE 语句带完整注释头(含回滚方式)
  3. data_migration.sql:仅当有存量数据需要刷时生成
  4. 审计字段与 Phase 3 感知卡片中项目约定一致

10.3 Flyway 集成方式

无需手写 00_all.sql。Flyway 是 Spring Boot 内置支持的数据库迁移工具,SQL 文件按版本号自动顺序执行。

如需提供快速执行指引,可在目录下放置 README.md:

## 执行顺序(按 Flyway 版本号)

1. alter/ 目录:ALTER TABLE 变更
2. data_migration.sql:刷存量数据(手动执行)

## 使用方式
- Spring Boot 自动执行:将 alter/ 下的 SQL 移入 db/migration/
- 手动执行:mvn flyway:migrate
- 纯 SQL 回退:按版本号顺序手动执行各文件

10.4 质量要求

  • [ ] 每个受影响的表一个 ALTER 文件
  • [ ] 每个 ALTER 带有回滚 SQL 注释
  • [ ] 新增字段都有 DEFAULT 值(存量兼容)
  • [ ] 刷数据脚本单独 data_migration.sql
  • [ ] Flyway 版本号按 ALTER 依赖顺序递增
  • [ ] 目录名使用英文短横线命名

禁止事项(🔵 横切机制)

  • ❌ 🔵场景输出 API 设计或 OpenAPI YAML(机制不产生新 API)
  • ❌ 跳过 Phase 10 资产获取
  • ❌ ALTER TABLE 不写回滚 SQL 注释
  • ❌ 新字段无 DEFAULT 值
  • ❌ 不声明配置开关和降级策略
  • ❌ 目录名使用中文(可能导致 CI/CD 编码问题)
  • ❌ 性能评估写"影响很小"而不给推算依据
  • ❌ 跳过 Phase 8 审计直接交付
  • ❌ 输出文件命名不用 机制设计.md 后缀

Current listing version

1.0.1

Verify the source revision ↗

Quality assessment

Out of 100 · Assessment report from SkillPi LAB.

Scenario Value92/100

Highlights

  • 高价值/高频刚需,直接解决用户明确的核心任务痛点
  • 显著提升日常高频场景的效率,自动化任务、信息聚合、内容生成等
Trigger Precision95/100

Highlights

  • 触发词精准完整,覆盖多种变体,边界清晰
Structure and Standards90/100

Highlights

  • Phase/步骤清晰,有出口条件,含端到端示例
  • frontmatter完整,单文件≤500行
Execution Reliability90/100

Highlights

  • 工具来源明确,参数正确,覆盖主要异常
  • 不可逆操作有确认机制
Evidence Verifiability (mean of the first four)92/100

The arithmetic mean of the first four original scores, rounded to a whole number.

Static text checks

100 / 100 · skillpi-20261123-no-r3-v1

No current rules matched the text.

This score reflects rule matches in the text and is provided for reference before use. It excludes attachments and runtime behavior.

Permissions and checks before use

Automatically summarized from this main document. Matches may be examples or defensive advice; they are not actual permission declarations. Attachments, external dependencies and runtime behavior are not covered.

These common operations were not identified in the main document. This does not mean no permissions or risks exist.

These notices grant no permissions. Your host tool must still confirm file changes, secrets, external transfers or costs as needed.

Security rating and access scope

safe · Static evidence review; not a runtime safety guarantee.

Before use, confirm and authorize actual file access, external services and network destinations in your host. This review grants no runtime permissions.