Skip to content

docs: make repo more agent-friendly - #70

Merged
YKDBontekoe merged 3 commits into
mainfrom
cursor/agent-friendly-repo-d1bd
Jul 6, 2026
Merged

YKDBontekoe merged 3 commits into
mainfrom
cursor/agent-friendly-repo-d1bd

Conversation

@YKDBontekoe

@YKDBontekoe YKDBontekoe commented Jul 6, 2026

Copy link
Copy Markdown
Owner

Summary

Makes KYNOS significantly more navigable for AI agents by connecting existing docs into a cohesive ecosystem with Cursor skills, CI enforcement, and architecture fixes.

What changed

Documentation hub

Cursor skills (22 total)

  • Workflow: onboard-agent, add-feature, wire-repository, validate-change, open-pr, fix-ci, regenerate-codemap
  • Domain: ui-design-system, ai-isolate, health-data, privacy-audit, linear-kynos
  • Audits: 10 skills under .cursor/skills/audits/ (from workflow_prompts.md)

Cursor rules

  • Expanded .cursor/rules/kynos.md
  • Added architecture.md and pr-workflow.md focused rules

CI enforcement

  • Added scripts/check_architecture.sh — features/infrastructure, domain purity, cross-feature provider imports
  • Added CODEMAP drift check to CI analyze job

Architecture fixes

  • Re-exported health import types via shared/providers/health_import_providers.dart
  • Re-exported GemmaDeviceRamProbe via ai_repository_providers.dart
  • Moved cross-feature providers to shared/providers/: settings, onboarding, coach_chat_seed, model_setup

Validation

  • flutter analyze — 0 issues
  • flutter test — 152 passed
  • bash scripts/check_design_system.sh — pass
  • bash scripts/check_architecture.sh — pass
  • flutter build web — success

Agent onboarding

Start at docs/agents/README.md or invoke /onboard-agent.

Open in Web Open in Cursor 

Summary by CodeRabbit

  • New Features

    • Added clearer onboarding, workflow, and PR guidance for contributors, including validation steps and review expectations.
    • Introduced shared app state for onboarding, settings, coach chat seeding, and model setup, improving consistency across screens.
  • Bug Fixes

    • Updated app screens to use the new shared state sources.
    • Strengthened checks to catch architecture, design-system, and codemap mismatches earlier in CI.
  • Documentation

    • Expanded project docs and agent skills with architecture rules, feature templates, troubleshooting, and audit guides.

Add agent documentation hub, 22 Cursor skills, CI architecture guards,
and fix layer import violations by moving cross-feature providers to
shared/providers/.

Co-authored-by: Youri Bontekoe <YKDBontekoe@users.noreply.github.com>
@coderabbitai

coderabbitai Bot commented Jul 6, 2026

Copy link
Copy Markdown

Review Change Stack

Warning

Review limit reached

@cursor[bot], you've reached your PR review limit, so we couldn't start this review.

Next review available in: 42 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: 5d6846c7-a9c7-4842-a459-bd5a79c204bd

📥 Commits

Reviewing files that changed from the base of the PR and between 859d192 and 3556cf9.

📒 Files selected for processing (14)
  • .cursor/rules/architecture.md
  • .cursor/skills/audits/audit-performance/SKILL.md
  • .cursor/skills/audits/audit-privacy/SKILL.md
  • .cursor/skills/audits/audit-test-coverage/SKILL.md
  • .cursor/skills/audits/audit-ui-polish/SKILL.md
  • .cursor/skills/health-data/SKILL.md
  • .cursor/skills/linear-kynos/SKILL.md
  • .cursor/skills/onboard-agent/SKILL.md
  • .cursor/skills/open-pr/SKILL.md
  • .cursor/skills/regenerate-codemap/SKILL.md
  • .cursor/skills/validate-change/SKILL.md
  • CONTRIBUTING.md
  • docs/agents/file-templates.md
  • docs/agents/troubleshooting.md
📝 Walkthrough

Walkthrough

This PR introduces agent-facing architecture documentation (rules, skills, PR workflow docs), a new check_architecture.sh script wired into CI alongside a CODEMAP freshness check, expanded AGENTS/CLAUDE/CONTRIBUTING/README docs, and refactors Settings, Onboarding, CoachChatSeed, ModelSetup, character, and health-import providers into lib/shared/providers/ with feature files converted to re-exports.

Changes

Architecture Rules, Skills, and Documentation

Layer / File(s) Summary
Architecture rule and CI enforcement
.cursor/rules/architecture.md, scripts/check_architecture.sh, .github/workflows/ci.yml, tool/generate_codemap.dart
Adds a dependency-direction contract and banned-import table, a bash script (check_architecture.sh) validating import boundaries via ripgrep, CI steps running that script plus a CODEMAP.md freshness diff check, and an updated marker-region rewrite in the codemap generator.
Cursor skill and rule documents
.cursor/rules/kynos.md, .cursor/rules/pr-workflow.md, .cursor/skills/**/SKILL.md, .gemini/skills/linear-kynos.md, .github/pull_request_template.md
Adds numerous new Cursor "skill" markdown documents (add-feature, ai-isolate, fix-ci, health-data, linear-kynos, onboard-agent, open-pr, privacy-audit, regenerate-codemap, ui-design-system, validate-change, wire-repository, and ten audit skills), updates rule docs, stubs the Gemini linear-kynos skill, and adds a structured PR template.
Agent hub docs and top-level onboarding docs
AGENTS.md, CLAUDE.md, CONTRIBUTING.md, README.md, CODEMAP.md, docs/agents/*, docs/workflow_prompts.md
Adds a new agent documentation hub, common-patterns/file-templates/troubleshooting guides, and updates existing top-level docs and workflow prompts to reference the new skills and architecture checks.

Provider Relocation to lib/shared/providers/

Layer / File(s) Summary
Settings provider moved to shared
lib/shared/providers/settings_provider.dart, lib/features/settings/providers/settings_provider.dart, lib/shared/providers/ai_repository_providers.dart, lib/features/settings/presentation/pages/on_device_model_picker_page.dart
Moves SettingsState/Settings notifier to shared providers, converts the feature file to a re-export, and updates dependents to import from the shared path.
Onboarding provider moved to shared
lib/shared/providers/onboarding_provider.dart, lib/features/onboarding/providers/onboarding_provider.dart, lib/app/router.dart, lib/features/settings/presentation/pages/settings_page.dart
Moves OnboardingCompleted to shared providers, converts the feature file to a re-export, and reorders related imports.
Coach chat seed provider moved to shared
lib/shared/providers/coach_chat_seed_provider.dart, lib/features/coach_chat/providers/coach_chat_seed_provider.dart, lib/features/dashboard/presentation/pages/dashboard_page.dart
Moves CoachChatSeed to shared providers, converts the feature file to a re-export, and updates the dashboard page import.
Model setup provider/state moved to shared
lib/shared/providers/model_setup_provider.dart, lib/shared/providers/model_setup_state.dart, lib/features/coach_chat/providers/model_setup_provider.dart, lib/features/coach_chat/providers/model_setup_state.dart
Moves ModelSetupNotifier/MissingHuggingFaceTokenException and ModelSetupPhase/ModelSetupState to shared providers, converting feature files to re-exports.
Character and health import provider path updates
lib/features/dashboard/providers/dashboard_summary_provider.dart, lib/features/dashboard/providers/post_run_debrief_provider.dart, lib/shared/providers/health_import_providers.dart, lib/features/settings/presentation/widgets/*, lib/features/settings/providers/health_import_provider.dart
Redirects character provider imports to shared/providers/character_providers.dart and adds/consumes health-import re-exports from the shared module instead of infrastructure directly.

Estimated code review effort: 3 (Moderate) | ~25 minutes

Possibly related PRs

  • YKDBontekoe/KYNOS#33: Related agent-friendly refactor building on the same CODEMAP/DI-cleanup work centralizing providers into lib/shared/providers/.
  • YKDBontekoe/KYNOS#35: Both PRs touch coach-chat seed plumbing and the CoachChatSeed provider used by CoachChatPage.
  • YKDBontekoe/KYNOS#64: Both PRs modify model_setup_provider.dart logic/re-export in the model-setup flow.

Poem

A rabbit hopped through folders deep,
Sorting providers while others sleep,
Skills and rules now neatly stacked,
Architecture checked, nothing cracked,
🐇 CODEMAP fresh, the burrow's complete!

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title is concise and accurately reflects the PR’s main theme of making the repo more agent-friendly through docs and workflow updates.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

Co-authored-by: Youri Bontekoe <YKDBontekoe@users.noreply.github.com>

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 16

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
.cursor/skills/linear-kynos/SKILL.md (1)

21-24: 📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick win

Fix the docs link target.

../../docs/agents/README.md resolves under .cursor/, so the agent hub link will break from this file.

Suggested fix
-For code changes triggered by Linear issues, follow [docs/agents/README.md](../../docs/agents/README.md) and use `/add-feature` or `/validate-change` as appropriate.
+For code changes triggered by Linear issues, follow [docs/agents/README.md](../../../docs/agents/README.md) and use `/add-feature` or `/validate-change` as appropriate.
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In @.cursor/skills/linear-kynos/SKILL.md around lines 21 - 24, The Canonical
Docs link in SKILL.md points to the wrong relative target from this location, so
update the docs reference in the Canonical Docs section to use the correct path
from the current file. Keep the guidance for Linear-triggered changes intact,
but make sure the link resolves to the agent README when read from the
.cursor/skills/linear-kynos/ context.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In @.cursor/rules/architecture.md:
- Around line 5-8: The dependency diagram fence in the architecture rules
markdown is missing a language label, causing markdownlint to flag it. Update
the fenced block in the diagram section to use a non-rendering text label, and
keep the content unchanged so the diagram still displays the same while
satisfying the linter.

In @.cursor/skills/audits/audit-performance/SKILL.md:
- Line 9: The reference link in this audit performance skill is pointing to the
wrong relative location and will break when rendered. Update the markdown
reference in SKILL.md so the docs/workflow_prompts.md link resolves from the
current .cursor/skills/audits/audit-performance context, and verify the
reference text still matches the intended document anchor alongside the
AGENTS.md §14 citation.

In @.cursor/skills/audits/audit-privacy/SKILL.md:
- Around line 21-24: The privacy scan in the audit-privacy skill is too narrow
because the current ripgrep patterns only match line-oriented logger calls, so
multi-line log statements can slip through. Update the scan definitions in
SKILL.md to use a broader matching approach that can catch multi-line logger
invocations in addition to the existing health-related and print/debugPrint
checks, and keep the rules anchored around the same logger and print symbols so
the audit still targets sensitive payloads reliably.
- Line 9: The markdown reference in SKILL.md points to the wrong relative
location, so update the docs/workflow_prompts.md link to use a path that
resolves correctly from .cursor/skills/audits/audit-privacy/SKILL.md. Keep the
existing reference text intact, but change only the link target so the rendered
docs can navigate to the right file.

In @.cursor/skills/audits/audit-test-coverage/SKILL.md:
- Line 9: The reference link in the skill docs points to the wrong relative path
and will break when rendered; update the markdown reference in SKILL.md so it
resolves to docs/workflow_prompts.md from the current file’s location. Keep the
AGENTS.md reference as-is and fix only the path used in the
docs/workflow_prompts.md link.
- Around line 24-27: The Proof of Work section in the audit skill currently
accepts only `flutter test`, which lets the coverage requirement be bypassed.
Update the proof expectations in `SKILL.md` so the proof step explicitly
requires coverage output in addition to the test run, and make it clear that the
validation should reference the coverage summary artifact for the target area
rather than just test success. Keep the wording aligned with the existing “Proof
of Work” bullets so the audit checker can match the updated requirement.

In @.cursor/skills/audits/audit-ui-polish/SKILL.md:
- Line 9: The reference in SKILL.md points to the wrong relative location, so
update the docs link target for workflow_prompts to resolve correctly from the
current markdown file. Fix the Markdown reference that mentions
workflow_prompts.md so it uses the correct path from this skill document, and
verify the referenced section still points to the intended
docs/workflow_prompts.md anchor.

In @.cursor/skills/health-data/SKILL.md:
- Around line 4-8: The health skill trigger paths are too narrow and won’t
activate for domain-layer edits that still need the same guidance. Update the
paths block in SKILL.md so it also matches the health domain files referenced by
the skill, especially repository and use-case related Dart files under the
health domain, and verify the trigger still covers shared provider and
infrastructure health patterns via the existing path globs.

In @.cursor/skills/onboard-agent/SKILL.md:
- Around line 16-19: The onboarding link list in SKILL.md uses paths that are
one directory too shallow, so update the repo-root references in the onboarding
order to point from the skill folder back to the actual repository root. Fix the
three links in the onboarding sequence—docs/agents/README.md, CODEMAP.md, and
AGENTS.md—so they resolve correctly when opened from
.cursor/skills/onboard-agent/, preserving the same ordering and targets.

In @.cursor/skills/open-pr/SKILL.md:
- Around line 36-48: The PR workflow references in SKILL.md are pointing to
paths that are one directory too shallow, so update both links to use the
correct relative locations. Fix the markdown link in the PR Body section that
points to the pull request template, and the AGENTS.md reference in the
Mandatory Monitoring section so both resolve correctly from
.cursor/skills/open-pr/. Use the existing link text and keep the checklist
wording unchanged.

In @.cursor/skills/regenerate-codemap/SKILL.md:
- Around line 20-26: The CODEMAP reference in the regenerate-codemap skill
points to the wrong location, so update the link target in the SKILL.md
instructions to use the repo-root CODEMAP path from the current file location.
Adjust the markdown link text around the auto-generated section description so
it resolves correctly from .cursor/skills/regenerate-codemap/, and keep the rest
of the commit guidance unchanged.

In @.cursor/skills/validate-change/SKILL.md:
- Around line 36-38: The Definition of Done link in the validate-change skill
references AGENTS.md with the wrong relative path from SKILL.md, so update the
markdown link target to point to the correct AGENTS.md location when resolved
from `.cursor/skills/validate-change/`. Fix the reference in the Definition of
Done section so the anchor for `AGENTS.md §4.7` works correctly from this file.

In `@CONTRIBUTING.md`:
- Around line 14-17: The architecture diagram fence in the CONTRIBUTING.md
section is missing a language label, so update the fenced block containing the
features/domain/infrastructure mapping to use the unique markdown fence with a
text label; keep the existing diagram content unchanged and ensure the fence is
explicitly marked as text to satisfy markdownlint.

In `@docs/agents/file-templates.md`:
- Around line 159-166: The widget-test template for <Name>Page is missing the
Flutter material import, so MaterialApp is not in scope and the copied example
will not compile. Update the imports in the template beside the existing
flutter_test and flutter_riverpod imports to include
package:flutter/material.dart, keeping the testWidgets setup for <Name>Page and
ProviderScope unchanged.
- Around line 44-53: The scaffolds are missing required imports for the symbols
used in the templates. Update the provider template that defines <Name> extends
_$<Name> so it includes dart:async for FutureOr, and update the widget smoke
test scaffold so it imports package:flutter/material.dart for MaterialApp. Keep
the existing template structure intact and add the imports alongside the current
Riverpod/generated part setup.

In `@docs/agents/troubleshooting.md`:
- Around line 9-13: The troubleshooting recipe currently uses unquoted
generated-file pathspecs in the git add step, which makes the staging command
shell-dependent. Update the instructions around the build_runner workflow to
reference the generated-file patterns via quoted pathspecs or an equivalent
shell-independent approach, and make sure the guidance still points readers to
the same git add and git commit steps in troubleshooting.md so the generated
.g.dart and .freezed.dart files are reliably staged.

---

Outside diff comments:
In @.cursor/skills/linear-kynos/SKILL.md:
- Around line 21-24: The Canonical Docs link in SKILL.md points to the wrong
relative target from this location, so update the docs reference in the
Canonical Docs section to use the correct path from the current file. Keep the
guidance for Linear-triggered changes intact, but make sure the link resolves to
the agent README when read from the .cursor/skills/linear-kynos/ context.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: fcf1526d-3108-4465-aa12-b23cca6d0823

📥 Commits

Reviewing files that changed from the base of the PR and between ef628ce and 859d192.

📒 Files selected for processing (65)
  • .cursor/rules/architecture.md
  • .cursor/rules/kynos.md
  • .cursor/rules/pr-workflow.md
  • .cursor/skills/add-feature/SKILL.md
  • .cursor/skills/ai-isolate/SKILL.md
  • .cursor/skills/audits/audit-ai-isolate/SKILL.md
  • .cursor/skills/audits/audit-architecture/SKILL.md
  • .cursor/skills/audits/audit-biomechanics/SKILL.md
  • .cursor/skills/audits/audit-dart-modernization/SKILL.md
  • .cursor/skills/audits/audit-documentation/SKILL.md
  • .cursor/skills/audits/audit-health-data/SKILL.md
  • .cursor/skills/audits/audit-performance/SKILL.md
  • .cursor/skills/audits/audit-privacy/SKILL.md
  • .cursor/skills/audits/audit-test-coverage/SKILL.md
  • .cursor/skills/audits/audit-ui-polish/SKILL.md
  • .cursor/skills/fix-ci/SKILL.md
  • .cursor/skills/health-data/SKILL.md
  • .cursor/skills/linear-kynos/SKILL.md
  • .cursor/skills/onboard-agent/SKILL.md
  • .cursor/skills/open-pr/SKILL.md
  • .cursor/skills/privacy-audit/SKILL.md
  • .cursor/skills/regenerate-codemap/SKILL.md
  • .cursor/skills/ui-design-system/SKILL.md
  • .cursor/skills/validate-change/SKILL.md
  • .cursor/skills/wire-repository/SKILL.md
  • .gemini/skills/linear-kynos.md
  • .github/pull_request_template.md
  • .github/workflows/ci.yml
  • AGENTS.md
  • CLAUDE.md
  • CODEMAP.md
  • CONTRIBUTING.md
  • README.md
  • docs/agents/README.md
  • docs/agents/common-patterns.md
  • docs/agents/file-templates.md
  • docs/agents/troubleshooting.md
  • docs/workflow_prompts.md
  • lib/app/router.dart
  • lib/features/coach_chat/providers/coach_chat_seed_provider.dart
  • lib/features/coach_chat/providers/model_setup_provider.dart
  • lib/features/coach_chat/providers/model_setup_state.dart
  • lib/features/dashboard/presentation/pages/dashboard_page.dart
  • lib/features/dashboard/providers/dashboard_summary_provider.dart
  • lib/features/dashboard/providers/post_run_debrief_provider.dart
  • lib/features/onboarding/providers/onboarding_provider.dart
  • lib/features/settings/presentation/pages/on_device_model_picker_page.dart
  • lib/features/settings/presentation/pages/settings_page.dart
  • lib/features/settings/presentation/widgets/apple_health_export_preview_card.dart
  • lib/features/settings/presentation/widgets/gpx_import_preview_card.dart
  • lib/features/settings/providers/health_import_provider.dart
  • lib/features/settings/providers/settings_provider.dart
  • lib/shared/providers/ai_repository_providers.dart
  • lib/shared/providers/coach_chat_seed_provider.dart
  • lib/shared/providers/coach_chat_seed_provider.g.dart
  • lib/shared/providers/health_import_providers.dart
  • lib/shared/providers/model_setup_provider.dart
  • lib/shared/providers/model_setup_provider.g.dart
  • lib/shared/providers/model_setup_state.dart
  • lib/shared/providers/onboarding_provider.dart
  • lib/shared/providers/onboarding_provider.g.dart
  • lib/shared/providers/settings_provider.dart
  • lib/shared/providers/settings_provider.g.dart
  • scripts/check_architecture.sh
  • tool/generate_codemap.dart
💤 Files with no reviewable changes (1)
  • lib/features/settings/providers/health_import_provider.dart

Comment thread .cursor/rules/architecture.md Outdated
Comment thread .cursor/skills/audits/audit-performance/SKILL.md Outdated
Comment thread .cursor/skills/audits/audit-privacy/SKILL.md Outdated
Comment thread .cursor/skills/audits/audit-privacy/SKILL.md
Comment thread .cursor/skills/audits/audit-test-coverage/SKILL.md Outdated
Comment thread .cursor/skills/validate-change/SKILL.md Outdated
Comment thread CONTRIBUTING.md Outdated
Comment thread docs/agents/file-templates.md
Comment thread docs/agents/file-templates.md Outdated
Comment thread docs/agents/troubleshooting.md
Co-authored-by: Youri Bontekoe <YKDBontekoe@users.noreply.github.com>
@YKDBontekoe
YKDBontekoe merged commit 52a845b into main Jul 6, 2026
11 checks passed
@YKDBontekoe
YKDBontekoe deleted the cursor/agent-friendly-repo-d1bd branch July 6, 2026 19:08
@github-actions

github-actions Bot commented Jul 6, 2026

Copy link
Copy Markdown

🎉 This PR is included in version 1.15.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants