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
This commit is contained in:
Evan authored and GitHub committed 2026-04-01 18:21:09 +08:00
1 parent ae5d97dc7e
commit 05bdf02169
23 files changed
+1500 -64

No files matched your search

+70
View File
@@ -0,0 +1,70 @@
id = "api-design"
name = "API Design & Specification"
description = "Design a REST API from requirements: endpoints, request/response schemas, auth, error handling, and OpenAPI spec."
category = "engineering"
tags = ["api", "design", "openapi", "engineering"]
[i18n.zh]
name = "API 设计与规范"
description = "从需求出发设计 REST API:端点、请求/响应结构、认证、错误处理,输出 OpenAPI 规范。"
[[parameters]]
name = "requirements"
description = "Feature or product requirements the API needs to satisfy"
param_type = "string"
required = true
[[parameters]]
name = "tech_stack"
description = "Technology stack and any existing API conventions"
param_type = "string"
required = false
default = ""
[[steps]]
name = "resource_model"
prompt_template = """
You are an API architect. From the requirements below, identify the core resources and their relationships:
1. List every resource (noun)
2. Define attributes and types for each
3. Map relationships (one-to-many, many-to-many)
4. Identify which resources need CRUD vs. action-oriented endpoints
Requirements:
{{requirements}}
Tech stack / conventions:
{{tech_stack}}
"""
[[steps]]
name = "endpoint_design"
prompt_template = """
Design the full set of REST endpoints based on the resource model. For each endpoint specify:
- Method + path
- Path/query parameters
- Request body schema (JSON)
- Success response schema + status code
- Error responses (4xx, 5xx)
- Auth requirement
- Idempotency and side-effect notes
Resource model:
{{resource_model}}
"""
depends_on = ["resource_model"]
[[steps]]
name = "openapi_spec"
prompt_template = """
Write a complete OpenAPI 3.1 YAML specification for the API designed above. Include:
- info block with title, version, description
- All paths with operations
- Reusable schemas in components/schemas
- Security schemes
- Example request/response bodies
Endpoint design:
{{endpoint_design}}
"""
depends_on = ["endpoint_design"]