Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
version: 2
updates:
- package-ecosystem: maven
directory: /
schedule:
interval: weekly
open-pull-requests-limit: 5
- package-ecosystem: github-actions
directory: /
schedule:
interval: weekly
50 changes: 50 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
name: CI

on:
push:
branches: [main]
pull_request:

permissions:
contents: read

concurrency:
group: ci-${{ github.ref }}
cancel-in-progress: true

jobs:
secret-scan:
name: Secret scan (full history)
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Install gitleaks
env:
GITLEAKS_VERSION: 8.28.0
run: |
curl -sSfL -o gitleaks.tgz "https://github.com/gitleaks/gitleaks/releases/download/v${GITLEAKS_VERSION}/gitleaks_${GITLEAKS_VERSION}_linux_x64.tar.gz"
tar -xzf gitleaks.tgz gitleaks
rm gitleaks.tgz
- name: Scan every commit
run: ./gitleaks git --redact --no-banner .

build:
name: Build and test (Java ${{ matrix.java }})
runs-on: ubuntu-latest
timeout-minutes: 15
strategy:
fail-fast: false
matrix:
java: ['21', '25']
steps:
- uses: actions/checkout@v4
- uses: actions/setup-java@v4
with:
distribution: temurin
java-version: ${{ matrix.java }}
cache: maven
- name: Verify
run: ./mvnw -B verify
6 changes: 6 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
target/
.idea/
*.iml
.vscode/
.DS_Store
.env
3 changes: 3 additions & 0 deletions .mvn/wrapper/maven-wrapper.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
wrapperVersion=3.3.4
distributionType=only-script
distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.9.11/apache-maven-3.9.11-bin.zip
3 changes: 3 additions & 0 deletions AGENTS.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Instructions for coding agents

Follow [CLAUDE.md](CLAUDE.md). The same rules apply to every agent working in this repo.
12 changes: 12 additions & 0 deletions CLAUDE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# Working in this repo

A portfolio repo: classic design patterns in modern Java, and patterns for LLM-backed systems. Read `README.md` first.

- Code is written fresh for this repo. Never copy code, names or domain details from an employer, a client, or any paid task platform.
- Every pattern has three parts: its code in its own package, a test class, and a `README.md` note (problem, the code, what modern Java changes, when not to use it). A change to one updates the others.
- Patterns stay independent: GoF packages don't depend on each other, LLM packages share only `llm.core`. `ArchitectureTest` enforces this.
- The main code has no runtime dependencies (ADR 0002). Tests never call a network or a real model (ADR 0003).
- Compile target is Java 21 (ADR 0001); CI also runs Java 25. The build treats warnings as errors.
- Run `./mvnw verify` before every push.
- Claude works on a feature branch and opens a pull request. Never push to `main`, never merge.
- `docs/LEARNING-NOTES.md` and the "Done so far" table in `KATAS.md` are the owner's own writing. Don't fill them in.
30 changes: 30 additions & 0 deletions KATAS.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
# Katas: rebuild a pattern from its tests

Reading a pattern is not the same as writing it under pressure. These katas are practice for live-coding rounds: delete a pattern's code, keep its tests, and make them pass again.

## The three katas

| Pattern | Tests to make pass | Files to delete |
| --- | --- | --- |
| Strategy | `ShippingCostTest` | `ShippingCost.java`, `Checkout.java` (keep `Parcel.java`) |
| Observer | `EventBusTest` | `EventBus.java`, `Subscription.java` (keep `OrderEvent.java`) |
| Command | `EditorTest` | `Edit.java`, `Editor.java` |

Time-box each one to 30 to 45 minutes, without AI help and without looking at the deleted code.

## How

1. Start a branch: `git switch -c kata/strategy`
2. Delete the files listed above for that pattern.
3. Run only its tests, and write code until they pass: `./mvnw test -Dtest=ShippingCostTest`
4. Run everything, so the architecture rules still hold: `./mvnw verify`
5. Compare your version with the original: `git diff main -- src/main`
6. Write one line in [docs/LEARNING-NOTES.md](docs/LEARNING-NOTES.md) on what you would do differently. Then throw the branch away: `git switch main && git branch -D kata/strategy`

## Done so far

| Kata | Date | Time taken | Notes |
| --- | --- | --- | --- |
| Strategy | | | |
| Observer | | | |
| Command | | | |
29 changes: 29 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
MIT License

Copyright (c) 2026 Alejandro Aguirre Luna

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

---

Scope: the MIT License above covers the source code, tests, templates and
configuration in this repository. The Markdown write-ups (`*.md` files,
including lab READMEs, architecture and threat-model documents, prompts,
runbooks and learning notes) are licensed under CC BY 4.0 instead; see
LICENSE-docs.
Loading
Loading