← All docs

Project structure

This is the canonical overview of the repository layout, shared by contributors and coding agents. Update it when responsibilities move; do not copy the tree into CONTRIBUTING.md or AGENTS.md.

This is the canonical overview of the repository layout, shared by contributors and coding agents. Update it when responsibilities move; do not copy the tree into CONTRIBUTING.md or AGENTS.md.

The tree below intentionally stops at architectural boundaries. It lists the directories and entry points a contributor needs to find a feature without trying to inventory every lint rule, test, generated file, or image.

Top-level layout

.
├── app/                              # Desktop app, frontend, and Rust crates
├── docs/                             # User, contributor, and agent documentation
├── docker/                           # Release container image
├── fixtures/                         # Generated lint-output baselines for supported games
├── pages/                            # GitHub Pages source and build/test tooling
├── schema/                           # JSON schemas for config and exported reports
├── shared/                           # Cross-component metadata, assets, and base scripts
├── SublimeLinter-contrib-papyrus-lint/ # SublimeLinter package
├── templates/                        # Release-time Nexus page template
├── vscode-extension/                 # VS Code extension
└── .github/                          # CI, release workflows, and repository scripts

Desktop app and frontend

app/ is an npm/Vite project whose browser-facing code talks to the Rust backend through Tauri commands.

app/
├── index.html                         # Vite entry document and application dialogs
├── src/                               # Framework-free TypeScript frontend
│   ├── main.ts                        # Composition root and application startup
│   ├── backend.ts                     # Typed Tauri command facade
│   ├── backend-context.ts             # Injectable backend used by UI modules/tests
│   ├── drop.ts / watch.ts             # Project selection and filesystem watching
│   ├── config*.ts / project-*.ts      # Configuration and project settings
│   ├── presets*.ts                    # Preset picker and preset management
│   ├── results-list*.ts               # Finding state, rendering, fixes, and exports
│   ├── results-filter.ts              # Finding filters
│   ├── code-viewer*.ts                # Viewer dialog, actions, compile, and diffs
│   ├── live-edit*.ts                  # Editor linting, highlighting, completion, save
│   ├── autocomplete*.ts               # Papyrus completion helpers
│   ├── highlight.ts / papyrus-source.ts # Source tokenization and presentation
│   ├── test/                           # Shared Vitest DOM fixture, mocks, and harness
│   └── styles/                         # Feature-level stylesheets
├── scripts/                           # Config type generation and link injection
├── e2e/                               # Playwright layout/browser tests
├── public/                            # Static Vite assets
└── src-tauri/                         # Rust/Tauri application package
    ├── src/main.rs                    # GUI process entry point
    ├── src/lib.rs                     # Tauri builder and command registration
    ├── src/files.rs                   # Script/project discovery and source I/O commands
    ├── src/lint.rs                    # Desktop lint orchestration
    ├── src/repair.rs                  # Fix and suppression commands
    ├── src/lint_config.rs             # Configuration-facing Tauri commands
    ├── src/config_presets.rs          # Preset-facing Tauri commands
    ├── src/export.rs                  # Text, JSON, and AI report commands
    ├── src/project_root.rs            # Project-root command adapter
    ├── src/meta.rs                    # Version and rule metadata commands
    ├── capabilities/                  # Tauri v2 capability declarations
    └── tests/                         # Binary-level integration tests

Frontend tests normally sit beside their module as *.test.ts. Rust unit tests similarly use sibling *_tests.rs files (and, where useful, a directory split by scenario) so implementation files do not become test containers.

Reusable Rust crates

The eleven crates under app/crates/ are independent path dependencies, not a Cargo workspace. Run Cargo commands against each crate's own Cargo.toml. Each crate's README holds its local invariants and test command; do not copy those into docs/agent/.

| Crate | Responsibility | | --- | --- | | papyrus-lint-globals | Dependency-light shared types and constants, including the supported-game model. | | papyrus-parser | Lexer, parser, AST, visitors, comment annotations, and type inference for Papyrus. | | papyrus-ast-cache | Disk and bundled-base-script cache for parsed ASTs and token streams. | | papyrus-collision-cache | Persistent content-hash cache used to detect conflicting script copies. | | papyrus-lints | Diagnostics, suppression/repair infrastructure, lint visitors, and individual rules. | | papyrus-lint-config | Config discovery and YAML I/O, compiler detection, script roots, and presets. | | papyrus-lint-core | Tauri-independent project resolution, cross-script lookup, compilation, and shared workflows. | | papyrus-lint-output | Plain-text, JSON, and AI-report models and formatting shared by GUI and CLI. | | papyrus-lint-live | In-memory source linting shared by CLI --blob, the language server, and desktop live edit. | | papyrus-lint-cli | PapyrusLinterCLI argument parsing and lint/fix/init/doctor/blob orchestration. | | papyrus-lint-lsp | Stdio language server (PapyrusLinterLsp). Publishes diagnostics, per-issue quick fixes, and papyrusLint.fixFile (every automatic fix, via workspace/applyEdit). |

Important internal boundaries:

The Tauri package depends on the reusable crates and always launches the desktop UI. Command-line linting lives only in the standalone PapyrusLinterCLI binary. This keeps Tauri and its GUI system dependencies out of the CLI crate. Both surfaces use papyrus-lint-output, preventing their exported report formats from drifting.

Shared inputs and generated data

shared/
├── configuration/project-settings/<key>.json  # One project setting
├── configuration/lint-settings/<key>.json     # One lint/Config setting
├── configuration/lint-settings.yaml           # UI order and rules comment
├── configuration/presets/                     # standard, careful, and strict overlays
├── rules/<id>.json                   # Canonical metadata for one lint rule
├── rules/data/<game>/*.yaml          # Game-specific function/value lookup tables
├── scripts/*.zip                     # Base and extender scripts embedded by caches
├── images/                           # README/site screenshots and branding
├── links.yaml                        # Canonical contact/download/documentation links
└── theme.css                         # Palette shared by the app and website

schema/
├── papyrus-lint.schema.json          # Generated, git-ignored project configuration schema
├── papyrus-lint-rule.schema.json     # Rule metadata schema
├── papyrus-lint-report.schema.json   # CLI JSON report schema
└── papyrus-lint-ai-export.v*.schema.json # Versioned AI export schemas

shared/rules/<id>.json is the rule metadata every build reads. Do not assemble a shared/rules.json first. shared/configuration/lint-settings.yaml is the checked-in order of project-settings/ and lint-settings/ JSON files, not a generated aggregate. papyrus-lint-config/build.rs renders the default YAML into $OUT_DIR from those files. Pages renders the same YAML and schema/papyrus-lint.schema.json while building the site. python3 .github/scripts/generate_default_config.py writes that YAML to disk only when a release (or a local inspection) needs the file. See AGENTS.md and CONTRIBUTING.md before changing rule or setting metadata.

Editor integrations

vscode-extension/ is a standalone TypeScript package. src/extension.ts wires together CLI discovery/download (cli*.ts), process execution (linter.ts), diagnostics, live linting, initialization, suppressions, code actions, and @nodiscard actions. Node-based module tests live in test/.

SublimeLinter-contrib-papyrus-lint/ is a standalone Python package. Its linter.py adapts CLI output to SublimeLinter; the command modules provide initialization and fix actions; cli_download.py and cli_hashes.py manage the released executable. Tests live in its tests/ directory.

Both integrations invoke PapyrusLinterCLI; neither embeds the Rust lint engine.

Website, release, and automation

Where to make a change

| Change | Primary location | | --- | --- | | Papyrus syntax or AST behavior | app/crates/papyrus-parser/ | | A lint or automatic repair | app/crates/papyrus-lints/ plus shared/rules/<id>.json | | Config discovery, persistence, or presets | app/crates/papyrus-lint-config/ | | Cross-script/project/compiler behavior | app/crates/papyrus-lint-core/ | | In-memory / blob lint | app/crates/papyrus-lint-live/ | | CLI command behavior | app/crates/papyrus-lint-cli/ | | LSP editor adapter | app/crates/papyrus-lint-lsp/ | | Shared export shape/formatting | app/crates/papyrus-lint-output/ | | Desktop-only backend command | app/src-tauri/ | | Desktop UI behavior | app/src/ | | VS Code or Sublime integration | vscode-extension/ or SublimeLinter-contrib-papyrus-lint/ | | Website generation | pages/ | | CI/release automation | .github/workflows/ and .github/scripts/ |

For the desktop UI, see app/src/README.md. For the Tauri shell, editor plugins, and coverage, see docs/agent/development.md. For a crate's own commands, see that crate's README.md.

View raw source on GitHub →