Agent skill

Mirage VFS Adapter Authoring

by strukto-ai in strukto-ai/mirage

Builds or extends a custom Mirage virtual filesystem adapter for an API, database, object store or app data, with a working mount configuration and filesystem tests.

Apache-2.0Auto-check passedDevelopment

Install Mirage VFS Adapter Authoring

skills CLI
$ npx skills add strukto-ai/mirage --skill mirage-vfs-authoring -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install strukto-ai/mirage mirage-vfs-authoring --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/strukto-ai/mirage.git skills-src && mkdir -p .claude/skills && cp -r skills-src/plugins/mirage/skills/mirage-vfs-authoring .claude/skills/mirage-vfs-authoring && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
mirage-vfs-authoring
GitHub stars
3.7k
Token cost
~2.4k tokens
SKILL.md length
1,262 words
Files
4 (incl. scripts, assets)
Skills in repo
2
Repo updated
First seen
Licence
Apache-2.0

At a glance

Builds or extends a custom Mirage virtual filesystem adapter for an API, database, object store or app data, with a working mount configuration and filesystem tests.

  • Connecting a new API or database to Mirage as a mounted filesystem
  • SKILL.md covers Start from the bundled adapter, Establish the resource contract, Implement the smallest VFS and Wire configuration and state, plus 2 more sections
  • Runs Python and TypeScript scripts from its folder; calls python
  • Packaging a reusable Mirage adapter

What it does

The deliverable is an adapter in your project, a working mount configuration and tests of its filesystem behavior, built on `BaseVFS` with a `VFSAdapter` assembled from the resource's capabilities, so a normal custom backend needs no Mirage fork. To start, `scripts/new_adapter.py` generates a Python or TypeScript adapter at a chosen output path and refuses to overwrite existing files. The generated code uses an in-memory fixture with a read-contract check and a mounted shell smoke test, and you swap in the real client, paths and expected bytes while keeping credentials in application config.

Before implementing, the agent checks the project's Mirage version, language, runtime and existing client, relies on the installed API because the interface is still evolving, and asks only about decisions that matter: visible resources, mount prefix, credentials and required writes. It reuses a built-in VFS when one fits, sketches a small example tree, separates stored bytes from rendered records, distinguishes complete directories from paginated or time-windowed ones, and keeps backend access async. Python and TypeScript templates are bundled.

When your agent uses it

  • Connecting a new API or database to Mirage as a mounted filesystem
  • Packaging a reusable Mirage adapter
  • Extending an existing custom adapter with new resources or writes

Example prompts

  • “Create a Mirage VFS adapter that exposes my Postgres tables as files under /db.”
  • “Scaffold a TypeScript Mirage adapter for our internal ticketing API and add the mount config.”
  • “Add write support to the custom adapter in resource.py and test it with a mounted shell.”

Requirements

  • Python with the project's Mirage environment, or TypeScript with `tsx` and `@struktoai/mirage-node`

What it can do on your machine

Read from SKILL.md and the folder at commit 9e61942. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    Ships 1 file in scripts/ (Python and TypeScript), which the agent can run.

    Shell commands in SKILL.md call:

    • python

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    No URLs in SKILL.md.

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Mirage VFS Adapter Authoring loads about 2.4k tokens when it runs. Until then it costs about 79 tokens; SKILL.md has 1,262 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~79
When it runs · the whole SKILL.md, loaded when a task matches
~2.4k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); the scripts in this folder are not scanned.

SKILL.md

The full file from strukto-ai/mirage at commit 9e61942, republished under its Apache-2.0 licence (© strukto-ai). 1,262 words, ~2,435 tokens.

Download SKILL.mdSave it as .claude/skills/mirage-vfs-authoring/SKILL.md (or your agent's skills folder). This skill also uses 3 other files; get the full folder from GitHub.
name
mirage-vfs-authoring
description
Build or extend a custom Mirage VFS adapter for a user's API, database, object store, or application data. Use when connecting a new resource to Mirage, implementing a backend, or packaging a reusable adapter. For reading or editing data in an existing mount, use the filesystem workflow instead.

Author a Mirage VFS

Deliver an adapter in the user's project, a working mount configuration, and tests of its filesystem behavior. Subclass BaseVFS and define the functions the resource supports. A normal custom backend needs no Mirage fork.

Start from the bundled adapter

For a new backend, run python scripts/new_adapter.py --language python --output <project>/resource.py from this skill directory, or select typescript and a .ts output. The script refuses to overwrite an existing file. The generated adapter uses only an in-memory fixture and includes a read-contract check plus a mounted shell smoke test. Run Python with the project's Mirage environment, or TypeScript with its tsx runner and @struktoai/mirage-node dependency.

Replace the fixture client with the resource API, then update the fixture paths and expected bytes. Keep credentials in the application's configuration. The self-contained templates are Python and TypeScript; no repository checkout is needed to scaffold.

Establish the resource contract

Inspect the project's Mirage version, language, runtime, and existing client. Use the installed API and matching source or documentation; the interface is still evolving. Ask only for missing decisions that affect the implementation: which resources are visible, the mount prefix, credentials, and required writes.

Reuse a builtin VFS when it already represents the resource. For a new adapter, define a small example tree and what each leaf renders before implementing it. Separate stored bytes from rendered records, and distinguish a complete directory from a paginated or time-windowed view. Use stable resource identities when display names can collide or change.

Consult the relevant language's guide and runnable example, using the revision matching the target Mirage package:

Implement the smallest VFS

Keep backend access async. An Accessor owns the client; implement its cleanup when the adapter owns connections. Reuse connections across calls. Python constructors and build_vfs are synchronous: perform network initialization lazily in async operations. TypeScript class references can use static async create when initialization requires I/O.

Subclass BaseVFS and define these functions over PathSpec:

  • readdir: return immediate child virtual paths in the format the installed example uses. Avoid fetching each child's contents just to list a directory.
  • read: return the exact bytes represented by a leaf. It also receives an offset and size; leave reads_ranges / readsRanges false and Mirage cuts the window from the whole read.
  • stat: classify the entry and return its rendered byte length, or None / null when the length is unknown without reading it.

Those three are the whole minimal VFS. Mirage derives streaming from read and existence from stat, and defaults to a remote resource. A derived stream still fetches the entire file; it is not a memory-efficient stream.

Builtin backends define these same functions. Core functions need not inherit a class: call them from the methods and wrap client-specific arguments or return values at the VFS boundary. The shared types live in vfs/types.

Define more functions independently as the resource needs them. A function the VFS does not define answers Operation not supported:

  • read_stream / readStream, exists, find, and du_size with du_entries / duSize with duEntries are native fast paths. They preserve the baseline read semantics. Set reads_ranges / readsRanges when read fetches only the asked window: offset plus size is an exclusive end, and an omitted size reads through EOF.
  • search is optional resource search for the search command, over a PathSpec and SearchQuery with query text and backend-defined JSON options. No regex support or grep compatibility is assumed. Return text records, an empty list for no matches, or None / null to decline. Validate resource-specific options and propagate failures. Define optional search_many / searchMany when ranking and limits must apply once across several scopes.
  • files_containing / filesContaining and lines_containing / linesContaining let grep and rg skip reads: the files under a directory, or the lines of one file, that may hold a plain text. Answer every match or return None / null; a missed hit is a wrong answer. before_full_scan / beforeFullScan may raise to refuse a scan no search could narrow.
  • write, append, pwrite, create, mkdir, unlink, rmdir, rm_r / rmR, rename, copy, truncate, and setattr are individual mutations. Defining write does not imply deletion, rename, or directory support; append and pwrite are built from read and write when the VFS does not define them. Mount mode still enforces which supported writes may execute.

A function only your class declares is reachable through the dispatcher by name once it is marked @vfs_call(effect=Effect.READ) / @vfsCall({ effect: Effect.READ }); the effect tells a read-only mount and its policies what the call does. Use the installed version's signatures, including optional index parameters. Older versions assembled a VFSAdapter of callbacks instead of methods; follow the guide matching the installed package.

Give the VFS a unique name and a concise prompt describing the tree and rendering. Let Mirage derive commands, globbing, and dispatcher ops from the functions it defines. Add bespoke commands or overrides for behavior the generic operations cannot express.

Scope belongs in the resource operations too: a direct read, stream, range read, or ID-addressed command must not bypass filters enforced by listing. Prove parent membership or resolve through a scoped index. An incomplete listing cannot prove an unlisted resource absent. Use Mirage's existing hierarchy/index helpers when their documented contract fits; do not import private helpers merely to shorten the adapter.

Grep/rg optimizations must return the same matches as searching the rendered bytes. Fall back to scanning when equivalence is uncertain. Respect read budgets before eagerly materializing results, and report incomplete output.

Show full SKILL.md (363 more words)Show less

Wire configuration and state

For an embedded application, mount the VFS instance directly. For YAML or a reusable package, use the supported class reference or registration path:

  • Python: CONFIG_CLS with register_vfs, a mirage.vfs package entry point, or a ./backend.py:ResourceVFS reference.
  • TypeScript: registerVfsFactory or a Node-loadable ./backend.mjs:ResourceVFS reference. Do not assume a browser can load a local Node module.

Validate config at this boundary. Python models should explicitly forbid unknown keys; TypeScript needs runtime validation, not a type assertion. Use the host's credential mechanism and secret types; avoid serializing credentials into state or errors.

Keep the default needs_override state for a live external resource unless reconstruction is deliberately implemented. For Mirage-owned in-memory data, implement state save/load and test restoration. Enable snapshot fingerprints, read revalidation, and known-size claims only when the operations fulfill those contracts.

Verify and deliver

Exercise the adapter through Workspace, with a fake service or fixture:

  • Listing, reading, stat, globbing, and a representative search agree.
  • Nested mount prefixes resolve correctly; missing paths fail consistently.
  • Direct reads of excluded resources fail even when their IDs are known.
  • Pagination and read limits do not silently omit data or prove false absence.
  • A read-only mount refuses supported writes before the mutation reaches the service; unsupported operations fail clearly.
  • Config typos fail, owned clients close, and promised state restoration works.

Use the user's language for an external adapter. When contributing a Mirage builtin, follow the repository's mirrored Python/TypeScript layout and gates, and add shared integration cases for observable shell behavior.

Deliver the adapter, exact mount configuration, and verification results. State which operations and state behavior are supported, and identify any live-service checks that could not be run.

Reuse the conformance check

Run check_read_contract / checkReadContract with a ReadFixture describing a small known file, its parent, an absent sibling, and expected bytes. This checks listing, stat, byte reads, streams, native ranges, existence, and missing-path errors without mutating the resource. It takes the VFS itself, so the same probe works for builtins and external backends.

Add backend-specific tests for pagination, authorization errors, and query options. Use disposable fixtures for mutation tests. Verify a read-only mount refuses writes and preserves the fixture. Do not run write probes against production data.

© strukto-ai, Apache-2.0. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

SKILL.md and 3 other files (scripts, assets) in plugins/mirage/skills/mirage-vfs-authoring of strukto-ai/mirage.

  • SKILL.md
  • assets/adapter.py
  • assets/adapter.ts
  • scripts/new_adapter.py

Open the folder on GitHubat commit 9e61942

Compare with similar skills

Mirage VFS Adapter Authoring next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Mirage VFS Adapter Authoring compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Mirage VFS Adapter Authoring this skillstrukto-ai/mirage3.7k—~2.4kAutomated safety check: PassApache-2.0
holaOS App Builder SDKholaboss-ai/holaOS11k—~11kAutomated safety check: PassCustom licence
Audit AI Codejxnl/personal-monorepo-template563—~1.7kAutomated safety check: PassNone
Full Stack ScaffoldDokhacgiakhoa/Agent-Skills-4-Vibe-Coding-CLI508—~548Automated safety check: PassCustom licence
Power Apps Code App Scaffoldgithub/awesome-copilot40k1 repos~1.8kAutomated safety check: PassMIT
Project Initathola/claude-night-market341—~1.2kAutomated safety check: PassMIT

Similar skills

  • holaOS App Builder SDK

    holaboss-ai/holaOS

    Builds new holaOS apps with @holaboss/app-builder-sdk, either as integration-only MCP modules or as dashboard apps with a shadcn UI under src/client/.

    11k GitHub stars~11k tokensUpdated 1 mo ago
    DevelopmentAuto-check passed
  • Audit AI Code

    jxnl/personal-monorepo-template

    Audit, de-slop, parameterize, modularize, or safely clean up AI-generated or AI-shaped backend/general code.

    563 GitHub stars~1.7k tokensUpdated 3 mo ago
    DevelopmentAuto-check passed
  • Full Stack Scaffold

    Dokhacgiakhoa/Agent-Skills-4-Vibe-Coding-CLI

    Unified project scaffolding for Node.js, Python, Rust, and Mobile.

    508 GitHub stars~548 tokensUpdated 4 mo ago
    DevelopmentAuto-check passed
  • Power Apps Code App Scaffold

    github/awesome-copilot

    Official

    Scaffold a complete Power Apps Code App project with PAC CLI setup, SDK integration, and connector configuration

    40k GitHub starsUsed in 1 repo~1.8k tokens
    DevelopmentAuto-check passed
  • Project Init

    athola/claude-night-market

    Scaffolds new projects with git, CI/CD workflows, pre-commit hooks, and build config.

    341 GitHub stars~1.2k tokensUpdated yesterday
    DevelopmentAuto-check passed
  • MCP Server Builder

    anthropics/skills

    Official

    Guides the design and implementation of Model Context Protocol servers in TypeScript or Python, from tool naming and error messages to evaluation.

    180k GitHub starsUsed in 63 repos~2.3k tokens
    Agent WorkflowsAuto-check passed

More from strukto-ai/mirage

  • Routes file reads, edits, and shell commands through Mirage's own tools instead of host filesystem tools whenever a path is a Mirage-mounted virtual path.

    3.7k GitHub stars~264 tokensUpdated today
    Auto-check passed

Questions about Mirage VFS Adapter Authoring

What does Mirage VFS Adapter Authoring do?

Builds or extends a custom Mirage virtual filesystem adapter for an API, database, object store or app data, with a working mount configuration and filesystem tests. The deliverable is an adapter in your project, a working mount configuration and tests of its filesystem behavior, built on `BaseVFS` with a `VFSAdapter` assembled from the resource's capabilities, so a normal custom backend needs no Mirage fork.py` generates a Python or TypeScript adapter at a chosen output path and refuses to overwrite existing files.

When should I use Mirage VFS Adapter Authoring?

Mirage VFS Adapter Authoring fits situations like: connecting a new API or database to Mirage as a mounted filesystem; packaging a reusable Mirage adapter; extending an existing custom adapter with new resources or writes.

How do I install Mirage VFS Adapter Authoring in Claude Code?

Run `npx skills add strukto-ai/mirage --skill mirage-vfs-authoring -a claude-code`. Or copy the skill folder (plugins/mirage/skills/mirage-vfs-authoring in strukto-ai/mirage) into .claude/skills/mirage-vfs-authoring in your project. Claude Code loads it when a task matches its description.

How do I install Mirage VFS Adapter Authoring in Codex?

Run `npx skills add strukto-ai/mirage --skill mirage-vfs-authoring -a codex`. Or copy the skill folder (plugins/mirage/skills/mirage-vfs-authoring in strukto-ai/mirage) into .agents/skills/mirage-vfs-authoring in your project. Codex loads it when a task matches its description.

Can I use Mirage VFS Adapter Authoring in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add strukto-ai/mirage --skill mirage-vfs-authoring -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/mirage-vfs-authoring, .gemini/skills/mirage-vfs-authoring, .github/skills/mirage-vfs-authoring and .opencode/skills/mirage-vfs-authoring in your project.

What does Mirage VFS Adapter Authoring need to run?

Going by SKILL.md and its folder, Mirage VFS Adapter Authoring needs Python and TypeScript for the scripts in its folder and the command-line tools its instructions call (python). Our summary lists: Python with the project's Mirage environment, or TypeScript with `tsx` and `@struktoai/mirage-node`.

Does Mirage VFS Adapter Authoring access the network?

SKILL.md contains no URLs. Any network use would come from the scripts or tools the agent runs. This is read from the text; nothing was executed.

Is Mirage VFS Adapter Authoring safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. The check reads SKILL.md only: the scripts in the folder are not scanned, so read them before running anything.

What licence does Mirage VFS Adapter Authoring use?

Mirage VFS Adapter Authoring is published under the Apache-2.0 licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Mirage VFS Adapter Authoring use?

About 2.4k tokens (SKILL.md is roughly 9.7k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.

What are the alternatives to Mirage VFS Adapter Authoring?

Skills that share tags, products or a category with Mirage VFS Adapter Authoring: holaOS App Builder SDK (holaboss-ai/holaOS, 11k stars), Audit AI Code (jxnl/personal-monorepo-template, 563 stars), Full Stack Scaffold (Dokhacgiakhoa/Agent-Skills-4-Vibe-Coding-CLI, 508 stars) and Power Apps Code App Scaffold (github/awesome-copilot, 40k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Mirage VFS Adapter Authoring?

strukto-ai (a GitHub organization) maintains it in strukto-ai/mirage, which has 3,682 GitHub stars. The repository holds 2 skills in this directory. The repository was last updated on October 11, 2026.

Source: strukto-ai/mirage on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.