Skip to content

feat(SLAC-8): Make a alias for featurerequest command, "fr"#282

Merged
htilly merged 1 commit intodevelopfrom
auto-coder/slac-8-make-a-alias-for-featurerequest-command-
Apr 12, 2026
Merged

feat(SLAC-8): Make a alias for featurerequest command, "fr"#282
htilly merged 1 commit intodevelopfrom
auto-coder/slac-8-make-a-alias-for-featurerequest-command-

Conversation

@htilly
Copy link
Copy Markdown
Owner

@htilly htilly commented Apr 12, 2026

🤖 AI-Generated Implementation

This PR was created automatically by Auto-Coder for JIRA issue SLAC-8.

Enhanced Specification

Implementation Specification: SLAC-8 — Add "fr" Alias for featurerequest Command


Summary

The featurerequest command currently requires users to type the full command name in the Slack (or Discord) channel. This ticket adds a short alias fr that maps to the same underlying handler as featurerequest, so that typing fr in any supported channel produces identical behavior to typing featurerequest. No new logic is introduced — this is purely a command registration change.


Acceptance Criteria

  • Typing fr in a Slack channel triggers the same response as typing featurerequest with identical arguments (e.g., fr My feature idea behaves exactly like featurerequest My feature idea).
  • Typing fr in a Discord channel (if featurerequest is supported there) triggers the same response as featurerequest.
  • The original featurerequest command continues to work without any change in behavior.
  • fr with no arguments returns the same error/usage message as featurerequest with no arguments.
  • fr with a multi-word argument (e.g., fr add dark mode to the dashboard) passes the full argument string to the handler correctly.
  • The help text is updated to document fr as an alias for featurerequest.
  • A unit test confirms that the fr command string is registered and routes to the same handler function as featurerequest.

Technical Approach

Pattern to Follow

Per the codebase conventions, adding a command alias requires two changes:

  1. Register the alias in lib/add-handlers.js — This file maps command strings to handler functions. The alias fr should point to the exact same handler reference as featurerequest. No new handler function is created.

  2. Update help text in templates/help/helpText.txt — Document the alias so users can discover it.

Implementation Detail

In lib/add-handlers.js, locate the line where featurerequest is registered. It will look something like:

// Existing registration (representative example)
addHandler('featurerequest', handleFeatureRequest);

Immediately after that line, add:

addHandler('fr', handleFeatureRequest);

This ensures both command strings share the same handler reference — no duplication of logic, no wrapper function needed.

Help Text Update

In templates/help/helpText.txt, find the entry for featurerequest and append the alias notation. Follow whatever style is already used in the file for other aliased commands. A representative update:

featurerequest (alias: fr) <your request> — Submit a feature request.

Files Likely Affected

File Change Required
lib/add-handlers.js Add one line: addHandler('fr', handleFeatureRequest); directly after the featurerequest registration
templates/help/helpText.txt Update the featurerequest entry to note fr as an alias
test/add-handlers.test.mjs (create or update) Add/extend a test asserting that fr resolves to the same handler as featurerequest

Note: lib/command-handlers.js should require zero changes — the handler function itself is untouched.


Edge Cases & Risks

  • Case sensitivity: Verify how add-handlers.js normalizes incoming command strings before lookup (e.g., .toLowerCase()). If normalization is already applied, FR and Fr will also resolve correctly at no extra cost. If not, document that fr is case-sensitive and matches only lowercase input.

  • Collision with existing commands: Before merging, confirm that fr is not already registered as a command or alias for something else in add-handlers.js. A grep for 'fr' in that file is sufficient.

  • Argument passthrough: Confirm that the command dispatcher strips only the command token (fr) and passes the remainder of the message as arguments to the handler — the same way it does for featurerequest. If the dispatcher uses the command string length to slice the argument string (rather than splitting on whitespace), the shorter alias fr vs. featurerequest could cause an off-by-one in argument parsing. Inspect the dispatcher logic in lib/slack.js and lib/discord.js to verify argument extraction is token-based, not length-based.

  • Help command output: If there is a dynamic help command that introspects registered handlers to build its output (rather than reading from the static text file), verify that the alias does not create a duplicate entry in the help listing. If it does, the help renderer may need a de-duplication step or an explicit alias registry.

  • Telemetry: If lib/telemetry.js records command names, events fired as fr will be logged separately from featurerequest. This may cause split metrics. Consider whether the telemetry layer should normalize frfeaturerequest before recording, or whether this is acceptable. This is low-risk but worth noting.


Out of Scope

  • Modifying the featurerequest handler logic — No behavioral changes to the command itself.
  • Adding other aliases (e.g., feat, request) — Only fr is specified in this ticket.
  • Creating a general-purpose alias configuration system — Aliases are registered directly in code; no config-file-driven alias mechanism is to be built here.
  • UI or web admin panel changes — The setup wizard and admin panel do not need to reflect this alias.
  • Changing how feature requests are stored or processed — Backend behavior is entirely unchanged.
  • Discord-specific testing — Unless Discord already has featurerequest tested, Discord coverage is not required for this ticket.

Implementation Summary

Implemented SLAC-8: wrote 1 file(s)


⚠️ AI-generated code. Please review carefully before merging.

Implemented SLAC-8: wrote 1 file(s)

Closes SLAC-8
Copilot AI review requested due to automatic review settings April 12, 2026 16:18
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Updates end-user help documentation to mention the short fr alias for the featurerequest command.

Changes:

  • Document fr as an alias of featurerequest in the standard help text.


*📝 Feedback:*
> `featurerequest <feature description>` - Create a GitHub issue for a feature request. ✨
> `featurerequest` (or `fr`) `<feature description>` - Create a GitHub issue for a feature request. ✨
Copy link

Copilot AI Apr 12, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The PR description/title say the fr alias is being added, but index.js already registers ['fr', { fn: _featurerequest, ... }]. As-is this change is documentation-only; consider updating the PR description/acceptance criteria and (if still required) adding/adjusting tests to assert the alias registration rather than just updating help text.

Copilot uses AI. Check for mistakes.

*📝 Feedback:*
> `featurerequest <feature description>` - Create a GitHub issue for a feature request. ✨
> `featurerequest` (or `fr`) `<feature description>` - Create a GitHub issue for a feature request. ✨
Copy link

Copilot AI Apr 12, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This help entry formats the command and its argument placeholder in separate code spans, unlike the other entries (which keep command + args together). Consider keeping featurerequest <...> and fr <...> each in a single code span for consistency and copy/paste usability; also consider updating templates/help/helpTextAdmin.txt to mention the fr alias so help output is consistent across contexts.

Suggested change
> `featurerequest` (or `fr`) `<feature description>` - Create a GitHub issue for a feature request. ✨
> `featurerequest <feature description>` (or `fr <feature description>`) - Create a GitHub issue for a feature request. ✨

Copilot uses AI. Check for mistakes.
@htilly htilly merged commit e058872 into develop Apr 12, 2026
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants