Architecture Patterns logo

Architecture Patterns

Community
jiaxiaojunQAQ
architecture-patterns

Organizational coding standards and architectural patterns. References comprehensive skills for detailed patterns. Use when making architecture decisions or implementing features.

Overview

PublisherjiaxiaojunQAQ
RepositorySkillJect
Skill namearchitecture-patterns
Stars
79
Forks
8
Bundled files
7
Links
  • Markdown instructions

    A SKILL.md file the model loads on demand, so it only costs tokens when a request actually matches.

  • Works with any LLM

    AI skills are plain Markdown, not provider-specific code, so this works with GPT, Claude, Gemini, Grok, or a local model.

  • 7 bundled files

    Scripts, templates, and references the model can read while it works. Files are read-only and never executed.

  • Open source

    Published by jiaxiaojunQAQ on GitHub. Read the source before you install it.

Installation

Install the Architecture Patterns AI skill in TypingMind to use it with any LLM, or drop it into another agent that reads SKILL.md.

1

Install in TypingMind

TypingMind installs a skill straight from its GitHub folder — it reads SKILL.md, bundles the resource files, and stores the result locally.

  1. Open the app and go to Plugins → Skills.
  2. Choose "Install from GitHub".
  3. Paste the skill folder URL below and confirm.
  4. Enable the skill in any chat where you want it available.
Plugins → Skills → Add skill → From GitHub URL, then paste the folder URL and press Continue.
2

Install in another agent

Any agent that reads the Agent Skills format can use this skill — copy the folder into that agent's skills directory.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/jiaxiaojunQAQ/SkillJect.git /tmp/SkillJect
mkdir -p .claude/skills
cp -r /tmp/SkillJect/data/skills_sample/architecture-patterns-barnhardt-enterprises-inc .claude/skills/architecture-patterns
Restart Claude Code after copying so it picks up the new skill.

Use it in TypingMind

Enable Architecture Patterns in any TypingMind chat and the model takes it from there. Its name and description sit in the system prompt, and the moment a request matches, the model loads the full instructions itself — you never invoke it by hand, and it costs no tokens until it is actually used.

The model loads Architecture Patterns on its own as soon as a request matches it.

Works with any AI model

AI skills are plain Markdown instructions rather than provider-specific code, so Architecture Patterns is not tied to the model it was written for. Install it once in TypingMind and use it with GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama, or a local model you run yourself — all on your own API keys.

  • Loaded only when it is needed

    The system prompt carries just the name and description. The instructions are fetched on the first matching request, so an idle skill costs nothing.

  • Switch models mid-chat

    Because the skill is instructions rather than code, changing model does not break it — the next model reads the same SKILL.md.

Skill instructions

This is the SKILL.md content the model loads. Read it before installing — a skill is instructions your model will follow.

Architecture Patterns (Pattern Index)

When to Use

  • Making architecture decisions
  • Implementing new features
  • Reviewing code for pattern compliance
  • Choosing between multiple approaches
  • Learning established patterns

Overview

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.

Pattern Categories

1. Next.js Patterns

→ See: nextjs-15-specialist skill

Quick Reference:

  • Server Components (default): Data fetching, database access, backend APIs
  • Client Components ('use client'): Interactivity, hooks, browser APIs
  • Server Actions ('use server'): Form submissions, mutations
  • Route Handlers (app/api/): REST API endpoints
  • Streaming: Suspense boundaries for progressive loading

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


2. TypeScript Conventions

→ See: typescript-strict-guard skill

Quick Reference:

  • No any - Use explicit types or unknown with type guards
  • No @ts-ignore - Fix underlying type error
  • No ! assertions - Use optional chaining or type guards
  • Explicit types - All function parameters and return types
  • Type guards - Runtime validation for unknown types

Decision 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


3. Database Patterns

→ See: drizzle-orm-patterns skill

Quick Reference:

  • Drizzle ORM (not Prisma) - Edge runtime compatible
  • Parameterized queries - SQL injection prevention
  • Transactions - Atomic operations for multi-step changes
  • Relations - Join queries with .with() syntax
  • Migrations - Version-controlled schema changes

Decision 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


4. State Management Patterns

Quick Reference:

  • Server state → React Query (useQuery, useMutation)
  • Local UI state → useState
  • Shared UI state → Context API
  • URL state → Next.js useSearchParams
  • Form state → React Hook Form + Zod

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


5. API Patterns

→ See: zod-validation-patterns skill

Quick Reference:

  • Input validation → Zod schemas (MANDATORY)
  • Error handling → try/catch with informative messages
  • Response format → Consistent JSON structure
  • Status codes → Proper HTTP semantics
  • Authentication → Check before processing
  • Authorization → Verify resource ownership

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


6. React 19 Patterns

→ See: react-19-patterns skill

Quick Reference:

  • use() hook - Read resources (Promises, Context) in components
  • useOptimistic - Optimistic UI updates
  • useFormStatus - Form submission state
  • useActionState - Server action state management
  • Actions - Server/client actions for mutations

Details: react-19-patterns.md


Pattern Selection Guide

Data Fetching

Scenario: Need to display data from database

Options:

  1. Server Component (PREFERRED)

    • ✅ Best performance
    • ✅ No client bundle
    • ✅ Direct database access
    • ❌ No interactivity
  2. React Query in Client Component

    • ✅ Caching, refetching, optimistic updates
    • ✅ Client-side interactivity
    • ❌ Larger bundle
    • ❌ Requires API route
  3. Server-Sent Events (SSE)

    • ✅ Real-time updates
    • ✅ Automatic reconnection
    • ❌ More complex setup
    • ❌ Requires SSE endpoint

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

Form Handling

Scenario: Need to handle form submission

Options:

  1. Server Actions (PREFERRED)

    • ✅ Progressive enhancement
    • ✅ Works without JavaScript
    • ✅ Simple implementation
    • ❌ Limited client-side control
  2. Client Component + API Route

    • ✅ Full client-side control
    • ✅ Complex validation
    • ✅ Multi-step forms
    • ❌ More code

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

Authentication

Scenario: Need to protect routes/resources

Pattern:

typescript
// 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


Progressive Disclosure

This skill uses progressive disclosure:

  1. SKILL.md (this file) - Pattern index and decision trees
  2. Pattern files - Reference comprehensive skills
  3. Comprehensive skills - Full implementation details

Example workflow:

  1. Read SKILL.md to understand pattern categories
  2. Use decision tree to select pattern
  3. Reference specific pattern file for overview
  4. Deep dive into comprehensive skill for details

Integration with Other Skills

Architecture patterns aggregate knowledge from:

  • nextjs-15-specialist - Next.js 15 complete patterns
  • typescript-strict-guard - TypeScript strict mode
  • drizzle-orm-patterns - Database operations
  • react-19-patterns - React 19 features
  • zod-validation-patterns - Input validation
  • security-sentinel - Security best practices

Common Patterns Quick Reference

Create a new page with data

typescript
// app/projects/page.tsx (Server Component)
export default async function ProjectsPage() {
  const projects = await db.select().from(projectsTable)
  return <ProjectList projects={projects} />
}

Create an API endpoint

typescript
// 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 })
}

Add interactivity to a component

typescript
// 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>
  )
}

See Also

  • nextjs-patterns.md - Next.js pattern details
  • typescript-conventions.md - TypeScript standards
  • database-patterns.md - Database operation patterns
  • state-management-patterns.md - State management guide
  • api-patterns.md - API design patterns
  • react-19-patterns.md - React 19 features

Bundled files

The model reads these on demand while the skill is loaded. They are exposed as readable files and are never executed.

Frequently asked questions

What does the Architecture Patterns AI skill do?

Organizational coding standards and architectural patterns. References comprehensive skills for detailed patterns. Use when making architecture decisions or implementing features.

Why use Architecture Patterns on TypingMind?

Because you install it once and use it with any model. Architecture Patterns is plain Markdown rather than provider-specific code, so the same skill runs on GPT-5, Claude, Gemini, Grok, or a local model — and you can switch model mid-chat without it breaking. TypingMind runs on your own API keys, so you pay providers directly instead of a per-seat subscription, and your skills and chats stay in your own storage.

How do I install Architecture Patterns in TypingMind?

Open Plugins → Skills → Install from GitHub in TypingMind and paste https://github.com/jiaxiaojunQAQ/SkillJect/tree/main/data/skills_sample/architecture-patterns-barnhardt-enterprises-inc. TypingMind reads its SKILL.md and bundles its files and installs it as a skill you can enable per chat.

Which AI models can use Architecture Patterns?

Any model you connect in TypingMind. AI skills are plain Markdown instructions rather than provider-specific code, so GPT, Claude, Gemini, Grok, and local models can all load this skill when a request matches it.

How many AI models can I use with Architecture Patterns?

As many as you like. As long as a model supports skills, you can use Architecture Patterns with it — GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama and more — all on TypingMind with your own API keys.

Is the Architecture Patterns AI skill free?

It is published on GitHub by jiaxiaojunQAQ. Check the repository for licensing terms. You only pay your own AI provider for the tokens you use.

What are AI skills?

An AI skill is a reusable instruction bundle that teaches an AI model how to do one specific task. It follows the open Agent Skills format: a SKILL.md file with a name and description, plus any scripts, templates or reference files the model may need. The model reads the instructions only when your request matches the skill, so an installed skill costs nothing until it is used.

How are AI skills different from plugins or MCP servers?

A plugin or MCP server gives a model new tools to call — code that runs somewhere and returns a result. An AI skill gives the model knowledge and process instead: how to approach a task, which steps to follow, what good output looks like. Skills are plain Markdown, so they need no server, no API key and no runtime, and they work with any model.

View all

Set up your own AI workspace now

Get notified about new features and future giveaways by subscribing to our newsletter 👇