Skip to content

Commit f0d65b0

Browse files
committed
chore: update agent docs, add commit conventions, and exclude .goat-flow from git" -m "- Add .github/git-commit-instructions.md with conventional commit rules
- Add .goat-flow/ to .gitignore (internal tooling workspace, not for VCS) - Overhaul AGENTS.md and CLAUDE.md with accurate component list, MCP tool guidance, and goat-flow router table - Align match arm default cases in TokenType, FHIRPathSpecificationTest, FHIRIGGeneratorCommand, and FHIRPrimitiveTypeNormalizer
1 parent 72eecb9 commit f0d65b0

8 files changed

Lines changed: 230 additions & 179 deletions

File tree

.github/git-commit-instructions.md

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
# Commit Conventions
2+
3+
## Format
4+
5+
```
6+
<type>(<scope>): <subject>
7+
8+
[optional body]
9+
10+
[optional footer]
11+
```
12+
13+
## Types
14+
15+
| Type | When to use |
16+
|------|-------------|
17+
| `feat` | New feature or user-visible capability |
18+
| `fix` | Bug fix |
19+
| `chore` | Build scripts, dependencies, tooling, CI |
20+
| `test` | Adding or updating tests |
21+
| `docs` | Documentation only |
22+
| `refactor` | Code restructure with no behaviour change |
23+
24+
## Rules
25+
26+
- **Subject line:** ≤ 72 characters, imperative mood ("add support for X", not "added"), no trailing period
27+
- **Scope:** optional, names the component affected (e.g. `serialization`, `codegen`, `fhirpath`)
28+
- **Body:** explain *why*, not *what*; wrap at 72 characters
29+
- **No AI mentions:** do not reference AI tools, Claude, or AI assistance in commit messages or PR descriptions
30+
- **GPG-sign** commits when possible (`git commit -S`)
31+
- **No `--no-verify`** — pre-commit hooks must pass; fix the underlying issue instead
32+
33+
## Examples
34+
35+
```
36+
feat(serialization): add strict validation mode to JSON deserializer
37+
38+
fix(fhirpath): handle empty collection in where() function
39+
40+
chore: upgrade phpstan to 2.x
41+
42+
test(codegen): add coverage for profile inheritance resolution
43+
```

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ Thumbs.db
99
# Internal tool configs
1010
.kiro/
1111
.claude/
12+
.goat-flow/
1213

1314
###> symfony/framework-bundle ###
1415
/config/secrets/prod/prod.decrypt.private.php

AGENTS.md

Lines changed: 77 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -32,9 +32,14 @@
3232

3333
### Components
3434

35-
- **FHIRBundle** (`ardenexal/fhir-bundle`): Symfony Bundle for seamless integration
36-
- **CodeGeneration** (`ardenexal/fhir-code-generation`): Standalone FHIR class generator
37-
- **Serialization** (`ardenexal/fhir-serialization`): Standalone FHIR JSON serialization
35+
All components are distributed as a single package (`ardenexal/fhir-tools`):
36+
37+
- **Metadata**: Shared PHP 8 attributes and contracts used by all other components
38+
- **CodeGeneration**: FHIR class generator from Structure Definitions
39+
- **Models**: Generated FHIR model classes (R4, R4B, R5) — do not hand-edit
40+
- **Serialization**: FHIR JSON/XML serialization and validation
41+
- **FHIRPath**: FHIRPath expression parser and evaluator
42+
- **FHIRBundle**: Symfony Bundle wiring all components together
3843

3944
---
4045

@@ -72,23 +77,33 @@ $serializer = new FHIRSerializationService();
7277

7378
## Essential Commands
7479
### Testing
80+
Prefer the `phpunit-run` MCP tool over CLI. It returns compact structured output and
81+
accepts `file`, `class`, `method`, and `filter` parameters.
82+
7583
```bash
76-
composer run test
77-
composer run generate-models-all
84+
# Fallback CLI only — use phpunit-run MCP tool instead when available
85+
composer test-ai # all tests, compact output
86+
composer test-ai-unit # unit suite only
87+
88+
composer run generate-models-all # regenerate all FHIR models (no MCP equivalent)
7889
```
7990

8091
### Code Quality
92+
Prefer the `phpstan-analyse` MCP tool over CLI. Use the `path` parameter to target a
93+
single file or directory.
94+
8195
```bash
82-
composer run lint # Fix code style
83-
composer run phpstan # Static analysis
96+
# Fallback CLI only — use phpstan-analyse MCP tool instead when available
97+
composer phpstan-ai # static analysis, compact output
98+
99+
composer lint # fix code style with Pint (no MCP equivalent)
84100
```
85101

86102
### Component Testing
87103
```bash
88-
# Test specific components
89-
composer run test -- tests/Unit/Bundle/FHIRBundle/
90-
composer run test -- tests/Unit/Component/CodeGeneration/
91-
composer run test -- tests/Unit/Component/Serialization/
104+
# Via MCP: phpunit-run with filter="CodeGeneration" (or Serialization / FHIRPath)
105+
# Via CLI fallback (tests live under src/Component/<Name>/tests/):
106+
composer test-ai -- --filter CodeGeneration
92107
```
93108

94109
---
@@ -105,12 +120,16 @@ composer run test -- tests/Unit/Component/Serialization/
105120
src/
106121
├── Bundle/FHIRBundle/ # Symfony Bundle
107122
├── Component/
123+
│ ├── Metadata/ # Shared attributes and contracts
108124
│ ├── CodeGeneration/ # FHIR class generation
109-
│ └── Serialization/ # FHIR JSON serialization
125+
│ ├── Models/ # Generated FHIR models (do not hand-edit)
126+
│ ├── Serialization/ # FHIR JSON/XML serialization
127+
│ └── FHIRPath/ # FHIRPath expression evaluator
110128
docs/
111-
├── architecture.md # Multi-project architecture
112-
├── migration-guide.md # Migration instructions
113129
└── component-guides/ # Component-specific guides
130+
├── fhir-bundle.md
131+
├── fhir-path.md
132+
└── serialization.md
114133
```
115134

116135
---
@@ -158,7 +177,9 @@ docs/
158177
Before submitting changes, confirm:
159178
- [ ] Symfony compliance (DI, Console helpers).
160179
- [ ] `declare(strict_types=1);` in all files.
161-
- [ ] Code passes `composer run lint` and `composer run phpstan`.
180+
- [ ] `phpstan-analyse` MCP tool (or `composer phpstan-ai`) reports no errors.
181+
- [ ] `phpunit-run` MCP tool (or `composer test-ai`) passes.
182+
- [ ] `composer lint` passes (no MCP equivalent).
162183
- [ ] All PHPUnit tests pass.
163184
- [ ] Component isolation maintained.
164185
- [ ] Backward compatibility preserved.
@@ -172,12 +193,47 @@ Before submitting changes, confirm:
172193
---
173194

174195
### Documentation Resources
175-
- **Architecture Guide**: `/docs/architecture.md` - Multi-project structure overview
176-
- **Migration Guide**: `/docs/migration-guide.md` - Step-by-step migration instructions
177-
- **Component Guides**: `/docs/component-guides/` - Detailed component documentation
178-
- **FHIRBundle Guide**: `/docs/component-guides/fhir-bundle.md` - Symfony integration
179-
- **CodeGeneration Guide**: `/docs/component-guides/code-generation.md` - Standalone generation
180-
- **Serialization Guide**: `/docs/component-guides/serialization.md` - JSON serialization
196+
- **Architecture Guide**: `.goat-flow/architecture.md` - System architecture and component overview
197+
- **Code Map**: `.goat-flow/code-map.md` - File layout and hot paths
198+
- **FHIRBundle Guide**: `docs/component-guides/fhir-bundle.md` - Symfony integration
199+
- **FHIRPath Guide**: `docs/component-guides/fhir-path.md` - FHIRPath evaluator
200+
- **Serialization Guide**: `docs/component-guides/serialization.md` - JSON/XML serialization
201+
202+
## Execution Loop
203+
204+
### READ
205+
206+
Before starting any task, orient with these sources:
207+
208+
- Read `.goat-flow/architecture.md` for system context.
209+
- Read `.goat-flow/code-map.md` for file layout.
210+
- Before declaring any tool or capability unavailable, read the matching playbook in `.goat-flow/skill-reference/` (e.g. `browser-use.md`, `page-capture.md`) and run that doc's "Availability Check" section verbatim — project-local CLI tools at `~/.local/bin/` are valid; do not conflate "no harness/MCP tool" with "no tool".
211+
212+
### SCOPE
213+
214+
Identify files to touch, tests to run, and a binary exit criterion. Confirm with user if scope extends beyond `src/` or `tests/` into config, CI, or infra files.
215+
216+
### ACT
217+
218+
Edit minimal files. Run `phpunit-run` (MCP) after each logical unit; fall back to `composer test-ai` if MCP is unavailable. Never hand-edit `src/Component/Models/src/`; run `php demo/bin/console fhir:generate` instead.
219+
220+
### VERIFY
221+
222+
`phpstan-analyse` (MCP) clean · `phpunit-run` (MCP) passes · `composer lint` passes. No hand-edits to generated model files. All exit criteria met with proof, not recollection.
223+
224+
## Router Table
225+
226+
| What you need | Where to look |
227+
|---|---|
228+
| Architecture overview | `.goat-flow/architecture.md` |
229+
| Repository layout | `.goat-flow/code-map.md` |
230+
| Domain terminology | `.goat-flow/glossary.md` |
231+
| Known traps and footguns | `.goat-flow/footguns/` |
232+
| Lessons from past incidents | `.goat-flow/lessons/` |
233+
| Architecture decisions | `.goat-flow/decisions/` |
234+
| Tool playbooks (CLI/MCP availability checks: browser-use, page-capture, skill-* references) | `.goat-flow/skill-reference/` — read BEFORE declaring a tool unavailable |
235+
236+
---
181237

182238
<!-- BEGIN AI_MATE_INSTRUCTIONS -->
183239
AI Mate Summary:

0 commit comments

Comments
 (0)