packmind
AGENTS.md317 starsChanged 2 months agoApache-2.0View on GitHub
_# Nx Monorepo Structure This is an Nx monorepo containing applications and reusable packages. Local development uses Docker Compose to run all services (API, frontend, database, Redis, etc.): This starts the entire development environment. Docker Compose automatically provisions PostgreSQL and Redis - no manual setup required. ## Working with Nx The following commands apply for both NX apps and packages (use ./node_modules/.bin/nx show projects to list actual apps and packages.) - Test a project: ./node_modules/.bin/nx test <project-name> - Lint a…
Where files are headingNew AGENTS.md files have more rules about keeping secrets out of the code, and fewer about checking a change actually works.
Of the AGENTS.md files we read, the 11,773 first seen in the last six months, against the older ones: the kind of rule that gained most share, and the kind that lost most. About files like this in general, not this one, and an estimate, since a kind is a pattern in the words.
In this repository92 other files it gives its agents.
- apps/AGENTS.mdAGENTS.md
- packages/AGENTS.mdAGENTS.md
- apps/CLAUDE.mdCLAUDE.md
- CLAUDE.mdCLAUDE.md
- packages/CLAUDE.mdCLAUDE.md
- .cursor/rules/packmind/standard-backend-tests-redaction.mdcCursor rule
- .cursor/rules/packmind/standard-changelog.mdcCursor rule
- .cursor/rules/packmind/standard-code-comments.mdcCursor rule
- .cursor/rules/packmind/standard-compliance-logging-personal-information.mdcCursor rule
- .cursor/rules/packmind/standard-typescript-good-practices.mdcCursor rule
- agent-skill-frontmatter-auditSkill
- amplitude-listener-events-adoptionSkill
- cli-e2e-test-authoringSkill
- datadog-analysisSkill
- doc-auditSkill
- feature-specSkill
- feature-sprintSkill
- packmind-onboardSkill
- packmind-update-playbookSkill
- playbook-cli-auditSkill
- product-mapSkill
- qa-reviewSkill
- release-proprietarySkill
- upgrade-runtime-stackSkill
- working-with-playground-appSkill
- working-with-pm-design-kitSkill
- agentic-design-sessionSkill
- agentic-doc-ingestSkill
- agentic-feature-framingSkill
- agentic-orchestratorSkill
- agent-skill-frontmatter-auditSkill
- amplitude-listener-events-adoptionSkill
- cli-e2e-test-authoringSkill
- create-run-e2e-testsSkill
- creating-end-user-documentation-for-packmindSkill
- datadog-analysisSkill
- doc-auditSkill
- feature-flags-auditSkill
- feature-flags-authoringSkill
- feature-specSkill
- feature-sprintSkill
- how-to-write-typeorm-migrations-in-packmindSkill
- improve-claude-mdSkill
- packmind-onboardSkill
- packmind-update-playbookSkill
- playbook-cli-auditSkill
- product-mapSkill
- qa-reviewSkill
- release-proprietarySkill
- upgrade-runtime-stackSkill
- working-with-playground-appSkill
- working-with-pm-design-kitSkill
- agent-skill-frontmatter-auditSkill
- amplitude-listener-events-adoptionSkill
- cli-e2e-test-authoringSkill
- creating-end-user-documentation-for-packmindSkill
- datadog-analysisSkill
- doc-auditSkill
- feature-flags-auditSkill
- feature-flags-authoringSkill
- The first 60 shown.
The file
Show its rules and text
We split this AGENTS.md into the rules it gives an agent
29 rules. About 0 are common, 20 are distinctive, and 9 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈20
Distinctive · estimate
This author's own choices. Worth a look.
9
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 33
Test a project: ./node_modules/.bin/nx test <project-name>
- Very specific: line 36
Test affected projects: pnpm run test:staged
- Distinctive: line 46
When running commands, ensure you use the correct Node version (see .nvmrc at the project's root level)
- Very specific: line 47
When renaming or moving a file that is commited to git, use git mv instead of mv
- Very specific: line 48
Ensure the env variable PACKMIND_EDITION is properly set to oss
- Distinctive: line 53
Do NOT create branches yourself - let developers decide on branching strategy
- Very specific: line 59
Secrets Retrieval: Always use Configuration.getConfig() from @packmind/node-utils to access secrets in code
- Very specific: line 70
Use the ./node_modules/.bin/nx lint and ./node_modules/.bin/nx test commands on the apps and packages you've edited
- Distinctive: line 75
Before starting your work, make sure to review the coding standards relevant to your current task.
- Distinctive: line 77
Always consult the sections that apply to the technology, framework, or type of contribution you are working on.
- Distinctive: line 79
All rules and guidelines defined in these standards are mandatory and must be followed consistently.
- Distinctive: line 86
Avoid asserting on stubbed logger output like specific messages or call counts.
- Distinctive: line 87
Avoid testing that a method is a function.
- Distinctive: line 88
Avoid testing that registry components are defined.
- Distinctive: line 90
Never write dummy tests without logic (like expect.true.toBe(true))
- Distinctive: line 91
Remove explicit 'Arrange, Act, Assert' comments from tests and structure them so the setup, execution, and verification phases are clear …
- Distinctive: line 92
Use afterEach to call datasource.destroy() to clean up the test database whenever you initialize it in beforeEach
- Distinctive: line 93
Use afterEach(() => jest.clearAllMocks()) instead of beforeEach(() => jest.clearAllMocks()) to clear mocks after each test and prevent …
- Distinctive: line 94
Use assertive, verb-first unit test names instead of starting with 'should'
- Distinctive: line 95
Use expect(actualArray).toEqual(expectedArray) for deep array equality in Jest tests instead of manual length and index checks
- Distinctive: line 96
Use one expect per test case for better clarity and easier debugging.
- Distinctive: line 97
Use stubLogger() in Jest tests to get a fully typed PackmindLogger stub instead of manually creating a jest.Mocked<PackmindLogger> object …
- Very specific: line 105
Ensure all released versions have their corresponding comparison links defined at the bottom of the CHANGELOG.MD file in the format …
- Distinctive: line 113
When a code comment earns its place in TypeScript sources, and when the code should speak for itself :
- Distinctive: line 114
Write a comment only when the code cannot carry the information itself — a non-obvious constraint, a side effect invisible at the call …
- Distinctive: line 121
Never log personal information in clear text across all log levels.
- Distinctive: line 122
Use the standard masking format of first 6 characters followed by "*" for logging user emails.
- Very specific: line 129
Do not use Object.setPrototypeOf when defining errors.
- Very specific: line 130
When defining a presentation DTO that enriches a domain type, use an intersection type (DomainType & { extraField: T }) instead of manually …
≈ “Common” is an estimate: at least 1 in 5 of the 16,595 AGENTS.md files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
_# Nx Monorepo Structure
This is an Nx monorepo containing applications and reusable packages.
Core Technologies
- Runtime: Node.js (version specified in
.nvmrc) - Language: TypeScript
- Database: PostgreSQL with TypeORM for entity persistence
- Cache: Redis for caching
- Background Jobs: BullMQ for job queue management
- Testing: Jest with @swc/jest as test runner. Tests are run with
./node_modules/.bin/nx run <project-name>as detailed below.
Directory Structure
apps/- Deployable applications (API, frontend, CLI, e2e tests, docs)packages/- Reusable domain and infrastructure packages shared across apps.github/workflows/- CI/CD pipelines for build, test, quality checks, and deployment
Local Development Environment
Local development uses Docker Compose to run all services (API, frontend, database, Redis, etc.):
docker compose upThis starts the entire development environment. Docker Compose automatically provisions PostgreSQL and Redis - no manual setup required.
Working with Nx
The following commands apply for both NX apps and packages (use ./node_modules/.bin/nx show projects to list actual apps and packages.)
- Test a project:
./node_modules/.bin/nx test <project-name> - Lint a project:
./node_modules/.bin/nx lint <project-name> - Build a project:
./node_modules/.bin/nx build <project-name> - Test affected projects:
pnpm run test:staged - Lint affected projects:
pnpm run lint:staged
Code Quality
- Linting:
./node_modules/.bin/nx lint <project-name>runs ESLint, using the config fileeslint.config.mjs. - Formatting: Prettier is used for code formatting. You don't have to run it, it's set as a pre-commit hook.
Commands
- When running commands, ensure you use the correct Node version (see .nvmrc at the project's root level)
- When renaming or moving a file that is commited to git, use
git mvinstead ofmv - Ensure the env variable
PACKMIND_EDITIONis properly set tooss
Git Workflow
- The project uses trunk-based development (all work on
mainbranch) - Do NOT create branches yourself - let developers decide on branching strategy
- Each sub-task should have its own commit (as per Task splitting section)
Security
- Secrets Detection: GitGuardian runs in CI to detect leaked secrets
- Secrets Retrieval: Always use
Configuration.getConfig()from@packmind/node-utilsto access secrets in code - Secrets Storage: Infisical or environment variables are used for secrets management - never hardcode secrets
Documentation
Public end-user documentation is maintained in the apps/doc/ folder (Mintlify-based).
Task splitting
- For any task you perform, you MUST split it into multiple into sub-tasks which have a logical increment (eg: new endpoint, new component, new use case etc). When a task is done, run all the validation steps (lint, test, packmind etc) and ask me for validation of the work you did.
- Each sub task MUST have its own commit.
- Use the
./node_modules/.bin/nx lintand./node_modules/.bin/nx testcommands on the apps and packages you've edited
<!-- start: Packmind standards -->Packmind Standards
Before starting your work, make sure to review the coding standards relevant to your current task.
Always consult the sections that apply to the technology, framework, or type of contribution you are working on.
All rules and guidelines defined in these standards are mandatory and must be followed consistently.
Failure to follow these standards may lead to inconsistencies, errors, or rework. Treat them as the source of truth for how code should be written, structured, and maintained.
Standard: Backend Tests Redaction
This standard establishes best practices for writing backend tests using Jest in the Packmind monorepo. It focuses on clarity, maintainability, and consistency across test suites by emphasizing behavi... :
- Avoid asserting on stubbed logger output like specific messages or call counts; instead verify observable behavior or return values
- Avoid testing that a method is a function; instead invoke the method and assert its observable behavior
- Avoid testing that registry components are defined; instead test the actual behavior and functionality of the registry methods like registration, retrieval, and error handling
- Move 'when' contextual clauses from
it()into nesteddescribe('when...')blocks - Never write dummy tests without logic (like expect.true.toBe(true))
- Remove explicit 'Arrange, Act, Assert' comments from tests and structure them so the setup, execution, and verification phases are clear without redundant labels
- Use afterEach to call datasource.destroy() to clean up the test database whenever you initialize it in beforeEach
- Use afterEach(() => jest.clearAllMocks()) instead of beforeEach(() => jest.clearAllMocks()) to clear mocks after each test and prevent inter-test pollution
- Use assertive, verb-first unit test names instead of starting with 'should'
- Use expect(actualArray).toEqual(expectedArray) for deep array equality in Jest tests instead of manual length and index checks
- Use one expect per test case for better clarity and easier debugging; group related tests in describe blocks with shared setup in beforeEach
- Use stubLogger() in Jest tests to get a fully typed PackmindLogger stub instead of manually creating a jest.Mocked
<PackmindLogger>object with jest.fn() methods
Full standard is available here for further request: Backend Tests Redaction
Standard: Changelog
Maintain a consistent and well-structured CHANGELOG.MD file following the Keep a Changelog format to ensure all releases are properly documented with accurate version links and dates. This standard ap... :
- An entry of the CHANGELOG should not exceed 200 characters
- Ensure all released versions have their corresponding comparison links defined at the bottom of the CHANGELOG.MD file in the format [X.Y.Z]: https://github.com/PackmindHub/packmind/compare/release/
<previous>...release/X.Y.Z - Format all release dates using the ISO 8601 date format YYYY-MM-DD (e.g., 2025-11-21) to ensure consistent and internationally recognized date representation
- Maintain an [Unreleased] section at the top of the changelog with its corresponding link at the bottom pointing to HEAD to track ongoing changes between releases
Full standard is available here for further request: Changelog
Standard: Code comments
When a code comment earns its place in TypeScript sources, and when the code should speak for itself :
- Write a comment only when the code cannot carry the information itself — a non-obvious constraint, a side effect invisible at the call site, or why an alternative was rejected; never to restate what the code does.
Full standard is available here for further request: Code comments
Standard: Compliance - Logging Personal Information
This standard ensures personal information is not exposed in application logs across all environments (development, staging, and production). Logs are often forwarded to external processors such as Da... :
- Never log personal information in clear text across all log levels. Always mask sensitive data such as emails, phone numbers, IP addresses, and other personally identifiable information before logging.
- Use the standard masking format of first 6 characters followed by "*" for logging user emails. This ensures consistency across the codebase and makes it easier to audit logs for compliance.
Full standard is available here for further request: Compliance - Logging Personal Information
Standard: Typescript good practices
Generic practices that can be applied for all TS code in our app :
- Do not use
Object.setPrototypeOfwhen defining errors. - When defining a presentation DTO that enriches a domain type, use an intersection type (
DomainType & { extraField: T }) instead of manually re-declaring the domain type's fields, so that structural drift is caught at compile time.
Full standard is available here for further request: Typescript good practices
<!-- end: Packmind standards -->_Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

