@groupby/ai-dev 0.5.15 → 0.5.16

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.
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.16",
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.
@@ -0,0 +1,320 @@
1
+ # Coding Guidelines — {{SERVICE_NAME}}
2
+
3
+ *Last updated: {{DATE}}*
4
+ *Owner: {{TEAM_NAME}}*
5
+
6
+ ---
7
+
8
+ ## §1 Project Structure
9
+
10
+ ### Convention: Package layout follows strict layer boundaries
11
+
12
+ The root package is `{{ROOT_PACKAGE}}`. Every class lives in exactly one named sub-package that matches its architectural role. {{REMOTE_INTEGRATION_PACKAGE_NOTE — FILL IN: describe how integrations are grouped, e.g. "Remote integrations are grouped under `remote/{integration-name}`" or remove if not applicable}}.
13
+
14
+ ---
15
+
16
+ ### Convention: Class naming encodes layer and purpose
17
+
18
+ <!-- FILL IN: scan src/main/java/{{ROOT_PACKAGE}}/ and extract the actual naming patterns present in this repo.
19
+ Add one row per layer found. Remove layers that do not exist in this codebase. -->
20
+
21
+ | Layer | Pattern | Examples |
22
+ |-------|---------|---------|
23
+ | {{layer}} | `{{NamingPattern}}` | {{ActualClassExamples}} |
24
+
25
+ ---
26
+
27
+ ## §2 Spring Boot Patterns
28
+
29
+ <!-- FILL IN or REMOVE: only if repo uses Spring Boot. If not, replace with the equivalent framework's conventions or remove. -->
30
+
31
+ ### Convention: `@Bean` in `@Configuration` classes for all infrastructure beans
32
+
33
+ Beans that require parameters, conditionals, or custom construction are declared as `@Bean` methods inside a `@Configuration` class. No infrastructure bean is created via `@Component` constructor alone.
34
+
35
+ ---
36
+
37
+ ### Convention: `@Service` / `@Component` for business-logic beans
38
+
39
+ Service classes and standalone components (not requiring conditional creation) use stereotype annotations directly. Always paired with `@RequiredArgsConstructor`.
40
+
41
+ ---
42
+
43
+ ### Convention: Runtime bean switching
44
+
45
+ {{BEAN_SWITCHING_NOTE}}
46
+
47
+ ---
48
+
49
+ ### Convention: All custom properties injected with `@Value` and a default
50
+
51
+ Properties are always injected with `@Value("${...}")`. Every optional property includes a colon-separated default value. {{CONFIGURATION_PROPERTIES_NOTE}}.
52
+
53
+ ---
54
+
55
+ ### Convention: Custom property namespace is `{{PROPERTY_PREFIX}}.*`
56
+
57
+ All application-specific properties are nested under the `{{PROPERTY_PREFIX}}` prefix in `application.yaml`. Spring-managed namespaces (`spring.*`, `management.*`) are used unmodified.
58
+
59
+ ---
60
+
61
+ ### Convention: Spring profile usage
62
+
63
+ {{PROFILE_NOTE}}
64
+
65
+ ---
66
+
67
+ ## §3 Error Handling
68
+
69
+ <!-- FILL IN or REMOVE: only if service exposes HTTP endpoints. -->
70
+
71
+ ### Convention: Custom exception hierarchy
72
+
73
+ {{EXCEPTION_HIERARCHY_NOTE}}
74
+
75
+ ---
76
+
77
+ ### Convention: All HTTP error mapping is centralised in a single `@ControllerAdvice` class
78
+
79
+ There is a single `@ControllerAdvice` class (`{{EXCEPTION_HANDLER_CLASS}}`). Services throw unchecked exceptions; they do not produce `ResponseEntity` or set HTTP status codes. Error mapping happens only in `{{EXCEPTION_HANDLER_CLASS}}`.
80
+
81
+ ---
82
+
83
+ ### Convention: Error response body format
84
+
85
+ {{ERROR_RESPONSE_FORMAT}}
86
+
87
+ ---
88
+
89
+ ### Convention: Exception handler logging
90
+
91
+ {{EXCEPTION_HANDLER_LOGGING_NOTE}}
92
+
93
+ ---
94
+
95
+ ## §4 Logging
96
+
97
+ ### Convention: Logger declaration
98
+
99
+ {{LOGGER_DECLARATION_NOTE}}
100
+
101
+ ---
102
+
103
+ ### Convention: Log levels
104
+
105
+ {{LOG_LEVEL_CONVENTIONS}}
106
+
107
+ ---
108
+
109
+ ### Convention: MDC usage
110
+
111
+ {{MDC_NOTE}}
112
+
113
+ ---
114
+
115
+ ## §5 Testing
116
+
117
+ ### Convention: Test approach
118
+
119
+ {{TEST_APPROACH_NOTE}}
120
+
121
+ ---
122
+
123
+ ### Convention: Test infrastructure
124
+
125
+ {{TEST_INFRA_NOTE}}
126
+
127
+ ---
128
+
129
+ ### Convention: Test infrastructure wiring
130
+
131
+ {{TEST_WIRING_NOTE}}
132
+
133
+ ---
134
+
135
+ ### Convention: Test interaction style
136
+
137
+ {{TEST_INTERACTION_NOTE}}
138
+
139
+ ---
140
+
141
+ <!-- FILL IN or REMOVE: include BDD sub-section only if a BDD framework is detected. -->
142
+
143
+ ### BDD Conventions ({{FRAMEWORK_NAME}})
144
+
145
+ {{BDD_CONVENTIONS — document stage/step patterns, naming, state sharing}}
146
+
147
+ ---
148
+
149
+ ## §6 API Layer
150
+
151
+ <!-- FILL IN or REMOVE: only if service exposes a REST API. -->
152
+
153
+ ### Convention: Controller return types
154
+
155
+ {{CONTROLLER_RETURN_NOTE}}
156
+
157
+ ---
158
+
159
+ ### Convention: Base URL path pattern
160
+
161
+ {{BASE_URL_PATTERN}}
162
+
163
+ ---
164
+
165
+ ### Convention: Request validation approach
166
+
167
+ {{VALIDATION_NOTE}}
168
+
169
+ ---
170
+
171
+ ### Convention: Model / DTO class construction
172
+
173
+ {{DTO_CONSTRUCTION_NOTE}}
174
+
175
+ ---
176
+
177
+ ## §7 Data Access
178
+
179
+ <!-- FILL IN or REMOVE: only if service owns or accesses a database. -->
180
+
181
+ ### Convention: Data access approach
182
+
183
+ {{DATA_ACCESS_NOTE}}
184
+
185
+ ---
186
+
187
+ ### Convention: SQL / query storage
188
+
189
+ <!-- FILL IN or REMOVE: include only if the service uses raw SQL. -->
190
+
191
+ {{SQL_STORAGE_NOTE — describe where queries live, e.g. "Simple queries are inline `private static final String` constants. Complex queries live in external `.sql` files under `src/main/resources/` loaded via `{{SQL_LOADER_CLASS}}`."}}
192
+
193
+ ---
194
+
195
+ ### Convention: Transactions
196
+
197
+ <!-- FILL IN or REMOVE: include only if the service owns a database. -->
198
+
199
+ {{TRANSACTION_NOTE}}
200
+
201
+ ---
202
+
203
+ ## §8 Inter-Service Communication
204
+
205
+ <!-- FILL IN or REMOVE: include only if service communicates with other services. -->
206
+
207
+ ### Convention: Outbound HTTP client
208
+
209
+ <!-- FILL IN or REMOVE: include only if service makes outbound HTTP calls. -->
210
+
211
+ {{OUTBOUND_HTTP_NOTE}}
212
+
213
+ ---
214
+
215
+ ### Convention: Async messaging
216
+
217
+ <!-- FILL IN or REMOVE: include only if service produces or consumes async messages. -->
218
+
219
+ {{ASYNC_MESSAGING_NOTE — describe producer pattern, consumer pattern, error handling, topic naming.}}
220
+
221
+ ---
222
+
223
+ ## §9 Secret Management
224
+
225
+ ### Convention: No secrets in source code or config files
226
+
227
+ `application.yaml` (or equivalent) contains only local development defaults. Production values are injected at runtime.
228
+
229
+ {{RUNTIME_SECRET_INJECTION_NOTE — FILL IN from repo scan + engineer confirmation: describe how runtime secrets are injected, e.g. "Kubernetes secret mounts", "AWS Secrets Manager", "environment variables set by the deployment pipeline".}}
230
+
231
+ ---
232
+
233
+ ### Convention: Build-time secret handling
234
+
235
+ <!-- FILL IN or REMOVE: include only if CI pipeline files exist in this repo. -->
236
+
237
+ {{BUILD_SECRET_NOTE}}
238
+
239
+ ---
240
+
241
+ ## §10 Dependency Management
242
+
243
+ ### Convention: Parent POM / BOM
244
+
245
+ {{PARENT_POM_NOTE}}
246
+
247
+ ---
248
+
249
+ ### Convention: Dependency version pinning
250
+
251
+ {{VERSION_PINNING_NOTE}}
252
+
253
+ ---
254
+
255
+ ### Convention: Image / artefact build
256
+
257
+ {{BUILD_TOOL_NOTE}}
258
+
259
+ ---
260
+
261
+ ## §11 CI / CD
262
+
263
+ <!-- FILL IN or REMOVE: include only if CI pipeline files exist in this repo. -->
264
+
265
+ ### Convention: CI tooling
266
+
267
+ {{CI_TOOL_NOTE}}
268
+
269
+ ---
270
+
271
+ ## §12 High-Risk Areas
272
+
273
+ AI may make changes anywhere in this repo. All code is reviewed before merge. The areas below are high-risk: the cost of a wrong change is high and not always visible to AI. For each, follow the specific rule and flag the change in the PR description. If a change is not clearly justified by the spec, stop and confirm with the engineer first.
274
+
275
+ ### High-Risk Area {{N}} — {{Name}}
276
+
277
+ **What:** {{specific files, packages, or patterns}}
278
+ **Why:** {{the failure mode if AI gets this wrong}}
279
+ **Rule:** {{specific constraint to follow}}
280
+
281
+ ---
282
+
283
+ ## Convention Gaps
284
+
285
+ <!-- FILL IN: document every inconsistency found during the codebase scan.
286
+ If no gaps exist, write "No convention gaps identified." and remove this comment.
287
+ Use the format below for each gap found. -->
288
+
289
+ {{CONVENTION_GAPS_OR_NONE — for each gap found, use this format:
290
+
291
+ ### Gap: <short description>
292
+
293
+ **Type:** Decision needed | AI hallucination risk | Intentional — needs documenting
294
+
295
+ **Description:** <what is inconsistent and where it appears>
296
+
297
+ **Examples of conflict:**
298
+ - `ClassA.method` — does X
299
+ - `ClassB.method` — does Y
300
+
301
+ **Jira ticket:** <link or leave blank>
302
+
303
+ ---
304
+ }}
305
+
306
+ ---
307
+
308
+ ## AI Usage Notes
309
+
310
+ **Patterns AI must always follow:**
311
+
312
+ {{GENERATE: one rule per confirmed convention — reference the section above}}
313
+
314
+ **Patterns AI must never use:**
315
+
316
+ {{GENERATE: one anti-pattern per confirmed absence or prohibition — state why (e.g. "not present in this codebase", "violates free zone", "contradicts convention in §X")}}
317
+
318
+ **Things that contradict common defaults or conventions:**
319
+
320
+ {{GENERATE: surprises a competent developer would not expect — things AI is likely to get wrong without being told explicitly}}
@@ -0,0 +1,55 @@
1
+ # Glossary — {{SERVICE_NAME}}
2
+
3
+ *Last updated: {{DATE}}*
4
+ *Owner: {{TEAM_NAME}}*
5
+
6
+ Domain terms used consistently in this service. Use these exact terms in code, specs, and documentation; do not introduce synonyms.
7
+
8
+ Only include terms where the meaning is specific to this service or where the code uses a different word than the business/product team. Generic terms ('microservice,' 'API') do not belong here.
9
+
10
+ ---
11
+
12
+ ## Core Concepts
13
+
14
+ **{{PrimaryDomainObject}}**
15
+ {{Definition: What it is, what it represents, who submits it, what happens to it.}}
16
+
17
+ **{{SecondaryDomainObject}}**
18
+ {{Definition.}}
19
+
20
+ **{{KeyIdentifier}}**
21
+ {{Definition: e.g. "A UUID assigned at creation time. Uniquely identifies a {{object}} across its full lifecycle."}}
22
+
23
+ <!-- Add more core concept entries as needed -->
24
+
25
+ <!-- OPTIONAL: If this service has a state machine or enum that constrains valid values:
26
+
27
+ ## {{Object}} States
28
+
29
+ | State | Meaning |
30
+ |-------|---------|
31
+ | `{{STATE}}` | {{when this state applies}} |
32
+
33
+ These are the ONLY valid states. Do not introduce new states without engineer confirmation. -->
34
+
35
+ ---
36
+
37
+ ## External Services
38
+
39
+ **{{ExternalServiceName}}**
40
+ {{What it is, what role it plays relative to this service, how this service calls it.}}
41
+
42
+ **{{ExternalServiceName}}** *(also known as: {{CodebaseName}})*
43
+ {{What it is. Note: code uses "{{CodebaseName}}" (e.g. package names, class names); the canonical domain name is "{{ExternalServiceName}}". Use the canonical name in new code and docs.}}
44
+
45
+ ---
46
+
47
+ ## Infrastructure Terms
48
+
49
+ <!-- Only include infrastructure terms that have domain-level significance — things that appear in specs, ADRs, or conversations with engineers, not just implementation details. -->
50
+
51
+ **{{InfrastructureTerm}}**
52
+ {{Definition: e.g. "The external_events_outbox table used to reliably publish status updates. Events are written transactionally alongside state changes and processed asynchronously."}}
53
+
54
+ **{{InfrastructureTerm}}**
55
+ {{Definition.}}
@@ -0,0 +1,59 @@
1
+ # harness-gap-log.md — {{SERVICE_NAME}}
2
+
3
+ *Last updated: {{DATE}}*
4
+ *Owner: {{TEAM_NAME}}*
5
+
6
+ ---
7
+
8
+ ## Purpose
9
+
10
+ Post-generation review found a problem rooted in a harness gap. Log it here with a workaround so the agent avoids repeating it.
11
+
12
+ Agent: check Active entries in the relevant area before generating. Apply the corrective action.
13
+
14
+ ---
15
+
16
+ ## Active Gaps
17
+
18
+ *Most recent first.*
19
+
20
+ <!-- ENTRY FORMAT:
21
+
22
+ ### {{YYYY-MM-DD}} — {{short description}}
23
+
24
+ **Area:** {{package, class, or concern area}}
25
+ **Exposed by:** {{spec or ticket where the problem surfaced}}
26
+ **What happened:** {{What did the generated code get wrong?}}
27
+ **Root cause:** {{Why did the harness fail to prevent this?}}
28
+ **Interim instruction:** {{What the agent must do differently until fixed permanently}}
29
+ **Fix required:** {{Which harness file needs what change}}
30
+ **Reached main?:** {{Yes / No}}
31
+ **Status:** Active
32
+ **Ticket:** {{link}}
33
+
34
+ Only log entries where:
35
+ - The root cause is a harness gap (not a spec error or random one-off)
36
+ - The interim instruction changes agent behaviour (if it doesn't, track in Jira only)
37
+
38
+ -->
39
+
40
+ *No active gaps.*
41
+
42
+ ---
43
+
44
+ ## Resolved Gaps
45
+
46
+ *Moved here once the harness fix is merged.*
47
+
48
+ <!-- ENTRY FORMAT:
49
+
50
+ ### {{YYYY-MM-DD}} — {{short description}}
51
+
52
+ **Area:** {{area}}
53
+ **What happened:** {{what the generated code got wrong}}
54
+ **Propagated to:** {{which harness file was updated to fix this permanently}}
55
+ **Status:** Closed
56
+
57
+ -->
58
+
59
+ *No resolved gaps.*
@@ -0,0 +1,123 @@
1
+ ---
2
+ name: use-case-writer
3
+ description: 'Produce a structured test plan from a PRD, spec file, Jira ticket, or plain description. Tags each test case by type (E2E / acceptance / contract / lint) so it can be handed directly to the matching writer skill. Use when: "write test cases for...", "plan the tests for...", "what tests do we need for...", "test plan for this feature".'
4
+ argument-hint: "Path to a PRD or spec (.md/.txt), a Jira key (FHR-XXXX), or a plain-English feature description"
5
+ user-invocable: true
6
+ allowed-tools: [Read, Grep, Glob, Bash, Write]
7
+ ---
8
+
9
+ # /use-case-writer — Test case planner for Titan services
10
+
11
+ Produces a test plan file (`test-plan-{slug}.md`) with test cases tagged by type.
12
+ Each test case maps directly to a writer skill:
13
+
14
+ | Tag | Writer skill |
15
+ |---|---|
16
+ | `[E2E]` | _dev-owned — no automated writer; author these manually in `titan-e2e-tests`_ |
17
+ | `[acceptance]` | `/acceptance-tests-writer` |
18
+ | `[contract]` | `/contract-tests-writer` |
19
+ | `[lint]` | `/lint-tests-writer` |
20
+
21
+ **Nothing is invented.** Test cases are derived from the input and verified against
22
+ the actual service code and docs. Ambiguous assertions go in the "open questions"
23
+ section — not into a test case.
24
+
25
+ ---
26
+
27
+ ## Step 0 — Detect input type
28
+
29
+ Check `$ARGUMENTS`:
30
+
31
+ - **File path ending in `.md` or `.txt`** → read it as a PRD or spec
32
+ - **`FHR-XXXX` pattern** → fetch the Jira ticket (if Atlassian MCP is connected) or ask the user to paste the description
33
+ - **Anything else** → treat as a plain-English description of the feature or change
34
+
35
+ If `$ARGUMENTS` is empty → ask: "Paste a PRD, a Jira ticket ID, or describe the feature."
36
+
37
+ ---
38
+
39
+ ## Step 1 — Read context sources
40
+
41
+ Read the relevant files for whichever services the feature touches:
42
+
43
+ ```
44
+ team-config.yaml # testing stack + repo list
45
+ titan-e2e-tests/docs/architecture.md # deployment topology
46
+ titan-e2e-tests/TESTING_GAPS.md # known gaps — don't plan tests that duplicate open gaps
47
+ ```
48
+
49
+ For `csp-apigateway`:
50
+ - `csp-apigateway/docs/` — existing specs/ADRs
51
+ - `csp-apigateway/apigateway-tests/src/test/java/.../tests/` — existing acceptance tests (don't plan duplicates)
52
+
53
+ For `csp-trigger-scheduler`:
54
+ - `csp-trigger-scheduler/src/test/java/.../integration/` — existing integration tests
55
+
56
+ For `fas-argo-deployment` / `titan-argo-deployment`:
57
+ - `charts/` — chart structure (for lint scope)
58
+
59
+ Only read what's relevant. Skip repos the feature doesn't touch.
60
+
61
+ ---
62
+
63
+ ## Step 2 — Extract functional requirements
64
+
65
+ From the input, list every distinct behaviour the feature introduces or changes:
66
+
67
+ - What does the system do (happy path)?
68
+ - What does it reject or handle differently (error / boundary cases)?
69
+ - What does it emit (Kafka messages, state changes)?
70
+ - What crosses a service boundary?
71
+ - What is deployed via Helm/Argo?
72
+
73
+ Group requirements by service boundary. Each requirement is a candidate test case.
74
+
75
+ ---
76
+
77
+ ## Step 3 — Assign test types
78
+
79
+ For each requirement, assign one type using these rules:
80
+
81
+ | Requirement type | Test type |
82
+ |---|---|
83
+ | Full flow across multiple services (apigw → scheduler → curator → Kafka) | `E2E` |
84
+ | Single service HTTP API behaviour in isolation | `acceptance` |
85
+ | Message schema / structure on a Kafka topic between two services | `contract` |
86
+ | Helm chart validity, template rendering, required fields | `lint` |
87
+ | Unit-level logic | *(skip — dev responsibility, out of QA AI scope)* |
88
+
89
+ A single feature may produce test cases of multiple types.
90
+
91
+ ---
92
+
93
+ ## Step 4 — Write the test plan
94
+
95
+ Create `titan-e2e-tests/docs/test-plan-{slug}.md` where `{slug}` is a kebab-case summary
96
+ of the feature (e.g. `test-plan-load-xml-e2e`, `test-plan-fas-healthcheck`).
97
+
98
+ Follow the structure in `skills/use-case-writer/TEMPLATE.md` — one entry per test case,
99
+ numbered sequentially and grouped by type (E2E → acceptance → contract → lint).
100
+
101
+ For each TC, populate the plain-English fields:
102
+
103
+ - **Why this matters:** one sentence naming what's at risk in production if this scenario fails. Derive from the ticket, the PRD, or the wording of the Expected outcome. If nothing in the input suggests a risk, write `TBD — engineer to fill` and note it in the Open questions table.
104
+ - **How this is verified:** one or two plain-English sentences translating the `**Assertion layer:**` value into what actually happens at runtime. Example: `Assertion layer: JGiven` → `The test sends a real HTTP request via the JGiven stages and asserts against the response and any Kafka messages produced.` Do not skip this field just because the assertion layer is obvious to a developer.
105
+
106
+ ---
107
+
108
+ ## Step 5 — Summarise open questions
109
+
110
+ Collect open questions in the bottom table of `TEMPLATE.md`. These must be resolved
111
+ before the corresponding writer skill is run.
112
+
113
+ ---
114
+
115
+ ## Step 6 — Present the output
116
+
117
+ Show:
118
+ 1. Path to the generated test plan file
119
+ 2. Summary table: test case count per type
120
+ 3. List of open questions
121
+ 4. Suggested next step: "Run `/{writer-skill} path/to/test-plan-{slug}.md` to generate code for each type."
122
+
123
+ Do not generate test code in this skill — that is the writer skills' job.
@@ -0,0 +1,39 @@
1
+ # Test plan: {Feature name}
2
+
3
+ ## Test cases
4
+
5
+ Number sequentially. Group by type: E2E first, then acceptance, then contract, then lint.
6
+
7
+ ## TC-{NNN} [{type}] {title}
8
+
9
+ **Service(s):** {comma-separated list}
10
+ **Jira:** {FHR-XXXX or n/a}
11
+
12
+ **Why this matters:** {one plain-English sentence — what's at risk in production if this scenario fails}
13
+
14
+ **Preconditions:**
15
+ - {what must be true before this test runs}
16
+
17
+ **Steps:**
18
+ 1. {action}
19
+ 2. {action}
20
+
21
+ **Expected outcome:**
22
+ - {observable result — HTTP status, Kafka message field, K8s state, etc.}
23
+
24
+ **How this is verified:** {plain-English description of the mechanism — example: "The test sends a real HTTP POST to the running apigateway, then checks the JSON body of the response and reads the message the service publishes to Kafka to confirm it matches the expected shape."}
25
+
26
+ **Assertion layer:** {RestAssured / JGiven / JSON Schema / helm lint}
27
+
28
+ **Writer skill:** `/{skill-name}`
29
+
30
+ **Open questions:**
31
+ - {anything that must be confirmed from the code before this can be implemented}
32
+
33
+ ---
34
+
35
+ ## Open questions
36
+
37
+ | # | Question | Blocks |
38
+ |---|---|---|
39
+ | 1 | {question} | TC-{NNN} |
@@ -0,0 +1,56 @@
1
+ ---
2
+ name: write-spec
3
+ description: Generate a complete implementation spec from a Jira ticket. Accepts a Jira key (e.g. FHR-1234) or a feature description. Fetches ticket details via Atlassian MCP, investigates the codebase, and produces a spec an AI coding agent can execute without further clarification. Outputs docs/specs/FHR-XXXX/SPEC.md. Run from the target service repo. Use when asked to write or generate a spec for a ticket or feature.
4
+ argument-hint: "Jira key (e.g. FHR-1234) or feature description"
5
+ user-invocable: true
6
+ ---
7
+
8
+ # /write-spec
9
+
10
+ Produces a clear, actionable spec that an AI coding agent can execute without further clarification. The output is the source of truth for plan generation.
11
+
12
+ ## Trigger
13
+
14
+ `/write-spec` followed by either:
15
+ - A JIRA ticket key (e.g. `FHR-1234`)
16
+ - A feature description
17
+ If missing, ask.
18
+
19
+ ## Input Resolution
20
+
21
+ 1. If a JIRA key is provided, attempt to fetch via MCP. If MCP is unavailable or fails, ask the user to paste the ticket content.
22
+ 2. Read `docs/specs/{JIRA-ID}/TICKET.md` if it exists.
23
+ 3. Read repository markdown files (architecture docs, glossary, coding guidelines) for context.
24
+ 4. Search codebase for components, tests, models, and contracts relevant to the feature.
25
+
26
+ ## Process
27
+
28
+ 1. **Gather context** - read the ticket, repository docs, and search the codebase for relevant files.
29
+ 2. **Clarify** unknowns before writing.
30
+ - Group related questions into a single message to minimize round-trips.
31
+ - Do not produce the spec until the user has explicitly answered all questions. A response about something else (e.g. "I don't see the file") is NOT permission to proceed — re-ask the questions.
32
+ - Never add assumptions in place of asking. If something is unknown, ask. Do not write the spec with assumptions documented inline.
33
+ - Never ask about information already present in the ticket or codebase.
34
+ - Only proceed without asking if the user explicitly says to (e.g. "proceed", "write what you have").
35
+ 3. **Write** the spec. Be concrete: exact file paths, method names, field names, types.
36
+ 4. **Validate** before presenting:
37
+ - Goal is concrete, not a placeholder.
38
+ - At least one G/W/T requirement exists.
39
+ - No unresolved unknowns remain.
40
+ 5. **Present** a short summary of what the spec covers and whether `/grill-with-docs` is recommended.
41
+
42
+ ## Output
43
+
44
+ - Template: `skills/write-spec/TEMPLATE.md`
45
+ - Write to: `docs/specs/{JIRA-ID}/SPEC.md`
46
+
47
+ ## Rules
48
+
49
+ - Use exactly the section names from the template.
50
+ - Requirements use Given/When/Then format. Edge cases are inline with the requirement they belong to.
51
+ - Context table lists key files with their roles (Read / Modify / Create), up to 8.
52
+ - Technical constraints are derived from the ticket and codebase, not invented.
53
+ - Omit sections that don't apply.
54
+ - NFRs cover performance, observability, and security — omit if none apply.
55
+ - Use only terms from the repository glossary if one exists.
56
+ - Write the spec to the output file; confirm only the file path.
@@ -0,0 +1,29 @@
1
+ # {JIRA-ID}: {Title}
2
+
3
+ ## Goal
4
+
5
+ {One or two sentences. What does this change achieve and why.}
6
+
7
+ ## Context
8
+
9
+ | Reference | Role |
10
+ |-----------|------|
11
+ | `path/to/file` | Read / Modify / Create |
12
+
13
+ ## Requirements
14
+
15
+ ### FR-1: {Name}
16
+
17
+ **Given** ...
18
+ **When** ...
19
+ **Then** ...
20
+
21
+ **Edge case:** ...
22
+
23
+ ### NFR-1: {Name}
24
+
25
+ {Description.}
26
+
27
+ ## Technical Constraints
28
+
29
+ {Constraints relevant to this feature, derived from the ticket and codebase.}