Initial commit: architecture design instructions and documentation

This commit is contained in:
Steffen committed 2026-10-13 13:38:21 +02:00
commit 4bbf5afe3e
64 files changed
+8819

No files matched your search

+106
View File
@@ -0,0 +1,106 @@
# AGENT.md — Requirements-Driven Architecture Design
## Mission
Design a coherent software architecture for the Health App based on the supplied requirements and relevant design constraints. Produce an architecture that can satisfy the application's required behaviour and is explicitly reasoned about in terms of potential energy efficiency.
Your task is **architecture design, not implementation**. Do not generate, edit, inspect, or request application source code. Do not implement services, infrastructure, scripts, tests, or deployment configurations.
Design an architecture justified by the documented requirements, constraints, and engineering trade-offs. Do not introduce complexity merely to produce a different architectural structure.
Evaluate architectural alternatives with **energy efficiency as an important design objective**. Explain which architectural characteristics could influence energy consumption, why, and under what assumptions. Consider potential trade-offs when selecting the proposed architecture.
## Inputs and authority
All documentation relevant to the application is located under `Docs/`.
Before designing the architecture, recursively inspect and read the documentation contained in `Docs/`, including its subdirectories.
Use this documentation to establish the system's functional requirements, business rules, constraints, and expected behaviour.
Distinguish mandatory requirements from existing architectural and design decisions. Existing architectural and design decisions may be reconsidered unless they represent explicit requirements or constraints.
Where documents contain contradictions, ambiguities, or missing information that materially affect architectural decisions, request clarification rather than silently making assumptions.
Do not modify the original documentation under `Docs/`. Place all newly produced architecture documentation in `ArchitectureProposal/`.
Treat sources according to their role:
1. **Functional requirements, acceptance criteria, and externally observable behaviour** are binding. Preserve them, including error and alternative scenarios.
2. **Domain concepts and genuine constraints** from the documentation must be respected where required by the functional requirements, acceptance criteria, documented non-functional requirements, or explicit user clarification. Record assumptions and unresolved ambiguities.
3. **Existing structural or technology decisions** described in documentation (such as service boundaries, number of databases, gateway placement, persistence allocation, protocols, or deployment topology) are **not binding solely because they appear in an earlier design**. Determine whether each is an explicit requirement or a design choice. If its status materially affects the architecture and is unclear, ask for clarification.
Design the architecture that best satisfies the documented requirements and constraints, with energy efficiency as an important design objective.
Evaluate relevant architectural alternatives and justify the selected approach based on their advantages, disadvantages, and expected consequences.
Existing architectural decisions may be retained, modified, or replaced based on their suitability. Do not favour an architecture merely because it already exists, nor reject one because it resembles an existing design.
Prioritize architectural suitability and justified decisions over novelty or the number of changes proposed.
Never edit the supplied requirements or design input files. Record suggested clarifications separately.
## Design boundaries
- Work at **software architecture and system design level**: components and responsibilities, boundaries, interactions, domain concepts and relationships, conceptual class structures, data ownership, persistence, caching, concurrency, deployment topology, communication, and relevant architectural patterns. Domain and class diagrams describe the design, not existing source code.
- Preserve required capabilities and externally observable API semantics where specified. Do not invent new functional requirements.
- Prefer architectural simplicity where alternatives otherwise satisfy the requirements and design objectives comparably. Evaluate whether additional complexity offers justified benefits, including potential energy-efficiency benefits.
- You may consider a monolith, modular monolith, microservices, or another pattern; no pattern is inherently preferred unless the supplied requirements mandate it.
- Consider energy-related consequences of architectural decisions, including idle resource use, inter-process/network communication, duplicated runtime overhead, database footprint, serialization, and scaling behaviour.
- Distinguish **energy consumption** from latency, throughput, CPU usage, and memory usage. These are not interchangeable measurements.
- Exclude code-level tuning, compiler flags, algorithm replacement, and micro-optimizations. Do not include the energy cost of operating an LLM.
- Maintain security, data protection, maintainability, deployability, and correctness; energy is not the only design objective.
## Working procedure
1. **Inventory the inputs.** Identify each requirements and design source, its purpose, and missing information. Read all relevant material before designing.
2. **Create a requirements-and-constraints register.** Separate binding functional behaviour, non-functional requirements, domain rules, assumed constraints, and optional existing design decisions. Cite file paths and requirement/user-story IDs.
3. **Identify architectural drivers.** Explain which requirements and expected runtime behaviours influence topology, boundaries, data flow, storage, and energy use. Identify important unknowns, especially expected workload and deployment environment.
4. **Consider alternatives.** Compare at least two feasible architectural approaches at a high level, including likely strengths, weaknesses, and energy-related hypotheses. Do not assume the most distributed or most consolidated design is superior.
5. **Select and develop one complete proposed architecture.** Justify the choice; define necessary components, responsibilities, interfaces, domain concepts, conceptual class relationships, data ownership, communication, persistence, security boundaries, and deployment assumptions. Document the architecture in an authoritative written specification and consistent editable diagrams. Avoid implementation-specific details unless necessary to make the design unambiguous.
6. **Check coverage and consistency.** Map every user story and acceptance criterion to the components and interactions responsible for satisfying it. Flag gaps and conflicts; do not silently redefine requirements.
7. **Evaluate the design critically.** Identify risks, trade-offs, likely bottlenecks, uncertainties, and expected energy-related consequences of architectural decisions. Explain the reasoning and assumptions behind those expectations.
If essential requirements are contradictory or a decision could materially alter the architecture, **stop and ask a focused question**. For smaller uncertainties, make the smallest explicit, reversible assumption and record it.
## Outputs
Write all new artifacts under `ArchitectureProposal/`; do not overwrite or rewrite the provided `Docs/` inputs.
Create:
- `ArchitectureProposal/README.md` — overview, scope, status, input list, assumptions, and navigation.
- `ArchitectureProposal/software-architecture.md` — authoritative written specification of the chosen architecture, including architectural style, system boundaries, components and responsibilities, interfaces and interactions, data flows and persistence, domain model, security and trust boundaries, deployment and runtime behaviour, failure handling, and key assumptions. Refer to the diagrams and keep the written specification consistent with them.
- `ArchitectureProposal/requirements-traceability.md` — mapping from every functional requirement, user story, and acceptance criterion to the proposed architecture; gaps and open questions.
- `ArchitectureProposal/architecture-decisions.md` — significant decisions and rationale, alternatives considered, consequences, and rejected options.
- `ArchitectureProposal/energy-hypotheses.md` — for each energy-relevant decision: anticipated mechanism, expected effect, assumptions, dependencies, and possible counter-effects. These are design expectations, not measured results; do not invent numerical savings or measurement procedures.
- `ArchitectureProposal/risks-and-open-questions.md` — uncertainties, unresolved constraints, potential behavioural incompatibilities, and trade-offs.
- `ArchitectureProposal/diagrams/` — editable **`.drawio` source files** for at least:
- **System context diagram** — actors, external systems, and system boundary.
- **Logical component diagram** — architectural components, responsibilities, interfaces, and interactions.
- **Domain model diagram** — domain concepts, their relationships, and relevant constraints; independent of source-code classes.
- **Conceptual class diagram** — design-level classes/types, responsibilities, key attributes and associations needed to explain the domain and design; do not reverse-engineer or invent code-level implementation details.
- **Data ownership/persistence diagram** — ownership and storage relationships.
- **Deployment topology diagram** — runtime units, hosts/containers where relevant, and communication boundaries.
Add sequence diagrams for important cross-component use cases when useful. Do not provide image-only diagrams as the sole source.
The proposed architecture must be sufficiently precise to guide implementation, but **do not write implementation code**.
## Quality gate before declaring completion
Confirm in the README that:
- [ ] Every functional requirement, user story, and acceptance criterion is traceable to the proposed architecture; unresolved coverage gaps are explicitly identified. No requirement has been silently omitted or changed.
- [ ] All significant input design constraints have been classified as mandatory, assumed, or optional, with uncertainty recorded.
- [ ] The proposed architecture is internally consistent, satisfies the documented requirements and constraints, and its significant decisions are justified independently of whether they resemble existing designs.
- [ ] The authoritative software architecture specification is complete and consistent with the diagrams.
- [ ] The domain model and conceptual class diagram cover relevant domain concepts and design relationships without prescribing unnecessary implementation detail.
- [ ] All components have clear responsibilities and ownership of data.
- [ ] Key communication, security, deployment, and failure-handling concerns are addressed.
- [ ] Expected energy-related effects are presented with reasoning, assumptions, and potential counter-effects, not as established savings.
- [ ] Draw.io source diagrams are editable and consistent with the written design.
- [ ] No application source code or original input documents were changed.
## Interaction and change control
Work only on the architecture assignment defined here. You may add or revise files in `ArchitectureProposal/`. Do not change requirements, original design documents, or other repository areas without explicit authorization. Explain important uncertainties and seek approval when a requirement conflicts with a proposed decision. Do not present expected energy benefits as measured results.