Commit Graph
463 Commits
Author SHA1 Message Date
Alex Gleason 83c0ed42af Simplify nostr-comments skill and add 3-dots actions menu
- Drop the outer Card wrapper, title, and counter from CommentsSection; it
  now renders as a lightweight space-y-6 container matching starpoint.
- Drop the Card wrapper and 'Adding to the discussion' label from
  CommentForm; use a rounded Textarea + right-aligned 'Post' button.
- Add a per-comment 3-dots menu with 'Open in Ditto' (opens nevent on
  ditto.pub) and 'Delete' (NIP-09 kind 5, shown only for own comments,
  confirmed via AlertDialog, optimistically removes from the cached
  useComments result via queryClient.setQueriesData).
- Remove the obsolete title prop from SKILL.md docs and examples.
2026-04-26 20:09:29 -05:00
Alex Gleason 76dc27a513 Add nip85-stats skill for NIP-85 Trusted Assertion stats 2026-04-26 20:03:42 -05:00
Alex Gleason 3866c0a119 Use tailwindcss-safe-area plugin in capacitor skill
Replaces the hand-rolled safe-area CSS utilities with the
tailwindcss-safe-area Tailwind plugin (same approach Shakespeare uses),
which gives us a richer utility set plus offset / or variants:

  pt-safe, pb-safe, px-safe, p-safe, mt-safe, inset-safe,
  top-safe, bottom-safe, h-dvh-safe, min-h-dvh-safe,
  pt-safe-offset-4 (safe area + 1rem),
  pb-safe-or-8 (max of safe area and 2rem),
  scroll-p-safe, border-t-safe, and more.

Critically, the SKILL.md now pins the plugin version per Tailwind
major \u2014 the plugin changed its registration API between 0.x and
1.x to match Tailwind's own v3\u2192v4 transition:

  Plugin 0.8.0  \u2192 Tailwind 3.x  (add to plugins: array in config)
  Plugin >=1.0  \u2192 Tailwind 4.x  (@import in main CSS, not @plugin)

mkstack ships Tailwind 3.4.x, so install targets 0.8.0 specifically.
Using @latest on a Tailwind 3 project silently produces no utilities
at all \u2014 documented in both the setup section and troubleshooting.

Also documents the Android WebView <140 caveat: Chromium bug 40699457
causes env(safe-area-inset-*) to return 0. Capacitor's SystemBars
plugin (insetsHandling: 'css', already preset in our capacitor.config.ts
template) works around it by injecting --safe-area-inset-* CSS variables,
but tailwindcss-safe-area uses env() directly and can't see them.
Two fixes:
  1. preferred: target WebView 140+ (Aug 2025+, auto-updated on any
     active Android >=7 via Play Services)
  2. fallback: new files/safe-area-shim.css that redeclares the common
     utilities with var(--safe-area-inset-*, env(..., 0px)) so the
     SystemBars-injected variables win. Copy to src/ and @import after
     @tailwind utilities; if targeting older Android fleets.

Changes:
- Remove files/safe-area.css (hand-rolled utilities)
- Add files/safe-area-shim.css (optional Android <140 override)
- SKILL.md: new step 3 'Register the Tailwind Safe-Area Plugin'
  inserted between 'Copy Skill Files' and 'Edit capacitor.config.ts';
  subsequent steps renumbered 4\u201310
- SKILL.md: 'Install Dependencies' adds the Tailwind plugin with a
  version matrix table and explicit v3-pinning rationale
- SKILL.md: 'Using the APIs \u2192 Safe-area utilities' rewritten with
  a real-world usage cheatsheet mapping plugin classes to use cases
- SKILL.md: expanded troubleshooting with three new safe-area
  entries (Android env-0 WebView<140, 'pt-safe doesn't exist' =
  plugin not registered or wrong major version, iOS missing
  viewport-fit=cover)

Validated: full stack staged into src/ + package.json (including
[email protected] and tailwind.config.ts plugins
registration). npm run test passes with only the 6 pre-existing
baseline errors; reverted cleanly.
2026-04-26 19:53:28 -05:00
Alex Gleason f927a00dcf Add capacitor skill for native iOS/Android builds
Provides the cross-platform primitives needed to wrap the mkstack web app
as a native iOS and Android binary using Capacitor, modeled on how Ditto
integrates the framework.

Each helper works unconditionally on every platform \u2014 native builds
use the real Capacitor plugin, web falls back to an equivalent browser
API:

- haptics: impactLight/Medium/Heavy, notificationSuccess/Warning/Error,
  selectionChanged \u2014 taptic engine on native, navigator.vibrate() on
  web, silent no-op where neither exists
- downloadTextFile / openUrl \u2014 @capacitor/filesystem and native
  share sheet on native, <a download> and window.open on web
- secureStorage + useSecureLocalStorage \u2014 iOS Keychain / Android
  KeyStore adapter with automatic migration of existing plaintext values
  from localStorage on first native read, plus an async-aware React hook
  that exposes a 'ready' flag
- DeepLinkHandler \u2014 listens for Capacitor appUrlOpen and forwards
  into React Router navigation
- bootstrapNative() \u2014 hides the iOS keyboard accessory bar and keeps
  the system-bar icon style in sync with the active CSS theme via
  MutationObserver on both the <html> class and the theme-vars style
  element; detects dark background from theme class or computed body
  luminance
- safe-area CSS utilities \u2014 .safe-area-top/-bottom/-left/-right
  padding classes plus .safe-area-inset-top/-bottom positional variants,
  preferring --safe-area-inset-* CSS vars (injected by the SystemBars
  plugin on Android) over env(safe-area-inset-*) so Chromium <140 on
  Android Just Works
- capacitor.config.ts template \u2014 preconfigured with androidScheme
  https, ios contentInset never, SystemBars insetsHandling css; placeholder
  appId / appName / scheme ready to be customized
- patch-cap-config.mjs \u2014 post-cap-sync hook that restores
  packageClassList entries for local (non-SPM) native plugin classes so
  they get registered at startup

SKILL.md documents the full setup sequence: install the nine
@capacitor/* + capacitor-secure-storage-plugin packages, copy files
into src/, paste the CSS snippet into index.css, edit capacitor.config.ts
identity fields, add viewport-fit=cover, wire bootstrapNative() into
main.tsx and DeepLinkHandler into AppRouter, npx cap add android / ios,
build, sync, run. Also covers common follow-ups (custom plugins, icons,
splash, push, deep-link verification, credential manager integration)
and troubleshooting (safe-area zero on Android, navigation no-op, keychain
orphaning, keyboard accessory bar timing, custom theme detection).

Validated: all files staged into src/ + deps installed \u2014 npm run
test passes with only the 6 pre-existing baseline errors (template
FIXMEs + missing index.html manifest/meta), then cleanly reverted.
2026-04-26 19:48:23 -05:00
Alex Gleason 0b220f250a Upgrade note-content skill with advancements from Ditto
Replaces the minimal NoteContent component with the full-featured
version from ~/Projects/ditto, and bundles the helper modules and
minimal companion stubs needed to make it work standalone.

New capabilities:
- BOLT11 lightning-invoice detection (renders LightningInvoiceCard)
- Inline image / video / audio / webxdc embeds with MIME detection
- Consecutive images grouped into an ImageGallery with shared Lightbox
- NIP-94 imeta-declared media appended when absent from content
- Embedded nevent / naddr cards, with relay and author hints pulled
  from q tags; supports naddr1 fragments embedded in external URLs
- Bare and @-prefixed NIP-19 identifiers (no nostr: prefix required)
- Line-end-aware link rendering: URLs at the end of a line become
  preview cards, mid-sentence URLs stay inline
- Trailing-punctuation stripping on URLs so 'see https://x.com.'
  links correctly
- wss:// relay URLs routed to /r/<encoded>
- Unicode-aware hashtag regex (matches non-ASCII letters)
- NIP-30 custom emoji via :shortcode: with per-event and viewer-wide
  fallback collections (useCustomEmojis)
- Flag emoji linkified to /i/iso3166:<CC>
- 'Emoji-only' posts auto-rendered at large size
- dir="auto" for RTL content
- Whitespace normalization around block embeds
- disableEmbeds / disableMediaEmbeds / disableNoteEmbeds /
  hideEmbedImages props for recursive embed cards and preview
  contexts

New bundled files:
- lib/: mediaUrls.ts, sanitizeUrl.ts, imeta.ts, customEmoji.ts,
  getDisplayName.ts, avatarShape.ts, countries.ts
- hooks/: useCustomEmojis.ts (stub), useBlossomFallback.ts (stub),
  useProfileUrl.ts (stub)
- components/: LinkEmbed, EmbeddedNote, EmbeddedNaddr,
  LightningInvoiceCard, VideoPlayer, AudioVisualizer, WebxdcEmbed,
  ImageGallery + Lightbox, ProfileHoverCard, CustomEmoji \u2014 all
  minimal but functional stubs; each file documents how to upgrade
  to a richer implementation

SKILL.md rewritten with full file list, upgrade paths for each
stub, routing expectations, and a patterns-to-render table.

Validated: tsc --noEmit clean, vitest run passes all 5 NoteContent
tests, vite build succeeds \u2014 when all skill files are staged
into src/ alongside the component.
2026-04-26 19:38:31 -05:00
Alex Gleason c067e87f2c Add note-content skill for rich text rendering of Nostr notes
Moves src/components/NoteContent.tsx and its test file into a new
note-content skill at .agents/skills/note-content/. The component
linkifies URLs, hashtags, and Nostr URIs (npub/nprofile/note/nevent)
inside plaintext event content, and was previously imported only by
the comments and DM stacks that have already been extracted/removed.

Also removes the 'Rendering Rich Text Content' section from
AGENTS.md since NoteContent is no longer part of the default
template surface. The new SKILL.md documents the expected /:nip19
and /t/:hashtag routes and the existing template hooks it relies on
(useAuthor, genUserName).
2026-04-26 18:04:43 -05:00
Alex Gleason 353551342b Add relay-management skill for NIP-65 relay list UI
Moves src/components/RelayListManager.tsx into a new
relay-management skill at .agents/skills/relay-management/, with a
SKILL.md covering installation, NIP-65 background, and how the
component hooks into the existing AppContext / NostrSync / kind
10002 publishing already present in the core template.

AGENTS.md's 'Relay Management' section keeps the NIP-65 sync
description but drops the RelayListManager usage example, pointing
at the new skill instead.
2026-04-26 18:00:11 -05:00
Alex Gleason bc97f82d3e Add edit-profile skill for Nostr profile editing form
Moves src/components/EditProfileForm.tsx into a new edit-profile
skill at .agents/skills/edit-profile/, with a SKILL.md covering
installation, the kind 0 fields it edits (name, about, picture,
banner, website, nip05, bot), and the existing template hooks it
plugs into (useCurrentUser, useNostrPublish, useUploadFile,
useToast).

Also removes the 'Nostr Edit Profile' section from AGENTS.md since
the component is no longer part of the default template surface.
2026-04-26 17:59:17 -05:00
Alex Gleason 0d5a415bac 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.
2026-04-26 17:58:22 -05:00
Alex Gleason 29913ef530 Extract comment system into the nostr-comments skill
Moves the NIP-22 (kind 1111) commenting stack out of src/ and into
.agents/skills/nostr-comments/files/ \u2014 useComments, usePostComment,
and the Comment / CommentForm / CommentsSection components.

Updates the existing SKILL.md with a setup preamble explaining how
to copy the files back into src/ when a project needs comment
functionality. No dependency changes were required; the skill only
uses packages already present in the template.
2026-04-26 17:57:46 -05:00
Alex Gleason c6be6355a7 Remove direct messaging from the codebase
Deletes the entire DM stack \u2014 DMProvider, DMContext, the dm/ UI
components, useDMContext, useConversationMessages, the dm* library
modules, pages/Messages.tsx, and the nostr-direct-messages skill.
Also drops the idb dependency, which was only used by the DM
IndexedDB message store.

The implementation was complex and tightly coupled; removing it
clears the way for a future, cleaner approach if DM support is
needed again.
2026-04-26 17:57:05 -05:00
Alex Gleason 9e2599502d Extract NWC and Lightning zap code into an nwc skill
Moves NWC wallet connection (useNWC, NWCContext, WalletModal) along with
the WebLN wallet detection (useWallet) and NIP-57 zap stack (useZaps,
ZapButton, ZapDialog) out of src/ and into .agents/skills/nwc/ as an
opt-in skill. Removes NWCProvider from App.tsx and TestApp.tsx, drops
the NWC-only dependencies (@getalby/sdk, @webbtc/webln-types) from
package.json, and updates AGENTS.md to stop referencing the extracted
hooks and components.

The new SKILL.md explains how to reinstall the dependencies, copy the
files back into src/, and wire up NWCProvider when a project actually
needs Lightning wallet and zap functionality.
2026-04-26 17:48:46 -05:00
Alex Gleason 59c32c845c Add mandatory commit instruction to AGENTS.md
Require that every completed task end with a git commit, without waiting
for the user to ask. Committing is part of completing the task.
2026-04-26 00:58:25 -05:00
Alex Gleason 4044d586db Upgrade Radix UI packages to fix infinite render loop with React 19
@radix-ui/react-popper 1.2.4 had a useEffect with no dependency array
that called setState on every render, causing an infinite loop. Fixed
in 1.2.8 by tracking the previous anchor in a ref.
2026-03-28 02:31:41 -05:00
Alex Gleason 01889d1207 Upgrade Vite and Nostrify 2026-03-28 00:43:37 -05:00
Alex Gleason dcfdbf9e47 Upgrade to React 19
- react, react-dom: ^18.3.1 -> ^19.2.4
- @types/react, @types/react-dom: ^18.3.1 -> ^19.x
- react-day-picker: ^8.10.1 -> ^9.14.0 (rewrite calendar.tsx for v9 API)
- vaul: ^0.9.3 -> ^1.1.2
- Fix RefObject<T> type in ZapDialog for React 19 type changes
2026-03-28 00:13:05 -05:00
Alex Gleason cb52a18d09 Add NIP-42 relay authentication support
Sign kind 22242 AUTH events automatically when relays send challenges.
Uses a signer ref pattern so the pool doesn't need to be recreated
when the user logs in/out or switches accounts.
2026-03-25 02:14:41 -05:00
Alex Gleason 699a3acb85 Upgrade Nostrify 2026-03-25 01:47:45 -05:00
Alex Gleason 1caf9dabcb feat: add client-initiated NIP-46 (nostrconnect://) login support
Upgrade to @nostrify/[email protected] and implement the nostrconnect:// login flow:
- QR code display on desktop, deep link on mobile
- Copy URI button, retry on timeout, abort on dialog close
- Bunker URI manual input as fallback under the Remote Signer tab
- Add QRCodeCanvas component using the existing qrcode dependency
2026-03-24 16:21:15 -05:00
Alex Gleason 9af2db39f2 Upgrade to Vite 8
Way faster builds!
2026-03-20 15:51:52 -05:00
Alex Gleason 1cf1ad94b2 .claude/skills/ -> .agents/skills/ 2026-03-12 12:51:56 -05:00
Alex Gleason e67f5158b7 Standardize Nostr filter limit to 15 in AGENTS.md examples 2026-03-11 18:28:22 -05:00
Alex Gleason 32ba132ae5 Add plausible-analytics skill 2026-03-11 14:48:17 -05:00
Alex Gleason ba892fdd54 Fix iOS Safari auto-zoom on input focus by ensuring 16px minimum font size on mobile 2026-03-07 11:38:12 -06:00
Alex Gleason c88350270a Update nostr-comments skill to include full scope of NIP-73 commenting 2026-02-24 13:25:26 -06:00
Alex Gleason b39bd0b7b7 Support NIP-73 hashtag identifiers 2026-02-24 11:55:40 -06:00
Alex Gleason 4a87514a06 Remove github test workflow 2026-02-23 19:13:34 -06:00
Alex Gleason 7e184e9199 npm audit fix 2026-02-21 21:08:55 -06:00
Alex Gleason 3d77bdba93 Upgrade Nostrify 2026-02-21 21:08:26 -06:00
Alex Gleason 157ecac58b Remove AbortSignal.any calls 2026-02-21 13:57:43 -06:00
Alex Gleason 12dcbfdb33 Add 'nostr' prefix to author queryKey 2026-02-21 13:53:09 -06:00
Alex Gleason 8a69f988ce npm audit fix 2026-02-19 03:52:37 -06:00
Alex Gleason 3bbdab76a1 Upgrade Nostrify 2026-02-19 03:51:30 -06:00
Alex Gleason 6ddc230446 Reduce default eoseTimeout to 200ms 2026-02-12 14:39:07 -06:00
Alex Gleason 098be99f9f Upgrade Nostrify, also npm audit fix 2026-02-12 13:40:11 -06:00
Alex Gleason 57d3f8abec npx update-browserslist-db@latest 2026-01-30 22:58:29 -06:00
Alex Gleason 5bea40c1a2 Remove relay.nostr.band (I thought we already did this) 2026-01-30 21:55:45 -06:00
Alex Gleason c1bd55108c Remove stray docs mentions from AGENTS.md 2026-01-24 21:21:09 -06:00
Alex Gleason 266e2c92d8 Replace docs with skills 2026-01-24 21:20:22 -06:00
Alex Gleason 8163f30011 You don't actually have to pass signal now 2026-01-24 00:02:15 -06:00
Alex Gleason b97db2ca77 Upgrade zod to v4 2026-01-23 23:59:13 -06:00
Alex Gleason cda1b903a9 Merge branch 'main' of gitlab.com:soapbox-pub/mkstack 2026-01-21 16:52:45 -06:00
Alex Gleason ead11c31fe Remove stack.json 2026-01-21 16:52:23 -06:00
Alex Gleason a9bbb5ab84 Merge branch 'remove-nostr-band-relay' into 'main'
Replace dead relay.nostr.band with relay.primal.net

See merge request soapbox-pub/mkstack!29
2026-01-21 20:32:10 +00:00
Derek Ross f87510bc3a Replace dead relay.nostr.band with relay.primal.net 2026-01-21 15:29:02 -05:00
Alex Gleason fc010f9b91 Add Nostr Security Model to AGENTS.md 2026-01-21 12:14:24 -06:00
Alex Gleason 20f9ea9069 npm audit fix 2026-01-17 19:19:05 -06:00
Alex Gleason fc4c4deded Upgrade Nostrify 2026-01-17 19:18:43 -06:00
Alex Gleason b3dac352a4 Remove deploy script 2026-01-11 22:21:47 -06:00
Alex Gleason e94f53f0e2 Add -z-10 isolate hint 2026-01-10 11:37:12 -06:00