Defrag logo

Defrag

CommunityPopular
gnekt
defrag

Weekly vault defragmentation. Runs a 5-phase structural audit: inbox hygiene, area completeness, project archival, MOC refresh, tag consistency, structure evolution, and generates a report. Triggers: EN: "defragment the vault", "reorganize the vault", "structural maintenance", "vault defrag", "weekly defrag". IT: "deframmenta il vault", "riorganizza il vault", "manutenzione strutturale", "defrag settimanale". FR: "defragmenter le vault", "reorganiser le vault". ES: "desfragmentar el vault", "reorganizar el vault". DE: "Vault defragmentieren", "Vault reorganisieren". PT: "desfragmentar o vault", "reorganizar o vault".

Overview

Publishergnekt
RepositoryMy-Brain-Is-Full-Crew
Skill namedefrag
Stars
3.7K
Forks
366
Bundled files
Instructions only
Links
  • Markdown instructions

    A SKILL.md file the model loads on demand, so it only costs tokens when a request actually matches.

  • Works with any LLM

    AI skills are plain Markdown, not provider-specific code, so this works with GPT, Claude, Gemini, Grok, or a local model.

  • Self-contained

    Everything the model needs lives in the instructions — no extra files to sync.

  • Open source

    Published by gnekt on GitHub. Read the source before you install it.

Installation

Install the Defrag AI skill in TypingMind to use it with any LLM, or drop it into another agent that reads SKILL.md.

1

Install in TypingMind

TypingMind installs a skill straight from its GitHub folder — it reads SKILL.md, bundles the resource files, and stores the result locally.

  1. Open the app and go to Plugins → Skills.
  2. Choose "Install from GitHub".
  3. Paste the skill folder URL below and confirm.
  4. Enable the skill in any chat where you want it available.
Plugins → Skills → Add skill → From GitHub URL, then paste the folder URL and press Continue.
2

Install in another agent

Any agent that reads the Agent Skills format can use this skill — copy the folder into that agent's skills directory.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/gnekt/My-Brain-Is-Full-Crew.git /tmp/My-Brain-Is-Full-Crew
mkdir -p .claude/skills
cp -r /tmp/My-Brain-Is-Full-Crew/skills/defrag .claude/skills/defrag
Restart Claude Code after copying so it picks up the new skill.

Use it in TypingMind

Enable Defrag in any TypingMind chat and the model takes it from there. Its name and description sit in the system prompt, and the moment a request matches, the model loads the full instructions itself — you never invoke it by hand, and it costs no tokens until it is actually used.

The model loads Defrag on its own as soon as a request matches it.

Works with any AI model

AI skills are plain Markdown instructions rather than provider-specific code, so Defrag is not tied to the model it was written for. Install it once in TypingMind and use it with GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama, or a local model you run yourself — all on your own API keys.

  • Loaded only when it is needed

    The system prompt carries just the name and description. The instructions are fetched on the first matching request, so an idle skill costs nothing.

  • Switch models mid-chat

    Because the skill is instructions rather than code, changing model does not break it — the next model reads the same SKILL.md.

Skill instructions

This is the SKILL.md content the model loads. Read it before installing — a skill is instructions your model will follow.

Vault Path Resolution

Read Meta/vault-map.md (always this literal path) to resolve folder paths. Parse the YAML frontmatter: each key is a role, each value is the actual folder path. Substitute only the vault-role tokens listed in the table below — do NOT substitute other {{...}} patterns (like {{date}}, {{Name}}, {{YYYY}}, {{ISO timestamp}}, {{today}}, {{Area Name}}, etc.), which are template placeholders.

If vault-map.md is absent: warn the user once — "No vault-map.md found, using default paths" — then use these defaults:

TokenDefault
{{inbox}}00-Inbox
{{projects}}01-Projects
{{areas}}02-Areas
{{resources}}03-Resources
{{archive}}04-Archive
{{templates}}Templates
{{moc}}MOC
{{meta}}Meta

If vault-map.md is present but a role is missing: warn the user — "vault-map.md does not define [role]. What folder should I use?" — and wait for their answer before proceeding.


Weekly Vault Defragmentation

You are executing the Architect's weekly vault defragmentation workflow. This is a structural operation — not a quality audit (that is the Librarian's job). You scan the vault's organizational skeleton, fix structural gaps, evolve the layout, and produce a comprehensive report.

Golden Rule: Language

Always respond to the user in their language. Match the language the user writes in. This skill file is written in English for universality, but your output adapts to the user.


Post-it Protocol

At the START of execution

Read {{meta}}/states/architect.md (if it exists). If it contains an active defrag flow, resume from the recorded phase — do NOT restart from Phase 1.

At the END of execution

Write (or overwrite) {{meta}}/states/architect.md with:

markdown
---
agent: architect
last-run: "{{ISO timestamp}}"
---

## Post-it

### Last operation: defrag
### Summary: {{brief summary of what was done}}
### Issues detected: {{any issues that need follow-up, with suggested agents}}

Max 30 lines in the Post-it body. If you need more, summarize.


The 5-Phase Defragmentation Workflow

When the user triggers a defrag, execute all 5 phases in order.

Phase 1: Structural Audit

  1. Scan all files in {{inbox}}/ — anything older than 48 hours that is still in Inbox is a failure. Signal the Sorter via ### Suggested next agent to triage it, or file it yourself if the destination is obvious.

  2. Scan {{areas}}/ — for each area:

    • Does it have an _index.md? If not, create it.
    • Does it have a corresponding MOC in {{moc}}/? If not, create it.
    • Are the sub-folders still relevant? Are there new clusters of notes that warrant a new sub-folder?
    • Are there notes that clearly belong to a different area? Move them.
  3. Scan {{projects}}/ — are there completed projects that should be archived to {{archive}}/?

  4. Scan {{resources}}/ — are there resources that now belong to a specific area? Move them.

  5. Scan {{moc}}/ — is the Master Index up to date? Are all area MOCs linked? Are there MOCs with no corresponding area (orphan MOCs)?

  6. Scan {{templates}}/ — are there templates that are never used? Are there note types that lack a template?

Phase 2: Tag Hygiene

  1. Scan all notes for tags not listed in {{meta}}/tag-taxonomy.md — either add them to the taxonomy or fix them.
  2. Look for tag synonyms (e.g., #ml and #machine-learning) — consolidate.
  3. Ensure hierarchical tags are consistent (all area tags use #area/ prefix).

Phase 3: MOC Refresh

  1. For each MOC, verify that it actually links to the notes it should.
  2. Add links to new notes that were created since the last defrag.
  3. Remove links to notes that were archived or deleted.
  4. Verify that the Master Index ({{moc}}/Index.md) links to every area MOC.

Phase 4: Structure Evolution

  1. Check {{meta}}/user-profile.md — has the user's situation changed? New jobs, new interests, new goals mentioned in recent notes?
  2. If you notice a cluster of 3+ notes on a topic that has no dedicated area or sub-folder, create the structure proactively using the Area Scaffolding Procedure (see below).
  3. Update {{meta}}/vault-structure.md with all changes.

Phase 5: Report

Create a defragmentation report at {{meta}}/health-reports/YYYY-MM-DD — Defrag Report.md:

markdown
---
type: report
date: "{{today}}"
tags: [report, defrag, maintenance]
---

# Vault Defragmentation Report — {{date}}

## Summary
- Files moved: {{count}}
- Structures created: {{list}}
- Tags fixed: {{count}}
- MOCs updated: {{list}}
- Inbox items triaged: {{count}}
- Projects archived: {{list}}

## Structural Changes
{{Detailed list of what was created, moved, renamed, or archived}}

## Recommendations
{{Suggestions for the user — new areas to consider, templates to create, etc.}}

## Next Defrag
{{Anything to watch for next week}}

Log the defrag in {{meta}}/agent-log.md.


Area Scaffolding Procedure (Summary)

When Phase 4 detects a new area or sub-area is needed, follow these 7 steps:

  1. Create the folder structure — create the area folder under {{areas}}/ with appropriate sub-folders.
  2. Create the area index note — every area folder gets an _index.md with purpose, active projects, sub-areas, key resources, and a link to its MOC.
  3. Create the area MOC — create {{moc}}/{{Area Name}}.md with overview, structure, key notes, active projects, and a link back to the Master Index.
  4. Update the Master MOC — add a link to the new area MOC in {{moc}}/Index.md.
  5. Create area-specific templates — if the area needs specialized templates (e.g., Finance needs Budget Entry), create them in {{templates}}/.
  6. Update {{meta}}/vault-structure.md — document the new area, its sub-folders, and its purpose.
  7. Update {{meta}}/tag-taxonomy.md — add area-specific tags (e.g., #area/finance, #budget).

For the full detailed procedure with templates and examples, see the Architect agent (agents/architect.md, Section 4).


Inter-Agent Coordination

After completing the defrag, analyze your findings and suggest follow-up agents when appropriate. Include a ### Suggested next agent section at the end of your output for each applicable case:

  • Sorter — when Inbox has items older than 48 hours, or when notes in {{resources}}/ should be moved to a newly created area.
  • Connector — when new MOCs were created that need linking, or when orphan notes (no links) were found.
  • Librarian — when structural inconsistencies were found that need a full quality audit (broken links, duplicates).

Output format for suggestions

markdown
### Suggested next agent
- **Agent**: sorter
- **Reason**: {{why this agent should run next}}
- **Context**: {{specific details about what needs attention}}

When to suggest a new agent

If during defrag you detect a recurring need that no existing agent covers, include:

markdown
### Suggested new agent
- **Need**: {{what capability is missing}}
- **Reason**: {{why no existing agent can handle this}}
- **Suggested role**: {{brief description of what the new agent would do}}

Output Format

Always structure your response as follows:

  1. Announce the defrag is starting (in the user's language)
  2. Execute each phase, reporting findings as you go
  3. Generate the report file at {{meta}}/health-reports/
  4. Update your post-it at {{meta}}/states/architect.md
  5. Log the operation in {{meta}}/agent-log.md
  6. Summarize results to the user with key metrics (files moved, structures created, tags fixed, MOCs updated)
  7. Suggest next agents if applicable

Frequently asked questions

What does the Defrag AI skill do?

Weekly vault defragmentation. Runs a 5-phase structural audit: inbox hygiene, area completeness, project archival, MOC refresh, tag consistency, structure evolution, and generates a report. Triggers: EN: "defragment the vault", "reorganize the vault", "structural maintenance", "vault defrag", "weekly defrag". IT: "deframmenta il vault", "riorganizza il vault", "manutenzione strutturale", "defrag settimanale". FR: "defragmenter le vault", "reorganiser le vault". ES: "desfragmentar el vault", "reorganizar el vault". DE: "Vault defragmentieren", "Vault reorganisieren". PT: "desfragmentar o vau...

Why use Defrag on TypingMind?

Because you install it once and use it with any model. Defrag is plain Markdown rather than provider-specific code, so the same skill runs on GPT-5, Claude, Gemini, Grok, or a local model — and you can switch model mid-chat without it breaking. TypingMind runs on your own API keys, so you pay providers directly instead of a per-seat subscription, and your skills and chats stay in your own storage.

How do I install Defrag in TypingMind?

Open Plugins → Skills → Install from GitHub in TypingMind and paste https://github.com/gnekt/My-Brain-Is-Full-Crew/tree/main/skills/defrag. TypingMind reads its SKILL.md and installs it as a skill you can enable per chat.

Which AI models can use Defrag?

Any model you connect in TypingMind. AI skills are plain Markdown instructions rather than provider-specific code, so GPT, Claude, Gemini, Grok, and local models can all load this skill when a request matches it.

How many AI models can I use with Defrag?

As many as you like. As long as a model supports skills, you can use Defrag with it — GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama and more — all on TypingMind with your own API keys.

Is the Defrag AI skill free?

It is published on GitHub by gnekt. Check the repository for licensing terms. You only pay your own AI provider for the tokens you use.

What are AI skills?

An AI skill is a reusable instruction bundle that teaches an AI model how to do one specific task. It follows the open Agent Skills format: a SKILL.md file with a name and description, plus any scripts, templates or reference files the model may need. The model reads the instructions only when your request matches the skill, so an installed skill costs nothing until it is used.

How are AI skills different from plugins or MCP servers?

A plugin or MCP server gives a model new tools to call — code that runs somewhere and returns a result. An AI skill gives the model knowledge and process instead: how to approach a task, which steps to follow, what good output looks like. Skills are plain Markdown, so they need no server, no API key and no runtime, and they work with any model.

View all

Set up your own AI workspace now

Get notified about new features and future giveaways by subscribing to our newsletter 👇