json-patch-audit
Installation
Review the source and dependencies with a prompt. A package is available to download.
Install with an AI assistant
Copy the prompt so your assistant can review the pinned revision and dependencies first.
View promptHide prompt
Check whether SkillPI Skill Finder is installed for your current agent. If it is missing, install and enable it using the official instructions at https://github.com/Findskills/skillpi. Then use Skill Finder to locate and install "json-patch-audit" from this exact SkillPI detail page: https://skillpi.com/skills/deepskill-8db3c12ec9a17fcc5485b1ab0a8ee4c556756a9260e50c59ddae0518178b7ed5. Verify the upstream source and version against https://skillhub.cn/skills/user_f1b049da/mwqc2026819 before installing. If they do not match, stop and report the mismatch. Report the installed path and source version.
Source and setup
skillhub.cn
Setup guidance pending
See the original source for supported tools, dependencies, and permissions.
Installation test pending
Generate user-profile change patches with fast-json-patch and record before/after field differences; suitable for profile-change audits, JSON Patch generation, and field-change logging.
Introduction source: third_party · user_f1b049da · 1.0.0 Reference
SkillPi interpretation
- Tasks
- Translation pending; see source documentation.
- Testing
- Not tested
Browse files
Frontmatter
name: json-patch-audit
slug: mwqc2026819
displayName: 资料修改审计
version: 1.0.0
summary: 用 fast-json-patch 生成客户资料变更补丁,记录字段前后差异。
license: MIT
description: 用 fast-json-patch 生成客户资料变更补丁,记录字段前后差异。当用户要资料改动审计、JSON Patch、字段变更日志时使用。资料修改审计(JSON Patch)
灵感:能力工具箱 json-patch(pkg: fast-json-patch)。
对比客户资料「改前 / 改后」对象,生成 RFC6902 JSON Patch,便于审计谁改了哪些字段;也可 applyPatch 回放。
何时使用
- 保存客户前生成变更日志
- 审核「改了手机号/阶段」等差异列表
硬约束
- 使用
fast-json-patch的compare/applyPatch(或等价实现)。 - 输入为两个纯 JSON 对象;输出 patch 数组 + 可读摘要(路径、op、旧值/新值)。
- 敏感字段(手机、证件)摘要可脱敏展示,完整值仅存审计库。
applyPatch失败要捕获并提示路径冲突。- 与「跟进笔记 Diff」区分:本 Skill 面向结构化 JSON,非纯文本行 diff。
推荐实现要点
import { compare, applyPatch, type Operation } from 'fast-json-patch'
export function diffCustomer(before: object, after: object): Operation[] {
return compare(before, after)
}
export function summarizePatch(patch: Operation[]) {
return patch.map((op) => ({
op: op.op,
path: op.path,
value: 'value' in op ? op.value : undefined,
}))
}
export function applyCustomerPatch<T extends object>(doc: T, patch: Operation[]) {
const result = applyPatch(structuredClone(doc), patch, true, false)
return result.newDocument
}
Agent 步骤
- 在保存钩子中
compare(old, new),有变更才写审计。 - UI 用路径映射中文字段名。
- 自测:改
mobile应产生replace操作。
附加
Current listing version
1.0.0
Safety and assessment details
Quality assessment
Out of 100 · Assessment report from SkillPi LAB.
Highlights
- 提供客户资料变更审计功能,生成 JSON Patch 并记录字段差异,适用于用户资料改动审计、变更日志等明确业务场景
- 具有实际使用价值,不属于测试性质或同质化壳工具
Highlights
- description 明确描述了使用场景(资料改动审计、JSON Patch 生成、字段变更日志),触发词覆盖合理
Highlights
- 文档结构清晰,包含何时使用、硬约束、推荐实现要点、Agent 步骤等
- 有代码示例和端到端逻辑说明,frontmatter 完整
Highlights
- 推荐实现中使用了 fast-json-patch 的 compare 和 applyPatch,提到了异常处理(applyPatch 失败捕获)
- 参数使用合理,工具来源明确
The arithmetic mean of the first four original scores, rounded to a whole number.
Static text checks
100 / 100 · skillpi-20261123-no-r3-v1
No current rules matched the text.
This score reflects rule matches in the text and is provided for reference before use. It excludes attachments and runtime behavior.
Permissions and checks before use
Automatically summarized from this main document. Matches may be examples or defensive advice; they are not actual permission declarations. Attachments, external dependencies and runtime behavior are not covered.
These common operations were not identified in the main document. This does not mean no permissions or risks exist.
Security rating and access scope
safe · Static evidence review; not a runtime safety guarantee.
Before use, confirm and authorize actual file access, external services and network destinations in your host. This review grants no runtime permissions.
User discussion
No verified reviews yet.