|
| 1 | +--- |
| 2 | +name: issue-create |
| 3 | +description: >- |
| 4 | + Interview the user to gather all required context, then open a high-quality GitHub issue (`gh issue create`) on the codex-proxy repo with the right template, labels, and structured body. |
| 5 | + TRIGGER when: user says "open an issue", "file an issue", "create issue", "report a bug", "feature request", "提个 issue", "报 bug", "提需求". |
| 6 | + DO NOT TRIGGER when: user wants to view, search, comment on, or close existing issues (use `gh issue list/view/comment/close` directly); user is writing a PR description (use `pr-push`). |
| 7 | +allowed-tools: |
| 8 | + - "Bash" |
| 9 | + - "Read" |
| 10 | + - "Write" |
| 11 | +--- |
| 12 | + |
| 13 | +# Issue Create |
| 14 | + |
| 15 | +Gather complete context through a structured interview, then file a well-formed issue. The interview is a hard gate — vague issues waste maintainer time. |
| 16 | + |
| 17 | +## Overview |
| 18 | + |
| 19 | +Most "I have a bug" or "I want a feature" reports are missing the information a maintainer needs to act. This skill runs a four-phase interview, fills the appropriate template, applies the right labels, and only then calls `gh issue create`. The user sees and approves the rendered body before submission. |
| 20 | + |
| 21 | +## When to Use |
| 22 | + |
| 23 | +- A user wants to file a new issue on the codex-proxy repository. |
| 24 | +- A user describes a bug or feature in conversation and asks "should we file an issue?" |
| 25 | + |
| 26 | +## Important Rules |
| 27 | + |
| 28 | +1. **The interview is not optional.** Do NOT call `gh issue create` until all required fields for the chosen type are collected and the user has explicitly approved the rendered body. |
| 29 | +2. **Never invent reproduction steps, version numbers, log output, or behavior.** If the user did not provide it, ask. If they cannot provide it, write "not provided" in the field, do not fabricate. |
| 30 | +3. **Show the full body before submitting.** The user must explicitly say "submit" / "looks good" / equivalent. "Yes" without seeing the body is not enough — show it first. |
| 31 | +4. **Apply only labels from the project's existing label set.** Read `references/labels.md` for the catalog. Do not invent new labels. |
| 32 | +5. **Strip secrets.** If the user pastes logs, headers, or config that contain tokens, cookies, OAuth state, API keys, or account IDs, redact them before they enter the issue body. Replace with `<redacted>`. |
| 33 | +6. **One issue per scope.** If the user describes two unrelated problems, file two issues. Ask before splitting. |
| 34 | + |
| 35 | +## Key Workflows |
| 36 | + |
| 37 | +### Phase 1: Type classification |
| 38 | + |
| 39 | +**Goal:** Pick the right template and label. |
| 40 | + |
| 41 | +Ask the user (one consolidated question): |
| 42 | + |
| 43 | +> What type of issue is this? |
| 44 | +> 1. **Bug** — something is broken or behaves incorrectly |
| 45 | +> 2. **Feature request** — propose new functionality |
| 46 | +> 3. **Question** — usage / configuration / "is this expected?" |
| 47 | +> 4. **Performance** — measurable regression or slowness |
| 48 | +> 5. **Documentation** — docs are wrong, missing, or unclear |
| 49 | +
|
| 50 | +Read the type spec: |
| 51 | +``` |
| 52 | +Read: .claude/skills/issue-create/references/issue-types.md |
| 53 | +``` |
| 54 | + |
| 55 | +Map answer to template path: |
| 56 | + |
| 57 | +| Type | Template asset | Default label | |
| 58 | +|---|---|---| |
| 59 | +| Bug | `assets/bug-report.md` | `bug` | |
| 60 | +| Feature request | `assets/feature-request.md` | `enhancement` | |
| 61 | +| Question | `assets/question.md` | `question` | |
| 62 | +| Performance | `assets/perf-report.md` | `bug` | |
| 63 | +| Documentation | `assets/feature-request.md` (with docs framing) | `documentation` | |
| 64 | + |
| 65 | +Do **NOT** proceed to Phase 2 until the type is confirmed. |
| 66 | + |
| 67 | +### Phase 2: Required-field interview |
| 68 | + |
| 69 | +**Goal:** Collect every field the chosen template requires. |
| 70 | + |
| 71 | +Read `references/issue-types.md` to see the required-field table for the chosen type. Ask for missing fields in **one consolidated message**, not one at a time. Group related fields together. |
| 72 | + |
| 73 | +**For bugs**, the required fields are: |
| 74 | +- One-line summary |
| 75 | +- Expected behavior |
| 76 | +- Actual behavior |
| 77 | +- Reproduction steps (numbered) |
| 78 | +- Codex-proxy version (`npm pkg get version` or app About dialog) |
| 79 | +- Deployment mode (Electron app / Docker / `npm start` / dev) |
| 80 | +- Relevant log lines (redact secrets) |
| 81 | +- Frequency (always / intermittent / once) |
| 82 | + |
| 83 | +**For feature requests**, the required fields are: |
| 84 | +- Problem the feature solves (user-facing motivation, not the proposed solution) |
| 85 | +- Proposed solution (high level) |
| 86 | +- Alternatives considered |
| 87 | +- Who benefits (single user / all users / specific deployment mode) |
| 88 | + |
| 89 | +**For questions**: |
| 90 | +- What you tried |
| 91 | +- What you expected |
| 92 | +- What happened |
| 93 | +- Relevant config (redact secrets) |
| 94 | + |
| 95 | +**For performance**: |
| 96 | +- All bug fields, plus: |
| 97 | +- Measured baseline vs current (timings, memory, request count — be specific) |
| 98 | +- Reproduction harness (script, steps, or `tests/bench/`) |
| 99 | + |
| 100 | +**For documentation**: |
| 101 | +- Which doc page / file |
| 102 | +- What is wrong or missing |
| 103 | +- Suggested fix (if any) |
| 104 | + |
| 105 | +If a field cannot be answered, the user must explicitly say "not applicable" or "unknown" — record that verbatim. Do not silently skip. |
| 106 | + |
| 107 | +Do **NOT** proceed to Phase 3 until every required field has either an answer or an explicit "not applicable". |
| 108 | + |
| 109 | +### Phase 3: Code & related-context grounding |
| 110 | + |
| 111 | +**Goal:** Help maintainers find the relevant code fast. |
| 112 | + |
| 113 | +Ask the user for: |
| 114 | +- File paths or `file:line` references they suspect are involved (optional but encouraged). |
| 115 | +- Related issues / PRs to link (`Refs #N`, `Related to #N`). |
| 116 | +- Whether they tried searching existing issues (`gh issue list --search "<keywords>"`). If they have not and the report sounds like something that might exist, run the search and show top 3 matches before continuing. |
| 117 | + |
| 118 | +If the user provides no code locations and the bug is concrete, optionally offer: |
| 119 | +> "Want me to grep for the relevant code so we can include file:line in the issue?" |
| 120 | +
|
| 121 | +Do not grep silently — ask first, and only do it once. |
| 122 | + |
| 123 | +### Phase 4: Render, confirm, submit |
| 124 | + |
| 125 | +**Goal:** Show the final body, get explicit approval, file the issue. |
| 126 | + |
| 127 | +1. Read the chosen template: |
| 128 | + ``` |
| 129 | + Read: .claude/skills/issue-create/assets/<template>.md |
| 130 | + ``` |
| 131 | +2. Read the labels catalog: |
| 132 | + ``` |
| 133 | + Read: .claude/skills/issue-create/references/labels.md |
| 134 | + ``` |
| 135 | +3. Fill the template with the collected fields. Strip secrets per Important Rule #5. |
| 136 | +4. Pick labels: |
| 137 | + - Always include the type label (Phase 1 mapping). |
| 138 | + - Add `good first issue` only if the user explicitly says it qualifies (small scope, low context required). |
| 139 | + - Add `help wanted` if the user has no plan to fix it themselves. |
| 140 | + - Add `documentation` in addition to the type label if docs need updating. |
| 141 | +5. Show the user the complete rendered output: |
| 142 | + ``` |
| 143 | + Title: <title> |
| 144 | + Labels: <label1>, <label2> |
| 145 | + Body: |
| 146 | + <full body> |
| 147 | + ``` |
| 148 | +6. Ask: "Ready to submit, or want to adjust anything?" |
| 149 | +7. Wait for an explicit affirmative. "Yes", "submit", "go", "looks good", "提交" all qualify. Silence or hedging does not. |
| 150 | +8. Submit: |
| 151 | + ```bash |
| 152 | + gh issue create \ |
| 153 | + --title "<title>" \ |
| 154 | + --label "<label1>,<label2>" \ |
| 155 | + --body "$(cat <<'EOF' |
| 156 | + <body> |
| 157 | + EOF |
| 158 | + )" |
| 159 | + ``` |
| 160 | +9. Print the issue URL. |
| 161 | +10. **STOP.** Do not assign, do not comment, do not link to projects unless the user issues a separate, explicit command. |
| 162 | +
|
| 163 | +## Common Pitfalls |
| 164 | +
|
| 165 | +- Do not call `gh issue create` before showing the body for approval. |
| 166 | +- Do not invent reproduction steps when the user gave a vague report — ask. |
| 167 | +- Do not paste raw logs that contain tokens / cookies / OAuth state / account IDs. |
| 168 | +- Do not apply labels outside the existing catalog. |
| 169 | +- Do not file two issues from one report without confirming the split with the user. |
| 170 | +- Do not grep / search the codebase silently to "fill in" missing fields — ask first. |
0 commit comments