Analyzes codebases to identify domain boundaries, conventions, and patterns. Use PROACTIVELY when discovering domains in unfamiliar codebases.
Analyzes codebases to discover domain structure, naming conventions, and patterns. Use proactively when exploring unfamiliar projects to extract policy rules from identified boundaries and integration points.
/plugin marketplace add rcrsr/repmat/plugin install repmat@rcrsrAnalyzes arbitrary codebases to discover domain structure, naming conventions, and patterns suitable for policy extraction.
["§WFT"]
Directory structure analysis:
Pattern detection:
*.service.ts, *_test.py, *.spec.tsxroutes/, services/, models/Convention indicators:
## Codebase Analysis
**Root:** /path/to/project
**Languages:** TypeScript (primary), Python (secondary)
**Frameworks:** React, FastAPI, Nx
## Discovered Domains
### Domain: backend-api
- **Boundary:** `apps/api-service/`
- **Languages:** Python
- **File patterns:** `*.py`, `!*_test.py`
- **Conventions detected:**
- snake_case for modules and functions
- PascalCase for classes
- Type hints on all public functions
- **Integration points:** Shared types with frontend via OpenAPI
- **Recommended policy prefix:** §BE
### Domain: frontend-web
- **Boundary:** `apps/web-client/src/`
- **Languages:** TypeScript, TSX
- **File patterns:** `*.tsx`, `*.ts`
- **Conventions detected:**
- PascalCase components
- camelCase utilities
- Barrel exports in index.ts
- **Integration points:** API client from generated types
- **Recommended policy prefix:** §FE
### Domain: shared-types
- **Boundary:** `packages/shared/`
- **Languages:** TypeScript
- **File patterns:** `*.ts`
- **Conventions detected:**
- Interface-first design
- Re-exported from index.ts
- **Integration points:** Imported by both frontend and backend codegen
- **Recommended policy prefix:** §TYPES
## Cross-Domain Patterns
- OpenAPI spec generates both Python and TypeScript clients
- Shared validation schemas in `packages/validation/`
- Common error codes defined in `packages/errors/`
## Recommendations
**Domain triplets to create (in order):**
1. §TYPES - Shared type definitions (no dependencies)
2. §BE - Backend API patterns (depends on §TYPES)
3. §FE - Frontend patterns (depends on §TYPES)
4. §INFRA - Infrastructure patterns (references §BE)
**Additional observations:**
- Monorepo structure suggests §MONO policy needed
- Test patterns consistent enough for §TEST policy
- No documentation conventions detected
Designs feature architectures by analyzing existing codebase patterns and conventions, then providing comprehensive implementation blueprints with specific files to create/modify, component designs, data flows, and build sequences