Skip to content

Conversation

@nanotaboada
Copy link
Owner

@nanotaboada nanotaboada commented Jan 24, 2026

  • Reduce copilot-instructions.md to thin pointer file (~500 tokens)
  • Add AGENTS.md with operational procedures (on-demand loading)
  • Implement tiered loading to minimize auto-loaded token cost
  • Add token efficiency headers explaining load strategy

Instructions now use thin pointer architecture: essential context auto-loads, detailed procedures load on-demand via #file reference.


This change is Reviewable

Summary by CodeRabbit

  • Documentation
    • Added comprehensive operational and development guidelines documentation, covering quick start procedures, testing and code quality standards, database management, Docker workflow, CI/CD pipeline configuration, deployment procedures, troubleshooting resources, and architecture overview
    • Updated coding conventions and architectural guidance to provide clearer development standards and best practices

✏️ Tip: You can customize this high-level summary in your review settings.

- Reduce copilot-instructions.md to thin pointer file (~500 tokens)
- Add AGENTS.md with operational procedures (on-demand loading)
- Implement tiered loading to minimize auto-loaded token cost
- Add token efficiency headers explaining load strategy

Instructions now use thin pointer architecture: essential context
auto-loads, detailed procedures load on-demand via #file reference.
@coderabbitai
Copy link

coderabbitai bot commented Jan 24, 2026

Walkthrough

This PR updates and adds documentation files to provide comprehensive Copilot instructions and operational guidance. .github/copilot-instructions.md is restructured with broader architectural guidance, while new AGENTS.md file provides development setup, workflow procedures, Docker operations, CI/CD pipelines, and troubleshooting guidance.

Changes

Cohort / File(s) Summary
Documentation Updates
.github/copilot-instructions.md
Restructures project overview into Copilot instructions with token-efficiency notes, sections for conventions, architecture, coding guidelines, and Docker/CI guidance. Shifts from concrete project structure to provider/usage-oriented guidance emphasizing async patterns and dependency injection.
New Operational Guide
AGENTS.md
New comprehensive documentation covering quick start, Python version requirements, development workflow (tests, linting, formatting), database management, Docker operations, CI/CD pipelines, project architecture, troubleshooting, and API usage. Includes environment setup, code quality tools (flake8, black), naming conventions, and production considerations.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10-15 minutes

Possibly related PRs

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title follows Conventional Commits format with 'docs:' prefix, is 57 characters (under 80), and accurately describes the main change: optimizing AI agent instructions for token efficiency by restructuring documentation into a thin pointer file (copilot-instructions.md) and detailed procedures file (AGENTS.md).
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch feat/optimize-ai-agent-instructions

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 and usage tips.

@sonarqubecloud
Copy link

@codacy-production
Copy link

Coverage summary from Codacy

See diff coverage on Codacy

Coverage variation Diff coverage
+0.00%
Coverage variation details
Coverable lines Covered lines Coverage
Common ancestor commit (bce5022) 131 119 90.84%
Head commit (8dc85ac) 131 (+0) 119 (+0) 90.84% (+0.00%)

Coverage variation is the difference between the coverage for the head and common ancestor commits of the pull request branch: <coverage of head commit> - <coverage of common ancestor commit>

Diff coverage details
Coverable lines Covered lines Diff coverage
Pull request (#471) 0 0 ∅ (not applicable)

Diff coverage is the percentage of lines that are covered by tests out of the coverable lines that the pull request added or modified: <covered lines added or modified>/<coverable lines added or modified> * 100%

See your quality gate settings    Change summary preferences

@codecov
Copy link

codecov bot commented Jan 24, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 89.65%. Comparing base (bce5022) to head (8dc85ac).

Additional details and impacted files
@@           Coverage Diff           @@
##           master     #471   +/-   ##
=======================================
  Coverage   89.65%   89.65%           
=======================================
  Files           3        3           
  Lines         116      116           
=======================================
  Hits          104      104           
  Misses         12       12           
Components Coverage Δ
Services 79.31% <ø> (ø)
Routes 100.00% <ø> (ø)
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@nanotaboada
Copy link
Owner Author

@coderabbitai review

@coderabbitai
Copy link

coderabbitai bot commented Jan 25, 2026

✅ Actions performed

Review triggered.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 5

🤖 Fix all issues with AI agents
In @.github/copilot-instructions.md:
- Around line 34-35: The documentation has inconsistent cache TTLs: one place
shows "10min/1hr TTL" while another shows "600s"; pick the correct TTL value
(e.g., 600s or 10min/1hr) and update all occurrences so they match—specifically
replace the "10min/1hr TTL" text and any later mention of "600s" (and the
related paragraph at the other noted occurrence) with the agreed-upon TTL string
so the architecture section and cache note are consistent.
- Around line 78-81: The two stray list items ("5. **Caching**: In-memory cache
(10 min TTL) with `X-Cache` headers (HIT/MISS)" and "6. **Async/Await**: All
database operations are async") should be removed from their current orphan
position or moved into the appropriate section (e.g., the "Core Conventions" or
"Architecture" list); update the destination list so numbering/bullets are
consistent and delete the original lines so no disconnected items remain. Ensure
the moved items keep their Markdown formatting and update any surrounding lists
or headings to preserve document structure.
- Around line 57-68: Update the port in the quick commands snippet so it matches
the rest of the docs: change the uvicorn command string "uvicorn main:app
--reload --host 0.0.0.0 --port 8000" to use --port 9000 and update the Swagger
URL "http://localhost:8000/docs" to "http://localhost:9000/docs"; ensure any
other occurrences of "8000" in that snippet are replaced with "9000" for
consistency.

In `@AGENTS.md`:
- Around line 229-230: Replace the bare URL in the prose ("Open
http://localhost:9000/docs - Interactive Swagger UI with "Try it out" buttons")
by wrapping it in angle brackets or inline code formatting to satisfy MD034;
e.g., change the phrase to use `<http://localhost:9000/docs>` or backticks
around the URL so the line reads like "Open <http://localhost:9000/docs> -
Interactive Swagger UI with 'Try it out' buttons" or similar.
- Around line 162-163: The fenced code block containing the architecture snippet
that starts with "routes/          # FastAPI endpoints with caching" is missing
a language tag (MD040); add a language identifier such as text (e.g., change the
opening fence to ```text) so the block becomes a labeled fenced code block and
satisfies markdownlint; locate the block in AGENTS.md and update the opening
fence accordingly.

Comment on lines +34 to +35
- **Cache**: aiocache SimpleMemoryCache (10min/1hr TTL)

Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟡 Minor

Cache TTL inconsistency.

“10min/1hr TTL” in the architecture section conflicts with the later cache note (600s). Please verify and make these consistent.

Also applies to: 176-179

🤖 Prompt for AI Agents
In @.github/copilot-instructions.md around lines 34 - 35, The documentation has
inconsistent cache TTLs: one place shows "10min/1hr TTL" while another shows
"600s"; pick the correct TTL value (e.g., 600s or 10min/1hr) and update all
occurrences so they match—specifically replace the "10min/1hr TTL" text and any
later mention of "600s" (and the related paragraph at the other noted
occurrence) with the agreed-upon TTL string so the architecture section and
cache note are consistent.

Comment on lines +57 to 68
```bash
# Run with hot reload
uvicorn main:app --reload --host 0.0.0.0 --port 8000

# Test with coverage
pytest --cov=. --cov-report=term-missing

# Docker
docker compose up

# Swagger: http://localhost:8000/docs
```
Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟡 Minor

Port mismatch with the rest of the docs.

Quick Commands uses port 8000 while the rest of the instructions and AGENTS.md use 9000. Align the port to avoid confusion.

💡 Suggested tweak
-uvicorn main:app --reload --host 0.0.0.0 --port 8000
+uvicorn main:app --reload --host 0.0.0.0 --port 9000

-# Swagger: http://localhost:8000/docs
+# Swagger: http://localhost:9000/docs
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
```bash
# Run with hot reload
uvicorn main:app --reload --host 0.0.0.0 --port 8000
# Test with coverage
pytest --cov=. --cov-report=term-missing
# Docker
docker compose up
# Swagger: http://localhost:8000/docs
```
# Run with hot reload
uvicorn main:app --reload --host 0.0.0.0 --port 9000
# Test with coverage
pytest --cov=. --cov-report=term-missing
# Docker
docker compose up
# Swagger: http://localhost:9000/docs
🤖 Prompt for AI Agents
In @.github/copilot-instructions.md around lines 57 - 68, Update the port in the
quick commands snippet so it matches the rest of the docs: change the uvicorn
command string "uvicorn main:app --reload --host 0.0.0.0 --port 8000" to use
--port 9000 and update the Swagger URL "http://localhost:8000/docs" to
"http://localhost:9000/docs"; ensure any other occurrences of "8000" in that
snippet are replaced with "9000" for consistency.

Comment on lines +78 to 81
💡 **Why this structure?** Copilot auto-loads this file on every chat (~500 tokens). Loading `AGENTS.md` or `SKILLS/` explicitly gives you deep context only when needed, saving 80% of your token budget!
5. **Caching**: In-memory cache (10 min TTL) with `X-Cache` headers (HIT/MISS)
6. **Async/Await**: All database operations are async

Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟡 Minor

Stray list items break structure.

Lines 79–81 look like leftover list entries and appear outside any section, which is confusing. Either remove them or move into the appropriate “Core Conventions” or “Architecture” list.

🤖 Prompt for AI Agents
In @.github/copilot-instructions.md around lines 78 - 81, The two stray list
items ("5. **Caching**: In-memory cache (10 min TTL) with `X-Cache` headers
(HIT/MISS)" and "6. **Async/Await**: All database operations are async") should
be removed from their current orphan position or moved into the appropriate
section (e.g., the "Core Conventions" or "Architecture" list); update the
destination list so numbering/bullets are consistent and delete the original
lines so no disconnected items remain. Ensure the moved items keep their
Markdown formatting and update any surrounding lists or headings to preserve
document structure.

Comment on lines +162 to +163
```
routes/ # FastAPI endpoints with caching
Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟡 Minor

Add a language tag to the fenced block.

Markdownlint flags the architecture diagram block as missing a language. Use text (or md) to satisfy MD040.

💡 Suggested tweak
-```
+```text
 Route → Service → Database
   ↓         ↓
 Cache    Session
</details>

<!-- suggestion_start -->

<details>
<summary>📝 Committable suggestion</summary>

> ‼️ **IMPORTANT**
> Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

```suggestion

🧰 Tools
🪛 markdownlint-cli2 (0.18.1)

162-162: Fenced code blocks should have a language specified

(MD040, fenced-code-language)

🤖 Prompt for AI Agents
In `@AGENTS.md` around lines 162 - 163, The fenced code block containing the
architecture snippet that starts with "routes/          # FastAPI endpoints with
caching" is missing a language tag (MD040); add a language identifier such as
text (e.g., change the opening fence to ```text) so the block becomes a labeled
fenced code block and satisfies markdownlint; locate the block in AGENTS.md and
update the opening fence accordingly.

Comment on lines +229 to +230
Open http://localhost:9000/docs - Interactive Swagger UI with "Try it out" buttons

Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟡 Minor

Avoid bare URL in prose.

Wrap the URL in angle brackets or code formatting to satisfy MD034 and keep rendering consistent.

💡 Suggested tweak
-Open http://localhost:9000/docs - Interactive Swagger UI with "Try it out" buttons
+Open <http://localhost:9000/docs> - Interactive Swagger UI with "Try it out" buttons
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
Open http://localhost:9000/docs - Interactive Swagger UI with "Try it out" buttons
Open <http://localhost:9000/docs> - Interactive Swagger UI with "Try it out" buttons
🧰 Tools
🪛 markdownlint-cli2 (0.18.1)

229-229: Bare URL used

(MD034, no-bare-urls)

🤖 Prompt for AI Agents
In `@AGENTS.md` around lines 229 - 230, Replace the bare URL in the prose ("Open
http://localhost:9000/docs - Interactive Swagger UI with "Try it out" buttons")
by wrapping it in angle brackets or inline code formatting to satisfy MD034;
e.g., change the phrase to use `<http://localhost:9000/docs>` or backticks
around the URL so the line reads like "Open <http://localhost:9000/docs> -
Interactive Swagger UI with 'Try it out' buttons" or similar.

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.

2 participants