[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"project-112546":3},{"id":4,"name":5,"fullName":6,"owner":7,"repo":5,"description":8,"homepage":9,"htmlUrl":9,"language":10,"languages":9,"totalLinesOfCode":9,"stars":11,"forks":12,"watchers":13,"openIssues":14,"contributorsCount":15,"subscribersCount":15,"size":15,"stars1d":15,"stars7d":16,"stars30d":17,"stars90d":15,"forks30d":15,"starsTrendScore":15,"compositeScore":18,"rankGlobal":9,"rankLanguage":9,"license":19,"archived":20,"fork":20,"defaultBranch":21,"hasWiki":22,"hasPages":20,"topics":23,"createdAt":9,"pushedAt":36,"updatedAt":37,"readmeContent":38,"aiSummary":39,"trendingCount":15,"starSnapshotCount":15,"syncStatus":40,"lastSyncTime":41,"discoverSource":42},112546,"easement","mokevnin\u002Feasement","mokevnin","Architecture quality gate for polyglot codebases: declare components and allowed dependencies, fail the build on drift",null,"Rust",62,7,1,6,0,5,11,46.31,"MIT License",false,"main",true,[24,25,26,27,28,29,30,31,32,33,34,35],"architecture","architecture-testing","ci","cli","code-quality","dependency-analysis","linter","quality-gate","quality-gates","rust","static-analysis","tree-sitter","2026-11-23 17:13:01","2026-11-18 15:00:52","# easement\n\nArchitecture quality gate for polyglot codebases.\n\nCatch changes that compile but break the architecture: a handler reaching storage directly, a feature importing another feature's internals, or a new dependency cycle.\n\nDeclare the components of your system and which of them may depend on which. `easement` extracts the real dependencies from the code, builds the graph and fails the build when the code drifts from the declared architecture.\n\n## Set up with a coding agent\n\nCopy this prompt into Claude Code, Codex, Cursor or another coding agent opened in your project:\n\n```text\nSet up easement (https:\u002F\u002Fgithub.com\u002Fmokevnin\u002Feasement), an architecture quality gate, in this project. Read https:\u002F\u002Fgithub.com\u002Fmokevnin\u002Feasement\u002Fblob\u002Fmain\u002Fdocs\u002FREADME.md first. Use installation.md and languages.md for tools and indexers, configuration.md for rules, and adoption.md for baseline and CI setup; these pages are in the same docs directory.\n\n1. Install easement the way this project installs its tools: a line in mise.toml if the project uses mise (\"github:mokevnin\u002Feasement\" = \"latest\"), otherwise Homebrew or the install script from installation.md.\n2. Run `easement doctor --format json` and install every indexer it reports missing, again the way the project installs tools. Repeat until it exits 0.\n3. Run `easement init`, then `easement check`. If the report says files are not covered by an indexer, fix the cause (a tsconfig include, a missing go.mod) or list them in `uncovered_ok` with a reason.\n4. Study the code and turn the generated config into the intended architecture: remove the allowances that should not exist, give every rule a `because` that tells where the code should go instead, and use `layers`, `public`, `no_cycles` and `tests: auto` where they fit. Do not change application code to make the check pass. When the config is final, record the existing violations with `easement baseline`.\n5. Add the check to CI: the GitHub Action from adoption.md with `diff` on pull requests if the project uses GitHub Actions, otherwise `easement check` in the existing pipeline. If the project has git hooks, run it on pre-push.\n6. Install the easement skill into the project with `npx skills add mokevnin\u002Feasement`, for the agents this team uses, and commit the files it writes, so every agent that works here gets it.\n7. Add these rules to the project's agent instructions (AGENTS.md, CLAUDE.md or whatever file the project already uses; create AGENTS.md if there is none):\n   - Use the easement skill before adding a file or an import and whenever `easement check` fails.\n   - After changing code, run `easement check`; it must exit 0.\n   - Never edit easement.yml, regenerate the baseline or add an `easement:disable` comment without asking a human.\n8. Run `easement check` once more and report: the components and rules you chose and why, the number of baselined violations, and anything you were unsure about.\n```\n\nReview the rules it proposes: the agent sees the code as it is, and you decide which dependencies should be allowed. The setup installs the [agent skill](skills\u002Feasement\u002FSKILL.md) for everyday work; [manual skill and Claude Code plugin installation](https:\u002F\u002Fgithub.com\u002Fmokevnin\u002Feasement\u002Fblob\u002Fmain\u002Fdocs\u002Fagent-setup.md#agent-skill) are also available.\n\n## Languages\n\nAll languages share component boundaries, public APIs, layers, isolation, cycles and coupling rules. The table shows the analysis behind those rules and which additional checks are available:\n\n| Language | Dependency analysis | Symbol rules | Type naming | Unused files | Package declarations |\n| --- | --- | --- | --- | --- | --- |\n| Go | SCIP | Yes | Yes | Yes | `go.mod` |\n| TypeScript \u002F JavaScript | SCIP | Yes | Yes | Yes | `package.json` |\n| Python | SCIP | Yes | Yes | Yes | — |\n| Rust | SCIP | Yes | Yes | Yes | `Cargo.toml`, features |\n| Java | SCIP | Not yet | Yes | Yes | — |\n| C# | SCIP | Not yet | Yes | Yes | — |\n| PHP | SCIP | Not yet | Yes | Yes | — |\n| Ruby | SCIP, constant references | Yes | Yes | No | — |\n| Kotlin | Imports only | No | No | No | — |\n| Swift | Imports only | No | No | No | — |\n\n**SCIP** uses language indexers to resolve references to definitions; install the indexer and the project's dependencies. Kotlin and Swift use bundled tree-sitter adapters with approximate import resolution. **Symbol rules** restrict uses of specific types, functions or methods; **type naming** assigns matching type names to components. **Package declarations** checks imports against declared dependencies and applies component rules to dependencies in manifests.\n\nCoverage has limits: TypeScript\u002FJavaScript needs a `tsconfig.json` that includes the files; Ruby needs Sorbet type information and cannot enforce external gem restrictions; unused-file checks stay conservative around incomplete indexes, and framework-loaded files may need explicit entry points. See [language requirements and limits](https:\u002F\u002Fgithub.com\u002Fmokevnin\u002Feasement\u002Fblob\u002Fmain\u002Fdocs\u002Flanguages.md).\n\nA green verdict covers the code the tool could read and judge. Reports name evidence gaps, deliberate narrowing such as `--diff`, and cache use. In CI, `easement check --require-evidence` also fails when evidence is incomplete.\n\n## What you can enforce\n\nComponents represent the parts of your architecture: layers, features, packages or services. Rules express which relationships are allowed and which conventions each part must follow:\n\n| Rule area | Example policy |\n| --- | --- |\n| Dependencies and layers | Handlers call services; domain code cannot reach storage, even through an intermediate component. |\n| Public APIs | Other components use billing's public API, also when another component re-exports billing's code; only maintenance jobs may use its admin surface. |\n| Feature isolation | Each feature uses its own data layer; one page cannot import another page's internals. |\n| Cycles and coupling | Components stay acyclic and below limits on outgoing dependencies or instability. |\n| Symbols and type ownership | Only use cases may call a destructive function; types named `*Repository` belong in the repository component. |\n| Package declarations | Imports must be declared in the manifest; production crates cannot enable a test-only Cargo feature. |\n| Files and conventions | Every resource directory contains required files or imports; generated files stay outside source checks; unreachable files are reported. |\n| Policy contracts and diagrams | Example dependencies pin allowed and rejected decisions; code dependencies must have arrows in the architecture diagram. |\n\nEach violation points to the source and carries the rule's `because`, so a developer or agent knows how to fix it. See [all rules and configuration examples](https:\u002F\u002Fgithub.com\u002Fmokevnin\u002Feasement\u002Fblob\u002Fmain\u002Fdocs\u002Fconfiguration.md).\n\n## Why easement\n\nChoose easement when you want architecture policy that spans languages and can guide coding agents as they work:\n\n- **One policy across the repository.** A Go backend and a TypeScript frontend share a component model, YAML rules, baseline and report. Teams maintain the same architecture vocabulary across languages.\n- **Decisions before and after a change.** Agents can ask `explain` where code belongs and `propose` whether an import would violate boundaries or create a cycle. `check` enforces the policy; `why` explains dependencies, `impact` finds dependents, and `review` exposes permissions or debt a policy change introduces.\n- **Adoption with explicit trust limits.** A shrinking baseline and diff checks support existing codebases. Reports expose unread code, unreliable suggestions and cached indexes, with an option to fail CI on missing evidence.\n\nFor Java rules about inheritance, annotations or method signatures, [ArchUnit](https:\u002F\u002Fwww.archunit.org\u002Fuserguide\u002Fhtml\u002F000_Index.html) goes deeper. For a JavaScript\u002FTypeScript project, [dependency-cruiser](https:\u002F\u002Fgithub.com\u002Fsverweij\u002Fdependency-cruiser) offers dependency validation and visualization; [Import Linter](https:\u002F\u002Fimport-linter.readthedocs.io\u002Fen\u002Fstable\u002Fcontract_types\u002F) provides Python import contracts. Easement's advantage is combining a shared policy across languages with agent queries, policy review and explicit analysis limits. See the [detailed comparison](https:\u002F\u002Fgithub.com\u002Fmokevnin\u002Feasement\u002Fblob\u002Fmain\u002Fdocs\u002Fcomparison.md).\n\n## Install\n\n```sh\nbrew install mokevnin\u002Ftap\u002Feasement\n```\n\nHomebrew works on macOS and Linux. You can also use `cargo install easement`, the install script or release packages; see [installation options](https:\u002F\u002Fgithub.com\u002Fmokevnin\u002Feasement\u002Fblob\u002Fmain\u002Fdocs\u002Finstallation.md).\n\nMost languages also need a SCIP indexer and the project's dependencies installed. From your project directory, run:\n\n```sh\neasement doctor\n```\n\nIt reports missing indexers and how to install them. Follow the [indexer setup](https:\u002F\u002Fgithub.com\u002Fmokevnin\u002Feasement\u002Fblob\u002Fmain\u002Fdocs\u002Flanguages.md#indexers), then repeat until `doctor` exits 0.\n\n## Quick start\n\nStart from your project's current layout:\n\n```sh\neasement init\n```\n\nIt writes `easement.yml` with components and allowances for the dependencies it finds. Review those allowances and remove the ones the architecture should forbid.\n\nFor example, handlers should reach storage through services. For a Go project with `internal\u002Fhandlers`, `internal\u002Fservices`, `internal\u002Frepository` and `internal\u002Fmodels`, the policy can be:\n\n```yaml\nversion: 1\n\ncomponents:\n  handlers:   { in: internal\u002Fhandlers }\n  services:   { in: internal\u002Fservices }\n  repository: { in: internal\u002Frepository }\n  models:     { in: internal\u002Fmodels }\n\ncommon: [models]\n\nrules:\n  handlers:\n    may_depend_on: [services]\n    because: handlers go through services, never straight to storage\n  services: { may_depend_on: [repository] }\n```\n\nRun the check:\n\n```sh\neasement check\n```\n\nA handler importing the repository fails with the source location and the reason:\n\n```text\ninternal\u002Fhandlers\u002Fbooks.go:6: handlers -> repository is not allowed (written as internal\u002Frepository\u002Fbooks.go) [dependency]\n  because: handlers go through services, never straight to storage\n```\n\nChange the handler to go through the service, then check again. `check` exits 0 when the code matches the policy, 1 on violations and 2 on an error, such as a broken config or a missing indexer. Additional exit codes are described in the [command reference](https:\u002F\u002Fgithub.com\u002Fmokevnin\u002Feasement\u002Fblob\u002Fmain\u002Fdocs\u002Fcommands.md#everyday-commands).\n\nFor an existing codebase, a [baseline](https:\u002F\u002Fgithub.com\u002Fmokevnin\u002Feasement\u002Fblob\u002Fmain\u002Fdocs\u002Fadoption.md#baseline-adopting-on-an-existing-project) records today's debt so new violations fail while old ones can be fixed gradually. For a pull request, [diff mode](https:\u002F\u002Fgithub.com\u002Fmokevnin\u002Feasement\u002Fblob\u002Fmain\u002Fdocs\u002Fadoption.md#diff-mode-judging-a-pull-request) judges what the change adds.\n\n## Everyday commands\n\n```sh\neasement check                    # check the project\neasement explain \u003Cfile>           # who owns the file and what it may do\neasement propose \u003Cfile> \u003Ctarget>  # judge an import before writing it\neasement why \u003Ca> \u003Cb>              # show the imports behind a dependency\neasement impact --diff main      # find files depending on changed code\neasement review --base main      # review what a policy change permits\neasement suggest                  # find unused allowances and missing ones\n```\n\nUse `--format json` for structured results. Reports for CI include GitHub annotations, SARIF and JUnit. See the [command reference](https:\u002F\u002Fgithub.com\u002Fmokevnin\u002Feasement\u002Fblob\u002Fmain\u002Fdocs\u002Fcommands.md) and [CI integration](https:\u002F\u002Fgithub.com\u002Fmokevnin\u002Feasement\u002Fblob\u002Fmain\u002Fdocs\u002Fadoption.md#in-ci); `easement \u003Ccommand> --help` lists the available flags.\n\n## Documentation\n\nStart with the [documentation index](https:\u002F\u002Fgithub.com\u002Fmokevnin\u002Feasement\u002Fblob\u002Fmain\u002Fdocs\u002FREADME.md), or go directly to:\n\n| Task | Guide |\n| --- | --- |\n| Install easement | [Installation](https:\u002F\u002Fgithub.com\u002Fmokevnin\u002Feasement\u002Fblob\u002Fmain\u002Fdocs\u002Finstallation.md) |\n| Set up with an agent | [Setup prompt](#set-up-with-a-coding-agent) and [skill installation](https:\u002F\u002Fgithub.com\u002Fmokevnin\u002Feasement\u002Fblob\u002Fmain\u002Fdocs\u002Fagent-setup.md#agent-skill) |\n| Define components and rules | [Configuration reference](https:\u002F\u002Fgithub.com\u002Fmokevnin\u002Feasement\u002Fblob\u002Fmain\u002Fdocs\u002Fconfiguration.md) |\n| Query and check the architecture | [Command reference](https:\u002F\u002Fgithub.com\u002Fmokevnin\u002Feasement\u002Fblob\u002Fmain\u002Fdocs\u002Fcommands.md) |\n| Adopt in an existing project or CI | [Baseline, diff, CI and monorepos](https:\u002F\u002Fgithub.com\u002Fmokevnin\u002Feasement\u002Fblob\u002Fmain\u002Fdocs\u002Fadoption.md) |\n| Set up indexers or understand analysis limits | [Languages, indexers and cache](https:\u002F\u002Fgithub.com\u002Fmokevnin\u002Feasement\u002Fblob\u002Fmain\u002Fdocs\u002Flanguages.md) |\n| Compare architecture tools | [Comparison and inspirations](https:\u002F\u002Fgithub.com\u002Fmokevnin\u002Feasement\u002Fblob\u002Fmain\u002Fdocs\u002Fcomparison.md) |\n\n## Development\n\nTools are pinned in `mise.toml`: `mise install`, which also installs the git hooks, `mise run setup` for the npm dependencies, then `mise run check` (every lint, the same set CI runs) and `cargo test`. Commits follow Conventional Commits; releases are cut by merging the release-please pull request. Before proposing a new language, rule or config key, read [CONTRIBUTING.md](CONTRIBUTING.md).\n\n## License\n\nMIT\n","easement 是一个面向多语言代码库的架构质量门禁工具，用于声明系统组件及其允许的依赖关系，并在代码实际依赖偏离架构约定时中断构建。它基于 Tree-sitter 进行跨语言静态依赖分析（支持 Rust、TypeScript、Go、Python 等），通过配置化规则（如分层约束、禁止循环依赖、接口可见性控制）实现架构合规性检查，可集成至 CI\u002FCD 流程或 Git 钩子。适用于中大型微服务、模块化单体或领域驱动设计（DDD）项目，帮助团队在演进过程中持续保障架构完整性，避免隐式耦合和技术债累积。",2,"2026-11-24 04:43:48","CREATED_QUERY"]