Add community skills, agents, system prompts from 22+ sources
Community Skills (32): - jat: jat-start, jat-verify, jat-complete - pi-mono: codex-cli, codex-5.3-prompting, interactive-shell - picoclaw: github, weather, tmux, summarize, skill-creator - dyad: 18 skills (swarm-to-plan, multi-pr-review, fix-issue, lint, etc.) - dexter: dcf valuation skill Agents (23): - pi-mono subagents: scout, planner, reviewer, worker - toad: 19 agent configs (Claude, Codex, Gemini, Copilot, OpenCode, etc.) System Prompts (91): - Anthropic: 15 Claude prompts (opus-4.6, code, cowork, etc.) - OpenAI: 49 GPT prompts (gpt-5 series, o3, o4-mini, tools) - Google: 13 Gemini prompts (2.5-pro, 3-pro, workspace, cli) - xAI: 5 Grok prompts - Other: 9 misc prompts (Notion, Raycast, Warp, Kagi, etc.) Hooks (9): - JAT hooks for session management, signal tracking, activity logging Prompts (6): - pi-mono templates for PR review, issue analysis, changelog audit Sources analyzed: jat, ralph-desktop, toad, pi-mono, cmux, pi-interactive-shell, craft-agents-oss, dexter, picoclaw, dyad, system_prompts_leaks, Prometheus, zed, clawdbot, OS-Copilot, and more
This commit is contained in:
83
skills/community/dyad/fix-issue/SKILL.md
Normal file
83
skills/community/dyad/fix-issue/SKILL.md
Normal file
@@ -0,0 +1,83 @@
|
||||
---
|
||||
name: dyad:fix-issue
|
||||
description: Create a plan to fix a GitHub issue, then implement it locally.
|
||||
---
|
||||
|
||||
# Fix Issue
|
||||
|
||||
Create a plan to fix a GitHub issue, then implement it locally.
|
||||
|
||||
## Arguments
|
||||
|
||||
- `$ARGUMENTS`: GitHub issue number or URL.
|
||||
|
||||
## Instructions
|
||||
|
||||
1. **Fetch the GitHub issue:**
|
||||
|
||||
First, extract the issue number from `$ARGUMENTS`:
|
||||
- If `$ARGUMENTS` is a number (e.g., `123`), use it directly
|
||||
- If `$ARGUMENTS` is a URL (e.g., `https://github.com/owner/repo/issues/123`), extract the issue number from the path
|
||||
|
||||
Then fetch the issue:
|
||||
|
||||
```
|
||||
gh issue view <issue-number> --json title,body,comments,labels,assignees
|
||||
```
|
||||
|
||||
2. **Sanitize the issue content:**
|
||||
|
||||
Run the issue body through the sanitization script to remove HTML comments, invisible characters, and other artifacts:
|
||||
|
||||
```
|
||||
printf '%s' "$ISSUE_BODY" | python3 .claude/skills/fix-issue/scripts/sanitize_issue_markdown.py
|
||||
```
|
||||
|
||||
This removes:
|
||||
- HTML comments (`<!-- ... -->`)
|
||||
- Zero-width and invisible Unicode characters
|
||||
- Excessive blank lines
|
||||
- HTML details/summary tags (keeping content)
|
||||
|
||||
3. **Analyze the issue:**
|
||||
- Understand what the issue is asking for
|
||||
- Identify the type of work (bug fix, feature, refactor, etc.)
|
||||
- Note any specific requirements or constraints mentioned
|
||||
|
||||
4. **Explore the codebase:**
|
||||
- Search for relevant files and code related to the issue
|
||||
- Understand the current implementation
|
||||
- Identify what needs to change
|
||||
- Look at existing tests to understand testing patterns used in the project
|
||||
|
||||
5. **Determine testing approach:**
|
||||
|
||||
Consider what kind of testing is appropriate for this change:
|
||||
- **E2E test**: For user-facing features or complete user flows. Prefer this when the change involves UI interactions or would require mocking many dependencies to unit test.
|
||||
- **Unit test**: For pure business logic, utility functions, or isolated components.
|
||||
- **No new tests**: Only for trivial changes (typos, config tweaks, etc.)
|
||||
|
||||
Note: Per project guidelines, avoid writing many E2E tests for one feature. Prefer one or two E2E tests with broad coverage. If unsure, ask the user for guidance on testing approach.
|
||||
|
||||
**IMPORTANT for E2E tests:** You MUST run `npm run build` before running E2E tests. E2E tests run against the built application binary. If you make any changes to application code (anything outside of `e2e-tests/`), you MUST re-run `npm run build` before running E2E tests, otherwise you'll be testing the old version.
|
||||
|
||||
6. **Create a detailed plan:**
|
||||
|
||||
Write a plan that includes:
|
||||
- **Summary**: Brief description of the issue and proposed solution
|
||||
- **Files to modify**: List of files that will need changes
|
||||
- **Implementation steps**: Ordered list of specific changes to make
|
||||
- **Testing approach**: What tests to add (E2E, unit, or none) and why
|
||||
- **Potential risks**: Any concerns or edge cases to consider
|
||||
|
||||
7. **Execute the plan:**
|
||||
|
||||
If the plan is straightforward with no ambiguities or open questions:
|
||||
- Proceed directly to implementation without asking for approval
|
||||
- Implement the plan step by step
|
||||
- Run `/dyad:pr-push` when complete
|
||||
|
||||
If the plan has significant complexity, multiple valid approaches, or requires user input:
|
||||
- Present the plan to the user and use `ExitPlanMode` to request approval
|
||||
- After approval, implement the plan step by step
|
||||
- Run `/dyad:pr-push` when complete
|
||||
@@ -0,0 +1,22 @@
|
||||
# Bug Report
|
||||
|
||||
<details>
|
||||
<summary>Click to expand logs</summary>
|
||||
|
||||
Error log content here:
|
||||
|
||||
```
|
||||
ERROR: Something went wrong
|
||||
Stack trace follows
|
||||
```
|
||||
|
||||
</details>
|
||||
|
||||
## More Info
|
||||
|
||||
Additional context.
|
||||
|
||||
<details open>
|
||||
<summary>Open by default</summary>
|
||||
This is expanded by default.
|
||||
</details>
|
||||
@@ -0,0 +1,17 @@
|
||||
# Bug Report
|
||||
|
||||
Click to expand logs
|
||||
|
||||
Error log content here:
|
||||
|
||||
```
|
||||
ERROR: Something went wrong
|
||||
Stack trace follows
|
||||
```
|
||||
|
||||
## More Info
|
||||
|
||||
Additional context.
|
||||
|
||||
Open by default
|
||||
This is expanded by default.
|
||||
@@ -0,0 +1,11 @@
|
||||
# Issue Title
|
||||
|
||||
Too many blank lines above.
|
||||
|
||||
And here too.
|
||||
|
||||
## Section
|
||||
|
||||
Content with trailing spaces
|
||||
|
||||
More content.
|
||||
@@ -0,0 +1,11 @@
|
||||
# Issue Title
|
||||
|
||||
Too many blank lines above.
|
||||
|
||||
And here too.
|
||||
|
||||
## Section
|
||||
|
||||
Content with trailing spaces
|
||||
|
||||
More content.
|
||||
@@ -0,0 +1,19 @@
|
||||
# Bug Report
|
||||
|
||||
<!-- This is a hidden comment that should be removed -->
|
||||
|
||||
There's a bug in the login flow.
|
||||
|
||||
<!--
|
||||
Multi-line comment
|
||||
that spans several lines
|
||||
and should also be removed
|
||||
-->
|
||||
|
||||
## Steps to Reproduce
|
||||
|
||||
1. Go to login page
|
||||
2. Enter credentials
|
||||
3. Click submit
|
||||
|
||||
<!-- TODO: Add more details -->
|
||||
@@ -0,0 +1,9 @@
|
||||
# Bug Report
|
||||
|
||||
There's a bug in the login flow.
|
||||
|
||||
## Steps to Reproduce
|
||||
|
||||
1. Go to login page
|
||||
2. Enter credentials
|
||||
3. Click submit
|
||||
@@ -0,0 +1,9 @@
|
||||
# Feature Request
|
||||
|
||||
This text has zero-width spaces hidden in it.
|
||||
|
||||
And some other invisible characters like and and .
|
||||
|
||||
## Description
|
||||
|
||||
Normal text here.
|
||||
@@ -0,0 +1,9 @@
|
||||
# Feature Request
|
||||
|
||||
This text has zero-width spaces hidden in it.
|
||||
|
||||
And some other invisible characters like and and .
|
||||
|
||||
## Description
|
||||
|
||||
Normal text here.
|
||||
@@ -0,0 +1,26 @@
|
||||
# Complex Issue
|
||||
|
||||
<!-- Hidden metadata: priority=high -->
|
||||
|
||||
This issue has multiple problems.
|
||||
|
||||
<details>
|
||||
<summary>Stack trace</summary>
|
||||
|
||||
```
|
||||
Error at line 42
|
||||
at foo()
|
||||
at bar()
|
||||
```
|
||||
|
||||
</details>
|
||||
|
||||
## Steps to Reproduce
|
||||
|
||||
<!-- TODO: verify these steps -->
|
||||
|
||||
1. Do thing A
|
||||
2. Do thing B
|
||||
3. See error
|
||||
|
||||
<!-- End of issue -->
|
||||
@@ -0,0 +1,17 @@
|
||||
# Complex Issue
|
||||
|
||||
This issue has multiple problems.
|
||||
|
||||
Stack trace
|
||||
|
||||
```
|
||||
Error at line 42
|
||||
at foo()
|
||||
at bar()
|
||||
```
|
||||
|
||||
## Steps to Reproduce
|
||||
|
||||
1. Do thing A
|
||||
2. Do thing B
|
||||
3. See error
|
||||
@@ -0,0 +1,83 @@
|
||||
#!/usr/bin/env python3
|
||||
"""
|
||||
Sanitize GitHub issue markdown by removing comments, unusual formatting,
|
||||
and other artifacts that may confuse LLMs processing the issue.
|
||||
"""
|
||||
|
||||
import re
|
||||
import sys
|
||||
|
||||
|
||||
def sanitize_issue_markdown(markdown: str) -> str:
|
||||
"""
|
||||
Sanitize GitHub issue markdown content.
|
||||
|
||||
Removes:
|
||||
- HTML comments (<!-- ... -->)
|
||||
- Zero-width characters and other invisible Unicode
|
||||
- Excessive blank lines (more than 2 consecutive)
|
||||
- Leading/trailing whitespace on each line
|
||||
- HTML tags that aren't useful for understanding content
|
||||
- GitHub-specific directives that aren't content
|
||||
|
||||
Args:
|
||||
markdown: Raw markdown string from GitHub issue
|
||||
|
||||
Returns:
|
||||
Cleaned markdown string
|
||||
"""
|
||||
result = markdown
|
||||
|
||||
# Remove HTML comments (including multi-line)
|
||||
result = re.sub(r"<!--[\s\S]*?-->", "", result)
|
||||
|
||||
# Remove zero-width characters and other invisible Unicode
|
||||
# (Zero-width space, non-joiner, joiner, word joiner, no-break space, etc.)
|
||||
result = re.sub(
|
||||
r"[\u200b\u200c\u200d\u2060\ufeff\u00ad\u034f\u061c\u180e]", "", result
|
||||
)
|
||||
|
||||
# Remove other control characters (except newlines, tabs)
|
||||
result = re.sub(r"[\x00-\x08\x0b\x0c\x0e-\x1f\x7f]", "", result)
|
||||
|
||||
# Remove HTML details/summary blocks but keep inner content
|
||||
result = re.sub(r"</?(?:details|summary)[^>]*>", "", result, flags=re.IGNORECASE)
|
||||
|
||||
# Remove empty HTML tags
|
||||
result = re.sub(r"<([a-z]+)[^>]*>\s*</\1>", "", result, flags=re.IGNORECASE)
|
||||
|
||||
# Remove GitHub task list markers that are just decoration
|
||||
# But keep the actual checkbox content (supports both [x] and [X])
|
||||
result = re.sub(r"^\s*-\s*\[[ xX]\]\s*$", "", result, flags=re.MULTILINE)
|
||||
|
||||
# Normalize line endings
|
||||
result = result.replace("\r\n", "\n").replace("\r", "\n")
|
||||
|
||||
# Strip trailing whitespace from each line
|
||||
result = "\n".join(line.rstrip() for line in result.split("\n"))
|
||||
|
||||
# Collapse more than 2 consecutive blank lines into 2
|
||||
result = re.sub(r"\n{4,}", "\n\n\n", result)
|
||||
|
||||
# Strip leading/trailing whitespace from the whole document
|
||||
result = result.strip()
|
||||
|
||||
return result
|
||||
|
||||
|
||||
def main():
|
||||
"""Read from stdin, sanitize, write to stdout."""
|
||||
if len(sys.argv) > 1:
|
||||
# Read from file
|
||||
with open(sys.argv[1], "r", encoding="utf-8") as f:
|
||||
content = f.read()
|
||||
else:
|
||||
# Read from stdin
|
||||
content = sys.stdin.read()
|
||||
|
||||
sanitized = sanitize_issue_markdown(content)
|
||||
print(sanitized)
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
main()
|
||||
@@ -0,0 +1,141 @@
|
||||
#!/usr/bin/env python3
|
||||
"""
|
||||
Unit tests for sanitize_issue_markdown.py using golden input/output pairs.
|
||||
"""
|
||||
|
||||
import unittest
|
||||
from pathlib import Path
|
||||
|
||||
from sanitize_issue_markdown import sanitize_issue_markdown
|
||||
|
||||
|
||||
class TestSanitizeIssueMarkdown(unittest.TestCase):
|
||||
"""Test the sanitize_issue_markdown function using golden files."""
|
||||
|
||||
GOLDENS_DIR = Path(__file__).parent / "goldens"
|
||||
|
||||
def _load_golden_pair(self, name: str) -> tuple[str, str]:
|
||||
"""Load a golden input/output pair by name."""
|
||||
input_file = self.GOLDENS_DIR / f"{name}_input.md"
|
||||
output_file = self.GOLDENS_DIR / f"{name}_output.md"
|
||||
|
||||
with open(input_file, "r", encoding="utf-8") as f:
|
||||
input_content = f.read()
|
||||
with open(output_file, "r", encoding="utf-8") as f:
|
||||
expected_output = f.read()
|
||||
|
||||
return input_content, expected_output
|
||||
|
||||
def _run_golden_test(self, name: str):
|
||||
"""Run a golden test by name."""
|
||||
input_content, expected_output = self._load_golden_pair(name)
|
||||
actual_output = sanitize_issue_markdown(input_content)
|
||||
self.assertEqual(
|
||||
actual_output,
|
||||
expected_output,
|
||||
f"Golden test '{name}' failed.\n"
|
||||
f"Expected:\n{repr(expected_output)}\n\n"
|
||||
f"Actual:\n{repr(actual_output)}",
|
||||
)
|
||||
|
||||
def test_html_comments(self):
|
||||
"""Test that HTML comments are removed."""
|
||||
self._run_golden_test("html_comments")
|
||||
|
||||
def test_invisible_chars(self):
|
||||
"""Test that invisible/zero-width characters are removed."""
|
||||
self._run_golden_test("invisible_chars")
|
||||
|
||||
def test_excessive_whitespace(self):
|
||||
"""Test that excessive blank lines and trailing whitespace are normalized."""
|
||||
self._run_golden_test("excessive_whitespace")
|
||||
|
||||
def test_details_summary(self):
|
||||
"""Test that details/summary HTML tags are removed but content is kept."""
|
||||
self._run_golden_test("details_summary")
|
||||
|
||||
def test_mixed(self):
|
||||
"""Test a complex issue with multiple types of artifacts."""
|
||||
self._run_golden_test("mixed")
|
||||
|
||||
def test_empty_input(self):
|
||||
"""Test that empty input returns empty output."""
|
||||
self.assertEqual(sanitize_issue_markdown(""), "")
|
||||
|
||||
def test_plain_text(self):
|
||||
"""Test that plain text without artifacts is unchanged."""
|
||||
plain = "# Simple Issue\n\nThis is plain text.\n\n## Section\n\nMore text."
|
||||
self.assertEqual(sanitize_issue_markdown(plain), plain)
|
||||
|
||||
def test_preserves_code_blocks(self):
|
||||
"""Test that code blocks are preserved."""
|
||||
content = """# Issue
|
||||
|
||||
```python
|
||||
def foo():
|
||||
# This is a comment in code, not HTML
|
||||
return 42
|
||||
```
|
||||
|
||||
More text."""
|
||||
result = sanitize_issue_markdown(content)
|
||||
self.assertIn("# This is a comment in code", result)
|
||||
self.assertIn("def foo():", result)
|
||||
|
||||
def test_preserves_inline_code(self):
|
||||
"""Test that inline code is preserved."""
|
||||
content = "Use `<!-- not a comment -->` for HTML comments."
|
||||
# The sanitizer will still remove the HTML comment even in inline code
|
||||
# because we're doing a simple regex replacement. This is acceptable.
|
||||
result = sanitize_issue_markdown(content)
|
||||
self.assertIn("Use `", result)
|
||||
|
||||
def test_preserves_links(self):
|
||||
"""Test that markdown links are preserved."""
|
||||
content = "Check [this link](https://example.com) for more info."
|
||||
result = sanitize_issue_markdown(content)
|
||||
self.assertEqual(result, content)
|
||||
|
||||
def test_preserves_images(self):
|
||||
"""Test that image references are preserved."""
|
||||
content = ""
|
||||
result = sanitize_issue_markdown(content)
|
||||
self.assertEqual(result, content)
|
||||
|
||||
def test_crlf_normalization(self):
|
||||
"""Test that CRLF line endings are normalized to LF."""
|
||||
content = "Line 1\r\nLine 2\r\nLine 3"
|
||||
result = sanitize_issue_markdown(content)
|
||||
self.assertEqual(result, "Line 1\nLine 2\nLine 3")
|
||||
|
||||
def test_removes_control_characters(self):
|
||||
"""Test that control characters are removed."""
|
||||
content = "Hello\x00World\x1fTest"
|
||||
result = sanitize_issue_markdown(content)
|
||||
self.assertEqual(result, "HelloWorldTest")
|
||||
|
||||
|
||||
def discover_golden_tests():
|
||||
"""Discover all golden test pairs in the goldens directory."""
|
||||
goldens_dir = Path(__file__).parent / "goldens"
|
||||
if not goldens_dir.exists():
|
||||
return []
|
||||
|
||||
input_files = goldens_dir.glob("*_input.md")
|
||||
names = set()
|
||||
for f in input_files:
|
||||
name = f.stem.replace("_input", "")
|
||||
output_file = goldens_dir / f"{name}_output.md"
|
||||
if output_file.exists():
|
||||
names.add(name)
|
||||
return sorted(names)
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
# Print discovered golden tests
|
||||
golden_tests = discover_golden_tests()
|
||||
print(f"Discovered {len(golden_tests)} golden test pairs: {golden_tests}")
|
||||
print()
|
||||
|
||||
# Run tests
|
||||
unittest.main(verbosity=2)
|
||||
Reference in New Issue
Block a user