AgentSkillsCN

product-management

任何代码变更都必须遵守此规定。在编写或编辑代码前,务必调用此技能。触发时机包括:实现、新增、创建、构建、重构、调整、修复、更新、变更、“产品”、“PM”、“规格”、“功能”。按照正确的流程流转(简单任务→开发者;复杂任务→功能细化者→开发者→QA)。切勿省略——即使你“已经知道该怎么做”,也绝不能跳过。

SKILL.md
--- frontmatter
name: product-management
description: MANDATORY for ANY code change. MUST invoke BEFORE writing/editing code. Triggers on implement, add, create, build, refactor, adjust, fix, update, change, "produto", "PM", "spec", "feature". Routes to correct workflow (trivial→coder, complex→feature-refiner→coder→qa). NEVER skip - even if you "already know what to do".
allowed-tools: Read, Write, Edit, Glob, Grep, Task, AskUserQuestion, Skill

Product Management & Workflow Orchestration

Jira Integration

Use the jira-searcher skill to fetch planning context when needed:

code
Skill: jira-searcher

When to use:

  • User references an epic/task key (e.g., "implement PROJ-123")
  • Need to understand scope of a planned feature
  • Want to see child tasks of an epic for breakdown

Available commands via jira_read.py:

  • epic <KEY> - Get epic details
  • epic-children <KEY> - List tasks under an epic

You orchestrate ALL development requests - from simple fixes to complex features.

STEP 0: Read Project Documentation (MANDATORY)

Before ANY assessment, read the project's agent_docs folder if it exists:

code
1. Glob for agent_docs/**/*.md in the project root
2. Read ALL found documents in parallel
3. Use this context for coding standards, agent workflows, and project patterns

<project_context_protocol>

  • ALWAYS check for agent_docs/ before starting work
  • If no agent_docs/ exists, proceed with defaults
  • Pass relevant context to downstream agents in the spec
  • Include "Project Standards" section in specs for complex features </project_context_protocol>

STEP 1: Quick Complexity Check (5 seconds)

Before anything, answer these 3 questions mentally:

  1. Is it a typo/text change/single-line fix? → TRIVIAL, skip to Trivial Path
  2. Is it a single file with clear scope? → SIMPLE, skip to Simple Path
  3. Does it need planning/multiple files? → Continue to Full Assessment

Trivial Path (Score < 6)

For truly trivial changes, delegate immediately without spec:

code
Task: [Exact user request]
subagent_type: coder

Examples: typo fix, CSS tweak, rename variable, update string literal, add simple validation

Simple Path (Score 6-8)

For simple but non-trivial changes:

  1. Brief mental assessment (no written spec needed)
  2. Delegate to coder with clear instructions:
code
Task: [Clear description with context]
subagent_type: coder

Examples: add button, new simple endpoint, basic component, configuration change

Full Path (Score 9+)

Continue to Complexity Assessment Matrix below.


Complexity Assessment Matrix (Only for Score 9+)

FactorSimple (1pt)Medium (2pt)Complex (3pt)
Files affected1-23-56+
New dependenciesNone1-2 knownNew/unfamiliar
Database changesNoneAdd columnsNew tables/relations
External APIsNoneExisting integrationNew integration
Business logicCRUDSome rulesComplex rules
Risk levelLowMediumHigh

Score interpretation:

  • 6-8 points: Simple → Coder only
  • 9-12 points: Medium → Coder → QA
  • 13-18 points: Complex → Feature-Refiner → Coder → QA

Workflow Patterns

Pattern 1: Simple (Score 6-8)

code
Direct to Coder (no QA needed for trivial changes)

Examples:
- Fix typo
- Update copy/text
- Add simple validation
- CSS adjustments

Delegation:

code
Task: Implement [description]
subagent_type: coder

Pattern 2: Medium (Score 9-12)

code
Coder → QA

Examples:
- New CRUD endpoint
- Add form field with validation
- Simple new component
- Bug fix with tests

Delegation sequence:

code
1. Create spec in specs/[feature].md
2. Task: Implement spec at specs/[feature].md
   subagent_type: coder
3. Coder auto-delegates to qa-code-reviewer

Pattern 3: Complex (Score 13-18)

code
Feature-Refiner → Update Spec → Coder → QA

Examples:
- New authentication system
- Payment integration
- Complex business workflow
- Architecture changes

Delegation sequence:

code
1. Create initial spec in specs/[feature].md
2. Task: Analyze technical feasibility and refine spec at specs/[feature].md
   subagent_type: feature-refiner
3. Update spec with refinements
4. Task: Implement refined spec at specs/[feature].md
   subagent_type: coder
5. Coder auto-delegates to qa-code-reviewer

Pattern 4: Parallel Independent Tasks

code
When feature has independent parts that don't share state:

┌─────────────┐     ┌─────────────┐
│   Coder A   │     │   Coder B   │
│  (API work) │     │  (UI work)  │
└──────┬──────┘     └──────┬──────┘
       │                   │
       ▼                   ▼
┌─────────────┐     ┌─────────────┐
│    QA A     │     │    QA B     │
└─────────────┘     └─────────────┘

Identification criteria for parallel work:

  • Different file domains (backend vs frontend)
  • No shared state or dependencies
  • Can be tested independently
  • No database migration conflicts

Delegation:

code
# Spawn parallel coders
Task: Implement API endpoints per specs/[feature]-api.md
subagent_type: coder

Task: Implement UI components per specs/[feature]-ui.md
subagent_type: coder

Specification Format (BDD)

Always create specs before delegation:

markdown
# Feature: [Name]

## Context

[What exists, what patterns to follow]

## Complexity Assessment

- Files affected: X
- New dependencies: X
- Database changes: X
- External APIs: X
- Business logic: X
- Risk level: X
- **Total Score: X → [Simple/Medium/Complex]**
- **Workflow: [Pattern to use]**

## User Story

As a [user type]
I want to [capability]  
So that [business value]

## MVP Scope

**In Scope:**

- ...

**Deferred:**

- ... → Future

## Acceptance Criteria

### Scenario: [Happy path]

Given [context]
When [action]
Then [outcome]

### Scenario: [Edge case]

...

## Technical Notes

[From feature-refiner if complex]

## Implementation Plan

- [ ] Part 1: [description] → Coder A
- [ ] Part 2: [description] → Coder B (parallel if independent)

Decision Tree

code
START: Any implementation request
  │
  ▼
QUICK CHECK (5 seconds):
  │
  ├── Typo/text/single-line? ─────→ TRIVIAL: Delegate to coder immediately
  │
  ├── Single file, clear scope? ──→ SIMPLE: Delegate to coder with context
  │
  └── Needs planning? ────────────→ Continue below
         │
         ▼
    Create spec with complexity assessment
         │
         ▼
    Score >= 13? ─────YES────→ feature-refiner → coder → qa
         │
         NO
         │
         ▼
    Has independent parts?
         │
         ├──YES──→ Split specs, spawn parallel coders
         │
         NO
         │
         ▼
    Delegate to coder (auto-QA for score 9+)

Agent Capabilities Reference

feature-refiner

  • Technical feasibility analysis
  • Library evaluation
  • Risk assessment
  • Architecture recommendations
  • Output: Technical refinements for spec

coder

  • Implementation from specs
  • Follows codebase patterns
  • Auto-delegates to QA when done
  • Output: Working code

qa-code-reviewer

  • Code quality review
  • Security check
  • Standards compliance
  • Output: APPROVED / REVISE / DISCUSS

Orchestration Commands

When delegating, use Task tool with:

code
Task: [Clear description of what to do]
subagent_type: [agent-name]

For resumable long tasks:

code
Task: [Description]
subagent_type: [agent-name]
# Note: Save agentId for potential resume

Examples

Example 1: "Fix typo in login button" → TRIVIAL

code
Quick check: Single text change? YES → TRIVIAL
Action: Delegate immediately

Task: Fix typo in login button
subagent_type: coder

Example 2: "Add loading spinner to submit button" → SIMPLE

code
Quick check: Single file, clear scope? YES → SIMPLE
Action: Delegate with context

Task: Add loading spinner to submit button. Show spinner while form submits, disable button during loading.
subagent_type: coder

Example 3: "Add dark mode toggle" → SIMPLE

code
Quick check: Needs planning? Borderline, but scope is clear
Assessment: 2 files, no deps, no DB, simple logic
Score: 6 → Simple
Action: Delegate to coder with context (no spec needed)

Task: Add dark mode toggle. Create toggle in settings, persist preference in localStorage, apply dark theme class to body.
subagent_type: coder

Example 4: "Add user profile page with avatar upload" → MEDIUM

code
Quick check: Needs planning? YES (multiple files, new feature)
Assessment: 4 files, 1 dep (image lib), add column, some logic
Score: 11 → Medium
Workflow: Coder → QA

Action: Create spec, delegate to coder

Example 5: "Integrate Stripe payments" → COMPLEX

code
Quick check: Needs planning? YES (new integration, high risk)
Assessment: 8+ files, new dep, new tables, new API, complex logic, high risk
Score: 17 → Complex
Workflow: Feature-Refiner → Coder → QA

Action: Create spec, delegate to feature-refiner, update spec, delegate to coder

Example 6: "Build admin dashboard with API and UI" → PARALLEL

code
Assessment: Complex BUT has independent parts
- API: backend only, no UI deps
- UI: frontend only, mocks API initially

Action:
1. Create specs/admin-api.md and specs/admin-ui.md
2. Spawn parallel coders
3. Each auto-delegates to QA