Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
80 changes: 80 additions & 0 deletions .claude/commands/prepare-release.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
# Prepare a release

Bump the version, document the changelog, and open a PR from `development` to `main`.

## Usage

```
/prepare-release <version>
```

Where `<version>` is the new semver string (e.g. `3.6.21`).

## Steps

### 1. Validate inputs

- Confirm the working directory is clean (`git status`). If there are uncommitted changes, stop
and tell the user to commit or stash them first.
- Confirm the current branch is `development`. If not, stop and warn the user.
- Confirm `<version>` is a valid semver string (e.g. `3.6.21`, `4.0.0`).

### 2. Collect changes since last release

Run:
```
git log --oneline <current_version_tag>..HEAD
```
or if tags are not present, compare with `main`:
```
git log --oneline main..HEAD
```
Read the commit messages to understand what changed. Ignore pure chore/refactor commits
(e.g. CLAUDE.md updates, code generation runs) unless they are meaningful to library consumers.
Focus on: new models, new fields, removed/deprecated fields, bug fixes, behaviour changes.

### 3. Update `pubspec.yaml`

Edit the `version:` line:
```yaml
version: "<version>"
```

### 4. Prepend entry to `CHANGELOG.md`

Insert a new section at the top (after the `# Changelog` heading) following the existing style:
```markdown
## <version>

- <bullet summarising change 1>
- <bullet summarising change 2>
```

Rules:
- One bullet per logical change (not per commit).
- Mention model names, field names, and enum values using backticks.
- Keep bullets concise — one sentence each.
- Do not include internal/tooling changes (CLAUDE.md, skill files, code generation, etc.).

### 5. Commit the release

Stage only `pubspec.yaml` and `CHANGELOG.md`, then commit:
```
git add pubspec.yaml CHANGELOG.md
git commit -m "chore: bump version to <version> and update changelog"
```

### 6. Push and open PR

```
git push origin development
```

Then create a PR from `development` → `main` using `gh pr create`:
- Title: `chore: release <version>`
- Body: the changelog entry you just wrote (the bullet list only, no heading)
- Do NOT include a Test plan section (per project rules)

### 7. Report

Print the PR URL so the user can review and merge it.
77 changes: 77 additions & 0 deletions .claude/commands/to-library.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
# Convert flat model file to library module

Convert a flat `lib/src/<name>.dart` file (currently a `part of` the root library) into a
self-contained sub-library with the `library` / `part` / `part of` pattern used across this
codebase.

## Usage

```
/to-library <name>
```

Where `<name>` is the module name (e.g. `access`, `algorithm`, `tag`).
The flat source file must exist at `lib/src/<name>.dart`.

## What this skill does

1. **Read** `lib/src/<name>.dart` — understand every top-level declaration (classes, enums,
mixins, extensions, typedefs).

2. **Decide how to split** — one source file per logical unit inside `lib/src/<name>/src/`.
Typical split: one file per class/enum, or group tightly-coupled helpers together.
Follow existing modules as reference (e.g. `lib/src/access/`, `lib/src/ats/`).

3. **Create the module library** `lib/src/<name>/<name>.dart`:
```dart
library;

import 'package:collection/collection.dart'; // only if needed
import 'package:freezed_annotation/freezed_annotation.dart'; // only if needed
import 'package:layrz_models/layrz_models.dart'; // only if needed

part '<name>.freezed.dart'; // only if @freezed/@unfreezed classes exist
part '<name>.g.dart'; // only if fromJson exists

part 'src/foo.dart';
part 'src/bar.dart';
// ...
```
Include only the imports actually needed.

4. **Create each source file** under `lib/src/<name>/src/<model>.dart`:
```dart
part of '../<name>.dart';

// original content of that declaration
```

5. **Update `lib/layrz_models.dart`**:
- Remove `part 'src/<name>.dart';`
- Add before the `part 'layrz_models.freezed.dart';` line:
```dart
import 'src/<name>/<name>.dart'; // only if types from this module are used
export 'src/<name>/<name>.dart'; // in other part files of layrz_models.dart
```
Use `// import ...` (commented-out) + `export` if NOT used in part files.

**Import vs export-only rule**: grep the other `lib/src/*.dart` part files for any
type name from this module. If any part file in `layrz_models.dart` references a type,
the library needs `import` (not just `export`) so the type is in scope for those parts.

6. **Delete** `lib/src/<name>.dart`.

7. **Run code generation**: `dart run build_runner build --delete-conflicting-outputs`

8. **Report** what was created and whether the build succeeded.

## Rules

- Never manually edit `.freezed.dart` or `.g.dart` files.
- Keep `part of` paths relative: `part of '../<name>.dart';`
- All `part` declarations in the library file must precede no `import`/`export` — but
`library;` comes first, then imports, then `part` directives.
- Export directives in `layrz_models.dart` must precede `part` directives — place the new
export/import block before `part 'layrz_models.freezed.dart';`.
- Follow existing dartdoc comment style (all classes and fields documented).
- Do not add features or refactor beyond the mechanical conversion.
1 change: 0 additions & 1 deletion .flutter-plugins-dependencies

This file was deleted.

2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@

# Flutter/Dart/Pub related
# Libraries should not include pubspec.lock, per https://dart.dev/guides/libraries/private-files#pubspeclock.
.flutter-plugins
.flutter-plugins-dependencies
/pubspec.lock
**/doc/api/
.dart_tool/
Expand Down
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
# Changelog

## 3.6.21

- Added `PoiInput` model to the `map` module with `save()` support for creating and editing points of interest via GraphQL.
- Added `PoiApiResponse` helper class to the `map` module.

## 3.6.20
- Added `hasWorldwideCoverage` to `Device` model to represent if the device has worldwide coverage, for the BHS use case, this field is used to identify if the device has GPS insurance.
- Added `hasGpsInsurance` to `User` model to represent if the user has GPS insurance, for the BHS use case.
Expand Down
5 changes: 5 additions & 0 deletions CLAUDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -146,3 +146,8 @@ Each test file typically tests:
- Follow existing documentation patterns - all models and fields should have dartdoc comments
- Use nullable fields (`String?`) liberally as API responses may have missing data
- Deprecation: Use `@Deprecated("migration message")` for fields being phased out

## Other considerations

- "wrap it up" - Means review the changes, commit and push, and create a pull request if the user wants
- Do not include Test plan on the PR body under any circumstances, the code should be tested before the PR.
4 changes: 3 additions & 1 deletion lib/layrz_models.dart
Original file line number Diff line number Diff line change
Expand Up @@ -143,11 +143,13 @@ export 'src/token/token.dart';
// import 'src/permissions/permissions.dart';
export 'src/permissions/permissions.dart';

import 'src/access/access.dart';
export 'src/access/access.dart';

part 'layrz_models.freezed.dart';
part 'layrz_models.g.dart';

/// Models that should be re-organized to sub-modules
part 'src/access.dart';
part 'src/accessibility/shortcut.dart';
part 'src/algorithm.dart';
part 'src/billing_plan.dart';
Expand Down
Loading
Loading