.github/skills/coding-standards/SKILL.md
TypeScript coding patterns and implementation standards for this project. Load when implementing new logic, refactoring existing code, handling errors, or when unsure how to structure state, side effects, or component architecture. Covers Result<T,E> pattern, composable logic design, and component architecture decisions.
npx skillsauth add poko8nada/pj_docs coding-standardsInstall 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.
// shared/types.ts — single source of truth, never redefine per-feature
type Result<T, E> = { ok: true; value: T } | { ok: false; error: E };
T | undefined or T | null// Domain function
function parseId(input: unknown): Result<string, "Invalid ID"> {
return typeof input === "string" && input !== ""
? { ok: true, value: input }
: { ok: false, error: "Invalid ID" };
}
// Server action
export async function createPost(
formData: FormData,
): Promise<Result<Post, string>> {
const title = formData.get("title");
if (!title) return { ok: false, error: "Title required" };
try {
const post = await db.insert({ title });
return { ok: true, value: post };
} catch (error) {
console.error("DB error:", error);
return { ok: false, error: "Failed to create post" };
}
}
// Hook
function useCreatePost() {
const [result, setResult] = useState<Result<Post, string> | null>(null);
const [isLoading, setIsLoading] = useState(false);
const create = async (formData: FormData) => {
setIsLoading(true);
const res = await createPost(formData);
setResult(res);
setIsLoading(false);
return res;
};
return { create, result, isLoading };
}
Applies to: React Hooks, Vue Composables, Svelte Runes, Solid Primitives, etc.
Components directly import stores/utilities/logic.
Use when: simple single-purpose components, no reuse needs, small-to-medium complexity.
Feature layer handles logic, components receive props.
Use when: reusable across contexts, complex business logic, clear server/client separation needed.
Decision: start with Pattern 1. Refactor to Pattern 2 when reuse, testing, or complexity demands it.
Only for:
Never for:
tools
Composite Skill. This skill is used for project planning. Users request that a project plan be created, particularly during the initial stages.
documentation
Core Skill. This skill is for document creation. User ask you to create planning documents, such as requirement and task breakdown.
development
Core Skill. Next.js 15+ App Router architecture guidelines including component patterns, state management with Zustand, server actions, and project structure. Use when developing Next.js applications.
development
Core Skill. HonoX architecture guidelines including file-based routing, Islands pattern, component types, performance optimization, and best practices for full-stack development.