Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion hands/reddit/HAND.toml
Original file line number Diff line number Diff line change
Expand Up @@ -836,7 +836,12 @@ Reddit uses a markdown variant. Use these formatting tools appropriately:
- Include a TL;DR for any post longer than 150 words
- Place it at the END of the post, preceded by a horizontal rule
- The TL;DR should be 1-2 sentences that capture the core point
- Format: `---\n\n**TL;DR:** One or two sentence summary.`
- Format:
```
---

**TL;DR:** One or two sentence summary.
```

## POST TYPE ROTATION

Expand Down
70 changes: 70 additions & 0 deletions workflows/api-design.toml
Original file line number Diff line number Diff line change
@@ -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"]
99 changes: 99 additions & 0 deletions workflows/blog-post.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,99 @@
id = "blog-post"
name = "Blog Post Writer"
description = "Research a topic, build a structured outline, write a full-length blog post, then optimise for SEO."
category = "creation"
tags = ["writing", "blog", "seo", "content"]

[i18n.zh]
name = "博客文章撰写"
description = "调研主题,构建结构化提纲,撰写完整博客文章,并进行 SEO 优化。"

[[parameters]]
name = "topic"
description = "Blog post topic or working title"
param_type = "string"
required = true

[[parameters]]
name = "audience"
description = "Target audience and their expertise level"
param_type = "string"
required = false
default = "general audience"

[[parameters]]
name = "tone"
description = "Desired tone (e.g. technical, conversational, authoritative)"
param_type = "string"
required = false
default = "informative and engaging"

[[steps]]
name = "research"
prompt_template = """
You are a research journalist. For the blog topic below, compile:
1. Key facts, statistics, and data points (with source type)
2. Common misconceptions to debunk
3. Expert perspectives and contrasting views
4. Recent developments or trends
5. Concrete examples and case studies
6. Angles that haven't been covered well in existing content

Topic: {{topic}}
Audience: {{audience}}
"""

[[steps]]
name = "outline"
prompt_template = """
You are a content strategist. Create a detailed blog post outline:
- Compelling headline (3 options)
- Hook / opening angle
- H2 sections with H3 subsections
- Key point per section
- Data or example to use in each section
- Conclusion and CTA

Target length: 1200-1800 words.
Tone: {{tone}}
Audience: {{audience}}

Research:
{{research}}
"""
depends_on = ["research"]

[[steps]]
name = "draft"
prompt_template = """
Write the full blog post following the outline. Guidelines:
- Open with a hook that immediately addresses the reader's pain or curiosity
- Use short paragraphs (3-4 sentences max)
- Include the statistics and examples from research
- Use subheadings to aid scannability
- End with a clear takeaway and one actionable CTA
- Tone: {{tone}}

Outline:
{{outline}}

Research:
{{research}}
"""
depends_on = ["outline", "research"]

[[steps]]
name = "seo_optimise"
prompt_template = """
SEO-optimise the blog post:
1. **Primary keyword** — identify the best target keyword
2. **Meta title** (under 60 chars) and **meta description** (under 155 chars)
3. **Keyword placement** — suggest where to naturally insert the primary keyword and 3 secondary keywords
4. **Internal link opportunities** — topics to link to
5. **Image alt text suggestions** — 2-3 descriptive alts
6. **Revised headline** if needed for keyword inclusion

Draft:
{{draft}}
"""
depends_on = ["draft"]
20 changes: 17 additions & 3 deletions workflows/brainstorm.toml
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,28 @@ required = true

[[steps]]
name = "idea_generator"
prompt_template = "You are a creative strategist. For the following challenge, generate 10 diverse solution ideas. Include: 3 conventional approaches, 4 creative approaches, and 3 bold/unconventional approaches. For each idea, give a one-line title and a 2-sentence explanation.\n\nChallenge: {{challenge}}"
prompt_template = """
You are a creative strategist. For the following challenge, generate 10 diverse solution ideas. Include: 3 conventional approaches, 4 creative approaches, and 3 bold/unconventional approaches. For each idea, give a one-line title and a 2-sentence explanation.

Challenge: {{challenge}}
"""

[[steps]]
name = "evaluator"
prompt_template = "You are a critical analyst. Evaluate each idea below on three criteria: Feasibility (1-5), Impact (1-5), Originality (1-5). Pick the top 3 ideas and for each provide: why it's promising, key risks, and concrete first steps to implement it.\n\nIdeas:\n{{idea_generator}}"
prompt_template = """
You are a critical analyst. Evaluate each idea below on three criteria: Feasibility (1-5), Impact (1-5), Originality (1-5). Pick the top 3 ideas and for each provide: why it's promising, key risks, and concrete first steps to implement it.

Ideas:
{{idea_generator}}
"""
depends_on = ["idea_generator"]

[[steps]]
name = "action_planner"
prompt_template = "You are a project planner. Take the top-rated idea below and create a concrete action plan: 1) Clear goal statement 2) 5-step implementation roadmap with timelines 3) Required resources 4) Success metrics 5) Potential obstacles and mitigation strategies.\n\nEvaluation:\n{{evaluator}}"
prompt_template = """
You are a project planner. Take the top-rated idea below and create a concrete action plan: 1) Clear goal statement 2) 5-step implementation roadmap with timelines 3) Required resources 4) Success metrics 5) Potential obstacles and mitigation strategies.

Evaluation:
{{evaluator}}
"""
depends_on = ["evaluator"]
67 changes: 67 additions & 0 deletions workflows/bug-triage.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
id = "bug-triage"
name = "Bug Triage & Fix Plan"
description = "Analyse a bug report, reproduce the failure path, identify root cause, and produce a prioritised fix plan with test cases."
category = "engineering"
tags = ["bug", "debugging", "triage", "engineering"]

[i18n.zh]
name = "Bug 分析与修复计划"
description = "分析 Bug 报告,还原失败路径,定位根因,输出优先级排序的修复计划与测试用例。"

[[parameters]]
name = "bug_report"
description = "The bug report, error message, or stack trace"
param_type = "string"
required = true

[[parameters]]
name = "codebase_context"
description = "Relevant code snippets or architecture description"
param_type = "string"
required = false
default = ""

[[steps]]
name = "reproduce_path"
prompt_template = """
You are a senior engineer doing bug triage. Given the bug report below, reconstruct the exact failure path:
1. Preconditions that must be true
2. Step-by-step sequence that triggers the bug
3. What the system does vs. what it should do
4. Affected components and data flow

Bug report:
{{bug_report}}

Codebase context:
{{codebase_context}}
"""

[[steps]]
name = "root_cause"
prompt_template = """
You are a debugging expert. Based on the failure path analysis, identify the root cause:
1. Immediate cause (the direct code/logic fault)
2. Contributing factors (environment, race condition, assumption violation)
3. Why this was not caught earlier (missing test, wrong assumption)
4. Blast radius — what else could be affected

Failure path:
{{reproduce_path}}
"""
depends_on = ["reproduce_path"]

[[steps]]
name = "fix_plan"
prompt_template = """
You are a tech lead. Produce a concrete fix plan:
1. **Recommended fix** — specific code change with rationale
2. **Alternative approaches** — trade-offs of each
3. **Test cases to add** — unit, integration, regression
4. **Rollout recommendation** — hotfix vs. normal release, feature flag needed?
5. **Prevention** — process or tooling changes to prevent recurrence

Root cause analysis:
{{root_cause}}
"""
depends_on = ["root_cause"]
60 changes: 56 additions & 4 deletions workflows/code-review.toml
Original file line number Diff line number Diff line change
Expand Up @@ -30,17 +30,69 @@ default = ""

[[steps]]
name = "review_correctness"
prompt_template = "Review the following {{language}} code for correctness. Analyse:\n- Logic errors and edge cases\n- Error handling completeness\n- Null/undefined safety\n- Off-by-one errors and boundary conditions\n- Resource leaks (memory, file handles, connections)\n- Concurrency issues (race conditions, deadlocks)\n\nContext: {{context}}\n\nCode:\n{{code}}"
prompt_template = """
Review the following {{language}} code for correctness. Analyse:
- Logic errors and edge cases
- Error handling completeness
- Null/undefined safety
- Off-by-one errors and boundary conditions
- Resource leaks (memory, file handles, connections)
- Concurrency issues (race conditions, deadlocks)

Context: {{context}}

Code:
{{code}}
"""

[[steps]]
name = "review_security"
prompt_template = "Perform a security review of the following {{language}} code. Check for:\n- Injection vulnerabilities (SQL, command, XSS)\n- Authentication and authorisation flaws\n- Sensitive data exposure (logging secrets, hardcoded credentials)\n- Input validation gaps\n- Insecure cryptographic usage\n- Path traversal and SSRF risks\n- Dependency vulnerabilities\n\nContext: {{context}}\n\nCode:\n{{code}}"
prompt_template = """
Perform a security review of the following {{language}} code. Check for:
- Injection vulnerabilities (SQL, command, XSS)
- Authentication and authorisation flaws
- Sensitive data exposure (logging secrets, hardcoded credentials)
- Input validation gaps
- Insecure cryptographic usage
- Path traversal and SSRF risks
- Dependency vulnerabilities

Context: {{context}}

Code:
{{code}}
"""

[[steps]]
name = "review_style"
prompt_template = "Review the following {{language}} code for style and maintainability. Evaluate:\n- Naming conventions and clarity\n- Function/method length and complexity\n- Code duplication\n- Documentation and comments quality\n- Consistent formatting\n- Appropriate use of language idioms\n- API design and public interface clarity\n\nContext: {{context}}\n\nCode:\n{{code}}"
prompt_template = """
Review the following {{language}} code for style and maintainability. Evaluate:
- Naming conventions and clarity
- Function/method length and complexity
- Code duplication
- Documentation and comments quality
- Consistent formatting
- Appropriate use of language idioms
- API design and public interface clarity

Context: {{context}}

Code:
{{code}}
"""

[[steps]]
name = "synthesise"
prompt_template = "Synthesise the three independent code review analyses below into a unified review summary. Prioritise findings by severity (critical, high, medium, low). Remove duplicates across analyses. Produce a final verdict: approve, request-changes, or needs-discussion.\n\nCorrectness review:\n{{review_correctness}}\n\nSecurity review:\n{{review_security}}\n\nStyle review:\n{{review_style}}"
prompt_template = """
Synthesise the three independent code review analyses below into a unified review summary. Prioritise findings by severity (critical, high, medium, low). Remove duplicates across analyses. Produce a final verdict: approve, request-changes, or needs-discussion.

Correctness review:
{{review_correctness}}

Security review:
{{review_security}}

Style review:
{{review_style}}
"""
depends_on = ["review_correctness", "review_security", "review_style"]
Loading
Loading