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
43 changes: 43 additions & 0 deletions .agents/skills/complex-dev/SKILL.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
---
name: complex-dev
description: Execute complex programming tasks with a rigorous, zero-compromise workflow. Use this skill when the user asks to build complex features, refactor major components, or implement robust system architectures.
---

# Complex Development Workflow

You are an expert software engineer executing complex programming tasks. You must strictly follow this rigorous workflow without skipping any steps.

## 🔴 Strict Constraints
* **Zero Trade-offs:** Never sacrifice code quality, security, readability, or maintainability for speed. Do not use hacky workarounds or leave critical "TODO" comments.
* **CLAUDE.md Compliance:** All generated code must strictly adhere to the formatting, architectural, and stylistic guidelines defined in the project's `CLAUDE.md` file.

---

## Step 1: Plan
Before writing any implementation code, analyze the requirement:
1. Outline the system architecture, data flow, and necessary components.
2. Identify potential edge cases, bottlenecks, and external dependencies.
3. Draft a brief step-by-step execution plan and explicitly state it.

## Step 2: Code
Write the implementation based on your plan, prioritizing modularity:
1. **Clear Logical Partitioning:** Keep functions and classes focused on a single responsibility (SRP).
2. **File Splitting:** Do not dump unrelated logic into a monolithic file. Break the code down and extract distinct modules, utilities, and components into separate files as needed.
3. Ensure code is highly readable with descriptive naming conventions and purposeful comments.

## Step 3: Test (Unit & Black-box)
Development is not complete without rigorous testing:
1. **Unit Tests:** Write comprehensive unit tests for all core functions and edge cases to verify internal logic.
2. **Black-box Tests:** Create test scripts or integration tests that validate the feature's external behavior and API boundaries without mocking internal implementations.

## Step 4: Format & Lint
Ensure the code meets production quality standards:
1. Run the project's designated code formatter.
2. Run the project's linter.
3. Automatically fix **all** linting errors and warnings. The code must be completely clean.

## Step 5: Verify
Finalize the task with end-to-end validation:
1. Execute the entire test suite (unit and black-box) to confirm everything passes.
2. Verify that the final implementation directly satisfies all original user requirements.
3. Provide a concise summary of the changes made, tests executed, and linting results.
11 changes: 10 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,14 +43,23 @@ jobs:
- name: Check workspace
run: cargo check --locked --workspace --all-targets

- name: Check SQLite feature set
run: cargo check --locked --no-default-features --features sqlite-fts --workspace --all-targets

- name: Run Clippy
run: cargo clippy --locked --workspace --all-targets -- -D warnings

- name: Run Clippy for SQLite
run: cargo clippy --locked --no-default-features --features sqlite-fts --workspace --all-targets -- -D warnings

- name: Run unit tests
run: cargo test --locked --workspace

- name: Run SQLite unit tests
run: cargo test --locked --no-default-features --features sqlite-fts --workspace

blackbox:
name: PostgreSQL black-box
name: Storage black-box
runs-on: ubuntu-latest
steps:
- name: Checkout
Expand Down
14 changes: 9 additions & 5 deletions CLAUDE.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
# abyss-backend Development Guide

`abyss-backend` is the standalone open-source Agent event service. It owns
event ingestion, PostgreSQL persistence, event queries, optional Elasticsearch
projection, and the HTTP API that exposes those capabilities.
event ingestion, compile-time-selected persistence and search, event queries,
and the HTTP API that exposes those capabilities.

Keep the repository focused on these public event-service responsibilities.

Expand All @@ -11,9 +11,11 @@ Keep the repository focused on these public event-service responsibilities.
- `api` owns HTTP routing and response boundaries.
- `identity` validates the deployment bearer token and returns the stable
standalone owner identifier.
- `usage` owns event request types, validation, ingestion, and queries.
- `search` owns the Elasticsearch projection and search worker.
- `db` owns PostgreSQL pooling, the consolidated migration, and Diesel models.
- `usage` owns event contracts plus backend-independent validation and ordering.
- `search` owns shared search contracts and safe projection extraction.
- `storage` is the `dyn StorageBackend` compatibility boundary and contains the
conditionally compiled PostgreSQL/Elasticsearch and SQLite/FTS5 backends.
- `db` owns PostgreSQL-only pooling, migrations, and Diesel models.

Keep modules focused and start new Rust module files with a `//!` responsibility
comment. Keep the implementation self-contained within this repository.
Expand All @@ -23,6 +25,8 @@ comment. Keep the implementation self-contained within this repository.
```bash
cargo +nightly fmt --all -- --check
cargo clippy --workspace --all-targets -- -D warnings
cargo clippy --no-default-features --features sqlite-fts --workspace --all-targets -- -D warnings
cargo test --workspace
cargo test --no-default-features --features sqlite-fts --workspace
make test-blackbox
```
100 changes: 100 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

11 changes: 9 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
.PHONY: check fmt clippy test test-blackbox docker-build k8s-render
.PHONY: check fmt clippy test test-blackbox test-blackbox-postgres test-blackbox-sqlite docker-build k8s-render

check: fmt clippy test

Expand All @@ -7,13 +7,20 @@ fmt:

clippy:
cargo clippy --locked --workspace --all-targets -- -D warnings
cargo clippy --locked --no-default-features --features sqlite-fts --workspace --all-targets -- -D warnings

test:
cargo test --locked --workspace
cargo test --locked --no-default-features --features sqlite-fts --workspace

test-blackbox:
test-blackbox: test-blackbox-postgres test-blackbox-sqlite

test-blackbox-postgres:
bash scripts/blackbox_abyss_backend.sh

test-blackbox-sqlite:
bash scripts/blackbox_sqlite_backend.sh

docker-build:
docker build -t abyss-backend:local .

Expand Down
Loading
Loading