.agents/skills/repo-source-code-document/SKILL.md
Document Formisch source code with JSDoc and inline comments. Use when writing or updating documentation comments in packages/core, packages/methods, or frameworks/* source files.
npx skillsauth add open-circle/formisch repo-source-code-documentInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
A concise guide for documenting Formisch source code with JSDoc and inline comments.
First line format:
[Name] [category] interface. → "Form store interface."[Name] [category] type. → "Validation mode type."Special cases:
/**
* Form store interface.
*/
export interface FormStore<TSchema extends Schema> {
/**
* Whether the form is currently submitting.
*/
readonly isSubmitting: ReadonlySignal<boolean>;
/**
* The current error messages of the form.
*/
readonly errors: ReadonlySignal<[string, ...string[]] | null>;
}
Property patterns:
Whether the [subject] [condition].The current [description].The path to the [description] within the form.The [description] of the field element.Overload signatures only (no JSDoc on implementation):
/**
* Creates a reactive field store of a specific field within a form store.
*
* @param form The form store instance.
* @param config The field configuration.
*
* @returns The field store with reactive properties and element props.
*/
export function useField<TSchema, TFieldPath>(
form: FormStore<TSchema>,
config: UseFieldConfig<TSchema, TFieldPath>
): FieldStore<TSchema, TFieldPath>;
// @__NO_SIDE_EFFECTS__
export function useField(form: FormStore, config: UseFieldConfig): FieldStore {
// Implementation (no JSDoc)
}
Rules:
@param: The [description]. (start with "The", end with period)@returns: The [description]. (describe what is returned)// @__NO_SIDE_EFFECTS__ for pure functions only/**
* Internal symbol constant.
*/
export const INTERNAL = '~internal' as const;
No JSDoc and inline comments needed - keep clean.
Mark major logic blocks:
// Get input value from field store
const input = getFieldInput(internalFieldStore);
// If validation is required, perform validation
if (shouldValidate) {
// implementation
}
// If field is touched, validate
if (isTouched) {
validate();
}
// Otherwise, if validation mode is initial, validate
else if (validate === 'initial') {
performValidation();
}
// Otherwise, skip validation
else {
return;
}
Group related operations under one comment:
// Set validation configuration
store.validators = 0;
store.validate = config.validate ?? 'submit';
store.revalidate = config.revalidate ?? 'input';
Explain WHY, not WHAT. Can use articles and periods:
// Hint: The object is deliberately not constructed with spread operator
// for performance reasons
const obj = { prop: value };
In JSDoc:
/**
* The initial input of the field.
*
* Hint: The initial input is used for resetting and may only be changed
* during this process. It does not move when a field is moved.
*/
initialInput: Signal<unknown>;
Same properties/functions across frameworks must use identical documentation text.
Check documentation in other frameworks before adding or modifying.
index, key, item)@ts-expect-error when context is clear[Name] [category] interface.[Name] [category] type.@param name The [description].
@returns The [description].
@internal (for internal APIs only)
// Get [what]
// Set [what] to [value]
// If [condition], [action]
// Otherwise, [action]
// Hint: [explanation with articles and period]
// TODO: [task]
development
Add new documentation guides and tutorials to the Formisch website. Use when creating guides about form concepts, features, or techniques that aren't covered by existing documentation.
development
Update existing API documentation when Formisch source code changes. Use when function signatures, types, interfaces, or JSDoc comments change in the library source.
development
Review and verify API documentation routes on the Formisch website. Use when checking documentation accuracy, completeness, and consistency with source code.
development
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.