Skip to content

Add AGENTS.md with agent instructions for replication-backend#211

Closed
Copilot wants to merge 2 commits into
masterfrom
copilot/implement-agents-documentation
Closed

Add AGENTS.md with agent instructions for replication-backend#211
Copilot wants to merge 2 commits into
masterfrom
copilot/implement-agents-documentation

Conversation

Copy link
Copy Markdown

Copilot AI commented Feb 23, 2026

No AGENTS.md existed to guide AI coding agents working on this repo, resulting in agents lacking project-specific context for architecture, tooling, and available MCP integrations.

Changes

  • AGENTS.md (new): Root-level agent instruction file covering:
    • Project overview with annotated source directory map (NestJS, TypeScript, CouchDB, CASL, Sentry)
    • All npm dev commands (build, test, lint, format)
    • Unit test patterns — TestingModule setup, mock injection via useValue, jest.spyOn, authGuardMockProviders for controller tests
    • E2E test structure (test/ dir, Supertest against full app)
    • MCP servers: GitHub MCP (issues, PRs, CI logs) and Sentry MCP (error events, stack traces), each with concrete use-case lists and links to relevant config files
    • Architecture notes: permission-filtered CouchDB endpoints, lostPermissions feed extension, RulesService change-watching, auth methods, /couchdb/ proxy, /api/ Swagger UI
Original prompt

Start implementation

The user has attached the following file paths as relevant context:

  • AGENTS.md
[Chronological Review: The conversation began with the user requesting a review of the Agents.md file based on the latest models and best practices. The user outlined specific needs for agents, including fleshing out user requirements, troubleshooting, planning technical implementation, and generating tests. The user then questioned the value of certain items in the list, such as whether to skip specific Angular versions and the necessity of Claude-specific workflow instructions. The conversation continued with requests to add Sentry.io and GitHub MCP server details, as well as discussions about linking relevant instruction files and whether to cover unit and e2e test patterns in Agents.md. The user finally requested to start implementation, then canceled that request to delegate to a cloud agent, and subsequently asked to create a new branch from the master branch for changes.]

[Intent Mapping:

  1. "Review the Agents.md based on the latest models and best practices."
  2. "Is (3) adding significant value? It seems to just duplicate Agents.md?"
  3. "Should we skip a specific angular version and instead say 'latest Angular'?"
  4. "Are the Claude specific workflow instructions necessary in addition to referencing agents.md?"
  5. "Add sentry.io MCP server in MCP section."
  6. "Also mention GitHub MCP for interaction with issues and PRs."
  7. "Should the agents.md skip unit test and e2e test patterns and only cover these as instructions?"
  8. "Should we also link to the relevant instruction file from the Agents.md sections?"
  9. "Start implementation."
  10. "Cancel: 'Delegate to cloud agent.'"
  11. "Create a new branch from master branch for these changes."]

[Technical Inventory: Technologies mentioned include Angular (latest version), Sentry.io for error tracking, GitHub for issue and PR management, and various AI models like Claude Sonnet and Opus. The conversation also discussed the structure of the Agents.md file and the potential need for specialized agents.]

[Code Archaeology: The user is currently working on the file located at /home/sleidig/Projects/ndb-core/src/app/core/basic-datatypes/entity/entity-block/entity-block.component.ts. Specific code changes were not detailed in the conversation.]

[Progress Assessment: The user has outlined the requirements for agents and discussed potential improvements to the Agents.md file. They have not yet implemented any changes but have expressed a desire to start.]

[Context Validation: All critical information for continuation is captured, including user requests for specific changes to the Agents.md file and the need for a new branch for changes.]

[Recent Commands Analysis:

  • Last Agent Commands: "Start implementation," "Cancel: 'Delegate to cloud agent,'" "Create a new branch from master branch for these changes."
  • Tool Results Summary: No specific tool results were provided, but the user indicated a desire to create a new branch for ongoing work.
  • Pre-Summary State: The agent was actively discussing the implementation of changes to the Agents.md file and preparing to create a new branch when the token budget was exceeded.
  • Operation Context: The commands executed were directly related to the user's goal of refining the agent instructions and managing the codebase effectively.]
1. Conversation Overview: - Primary Objectives: The user requested a review and improvement of the Agents.md file, questioning the necessity of certain content and suggesting additional details to include. - Session Context: The conversation flowed from an initial review request to specific inquiries about content duplication, versioning, and linking instructions, culminating in a request to create a new branch for changes. - User Intent Evolution: The user shifted from seeking a review to questioning the value of specific content, ultimately focusing on practical implementation steps.
  1. Technical Foundation:
  • Angular: Latest version to be referenced in documentation.
  • Sentry.io: For error tracking and troubleshooting.
  • GitHub: For issue and PR management.
  1. Codebase Status:
  • File Name: entity-block.component.ts
  • Purpose: Part of the core application handling basic data types.
  • Current State: User is preparing to implement changes based on discussions.
  • Key Code Segments: Not specified in the conversation.
  • Dependencies: Related to the overall architecture of the application.
  1. Problem Resolution:
  • Issues Encountered: Questions about the value of certain instructions and potential duplication in documentation.
  • Solutions Implemented: Suggestions for improvements to the Agents.md file and the structure of agent instructions.
  • Debugging Context: No specific debugging issues were mentioned.
  • Lessons Learned: Importance of clarity and relevance in documentation.
  1. Progress Tracking:
  • Completed Tasks: None yet; discussions are ongoi...

Created from VS Code.


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

Co-authored-by: sleidig <1682541+sleidig@users.noreply.github.com>
Copilot AI changed the title [WIP] Start implementation of agents documentation Add AGENTS.md with agent instructions for replication-backend Feb 23, 2026
Copilot AI requested a review from sleidig February 23, 2026 18:30
Comment thread AGENTS.md
@@ -0,0 +1,101 @@
# Agent Instructions
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Found 2 issues:

1. Incorrect formatting, autoformat by running qlty fmt. [prettier:fmt]


2. Incorrect formatting, autoformat by running qlty fmt. [markdownlint:fmt]

Comment thread AGENTS.md
@@ -0,0 +1,101 @@
# Agent Instructions

This file provides guidance for AI coding agents working on the **replication-backend** repository.
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Line length [markdownlint:MD013]

Comment thread AGENTS.md

## Project Overview

This is a [NestJS](https://nestjs.com/) backend service (Node.js / TypeScript) that acts as a
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Line length [markdownlint:MD013]

Comment thread AGENTS.md
Key source directories:

| Path | Purpose |
|---|---|
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Found 4 issues:

1. Table column style [markdownlint:MD060]


2. Table column style [markdownlint:MD060]


3. Table column style [markdownlint:MD060]


4. Table column style [markdownlint:MD060]

Comment thread AGENTS.md
| `src/` | Application source code |
| `src/auth/` | Authentication (JWT, Basic, Cookie) |
| `src/permissions/` | CASL permission rules and evaluation |
| `src/restricted-endpoints/` | Proxied CouchDB endpoints with permission checks |
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Line length [markdownlint:MD013]

Comment thread AGENTS.md

- Look up error events or issues captured in the production or staging Sentry project.
- Investigate stack traces and breadcrumbs to understand the root cause of a bug.
- Correlate a user-reported error with a specific Sentry event before making code changes.
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Line length [markdownlint:MD013]

Comment thread AGENTS.md

## Architecture Notes

- The service overrides selected CouchDB endpoints (`_bulk_docs`, `_changes`, `_all_docs`, etc.)
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Line length [markdownlint:MD013]

Comment thread AGENTS.md
- The service overrides selected CouchDB endpoints (`_bulk_docs`, `_changes`, `_all_docs`, etc.)
to filter documents based on the requesting user's CASL rules.
- Permission rules are stored as documents in a dedicated CouchDB database (`PERMISSION_DB`).
They are loaded and cached by `RulesService`, which watches for changes via the `_changes` feed.
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Line length [markdownlint:MD013]

Comment thread AGENTS.md
to filter documents based on the requesting user's CASL rules.
- Permission rules are stored as documents in a dedicated CouchDB database (`PERMISSION_DB`).
They are loaded and cached by `RulesService`, which watches for changes via the `_changes` feed.
- The `_changes` endpoint is extended with a `lostPermissions` array so that clients know which
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Line length [markdownlint:MD013]

Comment thread AGENTS.md
- The `_changes` endpoint is extended with a `lostPermissions` array so that clients know which
documents to purge locally when they lose read access.
- Authentication supports JWT (bearer token), HTTP Basic, and cookie-based sessions.
- CouchDB is also exposed as a transparent reverse proxy at `/couchdb/` for admin tooling.
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Line length [markdownlint:MD013]

@sleidig
Copy link
Copy Markdown
Member

sleidig commented May 11, 2026

Those details are mostly covered in the README.md already. Recent research shows that an AGENTS.md is not adding value in that case.

@sleidig sleidig closed this May 11, 2026
@sleidig sleidig deleted the copilot/implement-agents-documentation branch May 11, 2026 14:49
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