skills/barnhardt-enterprises-inc/architecture-patterns/SKILL.md
Organizational coding standards and architectural patterns. References comprehensive skills for detailed patterns. Use when making architecture decisions or implementing features.
npx skillsauth add aiskillstore/marketplace architecture-patternsInstall 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.
This skill is a pattern index that references comprehensive skills for details. Use this to understand which pattern to use, then reference the specific skill for implementation details.
→ See: nextjs-15-specialist skill
Quick Reference:
Decision Tree:
Need interactivity (onClick, onChange)?
├─ YES → Client Component
└─ NO → Server Component
Need React hooks (useState, useEffect)?
├─ YES → Client Component
└─ NO → Server Component
Need to fetch data?
└─ Prefer Server Component (better performance)
Details: nextjs-patterns.md
→ See: typescript-strict-guard skill
Quick Reference:
any - Use explicit types or unknown with type guards@ts-ignore - Fix underlying type error! assertions - Use optional chaining or type guardsunknown typesDecision Tree:
Type is unknown at compile time?
├─ Use `unknown` with type guard
└─ Define explicit interface/type
Need optional property?
├─ Use `type?.property`
└─ Or `type ?? defaultValue`
Need to narrow union type?
└─ Use discriminated union or type guard
Details: typescript-conventions.md
→ See: drizzle-orm-patterns skill
Quick Reference:
.with() syntaxDecision Tree:
Need to query database?
├─ Simple query → db.select().from(table)
├─ Relations → .with() syntax
└─ Complex → Use joins explicitly
Need to modify data?
├─ Single record → db.insert/update/delete
└─ Multiple operations → Use transaction
Details: database-patterns.md
Quick Reference:
Decision Tree:
What kind of state?
├─ Server data (API, database) → React Query
├─ Local UI (toggle, input) → useState
├─ Shared across components → Context
├─ URL parameters → useSearchParams
└─ Form data → React Hook Form
Details: state-management-patterns.md
→ See: zod-validation-patterns skill
Quick Reference:
Decision Tree:
Implementing API route?
1. Define Zod schema for input validation
2. Check authentication (if protected)
3. Validate input with schema.parse()
4. Check authorization (resource ownership)
5. Execute business logic
6. Return appropriate status code
Details: api-patterns.md
→ See: react-19-patterns skill
Quick Reference:
Details: react-19-patterns.md
Scenario: Need to display data from database
Options:
Server Component (PREFERRED)
React Query in Client Component
Server-Sent Events (SSE)
Decision:
Is data static or rarely changes?
└─ Use Server Component
Need real-time updates?
└─ Use SSE pattern
Need client-side caching/refetching?
└─ Use React Query
Scenario: Need to handle form submission
Options:
Server Actions (PREFERRED)
Client Component + API Route
Decision:
Simple form (create, update)?
└─ Use Server Action
Complex validation or multi-step?
└─ Use Client Component + API Route
Need optimistic UI updates?
└─ Use Client Component with useOptimistic
Scenario: Need to protect routes/resources
Pattern:
// 1. Check authentication
const user = await getAuthUser(request)
if (!user) {
return new Response('Unauthorized', { status: 401 })
}
// 2. Check authorization (resource ownership)
const resource = await db.resource.findUnique({ where: { id } })
if (!resource) {
return new Response('Not found', { status: 404 })
}
if (resource.userId !== user.id) {
return new Response('Forbidden', { status: 403 })
}
// 3. Proceed with operation
See: ../security-sentinel/SKILL.md
This skill uses progressive disclosure:
Example workflow:
Architecture patterns aggregate knowledge from:
// app/projects/page.tsx (Server Component)
export default async function ProjectsPage() {
const projects = await db.select().from(projectsTable)
return <ProjectList projects={projects} />
}
// app/api/projects/route.ts
import { z } from 'zod'
const createSchema = z.object({
name: z.string().min(1).max(100),
})
export async function POST(request: Request) {
// 1. Validate input
const body = await request.json()
const validated = createSchema.parse(body)
// 2. Check auth
const user = await getAuthUser(request)
if (!user) return new Response('Unauthorized', { status: 401 })
// 3. Execute
const project = await db.insert(projectsTable).values({
...validated,
userId: user.id,
})
return Response.json(project, { status: 201 })
}
// components/ProjectCard.tsx (Client Component)
'use client'
import { useState } from 'react'
export function ProjectCard({ project }: Props) {
const [loading, setLoading] = useState(false)
const handleDelete = async () => {
setLoading(true)
await deleteProject(project.id)
setLoading(false)
}
return (
<div>
<h2>{project.name}</h2>
<button onClick={handleDelete} disabled={loading}>
Delete
</button>
</div>
)
}
development
Apple Human Interface Guidelines for content display components. Use this skill when the user asks about charts component, collection view, image view, web view, color well, image well, activity view, lockup, data visualization, content display, displaying images, rendering web content, color pickers, or presenting collections of items in Apple apps. Also use when the user says how should I display charts, what's the best way to show images, should I use a web view, how do I build a grid of items, what component shows media, or how do I present a share sheet. Cross-references: hig-foundations for color/typography/accessibility, hig-patterns for data visualization patterns, hig-components-layout for structural containers, hig-platforms for platform-specific component behavior.
tools
Automate HelpDesk tasks via Rube MCP (Composio): list tickets, manage views, use canned responses, and configure custom fields. Always search tools first for current schemas.
testing
Expert Haskell engineer specializing in advanced type systems, pure functional design, and high-reliability software. Use PROACTIVELY for type-level programming, concurrency, and architecture guidance.
tools
GraphQL gives clients exactly the data they need - no more, no less. One endpoint, typed schema, introspection. But the flexibility that makes it powerful also makes it dangerous. Without proper controls, clients can craft queries that bring down your server. This skill covers schema design, resolvers, DataLoader for N+1 prevention, federation for microservices, and client integration with Apollo/urql. Key insight: GraphQL is a contract. The schema is the API documentation. Design it carefully.