本文へ移動
cccskills
無料GitHub で公開

architecture

Modular monolith architecture overview for melosys-api. Use when needing to understand module structure, dependencies between modules, where to place new code, or when changes in one module might affect others. Triggers: "architecture", "module dependencies", "where should I put", "which modules", "dependency graph".

日本語の概要は準備中です。原文の説明を表示しています。

インストール方法を見る

含まれるファイル(1)

  • SKILL.md7.6 KB

SKILL.md(原文)

インストールする前に、エージェントに与えられる指示の中身を確認できます。

Melosys-API Architecture

Modular monolith with 12 core modules plus the soknad-altinn types module (JAXB-generated classes from an Altinn XSD; depends on nothing internal, used by integrasjon). Understanding the dependency graph is essential for:

  • Knowing where to place new code
  • Understanding what tests to run after changes
  • Avoiding circular dependencies

Module Dependency Graph

                              ┌─────────────┐
                              │     app     │ ← Entry point (Spring Boot)
                              └──────┬──────┘
           ┌──────────────┬─────────┼─────────┬──────────────┐
           │              │         │         │              │
           ▼              ▼         ▼         ▼              ▼
    ┌──────────┐   ┌──────────┐ ┌──────┐ ┌─────────┐  ┌──────────┐
    │frontend- │   │ saksflyt │ │config│ │sikkerhet│  │statistikk│
    │   api    │   └────┬─────┘ └───┬──┘ └────┬────┘  └────┬─────┘
    └────┬─────┘        │           │         │            │
         │              │           │         │            │
         └──────┬───────┴───────────┴─────────┘            │
                │                                          │
                ▼                                          │
         ┌──────────┐                                      │
         │ service  │◄─────────────────────────────────────┘
         └────┬─────┘
              │
    ┌─────────┼─────────┬────────────┐
    │         │         │            │
    ▼         ▼         ▼            ▼
┌────────┐┌────────┐┌──────────┐┌───────────┐
│reposit-││integra-││saksflyt- ││   domain  │
│  ory   ││  sjon  ││   api    │└─────┬─────┘
└───┬────┘└───┬────┘└────┬─────┘      │
    │         │          │            │
    └─────────┴──────────┴────────────┘
                         │
                         ▼
                    ┌─────────┐
                    │  feil   │ ← Base exception module
                    └─────────┘

Module Descriptions

ModulePurposeKey Contents
appSpring Boot entry pointMain class, Flyway migrations, profiles
frontend-apiREST endpoints for melosys-webControllers, DTOs, GraphQL
saksflytSaga orchestrationSaga implementations, step handlers
saksflyt-apiSaga contracts/eventsEvent classes, saga interfaces
serviceBusiness logicCore services, validation, calculations
repositoryData accessJPA repositories, queries
integrasjonExternal systemsPDL, EESSI, Joark, Kafka consumers
domainJPA entitiesEntities, embeddables, converters
sikkerhetSecurityOIDC, ABAC, token handling
configCross-cutting configMDC, Unleash, ShedLock, metrics
statistikkDVH reportingEvent listeners, statistics producers
feilException hierarchyTekniskException, FunksjonellException
soknad-altinnAltinn A1 form typesJAXB classes generated from NAV_MedlemskapArbeidEOS XSD (no internal deps; used by integrasjon)

Dependency Rules

Allowed dependencies (downward only):

app → frontend-api, saksflyt, config, sikkerhet, statistikk, domain
frontend-api → service, repository, domain, sikkerhet, feil
saksflyt → service, saksflyt-api, domain, config, feil
service → repository, integrasjon, saksflyt-api, domain, config, feil
statistikk → service, domain
repository → domain
integrasjon → domain, sikkerhet, config, feil, soknad-altinn
saksflyt-api → domain, config
domain → feil
sikkerhet → feil
config → sikkerhet
feil → (none)

Forbidden: Circular dependencies, upward dependencies

Source of truth: These rules are derived from each module's pom.xml <dependencies> (artifacts under groupId no.nav.melosys, e.g. melosys-domain, melosys-integrasjon). They are hand-maintained here — regenerate from the POMs if module dependencies change.

Impact Analysis

When modifying code, test dependent modules:

If you change...Test these modules
feildomain, service, saksflyt, frontend-api, integrasjon, sikkerhet
domainrepository, service, saksflyt, frontend-api, integrasjon, saksflyt-api
repositoryservice, frontend-api
integrasjonservice
saksflyt-apiservice, saksflyt
servicesaksflyt, frontend-api, statistikk
sikkerhetintegrasjon, frontend-api, config
configservice, saksflyt, saksflyt-api, integrasjon

Placement Guidelines

Type of codeModule
REST endpointfrontend-api
Business logicservice
JPA entitydomain
Repository interfacerepository
External API clientintegrasjon
Saga/workflowsaksflyt (impl), saksflyt-api (contract)
Security filtersikkerhet
Kafka consumerintegrasjon
Kafka producerservice or integrasjon
Statistics listenerstatistikk
Flyway migrationapp
Cross-cutting configconfig
Custom exceptionfeil

Data Flow Examples

REST Request Flow

frontend-api → service → repository → domain
                     ↘→ integrasjon (external calls)

Saga Flow

frontend-api → service → saksflyt-api (event)
                              ↓
                         saksflyt (saga execution)
                              ↓
                         service (steps)

Kafka Event Flow

integrasjon (consumer) → service → domain/repository
service → integrasjon (producer)

Test Module

ModuleType
integrasjonstestIntegration tests with Spring context
arkitekturArchUnit architecture tests

Run integration tests with: mvn verify -pl integrasjonstest

Enforcement

The module-level boundaries above are enforced primarily by Maven: a module can only reference code in modules it declares as <dependencies>. The ArchUnit test arkitektur/src/test/kotlin/no/nav/melosys/ArkitekturTestIT.kt adds a coarser layering check on packages (Controller ..tjenester.gui.. → Service ..service.. → Integrations ..integrasjon.. / Persistence ..repository..), so it is weaker than — not a substitute for — the module dependency rules.

レビュー

まだレビューはありません。使ってみた感想をお寄せください。

コメント

ログインなしで書き込めます。使ってみた感想、質問、動かなかった環境などを気軽にどうぞ。

まだコメントはありません。最初のコメントを書いてみませんか。

送信するとすぐに公開されます。メールアドレスや電話番号などの個人情報は書かないでください。URL は 2 つまでです。

0 / 1000 文字

このフォームは reCAPTCHA で保護されており、Google のプライバシーポリシーと利用規約が適用されます。

同じリポジトリのスキル

Expert knowledge of Altinn A1 application processing for posted workers in melosys-api. Use when: (1) Understanding Altinn søknad/skjema processing, (2) Debugging MedlemskapArbeidEOS form mapping, (3) Understanding SoeknadMapper transformations, (4) Investigating posted worker application issues, (5) Understanding the MOTTAK_SOKNAD_ALTINN saga flow.

日本語の概要は準備中です。原文の説明を表示しています。

navikt/melosys-api22026年10月21日 更新

Expert knowledge of Employer/Employment integration (EREG/AAREG) in melosys-api. Use when: (1) Working with organization data from EREG (Enhetsregisteret), (2) Working with employment data from AAREG (Arbeidsforhold), (3) Understanding employer/organization lookup, (4) Debugging employer or employment issues, (5) Understanding the mapping between register data and domain models. Triggers: orgnummer, arbeidsforhold, EREG, AAREG, Enhetsregisteret, registeropplysninger, ansettelsesperiode, saksopplysning.

日本語の概要は準備中です。原文の説明を表示しています。

navikt/melosys-api22026年10月21日 更新

Expert knowledge of Behandling (case treatment) domain in melosys-api. Use when: (1) Understanding the behandling lifecycle and status transitions, (2) Debugging issues with behandling creation, status changes, or closure, (3) Understanding relationships between Fagsak, Behandling, and Behandlingsresultat, (4) Investigating why a behandling is stuck or has wrong status, (5) Understanding Behandlingstyper, Behandlingstema, Behandlingsstatus enums, (6) Debugging journalføring or SED-triggered behandling creation, (7) Understanding behandling creation via saksflyt sagas.

日本語の概要は準備中です。原文の説明を表示しています。

navikt/melosys-api22026年10月21日 更新

Expert knowledge of Behandlingsresultat (treatment result) domain in melosys-api. Use when: (1) Understanding result types and their meaning (FASTSATT_LOVVALGSLAND, MEDLEM_I_FOLKETRYGDEN, etc.), (2) Working with periods - Lovvalgsperiode, Medlemskapsperiode, Anmodningsperiode, Utpekingsperiode, (3) Debugging vedtak/decision metadata, criteria evaluation, or social insurance charges, (4) Understanding EU/EEA coordination logic and Article 16 exception handling, (5) Working with trygdeavgift (social insurance charge) calculations.

日本語の概要は準備中です。原文の説明を表示しています。

navikt/melosys-api22026年10月21日 更新

brev

無料

Expert knowledge of Brev (letter generation) in melosys-api. Use when: (1) Producing letters and decision documents (vedtaksbrev), (2) Understanding Dokgen templates and mapping, (3) Configuring letter recipients and distribution, (4) Debugging letter generation issues, (5) Adding new letter types or templates.

日本語の概要は準備中です。原文の説明を表示しています。

navikt/melosys-api22026年10月21日 更新

database

無料

Expert knowledge of the melosys-api Oracle database schema. Use when: (1) Writing SQL queries against the melosys database, (2) Understanding table relationships and foreign keys, (3) Debugging data issues by querying the database, (4) Understanding what data is stored where, (5) Creating or modifying Flyway migrations, (6) Mapping domain entities to database tables. Triggers: SQL against melosys DB, table/column lookup, FK relationships, "where is X stored", "what column stores X", "why is data missing", beh_resultat_id, behandlingsresultat_id, saksnummer, schema.

日本語の概要は準備中です。原文の説明を表示しています。

navikt/melosys-api22026年10月21日 更新

navikt のスキルをすべて見る

このスキルの問題を報告する