polyforgeai 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,128 @@
1
+ ---
2
+ name: report-issue
3
+ description: Use when the user wants to file a bug, create an issue, report a problem, or scan code for issues to report. Detects the issue tracker (GitHub/Jira/GitLab) and creates well-structured issues with context, severity, and suggested fixes.
4
+ ---
5
+
6
+ # /report-issue — Issue Detection & Reporting
7
+
8
+ You are PolyForge's issue reporter. You detect problems in code or behavior and create well-structured issues in the project's configured tracker.
9
+
10
+ ## Usage
11
+
12
+ ```
13
+ /report-issue Interactive — describe the problem, I'll create the issue
14
+ /report-issue "Login fails on Safari" Quick issue from description
15
+ /report-issue --scan src/ Scan directory for issues to report
16
+ ```
17
+
18
+ ## Process
19
+
20
+ ### Step 1: Determine Issue Tracker
21
+
22
+ Read `.claude/polyforge.json` → `issueTracker.type`
23
+
24
+ If not configured:
25
+ 1. Check `gh api repos/{owner}/{repo} --jq '.has_issues'` — if true, use GitHub
26
+ 2. Check for Jira config in `.env`, `.jira`, environment
27
+ 3. Check git remote for GitLab
28
+ 4. Ask the user
29
+
30
+ ### Step 2: Gather Issue Details
31
+
32
+ **Interactive mode** — ask ONE question at a time:
33
+ 1. "What's the problem?" (title/summary)
34
+ 2. "Can you describe the expected vs actual behavior?"
35
+ 3. "Which part of the codebase is affected?" (auto-detect from description if possible)
36
+ 4. "How severe is this? (critical / high / medium / low)"
37
+
38
+ **Scan mode** — analyze code and detect:
39
+ - Uncaught exceptions / missing error handling
40
+ - TODO/FIXME comments with context
41
+ - Dead code / unreachable branches
42
+ - Performance anti-patterns (N+1 queries, unbounded loops)
43
+ - Security issues (hardcoded secrets, missing validation)
44
+ - Type mismatches / potential null references
45
+
46
+ ### Step 3: Enrich the Issue
47
+
48
+ Before creating, automatically:
49
+ - Find the relevant source files and line numbers
50
+ - Check git blame for who last modified the area
51
+ - Look for related existing issues (avoid duplicates)
52
+ - Suggest a severity label based on analysis
53
+ - Add reproduction context if applicable
54
+
55
+ ### Step 4: Create the Issue
56
+
57
+ **GitHub Issues:**
58
+ ```bash
59
+ gh issue create \
60
+ --title "{title}" \
61
+ --body "{body}" \
62
+ --label "{severity},{type}" \
63
+ --assignee "{from git blame if applicable}"
64
+ ```
65
+
66
+ **Jira:**
67
+ ```bash
68
+ # Use Jira API via curl or jira CLI
69
+ # Read project key from .claude/polyforge.json → issueTracker.config.projectKey
70
+ curl -X POST "https://{domain}.atlassian.net/rest/api/3/issue" \
71
+ -H "Authorization: Basic {base64(email:token)}" \
72
+ -H "Content-Type: application/json" \
73
+ -d '{issue payload}'
74
+ ```
75
+
76
+ **GitLab:**
77
+ ```bash
78
+ # Use glab CLI or GitLab API
79
+ glab issue create --title "{title}" --description "{body}" --label "{labels}"
80
+ ```
81
+
82
+ ### Issue Body Template
83
+
84
+ ```markdown
85
+ ## Description
86
+ {clear description of the problem}
87
+
88
+ ## Expected Behavior
89
+ {what should happen}
90
+
91
+ ## Actual Behavior
92
+ {what happens instead}
93
+
94
+ ## Affected Code
95
+ - `{file}:{line}` — {brief description}
96
+
97
+ ## Reproduction Steps
98
+ 1. {step}
99
+ 2. {step}
100
+
101
+ ## Severity
102
+ {critical|high|medium|low} — {justification}
103
+
104
+ ## Suggested Fix
105
+ {brief suggestion based on code analysis}
106
+
107
+ ---
108
+ *⚒ Forged with [PolyForge](https://github.com/Vekta/polyforge)*
109
+ ```
110
+
111
+ ### Step 5: Confirm
112
+
113
+ Before creating, show the full issue preview and ask:
114
+ "Create this issue? (y/n/edit)"
115
+
116
+ ## Context Management
117
+
118
+ - In scan mode, delegate directory scanning to a subagent to preserve parent context for issue creation
119
+ - After creating issues, compact the conversation
120
+
121
+ ## Important Behaviors
122
+
123
+ - Check for duplicate issues before creating (search existing issues by title keywords)
124
+ - In scan mode: present all findings as a list, let user pick which to create as issues
125
+ - Respect project labeling conventions (detect from existing issues)
126
+ - For Jira: respect issue types (Bug, Task, Story) and required fields
127
+ - Read credentials from environment variables — never ask the user to paste them
128
+ - Log created issues to `tmp/issues-log-{date}.md`
@@ -0,0 +1,26 @@
1
+ # {{PROJECT_NAME}}
2
+
3
+ {{PROJECT_DESCRIPTION}}
4
+
5
+ ## Stack
6
+ {{STACK_SUMMARY}}
7
+
8
+ ## Commands
9
+ - Build: `{{BUILD_COMMAND}}`
10
+ - Test: `{{TEST_COMMAND}}`
11
+ - Lint: `{{LINT_COMMAND}}`
12
+ - Dev server: `{{DEV_COMMAND}}`
13
+
14
+ ## Architecture
15
+ {{ARCHITECTURE_SUMMARY}}
16
+
17
+ ## Conventions
18
+ {{CONVENTIONS}}
19
+
20
+ ## Key References
21
+ - Architecture details: @docs/CONTEXT.md
22
+ {{#HAS_DB}}- Database schema: @docs/DB.md{{/HAS_DB}}
23
+
24
+ ## PolyForge
25
+ Config: `.claude/polyforge.json`
26
+ Available commands: /init, /pr-review, /analyse-db, /analyse-code, /report-issue, /fix, /fix-ci, /brainstorm, /generate-doc
@@ -0,0 +1,43 @@
1
+ {
2
+ "$comment": "PolyForge project configuration — generated by /init",
3
+ "version": "0.1.0",
4
+ "project": {
5
+ "name": "",
6
+ "description": "",
7
+ "stack": [],
8
+ "architecture": "",
9
+ "testFrameworks": [],
10
+ "linters": [],
11
+ "packageManager": "",
12
+ "internalDependencies": []
13
+ },
14
+ "issueTracker": {
15
+ "type": "",
16
+ "config": {
17
+ "projectKey": "",
18
+ "domain": "",
19
+ "labels": []
20
+ }
21
+ },
22
+ "database": {
23
+ "type": "",
24
+ "connectionMethod": "",
25
+ "containerName": "",
26
+ "host": "",
27
+ "port": null,
28
+ "name": ""
29
+ },
30
+ "autonomy": "semi",
31
+ "permissions": "manual",
32
+ "pipeline": {
33
+ "preCommit": ["test", "lint"],
34
+ "prePush": ["test", "lint", "vulncheck"],
35
+ "prePR": ["test", "lint", "vulncheck", "doc-update"]
36
+ },
37
+ "goldenPrinciples": {
38
+ "enabled": true,
39
+ "customRules": []
40
+ },
41
+ "initializedAt": "",
42
+ "lastUpdatedAt": ""
43
+ }