skillRootStamp function

String skillRootStamp(
  1. List<FileInfo> entries
)

One root's stat-level stamp: the directory entries sorted by name, each rendered as name:kind:size:mtimeMs. A file edited in place inside a skill subdirectory usually bumps that subdirectory's mtime (and always its own, for flat <name>.md skills), so content edits surface here without ever reading content.

Implementation

String skillRootStamp(List<FileInfo> entries) {
  final sorted = [...entries]..sort((a, b) => a.name.compareTo(b.name));
  return [
    for (final entry in sorted)
      '${entry.name}:${entry.kind.name}:${entry.size}:${entry.mtimeMs}',
  ].join('|');
}