feat: register existing skills during maintainer setup #287
MergedLadyBluenotes(GitHub profile, opens in a new tab)merged 9 commits into
integration-tests fromrefs/pull/287/headmerged by LadyBluenotes(GitHub profile, opens in a new tab) - .changeset/guided-maintainer-adoption.md line 5OutdatedResolvedby coderabbitai[bot](GitHub profile, opens in a new tab)@@ -2,4 +2,4 @@22 '@tanstack/intent': minor33 ---445-Add guided adoption of existing package-owned skills with a read-only JSON plan, explicit batch registration and distribution choices, and interactive confirmation. Preserve authored guidance and prior records, reject stale plans, leave semantic review pending, and keep CI noninteractive.5+`maintainer setup` registers existing package-owned skills found under `skills/` directories that the skill tree does not record yet. Skill contents are preserved; the domain comes from `metadata.domain`, the domain map, or the parent directory, and defaults to `uncategorized` for the maintainer to edit. Invalid or conflicting skills are reported and left unregistered. Agent skill directories, dependencies, and packages outside the workspace are not scanned.@@ -197,4 +197,4 @@197197 'Set up, author, synchronize, and check library skills',198198 )199199 .usage(200- 'maintainer <setup|adopt|add|remove|status|sync|review|check> [name] [options]',200+ 'maintainer <setup|add|remove|status|sync|review|check> [name] [options]',packages/intent/src/maintainer/existing.ts line 134Resolvedby coderabbitai[bot](GitHub profile, opens in a new tab)@@ -0,0 +109,21 @@109+ frontmatter.name !== skill.name110+ )111+ throw new Error('Skill name must match its directory.')112+ if (113+ typeof frontmatter.description !== 'string' ||114+ !frontmatter.description.trim()115+ )116+ throw new Error('Skill needs a non-empty description.')117+ stringList(frontmatter.sources ?? [], 'sources')118+ stringList(frontmatter.requires ?? [], 'requires')119+ skill.domain = inferDomain(frontmatter, mapped, id)120+ } catch (error) {121+ skill.problems.push(122+ error instanceof Error ? error.message : String(error),123+ )124+ }125+ return [skill]126+ })127+ for (const skill of skills) {128+ if (129+ skills.some((other) => other.id !== skill.id && other.name === skill.name)
- packages/intent/tests/integration/packed-release.test.ts line 196Resolvedby coderabbitai[bot](GitHub profile, opens in a new tab)@@ -193,12 +193,4 @@193193 }194194 expect(run(['scaffold']).status).toBe(1)195195 const overview = run(['maintainer', '--help']).stdout196- for (const action of [197- 'setup',198- 'adopt',199- 'add',200- 'status',201- 'sync',202- 'review',203- 'check',204- ])196+ for (const action of ['setup', 'add', 'status', 'sync', 'review', 'check'])
- packages/intent/src/commands/maintainer.ts lines 292 to 303Resolvedby LadyBluenotes(GitHub profile, opens in a new tab)@@ -355,3 +276,21 @@355276 if (action === 'setup') {356277 const created = setupRecords(project)357278 configureDistribution(project, options)279+ const existing = findExistingSkills(project)280+ const candidates = existing.filter((skill) => !skill.problems.length)281+ const registered = planAddSkills(282+ project,283+ candidates.map((skill) => ({284+ name: skill.name,285+ options: {286+ package: skill.package || undefined,287+ path: skill.path,288+ domain: skill.domain,289+ },290+ })),291+ [],292+ (index, error) => {293+ candidates[index]!.problems.push(294+ error instanceof Error ? error.message : String(error),295+ )296+ },
Sign in to join this conversation.
Warning
Review limit reached#
Next included review available in 43 minutes.
Check out review usage here.
View limit details
Limit details: You’ve used all 2 included reviews currently available.
You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.
Learn how review limits work.
Review configuration:
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Advanced
Run ID:
69a4a905-58c1-49cd-84e8-94c790ab10ce📥 Commits
Reviewing files that changed from the base of the PR and between 89f13b96dc89bfb2b960cc9bf4de116f903729c6 and 7ca9700119973774afd7b31b6b0013e65b05aaf2.
📒 Files selected for processing (2)
packages/intent/src/commands/maintainer.tspackages/intent/tests/maintainer.test.ts📝 Walkthrough
Walkthrough#
maintainer setupnow discovers unregistered package-owned skills, validates them, infers domains, and registers valid skills. The separatemaintainer adoptworkflow, prompts, options, and tests are removed.Changes#
Maintainer setup flow
packages/intent/src/maintainer/existing.tsSKILL.mdfiles in workspace packages, excludes unsupported paths, validates metadata, detects duplicate names, and infers domains.packages/intent/src/commands/maintainer.ts,packages/intent/src/maintainer/add.ts,packages/intent/src/maintainer/project.ts,packages/intent/tests/maintainer.test.ts,benchmarks/intent/maintainer.bench.tsmaintainer setupregisters valid skills in one batch. Invalid candidates are reported without stopping valid registrations. Tests cover exclusions, idempotence, domain inference, invalid metadata, conflicts, and partial batch failures. A benchmark covers 20 and 200 existing skills.packages/intent/src/maintainer/adopt.ts,packages/intent/src/maintainer/adoption-prompts.ts,packages/intent/src/cli.ts,packages/intent/src/maintainer/distribution.ts,packages/intent/tests/integration/packed-release.test.ts,.changeset/guided-maintainer-adoption.mdmaintainer setupbehavior.Priority: ⬇️ Low
Estimated code review effort: 3 (Moderate) | ~25 minutes
Change: Feature
Sequence Diagram(s)#
Merge Risk: 🔵 Low · up to
89f13A blank domain mapping produces misleading recovery instructions, but setup otherwise remains usable and the mapping can be corrected manually.
🚥 Pre-merge checks | ✅ 4 | ❌ 1
❌ Failed checks (1 warning)#
✅ Passed checks (4 passed)
✨ Finishing Touches 💡 1
📝 Generate docstrings 💡
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.
❤️ Share