Skip to content

Add Copilot skill for Akces Framework internal development#336

Merged
jwijgerd merged 2 commits into
mainfrom
copilot/create-akces-framework-skill
Apr 11, 2026
Merged

Add Copilot skill for Akces Framework internal development#336
jwijgerd merged 2 commits into
mainfrom
copilot/create-akces-framework-skill

Conversation

Copilot AI commented Apr 11, 2026

Copy link
Copy Markdown
Contributor

New Copilot cloud agent skill (.github/skills/akces-framework-development/SKILL.md) for coding tasks on the framework internals. Complements the existing embabel-agent-framework skill which covers the Embabel/agentic side.

  • Activation scope: Framework architecture, core module changes, Kafka integration, state management, schema handling, build infrastructure, operator work
  • Module map: Full dependency graph (apisharedruntimeclientquery-supporteventcatalogagentic) with per-module package/class tables using full org.elasticsoftware.akces package names
  • Technology stack: Kafka-backed JSON Schema registry (Akces-Schemas topic), Protobuf 3.x internal wire protocol (jackson-dataformat-protobuf), Jackson 3.x (tools.jackson for core/databind, com.fasterxml.jackson.annotation for annotations in api)
  • Runtime internals: Partition lifecycle state machine (INITIALIZINGINITIALIZING_STATELOADING_GDPR_KEYSLOADING_STATEPROCESSINGSHUTTING_DOWN), handler function adapter pattern, Kafka topic layout, exactly-once transaction boundaries, RocksDB state snapshots
  • Agentic module: Singleton enforcement (1 partition per topic type, 1 replica), automatic initial state creation via getCreateDomainEvent() + @EventSourcingHandler(create = true), Kafka topic table, tick model, agent resolution — defers to embabel-agent-framework skill for Embabel concepts
  • Coding conventions: Immutable records, error events over exceptions, schema versioning, GDPR/PII handling (shared Akces-GDPRKeys topic), Apache 2.0 headers
  • Common dev tasks: Step-by-step for adding annotations, built-in events, protocol records, partition lifecycle changes, and new K8s CRDs
  • Build/test: Per-module commands and known quirks (e.g. -Dmaven.compiler.failOnError=false for controller compilation issues)

@jwijgerd
jwijgerd marked this pull request as ready for review April 11, 2026 11:58
Copilot AI review requested due to automatic review settings April 11, 2026 11:58

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds a new GitHub Copilot skill document intended to guide contributors working on the Akces Framework internals (core modules, runtime internals, operator, and build/test workflows), complementing the existing Embabel-focused skill.

Changes:

  • Introduces .github/skills/akces-framework-development/SKILL.md with an internal development guide (module map, runtime/agentic internals, conventions, and common tasks).
  • Documents build/test commands and operational development notes for framework modules and the Kubernetes operator.

Comment on lines +369 to +371
- [FRAMEWORK_OVERVIEW.md](../../FRAMEWORK_OVERVIEW.md) — Detailed architecture documentation
- [SERVICES.md](../../SERVICES.md) — Kubernetes services and deployment
- [README.md](../../README.md) — Project overview and getting started

Copilot AI Apr 11, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The relative links in the Reference Links section point to ../../FRAMEWORK_OVERVIEW.md, ../../SERVICES.md, and ../../README.md, which resolves under .github/ (e.g. .github/FRAMEWORK_OVERVIEW.md) and does not exist. These links should go up one more level to the repo root (e.g. ../../../FRAMEWORK_OVERVIEW.md).

Suggested change
- [FRAMEWORK_OVERVIEW.md](../../FRAMEWORK_OVERVIEW.md) — Detailed architecture documentation
- [SERVICES.md](../../SERVICES.md) — Kubernetes services and deployment
- [README.md](../../README.md) — Project overview and getting started
- [FRAMEWORK_OVERVIEW.md](../../../FRAMEWORK_OVERVIEW.md) — Detailed architecture documentation
- [SERVICES.md](../../../SERVICES.md) — Kubernetes services and deployment
- [README.md](../../../README.md) — Project overview and getting started

Copilot uses AI. Check for mistakes.
Comment on lines +73 to +78
| `o.e.akces.aggregate` | `Aggregate<S>`, `AgenticAggregate<S>`, `AggregateState`, `MemoryAwareState`, `TaskAwareState`, `CommandHandlerFunction`, `EventSourcingHandlerFunction`, `EventHandlerFunction`, `EventBridgeHandlerFunction`, `UpcastingHandlerFunction`, `CommandType`, `DomainEventType`, `AggregateStateType`, `SchemaType` |
| `o.e.akces.annotations` | `@AggregateInfo`, `@AgenticAggregateInfo`, `@CommandInfo`, `@DomainEventInfo`, `@AggregateStateInfo`, `@CommandHandler`, `@EventSourcingHandler`, `@EventHandler`, `@EventBridgeHandler`, `@UpcastingHandler`, `@PIIData`, `@AggregateIdentifier`, `@QueryModelInfo`, `@QueryModelEventHandler`, `@DatabaseModelInfo`, `@DatabaseModelEventHandler`, `@QueryModelStateInfo`, `@ReflectorInfo`, `@ReflectorEventHandler` |
| `o.e.akces.commands` | `Command`, `CommandBus` interfaces |
| `o.e.akces.events` | `DomainEvent`, `ErrorEvent` interfaces |
| `o.e.akces.processmanager` | `ProcessManager<S, P>` interface |
| `o.e.akces.query` | `QueryModel<S>`, `QueryModelState`, `DatabaseModel` |

Copilot AI Apr 11, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The package names in the module tables use o.e.akces.*, but the actual packages in this repo are org.elasticsoftware.akces.*. Using the abbreviated prefix here is likely to confuse contributors searching/navigating the code (and the later task steps also reference o.e.akces.*).

Suggested change
| `o.e.akces.aggregate` | `Aggregate<S>`, `AgenticAggregate<S>`, `AggregateState`, `MemoryAwareState`, `TaskAwareState`, `CommandHandlerFunction`, `EventSourcingHandlerFunction`, `EventHandlerFunction`, `EventBridgeHandlerFunction`, `UpcastingHandlerFunction`, `CommandType`, `DomainEventType`, `AggregateStateType`, `SchemaType` |
| `o.e.akces.annotations` | `@AggregateInfo`, `@AgenticAggregateInfo`, `@CommandInfo`, `@DomainEventInfo`, `@AggregateStateInfo`, `@CommandHandler`, `@EventSourcingHandler`, `@EventHandler`, `@EventBridgeHandler`, `@UpcastingHandler`, `@PIIData`, `@AggregateIdentifier`, `@QueryModelInfo`, `@QueryModelEventHandler`, `@DatabaseModelInfo`, `@DatabaseModelEventHandler`, `@QueryModelStateInfo`, `@ReflectorInfo`, `@ReflectorEventHandler` |
| `o.e.akces.commands` | `Command`, `CommandBus` interfaces |
| `o.e.akces.events` | `DomainEvent`, `ErrorEvent` interfaces |
| `o.e.akces.processmanager` | `ProcessManager<S, P>` interface |
| `o.e.akces.query` | `QueryModel<S>`, `QueryModelState`, `DatabaseModel` |
| `org.elasticsoftware.akces.aggregate` | `Aggregate<S>`, `AgenticAggregate<S>`, `AggregateState`, `MemoryAwareState`, `TaskAwareState`, `CommandHandlerFunction`, `EventSourcingHandlerFunction`, `EventHandlerFunction`, `EventBridgeHandlerFunction`, `UpcastingHandlerFunction`, `CommandType`, `DomainEventType`, `AggregateStateType`, `SchemaType` |
| `org.elasticsoftware.akces.annotations` | `@AggregateInfo`, `@AgenticAggregateInfo`, `@CommandInfo`, `@DomainEventInfo`, `@AggregateStateInfo`, `@CommandHandler`, `@EventSourcingHandler`, `@EventHandler`, `@EventBridgeHandler`, `@UpcastingHandler`, `@PIIData`, `@AggregateIdentifier`, `@QueryModelInfo`, `@QueryModelEventHandler`, `@DatabaseModelInfo`, `@DatabaseModelEventHandler`, `@QueryModelStateInfo`, `@ReflectorInfo`, `@ReflectorEventHandler` |
| `org.elasticsoftware.akces.commands` | `Command`, `CommandBus` interfaces |
| `org.elasticsoftware.akces.events` | `DomainEvent`, `ErrorEvent` interfaces |
| `org.elasticsoftware.akces.processmanager` | `ProcessManager<S, P>` interface |
| `org.elasticsoftware.akces.query` | `QueryModel<S>`, `QueryModelState`, `DatabaseModel` |

Copilot uses AI. Check for mistakes.

**Rules when modifying `api`:**
- Interfaces and annotations here are the public API. Changes are breaking.
- Keep the module dependency-free (no Kafka, no Spring, no Jackson).

Copilot AI Apr 11, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The guidance 'Keep the module dependency-free (no Kafka, no Spring, no Jackson)' is inaccurate for main/api: it depends on spring-context and jackson-annotations (and uses com.fasterxml.jackson.annotation.* in the API types). Consider updating this to the real constraint (e.g. no Kafka/runtime deps, and only Jackson annotations).

Suggested change
- Keep the module dependency-free (no Kafka, no Spring, no Jackson).
- Keep the module free of Kafka and runtime implementation dependencies; only lightweight API-level dependencies such as Spring context support and Jackson annotations should be used here.

Copilot uses AI. Check for mistakes.
- **Maven** — multi-module build, Bill of Materials (`bom/`), annotation processors
- **RocksDB** — embedded key–value store for aggregate state snapshots
- **Confluent Schema Registry** — Avro schema management for commands, events, and state
- **Jackson 3.x** — JSON serialization via `tools.jackson` package (not `com.fasterxml.jackson`)

Copilot AI Apr 11, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The Jackson note says to use tools.jackson and not com.fasterxml.jackson, but the codebase still uses com.fasterxml.jackson.annotation.* / jackson-annotations (notably in main/api). This should be clarified (e.g. tools.jackson for databind/core, com.fasterxml.jackson.annotation still used for annotations) to avoid misleading imports.

Suggested change
- **Jackson 3.x**JSON serialization via `tools.jackson` package (not `com.fasterxml.jackson`)
- **Jackson 3.x**use `tools.jackson` for core/databind JSON serialization APIs; `com.fasterxml.jackson.annotation` may still be used for annotations where the codebase depends on `jackson-annotations` (notably in `main/api`)

Copilot uses AI. Check for mistakes.
- **Spring Boot 4.x** — auto-configuration, dependency injection, Spring Kafka
- **Maven** — multi-module build, Bill of Materials (`bom/`), annotation processors
- **RocksDB** — embedded key–value store for aggregate state snapshots
- **Confluent Schema Registry** — Avro schema management for commands, events, and state

Copilot AI Apr 11, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The tech stack claims 'Confluent Schema Registry' and 'Avro schema management', but the framework’s SchemaRegistry implementation is Kafka-topic based (Akces-Schemas) and schemas are generated/validated as JSON Schema. Also, protocol records are serialized via Protobuf in ProtocolRecordSerde, not Avro. Updating this would prevent incorrect guidance.

Suggested change
- **Confluent Schema Registry**Avro schema management for commands, events, and state
- **Kafka-backed schema registry**schemas are stored in the `Akces-Schemas` topic and generated/validated as JSON Schema; protocol records use Protobuf serialization

Copilot uses AI. Check for mistakes.
Comment on lines +133 to +135
`STARTING` → `INITIALIZING` → `CATCHING_UP` → `PROCESSING` → `SHUTTING_DOWN`

For agentic aggregates, there is an additional `INITIALIZING_STATE` step between `INITIALIZING` and `CATCHING_UP` for auto-creating singleton state.

Copilot AI Apr 11, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The partition lifecycle state list (STARTINGINITIALIZINGCATCHING_UPPROCESSINGSHUTTING_DOWN) does not match the actual AggregatePartitionState enum (INITIALIZING, INITIALIZING_STATE, LOADING_GDPR_KEYS, LOADING_STATE, PROCESSING, SHUTTING_DOWN). This section should reflect the real state machine names to avoid confusion when debugging partition behavior.

Suggested change
`STARTING``INITIALIZING``CATCHING_UP``PROCESSING``SHUTTING_DOWN`
For agentic aggregates, there is an additional `INITIALIZING_STATE` step between `INITIALIZING` and `CATCHING_UP` for auto-creating singleton state.
`INITIALIZING``INITIALIZING_STATE``LOADING_GDPR_KEYS``LOADING_STATE``PROCESSING``SHUTTING_DOWN`
These names should be used as-is when correlating logs, metrics, and partition behavior during startup, state restoration, GDPR key loading, normal processing, and shutdown.

Copilot uses AI. Check for mistakes.
### GDPR / PII

- Fields annotated with `@PIIData` are encrypted/decrypted transparently.
- Encryption keys are per-aggregate, stored in a dedicated `*-GDPRKeys` Kafka topic.

Copilot AI Apr 11, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The GDPR section says encryption keys are stored in a dedicated *-GDPRKeys topic. In the current implementation the keys are stored in the shared Akces-GDPRKeys topic (partitioned), not per-aggregate topic. Please update this to match the actual topic layout.

Suggested change
- Encryption keys are per-aggregate, stored in a dedicated `*-GDPRKeys` Kafka topic.
- Encryption keys are stored in the shared partitioned `Akces-GDPRKeys` Kafka topic.

Copilot uses AI. Check for mistakes.
- **Spring Boot 4.x** — auto-configuration, dependency injection, Spring Kafka
- **Maven** — multi-module build, Bill of Materials (`bom/`), annotation processors
- **RocksDB** — embedded key–value store for aggregate state snapshots
- **Confluent Schema Registry** — Avro schema management for commands, events, and state

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

JSON schema management

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed in ae94fc8 — updated to "Kafka-backed schema registry — schemas are stored in the Akces-Schemas compacted Kafka topic and generated/validated as JSON Schema".


---

## Technology Stack

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

mention Protobuf 3.x for Internal Wire Protocol

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added in ae94fc8 — new bullet: "Protobuf 3.x — internal wire protocol for all protocol records (ProtocolRecordSerde, SchemaRecordSerde) using Jackson's jackson-dataformat-protobuf".

| `AgentProcessResultTranslator` | Drains `DomainEvent` objects from the Embabel Blackboard after each tick |
| `AgenticAggregateRuntimeFactory` | Spring bean factory — registers built-in memory/task events and adapters |

**Important agentic internals:**

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

mention here that AgenticAggrates are singleton instances with only 1 partition per topic type (add same table as for normal Aggregates). Also mention that the Framework takes care of creating the initital state (base on a DomainEvent and EventSourcingHandler provided by implementing class)

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Expanded in ae94fc8 — added singleton enforcement details, auto-creation via getCreateDomainEvent() + @EventSourcingHandler(create = true) during INITIALIZING_STATE, and a Kafka topic table for AgenticAggregates (same structure as normal aggregates but always 1 partition).

Copilot AI requested a review from jwijgerd April 11, 2026 12:11
@jwijgerd
jwijgerd merged commit bebef1c into main Apr 11, 2026
3 checks passed
@jwijgerd
jwijgerd deleted the copilot/create-akces-framework-skill branch April 11, 2026 12:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants