Skip to content

Split setup into focused commands and improve meta skills#37

Merged
LadyBluenotes merged 6 commits intomainfrom
meta-skills-feedback-improvements
Mar 5, 2026
Merged

Split setup into focused commands and improve meta skills#37
LadyBluenotes merged 6 commits intomainfrom
meta-skills-feedback-improvements

Conversation

@KyleAMathews
Copy link
Collaborator

Summary

Replace the monolithic intent setup command with three focused commands and apply 9 improvements to meta skill SKILL.md files based on real scaffolding runs (durable-streams, ElectricSQL).

User-visible impact: Library maintainers get a new intent edit-package-json command that automatically wires package.json for skill publishing (including safe handling of existing CLIs), and improved meta skill instructions that produce better results during scaffolding.

Approach

CLI refactoring

intent setup --shim --workflows --all → three single-purpose commands:

Old New What it does
setup --shim add-library-bin Generates bin/intent.{js,mjs} bridge file
(manual) edit-package-json Adds skills, bin, !skills/_artifacts to files; adds bin.intent entry
setup --workflows setup-github-actions Copies CI workflow templates with variable substitution

The new edit-package-json is entirely new functionality — the old setup never touched package.json contents. It handles three bin scenarios safely:

  • No bin field — creates { intent: "./bin/intent.{ext}" }
  • Object bin — adds intent alongside existing entries
  • String bin shorthand — converts to object form preserving the existing entry

Meta skill improvements

Based on feedback from two real scaffolding runs:

  • domain-discovery: Softened lightweight path threshold to judgment call, softened exhaustive reading guidance, added companion library exclusion and experimental features questions, added YAML validation step
  • tree-generator: Replaced manual package.json wiring prose with edit-package-json reference
  • generate-skill: Added subagent guidance for parallel per-skill generation, added maintainer review cadence preference, replaced inline feedback section with pointer to feedback-collection skill
  • feedback-collection: Added note that this skill covers meta-skill feedback about the scaffolding process itself
  • All three inline feedback template sections removed (consolidated into feedback-collection)

Error handling improvements

  • runEditPackageJson: try-catch around JSON.parse with actionable error message
  • detectVars and detectShimExtension: distinguish ENOENT (silent fallback) from parse/permission errors (warning)
  • Missing package.json sets process.exitCode = 1

Non-goals

  • Did not add discriminated union types for result types (pragmatic choice for a CLI tool)
  • Did not add try-catch at CLI call sites (consistent with existing pattern across all commands)
  • Did not add atomic write-then-rename for package.json (vanishingly rare failure mode for small files)

Verification

cd packages/intent
pnpm build        # confirms setup.ts and cli.ts compile
pnpm test         # 124 tests pass (18 setup tests across 3 describe blocks)

Files changed

File Changes
src/setup.ts Refactored runSetuprunAddLibraryBin, runEditPackageJson, runSetupGithubActions with improved error handling
src/cli.ts Three new command handlers replacing setup; updated usage string and scaffold prompt
src/index.ts Updated public API exports
tests/setup.test.ts 18 tests across 3 describe blocks: shim generation, package.json editing (idempotency, bin preservation, indent preservation), workflow copying
meta/domain-discovery/SKILL.md Softened thresholds, added questions, added YAML validation, removed feedback section
meta/tree-generator/SKILL.md Updated package.json wiring instructions, removed feedback section
meta/generate-skill/SKILL.md Added subagent guidance, review cadence, replaced feedback section
meta/feedback-collection/SKILL.md Added meta-skill feedback scope note

🤖 Generated with Claude Code

KyleAMathews and others added 2 commits March 5, 2026 16:22
Replace `intent setup` with three focused commands:
- `intent add-library-bin` — generates the bin/intent bridge file
- `intent edit-package-json` — wires package.json for skill publishing
- `intent setup-github-actions` — copies CI workflow templates

Improve meta skill SKILL.md files based on real scaffolding feedback:
- Soften lightweight path threshold and narrative guide reading
- Add companion library and experimental features questions
- Add YAML validation step in domain discovery
- Add subagent guidance and review cadence preference in generate-skill
- Replace inline feedback sections with pointer to feedback-collection
- Update tree-generator to reference edit-package-json command

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@pkg-pr-new
Copy link

pkg-pr-new bot commented Mar 5, 2026

Open in StackBlitz

npm i https://pkg.pr.new/@tanstack/intent@37

commit: 53507aa

autofix-ci bot and others added 2 commits March 5, 2026 23:24
@github-actions github-actions bot mentioned this pull request Mar 5, 2026
KyleAMathews and others added 2 commits March 5, 2026 16:42
…lls/_artifacts in monorepos

Restore content accidentally removed in PR #34's merge conflict resolution:
- Hard rules section enforcing mandatory interactive interviews
- STOP gates after Phase 1c, 2e, 3i
- Interactive phase headings and preambles for Phases 2 and 4
- Expanded rules for Phases 2 and 4 (open-ended questions, wait for response)
- Monorepo cross-package question in Phase 2a
- Phase 3 docs file listing preamble
- packages field in domain_map.yaml schema
- Additional constraints table rows (interview interactivity, STOP gates, etc.)
- Cross-model compatibility notes about STOP gates and hard rules

Also fix !skills/_artifacts to only be added in non-monorepo packages,
since in monorepos _artifacts lives at repo root.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@LadyBluenotes LadyBluenotes merged commit e964e05 into main Mar 5, 2026
4 checks passed
@github-actions github-actions bot mentioned this pull request Mar 5, 2026
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.

2 participants