Manus에서 모든 스킬 실행
원클릭으로
원클릭으로
원클릭으로 Manus에서 모든 스킬 실행
시작하기$pwd:
optimize
// Code optimization for performance, memory, and readability. Use to improve existing code.
$ git log --oneline --stat
stars:214
forks:4
updated:2026년 4월 22일 14:40
SKILL.md
// Code optimization for performance, memory, and readability. Use to improve existing code.
End-of-task pipeline — simplify review, double review, tests, single analyze+test gate, changelog/docs. Use when you've finished implementing a task and want to harden it before committing. Does NOT commit or push; the user must ask explicitly.
Automates the full release process — analyzes changes, suggests version, updates CHANGELOG and pubspec.yaml, commits, tags, and pushes.
| name | optimize |
| description | Code optimization for performance, memory, and readability. Use to improve existing code. |
# Flutter SDK lives on Windows — run via powershell.exe from WSL:
powershell.exe -Command "cd '$(wslpath -w "$PWD")'; flutter run -d windows --profile"
# Open DevTools and analyze:
# - CPU Profiler
# - Memory
# - Performance overlay
| Before | After | Example |
|---|---|---|
| O(n²) | O(n log n) | Sorting |
| O(n²) | O(n) | Nested loops → Map/Set |
| O(n) | O(1) | Linear search → HashMap |
// BAD: O(n²)
for (final item in list1) {
if (list2.contains(item)) { ... }
}
// GOOD: O(n)
final set2 = list2.toSet();
for (final item in list1) {
if (set2.contains(item)) { ... }
}
// Reuse objects
final _dateFormat = DateFormat('yyyy-MM-dd'); // Once
// Use const
const _defaultPadding = EdgeInsets.all(16);
// Unsubscribe in dispose
@override
void dispose() {
_subscription.cancel();
_controller.dispose();
super.dispose();
}
// BAD: entire list rebuilds
ListView(
children: items.map((i) => ItemWidget(i)).toList(),
)
// GOOD: only visible items
ListView.builder(
itemCount: items.length,
itemBuilder: (context, index) => ItemWidget(items[index]),
)
// BAD
return Container(
padding: EdgeInsets.all(16), // Created every build
child: Text('Hello'),
);
// GOOD
return const Padding(
padding: EdgeInsets.all(16),
child: Text('Hello'),
);
// BAD: entire widget rebuilds when counter changes
class MyWidget extends StatefulWidget {
Widget build(context) {
return Column(
children: [
Text('Counter: $counter'), // Changes
HeavyWidget(), // Doesn't change but rebuilds
],
);
}
}
// GOOD: extract immutable parts
class MyWidget extends StatefulWidget {
Widget build(context) {
return Column(
children: [
CounterText(counter: counter),
const HeavyWidget(), // Doesn't rebuild
],
);
}
}
// BAD: sequential
final users = await fetchUsers();
final posts = await fetchPosts();
// GOOD: parallel
final results = await Future.wait([
fetchUsers(),
fetchPosts(),
]);
class CachedRepository {
final Map<String, User> _cache = {};
Future<User> getUser(String id) async {
if (_cache.containsKey(id)) {
return _cache[id]!;
}
final user = await _api.fetchUser(id);
_cache[id] = user;
return user;
}
}
Timer? _debounce;
void onSearchChanged(String query) {
_debounce?.cancel();
_debounce = Timer(const Duration(milliseconds: 300), () {
performSearch(query);
});
}
After optimization:
# Verify nothing is broken (Flutter SDK is on Windows only):
powershell.exe -Command "cd '$(wslpath -w "$PWD")'; flutter analyze --fatal-infos --fatal-warnings"
powershell.exe -Command "cd '$(wslpath -w "$PWD")'; flutter test"
# Check performance:
powershell.exe -Command "cd '$(wslpath -w "$PWD")'; flutter run -d windows --profile"
# Use Performance overlay (P in console)