mcpField
W
webpack-plugin-authoring

webpack-plugin-authoring

github.com/pproencaDevelopment218122 installsUpdated 11w ago
Repository

About webpack-plugin-authoring

A best-practices skill for authoring and reviewing webpack 5 plugins, organized as 44 rules across eight categories. It is aimed at plugin developers handling hooks, assets, caching, diagnostics, performance, and packaging.

Key features

  1. 0144 rules across eight plugin categories
  2. 02Hook selection and tap pattern guidance
  3. 03Asset pipeline and source map practices
  4. 04Caching, watch mode, and lifecycle guidance
  5. 05Option validation and build diagnostics
  6. 06Performance, compatibility, and packaging advice

Use cases

  1. 01Authoring a new webpack 5 plugin
  2. 02Reviewing plugin correctness and performance
  3. 03Debugging missing plugin output or watch-mode staleness
  4. 04Preparing a plugin for npm publication

Install

Copy the command and run it in a terminal.

$npx skills add https://github.com/pproenca/dot-skills --skill webpack-plugin-authoring

After installing, type/webpack-plugin-authoringin Claude Code to confirm it loaded.

Bundled files

References and scripts installed along with SKILL.md.

AGENTS.md
metadata.json
assets/templates/
_template.md
references/
_sections.md
asset-buffer-not-source-for-binary.md
asset-content-hash-via-output-options.md
asset-delete-then-emit-loses-info.md
asset-emit-asset-not-direct-assignment.md
asset-preserve-source-maps.md
asset-set-info-metadata.md
asset-source-from-compiler-webpack.md
cache-add-file-dependencies.md
cache-build-dependencies-for-persistent-cache.md
cache-context-dependencies-for-directories.md
cache-missing-dependencies-for-optional-files.md
cache-use-input-file-system.md
compat-custom-hooks-via-weakmap.md
compat-export-shape-and-cjs-esm.md
compat-feature-detection-not-version-check.md
compat-use-compiler-webpack-namespace.md
compat-webpack-as-peer-dependency.md
diag-attach-loc-to-errors.md
diag-progress-reporting.md
diag-push-webpack-error-not-throw.md
diag-use-compilation-get-logger.md
diag-warnings-vs-errors-exit-codes.md
hook-bail-hook-return-semantics.md
hook-name-matches-class-name.md
hook-normal-module-factory-stages.md
hook-prefer-process-assets-over-emit.md

Details

From the project README

dot-skills Webpack 5 Plugins Best Practices

Comprehensive guide for writing correct, performant webpack 5 plugins. Contains 44 rules across 8 categories (8 hook + 7 asset + 5 cache + 5 life + 4 schema + 5 diag + 5 perf + 5 compat = 44), ordered by the authoring lifecycle: hook choice is the foundation, then asset manipulation, then caching/watch-mode correctness, then lifecycle hygiene, then user-facing concerns (schema validation, error reporting), then performance, then packaging.

Patterns are derived from webpack/webpack, the webpack-contrib plugin suite (mini-css-extract, terser, compression, copy, css-minimizer), and Next.js's webpack integration in vercel/next.js.

When to Apply

Reference these rules whenever:

  • Writing a new plugin (defining apply(compiler), picking which hook to tap)
  • Reviewing existing plugin code for correctness or performance
  • Debugging "why isn't my plugin's output showing up" — usually a hook/stage mismatch
  • Adding asset manipulation logic (processAssets, emitAsset, updateAsset)
  • Fixing watch-mode staleness or persistent-cache poisoning
  • Migrating a plugin from webpack 4 to webpack 5 (or supporting both)
  • Publishing a plugin to npm (export shape, peerDependencies, schema)

Rule Categories by Priority

PriorityCategoryImpactPrefix
1Hook Selection & Tap PatternsCRITICALhook-
2Asset PipelineCRITICALasset-
3Caching & Watch ModeHIGHcache-
4Plugin Lifecycle & StateHIGHlife-
5Schema & Options ValidationMEDIUM-HIGHschema-
6Errors, Warnings & LoggingMEDIUM-HIGHdiag-
7Performance & ParallelismMEDIUMperf-
8Compatibility & PackagingLOW-MEDIUMcompat-

Quick Reference

1. Hook Selection & Tap Patterns (CRITICAL)
2. Asset Pipeline (CRITICAL)
3. Caching & Watch Mode (HIGH)
4. Plugin Lifecycle & State (HIGH)
5. Schema & Options Validation (MEDIUM-HIGH)
6. Errors, Warnings & Logging (MEDIUM-HIGH)
7. Performance & Parallelism (MEDIUM)
8. Compatibility & Packaging (LOW-MEDIUM)

How to Use

When writing or reviewing plugin code, scan AGENTS.md for the relevant category, then read the individual rule file for the full pattern and rationale.

Reference Files

FileDescription
references/_sections.mdCategory definitions, impact levels, descriptions
assets/templates/_template.mdTemplate for authoring new rules
metadata.jsonVersion, discipline, source references

Comments

Markdown supported