Skip to content

feat: add /feedback command and feedback_submit tool#89

Merged
anandgupta42 merged 3 commits intomainfrom
feat/feedback-command
Mar 14, 2026
Merged

feat: add /feedback command and feedback_submit tool#89
anandgupta42 merged 3 commits intomainfrom
feat/feedback-command

Conversation

@anandgupta42
Copy link
Copy Markdown
Contributor

Summary

Closes #86

  • Adds /feedback slash command with guided 4-step flow (collect details → opt-in session context → confirm → submit)
  • Adds feedback_submit tool that creates GitHub issues via gh CLI with labels (user-feedback, from-cli, + category) and metadata table (CLI version, platform, arch, OS)
  • Registered as source: "command" (not "skill") to ensure TUI autocomplete visibility
  • Handles gh CLI not installed and not authenticated gracefully with actionable error messages

Changes

File Description
src/tool/feedback-submit.ts New tool: validates gh CLI, builds issue body with metadata, creates GitHub issue
src/command/template/feedback.txt New prompt template: guided feedback collection with $ARGUMENTS support
src/command/index.ts Registers /feedback as built-in command with source: "command"
src/tool/registry.ts Registers FeedbackSubmitTool in the tool registry
test/tool/feedback-submit.test.ts 34 unit tests (parameter validation, shell mocking, category mapping, metadata, error paths)
test/command/feedback.test.ts 13 integration tests (command registration, template content, TUI visibility guard)

Code review notes

Multi-model code review (Claude + GPT 5.2 Codex + Grok 4 + MiniMax M2.5 + GLM-5) identified and resolved:

  • Cross-platform path fix: path.basename() instead of .split("/").pop()
  • Type-safe CATEGORY_LABELS with satisfies constraint
  • Template/tool context mismatch (template now accurately describes what include_context sends)
  • Test mockability via Bun.$ namespace access pattern (with explanatory comment)

Test plan

  • 47 tests passing (34 unit + 13 integration)
  • Full test suite green (1526 pass, 0 fail)
  • Type check clean (no new errors)
  • Manual test: run /feedback in TUI, verify it appears in autocomplete
  • Manual test: submit a test issue and verify labels + metadata

🤖 Generated with Claude Code

@anandgupta42 anandgupta42 force-pushed the feat/feedback-command branch from b4a8d54 to 103baaf Compare March 7, 2026 03:06
- Add `feedback_submit` tool at `src/altimate/tools/feedback-submit.ts`
  with `try-catch` around all `Bun.$` calls (ENOENT safety) and
  buffer-based stdout/stderr capture for better error reporting
- Add `/feedback` slash command with guided flow template
- Register `FeedbackSubmitTool` in tool registry
- Register feedback command in `command/index.ts`
- Add 49 tests (tool + command integration)
- Fix CI `pr-standards.yml`: change `ref: 'dev'` to `ref: 'main'`
  and wrap TEAM_MEMBERS lookup in `try-catch` for rebase resilience
- Add `/feedback` to docs `commands.md`
@github-actions
Copy link
Copy Markdown

This PR doesn't fully meet our contributing guidelines and PR template.

What needs to be fixed:

  • PR description is missing required template sections. Please use the PR template.

Please edit this PR description to address the above within 2 hours, or it will be automatically closed.

If you believe this was flagged incorrectly, please let a maintainer know.

anandgupta42 and others added 2 commits March 13, 2026 21:35
- Fix misleading error: `gh auth status` catch now returns `gh_auth_check_failed`
  instead of `gh_not_installed` (gh IS installed at that point)
- Fix fragile version check: use `startsWith("gh version")` instead of
  `includes("not found")` for cross-platform correctness
- Add `trim().min(1)` validation to `title` and `description` zod schemas
  to reject empty/whitespace-only inputs
- Check `issueResult.exitCode !== 0` before stdout URL check on issue creation
- Restore `Bun.$` in `afterAll` to prevent mock leaking across test files
- Remove trailing `$ARGUMENTS` from end of feedback.txt template (duplicated
  from Step 1 pre-fill logic; could confuse model)
- Add 8 new tests: empty/whitespace validation, `gh_auth_check_failed` path,
  non-zero exitCode with stdout scenario, and updated "not found" test name
- Replace `/bin/echo` with `process.execPath` in bridge test — /bin/echo
  does not exist on Windows, causing ENOENT on spawn; process.execPath
  (the current Bun binary) exists on all platforms and exits quickly
  without speaking JSON-RPC as expected
- Add `unixtest` guard to postinstall, bin-wrapper, and integration tests
  — on Windows, postinstall.mjs takes a different early-exit path that
  skips hard-link setup; dummy binaries are Unix shell scripts that
  cannot be executed on Windows; skip all Unix-specific test paths using
  the same `process.platform !== "win32" ? test : test.skip` pattern
  already used in fsmonitor.test.ts

Co-Authored-By: Claude Sonnet 4.6 <[email protected]>
@anandgupta42 anandgupta42 merged commit 380530d into main Mar 14, 2026
8 of 9 checks passed
anandgupta42 added a commit that referenced this pull request Mar 17, 2026
* feat: add `/feedback` command and `feedback_submit` tool (#86)

- Add `feedback_submit` tool at `src/altimate/tools/feedback-submit.ts`
  with `try-catch` around all `Bun.$` calls (ENOENT safety) and
  buffer-based stdout/stderr capture for better error reporting
- Add `/feedback` slash command with guided flow template
- Register `FeedbackSubmitTool` in tool registry
- Register feedback command in `command/index.ts`
- Add 49 tests (tool + command integration)
- Fix CI `pr-standards.yml`: change `ref: 'dev'` to `ref: 'main'`
  and wrap TEAM_MEMBERS lookup in `try-catch` for rebase resilience
- Add `/feedback` to docs `commands.md`

* fix: address code review findings in feedback-submit tool

- Fix misleading error: `gh auth status` catch now returns `gh_auth_check_failed`
  instead of `gh_not_installed` (gh IS installed at that point)
- Fix fragile version check: use `startsWith("gh version")` instead of
  `includes("not found")` for cross-platform correctness
- Add `trim().min(1)` validation to `title` and `description` zod schemas
  to reject empty/whitespace-only inputs
- Check `issueResult.exitCode !== 0` before stdout URL check on issue creation
- Restore `Bun.$` in `afterAll` to prevent mock leaking across test files
- Remove trailing `$ARGUMENTS` from end of feedback.txt template (duplicated
  from Step 1 pre-fill logic; could confuse model)
- Add 8 new tests: empty/whitespace validation, `gh_auth_check_failed` path,
  non-zero exitCode with stdout scenario, and updated "not found" test name

* test: fix Windows CI failures in install and bridge tests

- Replace `/bin/echo` with `process.execPath` in bridge test — /bin/echo
  does not exist on Windows, causing ENOENT on spawn; process.execPath
  (the current Bun binary) exists on all platforms and exits quickly
  without speaking JSON-RPC as expected
- Add `unixtest` guard to postinstall, bin-wrapper, and integration tests
  — on Windows, postinstall.mjs takes a different early-exit path that
  skips hard-link setup; dummy binaries are Unix shell scripts that
  cannot be executed on Windows; skip all Unix-specific test paths using
  the same `process.platform !== "win32" ? test : test.skip` pattern
  already used in fsmonitor.test.ts

Co-Authored-By: Claude Sonnet 4.6 <[email protected]>

---------

Co-authored-by: Claude Sonnet 4.6 <[email protected]>
@anandgupta42 anandgupta42 deleted the feat/feedback-command branch March 17, 2026 00:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feat: Add user feedback → GitHub issue creation flow

1 participant