* feat: redesign plugins page and skills list view
Redesigned the plugins page with a cleaner toolbar (pill search,
toggle filter buttons) and simplified card layout. Added a proper
table-style list view for skills with skill name, version, summary,
and author avatar columns. Also polished the sort dropdown with a
chevron indicator, added card shadows for better separation, and
tightened up the theme toggle and sign-in button.
* feat: add publisher org ownership
* feat: migrate legacy publisher handles to orgs
---------
Co-authored-by: Peter Steinberger <steipete@gmail.com>
- Rename /packages route to /plugins with /packages redirecting
- Nav links now say "Plugins" and point to /plugins
- Plugins page only shows code-plugin and bundle-plugin (no skills)
- "Official only" → "Verified only"; blue checkmark badge for verified publishers
- Compact card footer: "by author · v1.2.3" inline with verified badge
- Remove duplicate Skill/Skill tag bubbles
- Update tests to match new routes and behavior
- Enhanced AGENTS.md with clearer project structure and development commands.
- Updated CHANGELOG.md to reflect recent fixes and additions.
- Improved formatting in CONTRIBUTING.md for better readability.
- Adjusted package.json and configuration files for consistent command structure.
- Refined README.md and VISION.md for clarity and organization.
- Standardized code formatting in various TypeScript files for consistency.
These changes aim to enhance documentation clarity and maintainability across the repository.
When a publish-time backup and the cron backup push concurrently, the
second push fails with "not a fast forward" because the branch moved.
Split backupSkillToGitHub into two phases:
1. Create blobs (storage downloads) — done once
2. Fetch ref, build tree, commit, push — retried up to 3x on conflict
Same retry applied to deleteGitHubSkillBackup.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
The schema import in skills.ts (needed for getPage) transitively pulls
in authTables from @convex-dev/auth/server. All test files that import
from skills.ts need this export in their mock.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Instead of scanning 500+ rows of the sort index and filtering for
highlighted skills in JS (which fails when highlighted skills are
sparse among 25K+ rows), query the skillBadges table via by_kind_at
index to find highlighted skill IDs directly, then look up their
digests. Also simplifies the non-highlighted path to a single getPage
call since the multi-round loop was only needed for highlighted.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Remove the V3 fallback branch and useV4 parameter from
useSkillsBrowseModel since V4 is verified and the only path used.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- /skills browse page now uses listPublicPageV4 via useV4 flag
- Homepage popular skills section uses listPublicPageV4
- Remove /skillsv4 and /test-v4 temporary test routes
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
When V4 returns hasMore=true but nextCursor=null, the next load-more
call would pass cursor=null, triggering the replace branch instead of
append. Treat this edge case as 'done' to prevent silent list reset.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Root cause of V4 returning empty in production: `getPage()` ignores the
`indexFields` property at runtime and always calls `getIndexFields(table,
index, schema)`. Without `schema`, it threw "schema is required" silently.
Fixes:
- Pass `schema` instead of `indexFields` to `getPage()`
- Use `absoluteMaxRows` instead of `targetMaxRows` (ignored when
`endIndexKey` is provided)
- Remove unused `DIGEST_INDEX_FIELDS` constant
Staged release:
- Add `/skillsv4` route (same UI as `/skills` but using V4 backend)
- Add `/test-v4` debug page for raw V4 API testing
- Add `useV4` flag to `useSkillsBrowseModel` hook
- Keep `/skills` on V3 until V4 is verified in production
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Replace `import schema from './schema'` with inline DIGEST_INDEX_FIELDS
lookup, avoiding @convex-dev/auth/server transitive dependency in tests
- Gut V1 test to match gutted handler (single stub verification)
- Fix load-more test to use V4 response shape
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Replace V2 test suite with single stub verification (no DB reads)
- Update skills-index tests: paginationOpts → cursor/numItems,
isDone/continueCursor → hasMore/nextCursor
- Update default convexHttpMock to return V4 shape
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Remove sortToIndex and getTrendingEntries (only used by gutted V1)
- Remove unused leaderboard imports
- Rename shadowed 'v' parameter to 'val' in encode/decodeIndexKey
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Use tagged object encoding for undefined index key values instead of
plain string sentinel to avoid collisions
- Add try/catch in decodeIndexKey, treat malformed cursors as first page
- When highlightedOnly filters out all fetched rows, advance nextCursor
to last fetched position instead of returning null (prevents restart loop)
- Update V3 JSDoc to reflect its current role
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
getPage walks the entire index unless bounded. Without constraining
startIndexKey/endIndexKey to the equality prefix ([undefined] for base,
[undefined, false] for nonsuspicious), desc order returns soft-deleted
items first, producing empty pages.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Use convex-helpers getPage() instead of .paginate() so that page cursors
are derived from actual index field values. Two users requesting the same
page now produce identical query args, enabling shared query caching.
- Add listPublicPageV4 with IndexKey-based cursor encoding
- Gut listPublicPage (V1) and listPublicPageV2 to return empty results
- Keep listPublicPageV3 intact for any remaining subscribers
- Switch frontend browse model and homepage to V4
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Duplicate of listPublicPageV2 as a separate Convex function. Frontend
switched to V3 so any remaining V2 calls in the dashboard are from
stale browser tabs with old bundles.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Cast page item to Record to access latestVersion property that isn't
on the narrow return type.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Remove fallback expectations — pre-backfill rows without owner fields
are now skipped, and missing latestVersionSummary returns null instead
of fetching from skillVersions.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
listPublicPageV2 was calling buildPublicSkillEntries which fell back to
ctx.db.get() for owners and versions, adding skills/users/skillVersions
to the query's read set. Now that digest rows have owner fields and
latestVersionSummary backfilled, we can construct the full response from
skillSearchDigest alone — writes to other tables no longer bust the cache.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- search.test: expect users lookup NOT called when digest has owner data
- listPublicPageV2.test: expect by_nonsuspicious_* indexes when nonSuspiciousOnly
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- P2: When digestToOwnerInfo returns { owner: null } (deactivated/deleted
user), fall back to live users table lookup instead of dropping the skill
from results. Applies to hydrateResults, lexicalFallbackSkills, and
buildPublicSkillEntries.
- P1: If compound index returns zero results on the first page (isSuspicious
not yet backfilled), fall back to base index with JS filtering so the
homepage isn't empty during migration.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Encodes the patterns learned from bandwidth optimization so AI coding
assistants get them right from the start — digest owner fields over
users table reads, compound indexes over JS filtering, one-shot fetches
for public pages, change detection in triggers.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Three bandwidth fixes:
1. search.hydrateResults / lexicalFallbackSkills: use digestToOwnerInfo()
to resolve owner data from the digest instead of ctx.db.get(ownerUserId)
on the users table. Eliminates users from the read set for ~99% of
search calls (8+ GB in 72h).
2. skills.listPublicPageV2: use compound by_nonsuspicious_* indexes when
nonSuspiciousOnly is true, filtering isSuspicious at the DB level
instead of scanning and discarding in JS (30+ GB in 72h).
3. maintenance.backfillDigestIsSuspicious: targeted backfill that sets
isSuspicious on digest rows where it's undefined, using the digest's
own moderationFlags/moderationReason. Must run before compound indexes
take effect.
Deploy sequence:
1. Deploy functions
2. npx convex run maintenance:backfillDigestIsSuspicious --prod
3. Compound indexes work immediately for backfilled rows
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
* test(cli): add tests for install --force rm ordering
Add three tests to verify that --force install does not delete the local
skill directory before pre-download checks have passed:
- rm not called when skill is malware-blocked
- rm not called when API fetch fails (skill not found)
- rm called before download when all checks pass (happy path)
* fix(cli): move rm after checks in install --force
Previously, install --force deleted the local skill directory before
fetching metadata or running moderation checks. If any check failed
(skill deleted, malware-blocked, not found), the local copy was lost.
This is inconsistent with cmdUpdate, which already checks before
deleting. Move rm to after all checks pass, just before download.
This does not alter the meaning of --force; it narrows the window in
which data is removed before the command has confirmed the replacement
is viable.
* fix(cli): validate forced install version before rm
---------
Co-authored-by: Jonathan Deamer <202770+jonathandeamer@users.noreply.github.com>
- Replace usePaginatedQuery mocks with convexHttp.query mocks in
browse page tests
- Update load-more test to use convexHttp instead of loadMorePaginated
- Update backend tests to reflect new behavior: getOwnerInfo skips
db.get when digest has pre-resolved owner data
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
listPublicPageV2 is the #1 DB bandwidth consumer (31GB+ spikes) because
usePaginatedQuery creates reactive subscriptions. Any write to
skillSearchDigest invalidates all active subscribers simultaneously —
a thundering herd. This replaces reactive subscriptions with one-shot
ConvexHttpClient.query() calls on both the /skills browse page and the
home page, eliminating the reactive read set entirely.
Also short-circuits getOwnerInfo() to return pre-resolved owner data
from the digest before hitting ctx.db.get(ownerUserId), removing the
users table from the reactive read set for listPublicPageV2.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Prevents unhandled promise rejections on transient network/backend
failures. Empty state is an acceptable fallback for the home page.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
The home page used useQuery for highlighted and popular skills, creating
live reactive subscriptions that re-executed on every skillSearchDigest
write (crons, triggers). Since the home page doesn't need live updates,
switch to one-shot convex.query() fetches on mount to eliminate unnecessary
reactive invalidation.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Existing skillSearchDigest rows created before the latestVersionSummary
denormalization lack the field, causing listPublicPageV2 to fall back to
reading full skillVersions docs (~6KB each, 14MB per call).
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
The by_active_updated index orders by updatedAt which is mutable —
rows can shift during a paginated scan causing double-counting or
skipping. Default _creationTime ordering is immutable and stable.
isPublicSkillDoc already filters softDeletedAt in JS.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
The skills trigger unconditionally wrote to skillSearchDigest on every skill
mutation, even when only stat fields were updated with identical values.
This caused every cron that patches skills (stat sync, backfill) to invalidate
all active listPublicPageV2 subscriptions, triggering massive re-execution
storms (55 GB bandwidth spikes).
Now upsertSkillSearchDigest compares new fields against the existing row and
skips the write when nothing changed. This prevents unnecessary reactive
invalidation while still keeping the digest current for real changes.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
The daily updateGlobalStatsInternal cron read all ~19K skillSearchDigest docs
(17.8 MB) in a single mutation, exceeding the Convex bytes-read limit.
Switch to an action-based approach that pages through the table in ~1000-doc
queries (each ~900 KB), then writes the result in a separate mutation.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Add delayMs param, stop flag via skillStatBackfillState, and status
query so backfill speed can be adjusted without redeploying.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
digestToOwnerInfo now checks for profile data (name/displayName/image)
in addition to handle when deciding whether to return an owner object.
Handle-less visible users get their full profile; deactivated users
(no handle AND no profile data) correctly get owner: null.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Write ownerHandle: '' (not undefined) for visible users without a
handle and for deactivated users, so digestToOwnerInfo can distinguish
"not backfilled" (undefined → fallback to DB) from "backfilled but
no handle" ('' → use userId fallback, skip DB read).
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Prevent baking deactivated/deleted user info into the digest.
The trigger and backfill now write undefined for owner fields
when the owner is not visible, matching the live query path.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
listPublicPageV2 (419 GB) and search.hydrateResults (1.76 TB) both read
full users docs for every unique owner. Denormalize ownerHandle, ownerName,
ownerDisplayName, ownerImage into the digest so query paths skip ctx.db.get
entirely. One extra read per skill mutation (rare) vs eliminating reads on
every query (very frequent).
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Use the public user serializer for `skills.getBySlug` so Convex query responses no longer expose private account metadata like email addresses from public endpoints.
Made-with: Cursor
Verifies that old digest rows without latestVersionSummary correctly
fall back to ctx.db.get(latestVersionId) for version data.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Eliminates ~9MB of skillVersions reads per listPublicPageV2 call by
copying latestVersionSummary from skills into the digest via the
existing trigger. Old rows without the field fall back to fetching
the full version doc.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
* fix: allow ownership healing when previous owner is deleted/banned
The GitHub identity check in `publishOrUpdateSkillInternal` and
`checkSlugAvailability` was unreachable when the skill owner's account
was deleted or deactivated. This created a permanent deadlock: the
original owner could not sign in, and no one (not even the same GitHub
user with a new Convex Auth record) could reclaim the slug.
Move the `canHealSkillOwnershipByGitHubProviderAccountId` check before
the deleted/deactivated early-exit so ownership healing still works for
duplicate Convex Auth user records where the old record was later banned.
When healing is not possible (different GitHub identity or missing
auth records), show a message directing the user to contact
security@openclaw.ai instead of a generic "Slug is already taken".
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* chore: drop unused skills sort index map
---------
Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-authored-by: Nimrod Gutman <nimrod.gutman@gmail.com>
* fix: surface auth errors from OAuth callback to the UI
When `afterUserCreatedOrUpdated` throws a `ConvexError` (e.g. banned or
deleted account), the error was silently discarded — the user was
redirected back to the sign-in page with no feedback.
Parse the error from the OAuth callback URL hash fragment in the
`ConvexAuthProvider` `replaceURL` callback and expose it via a
lightweight `useAuthError` hook (backed by `useSyncExternalStore`).
Display the error next to the sign-in button in both Header and the
CLI auth page, and add `.catch()` to `signIn()` calls to avoid
unhandled promise rejections.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* fix(auth): handle oauth callback sign-in errors
---------
Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-authored-by: Nimrod Gutman <nimrod.gutman@gmail.com>
Most skillSearchDigest rows have isSuspicious: undefined (not false),
so eq('isSuspicious', false) returns zero results. Revert to regular
indexes with JS filtering until the field is backfilled.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Add by_nonsuspicious_* indexes to skillSearchDigest (matching the
existing ones on the skills table) so nonSuspiciousOnly filtering
happens at the index level instead of in JS. This eliminates empty
filtered pages without needing a multi-paginate loop.
TODO: once deployed and stable, remove the duplicate by_nonsuspicious_*
indexes from the skills table (no longer queried by listPublicPageV2).
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Convex only allows a single .paginate() call per query function.
The while loop that skipped empty filtered pages violated this
constraint, causing "ran multiple paginated queries" errors on prod.
Remove the loop — clients will handle empty filtered pages by
requesting the next page via continueCursor.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
The rebuildTrendingLeaderboardInternal mutation queries ~31,500
skillDailyStats docs (7 days × ~4,500/day) in a single transaction,
hitting Convex's 32K document read limit on prod (71 errors/72h).
Split into action → query → mutation pattern so each day's query runs
in its own transaction with its own 32K budget:
- getDailyStats (internalQuery): reads one day's stats
- writeTrendingLeaderboard (internalMutation): writes leaderboard + prunes
- rebuildTrendingLeaderboardAction (internalAction): orchestrates the above
The old single-mutation path is kept as a fallback.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Problem:
Skills using legitimate API integrations (process.env + fetch) were
permanently flagged as malicious due to CREDENTIAL_HARVEST being
classified as a malicious-level reason code. Once flagged, skills could
not recover to normal status even after clean VT and OpenClaw scans,
because:
1. syncModerationReasons used a partial-update path that only patched
moderationReason without reconciling moderationFlags, moderationStatus,
or moderationVerdict.
2. Static scan "you are now a/an" regex over-matched common skill
preambles, adding spurious INJECTION_INSTRUCTIONS flags.
3. No mechanism existed for external scanner results (VT/LLM) to
override static suspicious findings when both independently
confirmed the skill as safe.
Solution:
- Downgrade CREDENTIAL_HARVEST from malicious.env_harvesting to
suspicious.env_credential_access — env+network is suspicious, not
malicious, for API integration skills (moderationReasonCodes.ts).
- Remove "you are now a/an" regex from markdown scanning to stop
false INJECTION_INSTRUCTIONS flags (moderationEngine.ts).
- Add external scanner override in buildModerationSnapshot: when both
VT and LLM report clean/benign, demote suspicious.* static codes
from verdict calculation while preserving malicious.* codes and
keeping all findings in evidence for transparency (moderationEngine.ts).
- Route syncModerationReasons through approveSkillByHashInternal for
rows with sha256hash, ensuring full moderation state reconciliation.
For legacy no-hash rows: malicious → escalateSkillByIdInternal
(immediate hide); clean/suspicious → updateSkillModerationReasonInternal
(partial fix, matches pre-existing behavior) (vt.ts, skills.ts).
- Add escalateSkillByIdInternal mutation for atomic emergency
escalation by skillId (sets moderationReason, moderationFlags,
moderationStatus, hiddenAt, isSuspicious) (skills.ts).
- Ensure approveSkillByHashInternal explicitly hides malicious skills
by setting moderationStatus to 'hidden' (skills.ts).
- Bump MODERATION_ENGINE_VERSION to v2.1.0.
Frontend:
- Add StaticAnalysisDetail component to display static scan findings
with severity-aware styling (SkillSecurityScanResults.tsx).
- getStaticGuidance now accepts vtStatus/llmStatus and shows "Confirmed
safe by external scanners" (benign/green) when both are clean, instead
of always showing yellow "Patterns worth reviewing" for critical
severity findings.
- Render SecurityScanResults and disclaimer when only static findings
are present (SkillHeader.tsx).
Testing:
- 7 new unit tests in moderationEngine.test.ts covering:
- CREDENTIAL_HARVEST downgrade (suspicious, not malicious)
- "you are now" no longer flagged in markdown
- "ignore previous instructions" still flagged
- buildModerationSnapshot: VT+LLM clean demotes suspicious codes
- buildModerationSnapshot: malicious codes preserved despite clean VT+LLM
- Single-scanner-clean does not demote suspicious codes
- VT suspicious + LLM clean does not demote suspicious codes
- All existing tests pass with engine version bump to v2.1.0.
Follow-up needed (not in this commit):
- One-time backfill for already-misflagged skills (cursor-based,
re-run approveSkillByHashInternal on isSuspicious=true + clean VT).
Made-with: Cursor
Both functions were hitting Bytes Read Limit errors scanning the full
skills table (~1.9KB/doc × 9K docs ≈ 17MB). Switch to the lightweight
skillSearchDigest table (~800 bytes/row) which carries all fields
needed by toPublicSkill/isPublicSkillDoc/isSkillSuspicious.
- Add 5 sort indexes to skillSearchDigest matching the ones used by
SORT_INDEXES (by_active_created, by_active_name, by_active_stats_*)
- listPublicPageV2: query skillSearchDigest, map via digestToHydratableSkill
- countPublicSkillsForGlobalStats: query skillSearchDigest
- Widen buildPublicSkillEntries/filterPublicSkillPage to HydratableSkill[]
- Guard latestVersionSummary access (digest rows don't carry it)
- Update test mocks to expect skillSearchDigest table
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Switches the 500-row lexicalFallbackSkills scan from full skill docs
(~3-5KB each) to lightweight digest rows (~800 bytes each), reducing
DB read bandwidth by ~75%.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Build the seen-ID set from vector results rather than only successful
hydrations, so soft-deleted and suspicious embeddings aren't re-hydrated
on each candidate-limit expansion loop iteration.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Replace ~28 manual syncSkillSearchDigest/upsertSkillSearchDigest calls
across 4 files with a single Triggers handler in convex/functions.ts
that fires automatically on every skills table write. This eliminates
the risk of new mutations silently breaking digest consistency.
- Add convex-helpers as direct dependency
- Create convex/functions.ts wrapping mutation/internalMutation with triggers
- Update all 39 convex modules to import from ./functions
- Remove syncSkillSearchDigest from lib (no longer needed)
- Add normalizeId mock to test db objects for trigger wrapper compat
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Add syncSkillSearchDigest calls to 6 maintenance mutations that patch
digest-relevant fields without syncing (applyEmptySkillCleanup,
applySkillBadgeBackfillPatch, upsertSkillBadgeRecord,
backfillDenormalizedBadges, backfillIsSuspicious, applySkillBackfillPatch)
- Replace unsafe `as unknown as Doc<'skills'>` cast with typed
HydratableSkill interface and digestToHydratableSkill mapper — compiler
now catches field drift between digest and skill doc
- DRY up extractDigestFields/digestToHydratableSkill with shared
SHARED_KEYS array and pick() helper
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
When a skill is hard-deleted, syncSkillSearchDigest now removes the
corresponding digest row instead of silently no-oping. Also adds
skillSearchDigest table handling to reclaim test mock.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
DRY up duplicated validator definitions (forkOf, badges, stats, moderationStatus)
into shared constants reused by both tables to prevent schema drift.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
hydrateResults reads full skill docs (~3-5KB each) but only needs ~800
bytes for toPublicSkill/isPublicSkillDoc/isSkillSuspicious. Add a
lightweight skillSearchDigest projection table that is kept in sync by
all skill mutation paths.
Also fix the searchSkills while loop to incrementally hydrate only new
embedding IDs on each expansion instead of re-hydrating all candidates
from scratch (475 → 250 reads per search).
Expected impact: ~7x bandwidth reduction for hydrateResults
(495 GB → ~70 GB at current traffic).
Post-deploy: npx convex run maintenance:backfillSkillSearchDigestInternal --prod
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
The static OG image still said "ClawdHub" and "clawdhub.com" — regenerated
from the already-correct og.svg source.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Add missing sha256 field to file mocks in moderation.test.ts
- Accept softDeletedAt param in makeSkillDoc in search.test.ts
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
When both filters are active, use the nonsuspicious index for isSuspicious
and apply highlightedOnly as a JS filter on top, instead of scanning the
full table with both filters in JS.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Restore the NONSUSPICIOUS_SORT_INDEXES map and index branching logic that
was lost during the PR #572 merge. When nonSuspiciousOnly is set, queries
now use by_nonsuspicious_* indexes with isSuspicious=false in the predicate
instead of scanning the full table and filtering in JS — eliminating
bytesReadLimit errors under load.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
The --limit flag under the 'explore' command's Flags section was
missing the proper two-space indentation, making it inconsistent
with other flag lists in the document.
- Add Node.js v18/20/22/24 prerequisite (Convex backend rejects v25+)
- Remove duplicate CONVEX_SITE_URL from .env.local example
- Reorder steps so Convex backend starts before auth/JWT setup
- Add "Set backend environment variables" section (bunx convex env set)
- Clarify that AUTH_GITHUB_ID/SECRET and SITE_URL must be set on the
Convex backend, not just in .env.local
- Make frontend port explicit (bun run dev -- --port 3000)
- Add updateGlobalStatsInternal step after seeding
The nonsuspicious index fallback now fires on any page (not just the
first) and reuses the client's cursor via stale-cursor recovery. This
prevents pagination from breaking when a SORT_INDEXES cursor is sent
back to the NONSUSPICIOUS_SORT_INDEXES path on page 2+.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Fix P1: remove !result.isDone guard from listPublicPageV2 backfill
fallback so it fires when the nonsuspicious index is empty (isDone=true)
- Fix updateTags to update latestVersionSummary when repointing latest tag
- Parallelize leaderboard daily queries with Promise.all
- Over-fetch stale-reason candidates (2x limit) before VT filtering
- Reconcile existing latestVersionSummary in backfill instead of skipping
- Add _creationTime approximation comment
- Rebuild schema dist to include author field on ClawdisSkillMetadata
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
The explicit ClawdisSkillMetadata interface (needed because ArkType's
[inferred] doesn't resolve all fields) now has a keyof-based type guard
that triggers a compile error if the interface keys drift from the schema.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Replace ArkType `[inferred]` type alias for ClawdisSkillMetadata with
an explicit interface so TS can see envVars/dependencies/author/links
- Extract listBySkillHandler from comments.ts so tests can call it
directly without accessing private _handler property
- Rebuild packages/schema dist output
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Phase 1: Add `by_moderation` compound index and rewrite 8 cron query
functions to use `.withIndex()` instead of `.filter().collect()` full
table scans (~6 GB/day saved).
Phase 2: Denormalize `isSuspicious` onto skills table with 6 compound
indexes so `listPublicPageV2` can filter at the index level instead of
paginating the entire table (~1 TB/day saved). Includes backfill
mutation and write-path updates across all moderation mutations.
Phase 3: Add `latestVersionSummary` denormalization to avoid reading
full ~6.4 KB `skillVersions` docs on list pages (~500 GB/day saved).
Phase 4: Split trending leaderboard query to one day at a time to stay
under 32K doc limit. Reduce global stats recount from hourly to daily
since delta tracking handles real-time accuracy (~400 MB/day saved).
Phase 5: Add "Convex Query & Bandwidth Rules" section to AGENTS.md.
Backfill commands (run after deploy):
bunx convex run maintenance:backfillIsSuspiciousInternal
bunx convex run maintenance:backfillLatestVersionSummaryInternal
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Fixes#209 by removing overly broad regex patterns that flag legitimate
authentication and payment integration skills.
## Problem
Skills like openbotauth (OAuth identity verification) were being flagged
as suspicious because they mention "token", "api key", or "password" in
their description or metadata. The regex scanner was too aggressive,
catching legitimate auth flows alongside actual threats.
## Solution
Removed three overly broad patterns:
- `suspicious.secrets` - flagged ANY mention of token/api key/password
- `suspicious.crypto` - flagged ANY mention of wallet/seed phrase/crypto
These are common in legitimate skills:
- OAuth skills mention "token" for authentication flows
- API integrations mention "api key" for service credentials
- Database skills mention "password" for connections
- Crypto wallet skills mention "seed phrase" for key management
The LLM evaluator already handles credential proportionality analysis
(section 4 of security prompt). The regex scan should only catch
ACTUAL malicious patterns, not keywords that appear in legitimate contexts.
## What Still Gets Flagged
Kept patterns that catch real threats:
- `suspicious.keyword` - malware, stealer, phishing, keylogger
- `suspicious.webhook` - discord/slack webhooks (data exfiltration)
- `suspicious.script` - curl | bash (arbitrary code execution)
- `suspicious.url_shortener` - bit.ly etc (URL obfuscation)
## Testing
- Added 18 comprehensive tests for pattern detection
- Verified OAuth skills (openbotauth, trello) are NOT flagged
- Verified malicious patterns ARE still flagged
- All 418 existing tests pass
## Security Impact
This does NOT weaken security:
- LLM evaluator still analyzes credential proportionality
- Actual malicious patterns (webhooks, curl|bash, etc) still caught
- Only removes false positives on legitimate auth keywords
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
onQueryChange called navigate() on every keystroke to sync the query
to the URL. Each navigate triggers history.replaceState, TanStack
Router re-evaluation, and useSearch() invalidation, causing multiple
re-renders per keystroke.
Keep setQuery() immediate so the controlled input stays responsive,
but debounce the navigate() call at 220 ms (matching the existing
search-action debounce). Cancel the pending timer when search.q
changes externally (browser back/forward) to prevent the debounced
navigate from overwriting the external URL change.
Made-with: Cursor
Replace the useEffect + useRef approach for setting webkitdirectory/
directory attributes with a ref callback that sets the attributes
every time the input element is mounted. This ensures folder selection
mode persists after page refresh, where React hydration could strip
the non-standard attributes.
Also removes the @ts-expect-error JSX props since the attributes are
now set imperatively via the ref callback.
When VirusTotal returns scan results with AV engine stats but no Code Insight
AI analysis, the skill status was stuck on 'Pending'. This fix adds fallback
logic to check last_analysis_stats (malicious/suspicious/harmless/undetected)
to determine scan status.
Functions updated:
- pollPendingScans: Check AV engines before requesting rescan
- backfillPendingScans: Check AV engines before marking as no results
- rescanActiveSkills: Check AV engines before keeping as pending
- backfillActiveSkillsVTCache: Check AV engines before skipping
Fixes#33435
- Increase upload timeout from 15s to 120s for multipart form uploads
(apiRequestForm and curl-based form upload). Regular API requests
remain at 15s.
- Improve timeout error message from bare "Timeout" to
"Request timed out after Ns" so users know what happened.
- Normalize non-Error throws (e.g. DOMException from AbortController
across runtimes) into proper Error instances, preventing the
misleading "Non-error was thrown" message from p-retry.
- Preserve the original error as `cause` on the wrapped Error.
cmdSearch and cmdExplore were not calling getOptionalAuthToken()
and did not pass the token to apiRequest, unlike install/update/uninstall.
This caused 'missing API token' errors on registries that require auth
(e.g. private Hermit instances).
parseFrontmatterLevelDeclarations did not handle the requires block
(env, bins, anyBins, config) or primaryEnv when declared at the
top level of SKILL.md frontmatter without a metadata.openclaw wrapper.
This caused the security scanner to always show "Required env vars: none"
for skills using that format, triggering false-positive suspicious flags.
Also extends the evalCtx.homepage fallback chain to check
clawdis.homepage and clawdis.links.homepage so skills declaring
homepage inside the metadata block are picked up by the scanner.
* feat(registry): support env vars, dependencies, author, and links in skill manifest
Closes#350
Add structured declarations for environment variables, package
dependencies, author identity, and project links to the skill
registry manifest. These fields can be declared in the clawdis
metadata block or as top-level frontmatter keys.
Changes:
- schema: add EnvVarDeclaration, DependencyDeclaration, SkillLinks
types to ClawdisSkillMetadata
- parser: extract envVars, dependencies, author, links from both
clawdis block and top-level frontmatter (fallback for skills
without a clawdis block)
- UI: render env vars with required/optional badges and descriptions,
dependencies with type/version/links, and project links in the
skill detail page install card
- security: update evaluator prompt to recognize envVars alongside
requires.env and primaryEnv
- tests: 7 new test cases covering all declaration formats
* fix(ui): handle unspecified env required state and stable keys
* docs(changelog): credit metadata manifest expansion (#360) (thanks @mahsumaktas)
---------
Co-authored-by: Peter Steinberger <steipete@gmail.com>
* feat(api): expose security evaluation results
- Add security field to skill version API responses
- Map llmAnalysis database field to public API format
- Display security info in CLI inspect command
- Enable security tools like clawsec-clawhub-checker to access internal security checks
Security field includes:
- status: clean|suspicious|malicious|pending|error
- hasWarnings: boolean
- checkedAt: timestamp
- model: evaluation model name
Backward compatible: optional field, no breaking changes.
* fix: ensure hasWarnings is always boolean
- Add ?? false to coerce undefined to false when dimensions is undefined
- Fixes Greptile comment: hasWarnings can be undefined instead of boolean
- Ensures SecurityStatusSchema validation passes on client side
* Update convex/httpApiV1/skillsV1.ts
Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com>
* fix(api-cli): harden security inspect output + tests (#362) (thanks @abutbul)
---------
Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com>
Co-authored-by: Peter Steinberger <steipete@gmail.com>
* fix(cli): handle missing browser opener gracefully
On headless Linux servers without xdg-open, 'clawhub login' crashes with
ENOENT error. This change catches the error and prints the URL for manual
copy-paste instead of crashing.
Fixes crash on:
- VPS/cloud servers
- Docker containers
- CI environments
- WSL without browser integration
* fix(cli): test browser-opener fallback messaging (#163) (thanks @aronchick)
---------
Co-authored-by: Peter Steinberger <steipete@gmail.com>
* feat: surface platform/architecture labels on skill cards and API
Expose existing `os` and `nix.systems` metadata from skill frontmatter
through the HTTP API and render as compact tags on browse/search views.
- Widen `PublicSkillListVersion` and `SkillListEntry` types to include
`os` and `nix.systems` fields (data already flows through, types were
artificially narrow)
- Add `metadata: { os, systems }` to `/api/v1/skills/{slug}` and
`/api/v1/skills` list responses
- Add `formatSystemsList` and `getPlatformLabels` helpers to map nix
system strings to human-readable labels (e.g. aarch64-darwin → macOS ARM64)
- Add `platformLabels` prop to `SkillCard`, render as `.tag .tag-compact`
- Show platform labels in both card grid and list views
- Update HTTP API docs with new `metadata` field
Coded by Claude Opus 4.6 (Claude Code)
Reviewed and tested by Jason (@asyncjason)
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
* fix: remove redundant optional chaining on clawdis
Address greptile-apps review comment — clawdis is already confirmed
truthy by the ternary condition, so `?.` is unnecessary.
Coded by Claude Opus 4.6 (Claude Code)
Reviewed and tested by Jason (@asyncjason)
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
* fix: include version data in listPublicPageV2 for platform labels
The browse listing passed includeVersion: false, causing latestVersion
to always be null and platform/arch labels to never render.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
---------
Co-authored-by: Jason Separovic <jason@wilma.dog>
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
* docs: add CONTRIBUTING.md and refresh README header
Add a comprehensive CONTRIBUTING.md covering local Convex setup,
env var configuration, GitHub OAuth, JWT keys, database seeding,
CLI development, PR guidelines, and AI-generated code policy.
Refresh the README with a centered logo, quick links row, and
clickable doc references. Condense the Local dev section to link
to CONTRIBUTING.md for full setup details.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
* fix: add #clawhub discord channel
---------
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
* fix: prevent filtered skills pagination flicker
Skip fully filtered-out pages in public skills pagination so highlighted/non-suspicious filtering doesn't return empty pages with more cursor state, which caused repeated loading-more flicker.
Co-authored-by: Cursor <cursoragent@cursor.com>
* fix: rely on inferred Convex paginate result type
Remove the custom runPaginate annotation so TypeScript infers the exact Convex paginate result shape and preserves stronger type-safety.
Co-authored-by: Cursor <cursoragent@cursor.com>
---------
Co-authored-by: Cursor <cursoragent@cursor.com>
Retry-After was set to an absolute Unix epoch timestamp (e.g. 1771404540),
which violates RFC 9110 §10.2.3. Clients treating it as delay-seconds
would wait ~56 years. Now emits the actual seconds until reset.
Closes#407
Address review feedback:
- Use undici's EnvHttpProxyAgent instead of ProxyAgent. This properly
handles HTTPS_PROXY vs HTTP_PROXY per-scheme, respects NO_PROXY,
and uses connect.timeout instead of requestTls.
- Update docs to mention NO_PROXY support.
The CLI creates a custom undici Agent via setGlobalDispatcher() which
overrides any proxy configuration. Since Node.js native fetch (backed
by undici) does not automatically respect HTTP_PROXY/HTTPS_PROXY env
vars, the CLI fails with 'fetch failed' on systems that require a
proxy for outbound connections.
Import ProxyAgent from undici and use it when any of the standard proxy
environment variables (HTTPS_PROXY, HTTP_PROXY, https_proxy, http_proxy)
is set. When no proxy variable is present, behavior is unchanged.
Also adds proxy documentation to cli.md and a troubleshooting entry.
Address review feedback:
- Guard rescan de-escalation with `status === 'clean'` so pending/unknown
verdicts don't accidentally clear the suspicious flag
- Fix approveSkillByHashInternal where `alreadyFlagged` in the condition
`(isSuspicious || alreadyFlagged) && !bypassSuspicious` prevented clean
verdicts from reaching the isClean branch that properly checks whether
a different scanner set the flag
The daily VT rescan updated vtAnalysis on the version but only called
escalateByVtInternal for suspicious/malicious verdicts. When a verdict
improved from suspicious to clean, the version's vtAnalysis was updated
(website shows "Benign") but the skill's moderationFlags kept the stale
"flagged.suspicious" entry (CLI warns "suspicious"). Now the rescan
calls approveSkillByHashInternal to clear the flag on de-escalation.
Avoids leaving an explicit undefined key in the badges object which
could fail Convex validation.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Add backfillDenormalizedBadgesInternal: syncs skillBadges table →
skill.badges field so listing/search reads are correct
- Simplify hydrateResults fallback
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Remove badge table queries from listing and search paths (~200 queries
per page load eliminated). Use denormalized skill.badges field instead.
- Sync skill.badges when badges are mutated (upsertSkillBadge/removeSkillBadge).
- Add embeddingSkillMap lookup table (~100 bytes/doc) so search hydration
can skip reading full skillEmbeddings docs (~12KB each with vector).
- Remove dead badge query exports from search module.
- Reduce lexical fallback scan limit from 1200 to 500.
- Add backfill mutation for embeddingSkillMap with graceful fallback.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Skills should never have more than a handful of badge records.
Using .take(10) instead of .collect() avoids unbounded reads.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
The 5-minute stat event processor was patching skill documents on every run,
which invalidated listPublicPageV2 reactive queries for ALL subscribers —
causing a thundering herd responsible for ~17 TB (59%) of the 28.65 TB
monthly db bandwidth.
Split into two paths:
- Daily stats (15-min cron): writes to skillDailyStats only, no skill doc patches
- Skill doc sync (6-hour cron): patches skill documents with accumulated deltas
Also skip reading version docs in listPublicPageV2 and search hydration
(version data is only needed on detail pages, not listings).
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Prevent activating skills with quality.low moderation reason
- Add skill lookup and moderationReason check in 3 locations where skills are activated
- This ensures quality gate quarantine is not bypassed when VT scan is unavailable or stale
Resolves review comments on #300
Published skills stay permanently hidden in search when VirusTotal
cannot produce a verdict. Three code paths leave moderationStatus as
'hidden' with no recovery:
1. VT_API_KEY not configured — scan skipped, skill stays hidden
2. VT hash not found after 10 poll attempts — marked stale, stays hidden
3. VT hash found but no Code Insight after 10 attempts — same
Fix: call setSkillModerationStatusActiveInternal in all three paths so
the skill becomes searchable. If VT later returns a malicious verdict,
approveSkillByHashInternal will correctly re-hide and flag it.
Closes#139
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Show 'Loading skills…' instead of 'No skills match' when pagination is not exhausted
- Hide 'Scroll to load more' when results are empty
- Add tests for both cases
* fix: return proper HTTP status codes for delete/undelete errors
The delete and undelete handlers for skills and souls were catching all
errors and returning 401 Unauthorized, even for errors like:
- 'Skill not found' (should be 404)
- 'Forbidden' (should be 403)
- Other validation errors (should be 400)
This change updates the error handling to return appropriate status codes:
- 401 Unauthorized: authentication failures
- 403 Forbidden: authorization failures (not owner/admin/moderator)
- 404 Not Found: skill/soul/user not found
- 400 Bad Request: other errors with descriptive message
Fixes#34
* fix(cli): use proper Error objects in abort timeouts
When AbortController.abort() receives a string instead of an Error,
the string itself is thrown. pRetry then wraps it in a confusing
message: 'Non-error was thrown: Timeout'
Changed all 3 occurrences in http.ts:
- apiRequest (line 57)
- apiRequestForm (line 106)
- downloadZip (line 141)
Now timeouts will surface as proper Error objects with clear messages.
* test: add e2e test for delete error handling
Verifies that deleting a non-existent skill returns a proper 'not found'
error instead of a generic 'Unauthorized' message.
* fix: use Error for timeout abort in e2e helper
* feat: add skill file viewer
* fix: prevent file viewer state updates after unmount
* feat: add ban reasons to moderation
* chore: release 0.6.0
* docs: reset changelog for next release
* feat: add LLM security evaluation at publish time
Add OpenClaw LLM-based security evaluator that runs alongside VirusTotal
when skills are published. Reads SKILL.md prose, metadata, install specs,
and file manifest, then assesses coherence across 5 dimensions to catch
social engineering vectors that VT/regex miss (e.g. instruction-only skills
with no code files).
- convex/lib/securityPrompt.ts: system prompt, message assembly, response
parsing, injection pattern detection
- convex/llmEval.ts: evaluateWithLlm action, evaluateBySlug convenience
action, backfillLlmEval for existing skills
- convex/schema.ts: llmAnalysis field on skillVersions
- convex/skills.ts: updateVersionLlmAnalysisInternal mutation,
getActiveSkillBatchForLlmBackfillInternal query, defense-in-depth
multi-scanner flag merging in approveSkillByHashInternal
- convex/lib/skillPublish.ts: schedule LLM eval alongside VT scan
- SkillDetailPage.tsx: OpenClaw row, LlmAnalysisDetail expandable
component with 5 dimension rows, guidance panel, findings section
- styles.css: analysis detail styles from mockup
* fix: collapse OpenClaw analysis by default, fix row spacing, switch to gpt-5-mini
* fix: add retry with backoff for OpenAI rate limits, fix JSON mode requirement
* fix: increase max_output_tokens for reasoning model, fix backfill error retry
* feat: recognize metadata.openclaw as valid frontmatter namespace
* fix: eval assembler falls back to metadata.openclaw for requirements
* feat: evaluator reads all file contents, not just SKILL.md
Reads all files from storage and includes their full source in the eval
prompt so the LLM can detect malicious code hidden behind clean READMEs.
Injection detection now scans all content. Per-file cap 10K chars, total
cap 50K chars.
* feat: add skill metadata docs, suspicious appeal banner for owners
- Document full frontmatter metadata reference in docs/skill-format.md
- Add metadata section + quick example to README
- Show appeal message on suspicious skills (owner-only) linking to GitHub issues
- Accept metadata.openclaw alias in README docs
- Re-evaluate all skills with full file content reading (backfill in progress)
* fix: trailing comma tolerance in JSON metadata, tone down persistence flags
- Strip trailing commas in frontmatter JSON before parsing (silent failure fix)
- Stop flagging disable-model-invocation default as a concern (it's the normal default)
- Stop flagging skills configuring themselves as privilege escalation
- Add MITRE ATLAS AML.T0051 context for when autonomous invocation actually matters
- Show actual defaults in assembled eval message instead of "not set"
* chore: fix lint issues (#213)
* perf: lazy-load diff viewer (Monaco) (#212)
* chore: fix review comments
* fix: VT scan sync race condition + LLM-first moderation model
VT no longer overwrites LLM moderation verdicts. LLM is the primary
moderation authority; VT only escalates (hides + flags) for malicious/
suspicious content via new escalateByVtInternal mutation. Stale VT polls
write vtAnalysis marker instead of overwriting moderationReason. Query
pools expanded to include LLM-evaluated skills awaiting VT results.
Ban message now references malicious skills and security@openclaw.ai.
* fix: handle GitHub API rate limits in account age check (#246)
* fix: handle GitHub API rate limits in account age check
The GitHub account lookup uses unauthenticated requests (60 req/hr
per IP). Since this runs server-side in Convex, all users share the
same IP and quickly exhaust the rate limit, causing "GitHub account
lookup failed" errors during skill publish.
- Detect 403/429 responses and surface a clear rate-limit message
- Support optional GITHUB_TOKEN env var for authenticated requests
(5,000 req/hr)
Fixes#155
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
* fix: stabilize GitHub account gate tests and docs
---------
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
Co-authored-by: Peter Steinberger <steipete@gmail.com>
* docs: thank @superlowburn for PR #246
* fix: prioritize relevant skills in search
* fix: add lexical fallback for skill search recall
* test: add search fallback coverage
* test: fix search test handler typing
* fix(http): remove allowH2 from undici Agent — causes fetch failed on Node.js 22+ (#245)
* Remove allowH2 option from global dispatcher
fix/remove-allowH2-undici-node22-compat
* fix(http): remove allowH2 from e2e dispatcher
---------
Co-authored-by: Peter Steinberger <steipete@gmail.com>
* docs: add 0.6.1 unreleased changelog from post-0.6.0 commits
* fix: allow soft-deleted users to re-authenticate
Fixes Issue #32 where users who soft-deleted their accounts were unable to sign back in because the re-auth logic was only triggering when an existingUserId was passed by the auth provider, which doesn't happen during a standard fresh login flow.
* test: update auth tests for direct deletedAt check
* fix: restore existingUserId check for type safety
* fix: update tests to include required existingUserId parameter
* fix: resolve final lint error in auth tests
* fix: ensure reactivation only matches soft-deleted user (prevents bypass)
* fix: allow re-auth when existingUserId is null
* fix: use valid crons.interval and set to 1 minute
* test: add missing coverage for fresh-login reactivation and identity mismatch guard
* fix: scope reauth fix; keep banned users blocked (#177) (thanks @tanujbhaud)
* fix: include comment deltas in action-based stat processing & add stats reconciliation (#194)
Bug 1: applyAggregatedStatsAndUpdateCursor was missing 'comments' in both
the guard condition and the applySkillStatDeltas call. This caused comment
count deltas to be silently dropped during cron-based event processing,
while stars/downloads/installs were processed correctly.
Bug 2: No reconciliation mechanism existed. If events were missed due to
cursor issues or processing errors, skill stats (stars, comments) would
remain stale with no way to recover. Added reconcileSkillStarCounts
maintenance mutation that counts actual records in the stars and comments
tables and patches any out-of-sync skill stats.
Fixes#193
Co-authored-by: Limitless2023 <limitless@users.noreply.github.com>
* fix: prevent horizontal overflow from long code blocks in skill pages (#183)
* Fix: Prevent horizontal overflow from long code blocks in skill pages
- Add max-width: 100% to .file-list-body and .file-row
- Prevents page-wide overflow when skills contain long code examples
- Markdown pre blocks already have overflow-x: auto, but parent containers were expanding infinitely
- Fixes issue where skills with 400+ char lines (e.g. browser automation commands) cause horizontal scrolling
Affected: Skills with long inline code in markdown (browser act commands, etc.)
* fix: add max-width to .file-list container to prevent overflow
- Also ensures .file-list-body constraint is inherited properly
- Prevents long code blocks from expanding file list container
* fix: add max-width to all markdown containers and pre tags
- Add max-width: 100% to .markdown, .tab-body, .markdown pre
- Ensures code blocks are constrained and show horizontal scrollbar
- Prevents content from expanding parent containers beyond viewport
* fix: add overflow-x to parent containers for horizontal scroll
Adds overflow-x: auto to .skill-detail-stack, .tab-card, and .tab-body
to ensure long code blocks are scrollable within the content area
instead of causing page-wide horizontal overflow.
Fixes horizontal overflow issue on skill pages with long code examples
(e.g., browser automation commands with 400+ character lines).
Tested on zepto skill page - page now stays within viewport (1200px)
and code blocks are accessible via horizontal scrollbar in tab area.
* docs: note code-block overflow fix in changelog (#183) (thanks @bewithgaurav)
---------
Co-authored-by: Peter Steinberger <steipete@gmail.com>
* chore(release): 0.6.1
* fix: prevent infinite loading loop on skills page (#90)
* fix: prevent infinite loading loop on skills pageAdd isLoadingMore guard to IntersectionObserver useEffect to preventcontinuous WebSocket queries when user is idle at bottom of page.The observer now won't set up while a request is in progress, breakingthe infinite loop cycle.Fixes: Related to #89
* fix: prevent repeated skills auto-load requests (#90) (thanks @xcqtnr)
* fix: resolve PR merge conflicts and keep observer regression test (#90) (thanks @xcqtnr)
---------
Co-authored-by: Peter Steinberger <steipete@gmail.com>
* fix(cli): secure config file permissions (#164)
* fix(cli): secure config file permissions and reduce duplication
Security:
- Config files now created with 0600 permissions (owner read/write only)
- Config directories created with 0700 permissions
- Protects API tokens from other users on shared systems
Maintainability:
- Extract resolveConfigPath() helper to reduce code duplication
- Same legacy fallback logic (clawhub -> clawdhub) now in one place
* fix(cli): tolerate unsupported chmod errors for config
---------
Co-authored-by: Peter Steinberger <steipete@gmail.com>
* fix: make /search host-aware in SSR (#257)
* fix: make /search mode-aware
Notes:\n- Medium: /search now depends on getSiteMode() during beforeLoad. On server-side routing, if VITE_SITE_MODE isn’t set and VITE_SOULHUB_SITE_URL is set (as in .env.local), getSiteMode() will resolve to souls and redirect /search to / even on the ClawdHub deployment. This is a regression risk vs the old always-/skills redirect. Confirm deployment envs guarantee correct mode. src/routes/search.tsx:9-31
* fix: make /search host-aware in SSR
* chore: fix lint and route tree for /search route
---------
Co-authored-by: Sash Zats <sash@zats.io>
* fix(vt): explicit return types and missing undici dependency (#255)
* fix(vt): explicit return types and missing undici dependency
Refactor action handlers in convex/vt.ts to use explicit return types, resolving circular type inference (TS7022). Also add undici to devDependencies for E2E tests.
* fix: add root undici devDependency for e2e (#255) (thanks @tanujbhaud)
---------
Co-authored-by: Peter Steinberger <steipete@gmail.com>
* Fix initial skill sorting (#92)
* fix: initial skill sorting
* chore: update unit test
* fix: use correct indexes for skill sorting
* chore: cleanup
* fix: land skill sorting update (#92) (thanks @bpk9)
---------
Co-authored-by: Peter Steinberger <steipete@gmail.com>
* fix: harden download rate limiting and dedupe (#43) (thanks @regenrek)
- add download-specific rate limit tier\n- add per-IP/day dedupe + daily pruning\n- keep moderation gating + deterministic zips\n- add optional forwarded-IP trust via TRUST_FORWARDED_IPS
* fix: harden skill listing and rate limiting under load
* fix: replace skill report prompt with modal
* fix: add skill publish anti-spam caps and quarantine
* docs: add git local-branch cleanup fallback
* fix: enforce quality gate and trust-tier spam checks
* fix: prevent autobanned users from self-reactivating
* test: expand reauth ban regression coverage
* feat: add empty-skill cleanup backfill with ban nominations
* fix: make empty-skill cleanup resumable
* feat: add non-suspicious skills filter toggle
* style: polish selected states in skills toolbar
* feat: default skills sort to downloads
* fix: enforce downloads as canonical default skills sort
* fix: force canonical downloads sort in skills browse mode
* fix: bypass suspicious flags for privileged owners and polish comment delete UI
* fix: add privileged-owner suspicious flag reconciler
* fix: force auth redirects and registry to canonical clawhub host
* feat: auto-generate missing skill summaries
* fix: make skill summary backfill resumable
* feat: add self-scheduling skill summary backfill job
* perf: short-circuit empty skill summary generation
* style: polish upload page layout and actions
* feat: show popular non-suspicious skills on homepage
* fix: normalize legacy skill stats to prevent homepage crash
* fix: render homepage popular cards from nested skill entries
* style: refine global UI theme, borders, and spacing
* fix: resolve search timeout and improve skills page UI alignment (#53)
* fix: resolve search timeout and improve skills page UI alignment
- Added a 10s timeout to OpenAI embedding requests to prevent hanging searches.
- Fixed a TypeScript error in search.ts regarding entry hydration.
- Restructured skills page layout and CSS to ensure consistent alignment between the search toolbar and skill cards.
* fix: resolve search timeout and improve skills page UI alignment
- Added a 10s timeout to OpenAI embedding requests to prevent hanging searches.
- Fixed a TypeScript error in search.ts regarding entry hydration.
- Restructured skills page layout and CSS to ensure consistent alignment between the search toolbar and skill cards.
* style: format skills index layout block
---------
Co-authored-by: Peter Steinberger <steipete@gmail.com>
* docs: thank @GhadiSaab for #53
* style: shift UI palette to cool blue tones
* style: remove remaining warm accent literals
* style: darken hero primary CTA in dark mode
* fix: show stars in popular skill cards
* fix: simplify skills CTA label
* fix: dedupe download metrics hourly by user-or-ip identity (#278)
* style: restore brown palette and dark-mode CTA tone
* fix(comments): stop updating skills.updatedAt on comment add/remove (#55)
* fix(comments): stop updating skills.updatedAt on comment add/remove
Comments are not content changes, so they shouldn't invalidate skill
list queries that depend on updatedAt. This reduces query invalidation
when users add or remove comments.
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
* test(comments): add updatedAt invalidation regression coverage
---------
Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
Co-authored-by: Peter Steinberger <steipete@gmail.com>
* refactor(comments): extract handlers and harden mutation tests
* feat: make account deletion irreversible and migrate lint to oxlint
* chore: add oxfmt config
* fix(cli): throw Error for all timeout aborts (#283)
* fix(cli): throw Error on timeout aborts
Users have seen an elevated number of:\n clawdhub search image\n ✖ Non-error was thrown: "Timeout". You should only throw errors.\n\nInvestigation shows we were aborting with a string instead of an Error. Switching to controller.abort(new Error('Timeout')) makes retries/formatting treat it as a real error and clears the message.\n\nExample after change:\n clawdhub search image\n table-image v1.0.0 Table Image (0.332)\n nano-banana-pro v1.0.1 Nano Banana Pro (0.319)\n vap-media v1.0.1 AI media generation API - Flux2pro, Veo3.1, Suno Ai (0.281)\n clawdbot-meshyai-skill v0.1.0 Meshy AI (0.276)\n venice-ai-media v1.0.0 Venice AI Media (0.274)\n daily-recap v1.0.2 Daily Recap (0.260)\n openai-image-gen v1.0.1 Openai Image Gen (0.260)\n bible-votd v1.0.1 Bible Verse of the Day (0.248)\n orf v1.0.1 ORF (0.224)\n smalltalk v1.0.1 Smalltalk (0.161)
* fix(http): wrap fetch calls in try-finally to prevent timer leaks
Addresses Vercel review comment: clearTimeout was not called on error paths when fetch throws an exception.
* fix(cli): unify timeout abort handling
---------
Co-authored-by: Sash Zats <sash@zats.io>
* refactor(cli): centralize HTTP status errors and timeout tests (#286)
* fix: keep new skill versions pending until VT verdict
* style: remove residual blue accents and warm base palette
* fix: add retry logic for OpenAI embedding API failures (#272)
* fix: add retry logic for OpenAI embedding API failures
Fixes#149
When importing or uploading skills, the OpenAI embedding API call could
fail with transient errors (rate limits, timeouts, network issues),
causing the entire import to fail with a generic "Server Error".
This adds retry logic with exponential backoff (1s, 2s, 4s delays):
- Retries on 429 (rate limit) and 5xx server errors
- Retries on network/fetch errors
- Logs warnings for debugging
- Max 3 retries before failing with clear error message
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
* fix: correct retry count and broaden network error catch
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
* fix: address retry loop off-by-one, broaden error catch, preserve original error
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
* fix: harden embeddings retry semantics
* style: format embeddings retry changes
---------
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
Co-authored-by: Peter Steinberger <steipete@gmail.com>
* fix: sync handle on user ensure
* fix: sync handle on user ensure (#293) (thanks @christianhpoe)
* feat: improve moderation/admin UX + language-aware quality gate
- API: owner-visible responses for hidden/soft-deleted skills\n- Admin: add unban user mutations + docs\n- Quality: Intl.Segmenter tokenization + CJK signal to reduce false rejects\n- Jobs: skill-stat-events interval 15m -> 5m\n- Tests: add coverage for owner-visible states + non-Latin docs\n- Changelog: add Unreleased entry
* refactor: simplify user ensure updates
* fix(cors): complete CORS + tokenized CLI reads (#296)
* fix(cors): add Access-Control-Allow-Origin headers to API and downloads
* fix: add CORS to error/raw paths & add CLI install auth
* fix: add OPTIONS handler for CORS preflight
* fix(cors): complete CORS + tokenized CLI reads
* test(cli): fix config mock typing
---------
Co-authored-by: Grenghis-Khan <63885013+Grenghis-Khan@users.noreply.github.com>
* refactor: centralize CORS + CLI auth token (#297)
* refactor(convex): centralize CORS headers
* refactor(cli): centralize auth token lookup
* fix(skills): keep global sorting across pagination (#98)
* fix: initial skill sorting
* chore: update unit test
* fix: use correct indexes for skill sorting
* chore: cleanup
* fix(skills): preserve server order for paginated sorting
* chore(lint): apply biome formatting fixes
* chore(convex): bump tsconfig lib to ES2022
* fix(skills): add deterministic tie-breaker for search sorting
* fix(skills): stable sorting across pagination (#98) (thanks @CodeBBakGoSu)
---------
Co-authored-by: Brian Kasper <bkasperr@gmail.com>
Co-authored-by: knox-glorang <knox@glorang.com>
Co-authored-by: Peter Steinberger <steipete@gmail.com>
* chore: drop convex-helpers (#302)
* perf: batch tag resolution to reduce action→query round-trips
- Add getVersionsByIds batch query to skills.ts and souls.ts
- Replace per-item tag resolution with batch resolution in httpApiV1.ts
- Reduces N action→query round-trips to 1 for list endpoints
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
* fix: add null guard and short-circuit for empty tags
- Short-circuit when no version IDs to resolve
- Add null coalescing for runQuery response
- Fixes potential crash when tags are empty or query returns null
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
* refactor: batch resolve tags in v1 API (#112) (thanks @mkrokosz)
* fix: handle duplicate Convex Auth user records in publish ownership check (#180)
* fix: handle duplicate user records in publish ownership check
* fix: heal publish ownership via GitHub auth identity
---------
Co-authored-by: Emmet Brown <emmet@Emmets-Mac-mini.local>
Co-authored-by: Peter Steinberger <steipete@gmail.com>
* fix: gate publish by immutable GitHub account ID
* refactor: simplify GitHub age gate cache
* fix(api): centralize v1 soft-delete error mapping
* chore(cli): align http client with main
* test(api): cover v1 soft-delete error mapping
* test(api): reposition soft-delete mapping test
* fix: default to CF-only client IP parsing
* docs: changelog credit + v1 delete status codes
* fix(cli): clarify logout only affects local config (#166)
* fix(cli): clarify logout only affects local config
Users may assume 'clawhub logout' revokes their token everywhere.
In reality, the token remains valid on the server until explicitly
revoked in the web UI. This could be a security concern on shared
machines.
Update the message to set correct expectations.
* fix(cli): clarify logout revocation scope (#166) (thanks @aronchick)
* chore: sync changelog for merge (#166) (thanks @aronchick)
---------
Co-authored-by: Peter Steinberger <steipete@gmail.com>
* feat: anti-squatting protection, backup restore, and ban flow improvements (#298)
* feat: anti-squatting protection, backup restore, and ban flow improvements
- Add `reservedSlugs` table with 90-day cooldown to prevent slug squatting
after skill deletion. Hard-delete finalize phase reserves slugs for the
original owner; `insertVersion` blocks non-owners during cooldown.
- Change ban flow from hard-delete to soft-delete: `banUserWithActor` now
sets `moderationReason: 'user.banned'` and syncs embedding visibility.
`unbanUserWithActor` restores all ban-hidden skills and releases slug
reservations automatically.
- Align `autobanMalwareAuthorInternal` with the same soft-delete + embedding
visibility pattern so unban recovery works uniformly.
- Add admin `reclaimSlug` / `reclaimSlugInternal` mutations for reclaiming
squatted slugs, with audit logging.
- Add GitHub backup restore system (`githubRestore.ts`,
`githubRestoreMutations.ts`, `githubRestoreHelpers.ts`) that reads from
the `clawdbot/skills` backup repo and re-creates skill records. Squatter
eviction runs synchronously in the same transaction as restore to avoid
async race conditions.
- Add `POST /api/v1/users/restore` and `POST /api/v1/users/reclaim` admin
HTTP endpoints for bulk operations.
- Add `trustedPublisher` flag on users; trusted publishers bypass the
`pending.scan` auto-hide for new skill publishes.
- Add `setTrustedPublisher` / `setTrustedPublisherInternal` admin mutations.
Addresses: slug squatting prevention, skill backup/restore, ban recovery,
and trusted publisher workflow improvements.
Co-authored-by: Cursor <cursoragent@cursor.com>
* fix: harden restore/reclaim + ban flow (#298) (thanks @autogame-17)
---------
Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Peter Steinberger <steipete@gmail.com>
* refactor: post-#298 cleanup (#313)
* refactor: consolidate slug + embedding helpers
* refactor: batch ban/unban skill updates
* refactor: report batched ban/unban scheduling
* fix: unblock package typecheck
* refactor: split httpApiV1 + consolidate moderation batches (#315)
* refactor: dedupe v1 file response + unify embedding patches (#316)
* Devin/1771112524 skill metadata update (#312)
* fix: sync GitHub profile on login to handle username renames (#303)
When a user renames their GitHub account, the stored username becomes stale
and causes 'GitHub account lookup failed' errors during skill publishing.
This fix:
- Adds syncGitHubProfile function that fetches current profile using the
immutable GitHub numeric ID
- Adds syncGitHubProfileInternal mutation to update user's name, handle,
displayName, and image when they change
- Schedules the sync as a background action on every login via
afterUserCreatedOrUpdated callback
The sync is best-effort (silently fails if GitHub API unavailable) since
it's not on the critical path. It only updates fields if the username
has actually changed.
Fixes#303
Co-Authored-By: Ian Alloway <adapter_burners.1y@icloud.com>
* fix: allow updating skill summary/description on subsequent publishes (#301)
Previously, the skill summary was only extracted from metadata.description
in the SKILL.md frontmatter. This change also checks for a direct
'description' field in the frontmatter, ensuring that users can update
their skill description by modifying either location.
The fix prioritizes the new description from the current publish over
the existing skill summary, allowing updates to be reflected correctly.
Fixes#301
Co-Authored-By: Ian Alloway <adapter_burners.1y@icloud.com>
* fix: throttle GitHub profile sync
* feat: show skill owner avatars
* fix: avoid nested owner links
* refactor: centralize profile sync + owner lookup
* docs: changelog for #312 (thanks @ianalloway)
---------
Co-authored-by: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Co-authored-by: Peter Steinberger <steipete@gmail.com>
* style: polish markdown code blocks
* feat: show skill owner avatars on home + lists
* feat: sync GitHub profile name
* feat: improve skill card meta layout
* fix: make ghost buttons look like buttons
* fix: match skill hero cta widths
* fix: prefer $HOME over os.homedir() for path resolution (#299)
* fix: prefer $HOME over os.homedir() for path resolution
os.homedir() reads from /etc/passwd which can return a stale path
after a Linux user rename (usermod -l). Prefer the $HOME environment
variable which reflects the current session.
Closes#82
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
* fix: normalize resolveHome output
---------
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
Co-authored-by: Peter Steinberger <steipete@gmail.com>
* UI: allow copying security scan summary text (#322)
* fix(ui): prevent analysis toggle when selecting summary (#324)
* feat: add uninstall command for skills (#241)
* feat: add uninstall command for skills
Implements `clawhub uninstall <slug>` to properly remove installed skills.
Changes:
- Added cmdUninstall function in skills.ts
- Validates skill is installed before removal
- Removes skill directory and lockfile entry
- Supports --yes flag to skip confirmation prompt
- Added comprehensive test coverage
Closes#221
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
* fix: require --yes in non-interactive mode and update lockfile before rm
Address review feedback:
- Fail with "Pass --yes (no input)" when running non-interactively
without --yes flag, matching delete/star/unstar/moderation commands
- Update lockfile before removing directory to avoid inconsistent state
if rm succeeds but writeLockfile fails
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
* fix: harden skill uninstall flow (#241) (thanks @superlowburn)
* docs: document uninstall CLI command (#241) (thanks @superlowburn)
* test: fix cmdUninstall mock typing (#241) (thanks @superlowburn)
---------
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
Co-authored-by: Peter Steinberger <steipete@gmail.com>
* feat: add skill file viewer
* fix: prevent file viewer state updates after unmount
* fix: lazy-load skill file viewer (#44) (thanks @regenrek)
---------
Co-authored-by: Sergiy Dybskiy <s@serg.tech>
Co-authored-by: Peter Steinberger <steipete@gmail.com>
Co-authored-by: theonejvo <theonejvo@users.noreply.github.com>
Co-authored-by: Vignesh <vigneshnatarajan92@gmail.com>
Co-authored-by: Steve <superlowburn@gmail.com>
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
Co-authored-by: DColl <david.coll.78@gmail.com>
Co-authored-by: Tanuj Bhaud <tanujbhaud@gmail.com>
Co-authored-by: Limitless <127183162+Limitless2023@users.noreply.github.com>
Co-authored-by: Limitless2023 <limitless@users.noreply.github.com>
Co-authored-by: Gaurav Sharma <sharmag@microsoft.com>
Co-authored-by: xcqtnr <xcqtnr0.0@gmail.com>
Co-authored-by: David Aronchick <aronchick@gmail.com>
Co-authored-by: Sash Zats <sash@zats.io>
Co-authored-by: Tanuj Bhaud <128238320+tanujbhaud@users.noreply.github.com>
Co-authored-by: Brian Kasper <brian@bkasper.com>
Co-authored-by: ghadi saab <ghadisaab21@gmail.com>
Co-authored-by: sethconvex <seth@convex.dev>
Co-authored-by: ChristianHPoe <chpoensgen@me.com>
Co-authored-by: Grenghis-Khan <63885013+Grenghis-Khan@users.noreply.github.com>
Co-authored-by: CodeBBakGoSu <127713112+CodeBBakGoSu@users.noreply.github.com>
Co-authored-by: Brian Kasper <bkasperr@gmail.com>
Co-authored-by: knox-glorang <knox@glorang.com>
Co-authored-by: Matthew Krokosz <mattkrokosz@gmail.com>
Co-authored-by: emmet-bot <emmet@universaleverything.io>
Co-authored-by: Emmet Brown <emmet@Emmets-Mac-mini.local>
Co-authored-by: autogame-17 <166480271+autogame-17@users.noreply.github.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Ian Alloway <adapter_burners.1y@icloud.com>
Co-authored-by: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Co-authored-by: CleanApp <165804662+borisolver@users.noreply.github.com>
* feat: add uninstall command for skills
Implements `clawhub uninstall <slug>` to properly remove installed skills.
Changes:
- Added cmdUninstall function in skills.ts
- Validates skill is installed before removal
- Removes skill directory and lockfile entry
- Supports --yes flag to skip confirmation prompt
- Added comprehensive test coverage
Closes#221
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
* fix: require --yes in non-interactive mode and update lockfile before rm
Address review feedback:
- Fail with "Pass --yes (no input)" when running non-interactively
without --yes flag, matching delete/star/unstar/moderation commands
- Update lockfile before removing directory to avoid inconsistent state
if rm succeeds but writeLockfile fails
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
* fix: harden skill uninstall flow (#241) (thanks @superlowburn)
* docs: document uninstall CLI command (#241) (thanks @superlowburn)
* test: fix cmdUninstall mock typing (#241) (thanks @superlowburn)
---------
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
Co-authored-by: Peter Steinberger <steipete@gmail.com>
* fix: prefer $HOME over os.homedir() for path resolution
os.homedir() reads from /etc/passwd which can return a stale path
after a Linux user rename (usermod -l). Prefer the $HOME environment
variable which reflects the current session.
Closes#82
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
* fix: normalize resolveHome output
---------
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
Co-authored-by: Peter Steinberger <steipete@gmail.com>
* fix: sync GitHub profile on login to handle username renames (#303)
When a user renames their GitHub account, the stored username becomes stale
and causes 'GitHub account lookup failed' errors during skill publishing.
This fix:
- Adds syncGitHubProfile function that fetches current profile using the
immutable GitHub numeric ID
- Adds syncGitHubProfileInternal mutation to update user's name, handle,
displayName, and image when they change
- Schedules the sync as a background action on every login via
afterUserCreatedOrUpdated callback
The sync is best-effort (silently fails if GitHub API unavailable) since
it's not on the critical path. It only updates fields if the username
has actually changed.
Fixes#303
Co-Authored-By: Ian Alloway <adapter_burners.1y@icloud.com>
* fix: allow updating skill summary/description on subsequent publishes (#301)
Previously, the skill summary was only extracted from metadata.description
in the SKILL.md frontmatter. This change also checks for a direct
'description' field in the frontmatter, ensuring that users can update
their skill description by modifying either location.
The fix prioritizes the new description from the current publish over
the existing skill summary, allowing updates to be reflected correctly.
Fixes#301
Co-Authored-By: Ian Alloway <adapter_burners.1y@icloud.com>
* fix: throttle GitHub profile sync
* feat: show skill owner avatars
* fix: avoid nested owner links
* refactor: centralize profile sync + owner lookup
* docs: changelog for #312 (thanks @ianalloway)
---------
Co-authored-by: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Co-authored-by: Peter Steinberger <steipete@gmail.com>
* feat: anti-squatting protection, backup restore, and ban flow improvements
- Add `reservedSlugs` table with 90-day cooldown to prevent slug squatting
after skill deletion. Hard-delete finalize phase reserves slugs for the
original owner; `insertVersion` blocks non-owners during cooldown.
- Change ban flow from hard-delete to soft-delete: `banUserWithActor` now
sets `moderationReason: 'user.banned'` and syncs embedding visibility.
`unbanUserWithActor` restores all ban-hidden skills and releases slug
reservations automatically.
- Align `autobanMalwareAuthorInternal` with the same soft-delete + embedding
visibility pattern so unban recovery works uniformly.
- Add admin `reclaimSlug` / `reclaimSlugInternal` mutations for reclaiming
squatted slugs, with audit logging.
- Add GitHub backup restore system (`githubRestore.ts`,
`githubRestoreMutations.ts`, `githubRestoreHelpers.ts`) that reads from
the `clawdbot/skills` backup repo and re-creates skill records. Squatter
eviction runs synchronously in the same transaction as restore to avoid
async race conditions.
- Add `POST /api/v1/users/restore` and `POST /api/v1/users/reclaim` admin
HTTP endpoints for bulk operations.
- Add `trustedPublisher` flag on users; trusted publishers bypass the
`pending.scan` auto-hide for new skill publishes.
- Add `setTrustedPublisher` / `setTrustedPublisherInternal` admin mutations.
Addresses: slug squatting prevention, skill backup/restore, ban recovery,
and trusted publisher workflow improvements.
Co-authored-by: Cursor <cursoragent@cursor.com>
* fix: harden restore/reclaim + ban flow (#298) (thanks @autogame-17)
---------
Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Peter Steinberger <steipete@gmail.com>
* fix(cli): clarify logout only affects local config
Users may assume 'clawhub logout' revokes their token everywhere.
In reality, the token remains valid on the server until explicitly
revoked in the web UI. This could be a security concern on shared
machines.
Update the message to set correct expectations.
* fix(cli): clarify logout revocation scope (#166) (thanks @aronchick)
* chore: sync changelog for merge (#166) (thanks @aronchick)
---------
Co-authored-by: Peter Steinberger <steipete@gmail.com>
* fix: handle duplicate user records in publish ownership check
* fix: heal publish ownership via GitHub auth identity
---------
Co-authored-by: Emmet Brown <emmet@Emmets-Mac-mini.local>
Co-authored-by: Peter Steinberger <steipete@gmail.com>
- Short-circuit when no version IDs to resolve
- Add null coalescing for runQuery response
- Fixes potential crash when tags are empty or query returns null
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Add getVersionsByIds batch query to skills.ts and souls.ts
- Replace per-item tag resolution with batch resolution in httpApiV1.ts
- Reduces N action→query round-trips to 1 for list endpoints
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
* fix: add retry logic for OpenAI embedding API failures
Fixes#149
When importing or uploading skills, the OpenAI embedding API call could
fail with transient errors (rate limits, timeouts, network issues),
causing the entire import to fail with a generic "Server Error".
This adds retry logic with exponential backoff (1s, 2s, 4s delays):
- Retries on 429 (rate limit) and 5xx server errors
- Retries on network/fetch errors
- Logs warnings for debugging
- Max 3 retries before failing with clear error message
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
* fix: correct retry count and broaden network error catch
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
* fix: address retry loop off-by-one, broaden error catch, preserve original error
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
* fix: harden embeddings retry semantics
* style: format embeddings retry changes
---------
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
Co-authored-by: Peter Steinberger <steipete@gmail.com>
* fix(cli): throw Error on timeout aborts
Users have seen an elevated number of:\n clawdhub search image\n ✖ Non-error was thrown: "Timeout". You should only throw errors.\n\nInvestigation shows we were aborting with a string instead of an Error. Switching to controller.abort(new Error('Timeout')) makes retries/formatting treat it as a real error and clears the message.\n\nExample after change:\n clawdhub search image\n table-image v1.0.0 Table Image (0.332)\n nano-banana-pro v1.0.1 Nano Banana Pro (0.319)\n vap-media v1.0.1 AI media generation API - Flux2pro, Veo3.1, Suno Ai (0.281)\n clawdbot-meshyai-skill v0.1.0 Meshy AI (0.276)\n venice-ai-media v1.0.0 Venice AI Media (0.274)\n daily-recap v1.0.2 Daily Recap (0.260)\n openai-image-gen v1.0.1 Openai Image Gen (0.260)\n bible-votd v1.0.1 Bible Verse of the Day (0.248)\n orf v1.0.1 ORF (0.224)\n smalltalk v1.0.1 Smalltalk (0.161)
* fix(http): wrap fetch calls in try-finally to prevent timer leaks
Addresses Vercel review comment: clearTimeout was not called on error paths when fetch throws an exception.
* fix(cli): unify timeout abort handling
---------
Co-authored-by: Sash Zats <sash@zats.io>
* fix(comments): stop updating skills.updatedAt on comment add/remove
Comments are not content changes, so they shouldn't invalidate skill
list queries that depend on updatedAt. This reduces query invalidation
when users add or remove comments.
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
* test(comments): add updatedAt invalidation regression coverage
---------
Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
Co-authored-by: Peter Steinberger <steipete@gmail.com>
* fix: resolve search timeout and improve skills page UI alignment
- Added a 10s timeout to OpenAI embedding requests to prevent hanging searches.
- Fixed a TypeScript error in search.ts regarding entry hydration.
- Restructured skills page layout and CSS to ensure consistent alignment between the search toolbar and skill cards.
* fix: resolve search timeout and improve skills page UI alignment
- Added a 10s timeout to OpenAI embedding requests to prevent hanging searches.
- Fixed a TypeScript error in search.ts regarding entry hydration.
- Restructured skills page layout and CSS to ensure consistent alignment between the search toolbar and skill cards.
* style: format skills index layout block
---------
Co-authored-by: Peter Steinberger <steipete@gmail.com>
* fix(vt): explicit return types and missing undici dependency
Refactor action handlers in convex/vt.ts to use explicit return types, resolving circular type inference (TS7022). Also add undici to devDependencies for E2E tests.
* fix: add root undici devDependency for e2e (#255) (thanks @tanujbhaud)
---------
Co-authored-by: Peter Steinberger <steipete@gmail.com>
* fix: make /search mode-aware
Notes:\n- Medium: /search now depends on getSiteMode() during beforeLoad. On server-side routing, if VITE_SITE_MODE isn’t set and VITE_SOULHUB_SITE_URL is set (as in .env.local), getSiteMode() will resolve to souls and redirect /search to / even on the ClawdHub deployment. This is a regression risk vs the old always-/skills redirect. Confirm deployment envs guarantee correct mode. src/routes/search.tsx:9-31
* fix: make /search host-aware in SSR
* chore: fix lint and route tree for /search route
---------
Co-authored-by: Sash Zats <sash@zats.io>
* fix(cli): secure config file permissions and reduce duplication
Security:
- Config files now created with 0600 permissions (owner read/write only)
- Config directories created with 0700 permissions
- Protects API tokens from other users on shared systems
Maintainability:
- Extract resolveConfigPath() helper to reduce code duplication
- Same legacy fallback logic (clawhub -> clawdhub) now in one place
* fix(cli): tolerate unsupported chmod errors for config
---------
Co-authored-by: Peter Steinberger <steipete@gmail.com>
* fix: prevent infinite loading loop on skills pageAdd isLoadingMore guard to IntersectionObserver useEffect to preventcontinuous WebSocket queries when user is idle at bottom of page.The observer now won't set up while a request is in progress, breakingthe infinite loop cycle.Fixes: Related to #89
* fix: prevent repeated skills auto-load requests (#90) (thanks @xcqtnr)
* fix: resolve PR merge conflicts and keep observer regression test (#90) (thanks @xcqtnr)
---------
Co-authored-by: Peter Steinberger <steipete@gmail.com>
* Fix: Prevent horizontal overflow from long code blocks in skill pages
- Add max-width: 100% to .file-list-body and .file-row
- Prevents page-wide overflow when skills contain long code examples
- Markdown pre blocks already have overflow-x: auto, but parent containers were expanding infinitely
- Fixes issue where skills with 400+ char lines (e.g. browser automation commands) cause horizontal scrolling
Affected: Skills with long inline code in markdown (browser act commands, etc.)
* fix: add max-width to .file-list container to prevent overflow
- Also ensures .file-list-body constraint is inherited properly
- Prevents long code blocks from expanding file list container
* fix: add max-width to all markdown containers and pre tags
- Add max-width: 100% to .markdown, .tab-body, .markdown pre
- Ensures code blocks are constrained and show horizontal scrollbar
- Prevents content from expanding parent containers beyond viewport
* fix: add overflow-x to parent containers for horizontal scroll
Adds overflow-x: auto to .skill-detail-stack, .tab-card, and .tab-body
to ensure long code blocks are scrollable within the content area
instead of causing page-wide horizontal overflow.
Fixes horizontal overflow issue on skill pages with long code examples
(e.g., browser automation commands with 400+ character lines).
Tested on zepto skill page - page now stays within viewport (1200px)
and code blocks are accessible via horizontal scrollbar in tab area.
* docs: note code-block overflow fix in changelog (#183) (thanks @bewithgaurav)
---------
Co-authored-by: Peter Steinberger <steipete@gmail.com>
Bug 1: applyAggregatedStatsAndUpdateCursor was missing 'comments' in both
the guard condition and the applySkillStatDeltas call. This caused comment
count deltas to be silently dropped during cron-based event processing,
while stars/downloads/installs were processed correctly.
Bug 2: No reconciliation mechanism existed. If events were missed due to
cursor issues or processing errors, skill stats (stars, comments) would
remain stale with no way to recover. Added reconcileSkillStarCounts
maintenance mutation that counts actual records in the stars and comments
tables and patches any out-of-sync skill stats.
Fixes#193
Co-authored-by: Limitless2023 <limitless@users.noreply.github.com>
Fixes Issue #32 where users who soft-deleted their accounts were unable to sign back in because the re-auth logic was only triggering when an existingUserId was passed by the auth provider, which doesn't happen during a standard fresh login flow.
* Remove allowH2 option from global dispatcher
fix/remove-allowH2-undici-node22-compat
* fix(http): remove allowH2 from e2e dispatcher
---------
Co-authored-by: Peter Steinberger <steipete@gmail.com>
* fix: handle GitHub API rate limits in account age check
The GitHub account lookup uses unauthenticated requests (60 req/hr
per IP). Since this runs server-side in Convex, all users share the
same IP and quickly exhaust the rate limit, causing "GitHub account
lookup failed" errors during skill publish.
- Detect 403/429 responses and surface a clear rate-limit message
- Support optional GITHUB_TOKEN env var for authenticated requests
(5,000 req/hr)
Fixes#155
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
* fix: stabilize GitHub account gate tests and docs
---------
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
Co-authored-by: Peter Steinberger <steipete@gmail.com>
VT no longer overwrites LLM moderation verdicts. LLM is the primary
moderation authority; VT only escalates (hides + flags) for malicious/
suspicious content via new escalateByVtInternal mutation. Stale VT polls
write vtAnalysis marker instead of overwriting moderationReason. Query
pools expanded to include LLM-evaluated skills awaiting VT results.
Ban message now references malicious skills and security@openclaw.ai.
- Strip trailing commas in frontmatter JSON before parsing (silent failure fix)
- Stop flagging disable-model-invocation default as a concern (it's the normal default)
- Stop flagging skills configuring themselves as privilege escalation
- Add MITRE ATLAS AML.T0051 context for when autonomous invocation actually matters
- Show actual defaults in assembled eval message instead of "not set"
- Document full frontmatter metadata reference in docs/skill-format.md
- Add metadata section + quick example to README
- Show appeal message on suspicious skills (owner-only) linking to GitHub issues
- Accept metadata.openclaw alias in README docs
- Re-evaluate all skills with full file content reading (backfill in progress)
Reads all files from storage and includes their full source in the eval
prompt so the LLM can detect malicious code hidden behind clean READMEs.
Injection detection now scans all content. Per-file cap 10K chars, total
cap 50K chars.
- getStatsInternal: derive VT stats from moderationReason instead of
N+1 version lookups that hit the 16MB byte limit
- UI: read cached vtAnalysis from version docs instead of hitting the
live VT API on every page view
- Backfill: add vt-cache-backfill cron (30min) with self-scheduling to
drain the backlog of skills missing cached vtAnalysis
- Daily rescan: cursor-based batching (100/batch) with self-scheduling
instead of loading all skills in one shot
- downloads:increment: remove unnecessary db.get that added skill doc
to read set, causing conflicts with the stat processing cron
- users:ensure: only patch when there are real field changes, skip
unconditional updatedAt bump that forced a write on every call
- comments: route stats through event sourcing (insertStatEvent) instead
of synchronous read-modify-write on the skill doc
- rateLimits: split into query-first check + conditional mutation so
denied requests are conflict-free reads
- skillStatEvents: reduce MAX_SKILLS_PER_RUN from 500 to 50 to shrink
the write set and lower conflict probability with concurrent mutations
Co-Authored-By: theonejvo <theonejvo@users.noreply.github.com>
The download endpoint now checks moderation status before serving zips:
- Pending scan (423): "This skill is pending a security scan by VirusTotal. Please try again in a few minutes."
- Malicious (403): "Blocked: this skill has been flagged as malicious by VirusTotal and cannot be downloaded."
- Removed (410): "This skill has been removed by a moderator."
- Hidden (403): "This skill is currently unavailable."
Closes the supply chain gap where a newly published version could be
downloaded before VT scanning completed.
CLI now checks moderation status before installing skills:
**Suspicious skills** - Shows warning and requires confirmation:
```
⚠️ Warning: "skill-name" is flagged as suspicious by VirusTotal Code Insight.
This skill may contain risky patterns (crypto keys, external APIs, eval, etc.)
Review the skill code before use.
? Install anyway? (y/N)
```
Non-interactive mode requires --force flag.
**Malicious skills** - Blocked entirely:
```
✖ Blocked: skill-name is flagged as malicious
Error: This skill has been flagged as malware and cannot be installed.
```
Changes:
- API now returns `moderation` field with `isSuspicious` and `isMalwareBlocked`
- CLI schema updated to expect moderation field
- cmdInstall and cmdUpdate enforce moderation checks
Thanks to @zackkorman for raising this issue.
The auditLogs.targetId field is v.string() in the schema, so explicitly
convert the Id<'users'> to string to ensure type-safe comparison.
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Users who deleted their account were unable to sign in again with the
same GitHub account. The OAuth flow would complete but the user would
remain logged out due to the `deletedAt` field being set.
This fix adds a `createOrUpdateUser` callback that:
1. Detects soft-deleted users during OAuth
2. Checks audit logs to determine if user was BANNED vs SELF-DELETED
3. If banned → throws error "This account has been suspended"
4. If self-deleted → clears `deletedAt` to restore account
Security: Both `deleteAccount` and `banUser` set the same `deletedAt`
field. This fix ensures banned users cannot restore their accounts.
Performance: The callback runs on every sign-in, but the audit log
query ONLY executes for soft-deleted users (rare edge case). Normal
active users just hit a single `if` check - no extra queries. When
the audit log query does run, it uses the `by_target` index for
efficient lookup.
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
`??` (nullish coalescing) treats `""` as a valid value, so users
with `handle=""` never get a fallback derived from name/email.
Change to `||` so empty strings fall through to the next candidate.
This affects any user whose handle field is an empty string rather
than null/undefined — e.g. early accounts or migration artifacts.
- Batch size 100 (was 10) - process more per run
- Skip skills checked in last 60 min - avoid hammering same hashes
- After 10 failed checks, mark as pending.scan.stale - drops from queue
- Track scanLastCheckedAt and scanCheckCount on skills
- Add TODO for webhook/notification setup
- Fetch 5x batch size and shuffle to avoid queue head-blocking
- Add getScanQueueHealthInternal to monitor queue status
- Log warnings when queue is unhealthy (>50 pending or >24h stale)
- Return health stats from pollPendingScans
- Add requestRescan() to trigger Code Insight via /analyse endpoint
- Update pollPendingScans to request rescan when no Code Insight
- Add backfillPendingScans for one-time backlog clearing
- Add pollPendingScans action to vt.ts that checks VT for Code Insight verdicts
- Add getPendingScanSkillsInternal query to get skills awaiting scan
- Add vt-pending-scans cron job running every 5 minutes
- Updates skill moderation status when VT analysis is complete
- Malicious skills: visible for transparency, downloads blocked via moderationFlags
- Suspicious skills: visible with warning banner, downloads allowed
- Neither appears in search/listings (not indexed)
- Add isSuspicious flag to moderation info
- Update approveSkillByHashInternal to set moderationFlags properly
- Add warning banner CSS variant for suspicious skills
- Add `source` field to VT results to indicate code_insight vs engines
- Display Code Insight analysis text when AI detects malicious patterns
- Only show "X/Y engines" when traditional AV detection triggers
- Add styled analysis block with red accent for malicious verdicts
* fix: show pending skill page to owners instead of "Skill not found"
When a skill owner uploads a skill that's pending VirusTotal scan,
they now see their skill page with a pending banner instead of
"Skill not found". The banner explains the scan is in progress.
Changes:
- Modified getBySlug query to return skill data for owners even when
moderationStatus is 'hidden' with reason 'pending.scan'
- Added pendingReview flag to query response
- Added pending banner component to SkillDetailPage
- Added CSS for pending banner using existing ClawHub gold theme
* fix: show pending skills on owner's dashboard
Extended the list query to include pending skills when the requester
is viewing their own dashboard. Added "Scanning" badge with gold theme
to indicate skills pending VirusTotal review.
* fix: show all moderation states to owners with appropriate UI
- Owners see their blocked/removed skills with explanatory banners
- Red banner for malware-blocked and removed skills
- Gold banner for pending scan
- Download button hidden for blocked/removed skills
- Added security disclaimer: "Like a lobster shell, security has layers"
- Fixed badges bug (use computed badges, not stale skill.badges)
* feat: make malware-blocked skills publicly visible
Blocked skills are now visible to everyone via direct URL:
- Shows red banner with "security issue detected"
- Displays VT scan results
- No download button
- Still hidden from listings/search
Sends a strong transparency signal about security enforcement.
* fix: allow owners to view pending scan skills (#136)
* fix: make deterministic zip date timezone-safe
* chore: update convex api types
* fix: update changelog for pending scan visibility (#136) (thanks @orlyjamie)
---------
Co-authored-by: theonejvo <theonejvo@users.noreply.github.com>
Co-authored-by: Peter Steinberger <steipete@gmail.com>
Blocked skills are now visible to everyone via direct URL:
- Shows red banner with "security issue detected"
- Displays VT scan results
- No download button
- Still hidden from listings/search
Sends a strong transparency signal about security enforcement.
- Owners see their blocked/removed skills with explanatory banners
- Red banner for malware-blocked and removed skills
- Gold banner for pending scan
- Download button hidden for blocked/removed skills
- Added security disclaimer: "Like a lobster shell, security has layers"
- Fixed badges bug (use computed badges, not stale skill.badges)
Extended the list query to include pending skills when the requester
is viewing their own dashboard. Added "Scanning" badge with gold theme
to indicate skills pending VirusTotal review.
When a skill owner uploads a skill that's pending VirusTotal scan,
they now see their skill page with a pending banner instead of
"Skill not found". The banner explains the scan is in progress.
Changes:
- Modified getBySlug query to return skill data for owners even when
moderationStatus is 'hidden' with reason 'pending.scan'
- Added pendingReview flag to query response
- Added pending banner component to SkillDetailPage
- Added CSS for pending banner using existing ClawHub gold theme
Add tests for the deterministic ZIP building utility from PR #130:
- buildSkillMeta function
- buildDeterministicZip with various scenarios
- Verifies deterministic output and _meta.json inclusion
Achieves 100% coverage for skillZip.ts.
Add comprehensive tests for the badges utility functions:
- isSkillHighlighted, isSkillOfficial, isSkillDeprecated
- getSkillBadges with all badge combinations
Improves branch coverage from 50% to 100% for badges.ts.
* feat: implementation of dynamic VirusTotal integration and deterministic ZIPs
* fix: do not show security scan results if hash is missing
* ui: show 'Loading...' instead of 'Pending' while fetching VT results
* security: restrict auto-approval to explicit benign verdicts only
* fix: prioritize AI verdict in results and refine stats fallback
- apply Biome formatting and import ordering across linted files
- fix management useEffect dependencies flagged by Biome
Tests: bun run lint:biome; bun run lint:oxlint
When AbortController.abort() receives a string instead of an Error,
the string itself is thrown. pRetry then wraps it in a confusing
message: 'Non-error was thrown: Timeout'
Changed all 3 occurrences in http.ts:
- apiRequest (line 57)
- apiRequestForm (line 106)
- downloadZip (line 141)
Now timeouts will surface as proper Error objects with clear messages.
The delete and undelete handlers for skills and souls were catching all
errors and returning 401 Unauthorized, even for errors like:
- 'Skill not found' (should be 404)
- 'Forbidden' (should be 403)
- Other validation errors (should be 400)
This change updates the error handling to return appropriate status codes:
- 401 Unauthorized: authentication failures
- 403 Forbidden: authorization failures (not owner/admin/moderator)
- 404 Not Found: skill/soul/user not found
- 400 Bad Request: other errors with descriptive message
Fixes#34
* fix: resolve typecheck and lint errors
* fix: stabilize publish paths and token types
* feat: show published skills on user profile
* fix: document profile published skills (#20) (thanks @njoylab)
---------
Co-authored-by: Peter Steinberger <steipete@gmail.com>
The `cmdUpdate` function was passing a relative path to `apiRequest`
using the `url` property, but `url` expects a full URL. When `url` is
provided, it's used as-is without combining with the registry base URL.
This caused "Failed to parse URL from /api/v1/skills/<slug>" errors
when updating skills that don't have a local fingerprint match.
Changed to use `path` property which correctly combines with the
registry base URL via `new URL(args.path, registry)`.
Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
* fix: relax search token matching to require at least one match
The search was requiring ALL query tokens to exist in the skill's
displayName, slug, or summary. This was too strict and caused valid
results to be filtered out. For example, searching "HTTP API client"
would fail to match skills about "HTTP API" that didn't mention "client".
Changed from `.every()` to `.some()` so at least one token must match,
allowing the vector similarity to determine relevance for the rest.
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
* fix: update matchesExactTokens to require prefix matching for query tokens
* more inclusive token check
* Update convex/lib/searchText.ts
Co-authored-by: vercel[bot] <35613825+vercel[bot]@users.noreply.github.com>
---------
Co-authored-by: Ahmed <ahmed.mire@kaluza.com>
Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
Co-authored-by: vercel[bot] <35613825+vercel[bot]@users.noreply.github.com>
- Fix "Explore search" button causing page refresh by using URL params
- Enable /search URL deep linking via beforeLoad redirect
- Fix logo click not closing search mode by properly syncing state with URL
Adds a new `clawdhub explore` command that fetches the most recently
updated skills from the registry, sorted by updatedAt descending.
Usage:
clawdhub explore # Show latest 25 skills
clawdhub explore --limit 10
Output includes slug, version, relative time since update, and summary.
The API endpoint already exists and returns skills sorted by updatedAt,
this just exposes it via the CLI.
- include nix plugin metadata, config requirements, and CLI help
- add config examples and format bundle code blocks
- refresh bundle UI styling and layout
- add dashboard with skill management and upload prefill
- redesign skill detail layout with full-width panels
- refactor modules and format dashboard/upload routes
- Add /dashboard route showing user's published skills
- Add 'Dashboard' link to user dropdown menu in header
- Skills display name, slug, description, stats (downloads, stars, versions)
- 'New Version' button links to upload with pre-populated slug
- Upload route accepts ?updateSlug param to pre-fill form for updates
- Auto-bumps version number when updating existing skill
- Responsive design for mobile
- Empty state with call-to-action for new users
contents:read# Required to scan the code in the PR
steps:
- name:Checkout code
uses:actions/checkout@v6
with:
fetch-depth:0# necessary to support the scoping requirements below
- name:TruffleHog OSS
id:trufflehog
# Use a concrete released ref that resolves in upstream action registry.
# v3 (major tag) is not published by trufflesecurity/trufflehog.
uses:trufflesecurity/trufflehog@v3.93.8
with:
path:./
base:${{ github.event.pull_request.base.sha }}# scope it to the committed files
head:${{ github.event.pull_request.head.sha }}
extra_args:--only-verified --debug
- name:Notify on Failure
if:steps.trufflehog.outcome == 'failure'
run:|
echo "::error::Verified secrets found! This PR contains live credentials that must be rotated immediately."
echo "::notice::If these secrets are already in the commit history, they cannot be removed via a simple removal commit/push. A repository owner can contact GitHub Support to purge the cached data: https://support.github.com/contact/private-information"
- PRs: include summary + test commands run. Add screenshots for UI changes.
- Before merging any PR, verify TypeScript cleanly with `bunx tsc -p packages/schema/tsconfig.json --noEmit` and `bunx tsc -p packages/clawdhub/tsconfig.json --noEmit`; if Convex code changed, also run the repo typecheck path used by deploy so `bunx convex deploy` will not fail on `tsc`.
- GitHub comments: for multiline `gh` comments/close messages, use `--body-file`, `--input`, or stdin/heredoc with real newlines; never pass literal `\\n` in shell strings.
- Reject PRs that add skills into source code/repo content directly (for example under `skills/` or seed-only additions intended as published skills). Skills must be uploaded/published via CLI.
## Git Notes
- If `git branch -d/-D <branch>` is policy-blocked, delete the local ref directly: `git update-ref -d refs/heads/<branch>`.
## URL Quick Reference
- Canonical site: `https://clawhub.ai` (prefer this over legacy domains).
- Skill page URL format: `https://clawhub.ai/<owner>/<slug>` (owner handle preferred; falls back to owner id).
- Skill API detail URL: `https://clawhub.ai/api/v1/skills/<slug>`.
- OAuth: GitHub OAuth App credentials required for login.
## Convex Ops (Gotchas)
- New Convex functions must be pushed before `convex run`: use `bunx convex dev --once` (dev) or `bunx convex deploy` (prod).
- For non-interactive prod deploys, use `bunx convex deploy -y` to skip confirmation.
- If `bunx convex run --env-file .env.local ...` returns `401 MissingAccessToken` despite `bunx convex login`, workaround: omit `--env-file` and use `--deployment-name <name>` / `--prod`.
## Convex Query & Bandwidth Rules
- **Always use `.withIndex()` instead of `.filter()` for fields that can be indexed.** `.filter()` causes full table scans — every doc is read and billed. Even a single `.filter()` on a 16K-row table reads ~16 MB per call.
- **Convex reads entire documents** — no field projections. If you only need a few fields from large docs (~6 KB+), denormalize a lightweight summary onto the parent doc or use a lookup table (see `embeddingSkillMap`, `skill.latestVersionSummary`, `skill.badges` for examples).
- **Denormalization pattern**: persist computed fields so they can be indexed. Every mutation that updates source fields must also update the denormalized field. Always write a cursor-based backfill for new fields (see `backfillIsSuspiciousInternal`, `backfillLatestVersionSummaryInternal`, `backfillDenormalizedBadgesInternal` for examples).
- **Cron jobs must never scan entire tables.** Use indexed queries with equality filters. Use cursor-based pagination for large datasets. Prefer incremental/delta tracking over full recounts.
- **32K document limit per query.** Split `.collect()` calls by a partition field (e.g., one day at a time instead of a 7-day range). See `rebuildTrendingLeaderboardAction` in `convex/leaderboards.ts` for an example.
- **Common mistakes**: `.filter().collect()` without an index; `ctx.db.get()` on large docs in a loop for list views; while loops that paginate the whole table to find filtered results.
- **Before writing or reviewing Convex queries, check deployment health.** Run `bunx convex insights` to check for OCC conflicts, `bytesReadLimit`, and `documentsReadLimit` errors. Run `bunx convex logs --failure` to see individual error messages and stack traces. This helps identify which functions are causing bandwidth issues so you can prioritize fixes.
- Packages/Plugins: add a first-class OpenClaw package registry across the web app, CLI, and HTTP API. ClawHub now supports package browse/search/detail/version/file/download flows plus `clawhub package explore`, `clawhub package inspect`, and `clawhub package publish` for `skill`, `code-plugin`, and `bundle-plugin` packages. (#1093)
- Packages/Install: package downloads now ship install-ready archives with a `package/` root, support nested files like `dist/index.js`, and work directly with OpenClaw plugin install flows.
- Skills/Web: server-render public skill pages and OG assets for faster first loads, cleaner sharing previews, and better cache behavior.
### Changed
- Browse/Search: rebuild public browse/search around denormalized digests, one-shot HTTP fetches, and deterministic cursors so the homepage and `/skills` are faster, more cacheable, and less likely to hit stale-tab or pagination dead ends.
- Search: default skill search to relevance, keep load-more retryable after fetch failures, and tighten package/skill catalog query paths to reduce inconsistent results under load.
### Fixed
- Packages/Auth: authenticated owners can now list, search, inspect, download, and read files from their own private packages instead of private packages being direct-URL-only. (#1093)
- Packages/API: stabilize package latest-version pointers, cursor pagination, publish outputs, fallback release resolution, and app-origin auth handling so package publish/search/install flows stay reliable.
- Visibility/API: prevent skills owned by deleted/banned users from showing up in public detail pages, browse/search results, or version API routes.
- Skills/API: sanitize public skill and soul version/file reads so hidden or invalid version data does not leak through direct API access.
- Skills/Web: keep Monaco compare layout toggles reliable while defaulting narrow screens to inline mode (#828) (thanks @geoffrey-xiao).
## 0.8.0 - 2026-03-13
### Added
- Skills/Web: show skill owner avatar + handle on skill cards, lists, and detail pages (#312) (thanks @ianalloway).
- Skills/Web: add file viewer for skill version files on detail page (#44) (thanks @regenrek).
- CLI: add `uninstall` command for skills (#241) (thanks @superlowburn).
- Skills/API/CLI: add ownership transfer workflow with request/list/accept/reject/cancel flows.
- Skills/Web/API: surface platform/architecture labels and security evaluation results in v1 + inspect views (#499, #362).
- API: add structured skill moderation responses plus `GET /api/v1/skills/{slug}/moderation` with redacted public evidence and full owner/staff detail (#334) (thanks @ArthurzKV).
- Moderation: persist structured moderation snapshots (static scan + VT/LLM merged verdict, reason codes, and evidence) on skills and versions (#333) (thanks @ArthurzKV).
- Skills: make published skill licensing explicit and fixed to MIT-0; require publish consent, surface no-attribution messaging in web/CLI/API, and remove per-skill license metadata.
- Skill metadata: support env vars, dependency declarations, author, and links in parsed manifest metadata + install UI (#360) (thanks @mahsumaktas).
- Rate limiting: apply authenticated quotas by user bucket (vs shared IP), emit delay-based reset headers, and improve CLI 429 guidance/retries (#412) (thanks @lc0rp).
- Skills: reserve deleted slugs for prior owners (90-day cooldown) to prevent squatting; add admin reclaim flow (#298) (thanks @autogame-17).
- Moderation: ban flow soft-deletes owned skills (reversible) and removes them from vector search (#298) (thanks @autogame-17).
- Security/moderation: add bounded explainable auto-ban reasons for scam comments and protect moderator/admin accounts from automated bans.
- Moderation: banning users now also soft-deletes their authored comments (skill + soul), including legacy cleanup on re-ban.
- Quality gate: language-aware word counting (`Intl.Segmenter`) and new `cjkChars` signal to reduce false rejects for non-Latin docs.
- Jobs: run skill stat event processing every 5 minutes (was 15).
- Deploy: add frontend/backend drift detection plus hardened production smoke/deploy checks.
- API performance: batch resolve skill/soul tags in v1 list/get endpoints (fewer action->query round-trips) (#112) (thanks @mkrokosz).
- LLM helpers: centralize OpenAI Responses text extraction for changelog/summary/eval flows (#502) (thanks @ianalloway).
- Search/listing performance: cut embedding hydration and badge read bandwidth via `embeddingSkillMap` + denormalized skill badges; shift stat-doc sync to low-frequency cron (#441) (thanks @sethconvex).
- Search/listing performance: move public browse/search hydration onto `skillSearchDigest`, add non-suspicious index paths, and split trending rebuilds to stay under Convex document limits.
### Fixed
- API: accept legacy CLI publish payloads during the v1 migration (#815).
- Auth/UI: surface OAuth callback failures in the web UI instead of swallowing them (#688).
- Skills: allow ownership healing when the previous owner was deleted/banned, and sanitize owner data in public payloads (#689, #793).
- CLI: validate explicit `install --force --version` targets before removing an existing local skill, preventing data loss when the requested version does not exist (#825) (thanks @jonathandeamer).
- Skills/Web: debounce search URL updates on `/skills` to keep typing responsive, and cancel stale pending navigations on external query changes (#587) (thanks @neeravmakwana).
- Upload: keep folder-picking enabled after page refresh by reapplying `webkitdirectory`/`directory` on the file input ref (#551) (thanks @MunemHashmi).
- CLI publish: use a longer multipart upload timeout and normalize abort rejections into proper Errors (#550) (thanks @MunemHashmi).
- CLI: forward optional auth tokens for `search` and `explore` against authenticated registries (#608) (thanks @artdaal).
- CLI: respect `HTTPS_PROXY`/`HTTP_PROXY`/`NO_PROXY` env vars for outbound registry requests, with troubleshooting docs (#363) (thanks @kerrypotter).
- CLI: preserve registry base paths when composing API URLs for search/inspect/moderation commands (#486) (thanks @Liknox).
- CLI: show manual URL guidance when automatic browser opening is unavailable; add regression tests for opener errors (#163) (thanks @aronchick).
- API/CLI: expose skill security status in version inspect output, with schema wiring and CLI regression coverage (#362) (thanks @abutbul).
- Moderation: remove over-broad keyword flags for common auth/payment/crypto terms so legitimate skills stop tripping regex prefilters (#273) (thanks @superlowburn).
- Skills hard-delete: delete `commentReports` rows during moderation cleanup to avoid orphaned report records.
- Comments: hide entries authored by deleted/deactivated users in `comments:listBySkill`.
- Admin API: `POST /api/v1/users/reclaim` now performs non-destructive root-slug owner transfer
(preserves existing skill versions/stats/metadata) and clears active slug reservations.
- VirusTotal: use shared AV-engine fallback verdict mapping for pending/backfill flows and keep undetected-only results pending (#591) (thanks @Shuai-DaiDai).
- Skills/listing: keep non-suspicious browse pagination on one cursor family during `isSuspicious` backfill, and re-sync stale `latestVersionSummary` metadata fields (#572) (thanks @sethconvex).
- PWA: update `manifest.json` branding so installed apps show the correct ClawHub name (#569) (thanks @Glucksberg).
- Search/tests: cover soft-deleted skill filtering in vector hydration and lexical exact-slug fallback (#552) (thanks @MunemHashmi).
- Docs/dev: fix local setup instructions for Node support, Convex env vars, frontend port, and post-seed stats refresh (#584) (thanks @jack-piplabs).
- Docs/CLI: fix `explore` flag list indentation so `--limit` renders correctly in the command reference (#601) (thanks @gandli).
- Skill metadata: parse top-level `requires.*`, `primaryEnv`, and homepage fallbacks for security review accuracy (#548) (thanks @MunemHashmi).
- Users: sync handle on ensure when GitHub login changes (#293) (thanks @christianhpoe).
- Users/Auth: throttle GitHub profile sync on login; also sync avatar when it changes (#312) (thanks @ianalloway).
- Upload gate: fetch GitHub account age by immutable account ID (prevents username swaps) (#116) (thanks @mkrokosz).
- VT fallback: activate only VT-pending hidden skills when scans are unavailable/stale; keep quality/scanner-blocked skills hidden (#300) (thanks @superlowburn).
- API: return proper status codes for delete/undelete errors (#35) (thanks @sergical).
- API: for owners, return clearer status/messages for hidden/soft-deleted skills instead of a generic 404.
- HTTP/CORS: add preflight handler + include CORS headers on API/download errors; CLI: include auth token for owner-visible installs/updates (#146) (thanks @Grenghis-Khan).
- CLI: clarify `logout` only removes the local token; token remains valid until revoked in the web UI (#166) (thanks @aronchick).
- CLI: validate skill slugs used for filesystem operations (prevents path traversal) (#241) (thanks @superlowburn).
- Skills: keep global sorting across pagination on `/skills` (thanks @CodeBBakGoSu, #98).
- Skills: allow updating skill description/summary from frontmatter on subsequent publishes (#312) (thanks @ianalloway).
- Skills/Web: prevent filtered pagination dead-ends and loading-state flicker on `/skills`; move highlighted browse filtering into server list query (#339) (thanks @Marvae).
- Web: align `/skills` total count with public visibility and format header count (thanks @rknoche6, #76).
- Skills/Web: centralize public visibility checks and keep `globalStats` skill counts in sync incrementally; remove duplicate `/skills` default-sort fallback and share browse test mocks (thanks @rknoche6, #76).
- Moderation: clear stale `flagged.suspicious` flags when VirusTotal rescans improve to clean verdicts (#418) (thanks @Phineas1500).
- API tests: lock `Retry-After` behavior to relative-delay semantics for v1 search 429s (#421) (thanks @apoorvdarshan).
- CLI tests: assert 5xx HTTP responses still perform retry attempts before surfacing final error (#457) (thanks @YonghaoZhao722).
- GitHub import: improve storage/publish failure errors with actionable context; add regression tests for error formatting (#512) (thanks @vassiliylakhonin).
## 0.7.0 - 2026-02-16
Reconstructed from the `clawhub@0.7.0` npm publish timestamp (`2026-02-16T05:02:25Z`) and the repo version bump commit (`e352309`).
### Added
- Skills/Web: show owner avatars/handles across cards, lists, and detail pages (#312) (thanks @ianalloway).
- Skills/Web: add version file viewer on skill detail pages (#44) (thanks @regenrek).
- CLI: add `uninstall` for installed skills (#241) (thanks @superlowburn).
- Skills/Web: add non-suspicious browse filter, downloads-first browse defaults, and popular non-suspicious homepage sections.
- Web: compact-format skill and soul stats, plus split page models for skills/detail rendering.
- Skills: auto-generate missing summaries and add a resumable/self-scheduling summary backfill job.
- Moderation/Admin: add anti-spam publish caps, trust-tier quality checks, empty-skill cleanup tooling, and stronger moderator UX.
### Changed
- HTTP/CLI: centralize CORS handling and allow tokenized owner-visible reads through the CLI (#296, #297).
- API performance: batch resolve tags in v1 list/get flows to cut action-to-query round-trips (#112) (thanks @mkrokosz).
- Quality gate: add language-aware word counting and tighten spam/quarantine handling around publish flows.
### Fixed
- Skills/Web: fix initial sort wiring, keep global ordering across pagination, prevent pagination dead-ends/flicker, and harden cursor recovery (#92, #98, #339).
Welcome! ClawHub is the public skill registry for [OpenClaw](https://github.com/openclaw/openclaw). We appreciate bug fixes, documentation improvements, and feature contributions.
- **Questions?** Ask in [#clawhub on Discord](https://discord.gg/clawd).
- **Bug fixes** — PRs are welcome.
- **New features or architectural changes** — please start with a Discord conversation in #clawhub first so we can align on scope.
## Local Development Setup
### Prerequisites
- [Bun](https://bun.sh/) (Convex CLI runs via `bunx`, no global install needed)
- [Node.js](https://nodejs.org/) v18, 20, 22, or 24 (required by the local Convex backend; v25+ is not yet supported)
### Install and configure
```bash
bun install
cp .env.local.example .env.local
```
Edit `.env.local` with the following values for **local Convex**:
```bash
# Frontend
VITE_CONVEX_URL=http://127.0.0.1:3210
VITE_CONVEX_SITE_URL=http://127.0.0.1:3210
SITE_URL=http://localhost:3000
# Deployment used by `bunx convex dev`
CONVEX_DEPLOYMENT=anonymous:anonymous-clawhub
```
### GitHub OAuth App (for login)
1. Go to [github.com/settings/developers](https://github.com/settings/developers) and create a new OAuth App.
2. Set **Homepage URL** to `http://localhost:3000`.
3. Set **Authorization callback URL** to `http://127.0.0.1:3210/api/auth/callback/github`.
4. Copy the Client ID and generate a Client Secret.
### Run the Convex backend
Start the local Convex backend first — other setup steps depend on it:
```bash
bunx convex dev --typecheck=disable
```
### Set backend environment variables
The Convex backend has its own env var store separate from `.env.local`. With the backend running, open a new terminal and set the required variables:
```bash
bunx convex env set AUTH_GITHUB_ID <your-client-id>
bunx convex env set AUTH_GITHUB_SECRET <your-client-secret>
bunx convex env set SITE_URL http://localhost:3000
```
### JWT keys (for Convex Auth)
With the backend still running, generate the signing keys:
```bash
bunx @convex-dev/auth
```
This sets `JWT_PRIVATE_KEY` and `JWKS` on the Convex backend and outputs values you can also save to `.env.local` for reference.
### Run the frontend
```bash
bun run dev -- --port 3000
```
Change the port if 3000 is already in use, and update `SITE_URL` in both `.env.local` and the Convex backend (`bunx convex env set SITE_URL ...`) to match.
### Seed the database
Populate sample data so the UI isn't empty:
```bash
# 3 sample skills (padel, gohome, xuezh)
bunx convex run --no-push devSeed:seedNixSkills
# 50 extra skills for pagination testing (optional)
bunx convex run --no-push devSeedExtra:seedExtraSkillsInternal
# Refresh the cached skills count (required after seeding)
bunx convex run --no-push statsMaintenance:updateGlobalStatsInternal
```
To reset and re-seed:
```bash
bunx convex run --no-push devSeed:seedNixSkills '{"reset": true}'
```
### Optional environment variables
These features degrade gracefully without their keys:
To show CLI help (recommended for nix plugins), include the `cli --help` output:
```yaml
---
name:padel
description:Check padel court availability and manage bookings via Playtomic.
metadata:{"clawdbot": { "cliHelp": "padel --help\\nUsage: padel [command]\\n"}}
---
```
`metadata.clawdbot` is preferred, but `metadata.clawdis` and `metadata.openclaw` are accepted as aliases.
## Skill metadata
Skills declare their runtime requirements (env vars, binaries, install specs) in the `SKILL.md` frontmatter. ClawHub's security analysis checks these declarations against actual skill behavior.
Full reference: [`docs/skill-format.md`](docs/skill-format.md#frontmatter-metadata)
- Desktop overview shows ClawScan-first current verdict totals, pipeline status, recent scan window, category rollups, and failed scan samples.
- Desktop drilldown shows a selected artifact with ClawScan verdict/category/summary first, followed by pipeline status and supporting scanner evidence.
- Mobile view keeps the management security overview usable at narrow width without overlapping controls.
"text":"Self-reflection + Self-criticism + Self-learning + Self-organizing memory. Agent evaluates its own work, catches mistakes, and improves permanently. Use when..."
},
{
"className":"skill-card-footer",
"text":"by@ivangdavilaUpdated 3w ago1.2k·195k"
}
],
"tagsBelowSummary":false,
"authorToUpdatedGap":14
},
{
"step":"mobile grid context",
"viewport":"mobile",
"children":[
{
"className":"skill-card-tags",
"text":"LinuxmacOSWindows"
},
{
"className":"skill-card-header",
"text":"Self-Improving + Proactive Agent"
},
{
"className":"skill-card-summary",
"text":"Self-reflection + Self-criticism + Self-learning + Self-organizing memory. Agent evaluates its own work, catches mistakes, and improves permanently. Use when..."
"text":"Self-reflection + Self-criticism + Self-learning + Self-organizing memory. Agent evaluates its own work, catches mistakes, and improves permanently. Use when..."
},
{
"className":"skill-card-tags",
"text":"LinuxmacOSWindows"
},
{
"className":"skill-card-footer",
"text":"by@ivangdavilaUpdated 3w ago1.2k·195k"
}
],
"tagsBelowSummary":true,
"authorToUpdatedGap":8
},
{
"step":"mobile grid context",
"viewport":"mobile",
"children":[
{
"className":"skill-card-header",
"text":"Self-Improving + Proactive Agent"
},
{
"className":"skill-card-summary",
"text":"Self-reflection + Self-criticism + Self-learning + Self-organizing memory. Agent evaluates its own work, catches mistakes, and improves permanently. Use when..."
- Rendered the account-ban and artifact-level scanner rejection emails from the real email builders; the account-ban email no longer includes scan-results appeal guidance, while the artifact-level email still includes local scan guidance.
- Captured the dedicated banned-account appeal page from a running local ClawHub preview after `/dashboard?error_description=Account%20banned` redirected to `/account-banned`.
- Rendered the account-ban and artifact-level scanner rejection emails from the real email builders.
- Captured the banned-account sign-in copy from a full-stack local ClawHub preview with local Convex on `/dashboard?error_description=Account%20banned`.
- Rendered the account-ban and artifact-level scanner rejection emails from the real email builders.
- Captured the banned-account sign-in copy from a full-stack local ClawHub preview with local Convex on `/dashboard?error_description=Account%20banned`.
Backend: production Convex read data (`wry-manatee-359`).
Pages captured:
-`/skills?sort=installs&dir=desc` showing prod skill rows and install sort.
-`/search?q=swarm` showing prod search results.
-`/chair4ce/swarm` showing a prod-backed skill detail page.
Note: default `/plugins` was not used because this PR head can request `sort=recommended`, which requires matching backend code that is not deployed to prod yet.
Some files were not shown because too many files have changed in this diff
Show More
Reference in New Issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.