From Dart Helper Utils
Migrates dart_helper_utils v5 to v6, handling renames, removed features, and compile errors. Run before upgrading or after bumping dependency.
How this skill is triggered — by the user, by Claude, or both
Slash command
/dart-helper-utils:migrate-dart-helper-utils-v5-to-v6The summary Claude sees in its skill listing — used to decide when to auto-load this skill
v6 is a large breaking release: all conversion logic moved to the
v6 is a large breaking release: all conversion logic moved to the
convert_object package (re-exported, so one DHU import still works),
several features moved to standalone packages, and many members were
renamed or removed. Source and target: any 5.x (and the same checklist
covers 4.x code, which mostly compiled unchanged under 5.x) to 6.x.
grep -A2 'dart_helper_utils' pubspec.lock.
Already >= 6.0.0 means only leftover compile errors need the tables here,
not the dependency change.grep -rln "package:dart_helper_utils" lib/ test/
# v5-only symbols that will break:
grep -rnE "ConvertObject\.|ParsingException|toString1|altKeys|firstValueForKeys|firstElementForIndices|httpFormat|flatJson|makeEncodable|safelyEncodedJson|DoublyLinkedList|Paginator|InfinitePaginator|AsyncPaginator|StringSimilarity|similarityTo|compareWith|DHUCountry|DHUTimezone|convertTo<" lib/ test/
# bare top-level conversion helpers (v5):
grep -rnE "\b(toNum|toInt|toDouble|toBool|toDateTime|toUri|toList|toSet|toMap|toBigInt|toType|tryTo[A-Z][a-zA-Z]*)\(" lib/ test/
For a large codebase, delegate the sweep to a read-only search subagent and have it return the file list with per-symbol counts.
dart_helper_utils: ^6.0.2 (SDK ^3.10.0);
dart pub get. Solver conflicts usually mean an old SDK constraint or a
direct pin on pre-1.1 convert_object.ConvertObject. to Convert., toString1 to
Convert.string, bare toInt(x) to convertToInt(x),
ParsingException to ConversionException (context is e.context),
altKeys: to alternativeKeys:, firstValueForKeys to tryGetRaw,
httpFormat to httpDateFormat, flatJson to flatMap,
makeEncodable/safelyEncodedJson to toJsonSafe()/toJsonString().doubly_linked_list package.similarityTo/compareWith:
string_search_algorithms package (algorithm enum renamed, e.g.
levenshteinDistance to levenshtein).obj.isInt/isDouble/isNull object getters: standard Dart checks or
tryConvertToInt(obj) != null.list.convertTo<T>(): convertToList<T>(list) (Set keeps
convertTo).firstOrNull, groupBy, mapIndexed,
whereNotNull, ... now come from the re-exported package:collection;
the same names keep working with ONE DHU import. Ambiguous-extension
errors mean a file imports both DHU and collection (or old DHU
leftovers) - keep a single provider per file.dart analyze and iterate until clean.alternativeKeys (all typed map getters) now picks the first NON-null
value; a present-but-null key no longer short-circuits. Audit sites that
relied on the old behavior; use containsKey to distinguish absence.tryToBool returns null (not false) for unknown values; add ?? false
where a false fallback was assumed.(123) as -123);
set NumberOptions(strictParsing: true) via Convert.configure to keep
strict v5 behavior.UriOptions(detectEmails: false, detectPhoneNumbers: false).toDateTime now accepts numeric epochs (seconds or milliseconds by
magnitude).percentile now takes 0-100 (v5 took 0-1): values.percentile(0.5)
must become values.percentile(50).TimeUtils.throttle signature changed from named duration:/function:
to positional (func, interval, {leading, trailing, onError}) returning a
callable ThrottledCallback with cancel/dispose.TimeUtils.runWithTimeout now completes with TimeoutException while the
task keeps running (late errors swallowed).tryRemoveWhere now takes a predicate and actually removes.setIfMissing checks key presence, not null values.getRandom on an empty iterable throws StateError; randomInRange
validates min <= max.concatWithSingleList/concatWithMultipleList return the non-empty side
when one side is empty.2.secondsDelay(), not 2.secDelay
(a v4-to-v5 change that often surfaces here).ParsingException text or inspected e.parsingInfo:
rewrite against ConversionException.context/fullReport().(x as dynamic).toInt()): greps cannot find these;
rely on the recorded test baseline.dart analyze clean, then the full test suite compared against the
pre-migration baseline.alternativeKeys, bool-parsing, and percentile
call sites (the silent behavior changes).// v5
final id = ConvertObject.toInt(json, mapKey: 'id');
final name = ConvertObject.toString1(json['name']);
final raw = json.firstValueForKeys('a', altKeys: ['b']);
final when = date.httpFormat;
final p = scores.percentile(0.9);
try { ... } on ParsingException catch (e) { log(e.parsingInfo.toString()); }
// v6
final id = Convert.toInt(json, mapKey: 'id');
final name = Convert.string(json['name']);
final raw = json.tryGetRaw('a', alternativeKeys: ['b']);
final when = date.httpDateFormat;
final p = scores.percentile(90);
try { ... } on ConversionException catch (e) { log(e.fullReport()); }
npx claudepluginhub omar-hanafy/dart_helper_utils --plugin dart-helper-utilsCreates, edits, and verifies skills using a test-driven development approach with pressure scenarios and subagents.