Audit End logo

Audit End

Community
RickyTong1
audit-end

结束审计会话,汇总审计数据,执行完整性检查,保存到 .claude/runs/。当用户说"完成了"、"结束"、"暂停"、"今天到这",或当前任务已完成需要保存审计记录时使用。

Overview

PublisherRickyTong1
Repositoryaudit-harness
Skill nameaudit-end
Stars
467
Forks
3
Bundled files
Instructions only
LicenseMIT
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 RickyTong1 on GitHub. Read the source before you install it.

Installation

Install the Audit End 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/RickyTong1/audit-harness/tree/main/skills/audit-end
  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/RickyTong1/audit-harness.git /tmp/audit-harness
mkdir -p .claude/skills
cp -r /tmp/audit-harness/skills/audit-end .claude/skills/audit-end
Restart Claude Code after copying so it picks up the new skill.

Use it in TypingMind

Enable Audit End 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 Audit End 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 Audit End 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.

/end — 审计会话结束 + 完整性检查

触发方式

/end

执行步骤

1. 确定当前 session

读取 .claude/runs/.current_session 获取 session_id。

如果文件不存在:

  • 检查是否有 auto_ session(Stop hook 自动创建的)
  • 如果有,使用最近的 auto session
  • 如果没有,提示用户"当前没有活跃的审计会话"

2. 收集审计数据

不是"扫描对话历史"——Skill 无法访问对话历史。 实际数据来源是 hooks 已经收集好的文件:

来源 1: .claude/runs/audit_buffer.jsonl
  → PostToolUse hook 自动记录的 Write/Edit/Bash 操作
  → 每条包含 timestamp, tool, files, detail

来源 2: .claude/runs/audit_pending.jsonl
  → Claude 主动写入的 [AUDIT] 块(JSON 格式)
  → 每条包含 batch, action, input, output

来源 3: .claude/runs/{session_id}/audit_trail.jsonl
  → Stop hook 已归档的历史记录(之前轮次的 buffer + pending)

汇总步骤:

  1. 读取 audit_buffer.jsonl 和 audit_pending.jsonl 中的剩余数据(Stop hook 可能还没来得及归档最后一轮)
  2. 追加到 .claude/runs/{session_id}/audit_trail.jsonl
  3. 清空 buffer 和 pending

3. 提取用户修正

在 audit_trail.jsonl 和 audit_pending.jsonl 中搜索 user_correction 类型的记录。如果本次会话中有用户纠正 Claude 的判断,标记为高优先级恢复项并写入 audit_trail:

json
{
    "record_type": "conversation",
    "action_type": "user_correction",
    "priority": "critical_for_recovery",
    "original_claim": "Claude 的原始判断",
    "correction": "用户的修正",
    "principle_extracted": "提取的通用原则",
    "persisted_to": ["写入了哪些文件"]
}

4. 审计完整性检查

从 audit_trail.jsonl 和 audit_buffer.jsonl 中提取信息执行检查:

检查项数据源通过条件失败处理
有审计记录audit_trail.jsonl 行数> 0⚠️ "审计性为 0"
文件修改有记录audit_trail 中 tool=Write/Edit 的条目每个修改过的文件都有记录⚠️ 列出未审计的文件
Prompt 修改有验证audit_trail 中含 "prompt" 的条目必须有包含 "回归测试" 或 "10000" 的条目❌ "Prompt 修改未验证"
Prompt 修改有 Harness 日志L1 附录 D已更新⚠️ 提醒补充
用户修正已持久化user_correction 条目已写入 CLAUDE.md 或文档⚠️ 提醒持久化

输出格式:

=== 会话审计检查 ===
会话: {session_id}
任务: {session.json 中的 task}
时长: {start → end}

[✅] 审计记录: {N} 条
[✅] 文件修改已记录 ({M} 个文件)
[⚠️] L1 附录 D 需要更新
[✅] 用户修正已持久化 (2 条)

Record 统计:
  工具操作:    {tool_use 记录数} 条
  [AUDIT] 块:  {pending 记录数} 条
  user_correction: {修正记录数} 条

5. 生成会话总结

写入 .claude/runs/{session_id}/session_summary.md:

markdown
# 会话总结 | {session_id}

## 任务: {描述}
## 时间: {start} → {end}
## 状态: completed

## 完成的工作
- {audit_trail 中的 action 列表}

## 关键结论
- {audit_pending 中的 output 字段}

## 用户修正
- {user_correction 记录}

## 遗留问题
- {检查中发现的问题}

6. 更新状态文件

bash
# 更新 session.json
# status = "completed", end_time = now()

# 更新 .claude/runs/index.json(如果 Stop hook 已创建)

# 清除 .current_session(会话已结束)
rm -f .claude/runs/.current_session

7. 注意事项

  • 即使检查发现问题,也要完成保存——记录比完美更重要
  • ⚠️ 是建议(不阻止保存),❌ 是严重警告(仍然保存,但必须提醒用户)
  • /end 之后 Stop hook 仍会触发一次(归档 /end 本身的操作),这是正常的

Frequently asked questions

What does the Audit End AI skill do?

结束审计会话,汇总审计数据,执行完整性检查,保存到 .claude/runs/。当用户说"完成了"、"结束"、"暂停"、"今天到这",或当前任务已完成需要保存审计记录时使用。

Why use Audit End on TypingMind?

Because you install it once and use it with any model. Audit End 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 Audit End in TypingMind?

Open Plugins → Skills → Install from GitHub in TypingMind and paste https://github.com/RickyTong1/audit-harness/tree/main/skills/audit-end. TypingMind reads its SKILL.md and installs it as a skill you can enable per chat.

Which AI models can use Audit End?

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 Audit End?

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

Is the Audit End AI skill free?

Yes. It is published on GitHub by RickyTong1 under the MIT license. 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 👇