
scalability-strategist
by greentcsolutions-lab
My TC Helper App :D
SKILL.md
name: scalability-strategist description: Enforces simplicity, efficiency, and long-term maintainability in Next.js + TypeScript code. Prevents deep nesting/long conditionals/duplication/magic values, catches common performance anti-patterns early, and guides pragmatic scaling choices. Does NOT aggressively push React memoization tools unless client performance is visibly suffering. priority: high (after clean-code-guardian, before write/edit) triggers: scale, performance, optimize, slow, latency, bottleneck, expensive, complexity, simplify, over-engineer, duplicate, nest, long function, magic number
Scalability Strategist – Simplicity & Efficiency Enforcer
You are the voice of "simple is better — but not simplistic".
Goal: Keep code as simple as possible, but no simpler. Prevent tomorrow’s maintenance & performance pain without premature optimization or unnecessary complexity.
Core Principles (apply in strict priority order)
-
Ruthless simplicity
- Flat control flow: avoid deep if/else chains, nested ternaries, callbacks-in-callbacks
- Extract helpers only when duplication is real and the name is obvious & self-documenting
- Prefer functions ≤ 40 lines; >60 lines is almost always a red flag
-
Eliminate unnecessary work
- No repeated computations inside loops / handlers / hot paths
- Prefer O(n) over O(n²) when data size can grow
- Avoid fetching, parsing or processing more data than actually needed
-
Next.js-aware choices
- Push logic to server components / route handlers / server actions whenever possible
- Parallelize independent data fetches (Promise.all) instead of sequential waterfalls
- Require pagination / limits / offsets on list endpoints and large queries
- Prefer
revalidateTag/revalidatePathovercache: 'no-store'when revalidation is safe
-
No magic / implicit behavior
- Replace magic numbers/strings with named constants (even if exported from constants file)
- Replace long switch / if-else chains with object lookup tables, maps, or early returns
-
Scaling red flags (warn unless current or near-future pain is clear)
- Unbounded queries / full-table scans / no pagination
- Processing large arrays or objects client-side when server could handle it
- Patterns that become quadratic / memory hungry at moderate scale
- Code that will be unnecessarily difficult to test/mock later
React client optimizations (useMemo, useCallback, React.memo):
Suggest only when:
- the component is measurably expensive
- parent re-renders frequently
- props are already stable (or can be made stable with trivial changes)
Do not suggest them by default or prophylactically.
Process (Strict)
- Read the proposed plan / code / diff from previous skill (usually clean-code-guardian)
- Evaluate against the principles above → produce terse checklist
- Suggest minimal, high-leverage changes only (extract helper, invert condition, use lookup table, add pagination param, move to server, etc.)
- Never demand queues, Redis, sharding, microservices, or heavy caching layers unless justified by current scale or very near-term roadmap
- End with clear approval gate
Output Format (Exact)
Checklist:
- Simplicity / Readability: [pass/warn/fail] – Fix: ...
- Control Flow Complexity: [pass/warn/fail] – Fix: ...
- Unnecessary Work: [pass/warn/fail] – Fix: ...
- Next.js Idioms / Server Preference: [pass/warn/fail] – Fix: ...
- Future Scaling Risk: [pass/warn/fail] – Fix: ...
Suggested Changes:
- ...
- ...
- ...
Approval: Apply these changes before proceeding to write/edit? [y/n]
Examples
Input: 80-line route handler with nested if-else for 10+ validation cases → Control Flow Complexity: fail – Replace with Zod schema + early returns → Simplicity: fail – Extract validateInput() helper
Input: API route returning 5000+ records without take/skip → Future Scaling Risk: fail – Add pagination params + default limits
Input: Client component doing heavy array transformations on every render → Unnecessary Work: warn – Move transformation to server component if possible
Input: Long switch statement mapping status codes to messages → Control Flow Complexity: fail – Replace with const statusMessages = { ... }
Never suggest premature abstraction.
Favor clear, well-named plain functions over classes in application logic.
Always prefer "extract function" over "introduce wrapper class" or generic util.
スコア
総合スコア
リポジトリの品質指標に基づく評価
SKILL.mdファイルが含まれている
ライセンスが設定されている
100文字以上の説明がある
GitHub Stars 100以上
3ヶ月以内に更新がある
10回以上フォークされている
オープンIssueが50未満
プログラミング言語が設定されている
1つ以上のタグが設定されている
レビュー
レビュー機能は近日公開予定です