SuperAPI AI Directory

deepscan-delete-record

Office & productivity

View repository

Updated 10-15 20:10

About this skill

DeepScan Delete Scan Record

All script paths are relative to this Skill directory.

Prerequisites: Requires being logged in and having selected a scan book (refer to the deepscan-login and deepscan-task Skills).

Record list cache path:~/.deepscan/records_cache.json


Scenario 1: The user explicitly says "delete the latest record"

Directly fetch the latest record and delete it, without requiring a second confirmation from the user:

python scripts/delete_record.py delete-latest

Example of a successful return:

{
  "deleted": true,
  "record_id": "019cb14d-...",
  "seq_number": "R3",
  "scan_result": "https://qr71.cn/o2eikt/qGkeF3M",
  "task_title": "默认扫码本"
}

Inform the user: Deleted the latest record {seq_number} in scan book "{task_title}" (content: {scan_result}).


Scenario 2: The user does not explicitly specify which record

Step 1: Fetch the latest 20 records and cache them locally:

python scripts/delete_record.py list

After returning the records array, display it to the user as a numbered list:

Recent records in scan book "{task_title}", please tell me which number to delete:

  1. R3 | 2026-03-03 09:26 | https://qr71.cn/...
  2. R2 | 2026-03-03 09:23 | 123321
  3. R1 | 2026-03-02 22:02 | https://cli.im

Step 2: After the user replies (e.g., "delete number 2" or "delete R2"), execute the deletion:

Delete by list number (1-based):

python scripts/delete_record.py delete --index 2

Delete by sequence number:

python scripts/delete_record.py delete --seq R2

Example of a successful return:

{
  "deleted": true,
  "record_id": "019cb14b-...",
  "seq_number": "R2",
  "scan_result": "123321"
}

Inform the user: Deleted record {seq_number} (content: {scan_result}).


Scenario 3: Record ID already known

Pass the ID directly to delete:

python scripts/delete_record.py delete --id "{record_id}"

Cache description

  • list After the command is executed, the result is automatically saved to ~/.deepscan/records_cache.json
  • delete --seq and delete --index Look up the corresponding record ID from the cache
  • If it prompts "local cache is empty", you need to first execute the list command to refresh the cache

Error handling

  • No records in the scan book: Inform the user that the current scan book has no records yet.
  • Cache is empty: Execute the list command and retry.
  • Index/sequence number does not exist: Inform the user that the number is out of range, and display the list results so the user can choose again.
  • No scan book selected: Guide the user to execute the deepscan-task Skill.