with one click
repo-source-code-review
// Review PRs and source code changes in Formisch packages/ and frameworks/. Use when reviewing pull requests, validating implementation patterns, or checking code quality before merging.
// Review PRs and source code changes in Formisch packages/ and frameworks/. Use when reviewing pull requests, validating implementation patterns, or checking code quality before merging.
| name | repo-source-code-review |
| description | Review PRs and source code changes in Formisch packages/ and frameworks/. Use when reviewing pull requests, validating implementation patterns, or checking code quality before merging. |
| metadata | {"author":"formisch","version":"1.0"} |
Guide for reviewing PRs and source code changes in packages/ and frameworks/.
| Check | Requirement |
|---|---|
| Naming | Matches existing patterns (FormStore, useField, createForm) |
| Purity annotation | // @__NO_SIDE_EFFECTS__ before pure factory functions |
| Import extensions | All imports use .ts extension |
| Interface vs type | Use interface for object shapes, type for unions/aliases |
| Folder structure | Methods: name.ts, index.ts. Primitives/components in their folder |
Good — purity annotation:
// @__NO_SIDE_EFFECTS__
export function useField<TSchema, TFieldPath>(
form: FormStore<TSchema>,
config: UseFieldConfig<TSchema, TFieldPath>
): FieldStore<TSchema, TFieldPath> {
return {
/* ... */
};
}
Bad — missing annotation:
export function useField<TSchema, TFieldPath>(
form: FormStore<TSchema>,
config: UseFieldConfig<TSchema, TFieldPath>
): FieldStore<TSchema, TFieldPath> {
return {
/* ... */
};
}
| Check | Requirement |
|---|---|
| Generic inference | Types infer correctly without explicit annotations |
| Constraints | Generic parameters have appropriate extends clauses |
| Return types | Explicit return types on exported functions |
| Type tests | .test-d.ts file covers type inference scenarios |
Good — constrained generic:
export function useField<
TSchema extends FormSchema,
TFieldPath extends RequiredPath<TSchema>,
>(
form: FormStore<TSchema>,
config: UseFieldConfig<TSchema, TFieldPath>
): FieldStore<TSchema, TFieldPath>;
| Check | Requirement |
|---|---|
| JSDoc present | All exported functions have JSDoc |
| First line | Action verb matching function purpose (see below) |
@param tags | Every parameter documented |
@returns tag | Return value documented |
| Overloads | Every overload has its own complete JSDoc block |
First line patterns by category:
| Category | Pattern |
|---|---|
| Primitives | Creates a ... |
| Methods | Focuses ..., Resets ..., Validates ... |
| Components | Renders a ... |
| Utilities | Returns ..., Gets ..., Sets ... |
| Check | Requirement |
|---|---|
| Runtime tests | .test.ts covers success cases, failure cases, edge cases |
| Type tests | .test-d.ts validates type inference with expectTypeOf |
| Error handling | Tests verify correct error messages and validation |
| Issue | What to Look For |
|---|---|
| Missing purity annotation | Factory function without // @__NO_SIDE_EFFECTS__ |
| Incomplete JSDoc | Missing @param or @returns, wrong description format |
| No type tests | New API without .test-d.ts file |
| Wrong import extension | Imports without .ts suffix |
| Inconsistent naming | Primitives not using create/use prefix, wrong Store suffix |
| Side effects in pure code | Mutations, I/O, or global state in primitive/method creation |
// @__NO_SIDE_EFFECTS__ on pure factory functions.ts extensioninterface used for object shapes.test.ts.test-d.tsrepo-structure-navigate — Navigate the codebaserepo-source-code-document — JSDoc requirementsDocument Formisch source code with JSDoc and inline comments. Use when writing or updating documentation comments in packages/core, packages/methods, or frameworks/* source files.
Create new API documentation routes for the Formisch website. Use when adding documentation for new exported functions, types, components, or methods that don't yet have website documentation.
Review and verify API documentation routes on the Formisch website. Use when checking documentation accuracy, completeness, and consistency with source code.
Update existing API documentation when Formisch source code changes. Use when function signatures, types, interfaces, or JSDoc comments change in the library source.
Write unit and type tests for Formisch framework packages (frameworks/preact, frameworks/solid, frameworks/svelte, frameworks/vue, frameworks/react). Use when adding tests for hooks/composables/runes (useForm/createForm, useField, useFieldArray) or components (Form, Field, FieldArray) in any framework wrapper.
Write unit tests for Formisch packages (packages/core and packages/methods) with proper TypeScript types. Use when creating new tests, fixing type errors in tests, or adding test coverage for core/methods functions.