Conversation
Prevent future release-please breakage by adding a restriction against manually editing CHANGELOG.md, which is managed by release-please.
Address review findings: - PS004 → PS018 (PS004 already taken by required-guards) - Clarify cumulative block lists in registry - Scope regex replace to @meta block only - Add CLI registration details and file manifest - Define preset severities and edge cases for custom blocks - Use existing compareVersions from core - Remove directives from interface (YAGNI)
- Add isValidSemver guard in PS018 to prevent compareVersions throw - Specify meta block boundary finding for --fix implementation - Use rule names (not IDs) as preset keys per convention - PS019 uses walkBlocks + isBlockType from existing utilities - Move Levenshtein to core/utils for reuse - Add explicit no-downgrade rule for --fix - Add documentation update plan - Expand files modified with grouped sections
Design for redesigned prs init command that auto-detects existing AI instruction files and offers migration inline. Supports two migration strategies: static import (fast, deterministic) and AI-assisted (skill + kick-start prompt). Includes multi-file import with modular .prs output structure. Key decisions: - Gateway choice: "Migrate existing" vs "Fresh start" - Modular output: project.prs + context.prs + standards.prs + etc. - prs migrate as alias to init migration path - Non-interactive: -y safe defaults, --import for explicit auto-import
10 tasks across 6 chunks covering: - Phase 1: clipboard, backup, migration prompt utilities - Phase 2: section merger + multi-file importer in @promptscript/importer - Phase 3: enriched migration candidates + enhanced init command - Phase 4: prs migrate command + CLI registration - Phase 5: SKILL.md docs + verification pipeline Reviewed and fixed: reserved keyword (autoImport), complete handler code, test coverage for LLM/backup flows, --files support.
Add importMultipleFiles() to merge sections from multiple AI instruction files into separate modular .prs files (context.prs, standards.prs, restrictions.prs, commands.prs, project.prs). Add emitModularFiles() to emitter.ts and export all new types from package index.
- Add MigrationCandidate interface with path, format, sizeBytes, sizeHuman, toolName - Change AIToolsDetection.migrationCandidates from string[] to MigrationCandidate[] - Expand INSTRUCTION_FILES to include .windsurfrules, .clinerules, .goosehints, augment-guidelines.md, codex.md - Add formatFileSize and toolNameForFile helpers with FILE_TOOL_NAMES lookup map - Update formatMigrationHint to display size and tool name per candidate - Add new fields to InitOptions (autoImport, backup, _forceMigrate, _forceLlm, _migrateFiles) - Add MigrateOptions interface - Add dedicated test suite in utils/__tests__/ai-tools-detector.spec.ts - Fix existing ai-tools-detector.spec.ts to include readFile mock - Update init.ts migration hint display logic to match new format
- Add gateway prompt showing migration candidates with size/tool info - Add strategy selection (static import vs AI-assisted migration) - Implement static migration flow using multi-file importer - Implement LLM migration flow with prompt generation and clipboard - Add backup handling before migration (git-aware defaults) - Extract skill installation into reusable installSkillToTargets() - Skills now always installed (not gated by --migrate flag) - Set exit code 2 when already initialized - Support _forceMigrate/_forceLlm internal flags for prs migrate - Support --auto-import flag for non-interactive static import
The init command now always installs the PromptScript skill to target directories (fresh start behavior), so the smoke test asserting skill absence without --migrate needs to be inverted.
Codecov Report❌ Patch coverage is 📢 Thoughts on this report? Let us know! |
- Add test for deduplication report display (deduplicatedCount > 0) - Add test for clipboard failure fallback (prints prompt to console) - Add test for emitEmptyProject when all imports fail - Add test for low-confidence review comment in emitModularFiles - Add test for readFile failure during size enrichment (catch block) - Add test for mergeSections with empty sections array
Bundle ReportChanges will increase total bundle size by 152.41kB (14.41%) ⬆️
Affected Assets, Files, and Routes:view changes for bundle: promptscript-cliAssets Changed:
|
Use counter variable instead of accessing .mock.calls on untyped mock to avoid TS2339 error in strict typecheck.
Owner
Author
Code reviewFound 2 issues:
promptscript/packages/cli/src/types.ts Lines 30 to 34 in e48fc30 promptscript/packages/cli/src/commands/migrate.ts Lines 17 to 21 in e48fc30
promptscript/packages/cli/src/utils/ai-tools-detector.ts Lines 349 to 353 in e48fc30 Generated with Claude Code - If this code review was useful, please react with 👍. Otherwise, react with 👎. |
- handleStaticMigration now filters candidates by _migrateFiles when provided, so prs migrate --files actually restricts which files are imported - formatMigrationHint now recommends "prs migrate" instead of the deprecated "prs init --migrate"
# Conflicts: # packages/cli/src/cli.ts
This was referenced Mar 22, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Redesigns
prs initto auto-detect existing AI instruction files and offer inline migration, plus addsprs migrateas a first-class command.prs initoffers "Migrate existing" vs "Fresh start" — no more passive hintsimportMultipleFiles()in@promptscript/importerwith section merger, dedup, modular output (project.prs + context.prs + standards.prs + restrictions.prs + commands.prs)prs migratecommand: alias to init migration path, supports--static,--llm,--filesflagsMigrationCandidatenow includes file size, format, and tool name for better UXprs initnow installs the PromptScript skill to all targets even without--migrate, so AI tools can help immediately.prs-backup/with timestamped dirs,--backupflag-yis safe (skips migration),-y --auto-importopts into static import for CINew files
packages/cli/src/utils/clipboard.ts— cross-platform clipboardpackages/cli/src/utils/backup.ts— backup + git detectionpackages/cli/src/utils/migration-prompt.ts— kick-start prompt generatorpackages/importer/src/merger.ts— section merge with per-block strategiespackages/importer/src/multi-importer.ts— batch import → modular .prspackages/cli/src/commands/migrate.ts—prs migratecommandBreaking changes
AIToolsDetection.migrationCandidatestype changed fromstring[]toMigrationCandidate[](internal CLI interface only)--migrateflag deprecated (still works, shows warning)Test Plan
pnpm run format— cleanpnpm run lint— 10/10 projects passpnpm run typecheck— 11/11 projects passpnpm prs validate --strict— no issuespnpm schema:check— up-to-datepnpm skill:check— all copies in syncprs initin repo with CLAUDE.md shows gateway promptprs init -y --auto-importin repo with instruction files produces modular .prsprs migrate --llmgenerates prompt and copies to clipboard