Skip to content

feat(integrations): suggest curated skills per integration with one-click add#4912

Merged
waleedlatif1 merged 6 commits into
stagingfrom
feat/integration-skills
Jun 8, 2026
Merged

feat(integrations): suggest curated skills per integration with one-click add#4912
waleedlatif1 merged 6 commits into
stagingfrom
feat/integration-skills

Conversation

@waleedlatif1

Copy link
Copy Markdown
Collaborator

Summary

  • Curated, research-backed skills for all 193 catalog integrations, surfaced on each integration's detail page with one-click "Add" (creates a workspace skill via the existing useCreateSkill flow)
  • Every skill is capability-grounded — its steps only use operations the block actually exposes (tools.access) — and validated across 3 audit passes against live online sources
  • New SuggestedSkill type + optional skills field on BlockMeta; getSuggestedSkillsForBlock() resolves versioned catalog types (e.g. notion_v2) to the base meta
  • New skills section component on the integration detail page with add / "Added" states (matched by skill name against existing workspace skills)
  • integration_skill_added PostHog event capturing workspace_id, integration_type, skill_name, position, skill_count

Type of Change

  • New feature

Testing

Tested manually. Typecheck clean, biome lint/format clean, API-validation audit passes; verified all 193 catalog integrations resolve ≥2 grounded skills.

Checklist

  • Code follows project style guidelines
  • Self-reviewed my changes
  • Tests added/updated and passing
  • No new warnings introduced
  • I confirm that I have read and agree to the terms outlined in the Contributor License Agreement (CLA)

…lick add

Curate research-backed, capability-grounded skills for every catalog
integration and surface them on the integration detail page. Each skill
maps to operations the block actually supports and can be added to the
workspace in one click; track adds in PostHog.

- Add SuggestedSkill type + skills field on BlockMeta; populate skills
  for all 193 catalog integrations (3 audit passes for grounding/sourcing)
- getSuggestedSkillsForBlock() with versioned-type (e.g. notion_v2) base fallback
- Skills section on the integration detail page with add/added states
- integration_skill_added PostHog event with workspace/integration metadata
@vercel

vercel Bot commented Jun 8, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

1 Skipped Deployment
Project Deployment Actions Updated (UTC)
docs Skipped Skipped Jun 8, 2026 10:25pm

Request Review

@cursor

cursor Bot commented Jun 8, 2026

Copy link
Copy Markdown

PR Summary

Medium Risk
Large catalog/content surface area and many new workspace skills created from suggested markdown; execution risk is low if skills stay grounded in exposed tools, but bad suggestions could mislead agents.

Overview
Adds curated integration skills to the catalog: optional skills on {Service}BlockMeta (SuggestedSkill with name, description, markdown content), resolved via getSuggestedSkillsForBlock (including fallback from versioned types like notion_v2 to the base meta).

On each integration detail page, a new Skills section lists those suggestions with Add / Added state (matched to workspace skill names through useCreateSkill / useSkills), shared SkillTile chrome with the Skills page, and integration_skill_added PostHog tracking.

Authoring rules are tightened in add-block / validate-integration docs and blocks/AGENTS.md: skills must align with tools.access and real use cases. The diff also seeds skills arrays across many block meta files (large catalog/content expansion beyond the UI wiring shown in the first files).

Reviewed by Cursor Bugbot for commit 04ca966. Configure here.

…r add

The row derived Added state solely from the useSkills cache, so between a
successful create and the list refetch the row still showed Add and could
be clicked again, hitting the server duplicate-name check. Track added
names in local state so the row reflects the add immediately.
@waleedlatif1

Copy link
Copy Markdown
Collaborator Author

@greptile

@waleedlatif1

Copy link
Copy Markdown
Collaborator Author

@cursor review

@greptile-apps

greptile-apps Bot commented Jun 8, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

This PR adds curated skill suggestions to all 193 integration detail pages, with one-click "Add" buttons that create workspace skills via the existing useCreateSkill mutation. It also optimises the mutation's onSuccess handler to immediately merge the new skill into the query cache before the background invalidation refetch lands.

  • New SuggestedSkill type + BlockMeta.skills field: Each block file gets 3–5 curated skills; getSuggestedSkillsForBlock() handles versioned type look-ups (e.g. notion_v2) by falling back to the base meta's skills.
  • IntegrationSkillsSection component: Displays the skill list with per-row "Add / Adding… / Added" state; concurrent adds are tracked via a Set (both useState and a useRef guard) and errors surface a toast.
  • SkillTile extracted to shared component: Moved from skills.tsx into workspace/[workspaceId]/components/skill-tile/ and re-exported from the barrel, so both consumers share the same source.

Confidence Score: 5/5

Safe to merge — the changes are additive (static curated data on block metas, a new UI section, and a cache-merge optimisation) and do not touch any execution, auth, or data-persistence paths.

All changed paths are either pure static data (skills fields on BlockMeta), UI-only (the new section component), or a narrow query-cache improvement in useCreateSkill's onSuccess. The concurrent-add guard uses both a ref and a Set, error handling toasts on failure, and getSuggestedSkillsForBlock correctly handles versioned type look-ups. No mutations to execution logic, auth, or database schema are present.

No files require special attention.

Important Files Changed

Filename Overview
apps/sim/app/workspace/[workspaceId]/integrations/[block]/integration-skills-section.tsx New component rendering curated skills per integration with add/added/pending states. Concurrent-add guard uses both a ref and a Set; error handling toasts on failure.
apps/sim/hooks/queries/skills.ts Adds optimistic cache merge (by skill ID) in onSuccess before invalidation, so the Added state reflects immediately after a create without waiting for the refetch.
apps/sim/blocks/registry.ts Adds getSuggestedSkillsForBlock(); correctly falls back from versioned type meta to base meta when skills are absent on the versioned entry.
apps/sim/blocks/types.ts Adds SuggestedSkill interface and optional skills field on BlockMeta; shapes match skillUpsertItemSchema constraints (name kebab-case, max lengths).
apps/sim/app/workspace/[workspaceId]/components/skill-tile/skill-tile.tsx Extracted shared SkillTile component; exported from workspace barrel and consumed by both skills.tsx and integration-skills-section.tsx to prevent drift.
apps/sim/app/workspace/[workspaceId]/integrations/[block]/integration-block-detail.tsx Wires getSuggestedSkillsForBlock and conditionally renders IntegrationSkillsSection; minimal change with correct guard (length > 0).
apps/sim/lib/posthog/events.ts Adds integration_skill_added event with workspace_id, integration_type, skill_name, position, skill_count fields.

Sequence Diagram

sequenceDiagram
    participant Page as IntegrationBlockDetail
    participant Section as IntegrationSkillsSection
    participant Hook as useCreateSkill
    participant Cache as React Query Cache
    participant API as POST /api/skills

    Page->>Page: getSuggestedSkillsForBlock(type)
    Page->>Section: skills[], workspaceId, integrationType

    Note over Section: useSkills() → existingNames Set
    Note over Section: skillsReady = !isPending && !isPlaceholderData

    Section->>Section: User clicks Add
    Section->>Section: inFlightRef.add(name) + setPendingNames
    Section->>Hook: "mutateAsync({ workspaceId, skill })"
    Hook->>API: "POST /api/skills { skills:[{name,desc,content}], workspaceId }"
    API-->>Hook: "{ success: true, data: SkillDefinition[] }"
    Hook->>Cache: setQueryData — merge new skills by ID
    Hook->>Cache: invalidateQueries (background refetch)
    Cache-->>Section: "existingNames updated → added=true"
    Section->>Section: captureEvent integration_skill_added
    Section->>Section: finally: pendingNames.delete(name)
Loading

Reviews (6): Last reviewed commit: "chore(integrations): drop local-variable..." | Re-trigger Greptile

…thoring

Address PR review feedback on the suggested-skills section:
- Make useSkills the single source of truth for Added state by writing the
  created skill into the React Query cache onSuccess (fixes stale Added that
  survived a delete, and the lag that allowed a duplicate click)
- Track in-flight adds in a Set so concurrent adds keep independent pending
  state and cannot be double-submitted
- Surface failures with toast.error instead of swallowing the rejection
- Extract the duplicated SkillTile into a shared workspace component

Also document the new BlockMeta.skills field in the add-block and
validate-integration skills (+ blocks AGENTS.md): skills must be grounded in
the block's tools.access and sourced from real online use cases, never invented.
@waleedlatif1

Copy link
Copy Markdown
Collaborator Author

@cursor review

@waleedlatif1

Copy link
Copy Markdown
Collaborator Author

@greptile

…ursor docs

- Guard handleAdd with a ref so two rapid clicks cannot both fire a create
  before the disabled state re-renders (pendingNames is async)
- Fold the create-cache-merge rationale into the hook's TSDoc and drop
  non-TSDoc inline comments to match the repo convention
- Align .cursor add-block/validate-integration command docs with the newer
  .claude/.agents versions: BlockMeta section + skills authoring/validation
  guidance (grounded in tools.access, sourced from real online use cases)
@waleedlatif1

Copy link
Copy Markdown
Collaborator Author

@cursor review

@waleedlatif1

Copy link
Copy Markdown
Collaborator Author

@greptile

…ills

useSkills uses keepPreviousData, so during initial load or a workspace switch
the list could be empty or a prior workspace's placeholder — making rows show
a misleading Add (duplicate-submittable) or a false Added. Derive skillsReady
from !isPending && !isPlaceholderData, only mark Added when ready, and disable
Add until the current workspace's list has loaded.
Keep to the repo's TSDoc-on-declarations convention — the in-flight guard and
skillsReady derivation are self-evident from naming.
@waleedlatif1

Copy link
Copy Markdown
Collaborator Author

@cursor review

@waleedlatif1

Copy link
Copy Markdown
Collaborator Author

@greptile

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ Bugbot reviewed your changes and found no new issues!

Comment @cursor review or bugbot run to trigger another review on this PR

Reviewed by Cursor Bugbot for commit 04ca966. Configure here.

@waleedlatif1

Copy link
Copy Markdown
Collaborator Author

@greptile review

1 similar comment
@waleedlatif1

Copy link
Copy Markdown
Collaborator Author

@greptile review

@waleedlatif1 waleedlatif1 merged commit e257d06 into staging Jun 8, 2026
12 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant