Spring Boot
piomin/claude-ai-spring-boot
Spring Boot 3.x development - REST APIs, JPA, Security, Testing, and Cloud-native patterns.
在 mica-ppocr 项目中新增自定义结构化解析器(证件 / 票据 / 卡证 OCR → 业务字段)时加载本 skill。
$ npx skills add lets-mica/mica-ppocr --skill mica-ppocr-custom-parser -a claude-codeProject install by default; add -g for ~/.claude/skills/.
$ gh skill install lets-mica/mica-ppocr mica-ppocr-custom-parser --agent claude-codeProject scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).
$ git clone --depth 1 https://github.com/lets-mica/mica-ppocr.git skills-src && mkdir -p .claude/skills && cp -r skills-src/.agents/skills/mica-ppocr-custom-parser .claude/skills/mica-ppocr-custom-parser && rm -rf skills-srcUse ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.
Claude Code skills documentation · loads skills from .claude/skills/
Install the "mica-ppocr-custom-parser" agent skill from https://github.com/lets-mica/mica-ppocr/tree/master/.agents/skills/mica-ppocr-custom-parser into .claude/skills/mica-ppocr-custom-parser/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "mica-ppocr-custom-parser", then confirm the skill loads.Claude Code copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$skill-installer install https://github.com/lets-mica/mica-ppocr/tree/master/.agents/skills/mica-ppocr-custom-parserType this inside Codex. $skill-installer <name> installs a curated skill from openai/skills. The installer writes to $CODEX_HOME/skills (default ~/.codex/skills). Restart Codex if the skill does not show up.
$ npx skills add lets-mica/mica-ppocr --skill mica-ppocr-custom-parser -a codexProject install goes to .agents/skills/; add -g for ~/.codex/skills/.
$ gh skill install lets-mica/mica-ppocr mica-ppocr-custom-parser --agent codexProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/lets-mica/mica-ppocr.git skills-src && mkdir -p .agents/skills && cp -r skills-src/.agents/skills/mica-ppocr-custom-parser .agents/skills/mica-ppocr-custom-parser && rm -rf skills-srcUse ~/.agents/skills/ instead of .agents/skills for a personal install.
Codex skills documentation · loads skills from .agents/skills/
Install the "mica-ppocr-custom-parser" agent skill from https://github.com/lets-mica/mica-ppocr/tree/master/.agents/skills/mica-ppocr-custom-parser into .agents/skills/mica-ppocr-custom-parser/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "mica-ppocr-custom-parser", then confirm the skill loads.Codex copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ npx skills add lets-mica/mica-ppocr --skill mica-ppocr-custom-parser -a cursorProject install goes to .agents/skills/; add -g for ~/.cursor/skills/.
$ gh skill install lets-mica/mica-ppocr mica-ppocr-custom-parser --agent cursorProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/lets-mica/mica-ppocr.git skills-src && mkdir -p .cursor/skills && cp -r skills-src/.agents/skills/mica-ppocr-custom-parser .cursor/skills/mica-ppocr-custom-parser && rm -rf skills-srcUse ~/.cursor/skills/ instead of .cursor/skills for a personal install.
Cursor skills documentation · loads skills from .cursor/skills/, .agents/skills/, .claude/skills/, .codex/skills/
Install the "mica-ppocr-custom-parser" agent skill from https://github.com/lets-mica/mica-ppocr/tree/master/.agents/skills/mica-ppocr-custom-parser into .cursor/skills/mica-ppocr-custom-parser/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "mica-ppocr-custom-parser", then confirm the skill loads.Cursor copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ gemini skills install https://github.com/lets-mica/mica-ppocr.git --path .agents/skills/mica-ppocr-custom-parser--scope user (default) or --scope workspace; --path is the subfolder of the repo that holds the skill; --consent skips the security confirmation prompt.
$ npx skills add lets-mica/mica-ppocr --skill mica-ppocr-custom-parser -a gemini-cliProject install goes to .agents/skills/; add -g for ~/.gemini/skills/.
$ gh skill install lets-mica/mica-ppocr mica-ppocr-custom-parser --agent gemini-cliProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/lets-mica/mica-ppocr.git skills-src && mkdir -p .gemini/skills && cp -r skills-src/.agents/skills/mica-ppocr-custom-parser .gemini/skills/mica-ppocr-custom-parser && rm -rf skills-srcUse ~/.gemini/skills/ instead of .gemini/skills for a personal install, then run /skills reload.
Gemini CLI skills documentation · loads skills from .gemini/skills/, .agents/skills/
Install the "mica-ppocr-custom-parser" agent skill from https://github.com/lets-mica/mica-ppocr/tree/master/.agents/skills/mica-ppocr-custom-parser into .gemini/skills/mica-ppocr-custom-parser/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "mica-ppocr-custom-parser", then confirm the skill loads.Gemini CLI copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ gh skill install lets-mica/mica-ppocr mica-ppocr-custom-parserInstalls for Copilot at project scope by default; add --scope user for a personal install. Preview a skill first with gh skill preview. Needs GitHub CLI 2.90.0 or later (public preview).
$ npx skills add lets-mica/mica-ppocr --skill mica-ppocr-custom-parser -a github-copilotProject install goes to .agents/skills/; add -g for ~/.copilot/skills/.
$ git clone --depth 1 https://github.com/lets-mica/mica-ppocr.git skills-src && mkdir -p .github/skills && cp -r skills-src/.agents/skills/mica-ppocr-custom-parser .github/skills/mica-ppocr-custom-parser && rm -rf skills-srcUse ~/.copilot/skills/ instead of .github/skills for a personal install. Commit .github/skills so cloud agent and code review can use it.
GitHub Copilot skills documentation · loads skills from .github/skills/, .claude/skills/, .agents/skills/
Install the "mica-ppocr-custom-parser" agent skill from https://github.com/lets-mica/mica-ppocr/tree/master/.agents/skills/mica-ppocr-custom-parser into .github/skills/mica-ppocr-custom-parser/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "mica-ppocr-custom-parser", then confirm the skill loads.GitHub Copilot copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ npx skills add lets-mica/mica-ppocr --skill mica-ppocr-custom-parser -a opencodeOpenCode documents no install command of its own. Project install goes to .agents/skills/; add -g for ~/.config/opencode/skills/.
$ gh skill install lets-mica/mica-ppocr mica-ppocr-custom-parser --agent opencodeProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/lets-mica/mica-ppocr.git skills-src && mkdir -p .opencode/skills && cp -r skills-src/.agents/skills/mica-ppocr-custom-parser .opencode/skills/mica-ppocr-custom-parser && rm -rf skills-srcUse ~/.config/opencode/skills/ instead of .opencode/skills for a personal install.
OpenCode skills documentation · loads skills from .opencode/skills/, .claude/skills/, .agents/skills/
Install the "mica-ppocr-custom-parser" agent skill from https://github.com/lets-mica/mica-ppocr/tree/master/.agents/skills/mica-ppocr-custom-parser into .opencode/skills/mica-ppocr-custom-parser/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "mica-ppocr-custom-parser", then confirm the skill loads.OpenCode copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
mica-ppocr-custom-parser在 mica-ppocr 项目中新增自定义结构化解析器(证件 / 票据 / 卡证 OCR → 业务字段)时加载本 skill。
Mica Ppocr Custom Parser is an agent skill from lets-mica/mica-ppocr. 在 mica-ppocr 项目中新增自定义结构化解析器(证件 / 票据 / 卡证 OCR → 业务字段)时加载本 skill。 覆盖从 BaseStructuredParser<R / BaseStructuredResult 继承、LabelMatcher 公共工具调用、 Spring Boot 自动配置注册、PPOcrTemplate 集成,到 BaseTest 可视化调试与单测的完整链路。 触发场景:用户说"加个 XX 证件 / 票据解析器"、"自定义结构化解析"、"怎么把 OCR 散落文字组织成字段"、 "新增一种证件 OCR"、"写个新的 parser / 解析器"、"新加一个卡证/营业执照/发票/收据 等结构化识别"、 "mica-ppocr 加新解析"、"解析器模板/模板解析"、"label-value 提取"。
Its SKILL.md is about 3.1k tokens, which your agent loads only when the skill is triggered. It is a single SKILL.md file with no bundled scripts.
It sits in Backend & APIs, covering Backend development. It works with Spring Boot and Java. The repository describes itself as: PP-OCRv6 纯 Java 图片 OCR(ONNX Runtime,零 PaddlePaddle 依赖,bit-exact 对位 Python,Spring Boot Starter,结构化识别行驶证/身份证/银行卡/驾驶证/营业执照等). The licence is Apache-2.0.
10 steps, taken from the step headings in SKILL.md.
Read from SKILL.md and the folder at commit a7d496e. It shows what the files ask for, not the result of running them.
Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.
From allowed-tools in the SKILL.md frontmatter.
No scripts in the folder and no shell commands in SKILL.md (its code samples are java).
From the folder's file list and the shell code blocks in SKILL.md.
No URLs in SKILL.md.
From URLs in SKILL.md, links to its own repository left out.
Names no API keys, tokens, secrets or passwords.
From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.
Mica Ppocr Custom Parser loads about 3.1k tokens when it runs. Until then it costs about 101 tokens; SKILL.md has 626 words of instructions outside code blocks.
Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.
The automated check found no risky patterns in SKILL.md.
Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.
The full file from lets-mica/mica-ppocr at commit a7d496e, republished under its Apache-2.0 licence (© lets-mica). 626 words, ~3,127 tokens.
.claude/skills/mica-ppocr-custom-parser/SKILL.md (or your agent's skills folder).把 PP-OCRv6 检测出的散落文字框(
List<PPOcrV6Result>),按"标签定位 + 位置匹配 + 正则兜底"的策略, 组织成业务字段对象(继承BaseStructuredResult的 POJO)。
模块路径:mica-ppocr-structured/src/main/java/net/dreamlu/mica/ai/ppocr/structured/parser/
用户提出以下任何需求时,先加载本 skill:
mica-ppocr-structured/.../parser/<new-biz>/ 这样的目录或被要求"参考 VehicleLicenseParser"不要用本 skill 处理:
PPOcrV6Engine 即可,不需要结构化层| 层 | 文件 | 职责 |
|---|---|---|
| 基类(必须继承) | core/BaseStructuredParser<R> | 持有 PPOcrV6Engine,5 个 parse(...) 一站式重载已 final 实现;子类只覆盖 parseResults(List<PPOcrV6Result>) |
| 结果基类(必须继承) | core/BaseStructuredResult | 提供 rawResults(原始 OCR 框)与 fieldBoxes(字段名 → 框坐标),Lombok @Data |
| 公共工具(按需调用) | core/LabelMatcher | 标签定位、位置匹配、正则兜底、合并框剥值、跨行拼接、互斥分配、几何工具 minX/maxX/minY/maxY |
LabelMatcher 是 @UtilityClass 静态方法集合,不绑定任何具体业务,所有解析器共享同一套语义。
在 mica-ppocr-structured/src/main/java/net/dreamlu/mica/ai/ppocr/structured/parser/<biz>/ 下新增 2~3 个文件:
<biz>/
├── <Biz>Parser.java # 继承 BaseStructuredParser<<Biz>Result>
├── <Biz>Result.java # 继承 BaseStructuredResult
└── <Biz>Side.java # 可选:有正反面/多版面时包名小写 + 业务名(参考 vehicle/、idcard/、invoice/、train/)。
@Data
@EqualsAndHashCode(callSuper = true)
public class InvoiceResult extends BaseStructuredResult {
private String invoiceCode; // 发票代码
private String invoiceNo; // 发票号码
private String invoiceDate; // 开票日期
private BigDecimal amount; // 价税合计
// ... 业务字段
}要点:
@Data + @EqualsAndHashCode(callSuper = true) —— rawResults 和 fieldBoxes 在父类LabelMatcher.applyFieldBox(result, "fieldName", match) 一致null(OCR 失败/字段缺失),不要用基本类型@Slf4j
public class InvoiceParser extends BaseStructuredParser<InvoiceResult> {
// 1) 正则常量(业务相关)
private static final Pattern INVOICE_CODE_PATTERN = Pattern.compile("^\\d{8,12}$");
public InvoiceParser(PPOcrV6Engine engine) {
super(engine); // engine 可为 null:仅当只调 parseResults(List) 时
}
@Override
public InvoiceResult parseResults(List<PPOcrV6Result> results) {
InvoiceResult r = new InvoiceResult();
r.setRawResults(new ArrayList<>(results)); // 必填:供调用方做可视化
// 2) 逐字段填值
LabeledMatch codeMatch = parseInvoiceCode(results);
r.setInvoiceCode(codeMatch.value());
LabelMatcher.applyFieldBox(r, "invoiceCode", codeMatch);
// ... 其他字段
return r;
}
}模板四件套:
PPOcrV6Engine,转给 super(engine)parseResults 入口:new Result → setRawResults(new ArrayList<>(results)) → 填字段 → returnLabeledMatch(值 + 匹配框),用 LabelMatcher.applyFieldBox 回填 fieldBoxeslog.warn(不要 System.out.println)| 场景 | 推荐方法 | 备注 |
|---|---|---|
| 标准左标签 + 右值 | matchValueWithBox / matchValue | 默认走"右侧 y 重叠 + 最左"策略 |
| 标签与值合并到同一 OCR 框("发票代码12345678") | matchValueFromPrefix / matchValueFromPrefixWithBox | 自动从合并框剥前缀 |
| 标签定位后,值要按正则再校验 + 不匹配时回退正则 | labelOrFallback / labelOrFallbackWithBox | fieldName 用于日志,last 控制首/末匹配 |
| OCR 残缺标签("号牌号"少了"码") | findLabelBox 内部已支持,无需特别调用 | 完整等于 > 开头匹配 > 包含 fragment |
| 票据类有合并框需要从文本中抠值 | matchSubstring / matchSubstringWithBox | 传 text -> 提取函数 |
| 标签被 OCR 切碎成 fragment("日期"→ "日") | matchValueByLabelKeywordWithBox | 传关键字列表 |
| 多个 label 抢同一右侧值("金额/总金额"同行) | assignExclusiveValues | 贪心最佳优先互斥分配 |
| 跨多行的字段(住址、经营范围) | collectMultiLineRight | 按 y 升序拼接右侧 y 重叠框 |
| 几何位置兜底(无标签场景) | minX/maxX/minY/maxY | 自己写规则(参考 BankCardParser#parseBankName) |
返回风格选择:
matchValue(...) -> String(一行搞定)fieldBoxes → matchValueWithBox(...) -> LabeledMatch,后续 LabelMatcher.applyFieldBox(result, "fieldName", match)在 mica-ppocr-spring-boot-starter/src/main/java/net/dreamlu/mica/ai/ppocr/autoconfigure/StructuredParserAutoConfiguration.java:
@Bean(参考现有 8 个)ppocrTemplate(...) 方法签名 + 构造器调用 + null 校验里PPOcrTemplate 同步新增:字段、@Getter 方法、构造器参数、null 校验整套有 4 个文件要改(只要用户走 Spring Boot):
| 文件 | 改动 |
|---|---|
StructuredParserAutoConfiguration.java | 新 @Bean,加进 ppocrTemplate 签名 |
PPOcrTemplate.java | 新字段 + getter + 构造器参数 + null 校验 |
解析器 Parser.java | 新文件 |
解析器 Result.java | 新文件 |
Solon / 非 Spring 用户只需前 2 个文件,自行 new XxxParser(engine) 即可。
参考:VehicleLicenseParser、DriverLicenseParser、BusinessLicenseParser
LabeledMatch m = LabelMatcher.matchValueWithBox(results, "号牌号码");
r.setPlateNo(m.value());
LabelMatcher.applyFieldBox(r, "plateNo", m);参考:VehicleLicenseParser 的 plateNo/vin/issueDate
LabeledMatch m = LabelMatcher.labelOrFallbackWithBox(
LabelMatcher.matchValueWithBox(results, "车辆识别代号"),
results, VIN_PATTERN, "VIN", false /* last=false 取首个 */);参考:BankCardParser#parseCardNumber、BankCardParser#parseHolderName
String cardNo = LabelMatcher.matchPattern(results, CARD_NUMBER_PATTERN, false);参考:VehicleLicenseParser#parseIdNumber、InvoiceParser#findInvoiceCode
matchValueFromPrefixString no = LabelMatcher.matchSubstring(results, text -> {
if (!text.startsWith("No")) return null;
Matcher m = INVOICE_NO_PATTERN.matcher(text.substring(2));
return m.find() ? m.group() : null;
});参考:IdCardParser#parseAddress、LabelMatcher.collectMultiLineRight
要点:合并框首行 + 后续 y 重叠右侧框按 y 升序拼接,中间空格分隔,最后用 replaceAll("\\s+", "") 去噪。
参考:IdCardParser#detectSide、InvoiceParser#parseParty(用 imgMidY 分上下半区)
// 1) 用特征标签判定(先反后正:反面字少,OCR 不易误识)
boolean isBack = LabelMatcher.findLabelBox(results, "签发机关") != null;
if (isBack) { ... }
// 2) 用 y 中位数分上下区
int imgMidY = computeImageMidY(results);参考:LabelMatcher.assignExclusiveValues、LabelMatcher.LabelDef
适用于"金额/总金额/小计"等 label 同行且都指向同一右侧值。
vehicle / idcard / invoice / train / taxi / bankcard / driver / business)<业务名 PascalCase>Parser / <业务名 PascalCase>Result / IdCardSide(多版面时)plateNo / vin / issueDate / invoiceCode)log.debug(不要 info,正常路径不打日志)log.warn("身份证解析:未匹配到身份证号")System.out.println / System.err.printlnLabelMatcher.matchValueWithBox 返回的可能是 LabeledMatch.textOnly(null),先判 hasValue() 再用find()(应对合并框),全等校验才用 matches()r.setRawResults(new ArrayList<>(results)) —— 必须用 new ArrayList 包一层,避免外部修改影响BaseStructuredParser#parse(...)(已 final)engine 在 parse(...) 调用时为 null(基类会 NPE)LabelMatcher 改成实例类(它是 @UtilityClass)每个新文件第一行要带:
/*
* Copyright (c) 2019-2026, dreamlu.net All rights reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* ... (省略,完整模板见项目其它文件)
*/BaseTest 子类(30 行跑通 demo)参考 src/test/java/.../parser/vehicle/VehicleLicenseMain.java:
public class MyBizMain extends BaseTest<MyBizParser, MyBizResult> {
private static final String IMAGE_PATH = "test_images/mybiz/sample1.png";
private static final String VIS_PATH = "test_images/mybiz/vis.png";
public static void main(String[] args) {
new MyBizMain().demo(IMAGE_PATH, VIS_PATH);
}
@Override protected MyBizParser newParser(PPOcrV6Engine engine) {
return new MyBizParser(engine);
}
@Override protected void printResult(MyBizResult r) {
System.out.println("fieldA: " + r.getFieldA());
// ...
}
}跑 demo:直接 IDE 跑 main,会打印所有 OCR 框 + 解析结果 + 可视化 PNG。
参考 src/test/java/.../parser/core/LabelMatcherTest.java、各 ParserTest.java:
List<PPOcrV6Result>(框坐标 + 文本 + score)parseResults 返回的字段值logback-test.xml 设 level=DEBUG,看 LabelMatcher 的 [DEBUG-FIND] / 结构化解析: 日志result.getRawResults() 在测试里 dump 出来,人工对照看每个框result.getFieldBoxes() 在 demo 里画框,验证框是否落在正确字段上// MyBizResult.java
@Data
@EqualsAndHashCode(callSuper = true)
public class MyBizResult extends BaseStructuredResult {
private String title; // 业务标题
private String code; // 业务编码
private String date; // 业务日期
}
// MyBizParser.java
@Slf4j
public class MyBizParser extends BaseStructuredParser<MyBizResult> {
private static final Pattern CODE_PATTERN = Pattern.compile("[A-Z]{2}\\d{6}");
private static final Pattern DATE_PATTERN = Pattern.compile("\\d{4}-\\d{2}-\\d{2}");
public MyBizParser(PPOcrV6Engine engine) {
super(engine);
}
@Override
public MyBizResult parseResults(List<PPOcrV6Result> results) {
MyBizResult r = new MyBizResult();
r.setRawResults(new ArrayList<>(results));
// 标题:纯标签
LabeledMatch title = LabelMatcher.matchValueWithBox(results, "标题");
r.setTitle(title.value());
LabelMatcher.applyFieldBox(r, "title", title);
// 编码:标签 + 正则兜底
LabeledMatch code = LabelMatcher.labelOrFallbackWithBox(
LabelMatcher.matchValueWithBox(results, "编码"),
results, CODE_PATTERN, "编码", false);
r.setCode(code.value());
LabelMatcher.applyFieldBox(r, "code", code);
// 日期:正则兜底
r.setDate(LabelMatcher.matchPattern(results, DATE_PATTERN, false));
return r;
}
}启动期注册到 Spring Boot → 见 §3.5。
| 解析器 | 难度 | 演示模式 | 关键技巧 |
|---|---|---|---|
BankCardParser | ⭐ | 纯正则 + 位置兜底 | 英文标签黑名单、底部 y 过滤、卡号去空格 |
DriverLicenseParser | ⭐⭐ | 标准左标签 + 右值 | 驾照字段比行驶证多一项 |
VehicleLicenseParser | ⭐⭐ | 标准 + 兜底链 | labelOrFallback + 子串搜索 + 版面布局兜底 |
IdCardParser | ⭐⭐⭐ | 双版面 + 合并框 | detectSide、cutAtNextLabel、跨行地址 |
BusinessLicenseParser | ⭐⭐⭐ | 多行字段 + 区域过滤 | collectMultiLineRight、findCleanLabelBox |
TaxiReceiptParser | ⭐⭐⭐⭐ | 票据版式碎片化 | keyword 定位、底部正则兜底、金额行多 label 互斥 |
TrainTicketParser | ⭐⭐⭐⭐ | 票据版式碎片化 | 合并框切日期+时间、票号正则、噪声黑名单 |
InvoiceParser | ⭐⭐⭐⭐⭐ | 复杂版面(购销双方/明细表/合计) | y 中位数分上下、fragment + 续段合并框、4 字段同模板 |
入门先看
BankCardParser;做卡证看VehicleLicenseParser/IdCardParser;做票据看TrainTicketParser/TaxiReceiptParser;做发票看InvoiceParser。
| 坑 | 后果 | 怎么避 |
|---|---|---|
直接 r.text().equals(label) 找标签 | OCR 残缺("号牌号"缺"码")会漏匹配 | 用 LabelMatcher.findLabelBox(已支持 fragment) |
自己遍历 r.text() 写最近距离匹配 | 同行多个 label 都选到同一值 | 金额/票号类用 assignExclusiveValues |
| 跨行字段只取首个 y 重叠框 | 漏掉第二/三行 | 用 collectMultiLineRight 或自己写 y 升序拼接 |
用 r.text().matches() 匹配合并框 | 整框不匹配 → 漏识别 | 改用 find() 或写 extractor |
Result 字段没加 @EqualsAndHashCode(callSuper = true) | Lombok 不生成 equals 用父类,反序列化可能丢 rawResults | 必加 |
忘记 r.setRawResults(...) | 调用方拿到空 rawResults,无法做可视化 | 入口第一行就 set |
| 兜底分支没打 log | 调试时不知道走了哪条路径 | 每个兜底命中打 log.debug,失败打 log.warn |
Spring 注册时漏改 PPOcrTemplate | 启动报 BankCardParser must not be null | 4 个文件同步改(autoConfig + Template + Parser + Result) |
core/BaseStructuredParser.java —— SPI 基类,5 个 parse(...) 重载 + parseResults 抽象方法core/BaseStructuredResult.java —— rawResults + fieldBoxes 通用能力core/LabelMatcher.java —— 700+ 行工具,涵盖 12+ 种匹配场景,写解析器前先扫一遍注释找匹配场景写代码时 LabelMatcher 的 JavaDoc 是最权威的 API 文档,优先看它而不是猜。
© lets-mica, Apache-2.0. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file
Just SKILL.md in .agents/skills/mica-ppocr-custom-parser of lets-mica/mica-ppocr.
Open the folder on GitHubat commit a7d496e
Mica Ppocr Custom Parser next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.
| Skill | Stars | Used in | Tokens | Auto-check | Licence | Repo updated |
|---|---|---|---|---|---|---|
| Mica Ppocr Custom Parser this skilllets-mica/mica-ppocr | 110 | — | ~3.1k | Automated safety check: Pass | Apache-2.0 | |
| Spring Bootpiomin/claude-ai-spring-boot | 1.3k | — | ~2k | Automated safety check: Pass | Apache-2.0 | |
| Dr Jskilljdubois/dr-jskill | 342 | — | ~4.6k | Automated safety check: Notes | Apache-2.0 | |
| WxJava Integration Guidebinarywang/WxJava | 33k | — | ~123 | Automated safety check: Pass | Apache-2.0 | |
| Flycms Devsunkaifei/FlyCms | 656 | — | ~827 | Automated safety check: Pass | MIT | |
| Intelliconnect Service Styleruanrongman/IntelliConnect | 147 | — | ~2.4k | Automated safety check: Pass | Apache-2.0 |
piomin/claude-ai-spring-boot
Spring Boot 3.x development - REST APIs, JPA, Security, Testing, and Cloud-native patterns.
jdubois/dr-jskill
Creates Java + Spring Boot projects: Web applications, full-stack apps with Vue.js or Angular or React or vanilla JS, PostgreSQL, REST APIs, and Docker.
binarywang/WxJava
Plans a WxJava setup for Java, Spring Boot or Solon projects that call WeChat services, from module and BOM choice to config and a minimal working call.
sunkaifei/FlyCms
FlyCms 项目(backend/ Spring Boot 4.1.1 + frontend/ vue-vben-admin v5)的架构地图与开发规范总纲。凡在本仓库做任何开发——写后端接口、新增/修改模块、管理页面、数据库变更、修 bug、重构——都要先加载本 skill 再动手,即使用户只说"改一下""加个功能";前端登录/菜单/权限专项另见…
ruanrongman/IntelliConnect
Create or update IntelliConnect Spring Boot service/serviceimpl code in this repository style.
Snailclimb/AIGuide
Java/Spring Boot 编码规范:用于编写、审查、重构和讲解 Java 代码。适用于 Java 风格、Spring Boot 架构、Controller/Service/Manager/DAO 分层、API 边界、Entity/VO/Form/DTO/BO 设计、MyBatis/MyBatis-Plus 持久化、事务、异常、日志、安全、性能、测试和 Java 代码评审等场景。默认结合…
lets-mica/mica-ppocr
Optimizes mica-ppocr Java parsers via batch run, failure diagnosis, and LabelMatcher/regex fixes.
Works with
Categories
在 mica-ppocr 项目中新增自定义结构化解析器(证件 / 票据 / 卡证 OCR → 业务字段)时加载本 skill。. Mica Ppocr Custom Parser is an agent skill from lets-mica/mica-ppocr.
Mica Ppocr Custom Parser fits situations like: tasks that involve Backend development.
Run `npx skills add lets-mica/mica-ppocr --skill mica-ppocr-custom-parser -a claude-code`. Or copy the skill folder (.agents/skills/mica-ppocr-custom-parser in lets-mica/mica-ppocr) into .claude/skills/mica-ppocr-custom-parser in your project. Claude Code loads it when a task matches its description.
Run `npx skills add lets-mica/mica-ppocr --skill mica-ppocr-custom-parser -a codex`. Or copy the skill folder (.agents/skills/mica-ppocr-custom-parser in lets-mica/mica-ppocr) into .agents/skills/mica-ppocr-custom-parser in your project. Codex loads it when a task matches its description.
Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add lets-mica/mica-ppocr --skill mica-ppocr-custom-parser -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/mica-ppocr-custom-parser, .gemini/skills/mica-ppocr-custom-parser, .github/skills/mica-ppocr-custom-parser and .opencode/skills/mica-ppocr-custom-parser in your project.
SKILL.md names no scripts, command-line tools or credentials: Mica Ppocr Custom Parser is instructions for the agent only.
SKILL.md contains no URLs. Any network use would come from the scripts or tools the agent runs. This is read from the text; nothing was executed.
Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.
Mica Ppocr Custom Parser is published under the Apache-2.0 licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.
About 3.1k tokens (SKILL.md is roughly 13k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.
Skills that share tags, products or a category with Mica Ppocr Custom Parser: Spring Boot (piomin/claude-ai-spring-boot, 1.3k stars), Dr Jskill (jdubois/dr-jskill, 342 stars), WxJava Integration Guide (binarywang/WxJava, 33k stars) and Flycms Dev (sunkaifei/FlyCms, 656 stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.
lets-mica (a GitHub organization) maintains it in lets-mica/mica-ppocr, which has 110 GitHub stars. The repository holds 2 skills in this directory. The repository was last updated on October 8, 2026.
Source: lets-mica/mica-ppocr on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.