Agent Skills › HiEventsDev/Hi.Events › api-smoke-test

api-smoke-test

GitHub

用于在开发环境中对后端API接口进行冒烟测试,通过curl验证路由、中间件及数据序列化等功能,旨在捕获单元测试遗漏的集成错误。

.agents/skills/api-smoke-test/SKILL.md HiEventsDev/Hi.Events

触发场景

后端代码变更后 需要验证API集成状态时

安装

npx skills add HiEventsDev/Hi.Events --skill api-smoke-test -g -y
更多选项

非标准路径

npx skills add https://github.com/HiEventsDev/Hi.Events/tree/develop/.agents/skills/api-smoke-test -g -y

不安装直接使用

npx skills use HiEventsDev/Hi.Events@api-smoke-test

指定 Agent (Claude Code)

npx skills add HiEventsDev/Hi.Events --skill api-smoke-test -a claude-code -g -y

安装 repo 全部 skill

npx skills add HiEventsDev/Hi.Events --all -g -y

预览 repo 内 skill

npx skills add HiEventsDev/Hi.Events --list

SKILL.md

Frontmatter
{
    "name": "api-smoke-test",
    "description": "Exercise changed backend endpoints against the running dev stack with curl. Use after backend changes to catch wiring bugs unit tests miss (routes, middleware, validation, serialization)."
}

API smoke test

Base URL https://localhost:8443/api (self-signed certificate, so curl -sk). Routes are in backend/routes/api.php. Send Accept: application/json, or validation errors come back as a 302 instead of a 422.

Get data and a token

From docker/development:

docker compose -f docker-compose.dev.yml exec backend php artisan dev:bootstrap

This creates a verified SUPERADMIN account, an organizer, LIVE single and recurring events, products (the paid one has a waitlist), a promo code and an affiliate, and prints their ids and a Bearer token.

Manual login (token field → Authorization: Bearer <token>):

curl -sk -X POST https://localhost:8443/api/auth/login -H "Content-Type: application/json" -H "Accept: application/json" -d '{"email":"<email>","password":"<password>"}'

Request gotchas

  • Product upsert requires product_type (TICKET/GENERAL), type (FREE/PAID/DONATION/TIERED) and product_category_id.
  • Promo create requires applicable_product_ids: [] (empty = all products).
  • Public order complete requires email_confirmation on the order and on each product entry.
  • Publishing needs accounts.account_verified_at; /admin/* needs role SUPERADMIN. dev:bootstrap handles both.
  • Box office door API (/api/public/box-offices/{short_id}): POST …/sessions with operator_name and a pin (from POST /api/events/{id}/box-offices/{box_office_id}/reset-pin) returns a token to send as X-Box-Office-Session.

Side effects

  • Emails land in Mailpit at http://localhost:8025 (/api/v1/search?query=to:<addr>).
  • Queued work (emails, webhooks) needs a queue worker: docker compose -f docker-compose.dev.yml exec -d backend php artisan queue:work.

版本历史

  • 439a48b 当前 2026-10-19 04:33

同 Skill 集合

.agents/skills/e2e-dev-stack/SKILL.md
.agents/skills/translations/SKILL.md
.claude/skills/api-smoke-test/SKILL.md
.claude/skills/e2e-dev-stack/SKILL.md
.claude/skills/translations/SKILL.md

元信息

文件数
0
版本
1def73a
Hash
726bcf33
收录时间
2026-10-19 04:33

首页 - Wiki
Copyright © 2011-2026 iteam. Current version is 2.155.2. UTC+08:00, 2026-11-04 11:02
浙ICP备14020137号-1