Skip to content

feat(nonstop_cli): generate a Claude Code setup and harden the app template - #51

Merged
ProjectAJ14 merged 5 commits into
mainfrom
claude-setup-for-nonstop-cli
Sep 29, 2026
Merged

ProjectAJ14 merged 5 commits into
mainfrom
claude-setup-for-nonstop-cli

Conversation

@ProjectAJ14

Copy link
Copy Markdown
Contributor

What changes?

Projects generated by nonstop create now start with a Claude Code "system boundary": clear rules for how to set up, run, change and troubleshoot the repo.

Claude Code setup in every generated mono-repo

  • A root CLAUDE.md, titled with the project name and followed by its description, the same way the README starts. It covers setup, run, commands, strict SOLID and Flutter rules, definition of done, troubleshooting, and how to communicate with the user.
  • One CLAUDE.md per area (apps/, features/, packages/, plugins/) and per member (app, auth, dashboard, 11 packages). Each covers public API, layout, rules, common changes, tests and gotchas.
  • Docs are gated per selected module. A project without auth, say, never mentions features/auth.
  • .claude/settings.json:
    • an allowlist of the usual melos/flutter commands;
    • reads of .env and keystores are denied;
    • a hook blocks hand edits to generated files (*.g.dart, *.i69n.dart, generated theme, pubspec.lock);
    • a hook runs dart format on every Dart file Claude edits.
  • Skills: melos-workspace, new-feature, flutter-best-practices, design-system, troubleshooting.
  • The package, app and plugin bricks add a starter CLAUDE.md for new members.

CLI

  • nonstop create --template package|app|plugin inside a mono-repo now adds the member to the root workspace: list and sets resolution: workspace. Before, dart pub get rejected new members until they were edited by hand.

Template fixes found while documenting it

  • Dashboard no longer imports auth: the app passes in the route guard and sign-out.
  • Sign-out: also unregisters the device push token when notifications are enabled. A backend failure is logged and doesn't block sign-out.
  • Startup: an offline Remote Config fetch no longer fails it.
  • Privacy: no user IDs, emails or names in logs or crash reports; the email domain is no longer sent to analytics.
  • Analytics: sign-up logged a sign-in event, and one redirect event fired twice; both fixed.
  • Rule compliance:
    • strings come from localization and colors from the theme;
    • dependencies are injected through constructors, with no di.get in build;
    • contracts are abstract interface class;
    • unused dependencies are removed.
  • Docs: READMEs rewritten from the code (network, analytics, crashlytics, feature_flags; notifications is new). Health-specific helpers left over from an earlier product are removed.
  • Small bugs: wrong nonstop create syntax in the area READMEs; an unused material import when dashboard is on and auth is off.

Example snapshot

  • packages/nonstop_cli/example/nonstop_example is the committed output of nonstop create with every module on. Regenerate it with melos run generate:nonstop_example; never edit it by hand.
  • It's excluded from the repo-wide lint and from the published package (.pubignore).

Validation

  • dart test in packages/nonstop_cli: 87 passed, including all 512 module combinations and the new workspace tests.
  • dart run tool/verify_template.dart <profile> for full, default, minimal, auth-only, network-only and firestore-only: lint clean, 100% line coverage and flutter build web for each.
  • Extra combinations --no-auth and --no-notifications: lint clean, 100% coverage.
  • Doc checker over every generated doc in all 512 combinations: no mentions of disabled modules, no leftover template tags, no broken tables.
  • Regenerated example: lint clean, coverage 2309/2309 (100%), web build OK. Its docs match the reviewed hand-written versions except for the project-name titles and the bash prefix on the hook commands.
  • nonstop create demo_pkg --template package inside the example: the package was added to the workspace, dart pub get resolved, and it got a starter CLAUDE.md.
  • Repo-wide melos lint: no issues.
  • Not done: device runs (iOS/Android), and running against a real Firebase project.

Compatibility

Affected package: nonstop_cli (bricks and create command). Only newly generated projects change; existing projects are untouched. If you copied older generated code, note these API changes:

  • AssetImage → AppAssetImage
  • crashlytics enableAutomaticDataCollection → installGlobalErrorHandlers
  • UserMetadata now has only userId
  • DependencyInjection.init() removed
  • FeatureFlag is now an interface (its constructor still works)

Checklist

  • The PR title follows Conventional Commits.
  • Relevant analysis and tests pass; behavior changes have appropriate tests.
  • Documentation/examples are updated where needed.
  • Package versions and changelogs are left to Melos.
  • New public packages include a README, LICENSE, tests and release setup from docs/RELEASING.md (no new public packages).
  • No credentials, private data or generated build output are included.

🤖 Generated with Claude Code

ProjectAJ14 and others added 5 commits September 29, 2026 16:02
`nonstop create --template package|app|plugin` run inside a mono-repo now
lists the new member under the root `workspace:` and sets
`resolution: workspace` in its pubspec, so `dart pub get` accepts it without
manual edits. The mono template never registers itself.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…mplate

Generated mono-repos now ship a Claude Code boundary for the project:
- a root CLAUDE.md (setup, run, commands, strict SOLID and Flutter rules,
  definition of done, communication rules) and one CLAUDE.md per area and
  per member, titled with the project name and gated per selected module
- .claude/settings.json with command allowlist, a guard that blocks edits to
  generated files, and a hook that formats edited Dart files
- skills: melos-workspace, new-feature, flutter-best-practices,
  design-system, troubleshooting
- package, app and plugin bricks add a starter CLAUDE.md for new members

Template fixes found while documenting it:
- dashboard no longer imports auth; the app injects the guard and sign-out
- sign-out unregisters the device push token when notifications are enabled
- an offline Remote Config fetch no longer fails startup
- no user ids, emails or names in logs or crash reports
- strings via localization and colors via the theme everywhere
- dependencies injected through constructors instead of di.get in build
- contracts are abstract interface classes; unused dependencies removed
- crashlytics, analytics, network, feature_flags and notifications READMEs
  rewritten from the code; leftover health-specific helpers removed
- create-command syntax fixed in the area READMEs
- unused material import with dashboard on and auth off

Every module combination still renders; all six verify profiles pass lint,
100% line coverage and a web build.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
packages/nonstop_cli/example/nonstop_example is the output of `nonstop create`
with every module enabled, including its CLAUDE.md files and .claude setup.
It is a reviewable snapshot of what users get, regenerated from the bricks
with `melos run generate:nonstop_example` and never edited by hand.

The snapshot is excluded from the repo-wide format/analyze run (it has its own
workspace and gate) and from the published package via .pubignore.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
`useEmulators` and `baseUrl` exist in every generated project, so the core
package doc now lists both regardless of which modules were selected.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ed pubspecs

The coverage gate flagged two lines: the templates' "added to the workspace"
log and the lookup skipping an unparsable pubspec on the way up.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@ProjectAJ14
ProjectAJ14 merged commit 2d04704 into main Sep 29, 2026
35 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant