Skip to content

docs(frontend): add hooks naming and organization conventions#6082

Closed
dantovska wants to merge 1 commit into
mainfrom
docs/frontend-hooks-naming-convention
Closed

docs(frontend): add hooks naming and organization conventions#6082
dantovska wants to merge 1 commit into
mainfrom
docs/frontend-hooks-naming-convention

Conversation

@dantovska

@dantovska dantovska commented Jun 17, 2026

Copy link
Copy Markdown
Contributor

What

Expands the Custom Hooks section of the frontend skill (.ai/skills/frontend/SKILL.md) with explicit naming, organization, and barrel-file conventions for custom React hooks.

Previously the skill only said "store component-specific hooks in the component's /hooks directory." The new content documents the conventions actually used across the vector search and vector set features:

  • Naminguse prefix, camelCase, file named exactly after the hook, named exports only; context hooks defined inline in their provider.
  • Organization — feature-wide vs. component-scoped hooks/ dirs; one folder per non-trivial hook with .types.ts / .utils.ts / .spec.ts companions colocated.
  • Barrels — per-hook index.ts re-exporting the hook + public types, and a hooks/index.ts aggregator (tied to the existing 3+ items barrel rule).

Docs-only change to a skill file; no code or runtime impact.

Testing

No code changes — review the rendered Markdown in .ai/skills/frontend/SKILL.md.


Note

Low Risk
Documentation-only change to a skill file; no application code or runtime behavior is affected.

Overview
Expands Custom Hooks in .ai/skills/frontend/SKILL.md beyond the one-line “put hooks in /hooks” note with conventions aligned to vector-search / vector-set patterns.

Naming documents use + camelCase, named exports only, hook files named after the hook (camelCase, not PascalCase), and context hooks living in their provider file.

Organization distinguishes feature-level vs component-scoped hooks/, one folder per non-trivial hook with colocated *.types.ts, *.utils.ts, and *.spec.ts, and simple hooks as a single file.

Barrels adds per-hook index.ts re-exports and a hooks/index.ts aggregator gated by the existing 3+ hooks barrel rule.

Reviewed by Cursor Bugbot for commit f5e25e3. Bugbot is set up for automated code reviews on this repo. Configure here.

Expand the Custom Hooks section of the frontend skill with naming,
organization, and barrel-file conventions derived from the vector
search and vector set features (use-prefix camelCase, named exports,
one-folder-per-hook with .types/.utils/.spec companions).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@dantovska dantovska requested a review from a team as a code owner June 17, 2026 12:33
@jit-ci

jit-ci Bot commented Jun 17, 2026

Copy link
Copy Markdown

🛡️ Jit Security Scan Results

CRITICAL HIGH MEDIUM

✅ No security findings were detected in this PR


Security scan by Jit

@dantovska

Copy link
Copy Markdown
Contributor Author

decided to leave it up to personal preference depending on the case

@dantovska dantovska closed this Jun 22, 2026
@dantovska dantovska deleted the docs/frontend-hooks-naming-convention branch June 24, 2026 09:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants