math-skill 3.1.1 → 3.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.en-US.md +90 -12
- package/README.md +90 -12
- package/SKILL.en.md +122 -0
- package/SKILL.md +122 -0
- package/agents/math-critic.en.md +42 -16
- package/agents/math-critic.md +43 -16
- package/commands/ask.en.md +2 -2
- package/commands/ask.md +2 -2
- package/design-patterns/compression/low-rank-kv-cache.en.md +1 -0
- package/design-patterns/loss/orthogonality-loss.en.md +7 -7
- package/design-patterns/loss/orthogonality-loss.md +7 -7
- package/knowledge-base/algebraic-geometry/grassmannian-plucker.en.md +71 -0
- package/knowledge-base/algebraic-geometry/grassmannian-plucker.md +71 -0
- package/knowledge-base/algebraic-geometry/index.en.md +47 -0
- package/knowledge-base/algebraic-geometry/index.md +47 -0
- package/knowledge-base/algebraic-geometry/sheaf-cohomology.en.md +72 -0
- package/knowledge-base/algebraic-geometry/sheaf-cohomology.md +72 -0
- package/knowledge-base/cryptography/attack-game-framework.en.md +56 -0
- package/knowledge-base/cryptography/attack-game-framework.md +56 -0
- package/knowledge-base/cryptography/cca-cpa-ae-hierarchy.en.md +57 -0
- package/knowledge-base/cryptography/cca-cpa-ae-hierarchy.md +57 -0
- package/knowledge-base/cryptography/index.en.md +54 -0
- package/knowledge-base/cryptography/index.md +54 -0
- package/knowledge-base/cryptography/prf-prg-owf.en.md +62 -0
- package/knowledge-base/cryptography/prf-prg-owf.md +62 -0
- package/knowledge-base/cryptography/reduction-proof-template.en.md +60 -0
- package/knowledge-base/cryptography/reduction-proof-template.md +60 -0
- package/knowledge-base/matrix-analysis/low-rank-approximation.en.md +2 -2
- package/knowledge-base/matrix-analysis/low-rank-approximation.md +2 -2
- package/knowledge-base/matrix-analysis/projection.en.md +11 -12
- package/knowledge-base/matrix-analysis/projection.md +11 -12
- package/knowledge-base/overview.en.md +9 -3
- package/knowledge-base/overview.md +9 -3
- package/knowledge-base/probability/kl-divergence.en.md +6 -6
- package/knowledge-base/probability/kl-divergence.md +6 -6
- package/package.json +11 -3
- package/references/agentic-workflow.en.md +2 -2
- package/references/agentic-workflow.md +2 -2
- package/references/books/abstract-algebra.en.md +18 -29
- package/references/books/abstract-algebra.md +18 -29
- package/references/books/algebraic-geometry-rising-sea.en.md +1 -1
- package/references/books/algebraic-geometry-rising-sea.md +2 -2
- package/references/books/applied-cryptography.en.md +112 -0
- package/references/books/applied-cryptography.md +127 -0
- package/references/books/differential-geometry.md +1 -1
- package/references/books/foundations-of-cryptography.en.md +112 -0
- package/references/books/foundations-of-cryptography.md +127 -0
- package/references/books/introduction-to-modern-cryptography.en.md +130 -0
- package/references/books/introduction-to-modern-cryptography.md +155 -0
- package/references/books/micro-lie-theory.en.md +1 -1
- package/references/books/micro-lie-theory.md +1 -1
- package/references/books/smooth-manifolds.en.md +1 -1
- package/references/books/smooth-manifolds.md +1 -1
- package/references/gpu-friendly-math.en.md +8 -8
- package/references/gpu-friendly-math.md +8 -8
- package/references/inspiration.en.md +8 -84
- package/references/inspiration.md +8 -84
- package/references/musings.en.md +87 -0
- package/references/musings.md +87 -0
- package/references/skill-index.en.md +48 -13
- package/references/skill-index.md +48 -13
- package/skills/math-research-activator/SKILL.en.md +4 -165
- package/skills/math-research-activator/SKILL.md +4 -165
|
@@ -1,171 +1,10 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: math-research-activator
|
|
3
3
|
description: |
|
|
4
|
-
|
|
4
|
+
Route AI architecture/operator design, theoretical analysis, math-to-AI transfer, and cryptographic definitions, constructions, reductions, or protocol reviews to the minimum necessary mathematical lenses, anchors, and design checks. Also use for mathematics questions tied to AI research. Do not use for implementation-only debugging, refactoring, tuning, or general code review.
|
|
5
|
+
中文:为 AI 架构/算子设计、理论分析、数学迁移,以及密码学定义、构造、归约和协议审查,选择最少必要的数学透镜、锚点与检查;纯实现工程任务不触发。
|
|
5
6
|
---
|
|
6
7
|
|
|
8
|
+
# Compatibility Entry
|
|
7
9
|
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
# Math Research OS
|
|
11
|
-
|
|
12
|
-
> "The thinking system does not hand out theorems, the knowledge system does not indulge in loose inspiration, and the design layer does not fake profundity."
|
|
13
|
-
|
|
14
|
-
This system is a mathematical staff office for AI architecture innovation — not an arsenal, but one that tells you: **what kind of battle this is, which arms to deploy, how to deploy them, and where things could go wrong.**
|
|
15
|
-
|
|
16
|
-
## Core Principle
|
|
17
|
-
|
|
18
|
-
> Math Skill does not store mathematics. It activates, routes, and translates mathematics for AI research.
|
|
19
|
-
|
|
20
|
-
- **knowledge-base/** is not a closed encyclopedia but a set of mathematical activation anchors
|
|
21
|
-
- When existing cards cannot cover a problem, the agent must NOT stop or force-fit; instead, generate a "temporary knowledge card" based on lenses, reference layers, and the agent's own mathematical knowledge, then continue with design translation
|
|
22
|
-
- **design-patterns/** is a collection of math→AI translation prototypes, not a complete model repository; when no matching pattern exists, generate a temporary design candidate from the mathematical structure and label it as a temporary design pattern
|
|
23
|
-
|
|
24
|
-
## Three-Layer Orthogonal Architecture
|
|
25
|
-
|
|
26
|
-
| Layer | Responsibility | Directory | Core Question |
|
|
27
|
-
|-------|---------------|-----------|--------------|
|
|
28
|
-
| **Thinking Lenses** | Diagnose problem structure, recommend mathematical perspectives | `../../lenses/*.en.md` | Which perspective should we view this problem through? |
|
|
29
|
-
| **Activation Anchors** | Activate high-frequency math structures; trigger Knowledge Gap Protocol when insufficient | `../../knowledge-base/*/*.en.md` | What math structures does this perspective require? |
|
|
30
|
-
| **Design Translation** | Translate mathematics into AI modules/losses/operators | `../../design-patterns/*/*.en.md` | How does this mathematics become model architecture? |
|
|
31
|
-
|
|
32
|
-
Auxiliary layers:
|
|
33
|
-
- `../../references/books/*.en.md`: Distilled notes from 7 textbooks; full context when deeper understanding is needed
|
|
34
|
-
- `../../references/gpu-friendly-math.en.md`: GPU Eight-Dimension Acceptance Gate (single source of truth)
|
|
35
|
-
- `../../agents/math-critic.en.md`: Math-engineering dual critic
|
|
36
|
-
|
|
37
|
-
## Intent Diagnosis (5 Scenarios)
|
|
38
|
-
|
|
39
|
-
| Scenario | Diagnostic Signal | Invocation Path |
|
|
40
|
-
|----------|------------------|-----------------|
|
|
41
|
-
| **A. Problem Analysis** | "Is this design sound?" "Are there gaps in the reasoning chain?" | Lenses → critic |
|
|
42
|
-
| **B. Mechanism Design** | "Design a new attention mechanism" "Transfer X to Y" | Lenses → Anchors → Design → critic |
|
|
43
|
-
| **C. Knowledge Query** | "What is a tangent space on a manifold?" "How is the projection theorem applied?" | Anchors |
|
|
44
|
-
| **D. Verification & Review** | "Does this formula hold?" "What guarantees does this loss provide?" | Anchors → relevant design patterns (if a concrete AI construct is cited) → critic |
|
|
45
|
-
| **E. Pure Engineering** | Debugging, refactoring, hyperparameter tuning, code review | **Do not invoke the math system** |
|
|
46
|
-
|
|
47
|
-
## Lens Library (15 Mathematical Perspectives)
|
|
48
|
-
|
|
49
|
-
15 lenses covering: Axiomatization, Duality, Symmetry, Spectral Decomposition, Geometric, Projection & Decomposition, Variational, Local-to-Global, Topological, Categorical, Perturbation, Causal, Game-Theoretic, Probabilistic & Statistical, Algorithmic. Directory: `../../lenses/*.en.md`. Full catalog table: `../../references/skill-index.en.md`.
|
|
50
|
-
|
|
51
|
-
## Activation Anchors (Organized by Mathematical Domain)
|
|
52
|
-
|
|
53
|
-
7 domains: Matrix Analysis, Optimization, Differential Geometry, Lie Theory, Topology, Probability & Information, Information Geometry. Directory: `../../knowledge-base/*/*.en.md`. Full catalog table: `../../references/skill-index.en.md`.
|
|
54
|
-
|
|
55
|
-
## Design Pattern Library (Organized by AI Component)
|
|
56
|
-
|
|
57
|
-
5 component types: Attention, Loss Functions, Routing, Representation, Compression. Directory: `../../design-patterns/*/*.en.md`. Full catalog table: `../../references/skill-index.en.md`.
|
|
58
|
-
|
|
59
|
-
## Automatic Trigger Conditions
|
|
60
|
-
|
|
61
|
-
**All of Gate 1 + Gate 2 + Gate 3 must be satisfied simultaneously for intervention:**
|
|
62
|
-
|
|
63
|
-
### Gate 0 · Exclusion Gate (Highest Priority)
|
|
64
|
-
The following tasks **never** trigger the system regardless of workspace contents: code review, debugging, refactoring, hyperparameter tuning, build/deployment, purely factual queries, general software engineering.
|
|
65
|
-
|
|
66
|
-
### Gate 1 · Environment Signal
|
|
67
|
-
The workspace contains architecture-level core code (attention/transformer/MoE, `*.cu`/kernel) or research notes. Routine files like `model.py` or `trainer.py` alone **do not** constitute an environment signal.
|
|
68
|
-
|
|
69
|
-
### Gate 2 · Task Signal
|
|
70
|
-
The user's task involves **designing/improving** a new architecture/operator, **analyzing** theoretical properties, **transferring** mathematical structures into AI design, or **querying math knowledge relevant to AI research** (e.g., "how is tangent space used in optimization?"). Pure encyclopedic math queries (e.g., "what is a group?" with no AI context) do not auto-trigger, but can be accessed via `/ask`.
|
|
71
|
-
|
|
72
|
-
### Gate 3 · Intent Match
|
|
73
|
-
The user's intent matches one of scenarios A/B/C/D. Pure engineering tasks matching scenario E → no intervention.
|
|
74
|
-
|
|
75
|
-
> **`/ask` entry**: Manual invocation skips Gate 1 and Gate 2, executing only Gate 0 (exclusion) + Gate 3 (intent match), allowing direct access to any scenario including knowledge queries.
|
|
76
|
-
|
|
77
|
-
## Main Workflow
|
|
78
|
-
|
|
79
|
-
### Step 1: Diagnose Intent
|
|
80
|
-
1. Determine which scenario (A/B/C/D/E) the user's intent belongs to
|
|
81
|
-
2. Extract the core tension of the problem: what to preserve? what to suppress? what are the constraints? what is the engineering bottleneck?
|
|
82
|
-
3. Output a problem-type classification
|
|
83
|
-
|
|
84
|
-
### Step 2: Route Invocation
|
|
85
|
-
|
|
86
|
-
```
|
|
87
|
-
Scenario A (Analysis): Select 1–3 lenses → output perspective diagnosis → critic review
|
|
88
|
-
Scenario B (Design): Select 1–3 lenses → invoke relevant activation anchors; if no coverage, enter Knowledge Gap Protocol → generate formal/temporary design patterns → critic review
|
|
89
|
-
Scenario C (Query): Prefer loading relevant activation anchors; if no coverage, generate temporary knowledge card → output per knowledge activation protocol
|
|
90
|
-
Scenario D (Verification): Load relevant anchors or temporary knowledge cards → critic reviews conditions and boundaries
|
|
91
|
-
Scenario E (Engineering): No intervention
|
|
92
|
-
```
|
|
93
|
-
|
|
94
|
-
### Step 3: Output Format
|
|
95
|
-
|
|
96
|
-
**Token-economy rule**: The following is the maximum structure, not the default full template. Trim to the user's question; for simple knowledge queries, provide only the needed definition / formula / risk. Expand design and GPU sections only when relevant, and do not restate loaded cards verbatim.
|
|
97
|
-
|
|
98
|
-
**Scenario A/B Output**:
|
|
99
|
-
1. **[Diagnosis]** Problem type + core tension
|
|
100
|
-
2. **[Lens]** Recommend 1–3 mathematical perspectives (annotate why each is/is not suitable)
|
|
101
|
-
3. **[Knowledge]** (Scenario B only) Activated mathematical structures (reference activation anchors or temporary knowledge cards)
|
|
102
|
-
4. **[Design]** (Scenario B only) Candidate AI module drafts (reference design patterns or temporary design drafts)
|
|
103
|
-
5. **[GPU]** Run candidates through the Eight-Dimension Gate (friendly/retrofittable/unfriendly)
|
|
104
|
-
6. **[Conclusion]** Retain candidates that pass both acceptance gates + next-step recommendations
|
|
105
|
-
|
|
106
|
-
**Scenario C Output** (Knowledge Activation Protocol, trimmed as needed):
|
|
107
|
-
1. Minimal definition
|
|
108
|
-
2. Core formulas
|
|
109
|
-
3. Applicable problems
|
|
110
|
-
4. AI design translation (only when the question involves AI / operators)
|
|
111
|
-
5. Engineering feasibility (only when implementation / GPU matters)
|
|
112
|
-
6. Risks and failure conditions
|
|
113
|
-
7. Further references (only when traceability is requested or the conclusion depends on book references)
|
|
114
|
-
|
|
115
|
-
**Scenario D Output** (short conclusion first + conditions/boundaries):
|
|
116
|
-
1. Conditions under which it holds
|
|
117
|
-
2. Conditions under which it fails
|
|
118
|
-
3. What it can guarantee at most
|
|
119
|
-
4. What it cannot guarantee
|
|
120
|
-
5. Engineering feasibility (only when implementation / GPU matters)
|
|
121
|
-
|
|
122
|
-
**A conclusion must always be provided — never output analysis alone without convergence.**
|
|
123
|
-
|
|
124
|
-
## GPU Eight-Dimension Acceptance Gate
|
|
125
|
-
|
|
126
|
-
Formal terminology (single authoritative source: `../../references/gpu-friendly-math.en.md`):
|
|
127
|
-
**Tensorization / GEMM-mappability / Complexity / Memory & KV-Cache / Low-Precision Stability / Parallelism & Communication / Sparse Structure / Operator Fusion**
|
|
128
|
-
|
|
129
|
-
**Quantitative assessment requirements**: For each candidate design, the GPU assessment should not only provide [v]/[~]/[x] labels but also answer:
|
|
130
|
-
1. FLOPs of core operations and ratio vs. baseline
|
|
131
|
-
2. Peak memory (bytes), whether large matrices are materialized
|
|
132
|
-
3. Numerical stability strategy under bf16/fp8
|
|
133
|
-
4. Number of fusible kernels and expected speedup
|
|
134
|
-
|
|
135
|
-
See the quantitative checklist in `../../references/gpu-friendly-math.en.md`.
|
|
136
|
-
|
|
137
|
-
## Depth-of-Consultation Protocol
|
|
138
|
-
|
|
139
|
-
- **Light**: Read knowledge cards (`../../knowledge-base/*/*.en.md`); self-contained and immediately usable
|
|
140
|
-
- **Medium**: Read distilled book notes (`../../references/books/*.en.md`) for more complete context
|
|
141
|
-
- **Deep**: When `math_book/<PDF>` is available locally, the agent automatically runs `pdftotext` + grep to locate the original page
|
|
142
|
-
|
|
143
|
-
## Knowledge Gap Protocol
|
|
144
|
-
|
|
145
|
-
When the mathematical tools required by the user's problem are not in the existing `knowledge-base/`, do NOT force-fit existing cards. Execute the following procedure:
|
|
146
|
-
|
|
147
|
-
1. **Gap Identification**: Explicitly state that no fully corresponding knowledge card exists. Classify the gap as: new domain, new theorem family, new structure, new application scenario, or combinatorial extension of existing cards.
|
|
148
|
-
|
|
149
|
-
2. **Lens Fallback**: Select 1–3 most relevant thinking lenses to determine the problem's mathematical structure. E.g., local-to-global, categorical, spectral, projection, causal, perturbation.
|
|
150
|
-
|
|
151
|
-
3. **Candidate Knowledge Localization**: Provide mathematical keywords, theorem families, concept clusters, and reference book directions to look up. Existing card coverage is not required, but explain why these concepts are relevant.
|
|
152
|
-
|
|
153
|
-
4. **Temporary Knowledge Card**: Generate a temporary knowledge summary in the same format as formal cards:
|
|
154
|
-
- Minimal definition
|
|
155
|
-
- Core structure
|
|
156
|
-
- Applicable problems
|
|
157
|
-
- AI design translation
|
|
158
|
-
- GPU feasibility
|
|
159
|
-
- Risks and failure conditions
|
|
160
|
-
- **Source & Confidence** (required):
|
|
161
|
-
- Knowledge source: label as "Agent inference / Lens derivation / Reference book extrapolation / Requires external verification"
|
|
162
|
-
- Confidence: High (theorem-backed) / Medium (reasonable inference, not rigorously proven) / Low (exploratory hypothesis)
|
|
163
|
-
- Unverified claims: list key conclusions requiring subsequent verification
|
|
164
|
-
|
|
165
|
-
5. **Design Translation**: If the user's goal is mechanism design, translate the temporary knowledge into candidate AI modules, losses, routing, attention, representation, or compression schemes.
|
|
166
|
-
|
|
167
|
-
6. **Upgrade Recommendation**: If this gap recurs frequently, recommend adding a formal knowledge card or design pattern.
|
|
168
|
-
|
|
169
|
-
## Workflow Example
|
|
170
|
-
|
|
171
|
-
Full workflow example: `../../references/skill-index.en.md`.
|
|
10
|
+
This is the Claude/plugin-style compatibility entry. Read and follow `../../SKILL.en.md` completely; the root file is the single authoritative English body and all resource paths resolve from the repository root. Do not also load `SKILL.md`.
|
|
@@ -1,171 +1,10 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: math-research-activator
|
|
3
3
|
description: |
|
|
4
|
-
|
|
5
|
-
English:
|
|
4
|
+
数学研究路由器:为 AI 架构/算子设计、理论性质分析、数学结构迁移,以及密码学定义、构造、归约与协议审查,选择必要的数学透镜、知识锚点和设计检查。也用于与 AI 研究有关的数学查询。纯实现型 debug、重构、调参和一般代码审查不触发。
|
|
5
|
+
English: Route AI architecture/operator design, theoretical analysis, math-to-AI transfer, and cryptographic definitions, constructions, reductions, or protocol reviews to the minimum necessary mathematical lenses, anchors, and design checks. Do not use for implementation-only debugging, refactoring, tuning, or general code review.
|
|
6
6
|
---
|
|
7
7
|
|
|
8
|
-
|
|
8
|
+
# 兼容入口
|
|
9
9
|
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
> "思想系统不负责给定理,知识系统不负责乱启发,设计层不负责装深刻。"
|
|
13
|
-
|
|
14
|
-
本系统是面向 AI 架构创新的数学参谋部——不是武器库,而是告诉你:**这场仗是什么仗、该用什么兵种、怎么部署、哪里会翻车。**
|
|
15
|
-
|
|
16
|
-
## 核心原则
|
|
17
|
-
|
|
18
|
-
> Math Skill 不存储数学,它激活数学、路由数学,并把数学翻译成 AI 研究设计。
|
|
19
|
-
|
|
20
|
-
- **knowledge-base/** 不是封闭百科,而是数学激活锚点集合(activation anchors)
|
|
21
|
-
- 当现有卡片不能覆盖问题时,Agent 不得停止或强行套用,而应基于透镜、参考层和自身数学知识生成"临时知识卡",继续完成设计翻译
|
|
22
|
-
- **design-patterns/** 是 math→AI 翻译原型集合,不是完整模型仓库;无对应模式时根据数学结构临时生成候选设计,并标记为 temporary design pattern
|
|
23
|
-
|
|
24
|
-
## 三层正交架构
|
|
25
|
-
|
|
26
|
-
| 层 | 职责 | 目录 | 核心问题 |
|
|
27
|
-
|----|------|------|---------|
|
|
28
|
-
| **思想透镜** | 诊断问题结构,推荐数学视角 | `../../lenses/*.md` | 这个问题该用什么视角看? |
|
|
29
|
-
| **激活锚点** | 激活高频数学结构,并在不足时触发 Knowledge Gap Protocol | `../../knowledge-base/*/*.md` | 这个视角需要激活哪些数学结构? |
|
|
30
|
-
| **设计翻译** | 把数学变成 AI 模块/loss/算子 | `../../design-patterns/*/*.md` | 这些数学怎么变成模型结构? |
|
|
31
|
-
|
|
32
|
-
辅助层:
|
|
33
|
-
- `../../references/books/*.md`:7 本书的蒸馏稿,需要深入时的完整上下文
|
|
34
|
-
- `../../references/gpu-friendly-math.md`:GPU 八维验收门(唯一权威)
|
|
35
|
-
- `../../agents/math-critic.md`:数学-工程双重批判器
|
|
36
|
-
|
|
37
|
-
## 意图诊断(5 场景)
|
|
38
|
-
|
|
39
|
-
| 场景 | 诊断信号 | 调用路径 |
|
|
40
|
-
|------|---------|---------|
|
|
41
|
-
| **A. 问题分析** | "这个设计合理吗?""逻辑链有没有漏洞?" | 透镜 → critic |
|
|
42
|
-
| **B. 机制设计** | "设计新 attention""把 X 迁移到 Y" | 透镜 → 激活锚点 → 设计 → critic |
|
|
43
|
-
| **C. 知识查询** | "流形上的切空间是什么?""投影定理怎么用?" | 激活锚点 |
|
|
44
|
-
| **D. 验证审查** | "这个公式成立吗?""loss 能保证什么?" | 激活锚点 → 相关设计模式(若引用具体 AI 构造)→ critic |
|
|
45
|
-
| **E. 纯工程** | debug、重构、调参、代码审查 | **不调用数学系统** |
|
|
46
|
-
|
|
47
|
-
## 透镜库(15 个数学视角)
|
|
48
|
-
|
|
49
|
-
15 个透镜覆盖:公理化、对偶、对称性、谱分解、几何、投影与分解、变分、局部到整体、拓扑、范畴化、扰动、因果、博弈、概率统计、算法。目录:`../../lenses/*.md`。完整目录表见 `../../references/skill-index.md`。
|
|
50
|
-
|
|
51
|
-
## 激活锚点(按数学领域组织)
|
|
52
|
-
|
|
53
|
-
7 个领域:矩阵分析、最优化、微分几何、李理论、拓扑、概率与信息、信息几何。目录:`../../knowledge-base/*/*.md`。完整目录表见 `../../references/skill-index.md`。
|
|
54
|
-
|
|
55
|
-
## 设计模式库(按 AI 组件组织)
|
|
56
|
-
|
|
57
|
-
5 个组件类型:注意力、损失函数、路由、表示、压缩。目录:`../../design-patterns/*/*.md`。完整目录表见 `../../references/skill-index.md`。
|
|
58
|
-
|
|
59
|
-
## 自动触发条件
|
|
60
|
-
|
|
61
|
-
**必须同时满足 Gate 1 + Gate 2 + Gate 3 才介入:**
|
|
62
|
-
|
|
63
|
-
### Gate 0 · 排除门(最高优先级)
|
|
64
|
-
以下任务**无论工作区含什么**都不触发:代码审查、debug、重构、调参、构建部署、纯事实查询、通用软件工程。
|
|
65
|
-
|
|
66
|
-
### Gate 1 · 环境信号
|
|
67
|
-
工作区含架构核心代码(attention/transformer/MoE、`*.cu`/kernel)或研究笔记。仅 `model.py`、`trainer.py` 等常规文件**不构成**环境信号。
|
|
68
|
-
|
|
69
|
-
### Gate 2 · 任务信号
|
|
70
|
-
用户任务涉及**设计/改进**新架构/算子、**分析**理论性质、**迁移**数学结构到 AI 设计,或**查询与 AI 研究相关的数学知识**(如"切空间在优化中怎么用")。纯百科式数学查询(如"什么是群"且无 AI 上下文)不自动触发,但可通过 `/ask` 手动进入。
|
|
71
|
-
|
|
72
|
-
### Gate 3 · 意图匹配
|
|
73
|
-
用户意图匹配场景 A/B/C/D 之一。纯工程任务匹配场景 E → 不介入。
|
|
74
|
-
|
|
75
|
-
> **`/ask` 入口**:手动调用时跳过 Gate 1 和 Gate 2,仅执行 Gate 0(排除门)+ Gate 3(意图匹配),可直接进入任意场景包括知识查询。
|
|
76
|
-
|
|
77
|
-
## 主流程
|
|
78
|
-
|
|
79
|
-
### 第一步:诊断意图
|
|
80
|
-
1. 判断用户意图属于场景 A/B/C/D/E 哪个
|
|
81
|
-
2. 提取问题核心张力:想保留什么?想抑制什么?约束是什么?工程瓶颈是什么?
|
|
82
|
-
3. 输出问题类型分类
|
|
83
|
-
|
|
84
|
-
### 第二步:路由调用
|
|
85
|
-
|
|
86
|
-
```
|
|
87
|
-
场景 A(分析):选 1-3 个透镜 → 输出视角诊断 → critic 审查
|
|
88
|
-
场景 B(设计):选 1-3 个透镜 → 调用相关激活锚点;若无覆盖则进入 Knowledge Gap Protocol → 生成正式/临时设计模式 → critic 审查
|
|
89
|
-
场景 C(查询):优先加载相关激活锚点;若无覆盖则生成临时知识卡 → 按知识激活协议输出
|
|
90
|
-
场景 D(验证):加载相关锚点或临时知识卡 → critic 审查条件与边界
|
|
91
|
-
场景 E(工程):不介入
|
|
92
|
-
```
|
|
93
|
-
|
|
94
|
-
### 第三步:输出格式
|
|
95
|
-
|
|
96
|
-
**Token 经济原则**:以下是最长结构,不是默认全文模板。按用户问题裁剪;简单知识查询只给必要定义/公式/风险,设计与 GPU 内容只在与问题有关时展开;避免复述已加载卡片全文。
|
|
97
|
-
|
|
98
|
-
**场景 A/B 输出**:
|
|
99
|
-
1. **[诊断]** 问题类型 + 核心张力
|
|
100
|
-
2. **[透镜]** 推荐 1-3 个数学视角(标注为什么适合/不适合)
|
|
101
|
-
3. **[知识]**(仅场景 B)激活的数学结构(引用激活锚点或临时知识卡)
|
|
102
|
-
4. **[设计]**(仅场景 B)候选 AI 模块草案(引用设计模式或临时设计草案)
|
|
103
|
-
5. **[GPU]** 候选过八维门(友好/可改造/不友好)
|
|
104
|
-
6. **[结论]** 保留通过双验收门的候选 + 下一步建议
|
|
105
|
-
|
|
106
|
-
**场景 C 输出**(知识激活协议,按需裁剪):
|
|
107
|
-
1. 最小定义
|
|
108
|
-
2. 核心公式
|
|
109
|
-
3. 适用问题
|
|
110
|
-
4. AI 设计翻译(仅当问题与 AI/算子相关)
|
|
111
|
-
5. 工程可行性(仅当涉及实现/GPU)
|
|
112
|
-
6. 风险与失效条件
|
|
113
|
-
7. 深入参考(仅当用户要追溯或结论依赖外部书稿)
|
|
114
|
-
|
|
115
|
-
**场景 D 输出**(优先短结论 + 条件边界):
|
|
116
|
-
1. 成立条件
|
|
117
|
-
2. 不成立条件
|
|
118
|
-
3. 最多能保证什么
|
|
119
|
-
4. 不能保证什么
|
|
120
|
-
5. 工程可行性(仅当涉及实现/GPU)
|
|
121
|
-
|
|
122
|
-
**必须给出结论,不得只输出分析而不收敛。**
|
|
123
|
-
|
|
124
|
-
## GPU 八维验收门
|
|
125
|
-
|
|
126
|
-
正式术语(唯一权威来源:`../../references/gpu-friendly-math.md`):
|
|
127
|
-
**张量化 / GEMM 可映射 / 复杂度 / 显存与 KV-Cache / 低精度稳定 / 并行与通信 / 稀疏结构 / 算子融合**
|
|
128
|
-
|
|
129
|
-
**量化评估要求**:对每个候选设计,GPU 评估不应只给 [v]/[~]/[x] 标签,还需回答:
|
|
130
|
-
1. 核心操作的 FLOPs 和与 baseline 的比值
|
|
131
|
-
2. 峰值显存 (bytes),是否物化大矩阵
|
|
132
|
-
3. bf16/fp8 下的数值稳定性策略
|
|
133
|
-
4. 可融合的 kernel 数和预期加速
|
|
134
|
-
|
|
135
|
-
详见 `../../references/gpu-friendly-math.md` 的量化检查清单。
|
|
136
|
-
|
|
137
|
-
## 深度查阅协议
|
|
138
|
-
|
|
139
|
-
- **轻度**:读知识卡片(`../../knowledge-base/*/*.md`),自足可用
|
|
140
|
-
- **中度**:读书蒸馏稿(`../../references/books/*.md`),获取更完整上下文
|
|
141
|
-
- **深度**:本机有 `math_book/<PDF>` 时,Agent 自动 `pdftotext` + grep 定位原文页
|
|
142
|
-
|
|
143
|
-
## 知识缺口协议 / Knowledge Gap Protocol
|
|
144
|
-
|
|
145
|
-
当用户问题需要的数学工具不在现有 `knowledge-base/` 中时,不得强行套用已有卡片。执行以下流程:
|
|
146
|
-
|
|
147
|
-
1. **缺口识别**:明确指出现有知识库中没有完全对应的知识卡片。判断缺口属于:新领域、新定理族、新结构、新应用场景,还是已有卡片的组合扩展。
|
|
148
|
-
|
|
149
|
-
2. **透镜回退**:选择 1-3 个最相关思想透镜,用它们确定问题的数学结构。例如:局部到整体、范畴化、谱分解、投影、因果、扰动等。
|
|
150
|
-
|
|
151
|
-
3. **候选知识定位**:给出应查找的数学关键词、定理族、概念簇、参考书方向。不要求已有知识卡覆盖,但必须说明为什么这些知识相关。
|
|
152
|
-
|
|
153
|
-
4. **临时知识卡**:生成一个"临时知识摘要",格式同正式知识卡:
|
|
154
|
-
- 最小定义
|
|
155
|
-
- 核心结构
|
|
156
|
-
- 适用问题
|
|
157
|
-
- AI 设计翻译
|
|
158
|
-
- GPU 可行性
|
|
159
|
-
- 风险与失效条件
|
|
160
|
-
- **来源与置信度**(必填):
|
|
161
|
-
- 知识来源:标注为"Agent 推断 / 透镜推导 / 参考书外推 / 需外部验证"
|
|
162
|
-
- 置信度:高(有定理支撑)/ 中(合理推断但未严格证明)/ 低(探索性假说)
|
|
163
|
-
- 未核验声明:列出需要后续验证的关键结论
|
|
164
|
-
|
|
165
|
-
5. **设计翻译**:若用户目标是机制设计,则将临时知识转译为候选 AI 模块、loss、routing、attention、representation 或 compression 方案。
|
|
166
|
-
|
|
167
|
-
6. **升级建议**:如果该缺口高频出现,建议新增正式 knowledge card 或 design pattern。
|
|
168
|
-
|
|
169
|
-
## 工作流范例
|
|
170
|
-
|
|
171
|
-
完整工作流范例见 `../../references/skill-index.md`。
|
|
10
|
+
这是 Claude/plugin 风格的兼容入口。完整读取并遵循 `../../SKILL.md`;该根文件是唯一权威正文,所有资源路径均相对仓库根解析。不要同时读取 `SKILL.en.md`。
|