Code Patterns logo

Code Patterns

Community
Aedelon
code-patterns

Reference patterns for REST APIs, pytest/vitest testing, Docker multi-stage builds, GitHub Actions CI/CD, PostgreSQL, TypeScript generics, Python async, and React Server Components. MUST BE USED when user asks about: "API design", "how to test", "Dockerfile", "CI/CD pipeline", "database schema", "TypeScript types", "async/await", "React hooks", "Next.js", "FastAPI", "testing pattern", "mock", "fixture", "docker compose", "github actions", "workflow yaml", "postgres query", "SQL pattern", "migration", "generic type", "server component", "use client", "use server", "middleware pattern", "error handling pattern", "retry logic". Includes code examples and validation commands. NOT for running tests (use smart-test-runner), security patterns (use security-audit), or git operations (use commit-message).

Overview

PublisherAedelon
Repositoryclaude-code-blueprint
Skill namecode-patterns
Stars
119
Forks
34
Bundled files
Instructions only
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.

  • Self-contained

    Everything the model needs lives in the instructions — no extra files to sync.

  • Open source

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

Installation

Install the Code 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.
    https://github.com/Aedelon/claude-code-blueprint/tree/main/skills/code-patterns
  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/Aedelon/claude-code-blueprint.git /tmp/claude-code-blueprint
mkdir -p .claude/skills
cp -r /tmp/claude-code-blueprint/skills/code-patterns .claude/skills/code-patterns
Restart Claude Code after copying so it picks up the new skill.

Use it in TypingMind

Enable Code 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 Code 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 Code 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.

Code Patterns Reference

This skill contains comprehensive patterns for modern development. Reference files are organized by topic.

Quick Reference

TopicKey PatternsWhen to Use
API DesignREST, GraphQL, OpenAPIDesigning/implementing APIs
Testingpytest, vitest, mockingWriting tests
DockerMulti-stage, ComposeContainerizing apps
CI/CDGitHub Actions, pipelinesSetting up automation
DatabasePostgreSQL, migrationsDatabase design
TypeScriptTypes, generics, patternsTS development
Pythonasync, patterns, uvPython development
React/Next.jsServer Components, hooksFrontend development

Reference Files

  • api.md - REST, GraphQL, authentication, pagination
  • testing.md - pytest, vitest, mocking, coverage
  • docker.md - Dockerfiles, Compose, production
  • ci-cd.md - GitHub Actions, deployment
  • database.md - PostgreSQL, migrations, queries
  • typescript.md - Types, generics, advanced patterns
  • python.md - async, patterns, best practices
  • react.md - Server Components, hooks, Next.js

API Design Quick Reference

REST Endpoints

GET    /resources         List
GET    /resources/{id}    Get one
POST   /resources         Create
PUT    /resources/{id}    Replace
PATCH  /resources/{id}    Update
DELETE /resources/{id}    Delete

HTTP Status Codes

CodeMeaning
200OK
201Created
204No Content
400Bad Request
401Unauthorized
403Forbidden
404Not Found
422Unprocessable
429Rate Limited
500Server Error

Testing Quick Reference

pytest

python
@pytest.fixture
def client():
    return TestClient(app)

def test_endpoint(client):
    response = client.get("/api/users")
    assert response.status_code == 200

vitest

typescript
import { describe, it, expect, vi } from 'vitest';

describe('Component', () => {
  it('should work', () => {
    expect(true).toBe(true);
  });
});

Docker Quick Reference

Multi-Stage Build

dockerfile
FROM node:20-alpine AS builder
WORKDIR /app
COPY package*.json ./
RUN npm ci
COPY . .
RUN npm run build

FROM node:20-alpine
COPY --from=builder /app/dist ./dist
USER node
CMD ["node", "dist/index.js"]

Compose

yaml
services:
  app:
    build: .
    ports:
      - "3000:3000"
    depends_on:
      db:
        condition: service_healthy
  db:
    image: postgres:16-alpine
    healthcheck:
      test: ["CMD", "pg_isready"]

CI/CD Quick Reference

GitHub Actions

yaml
name: CI
on: [push, pull_request]
jobs:
  test:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      - uses: actions/setup-node@v4
      - run: npm ci
      - run: npm test

TypeScript Quick Reference

Utility Types

typescript
Partial<T>      // All properties optional
Required<T>     // All properties required
Pick<T, K>      // Select properties
Omit<T, K>      // Exclude properties
Record<K, V>    // Object with key type K, value type V

Generics

typescript
function first<T>(arr: T[]): T | undefined {
  return arr[0];
}

Python Quick Reference

Async

python
async def fetch_data():
    async with aiohttp.ClientSession() as session:
        async with session.get(url) as response:
            return await response.json()

Type Hints

python
def process(items: list[str]) -> dict[str, int]:
    return {item: len(item) for item in items}

React/Next.js Quick Reference

Server Component (default)

tsx
// app/page.tsx
async function Page() {
  const data = await fetch('...');
  return <div>{data}</div>;
}

Client Component

tsx
'use client';
import { useState } from 'react';

export function Counter() {
  const [count, setCount] = useState(0);
  return <button onClick={() => setCount(c => c + 1)}>{count}</button>;
}

Frequently asked questions

What does the Code Patterns AI skill do?

Reference patterns for REST APIs, pytest/vitest testing, Docker multi-stage builds, GitHub Actions CI/CD, PostgreSQL, TypeScript generics, Python async, and React Server Components. MUST BE USED when user asks about: "API design", "how to test", "Dockerfile", "CI/CD pipeline", "database schema", "TypeScript types", "async/await", "React hooks", "Next.js", "FastAPI", "testing pattern", "mock", "fixture", "docker compose", "github actions", "workflow yaml", "postgres query", "SQL pattern", "migration", "generic type", "server component", "use client", "use server", "middleware pattern", "erro...

Why use Code Patterns on TypingMind?

Because you install it once and use it with any model. Code 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 Code Patterns in TypingMind?

Open Plugins → Skills → Install from GitHub in TypingMind and paste https://github.com/Aedelon/claude-code-blueprint/tree/main/skills/code-patterns. TypingMind reads its SKILL.md and installs it as a skill you can enable per chat.

Which AI models can use Code 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 Code Patterns?

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

Is the Code Patterns AI skill free?

It is published on GitHub by Aedelon. 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 👇