Agent skill

Sokra Mode

by module-federation in module-federation/core

Design, build, and maintain module-federation/core the way sokra (Tobias Koppers) built webpack 5: plugin architecture, container/sharing, runtime, caching, and reviews.

MITAuto-check passedBackend & APIs

Install Sokra Mode

skills CLI
$ npx skills add module-federation/core --skill sokra-mode -a claude-code

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

GitHub CLI
$ gh skill install module-federation/core sokra-mode --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/module-federation/core.git skills-src && mkdir -p .claude/skills && cp -r skills-src/.claude/skills/sokra-mode .claude/skills/sokra-mode && 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
sokra-mode
GitHub stars
2.7k
Token cost
~2.2k tokens
SKILL.md length
1,075 words
Files
3 (incl. references)
Skills in repo
5
Repo updated
First seen
Licence
MIT

At a glance

Design, build, and maintain module-federation/core the way sokra (Tobias Koppers) built webpack 5: plugin architecture, container/sharing, runtime, caching, and reviews.

  • Do it like sokra
  • SKILL.md covers Architecture, Discipline, This repo and Verification, plus 2 more sections
  • Calls pnpm
  • Review this like sokra would

What it does

Sokra Mode is an agent skill from module-federation/core. Design, build, and maintain module-federation/core the way sokra (Tobias Koppers) built webpack 5: plugin architecture, container/sharing, runtime, caching, and reviews. Use for /sokra-mode, "sokra mode", "do it like sokra", or "review this like sokra would".

Its SKILL.md is about 2.2k tokens, which your agent loads only when the skill is triggered. The skill folder holds 3 other files, including reference files (for example `references/plugin-patterns.md` and `references/repo-map.md`).

It sits in Backend & APIs, covering Caching. It works with webpack and TypeScript. The repository describes itself as: Module Federation is a concept that allows developers to share code and resources across multiple JavaScript applications. The licence is MIT.

When your agent uses it

  • Do it like sokra
  • Review this like sokra would

Example prompts

  • “sokra mode”
  • “do it like sokra”
  • “review this like sokra would”
  • “/sokra-mode”

What it can do on your machine

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

    Shell commands in SKILL.md call:

    • pnpm

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

  • Network

    Links to these hosts (documentation or services it may open):

    • github.com

    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

Sokra Mode loads about 2.2k tokens when it runs, and up to ~7.7k if it reads all its reference files. Until then it costs about 68 tokens; SKILL.md has 1,075 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~68
When it runs · the whole SKILL.md, loaded when a task matches
~2.2k
With references · SKILL.md plus every file in references/, read only if the agent opens them
~7.7k

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 module-federation/core at commit 9135b23, republished under its MIT licence (© module-federation). 1,075 words, ~2,154 tokens.

Download SKILL.mdSave it as .claude/skills/sokra-mode/SKILL.md (or your agent's skills folder). This skill also uses 2 other files; get the full folder from GitHub.
name
sokra-mode
description
Design, build, and maintain module-federation/core the way sokra (Tobias Koppers) built webpack 5: plugin architecture, container/sharing, runtime, caching, and reviews. Use for /sokra-mode, "sokra mode", "do it like sokra", or "review this like sokra would".
disable-model-invocation
true

sokra mode

This skill applies sokra's webpack design discipline to building and maintaining this repo. packages/enhanced is a TypeScript fork of the container and sharing plugins he wrote, so his rules apply there directly. The rules come from his public webpack/webpack record: 739 authored PRs and 717 reviews (2019–2022), and 400 issues plus 49 discussions (2020–2024). His webpack code stops in November 2022. Don't impersonate him: never sign as him, post as him, or claim his approval. Detailed patterns with evidence links are in references/plugin-patterns.md, and the per-package map of this repo's thirteen plugin packages is in references/repo-map.md. Read both before writing a new plugin, Module, Dependency, RuntimeModule, or runtime hook.

Architecture

  • Build one feature as a slice of small classes. Each class has one job and its own file: Plugin (wiring), Dependency plus Template, Module subclass, ModuleFactory, RuntimeModule, and a RuntimeGlobals entry.
  • Umbrella plugins only compose. ModuleFederationPlugin → ContainerPlugin + ContainerReferencePlugin + SharePlugin → ConsumeSharedPlugin / ProvideSharedPlugin.
  • Reuse existing machinery. Remotes are externals. A container is a normal entry with a library. Fallbacks go through normalModuleFactory.
  • Connect parts through hooks and requirements, not direct calls.
    • Code declares runtimeRequirements, and runtimeRequirementInTree adds the modules they need.
    • Extension points are static getCompilationHooks(compilation) backed by a WeakMap. FederationModulesPlugin is this repo's example.
  • Put logic where the concern lives. Loading goes in the loading or runtime plugin. Error text goes in the error. Build-phase work goes in Module.build.
  • Keep build and codeGeneration apart. Never mutate buildInfo in codegen. Pass data out through codegen data and custom source types. Anything that crosses from build to codegen must be serializable.
  • Keep the core small, and challenge the premise first.
    • Ask for the use case, and check whether an existing option or hook already covers it.
    • For rare needs, expose a small override or a replaceable module, not new config.
    • Never add globals.
    • Don't branch on target; gate on environment or feature flags.

Discipline

  • Builds must be deterministic. Sort every emitted map and key, and use tiebreakers. Output must not depend on build order, the machine, or the Node version. Adding a chunk must not rewrite shared chunks.
  • Caching must be correct by default.
    • Cached classes use makeSerializable and serialize every field, including subclass fields.
    • Per-compilation state goes in a WeakMap.
    • Dependency paths are absolute.
    • Anything unsafe stays opt-in.
  • Performance is a correctness concern. Hot paths do one get and compare to undefined. Avoid throwaway arrays and quadratic scans. Hoist constant Sets and comparators. Lazy-require with memoize. Measure perf claims.
  • Memory-trading optimizations are not plain wins. A cache that grows, or that keeps modules which have left the compilation, goes behind experiments.* with eviction, or gets reverted (#14436, #14319).
  • Never break a public or plugin-facing interface in a minor. New behavior ships behind experiments.*. Renames keep a deprecation shim.
  • Report problems as errors when the output can't be correct, otherwise as warnings. Messages name the cause and the fix.
  • Every option gets a schema and a precise type. Name options positively. Use the graph APIs (moduleGraph, chunkGraph), never legacy module.* fields. Use RuntimeGlobals and runtimeTemplate.basicFunction/returningFunction, never a literal __webpack_require__.x.
Show full SKILL.md (567 more words)Show less

This repo

  • Package roles. Thirteen packages are bundler plugins; references/repo-map.md lists each with its hooks and gaps.
    • enhanced is the webpack plugin layer, and every rule above applies in full.
    • node, nextjs-mf, dts-plugin, manifest, utilities, and the legacy plugins compose on top of it. Same rules: umbrella plugins compose, runtime goes through requirements, assets go through processAssets with a named stage, options are validated at the boundary.
    • rspack and rsbuild-plugin wrap rspack's native MF plugin. They shape options; module and dependency internals live in rspack itself.
    • runtime-core and webpack-bundler-runtime hold the runtime logic.
    • sdk owns the shared option types.
  • Runtime split. RuntimeModules in enhanced stay thin: they emit data (mappings, ids) and call federationGlobal.bundlerRuntime.*. Logic lives in runtime-core or webpack-bundler-runtime, with unit tests there. This is a deliberate MF 2 change to sokra's "generate the runtime" rule. His rules still govern the glue: RuntimeGlobals, requirements, and template helpers.
  • Extend at runtime through plugins. Keep runtime-core small. Add a hook in its plugin system (src/utils/hooks) or a runtime plugin (runtime-plugins, retry-plugin) before adding an option.
  • Webpack internals.
    • Load them through normalizeWebpackPath (see AGENTS.md).
    • makeSerializable keys are 'enhanced/lib/<path>', and there is no internalSerializables registry.
    • Types are TypeScript. Avoid any and unchecked casts where a precise type exists.
  • Options. Types go in packages/sdk/src/types/plugins/ModuleFederationPlugin.ts and schemas in packages/enhanced/src/schemas. Then run pnpm --filter @module-federation/enhanced run generate:schema; the pre-commit hook also runs it when schema JSON changes. New behavior goes under the plugin's experiments.
  • Errors. Runtime errors carry codes from @module-federation/error-codes, which is this repo's equivalent of DEP_WEBPACK_*. Build problems go to compilation.errors or compilation.warnings.
  • Compatibility. Every package is published. Add a changeset (pnpm run changeset) for publishable behavior changes.

Verification

  • Every fix and feature needs a regression test that hits the edge that broke.
    • Build-side: packages/enhanced/test/configCases/<area>/<case>, or test/compiler-unit. Other plugin packages use jest or rstest cases next to the source.
    • Runtime: packages/runtime-core/__tests__/*.spec.ts.
    • E2E: the matching app in apps/, via pnpm run ci:local --only=<job>.
    • Run with pnpm --filter <pkg> run test.
    • A PR without a test is blocked.
  • When you fix one path, check its siblings. Grep every path that emits the same thing. Check the counterparts in rspack, runtime-core, webpack-bundler-runtime, node, and nextjs-mf too.
  • Regenerate derived files in the same change: snapshots, types, schema outputs.

Reviews

  • Approve without comment, and put every objection inline. Prefer a suggestion block to a description.
  • Lead with the verdict ("working as expected", "that's a bug", "not supported"). Then give the mechanism in one or two sentences, then a snippet or a permalink.
  • Keep requests short and imperative: "Please add a test case", "Use X instead". When refusing, give the reason and name the alternative. Reject refactors that bring no concrete benefit.
  • Push guards back to the root cause. "This should never be undefined" means find where the value is produced.
  • Triage: get a minimal repro repo before debugging, and profiling data before accepting a perf claim. Keep one problem per issue, and name the owning tool when the bug is not ours.

Process

  • Titles and commits are short imperatives. Use this repo's conventional-commit prefix (fix(enhanced): …), which commitlint enforces. Put regeneration in separate commits (chore: update snapshots).
  • Land a feature as one experimental PR, then small single-purpose fix PRs. Write the PR body the way AGENTS.md asks, and say plainly what was not tested.
  • Defer scope creep to "before this leaves experimental" or to a tracked TODO. Revert quickly when a change costs more than it gives.

© module-federation, MIT. 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 2 other files (references) in .claude/skills/sokra-mode of module-federation/core.

  • SKILL.md
  • references/plugin-patterns.md
  • references/repo-map.md

Open the folder on GitHubat commit 9135b23

Compare with similar skills

Sokra Mode 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.

Sokra Mode compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Sokra Mode this skillmodule-federation/core2.7k—~2.2kAutomated safety check: PassMIT
Ar Io Gateway Operatorar-io/ar-io-node127—~8.8kAutomated safety check: NotesAGPL-3.0
Apollo Clientapollographql/skills117—~1.9kAutomated safety check: PassMIT
Dce Edgevercel/next.js143k—~1kAutomated safety check: PassMIT
Nextjs Turbopackkurealnum/dotfiles2905 repos~540Automated safety check: PassNone
Build Perf Baselinedotnet/skills5.6k1 repos~3.6kAutomated safety check: PassMIT

Similar skills

  • Ar Io Gateway Operator

    ar-io/ar-io-node

    Operate any AR.IO node deployment — architecture, daily ops, diagnostics, and recurring pitfalls that apply to every operator.

    127 GitHub stars~8.8k tokensUpdated today
    Backend & APIsAuto-check: notes
  • Apollo Client

    apollographql/skills

    Guide for building React applications with Apollo Client 4.x.

    117 GitHub stars~1.9k tokensUpdated 2 days ago
    Backend & APIsAuto-check passed
  • Dce Edge

    vercel/next.js

    Official

    DCE-safe require() patterns and edge runtime constraints. An agent skill from vercel/next.js.

    143k GitHub stars~1k tokensUpdated today
    Backend & APIsAuto-check passed
  • Nextjs Turbopack

    kurealnum/dotfiles

    Next.js 16+ and Turbopack — incremental bundling, FS caching, dev speed, and when to use Turbopack vs webpack.

    290 GitHub starsUsed in 5 repos~540 tokens
    Backend & APIsAuto-check passed
  • Build Perf Baseline

    dotnet/skills

    Official

    Establish MSBuild/.NET build performance baselines before optimizing.

    5.6k GitHub starsUsed in 1 repo~3.6k tokens
    Backend & APIsAuto-check passed
  • Golem Mark Read Only TS

    golemcloud/golem

    Marking TypeScript agent methods as read-only for a side-effect-free guarantee and result caching.

    1.5k GitHub stars~1.2k tokensUpdated today
    Backend & APIsAuto-check passed

More from module-federation/core

  • Changeset PR

    module-federation/core

    Create or update a .changeset/.md file for the current branch or PR in this repository, choose the correct package scope and release type, and verify the result against repo-specific Changesets…

    2.7k GitHub stars~1.3k tokensUpdated yesterday
    Auto-check passed
  • Gh PR Metadata

    module-federation/core

    Update the current GitHub PR title and body for this repository so they match the repo's pull request template and conventional-commit title style.

    2.7k GitHub stars~1k tokensUpdated yesterday
    Auto-check passed
  • Local CI

    module-federation/core

    Run this repository's local CI parity commands and pnpm run ci:local jobs.

    2.7k GitHub stars~914 tokensUpdated yesterday
    Auto-check passed
  • Sokra Mode

    module-federation/core

    Apply sokra's webpack design discipline to module-federation/core plugin architecture, runtime, caching, and reviews when asked for sokra mode or to review or build something like sokra would.

    2.7k GitHub stars~233 tokensUpdated yesterday
    Auto-check passed

Categories

Questions about Sokra Mode

What does Sokra Mode do?

Design, build, and maintain module-federation/core the way sokra (Tobias Koppers) built webpack 5: plugin architecture, container/sharing, runtime, caching, and reviews. Sokra Mode is an agent skill from module-federation/core. Design, build, and maintain module-federation/core the way sokra (Tobias Koppers) built webpack 5: plugin architecture, container/sharing, runtime, caching, and reviews.

When should I use Sokra Mode?

Sokra Mode fits situations like: do it like sokra; review this like sokra would.

How do I install Sokra Mode in Claude Code?

Run `npx skills add module-federation/core --skill sokra-mode -a claude-code`. Or copy the skill folder (.claude/skills/sokra-mode in module-federation/core) into .claude/skills/sokra-mode in your project. Claude Code loads it when a task matches its description.

How do I install Sokra Mode in Codex?

Run `npx skills add module-federation/core --skill sokra-mode -a codex`. Or copy the skill folder (.claude/skills/sokra-mode in module-federation/core) into .agents/skills/sokra-mode in your project. Codex loads it when a task matches its description.

Can I use Sokra Mode 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 module-federation/core --skill sokra-mode -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/sokra-mode, .gemini/skills/sokra-mode, .github/skills/sokra-mode and .opencode/skills/sokra-mode in your project.

What does Sokra Mode need to run?

Going by SKILL.md and its folder, Sokra Mode needs the command-line tools its instructions call (pnpm).

Does Sokra Mode access the network?

SKILL.md names 1 domain. As links in the text: github.com. This is read from the text; nothing was executed.

Is Sokra Mode 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 Sokra Mode use?

Sokra Mode is published under the MIT licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Sokra Mode use?

About 2.2k tokens (SKILL.md is roughly 8.6k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full. Its references folder adds about 5.6k tokens, read only when the agent opens those files.

What are the alternatives to Sokra Mode?

Skills that share tags, products or a category with Sokra Mode: Ar Io Gateway Operator (ar-io/ar-io-node, 127 stars), Apollo Client (apollographql/skills, 117 stars), Dce Edge (vercel/next.js, 143k stars) and Nextjs Turbopack (kurealnum/dotfiles, 290 stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Sokra Mode?

module-federation (a GitHub organization) maintains it in module-federation/core, which has 2,656 GitHub stars. The repository holds 5 skills in this directory. The repository was last updated on October 9, 2026.

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