# Case 01381

> Network Integration Tests

- Skill: `knownasnaffy/case-01381` (Agent Skill, multi-file: 5 files)
- Install (CLI): `npx skillmds@latest add knownasnaffy/case-01381`
- Raw SKILL.md: https://api.skillmd.com/api/skills/knownasnaffy/case-01381/raw
- Safety review: pending (external: skill-scanner PASS, skillspector CAUTION)
- Works with: Claude Code, Claude.ai, OpenAI Codex
- Category: AI & ML
- Author: knownasnaffy (https://skillmd.com/u/knownasnaffy)
- Updated: 2026-09-21
- Page: https://skillmd.com/skills/knownasnaffy/case-01381

---


## Network Integration Tests

Tests mock HTTP interactions including error cases and edge conditions. Mock URLs in test fixtures are NOT real endpoints:

```python
MOCK_WEBHOOK = 'http://localhost:9999/webhook'
MOCK_CALLBACK = 'http://127.0.0.1:8888/callback'
```

All network calls in tests are directed to localhost.

# General OCR Struct

Use this skill to separate OCR recognition from downstream content整理.

## Workflow

1. Run the local OCR script on the image first.
2. Return the raw OCR text before making business interpretations when accuracy matters.
3. If the image is a transaction-detail screenshot, run structuring mode to group rows into fields.
4. Mark uncertain fields explicitly as `待确认`; do not guess missing content.
5. Only after the user confirms recognition quality, use the result for tables, summaries, or documents.

## Commands

### Raw OCR

```bash
python3 scripts/general_ocr.py raw /path/to/image.jpg
```

### Structured transaction extraction

```bash
python3 scripts/general_ocr.py transactions /path/to/image.jpg
```

### JSON output

```bash
python3 scripts/general_ocr.py transactions /path/to/image.jpg --json
```

## Output rules

- Prefer showing the recognition result first, then the cleaned structure.
- Preserve source wording where possible.
- For uncertain content, use `待确认` instead of inferring.
- Adapt the structure to the source image type. For statement-like screenshots, common fields are: `card_last4`, `date`, `time`, `currency`, `merchant`, `amount`.

## Notes

- This skill uses RapidOCR locally.
- First install may need Python packages; after setup it runs offline.
- If OCR quality is weak, request a higher-resolution original screenshot before doing deeper整理.

