V Vant Docs

Tutorial: Create Custom Islands

10-minute tutorial to create custom islands for your brain

What You’ll Build

Custom islands that load on-demand when triggered.

Why Islands?

Islands let you lazy-load brain components:

Default Islands

Vant comes with built-in islands (DEFAULT_ISLANDS in lib/islands.js):

Island Type Triggers
identity static (always) -
learnings static (always) -
decisions static (always) -
github lazy “github”, “pr”, “issue”, “push”, “repo”, “commit”, “branch”
gitlab lazy “gitlab”, “merge”, “mr”
bitbucket lazy “bitbucket”
linear lazy “linear”, “project”, “issue”, “tracker”
trust lazy “trust”, “reputation”, “score”
market lazy “market”, “trade”, “listing”, “bid”
evolution lazy “evolution”, “session”, “insight”, “learning”

Create Custom Island

Step 1: Extend Islands

The no-fork path is vant.islands.createIsland(name, { type, triggers }) (shown under Island Manifest below); editing DEFAULT_ISLANDS in lib/islands.js is the fork-and-ship alternative:

const DEFAULT_ISLANDS = {
    // ... existing islands ...
    herbalism: { 
        name: 'Herbalism', 
        type: 'lazy', 
        triggers: ['herb', 'plant', 'medicine'] 
    },
    // Add more...
};

Runtime API

const vant = require('vant-os');

// Get available islands
const available = vant.islands.getAvailable();
// ['identity', 'learnings', 'decisions', 'github', 'gitlab', ...]

// Find triggers in prompt
const triggers = vant.islands.findTriggers('What herbs help with sleep?');
// ['herb', 'plant']

// Auto-hydrate from prompt
await vant.islands.autoHydrate('I need to work with GitHub PRs');

Step 2: Add Content

Add content to your brain:

# skills/herbalism.md

## Teas
- Chamomile: sleep, anxiety
- Peppermint: digestion, headaches
- Ginger: nausea, inflammation

## Tinctures
- Echinacea: immune support
- Valerian: sleep

Step 3: Trigger Usage

const vant = require('vant-os');

// Think about herbs - auto-hydrates island
const result = await vant.islands.autoHydrate('What herbs help with sleep?');

// Check hydrated islands
console.log(vant.islands.getHydrated());
// [{ name: 'herbalism', loaded: true }]

Programmatic Load

// Load specific island (get data)
const data = await vant.islands.load('github');

// Load + track as hydrated
await vant.islands.hydrate('github');

// Get all available islands
const all = vant.islands.getAvailable();

Island Manifest

Islands live in a manifest (islands.json under the brain root) merged over DEFAULT_ISLANDS at load time. The public way to add one is createIsland - it validates, registers the definition, and stamps a brain file for static islands:

const vant = require('vant-os');

vant.islands.createIsland('herbalism', {
    type: 'lazy',
    triggers: ['herb', 'plant']
});
// → { name: 'herbalism', type: 'lazy', triggers: ['herb', 'plant'] }

// Triggers are adjustable later
vant.islands.updateTriggers('herbalism', ['herb', 'plant', 'medicine']);

(There is no exported saveManifest - save(name, data) persists island DATA into the registered island’s storage slot.)

Use Cases

Skills Island

# skills/python.md
# skills/javascript.md
# skills/docker.md

Tools you’ve learned, triggers on tool names:

const result = await vant.think('How do I use Docker?');
// → Loads python island, then docker island

Project Island

# projects/myapp.md

Project context, triggers on project name:

const result = await vant.think('Update myapp');
// → Loads myapp project island

Client Island

# clients/acme.md

Client context, triggers on client name:

const result = await vant.think('Contact acme about invoice');
// → Loads acme client island