packmind / packages
CLAUDE.md317 starsChanged 2 months agoApache-2.0View on GitHub
This directory contains reusable domain and infrastructure packages shared across applications. Every packages/*/project.json declares an env:* tag, and @nx/enforce-module-boundaries in the root eslint.config.mjs turns those tags into hard import rules: A lint error about module boundaries usually means code belongs in a differently-tagged package, not that the rule needs an exception. Domain packages (accounts, spaces, standards, skills, commands, deployments, git, coding-agent, llm) follow a common shape. Only the first four lines are present in every one of them; the rest…
In this repository92 other files it gives its agents.
- AGENTS.mdAGENTS.md
- apps/AGENTS.mdAGENTS.md
- packages/AGENTS.mdAGENTS.md
- apps/CLAUDE.mdCLAUDE.md
- 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
We split this CLAUDE.md into the rules it gives an agent
3 rules. About 0 are common, 1 is distinctive, and 2 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈1
Distinctive · estimate
This author's own choices. Worth a look.
2
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 12
test-utils: - Test factories, fixtures, and utilities for consistent test data creation
- Very specific: line 50
Every packages/*/project.json declares an env:* tag, and @nx/enforce-module-boundaries in the root eslint.config.mjs turns those tags into …
- Very specific: line 121
All seven have an explicit "@packmind/<pkg>/test" entry in tsconfig.base.json (plus the legacy @packmind/recipes/test, which points at …
≈ “Common” is an estimate: at least 1 in 5 of the 12,729 CLAUDE.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
Packages
This directory contains reusable domain and infrastructure packages shared across applications.
Package Categories
Core Infrastructure
- types - Shared TypeScript types and interfaces used across packages and apps
- logger - Logging utilities with console and structured output support
- node-utils - Shared backend framework:
BaseHexa/HexaRegistry, scoped repositories, config, cache, jobs, SSE, mail - test-utils - Test factories, fixtures, and utilities for consistent test data creation
- migrations - TypeORM database migrations for schema evolution
Domain Packages
- accounts - User account management, authentication, and user profiles
- spaces - Workspace management, space members, roles, and permissions
- standards - Coding standards creation, storage, and retrieval
- commands - Multi-step coding command definitions and execution (formerly "recipes")
- skills - AI agent skill definitions and management
- editions - Product edition management (OSS, Enterprise, etc.)
- feature-flags - Shared, browser-safe feature-flag registry and decision logic (consumed by both frontend and backend)
- playbook-change-applier - Applies proposed changes to playbook artifacts (standards, commands, skills)
Integration & Deployment
- git - Git repository operations for standards and command deployment
- deployments - Deployment pipeline for distributing standards, commands, and skills to AI agents
- coding-agent - AI coding agent integration and rendering for multiple agent types (Claude Code, Cursor, etc.)
Language Analysis
- linter-ast - Abstract syntax tree (AST) analysis and manipulation utilities
- linter-execution - Linting rule execution engine for coding standards
- llm - Large language model integration for AI-powered features
Frontend
- frontend - Shared
data-testidenums used by bothapps/frontendcomponents andapps/e2e-testspage objects - ui - The PM design kit — see the
working-with-pm-design-kitskill
Supporting
- assets - Static assets: fonts, icons, images, styles (tree-sitter WASM grammars live in
linter-ast/res/, not here) - integration-tests - Cross-package integration test suites (deployments, standards, tracked repositories, etc.)
Environment Tags and Import Boundaries
Every packages/*/project.json declares an env:* tag, and @nx/enforce-module-boundaries in the
root eslint.config.mjs turns those tags into hard import rules:
| Tag | May depend on |
env:node | anything |
env:shared | env:shared, env:node |
env:browser | env:shared, env:browser — never env:node |
env:shared:types,assets,editions,feature-flagsenv:browser:ui,frontendenv:node: everything else
A lint error about module boundaries usually means code belongs in a differently-tagged package, not that the rule needs an exception.
Package Layout
Domain packages (accounts, spaces, standards, skills, commands, deployments, git,
coding-agent, llm) follow a common shape. Only the first four lines are present in every one of
them; the rest exist where the package needs them, so check before assuming a directory is there:
src/<Name>Hexa.ts always — entry point, extends BaseHexa
src/application/adapter/<Name>Adapter.ts always — plural `adapters/` in `spaces`
src/application/services/ most — `llm` uses `src/infra/services/` instead
src/index.ts always — public barrel; nothing is importable until exported here
src/application/useCases/<useCaseName>/ most — `spaces` uses flat `src/application/usecases/<UseCaseName>.ts` files instead of one folder per use case
src/domain/repositories|useCases|errors/ most
src/domain/entities/ only accounts and standards
src/infra/schemas/ persistence packages only — index.ts barrel exporting a <name>Schemas array of TypeORM EntitySchemas
src/infra/repositories/ persistence packages, plus `coding-agent` (deployer implementations, not persisted entities)
src/application/jobs/ + src/domain/jobs/ only commands, deployments, git
test/ only the 7 packages listed belowBaseHexa, BaseService and HexaRegistry come from @packmind/node-utils
(packages/node-utils/src/hexa/).
Two of the packages above are not persistence domains and diverge most: coding-agent has no
infra/schemas/ and no test/ (its infra/repositories/ holds deployer implementations, not
persisted entities — see its own CLAUDE.md), and llm has schemas but no test/.
Architecture rules live in packages/.claude/rules/packmind/
The behavioural conventions for this layout are Packmind standards, not documented here — consult them rather than inferring from neighbouring code:
- Use Case Architecture Patterns — contract-per-file in
packages/types/src/<domain>/contracts/, theAbstractMemberUseCase/AbstractAdminUseCase/AbstractSpaceMemberUseCasesplit - Port-Adapter Cross-Domain Integration — how one domain may reach another
- Scoped Repository Patterns —
OrganizationScopedRepository/SpaceScopedRepository - Domain Events
- Domain Error Handling — error families (domain / internal / upstream) mapped centrally by
DomainExceptionFilter - Back-end repositories SQL queries using TypeORM
- Back-end TypeScript Clean Code Practices
Cross-Package Conventions
Entity factories: the /test subpath
Packages that own persisted entities ship their factories in packages/<pkg>/test/ (an index.ts
plus one <entity>Factory.ts per entity), imported as @packmind/<pkg>/test — for example
import { standardFactory } from '@packmind/standards/test'.
Exactly seven packages have this subpath: accounts, commands, deployments, git, skills,
spaces, standards. There is no @packmind/coding-agent/test or @packmind/llm/test — don't
import one. (packages/node-utils/test/ exists but holds shared test suites, not factories, and is
not exposed as a subpath.)
All seven have an explicit "@packmind/<pkg>/test" entry in tsconfig.base.json (plus the legacy
@packmind/recipes/test, which points at packages/commands/test/index.ts). If a new /test
subpath fails to resolve under Jest, add the alias — jest.config.ts maps modules from those
paths.
Spec files import factories from there; production code must not. For the split between these and the
generic helpers in @packmind/test-utils, see test-utils/CLAUDE.md.
Branded IDs
Entity identifiers are never bare strings. Each one is declared in @packmind/types as a branded
type plus a creator, following packages/types/src/skills/SkillId.ts:
import { Branded, brandedIdFactory } from '../brandedTypes';
export type SkillId = Branded<'SkillId'>;
export const createSkillId = brandedIdFactory<SkillId>();The Branded / brandedIdFactory helpers live in packages/types/src/brandedTypes.ts.
Working with Packages
The generic nx build|test|lint <name> commands are in the root CLAUDE.md, which already covers
packages. What it does not tell you:
Two Nx project names differ from their directory name:
packages/frontendisfrontend-lib(plainfrontendis the app) andpackages/integration-testsis@packmind/integration-tests.Most targets are inferred by Nx plugins rather than declared:
@nx/jest/pluginderivestestfrom a package'sjest.config.tsand@nx/eslint/pluginderiveslint(seepluginsinnx.json). So aproject.jsonthat lists onlybuildstill has atesttarget — check with./node_modules/.bin/nx show project <package-name>instead of readingproject.json.Every package declares
typecheck(tsc --noEmit). Mostbuildtargets depend on it via the@nx/js:swcexecutor'stargetDefaultsinnx.json, so building one of those packages type checks it; the target is one line —"typecheck": {}— inheriting its command from the same file.migrationshas nobuildtarget at all — its esbuild output is produced bybundle(@nx/esbuild:esbuild), whosetargetDefaultsdepend on^buildbut not ontypecheck, sonx bundle migrationsdoes not type check. Runnx typecheck migrationsseparately.
uiis the one package whosebuildis not purely inferred: it declaresdependsOnso the vite build gates ontypechecktoo. Its build output goes todist/packages/packmind-ui.
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.

