Install any skill in seconds. Free to start, no credit card required.
Get Started Free →Build secure, reusable data access patterns with DTOs, taint checks, and colocated authorization in Next.js. Use when centralizing database queries, transforming raw data to DTOs, adding server-only guards, or preventing sensitive data from reaching Client Components.
.claude/skills/hoangnguyen0403-nextjs-data-access-layer/SKILL.md| Test case | Without → With | Effect | Δ tokens | Δ turns |
|---|---|---|---|---|
| case-01 | ✗→✓ | ▲ Improved | -11% | 0% |
| case-02 | ✗→✓ | ▲ Improved | -12% | 0% |
| case-03 | ✗→✓ | ▲ Improved | -31% | 0% |
| case-06 | ✗→✓ | ▲ Improved | 0% | 0% |
| case-10 | ✗→✓ | ▲ Improved | -22% | 0% |
Centralize all data access (Database & External APIs) to ensure consistent security, authorization, and caching.
services/ or lib/data.ts with import 'server-only'.await auth().cache() from React to deduplicate requests within render cycle.See implementation examples
taintObjectReference or taintUniqueValue from experimental taint API to guard sensitive data.cache() to deduplicate within single render.NotFoundError, UnauthorizedError) caught by error.tsx or notFound().fetch('localhost/api') in Server Components: Call DAL functions directly.When this skill applies, preserve the following domain terminology or equivalent concrete examples in the answer when relevant:
| Case | Status | Duration (ms) | Turns | Tokens | Tool calls | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Without | With | Δ | Without | With | Δ | Without | With | Δ | Without | With | Δ | ||
case-01 | fail→pass | 20,921 | 16,027 | -23% | 1 | 1 | 0% | 2,929 | 2,600 | -11% | 0 | 0 | — |
case-02 | fail→pass | 23,624 | 18,460 | -22% | 1 | 1 | 0% | 3,299 | 2,913 | -12% | 0 | 0 | — |
case-03 | fail→pass | 41,431 | 16,381 | -60% | 1 | 1 | 0% | 3,898 | 2,685 | -31% | 0 | 0 | — |
case-04 | pass→pass | 11,660 | 11,056 | -5% | 1 | 1 | 0% | 1,978 | 2,485 | +26% | 0 | 0 | — |
case-05 | pass→pass | 14,832 | 11,594 | -22% | 1 | 1 | 0% | 2,226 | 2,420 | +9% | 0 | 0 | — |
case-06 | fail→pass | 14,501 | 9,748 | -33% | 1 | 1 | 0% | 2,143 | 2,139 | -0% | 0 | 0 | — |
case-07 | pass→pass | 10,831 | 5,916 | -45% | 1 | 1 | 0% | 1,826 | 1,501 | -18% | 0 | 0 | — |
case-08 | pass→pass | 13,450 | 9,241 | -31% | 1 | 1 | 0% | 2,130 | 1,843 | -13% | 0 | 0 | — |
case-09 | pass→pass | 10,687 | 10,614 | -1% | 1 | 1 | 0% | 1,751 | 1,947 | +11% | 0 | 0 | — |
case-10 | fail→pass | 16,948 | 9,586 | -43% | 1 | 1 | 0% | 2,603 | 2,028 | -22% | 0 | 0 | — |
case-11 | pass→pass | 17,673 | 14,907 | -16% | 1 | 1 | 0% | 2,968 | 3,217 | +8% | 0 | 0 | — |
case-12 | pass→pass | 14,042 | 10,738 | -24% | 1 | 1 | 0% | 2,273 | 2,113 | -7% | 0 | 0 | — |
case-13 | fail→pass | 11,584 | 6,205 | -46% | 1 | 1 | 0% | 1,804 | 1,169 | -35% | 0 | 0 | — |
case-14 | fail→fail | 13,430 | 11,098 | -17% | 1 | 1 | 0% | 2,069 | 2,275 | +10% | 0 | 0 | — |
case-15 | pass→pass | 12,202 | 11,200 | -8% | 1 | 1 | 0% | 1,925 | 2,055 | +7% | 0 | 0 | — |
case-16 | fail→pass | 16,666 | 11,497 | -31% | 1 | 1 | 0% | 2,268 | 2,338 | +3% | 0 | 0 | — |
case-17 | pass→pass | 12,109 | 10,925 | -10% | 1 | 1 | 0% | 1,826 | 2,373 | +30% | 0 | 0 | — |
case-18 | pass→pass | 17,693 | 9,761 | -45% | 1 | 1 | 0% | 2,724 | 2,132 | -22% | 0 | 0 | — |
case-19 | pass→pass | 15,440 | 13,122 | -15% | 1 | 1 | 0% | 2,506 | 2,480 | -1% | 0 | 0 | — |
case-20 | pass→fail | 13,190 | 14,232 | +8% | 1 | 1 | 0% | 2,471 | 3,158 | +28% | 0 | 0 | — |
case-21 | pass→pass | 8,476 | 12,175 | +44% | 1 | 1 | 0% | 1,538 | 2,562 | +67% | 0 | 0 | — |
case-22 | pass→pass | 11,923 | 11,637 | -2% | 1 | 1 | 0% | 2,421 | 2,325 | -4% | 0 | 0 | — |
case-23 | pass→pass | 15,801 | 18,928 | +20% | 1 | 1 | 0% | 2,818 | 4,219 | +50% | 0 | 0 | — |
DecimalAI ran this skill against gemini-3.6-flash twice over the same eval suite — once with the skill loaded and once without — and compared the two runs case by case. 23 cases were attempted. The headline lift of +26 percentage points is the difference between those two pass rates over the 23 comparable cases. 1 case got worse with the skill loaded, and it is included in that figure.
Without the skill loaded, the model failed this case. With it loaded, the same prompt on the same model passed. This is one improved case from the latest verified run; every case, including any that regressed, is in the table above.
Other measured skills in the registry, with their headline benchmark lift.