CLAUDE.md TemplatesClaude Code Skill

CLAUDE.md Template: Angular Material + FastAPI LangChain Starter

Copyable CLAUDE.md template for Angular Material + FastAPI + LangChain Claude Code integration.

CLAUDE.md templateAngular MaterialFastAPILangChainClaude CodeAngularFastAPI LangChainCLAUDE.mdClaude Code TemplateClaude Code

Target User

Frontend and backend engineers building Claude Code workflows for an Angular Material + FastAPI stack

Use Cases

  • Generate Claude Code templates for Angular Material frontend interactions
  • Orchestrate FastAPI endpoints with LangChain prompts
  • Securely integrate Claude with backend API

Markdown Template

CLAUDE.md Template: Angular Material + FastAPI LangChain Starter

# CLAUDE.md

Project role: You are a Claude Code skill assistant responsible for generating a production-ready starter for an Angular Material + FastAPI + LangChain stack. Output must be actionable and paste-ready for CLAUDE.md.

Architecture rules:
- Frontend: Angular (v14+) using Angular Material components.
- Backend: FastAPI with Pydantic models and SQLAlchemy for PostgreSQL access.
- Orchestration: LangChain prompts orchestrating calls to the Claude LLM and backend endpoints.
- Language and tooling: TypeScript for frontend, Python for backend, Claude Code for integration prompts.

File structure rules:
- frontend/
  - src/
  - angular.json
- backend/
  - main.py
  - app/
  - requirements.txt
- langchain/
  - prompts/
  - agents/
- tests/
- docker/

Authentication rules:
- Backend uses OAuth2PasswordBearer with JWT tokens for API access.
- Frontend obtains a short-lived access token after login and sends it in Authorization headers.
- Claude must not embed or log real secrets in prompts or code blocks.

Database rules:
- PostgreSQL recommended; use SQLAlchemy ORM with Alembic migrations.
- Do not hardcode credentials; fetch from environment at runtime.

Validation rules:
- Use Pydantic models in FastAPI for all request/response validation.
- Validate and sanitize all user input from the frontend.

Security rules:
- Enforce HTTPS in production; set CORS to allow known frontend origin only.
- Use CSRF protection for state-changing endpoints where applicable.
- Do not expose raw database errors in API responses.

Testing rules:
- Backend: pytest + httpx for unit and integration tests.
- Frontend: basic component-level tests (Angular TestBed) and E2E tests if feasible.
- Run tests in CI on push and PR.

Deployment rules:
- Docker Compose: frontend, backend, and PostgreSQL services.
- Use environment variables for secrets and DB connection strings.
- Ensure container health checks and proper restart policies.

Things Claude must not do:
- Do not output secrets, API keys, or password strings.
- Do not bypass authentication or enable open endpoints.
- Do not introduce insecure dependencies.
- Do not generate code that writes secrets to disk or logs.

Overview

CLAUDE.md template for Angular Material + FastAPI + LangChain integrates a modern Angular frontend with Angular Material components, a FastAPI backend, and LangChain prompts to drive Claude Code-powered workflows. This page provides a copyable CLAUDE.md template you can paste directly into CLAUDE.md files to bootstrap a production-ready Claude skill for this stack.

Direct answer: This CLAUDE.md template defines a concrete project role, architecture constraints, file structure, and security and deployment rules for a working Angular Material + FastAPI + LangChain Claude Code integration.

When to Use This CLAUDE.md Template

  • Starting a new Claude Code skill for an Angular Material + FastAPI + LangChain project.
  • Enforcing a consistent architecture and workflow across teams.
  • Documenting authentication, data validation, and deployment steps for production use.

Copyable CLAUDE.md Template

# CLAUDE.md

Project role: You are a Claude Code skill assistant responsible for generating a production-ready starter for an Angular Material + FastAPI + LangChain stack. Output must be actionable and paste-ready for CLAUDE.md.

Architecture rules:
- Frontend: Angular (v14+) using Angular Material components.
- Backend: FastAPI with Pydantic models and SQLAlchemy for PostgreSQL access.
- Orchestration: LangChain prompts orchestrating calls to the Claude LLM and backend endpoints.
- Language and tooling: TypeScript for frontend, Python for backend, Claude Code for integration prompts.

File structure rules:
- frontend/
  - src/
  - angular.json
- backend/
  - main.py
  - app/
  - requirements.txt
- langchain/
  - prompts/
  - agents/
- tests/
- docker/

Authentication rules:
- Backend uses OAuth2PasswordBearer with JWT tokens for API access.
- Frontend obtains a short-lived access token after login and sends it in Authorization headers.
- Claude must not embed or log real secrets in prompts or code blocks.

Database rules:
- PostgreSQL recommended; use SQLAlchemy ORM with Alembic migrations.
- Do not hardcode credentials; fetch from environment at runtime.

Validation rules:
- Use Pydantic models in FastAPI for all request/response validation.
- Validate and sanitize all user input from the frontend.

Security rules:
- Enforce HTTPS in production; set CORS to allow known frontend origin only.
- Use CSRF protection for state-changing endpoints where applicable.
- Do not expose raw database errors in API responses.

Testing rules:
- Backend: pytest + httpx for unit and integration tests.
- Frontend: basic component-level tests (Angular TestBed) and E2E tests if feasible.
- Run tests in CI on push and PR.

Deployment rules:
- Docker Compose: frontend, backend, and PostgreSQL services.
- Use environment variables for secrets and DB connection strings.
- Ensure container health checks and proper restart policies.

Things Claude must not do:
- Do not output secrets, API keys, or password strings.
- Do not bypass authentication or enable open endpoints.
- Do not introduce insecure dependencies.
- Do not generate code that writes secrets to disk or logs.

Recommended Project Structure

frontend/
  angular.json
  package.json
  src/
  src/app/
  src/styles.css

backend/
  main.py
  app/
    api/
    models/
    routers/
  requirements.txt
  alembic/

langchain/
  prompts/
  chains/
  prompts_lang/

tests/
  test_backend.py
  test_frontend.cy.ts

docker-compose.yml

Core Engineering Principles

  • Strong typing across both TS and Python with clear data contracts.
  • Explicit interfaces between frontend, backend, and Claude Code prompts.
  • Idempotent operations and predictable error handling.
  • Separate concerns: UI, API, and LLM orchestration are decoupled.
  • Automated tests and CI for regression safety.

Code Construction Rules

  • Frontend must use Angular Material components with accessible UI patterns.
  • Backend must expose typed FastAPI endpoints with Pydantic models.
  • Claude Code prompts must not rely on hardcoded secrets; use environment variables.
  • LangChain prompts must be modular and reusable for different user flows.
  • Do not mix frontend and backend business logic in prompts.

Security and Production Rules

  • Use HTTPS, enforce secure cookies, and set strict CORS policies.
  • Store secrets in environment managers and/or secret vaults; never commit to repo.
  • Implement token expiry and refresh tokens where applicable.
  • Audit logs for authentication, authorization, and sensitive data access.

Testing Checklist

  • Backend: unit tests for Pydantic models and routers; integration tests for LangChain calls.
  • Frontend: unit tests for components and services; accessibility checks.
  • Deployment: verify Docker Compose startup, health checks, and DB migrations.

Common Mistakes to Avoid

  • Hardcoding secrets or exposing them in code blocks.
  • Imprecise data validation leading to runtime errors.
  • Skipping migrations when schema changes occur.
  • Overcomplicating prompts with unrelated tooling.

FAQ

What is this CLAUDE.md template for?
It provides a ready-to-paste instruction block to bootstrap a Claude Code skill for Angular Material + FastAPI + LangChain stack.
Which stack does this template cover?
Angular Material for the frontend, FastAPI for the backend, and LangChain for LLM orchestration with Claude.
How do I customize prompts?
Modify the prompts/ directory under langchain to tailor prompts to your data models and flows.
Where should secrets go?
Environment variables or a secret manager; never hardcode in code or prompts.
Can I deploy with Docker?
Yes. The template includes deployment guidance and a docker-compose-ready layout.