当前位置: 首页 > Skill >

AFOL BrickLink

AFOL BrickLink

AFOL BrickLink

使用独立的 BrickLink API CLI,实现 OAuth1 签名的目录、价格、订单、库存、反馈、优惠券、发货、通知和会员备注等功能。

1.0.0 2026.11.27 367
获取Skill文件查看使用说明
作 者:陈安 许可证: 更新时间:2026.11.27
本文目录展开

BrickLink AFOL skill

Use this skill when the user asks for BrickLink item lookup, price guides, known colors, images, supersets/subsets, item mapping, orders, inventory, feedback, coupons, notifications, shipping methods, member ratings, or private member notes.

Primary interface: scripts/bricklink.

The skill is self-contained for archive distribution and wraps the BrickLink API directly using checked-in references inside this skill directory:

  • OpenAPI reference: references/openapi/bricklink.yaml
  • Domain guidance: references/prompts/bricklink-tools.txt
  • CLI source: scripts/bricklink_cli.py

Do not scrape vendor docs or invent parameters when the checked-in OpenAPI reference covers the endpoint. If the reference is insufficient, say what is missing.

Authentication

Required environment variables:

export BRICKLINK_API_CONSUMER_KEY=...
export BRICKLINK_API_CONSUMER_SECRET=...
export BRICKLINK_API_TOKEN_VALUE=...
export BRICKLINK_API_TOKEN_SECRET=...

Optional override:

export BRICKLINK_API_BASE_URL=https://api.bricklink.com/api/store/v1

Never print, commit, log, or paste the real OAuth credentials. Commands should reference the BRICKLINK_API_* variables only indirectly through the CLI.

BrickLink auth placement matters:

  • Every API request is OAuth 1.0a signed with an Authorization: OAuth ... header.
  • Credentials do not belong in query parameters or JSON request bodies.
  • GET query parameters are included in the OAuth signature base string.
  • POST/PUT/DELETE JSON request bodies are not where OAuth credentials live.

The CLI handles this split, which is the main reason to use it instead of ad-hoc curl.

CLI quick reference

Run commands from this skill directory:

scripts/bricklink --help
scripts/bricklink colors
scripts/bricklink color --color-id 11
scripts/bricklink categories
scripts/bricklink item --type SET --no 75192-1
scripts/bricklink item-price --type SET --no 75192-1 --guide-type sold --new-or-used N --currency-code EUR
scripts/bricklink item-colors --type PART --no 3001
scripts/bricklink item-mapping --type PART --no 3001 --color-id 5
scripts/bricklink element-mapping --element-id 4211111
scripts/bricklink inventory-list --item-type SET --status Y
scripts/bricklink orders --direction in --status PAID
scripts/bricklink order --order-id 123456
scripts/bricklink notifications
scripts/bricklink coupons
scripts/bricklink shipping-methods
scripts/bricklink member-ratings --username example_user
scripts/bricklink member-notes --username example_user

Mutating commands are guarded. They do nothing unless passed --yes; use --dry-run first:

scripts/bricklink inventory-create --dry-run 
  --json '{"item":{"type":"PART","no":"3001"},"color_id":5,"quantity":1,"unit_price":"0.12","new_or_used":"U"}'

scripts/bricklink inventory-update --dry-run --inventory-id 123456 
  --json '{"quantity":2,"unit_price":"0.15"}'

scripts/bricklink inventory-delete --dry-run --inventory-id 123456
scripts/bricklink order-status --dry-run --order-id 123456 --json '{"status":"PACKED"}'
scripts/bricklink feedback-create --dry-run --json '{"order_id":123456,"rating":"POSITIVE","comment":"Thank you"}'
scripts/bricklink coupon-create --dry-run --json '{"buyer_name":"example_user","discount_rate":5}'
scripts/bricklink member-notes-update --dry-run --username example_user --json '{"note":"Asked about train parts"}'

Safety rules

Read-only by default:

  • colors, color, categories, category
  • item, item-images, item-supersets, item-subsets, item-price, item-colors
  • item-mapping, element-mapping
  • orders, order, order-items, order-messages, order-feedback
  • inventory-list, inventory
  • feedback, feedback-view
  • notifications, coupons, coupon
  • shipping-methods, shipping-method
  • member-ratings, member-notes

Mutating operations require explicit user confirmation in the current conversation before execution:

  • inventory-create, inventory-update, inventory-delete
  • order-update, order-status, order-payment-status, order-drive-thru
  • feedback-create, feedback-reply
  • coupon-create, coupon-update, coupon-delete
  • member-notes-create, member-notes-update, member-notes-delete

Stored credentials are not permission. Before any mutation, restate the exact action, endpoint, target ID/user/order, payload summary, and whether the action is destructive. Wait for explicit confirmation such as "yes, update BrickLink inventory 123456".

The CLI enforces this mechanically: mutating commands fail unless --yes is passed, and --dry-run prints the request shape with credentials redacted as environment-variable references.

If the user asks to "sell", "list", "update inventory", "delete lot", "leave feedback", or "create a coupon" without naming a platform and both BrickLink/BrickOwl could apply, ask which marketplace to use before mutating anything.

Endpoint coverage

  • GET /orders via orders
  • GET /orders/{order_id} via order
  • PUT /orders/{order_id} via order-update --yes
  • GET /orders/{order_id}/items via order-items
  • GET /orders/{order_id}/messages via order-messages
  • GET /orders/{order_id}/feedback via order-feedback
  • PUT /orders/{order_id}/status via order-status --yes
  • PUT /orders/{order_id}/payment_status via order-payment-status --yes
  • POST /orders/{order_id}/drive_thru via order-drive-thru --yes
  • GET /inventories via inventory-list
  • POST /inventories via inventory-create --yes
  • GET /inventories/{inventory_id} via inventory
  • PUT /inventories/{inventory_id} via inventory-update --yes
  • DELETE /inventories/{inventory_id} via inventory-delete --yes
  • GET /items/{type}/{no} via item
  • GET /items/{type}/{no}/images/{color_id} via item-images
  • GET /items/{type}/{no}/supersets via item-supersets
  • GET /items/{type}/{no}/subsets via item-subsets
  • GET /items/{type}/{no}/price via item-price
  • GET /items/{type}/{no}/colors via item-colors
  • GET /feedback via feedback
  • POST /feedback via feedback-create --yes
  • GET /feedback/{feedback_id} via feedback-view
  • POST /feedback/{feedback_id}/reply via feedback-reply --yes
  • GET /colors, GET /colors/{color_id} via colors, color
  • GET /categories, GET /categories/{category_id} via categories, category
  • GET /notifications via notifications
  • GET /coupons, GET /coupons/{coupon_id} via coupons, coupon
  • POST /coupons, PUT /coupons/{coupon_id}, DELETE /coupons/{coupon_id} via guarded coupon commands
  • GET /settings/shipping_methods, GET /settings/shipping_methods/{method_id} via shipping commands
  • GET /members/{username}/ratings via member-ratings
  • GET /members/{username}/my_notes via member-notes
  • POST/PUT/DELETE /members/{username}/my_notes via guarded member-note commands
  • GET /item_mapping/{type}/{no} via item-mapping
  • GET /item_mapping/{element_id} via element-mapping

Treat order, buyer, address, payment, feedback, coupon, inventory, and private-note data as private. Summarize only what the user needs.

Known BrickLink endpoint quirks

BrickLink item type values are uppercase API enums such as SET, PART, and MINIFIG. Do not pass BrickOwl-style title-case types.

The item mapping endpoints are overloaded:

  • Use item-mapping --type PART --no <part-no> --color-id <color-id> for GET /item_mapping/{type}/{no}. The checked-in OpenAPI restricts type to PART here.
  • Use element-mapping --element-id <element-id> for GET /item_mapping/{element_id}.

Price guide defaults can hide intent. Set --guide-type sold|stock, --new-or-used N|U, and --currency-code explicitly when the user asks for a price estimate.

Subsets and supersets shape changes with --break-minifigs and --break-subsets; keep those flags explicit instead of guessing.

Mutating workflows

Do not run these with --yes until the user explicitly confirms the exact action.

Create inventory

Draft the JSON from current state or user-provided details, then inspect it:

scripts/bricklink inventory-create --dry-run --json "$INVENTORY_JSON"

Confirmation prompt shape:

Confirm BrickLink inventory create: item <type>/<no>, color <color_id>, quantity <qty>, price <unit_price>, condition <new_or_used>. This creates live marketplace inventory.

Then:

scripts/bricklink inventory-create --yes --json "$INVENTORY_JSON"

Update or delete inventory

Read the lot first with inventory --inventory-id. Only update fields the user named. Deletion is destructive and needs immediate confirmation naming the inventory ID.

scripts/bricklink inventory-update --dry-run --inventory-id "$INVENTORY_ID" --json "$PATCH_JSON"
scripts/bricklink inventory-delete --dry-run --inventory-id "$INVENTORY_ID"

Orders, feedback, coupons, and member notes

For order status/payment changes, feedback, coupons, and private member notes, draft the exact JSON and show it before execution. Do not infer tone for feedback or notes; ask the user to approve exact text.

scripts/bricklink order-status --dry-run --order-id "$ORDER_ID" --json "$ORDER_STATUS_JSON"
scripts/bricklink feedback-reply --dry-run --feedback-id "$FEEDBACK_ID" --json "$REPLY_JSON"
scripts/bricklink coupon-update --dry-run --coupon-id "$COUPON_ID" --json "$COUPON_JSON"
scripts/bricklink member-notes-delete --dry-run --username "$USERNAME"

Live smoke checks

Local, no-network checks:

python3 -m py_compile scripts/bricklink_cli.py
scripts/bricklink inventory-delete --dry-run --inventory-id 123456
python3 -m unittest discover -s tests -p 'test_*.py'
scripts/validate-skills.sh
git diff --check

Read-only smoke check, only when all four BRICKLINK_API_* credentials are configured:

scripts/bricklink colors

Summarize only response shape: status, top-level keys, and rough counts. Never paste private account/order/inventory/member-note data or credential values.

Common pitfalls

  1. Treating credentials as consent. They are not. Writes still require explicit user intent.
  2. Putting OAuth credentials in query parameters or JSON bodies. BrickLink uses OAuth1 Authorization headers.
  3. Using BrickOwl item type casing. BrickLink item types are uppercase API enums.
  4. Mixing up item-mapping and element-mapping; the paths look similar but answer opposite questions.
  5. Running full set price breakdowns for casual questions. Start with targeted item or set price guide calls unless the user approved fan-out.
  6. Guessing item type or color ID. Use /colors, /items/{type}/{no}/colors, and item mapping endpoints instead of inventing IDs.
  7. Mutating the wrong marketplace. If BrickLink and BrickOwl are both configured and the user only says "my store", ask which platform before writing.
  8. Posting feedback or member notes from inferred tone. Draft first; let the user approve exact text.
  9. Bulk inventory changes without a reviewed ID list. Require exact inventory IDs and payload summaries before touching live listings.

Verification checklist

  • BRICKLINK_API_CONSUMER_KEY, BRICKLINK_API_CONSUMER_SECRET, BRICKLINK_API_TOKEN_VALUE, and BRICKLINK_API_TOKEN_SECRET are referenced only as env vars.
  • Read-only smoke check uses GET /colors or another harmless endpoint.
  • Price guide and item lookup examples are read-only.
  • Inventory/order/feedback/coupon/member-note writes require explicit user intent and --yes.
  • Dry runs do not require credentials and do not call the network.
  • Destructive deletes require immediate confirmation with exact IDs.
  • Endpoint coverage matches references/openapi/bricklink.yaml.
  • Large price-breakdown fan-out asks approval before execution.

推荐文章

更多
PHP时间戳与日期字符串相互转换方法详解

本文介绍PHP中时间数值(Unix时间戳)与日期字符串之间的相互转换方法。通过strtotime和date函数,实现将当前时间、指定日期转换为时间戳,以及将时间戳格式化为可读的日期时间字符串,并提供相关在线计算工具推荐。

2025.11.30 1,034
PHP日期转时间戳时区偏差怎么解决

在 PHP 中将日期字符串转换为时间戳时,若未显式指定时区,默认使用脚本配置的 date.timezone 或系统时区。当服务器时区与业务逻辑预期(如 UTC )不一致时,会产生偏差。解决核心是确保输入字符串携带明确时区信息,或在转换前统一设置时区上下文。

2026.10.24 1,031
PHP跨域配置:怎么安全地允许指定域名而非使用通配符

在 PHP 中安全地允许指定域名跨域,核心是解析请求头中的 Origin ,验证其是否在白名单内,然后动态设置 Access-Control-Allow-Origin 响应头。不要使用通配符 * ,也不要硬编码单一域名。

2025.03.29 1,019
JavaScript中利用replace结合正则实现replaceAll效果

JavaScript原生仅支持replace()进行单次或全局替换,缺乏类似Java的replaceAll()便捷方法。本文总结四种在JS中实现全量替换的方案:使用带g标志的正则、带gm标志的正则、扩展String原型以及split后join。通过对比代码示例,展示各方法的实现细节与适用场景,帮助开发者根据需求选择最优解。

2025.04.29 1,017
OpenAI的Jalapeno芯片未落地,教你分辨300兆瓦算力消息

OpenAI计划在SB Energy租赁的数据中心部署约300兆瓦自研Jalapeno推理芯片,但目前双方仍处于洽谈阶段,交易细节与上线时间表均未公布。本文带你按报道原文核实项目所处阶段,厘清芯片发布、电力功率与实际推理算力的边界,并将融资意向与签约、开工、投运节点分开追踪,避免误将规划容量计入现有算力。

2026.12.02 1,014
PHP实现基础文件上传:HTML表单与$_FILES处理流程

在 HTML 表单中设置 enctype="multipart/form-data" ,并在 PHP 后端通过 $_FILES 数组接收文件,调用 move_uploaded_file() 将临时文件移动到目标目录即可完成上传。

2026.09.07 1,014
Skill 文件
  • SKILL.md
    • BrickLink AFOL skill
    • Authentication
    • CLI quick reference
    • Safety rules
    • Endpoint coverage
    • Known BrickLink endpoint quirks
    • Mutating workflows
      • Create inventory
      • Update or delete inventory
      • Orders, feedback, coupons, and member notes
    • Live smoke checks
    • Common pitfalls
    • Verification checklist
  • 项目或源文件

相关 Skill

更多
service-qa-coach service-qa-coach Review support quality for chat, email, phone, social DM, or marketplace service teams. Use when a team needs a QA scorecard, failure-mode analysis, coaching plan, calibration checklist, or service-improvement brief without live ticketing, CRM, or contact-center system access.
高中数学作业批改助手 高中数学作业批改助手 >图片识别 直接读取学生手写作答照片,识别公式、符号、步骤 🧮 自动推导 根据题目自动生成参考答案和评分细则,无需教师预设 📊 逐步给分 每个关键步骤独立评分,体现过程分 📝 结构化报告 输出含识别内容、参考答案、逐步评分、改进建议的完整报告 🗂 批量批改 支持一次性批改多道题,最终汇总得分表
Vibration Analysis Vibration Analysis 分析来自CMS趋势、RMS/峰值、频谱及SCADA报警的风机传动链(主轴、齿轮箱、发电机)振动数据。
Traditional Bone Tool Making Basics Traditional Bone Tool Making Basics Use when you need custom, durable, repairable tools like awls, needles, scrapers, harpoons, or fishing hooks made from local animal bones or antlers and comm...
音频混音工具 音频混音工具 名称:Sound Mixing Tool(标识 sound-mixing-tool) 短简介(≤60字):音乐/音效响度精确对齐 + 融合混音工作流:用 ffmpeg 两段式 loudnorm 把多组素材 LUFS 偏差压到 <0.10,再最小干预融合、导出可进引擎的独立分轨。 标签/关键词:音频混音 响度匹配 LUFS ffmpeg 游戏音频 音效设计 Wwise FMOD 分轨导出 后期处理 触发词:混音 · 响度匹配 · LUFS 对齐 · MIX 版本 · 音乐音效分轨 · 融合 · 不打架 · 不能盖住 适用场景 :游戏音频集成、影视短视频配乐、播客后期