monorepo
AGENTS.md302 starsChanged 12 days agoMITView on GitHub
This is the InversifyJS monorepo - a TypeScript dependency injection library ecosystem. The repository contains multiple packages organized into categories: The project follows a comprehensive testing strategy with multiple test types: Standard structure: - src/ - TypeScript source code - lib/ - ES Module build output ("type": "module") - vitest.config.mjs - Test configuration - Standard scripts: build, test, lint, format
- Installs packages
Where files are headingNew AGENTS.md files have more rules about keeping secrets out of the code, and fewer about code style.
Of the AGENTS.md files we read, the 31,700 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 repository22 other files it gives its agents.
- CLAUDE.mdCLAUDE.md
- .github/copilot-instructions.mdCopilot instructions
- openspec-apply-changeSkill
- openspec-archive-changeSkill
- openspec-exploreSkill
- openspec-proposeSkill
- openspec-sync-specsSkill
- openspec-apply-changeSkill
- openspec-archive-changeSkill
- openspec-exploreSkill
- openspec-proposeSkill
- openspec-sync-specsSkill
- openspec-apply-changeSkill
- openspec-archive-changeSkill
- openspec-exploreSkill
- openspec-proposeSkill
- openspec-sync-specsSkill
- openspec-apply-changeSkill
- openspec-archive-changeSkill
- openspec-exploreSkill
- openspec-proposeSkill
- openspec-sync-specsSkill
The file
Show its rules and text
We split this AGENTS.md into the rules it gives an agent
24 rules. About 0 are common, 16 are distinctive, and 8 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈16
Distinctive · estimate
This author's own choices. Worth a look.
8
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 66
Testing: Use Vitest with extensive unit and integration test coverage
- Distinctive: line 82
Follow the structured testing patterns documented in:
- Very specific: line 88
Vitest mocking: Use vitest.fn() and vitest.mock() for external dependencies
- Distinctive: line 89
Fixture classes: Create reusable test fixtures with static methods
- Distinctive: line 90
Clear naming: Use descriptive test names with "when called, and [condition]" pattern
- Distinctive: line 156
All packages use workspace protocol for internal dependencies
- Distinctive: line 158
No known security vulnerabilities in production dependencies
- Distinctive: line 163
Branch Naming: Use descriptive feature branch names
- Distinctive: line 164
Commit Messages: Follow conventional commit format
- Distinctive: line 165
Testing: All changes must include appropriate tests
- Very specific: line 166
Build: Ensure pnpm run build passes
- Very specific: line 167
Linting: Ensure pnpm run lint passes
- Distinctive: line 169
Documentation: Update relevant docs for public API changes
- Distinctive: line 178
Create package directory following existing structure
- Distinctive: line 181
Add appropriate tsconfig files
- Distinctive: line 183
Add to Turbo build pipeline if needed
- Distinctive: line 186
Check Turbo cache: builds are cached by input file hashes
- Distinctive: line 187
Verify TypeScript configurations for target output format
- Distinctive: line 188
Ensure all workspace dependencies are properly declared
- Very specific: line 189
Use --filter flag to isolate specific package issues
- Very specific: line 192
Use workspace:* protocol for internal dependencies
- Very specific: line 193
Run pnpm install after adding new dependencies
- Very specific: line 194
Check knip output for unused dependencies: pnpm run unused
- Very specific: line 202
Read docs/README.md inside that installed package first, then read the relevant pages from its docs/ directory before changing Turborepo …
≈ “Common” is an estimate: at least 1 in 5 of the 40,246 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
AGENTS.md
Project Overview
This is the InversifyJS monorepo - a TypeScript dependency injection library ecosystem. The repository contains multiple packages organized into categories:
- Framework packages: Core framework and HTTP functionality
- Container packages: DI container implementation, plugins, and examples
- Foundation packages: Shared tooling (ESLint, Prettier, TypeScript configs)
- Documentation packages: Code examples and website services
- Logger package: Logging utilities
- JSON Schema packages: Schema validation utilities
- Open API packages: OpenAPI integration
Build and Test Commands
Setup
# Install dependencies
pnpm install
# Build all packages
pnpm run build
# Run all tests
pnpm testDevelopment Workflow
# Format code
pnpm run format
# Lint code
pnpm run lint
# Run tests for a specific package
pnpm run --filter "@inversifyjs/package-name" test
# Run only unit tests
pnpm run test:unit
# Run only integration tests
pnpm run test:integration
# Run tests with coverage
pnpm run test:coverage
Working with Specific Packages
# Build a specific package
pnpm run --filter "@inversifyjs/package-name" build
# Test a specific package
pnpm run --filter "@inversifyjs/package-name" test
# Format a specific package
pnpm run --filter "@inversifyjs/package-name" formatCode Style Guidelines
- TypeScript: Strict mode enabled across all packages
- Testing: Use Vitest with extensive unit and integration test coverage
- Mocking: External modules are mocked using
vitest.fn() - Formatting: Prettier configuration shared via
@inversifyjs/foundation-prettier-config - Linting: ESLint configuration shared via
@inversifyjs/foundation-eslint-config
Testing Instructions
The project follows a comprehensive testing strategy with multiple test types:
Test Types
- Unit Tests (
*.spec.ts): Test individual functions/classes in isolation - Integration Tests (
*.int.spec.ts): Test component interactions - End-to-End Tests: Full system tests (some packages)
- Type Tests (
*.spec-d.ts): TypeScript type checking tests
Test Structure
Follow the structured testing patterns documented in:
- Unit Testing Guidelines
- Test Fixtures Guidelines
Key Testing Principles
- Four-layer describe structure: Class → Method → Input → Flow scopes
- Vitest mocking: Use
vitest.fn()andvitest.mock()for external dependencies - Fixture classes: Create reusable test fixtures with static methods
- Clear naming: Use descriptive test names with "when called, and [condition]" pattern
Running Tests
# Run all tests
pnpm test
# Run only unit tests
pnpm run test:unit
# Run only integration tests
pnpm run test:integration
# Run tests for uncommitted changes
pnpm run test:uncommitted
# Run with coverage
pnpm run test:coveragePackage Types and Structure
Core Library Packages
Main implementation packages with ESM-only builds:
/packages/framework/core/- Framework core/packages/container/libraries/- Container implementations/packages/logger/- Logging utilities
Standard structure:
src/- TypeScript source codelib/- ES Module build output ("type": "module")vitest.config.mjs- Test configuration- Standard scripts:
build,test,lint,format
Example Packages
Demonstration packages (usually no tests):
/packages/container/examples/- Usage examples/packages/docs/tools/- Code examples for documentation
Foundation Packages
Shared tooling and configuration:
/packages/foundation/tools/- Shared configs (ESLint, Prettier, TypeScript, etc.)
Documentation Services
Docusaurus-based documentation sites:
/packages/docs/services/- Documentation websites
Monorepo Architecture
Workspace Configuration
- Package Manager: pnpm with workspaces
- Build Tool: Turbo for task orchestration
- Dependency Management: Workspace protocol for internal dependencies
Build System
- TypeScript:
tsccompiles directly tolib/as ESM ("type": "module") - SWC: Fast TypeScript compilation for tests
- Turbo: Cached, parallelized builds
Quality Assurance
- Pre-commit Hooks: Husky with lint-staged
- Commitlint: Conventional commit messages
- Changesets: Version management and changelogs
Security Considerations
- All packages use workspace protocol for internal dependencies
- Development dependencies are pinned to specific versions
- No known security vulnerabilities in production dependencies
- Type-safe dependency injection prevents runtime injection attacks
Pull Request Guidelines
- Branch Naming: Use descriptive feature branch names
- Commit Messages: Follow conventional commit format
- Testing: All changes must include appropriate tests
- Build: Ensure
pnpm run buildpasses - Linting: Ensure
pnpm run lintpasses - Coverage: Maintain or improve test coverage
- Documentation: Update relevant docs for public API changes
Performance Considerations
- Turbo caching significantly speeds up repeated builds
Common Tasks
Adding a New Package
- Create package directory following existing structure
- Add to
pnpm-workspace.yaml - Configure
package.jsonwith standard scripts - Add appropriate tsconfig files
- Configure Vitest, ESLint, and Prettier
- Add to Turbo build pipeline if needed
Debugging Build Issues
- Check Turbo cache: builds are cached by input file hashes
- Verify TypeScript configurations for target output format
- Ensure all workspace dependencies are properly declared
- Use
--filterflag to isolate specific package issues
Working with Dependencies
- Use
workspace:*protocol for internal dependencies - Run
pnpm installafter adding new dependencies - Check
knipoutput for unused dependencies:pnpm run unused
<!-- BEGIN:turborepo-agent-rules -->This is NOT the Turborepo you know
Turborepo configuration, task behavior, and CLI commands can vary between installed versions and may differ from your training data. Resolve the turbo package from this file's directory or relevant workspace; in monorepos, it may not be visible from the repository root. For example, run node -p "require.resolve('turbo/package.json')" from a workspace that depends on turbo.
Read docs/README.md inside that installed package first, then read the relevant pages from its docs/ directory before changing Turborepo configuration or commands. Heed deprecation notices. These bundled docs match the installed package version and are available without network access.
This block is written and re-added by turbo before repository-scoped commands when an AI agent is detected. In the Turborepo source repository, its template is defined in crates/turborepo-cli/src/cli/agent_guidance.rs. Removing the managed block while updates are enabled means a later qualifying invocation will add it again. Set "agentGuidance": false in the root turbo.json or turbo.jsonc to opt out; this does not remove an existing block. Keep the block committed with your work to avoid an uncommitted change on the next agent invocation.
<!-- END:turborepo-agent-rules -->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.

