Agent skill

Static File Serving

by static-web-server in static-web-server/static-web-server

Serve static files and web assets with optimal headers, MIME types, compression, and caching for the Static Web Server (SWS) project

Apache-2.0Auto-check passedBackend & APIs

Install Static File Serving

skills CLI
$ npx skills add static-web-server/static-web-server --skill static-file-serving -a claude-code

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

GitHub CLI
$ gh skill install static-web-server/static-web-server static-file-serving --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/static-web-server/static-web-server.git skills-src && mkdir -p .claude/skills && cp -r skills-src/.agents/skills/static-file-serving .claude/skills/static-file-serving && 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
static-file-serving
GitHub stars
2.4k
Token cost
~1.8k tokens
SKILL.md length
614 words
Files
1
Skills in repo
9
Repo updated
First seen
Licence
Apache-2.0

At a glance

Serve static files and web assets with optimal headers, MIME types, compression, and caching for the Static Web Server (SWS) project

  • Tasks that involve Caching
  • SKILL.md covers General Principles, MIME Types, Compression and Caching Strategy, plus 3 more sections
  • Instructions only: no scripts, shell commands, URLs or credentials in SKILL.md
  • Tasks that involve Static sites and blogs

What it does

Static File Serving is an agent skill from static-web-server/static-web-server. Serve static files and web assets with optimal headers, MIME types, compression, and caching for the Static Web Server (SWS) project

Its SKILL.md is about 1.8k tokens, which your agent loads only when the skill is triggered. It is a single SKILL.md file with no bundled scripts.

It sits in Backend & APIs, covering Caching and Static sites and blogs. It works with WebAssembly and Linux. The repository describes itself as: A cross-platform, high-performance and asynchronous web server for static files-serving. ⚡. The licence is Apache-2.0.

When your agent uses it

  • Tasks that involve Caching
  • Tasks that involve Static sites and blogs

Example prompts

  • “/static-file-serving”

What it can do on your machine

Read from SKILL.md and the folder at commit 32ec4aa. 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

    No scripts in the folder and no shell commands in SKILL.md (its code samples are bash and toml).

    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

Static File Serving loads about 1.8k tokens when it runs. Until then it costs about 38 tokens; SKILL.md has 614 words of instructions outside code blocks.

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

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); files beside SKILL.md are not scanned.

SKILL.md

The full file from static-web-server/static-web-server at commit 32ec4aa, republished under its Apache-2.0 licence (© static-web-server). 614 words, ~1,819 tokens.

Download SKILL.mdSave it as .claude/skills/static-file-serving/SKILL.md (or your agent's skills folder).
name
static-file-serving
description
Serve static files and web assets with optimal headers, MIME types, compression, and caching for the Static Web Server (SWS) project

Static File Serving Standards

Load this skill when configuring MIME types, selecting compression formats, setting cache headers, organizing static file directories, or optimizing file delivery with SWS.

When to load: documenting or reviewing compression setup, cache-control strategy, MIME-type overrides, SPA vs. multi-page file layout, directory listing, or pre-compression build steps.

General Principles

  • Serve the right Content-Type: SWS uses mime_guess to determine MIME types from file extensions. If the wrong type is served, rename the file or add a custom header rule
  • Compress where it helps: Text-based formats compress well (HTML, CSS, JS, JSON, SVG, XML). Pre-compress at build time for zero-CPU serving
  • Cache aggressively for versioned assets: Use fingerprinting in filenames (app.a1b2c3d.js) with Cache-Control: max-age=31536000 (1 year)
  • Don't cache HTML entry points: HTML files that reference versioned assets should have short or no cache TTL
  • Use a CDN for production: Put SWS behind a CDN (Cloudflare, Fastly, CloudFront) for edge caching and DDoS protection

MIME Types

SWS determines Content-Type from file extension. Ensure files have correct extensions:

ExtensionMIME TypeCategory
.html, .htmtext/htmlDocument
.csstext/cssStylesheet
.js, .mjstext/javascript (or application/javascript)Script
.jsonapplication/jsonData
.xmlapplication/xmlData
.svgimage/svg+xmlVector image
.pngimage/pngRaster image
.jpg, .jpegimage/jpegRaster image
.webpimage/webpRaster image
.avifimage/avifRaster image
.gifimage/gifRaster image
.icoimage/x-iconIcon
.woff2font/woff2Web font
.wofffont/woffWeb font
.pdfapplication/pdfDocument
.wasmapplication/wasmWebAssembly
.txttext/plainText
.mdtext/markdownMarkdown
.zipapplication/zipArchive
.tarapplication/x-tarArchive
.gzapplication/gzipCompressed
.brapplication/brotliCompressed
.zstapplication/zstdCompressed
Custom MIME Types

Use the TOML config file to override or add MIME types for specific paths:

toml
[advanced.headers]
source = "**/*.yaml"
headers = { Content-Type = "application/yaml" }

Compression

Static (Pre-compressed) Compression

Pre-compress files at build time. SWS serves .br, .gz, or .zst variants automatically based on the client's Accept-Encoding header:

VariantExtensionEncoding HeaderBuild Command
Brotli.brbrbrotli -q 11 -f file
Gzip.gzgzipgzip -9 -k file
Zstandard.zstzstdzstd -19 -k file

Compression ratios (typical for text files):

FormatLevelRatioSpeed
Brotli11~75%Slowest
Zstandard19~72%Medium
Gzip9~68%Fastest
Dynamic (On-the-fly) Compression

SWS compresses responses in real-time when the client sends Accept-Encoding and no pre-compressed variant exists:

  • Only text-based MIME types are compressed (HTML, CSS, JS, JSON, XML, SVG, etc.)
  • Responses below 860 bytes skip compression (overhead exceeds savings)
  • Compression level is configurable: fastest, default, best
Show full SKILL.md (224 more words)Show less
SWS CLI Examples
bash
# Serve with Brotli pre-compressed variants only (no on-the-fly compression)
static-web-server --root ./dist --compression-static --compression=false

# Serve with both pre-compressed variants and on-the-fly gzip fallback
static-web-server --root ./dist --compression-static --compression

# Serve with only on-the-fly compression at fastest level
static-web-server --root ./dist --compression --compression-level fastest

Caching Strategy

Cache-Control Headers

SWS sets Cache-Control based on file extension. Enable with --cache-control-headers (default: enabled):

CategoryExtensionsmax-age
Static assets.css, .js, .png, .woff2, .avif, .webp, .pdf, .ico, .gz, .bz2, .zip, .tar1 year (31536000)
Data/feeds.json, .xml, .rss, .atom1 hour (3600)
Everything elseunknown extensions1 hour (3600)
Custom Cache Headers

Override Cache-Control for specific paths via TOML:

toml
[advanced.headers]
source = "**/*.html"
headers = { Cache-Control = "no-cache" }
Versioned Assets Pattern

For production deployments, use content-hash filenames and cache aggressively:

dist/
  index.html              ← short cache (or no-cache)
  assets/
    app.a1b2c3d.js        ← 1-year cache (fingerprinted)
    style.e4f5g6h.css     ← 1-year cache (fingerprinted)
    logo.h7i8j9k.png      ← 1-year cache (fingerprinted)

This way, when app.a1b2c3d.js changes, the new filename app.x9y0z1.js triggers a fresh download. The HTML entry point changes to reference the new filename.

Security Headers for Static Sites

Enable --security-headers (auto-enabled with --tls) for production static sites:

bash
static-web-server \
    --root ./dist \
    --tls --tls-cert cert.pem --tls-key key.pem \
    --security-headers \
    --cache-control-headers

Headers sent: Strict-Transport-Security, X-Frame-Options: DENY, X-Content-Type-Options: nosniff, Content-Security-Policy: frame-ancestors 'self', Referrer-Policy: strict-origin-when-cross-origin.

File Organization

Single-Page Application (SPA)
dist/
  index.html              ← entry point (served for all routes)
  assets/
    app.js
    style.css
  favicon.ico
  robots.txt

SWS configuration:

bash
static-web-server --root ./dist --page-fallback ./index.html

The --page-fallback option serves index.html for any 404, enabling client-side routing.

Multi-Page Static Site
dist/
  index.html
  about.html
  blog/
    index.html
    post-1.html
  assets/
    main.css
    main.js
  images/
    hero.png

SWS configuration:

bash
static-web-server --root ./dist --index-files "index.html,index.htm"
Directory Listing (Development)

For development or internal tools, enable directory listing:

bash
static-web-server --root ./public --directory-listing

Options: --directory-listing-order (0–6), --directory-listing-format html|json, --directory-listing-download targz.

Checklist

  • Do all files have correct extensions for MIME type detection?
  • Are pre-compressed variants (.br/.gz/.zst) generated at build time?
  • Are versioned assets using fingerprint filenames for cache busting?
  • Is Cache-Control appropriate for the content type?
  • Is the HTML entry point not cached (or has short TTL)?
  • Are security headers enabled for production?
  • Is TLS enabled for production deployments?

© static-web-server, 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

Just SKILL.md in .agents/skills/static-file-serving of static-web-server/static-web-server.

Open the folder on GitHubat commit 32ec4aa

Compare with similar skills

Static File Serving 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.

Static File Serving compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Static File Serving this skillstatic-web-server/static-web-server2.4k—~1.8kAutomated safety check: PassApache-2.0
Dtvm Perf ProfileDTVMStack/DTVM157—~1.1kAutomated safety check: PassCustom licence
Gpg SigningProrise-cool/Claude-Code-Multi-Agent305—~3.9kAutomated safety check: WarnNone
macOS Cleanerdaymade/claude-code-skills1.4k—~10kAutomated safety check: NotesMIT
Mintlify APImacro-inc/macro4.6k2 repos~333Automated safety check: PassMIT
Tanstack Query Best PracticesDeckardGer/tanstack-agent-skills2221 repos~1.2kAutomated safety check: PassMIT

Similar skills

  • Dtvm Perf Profile

    DTVMStack/DTVM

    Profile DTVM execution using Linux perf and generate categorized analysis reports.

    157 GitHub stars~1.1k tokensUpdated yesterday
    Backend & APIsAuto-check passed
  • Gpg Signing

    Prorise-cool/Claude-Code-Multi-Agent

    Comprehensive guide to GPG commit signing. An agent skill from Prorise-cool/Claude-Code-Multi-Agent.

    305 GitHub stars~3.9k tokensUpdated 22 days ago
    Backend & APIsAuto-check: warnings
  • macOS Cleaner

    daymade/claude-code-skills

    Diagnoses and safely reclaims macOS disk space: caches, logs, app remnants, large/duplicate files, Docker/OrbStack, Chromium code-sign clones, developer caches.

    1.4k GitHub stars~10k tokensUpdated today
    DevOps & CloudAuto-check: notes
  • Mintlify API

    macro-inc/macro

    Interact with the Mintlify REST API to manage deployments, trigger builds, and query documentation site metadata programmatically.

    4.6k GitHub starsUsed in 2 repos~333 tokens
    Backend & APIsAuto-check passed
  • Tanstack Query Best Practices

    DeckardGer/tanstack-agent-skills

    TanStack Query (React Query) best practices for data fetching, caching, mutations, and server state management.

    222 GitHub starsUsed in 1 repo~1.2k tokens
    Backend & APIsAuto-check passed
  • Reatom Async

    reatom/reatom

    Masters Reatom v1001 async flows. An agent skill from reatom/reatom.

    1.4k GitHub stars~744 tokensUpdated yesterday
    Backend & APIsAuto-check passed

More from static-web-server/static-web-server

All 9 skills in this repo
  • Design

    static-web-server/static-web-server

    Design or review software architecture, API contracts, data models, and module boundaries for the Static Web Server (SWS) project

    2.4k GitHub stars~1.8k tokensUpdated today
    Auto-check passed
  • Issue Tracking

    static-web-server/static-web-server

    Triage, debug, fix, and document issues for the Static Web Server (SWS) project — bug reports, root cause analysis, fix implementation, and regression prevention

    2.4k GitHub stars~1.5k tokensUpdated today
    Auto-check passed
  • Performance

    static-web-server/static-web-server

    Optimize or review performance for the Static Web Server (SWS) project — profiling, bottlenecks, resource usage, compression, and caching

    2.4k GitHub stars~3.1k tokensUpdated today
    Auto-check passed
  • Prose

    static-web-server/static-web-server

    Author or edit any prose for the Static Web Server (SWS) project — documentation, design docs, READMEs, PR descriptions, issue bodies, commit message bodies, or other human-readable text — following…

    2.4k GitHub stars~971 tokensUpdated today
    Auto-check passed
  • Rust Backend

    static-web-server/static-web-server

    Write or review Rust backend code for the Static Web Server (SWS) project — crates, modules, functions, types, error handling, and async code

    2.4k GitHub stars~1.7k tokensUpdated today
    Auto-check passed
  • Testing

    static-web-server/static-web-server

    Write or review tests for the Static Web Server (SWS) project — unit tests, integration tests, test fixtures, and mocking strategies

    2.4k GitHub stars~1.5k tokensUpdated today
    Auto-check passed

Questions about Static File Serving

What does Static File Serving do?

Serve static files and web assets with optimal headers, MIME types, compression, and caching for the Static Web Server (SWS) project. Static File Serving is an agent skill from static-web-server/static-web-server.

When should I use Static File Serving?

Static File Serving fits situations like: tasks that involve Caching; tasks that involve Static sites and blogs.

How do I install Static File Serving in Claude Code?

Run `npx skills add static-web-server/static-web-server --skill static-file-serving -a claude-code`. Or copy the skill folder (.agents/skills/static-file-serving in static-web-server/static-web-server) into .claude/skills/static-file-serving in your project. Claude Code loads it when a task matches its description.

How do I install Static File Serving in Codex?

Run `npx skills add static-web-server/static-web-server --skill static-file-serving -a codex`. Or copy the skill folder (.agents/skills/static-file-serving in static-web-server/static-web-server) into .agents/skills/static-file-serving in your project. Codex loads it when a task matches its description.

Can I use Static File Serving 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 static-web-server/static-web-server --skill static-file-serving -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/static-file-serving, .gemini/skills/static-file-serving, .github/skills/static-file-serving and .opencode/skills/static-file-serving in your project.

What does Static File Serving need to run?

SKILL.md names no scripts, command-line tools or credentials: Static File Serving is instructions for the agent only.

Does Static File Serving 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 Static File Serving 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. Review the folder before installing.

What licence does Static File Serving use?

Static File Serving 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 Static File Serving use?

About 1.8k tokens (SKILL.md is roughly 7.3k 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 Static File Serving?

Skills that share tags, products or a category with Static File Serving: Dtvm Perf Profile (DTVMStack/DTVM, 157 stars), Gpg Signing (Prorise-cool/Claude-Code-Multi-Agent, 305 stars), macOS Cleaner (daymade/claude-code-skills, 1.4k stars) and Mintlify API (macro-inc/macro, 4.6k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Static File Serving?

static-web-server (a GitHub organization) maintains it in static-web-server/static-web-server, which has 2,372 GitHub stars. The repository holds 9 skills in this directory. The repository was last updated on October 7, 2026.

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