You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feat: add feedback command for submitting user feedback (Fission-AI#509)
* feat: add feedback command for submitting user feedback
Implement `openspec feedback` command that creates GitHub Issues using the gh CLI.
Includes graceful fallback to manual submission when gh is not available or
not authenticated.
Features:
- Automatic gh CLI detection and authentication check
- Graceful fallback with pre-filled issue URLs for manual submission
- Automatic metadata inclusion (version, platform, timestamp)
- /feedback skill for agent-assisted feedback with context enrichment
- Comprehensive test coverage with mocked gh CLI calls
* fix: address PR review comments for feedback command
- Add Windows compatibility: use 'where gh' on Windows, 'which gh' on Unix/macOS
- Fix shell injection vulnerability: replace execSync with execFileSync and argument arrays
- Fix British English phrasing: "in future" → "in the future"
- Reduce code duplication: extract formatTitle/formatBody to single location
- Update tests to verify execFileSync usage and cross-platform command detection
- Add spec scenarios for safe command execution and cross-platform support
Users and agents need a simple way to submit feedback about OpenSpec directly from the CLI. Currently there's no mechanism to collect user feedback, feature requests, or bug reports in a way that enables follow-up conversation.
3
+
Users and agents need a simple way to submit feedback about OpenSpec directly from the CLI. Currently there's no mechanism to collect user feedback, feature requests, or bug reports in a way that enables follow-up conversation. Using GitHub Issues allows us to track feedback, prevent spam via GitHub auth, and enables outreach to users.
4
4
5
5
## What Changes
6
6
7
7
- Add `openspec feedback <message>` CLI command
8
-
-Add GitHub Device OAuth flow for user authentication
9
-
-Create GitHub Issues in the openspec repository for each feedback submission
10
-
-Add `/feedback` skill for agent-assisted feedback with context enrichment and anonymization
8
+
-Leverage `gh` CLI for GitHub authentication and issue creation
9
+
-Add `/feedback` skill for agent-assisted feedback with context enrichment
Copy file name to clipboardExpand all lines: openspec/changes/add-feedback-command/specs/cli-feedback/spec.md
+80-79Lines changed: 80 additions & 79 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -2,91 +2,75 @@
2
2
3
3
### Requirement: Feedback command
4
4
5
-
The system SHALL provide an `openspec feedback` command that creates a GitHub Issue in the openspec repository with the user's feedback.
5
+
The system SHALL provide an `openspec feedback` command that creates a GitHub Issue in the openspec repository using the `gh` CLI. The system SHALL use `execFileSync` with argument arrays to prevent shell injection vulnerabilities.
6
6
7
7
#### Scenario: Simple feedback submission
8
8
9
9
-**WHEN** user executes `openspec feedback "Great tool!"`
10
-
-**THEN** the system creates a GitHub Issue with title "Feedback: Great tool!"
10
+
-**THEN** the system executes `gh issue create` with title "Feedback: Great tool!"
11
+
-**AND** the issue is created in the openspec repository
11
12
-**AND** the issue has the `feedback` label
12
13
-**AND** the system displays the created issue URL
13
14
14
-
#### Scenario: Rich feedback with body
15
+
#### Scenario: Safe command execution
16
+
17
+
-**WHEN** submitting feedback via `gh` CLI
18
+
-**THEN** the system uses `execFileSync` with separate arguments array
19
+
-**AND** user input is NOT passed through a shell
20
+
-**AND** shell metacharacters (quotes, backticks, $(), etc.) are treated as literal text
21
+
22
+
#### Scenario: Feedback with body
15
23
16
24
-**WHEN** user executes `openspec feedback "Title here" --body "Detailed description..."`
17
25
-**THEN** the system creates a GitHub Issue with the specified title
18
26
-**AND** the issue body contains the detailed description
19
-
-**AND** the issue body includes metadata (OpenSpec version, platform)
20
-
21
-
#### Scenario: Multiline message
22
-
23
-
-**WHEN** user provides a multiline message (first line as title, rest as body)
24
-
-**THEN** the system uses the first line as the issue title
25
-
-**AND** the remaining lines become the issue body
26
-
27
-
### Requirement: GitHub authentication
28
-
29
-
The system SHALL authenticate users via GitHub Device OAuth flow before submitting feedback.
30
-
31
-
#### Scenario: First-time authentication
32
-
33
-
-**WHEN** user runs `openspec feedback` for the first time
34
-
-**AND** no GitHub token is stored
35
-
-**THEN** the system initiates GitHub Device OAuth flow
36
-
-**AND** displays a URL and code for the user to authorize
37
-
-**AND** polls for authorization completion
38
-
-**AND** stores the token in global config on success
39
-
40
-
#### Scenario: Cached authentication
41
-
42
-
-**WHEN** user runs `openspec feedback`
43
-
-**AND** a valid GitHub token is stored
44
-
-**THEN** the system uses the cached token without re-authentication
45
-
46
-
#### Scenario: Token refresh
47
-
48
-
-**WHEN** the stored GitHub token is expired or invalid
49
-
-**THEN** the system initiates a new Device OAuth flow
50
-
-**AND** updates the stored token on success
27
+
-**AND** the issue body includes metadata (OpenSpec version, platform, timestamp)
51
28
52
-
#### Scenario: Authentication cancellation
29
+
###Requirement: GitHub CLI dependency
53
30
54
-
-**WHEN** user cancels the OAuth flow (Ctrl+C)
55
-
-**THEN** the system exits gracefully without storing any token
56
-
-**AND** displays a message indicating feedback was not submitted
31
+
The system SHALL use `gh` CLI for automatic feedback submission when available, and provide a manual submission fallback when `gh` is not installed or not authenticated. The system SHALL use platform-appropriate commands to detect `gh` CLI availability.
57
32
58
-
###Requirement: GitHub token storage
33
+
#### Scenario: Missing gh CLI with fallback
59
34
60
-
The system SHALL securely store GitHub authentication tokens in the global config directory.
35
+
-**WHEN** user runs `openspec feedback "message"`
36
+
-**AND**`gh` CLI is not installed (not found in PATH)
37
+
-**THEN** the system displays warning: "GitHub CLI not found. Manual submission required."
38
+
-**AND** outputs structured feedback content with delimiters:
39
+
- "--- FORMATTED FEEDBACK ---"
40
+
- Title line
41
+
- Labels line
42
+
- Body content with metadata
43
+
- "--- END FEEDBACK ---"
44
+
-**AND** displays pre-filled GitHub issue URL for manual submission
45
+
-**AND** exits with zero code (successful fallback)
61
46
62
-
#### Scenario: Token persistence
47
+
#### Scenario: Cross-platform gh CLI detection on Unix
0 commit comments