diff --git a/.github/workflows/documentation.yml b/.github/workflows/documentation.yml new file mode 100644 index 0000000..5fd3b8b --- /dev/null +++ b/.github/workflows/documentation.yml @@ -0,0 +1,88 @@ +name: Documentation + +# Builds the docToolchain microsite from docs/ and publishes it to GitHub Pages. +# Pull requests build the site but do not publish it. +on: + push: + branches: [master] + paths: + - 'docs/**' + - 'docToolchainConfig.groovy' + - 'dtcw4' + - '.github/workflows/documentation.yml' + pull_request: + paths: + - 'docs/**' + - 'docToolchainConfig.groovy' + - 'dtcw4' + - '.github/workflows/documentation.yml' + workflow_dispatch: + +permissions: + contents: read + pages: write + id-token: write + +# Let a running deployment finish; queue the next one instead of cancelling it. +concurrency: + group: pages + cancel-in-progress: false + +jobs: + build: + name: Build microsite + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + + - name: Set up Java + uses: actions/setup-java@v4 + with: + distribution: temurin + java-version: '21' + + # The docToolchain runtime lives outside the repository. Installing it + # means a git clone plus a one-time Gradle build, so cache it: the key + # changes only when the wrapper (and with it the pinned version) changes. + - name: Cache docToolchain runtime + id: dtc-cache + uses: actions/cache@v4 + with: + path: ~/.doctoolchain + key: doctoolchain-${{ runner.os }}-${{ hashFiles('dtcw4') }} + + - name: Install docToolchain + if: steps.dtc-cache.outputs.cache-hit != 'true' + run: ./dtcw4 local install doctoolchain + + - name: Generate site + run: ./dtcw4 local generateSite + + - name: Fail if the landing page is missing + run: test -s build/docs/microsite/output/index.html + + - name: Upload site as build artifact + uses: actions/upload-artifact@v4 + with: + name: microsite + path: build/docs/microsite/output + retention-days: 7 + + - name: Upload Pages artifact + if: github.event_name != 'pull_request' + uses: actions/upload-pages-artifact@v3 + with: + path: build/docs/microsite/output + + deploy: + name: Publish to GitHub Pages + if: github.event_name != 'pull_request' + needs: build + runs-on: ubuntu-latest + environment: + name: github-pages + url: ${{ steps.deployment.outputs.page_url }} + steps: + - name: Deploy + id: deployment + uses: actions/deploy-pages@v4 diff --git a/CLAUDE.md b/CLAUDE.md index 3d1d9c9..9268517 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -278,3 +278,221 @@ Since responsible-vibe-mcp operates statelessly, provide: - **context**: Current situation and what you're trying to determine Remember: responsible-vibe-mcp guides the development process but relies on you to provide conversation context and follow its instructions precisely. + +## Specification + +When we talk about a "specification" or "spec", we mean: +- Persona Use Cases in Cockburn's Fully Dressed format (Primary Actor, Trigger, Main Success Scenario, Extensions, Postconditions) at User Goal level, with Business Rules (BR-IDs) +- System Use Cases for each technical interface (API endpoint, CLI command, event, file format): input/validation, processing, output/status codes, error responses +- Activity Diagrams for all flows (not just the happy path) +- Acceptance criteria in Gherkin format (Given/When/Then) +- Individual requirements in EARS syntax where applicable (When/While/If/Shall) +- Supplementary Specifications as needed: Entity Model, State Machines, Interface Contracts, Validation Rules + +## Requirements Discovery + +Clarify requirements using the Socratic Method: +- Ask at most 3 questions at a time, challenge assumptions +- Use MECE to ensure questions cover all areas without overlap +- Keep asking until you fully understand the requirements + +Frame the scope before writing it down: +- Impact Mapping connects deliverables to business goals and actors — so you build what moves a goal, not just what was asked. +- User Story Mapping lays stories along the user's journey and exposes a coherent first slice. + +Document the result as a PRD (problem, goals, personas, success criteria, scope). + +## Architecture Documentation + +Architecture documentation follows arc42. Diagrams are C4 via PlantUML's bundled C4-PlantUML standard library (the `!include ` stdlib form), not Mermaid. Decisions are Nygard ADRs with a 3-point Pugh matrix. Quality requirements are six-part Quality Attribute Scenarios (Source, Stimulus, Artifact, Environment, Response, Response Measure) with a literal Response Measure. + +That is the shared vocabulary. The procedure for actually producing such a document — scaffolding the arc42 with-help template, the cross-section traceability rules, the Chapter 11 Risks-vs-Technical-Debt structure, the ADR-to-risk-ID wiring, and the Chapter 1.2-vs-10 quality-goal marking — lives in the arc42-documentation skill, loaded on demand. + +## Crosscutting Concepts + +arc42 leaves Chapter 8 open. We require five baseline crosscutting concepts, in this order: + +- 8.1 Threat Model — STRIDE; threats get IDs (T-001…). +- 8.2 Security — every mitigation references the T-IDs it closes. +- 8.3 Test — testing pyramid; tests trace to Use Cases and Business Rules. +- 8.4 Observability — logs, metrics, traces, audit trails. +- 8.5 Error Handling — retry, circuit breaker, fallback, recovery. + +Add further Chapter 8.x concepts (persistence, i18n, accessibility, configuration, performance) only when the system actually has that concern. + +## Layer Boundaries + +At every layer boundary: +- Expose only well-defined DTOs and contracts — never domain entities +- Use explicit mapping at every seam +- Apply Anti-Corruption Layers when integrating external systems +- Dependency direction points inward (DIP) + +## Backlog Management + +Create EPICs and User Stories as GitHub issues from the specification. +- User Stories follow INVEST criteria (Independent, Negotiable, Valuable, Estimable, Small, Testable) +- Prioritize with MoSCoW (Must/Should/Could/Won't) +- Mark dependencies between issues +- Groom the backlog regularly as the project evolves + +## Vertical Slicing + +Build the first increment as a walking skeleton: a deployable end-to-end slice that wires every architectural layer together and does almost nothing else. + +Grow the system as thin vertical slices — each slice cuts through all layers and delivers one small piece of user value. Slices are tracer bullets: kept and refined, never thrown away. + +When a technical unknown blocks a slice, run a spike solution first — a timeboxed, throwaway experiment that removes the risk. Spike code is discarded; only its lesson carries into the slice. + +## Implement Next + +For each issue: +- Create a feature branch for the EPIC +- Select next issue from backlog (respect dependencies) +- Analyze and document analysis as a comment on the issue +- Implement using TDD (London or Chicago School as appropriate) +- Each test references its Use Case ID for traceability +- Beyond example-based tests, write invariant tests: name the property that connects a calculation's inputs to its output and test it over a range of values. Ask which of these tests would still fail if a change altered the units, the granularity, or the cardinality of an input +- Commit with Conventional Commits, reference issue number +- Verify the spec and architecture docs against the code: for each structural claim, confirm it still holds. Correct the document, never the code +- When EPIC is complete, create a Pull Request + +## Refactoring + +Refactoring targets are named code smells, not a vague urge to "clean up". + +For any refactoring that does not complete in one step, use the Mikado Method: attempt the change, note what breaks, revert, and do the prerequisites first — never leave the build broken while you dig. + +Refactoring commits change structure only. Behaviour changes go in separate commits, and the test suite stays green at every commit. + +## Code Quality + +Our code follows: +- SOLID principles +- DRY, KISS +- Ubiquitous Language from Domain-Driven Design (same terms in code as in the specification) + +## Quality Review + +Quality assurance follows three layers: +- Code review using Fagan Inspection (structured, systematic, with defined phases) +- Security review based on OWASP Top 10 +- Architecture review using ATAM (scenario-based tradeoff analysis against quality goals) +- Use a different AI model or fresh session for reviews to avoid blind spots + +## Docs-as-Code + +Documentation follows Docs-as-Code according to Ralf D. Müller: +- AsciiDoc as format, PlantUML for inline diagrams, built by docToolchain +- Version-controlled, peer-reviewed, and built automatically +- Plain English according to Strunk & White (or Gutes Deutsch nach Wolf Schneider) +- Projects following this contract include the `dtcw` wrapper and `docToolchainConfig.groovy` so PlantUML / AsciiDoc actually render. + +## Socratic Code Theory Recovery + +Recover a program's "theory" (Naur 1985) from source code through recursive question refinement. + +- Start with 5 root questions: Q1 Problem/Users, Q2 Specification, Q3 Architecture, Q4 Quality Goals, Q5 Risks. + +- The second level of the tree is FIXED, not free. Every run emits exactly these nodes, in this order, even when a node's only leaf is [OPEN] or [ANSWERED: not applicable]: + - Q1.1-Q1.6: product identity, primary users, channels, why-built, success metrics, segment priority + - Q2.1-Q2.6: actors, use-case catalog, per-interface system specs, data/entity model, acceptance criteria, cross-cutting business rules + - Q3.1-Q3.12: the twelve arc42 chapters, in arc42 order + - Q4.1-Q4.8: the eight ISO/IEC 25010 characteristics; plus Q4.9: which characteristic has priority + - Q5.1-Q5.5: technical debt, security risks, operational risks, dependency/supply-chain risks, scaling/performance risks + +- Below the fixed second level, decompose adaptively and code-driven; a node is a leaf only when it can be answered from one specific file:line evidence (a directory is too coarse — decompose further) or definitively marked [OPEN]. Depth tracks code density: a small bounded context yields a shallow tree, a large one a deep tree, capped at four levels below a fixed node. Depth varies between runs — expected. + +- Q-IDs are stable: Q3.7 is always Deployment View, in every run, so trees from different runs can be diffed node-by-node. + +- Each leaf is [ANSWERED] (with file:line evidence) or [OPEN] (with Category, Ask role, and why it is unanswerable from code). + +- Quality is not wholly team knowledge. Derive quality scenarios for the Q4 branch and arc42 Chapter 10 from measurable code behaviour — literal thresholds, timeouts, budgets, the threat catalogue and test concept from Q3.8 — as [ANSWERED] with file:line; never invent target numbers. Only the quality-goal ranking (Q4.9) is [OPEN]. arc42 Chapter 10 carries the derivable scenarios, never just an [OPEN] pointer. Chapter 1.2 names only the top 3-5 quality goals; Chapter 10 covers all eight characteristics — mark each Chapter 10 entry as concretising a Chapter 1.2 top goal or as derived. + +- Open Questions are the handoff document: always emit one section per role (Product Owner, Architect, Developer, Domain Expert, Operations), even when a section is empty ("No open questions for this role"). + +- Two-phase workflow: Phase 1 builds the tree; the team answers the Open Questions; Phase 2 synthesizes documentation from the answered tree. + +## Documentation Verification + +Verify the documentation against the code, in both directions. +- Ask what implementation revealed that the documents do not yet say +- For each structural claim in the architecture and specification documents, confirm that it holds today: module names, class names, file paths, table and column names, enum values, invariants, start commands, and claims of the form "the only place where X happens" +- List every claim that no longer holds, with document location and code location +- Never change the code to match the document. The document states an intention, the code states reality. Correct the document, or open an issue where the code is wrong +- Report how many claims were checked and how many had drifted +- Make structural claims mechanically verifiable where the project allows it: table names, column names, module paths, enum values. Traceability tooling that only runs forward (every rule has a test) never notices a documented column the schema does not have +- A structural claim that no test can verify does not belong in the documentation. Either make it verifiable or delete it +- Run the verification again after the bug-fix loop, before release: fixes change behaviour, and changed behaviour is what makes a correct claim stale + +## Concise Response (TLDR) + +Responses lead with the conclusion first (BLUF). Keep to essential points. No filler, no preamble. Use short sentences, active voice, and no unnecessary words (Strunk & White). + +## Simple Explanation (ELI5) + +Explain complex concepts using simple language and everyday analogies. When the explanation feels hard to write, that reveals gaps in understanding — study those areas first (Feynman Technique). + +## Explaining and Teaching + +When asked to explain or teach something (including "why does X…"), act as a teacher running a dialogue, not a lecture — your goal is that the learner can apply it afterwards, not that you delivered it. + +Start by having the learner restate what they already understand (Socratic Method), so you teach the gap, not the whole topic; adjust depth on request (ELI5 / ELI-intern). Keep a short running checklist of what they must grasp — the problem and why it exists, the solution with its design decisions and edge cases, and why it matters — a Definition of Done for understanding, worked one item at a time; for a long or multi-session explanation, persist that checklist as a file so it survives context loss and can be resumed. + +Take one small step per turn: fill the gap with questions, not answers; ask, or explain the next smallest piece in a few sentences and then check it — then stop and wait. Never stack several steps in one turn. Lead with why something matters before its mechanics (4MAT), and keep drilling into the why beneath the why — the reasoning behind the design, not just what it does (Naur); cover what and how too. + +Check by quizzing, never "makes sense?" — open or multiple-choice questions; for multiple choice, vary which option is correct and don't reveal the answer until the learner has committed. The sharpest check is having them explain it back in their own words (Feynman Technique) or apply it to a fresh case; use a concrete artifact (an example, code, a trace) when it helps. React to the actual answer: if they've got it, advance; if not, give a short targeted hint and re-ask. "Understood" means they can use it on a new case, not recite it (Bloom's Apply, not recall) — don't move on, and don't end, until they've shown that. + +Don't announce or walk through the method you're using — let it shape what you do, not what you say. Scale to the question: a small factual ask gets a one-line answer, and the learner can say "just tell me" anytime. If you're unsure of the topic, learn it before teaching. + +## Writing Style + +Writing follows Gutes Deutsch nach Wolf Schneider (or Plain English according to Strunk & White). + +Additionally: +- Technical terms stay in English (LLM, Prompt, Token, Spec, etc.) +- Address the reader directly, use first person sparingly but deliberately +- Use analogies to human thinking to explain technical concepts +- One thought per paragraph (5-8 sentences is fine) +- Section headings are statements, not topic announcements +- First sentence says what the paragraph is about +- Show code and prompts, don't just claim things work +- Conclusions make a clear statement — never end with 'it remains exciting' + +## TDD, Hamburg Style + +Design-led TDD recipe by Ralf Westphal — close the requirements/logic gap before writing code, then test at service boundaries with minimal mocking. Use it when the problem is too complex for pure micro-step Red-Green-Refactor. + +- **ACD cycle (Analyze → Design → Code)** precedes the test loop: first model the solution to close the gap between requirements and logic, only then code. +- **"Right from the start" philosophy** — implement correctly the first time so refactoring is a correction, not routine cleanup. +- **Service-level testing** — test behind the public API, independent of API technology. +- **Minimal mocking** — closer to *TDD, Chicago School* than *London School*. +- **IOSP (Integration Operation Segregation Principle)** — a function is either composition (Integration) or logic (Operation), never both; structural support for simple unit tests. +- **Deep Work over Small Steps** — accept that some problems can't be sliced into tiny green increments; stay red longer when the design demands it. + +Composes: *TDD, London School*, *TDD, Chicago School*, *Red-Green-Refactor*, *IOSP*. +Sources: https://ralfw.de/hamburg-style-tdd/, https://ralfw.de/tdd-how-it-can-be-done-right/ + +## Strategic Architecture Analysis + +Strategic architecture analysis combines four lenses, each for a different question. Reach for it when evaluating build-vs-buy, assessing architecture fitness for changing requirements, or running a strategic technology-radar review. + +Map the value chain with Wardley Mapping to see how each component evolves — what is commodity, what is genesis, and where the strategic differentiation actually sits. + +Classify each challenge with the Cynefin Framework — Clear, Complicated, Complex, or Chaotic — so the response fits the domain instead of forcing one playbook onto every problem. + +When a decision has a wide solution space, lay the dimensions and their options out in a Morphological Box and combine them deliberately, rather than anchoring on the first design that comes to mind. + +Evaluate the shortlisted architectures against the quality goals with ATAM, naming the sensitivity points, the tradeoff points, and the risks each option carries. + +When the root cause of a problem stays unclear, drill down with the Five Whys before committing to a direction. + +## Presentation Planning + +When asked to plan a presentation or talk, act as a planning partner in dialogue, not a slide generator — the goal is a plan the speaker can deliver, built around one audience and one core message. + +Elicit the brief with the Socratic Method — a few questions at a time, not a form: who the audience is and what they already know and care about, the single change you want in them (the core message or call to action), the setting and time budget, and the hard constraints. Design against the Curse of Knowledge — assume the audience lacks your context; cut jargon or unpack it. + +Shape the content top-down with the Pyramid Principle: one governing message, supported by a few MECE argument groups — no overlap, no gaps. Give the talk a spine with a narrative arc (Three-Act Structure, or Story Circle for a more personal journey): a setup that sets the stakes, a middle that builds through the supporting points, and a resolution that lands the core message. Lead each section with why it matters before the detail (4MAT); open with the bottom line, not a wind-up (BLUF), then earn it. + +Produce a plan, not slides: the one-sentence core message, the audience, the arc, and per section the single takeaway plus its evidence and rough timing. Work one part at a time — propose the core message and audience first, check them, then the arc, then fill the sections; stop and wait between steps instead of dumping a full deck. If the speaker says "just draft it", give the whole outline at once. Don't announce the method — let it shape the plan, not the talk about it. diff --git a/docToolchainConfig.groovy b/docToolchainConfig.groovy new file mode 100644 index 0000000..6790af1 --- /dev/null +++ b/docToolchainConfig.groovy @@ -0,0 +1,53 @@ +// docToolchain configuration for the arc42-generator documentation +// see https://doctoolchain.org/docToolchain/v4.0.x/ for all options + +outputPath = 'build/docs' + +inputPath = 'docs' + +inputFiles = [ + [file: 'QUESTION_TREE-arc42-generator.adoc', formats: ['html']], + [file: 'OPEN_QUESTIONS-arc42-generator.adoc', formats: ['html']], + [file: 'arc42-requirements.adoc', formats: ['html']], + [file: 'arc42/arc42-arc42-generator.adoc', formats: ['html']], + [file: 'specs/prd-arc42-generator.adoc', formats: ['html']], + [file: 'specs/use-cases-arc42-generator.adoc', formats: ['html']], + [file: 'specs/backlog-arc42-generator.adoc', formats: ['html']], +] + +taskInputsDirs = [:] + +// === microsite (task: generateSite) ========================================= +microsite = [:] + +// title in the upper left corner and fallback page title +microsite.title = 'arc42-generator' + +// the landing page ships with the internal theme +microsite.landingPage = 'landingpage.gsp' + +// footer and edit links +microsite.footerGithub = 'https://github.com/LLM-Coding/arc42-generator' +microsite.issueUrl = 'https://github.com/LLM-Coding/arc42-generator/issues/new' +microsite.gitRepoUrl = 'https://github.com/LLM-Coding/arc42-generator/edit/master/docs/' +microsite.footerText = 'built with docToolchain' + +// Menu entries come from the :jbake-menu: attribute of each document. +// The include fragments below are rendered as pages but must not appear in the +// menu: arc42 chapters, the help style and the ADR records all live inside +// their parent document. +microsite.menu = [ + architecture : 'Architecture', + prd : 'Product', + spec : 'Specification', + backlog : 'Backlog', + questiontree : 'Question Tree', + openquestions: 'Open Questions', + legacy : 'arc42 Requirements', + src : '-', + common : '-', + adrs : '-', + arc42 : '-', + specs : '-', + doc : '-', +] diff --git a/docs/OPEN_QUESTIONS-arc42-generator.adoc b/docs/OPEN_QUESTIONS-arc42-generator.adoc new file mode 100644 index 0000000..cc9aeaf --- /dev/null +++ b/docs/OPEN_QUESTIONS-arc42-generator.adoc @@ -0,0 +1,133 @@ += Socratic Code Theory Recovery: Open Questions — arc42-generator +:jbake-menu: openquestions +:jbake-title: Open Questions +:jbake-type: page +:jbake-status: published +:toc: left +:sectnums: + +Bounded context:: `arc42-generator` (whole repository, working tree at commit `6672693`) +Phase:: 1 of 2. These nine questions are the handoff. Phase 2 synthesizes PRD, specification, +arc42 document and ADRs only after they are answered. +Source:: Every question is copied verbatim from `QUESTION_TREE-arc42-generator.adoc`, where it +carries its Q-ID and the code evidence around it. +How to answer:: One to three sentences per question, written back into this file under the +question. + +== Product Owner + +=== Q1.5.3 Adoption metric +Category: business-context. + +No download counter, telemetry, or target figure exists anywhere in the repository. Whether +success is measured in downloads, languages covered, or formats supported cannot be derived. + +*Answer:* Der Release-Aufwand ist die Kennzahl. Erfolgreich ist der Generator, wenn ein Maintainer ein +neues Template-Release ohne Handarbeit und ohne Spezialwissen herausbringt. Download-Zahlen +werden nicht erhoben. + +=== Q1.6.3 Why that ranking? +Category: business-context. + +The code guards EN and DE (`test-discovery.groovy:79`) and validates only EN Markdown +(`build-arc42.sh:89`); images are checked for five formats (`build-arc42.sh:124`). Which +languages and formats the community actually uses — and therefore which ones must never break — +is not derivable from the code. + +*Answer:* EN und DE sind die Referenz: Core-Committer pflegen sie, alle Übersetzungen richten sich nach +ihnen. Deshalb sichern die Tests genau diese beiden ab. Community-Sprachen dürfen nachziehen. + +== Architect + +=== Q1.4.3 Why not simply keep Gradle? +Category: design-rationale. + +The code records the outcome, never the decision. Whether speed, the "chicken-and-egg problem" +mentioned in `CLAUDE.md:120`, or maintainer skill set drove the rewrite is not derivable. + +*Answer:* Gradle wurde in der alten Fassung falsch eingesetzt: der erste Durchlauf erzeugte die +Build-Skripte für den zweiten. Diese Zwei-Stufen-Konstruktion trieb die Komplexität hoch und +wurde deshalb beseitigt. Die Build-Zeit war Folge, nicht Grund. + +=== Q3.8.1.1 Is a threat catalogue present? +Category: design-rationale. + +No STRIDE analysis, no threat IDs, no security section exists in any document in the repository. +Which threats the build is expected to withstand — hostile template content, a compromised +upstream repository, a poisoned Pandoc download — must come from you. + +*Answer:* Kein Threat-Katalog, bewusst. Security spielt für diesen Build eine sehr untergeordnete Rolle: +Ein- und Ausgabe sind öffentliche Open-Source-Inhalte, der Build läuft auf Maintainer-Rechnern, +und es gibt weder Nutzerdaten noch einen laufenden Dienst. Die im Code belegten Punkte +(`SafeMode.UNSAFE`, ungeprüfte Downloads, `safe.directory '*'`) sind damit akzeptierte Risiken, +keine offenen Befunde. Für arc42 Kapitel 8.1 heißt das: STRIDE-Katalog entfällt, die +Risikoakzeptanz wird als Entscheidung dokumentiert. + +=== Q3.8.2.3 Why was UNSAFE chosen? +Category: design-rationale. + +`SafeMode.UNSAFE` is set at all three AsciidoctorJ call sites (`lib/Converter.groovy:100`, +`:132`, `:311`). Whether UNSAFE is required for the template's own includes or was chosen to +avoid debugging path errors is not derivable. + +*Answer:* Bequemlichkeit. `SafeMode.UNSAFE` erspart das Debuggen von Pfad- und Safe-Mode-Fehlern; ob +`SERVER` oder `SAFE` ebenfalls genügen würden, ist nie geprüft worden. Zusammen mit der +Risikoakzeptanz aus Q3.8.1.1 bleibt die Einstellung, wie sie ist — als bewusste Entscheidung, +nicht als Befund. + +=== Q4.9 Which characteristic has priority? +Category: quality-goals. + +The code guards performance and functional suitability with measurements, and leaves security +and reliability to defaults. Whether that ranking is intended or accidental cannot be read from +the code. + +*Answer:* Zuverlässigkeit hat Vorrang. Ein Build, der still Kapitel verschluckt (`lib/Converter.groovy:345`) +oder Erfolg meldet, obwohl Konvertierungen scheiterten (`lib/Converter.groovy:437-440` mit +`build.groovy:211-215`), ist das größte Problem — schwerer als Build-Zeit. Die gemessene +Performance bleibt ein erreichtes Nebenziel, nicht das oberste. + +== Developer + +=== Q3.2.2.5 Review and branching rules +Category: design-rationale. + +`CLAUDE.md:350` and `:356` prescribe feature branches and Conventional Commits for future work, +but the history mixes conventional and free-form subjects and no branch protection or template +is stored in the repository. Which rule actually binds contributors is not derivable. + +*Answer:* `CLAUDE.md` gilt ab jetzt: Feature-Branch vom Main, Conventional Commits, Pull Request. Die +Regel bindet alle neuen Beiträge; die gemischte Altlast in der Historie bleibt unangetastet. +Technisch durchgesetzt (Branch Protection, Commit-Lint) ist sie nicht. + +== Domain Expert + +=== Q2.6.10 The declared but unused `example` feature +Category: business-context. + +`buildconfig.groovy:7` declares `example` as a Golden Master feature and +`buildconfig.groovy:13-14` keeps a `with-examples` style commented out with the note "no content +yet". What an `arc42example` block should contain, and whether the examples flavor is still +intended, is a question about arc42 itself and cannot be answered from this repository. + +*Answer:* Nie genutztes Feature. Der Golden Master (Stand 2026-09, flacher Klon von +`arc42/arc42-template`) enthält `arc42example` null mal, `arc42help` dagegen 995 mal in 168 +`.adoc`-Dateien. Die Templates tragen ausschließlich Hilfetexte, die der Build für die +`plain`-Variante ausblendet. `example` in `buildconfig.groovy:7` erzeugt daher bei jedem Lauf +eine Regex in `lib/Templates.groovy:80`, die nie trifft. Sollte `with-examples` etwas anderes +meinen als die Hilfetexte, ist es nie gebaut worden — Feature-Flag und auskommentierter Style +sind Kandidaten zum Entfernen. + +== Operations + +=== Q5.5.5 Growth limit of the current design +Category: future-direction. + +Conversion parallelises over templates only, not over formats (`lib/Converter.groovy:430-432`). +No figure exists for how many languages or formats the pipeline must still handle comfortably, +so the point at which one-dimensional parallelism stops being adequate cannot be derived. + +*Answer:* Zeitbudget statt Größe: ein voller Build darf bis zu 20 Minuten dauern. Heute liegt er bei +17,4 s (`TEST-REPORT.md:365`), also mehr als zwei Größenordnungen darunter. Die einstufige +Parallelität bleibt damit auf absehbare Zeit ausreichend; die sequentielle Format-Schleife wird +erst zum Thema, wenn dieses Budget gerissen wird. diff --git a/docs/QUESTION_TREE-arc42-generator.adoc b/docs/QUESTION_TREE-arc42-generator.adoc new file mode 100644 index 0000000..df9ba1e --- /dev/null +++ b/docs/QUESTION_TREE-arc42-generator.adoc @@ -0,0 +1,915 @@ += Socratic Code Theory Recovery: Question Tree — arc42-generator +:jbake-menu: questiontree +:jbake-title: Question Tree +:jbake-type: page +:jbake-status: published +:toc: left +:toclevels: 3 +:sectnums: +:sectnumlevels: 1 + +Bounded context:: `arc42-generator` (whole repository, working tree at commit `6672693`) +Phase:: 1 of 2 — tree construction only. No PRD, no arc42 document, no ADRs. +Method:: Naur (1985) theory recovery through recursive question refinement. +Evidence rule:: A leaf is `[ANSWERED]` only with `file:line` evidence. A directory is not evidence. + +NOTE: The submodules `arc42-template/` and `req42-framework/` are not checked out in this +working tree (both directories are empty). Every statement about Golden Master *content* is +therefore derived from the generator's own code and configuration, never from template files. + +== Q1 — What problem does this bounded context solve, and for whom? + +=== Q1.1 Product identity + +==== Q1.1.1 What does the program produce? +[ANSWERED] ZIP archives, one per (language, flavor, format) triple, named +`arc42-template-- +++++ +endif::backend-html5[] \ No newline at end of file diff --git a/docs/arc42/images/arc42-logo.png b/docs/arc42/images/arc42-logo.png new file mode 100644 index 0000000..88c76d0 Binary files /dev/null and b/docs/arc42/images/arc42-logo.png differ diff --git a/docs/arc42/src/01_introduction_and_goals.adoc b/docs/arc42/src/01_introduction_and_goals.adoc new file mode 100644 index 0000000..b048e34 --- /dev/null +++ b/docs/arc42/src/01_introduction_and_goals.adoc @@ -0,0 +1,124 @@ +ifndef::imagesdir[:imagesdir: ../images] + +[[section-introduction-and-goals]] +== Introduction and Goals + +The arc42-generator turns one source into many downloads. +The arc42 template is maintained once, as AsciiDoc, in the `arc42-template` repository — the +Golden Master. +Readers want it as Word, Markdown, HTML, LaTeX and a dozen other formats, in their own language, +with or without the embedded help texts. +This generator produces every one of those combinations and packs each into a ZIP archive ready +for download (`lib/Packager.groovy:83`). + +Nobody who merely uses an arc42 template needs this repository. +The README says so in its first sentence (`README.adoc:3`): users download finished archives +from arc42.org. +This repository serves the people who produce those archives. + +=== Requirements Overview + +[cols="1,4,2",options="header"] +|=== +|ID |Requirement |Evidence + +|R-1 +|The generator shall produce the template for every language directory found in the Golden +Master, without a code or configuration change per language. +|`lib/Templates.groovy:37-40` + +|R-2 +|The generator shall produce two content flavors: `plain` without help texts and `with-help` +with them. +|`buildconfig.groovy:10-15`, `lib/Templates.groovy:75-90` + +|R-3 +|The generator shall convert each flavor into all 17 configured output formats. +|`buildconfig.groovy:17-35`, `lib/Converter.groovy:60-71` + +|R-4 +|The generator shall package each (language, flavor, format) combination as one ZIP archive in +the distribution directory. +|`lib/Packager.groovy:71-93`, `buildconfig.groovy:38` + +|R-5 +|The generator shall run as a single command, both in a container and as a plain Groovy script +with phase and format filters. +|`docker-compose.yml:9`, `build.groovy:16-21` + +|R-6 +|The generator shall validate its own output: generated Markdown parses as CommonMark, and every +image referenced by a `with-help` Markdown file exists. +|`build-arc42.sh:94-104`, `build-arc42.sh:151-182` +|=== + +Success is measured by release effort, not by downloads. +The generator has done its job when a maintainer produces a complete template release without +handwork and without special knowledge (team answer). + +=== Quality Goals + +These are the top goals, in order. +Chapter 10 carries one concrete scenario per goal and covers the remaining ISO 25010 +characteristics as derived scenarios. + +[cols="1,2,4,1",options="header"] +|=== +|ID |Quality Goal (ISO 25010) |Motivation |Scenario + +|QG-1 +|Reliability +|A build that silently drops a chapter, or reports success although conversions failed, damages +every downstream download. This outranks build speed (team answer). +|<> + +|QG-2 +|Maintainability +|A handful of volunteers maintain the generator beside their actual work. Adding a language must +cost nothing; adding a format must stay cheap. +|<> + +|QG-3 +|Functional Suitability +|Every maintained language must appear in every supported format. Partial output is worse than a +failed build. +|<> + +|QG-4 +|Performance Efficiency +|Speed is an achieved side goal, not the top one. The budget is generous: a full build may take +up to 20 minutes (team answer), today it takes 17.4 s. +|<> +|=== + +=== Stakeholders + +[cols="1,2,3",options="header"] +|=== +|Role |Contact |Expectation + +|Template user +|Anonymous, reaches the result through arc42.org/download +|Finds a current, complete template in the format and language of choice. Never sees this +repository (`README.adoc:3`). + +|Release maintainer +|arc42 core committers +|Produces a full release with one command and pushes the archives into the template repository +(`build-arc42.sh:198-205`). + +|Translator / contributor +|Community, per language +|Works only in the template repository; the generator picks up a new language directory by +itself (`lib/Templates.groovy:38`). + +|arc42 founders +|Gernot Starke, Peter Hruschka +|Guard the conceptual integrity of the template; decide what the template contains +(`docs/arc42-requirements.adoc:101-102`). + +|Generator developer +|Whoever changes this repository +|Finds a build that is readable without build-tool knowledge, and a documented path for adding a +format (`CLAUDE.md:170-181`). +|=== diff --git a/docs/arc42/src/02_architecture_constraints.adoc b/docs/arc42/src/02_architecture_constraints.adoc new file mode 100644 index 0000000..e8e8ff0 --- /dev/null +++ b/docs/arc42/src/02_architecture_constraints.adoc @@ -0,0 +1,99 @@ +ifndef::imagesdir[:imagesdir: ../images] + +[[section-architecture-constraints]] +== Architecture Constraints + +Three kinds of constraint bind this build: what it may run on, how the project works, and what +the code has to look like. + +=== Technical Constraints + +[cols="1,3,2",options="header"] +|=== +|ID |Constraint |Evidence + +|C-T-1 +|Groovy 5.0.3 on an OpenJDK 21 JRE, Alpine Linux 3.20. No JDK, no build tool. +|`Dockerfile:4`, `:14`, `:23-26`, `:29` + +|C-T-2 +|AsciidoctorJ 2.5.10, AsciidoctorJ-Diagram 2.2.14 and GPars 1.2.1, pinned and resolved by Grape. +|`lib/Converter.groovy:3-5`, `init-groovy-deps.groovy:3-5` + +|C-T-3 +|Pandoc 3.7.0.2 as an external binary; installed from a GitHub release when missing. +|`build-arc42.sh:26-27`, `:39-40` + +|C-T-4 +|Docker is the only supported execution mode. Local execution is explicitly unsupported. +|`README.adoc:17`, `:19`, `:113` + +|C-T-5 +|Open-source tooling only; no proprietary converter may be required. +|`docs/arc42_build_process_requirements.md:190-199` + +|C-T-6 +|MIT licence for the generator. +|`LICENSE.txt:1-3` +|=== + +=== Organizational and Process Constraints + +[cols="1,3,2",options="header"] +|=== +|ID |Constraint |Evidence + +|C-O-1 +|Two repositories: this one holds the build logic, `arc42-template` holds only content. The +template is consumed as a Git submodule. +|`docs/arc42_build_process_requirements.md:86-104`, `.gitmodules:1-6` + +|C-O-2 +|Release is manual: build, inspect `arc42-template/dist/`, then commit and push inside the +submodule. +|`build-arc42.sh:198-205`, `CLAUDE.md:202-207` + +|C-O-3 +|Feature branch off main, Conventional Commits, pull request — binding for all new +contributions, not technically enforced (team answer). +|`CLAUDE.md:350`, `:356` + +|C-O-4 +|CI covers the documentation only: one workflow builds and publishes the microsite. The template +build and the test suite are still started by hand. See <>. +|`.github/workflows/documentation.yml`, requirement `docs/arc42_build_process_requirements.md:229` + +|C-O-5 +|Agent tooling in this repository asks before Bash and Write, and may not read `.env*` or +`secrets/**`. +|`settings.json:12-20` +|=== + +=== Conventional Constraints + +[cols="1,3,2",options="header"] +|=== +|ID |Constraint |Evidence + +|C-C-1 +|LF line endings for shell, Docker and Groovy files; binaries excluded from normalisation. +|`.gitattributes:2-10`, `:23-31` + +|C-C-2 +|Generated artifacts stay untracked: `build`, `src_gen`, IDE files, `.gradle`. +|`.gitignore:1-8` + +|C-C-3 +|Fixed output layout: `build/src_gen//asciidoc/