Add configutation files for Claude Code plugin definition#172
Conversation
🤖 chore: sync skills directory from dart-lang/skills
There was a problem hiding this comment.
Code Review
This pull request adds Claude Code plugins, MCP server configurations, and a comprehensive set of Dart and Flutter skill guides, along with a synchronization script tool/sync_skills.dart. The code review identified several critical issues in the synchronization script, including cross-platform path separator mismatches on Windows, missing exit code checks and rename handling in git diff commands, silent failures when full synchronization fails, and a lack of defensive checks for the existence of the source directory. Additionally, a minor syntax typo (unmatched double quote) was flagged in the dart-migrate-to-checks-package skill documentation.
|
|
||
| await for (final entity in sourceSkillsDir.list(recursive: true)) { | ||
| if (entity is File) { | ||
| final relPath = entity.path.replaceFirst('$srcDir/skills/', ''); |
There was a problem hiding this comment.
On Windows, entity.path uses backslashes (\\) as path separators, whereas $srcDir/skills/ uses forward slashes (/). This mismatch causes replaceFirst to fail to match, leading to incorrect destination paths during a full sync.
Normalize the path separators to forward slashes before performing the replacement to ensure cross-platform compatibility.
| final relPath = entity.path.replaceFirst('$srcDir/skills/', ''); | |
| final relPath = entity.path.replaceAll('\\', '/').replaceFirst('${srcDir.replaceAll('\\', '/')}/skills/', ''); |
| ..has((e) => e.message, 'message').equals('invalid input'); | ||
|
|
||
| // NO (Passing a callback to sync throws will cause a compiler error!) | ||
| check(() => triggerSync").throws<ArgumentError>((it) => ...); // ERROR! |
There was a problem hiding this comment.
There is an unmatched double quote in the code example (triggerSync"). It should be triggerSyncError() to match the context of the example.
| check(() => triggerSync").throws<ArgumentError>((it) => ...); // ERROR! | |
| check(() => triggerSyncError()).throws<ArgumentError>((it) => ...); // ERROR! |
This PR adds
Tested by manually running the workflow to sync in dart-lang/skills.