Skip to content

Implementation plan / Session plan / Handover FN-S01

Handover FN-S01 Foundation: Repository layout and agent instructions

Card: FN-S01. Issue: cema-care/his#1. Branch: session/FN-S01.

What was built and where

  • Agent instruction file CLAUDE.md at the repository root: how a session starts and ends, the rules that matter while working, where code goes (with every deployable unit, its folder and its modules), build and test commands, naming, and where handovers and decision records go.
  • Code folders beside docs/, each with a README that says what it holds and who changes it:
  • services/: one folder per application deployable unit of architecture section 5.2 (25, named <domain code>-<unit>), and services/_template/ reserved for FN-S03;
  • platform/: one folder per Domain 2 platform unit (10), and platform/dev-environment/ reserved for FN-S02;
  • contracts/: one folder per domain (10), and contracts/common/ reserved for FN-S04;
  • web/: shell/ and design-system/ reserved for FN-S06, and domains/<domain>/ for the ten domain workspaces;
  • e2e/: harness/ for FN-S07 and scenarios/<SLICE>/ for the slices. The unit folders and their modules follow UNITS in sessions_def.py, so the plan's rule that two sessions never work on one unit side by side also keeps them out of each other's files.
  • Decision record ADR-HIS-039 Code layout of the repository, Status Accepted and approved by the Enterprise Architecture Board on 2026-11-24: one independent build per folder, Gradle with dependency locking for Java units, pnpm with a lockfile per folder for TypeScript, nothing at the root edited by ordinary sessions. Its row is added to the decision record index exactly as build_adrs.py writes it (checked by running the generator on a scratch copy; the plan build was not run in the checkout).
  • .gitignore: build output of Gradle, pnpm/Node, OpenTofu, test reports and editors.

docs/, mkdocs.yml, requirements-docs.txt and .github/workflows/ are unchanged apart from the new decision record, its index row and this handover.

Checks and their result

Check Command Result
Link check of docs/ python3 docs/implementation_plan/tools/check_links.py 0 broken links, 0 duplicate anchors
Documentation site build pip install -r requirements-docs.txt && mkdocs build Builds; ADR-HIS-039 is listed in the index page
Links in CLAUDE.md and the code-folder READMEs (outside docs/, so not covered by the link check) A one-off script applying the same rule as check_links.py 62 files, 162 links, 0 broken
Generated index unchanged except for the new record build_adrs.py on a scratch copy, then diff -r against the checkout Only the record count and the ADR-HIS-039 row differ before the copy; identical after
"A new session can find where code goes and how to build and test it from the instruction file alone" A fresh agent given only CLAUDE.md answered twelve questions a build, screen, contract and integrate session would ask Every question answered from the file. The gaps it found are fixed: the stack of services/pex-portal-bff, the build file to declare a dependency in, where Gradle runs, the environment name, what to do when a command does not exist yet, the test scenario tag, and the decision record index exception

No code builds yet: the Gradle, pnpm and OpenTofu commands in CLAUDE.md section 3 are the convention the foundation sessions FN-S02 to FN-S07 implement, and each of them updates that section.

Requirements and test scenarios

The card implements no functional requirement and lists no test scenario.

Differences from the card or specification

  • Decision records stay in docs/architecture/decisions/. The card lists a top-level folder for decision records, and also says the records exist in docs/architecture/decisions/ and that the instruction file should point there. A second location would split them, so there is none; CLAUDE.md points to the existing folder.
  • No manifests or lockfiles yet. The card requires each unit, workspace and contract folder to have its own manifest and lockfile. FN-S01 fixes the rule and the folders; the files themselves come from the service template (FN-S03), the contract tooling (FN-S04) and the web workspaces (FN-S06). Empty builds created now would only be overwritten.
  • Build tools chosen here. The technology stack names Java 21 with Spring Boot and TypeScript but no build tool or package manager; a per-folder lockfile needs one, so ADR-HIS-039 chose Gradle and pnpm. The Board confirmed both, and care.cema.his as the root of the Java packages, when it approved the record.

Questions for a person

None left. The Enterprise Architecture Board approved ADR-HIS-001 to ADR-HIS-039 on 2026-11-24, in the review of the FN-S01 pull request. That settles this card's "Needs a person". The Board confirmed the three choices of ADR-HIS-039: Gradle rather than Maven, pnpm rather than npm, and care.cema.his as the root of the Java packages. Main records the approval in ADR-HIS-001 to ADR-HIS-038. This pull request records it in ADR-HIS-039: Status Accepted, Decided by the Board, and Record approved on 2026-11-24.

After the merge with main, CLAUDE.md follows session rule 0 (Claude owns the code base, ADR-HIS-041) and rule 11. Under rule 11, a review agent reviews every pull request and the launcher merges what it approves (ADR-HIS-040). Approvals named under "Needs a person" are given on the merged work and never block. A decision record a session writes is Accepted when written, and its Record line stays "awaiting approval" until the Board approves.

Follow-ups outside the card

  • Patient portal frontend. The ten web workspaces are for the staff shell. Whether the patient-facing portal screens (design group P13) are a workspace under web/domains/pex/ or an application of their own is for FN-S06 or the first PEX screen session to settle.
  • Shared dependency upgrades. With a lockfile per folder, a library used by many units (Spring Boot, for example) is upgraded unit by unit. The pipeline of FN-S05 may want a report of version drift across units.