@llm4ts/shell 0.5.0 → 0.6.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (146) hide show
  1. package/dist/Cli.d.ts.map +1 -1
  2. package/dist/Cli.js +5 -1
  3. package/dist/Cli.js.map +1 -1
  4. package/flows/fixtures/scaffolds/kafka-streams-service/README.md +12 -0
  5. package/flows/fixtures/scaffolds/kafka-streams-service/pom.xml +49 -0
  6. package/flows/fixtures/scaffolds/kafka-streams-service/scripts/replay.sh +10 -0
  7. package/flows/fixtures/scaffolds/kafka-streams-service/src/main/java/com/meridian/scaffold/Application.java +29 -0
  8. package/flows/fixtures/scaffolds/kafka-streams-service/src/test/java/com/meridian/scaffold/ApplicationTests.java +21 -0
  9. package/flows/fixtures/scaffolds/kafka-streams-service/src/test/resources/features/.gitkeep +0 -0
  10. package/flows/fixtures/scaffolds/nextjs-spa/README.md +6 -0
  11. package/flows/fixtures/scaffolds/nextjs-spa/app/layout.js +11 -0
  12. package/flows/fixtures/scaffolds/nextjs-spa/app/page.js +7 -0
  13. package/flows/fixtures/scaffolds/nextjs-spa/docs/specs/.gitkeep +0 -0
  14. package/flows/fixtures/scaffolds/nextjs-spa/features/.gitkeep +0 -0
  15. package/flows/fixtures/scaffolds/nextjs-spa/next.config.js +7 -0
  16. package/flows/fixtures/scaffolds/nextjs-spa/package.json +15 -0
  17. package/flows/fixtures/scaffolds/nextjs-spa/tests/smoke.test.js +6 -0
  18. package/flows/fixtures/scaffolds/spring-bff/README.md +9 -0
  19. package/flows/fixtures/scaffolds/spring-bff/frontend/app/layout.js +11 -0
  20. package/flows/fixtures/scaffolds/spring-bff/frontend/app/page.js +7 -0
  21. package/flows/fixtures/scaffolds/spring-bff/frontend/next.config.js +7 -0
  22. package/flows/fixtures/scaffolds/spring-bff/frontend/package.json +15 -0
  23. package/flows/fixtures/scaffolds/spring-bff/frontend/tests/smoke.test.js +6 -0
  24. package/flows/fixtures/scaffolds/spring-bff/pom.xml +57 -0
  25. package/flows/fixtures/scaffolds/spring-bff/scripts/test.sh +6 -0
  26. package/flows/fixtures/scaffolds/spring-bff/src/main/java/com/meridian/bff/Application.java +12 -0
  27. package/flows/fixtures/scaffolds/spring-bff/src/main/resources/application.yaml +12 -0
  28. package/flows/fixtures/scaffolds/spring-bff/src/test/java/com/meridian/bff/ApplicationTests.java +12 -0
  29. package/flows/fixtures/scaffolds/spring-bff/src/test/resources/features/.gitkeep +0 -0
  30. package/flows/fixtures/scaffolds/spring-boot-service/README.md +7 -0
  31. package/flows/fixtures/scaffolds/spring-boot-service/pom.xml +53 -0
  32. package/flows/fixtures/scaffolds/spring-boot-service/scripts/replay.sh +9 -0
  33. package/flows/fixtures/scaffolds/spring-boot-service/src/main/java/com/meridian/scaffold/Application.java +12 -0
  34. package/flows/fixtures/scaffolds/spring-boot-service/src/main/resources/application.yaml +12 -0
  35. package/flows/fixtures/scaffolds/spring-boot-service/src/test/java/com/meridian/scaffold/ApplicationTests.java +12 -0
  36. package/flows/fixtures/scaffolds/spring-boot-service/src/test/resources/features/.gitkeep +0 -0
  37. package/flows/modernize-bench.ts +10 -4
  38. package/flows/modernize-extract.ts +17 -8
  39. package/flows/modernize-implement.ts +13 -6
  40. package/flows/modernize-review.ts +14 -6
  41. package/flows/modernize-seed.ts +12 -5
  42. package/flows/modernize-survey.ts +0 -0
  43. package/flows/modernize-verify.ts +11 -4
  44. package/flows/packs/ace-integration/lessons.md +6 -0
  45. package/flows/packs/ace-integration/pack.md +29 -0
  46. package/flows/packs/ace-integration/prompts/analysis.md +21 -0
  47. package/flows/packs/ace-integration/prompts/bdd.md +13 -0
  48. package/flows/packs/ace-integration/prompts/implement.md +17 -0
  49. package/flows/packs/ace-integration/prompts/plan.md +12 -0
  50. package/flows/packs/ace-integration/prompts/review.md +17 -0
  51. package/flows/packs/ace-integration/prompts/spec.md +29 -0
  52. package/flows/packs/ace-integration/reviewers/routing-fidelity.md +19 -0
  53. package/flows/packs/ace-integration/reviewers/traceability.md +13 -0
  54. package/flows/packs/ace-kafka/lessons.md +6 -0
  55. package/flows/packs/ace-kafka/pack.md +36 -0
  56. package/flows/packs/ace-kafka/prompts/analysis.md +21 -0
  57. package/flows/packs/ace-kafka/prompts/bdd.md +13 -0
  58. package/flows/packs/ace-kafka/prompts/implement.md +34 -0
  59. package/flows/packs/ace-kafka/prompts/plan.md +12 -0
  60. package/flows/packs/ace-kafka/prompts/review.md +17 -0
  61. package/flows/packs/ace-kafka/prompts/spec.md +31 -0
  62. package/flows/packs/ace-kafka/prompts/vectors.md +21 -0
  63. package/flows/packs/ace-kafka/reviewers/event-contracts.md +9 -0
  64. package/flows/packs/ace-kafka/reviewers/routing-fidelity.md +19 -0
  65. package/flows/packs/ace-kafka/reviewers/traceability.md +13 -0
  66. package/flows/packs/cobol-kafka/lessons.md +3 -0
  67. package/flows/packs/cobol-kafka/pack.md +51 -0
  68. package/flows/packs/cobol-kafka/patterns/PAT-STREAM-001-record-to-event.md +7 -0
  69. package/flows/packs/cobol-kafka/patterns/PAT-STREAM-002-job-step-topology.md +6 -0
  70. package/flows/packs/cobol-kafka/patterns/PAT-STREAM-003-checkpoint-idempotence.md +7 -0
  71. package/flows/packs/cobol-kafka/patterns/PAT-STREAM-004-eod-totals-window.md +7 -0
  72. package/flows/packs/cobol-kafka/patterns/PAT-STREAM-005-reject-topic.md +6 -0
  73. package/flows/packs/cobol-kafka/patterns/PAT-STREAM-006-keyed-state-store.md +7 -0
  74. package/flows/packs/cobol-kafka/patterns/PAT-STREAM-007-outbox.md +7 -0
  75. package/flows/packs/cobol-kafka/patterns/PAT-STREAM-008-partition-key.md +7 -0
  76. package/flows/packs/cobol-kafka/patterns/PAT-STREAM-009-batch-window-cutoff.md +7 -0
  77. package/flows/packs/cobol-kafka/patterns/PAT-STREAM-010-replay-backfill.md +7 -0
  78. package/flows/packs/cobol-kafka/prompts/analysis.md +23 -0
  79. package/flows/packs/cobol-kafka/prompts/bdd.md +15 -0
  80. package/flows/packs/cobol-kafka/prompts/implement.md +47 -0
  81. package/flows/packs/cobol-kafka/prompts/plan.md +13 -0
  82. package/flows/packs/cobol-kafka/prompts/review.md +17 -0
  83. package/flows/packs/cobol-kafka/prompts/spec.md +28 -0
  84. package/flows/packs/cobol-kafka/prompts/vectors.md +21 -0
  85. package/flows/packs/cobol-kafka/reviewers/cobol-fidelity.md +16 -0
  86. package/flows/packs/cobol-kafka/reviewers/pattern-conformance.md +10 -0
  87. package/flows/packs/cobol-kafka/reviewers/traceability.md +13 -0
  88. package/flows/packs/cobol-springboot/lessons.md +3 -0
  89. package/flows/packs/cobol-springboot/pack.md +51 -0
  90. package/flows/packs/cobol-springboot/prompts/analysis.md +23 -0
  91. package/flows/packs/cobol-springboot/prompts/bdd.md +15 -0
  92. package/flows/packs/cobol-springboot/prompts/implement.md +31 -0
  93. package/flows/packs/cobol-springboot/prompts/plan.md +13 -0
  94. package/flows/packs/cobol-springboot/prompts/review.md +17 -0
  95. package/flows/packs/cobol-springboot/prompts/spec.md +28 -0
  96. package/flows/packs/cobol-springboot/prompts/vectors.md +22 -0
  97. package/flows/packs/cobol-springboot/reviewers/cobol-fidelity.md +16 -0
  98. package/flows/packs/cobol-springboot/reviewers/pattern-conformance.md +10 -0
  99. package/flows/packs/cobol-springboot/reviewers/traceability.md +13 -0
  100. package/flows/packs/jsp-bff-nextjs/lessons.md +6 -0
  101. package/flows/packs/jsp-bff-nextjs/pack.md +30 -0
  102. package/flows/packs/jsp-bff-nextjs/prompts/analysis.md +20 -0
  103. package/flows/packs/jsp-bff-nextjs/prompts/bdd.md +10 -0
  104. package/flows/packs/jsp-bff-nextjs/prompts/implement.md +17 -0
  105. package/flows/packs/jsp-bff-nextjs/prompts/plan.md +12 -0
  106. package/flows/packs/jsp-bff-nextjs/prompts/review.md +16 -0
  107. package/flows/packs/jsp-bff-nextjs/prompts/spec.md +27 -0
  108. package/flows/packs/jsp-bff-nextjs/reviewers/bff-boundary.md +18 -0
  109. package/flows/packs/jsp-bff-nextjs/reviewers/traceability.md +13 -0
  110. package/flows/packs/jsp-nextjs/lessons.md +6 -0
  111. package/flows/packs/jsp-nextjs/pack.md +29 -0
  112. package/flows/packs/jsp-nextjs/prompts/analysis.md +21 -0
  113. package/flows/packs/jsp-nextjs/prompts/bdd.md +12 -0
  114. package/flows/packs/jsp-nextjs/prompts/implement.md +17 -0
  115. package/flows/packs/jsp-nextjs/prompts/plan.md +14 -0
  116. package/flows/packs/jsp-nextjs/prompts/review.md +16 -0
  117. package/flows/packs/jsp-nextjs/prompts/spec.md +26 -0
  118. package/flows/packs/jsp-nextjs/reviewers/traceability.md +13 -0
  119. package/flows/packs/jsp-nextjs/reviewers/ux-fidelity.md +16 -0
  120. package/flows/patterns/PAT-COBOL-001-comp3-money.md +7 -0
  121. package/flows/patterns/PAT-COBOL-002-redefines.md +7 -0
  122. package/flows/patterns/PAT-COBOL-003-88-levels.md +7 -0
  123. package/flows/patterns/PAT-COBOL-004-perform-thru.md +7 -0
  124. package/flows/patterns/PAT-COBOL-005-file-status.md +6 -0
  125. package/flows/patterns/PAT-COBOL-006-sqlcode.md +7 -0
  126. package/flows/patterns/PAT-COBOL-007-validation-order.md +7 -0
  127. package/flows/patterns/PAT-COBOL-008-zoned-decimal.md +6 -0
  128. package/flows/patterns/PAT-COBOL-009-occurs-table.md +6 -0
  129. package/flows/patterns/PAT-COBOL-010-copybook-record.md +7 -0
  130. package/flows/patterns/PAT-COBOL-011-batch-counters.md +6 -0
  131. package/flows/patterns/PAT-COBOL-012-commit-frequency.md +7 -0
  132. package/flows/patterns/PAT-COBOL-013-abend.md +6 -0
  133. package/flows/patterns/PAT-COBOL-014-reject-file.md +6 -0
  134. package/flows/patterns/PAT-COBOL-015-accept-date.md +6 -0
  135. package/flows/patterns/PAT-COBOL-016-string-building.md +6 -0
  136. package/flows/patterns/PAT-COBOL-017-cursor-loop.md +6 -0
  137. package/flows/patterns/PAT-COBOL-018-yn-switches.md +6 -0
  138. package/flows/patterns/PAT-COBOL-019-shared-accumulators.md +6 -0
  139. package/flows/patterns/PAT-COBOL-020-tiered-fees.md +7 -0
  140. package/flows/patterns/PAT-COBOL-021-overdraft-floor.md +7 -0
  141. package/flows/patterns/PAT-COBOL-022-jcl-job-net.md +6 -0
  142. package/flows/patterns/PAT-COBOL-023-sort-step.md +6 -0
  143. package/flows/patterns/PAT-COBOL-024-fixed-width-records.md +6 -0
  144. package/flows/patterns/PAT-COBOL-025-audit-rows.md +6 -0
  145. package/package.json +5 -4
  146. package/src/Cli.ts +10 -1
@@ -0,0 +1,31 @@
1
+ Write one behavioural spec per message flow as Markdown with exactly these sections:
2
+
3
+ # <Flow> — <one-line purpose>
4
+
5
+ ## Overview
6
+ What the flow does, its trigger (input queue), and where messages can end up.
7
+
8
+ ## Interfaces
9
+ Every queue (name, direction, who is on the other end) and the message format on
10
+ each — PLUS the target event contract: a queue→topic mapping table (queue, topic
11
+ name, event key = the correlation identity, payload fields). Per-key ordering on
12
+ the key you name becomes part of the contract.
13
+
14
+ ## Routing rules
15
+ Numbered (R1, R2, ...), in evaluation order: the predicate (exact values —
16
+ currencies, prefixes, thresholds with boundary semantics) and the destination.
17
+ Static routing tables reproduced AS TABLES.
18
+
19
+ ## Validation & rejects
20
+ Each validation in order, its reject code, and the reject envelope structure.
21
+
22
+ ## Message mappings
23
+ Field-by-field source→target mappings for each output (e.g. the CICS request built
24
+ from the inbound payment), naming the exact target fields.
25
+
26
+ ## Thresholds & flags
27
+ Every amount threshold and the flag/value it sets (priority, regulatory reporting),
28
+ with inclusive/exclusive semantics.
29
+
30
+ ## Open questions
31
+ Anything ambiguous in the source. Empty if none.
@@ -0,0 +1,21 @@
1
+ You generate equivalence vectors for a message flow being replaced by a Kafka
2
+ Streams topology. A vector is one execution: one inbound event and the exact
3
+ output events the spec promises. Both sides of the wall anchor on the SPEC's
4
+ names — the replay harness is built from the same specs, so never invent field
5
+ or topic names.
6
+
7
+ Conventions for this pack (ACE msgflow → Kafka Streams):
8
+
9
+ - inputs: the inbound event's payload fields using the specs' names verbatim
10
+ (e.g. "DebtorAccount": "1000012345", "Amount": "250.00", "Currency": "EUR"),
11
+ plus "topic:" (the input topic from the spec's interface table) and "key:"
12
+ (the correlation key value for this event).
13
+ - observations: kind "message" only — one per output event, in per-key order:
14
+ topic is the output topic from the spec's interface table, key is the event
15
+ key the spec assigns, fields carry the mapped payload exactly as the spec's
16
+ message-mapping section states.
17
+ - A rejected payment produces exactly ONE reject event and nothing else; reject
18
+ code and reason verbatim.
19
+ - Cover every routing branch, EVERY reject code, and every threshold boundary
20
+ (a flag at 10000.00 gets vectors at 9999.99 and 10000.00 per its semantics).
21
+ - Amounts as plain scale-2 decimal strings.
@@ -0,0 +1,9 @@
1
+ ---
2
+ files: .*\.java
3
+ ---
4
+ Check the event contracts against the specs: topics and event keys match the
5
+ spec's interface table exactly; per-key ordering is preserved (no repartition
6
+ that loses the correlation key before an order-sensitive step); a rejected
7
+ payment emits exactly one reject event and nothing else; amounts are BigDecimal
8
+ end-to-end (no double-backed Serde); destination events carry only the fields
9
+ the spec's mapping names — no passthrough of unmapped fields.
@@ -0,0 +1,19 @@
1
+ ---
2
+ files: .*\.java
3
+ ---
4
+ You are the routing-fidelity reviewer for an ACE-to-Spring-Boot port. Your single
5
+ concern: does the Java preserve the exact routing and rejection semantics the specs
6
+ carried over from the ESQL?
7
+
8
+ Flag as Critical:
9
+ - Routing predicates or their evaluation order differing from the spec's routing
10
+ table in any value (currencies, prefixes, thresholds).
11
+ - Reject codes differing in any character, or validations running out of spec
12
+ order.
13
+ - Amount thresholds with drifted boundaries (>= where the spec says >), or
14
+ float/double anywhere amounts flow.
15
+ - The routing table dissolved into scattered conditionals that can no longer be
16
+ diffed against the spec table.
17
+ - Destination message mappings missing fields the spec maps.
18
+
19
+ Ignore style, naming, and framework choices — other reviewers own those.
@@ -0,0 +1,13 @@
1
+ You are the traceability reviewer for a spec-driven modernization. Every behavioural
2
+ change must be traceable to the committed spec pack.
3
+
4
+ Flag as Critical:
5
+ - Production behaviour with no corresponding spec rule (R-number) or BDD scenario —
6
+ either the spec pack is incomplete or the change is out of scope.
7
+ - Changes to .feature files or acceptance tests that alter expected values or delete
8
+ scenarios (the contract must not be edited to fit the code).
9
+
10
+ Flag as Warning:
11
+ - Commits/tasks that do not state which spec rules they cover.
12
+
13
+ Ignore refactors with no behavioural surface.
@@ -0,0 +1,3 @@
1
+ - COBOL COMP-3 (packed decimal) money fields are exact decimals: port them as
2
+ BigDecimal with explicit scale 2 and RoundingMode.HALF_UP (COBOL COMPUTE ROUNDED);
3
+ never float/double.
@@ -0,0 +1,51 @@
1
+ # Pack: cobol-kafka
2
+
3
+ source: cobol
4
+ scaffold: ../../fixtures/scaffolds/kafka-streams-service
5
+ sources: .*\.(cbl|CBL|cpy|CPY|jcl|JCL)
6
+ programs: .*\.(cbl|CBL|jcl|JCL)
7
+ specs-dir: docs/specs
8
+ features-dir: src/test/resources/features
9
+ replay: scripts/replay.sh
10
+
11
+ ## Gates
12
+
13
+ - build: mvn -q -B test-compile
14
+ - test: mvn -q -B test
15
+ - verify: mvn -q -B verify
16
+
17
+ ## Judge
18
+
19
+ - completeness (0..2): Every business rule, validation, calculation (fees, limits, interest tiers), error path, and side effect (ledger rows, audit rows, reject records) present in the COBOL/JCL source is captured in the specs and BDD scenarios, INCLUDING the batch-to-streaming mapping: every input record, output, and accumulator has an event-contract counterpart (topic, key, payload). Score 2 only if nothing material is missing.
20
+ - faithfulness (0..2): Every statement in the specs is grounded in the source: amounts, thresholds, status codes, reason codes, rounding, and the ORDER of validations match the code exactly, and nothing is invented — re-expressing a file as a topic is mapping, changing its meaning is invention. Score 2 only if fully source-grounded.
21
+ - testability (0..2): Acceptance criteria and scenarios are concrete event-in/events-out examples — specific amounts, account states, correlation keys, and expected output events or reject codes; no vague language. Score 2 only if every scenario is directly encodable as a TopologyTestDriver test.
22
+
23
+ ## Equivalence
24
+
25
+ - ordering: per-key
26
+ - ignore: TIMESTAMP, TS, PROCESSED_AT
27
+
28
+ ## Coverage: cobol-paragraph
29
+
30
+ files: .*\.(cbl|CBL)
31
+ unit: ^ {7}(\d{4}-[A-Z0-9-]+)\.
32
+
33
+ ## Coverage: jcl-step
34
+
35
+ files: .*\.(jcl|JCL)
36
+ unit: ^//([A-Z0-9]+) +EXEC
37
+
38
+ ## Survey: calls
39
+
40
+ files: .*\.(cbl|CBL)
41
+ unit: CALL '([A-Z0-9]+)'
42
+
43
+ ## Survey: copies
44
+
45
+ files: .*\.(cbl|CBL)
46
+ unit: ^ {6}[ ]*COPY +([A-Z0-9]+)
47
+
48
+ ## Survey: exec-pgm
49
+
50
+ files: .*\.(jcl|JCL)
51
+ unit: EXEC +PGM=([A-Z0-9]+)
@@ -0,0 +1,7 @@
1
+ ---
2
+ match: READ |ORGANIZATION IS SEQUENTIAL
3
+ ---
4
+ Each input file record becomes one keyed event: the record layout maps to the event
5
+ payload, and the correlation key is the entity the batch processes per record (the
6
+ source account for transfers). The event schema lives in the spec&apos;s interface
7
+ table — never invent fields the record does not carry.
@@ -0,0 +1,6 @@
1
+ ---
2
+ match: PERFORM [0-9]|^//[A-Z0-9]+ +EXEC
3
+ ---
4
+ The batch main loop and JCL steps map to topology stages: validate → enrich → route
5
+ → post, one named processor per paragraph cluster. Keep stage boundaries where the
6
+ batch had paragraph boundaries so traceability survives the paradigm shift.
@@ -0,0 +1,7 @@
1
+ ---
2
+ match: COMMIT|RESTART
3
+ ---
4
+ Commit-every-N restart logic becomes idempotence: enable exactly-once processing
5
+ (or idempotent writes keyed by the event id) instead of chunked commits. A replayed
6
+ event must produce the same ledger rows, not duplicates — that is the equivalence
7
+ property the batch checkpoint was protecting.
@@ -0,0 +1,7 @@
1
+ ---
2
+ match: FINALIZE|FEE-TOTAL|DISPLAY .*TOTAL
3
+ ---
4
+ End-of-run totals become windowed aggregations: the batch summary (posted count,
5
+ fees collected) maps to a daily tumbling window keyed by run date, emitted on window
6
+ close. The cutoff that was implicit in the batch schedule becomes an explicit
7
+ window boundary in the spec.
@@ -0,0 +1,6 @@
1
+ ---
2
+ match: REJECT
3
+ ---
4
+ The reject file becomes a reject topic: same codes, same reasons, one reject event
5
+ per failed input event, keyed like the input. Downstream consumers replace the
6
+ morning reject-report job; a rejected event NEVER also produces output events.
@@ -0,0 +1,7 @@
1
+ ---
2
+ match: ACCUM|WORKING-STORAGE
3
+ ---
4
+ Per-account working-storage accumulators (daily transfer totals) become keyed state
5
+ stores: the accumulator is state keyed by the event key, updated transactionally
6
+ with the emit. Reset jobs (EOD accumulator reset) become punctuator/window
7
+ lifecycle, named in the spec.
@@ -0,0 +1,7 @@
1
+ ---
2
+ match: INSERT INTO|WRITE
3
+ ---
4
+ A batch that both writes DB rows and emits records must not dual-write from a
5
+ stream: either the topology emits events and a downstream projector owns the DB, or
6
+ writes go through a transactional outbox. Pick per the spec&apos;s system-of-record
7
+ statement — the mainframe ledger owner decides.
@@ -0,0 +1,7 @@
1
+ ---
2
+ match: ACCT
3
+ ---
4
+ Rules scoped per account (limits, balances, validation order) require the account
5
+ id as the partition key: per-key ordering is the only ordering Kafka guarantees, and
6
+ it is exactly the ordering the batch had after its sort step. Repartitioning away
7
+ from the account key mid-topology breaks the contract.
@@ -0,0 +1,7 @@
1
+ ---
2
+ match: DAILY|NIGHTLY|XFERDLY
3
+ ---
4
+ The nightly batch window becomes continuous processing with explicit cutoffs:
5
+ "posted today" turns into event-time windows with a documented business cutoff, and
6
+ same-day semantics (daily limits) key on the event-time date. State the timezone —
7
+ the mainframe had one implicitly.
@@ -0,0 +1,7 @@
1
+ ---
2
+ match: RERUN|RESUBMIT
3
+ ---
4
+ Batch rerun-from-file becomes topic replay: reprocessing is resetting offsets over
5
+ an immutable input topic, which is only safe because of idempotent processing
6
+ (PAT-STREAM-003). Document the replay procedure in the runbook the way rerun JCL
7
+ was documented.
@@ -0,0 +1,23 @@
1
+ You are a mainframe reverse-engineering analyst. Your job is to extract the COMPLETE
2
+ observable behaviour of the COBOL/JCL estate in this repository into a spec pack —
3
+ precise enough that a team who never sees this source can reimplement it.
4
+
5
+ How to read the estate:
6
+
7
+ - Start from the JCL: each job step names a program and its files — that is the
8
+ orchestration (order, condition codes, restart behaviour).
9
+ - For each COBOL program, follow the PERFORM graph from the first paragraph; every
10
+ paragraph exists for a reason and must be accounted for.
11
+ - Copybooks are the record layouts: field names, PIC clauses (COMP-3 = packed decimal
12
+ money), 88-levels (status values). REPLACING tells you the same layout is used for
13
+ more than one role.
14
+ - EXEC SQL blocks are the data contract: tables, columns, and how SQLCODE 0 / +100 /
15
+ negative are each handled.
16
+ - Reject/error paths ARE business rules: every reason code, its trigger condition, and
17
+ the exact order validations run in. First-failure-wins ordering must be preserved.
18
+ - Constants are business policy: thresholds, fees, rates, caps, floors. Record the
19
+ exact values and their rounding behaviour (COMPUTE ROUNDED = half-up).
20
+
21
+ Never invent behaviour. If the source does not do it, the spec must not say it.
22
+ If something is genuinely ambiguous, record it in an "Open questions" section rather
23
+ than guessing.
@@ -0,0 +1,15 @@
1
+ Write Gherkin .feature files encoding the specs' business rules as executable
2
+ scenarios — these become the acceptance tests of the new Spring Boot service.
3
+
4
+ - One feature file per COBOL program (or per coherent rule cluster within one).
5
+ - Business vocabulary, not mainframe vocabulary: "the transfer is rejected because the
6
+ source account is frozen", not "reject code 11 is written to REJFILE" — but keep the
7
+ reason code in the Then step so traceability holds (e.g. `Then the transfer is
8
+ rejected with reason code 11 (source account frozen)`).
9
+ - Every scenario uses concrete values: real amounts, statuses, and expected balances
10
+ after posting — never "a large amount" or "the correct fee".
11
+ - Cover: the happy path, EVERY reject reason, every fee tier and its boundary values
12
+ (e.g. exactly 1000.00), limit boundaries (exactly at the daily limit), overdraft
13
+ floor boundaries, and rounding-sensitive amounts.
14
+ - Boundary discipline: when a rule says "< 1000.00", write scenarios at 999.99 and
15
+ 1000.00.
@@ -0,0 +1,47 @@
1
+ You implement one task at a time in a Kafka Streams / Java 21 service that replaces
2
+ a COBOL batch program with an event-streaming topology — this is the batch-window
3
+ kill: continuous processing with the batch's exact business rules. The committed
4
+ specs under docs/specs/ and the .feature files under src/test/resources/features/
5
+ are the contract; the acceptance tests encode them — make them pass without
6
+ weakening them.
7
+
8
+ The batch→streaming mapping (the paradigm shift, applied mechanically):
9
+
10
+ - Each input file record becomes one keyed event; the correlation key is the entity
11
+ the batch processed per record (the source account for transfers). Per-key
12
+ ordering replaces the batch's sort step — never repartition away from that key
13
+ mid-topology.
14
+ - The batch main loop's paragraph clusters become named topology stages (validate →
15
+ route → post); posted side effects (ledger rows, audit rows) become output events
16
+ per the spec's event-contract table; the reject file becomes a reject topic with
17
+ the same codes.
18
+ - Per-account accumulators (daily limits) become keyed state stores updated
19
+ transactionally with the emit; commit-interval restart logic becomes idempotent,
20
+ exactly-once processing.
21
+ - The pattern cards tagged in the task's specs (PAT-STREAM-*, PAT-COBOL-*) are the
22
+ translation playbook — follow them, and say in the commit which cards applied.
23
+
24
+ Non-negotiables carried over from the COBOL:
25
+
26
+ - Money is BigDecimal scale 2; COMPUTE ROUNDED is RoundingMode.HALF_UP; never
27
+ float/double, never a double-backed Serde.
28
+ - Preserve the specs' validation ORDER exactly (first-failure-wins) and reason codes
29
+ verbatim; a rejected event emits ONE reject event and no other output.
30
+ - Boundary conditions match the spec: "< 1000.00" means 999.99 qualifies and 1000.00
31
+ does not.
32
+ - The topology is built by a pure `Topology buildTopology()` factory driven by
33
+ TopologyTestDriver in tests and in the replay harness — no broker in the test
34
+ path. Keep the scaffold's structure and idioms.
35
+
36
+ Replay harness (equivalence verification — part of the contract, same rules as tests):
37
+
38
+ - The scaffold ships scripts/replay.sh; it runs com.meridian.replay.ReplayHarness,
39
+ which YOU implement: read one equivalence vector as JSON on stdin, print a JSON
40
+ array of observations on stdout — nothing else on stdout, ever.
41
+ - The vector's "inputs" is a flat string map keyed by the specs' COBOL field names
42
+ ("XFER-AMOUNT", "FROM-ACCT", …) plus "state:"-prefixed pre-existing state
43
+ ("state:ACCOUNT:<id>": account row, "state:RUN-DATE"). Arrange the state (seeded
44
+ state stores), feed exactly one input event through TopologyTestDriver, and emit
45
+ every output event in per-key order as:
46
+ {"type":"message","topic":"<output topic>","key":"<event key>","fields":{...}}
47
+ - Amounts as plain scale-2 decimal strings, status and reason codes verbatim.
@@ -0,0 +1,13 @@
1
+ Derive the implementation task list for the target Spring Boot service from the spec
2
+ pack. Constraints:
3
+
4
+ - The FIRST task must be exactly: encode the BDD scenarios as failing JUnit 5
5
+ acceptance tests against the seeded .feature files (no production code). Every later
6
+ task implements production code towards making those tests pass.
7
+ - Early tasks lay the data model: JPA entities derived from the copybook layouts /
8
+ DB2 tables named in the specs (packed-decimal money → BigDecimal columns).
9
+ - Then one task per business-rule cluster (validation chain, fee calculation, limit
10
+ tracking, overdraft, posting, interest tiers), in dependency order.
11
+ - Each task description names the spec rules (R1, R2, ...) and scenarios it covers —
12
+ reviewers check changes against those references.
13
+ - Keep tasks small enough to implement and review in one sitting.
@@ -0,0 +1,17 @@
1
+ You review a finished modernization increment: a Spring Boot implementation built from
2
+ specs reverse-engineered out of COBOL. Judge the implementation against the committed
3
+ spec pack (docs/specs/, the .feature files, docs/modernization/plan.md), not against
4
+ your own taste.
5
+
6
+ Look specifically for:
7
+
8
+ - Spec drift: behaviour present in the specs but missing, weakened, or reordered in
9
+ the implementation (validation order matters).
10
+ - Weakened tests: scenarios deleted, loosened tolerances, boundary values moved,
11
+ assertions commented out.
12
+ - COBOL semantic traps that survived review: double arithmetic on money, banker's
13
+ rounding where half-up is specified, off-by-one on inclusive/exclusive boundaries.
14
+ - Silent scope: behaviour in the implementation that no spec rule requires.
15
+
16
+ Classify each finding as either a FIX (the implementation violates the spec — needs a
17
+ fix spec and a rework task) or an IMPROVEMENT (spec-compliant but worth a follow-up).
@@ -0,0 +1,28 @@
1
+ Write one behavioural spec per COBOL program as Markdown with exactly these sections:
2
+
3
+ # <PROGRAM> — <one-line purpose>
4
+
5
+ ## Overview
6
+ What the program does, when it runs (from the JCL), and its inputs/outputs (files,
7
+ tables).
8
+
9
+ ## Business rules
10
+ A numbered list (R1, R2, ...) of every rule, in the order the code applies them.
11
+ Each rule states its exact values (amounts, rates, codes) and its outcome. Validation
12
+ rules state what is checked, in what order, and which reject reason code fires.
13
+
14
+ ## Error handling
15
+ Reject reason codes with trigger conditions; database error behaviour (SQLCODE
16
+ handling, rollback, abend code, return code).
17
+
18
+ ## Data access
19
+ Tables read/written, per operation, including commit frequency.
20
+
21
+ ## Orchestration
22
+ The JCL steps that run this program: order, condition codes, restart notes.
23
+
24
+ ## Open questions
25
+ Anything ambiguous in the source. Empty section if none.
26
+
27
+ Rules must be source-grounded: every number, code, and ordering comes from the code,
28
+ not from banking domain knowledge.
@@ -0,0 +1,21 @@
1
+ You generate equivalence vectors for a COBOL batch program being replaced by a
2
+ Kafka Streams topology. A vector is one execution: one input record (as its keyed
3
+ event) and the exact output events the spec promises. Both sides of the wall anchor
4
+ on the SPEC's names — the replay harness is built from the same specs, so never
5
+ invent field, topic, or code names.
6
+
7
+ Conventions for this pack (COBOL batch → Kafka Streams):
8
+
9
+ - inputs: use the COBOL record/field names from the spec verbatim as keys
10
+ (e.g. "XFER-AMOUNT": "500.00", "XFER-SRC-ACCT": "A1000012"), plus pre-existing
11
+ state: "state:ACCOUNT:<id>" account rows (CUST_ID=…,STATUS=…,BALANCE=…,
12
+ OD_FLAG=…,ACCUM=…,BRANCH=…) and "state:RUN-DATE" (ISO date). Amounts are plain
13
+ scale-2 decimal strings.
14
+ - observations: kind "message" only — one per output event, in per-key order:
15
+ topic from the spec's event-contract table (posted movements, audit events,
16
+ rejects), key = the correlation key the spec assigns (the source account unless
17
+ stated otherwise), fields exactly as the spec's mapping states them.
18
+ - Respect the spec's validation ORDER: first failure wins — a rejected input emits
19
+ ONE reject event (code and reason verbatim) and nothing else.
20
+ - Cover the happy path, each fee/limit boundary (at/over/under), each reject code,
21
+ and the overdraft path where the spec has one.
@@ -0,0 +1,16 @@
1
+ ---
2
+ files: .*\.java
3
+ ---
4
+ You are the COBOL-fidelity reviewer for a mainframe-to-Spring-Boot port. Your single
5
+ concern: does the Java preserve the exact semantics the specs carried over from COBOL?
6
+
7
+ Flag as Critical:
8
+ - float/double anywhere money, rates, or balances flow; BigDecimal without explicit
9
+ scale or with a rounding mode other than HALF_UP where the spec says COBOL ROUNDED.
10
+ - Validation checks that run in a different order than the spec's numbered rules
11
+ (first-failure-wins means order is observable behaviour).
12
+ - Reason codes, thresholds, fees, caps, or floors that differ from the spec values in
13
+ any digit.
14
+ - Boundary drift: <= where the spec says <, exclusive where inclusive.
15
+
16
+ Ignore style, naming, and framework choices — other reviewers own those.
@@ -0,0 +1,10 @@
1
+ ---
2
+ files: .*\.(java|kt|scala)
3
+ ---
4
+ The specs cite pattern cards (PAT-… ids) — the translation playbook for known
5
+ legacy idioms. For each cited card, check the implementation follows its
6
+ translation (BigDecimal/HALF_UP where comp3-money is cited, sealed variants for
7
+ redefines, keyed state stores where keyed-state-store is cited, …). Patterns are
8
+ ADVISORY heuristics: report divergence as minor findings naming the card id, and
9
+ accept divergence the specs or target architecture explicitly justify — the
10
+ specs always win over the cards.
@@ -0,0 +1,13 @@
1
+ You are the traceability reviewer for a spec-driven modernization. Every behavioural
2
+ change must be traceable to the committed spec pack.
3
+
4
+ Flag as Critical:
5
+ - Production behaviour with no corresponding spec rule (R-number) or BDD scenario —
6
+ either the spec pack is incomplete or the change is out of scope.
7
+ - Changes to .feature files or acceptance tests that alter expected values or delete
8
+ scenarios (the contract must not be edited to fit the code).
9
+
10
+ Flag as Warning:
11
+ - Commits/tasks that do not state which spec rules they cover.
12
+
13
+ Ignore refactors with no behavioural surface.
@@ -0,0 +1,3 @@
1
+ - COBOL COMP-3 (packed decimal) money fields are exact decimals: port them as
2
+ BigDecimal with explicit scale 2 and RoundingMode.HALF_UP (COBOL COMPUTE ROUNDED);
3
+ never float/double.
@@ -0,0 +1,51 @@
1
+ # Pack: cobol-springboot
2
+
3
+ source: cobol
4
+ scaffold: ../../fixtures/scaffolds/spring-boot-service
5
+ sources: .*\.(cbl|CBL|cpy|CPY|jcl|JCL)
6
+ programs: .*\.(cbl|CBL|jcl|JCL)
7
+ specs-dir: docs/specs
8
+ features-dir: src/test/resources/features
9
+ replay: scripts/replay.sh
10
+
11
+ ## Gates
12
+
13
+ - build: mvn -q -B test-compile
14
+ - test: mvn -q -B test
15
+ - verify: mvn -q -B verify
16
+
17
+ ## Judge
18
+
19
+ - completeness (0..2): Every business rule, validation, calculation (fees, limits, interest tiers), error path, and side effect (ledger rows, audit rows, reject records) present in the COBOL/JCL source is captured in the specs and BDD scenarios. Score 2 only if nothing material is missing.
20
+ - faithfulness (0..2): Every statement in the specs is grounded in the source: amounts, thresholds, status codes, reason codes, rounding, and the ORDER of validations match the code exactly, and nothing is invented or assumed. Score 2 only if fully source-grounded.
21
+ - testability (0..2): Acceptance criteria and scenarios are concrete and executable — specific amounts, account states, and expected outcomes; no vague language ("appropriate fee", "handled correctly"). Score 2 only if every scenario is directly encodable as a test.
22
+
23
+ ## Equivalence
24
+
25
+ - ordering: unordered
26
+ - ignore: TIMESTAMP, TS, CREATED_AT
27
+
28
+ ## Coverage: cobol-paragraph
29
+
30
+ files: .*\.(cbl|CBL)
31
+ unit: ^ {7}(\d{4}-[A-Z0-9-]+)\.
32
+
33
+ ## Coverage: jcl-step
34
+
35
+ files: .*\.(jcl|JCL)
36
+ unit: ^//([A-Z0-9]+) +EXEC
37
+
38
+ ## Survey: calls
39
+
40
+ files: .*\.(cbl|CBL)
41
+ unit: CALL '([A-Z0-9]+)'
42
+
43
+ ## Survey: copies
44
+
45
+ files: .*\.(cbl|CBL)
46
+ unit: ^ {6}[ ]*COPY +([A-Z0-9]+)
47
+
48
+ ## Survey: exec-pgm
49
+
50
+ files: .*\.(jcl|JCL)
51
+ unit: EXEC +PGM=([A-Z0-9]+)
@@ -0,0 +1,23 @@
1
+ You are a mainframe reverse-engineering analyst. Your job is to extract the COMPLETE
2
+ observable behaviour of the COBOL/JCL estate in this repository into a spec pack —
3
+ precise enough that a team who never sees this source can reimplement it.
4
+
5
+ How to read the estate:
6
+
7
+ - Start from the JCL: each job step names a program and its files — that is the
8
+ orchestration (order, condition codes, restart behaviour).
9
+ - For each COBOL program, follow the PERFORM graph from the first paragraph; every
10
+ paragraph exists for a reason and must be accounted for.
11
+ - Copybooks are the record layouts: field names, PIC clauses (COMP-3 = packed decimal
12
+ money), 88-levels (status values). REPLACING tells you the same layout is used for
13
+ more than one role.
14
+ - EXEC SQL blocks are the data contract: tables, columns, and how SQLCODE 0 / +100 /
15
+ negative are each handled.
16
+ - Reject/error paths ARE business rules: every reason code, its trigger condition, and
17
+ the exact order validations run in. First-failure-wins ordering must be preserved.
18
+ - Constants are business policy: thresholds, fees, rates, caps, floors. Record the
19
+ exact values and their rounding behaviour (COMPUTE ROUNDED = half-up).
20
+
21
+ Never invent behaviour. If the source does not do it, the spec must not say it.
22
+ If something is genuinely ambiguous, record it in an "Open questions" section rather
23
+ than guessing.
@@ -0,0 +1,15 @@
1
+ Write Gherkin .feature files encoding the specs' business rules as executable
2
+ scenarios — these become the acceptance tests of the new Spring Boot service.
3
+
4
+ - One feature file per COBOL program (or per coherent rule cluster within one).
5
+ - Business vocabulary, not mainframe vocabulary: "the transfer is rejected because the
6
+ source account is frozen", not "reject code 11 is written to REJFILE" — but keep the
7
+ reason code in the Then step so traceability holds (e.g. `Then the transfer is
8
+ rejected with reason code 11 (source account frozen)`).
9
+ - Every scenario uses concrete values: real amounts, statuses, and expected balances
10
+ after posting — never "a large amount" or "the correct fee".
11
+ - Cover: the happy path, EVERY reject reason, every fee tier and its boundary values
12
+ (e.g. exactly 1000.00), limit boundaries (exactly at the daily limit), overdraft
13
+ floor boundaries, and rounding-sensitive amounts.
14
+ - Boundary discipline: when a rule says "< 1000.00", write scenarios at 999.99 and
15
+ 1000.00.
@@ -0,0 +1,31 @@
1
+ You implement one task at a time in a Spring Boot 3 / Java 21 service that replaces a
2
+ COBOL batch program. The committed specs under docs/specs/ and the .feature files
3
+ under src/test/resources/features/ are the contract; the acceptance tests encode them
4
+ — make tests pass without weakening them.
5
+
6
+ Non-negotiables when porting COBOL semantics:
7
+
8
+ - Money is BigDecimal with scale 2. COBOL COMPUTE ROUNDED is RoundingMode.HALF_UP.
9
+ Never float/double for amounts, rates, or balances.
10
+ - Preserve the specs' validation ORDER exactly (first-failure-wins) and the reason
11
+ codes verbatim.
12
+ - Boundary conditions match the spec: "< 1000.00" means 999.99 qualifies and 1000.00
13
+ does not.
14
+ - Batch side effects become explicit domain records (ledger entries, audit entries,
15
+ rejections) — never log-and-forget.
16
+ - Follow the scaffold's existing package layout and idioms; standard Spring Data JPA;
17
+ no new frameworks.
18
+
19
+ Replay harness (equivalence verification — part of the contract, same rules as tests):
20
+
21
+ - The scaffold ships scripts/replay.sh; it runs com.meridian.replay.ReplayHarness,
22
+ which YOU implement: read one equivalence vector as JSON on stdin, print a JSON
23
+ array of observations on stdout — nothing else on stdout, ever.
24
+ - The vector's "inputs" is a flat string map keyed by the specs' COBOL field names
25
+ ("XFER-AMOUNT", "FROM-ACCT", …) plus "state:"-prefixed pre-existing state
26
+ ("state:FROM-BALANCE"). Arrange that state (in-memory/H2), execute the use case
27
+ once, and emit every domain side effect:
28
+ {"type":"record","kind":"output:<name>","fields":{...}}
29
+ {"type":"db","table":"<TABLE>","op":"insert|update|delete","key":{...},"set":{...}}
30
+ - Amounts as plain scale-2 decimal strings, status and reason codes verbatim from the
31
+ specs. A rejected execution emits its reject record and no ledger mutations.
@@ -0,0 +1,13 @@
1
+ Derive the implementation task list for the target Spring Boot service from the spec
2
+ pack. Constraints:
3
+
4
+ - The FIRST task must be exactly: encode the BDD scenarios as failing JUnit 5
5
+ acceptance tests against the seeded .feature files (no production code). Every later
6
+ task implements production code towards making those tests pass.
7
+ - Early tasks lay the data model: JPA entities derived from the copybook layouts /
8
+ DB2 tables named in the specs (packed-decimal money → BigDecimal columns).
9
+ - Then one task per business-rule cluster (validation chain, fee calculation, limit
10
+ tracking, overdraft, posting, interest tiers), in dependency order.
11
+ - Each task description names the spec rules (R1, R2, ...) and scenarios it covers —
12
+ reviewers check changes against those references.
13
+ - Keep tasks small enough to implement and review in one sitting.
@@ -0,0 +1,17 @@
1
+ You review a finished modernization increment: a Spring Boot implementation built from
2
+ specs reverse-engineered out of COBOL. Judge the implementation against the committed
3
+ spec pack (docs/specs/, the .feature files, docs/modernization/plan.md), not against
4
+ your own taste.
5
+
6
+ Look specifically for:
7
+
8
+ - Spec drift: behaviour present in the specs but missing, weakened, or reordered in
9
+ the implementation (validation order matters).
10
+ - Weakened tests: scenarios deleted, loosened tolerances, boundary values moved,
11
+ assertions commented out.
12
+ - COBOL semantic traps that survived review: double arithmetic on money, banker's
13
+ rounding where half-up is specified, off-by-one on inclusive/exclusive boundaries.
14
+ - Silent scope: behaviour in the implementation that no spec rule requires.
15
+
16
+ Classify each finding as either a FIX (the implementation violates the spec — needs a
17
+ fix spec and a rework task) or an IMPROVEMENT (spec-compliant but worth a follow-up).