Files
librefang-registry/workflows/product-spec.toml
T
Evan 05bdf02169 feat(workflows): expand template library from 9 to 22 + multiline string cleanup (#36)
* feat(workflows): add 13 workflow templates across engineering, business, and productivity

Engineering:
- bug-triage: reproduce path → root cause → fix plan
- api-design: resource model → endpoints → OpenAPI spec
- incident-postmortem: timeline → RCA → full postmortem report
- test-generation: code analysis → edge cases → full test suite
- refactor-plan: smell analysis → prioritised opportunities → migration plan

Business:
- competitor-analysis: profiles → SWOT → strategy report
- product-spec: problem definition → user stories → full PRD
- market-research: landscape → segments → research report

Productivity/Thinking:
- meeting-summary: raw notes → structured summary → follow-up email
- decision-matrix: criteria → weighted scoring → recommendation memo
- learning-plan: gap analysis → roadmap → week-1 day-by-day plan
- job-application: job analysis → tailored resume → cover letter → interview prep
- blog-post: research → outline → draft → SEO optimisation

Closes #1912 on librefang/librefang

* fix(workflows): overhaul existing 9 templates

- data-pipeline: redesigned — original 'extract from URL' step was
  broken (LLMs cannot fetch URLs); replaced with paste-data approach
  (profile → clean_transform → analyse) with analysis_goal parameter
- translate-polish: added target_language and register parameters;
  added back-translation step for accuracy verification
- weekly-report: added team/audience parameters, richer extraction
  step, added Metrics and Notes sections
- content-pipeline: added audience/tone parameters, added outline step
  between research and writing
- content-review: fix category 'content' → 'creation'
- customer-support: fix category 'support' → 'business'

* style(workflows): convert all prompt_template strings to TOML multiline syntax

Replace \n escape sequences with real newlines using triple-quote
multiline strings ("""...""") across all 22 workflow templates.
No content changes — formatting only.

* style(hands): replace \n escape in reddit writer format example with multiline code block
2026-04-01 18:21:09 +08:00

86 lines
2.4 KiB
TOML

id = "product-spec"
name = "Product Spec Writer"
description = "Turn a product idea or feature request into a complete PRD: user stories, acceptance criteria, technical notes, and open questions."
category = "business"
tags = ["product", "prd", "planning", "engineering"]
[i18n.zh]
name = "产品需求文档撰写"
description = "将产品想法或功能需求转化为完整 PRD:用户故事、验收标准、技术备注和待确认事项。"
[[parameters]]
name = "feature_idea"
description = "Feature idea or problem statement to spec out"
param_type = "string"
required = true
[[parameters]]
name = "context"
description = "Product context, target users, and any constraints"
param_type = "string"
required = false
default = ""
[[steps]]
name = "problem_definition"
prompt_template = """
You are a senior product manager. Define the problem clearly:
1. **Problem statement** — one precise sentence
2. **Who has this problem** — user segments and their specific pain
3. **Current workarounds** — how users cope today
4. **Why now** — why is this worth solving now
5. **Success looks like** — quantifiable outcomes
6. **Out of scope** — what this will deliberately not solve
Idea: {{feature_idea}}
Context: {{context}}
"""
[[steps]]
name = "user_stories"
prompt_template = """
Write user stories in the format: As a [user type], I want to [action] so that [outcome].
For each story:
- Given / When / Then acceptance criteria (3-5 criteria)
- Priority: P0 (must-have) / P1 (should-have) / P2 (nice-to-have)
- Estimated complexity: S / M / L / XL
Write at least 6 user stories covering happy paths, edge cases, and error states.
Problem definition:
{{problem_definition}}
"""
depends_on = ["problem_definition"]
[[steps]]
name = "prd"
prompt_template = """
Write a complete Product Requirements Document:
## Overview
## Problem Statement
## Goals & Non-Goals
## User Stories
(from above)
## Functional Requirements
Numbered list of specific behaviours the system must exhibit.
## Non-Functional Requirements
Performance, security, accessibility, internationalisation.
## Technical Considerations
Known constraints, integration points, migration needs.
## Metrics
How success will be measured (leading and lagging indicators).
## Open Questions
Decisions still needed, with suggested owners.
## Timeline Sketch
Phases with rough scope.
Problem definition:
{{problem_definition}}
User stories:
{{user_stories}}
"""
depends_on = ["problem_definition", "user_stories"]