关于 product-analysis
product-analysis 是一个产品分析技能,通过并行探索和综合多个 AI 视角来审查项目,适合评估 UX、API、架构和文档的团队。它可检测 Codex CLI 是否可用,并按分析范围组织 Claude Code Agent 与 Codex CLI 的调查。
主要功能
- 01按范围分析 UX、API 与架构
- 02并行启动 Claude Code Agent
- 03检测并调用 Codex CLI
- 04交叉验证分析发现
- 05量化指标并生成报告
适用场景
- 01审查产品导航与新用户流程
- 02盘点 API 端点及其使用情况
- 03分析模块依赖和代码重复
- 04检查文档与配置是否一致
安装
复制下面的命令,在终端中运行。
npx skills add https:/ / github.com/ daymade/ claude-code-skills --skill product-analysis安装后在 Claude Code 中输入/product-analysis确认已加载。
包含的文件
除 SKILL.md 外,安装时一起下载的参考资料和脚本。
references/analysis_dimensions.mdcodex_patterns.mdsynthesis_methodology.md详细介绍
产品分析
多路径并行产品分析,结合 Claude Code agent teams 和 Codex CLI,通过跨模型扩展测试时计算。
核心原则:相同的分析任务,多种 AI 视角,深入综合。
工作原理
/product-analysis full
│
├─ Step 0: Auto-detect available tools (codex? competitors?)
│
┌────┼──────────────┐
│ │ │
Claude Code Codex CLI (auto-detected)
Task Agents (background Bash)
(Explore ×3-5) (×2-3 parallel)
│ │
└────────┬──────────┘
│
Synthesis (main context)
│
Structured Report
步骤 0:自动检测可用工具
启动任何 Agent 之前,先检测可用工具:
# Check if Codex CLI is installed
which codex 2>/dev/null && codex --version
决策逻辑:
- 如果找到
codex:告知用户——“已检测到 Codex CLI(版本 X)。将运行跨模型分析,以获得更丰富的视角。” - 如果未找到
codex:仅使用 Claude Code Agent 继续执行,不作提示。不要要求用户安装任何内容。
还要检测项目类型,以便定制 Agent 提示词:
# Detect project type
ls package.json 2>/dev/null # Node.js/React
ls pyproject.toml 2>/dev/null # Python
ls Cargo.toml 2>/dev/null # Rust
ls go.mod 2>/dev/null # Go
范围模式
解析 $ARGUMENTS 以确定分析范围:
| 范围 | 涵盖内容 | 常用 Agent |
|---|---|---|
full | UX + API + 架构 + 文档(默认) | 5 个 Claude + Codex(如果可用) |
ux | 前端导航、信息密度、用户旅程、空状态、引导流程 | 3 个 Claude + Codex(如果可用) |
api | 后端 API 覆盖范围、端点健康状况、错误处理、一致性 | 2 个 Claude + Codex(如果可用) |
arch | 模块结构、依赖关系图、代码重复、关注点分离 | 2 个 Claude + Codex(如果可用) |
compare X Y | 自我审计 + 竞争基准分析(调用 /competitors-analysis) | 3 个 Claude + competitors-analysis |
阶段 1:并行探索
使用 Task 工具(后台模式)同时启动所有探索 Agent。
Claude Code Agent(始终运行)
针对每个维度,启动一个 Task Agent,并设置 subagent_type: Explore 和 run_in_background: true:
Agent A — 前端导航与信息密度
Explore the frontend navigation structure and entry points:
1. App.tsx: How many top-level components are mounted simultaneously?
2. Left sidebar: How many buttons/entries? What does each link to?
3. Right sidebar: How many tabs? How many sections per tab?
4. Floating panels: How many drawers/modals? Which overlap in functionality?
5. Count total first-screen interactive elements for a new user.
6. Identify duplicate entry points (same feature accessible from 2+ places).
Give specific file paths, line numbers, and element counts.
Agent B — 用户旅程与空状态
Explore the new user experience:
1. Empty state page: What does a user with no sessions see? Count clickable elements.
2. Onboarding flow: How many steps? What information is presented?
3. Prompt input area: How many buttons/controls surround the input box? Which are high-frequency vs low-frequency?
4. Mobile adaptation: How many nav items? How does it differ from desktop?
5. Estimate: Can a new user complete their first conversation in 3 minutes?
Give specific file paths, line numbers, and UX assessment.
Agent C — 后端 API 与健康状况
Explore the backend API surface:
1. List ALL API endpoints (method + path + purpose).
2. Trace frontend, CLI, integration and documented external/API consumers. Mark unused only with consumer and lifecycle evidence; otherwise report coverage unknown.
3. Check error handling consistency (do all endpoints return structured errors?).
4. Check authentication/authorization patterns (which endpoints require auth?).
5. Identify any endpoints that duplicate functionality.
Give specific file paths and line numbers.
Agent D — 架构与模块结构(仅适用于 full/arch 范围)
Explore the module structure and dependencies:
1. Map the module dependency graph (which modules import which).
2. Identify circular dependencies or tight coupling.
3. Find code duplication across modules (same pattern in 3+ places).
4. Check separation of concerns (does each module have a single responsibility?).
5. Identify dead code or unused exports.
Give specific file paths and line numbers.
Agent E — 文档与配置一致性(仅适用于 full 范围)
Explore documentation and configuration:
1. Compare README claims vs actual implemented features.
2. Check config file consistency (base.yaml vs .env.example vs code defaults).
3. Find outdated documentation (references to removed features/files).
4. Check test coverage gaps (which modules have no tests?).
Give specific file paths and line numbers.
Codex CLI Agent(自动检测)
如果在步骤 0 中检测到 Codex CLI,则通过后台 Bash 启动并行 Codex 分析。
每次 Codex 调用都使用相同的维度提示词,但采用不同模型的视角:
codex -m o4-mini \
-c model_reasoning_effort="high" \
--full-auto \
"Analyze the frontend navigation structure of this project. Count all interactive elements visible to a new user on first screen. Identify duplicate entry points where the same feature is accessible from 2+ places. Give specific file paths and counts."
并行运行 2–3 条 Codex 命令(后台 Bash),每条命令对应一个主要维度。
重要:Codex 在项目的工作目录中运行,拥有完整的文件系统访问权限。--full-auto 标志(或旧版本中的 --dangerously-bypass-approvals-and-sandbox)可启用自主执行。
阶段 2:竞争基准分析(仅适用于 compare 范围)
当范围为 compare 时,针对每个竞争对手调用 competitors-analysis 技能:
Use the Skill tool to invoke: /competitors-analysis {competitor-name} {competitor-url}
此操作委托给正交的 competitors-analysis 技能,由其负责:
- 克隆并验证代码仓库
- 基于证据的代码分析(文件:行号引用)
- 生成竞争对手档案
阶段 3:综合分析
所有 Agent 完成后,在主对话上下文中综合分析结果。
交叉验证
使用综合分析方法比较各 Agent 的发现。将一致和不一致之处视为审查线索;针对原始资料或对相关使用者的可复现观察,核实重要主张。置信度应基于测量有效性、范围覆盖情况和证据独立性,而非投票结果或模型身份。合并计数前,先协调不同的范围。使用计数定位可能造成任务阻碍的因素;在声称存在可用性或业务影响之前,先核实其对任务的实际影响。
量化
从 Agent 报告中提取具体数据:
| 指标 | 测量内容 |
|---|---|
| 首屏交互元素 | 新用户可见的按钮、链接和输入框总数 |
| 功能入口重复度 | 具有 2 个或更多入口的功能数量 |
| API 使用方覆盖情况 | 有观察到使用方的路由、已验证未使用的路由和覆盖情况未知的路由,包括 CLI、集成和外部客户端 |
| 首次获得价值所需的引导步骤 | 从启动到首次成功操作所需的步骤 |
| 模块耦合度评分 | 循环依赖或双向依赖的数量 |
结构化输出
生成分层优化报告:
## Product Analysis Report
### Executive Summary
[1-2 sentences: key finding]
### Quantified Findings
| Metric | Value | Assessment |
|--------|-------|------------|
| ... | ... | ... |
### P0: Critical (block launch)
[Issues that prevent basic usability]
### P1: High Priority (launch week)
[Issues that significantly degrade experience]
### P2: Medium Priority (next sprint)
[Issues worth addressing but not blocking]
### Cross-Model Insights
[Findings that only one model identified — worth investigating]
### Competitive Position (if compare scope)
[How we compare on key dimensions]
工作流检查清单
- 解析
$ARGUMENTS以确定范围 - 自动检测 Codex CLI 是否可用(
which codex) - 自动检测项目类型(package.json / pyproject.toml / 等)
- 启动 Claude Code Explore Agent(3-5 个并行运行,后台执行)
- 若检测到 Codex CLI,则并行启动 Codex CLI 命令(2-3 个,后台执行)
- 若范围包含
compare,则调用/competitors-analysis - 收集所有 Agent 的结果
- 交叉验证发现
- 量化指标
- 生成包含 P0/P1/P2 优先级的结构化报告
参考资料
- references/analysis_dimensions.md — 详细的审计维度定义和提示词
- references/synthesis_methodology.md — 如何对多 Agent 发现进行加权和合并
- references/codex_patterns.md — Codex CLI 调用模式和标志参考