Skip to main content

Documentation Index

Fetch the complete documentation index at: https://docs.encoreos.io/llms.txt

Use this file to discover all available pages before exploring further.

Date: 2026-05-09 Scope: .cursor/rules/, .cursor/skills/, .cursor/commands/, .claude/, .agents/, AGENTS.md, AI_GUIDE.md, constitution.md, .github/instructions/, package.json scripts

Executive Summary

The Encore Health OS agent infrastructure is mature and well-structured. Document hierarchy is clear, core AGENTS.md files are complete (14/14), and rule activation patterns are sound. This audit identifies 26 actionable improvements across 6 categories to increase efficiency, reduce context waste, and improve accuracy for AI agents.

Inventory Snapshot

AreaCountStatus
.cursor/rules/ files45Active (README says 35 — stale)
.cursor/skills/23All have SKILL.md
.cursor/commands/78Well-organized by domain
.claude/agents/6Code-reviewer, compliance, docs, structure, writer, test-gen
.claude/commands/5commit, fix-issue, pr-summary, security-audit, recommender
.claude/skills/5spec-review, doc-update, code-review, api-integration, file-organizer
.agents/skills/4cloud-runbook, autofix, code-review, turborepo
src/**/AGENTS.md14All cores + platform + shared + integrations
.github/instructions/10Copilot-scoped instructions
package.json scripts218Categorized; CLAUDE.md says 206 (stale)

Category 1: Version & Metadata Drift (High Priority)

These are factual inconsistencies that can mislead agents into wrong behavior or stale assumptions.
#IssueLocationFix
1constitution.md header says v1.17.0 but footer block says v1.16.1constitution.md footer (~line 2190)Update footer to 1.17.0
2docs/VERSIONS.md lists copilot-instructions.md as v1.23.0; actual file is v1.23.1docs/VERSIONS.mdSync to 1.23.1
3.cursor/README.md says 35 rule files; actual count is 45.cursor/README.mdUpdate to 45
4CLAUDE.md says 206 scripts; actual count is 218CLAUDE.mdUpdate to 218
5constitution.md TOC omits §12.3–12.5 (Testing, Audit, Rate Limiting)constitution.md TOCAdd subsections to TOC
6AI_GUIDE.md See Also has broken note: “AGENTS.md consolidated into AGENTS.md”AI_GUIDE.md footerFix copy-paste error
Impact: Agents trust stated counts/versions for cache decisions and self-validation. Drift wastes tokens on confusion and may cause agents to skip reading updated material.

Category 2: Context Efficiency (Medium-High Priority)

These changes reduce token waste for AI agents while preserving information.
#RecommendationRationale
7Delete the 4 split-stub files (performance-patterns.md, security-patterns.md, form-libraries.md, and any other pure-redirect files) and update cross-references to point directly to the targets.Each stub wastes ~200 tokens of context when accidentally loaded. A glob match can still pull them in. Alternatively, if keeping stubs for discoverability, make them 2-line files (no YAML frontmatter globs: that could trigger loading).
8Consolidate query-patterns.md and perf-query-caching.md into a single file.Both cover React Query caching with overlapping content. Having two glob-matched files for src/**/*.{ts,tsx} means agents may load both (~450 lines) for the same task.
9Add a max_lines: N or size_budget metadata field to each core AGENTS.md header as a soft governance signal.Several core AGENTS.md files exceed their own stated size goals (e.g., platform at 800+ lines vs “keep small”). A metadata field makes drift visible during governance audits.
10Create a lightweight .cursor/rules/index.md (decision-tree replacement or supplement) that maps “I’m editing file X” → “load rules Y, Z”.pattern-decision-tree.md exists but is 150 lines of prose. A flat table (file-glob → rule-files) would be more scannable for agents and enable tooling to auto-inject only relevant rules.

Category 3: Missing Skills & Commands (Medium Priority)

Gaps where a new skill or command would materially improve agent performance.
#Proposed AdditionJustification
11Skill: migration-authoring (.cursor/skills/migration-authoring/SKILL.md)Currently agents must read database-patterns.mdc + database-migrations.md + constitution.md §5 + the DB dev guide. A single skill that sequences these reads and provides a preflight checklist would reduce missed steps and token churn.
12Skill: rls-testing (.cursor/skills/rls-testing/SKILL.md)RLS tests have specific setup (service-role keys, test isolation, SKIP_SUPABASE_TESTS). The info is scattered across .github/instructions/rls-tests.instructions.md, testing.md rule, and the test setup doc. A unified skill chains them.
13Command: validate-quick (.cursor/commands/development/validate-quick.md)Many tasks only need typecheck + lint + build (not full governance). A command that runs the minimal CI gate (npm run validate) and reports pass/fail would be faster than agents guessing which checks to run.
14Skill: ui-component-creationAgents creating new components must synthesize dialog-size-standards, tab-patterns, semantic colors, mobile/gesture patterns, and breadcrumb rules. A single skill that triggers on “creating a new page/component” would orchestrate the reads.
15Command: sync-versions (.cursor/commands/documentation/sync-versions.md)Automates the version drift fixes from Category 1. Reads all doc headers, compares to VERSIONS.md, and proposes corrections. Could be run monthly per governance cadence.

Category 4: Rule Activation & Glob Refinement (Medium Priority)

#RecommendationRationale
16Narrow database-patterns.mdc glob from src/**/*.{ts,tsx} to src/**/hooks/use*Query*.{ts,tsx}, src/**/hooks/use*Mutation*.{ts,tsx}, src/**/api/** or similar.A 431-line rule currently loads for ANY .ts/.tsx edit. Most of its content (RLS, SECURITY DEFINER, naming) is irrelevant when editing a UI component.
17Add alwaysApply: false explicitly to all rules that lack it (currently only constitution.mdc and quick-reference.mdc have alwaysApply fields).Explicit is better than implicit for governance audits and tooling.
18Remove or refine the glob on ai-slop-avoidance.mdc (**/*.{ts,tsx,js,jsx}).This 30-line rule is lightweight but loads for every TS/JS edit. Consider making it always-apply (it’s short) or removing the glob and relying on the check:slop command for enforcement.
19Create a .cursor/rules/mobile-patterns.md scoped to src/cores/*/components/mobile/** and src/platform/gestures/**.Mobile/gesture guidance is currently embedded in AGENTS.md point #15 (a paragraph) and a separate dev guide. A scoped rule file would auto-inject when agents edit mobile components.

Category 5: Cross-Tool Consistency (Low-Medium Priority)

#IssueFix
20.claude/skills/code-review/ and .agents/skills/code-review/ overlap but serve different purposes (local Claude review vs CodeRabbit PR integration).Rename .agents/skills/code-review/ to .agents/skills/coderabbit-review/ to eliminate ambiguity. Update SKILL.md trigger descriptions.
21.cursor/mcp.json only defines shadcn; AGENTS.md references “baseline: shadcn, fallow” for MCP.Either add a fallow MCP config (if it supports MCP protocol) or correct AGENTS.md to say “baseline MCP: shadcn; fallow via npm scripts.”
22.github/instructions/ has no mention in .cursor/README.md or AGENTS.md Document Map.Add a row to the AGENTS.md Document Map table for .github/instructions/ files and their purpose (Copilot-scoped instruction injection).
23No .agents/README.md exists to explain the .agents/ directory purpose vs .claude/ vs .cursor/.Add a short README explaining: .agents/ = cross-tool skills (Cloud agents, CI); .claude/ = Claude Code; .cursor/ = Cursor IDE.

Category 6: Operational & Governance Improvements (Low Priority)

#RecommendationRationale
24Add a docs/VERSIONS.md “Debugging & Troubleshooting” section or remove the empty heading.Empty headings waste tokens and signal incomplete work to agents.
25Add governance audit for skill versions to the monthly cadence in RULES_GOVERNANCE.md.Skills have version fields (v1.0.0) but no process to review/bump them. As skills evolve, stale version numbers reduce trust.
26Create a script npm run audit:agent-config that validates: rule count matches README, VERSIONS.md matches file headers, no empty doc sections, skill frontmatter is complete.Automates Category 1 fixes and prevents future drift. Could be added to validate:governance.

Priority Matrix

                    HIGH IMPACT

    ┌───────────────────┼───────────────────┐
    │   Cat 1 (#1-6)    │   Cat 2 (#7-10)   │
    │   Version drift   │   Context savings  │
    │                   │                    │
LOW ├───────────────────┼───────────────────┤ HIGH
EFF │   Cat 5 (#20-23)  │   Cat 3 (#11-15)  │  EFFORT
ORT │   Consistency     │   New skills       │
    │                   │                    │
    │   Cat 6 (#24-26)  │   Cat 4 (#16-19)  │
    │   Governance      │   Glob tuning      │
    └───────────────────┼───────────────────┘

                    LOW IMPACT
Recommended execution order:
  1. Category 1 (version fixes) — immediate, low effort, high trust impact
  2. Category 2 items 7-8 (stub deletion, query consolidation) — quick wins
  3. Category 3 item 11 (migration skill) — highest-value new skill
  4. Category 4 item 16 (database-patterns glob) — largest context savings
  5. Remaining items by priority band

Appendix: Unused/Redundant Configuration

ItemStatusRecommendation
form-libraries.mdPure redirect stubDelete or reduce to 2 lines without glob
performance-patterns.mdPure redirect stubDelete or reduce to 2 lines without glob
security-patterns.mdPure redirect stubDelete or reduce to 2 lines without glob
file-organizer skill (.claude/skills/)Generic, not Encore-specificConsider removing — adds noise to skill list
turborepo skill (.agents/skills/)950+ lines; project is not a monorepo yetKeep but mark as “future/aspirational” in its description
constitution.md “Annual Review” headingDuplicate of §10.3Merge into §10.3 or remove standalone heading

Next Steps

  1. Immediate: Fix the 6 version drift items (Category 1) — these can be done in a single commit.
  2. This sprint: Delete stubs, consolidate query patterns, narrow database-patterns glob.
  3. Next sprint: Author the migration-authoring and rls-testing skills.
  4. Monthly governance: Add audit:agent-config script to validate:governance chain.

Generated by agent audit on 2026-05-09. All 26 recommendations implemented in this PR.