How to roll Fensu out on a new repo, a small existing repo, or a large existing one.
Fensu’s defaults describe a coherent target architecture. How you turn them on
depends on where you are starting. New / small repos are where Fensu
pays off fastest; big legacy repos(e.g. 100k+ lines) need more judgment.
New repositories
The defaults are calibrated for a fresh repo.
fensu init --yes --name my_package
fensu init scaffolds a src/ package, a tests/ directory, and a
fensu.toml with the full ruleset selected. This is where Fensu is easiest to
live with, because you never accumulate drift in the first place.
Small existing repositories
This is the strongest first experience. Whether the repo is tidy or very
inconsistent, adoption is mostly a single pass that leaves it on a coherent architecture.
Initialize in the directory that holds your pyproject.toml:
fensu init --yes
See the drift:
fensu check
Drive the faults to zero. Hand the output to a coding agent and let it work
through them, since each diagnostic already states the contract and the fix:
Run `fensu check` and fix every fault. If a fault looks like it needs areal design decision, leave it and list it for me instead of forcing a change.
Most faults are pretty mechanical to fix, but open enough that they can’t be auto fixed.
The few that would require a genuine structural decision are worth pausing on rather than rushing.
Defer the handful you want to think about. Record them as explicit
rule exceptions or ignore
entries so the run is green and the deferral is visible, then come back to them
deliberately.
The result is a repo that conforms to a coherent architecture and stays that way,
for very little up-front effort.
Large existing repositories
Pointing the full default set at a large, established codebase surfaces a lot at
once. That is real drift against the target architecture, not the tool
overreacting. But a big-bang refactor to zero faults is usually the wrong response,
and it is rarely safe.Here the goal is not to bend the codebase to Fensu’s defaults. It is to encode the
architecture you actually have and want.
Enforce as aggressively as you can refactor safely, and no more. If your test
suite would not catch a bad structural move, do not let the linter pressure you
into one.
Custom rules are the main lever. Where a default rule does not fit how part of
the repo is legitimately built, do not twist the code to pass it. Write a
custom rule that states the invariant you genuinely care
about. You capture real architectural intent as an executable check instead of
paying for a disruptive migration, and the rule flows into your generated
agent guidance like any core rule.Supporting configuration keeps everything else visible while you decide:
ownership_roots when established
domains begin below structural grouping directories or at mixed physical depths.
ignore for a default that is wrong for
this repo globally.
warn for a policy you want measured
but not blocking yet.
rule_ignores for a justified
selector/path intersection while keeping rules and project context active.
Evaluation targeting to enforce
the regions you trust while keeping the rest as project context.
Every deviation lives in configuration or a custom rule,
where a reviewer can see it, rather than scattered through the source. See
Philosophy for why that matters.
Duplicated code in an existing repository
fensu dupes is advisory, so you can add it on day one without
changing what CI blocks. An established repository usually has a backlog of
copies. Treat that backlog as a record of past drift, not as a to-do list that
must reach zero.
Take a baseline. Run the report once and keep the output with the
adoption notes:
fensu dupes --top 50
Triage the top clusters. Sort each one into genuine (one concept with
no owner) or intentional (a deliberate mirror or a contract-forced copy).
Use --diff to find copies that have already diverged. A fix present in only
one copy is a bug report, not a refactor.
Record the diagnosis for each genuine cluster before consolidating it,
in an issue or the adoption notes. Merging the copies removes the evidence.
Record intentional copies in [dupes]: an
allowlist entry for mirrors or a contract_exemptions entry for forced
methods, each with a reason.
Consolidate in focused batches. Take one cluster or one area at a time,
add characterization tests first when coverage is weak, and let
fensu check decide where the shared owner lives.
Catch new duplication in review. Run the report on every branch:
fensu dupes --since origin/main --diff
Do not chase zero. The goal is that new duplication gets noticed and old
duplication gets a recorded decision. See
Duplicated code for a worked example.
{"docsConfig":{"theme":"mint","$schema":"https://mintlify.com/docs.json","name":"Fensu","description":"Fensu enforces architectural boundaries, repository structure, code shape, and test conventions across Python, Rust, TypeScript, and Svelte projects.","colors":{"primary":"#E84B03","light":"#FF6A2B","dark":"#C23D02"},"logo":{"light":"https://mintcdn.com/fensu-docs/dfspBImhxx3Pgza7/fensu_light_logo_trim.png?fit=max\u0026auto=format\u0026n=dfspBImhxx3Pgza7\u0026q=85\u0026s=2524c9238fb6f68a1bd720ea42182eba","dark":"https://mintcdn.com/fensu-docs/dfspBImhxx3Pgza7/fensu_dark_logo_trim.png?fit=max\u0026auto=format\u0026n=dfspBImhxx3Pgza7\u0026q=85\u0026s=d4e6fed0b482f0025fc6dded5a966005"},"favicon":"https://mintcdn.com/fensu-docs/CQ9pOV7_AS826Rko/fensu_favicon_square.png?fit=max\u0026auto=format\u0026n=CQ9pOV7_AS826Rko\u0026q=85\u0026s=ae5419b18f642493523fbf248529fca3","footer":{"socials":{"github":"https://github.com/sqlstack-io/fensu"}},"markdown":{"instructions":["Read the Fensu Quickstart before onboarding a repository.","Use fensu init --yes for an existing repository, or fensu init --yes --name NAME for an empty repository. Use --no-skills only when configuration-only initialization is explicitly required.","For repository-wide Fensu onboarding, detect and configure every confidently supported target; a detected SvelteKit project belongs in that scope alongside Python targets.","For narrowly scoped work, do not introduce unrelated analyzer targets. Existing configured targets always apply.","Do not call Fensu onboarding complete until fensu skills --check succeeds."]},"styling":{"latex":false},"navigation":{"pages":[]}},"deployment":{"deploymentMetadataValue":{"subdomain":"fensu-docs","hasAudioNarration":false,"actualSubdomain":"fensu-docs","customDomains":["docs.fensu.dev"],"gitSource":{"type":"github","owner":"sqlstack-io","repo":"fensu-docs","deployBranch":"main","contentDirectory":"","isPrivate":true,"mountPath":"","label":"","_id":"6b10f7309ffae5051c419eb4"},"entitlements":{},"buildId":"6ae2f87241d6803c466ed46f","clientVersion":"0.0.4458","searchFilterCounts":[{"language":"default","tag":"Concepts","count":11},{"language":"default","tag":"CLI Reference","count":8},{"language":"default","tag":"Getting Started","count":4},{"language":"default","tag":"Additional Analyzers","count":2},{"language":"default","tag":"Native Rule Packs","count":2},{"language":"default","tag":"API Reference","count":1}]},"assistantConfig":{"enableAskAiButton":false,"enableStarterQuestions":false,"enableContextualStarterQuestions":false,"enableAskAiSearchBar":true},"basePath":"","hasChatPermissions":false,"hasWebMcpPermissions":false,"toggles":[{"name":"kill-isr","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"agent-mintlify-slack","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"agent-integrations-settings","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"rbac-expansion","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automations-pr-grouping","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"custom-prefix","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"analytics-v7","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"user-flows-analytics","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"no-publish-flow","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"snapshot-serving-live","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"stripTemperatureMiddleware","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"support-platform-pylon-zendesk","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"snapshot-serving","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"instant-rollback","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"granular-notifications-server","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"granular-notifications","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automations-fable","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"fixed-ai-action-pricing","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automation-resolve-merge-conflict","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"scoped-publishing","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"mintql","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"page-level-analytics","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"editor-version-history-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"billing-page-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"full-page-search","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workspace-projects","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"fork-pr-previews","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"revalidation-jwt","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"hobby-abuse-scan","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"dashboard-inbox","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"turbopuffer-dual-write","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"approve-review-flow","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"editor-metadata","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"turbopuffer-serve","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"live-agents","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"starter-pricing","enabled":true,"variant":{"name":"control","enabled":true,"payload":{"type":"string","value":"control"},"feature_enabled":true},"impressionData":false},{"name":"llms-txt-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"auth-vite-origin","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false}],"starterQuestions":[],"googleFontsInlined":false},"customCss":[]}
{"page":{"pagePath":"adoption","slug":"/adoption","pageMetadata":{"title":"Adopting Fensu","description":"How to roll Fensu out on a new repo, a small existing repo, or a large existing one.","href":"/adoption"},"description":{"compiledSource":"\"use strict\";\nconst {jsx: _jsx} = arguments[0];\nconst {useMDXComponents: _provideComponents} = arguments[0];\nfunction _createMdxContent(props) {\n const _components = {\n p: \"p\",\n ..._provideComponents(),\n ...props.components\n };\n return _jsx(_components.p, {\n children: \"How to roll Fensu out on a new repo, a small existing repo, or a large existing one.\"\n });\n}\nfunction MDXContent(props = {}) {\n const {wrapper: MDXLayout} = {\n ..._provideComponents(),\n ...props.components\n };\n return MDXLayout ? _jsx(MDXLayout, {\n ...props,\n children: _jsx(_createMdxContent, {\n ...props\n })\n }) : _createMdxContent(props);\n}\nreturn {\n default: MDXContent\n};\n","frontmatter":{},"scope":{}},"pageType":"default","mdx":{"mdxSource":{"compiledSource":"\"use strict\";const{Fragment:_Fragment,jsx:_jsx,jsxs:_jsxs}=arguments[0];const{useMDXComponents:_provideComponents}=arguments[0];function _createMdxContent(props){const _components={a:`a`,code:`code`,em:`em`,li:`li`,ol:`ol`,p:`p`,pre:`pre`,span:`span`,strong:`strong`,ul:`ul`,..._provideComponents(),...props.components},{CodeBlock,Heading,Warning}=_components;if(!CodeBlock)_missingMdxReference(`CodeBlock`,true);if(!Heading)_missingMdxReference(`Heading`,true);if(!Warning)_missingMdxReference(`Warning`,true);return _jsxs(_Fragment,{children:[_jsx(_components.p,{children:`Fensu’s defaults describe a coherent target architecture. How you turn them on\ndepends on where you are starting. New / small repos are where Fensu\npays off fastest; big legacy repos(e.g. 100k+ lines) need more judgment.`}),`\n`,_jsx(Heading,{level:`2`,id:`new-repositories`,children:`New repositories`}),`\n`,_jsx(_components.p,{children:`The defaults are calibrated for a fresh repo.`}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`1`,language:`shellscript`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`shellscript`,children:_jsxs(_components.code,{language:`shellscript`,numberOfLines:`1`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#DCDCAA`},children:`fensu`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` init`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` --yes`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` --name`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` my_package`})]}),`\n`]})})}),`\n`,_jsxs(_components.p,{children:[_jsx(_components.a,{href:`/cli/init`,children:_jsx(_components.code,{children:`fensu init`})}),` scaffolds a `,_jsx(_components.code,{children:`src/`}),` package, a `,_jsx(_components.code,{children:`tests/`}),` directory, and a\n`,_jsx(_components.code,{children:`fensu.toml`}),` with the full ruleset selected. This is where Fensu is easiest to\nlive with, because you never accumulate drift in the first place.`]}),`\n`,_jsx(Heading,{level:`2`,id:`small-existing-repositories`,children:`Small existing repositories`}),`\n`,_jsx(_components.p,{children:`This is the strongest first experience. Whether the repo is tidy or very\ninconsistent, adoption is mostly a single pass that leaves it on a coherent architecture.`}),`\n`,_jsxs(_components.ol,{children:[`\n`,_jsxs(_components.li,{children:[`\n`,_jsxs(_components.p,{children:[_jsx(_components.strong,{children:`Initialize`}),` in the directory that holds your `,_jsx(_components.code,{children:`pyproject.toml`}),`:`]}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`1`,language:`shellscript`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`shellscript`,children:_jsxs(_components.code,{language:`shellscript`,numberOfLines:`1`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#DCDCAA`},children:`fensu`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` init`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` --yes`})]}),`\n`]})})}),`\n`]}),`\n`,_jsxs(_components.li,{children:[`\n`,_jsx(_components.p,{children:_jsx(_components.strong,{children:`See the drift:`})}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`1`,language:`shellscript`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`shellscript`,children:_jsxs(_components.code,{language:`shellscript`,numberOfLines:`1`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#DCDCAA`},children:`fensu`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` check`})]}),`\n`]})})}),`\n`]}),`\n`,_jsxs(_components.li,{children:[`\n`,_jsxs(_components.p,{children:[_jsx(_components.strong,{children:`Drive the faults to zero.`}),` Hand the output to a coding agent and let it work\nthrough them, since each diagnostic already states the contract and the fix:`]}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`3`,language:`text`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`text`,children:_jsxs(_components.code,{language:`text`,numberOfLines:`3`,children:[_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:\"Run `fensu check` and fix every fault. If a fault looks like it needs a\"})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`real design decision, leave it and list it for me instead of forcing a change.`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{})})]})})}),`\n`,_jsx(_components.p,{children:`Most faults are pretty mechanical to fix, but open enough that they can’t be auto fixed.\nThe few that would require a genuine structural decision are worth pausing on rather than rushing.`}),`\n`]}),`\n`,_jsxs(_components.li,{children:[`\n`,_jsxs(_components.p,{children:[_jsx(_components.strong,{children:`Defer the handful you want to think about.`}),` Record them as explicit\n`,_jsx(_components.a,{href:`/concepts/configuration#exact-rule-exceptions`,children:`rule exceptions`}),` or `,_jsx(_components.code,{children:`ignore`}),`\nentries so the run is green and the deferral is visible, then come back to them\ndeliberately.`]}),`\n`]}),`\n`]}),`\n`,_jsx(_components.p,{children:`The result is a repo that conforms to a coherent architecture and stays that way,\nfor very little up-front effort.`}),`\n`,_jsx(Heading,{level:`2`,id:`large-existing-repositories`,children:`Large existing repositories`}),`\n`,_jsx(_components.p,{children:`Pointing the full default set at a large, established codebase surfaces a lot at\nonce. That is real drift against the target architecture, not the tool\noverreacting. But a big-bang refactor to zero faults is usually the wrong response,\nand it is rarely safe.`}),`\n`,_jsx(_components.p,{children:`Here the goal is not to bend the codebase to Fensu’s defaults. It is to encode the\narchitecture you actually have and want.`}),`\n`,_jsx(Warning,{children:_jsx(_components.p,{children:`Enforce as aggressively as you can refactor safely, and no more. If your test\nsuite would not catch a bad structural move, do not let the linter pressure you\ninto one.`})}),`\n`,_jsxs(_components.p,{children:[_jsx(_components.strong,{children:`Custom rules are the main lever.`}),` Where a default rule does not fit how part of\nthe repo is legitimately built, do not twist the code to pass it. Write a\n`,_jsx(_components.a,{href:`/concepts/custom-rules`,children:`custom rule`}),` that states the invariant you genuinely care\nabout. You capture real architectural intent as an executable check instead of\npaying for a disruptive migration, and the rule flows into your generated\n`,_jsx(_components.a,{href:`/cli/skills`,children:`agent guidance`}),` like any core rule.`]}),`\n`,_jsx(_components.p,{children:`Supporting configuration keeps everything else visible while you decide:`}),`\n`,_jsxs(_components.ul,{children:[`\n`,_jsxs(_components.li,{children:[_jsx(_components.a,{href:`/concepts/configuration#ownership-roots`,children:_jsx(_components.code,{children:`ownership_roots`})}),` when established\ndomains begin below structural grouping directories or at mixed physical depths.`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.a,{href:`/concepts/configuration#selection`,children:_jsx(_components.code,{children:`ignore`})}),` for a default that is wrong for\nthis repo globally.`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.a,{href:`/concepts/configuration#the-warn-tier`,children:_jsx(_components.code,{children:`warn`})}),` for a policy you want measured\nbut not blocking yet.`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.a,{href:`/concepts/configuration#exact-rule-exceptions`,children:_jsx(_components.code,{children:`rule_exceptions`})}),` for isolated,\njustified findings.`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.a,{href:`/concepts/configuration#path-scoped-rule-ignores`,children:_jsx(_components.code,{children:`rule_ignores`})}),` for a justified\nselector/path intersection while keeping rules and project context active.`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.a,{href:`/concepts/configuration#evaluation-targeting`,children:`Evaluation targeting`}),` to enforce\nthe regions you trust while keeping the rest as project context.`]}),`\n`]}),`\n`,_jsxs(_components.p,{children:[`Every deviation lives in `,_jsx(_components.a,{href:`/concepts/configuration`,children:`configuration`}),` or a custom rule,\nwhere a reviewer can see it, rather than scattered through the source. See\n`,_jsx(_components.a,{href:`/philosophy`,children:`Philosophy`}),` for why that matters.`]}),`\n`,_jsx(Heading,{level:`2`,id:`duplicated-code-in-an-existing-repository`,children:`Duplicated code in an existing repository`}),`\n`,_jsxs(_components.p,{children:[_jsx(_components.a,{href:`/cli/dupes`,children:_jsx(_components.code,{children:`fensu dupes`})}),` is advisory, so you can add it on day one without\nchanging what CI blocks. An established repository usually has a backlog of\ncopies. Treat that backlog as a record of past drift, not as a to-do list that\nmust reach zero.`]}),`\n`,_jsxs(_components.ol,{children:[`\n`,_jsxs(_components.li,{children:[`\n`,_jsxs(_components.p,{children:[_jsx(_components.strong,{children:`Take a baseline.`}),` Run the report once and keep the output with the\nadoption notes:`]}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`1`,language:`shellscript`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`shellscript`,children:_jsxs(_components.code,{language:`shellscript`,numberOfLines:`1`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#DCDCAA`},children:`fensu`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` dupes`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` --top`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:` 50`})]}),`\n`]})})}),`\n`]}),`\n`,_jsxs(_components.li,{children:[`\n`,_jsxs(_components.p,{children:[_jsx(_components.strong,{children:`Triage the top clusters.`}),` Sort each one into `,_jsx(_components.em,{children:`genuine`}),` (one concept with\nno owner) or `,_jsx(_components.em,{children:`intentional`}),` (a deliberate mirror or a contract-forced copy).\nUse `,_jsx(_components.code,{children:`--diff`}),` to find copies that have already diverged. A fix present in only\none copy is a bug report, not a refactor.`]}),`\n`]}),`\n`,_jsxs(_components.li,{children:[`\n`,_jsxs(_components.p,{children:[_jsx(_components.strong,{children:`Record the diagnosis`}),` for each genuine cluster before consolidating it,\nin an issue or the adoption notes. Merging the copies removes the evidence.`]}),`\n`]}),`\n`,_jsxs(_components.li,{children:[`\n`,_jsxs(_components.p,{children:[_jsx(_components.strong,{children:`Record intentional copies`}),` in `,_jsx(_components.a,{href:`/cli/dupes#configuration`,children:_jsx(_components.code,{children:`[dupes]`})}),`: an\n`,_jsx(_components.code,{children:`allowlist`}),` entry for mirrors or a `,_jsx(_components.code,{children:`contract_exemptions`}),` entry for forced\nmethods, each with a `,_jsx(_components.code,{children:`reason`}),`.`]}),`\n`]}),`\n`,_jsxs(_components.li,{children:[`\n`,_jsxs(_components.p,{children:[_jsx(_components.strong,{children:`Consolidate in focused batches.`}),` Take one cluster or one area at a time,\nadd characterization tests first when coverage is weak, and let\n`,_jsx(_components.a,{href:`/cli/check`,children:_jsx(_components.code,{children:`fensu check`})}),` decide where the shared owner lives.`]}),`\n`]}),`\n`,_jsxs(_components.li,{children:[`\n`,_jsxs(_components.p,{children:[_jsx(_components.strong,{children:`Catch new duplication in review.`}),` Run the report on every branch:`]}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`1`,language:`shellscript`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`shellscript`,children:_jsxs(_components.code,{language:`shellscript`,numberOfLines:`1`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#DCDCAA`},children:`fensu`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` dupes`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` --since`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` origin/main`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` --diff`})]}),`\n`]})})}),`\n`]}),`\n`]}),`\n`,_jsxs(_components.p,{children:[`Do not chase zero. The goal is that new duplication gets noticed and old\nduplication gets a recorded decision. See\n`,_jsx(_components.a,{href:`/concepts/duplicated-code`,children:`Duplicated code`}),` for a worked example.`]})]})}function MDXContent(props={}){const{wrapper:MDXLayout}={..._provideComponents(),...props.components};return MDXLayout?_jsx(MDXLayout,{...props,children:_jsx(_createMdxContent,{...props})}):_createMdxContent(props)}return{default:MDXContent};function _missingMdxReference(id,component){throw new Error(`Expected `+(component?`component`:`object`)+\" `\"+id+\"` to be defined: you likely forgot to import, pass, or provide it.\")}","frontmatter":{},"scope":{"config":{},"pageMetadata":{"title":"Adopting Fensu","description":"How to roll Fensu out on a new repo, a small existing repo, or a large existing one.","href":"/adoption"}}},"mdxSourceWithNoJs":null},"mdxExtracts":{"tableOfContents":[{"title":"New repositories","slug":"new-repositories","depth":2,"children":[]},{"title":"Small existing repositories","slug":"small-existing-repositories","depth":2,"children":[]},{"title":"Large existing repositories","slug":"large-existing-repositories","depth":2,"children":[]},{"title":"Duplicated code in an existing repository","slug":"duplicated-code-in-an-existing-repository","depth":2,"children":[]}],"codeExamples":{}},"jsLinks":[],"subdomain":"fensu-docs","siteName":"Fensu","title":"Adopting Fensu - Fensu","contextualStarterQuestions":[],"navMaps":{"firstHrefInVersion":{},"firstHrefInLanguage":{}},"lastModified":"2026-09-25T01:53:58.341Z","originalFileLocation":"adoption.mdx"},"headHtml":"\u003cscript data-mint-head>(function(){var d=document.documentElement,p=null;if(!p){try{p=localStorage.getItem(\"isDarkMode\")}catch(e){}if(p==='true')p='dark';else if(p==='false')p='light';if(p!=='light'\u0026\u0026p!=='dark'\u0026\u0026p!=='system')p=\"system\"}var r=p==='system'?(matchMedia(\"(prefers-color-scheme: dark)\").matches?'dark':'light'):p;d.classList.remove(r==='dark'?'light':'dark');d.classList.add(r);d.setAttribute(\"data-theme-preference\",p)})();\u003c/script>\u003cmeta data-mint-head name=\"description\" content=\"How to roll Fensu out on a new repo, a small existing repo, or a large existing one.\">\u003cmeta data-mint-head name=\"application-name\" content=\"Fensu\">\u003cmeta data-mint-head name=\"generator\" content=\"Mintlify\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"192x192\" href=\"/mintlify-assets/_mintlify/favicons/fensu-docs/qLfXKgmETWdqbUq_/_generated/favicon/android-chrome-192x192.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"apple-touch-icon\" type=\"image/png\" sizes=\"180x180\" href=\"/mintlify-assets/_mintlify/favicons/fensu-docs/qLfXKgmETWdqbUq_/_generated/favicon/apple-touch-icon.png\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"16x16\" href=\"/mintlify-assets/_mintlify/favicons/fensu-docs/qLfXKgmETWdqbUq_/_generated/favicon/favicon-16x16.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"32x32\" href=\"/mintlify-assets/_mintlify/favicons/fensu-docs/qLfXKgmETWdqbUq_/_generated/favicon/favicon-32x32.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"shortcut icon\" type=\"image/x-icon\" href=\"/mintlify-assets/_mintlify/favicons/fensu-docs/qLfXKgmETWdqbUq_/_generated/favicon/favicon.ico\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"192x192\" href=\"/mintlify-assets/_mintlify/favicons/fensu-docs/qLfXKgmETWdqbUq_/_generated/favicon-dark/android-chrome-192x192.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"16x16\" href=\"/mintlify-assets/_mintlify/favicons/fensu-docs/qLfXKgmETWdqbUq_/_generated/favicon-dark/favicon-16x16.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"32x32\" href=\"/mintlify-assets/_mintlify/favicons/fensu-docs/qLfXKgmETWdqbUq_/_generated/favicon-dark/favicon-32x32.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"shortcut icon\" type=\"image/x-icon\" href=\"/mintlify-assets/_mintlify/favicons/fensu-docs/qLfXKgmETWdqbUq_/_generated/favicon-dark/favicon.ico\" media=\"(prefers-color-scheme: dark)\">\u003cmeta data-mint-head property=\"og:title\" content=\"Adopting Fensu - Fensu\">\u003cmeta data-mint-head property=\"og:description\" content=\"How to roll Fensu out on a new repo, a small existing repo, or a large existing one.\">\u003cmeta data-mint-head property=\"og:site_name\" content=\"Fensu\">\u003cmeta data-mint-head property=\"og:url\" content=\"https://docs.fensu.dev/adoption\">\u003cmeta data-mint-head property=\"og:type\" content=\"website\">\u003cmeta data-mint-head property=\"og:image\" content=\"https://fensu-docs.mintlify.site/_mintlify/api/og/v2?division=Getting+Started\u0026amp;title=Adopting+Fensu\u0026amp;description=How+to+roll+Fensu+out+on+a+new+repo%2C+a+small+existing+repo%2C+or+a+large+existing+one.\u0026amp;theme=f568b4889a09bccf6658d435\u0026amp;signature=e29417b4362d54b5d437c5a031a841f76be60476ba555565e555dc5fd180991f\">\u003cmeta data-mint-head property=\"og:image:width\" content=\"1200\">\u003cmeta data-mint-head property=\"og:image:height\" content=\"630\">\u003cmeta data-mint-head name=\"twitter:card\" content=\"summary_large_image\">\u003cmeta data-mint-head name=\"twitter:title\" content=\"Adopting Fensu - Fensu\">\u003cmeta data-mint-head name=\"twitter:description\" content=\"How to roll Fensu out on a new repo, a small existing repo, or a large existing one.\">\u003cmeta data-mint-head name=\"twitter:image\" content=\"https://fensu-docs.mintlify.site/_mintlify/api/og/v2?division=Getting+Started\u0026amp;title=Adopting+Fensu\u0026amp;description=How+to+roll+Fensu+out+on+a+new+repo%2C+a+small+existing+repo%2C+or+a+large+existing+one.\u0026amp;theme=f568b4889a09bccf6658d435\u0026amp;signature=e29417b4362d54b5d437c5a031a841f76be60476ba555565e555dc5fd180991f\">\u003cmeta data-mint-head name=\"twitter:image:width\" content=\"1200\">\u003cmeta data-mint-head name=\"twitter:image:height\" content=\"630\">\u003cmeta data-mint-head name=\"msapplication-config\" content=\"/mintlify-assets/_mintlify/favicons/fensu-docs/qLfXKgmETWdqbUq_/_generated/favicon/browserconfig.xml\">\u003cmeta data-mint-head name=\"apple-mobile-web-app-title\" content=\"Fensu\">\u003cmeta data-mint-head name=\"msapplication-TileColor\" content=\"#E84B03\">\u003clink data-mint-head rel=\"canonical\" href=\"https://docs.fensu.dev/adoption\">\u003clink data-mint-head rel=\"alternate\" type=\"application/xml\" href=\"/sitemap.xml\">\u003clink data-mint-head rel=\"alternate\" type=\"text/markdown\" href=\"/adoption.md\">\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@graph\":[{\"@type\":\"Organization\",\"@id\":\"https://docs.fensu.dev/#organization\",\"name\":\"Fensu\",\"url\":\"https://docs.fensu.dev\",\"logo\":{\"@type\":\"ImageObject\",\"url\":\"https://mintcdn.com/fensu-docs/dfspBImhxx3Pgza7/fensu_light_logo_trim.png?fit=max\u0026auto=format\u0026n=dfspBImhxx3Pgza7\u0026q=85\u0026s=2524c9238fb6f68a1bd720ea42182eba\"}},{\"@type\":\"WebSite\",\"@id\":\"https://docs.fensu.dev#website\",\"name\":\"Fensu\",\"url\":\"https://docs.fensu.dev\",\"publisher\":{\"@id\":\"https://docs.fensu.dev/#organization\"}},{\"@type\":\"WebPage\",\"@id\":\"https://docs.fensu.dev/adoption#webpage\",\"url\":\"https://docs.fensu.dev/adoption\",\"name\":\"Adopting Fensu\",\"description\":\"How to roll Fensu out on a new repo, a small existing repo, or a large existing one.\",\"dateModified\":\"2026-09-25T01:53:58.341Z\",\"isPartOf\":{\"@id\":\"https://docs.fensu.dev#website\"},\"breadcrumb\":{\"@id\":\"https://docs.fensu.dev/adoption#breadcrumb\"}},{\"@type\":\"BreadcrumbList\",\"@id\":\"https://docs.fensu.dev/adoption#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Getting Started\",\"item\":\"https://docs.fensu.dev\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Adopting Fensu\",\"item\":\"https://docs.fensu.dev/adoption\"}]},{\"@type\":[\"Article\",\"TechArticle\"],\"@id\":\"https://docs.fensu.dev/adoption#article\",\"headline\":\"Adopting Fensu\",\"name\":\"Adopting Fensu\",\"description\":\"How to roll Fensu out on a new repo, a small existing repo, or a large existing one.\",\"url\":\"https://docs.fensu.dev/adoption\",\"mainEntityOfPage\":{\"@id\":\"https://docs.fensu.dev/adoption#webpage\"},\"dateModified\":\"2026-09-25T01:53:58.341Z\",\"publisher\":{\"@id\":\"https://docs.fensu.dev/#organization\"},\"isPartOf\":{\"@id\":\"https://docs.fensu.dev#website\"}}]}\u003c/script>\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@type\":\"WebSite\",\"name\":\"Fensu\",\"publisher\":{\"@type\":\"Organization\",\"name\":\"Fensu\"},\"provider\":{\"@type\":\"Organization\",\"name\":\"Mintlify\",\"url\":\"https://mintlify.com\"}}\u003c/script>","agentPointerHref":"/adoption.md","siteName":"Fensu","nav":{"global":null,"groups":[{"group":"Getting Started","pages":[{"title":"Fensu (フェンス)","href":"/index"},{"title":"Quickstart","description":"Install Fensu, initialize a repository, and read your first faults in a few minutes.","href":"/quickstart"},{"title":"Adopting Fensu","href":"/adoption"},{"title":"Philosophy","description":"Why Fensu is strict by default and how deliberate deviation works.","href":"/philosophy"}]},{"group":"Concepts","pages":[{"title":"Architecture Model","href":"/concepts/architecture-model"},{"title":"Configuration","href":"/concepts/configuration"},{"title":"Caching","href":"/concepts/caching"},{"title":"Rule Families","href":"/concepts/rule-families"},{"title":"Duplicated Code","href":"/concepts/duplicated-code"},{"group":"Native Rule Packs","pages":[{"title":"Overview","href":"/concepts/rule-packs"},{"title":"Dagster","href":"/concepts/rule-packs/dagster"}]},{"title":"Custom Rules","href":"/concepts/custom-rules"},{"title":"Repository Rules","href":"/concepts/repository-rules"},{"group":"Additional Analyzers","pages":[{"title":"Rust","href":"/concepts/analyzers/rust"},{"title":"TypeScript and SvelteKit","href":"/concepts/analyzers/typescript-sveltekit"}]}]},{"group":"CLI Reference","pages":[{"title":"Overview","href":"/cli/index"},{"title":"fensu check","href":"/cli/check"},{"title":"fensu dupes","href":"/cli/dupes"},{"title":"fensu init","href":"/cli/init"},{"title":"fensu map","href":"/cli/map"},{"title":"fensu rule","href":"/cli/rule"},{"title":"fensu skills","href":"/cli/skills"},{"title":"fensu target","href":"/cli/target"}]},{"group":"API Reference","pages":[{"title":"RuleContext","href":"/reference/rule-context"}]}]},"basePath":"","title":"Adopting Fensu - Fensu","deploymentId":"dpl_HZVV42MMRSo9WnNHfTGZvby5jph9","buildId":"dpl_HZVV42MMRSo9WnNHfTGZvby5jph9","dynamics":[],"chunks":[]}