Skip to content
Skills Library
Finance & accounting · Review & audit

auditcore-multi-agent-audit

/auditcore-multi-agent-audit

Use when auditing financial spreadsheets (.xlsx or .csv), detecting accounting fraud, split transactions, Benford's law anomalies, or internal control defects, retrieving Chinese auditing standards (CSA) or enterprise internal control regulations, or generating CSA-1131 compliant audit working papers (.docx and .md). Triggers on financial audit, voucher review, audit workpaper, split transaction fraud, 财务审计, 凭证核查, 审计底稿, 拆单舞弊, 法规检索, 内控缺陷核查.

Licence
MIT
Last repository change
07.11.2026

Assessment and security

95/ 100Class: good
Format20 / 25
Frontmatter with name and description, valid name, description up to 1,024 characters, name matching the folder.
Discoverability25 / 25
Description explains when to use the skill, has a reasonable length and uses third person.
Content35 / 35
At least 150 words and at most 500 lines, headings, step lists, examples or code.
Hygiene15 / 15
No placeholders such as TODO, no Windows paths, with a licence.
Riskno signals detected in the scan
Files in this package
26
Scripts
13
HTML comments
0
URLs in SKILL.md
0
Deprecation

No signals detected. Repository changed on 07.11.2026, without references to retired models or APIs.

Licence

MIT, open: use and modify while retaining author attribution.

What to check before installing
  • 13 scripts in this package. Review them before installing, as Claude may execute them.

Scripts: mcp_server.py, scripts/__init__.py, scripts/audit_cli.py, scripts/engine/__init__.py, scripts/engine/contracts.py, scripts/engine/data_loader.py, scripts/engine/docx_generator.py, scripts/engine/evidence_graph.py

What it does and when to use it

Use when auditing financial spreadsheets (.xlsx or .csv), detecting accounting fraud, split transactions, Benford's law anomalies, or internal control defects, retrieving Chinese auditing standards (CSA) or enterprise internal control regulations, or generating CSA-1131 compliant audit working papers (.docx and .md). Triggers on financial audit, voucher review, audit workpaper, split transaction fraud, 财务审计, 凭证核查, 审计底稿, 拆单舞弊, 法规检索, 内控缺陷核查.

Original author description

Use when auditing financial spreadsheets (.xlsx or .csv), detecting accounting fraud, split transactions, Benford's law anomalies, or internal control defects, retrieving Chinese auditing standards (CSA) or enterprise internal control regulations, or generating CSA-1131 compliant audit working papers (.docx and .md). Triggers on financial audit, voucher review, audit workpaper, split transaction fraud, 财务审计, 凭证核查, 审计底稿, 拆单舞弊, 法规检索, 内控缺陷核查.

How it works

  1. 一、 架构总览 (Overview)
  2. 二、 三大核心铁律 (IRON RULES — 违反任一条即视为审计失效)
  3. 三、 五大运行模式路由表 (5 Operational Modes)
  4. 四、 full-audit 标准五步状态机执行协议 (5-Step Stateful Protocol)
  5. 五、 常见借口与防偷懒对照表 (Rationalization Table & Red Flags)
Original SKILL.md headings · 163 lines, 772 words
SKILL.md preview
---
name: auditcore-multi-agent-audit
description: Use when auditing financial spreadsheets (.xlsx or .csv), detecting accounting fraud, split transactions, Benford's law anomalies, or internal control defects, retrieving Chinese auditing standards (CSA) or enterprise internal control regulations, or generating CSA-1131 compliant audit working papers (.docx and .md). Triggers on financial audit, voucher review, audit workpaper, split transaction fraud, 财务审计, 凭证核查, 审计底稿, 拆单舞弊, 法规检索, 内控缺陷核查.
---

# AuditCore 多智能体协同审计与底稿生成技能 (AuditCore Multi-Agent Audit Skill)

## 一、 架构总览 (Overview)

**AuditCore Skill** 采用 **“借脑保核 (Host-Brain + Deterministic-Core)”** 架构:
- **免外部 API Key 的多智能体盲审委员会**:直接复用宿主智能体(Claude Code、Antigravity、Codex、OpenClaw 等)的子智能体派遣能力,拉起四个上下文物理隔离的审计角色(`junior-auditor`、`challenger-auditor`、`fact-checker`、`senior-partner`)。
- **确定性专利算法内核 (`scripts/audit_cli.py`)**:通过有状态 CLI 引擎强制执行 **PII 加密脱敏与 SHA-256 哈希链审计日志**、**三级重要性水平过滤**、**六维确定性规则穿透(本福德定律、Z-Score、整十万/整万异常、周末记账、同日拆单规避审批、负数红字冲销/重复凭证)**、**免 PyTorch 三路混合法规检索 $H(q, c_i)$**、**四层证据拓扑因果图与二部图损失验证**、**DAG 状态机最小割局部回退**,以及 **CSA-1131 四要素 Word (`.docx`) / Markdown (`.md`) 底稿自动生成与 PII 逆向还原**。

---

## 二、 三大核心铁律 (IRON RULES — 违反任一条即视为审计失效)

### IRON RULE 1:PII 零泄露物理隔离门禁 (Zero-Leakage Privacy Gate)
- **严禁直接读取原始账套**:在执行 `scripts/audit_cli.py init` 之前或之后,**绝对禁止**使用 `pandas`、`python`、`cat`、`head` 或文件读取工具直接查看用户的原始 `.xlsx`/`.csv` 文件内容!
- **严禁触碰加密保险箱**:`init` 生成的 `.auditcore_workspace/cases/<CASE_ID>/.vault_do_not_read.json` 采用 XOR-SHA256-HMAC 加密保存真实企业与账号映射,**宿主与任何子智能体严禁读取或解密该文件**。
- **全流程脱敏推理**:所有 SQL 探索与四角色盲审推理必须严格使用 `PERSON_0001`、`ACCT_0001` 等脱敏占位符;真实企业名称仅在最终 `audit_cli.py export` 阶段由确定性脚本在本地完成逆向还原。

### IRON RULE 2:四角色子智能体独立盲审契约 (Blinded Subagent Isolation)
- 在 `full-audit` 模式下,**严禁在主对话中“单模型自言自语分饰四角”**。
- 必须按状态机顺序,依次读取 `agents/` 下的对应角色契约文件并派生独立子智能体(使用宿主的 `invoke_subagent` / `Task` / `Agent` 工具):
  1. 初审:`agents/junior-auditor.md` -> 提交 `--role junior`
  2. 独立复核:`agents/challenger-auditor.md` -> 提交 `--role challenger`
  3. 事实核查:`agents/fact-checker.md` -> 提交 `--role factcheck`
  4. 终审合伙人:`agents/senior-partner.md` -> 提交 `--role senior`
- **降级兼容规则**:仅当宿主环境不支持任何子智能体派遣工具时,方可在主会话中分步独立生成各角色 JSON,但每一步生成后**必须立即调用 `audit_cli.py commit`** 通过确定性证据图核验,绝不可跳步合并。

### IRON RULE 3:有状态 CLI 强制门禁与最小割回退闭环 (Stateful CLI & Minimum-Cut Rollback)
- 每一个角色结论必须通过 `scripts/audit_cli.py commit --role <role>` 提交。若违反状态机顺序,CLI 将返回退出码 `2` (`STATE_GUARD_VIOLATION`)。
- 当提交 `factcheck` 后,若全局一致性评分 $S_{\text{global}} < \theta$(默认 `0.80`),CLI 将自动执行**依赖感知最小割局部回退**,返回 `"rollback_triggered": true` 及 `rollback_diagnosis.arbitration_probe`(核查探针),并将状态回退至 `STATE_JUNIOR_AUDIT` 或 `STATE_CHALLENGER_REVIEW`。
- **遇到 `rollback_triggered: true` 时,必须将 `rollback_diagnosis` 注入目标角色重新派生子智能体**,直至一致性达标进入 `STATE_SENIOR_PARTNER`!严禁手写伪造底稿跳过 `export`。

---

## 三、 五大运行模式路由表 (5 Operational Modes)

根据用户诉求自动选择对应模式(默认执行 **`full-audit`**):

| 模式名称 | 适用场景与触发词 | 执行路径 |
| :--- | :--- | :--- |
| **`full-audit`**<br>*(默认全流程)* | 审计账套文件、全面排查舞弊/内控缺陷并出具正式底稿 | 完整执行下方 **第四节:标准五步状态机协议**(`init` $\to$ `sql` $\to$ 四角色盲审与最小割回退循环 $\to$ `export`) |
| **`quick-scan`**<br>*(快速扫描)* | “快速扫一下异常”、“不用跑多智能体博弈,只看规则扫描结果” | 1. 运行 `audit_cli.py init --file <PATH> --case <ID> --mode quick`<br>2. 可选运行 `audit_cli.py export --case <ID> --out-dir <DIR>` 快速导出规则扫描底稿 |
| **`sql-explore`**<br>*(SQL 沙箱穿透)* | 对已初始化账套执行自定义跨期/分组聚合查询 | 运行 `audit_cli.py sql --case <ID> --query "SELECT ... FROM financial_ledger ..."`(仅限只读 `SELECT / WITH`) |
| **`law-lookup`**<br>*(法规混合检索)* | “查一下拆单/周末入账/审计证据相关的准则条款” | 运行 `audit_cli.py law --query "<关键词或问题>" --top-k 5`,直接输出加权证据链 $E(q)$ 与定性推理四阶段结论 $\Psi$ |
| **`workpaper`**<br>*(底稿重导出)* | 对已完成终审的案件更换单位名称、会计期间或导出目录 | 运行 `audit_cli.py export --case <ID> --entity-name "<单位名称>" --period "<期间>" --out-dir <DIR>` |

> 详细 CLI 参数与 JSON Schema 请按需查阅:`references/schemas.md`。

---

## 四、 `full-audit` 标准五步状态机执行协议 (5-Step Stateful Protocol)

假设技能根目录为 `<SKILL_DIR>`(包含 `scripts/audit_cli.py`)。若用户未提供账套文件而要求演示,可直接使用内置高仿真舞弊样本账套 `<SKILL_DIR>/examples/sample_vouchers_2026.xlsx`。

### Step 1:初始化账套、加密脱敏与确定性规则穿透 (`init`)
```bash
python3 <SKILL_DIR>/scripts/audit_cli.py init \
  --file "<USER_EXCEL_OR_CSV_PATH>" \
  --case "CASE_2026_01" \
  --workspace ".auditcore_workspace" \
  --lang "中文"
```
- 记录返回的 JSON:`stats`、`schema_ddl`、`rule_findings`、`anomaly_samples`、`evidence_chain`。
- 此时状态机位于 `STATE_DYNAMIC_SQL_EXPLORATION`。

### Step 2:只读 SQLite 沙箱穿透查询 (`sql`)
基于 `schema_ddl` 与 `rule_findings`,编写一条针对脱敏表 `financial_ledger` 的聚合核查 SQL(例如核查同一供应商同日拆单笔数与累计金额,或按借方科目汇总异常金额):
```bash
python3 <SKILL_DIR>/scripts/audit_cli.py sql \
  --case "CASE_2026_01" \
  --workspace ".auditcore_workspace" \
  --query "SELECT Date, Vendor, COUNT(*) AS tx_count, SUM(Amount) AS total_amount FROM financial_ledger GROUP BY Date, Vendor HAVING tx_count >= 2 OR total_amount >= 100000 ORDER BY total_amount DESC"
```
- 此时状态机推进至 `STATE_JUNIOR_AUDIT`。

### Step 3:多智能体独立盲审与最小割局部回退循环 (`commit` Loop)

#### 3.1 派生初级审计员 (`STATE_JUNIOR_AUDIT`)
1. 读取 `<SKILL_DIR>/agents/junior-auditor.md`。
2. 派生子智能体(或独立步骤),仅传入脱敏 `stats`、`rule_findings`、`anomaly_samples`、`sql` 结果、`evidence_chain`(若为回退重审,额外传入 `rollback_diagnosis`)。
3. 获取子智能体返回的 JSON(含 `analysis`、`risk_score`、`cited_reg_ids`),提交至 CLI:
```bash
python3 <SKILL_DIR>/scripts/audit_cli.py commit \
  --case "CASE_2026_01" \
  --workspace ".auditcore_workspace" \
  --role junior \
  --payload '<JUNIOR_JSON>'
```
- 状态机推进至 `STATE_CHALLENGER_REVIEW`。

#### 3.2 派生独立复核人 (`STATE_CHALLENGER_REVIEW`)
1. 读取 `<SKILL_DIR>/agents/challenger-auditor.md`。
2. 派生独立子智能体,传入脱敏异常证据、`evidence_chain` 以及初审的 `junior_report` 与 `junior_score`,要求其以职业怀疑态度独立复核质询。
3. 获取返回的 JSON(含 `rebuttal`、`adjusted_risk_score`),提交至 CLI:
```bash
python3 <SKILL_DIR>/scripts/audit_cli.py commit \
  --case "CASE_2026_01" \
  --workspace ".auditcore_workspace" \
  --role challenger \
  --payload '<CHALLENGER_JSON>'
```
- 状态机推进至 `STATE_FACT_CHECK`。

#### 3.3 派生事实核查员并检验全局一致性 (`STATE_FACT_CHECK`)
1. 读取 `<SKILL_DIR>/agents/fact-checker.md`。
2. 派生独立子智能体,对初审与复核结论执行**原子事实拆解 (`claims`)** 与 **二部图证据映射 (`evidence_mapping`)**。
3. 获取返回的 JSON(含 `analysis`、`support_score`、`conflict_score`、`conflict_type`、`claims`、`evidence_mapping`),提交至 CLI:
```bash
python3 <SKILL_DIR>/scripts/audit_cli.py commit \
  --case "CASE_2026_01" \
  --workspace ".auditcore_workspace" \
  --role factcheck \
  --payload '<FACTCHECK_JSON>'
```
4. **检查 CLI 返回的 `current_state` 与 `rollback_triggered`**:
   - 若 `"rollback_triggered": true`:说明证据图存在严重冲突($S_{\text{global}} < \theta$),CLI 已自动切除最差推理子图并回退至 `rollback_target_state`(通常为 `STATE_JUNIOR_AUDIT`)。你**必须**提取返回的 `rollback_diagnosis`(含 `arbitration_probe` 与 `csa_guidance`),回到 **3.1**(或 **3.2**)重新派生子智能体修正结论!
   - 若 `"current_state": "STATE_SENIOR_PARTNER"`:说明证据图一致性达标,进入 Step 4。

### Step 4:派生高级合伙人作出终审裁决与审计调整分录 (`STATE_SENIOR_PARTNER`)
1. 读取 `<SKILL_DIR>/agents/senior-partner.md`。
2. 派生独立子智能体,传入脱敏统计、法规证据链、通过核验的初审/复核结论,生成终审裁决(`final_verdict`、`final_risk_score`、`reasoning`、`action_item`、`suggested_aje`)。
3. 提交至 CLI:
```bash
python3 <SKILL_DIR>/scripts/audit_cli.py commit \
  --case "CASE_2026_01" \
  --workspace ".auditcore_workspace" \
  --role senior \
  --payload '<SENIOR_JSON>'
```
- 状态机推进至 `STATE_WORKPAPER_GENERATION`。

### Step 5:组装四要素底稿、评估质量 $Q(Y)$、逆向还原 PII 并导出 CSA-1131 底稿 (`export`)
```bash
python3 <SKILL_DIR>/scripts/audit_cli.py export \
  --case "CASE_2026_01" \
  --workspace ".auditcore_workspace" \
  --out-dir "./audit_outputs" \
  --entity-name "被审计单位" \
  --period "2026年度"
```
- CLI 将自动完成 PII 实体名称逆向还原,并生成:
  1. `workpaper_docx_path`:符合中国注册会计师审计准则第 1131 号的正式 `.docx` Word 审计工作底稿;
  2. `workpaper_markdown_path`:结构化 `.md` 审计工作底稿;
  3. `quality_evaluation`:包含 $Q_{\text{ev}}$、$Q_{\text{con}}$、$Q_{\text{cmp}}$、总分 $Q(Y)$ 及零容忍幻觉校验结果的评估报告。
- 向用户汇报最终审计发现、展示还原后的真实涉事单位名称、审计调整分录 (AJE)、质量评分 $Q(Y)$ 及生成的 `.docx` / `.md` 文件路径。

---

## 五、 常见借口与防偷懒对照表 (Rationalization Table & Red Flags)

| 智能体常见偷懒借口 (Rationalization) | 客观事实与铁律反制 (Reality & Iron Rule) |
| :--- | :--- |
| “账套文件很小,我先用 `pandas.read_excel` 看一眼里面有什么列和供应商。” | **严重违规 (违反 IRON RULE 1)**!一旦直接读取原始文件,明文企业名称与银行账号即刻暴露在 LLM 上下文中,彻底破坏隐私合规边界。必须且只能先运行 `audit_cli.py init`。 |
| “为了省时间,我直接在一个代码块里同时写好初审、复核、事实核查和合伙人的 JSON 并连续 commit。” | **严重违规 (违反 IRON RULE 2)**!单上下文同时编造四个角色会引发严重的确认偏误(Confirmation Bias)。若宿主支持子智能体,必须独立派生;即使顺序执行,也必须在每次 `commit` 后读取 CLI 的证据图反馈再执行下一步。 |
| “`factcheck` 提交后触发了 `rollback_triggered: true`,我直接改一下 JSON 里的分数再提交 `senior` 吧。” | **状态门禁直接拦截 (退出码 2)**!回退后状态机处于 `STATE_JUNIOR_AUDIT`(或 `STATE_CHALLENGER_REVIEW`),不按 `rollback_diagnosis.arbitration_probe` 重跑前序角色,状态机绝不会放行至 `STATE_SENIOR_PARTNER`。 |
| “我已经知道审计结论了,自己写一份 Markdown 报告给用户就行,不用调 `audit_cli.py export`。” | **严重违规 (违反 IRON RULE 3)**!手写报告无法解密 `.vault_do_not_read.json` 中的真实企业名称(只能输出 `PERSON_0001`),且缺失专利四要素结构 $Y=\{\text{idx},\text{aje},\text{jud},\text{log}\}$、质量评分 $Q(Y)$ 与 CSA-1131 `.docx` 正式底稿。 |

### Red Flags — 出现以下念头时立即停止并回到 CLI 协议:
- 准备运行 `pd.read_excel` / `pd.read_csv` / `open()` 读取用户原始财务文件
- 准备读取 `.vault_do_not_read.json`
- 在分析中编造未出现在 `evidence_chain` 中的法条编号(会触发 `hallucinated_citations` 零容忍降级,将 $Q(Y)$ 强制压低至 $\le 0.40$)
- 跳过 `sql` 或任意 `commit --role` 步骤直接尝试 `export`
Files in this package (26)
  • .gitignore 1 KB
  • LICENSE 1 KB
  • README.md 13 KB
  • SKILL.md 13 KB
  • mcp_server.py 5 KB
  • requirements.txt 1 KB
  • agents/challenger-auditor.md 4 KB
  • agents/fact-checker.md 5 KB
  • agents/junior-auditor.md 5 KB
  • agents/senior-partner.md 5 KB
  • examples/sample_vouchers_2026.xlsx 7 KB
  • examples/sample_workpaper_preview.md 8 KB
  • references/regulations_corpus.json 12 KB
  • references/schemas.md 7 KB
  • scripts/__init__.py 1 KB
  • scripts/audit_cli.py 36 KB
  • scripts/generate_sample_data.py 6 KB
  • scripts/engine/__init__.py 1 KB
  • scripts/engine/contracts.py 7 KB
  • scripts/engine/data_loader.py 11 KB
  • scripts/engine/docx_generator.py 15 KB
  • scripts/engine/evidence_graph.py 16 KB
  • scripts/engine/privacy_layer.py 12 KB
  • scripts/engine/rag_lite.py 28 KB
  • scripts/engine/rule_agent.py 8 KB
  • scripts/engine/state_machine.py 14 KB

Versions

The database has no other skills named auditcore-multi-agent-audit.

Database snapshot: 13.11.2026 · package version 4ba672edb82c (SHA-256 digest of the entire package)

Downloads in the last 30 days: 0 · ranking

: harmful content, incorrect descriptions or an author’s removal request.

Similar skills

  • 100algo-risk-benford
    Apply Benford's Law to detect anomalies in numerical datasets by analyzing first-digit frequency distributions. Use this skill when the user needs to audit financial data for fraud indicators, validate data integrity, or detect fabricated numbers — even if they say 'data…
  • 100ft-internal-audit
    Use when: user needs internal control evaluation, process audit, fraud detection, COSO framework application, or audit workpaper preparation. Trigger: ''内部审计'', ''内控'', ''舞弊'', ''COSO'', ''审计底稿'', ''职责分离'', ''控制缺陷''. NOT for: external audit (CPA statutory audit) or financial…
  • 100wp-generator
    生成审计工作底稿——按事务所底稿编码规则和模板样式, 将各审计程序的执行记录汇总为结构化底稿。 遵循 CSA 1131 号(审计工作底稿)和中国注协审计工作底稿指引。 在审计程序执行完毕后使用,用于整理和归档。
  • 100report-drafting
    起草审计报告——根据审计执行结果和发现的错报, 确定审计意见类型并生成审计报告草稿。 遵循 CSA 1501~1504 号(审计意见与报告相关准则)。 在三级复核完成后使用。
  • 80domain-fintech:fraud-detection
    Guides fraud detection implementation: rule-based detection (velocity checks, amount thresholds, geo-anomalies), ML-based anomaly detection (isolation forest, autoencoders), device fingerprinting, behavioral biometrics, 3DS2, fraud scoring pipelines, case management, and…
  • 90forensic-accounting
    When the user wants to investigate financial discrepancies, fraud, or hidden assets. Also use when the user mentions "suspicious transactions," "missing funds," "embezzlement check," "laundering detection," "shell company audit," "whistleblower claims," or "something doesn't add…

Feedback and reports

Your message goes to Bartosz Sokoliński. An email address is needed only for a reply. See the privacy policy.