feat: add slash commands and context menu command #16

Merged
naomi merged 7 commits from feat/commands into main 2026-03-03 15:05:10 -08:00
Owner

Summary

This PR adds a suite of slash commands and a context menu command to Amari, along with shared utilities and quality improvements across the board.

New Commands

  • /create-issue — generates a GitHub issue on a specified repo using AI-drafted content (title, description, acceptance criteria)
  • /create-task — creates a task in Naomi's Leantime instance with an AI-drafted description and configurable priority
  • /onboard-mentee — automates the mentorship onboarding flow (GitHub invite, forum thread, role assignment)
  • Forward to Owner (context menu, message command) — forwards any message to Naomi with action buttons (contributed by @teklu)

Shared Utilities

  • src/utils/makeAiRequest.ts — a single wrapper around the Anthropic SDK for all AI calls, with Amari's personality prompt baked in and full error handling
  • src/events/handleInteractionCreate.ts — extracted interaction handler (was inline in index.ts) to keep complexity under control

Quality Improvements

  • ephemeral: trueflags: [ MessageFlags.Ephemeral ] (deprecated API removed)
  • Full try/catch + logger.error audit across all modules (logMenteeJoin, checkAchievements, processMentorshipRole, processGitHubEvent)
  • deployGlobal.ts replaced with a static commands.json payload for manual registration
  • Amari's personality prompt updated to reflect her actual character — warm, observant, and relentlessly caring

Notes

  • CLIENT_ID is needed in 1Password at op://Environment Variables - Naomi/Amari/client id for the commands.json registration call
  • The forward-to-owner command (PR #13, contributed by @teklu) is fully preserved with original commit authorship

This PR was created with help from Hikari~ 🌸

## Summary This PR adds a suite of slash commands and a context menu command to Amari, along with shared utilities and quality improvements across the board. ### New Commands - **`/create-issue`** — generates a GitHub issue on a specified repo using AI-drafted content (title, description, acceptance criteria) - **`/create-task`** — creates a task in Naomi's Leantime instance with an AI-drafted description and configurable priority - **`/onboard-mentee`** — automates the mentorship onboarding flow (GitHub invite, forum thread, role assignment) - **Forward to Owner** (context menu, message command) — forwards any message to Naomi with action buttons (contributed by @teklu) ### Shared Utilities - **`src/utils/makeAiRequest.ts`** — a single wrapper around the Anthropic SDK for all AI calls, with Amari's personality prompt baked in and full error handling - **`src/events/handleInteractionCreate.ts`** — extracted interaction handler (was inline in `index.ts`) to keep complexity under control ### Quality Improvements - `ephemeral: true` → `flags: [ MessageFlags.Ephemeral ]` (deprecated API removed) - Full `try/catch` + `logger.error` audit across all modules (`logMenteeJoin`, `checkAchievements`, `processMentorshipRole`, `processGitHubEvent`) - `deployGlobal.ts` replaced with a static `commands.json` payload for manual registration - Amari's personality prompt updated to reflect her actual character — warm, observant, and relentlessly caring ### Notes - `CLIENT_ID` is needed in 1Password at `op://Environment Variables - Naomi/Amari/client id` for the `commands.json` registration call - The forward-to-owner command (PR #13, contributed by @teklu) is fully preserved with original commit authorship ✨ This PR was created with help from Hikari~ 🌸
hikari added 7 commits 2026-03-03 14:43:14 -08:00
Refactored createIssue, createTask, and onboardMentee commands to
extract helper functions, fix JSDoc descriptions, correct type
handling, and satisfy all ESLint rules. Also fixed object-shorthand
mixing in index.ts and the naming convention in anthropic.ts.
- Replace forwardToOwner embed approach with getComponentsForNaomi + Components V2
- Extract InteractionCreate handler to src/events/handleInteractionCreate.ts
- Replace deployGlobal.ts script with static commands.json payload
- Fix minor error handling in createTask and onboardMentee
- Centralise all Claude API calls through a shared makeAiRequest module
- Apply a consistent Amari personality to all AI-generated content
- Add try/catch with logger.error to all AI and external API call sites
- Extract postGiteaIssue helper in createIssue for better structure
- Replace `ephemeral: true` with `flags: [ MessageFlags.Ephemeral ]` in all command files
- Add try/catch with logger.error to logMenteeJoin, checkAchievements, processMentorshipRole
- Extract handleIssueOpened and handlePrOpened helpers in processGitHubEvent to reduce complexity
- Add logger.error calls in all newly introduced catch blocks
feat: give Amari a proper personality prompt
Node.js CI / CI (pull_request) Successful in 29s
Security Scan and Upload / Security & DefectDojo Upload (pull_request) Successful in 53s
5c77dc8eb5
Co-Authored-By: Naomi Carrigan <commits@nhcarrigan.com>
naomi merged commit 1ebe240475 into main 2026-03-03 15:05:10 -08:00
naomi deleted branch feat/commands 2026-03-03 15:05:10 -08:00
Sign in to join this conversation.
No Reviewers
No Label
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: nhcarrigan/amari#16