Skip to content

feat: Phase 1 spec fixes — H1-H5 + Bookmark rename + B1 middleware#1200

Open
le-dawg wants to merge 341 commits into
f:mainfrom
solution8-com:feat/spec-fixes-h1-h5
Open

feat: Phase 1 spec fixes — H1-H5 + Bookmark rename + B1 middleware#1200
le-dawg wants to merge 341 commits into
f:mainfrom
solution8-com:feat/spec-fixes-h1-h5

Conversation

@le-dawg

@le-dawg le-dawg commented Jun 4, 2026

Copy link
Copy Markdown

Summary

  • Bookmark rename: model Collectionmodel Bookmark (@@map("bookmarks")) frees the collections table name for Phase 1 marketplace schema; forward migration + manual rollback script added
  • B1 fix: /api/collections added to PUBLIC_PATHS in middleware so collection routes aren't 401'd before route code runs
  • H3: computePromptContentHash() utility (src/lib/collections/content-hash.ts) — SHA-256 over main content + alphabetically sorted skill files; recomputation hook wired into MCP add_file_to_skill, update_skill_file, remove_file_from_skill with pre-migration try/catch guard
  • H5: Username change blocked when user has PUBLIC or ADMIN_PRIVATE collections (marketplace URL stability)
  • H1/H2/H4: Spec-only clarifications (no code changes) — prereq scope, download auth contract, org admin = role=ADMIN

Test Plan

  • 761/761 Vitest tests pass locally (npx vitest run)
  • Vercel preview build succeeds
  • Verify prisma generate works: DATABASE_URL="postgresql://placeholder" DIRECT_URL="postgresql://placeholder" npx prisma generate
  • Test username guard: attempt username change with an active PUBLIC collection → expect 400 username_locked
  • Test username guard: attempt username change with no public collections → expect 200
  • Confirm /api/collections routes accessible without session (middleware exemption)

Notes

  • Rollback migration lives in prisma/manual-rollbacks/ — NOT in prisma/migrations/ (Prisma would auto-apply it and rename bookmarks back to collections)
  • contentHash recompute hook is a no-op until CollectionItem table exists (Phase 1 migration)
  • Username guard uses (db as any).collection?.count — will be a typed call once Phase 1 schema lands

🤖 Generated with Claude Code

le-dawg and others added 30 commits March 23, 2026 23:21
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
…sorting-and-deletion

Fix tags admin bulk-delete parse error
…caping

Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
…as HTML

Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
…ng or encoding

Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
Potential fix for code scanning alert no. 24: Double escaping or unescaping
…rofile

feat: Admin Delete User from Profile Page
…-merge-logic

Move middleware.ts to src/middleware.ts, absorb src/proxy.ts
- Install @vercel/speed-insights package
- Add SpeedInsights component to root layout
- Enable real-time performance monitoring for the application

Co-authored-by: le-dawg <3172733+le-dawg@users.noreply.github.com>
…thorized-error

Add Vercel Speed Insights integration
…uthorized-errors

Add structured [AUTH] logging to diagnose unauthorized redirects
fix: NextAuth `error=Configuration` on GitHub sign-in
1. src/lib/auth/index.ts: Add githubUsername to both db.user.findUnique
   selects in jwt callback; update admin checks to evaluate both
   dbUser.githubUsername and dbUser.username (OR logic via De Morgan's law)

2. src/middleware.ts: Add NEXTAUTH_SECRET fallback to getToken secret

3. src/app/unauthorized/page.tsx: Change Go Home link to /login with
   prefetch=false to prevent prefetch bouncing back to /unauthorized

4. src/components/layout/header.tsx: Wrap all protected nav links
   (/prompts, /skills, /taste, /workflows, /categories, /tags,
   /discover, /promptmasters) in {user && (...)} for both mobile
   and desktop menus to eliminate background prefetch spam

Agent-Logs-Url: https://github.com/solution8-com/S8-Utility-Promptschat/sessions/cf338f63-b46e-4dbc-831b-4581051a55d7

Co-authored-by: le-dawg <3172733+le-dawg@users.noreply.github.com>
Fix infinite 401 redirect loop, admin lockout via username sanitization, and middleware secret mismatch
le-dawg and others added 29 commits May 9, 2026 14:40
- Remove hardcoded skill.nd.json requirement for folder uploads
- Support dragging single skill files in addition to folders
- Enable direct download of single-file skills (not wrapped in ZIP)
- Maintain ZIP download for multi-file skills
- Add comprehensive tests for skill editor functionality

This addresses the user's request to improve skill uploading through the DUI interface with drag-and-drop capabilities and flexible download options.
Fix PR #59 review issues in SkillEditor drop flow and single-file download headers
…replace confirmation dialog

Agent-Logs-Url: https://github.com/solution8-com/AIRstack-Promptbar/sessions/14aeefbc-78ff-4065-a56e-e9bc1b85b4f3

Co-authored-by: le-dawg <3172733+le-dawg@users.noreply.github.com>
…mits

feat(skill): enhance upload/download capabilities

- Remove hardcoded skill.nd.json requirement for folder uploads
- Support dragging single skill files in addition to folders
- Enable direct download of single-file skills (not wrapped in ZIP)
- Maintain ZIP download for multi-file skills
- Add comprehensive tests for skill editor functionality

This addresses the user's request to improve skill uploading through the DUI interface with drag-and-drop capabilities and flexible download options.
Entire-Checkpoint: 75bf672334cb
…pansion

URLs containing query params (e.g. ?users=le-dawg) were embedded unquoted
in the claude and gemini CLI commands, causing zsh to treat ? as a glob
wildcard and fail with "no matches found".

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Entire-Checkpoint: 708305c02561
fix: quote MCP URL in generated shell commands
MCP clients (Claude Code, Cursor, etc.) use PROMPTS_API_KEY header auth
and have no browser session. Middleware was blocking before the route
handler could validate the key, causing 401 → OAuth probe → HTML parse error.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Entire-Checkpoint: ecba472feaaa
… behind showOfficialBranding

Agent-Logs-Url: https://github.com/solution8-com/AIRstack-Promptbar/sessions/3790ce93-195b-4962-8a03-254299c33f28

Co-authored-by: le-dawg <3172733+le-dawg@users.noreply.github.com>
…eject-button

Fix admin change-request actions + env-driven MCP branding across all clients
Entire-Checkpoint: 2fa989faaa05
…entHash, username stability

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Entire-Checkpoint: e271fadc42c8
…Phase 1

Includes forward migration (20260604000000) and rollback migration (20260604000001).
All db.collection.* refs → db.bookmark.*, collectedBy relation → bookmarks.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Entire-Checkpoint: af62f2909406
…se 1 integrity

computePromptContentHash() in src/lib/collections/content-hash.ts provides
order-independent SHA-256 over skill content + alphabetically sorted files.
Wired into add_file_to_skill, update_skill_file, remove_file_from_skill with
try/catch guard (no-op until Phase 1 CollectionItem table is migrated).

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Entire-Checkpoint: 6e9c47ad453c
…se 1 marketplace URL stability)

Guard checks collection visibility before allowing username rename;
test suite covers locked, unlocked, and unchanged-username paths.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Entire-Checkpoint: 210d55d1757f
…sma rename

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Entire-Checkpoint: f01f362e1317
…leware exemption

prisma/migrations/ is apply-only — migrate deploy would have renamed bookmarks
back to collections. Rollback script now lives in prisma/manual-rollbacks/ for
manual use only.

Also commits the /api/collections PUBLIC_PATHS exemption (B1 fix) and its tests.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Entire-Checkpoint: 63ca5e85f1f5
@coderabbitai

coderabbitai Bot commented Jun 4, 2026

Copy link
Copy Markdown

Important

Review skipped

Too many files!

This PR contains 277 files, which is 127 over the limit of 150.

To get a review, narrow the scope:
• coderabbit review --type committed # exclude uncommitted changes
• coderabbit review --dir # limit to a subdirectory
• coderabbit review --base # compare against a closer base

⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: 770a3802-7520-4734-854b-df42012e88b6

📥 Commits

Reviewing files that changed from the base of the PR and between e3b01f7 and e3c10af.

⛔ Files ignored due to path filters (7)
  • ffff.svg is excluded by !**/*.svg
  • package-lock.json is excluded by !**/package-lock.json
  • packages/prompts.chat/package-lock.json is excluded by !**/package-lock.json
  • packages/raycast-extension/package-lock.json is excluded by !**/package-lock.json
  • prompts.csv is excluded by !**/*.csv
  • public/sponsors/vercel-oss-dark.svg is excluded by !**/*.svg
  • public/sponsors/vercel-oss.svg is excluded by !**/*.svg
📒 Files selected for processing (277)
  • .agents/README.md
  • .agents/skills/claude/prompts.chat/index.json
  • .agents/skills/claude/prompts.chat/prompt-lookup/SKILL.md
  • .agents/skills/claude/prompts.chat/skill-lookup/SKILL.md
  • .agents/skills/windsurf/book-translation/SKILL.md
  • .agents/skills/windsurf/widget-generator/SKILL.md
  • .claude-mcp-config.json
  • .claude/settings.json
  • .dockerignore
  • .entire/.gitignore
  • .env.example
  • .env.local.example
  • .github/README.md
  • .github/fufukaka.md
  • .github/workflows/prisma-onetime.yml
  • .gitignore
  • .kilo/kilo.json
  • .kilo/plans/1776879122018-sunny-harbor.md
  • .mcp.json
  • .vercelignore
  • .windsurf/skills
  • AGENTS.md
  • CLAUDE-PLUGIN.md
  • DOCKER.md
  • Dockerfile
  • GOVERNANCE.md
  • INTERNAL_HACK_FEATURE.md
  • INTERNAL_HACK_IMPROVEMENTS.md
  • INTERNAL_HACK_MODE_UPDATES.md
  • LICENSE
  • LICENSE-CC0
  • LICENSE-MIT
  • PROMPTS.md
  • README.md
  • SECURITY.md
  • SELF-HOSTING.md
  • TASTE_GRADUATION.md
  • UI_TESTING_GUIDE.md
  • compose.yml
  • docker/Dockerfile
  • docker/bootstrap.sh
  • docker/entrypoint.sh
  • docker/supervisord.conf
  • docs/MCP_SKILL_COMMENTS.md
  • docs/adr/.adr/cache/constraints_accepted.json
  • docs/adr/.adr/cache/contract_cache.json
  • docs/adr/.adr/policy.json
  • docs/adr/adr-index.json
  • docs/internal/INTERNAL_HACK_FEATURE.md
  • docs/internal/INTERNAL_HACK_IMPROVEMENTS.md
  • docs/internal/INTERNAL_HACK_MODE_UPDATES.md
  • docs/internal/README.md
  • docs/internal/TASTE_GRADUATION.md
  • docs/internal/UI_TESTING_GUIDE.md
  • docs/superpowers/plans/2026-04-29-guide-features-implementation.md
  • docs/superpowers/specs/2026-04-29-guide-edit-admin-usertable-design.md
  • docs/superpowers/specs/2026-05-05-codex-branch-triage-design.md
  • docs/superpowers/specs/2026-06-02-promptbar-phase1-collections-marketplace-design.md
  • messages/ar.json
  • messages/az.json
  • messages/de.json
  • messages/el.json
  • messages/en.json
  • messages/es.json
  • messages/fa.json
  • messages/fr.json
  • messages/he.json
  • messages/it.json
  • messages/ja.json
  • messages/ko.json
  • messages/nl.json
  • messages/pt.json
  • messages/ru.json
  • messages/tr.json
  • messages/zh.json
  • next.config.ts
  • package.json
  • packages/prompts.chat/README.md
  • packages/prompts.chat/src/cli/api.ts
  • packages/prompts.chat/src/cli/components/PromptDetail.tsx
  • packages/prompts.chat/src/cli/platforms.ts
  • packages/prompts.chat/src/parser/index.ts
  • packages/raycast-extension/README.md
  • packages/raycast-extension/package.json
  • packages/raycast-extension/raycast-env.d.ts
  • packages/raycast-extension/src/api.ts
  • packages/raycast-extension/src/utils.ts
  • pipikaka.prompt.yml
  • plugins/claude/promptbar/.claude-plugin/plugin.json
  • plugins/claude/promptbar/.mcp.json
  • plugins/claude/promptbar/agents/prompt-manager.md
  • plugins/claude/promptbar/agents/skill-manager.md
  • plugins/claude/promptbar/commands/prompts.md
  • plugins/claude/promptbar/commands/skills.md
  • plugins/claude/promptbar/skills/index.json
  • plugins/claude/prompts.chat/.mcp.json
  • prisma.config.ts
  • prisma/manual-rollbacks/20260604000001_rollback_rename_bookmarks_to_collections/migration.sql
  • prisma/migrations/20260324100000_add_ci_username_unique_index/migration.sql
  • prisma/migrations/20260407180000_add_guide_prompt_type/migration.sql
  • prisma/migrations/20260415000000_add_example_content/migration.sql
  • prisma/migrations/20260604000000_rename_collections_to_bookmarks/migration.sql
  • prisma/schema.prisma
  • prisma/seed.ts
  • prompts.config.ts
  • scripts/generate-contributors.sh
  • sentry.edge.config.ts
  • sentry.server.config.ts
  • src/__tests__/api/admin-users.test.ts
  • src/__tests__/api/change-requests.test.ts
  • src/__tests__/api/collection.test.ts
  • src/__tests__/api/leaderboard.test.ts
  • src/__tests__/api/mcp-create-skill-comment.test.ts
  • src/__tests__/api/mcp-handler.test.ts
  • src/__tests__/api/prompt-examples.test.ts
  • src/__tests__/api/prompts.test.ts
  • src/__tests__/api/register.test.ts
  • src/__tests__/api/tags.test.ts
  • src/__tests__/api/user-profile-username-guard.test.ts
  • src/__tests__/api/user-profile.test.ts
  • src/__tests__/api/versions.test.ts
  • src/__tests__/components/mcp-config-tabs.test.ts
  • src/__tests__/components/skill-editor.test.tsx
  • src/__tests__/lib/admin.test.ts
  • src/__tests__/lib/auth/provider-metadata.test.ts
  • src/__tests__/lib/collections/content-hash.test.ts
  • src/__tests__/lib/plugins/auth/oauth.test.ts
  • src/__tests__/lib/plugins/auth/oidc.test.ts
  • src/__tests__/lib/prompt-access.test.ts
  • src/__tests__/lib/urls.test.ts
  • src/__tests__/middleware.test.ts
  • src/app/(auth)/login/page.tsx
  • src/app/(auth)/register/page.tsx
  • src/app/[username]/opengraph-image.tsx
  • src/app/[username]/page.tsx
  • src/app/about/page.tsx
  • src/app/ads.txt/route.ts
  • src/app/api/admin/related-prompts/route.ts
  • src/app/api/admin/slugs/route.ts
  • src/app/api/admin/tags/[id]/route.ts
  • src/app/api/admin/users/[id]/route.ts
  • src/app/api/admin/users/route.ts
  • src/app/api/admin/webhooks/route.ts
  • src/app/api/ai/github-models/route.ts
  • src/app/api/auth/register/route.ts
  • src/app/api/collection/route.ts
  • src/app/api/leaderboard/route.ts
  • src/app/api/prompts/[id]/changes/[changeId]/route.ts
  • src/app/api/prompts/[id]/changes/route.ts
  • src/app/api/prompts/[id]/comments/[commentId]/vote/route.ts
  • src/app/api/prompts/[id]/comments/route.ts
  • src/app/api/prompts/[id]/connections/route.ts
  • src/app/api/prompts/[id]/examples/route.ts
  • src/app/api/prompts/[id]/flow/route.ts
  • src/app/api/prompts/[id]/route.ts
  • src/app/api/prompts/[id]/skill/route.ts
  • src/app/api/prompts/[id]/versions/route.ts
  • src/app/api/prompts/[id]/vote/route.ts
  • src/app/api/prompts/route.ts
  • src/app/api/tags/route.ts
  • src/app/api/user/notifications/route.ts
  • src/app/api/user/profile/route.ts
  • src/app/api/users/search/route.ts
  • src/app/book/layout.tsx
  • src/app/book/page.tsx
  • src/app/categories/[slug]/page.tsx
  • src/app/collection/page.tsx
  • src/app/discover/page.tsx
  • src/app/docs/self-hosting/page.tsx
  • src/app/feed/page.tsx
  • src/app/globals.css
  • src/app/guides/[id]/edit/page.tsx
  • src/app/guides/[id]/page.tsx
  • src/app/guides/new/page.tsx
  • src/app/guides/page.tsx
  • src/app/how_to_write_effective_prompts/page.tsx
  • src/app/layout.tsx
  • src/app/page.tsx
  • src/app/privacy/page.tsx
  • src/app/promptmasters/loading.tsx
  • src/app/prompts.csv/route.ts
  • src/app/prompts.json/route.ts
  • src/app/prompts/[id]/changes/[changeId]/page.tsx
  • src/app/prompts/[id]/changes/new/page.tsx
  • src/app/prompts/[id]/edit/page.tsx
  • src/app/prompts/[id]/opengraph-image.tsx
  • src/app/prompts/[id]/page.tsx
  • src/app/prompts/new/loading.tsx
  • src/app/prompts/new/page.tsx
  • src/app/prompts/page.tsx
  • src/app/robots.ts
  • src/app/sitemap.ts
  • src/app/skills/page.tsx
  • src/app/support/page.tsx
  • src/app/tags/[slug]/page.tsx
  • src/app/taste/page.tsx
  • src/app/terms/page.tsx
  • src/app/unauthorized/page.tsx
  • src/app/workflows/page.tsx
  • src/components/admin/categories-table.tsx
  • src/components/admin/delete-user-button.tsx
  • src/components/admin/prompts-management.tsx
  • src/components/admin/tags-table.tsx
  • src/components/admin/users-table.tsx
  • src/components/ads/ezoic-ad.tsx
  • src/components/ads/ezoic-placeholder.tsx
  • src/components/auth/auth-content.tsx
  • src/components/auth/oauth-button.tsx
  • src/components/auth/register-form.tsx
  • src/components/comments/comment-item.tsx
  • src/components/comments/comment-section.tsx
  • src/components/guides/guide-content.tsx
  • src/components/guides/guide-edit-form.tsx
  • src/components/guides/guide-form.tsx
  • src/components/kids/layout/background-music.tsx
  • src/components/layout/ezoic-ads.tsx
  • src/components/layout/footer.tsx
  • src/components/layout/header.tsx
  • src/components/mcp/mcp-config-tabs.tsx
  • src/components/promptmasters/promptmasters-content.tsx
  • src/components/prompts/add-example-dialog.tsx
  • src/components/prompts/admin-tag-badge.tsx
  • src/components/prompts/contributor-search.tsx
  • src/components/prompts/discover-tabs.tsx
  • src/components/prompts/discovery-prompts.tsx
  • src/components/prompts/download-prompt-dropdown.tsx
  • src/components/prompts/infinite-prompt-list.tsx
  • src/components/prompts/interactive-prompt-content.tsx
  • src/components/prompts/iterate-button.tsx
  • src/components/prompts/markdown-preview.tsx
  • src/components/prompts/media-preview-with-examples.tsx
  • src/components/prompts/mode-toggle.tsx
  • src/components/prompts/prompt-card.tsx
  • src/components/prompts/prompt-filters.tsx
  • src/components/prompts/prompt-form.tsx
  • src/components/prompts/prompt-list.tsx
  • src/components/prompts/run-prompt-button.tsx
  • src/components/prompts/skill-editor.test.tsx
  • src/components/prompts/skill-editor.tsx
  • src/components/prompts/skills-filtered-list.tsx
  • src/components/prompts/user-examples-gallery.tsx
  • src/components/prompts/user-examples-section.tsx
  • src/components/prompts/widget-card.tsx
  • src/components/seo/structured-data.tsx
  • src/components/settings/profile-form.tsx
  • src/instrumentation-client.ts
  • src/lib/admin.ts
  • src/lib/ai/generate-hack-description.ts
  • src/lib/ai/github-models.ts
  • src/lib/auth/index.ts
  • src/lib/auth/provider-metadata.ts
  • src/lib/collections/content-hash.ts
  • src/lib/config/index.ts
  • src/lib/db-errors.ts
  • src/lib/ezoic.ts
  • src/lib/plugins/auth/github.ts
  • src/lib/plugins/auth/index.ts
  • src/lib/plugins/auth/oauth.ts
  • src/lib/plugins/auth/oidc.ts
  • src/lib/plugins/media-generators/fal.ts
  • src/lib/plugins/media-generators/wiro.ts
  • src/lib/plugins/widgets/coderabbit.ts
  • src/lib/plugins/widgets/ezoic.tsx
  • src/lib/plugins/widgets/index.ts
  • src/lib/plugins/widgets/types.ts
  • src/lib/prompt-access.ts
  • src/lib/prompt-votes.ts
  • src/lib/rate-limit.ts
  • src/lib/skill-files.ts
  • src/lib/urls.ts
  • src/middleware.ts
  • src/pages/api/mcp.ts
  • src/proxy.ts
  • tsconfig.json
  • ux-iteration-1-worklog.md
  • vercel.json
  • vitest.setup.ts

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

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.