faasjs-best-practices
Use when working in any FaasJS repo and no narrower FaasJS skill is already selected, or when a task spans project conventions, validation gates, security boundaries, and multiple FaasJS subsystems. For focused work, also load the relevant FaasJS skill: faasjs-project-workflow, faasjs-react-ant-design, faasjs-api-jobs, faasjs-pg, faasjs-plugins-runtime, faasjs-utils-data, or faasjs-specs.
Install
npx skills add https://github.com/faasjs/faasjs --skill faasjs-best-practicesSKILL.md
FaasJS Best Practices
Default Workflow
- Identify the task area and load the narrowest FaasJS skill that owns it.
- Read local repo instructions and relevant
tsconfig.jsonfiles before choosing imports or paths. - Keep changes minimal and task-scoped; avoid unrelated refactors, speculative fallbacks, and new aliases unless configuration changes with them.
- Validate external input at boundaries, check auth/tenant/permission scope before data access, and never log secrets.
- Before handoff, run
vp check --fix && vp testwhen feasible; if not feasible, record why and run the smallest useful validation.
Load These References
- New project, feature layout, config, CLI, comments, naming, or shared testing: use
faasjs-project-workflow. - React UI,
@faasjs/ant-design,useFaas, forms, tables, drawers, CRUD screens, or React tests: usefaasjs-react-ant-design. .api.ts,defineApi, HTTP plugin helpers, middleware,.job.ts, ordefineJob: usefaasjs-api-jobs.@faasjs/pg,QueryBuilder, table declarations, migrations, or PostgreSQL tests: usefaasjs-pg.- Business writes that enqueue a job in the same transaction: load both
faasjs-pgandfaasjs-api-jobs. - Plugin lifecycle, injected fields, logger usage, Node bootstrapping, or runtime config loading: use
faasjs-plugins-runtime. @faasjs/utils, JSON, YAML, stream helpers, or validation helpers: usefaasjs-utils-data.- Normative runtime behavior for
faas.yaml, routing, HTTP protocol, or plugin contracts: usefaasjs-specs.
Gotchas
- Zod is for external input contracts; keep internal
typeof,instanceof, and null checks as control-flow predicates. - Keep local TypeScript imports extensionless and prefer configured aliases over deep relative imports.
- Destructure React hook returns and only the top-level
defineApi/defineJobhandler context; keep business values visible asparams.key. - Return values directly unless an intermediate variable documents a non-trivial condition, is reused, or improves readability.
- Keep generated job paths aligned with runtime discovery, and do not let transaction-scoped clients escape their callbacks.
Validation
- Use
vp check --fixfor formatting and linting. - Use
vp testorvp test <pattern>for tests. - Run
npx faas typesafter adding, renaming, moving, or removing.api.tsor.job.tsfiles. - Run
npx faasjs-pg migrateor targeted PG checks only when database changes require them andDATABASE_URLis available.
Related skills
improve-codebase-architecturemattpocock1MScan a codebase for deepening opportunities, present them as a visual HTML report, then grill through whichever one you pick.codebase-designmattpocock691KShared vocabulary for designing deep modules. Use when the user wants to design or improve a module's interface, find deepening opportunities, decide where a seam goes, make code more testable or AI-navigable, or when another skill needs the deep-module vocabulary.web-design-guidelinesvercel-labs676KReview UI code for Web Interface Guidelines compliance. Use when asked to "review my UI", "check accessibility", "audit design", "review UX", or "check my site against best practices".code-reviewmattpocock631KReview the changes since a fixed point (commit, branch, tag, or merge-base) along two axes: Standards (does the code follow this repo's documented coding standards?) and Spec (does the code match what the originating issue/spec asked for?). Runs both reviews in parallel sub-agents and reports them side by side. Use when the user wants to review a branch, a PR, work-in-progress changes, or asks to \"review since X\".