一键导入
api-debug
用 AI Access Key 认证查询 PrdAgent 真实 API 数据,辅助排查问题、核对数据状态、理解系统行为,产出可直接分析的 JSON 响应。触发词:"查 API 数据"、"调试接口"、"看真实数据"、"api debug"、"verify data state"。
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
用 AI Access Key 认证查询 PrdAgent 真实 API 数据,辅助排查问题、核对数据状态、理解系统行为,产出可直接分析的 JSON 响应。触发词:"查 API 数据"、"调试接口"、"看真实数据"、"api debug"、"verify data state"。
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
| name | api-debug |
| description | 用 AI Access Key 认证查询 PrdAgent 真实 API 数据,辅助排查问题、核对数据状态、理解系统行为,产出可直接分析的 JSON 响应。触发词:"查 API 数据"、"调试接口"、"看真实数据"、"api debug"、"verify data state"。 |
版本:v1.0.0 | 状态:已落地 | 触发:
/api-debug、"查 API 数据"、"调试接口"
Query the PrdAgent API using AI Access Key authentication to fetch real data for debugging and investigation.
This skill should be used when:
The API uses AI Access Key authentication:
AI_ACCESS_KEY - 通用 AI 认证密钥(CDS + MAP 平台 + 后端 API 共享)MAP_AI_USER - X-AI-Impersonate 用户名(优先级最高,强烈建议配置)X-AI-Access-Key: {key} - The configured access keyX-AI-Impersonate: {username} - A valid username to impersonate (must exist in database)警告:严禁硬编码
admin或root。admin通常不是数据库真实用户名,root是破窗账户不在 users 集合中。 强烈建议:从$MAP_AI_USER环境变量读取用户名,避免每次都通过 JWT 登录发现。
# 本地开发
http://localhost:5000
# 预览环境(v3:{tail}-{prefix}-{projectSlug}.miduo.org,统一走 cdscli 不要手拼)
python3 .claude/skills/cds/cli/cdscli.py --human preview-url
# 预览环境 Cloudflare 干扰时(通过 CDS container-exec)
http://localhost:5000 (容器内)
预览域名可能被 Cloudflare 干扰返回 500,此时需通过 CDS
container-exec在容器内测试。
| Method | Endpoint | Description |
|---|---|---|
| GET | /api/users | List all users |
| GET | /api/users/{userId} | Get user details |
| Method | Endpoint | Description |
|---|---|---|
| GET | /api/authz/users | List users with permissions |
| GET | /api/authz/roles | List system roles |
| Method | Endpoint | Description |
|---|---|---|
| GET | /api/prd/projects | List projects |
| GET | /api/prd/projects/{id} | Get project details |
| Method | Endpoint | Description |
|---|---|---|
| GET | /api/mds/model-groups | List all model groups |
| PUT | /api/mds/model-groups/{id} | Update model group (e.g., set isDefaultForType) |
| GET | /api/mds/platforms | List LLM platforms |
| GET | /api/mds/models | List configured models |
| Method | Endpoint | Description |
|---|---|---|
| GET | /api/logs/llm?limit=10 | Get recent LLM request logs |
| Method | Endpoint | Description |
|---|---|---|
| GET | /api/visual-agent/image-master/workspaces | List workspaces |
| POST | /api/visual-agent/image-gen/generate | Generate image |
| POST | /api/visual-agent/image-gen/compose | Multi-image compose |
| Method | Endpoint | Description |
|---|---|---|
| GET | /api/init/status | Get system initialization status |
Identify the data needed: Determine which API endpoint to query based on the debugging context.
Execute the query: Use curl with the AI Access Key headers:
curl -s "http://[::1]:5000/api/{endpoint}" \
-H "X-AI-Access-Key: $AI_ACCESS_KEY" \
-H "X-AI-Impersonate: $MAP_AI_USER"
Parse the response: The API returns JSON in this format:
{
"success": true,
"data": { ... },
"error": null
}
Analyze the data: Use the returned data to understand the system state and diagnose issues.
When debugging LLM-related features, always check the LLM logs:
Invoke-RestMethod -Uri "http://localhost:8000/api/logs/llm?limit=10" -Headers @{"X-AI-Access-Key"="$env:AI_ACCESS_KEY"; "X-AI-Impersonate"="$env:MAP_AI_USER"} | ForEach-Object { $_.data.items } | ForEach-Object {
Write-Host "---"
Write-Host "Model: $($_.model)"
Write-Host "Purpose: $($_.requestPurpose)"
Write-Host "Status: $($_.status)"
Write-Host "Duration: $($_.durationMs)ms"
if ($_.error) { Write-Host "Error: $($_.error)" }
}
Key fields to check:
requestPurpose: Identifies which feature made the call (e.g., visual-agent.compose::vision)status: succeeded or failederror: Error message if failedrequestBody: The actual request sent to LLM (check if data is missing)answerPreview: Preview of LLM responsecurl -s "http://[::1]:5000/api/users" \
-H "X-AI-Access-Key: $AI_ACCESS_KEY" \
-H "X-AI-Impersonate: $MAP_AI_USER" | jq
curl -s "http://[::1]:5000/api/users/user1" \
-H "X-AI-Access-Key: $AI_ACCESS_KEY" \
-H "X-AI-Impersonate: $MAP_AI_USER" | jq
curl -s "http://[::1]:5000/api/prd/projects?page=1&pageSize=10" \
-H "X-AI-Access-Key: $AI_ACCESS_KEY" \
-H "X-AI-Impersonate: $MAP_AI_USER" | jq
AI_ACCESS_KEY environment variable is set on the serverX-AI-Impersonate must exist in the database (use $MAP_AI_USER, never hardcode admin or root)container-exec 在容器内直接 curl http://localhost:5000/... 绕过 CDN| 陷阱 | 后果 | 正确做法 |
|---|---|---|
使用 Authorization: Bearer header | 认证失败 | 必须用 X-AI-Access-Key header |
测试 /api/users/me | 404(该端点不存在) | 用 /api/users 列表验证认证是否正常 |
| 把 404 当成认证失败 | 误判根因、引入错误修复 | 区分 HTTP 状态码:401=认证失败,404=端点不存在 |
| 预览域名 500 认为代码有 bug | 可能是 Cloudflare 干扰 | 通过 CDS container-exec 在容器内验证 |
识别每日验收、PR 验收、commit 验收、未发布分支验收、缺陷复测、视觉回归和发布前验收等场景,并为 create-visual-test-to-kb 生成测试范围、指差法步骤、预期结果、证据链、截图回读和报告结构。Use when the user asks to optimize or run visual acceptance across different scenarios, asks whether yesterday's changes, a PR, a commit range, or an unpublished branch were really accepted, or needs PR/commit results to map to screenshots and MAP knowledge base reports.
Convert PRs, commits, yesterday's changes, or release scope into a test-minded acceptance design before visual execution. Use when the user asks for daily acceptance, visual acceptance, PR/commit acceptance, proof that code changes really affected product behavior, coverage planning, fusion testing, evidence strength, or when screenshots/reports looked related but failed to prove the assigned task.
工业级功能验收/视觉测试全流水线(MAP 验收标准 v2)——模拟人类的浏览器取证 + 标准化验收报告 + 归档进 CDS 验收中心并出直达深链。职责分离:验收报告永远按项目归 CDS(平台自带、证据链内置),MAP 等系统通过知识库开放协议从 CDS 拉取展示,技能不再分流到 MAP 知识库。一个技能内含三段:标准/模板、模拟人类浏览器取证(点击导航进入、禁地址栏直达、双主题截图、ZZ 照做风画框标序号 stepClick/stepShot)、报告归档(命名结构固定,**每次归档强制输出可达地址**:CDS 直达深链 /reports,匿名对外用 /r/token)。默认报告走 **ZZ 照做风**(全大标题 + 一句话一步 + 逐步配图 `{{IMG:}}` + 文字在上图在下 + 变化处画框 + 分支顺序讲,同岗位照做必复现)。归档前有**强制准入校验**:目标/档位/Verdict/截图数/证据完整性/报告结构不达标直接拒收(入口准则,杜绝"什么都能进")。项目无关,改 acceptance.config.json 即可跨仓库复用;无 CDS/离线退化为本地 md+截图。触发词:"视觉验收"、"验收"、"视觉测试"、"验收归档"、"归档验收报告"、"create visual test"、"/视觉验收"、"/验收"。
CDS (Cloud Dev Space) core skill — hosts the canonical cdscli Python CLI, handles authentication (static AI_ACCESS_KEY / dynamic pairing / project key), manages env vars and project keys, owns CDS service self-update, defines the preview-URL slug formula, and acts as dispatcher when the user's intent is ambiguous between cold-path scanning and hot-path debugging. Activates when the user mentions CDS generically without specifying scan-or-deploy, configures CDS credentials, manages env / keys, updates the CDS service code itself, or asks about preview URL conventions. Does NOT directly perform project scanning (delegates to cds-project-scan, the cold path) or deployment debugging (delegates to cds-deploy-pipeline, the hot path). Trigger phrases include "cds 认证", "AI_ACCESS_KEY", "项目 key", "cds 自更新", "cds self-update", "预览地址公式", "配 cds 环境变量", "/cds", "/cds-auth", and the bare word "cds" when the user has not yet picked a direction.
Generates weekly project reports from git history. Collects commits, PRs, and contributor data, analyzes and categorizes changes, then produces a structured Chinese-language weekly report (overview, completed items, next-week priorities) saved to doc/report.YYYY-WXX.md. Trigger words: "生成周报", "写周报", "weekly report", "本周总结".
从 git 历史生成「今日大事早知道」开发日报,并发布到知识库(文档空间)。按「新增功能多讲 → 优化/修复次之 → 计划/遗留垫底」的固定权重分层叙事。自动 find-or-create「日报知识库」并出分享链。触发词:"生成日报"、"写日报"、"今日大事"、"日报"、"daily report"、"/daily"、"今天干了啥"。