Add mcs pack validate command for local tech pack validation#310
Merged
Add mcs pack validate command for local tech pack validation#310
mcs pack validate command for local tech pack validation#310Conversation
- New ValidatePack subcommand with path/identifier resolution and severity-based findings (errors exit 1, warnings exit 0) - New PackHeuristics engine with 7 checks: empty pack, root source copy, missing settings files, unreferenced files, root-level content, MCP dependency gaps, python module paths - 21 unit tests for heuristics + 4 command parsing tests
- Add CLI reference, creating-tech-packs guide section, and schema heuristic checks - Update CLAUDE.md with command and architecture entries for ValidatePackCommand and PackHeuristics - Add quick links in README and docs index
…es, add tests - Replace 3 try? usages in PackHeuristics with do/catch that emit warning findings instead of silently returning empty - Distinguish "pack not found" from "registered but invalid path" in resolvePackPath - Add 7 new tests: configureProject branches, configure script references, full-path commands, -m edge case, filesystem errors
- Guard checkPythonModulePaths on python/python3 command to avoid false positives on non-Python MCP servers - Extract referencedPaths(from:) helper to deduplicate manifest iteration between two checks - Use array .contains(base) instead of chained == comparisons for runtime checks
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
Phase 3 of the three-tier pack validation strategy (Worker → GitHub Actions → CLI). Lets pack authors run
mcs pack validatelocally during development to catch structural errors and heuristic issues before submitting to the registry.mcs pack validate [source]— accepts a directory path, installed pack identifier, or defaults to CWDExternalPackLoader.validate(at:), then heuristic checks via newPackHeuristicsenginesource: ".", missing settings files) cause exit code 1; warnings (unreferenced files, MCP dependency gaps, python module paths, root-level content) exit 0-mmodule path verificationNew Files
Sources/mcs/Commands/ValidatePackCommand.swiftValidatePacksubcommand with path/identifier resolutionSources/mcs/ExternalPack/PackHeuristics.swiftTests/MCSTests/PackHeuristicsTests.swiftTests/MCSTests/ValidatePackCommandTests.swiftModified Files
Sources/mcs/Commands/PackCommand.swiftValidatePacksubcommandTests/MCSTests/PackCommandTests.swiftValidatePackcheckTest plan
swift test --filter MCSTests.PackHeuristicsTests— 19 heuristic tests passswift test --filter MCSTests.ValidatePackCommandTests— 4 command tests passswift test --filter MCSTests.PackCommandParsingTests— existing tests pass with new subcommandswift test— full suite (938 tests, 110 suites) passes with no regressionsswiftformat+swiftlintcleanmcs pack validate ~/Developer/bug-shepherd— reports unreferenced files + warningsmcs pack validate ~/Developer/morning-digest— reports empty pack error (exit 1)mcs pack validatein a valid pack directory — all checks passed