Ontopix Engineering Handbook
Foundational principles, proven patterns, and architectural decisions for engineering at Ontopix.
This repository defines how we work, how we solve problems, and why we made specific architectural choices.
📽️ Quick Overview
Want a visual summary? Watch this video walkthrough that covers the essentials of our engineering handbook:
https://github.com/user-attachments/assets/01bab484-f4a7-40c0-8f08-f3b4e78f0265
What This Is
The Engineering Handbook is the single source of truth for:
- Principles — Core values and beliefs guiding ALL engineering decisions
- Patterns — Proven, reusable solutions to recurring problems
- Decisions — Architectural Decision Records (ADRs) documenting why we made specific choices
- Templates — Ready-to-use starting points for new work
- Resources — External tools, services, and platforms catalog
This handbook is designed to work equally well for:
- Humans — Engineers onboarding, making decisions, or resolving ambiguity
- AI Agents — Claude Code, Cursor, and other coding assistants needing clear operational context
Principles vs Patterns
Understanding the difference between Principles and Patterns is critical to using this handbook effectively.
Quick Reference
| Aspect | Principles | Patterns |
|---|---|---|
| What | Core values and beliefs | Proven solutions to problems |
| Abstraction | Philosophical, abstract | Concrete, actionable |
| Scope | Universal (applies everywhere) | Specific (solves particular problems) |
| Stability | Very stable (years) | Evolves regularly (months) |
| Examples | SOLID, DRY, Security-first | AGENTS.md, Taskfile, .infra/ |
Principles (Abstract Philosophy)
What: Core values and beliefs that guide ALL engineering decisions at Ontopix.
Characteristics:
- Abstract and philosophical
- Apply universally across all contexts
- Rarely change (years between updates)
- Not prescriptive about implementation
- Guide decision-making
Examples:
- SOLID principles (Single Responsibility, Open/Closed, etc.)
- DRY (Don't Repeat Yourself)
- KISS (Keep It Simple, Stupid)
- Security by design
- Automation over manual work
Think of principles as: "Our engineering philosophy and values"
Patterns (Concrete Solutions)
What: Proven, reusable solutions to recurring problems.
Characteristics:
- Concrete and actionable
- Solve specific problems
- Evolve as technology changes
- Prescriptive about implementation
- Can be directly applied
Examples:
- Use AGENTS.md as AI agent entrypoint
- Use Taskfile for operational contracts
- Place infrastructure in .infra/ directory
- JWT tokens for authentication
Think of patterns as: "How we implement our philosophy"
The Relationship
Principles (Why)
↓
Patterns (What & How)
↓
Implementation (Actual Code)
Example Flow:
- Principle: "Automation over manual work"
- Pattern: "Use Taskfile for all repository operations"
- Implementation:
Taskfile.yamlin specific repository
Decision Flow
When facing an engineering decision:
┌─────────────────────┐
│ New Challenge │
└──────────┬──────────┘
│
▼
┌─────────────────────┐
│ Check Principles │ ← Does this align with our values?
└──────────┬──────────┘
│
▼
┌─────────────────────┐
│ Find/Create Pattern │ ← How do we solve this?
└──────────┬──────────┘
│
▼
┌─────────────────────┐
│ Implement │ ← Write actual code
└─────────────────────┘
Principles
Our Core Engineering Principles define the abstract values that guide all our work:
- Simplicity First — YAGNI, KISS, Occam's Razor
- Code Quality & Maintainability — Write for comprehension by humans and AI agents
- Security by Design — Defense in depth, Zero Trust, least privilege
- Automation Over Manual Work — If you do it twice, automate it
- Evidence Over Assumptions — Measure, don't guess
- Human-AI Collaboration — AI agents as first-class citizens in development
- Pragmatism Over Dogma — Context matters, use judgment
- Ownership & Responsibility — You build it, you run it
- Long-Term Thinking — Technical debt is real debt
- Continuous Learning & Improvement — Stay curious, iterate on processes
Patterns
Proven solutions to recurring problems at Ontopix.
Organizational Patterns (Mandatory)
These patterns define how we organize work and apply to ALL repositories:
| Pattern | Problem Solved | Priority |
|---|---|---|
| Repository Structure | Inconsistent file organization | ✅ Required |
| AI Agent Entrypoint | Agents don't know where to start | ✅ Required |
| Taskfile Contract | Inconsistent operational interfaces | ✅ Required |
| Infrastructure Layout | Where to put Terraform/IaC | ✅ Required* |
| Sandbox Environments | Safe local development | ✅ Required* |
| Git Conventions | Inconsistent git workflows | ✅ Required |
| GitHub Actions | CI/CD setup and patterns | ✅ Required |
*Required if applicable: Infrastructure Layout (for repos with infrastructure), Sandbox (for application repos)
Technical Patterns (Optional but Recommended)
These patterns define how we solve specific technical problems:
| Pattern | Problem Solved | Status |
|---|---|---|
| Lambda Deploy | Standard Lambda code deployment from CI/CD | ✅ Production |
| Authentication | User identity verification | 🚧 Coming soon |
| Caching | Performance optimization | 🚧 Coming soon |
| Rate Limiting | API protection | 🚧 Coming soon |
| Error Handling | Consistent error responses | 🚧 Coming soon |
Technical patterns will be extracted from production implementations and added incrementally.
Quick Start
For New Engineers
Week 1: Understand the philosophy
- Read Core Engineering Principles
- Understand Principles vs Patterns (above)
- Review the Decision Flow
Week 2: Learn the patterns 4. Read Organizational Patterns 5. Review Templates 6. Set up your first repository
Week 3: Understand the context 7. Browse ADRs to understand "why" 8. See how principles inform patterns
For Starting a New Repository
Minimum Viable Repository (5 required files):
my-new-repo/
├─ README.md ← Human documentation
├─ AGENTS.md ← AI agent entrypoint
├─ Taskfile.yaml ← Operational interface
├─ .editorconfig ← Editor consistency
└─ CODEOWNERS ← Ownership definition
Setup Steps:
- Copy templates from templates/
- Follow Repository Structure Pattern
- Create AGENTS.md from template
- Define operations in Taskfile.yaml
- If deploying infrastructure, follow Infrastructure Layout
- If application, implement Sandbox
For AI Agents
When you enter an Ontopix repository:
- Read
AGENTS.mdfirst — It is your mandatory entrypoint - Check for patterns — AGENTS.md references relevant patterns
- Use Taskfile for operations — Never invoke tools directly
- Surface pattern violations — Stop and ask if you detect discrepancies
- Request human approval — For architecture, infrastructure, or contract changes
Decisions
Architectural Decision Records (ADRs) document why we made specific choices. ADRs are immutable historical records.
Available ADRs
| ADR | Decision | Date |
|---|---|---|
| ADR-0001 | Keep patterns in this repo (not separate) | 2025-12-16 |
| ADR-0002 | AGENTS.md as mandatory AI agent entrypoint | 2025-12-16 |
| ADR-0003 | Taskfile as repository operational contract | 2025-12-16 |
| ADR-0004 | Infrastructure organization with .infra/ convention | 2025-12-16 |
| ADR-0011 | Direct zip upload as default Lambda deploy method | 2026-03-14 |
Templates
Ready-to-use starting points for creating new repositories:
| Template | Purpose | Required |
|---|---|---|
| README.md.tpl | Human-oriented repository documentation | ✅ Yes |
| AGENTS.md.tpl | AI agent entrypoint and operational contract | ✅ Yes |
| Taskfile.yaml.tpl | Repository operational interface | ✅ Yes |
| CLAUDE.md.tpl | Claude-specific context and instructions | Optional |
| cursorrules.tpl | Cursor-specific rules and patterns | Optional |
Resources
Centralized catalog of external resources, tools, and service accounts used across Ontopix engineering.
Quick Access
| Category | Description | Examples |
|---|---|---|
| SaaS Platforms | External services and platforms | AWS, N8n, Stripe |
| Infrastructure | Cloud providers, CDN, DNS | Cloudflare, Domain registrar |
| Development Tools | CI/CD, monitoring, testing | GitHub, Sentry, Datadog |
| APIs & Integrations | External APIs and integration endpoints | OpenAI, Stripe webhooks |
🔐 Important Security Note
Resources documentation NEVER includes credentials. It documents:
- Where to find credentials (password manager, vault)
- Who manages access (team or person)
- How to request access (Slack channel, contact)
How to Use This Handbook
When Should I Consult What?
Starting a project? → Check Principles → Apply Organizational Patterns → Use Templates
Solving a specific problem? → Browse Technical Patterns → Check related ADRs
Making an architectural decision? → Review Principles → Check existing ADRs → Create new ADR if needed
Need access to external services? → Check Resources for URLs, access info, and credential locations
Onboarding AI agents? → Point them to AGENTS.md pattern
Understanding "why"? → Read ADRs for historical context
Evolution and Contributions
Proposing Changes
To Principles (rare):
- Create issue explaining why principle should change
- Discuss with engineering leadership
- Update principle documentation
- Communicate organization-wide
To Patterns (common):
- Identify problem with current pattern
- Propose solution with evidence
- Create PR with changes
- Get review from engineering team
- Update related ADRs if needed
To Add New Pattern:
- Verify problem recurs 3+ times
- Document solution following pattern structure
- Provide real production examples
- Create PR for review
- Pattern becomes official after merge
Creating ADRs
When making architectural decisions:
- Use ADR template
- Document context, decision, alternatives, consequences
- Place in
decisions/directory - Link from relevant patterns
- ADRs are immutable after creation (history doesn't change)
FAQ
Q: What's the difference between principles and patterns? A: Principles are abstract values (SOLID, DRY). Patterns are concrete solutions (AGENTS.md, Taskfile). See Principles vs Patterns.
Q: Are all patterns mandatory? A: Organizational patterns are mandatory for all repos. Technical patterns are optional but recommended for specific problems.
Q: Can I deviate from patterns? A: Only with explicit justification documented in AGENTS.md or an ADR. Engineering leadership must approve.
Q: Where do I find implementation examples? A: Check Templates for starting points and pattern documentation for production examples.
Q: How do I know which pattern to use? A: Read AGENTS.md in the repository - it references relevant patterns for that specific project.
Q: What if a pattern conflicts with language conventions? A: Language conventions win, but document the exception in AGENTS.md.
Getting Help
- Have a question? → Create an issue
- Found a bug? → Create an issue
- Want to contribute? → Create a PR
- Need clarification? → Ask in engineering Slack
Remember: These are guidelines informed by experience, not rigid rules. Use judgment. Question dogma. Build great things.