Extract Shakespeare AI hook into the ai-chat skill

Moves src/hooks/useShakespeare.ts into
.agents/skills/ai-chat/files/hooks/useShakespeare.ts and prepends
setup instructions to the existing SKILL.md.

Also removes the useShakespeare bullet from AGENTS.md since the hook
is no longer part of the default template surface.
This commit is contained in:
Alex Gleason committed 2026-04-26 17:58:22 -05:00
1 parent 29913ef530
commit 0d5a415bac
3 files changed
+22 -1

No files matched your search

+22
View File
@@ -5,6 +5,28 @@ description: Build AI-powered chat interfaces, implement streaming responses, or
# AI Integration with Shakespeare API
This skill provides the `useShakespeare` hook for AI chat completions with Nostr authentication against the Shakespeare AI API. The API dynamically provides available models, so you should query them at runtime rather than hardcoding model names.
**The Shakespeare integration is not included in the project by default.** When the user wants AI chat functionality, follow the setup instructions below to install the hook.
## Files Provided by This Skill
| Skill file | Copy to |
|---|---|
| `files/hooks/useShakespeare.ts` | `src/hooks/useShakespeare.ts` |
## Setup Instructions
### 1. Dependencies
No extra npm packages are required — the hook uses only packages already present in the template (`react`, `@nostrify/react/login` via the existing `useCurrentUser` hook).
### 2. Copy the Skill File Into `src/`
Copy `.agents/skills/ai-chat/files/hooks/useShakespeare.ts` into `src/hooks/useShakespeare.ts`. The hook uses `@/hooks/useCurrentUser` and `@nostrify/react/login` types — both already present in the template — so no further wiring is required.
## Usage
Use the `useShakespeare` hook for AI chat completions with Nostr authentication. The API dynamically provides available models, so you should query them at runtime rather than hardcoding model names.
```tsx
-1
View File
@@ -31,7 +31,6 @@ This project is a Nostr client application built with React 19.x, TailwindCSS 3.
- `useLoggedInAccounts`: Manage multiple accounts
- `useLoginActions`: Authentication actions
- `useIsMobile`: Responsive design helper
- `useShakespeare`: AI chat completions with Shakespeare AI API
- `/src/pages/`: Page components used by React Router (Index, NotFound)
- `/src/lib/`: Utility functions and shared logic
- `/src/contexts/`: React context providers (AppContext)