Commit Graph

13 Commits

Author SHA1 Message Date
Alejandro Gómez
075cdcb97b refactor: cleanup skills 2026-04-03 11:07:14 +02:00
Alejandro Gómez
4a501634c5 chore: sync NIPs 2026-03-26 09:58:07 +01:00
Alejandro Gómez
5d22403235 ai: sync-nips command 2026-03-26 09:22:32 +01:00
Alejandro
5d35832f85 feat: enhance /review command with deep code review capabilities (#228)
- Accept PR number, branch name, or review uncommitted changes
- Reference project skills (React, Applesauce, Nostr) for context
- Prioritized review criteria: correctness, protocol compliance,
  applesauce patterns, React best practices, simplicity, consistency
- Structured output format with file:line references
- Senior reviewer persona focused on maintainability

https://claude.ai/code/session_012e61BRqaF8LwUAFJuz8FaP

Co-authored-by: Claude <noreply@anthropic.com>
2026-01-29 18:59:57 +01:00
Alejandro
d69cc1fec6 Migrate from Tailwind CSS v3 to v4 (#219)
- Replace JS config (tailwind.config.js) with CSS-first @theme directive
- Add @tailwindcss/vite plugin for improved Vite integration
- Update src/index.css with v4 syntax (@import, @theme, @utility)
- Convert @layer utilities to @utility syntax
- Fix hardcoded scrollbar colors in command-launcher.css
- Add Tailwind v4 skill document (.claude/skills/tailwind-v4.md)
- Update CLAUDE.md with Tailwind v4 quick reference

https://claude.ai/code/session_01T6RenqDof8br6Nt9aKcjvq

Co-authored-by: Claude <noreply@anthropic.com>
2026-01-27 11:24:35 +01:00
Alejandro
adf8a62954 feat: add hashtag support to rich editor (#185)
* feat: add automatic hashtag extraction and t tags in POST command

Extract hashtags from post content and automatically add them as t tags to published events.

Changes:
- Add hashtag extraction logic to RichEditor.serializeContent() using Unicode-aware regex
- Update SerializedContent interface to include hashtags field
- Update RichEditor props and callbacks to pass hashtags through the pipeline
- Add t tags for each hashtag in PostViewer.handlePublish()

Hashtags are deduplicated and stored in lowercase (following Nostr convention).
Example: #bitcoin #nostr #Bitcoin → ["t", "bitcoin"], ["t", "nostr"]

* refactor: use NoteBlueprint for automatic hashtag/mention extraction

Replace manual hashtag and mention extraction with applesauce's NoteBlueprint,
which automatically extracts hashtags, mentions, and event quotes from text content.

Changes:
- Simplify SerializedContent interface by removing manually extracted fields
- Remove hashtag extraction regex and mention/eventRef tracking from editors
- Replace manual event building with factory.create(NoteBlueprint, ...)
- Use q tags for event quotes (NIP-18) instead of e tags

Benefits:
- ~70 lines of code removed
- Leverage battle-tested applesauce extraction logic
- Automatic benefits from future applesauce improvements
- Correct semantic tags (q for quotes, p for mentions, t for hashtags)

What still works:
- Custom emoji tags (NIP-30)
- Blob attachments/imeta tags (NIP-92)
- Address references (naddr - not yet in applesauce)
- Client tag

All tests pass (980/980).

* refactor: use NoteReplyBlueprint in NIP-10 adapter

Replace manual NIP-10 tag building with NoteReplyBlueprint, which automatically
handles root/reply markers, p-tag copying, and all the threading logic.

Changes:
- Simplify sendMessage from ~95 lines to ~40 lines
- Remove manual e-tag building with root/reply markers
- Remove manual p-tag deduplication logic
- Use factory.create(NoteReplyBlueprint, parentEvent, content, options)
- Automatically get hashtags, mentions, and event quotes via setShortTextContent

Benefits:
- ~55 lines of complex threading logic removed
- Leverage battle-tested applesauce NIP-10 implementation
- Automatic root detection from parent's existing tags
- Cleaner, more maintainable code

All tests pass (980/980).

* refactor: use GroupMessageBlueprint and ReactionBlueprint in chat adapters

Replace manual event building with applesauce blueprints in all chat adapters.

Changes:
- NIP-29: Use GroupMessageBlueprint for kind 9 messages
  * Auto-handles h-tag, hashtags, mentions, emojis
  * Manually add q-tag for replies (NIP-29 specific)
  * ~15 lines removed

- All adapters (NIP-10, NIP-29, NIP-53, NIP-C7): Use ReactionBlueprint for kind 7 reactions
  * Auto-handles e-tag, k-tag, p-tag, custom emoji support
  * Protocol-specific tags (h-tag, a-tag) added manually
  * ~60 lines removed across 4 adapters

Benefits:
- ~75 lines of code removed total
- Leverage battle-tested applesauce blueprints
- Automatic hashtag, mention, and quote extraction
- Cleaner, more maintainable code

All tests pass (980/980).

* fix: add required previous field to GroupMessageBlueprint options

GroupMessageBlueprintOptions requires a 'previous' field for message threading.
Added empty array for now since we don't support threading yet.

* docs: add comprehensive blueprint documentation to applesauce skills

Added detailed documentation for:
- NoteBlueprint (automatic hashtag/mention/quote extraction)
- NoteReplyBlueprint (NIP-10 threading)
- ReactionBlueprint (kind 7 reactions)
- GroupMessageBlueprint (NIP-29 groups)
- DeleteBlueprint (NIP-09 deletion)
- EventFactory usage patterns
- Before/after examples showing code reduction
- Best practices for using blueprints

This documents the refactoring work done throughout the codebase.

* fix: use single newline separator in TipTap getText() calls

TipTap's getText() uses double newlines (\n\n) by default to separate
block nodes like paragraphs, which was causing extra blank lines in
posted content.

Changed to getText({ blockSeparator: '\n' }) in both RichEditor and
MentionEditor to use single newlines between paragraphs.

---------

Co-authored-by: Claude <noreply@anthropic.com>
2026-01-21 16:20:00 +01:00
Alejandro
9282e45910 feat: Add npm install step to verify skill (#127)
Add npm install as the first step in the verification suite to ensure
all dependencies are installed before running lint, tests, and build.
This prevents failures due to missing or outdated dependencies.

Co-authored-by: Claude <noreply@anthropic.com>
2026-01-17 21:39:35 +01:00
Alejandro
b2b398b9fb docs: add applesauce v5 upgrade plan (#39)
* docs: add applesauce v5 upgrade plan

Comprehensive migration plan covering:
- Package updates (add applesauce-common, update to v5)
- EventFactory import migration (applesauce-factory → applesauce-core)
- Unified event loader setup
- ActionHub → ActionRunner migration
- useObservableMemo → use$ hook migration
- New features: casting system, encrypted content caching
- Documentation and skills updates needed

* feat: upgrade applesauce libraries to v5

Major upgrade from applesauce v4 to v5 with breaking changes:

Package updates:
- applesauce-core: ^4.0.0 → ^5.0.0
- applesauce-actions: ^4.0.0 → ^5.0.0
- applesauce-loaders: ^4.0.0 → ^5.0.0
- applesauce-react: ^4.0.0 → ^5.0.0
- applesauce-relay: ^4.0.0 → ^5.0.0
- applesauce-signers: ^4.0.0 → ^5.0.0
- applesauce-accounts: ^4.0.0 → ^5.0.0
- Added new applesauce-common: ^5.0.0 package

API migrations:
- EventFactory: applesauce-factory → applesauce-core/event-factory
- ActionHub → ActionRunner with async function pattern (not generators)
- useObservableMemo → use$ hook across all components
- Helper imports: article, highlight, threading, zap, comment, lists
  moved from applesauce-core to applesauce-common
- parseCoordinate → parseReplaceableAddress
- Subscription options: retries → reconnect
- getEventPointerFromETag now returns null instead of throwing

New features:
- Unified event loader via createEventLoaderForStore
- Updated loaders.ts to use v5 unified loader pattern

Documentation:
- Updated CLAUDE.md with v5 patterns and migration notes
- Updated applesauce-core skill for v5 changes
- Created new applesauce-common skill

Test fixes:
- Updated publish-spellbook.test.ts for v5 ActionRunner pattern
- Updated publish-spell.test.ts with eventStore mock
- Updated relay-selection.test.ts with valid test events
- Updated loaders.test.ts with valid 64-char hex event IDs
- Added createEventLoaderForStore mock

---------

Co-authored-by: Claude <noreply@anthropic.com>
2026-01-05 14:54:21 +01:00
Alejandro
c223deb4b9 feat: enhance Claude Code setup with slash commands, hooks, and verification (#38)
Add slash commands for common workflows:
- /commit-push-pr: Streamlined PR creation
- /verify: Full verification suite (lint + test + build)
- /test: Run tests with results summary
- /lint-fix: Auto-fix lint and formatting
- /review: Code review for quality and Nostr patterns

Update settings.json:
- Expand permissions for common safe bash commands
- Add PostToolUse hook for auto-formatting with Prettier

Update CLAUDE.md:
- Add Verification Requirements section
- Document available slash commands
- Emphasize running /verify before PRs

Co-authored-by: Claude <noreply@anthropic.com>
2026-01-05 12:45:49 +01:00
Claude
2189d5a969 docs: add applesauce helpers investigation and refactoring plan
- Created APPLESAUCE_REFACTORING_PLAN.md with detailed analysis
- Updated CLAUDE.md with Applesauce Helpers & Caching section
- Enhanced applesauce-core skill with helper documentation

Key findings:
- Applesauce helpers cache internally using symbols
- No need for useMemo when calling applesauce helpers
- Identified 40+ useMemo instances that can be removed
- Documented available helpers and custom grimoire helpers
- Provided migration strategy and refactoring opportunities
2025-12-22 13:12:56 +00:00
Alejandro Gómez
6c6f3728c0 ui: adjust spacing for quote skeletons 2025-12-18 11:10:30 +01:00
Alejandro Gómez
f4d0048b30 ai: claude config 2025-12-14 21:57:17 +01:00
Alejandro Gómez
34f5885953 ai: add CLAUDE.md and skills 2025-12-11 12:40:29 +01:00