check-data-layer

check-data-layer is a command for Claude Code from rungchan2/frontend-skills. It costs 0 tokens per session (1,237 once invoked), scanned A, original, Apache-2.0.

A codebase scanner that checks whether database access and TypeScript types follow the project's required separation rules.

In plain words
What is it for?
Use it to review a TypeScript application for misplaced database calls, poorly organized service files, missing return types, use of any, and duplicate type definitions.
Why use it?
It helps find code where components, hooks, and services access the database in the wrong place, or where types are duplicated or left unclear.

Command for Claude Code

Written for Claude Code: a Claude Code command (commands/*.md).

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add commands/rungchan2/frontend-skills/check-data-layer
Clone the repo
git clone --depth 1 https://github.com/rungchan2/frontend-skills

Made for: Claude Code.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for check-data-layer

README.md
[![agentmods](https://agentmods.dev/badge/commands/rungchan2/frontend-skills/check-data-layer.svg)](https://agentmods.dev/commands/rungchan2/frontend-skills/check-data-layer)
Your own site
<a href="https://agentmods.dev/commands/rungchan2/frontend-skills/check-data-layer"><img src="https://agentmods.dev/badge/commands/rungchan2/frontend-skills/check-data-layer.svg" alt="Measured on agentmods" height="20"></a>
Per session 0 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 1,237 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00000 $0.01237
Opus 5 $0.00000 $0.00619
Sonnet 5 $0.00000 $0.00247
Haiku 4.5 $0.00000 $0.00124

Measured 6d ago against content hash e6a0e3878bec, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-06, from the pricing page.

Security

Grade A, and why

check-data-layer scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 6d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

skills/claudemd/skills/builder/commands/check-data-layer.md · 154 lines

How it starts

The opening of the file, as written. The whole thing — 154 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Check Data Layer Violations

Scan the codebase for violations of the data layer separation architecture and report them.

What to Check

1. Component violations:

  • Search for import.*createClient.*from.*@/lib/supabase/client in component files
  • Search for useQuery or useMutation defined directly in component files (not imported)

2. Hook violations:

  • Search for createClient() calls in /hooks/ files
  • Hooks should only import service functions, not call Supabase directly

3. Service organization:

  • Check if service functions are properly organized in /lib/services/
  • Verify proper file naming: {table-name}.ts or {feature-name}-service.ts

4. TypeScript violations:

  • Functions without explicit return types
  • Async functions without Promise<T> return types
  • Inline type definitions (not imported from /types/)
  • Usage of any type
  • Duplicate type definitions that already exist in /types/

Search Patterns

Use Grep to find violations:

# === Architecture Violations ===

# Find components importing Supabase client
grep -r "import.*createClient.*from.*@/lib/supabase/client" app/ components/ --include="*.tsx" --include="*.ts"

# Find inline queries in components (check for useQuery not from import)
grep -r "useQuery({" app/ components/ --include="*.tsx" -A 3

# Find createClient in hooks (should be in services only)
grep -r "createClient()" hooks/ --include="*.ts" --include="*.tsx"

# Find service functions not in /lib/services/
grep -r "from('.*')" app/ components/ hooks/ --include="*.tsx" --include="*.ts"

# === TypeScript Violations ===

# Find functions without return types (async functions)
grep -rE "export async function [a-zA-Z]+\([^)]*\)\s*{" lib/services/ hooks/ --include="*.ts" --include="*.tsx"

# Find functions without return types (regular functions)
grep -rE "export function [a-zA-Z]+\([^)]*\)\s*{" lib/services/ hooks/ --include="*.ts" --include="*.tsx"

# Find usage of 'any' type
grep -r ": any" lib/services/ hooks/ --include="*.ts" --include="*.tsx"

# Find inline type definitions (type/interface not in /types/)
grep -r "^type [A-Z]" app/ components/ lib/services/ hooks/ --include="*.ts" --include="*.tsx"
grep -r "^interface [A-Z]" app/ components/ lib/services/ hooks/ --include="*.ts" --include="*.tsx"

Read the full file on GitHub · 154 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 6d ago First seen · 154 lines · 0 tokens per session scan A e6a0e3878bec

Subscribe to this mod's changes

check-data-layer is a command published in the GitHub repository rungchan2/frontend-skills (2 stars, last pushed 4mo ago), licensed Apache-2.0. It costs nothing until one of its globs matches a file; then it loads 1,237 tokens. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.