mcpField
F
faasjs-plugins-runtime

faasjs-plugins-runtime

github.com/faasjsDevelopment120188 installsUpdated 10w ago
Repository

About faasjs-plugins-runtime

faasjs-plugins-runtime is a development skill for implementing and testing FaasJS plugins and runtime utilities. It covers lifecycle hooks, injected fields, logging, configuration, and Node-only setup guidance.

Key features

  1. 01Plugin lifecycle and hooks
  2. 02Injected field typing
  3. 03Logger selection and handling
  4. 04Configuration and environment loading
  5. 05Retry-safe mount initialization
  6. 06Plugin lifecycle testing

Use cases

  1. 01Add authentication or tenant context through plugins
  2. 02Implement retry-safe mount hooks
  3. 03Configure logging without exposing secrets
  4. 04Test plugin lifecycle behavior

Install

Copy the command and run it in a terminal.

$npx skills add https://github.com/faasjs/faasjs --skill faasjs-plugins-runtime

After installing, type/faasjs-plugins-runtimein Claude Code to confirm it loaded.

Bundled files

References and scripts installed along with SKILL.md.

references/guidelines/
logger.md
node-utils.md
plugins.md

Details

From the project README

FaasJS Plugins And Runtime

Default Workflow

  1. Use plugins for cross-cutting business context such as auth, tenant, request metadata, and permission scope.
  2. Implement plugin lifecycle hooks with clear ownership, retry-safe mount initialization, and exactly one next() call when required.
  3. Provide injected field types through DefineApiInject module augmentation.
  4. Prefer injected loggers when the framework provides one; create labeled loggers for standalone code.
  5. Keep @faasjs/node-utils usage in Node-only bootstrapping and tooling paths.

Load These References

  • Plugin interface, lifecycle hooks, injected fields, config-driven loading, and tests: references/guidelines/plugins.md.
  • Logger selection, levels, formatting, timing, and secret handling: references/guidelines/logger.md.
  • loadConfig, .env loading, module hooks, schema helpers, and path containment: references/guidelines/node-utils.md.

Gotchas

  • Mutate InvokeData for injected fields and document the type surface with module augmentation.
  • Keep onMount retry-safe: concurrent callers share one attempt, and a later call may retry after failure.
  • Do not log secrets or full sensitive payloads.
  • Keep module hook registration at process bootstrap.

Validation

  • Test plugins with real Func instances when behavior depends on lifecycle execution.
  • Cover shared mount success, shared mount failure, and later retry when onMount owns resources.
  • Run focused tests with vp test <pattern>.
  • Run vp check --fix before handoff when plugin or runtime files changed.

Comments

Markdown supported