# omtp-analyze-fangji

Adopt this skill: https://proskills.md/skills/other/skyfiredao-oh-my-tcmpowers-skills-omtp-analyze-fangji

Page: https://proskills.md/skills/other/skyfiredao-oh-my-tcmpowers-skills-omtp-analyze-fangji
This document is the public skill bundle for that page. It contains SKILL.md and every helper file the catalog carries. No login is required.

## File: skills/omtp-analyze-fangji/SKILL.md
size: 5539
sha: c88ee0078693439697108fad000519ade6619585
upstream: https://github.com/skyfiredao/oh-my-tcmpowers/blob/main/skills/omtp-analyze-fangji/SKILL.md

```text
---
name: omtp-analyze-fangji
description: "方剂分析/药方/处方/组方/配伍 - Perform five-phase structural analysis on herbal formula: locate each herb in mutual containment matrix, produce whole-formula statistics"
---

# 辅行诀方剂分析

辅行诀体系中的方剂五行结构分析。输入药方后，前置加载 omtp-core-fxj，逐药定位五行坐标（第一层味属+第二层行中之行），然后统计整方五行结构特征。不涉及路由判断、配伍比例分析或框架推导。与 omtp-analyze-zhengzhuang 互为反向流程。

## 前置条件

必须前置加载 `omtp-core-fxj` 作为理论基础（五行互含表、体用展开序列等通用概念）。

## 输入

用户提供药方，包含：
- 各药名称
- 各药剂量
- 总药味数

## 清单

调用本技能后，将以下清单写入 todowrite，逐项执行：

- [ ] 提取基本指标
- [ ] 药物五行定位（逐药，使用 omtp-core-fxj）
- [ ] 整方五行结构统计

## 第一步：基本指标提取

从用户提供的药方中提取：

1. **药名列表**：逐一列出所有药物，**包括溶剂**（如酢、白酨浆等非水溶剂）
2. **各药剂量**：记录每味药的用量
3. **总药味数**：统计药物总数（溶剂单独标注）

## 第二步：药物五行定位

逐药确定两层五行坐标。

### 60味药表内查找

对照框架中的五行互含总表（含草药25味+金石30味+补遗5味，共60味），直接获取：
- 第一层：味属哪行（药物进入哪个脏腑）
- 第二层：行中之行（药物作用于哪个脏腑）

标注（存疑）的药物（代赭石、葶苈子），需注意其坐标与组方规则的矛盾。

### 心神方存疑药物

若药物出现在框架"心神方剂存疑药物"表中，使用该表的推测坐标，并标注"待确认"。注意栝蒌和薤白存在经文表与心神方分析的矛盾。

### 药表外处理（Level 2 / Level 3）

药方中出现不在 60 味互含表内的药物，按 TaoHongJing 三级 fallback 处理：

- **Level 1**：互含表 60 味直接查得（本步骤不适用）
- **Level 2**：查 `data/bencao/<药名>.md`（340 味历代本草），按性味归经推导五行坐标
- **Level 3**：本地 bencao 无对应文件时，网络搜索 + 感官习性综合判断

**Level 3 判断维度**（综合，无固定优先级）：

- **颜色**：药材本色及炮制后颜色
- **气味**：药材的气味特征
- **取用部位**：根、茎、叶、花、果、种子、皮等
- **季节性**：采收季节、生长周期
- **炮制特征**：炮制方法及炮制后的变化

综合以上维度判断该药的五味归属（辛/咸/甘/酸/苦）和行中之行，确定其两层五行坐标。

**判断过程必须展示**：标注当前层级（Level 2 / Level 3）+ 信息来源（`data/bencao/<药名>.md` 或网络搜索），说明综合判断依据，再给出五行定位结论。

## 第三步：整方五行结构统计

将第二步的逐药定位结果整合为整方的五行结构概览。此步骤是下游分析的输入依据。

### 味对五脏的体用化角色分布

每个味在五脏体用化总表中有确定的角色（用=补、体=泻、化）。将整方所有药物的味代入总表，统计每个脏腑收到的补、泻、化各多少味药：

| 脏腑 | 补（用味） | 泻（体味） | 化 | 涉及药物 |
|------|----------|----------|---|---------|
| 肝 | ? | ? | ? | ... |
| 心 | ? | ? | ? | ... |
| 脾 | ? | ? | ? | ... |
| 肺 | ? | ? | ? | ... |
| 肾 | ? | ? | ? | ... |

味→角色对照（来自 omtp-core-fxj 五脏体用化总表）：

- 辛：补肝、泻脾、化肺
- 咸：补心、泻肺、化肾
- 甘：补脾、泻肾、化肝
- 酸：补肺、泻肝、化心
- 苦：补肾、泻心、化脾

注意：上表中的"化"列包含两种来源（详见 omtp-core-fxj「化味的合成」）：

1. **直接化味**：方中存在该脏腑化味的药物，直接计入
2. **合成化味**：方中同时存在该脏腑的体味药和用味药时，体+用合成出化味（效果<50%，参见 core 合成规则）

统计时需分别标注直接化味和合成化味。

### 行中之行分布

按第二层（行中之行）统计目标脏腑覆盖：

| 目标行 | 目标脏腑 | 药数 | 药物列表 |
|--------|---------|------|---------|
| 木 | 肝 | ? | ... |
| 火 | 心 | ? | ... |
| 土 | 脾 | ? | ... |
| 金 | 肺 | ? | ... |
| 水 | 肾 | ? | ... |

### 结构特征提取

基于上述统计，提取以下特征（仅统计事实，不做判断）：

1. **补泻集中度**：哪个脏腑收到的补味药最多？哪个收到的泻味药最多？
2. **目标集中度**：行中之行是否集中指向单一脏腑，或分散
3. **总药味数**：记录（含/不含溶剂）

## 反模式

- 跳过 core 五行分析 -- 必须先用 omtp-core-fxj 逐药定位，再统计整方结构
- 跳过60味药表直接查 bencao -- 先查互含表，不在表中才查 `data/bencao/`
- 跳过本地 bencao 直接网络搜索 -- 本地 340味本草数据优先，无对应文件才允许网络搜索
- 仅凭归经判断五行 -- 归脏仅参考，以药物自身习性综合判断

## 与其他技能的关系

| 关系 | 技能 | 说明 |
|------|------|------|
| 下游（前置依赖） | omtp-core-fxj | 五行互含表、体用化结构、推导公式 |
| 平行（反向流程） | omtp-analyze-zhengzhuang | 本 skill 从药到五行结构，zhengzhuang 从症到脏腑，可交叉验证 |
```

## File: README.md
upstream: https://github.com/skyfiredao/oh-my-tcmpowers/blob/main/README.md

```text
# 中医之心 Oh My TCM Powers (oh-my-tcmpowers)

> **中医之心** — 澎湃动力，源自核心

**[中文文档](README_zh.md)**

An AI skill set + agent orchestration layer for **analyzing Traditional Chinese Medicine (TCM) formulas, symptoms, pulse patterns, and acupoints** through multiple classical frameworks. 5 agents handle entry routing, context isolation, and parallel dispatch; 18 specialized skills provide pure domain knowledge covering core theory, formula composition rules, acupuncture point selection rules, pulse diagnosis, and analysis methods. Symptom analysis simultaneously derives herbal formulas (Fuxingjue), circular-motion prescriptions (Yuanyundong), Bianzhenglu diagnostic-reversal prescriptions (辨证录), and acupuncture point combinations, forming quad-path cross-validation; pulse diagnosis provides an independent reverse-validation channel.

## What It Does

Oh My TCM Powers (中医之心) provides a structured, rule-driven framework for analyzing herbal formulas, acupoint combinations, and clinical symptoms using the *Fuxingjue* theory system. It deduces therapeutic mechanisms through five-phase relationships, ti-yong-hua (body-function-transformation) layering, and quantified composition rules.

- **5 agents + 17 skills**: agents handle routing and orchestration, skills provide pure domain knowledge
- **Three-layer architecture**: agent (routing/orchestration/archive) → skill (core theory/rules/analysis methods) → data (herb tables/acupoint tables/symptom data)
- **Parallel quad-path analysis**: symptom analysis simultaneously derives Fuxingjue herbal formula, Yuanyundong circular-motion prescription, Bianzhenglu diagnostic-reversal prescription, and acupuncture point combination, with convergence and divergence comparison
- **Bidirectional analysis**: formula→symptom and symptom→formula, cross-validating each other
- **Five-phase mutual containment table**: 60 medicinals (25 herbal + 30 mineral + 5 supplementary) mapped to 25 positions in a 5×5 matrix
- **10-position ti-yong expansion sequence**: cyclic mapping of body (ti) and function (yong) flavors across five phases
- **Verified composition rules** for supplement (bu) and drain (xie) formulas, validated against all 24 classical five-organ formulas
- **Synthesized hua-flavor**: ti-flavor + yong-flavor can synthesize hua-flavor at reduced potency (<50%), a core-level mechanism applicable to all rule branches
- **Dosage ratio patterns**: 3:1 sovereign-to-minister (jun:chen) ratio for supplement formulas (sovereign dose is 3× minister dose), organ-specific ratios for drain formulas
- **Heart-spirit (xinshen) special logic**: virtual organ independent of five phases, with inverted supplement/drain semantics and solvent participation
- **External-contraction formulas (erldan liushen)**: 16 formulas treating external contraction through six directional positions (four cardinal + central upper/lower), independent of the five-organ supplement/drain system
- **Dual-layer flavor system**: each medicinal has two flavor layers, both usable for expansion sequence matching
- **Three-branch routing**: automatic selection of five-organ, heart-spirit, or external-contraction rules based on five-phase structural analysis
- **Six-channel (liujing) pattern differentiation**: six-channel theory integrated into acupuncture core, with channel-to-formula mapping for Shanghan (cold-damage) staging
- **Wei-Qi-Ying-Xue (defense-qi-nutrient-blood) staging**: four-level warm-disease depth staging framework for diagnostic differentiation (pure diagnostic tool, independent of formula selection)
- **Sanjiao (triple-burner) staging**: three-burner warm-disease spatial staging framework for diagnostic differentiation (pure diagnostic tool, independent of formula selection)
- **Yuanyundong (circular motion) subsystem**: Peng Ziyi's ascending-descending-floating-sinking model with 8 pathological types (+ subtypes), 15 compound types, 10 prescription rule types, and ~120 medicinals classified by qi-dynamic function
- **Acupuncture subsystem**: 3 additional skills for meridian-organ analysis and acupoint selection using 12 classical point selection methods
- **20 acupoint data files**: 12 regular meridians + 8 extraordinary meridians with point names, five-phase attributes, and special point classifications
- **Pulse diagnosis (maizhen) module**: 27-pulse classification system based on Wang Shuhe's *Maijing* and Li Shizhen's *Binhu Maixue*, providing reverse-validation of symptom-based diagnosis through pulse-to-organ-pathology mapping
- **Analysis archive**: each analysis session writes input, analysis process, and results to timestamped directories for research traceability

## Agent Overview

| Agent | Role |
|---|---|
| `omtp-agent-BianQue`（扁鹊） | General practitioner, strongest in diagnosis. Entry routing, dispatch, archive management, result summary |
| `omtp-agent-TaoHongJing`（陶弘景） | Herbal medicine expert (Fuxingjue). Loads core-fxj, routes to rule branch, executes complete derivation chain |
| `omtp-agent-PengZiYi`（彭子益） | Circular-motion expert (Yuanyundong). Staged loading: core-yyd → bianshi (identification), then rules-yyd → zufang → yaoxing (prescription). Independently analyzes symptoms through ascending-descending model, derives prescriptions |
| `omtp-agent-ChenShiDuo`（陈士铎） | Bianzhenglu expert (辨证录). Loads core-bzl → rules-bzl, "似X非X" diagnostic reversal method, bu-fa dominant prescriptions with fan-zuo (反佐) and large-dose multi-organ coordination |
| `omtp-agent-HuangFuMi`（皇甫谧） | Acupuncture expert. Loads core-zj + rules-zj + rules-ziwu-liuzhu, organ-to-meridian mapping, 12-method point selection + chronoacupuncture |

## Skill Overview

### Core Layer

| Skill | Purpose |
|---|---|
| `omtp-core-fxj` | Core theory: five-phase relationships, organ-flavor mapping, ti-yong-hua structure, 10-position expansion sequence, 60-medicinal mutual containment table, synthesized hua-flavor rules |
| `omtp-core-yyd` | Circular-motion core theory framework: Peng Ziyi's ascending-descending-floating-sinking model, central-qi pivot, 8-type summary table (detailed identification data in data/yyd-bianshi.md) |
| `omtp-core-bzl` | Bianzhenglu (辨证录) methodology: 论→辨→治→方 four-step chain, "似X非X" diagnostic reversal, 126-men routing table |

### Rule Layer (loaded by agents based on analysis results)

| Skill | Purpose |
|---|---|
| `omtp-rules-fxj5z` | Five-organ supplement/drain formula rules: composition rules for small/large supplement and drain formulas, dosage ratio patterns, cross-phase pairings |
| `omtp-rules-fxj1xz` | Heart-spirit (xinshen) formula rules: virtual organ independent of five phases, inverted supplement/drain logic, solvent participation, unique formula structures |
| `omtp-rules-fxj2d6s` | External-contraction formula rules: two-dawn (erldan) and six-spirit (liushen) formulas, six directional positions, herb-symptom fitting for 16 classical formulas |
| `omtp-rules-wei-qi-ying-xue` | Wei-Qi-Ying-Xue (defense-qi-nutrient-blood) warm-disease staging: four-level diagnostic staging framework for warm-disease depth differentiation |
| `omtp-rules-sanjiao` | Sanjiao (triple-burner) warm-disease staging: three-burner diagnostic staging framework for warm-disease spatial differentiation |
| `omtp-rules-yyd` | Yuanyundong (circular motion) prescription rule framework: 3 composition principles, 3-layer structure, 10-type summary, dosage ratio principles (detailed prescription data in data/yyd-zufang.md) |
| `omtp-rules-bzl` | Bianzhenglu (辨证录) prescription rules: bu-fa dominant, fan-zuo (反佐) pairing, large-dose strategy, multi-organ coordination, 3-level fallback (exact match → adapt → framework derive) |

### Analysis Method Layer (loaded by agents, providing domain methods without routing logic)

| Skill | Loaded by | Purpose |
|---|---|---|
| `omtp-analyze-fangji` | omtp-agent-TaoHongJing | Herb five-phase positioning + whole-formula statistical feature methods |
| `omtp-analyze-zhengzhuang` | omtp-agent-BianQue | Symptom extraction + organ mappi
```
