Back to list
nwiizo

memory-optimizer

by nwiizo

🛠️ Build. Learn. Ship. (and mass produce it.) — Systems programming, distributed systems, and AI infrastructure.

37🍴 0📅 Jan 20, 2026

SKILL.md


name: memory-optimizer description: Refactors CLAUDE.md into minimal startup context by extracting path-specific rules, skills, commands, and agents. Use when CLAUDE.md exceeds 50 lines, startup feels slow, memory needs restructuring, or splitting monolithic project instructions.

Memory Optimizer

Restructures .claude/CLAUDE.md using progressive disclosure to minimize startup tokens.

Decision Table

Signal in CLAUDE.mdExtract ToFrontmatter
File extensions (.ts, .py) or directories (src/api/).claude/rules/{topic}.mdpaths: {glob}
Multi-step workflow (3+ steps).claude/skills/{name}/SKILL.mdname:, description:
User-triggered template.claude/commands/{name}.mddescription:
Specialized task needing limited tools.claude/agents/{name}.mdname:, description:, tools:
Essential for ALL interactionsKeep in CLAUDE.md

Workflow

  1. Analyze: Read CLAUDE.md, count lines
  2. Categorize: Apply decision table to each section
  3. Plan: Present extraction table for approval
  4. Extract: Create files with proper frontmatter
  5. Refactor: Reduce CLAUDE.md to <50 lines
  6. Report: Show before/after line counts

Extraction Plan Format

Present before creating files:

| Content        | Extract To                     | Type    | Trigger/Path        |
| -------------- | ------------------------------ | ------- | ------------------- |
| TS conventions | .claude/rules/typescript.md    | Rule    | `**/*.ts`           |
| Deploy process | .claude/skills/deploy/SKILL.md | Skill   | "deploy", "release" |
| PR template    | .claude/commands/review.md     | Command | `/review`           |
| Security check | .claude/agents/security.md     | Agent   | security tasks      |

File Templates

Rule

---
paths: src/**/*.ts
---
# {Topic}
{ Instructions }

Skill

---
name: {kebab-case}
description: {What it does}. Use when {triggers}.
---
# {Name}
{Instructions}

Command

---
description: { Brief description }
---
{ Prompt template with $ARGUMENTS }

Agent

---
name: {name}
description: {When to delegate}. Use proactively for {triggers}.
tools: Read, Grep, Glob
---
# {Name}
{Instructions}

Refactored CLAUDE.md Target

# {Project}

{1-2 sentence overview}

## Commands

- Build: `{cmd}`
- Test: `{cmd}`

## References

- @README.md
- @docs/architecture.md

Goal: <50 lines, ideally 20-30

Validation

After extraction, verify:

  • CLAUDE.md line count reduced
  • Each file has valid YAML frontmatter
  • Rules have paths:, skills have description: with "Use when"

Description Formula

{Verb} {what}. Use when {trigger1}, {trigger2}, or {trigger3}.

Bad: Helps with code review Good: Reviews code for security and performance issues. Use when reviewing PRs, checking code quality, or after major changes.

Score

Total Score

70/100

Based on repository quality metrics

SKILL.md

SKILL.mdファイルが含まれている

+20
LICENSE

ライセンスが設定されている

+10
説明文

100文字以上の説明がある

+10
人気

GitHub Stars 100以上

0/15
最近の活動

3ヶ月以内に更新がある

0/10
フォーク

10回以上フォークされている

0/5
Issue管理

オープンIssueが50未満

+5
言語

プログラミング言語が設定されている

+5
タグ

1つ以上のタグが設定されている

0/5

Reviews

💬

Reviews coming soon