@groupby/ai-dev 0.5.15 → 0.5.17

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 (41) hide show
  1. package/package.json +1 -1
  2. package/teams/fhr-orchestration/skills/create-jira/SKILL.md +47 -0
  3. package/teams/fhr-orchestration/skills/create-jira/TEMPLATE.md +10 -0
  4. package/teams/fhr-orchestration/skills/create-plan/SKILL.md +48 -0
  5. package/teams/fhr-orchestration/skills/create-plan/TEMPLATE.md +13 -0
  6. package/teams/fhr-orchestration/skills/init-harness/SKILL.md +164 -0
  7. package/teams/fhr-orchestration/skills/init-harness/assets/TEMPLATE.CLAUDE.md +88 -0
  8. package/teams/fhr-orchestration/skills/init-harness/assets/TEMPLATE.architecture.md +152 -0
  9. package/teams/fhr-orchestration/skills/init-harness/assets/TEMPLATE.coding-guidelines.md +320 -0
  10. package/teams/fhr-orchestration/skills/init-harness/assets/TEMPLATE.glossary.md +55 -0
  11. package/teams/fhr-orchestration/skills/init-harness/assets/TEMPLATE.harness-gap-log.md +59 -0
  12. package/teams/fhr-orchestration/skills/use-case-writer/SKILL.md +123 -0
  13. package/teams/fhr-orchestration/skills/use-case-writer/TEMPLATE.md +39 -0
  14. package/teams/fhr-orchestration/skills/write-spec/SKILL.md +56 -0
  15. package/teams/fhr-orchestration/skills/write-spec/TEMPLATE.md +29 -0
  16. package/teams/firstspirit-caas/mcp/jira-tools.py +2122 -0
  17. package/teams/firstspirit-caas/mcp/test_bamboo_artifacts.py +315 -0
  18. package/teams/firstspirit-caas/mcp/test_jira_links.py +192 -0
  19. package/teams/firstspirit-caas/mcp/test_update_jira_ticket.py +161 -0
  20. package/teams/firstspirit-caas/resources/mcp-setup.md +57 -0
  21. package/teams/firstspirit-caas/skills/chronicle/SKILL.md +105 -0
  22. package/teams/firstspirit-caas/skills/create-jira-ticket/SKILL.md +183 -0
  23. package/teams/firstspirit-caas/skills/get-jira-ticket/SKILL.md +125 -0
  24. package/teams/firstspirit-caas/skills/handle-red-cve-plan/SKILL.md +316 -0
  25. package/teams/firstspirit-caas/skills/handle-red-cve-plan/references/suppression.md +79 -0
  26. package/teams/firstspirit-caas/skills/handle-red-cve-plan/scripts/gen_suppression.py +116 -0
  27. package/teams/firstspirit-caas/skills/handle-red-cve-plan/scripts/parse_json_report.py +183 -0
  28. package/teams/firstspirit-caas/skills/handle-red-cve-plan/scripts/parse_report.py +255 -0
  29. package/teams/firstspirit-caas/skills/handle-red-cve-plan/scripts/test_gen_suppression.py +171 -0
  30. package/teams/firstspirit-caas/skills/handle-red-cve-plan/scripts/test_parse_json_report.py +244 -0
  31. package/teams/firstspirit-caas/skills/handle-red-cve-plan/scripts/test_parse_report.py +464 -0
  32. package/teams/firstspirit-caas/skills/handle-red-cve-plan/scripts/testdata/sample-report.html +39 -0
  33. package/teams/firstspirit-caas/skills/handle-red-cve-plan/scripts/testdata/sample-report.json +76 -0
  34. package/teams/firstspirit-caas/skills/handle-weekly-cve-plans/SKILL.md +238 -0
  35. package/teams/firstspirit-caas/skills/retrospect/SKILL.md +94 -0
  36. package/teams/firstspirit-caas/skills/retrospect/extract_prompts.py +392 -0
  37. package/teams/firstspirit-caas/skills/review/SKILL.md +131 -0
  38. package/teams/firstspirit-caas/skills/review-finalize/SKILL.md +103 -0
  39. package/teams/firstspirit-caas/skills/specify/SKILL.md +239 -0
  40. package/teams/firstspirit-caas/skills/summarise-for-jira-comment/SKILL.md +162 -0
  41. package/teams/firstspirit-caas/skills/write-releasenotes/SKILL.md +177 -0
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@groupby/ai-dev",
3
- "version": "0.5.15",
3
+ "version": "0.5.17",
4
4
  "description": "Interactive installer for Rezolve Ai development content",
5
5
  "type": "module",
6
6
  "bin": {
@@ -0,0 +1,47 @@
1
+ ---
2
+ name: create-jira
3
+ description: Groom a Jira ticket into a structured, grooming-ready ticket file. Accepts a Jira key (e.g. FHR-1234), a Jira URL, or rough notes/description. Fetches ticket details via Atlassian MCP if available. Outputs docs/specs/FHR-XXXX/TICKET.md. Use when asked to create, groom, or write a Jira ticket.
4
+ argument-hint: "Jira key (e.g. FHR-1234), Jira URL, or a description/notes for the ticket"
5
+ user-invocable: true
6
+ ---
7
+
8
+ # /create-jira
9
+
10
+ Transforms rough input (notes, conversation, pasted JIRA content) into a structured, grooming-ready ticket saved to `docs/specs/{JIRA-ID}/TICKET.md`.
11
+
12
+ ## Trigger
13
+
14
+ `/create-jira` followed by either:
15
+ - Pasted ticket content, rough notes, or a description
16
+ - A JIRA ticket key (e.g. `FHR-7054`)
17
+
18
+ ## Input Resolution
19
+
20
+ 1. If the user provides content directly, use it as the source material.
21
+ 2. If the user provides only a JIRA key, attempt to fetch via MCP. If MCP is unavailable or fails, ask the user to paste the ticket content.
22
+
23
+ ## Process
24
+
25
+ 1. **Parse** the input to identify what is known and what is missing.
26
+ 2. **Clarify** unknowns before writing. Group related questions into a single message to minimize round-trips. Do not produce the ticket until all ambiguity is resolved.
27
+ 3. **Write** the final ticket.
28
+
29
+ ## Clarification Guidelines
30
+
31
+ - Group related unknowns into one question (e.g. "I need: (1) which repo owns this, (2) who is the engineer, (3) link to the source of truth").
32
+ - Never ask about information already present in the input.
33
+ - If something can be reasonably inferred from context, state the assumption and ask for confirmation rather than asking an open question.
34
+
35
+ ## Output
36
+
37
+ - Template: `skills/create-jira/TEMPLATE.md`
38
+ - Write to: `docs/specs/{JIRA-ID}/TICKET.md`
39
+
40
+ ## Rules
41
+
42
+ - Use exactly the section names from the template. Do not rename, split, or add sections.
43
+ - Acceptance Criteria are plain-language observable outcomes as checklist items. It should be self-evidently verifiable.
44
+ - If a section does not apply, omit it entirely. No "N/A" filler.
45
+ - Do not use emojis, icons, decorative symbols, backtick code formatting for shell commands, or non-ASCII punctuation (e.g. em dashes, curly quotes) anywhere in the output. Use plain ASCII only.
46
+ - Do not produce the ticket with unresolved gaps. Ask first, write second.
47
+ - Write the ticket directly to the output file. Do not display the ticket content in the conversation - only confirm the file path once written.
@@ -0,0 +1,10 @@
1
+ # {JIRA-ID}: {Title}
2
+
3
+ ## TL;DR
4
+ {2–3 sentences. What is changing, why and why the work matters, and what it touches or enables. Concise overview of the work; enough to understand the ticket at a glance without reading the full body.}
5
+
6
+ ## Affected Areas
7
+ {Module, service, component, or file names. Approximate is fine}
8
+
9
+ ## Acceptance Criteria
10
+ - [ ] {Plain-language observable outcome, independently verifiable}
@@ -0,0 +1,48 @@
1
+ ---
2
+ name: create-plan
3
+ description: Generate a TDD implementation plan from a spec file. Accepts a Jira key (e.g. FHR-1234), a Jira URL, or a path to a SPEC.md file. Reads the spec and breaks it into ordered, independently executable tasks for a coding agent. Outputs docs/specs/FHR-XXXX/PLAN.md. Use when asked to create a plan or implementation tasks for a ticket or spec.
4
+ argument-hint: "Jira key (e.g. FHR-1234), Jira URL, or path to SPEC.md"
5
+ user-invocable: true
6
+ ---
7
+
8
+ # /create-plan
9
+
10
+ Reads a spec and produces a detailed TDD implementation plan with ordered tasks, each independently executable by a coding agent.
11
+
12
+ ## Trigger
13
+
14
+ `/create-plan` followed by one of:
15
+ - A JIRA key (e.g. `FHR-1234`) - resolves to `docs/specs/FHR-1234/SPEC.md`
16
+ - A JIRA link (e.g. `https://attraqt.atlassian.net/browse/FHR-1234`) - extracts key, resolves same as above
17
+ - A path to a spec or ticket file (e.g. `docs/specs/FHR-1234/SPEC.md`)
18
+
19
+ ## Input Resolution
20
+
21
+ 1. Resolve the argument to a JIRA key.
22
+ 2. Read `docs/specs/{JIRA-ID}/SPEC.md`. If it does not exist, check for `docs/specs/{JIRA-ID}/TICKET.md` and ask whether to write a spec first.
23
+ 3. Read repository markdown files (coding guidelines, architecture docs) for conventions.
24
+
25
+ ## Process
26
+
27
+ 1. **Plan** - break the spec into discrete implementation tasks.
28
+ 2. **Order** - dependencies first (e.g. data model before service before controller).
29
+ 3. **Validate** before presenting:
30
+ - Every functional requirement in the spec has at least one corresponding task.
31
+ - Every task is independently executable by a coding agent.
32
+ - Tasks name exact files to create or modify.
33
+ 4. **Present** - summary of the plan structure and task count.
34
+
35
+ ## Output
36
+
37
+ - Template: `skills/create-plan/TEMPLATE.md`
38
+ - Write to: `docs/specs/{JIRA-ID}/PLAN.md`
39
+
40
+ Each task follows the format in `TEMPLATE.md`.
41
+
42
+ ## Rules
43
+
44
+ - Tasks must be ordered so each can be executed without forward dependencies.
45
+ - Each task names exact files to create or modify.
46
+ - Follow conventions from repository coding guidelines.
47
+ - Do not invent requirements beyond what the spec states.
48
+ - If the spec has gaps that prevent planning, stop and ask rather than assuming.
@@ -0,0 +1,13 @@
1
+ ### Task N: {Name}
2
+
3
+ **Files:** `path/to/file` (create | modify)
4
+
5
+ **Acceptance tests (BDD)**
6
+ - Given ... When ... Then ...
7
+
8
+ **Unit tests (TDD)**
9
+ - should {expected behaviour} when {condition}
10
+
11
+ **Implementation**
12
+ - {Concrete step}
13
+ - {Concrete step}
@@ -0,0 +1,164 @@
1
+ ---
2
+ name: init-harness
3
+ description: "Investigate a Titan service repo and produce (or refresh) its AI harness — CLAUDE.md at the repo root plus docs/coding-guidelines.md, docs/architecture.md, docs/glossary.md, docs/harness-gap-log.md. Reads the codebase, Jira/Confluence, and Miro boards; asks the engineer about high-risk areas and unknowns; writes documentation only, never production code. Use when: \"init the harness for this repo\", \"set up AI docs for this service\", \"refresh CLAUDE.md and docs/\", \"onboard this repo for AI coding\", \"update the harness after big changes\", or when starting AI-assisted work in a new Titan service."
4
+ argument-hint: "Optional: Jira ticket key, Confluence space URL, Miro board URL, or 'update' to refresh existing files"
5
+ context: fork
6
+ ---
7
+
8
+ # Init Harness
9
+
10
+ Investigate a repo and produce, or update, the canonical set of AI harness documentation files. A coding agent must not generate production code in a repo without these files in place.
11
+
12
+ **Do NOT write production code.** Research, ask questions, and write documentation only.
13
+
14
+ ## Output Files
15
+
16
+ The skill always targets this fixed set. After writing all files, suggest any extras that appear warranted and let the engineer decide.
17
+
18
+ | File | Location | Purpose |
19
+ |------|----------|---------|
20
+ | `CLAUDE.md` | repo root | Agent entry point: build commands, file pointers, service identity, dependencies, definition of done, PR guidance |
21
+ | `docs/coding-guidelines.md` | `docs/` | Every naming, structural, and pattern convention extracted from the codebase |
22
+ | `docs/architecture.md` | `docs/` | System context, layer map, data model, messaging topology, API surface |
23
+ | `docs/glossary.md` | `docs/` | Canonical domain terms used verbatim in code, specs, and docs |
24
+ | `docs/harness-gap-log.md` | `docs/` | Record of generation failures and their fixes |
25
+
26
+ > **Known gap:** `docs/testing.md` is not yet in the output set. Testing conventions are covered in `docs/coding-guidelines.md`. When `testing.md` is created as a shared template, add it here.
27
+
28
+ > **Note on `coding-guidelines.md`:** The coding-guidelines template is Spring Boot specific. If a future Titan repo uses a different stack, create a new coding-guidelines template for that framework and add it to the assets directory.
29
+
30
+ ## Templates
31
+
32
+ Read the template for each file before writing it.
33
+
34
+ | Template | Produces |
35
+ |----------|---------|
36
+ | [TEMPLATE.CLAUDE.md](./assets/TEMPLATE.CLAUDE.md) | `CLAUDE.md` |
37
+ | [TEMPLATE.coding-guidelines.md](./assets/TEMPLATE.coding-guidelines.md) | `docs/coding-guidelines.md` |
38
+ | [TEMPLATE.architecture.md](./assets/TEMPLATE.architecture.md) | `docs/architecture.md` |
39
+ | [TEMPLATE.glossary.md](./assets/TEMPLATE.glossary.md) | `docs/glossary.md` |
40
+ | [TEMPLATE.harness-gap-log.md](./assets/TEMPLATE.harness-gap-log.md) | `docs/harness-gap-log.md` |
41
+
42
+ ## Research Tools
43
+
44
+ ### Atlassian (Jira / Confluence)
45
+
46
+ When the engineer provides a Jira ticket key, Confluence space, or Confluence page URL, use available Atlassian MCP tools to:
47
+ - Fetch the page content: architecture docs, team conventions, ADRs, onboarding guides
48
+ - Extract domain terms, service names, team agreements, deployment topology
49
+
50
+ ### Miro
51
+
52
+ When the engineer provides a Miro board URL, use available Miro MCP tools to:
53
+ - Read the board content: system diagrams, data flow, component maps
54
+ - Extract topology, component names, and integration boundaries
55
+
56
+ ## Investigation Process
57
+
58
+ Work through all six steps in order. Do not skip steps.
59
+
60
+ **Re-run detection:** If Step 2 classifies all files as **current** or **stale** (none missing), this is a re-run. In re-run mode: skip Step 3 unless the engineer provided external source URLs in the skill invocation. Step 4b reduces to: "I found these gaps between the existing docs and the current codebase: [list]. Anything else I should know before updating?"
61
+
62
+ ### Step 1 — Investigate the codebase
63
+
64
+ Read every template in the Templates table. Each `{{PLACEHOLDER}}` is an investigation target.
65
+
66
+ **Investigation paths (in this order):**
67
+
68
+ 1. **Build file** — framework, version, dependencies, plugins, and the commands needed to build, test, and run the service (full build, skip-tests, single module, single test class)
69
+ 2. **Entry point** — main class or bootstrap file, annotations, base package/module
70
+ 3. **Configuration** — app config files, property/env prefixes, profiles, feature flags
71
+ 4. **Tests** — test files and directories, framework, infrastructure (containers, mocks), naming
72
+ 5. **Source structure** — directory tree of production code, layer names
73
+ 6. **API surface** — endpoints, handlers, response types, error handling
74
+ 7. **CI and infrastructure** — pipeline files at repo root
75
+
76
+ **Stop when** you can fill every template placeholder with a value from the codebase. Do not catalogue patterns that no template section requires.
77
+
78
+ ### Step 2 — Classify existing harness files
79
+
80
+ 1. Check if `CLAUDE.md` exists at root and check for `.md` files in `docs/`.
81
+ 2. For each present file, note the `*Last updated*` date.
82
+ 3. Classify: **missing** (create from template), **stale** (regenerate), **current** (targeted updates only).
83
+ 4. Check for `.md` files in `docs/` that are NOT in the Output Files table. Flag them to the engineer: "These files exist but are not part of the harness set. Should they be deleted, moved, or kept as standalone references?"
84
+
85
+ A file is stale if it references non-existent classes/packages or is missing sections present in the template.
86
+
87
+ ### Step 3 — Gather external context
88
+
89
+ Pull from every source the engineer provides:
90
+ - Jira / Confluence: fetch linked pages; extract architecture docs, team decisions, domain glossary
91
+ - Miro: read the board; extract system diagram, component names, integration boundaries
92
+ - Any other URLs or documents pasted directly
93
+
94
+ Ask the engineer **once**:
95
+ - "Are there any Confluence pages, Miro boards, Jira epics, architecture diagrams, or runbooks I should read? Paste URLs or ticket keys here."
96
+
97
+ ### Step 4 — Identify unknowns and ask the engineer
98
+
99
+ Ask the engineer **once**, grouping all questions in a single message:
100
+
101
+ - **High-risk areas:** Are there areas where a wrong AI change would cause damage beyond a normal bug (data loss, broken contracts, security vulnerability, silent CI breakage)? These will go in `coding-guidelines.md` §12 High-Risk Areas.
102
+ - **Domain:** What does `[term]` mean in this service's context? (list any terms the codebase uses that could not be inferred)
103
+ - **Dependencies:** What does this service call outbound? What calls it inbound?
104
+ - **Deployment:** Deployment config path or infrastructure repo location?
105
+ - **Gaps:** For anything you could not determine from investigation paths 1-7, list each gap explicitly.
106
+
107
+ Wait for answers before writing anything.
108
+
109
+ ### Step 5 — Write the files
110
+
111
+ Write (or update) all 5 files. Rules:
112
+
113
+ 1. Create `docs/` if it does not exist.
114
+ 2. Read the corresponding template before writing each file.
115
+ 3. Replace every `{{PLACEHOLDER}}` with discovered or confirmed content. No placeholder may remain.
116
+ 4. **`coding-guidelines.md`:** Include a Logging section.
117
+ 5. **Re-run mode:** for existing files, diff each section against what you would generate from scratch. If an existing section contains information you cannot find in the codebase or provided external sources (team decisions, deployment details, transitional notes, "do not" warnings), preserve it and mark it with a comment `<!-- preserved: not verifiable from codebase -->` so the engineer can confirm or remove during review.
118
+ 6. **Every section must earn its space.** If it restates general knowledge (SOLID, DRY, composition over inheritance, KISS, YAGNI), delete it. Only write content specific to this repo that would cause wrong output if missing.
119
+ 7. **No cross-file duplication.** No instruction may appear in more than one output file. If you find yourself writing the same rule in two places, pick one file to own it and delete from the other.
120
+ 8. **`glossary.md`:** every definition must be complete enough to generate correct code from. Test: if reading only this definition, would the agent produce the right logic? If not, the definition is incomplete.
121
+ 9. **`architecture.md` §9 Key Design Decisions:** only include a decision when this repo deliberately chose against the common pattern and an agent would produce wrong code by defaulting to the standard approach. Zero entries is valid.
122
+ 10. **`architecture.md` §3 Layer Map:** list every class that owns meaningful logic. Depth guide: include the class if another developer needs to know it exists to avoid duplicating its responsibility. Exclude DTOs, mappers, and trivial config beans. One line per class: name, package, purpose.
123
+ 11. **`architecture.md` §10 Deployment Context:** determine the deployment mechanism from CI files and build config. Write two plain sentences: (1) how this service deploys (K8s/ArgoCD, EC2/AMI, Lambda, etc.), (2) where deployment config lives (separate repo path, or "in this repo at {{path}}"). Do not include deployment options that don't apply.
124
+ 12. **`architecture.md` §2 System Context:** if the engineer provided a Miro board, Confluence page, or diagram URL, transcribe it as an ASCII diagram above the table. If no external diagram source exists, omit the diagram block entirely. The neighbour table is always required. Populate it from codebase evidence (REST clients, Kafka producers/consumers, DB connections). For inbound callers not visible in code, ask the engineer.
125
+ 13. **`coding-guidelines.md` §12 High-Risk Areas:** include an entry when a wrong AI change causes damage beyond a normal bug (data loss, broken contracts, security vulnerability, silent CI breakage). The agent can still generate in these areas but must follow the area-specific rule and flag it in the PR. If the concern is merely inconsistent code style, fix the relevant coding-guidelines section instead. Common candidates: database migrations, published API contracts, infrastructure/CI files, credential handling, generated code. Zero entries is valid for simple repos.
126
+ 14. **`coding-guidelines.md` AI Usage Notes:** derive all three lists directly from §1–§12. Generate: (1) patterns AI must always follow, (2) patterns AI must never use, (3) things that contradict common defaults or conventions.
127
+
128
+ **CLAUDE.md size check:** if the file exceeds 110 lines, audit for content that belongs in a sub-file.
129
+
130
+ **Presentation mode:**
131
+ - **Initial run (files missing):** present all files together as a complete set. Get one confirmation before writing to disk.
132
+ - **Re-run (all files exist):** present changes one at a time. For each change: state the file, what you would change, and why (citing the template or codebase evidence). Wait for the engineer to say yes, no, or ask a question before presenting the next change. Only write approved changes to disk.
133
+
134
+ ### Step 6 — Validate
135
+
136
+ Before presenting the output, verify:
137
+
138
+ - [ ] All 5 files exist at the correct paths
139
+ - [ ] `CLAUDE.md` has a Build Commands section with at least one runnable command
140
+ - [ ] `CLAUDE.md` harness status table shows Present for all files that exist
141
+ - [ ] No `{{PLACEHOLDER}}` text remains in any output file
142
+ - [ ] `coding-guidelines.md` has at least one convention per section
143
+ - [ ] `coding-guidelines.md` includes a Logging section
144
+ - [ ] `architecture.md` has a system context description, layer map, and integration inventory
145
+ - [ ] `glossary.md` has domain terms extracted from the codebase; if fewer than 3, flag to engineer
146
+ - [ ] `coding-guidelines.md` §12 High-Risk Areas is populated (or engineer confirmed none exist)
147
+ - [ ] `coding-guidelines.md` AI Usage Notes is populated with rules derived from §1–§12
148
+ - [ ] `harness-gap-log.md` has the correct service name and empty Active Gaps section (or carried-over entries with actionable corrective actions)
149
+ - [ ] All files have `*Last updated*` and `*Owner*` headers
150
+ - [ ] No section in any file restates generic engineering principles
151
+ - [ ] No instruction appears in more than one file
152
+
153
+ Fix any failing items before presenting.
154
+
155
+ ## Output
156
+
157
+ After all files are written, present a summary covering:
158
+ - Files created vs updated
159
+ - Key discoveries from investigation
160
+ - Assumptions the engineer should confirm
161
+ - Cross-file duplication check: confirm no instruction appears in more than one file
162
+ - Generic content audit: confirm no SOLID/DRY/KISS/YAGNI sections remain
163
+
164
+ Harness is ready. Next step is for the engineer: produce a spec for the first (or next) feature before any generation begins.
@@ -0,0 +1,88 @@
1
+ # CLAUDE.md — {{SERVICE_NAME}}
2
+
3
+ *Last updated: {{DATE}}*
4
+ *Owner: {{TEAM_NAME}}*
5
+
6
+ ---
7
+
8
+ ## Purpose
9
+
10
+ Entry point for AI generation in `{{SERVICE_NAME}}`. This is an index. Conventions live in `docs/coding-guidelines.md`. Architecture lives in `docs/architecture.md`.
11
+
12
+ ---
13
+
14
+ ## Harness Status
15
+
16
+ | File | Status |
17
+ |------|--------|
18
+ | coding-guidelines.md | Present |
19
+ | architecture.md | Present |
20
+ | glossary.md | Present |
21
+ | harness-gap-log.md | Present |
22
+ | testing.md | Pending — conventions in coding-guidelines.md for now |
23
+
24
+ ---
25
+
26
+ ## What This Service Does
27
+
28
+ `{{SERVICE_NAME}}` {{SERVICE_ONE_LINE_DESCRIPTION}}.
29
+
30
+ Service: `{{SERVICE_NAME}}` | Framework: {{FRAMEWORK_AND_VERSION}} | Main class: `{{MAIN_CLASS}}`
31
+
32
+ ---
33
+
34
+ ## Build Commands
35
+
36
+ ```shell
37
+ {{BUILD_ALL_COMMAND}}
38
+ {{BUILD_SKIP_TESTS_COMMAND}}
39
+ {{RUN_TESTS_SINGLE_MODULE_COMMAND}}
40
+ {{RUN_SINGLE_TEST_CLASS_COMMAND}}
41
+ ```
42
+
43
+ ---
44
+
45
+ ## Read Before Generating
46
+
47
+ 1. `docs/coding-guidelines.md` — conventions for this repo
48
+ 2. `docs/architecture.md` — service boundaries and integrations
49
+ 3. `docs/glossary.md` — domain terms; use exactly as defined
50
+ 4. `docs/harness-gap-log.md` — check for open gaps; apply corrective actions
51
+ 5. `docs/specs/[TICKET]/SPEC.md` — required before any generation
52
+
53
+ No spec provided? Stop and ask for one.
54
+
55
+ <!-- FILL IN or REMOVE: only if deployment config lives outside this repo -->
56
+ **Deployment context:** This service deploys via a separate repo (`{{DEPLOYMENT_CONFIG_PATH}}`). The agent cannot read it. If generation needs environment config or service URLs, the engineer must paste relevant values into the session.
57
+
58
+ ---
59
+
60
+ ## Service Dependencies
61
+
62
+ <!-- FILL IN: one row per dependency -->
63
+ | Service | Communication | Declared in |
64
+ |---------|---------------|-------------|
65
+ | {{SERVICE}} | {{REST / Kafka / etc.}} | {{Class}} |
66
+
67
+ <!-- FILL IN or REMOVE: transitional/disabled dependency notes -->
68
+
69
+ ---
70
+
71
+ ## Definition of Done
72
+
73
+ - [ ] Inputs validated at the boundary
74
+ - [ ] Errors handled explicitly (no silent swallowing)
75
+ - [ ] No secrets or hardcoded environment values
76
+ - [ ] Tests cover spec scenarios (happy path + failures)
77
+ - [ ] Build passes and quality gate is green
78
+
79
+ ---
80
+
81
+ ## Pull Requests
82
+
83
+ When creating a PR, include in the body:
84
+ - **Ticket** link
85
+ - **What changed** (one paragraph)
86
+ - **Spec path** referenced
87
+ - **What was manually adjusted** (be specific; "Nothing" is valid)
88
+ - **Harness gaps** encountered (or "None")
@@ -0,0 +1,152 @@
1
+ # architecture.md — {{SERVICE_NAME}}
2
+
3
+ *Last updated: {{DATE}}*
4
+ *Owner: {{TEAM_NAME}}*
5
+
6
+ ---
7
+
8
+ ## 1. Purpose
9
+
10
+ `{{SERVICE_NAME}}` {{SERVICE_PURPOSE_ONE_PARAGRAPH}}.
11
+
12
+ ---
13
+
14
+ ## 2. System Context
15
+
16
+ <!-- Include a diagram here only if transcribed from an external source (Miro board, Confluence page, whiteboard photo). Do not invent one. The table below is the authoritative source of truth. -->
17
+
18
+ | Neighbour | Role | Communication | Notes |
19
+ |-----------|------|---------------|-------|
20
+ | **{{ServiceName}}** | {{role relative to this service}} | {{REST / Kafka / gRPC / S3 / etc.}} | {{retry policy, cache, transitional status, or "—"}} |
21
+ | **{{ServiceName}}** | {{role relative to this service}} | {{protocol}} | {{notes or "—"}} |
22
+
23
+ {{INTEGRATION_NOTES — expand on transitional, disabled, or non-obvious integrations}}
24
+
25
+ ---
26
+
27
+ ## 3. Internal Layer Map
28
+
29
+ <!-- Include only layers that exist. Remove any that do not. -->
30
+
31
+ ```
32
+ {{ENTRY_POINT_LAYER}} ({{package}})
33
+ ├── {{Class}} — {{one-line purpose}}
34
+ └── {{Class}} — {{one-line purpose}}
35
+
36
+ {{BUSINESS_LOGIC_LAYER}} ({{package}})
37
+ ├── {{Class}} — {{one-line purpose}}
38
+ └── {{Class}} — {{one-line purpose}}
39
+
40
+ {{PERSISTENCE_LAYER}} ({{package}})
41
+ ├── {{Class}} — {{tables or store in scope}}
42
+ └── {{Class}} — {{tables or store in scope}}
43
+
44
+ <!-- FILL IN or REMOVE: only if scheduled tasks exist -->
45
+ {{SCHEDULING_LAYER}} ({{package}})
46
+ ├── {{Class}} — {{what it does}}
47
+ └── {{Class}} — {{what it does}}
48
+
49
+ <!-- FILL IN or REMOVE: only if outbound integrations exist -->
50
+ {{INTEGRATIONS_LAYER}} ({{package}})
51
+ ├── {{Class}} — {{protocol + target}}
52
+ └── {{Class}} — {{protocol + target}}
53
+
54
+ Cross-cutting
55
+ ├── {{ExceptionHandler}}
56
+ └── {{other cross-cutting concerns — cache, locks, filters}}
57
+ ```
58
+
59
+ ---
60
+
61
+ ## 4. {{PRIMARY_DOMAIN_CONCEPT}} Lifecycle
62
+
63
+ <!-- FILL IN or REMOVE: include only if service manages a domain entity with state transitions. -->
64
+
65
+ ### State machine
66
+
67
+ ```
68
+ {{ASCII_STATE_MACHINE}}
69
+ ```
70
+
71
+ ### Key invariants
72
+
73
+ {{KEY_INVARIANTS — correctness guarantees that must always hold}}
74
+
75
+ ---
76
+
77
+ ## 5. Database Schema
78
+
79
+ <!-- FILL IN or REMOVE: include only if service owns a database. -->
80
+
81
+ Schema: `{{DB_SCHEMA_NAME}}`
82
+ Migration tool: {{MIGRATION_TOOL}}
83
+
84
+ ```
85
+ {{TABLE_DEFINITIONS — from migration files}}
86
+ ```
87
+
88
+ {{SCHEMA_DESIGN_NOTES — non-obvious decisions: state split, CASCADE, idempotency}}
89
+
90
+ ---
91
+
92
+ ## 6. Messaging Topology
93
+
94
+ <!-- FILL IN or REMOVE: include only if service produces or consumes async messages. -->
95
+
96
+ | Topic / Queue | Direction | Producer | Consumer | Purpose |
97
+ |---------------|-----------|----------|----------|---------|
98
+ | `{{name}}` | Outbound | `{{Class}}` | {{downstream}} | {{purpose}} |
99
+ | `{{name}}` | Inbound | {{upstream}} | `{{Class}}` | {{purpose}} |
100
+
101
+ {{MESSAGING_DESIGN_NOTES — outbox pattern, partition strategy, delivery guarantees}}
102
+
103
+ ---
104
+
105
+ ## 7. Scheduling Subsystem
106
+
107
+ <!-- FILL IN or REMOVE: include only if service has scheduled tasks. -->
108
+
109
+ | Scheduler | Schedule | Lock name | Purpose |
110
+ |-----------|----------|-----------|---------|
111
+ | `{{Class}}` | {{delay or cron}} | {{lock name or "none"}} | {{purpose}} |
112
+
113
+ {{SCHEDULING_NOTES — coordination mechanism, duplicate execution risk, timing dependencies}}
114
+
115
+ ---
116
+
117
+ ## 8. REST API Surface
118
+
119
+ <!-- FILL IN or REMOVE: include only if service exposes HTTP endpoints. -->
120
+
121
+ ### {{ControllerClass}} — `{{/api/v1/path}}`
122
+
123
+ | Method | Path | Purpose |
124
+ |--------|------|---------|
125
+ | {{POST/GET/etc.}} | `{{full path}}` | {{purpose}} |
126
+
127
+ Error response format: {{plain string / structured JSON / RFC 7807}}.
128
+ Exception mapping: centralised in `{{ExceptionHandlerClass}}`.
129
+ Status codes in use: {{list}}.
130
+
131
+ ---
132
+
133
+ ## 9. Key Design Decisions
134
+
135
+ <!-- FILL IN or REMOVE: only when this repo chose against the common pattern and an agent would produce wrong code by default. Remove section if zero entries. -->
136
+
137
+ ### Why {{decision}} instead of {{alternative}}?
138
+
139
+ {{EXPLANATION}}
140
+
141
+ ---
142
+
143
+ ## 10. Deployment Context
144
+
145
+ {{DEPLOYMENT_MECHANISM}}
146
+ {{DEPLOYMENT_CONFIG_LOCATION}}
147
+
148
+ Image/artefact build: {{Jib / Docker / AMI / other}}.
149
+ <!-- FILL IN or REMOVE: include only if service uses a container registry -->
150
+ Registry: {{URL}}, image: {{name}}.
151
+
152
+ For generation involving environment config, service URLs, or infrastructure values: engineer must paste config. Do not guess.