Deslop a Rust Codebase's Structure

Once per Rust codebase, when its module structure has grown sloppy — run the deslop-please linter and fix every flagged error from first principles toward deep modules and narrow interfaces.

  • existing
  • maintenance
  • #rust
  • #linting
  • #refactoring
  • #agents
  • by Xiangpeng Hao (@MOVNTDQ)
  • github.com
deslop-codebase.md
## Context

This repository is already built and running. You are doing a one-time cleanup of
its structure with [`deslop-please`](https://github.com/deterministic-machines/deslop-please),
an opinionated linter that flags sloppy code. It follows *A Philosophy of Software
Design*: **deep** modules, **narrow** interfaces. Deep modules hide the attention
for you and your agents, so you only need to care about the narrow interface.

`deslop-please` analyzes Rust workspaces (it installs with `cargo install
deslop-please` and reads `cargo metadata`). It reports four classes of problems:

- `module-cycle` — modules that use each other, even when what they exchange only
  forms a chain.
- `tangle` — a module and its child module know each other, with no module cycle.
- `field-leak` — a type's fields are known and worked on outside the module that
  owns them.
- `shallow-module` — callers use too much of a module's surface instead of a
  narrow interface.

**The rules in the Guardrails section are binding. Read them before starting.**

## Goal

Fix every error `deslop-please` flags, from first principles toward deeper modules
and narrower interfaces, so a final run reports a clean codebase and intended
behavior is unchanged.

## Inputs

This prompt is self-contained: run it from the root of the Rust workspace you want
to deslop. The linter discovers the structure itself; there are no placeholders to
fill in.

## Instructions

1. Install the linter with `cargo install deslop-please`, then run `deslop-please`
   from the repository root. Record the full list of errors before changing
   anything.
2. Work out the fix for each error using the per-class questions in Guardrails.
   Draw a diagram to help the user understand the before and proposed after
   structure.
3. Land the fixes through the repository's normal change flow (commits or PRs
   matching its conventions).
4. Re-run `deslop-please` and repeat until it reports no errors. If an error truly
   should not be fixed, mute it with
   `deslop-please --update-allow .deslop-please.allow` and run subsequent checks
   with `deslop-please --allow .deslop-please.allow`, and say why in the report.

## Output format

- The deslopped codebase, landed through the repository's normal change flow.
- For each error class you touched, a diagram showing the before and after
  structure.
- A final report listing: the errors found per class, the fix for each, anything
  muted via `.deslop-please.allow` and why, and evidence that intended behavior is
  unchanged (the repository's own build and tests passing).

## Guardrails

These rules are binding throughout the task:

- Errors flagged by `deslop-please` must be fixed from first principles — don't do
  mechanical moves to hide them.
- `module-cycle` & `tangle`: what is the intended layer of abstraction? Which
  module should be at which layer?
- `field-leak` & `shallow-module`: why do we have these fields/functions at all?
  What are the patterns of use? Can they be hidden behind a narrow interface?
  Don't fix each leak one at a time — fix them holistically.
- Draw a diagram to help the user understand the before and proposed after
  structure.
- You may modify repository files; this is a refactor, not an audit.
- Intended behavior must be the same as when you started — verify it with the
  repository's own build and tests at the end.

More prompts

## Context This repository is already built and running. You are starting a thorough refactor ofthe whole codebase and completing it to the end. Treat it as a goal. Why do this at all: - **Better output:** agents write better code in a well-structured codebase.- **Cheaper & faster changes:** agents spend fewer tokens searching and more on the

Untangle Codebase

Once per codebase, when it has grown tangled — a one-pass structural refactor so a typical change lands in one place and agents working in it break less.

  • #refactoring
  • #tech-debt
  • #architecture
  • #agents
2 views0 copies

mBy @mazeincoding

## Context You are running a one-time, comprehensive technical SEO + GEO (AI-search readiness)audit-and-fix on this existing, already-built web project. This condenses the SEOPrompt Master workflow (START.md, phase prompts 00–05, checklists and scoringrubric from github.com/umutxyp/Seo-Promt-Master) into a single self-contained run. Two principles drive everything: 

Audit and Fix a Site's SEO and AI-Search (GEO) Readiness

Once per site, when you want every public page brought into compliance with Google's SEO guidance plus AI-search readiness — route inventory, per-page 9-point audit, prioritized fixes, and verified SEO/GEO scores.

  • #seo
  • #geo
  • #audit
  • #web
  • #agents
6 views0 copies

DBy @DanKornas

## Context Act as a Principal Application Security Engineer specialising in authorization,role-based permissions and multi-tenant SaaS security. You are auditing anexisting, already-built application's actual codebase. The app hasauthentication — users log in and see their own dashboard — but a login systemdoes not automatically make the application secure. What happens when someonechanges a user ID in the URL or sends an API request for another customer'sdata? Do not assume authentication automatically provides authorization.

Audit Authorization and Data Isolation

Once per application, before giving real customers access — audit the codebase for broken access controls, privilege escalation and cross-tenant data exposure that a login system alone does not prevent.

  • #security
  • #authorization
  • #multi-tenant
  • #rbac
  • #audit
14 views3 copies

SBy @Sujay__Raj