Configuration
Config File Location
Section titled “Config File Location”Repotype looks for configuration in this order:
repotype.yaml(preferred)repo-schema.yaml(legacy, still supported)
Place the file at your repository root.
Basic Structure
Section titled “Basic Structure”version: "1"
# Inherit from other configsextends: - ./profiles/base.yaml
# Default behaviordefaults: unmatchedFiles: deny # deny | allow
# Folder structure rulesfolders: - id: folder-rule-id path: src # ...
# File rulesfiles: - id: file-rule-id glob: "src/**/*.ts" # ...
# External tool pluginsplugins: - id: markdownlint # ...
# Operational settingsoperations: hooks: enabled: true watcher: enabled: falseInheritance with extends
Section titled “Inheritance with extends”Configs can inherit from other files:
version: "1"extends: - ../../profiles/base/repotype.yaml - ../../profiles/typescript/repotype.yamlChild configs override parent values. Arrays are merged.
Defaults
Section titled “Defaults”Control behavior for files that don’t match any rule:
defaults: # deny = unmatched files are errors (recommended) # allow = unmatched files emit suggestions only unmatchedFiles: denyFile Rules
Section titled “File Rules”See File Rules Guide for complete documentation.
files: - id: typescript-source glob: "src/**/*.ts" pathCase: kebab # kebab | camel | pascal | snake pathPattern: '^src/[a-z-/]+\.ts$'
- id: markdown-docs glob: "docs/**/*.md" frontmatter: required: [title, description] schema: schemas/doc.schema.json
- id: config-json glob: "config/*.json" schema: kind: json schema: schemas/config.schema.jsonFolder Rules
Section titled “Folder Rules”See Folder Rules Guide for complete documentation.
folders: - id: docs-structure path: docs requiredFolders: - guides - reference allowedFolders: - guides - reference - examples requiredFiles: - README.mdPlugins
Section titled “Plugins”Wrap external tools (linters, formatters) as Repotype plugins:
plugins: - id: markdownlint enabled: true install: - cmd: "pnpm add -D markdownlint-cli2" validate: cmd: "pnpm exec markdownlint-cli2 '**/*.md'" severityOnFailure: error
- id: biome enabled: true validate: cmd: "pnpm exec biome check ." fix: cmd: "pnpm exec biome check --write ."Operations
Section titled “Operations”Configure git hooks and watchers:
operations: hooks: enabled: true hook: both # pre-commit | pre-push | both
watcher: enabled: true schedule: "*/15 * * * *" queueDir: sort_queue minErrors: 3 logFile: .repotype/logs/watcher.logApply operations with:
npx repotype apply .Validation
Section titled “Validation”Validate your config syntax:
npx repotype validate . --jsonFull Example
Section titled “Full Example”version: "1"
defaults: unmatchedFiles: deny
folders: - id: src-structure path: src requiredFolders: [components, hooks, utils] pathCase: kebab
- id: docs-structure path: docs requiredFiles: [README.md] allowedFolders: [guides, reference, api]
files: - id: typescript glob: "src/**/*.{ts,tsx}" pathCase: kebab
- id: components glob: "src/components/**/*.tsx" requiredCompanion: - pattern: "*.test.tsx"
- id: markdown-docs glob: "docs/**/*.md" frontmatter: required: [title]
- id: root-readme glob: "README.md"
- id: package-json glob: "package.json" schema: kind: json schema: schemas/package.schema.json
plugins: - id: eslint enabled: true validate: cmd: "pnpm exec eslint ." fix: cmd: "pnpm exec eslint --fix ."
operations: hooks: enabled: true hook: pre-commit