Analogical Reasoning logo

Analogical Reasoning

Community
vivy-yi
analogical-reasoning

类比推理——当法律对当前问题没有直接规定时,通过相似案件/规范的类推适用填补法律漏洞。 适用情形:新型案件缺乏直接规定、需要"参照"/"比照"已有规范、论证同案同判。 核心原则:相似案件相似处理(Like cases should be treated alike)。 禁用领域:刑法定罪量刑、税法课税要件、行政处罚裁量(严格限制类推)。 与deductive-reasoning互补:演绎推理是大前提明确时的推理,类比推理是大前提缺失时的推理。

Overview

Publishervivy-yi
RepositoryGreater-China-Legal
Skill nameanalogical-reasoning
Stars
49
Forks
9
Bundled files
Instructions only
Links
  • Markdown instructions

    A SKILL.md file the model loads on demand, so it only costs tokens when a request actually matches.

  • Works with any LLM

    AI skills are plain Markdown, not provider-specific code, so this works with GPT, Claude, Gemini, Grok, or a local model.

  • Self-contained

    Everything the model needs lives in the instructions — no extra files to sync.

  • Open source

    Published by vivy-yi on GitHub. Read the source before you install it.

Installation

Install the Analogical Reasoning AI skill in TypingMind to use it with any LLM, or drop it into another agent that reads SKILL.md.

1

Install in TypingMind

TypingMind installs a skill straight from its GitHub folder — it reads SKILL.md, bundles the resource files, and stores the result locally.

  1. Open the app and go to Plugins → Skills.
  2. Choose "Install from GitHub".
  3. Paste the skill folder URL below and confirm.
    https://github.com/vivy-yi/Greater-China-Legal/tree/main/plugins/legal-atomic/analogical-reasoning
  4. Enable the skill in any chat where you want it available.
Plugins → Skills → Add skill → From GitHub URL, then paste the folder URL and press Continue.
2

Install in another agent

Any agent that reads the Agent Skills format can use this skill — copy the folder into that agent's skills directory.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/vivy-yi/Greater-China-Legal.git /tmp/Greater-China-Legal
mkdir -p .claude/skills
cp -r /tmp/Greater-China-Legal/plugins/legal-atomic/analogical-reasoning .claude/skills/analogical-reasoning
Restart Claude Code after copying so it picks up the new skill.

Use it in TypingMind

Enable Analogical Reasoning in any TypingMind chat and the model takes it from there. Its name and description sit in the system prompt, and the moment a request matches, the model loads the full instructions itself — you never invoke it by hand, and it costs no tokens until it is actually used.

The model loads Analogical Reasoning on its own as soon as a request matches it.

Works with any AI model

AI skills are plain Markdown instructions rather than provider-specific code, so Analogical Reasoning is not tied to the model it was written for. Install it once in TypingMind and use it with GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama, or a local model you run yourself — all on your own API keys.

  • Loaded only when it is needed

    The system prompt carries just the name and description. The instructions are fetched on the first matching request, so an idle skill costs nothing.

  • Switch models mid-chat

    Because the skill is instructions rather than code, changing model does not break it — the next model reads the same SKILL.md.

Skill instructions

This is the SKILL.md content the model loads. Read it before installing — a skill is instructions your model will follow.

/analogical-reasoning — 类比推理

核心原则

相似案件相似处理 · Like Cases Should Be Treated Alike

类比推理逻辑结构:
  前提1:案件A具有特征{F1,F2,F3,F4},适用法律效果R
  前提2:案件B具有特征{F1,F2,F3,F5}
  前提3:{F1,F2,F3}是导致R的本质特征(相似性基础)
  前提4:F4与F5的差异不足以影响R的适用
  ──────────────────────────────────────────
  结论:案件B应类推适用法律效果R

关键术语

术语含义
待决案件当前需要解决、缺乏直接法律规定的案件
参照对象已有明确法律规定的案件/规范
相似性基础(Tertium Comparationis)两个案件共享的、与法律评价相关的本质特征
法律漏洞法律对应当规范的事项未作规定的状态

类比推理禁区

❌ 严格禁止:
├── 刑法:不利于被告人的类推(罪刑法定)
├── 税法:课税要件类推(税收法定)
├── 行政处罚:处罚种类和幅度类推
└── 其他法律保留领域

⚠️ 宽松领域(有利于当事人时可考虑):
└── 民法、商法(类比推理最活跃的领域)

工作流程

步骤1:前置检查

1.1 确认法律漏洞存在
    - 检索现行法律法规,确认无直接规定
    - 区分"真正漏洞"(立法者未预见)vs"有意沉默"(立法者有意不规范)

1.2 检查禁区
    - 刑法/税法/行政处罚 → 如在禁区,终止类比,明确告知用户

1.3 确认无优先方法
    - 文义/体系/目的解释能否解决?→ 如能解决,优先使用
    - 类比推理作为补充论证

步骤2:寻找参照对象

2.1 确定搜索范围
    - 同一法律部门内的相关规范(优先)
    - 相邻法律部门的相关规范
    - 司法解释/指导性案例/公报案例

2.2 初步筛选
    - 列出所有可能相关的规范/案例
    - 保留2-5个高相似度候选对象

2.3 确定最佳参照对象
    - 优先选择:同一法律部门 + 规范目的最接近 + 已有司法实践支持

步骤3:相似性分析

3.1 提取待决案件的关键特征
    - 事实特征:主体/客体/行为/结果/因果关系
    - 法律特征:法律关系/权利义务/利益状态
    - 价值特征:涉及的法律价值/利益冲突类型

3.2 提取参照对象的关键特征(同一维度)

3.3 建立相似性对照表
┌────────────┬────────────┬────────────┬──────────┐
│ 比较维度   │ 待决案件   │ 参照对象   │ 相似/差异│
├────────────┼────────────┼────────────┼──────────┤
│ 维度1     │ ...       │ ...       │ 相似     │
│ 维度2     │ ...       │ ...       │ 差异     │
└────────────┴────────────┴────────────┴──────────┘

3.4 识别相似性基础
    - 核心问题:参照规范之所以规定该效果,其理由是否同样适用于待决案件?
    - 必须是"法律上重要的"相似性,不是表面相似

步骤4:差异性评估

4.1 识别差异点
    - 事实层面差异
    - 法律关系层面差异
    - 利益状态层面差异

4.2 评估差异的法律重要性
    - 该差异是否影响参照规范的规范目的?
    - 该差异是否导致利益状态实质性变化?
    - 该差异是否是立法者有意区别对待的因素?

4.3 综合判断
    - 所有差异"可忽略" → 类比成立,置信度高
    - 存在"需注意"的差异 → 可能成立,需附加论证
    - 存在"足以推翻"的差异 → 类比不成立

步骤5:正当性论证

5.1 规范目的论证
    - 阐明参照规范的规范目的(Ratio Legis)
    - 论证该目的同样涵盖待决案件

5.2 平等原则论证
    - 待决案件与参照案件在法律评价上处于相同地位

5.3 体系一致性论证
    - 类推结论与法律体系整体价值取向一致

5.4 回应反对意见
    - 预判反面推理的可能性
    - 论证为何类比优于反面推理

步骤6:形成结论

6.1 明确类推适用的具体方式
    - 完全类推:直接适用参照规范
    - 修正类推:参照但做必要调整

6.2 标注置信度等级

输出格式

## 类比推理报告

### 案件信息
- 待决案件:[简要描述]
- 法律问题:[缺乏直接规定的核心问题]
- 检索目的:类比适用

### 前置检查
- 法律漏洞:✅存在 / ❌不存在
- 禁区检查:✅无禁区 / ❌在禁区内(终止类比)
- 优先方法:✅无 / ⚠️有(建议优先使用其他方法)

### 参照对象
- 最佳参照:[规范/案例名称]
- 选择理由:[为何选此参照]

### 相似性分析
┌────────────┬────────────┬────────────┬──────────┐
│ 比较维度   │ 待决案件   │ 参照对象   │ 相似/差异│
├────────────┼────────────┼────────────┼──────────┤
│ [维度1]   │ ...       │ ...       │ 相似     │
│ [维度2]   │ ...       │ ...       │ 差异     │
└────────────┴────────────┴────────────┴──────────┘

### 差异性评估
- 差异1:[差异点] → [可忽略/需注意/足以推翻]
- 差异2:[差异点] → [可忽略/需注意/足以推翻]

### 正当性论证
- 规范目的:✅类推符合 / ❌类推违背
- 平等原则:✅符合 / ❌违背
- 体系一致:✅一致 / ❌矛盾

### 类比结论
- 结论:待决案件应[完全类推/修正类推]适用[参照规范]
- 类推方式:[具体适用方式]
- 置信度:🟢高 / 🟡中 / 🔴低
- 风险提示:[类比的局限性和不确定性]

置信度判断

置信度条件
🟢 高相似性基础明确 + 差异均可忽略 + 无禁区问题 + 司法实践支持
🟡 中存在需注意的差异 + 规范目的论证基本成立
🔴 低存在足以推翻的差异 + 规范目的论证不充分 + 无先例支持

引用说明

本skill方法论来自 THUYRan/Legal-Skills-Chinese/analogical-reasoning, THUYRan原版22000字,GCL精简至约200行,保留核心流程和输出格式。

Frequently asked questions

What does the Analogical Reasoning AI skill do?

类比推理——当法律对当前问题没有直接规定时,通过相似案件/规范的类推适用填补法律漏洞。 适用情形:新型案件缺乏直接规定、需要"参照"/"比照"已有规范、论证同案同判。 核心原则:相似案件相似处理(Like cases should be treated alike)。 禁用领域:刑法定罪量刑、税法课税要件、行政处罚裁量(严格限制类推)。 与deductive-reasoning互补:演绎推理是大前提明确时的推理,类比推理是大前提缺失时的推理。

Why use Analogical Reasoning on TypingMind?

Because you install it once and use it with any model. Analogical Reasoning is plain Markdown rather than provider-specific code, so the same skill runs on GPT-5, Claude, Gemini, Grok, or a local model — and you can switch model mid-chat without it breaking. TypingMind runs on your own API keys, so you pay providers directly instead of a per-seat subscription, and your skills and chats stay in your own storage.

How do I install Analogical Reasoning in TypingMind?

Open Plugins → Skills → Install from GitHub in TypingMind and paste https://github.com/vivy-yi/Greater-China-Legal/tree/main/plugins/legal-atomic/analogical-reasoning. TypingMind reads its SKILL.md and installs it as a skill you can enable per chat.

Which AI models can use Analogical Reasoning?

Any model you connect in TypingMind. AI skills are plain Markdown instructions rather than provider-specific code, so GPT, Claude, Gemini, Grok, and local models can all load this skill when a request matches it.

How many AI models can I use with Analogical Reasoning?

As many as you like. As long as a model supports skills, you can use Analogical Reasoning with it — GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama and more — all on TypingMind with your own API keys.

Is the Analogical Reasoning AI skill free?

It is published on GitHub by vivy-yi. Check the repository for licensing terms. You only pay your own AI provider for the tokens you use.

What are AI skills?

An AI skill is a reusable instruction bundle that teaches an AI model how to do one specific task. It follows the open Agent Skills format: a SKILL.md file with a name and description, plus any scripts, templates or reference files the model may need. The model reads the instructions only when your request matches the skill, so an installed skill costs nothing until it is used.

How are AI skills different from plugins or MCP servers?

A plugin or MCP server gives a model new tools to call — code that runs somewhere and returns a result. An AI skill gives the model knowledge and process instead: how to approach a task, which steps to follow, what good output looks like. Skills are plain Markdown, so they need no server, no API key and no runtime, and they work with any model.

View all

Set up your own AI workspace now

Get notified about new features and future giveaways by subscribing to our newsletter 👇