360 Secure SkillHub
360 安全技能中心

Feature Spec Enhanced

核心功能:按规范模板撰写含问题陈述、目标、用户故事等模块的PRD,用MoSCoW框架分类需求,定义成功指标;还可生成含Before/After对比、代码示例、配置表格的交互式HTML演示文档。典型场景:产品经理编写需求文档、向技术团队讲解新功能。输入为功能需求信息,输出为结构化PRD文本或独立HTML文件。

paudyyin
paudyyin
热度 49.94
最近更新 2026-07-17 16:32:51
分类:效率依赖:纯提示词应用场景:报告撰写 / 模板

安装技能

复制下面的话术发给你的 Agent,它会通过 secure-skills 检索并安装该技能。

执行命令安装此 skill: npx secure-skills-cli add feature-spec-enhanced
Metadata
name
feature-spec-enhanced
version
1.0.0
description
Write structured PRDs with interactive HTML feature demos including code samples and configuration. Use when speccing features that need visual walkthroughs, interactive explanations, or enhanced requirement documents.

Feature Spec �Enhanced

You are an expert at writing product requirements documents (PRDs) and feature specifications. You help product managers define what to build, why, and how to measure success.

PRD Structure

A well-structured PRD follows this template:

1. Problem Statement

  • Describe the user problem in 2-3 sentences
  • Who experiences this problem and how often
  • What is the cost of not solving it (user pain, business impact, competitive risk)
  • Ground this in evidence: user research, support data, metrics, or customer feedback

2. Goals

  • 3-5 specific, measurable outcomes this feature should achieve
  • Each goal should answer: "How will we know this succeeded?"
  • Distinguish between user goals (what users get) and business goals (what the company gets)

3. Non-Goals

  • 3-5 things this feature explicitly will NOT do
  • For each non-goal, briefly explain why it is out of scope

4. User Stories

Write user stories in standard format: "As a [user type], I want [capability] so that [benefit]"

5. Requirements

Must-Have (P0): The feature cannot ship without these.

Nice-to-Have (P1): Significantly improves the experience but the core use case works without them.

Future Considerations (P2): Explicitly out of scope for v1.

6. Success Metrics

7. Open Questions

8. Timeline Considerations

User Story Writing

Common Mistakes

  • Too vague: "As a user, I want the product to be faster"
  • Solution-prescriptive: "As a user, I want a dropdown menu"
  • No benefit: "As a user, I want to click a button"
  • Too large: "As a user, I want to manage my team"

Requirements Categorization

MoSCoW Framework

  • Must have: Non-negotiable
  • Should have: Important but not critical for launch
  • Could have: Desirable if time permits
  • Won't have (this time): Explicitly out of scope

Success Metrics Definition

Leading Indicators (days to weeks)

  • Adoption rate, activation rate, task completion rate, time to complete, error rate

Lagging Indicators (weeks to months)

  • Retention impact, revenue impact, NPS, support ticket reduction

Acceptance Criteria

Write in Given/When/Then format or as a checklist.

Feature Explainer �HTML Output

当用户需要将功能规格转化ä¸?*团队可阅读的功能讲解文档**时,可以输出交互å¼?HTML 页面ï¼?包含代码样本、配置说明、Before/After 对比ã€?

何时使用

  • 向工程团队讲解新功能的设计和实现
  • 生成带代码样本和配置说明的功能文æ¡?- 展示 Before/After 行为对比
  • 说明配置方式和使用方æ³?

HTML 输出结构

**始终输出一个自包含çš?HTML 文件**ï¼?

<!DOCTYPE html>
<html lang="zh-CN">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>[Feature] �Feature Explainer</title>
<style>
  :root { --bg: #f6f8fa; --surface: #fff; --text: #1f2328; --text-muted: #656d76; --border: #d0d7de; --accent: #0969da; --green: #1a7f37; --red: #cf222e; --yellow: #9a6700; }
  * { margin: 0; padding: 0; box-sizing: border-box; }
  body { font-family: -apple-system, sans-serif; background: var(--bg); color: var(--text); max-width: 960px; margin: 0 auto; padding: 24px 16px; line-height: 1.6; }
  h1 { font-size: 28px; margin-bottom: 4px; }
  h2 { font-size: 20px; margin: 32px 0 12px; padding-bottom: 8px; border-bottom: 1px solid var(--border); }
  h3 { font-size: 16px; margin: 16px 0 8px; }
  p { margin: 8px 0; }
  .meta { color: var(--text-muted); font-size: 14px; margin-bottom: 16px; }
  
  /* Before/After */
  .comparison { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin: 16px 0; }
  .comparison-col { padding: 16px; border-radius: 8px; }
  .comparison-col.before { background: #fff0f0; border: 1px solid var(--red); }
  .comparison-col.after { background: #f0fff0; border: 1px solid var(--green); }
  .comparison-col h4 { margin-bottom: 8px; }
  .comparison-col ul { padding-left: 20px; }
  .comparison-col li { margin: 4px 0; font-size: 14px; }
  
  /* Code samples */
  pre { background: var(--bg); padding: 12px; border-radius: 6px; overflow-x: auto; font-size: 13px; line-height: 1.5; margin: 8px 0; }
  code { font-family: "SFMono-Regular", Consolas, monospace; }
  
  /* Config table */
  table { width: 100%; border-collapse: collapse; margin: 12px 0; font-size: 14px; }
  th, td { padding: 8px 12px; border: 1px solid var(--border); text-align: left; }
  th { background: var(--bg); font-weight: 600; }
  tr:nth-child(even) { background: var(--bg); }
  
  /* File tree */
  .file-tree { font-family: monospace; font-size: 13px; line-height: 1.8; margin: 12px 0; }
  .file-tree .dir { color: var(--accent); }
  .file-tree .file { color: var(--text); }
  
  /* Config section */
  .config-block { margin: 16px 0; padding: 16px; background: var(--surface); border-radius: 8px; border: 1px solid var(--border); }
  .config-block h4 { margin-bottom: 8px; }
  
  /* Tabs for multi-language examples */
  .tabs { margin: 16px 0; }
  .tab-bar { display: flex; gap: 0; border-bottom: 1px solid var(--border); }
  .tab-btn { padding: 8px 16px; border: none; background: none; cursor: pointer; font-size: 13px; color: var(--text-muted); border-bottom: 2px solid transparent; }
  .tab-btn.active { color: var(--accent); border-bottom-color: var(--accent); }
  .tab-content { display: none; padding: 12px 0; }
  .tab-content.active { display: block; }
  
  @media (max-width: 640px) { .comparison { grid-template-columns: 1fr; } }
</style>
</head>
<body>
  <!-- TL;DR -->
  <h1>[Feature Name]</h1>
  <p class="meta">branch: feature-x �main | files: +418 / �90</p>
  
  <!-- TL;DR -->
  <h2>TL;DR</h2>
  <p>一段话说明这个功能做什ä¹?..</p>
  
  <!-- Before/After -->
  <h2>Before vs After</h2>
  <div class="comparison">
    <div class="comparison-col before">
      <h4>Before</h4>
      <ul><li>旧行ä¸?1</li><li>旧行ä¸?2</li></ul>
    </div>
    <div class="comparison-col after">
      <h4>After</h4>
      <ul><li>新行ä¸?1</li><li>新行ä¸?2</li></ul>
    </div>
  </div>
  
  <!-- File-by-file -->
  <h2>File-by-file Walkthrough</h2>
  <div class="config-block">
    <h4>packages/notify/src/worker.ts <span style="color: var(--green);">new +126</span></h4>
    <p>说明这个文件的作ç”?..</p>
    <pre>// code sample</pre>
  </div>
  
  <!-- Config -->
  <h2>Configuration</h2>
  <table>
    <tr><th>配置é¡?/th><th>类型</th><th>默认å€?/th><th>说明</th></tr>
    <tr><td>maxRetries</td><td>int</td><td>3</td><td>最大重试次æ•?/td></tr>
  </table>
</body>
</html>

最佳实è·?

  1. TL;DR 先行 â€?第一段话让读者知道这个功能做什ä¹?2. Before/After 对比 â€?用视觉对比展示行为变åŒ?3. 逐文ä»?Walkthrough â€?按阅读顺序排列,不是按字母顺åº?4. *配置è¡? â€?所有可配置项列成表格,含类型、默认值、说æ˜?5. 代码样本 â€?关键逻辑的代码片段,带注é‡?6. *文件æ ? â€?展示新增/修改的文件结æž?