@groupby/ai-dev 0.5.13 → 0.5.15

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 (32) hide show
  1. package/package.json +1 -1
  2. package/teams/brain-studio/skills/arch-context/SKILL.md +135 -0
  3. package/teams/brain-studio/skills/draft-plan/SKILL.md +222 -0
  4. package/teams/brain-studio/skills/draft-pr/SKILL.md +291 -0
  5. package/teams/brain-studio/skills/git-context/SKILL.md +159 -0
  6. package/teams/brain-studio/skills/html/SKILL.md +233 -0
  7. package/teams/brain-studio/skills/javascript/SKILL.md +680 -0
  8. package/teams/brain-studio/skills/jira-context/SKILL.md +113 -0
  9. package/teams/brain-studio/skills/jira-spec/SKILL.md +247 -0
  10. package/teams/brain-studio/skills/pr-review/SKILL.md +310 -0
  11. package/teams/brain-studio/skills/react/SKILL.md +282 -0
  12. package/teams/brain-studio/skills/styled-components/SKILL.md +336 -0
  13. package/teams/brain-studio/skills/tdd-implement/SKILL.md +278 -0
  14. package/teams/brain-studio/skills/typescript/SKILL.md +491 -0
  15. package/teams/fhr-andromeda/github/PULL_REQUEST_TEMPLATE.md +51 -0
  16. package/teams/fhr-andromeda/github/copilot-instructions.md +47 -0
  17. package/teams/fhr-andromeda/instructions/CLAUDE.md +66 -0
  18. package/teams/fhr-andromeda/instructions/ai-instructions.md +312 -0
  19. package/teams/fhr-andromeda/instructions/architecture.md +181 -0
  20. package/teams/fhr-andromeda/instructions/code-review.md +127 -0
  21. package/teams/fhr-andromeda/instructions/coding-guidelines.md +139 -0
  22. package/teams/fhr-andromeda/instructions/domain.md +125 -0
  23. package/teams/fhr-andromeda/instructions/jira-ticket-template.md +55 -0
  24. package/teams/fhr-andromeda/instructions/modules/data-quality-frontend.md +57 -0
  25. package/teams/fhr-andromeda/instructions/modules/data-quality.md +62 -0
  26. package/teams/fhr-andromeda/instructions/modules/fhr-custom-transforms.md +59 -0
  27. package/teams/fhr-andromeda/instructions/modules/hop-dev-platform-frontend.md +60 -0
  28. package/teams/fhr-andromeda/instructions/modules/hop-dev-platform.md +62 -0
  29. package/teams/fhr-andromeda/instructions/modules/workflow-scripts.md +119 -0
  30. package/teams/fhr-andromeda/skills/fhr-pr/SKILL.md +71 -0
  31. package/teams/fhr-andromeda/skills/fhr-review/SKILL.md +78 -0
  32. package/teams/fhr-andromeda/skills/fhr-spec/SKILL.md +96 -0
@@ -0,0 +1,119 @@
1
+ # CLAUDE.md - workflow-scripts
2
+
3
+ **Agent type:** `Python Dev - workflow-scripts`
4
+
5
+ This file owns module-specific context for Python workflow-step logic. Read it after the root
6
+ harness files. Inspect current source for exact scripts, utilities, and Docker layout.
7
+
8
+ ---
9
+
10
+ ## What This Module Is
11
+
12
+ `workflow-scripts` contains Python code executed by Argo workflow steps. Scripts prepare ETL
13
+ jobs, coordinate runtime execution, move data, publish results, report metrics, and integrate
14
+ with DQSys.
15
+
16
+ Workflow definitions and cluster templates are in `andromeda-argo-deployments`.
17
+
18
+ ---
19
+
20
+ ## Architecture Constraints
21
+
22
+ - Each script must have one responsibility and behave as a workflow-step entrypoint.
23
+ - Configuration comes from environment variables or from `hop_job_config` via
24
+ `apply_hop_job_config()` from `arg_utils.py`.
25
+ - Logging must use `logger_config.py`; never use `print()` in production code.
26
+ - Argument parsing must use `arg_utils.py`; never parse raw command-line arguments directly.
27
+ - Scripts that receive `hop_job_config` must call `apply_hop_job_config()` to merge its fields
28
+ onto the argument namespace — they do not re-derive identity, paths, or config from scratch.
29
+ - Fatal failures must be explicit, logged with `exc_info=True`, and exit non-zero.
30
+ - Scripts must not silently skip external-system failures.
31
+ - Do not encode workflow-template assumptions that belong in `andromeda-argo-deployments`.
32
+
33
+ ### Mandatory Script Structure
34
+
35
+ ```python
36
+ # imports
37
+ # logger = setup_logging(...)
38
+ # constants
39
+ # helper functions
40
+ def main() -> None: ...
41
+ if __name__ == "__main__":
42
+ try:
43
+ main()
44
+ except Exception:
45
+ logger.error("Fatal error", exc_info=True)
46
+ sys.exit(1)
47
+ ```
48
+
49
+ ---
50
+
51
+ ## Shared Utilities
52
+
53
+ All scripts use these utilities from the same directory:
54
+
55
+ | Utility | Purpose |
56
+ |---|---|
57
+ | `arg_utils.py` | CLI argument parsing and `apply_hop_job_config()` |
58
+ | `logger_config.py` | Structured logger setup |
59
+ | `db_utils.py` | Database connections, DQ data models, credential helpers |
60
+ | `directory_utils.py` | S3 path and local directory helpers |
61
+ | `file_utils.py` | File I/O helpers |
62
+
63
+ ---
64
+
65
+ ## Integration Boundaries
66
+
67
+ This module integrates with:
68
+
69
+ - S3 for ETL inputs, outputs, and status artefacts;
70
+ - Kafka for completion signals and streaming dispatch;
71
+ - Kubernetes for runtime orchestration;
72
+ - `data-quality` REST API (`dq_execution.py`, `dq_custom_checks.py`);
73
+ - DQSys PostgreSQL database (`populate_dashboard.py`, `update_etl_dashboard.py`);
74
+ - `custom-etl` GitHub repository (`deploy_custom_etl_package.py`).
75
+
76
+ When changing script arguments, environment variables, API payloads, or output artefacts,
77
+ identify workflow-template and consumer impact explicitly.
78
+
79
+ ---
80
+
81
+ ## Testing Expectations
82
+
83
+ - Tests live in `src/test/python/test_<script_name>.py`.
84
+ - Mock all external systems (S3, Kafka, Kubernetes, PostgreSQL); no real connections in tests.
85
+ - Cover required configuration validation, happy path, external failures, and exit behaviour.
86
+ - New scripts need tests for argument/env validation and fatal-error handling.
87
+
88
+ ---
89
+
90
+ ### Grafana dashboard dependency
91
+
92
+ `realtime_metrics_daemon.py` and `metrics_exporter.py` push `argo_etl_*` metrics to the
93
+ Prometheus Pushgateway. These metrics are consumed by the Grafana ETL dashboard defined in the
94
+ **`andromeda-argo-deployments`** repo:
95
+
96
+ ```
97
+ misc/attraqt-grafana-dashboards/fms-dev/etl2-overview-dashboard.yaml
98
+ ```
99
+
100
+ **Any change to a metric name, label key, label value, or aggregation in either script must be
101
+ accompanied by a corresponding update to that dashboard in the same cross-repo set of PRs.**
102
+ Specifically check:
103
+ - PromQL `expr` lines that filter on `step_name=`, `workflow_suffix=`, or use `max by (...)` on
104
+ label dimensions you have changed.
105
+ - `legendFormat` strings referencing those labels.
106
+ - Column-visibility settings (`"<label>": true/false`) in table panels.
107
+ - Template variables whose `query` or `options` reference label values that have changed.
108
+
109
+ ---
110
+ ## Context to Confirm When Needed
111
+
112
+ Stop and ask, or inspect current source, when a task depends on:
113
+
114
+ - exact environment variable names;
115
+ - S3 bucket or key conventions;
116
+ - Kafka topic conventions;
117
+ - workflow-step input/output contracts;
118
+ - `data-quality` API or database contracts;
119
+ - Docker image ownership for a script.
@@ -0,0 +1,71 @@
1
+ ---
2
+ name: fhr-pr
3
+ description: Generate a filled PR description for any branch in the fhr-apache-hop repository using the project's PULL_REQUEST_TEMPLATE.md and AI harness context.
4
+ ---
5
+
6
+ # fhr-pr — Generate PR Description
7
+
8
+ Generate a filled PR description for any branch in the fhr-apache-hop repository using the project's PULL_REQUEST_TEMPLATE.md and AI harness context.
9
+
10
+ ## When to invoke
11
+
12
+ When the user says "write a PR", "create a PR description", "fill in the PR template", or similar, and they are working in the fhr-apache-hop repo.
13
+
14
+ ## Instructions
15
+
16
+ ### Step 1 — Gather context
17
+
18
+ Read the following in order:
19
+ 1. `.github/PULL_REQUEST_TEMPLATE.md` — the template to fill
20
+ 2. `CLAUDE.md` (root) — to understand the repo and module map
21
+ 3. `.ai/ai-instructions.md` — for TDD phase definitions referenced in the template
22
+
23
+ Then collect the changes to describe:
24
+ - Run `git log origin/master..HEAD --oneline` to list commits on the branch
25
+ - Run `git diff origin/master --stat` to list changed files with their modules
26
+ - Read each changed file (or its diff via `git diff origin/master -- <file>`) to understand what changed and why
27
+
28
+ If a Jira ticket ID is mentioned by the user or visible in the branch name (`git rev-parse --abbrev-ref HEAD`), extract it.
29
+
30
+ ### Step 2 — Determine agent types
31
+
32
+ From the changed file paths, identify which modules are in scope and look up the agent type from the relevant module `CLAUDE.md` header. Modules and their agent types:
33
+ - `hop-dev-platform/` → `Java Dev - hop-dev-platform`
34
+ - `hop-dev-platform-frontend/` → `Angular Dev - hop-dev-platform-frontend`
35
+ - `data-quality/` → `Java Dev - data-quality`
36
+ - `data-quality-frontend/` → `Angular Dev - data-quality-frontend`
37
+ - `workflow-scripts/` → `Python Dev - workflow-scripts`
38
+ - `fhr-custom-transforms/` → `Java Dev - fhr-custom-transforms`
39
+
40
+ ### Step 3 — Fill the template
41
+
42
+ Fill every section of `.github/PULL_REQUEST_TEMPLATE.md`:
43
+
44
+ **AI Generation Info**
45
+ - Jira ticket: extract from branch name (e.g. `FHR-1234-...`) or ask the user
46
+ - Agent type: from Step 2 — list all modules in scope
47
+ - AI tool: `Claude (claude-sonnet-4-6)`
48
+ - Spec referenced: Jira ticket title if known, otherwise "inline"
49
+
50
+ **TDD Summary**
51
+ - Tests written first: answer honestly based on what you observe (test files vs production file commit order)
52
+ - Test files: list all `*.spec.ts`, `*Test.java`, `*Spec.groovy`, `test_*.py` files changed
53
+ - Production files: all other changed source files
54
+
55
+ **What was generated**
56
+ Write one concise paragraph or bullet group per logical change area. Group by module. Each entry should say what changed and why (the user-visible outcome or bug fixed), not just which file was touched.
57
+
58
+ **What was reviewed / changed after generation**
59
+ Note any manual corrections, edge-case decisions, or departures from the generated output. If nothing was changed post-generation, write: "None — generated output accepted as-is"
60
+
61
+ **Review notes**
62
+ Flag anything that warrants careful human review: async error paths that are fire-and-forget, schema migrations, security surface changes, cross-repo impact, S3/Kafka contracts. If none, write: "None identified"
63
+
64
+ **Checklist**
65
+ Check each item based on what you observed. Leave unchecked items that the user must verify locally (build success, TDD order).
66
+
67
+ ### Step 4 — Save and present
68
+
69
+ Write the filled description to `<TICKET-ID>-pr.md` in the repo root (e.g. `FHR-7204-pr.md`). If no ticket ID is known, use `pr-description.md`.
70
+
71
+ Present the file to the user.
@@ -0,0 +1,78 @@
1
+ ---
2
+ name: fhr-review
3
+ description: Review changed files on the current branch against the project's code-review checklist, producing a structured list of BLOCK, WARN, and NOTE findings.
4
+ ---
5
+
6
+ # fhr-review — Code Review Against Project Checklist
7
+
8
+ Review changed files on the current branch against the project's `.ai/code-review.md` checklist, producing a structured list of BLOCK, WARN, and NOTE findings.
9
+
10
+ ## When to invoke
11
+
12
+ When the user says "review this", "review the changes", "run a code review", or asks for a checklist-based review of what's on the branch.
13
+
14
+ ## Instructions
15
+
16
+ ### Step 1 — Read the review criteria
17
+
18
+ Read in order:
19
+ 1. `.ai/code-review.md` — the checklist with BLOCK/WARN/NOTE severity rules
20
+ 2. `CLAUDE.md` (root) — module map, to route module-specific checks
21
+ 3. The relevant module `CLAUDE.md` for each changed module — for module-specific constraints
22
+
23
+ ### Step 2 — Collect the diff
24
+
25
+ Run `git diff origin/master --stat` to identify changed files and their modules.
26
+
27
+ For each changed file, read it fully (or use `git diff origin/master -- <file>` for the diff). Group files by module.
28
+
29
+ ### Step 3 — Apply the checklist
30
+
31
+ Work through `.ai/code-review.md` section by section. Apply:
32
+ - **Universal BLOCK checks** to every file
33
+ - **Universal WARN checks** to every file
34
+ - **Java checks** (and module-specific sub-checks) for Java files
35
+ - **Python checks** for Python files
36
+ - **Angular checks** for TypeScript/HTML/SCSS files in frontend modules
37
+ - **Database and migration checks** for any SQL or migration files
38
+ - **Cross-module impact checks** for any API, schema, or contract changes
39
+
40
+ For each finding, produce one entry in the format:
41
+
42
+ ```
43
+ [BLOCK|WARN|NOTE] <file>:<line-range>
44
+ <what the finding is>
45
+ <why it matters>
46
+ <concise recommendation>
47
+ ```
48
+
49
+ If a section has no findings, write `✓ <section name> — no issues`.
50
+
51
+ ### Step 4 — Summarise
52
+
53
+ After all findings, output a summary block:
54
+
55
+ ```
56
+ ## Summary
57
+ BLOCK: <n> WARN: <n> NOTE: <n>
58
+
59
+ <One sentence on the overall state — e.g. "Ready to merge after BLOCK items are resolved" or "No blocking issues; WARN items are recommended before merge.">
60
+ ```
61
+
62
+ ### Step 5 — Cross-module impact
63
+
64
+ Explicitly state whether any changes affect:
65
+ - Backend API consumers (frontend models, workflow scripts)
66
+ - `data-quality` REST API (check `dq_execution.py`, `dq_custom_checks.py`, `populate_dashboard.py` in `workflow-scripts`)
67
+ - Database schema consumed outside one module
68
+ - `andromeda-argo-deployments` (workflow templates, Argo config)
69
+
70
+ If cross-module impact exists and is not tracked in the PR or a linked ticket, raise it as a **WARN**.
71
+
72
+ ### Notes on severity
73
+
74
+ - **BLOCK** — must be fixed before merge. Do not soften a BLOCK to a WARN to be polite.
75
+ - **WARN** — should be fixed; flag clearly even if the reviewer may choose to defer.
76
+ - **NOTE** — optional suggestion. Keep these brief; do not pad the review with trivial notes.
77
+
78
+ If there are zero BLOCKs and zero WARNs, say so explicitly — a clean review is useful information.
@@ -0,0 +1,96 @@
1
+ ---
2
+ name: fhr-spec
3
+ description: Turn a Jira ticket into a structured AI Spec following the format defined in the project harness, ready for an AI coding agent to implement.
4
+ ---
5
+
6
+ # fhr-spec — Generate AI Spec from Jira Ticket
7
+
8
+ Turn a Jira ticket into a structured AI Spec following the format defined in `.ai/ai-instructions.md §11`, ready for an AI coding agent to implement.
9
+
10
+ ## When to invoke
11
+
12
+ When the user says "generate a spec", "write an AI spec", "spec out this ticket", or pastes a Jira ticket ID or description and wants it turned into an implementation-ready spec.
13
+
14
+ ## Instructions
15
+
16
+ ### Step 1 — Read the harness
17
+
18
+ Read in order:
19
+ 1. `CLAUDE.md` (root) — repo map and module ownership
20
+ 2. `.ai/architecture.md` — system boundaries and constraints
21
+ 3. `.ai/domain.md` — business vocabulary
22
+ 4. `.ai/coding-guidelines.md` — implementation rules
23
+ 5. `.ai/jira-ticket-template.md` — the expected ticket format
24
+
25
+ ### Step 2 — Ingest the ticket
26
+
27
+ If the user provided a Jira ticket ID and the Jira MCP is available, fetch it with `getJiraIssue`. Otherwise, read whatever the user pasted.
28
+
29
+ Extract:
30
+ - Title and ticket ID
31
+ - Module (from the ticket's **Module** field or infer from description)
32
+ - Agent type (from the relevant module `CLAUDE.md` header)
33
+ - What to build (objective)
34
+ - Requirements (given/when/then items)
35
+ - Do Not Touch constraints
36
+ - Acceptance criteria
37
+ - Extra context
38
+
39
+ ### Step 3 — Identify gaps
40
+
41
+ Before writing the spec, check whether the ticket has enough information to produce concrete, testable requirements. Common gaps:
42
+ - Missing field names, endpoint paths, or status codes
43
+ - Ambiguous acceptance criteria that cannot become a unit test
44
+ - Unclear module scope (which module owns the change)
45
+ - Cross-repo impact not declared (does `andromeda-argo-deployments` need to change?)
46
+ - New dependency or framework required
47
+
48
+ If critical gaps exist, ask the user to fill them before continuing. Keep questions batched and specific.
49
+
50
+ ### Step 4 — Write the AI Spec
51
+
52
+ Produce the spec in the canonical format from `.ai/ai-instructions.md`:
53
+
54
+ ```markdown
55
+ ## AI Spec
56
+
57
+ **Ticket**: <id> **Module**: <module> **Agent**: <type>
58
+
59
+ ### Objective
60
+ One or two sentences — what this achieves and why.
61
+
62
+ ### Out of Scope
63
+ - <item>
64
+
65
+ ### Functional Requirements
66
+ 1. Given … when … then …
67
+ 2. Given … when … then … (include error paths and edge cases)
68
+
69
+ ### Technical Constraints
70
+ - Architecture pattern (e.g. synchronous Spring MVC, reactive WebFlux, standalone Angular component)
71
+ - Security requirements (e.g. endpoint must be behind existing OAuth2 filter chain)
72
+ - Cross-repo impact (e.g. `andromeda-argo-deployments` needs a matching PR — yes/no)
73
+ - New dependencies: none | <name + approval required>
74
+
75
+ ### Acceptance Criteria
76
+ - [ ] Given … when … then …
77
+ - [ ] All existing tests pass.
78
+ - [ ] BUILD SUCCESS confirmed locally.
79
+ - [ ] No TODO, FIXME, placeholder comments, or commented-out code.
80
+ ```
81
+
82
+ Rules when writing requirements:
83
+ - Every requirement must be testable — if it can't become a `given/when/then` unit test, rewrite it until it can
84
+ - Include at least one error/edge-case requirement per feature area
85
+ - Use exact field names, endpoint paths, and status codes from the ticket or source code
86
+ - Do not invent technical implementation details — describe observable behaviour only
87
+
88
+ ### Step 5 — Present and optionally post to Jira
89
+
90
+ Present the spec to the user in the conversation.
91
+
92
+ If the Jira MCP is available and the user confirms, append the spec to the Jira ticket description using `editJiraIssue` (append only — do not overwrite the original description).
93
+
94
+ End the spec with:
95
+
96
+ > **Awaiting spec approval.** Reply with `APPROVED`, `lgtm`, or `proceed` to begin implementation.