# AI use cases for Perch (lakeday-org/perch)

Repo: [lakeday-org/perch](https://github.com/lakeday-org/perch) | Use cases: 5 | Page: https://dedupedai.com/use-cases/lakeday-org-perch/

Perch is a JavaScript command-line tool that lints code for semantic problems such as logic bugs, using decision models.

This file holds every use case of this repo. Each one starts with a "## " heading and ends with its URL.

- Find logic bugs in a codebase, worst first: https://dedupedai.com/use-cases/lakeday-org-perch/scan-codebase-for-logic-bugs/
- Confirm a fix works without recording it: https://dedupedai.com/use-cases/lakeday-org-perch/check-a-fix-before-committing/
- Write a custom rule for your own code standard: https://dedupedai.com/use-cases/lakeday-org-perch/add-custom-lint-rule/
- Let a coding agent run Perch on its own changes: https://dedupedai.com/use-cases/lakeday-org-perch/let-coding-agent-use-perch/
- Scan pull requests in CI with Perch Cloud: https://dedupedai.com/use-cases/lakeday-org-perch/gate-pull-requests-with-perch-cloud/

## How to find logic bugs in a codebase, worst first with Perch

Repo: [lakeday-org/perch](https://github.com/lakeday-org/perch) | Difficulty: Intermediate | Time: 30 minutes | Basis: From the README

Run one scan to list semantic defects in your code, ranked by severity and confidence.

**Who it is for:** A developer who suspects a codebase has wrong-order, off-by-one, or null-handling bugs and wants a ranked list to start with.

**The problem:** Standard linters miss many meaning-level bugs, so problems can stay hidden until they reach production.

**The outcome:** A ranked list of findings with file, line, problem type, and confidence, sorted so the worst appear first.

### Steps

1. Run `npm install -g @lakeday/perch`
2. Run `perch login` to sign in to Perch Cloud
3. Run `perch scan` in the project folder
4. Run `perch issues` to see the findings worst first
5. Run `perch issues <id>` with a finding ID to view one finding in detail (inferred, check the README)

### Prompt to paste into your agent

```text
In the perch repo at <project path>, run `perch scan` and then `perch issues`. Report the top five findings with file, line, and problem type. Verify that the output lists problems with IDs and a severity for each.
```

### Caveat

Scans run through Perch Cloud after sign-in, and the README says the first $5 is free, so later scans may cost money.

Disclaimer: Third-party repos we don't own or vouch for. AI-generated use cases can be wrong: review everything and run at your own risk. Full text: https://dedupedai.com/disclaimer/

URL: https://dedupedai.com/use-cases/lakeday-org-perch/scan-codebase-for-logic-bugs/

## How to confirm a fix works without recording it with Perch

Repo: [lakeday-org/perch](https://github.com/lakeday-org/perch) | Difficulty: Intermediate | Time: 30 minutes | Basis: From the README

Re-ask Perch about a finding after you change the code, without saving anything.

**Who it is for:** A developer who has edited code to resolve a flagged issue and wants a second opinion before committing.

**The problem:** It is unclear whether an edit actually fixed the defect, and a full rescan may not be needed for one finding.

**The outcome:** A fresh answer on the finding after your change, with nothing recorded in the scan history.

### Steps

1. Finish the change to the flagged code
2. Run `perch check <id>` with the finding ID from `perch issues` (inferred, check the README)
3. Read the new answer and confirm the problem is gone
4. Run `perch scan` again if you want a full recorded result

### Prompt to paste into your agent

```text
In the perch repo at <project path>, after editing the code for finding <id>, run `perch check <id>`. Report whether the problem still appears. Verify that the check did not add a new record to the scan results.
```

### Caveat

The README gives the `perch check` command without showing its argument format, so confirm the exact syntax with `perch check --help` or the docs before relying on it.

Disclaimer: Third-party repos we don't own or vouch for. AI-generated use cases can be wrong: review everything and run at your own risk. Full text: https://dedupedai.com/disclaimer/

URL: https://dedupedai.com/use-cases/lakeday-org-perch/check-a-fix-before-committing/

## How to write a custom rule for your own code standard with Perch

Repo: [lakeday-org/perch](https://github.com/lakeday-org/perch) | Difficulty: Intermediate | Time: 45 minutes | Basis: From the README

Add a plain-English rule to Perch.yaml so Perch checks a practice your team cares about.

**Who it is for:** A team lead who has a house rule, such as keeping secrets out of logs, that generic linters do not check.

**The problem:** Built-in checks do not cover every team standard, and a written rule is easy to forget in review.

**The outcome:** A committed rule in Perch.yaml that Perch applies to matching files on every scan.

### Steps

1. Open `perch.yaml` in the project root, or create it
2. Add a rule with `name`, `where`, `each`, and `ensure` fields, as shown in the README example
3. Run `perch scan` to apply the new rule
4. Run `perch issues` to review what the rule found
5. Commit `perch.yaml` so the rule applies to the team

### Prompt to paste into your agent

```text
In the perch repo at <project path>, add a rule named private-logs to perch.yaml with where set to src/**/*.ts, each set to method, and ensure set to 'Keep passwords and access tokens out of logs.' Run `perch scan`. Verify that the scan output includes findings from this rule.
```

### Caveat

Rule syntax beyond the README example (such as `sees` and `min`) is documented elsewhere, so this example covers only the basic fields.

Disclaimer: Third-party repos we don't own or vouch for. AI-generated use cases can be wrong: review everything and run at your own risk. Full text: https://dedupedai.com/disclaimer/

URL: https://dedupedai.com/use-cases/lakeday-org-perch/add-custom-lint-rule/

## How to let a coding agent run Perch on its own changes with Perch

Repo: [lakeday-org/perch](https://github.com/lakeday-org/perch) | Difficulty: Intermediate | Time: 30 minutes | Basis: From the README

Install Perch instructions for your AI coding assistant so it can scan its own edits.

**Who it is for:** A developer using Claude Code, Codex, or Cursor who wants the agent to check its own changes for logic bugs.

**The problem:** Coding agents often ship logic errors they do not notice, and reviewing each edit by hand is slow.

**The outcome:** The assistant has Perch instructions in its project folder and can scan and check its own work.

### Steps

1. Run `npm install -g @lakeday/perch` if Perch is not installed yet
2. Run `perch setup claude-code` for Claude Code, `perch setup codex` for Codex, or `perch setup cursor` for Cursor
3. Start a session with the assistant in the project folder
4. Ask the assistant to run `perch scan` after each change and fix the top findings

### Prompt to paste into your agent

```text
In the perch repo at <project path>, after you finish editing, run `perch scan` and then `perch issues`. Fix the top finding if it is a real defect, then run `perch check <id>`. Verify that the final scan lists no new problems introduced by your edits.
```

### Caveat

The skill files are written into the project's .claude, .codex, or .cursor folders, so review them before committing, and Perch still requires a Perch Cloud sign-in.

Disclaimer: Third-party repos we don't own or vouch for. AI-generated use cases can be wrong: review everything and run at your own risk. Full text: https://dedupedai.com/disclaimer/

URL: https://dedupedai.com/use-cases/lakeday-org-perch/let-coding-agent-use-perch/

## How to scan pull requests in CI with Perch Cloud with Perch

Repo: [lakeday-org/perch](https://github.com/lakeday-org/perch) | Difficulty: Advanced | Time: 45 minutes | Basis: From the README

Have Perch review pull requests automatically, with no workflow file to write.

**Who it is for:** A team that wants a semantic review on every pull request before merging, without maintaining CI configuration.

**The problem:** Reviewers miss logic bugs in large pull requests, and setting up custom CI checks takes time.

**The outcome:** Pull requests are scanned by Perch Cloud, and the team knows what a build can gate on.

### Steps

1. Run `perch login` to sign in to Perch Cloud
2. Read the CI guide at https://docs.perchscan.com/ci/ to see what a build can gate on and what it cannot
3. Connect the repository to Perch Cloud through its dashboard at https://perchscan.com (inferred, check the README)
4. Open a pull request and review the Perch findings it reports

### Prompt to paste into your agent

```text
For the perch repo at <project path>, read https://docs.perchscan.com/ci/ and summarize what a build can gate on. Confirm that a test pull request receives perch findings. Verify that the pull request shows findings without any new workflow file added to the repo.
```

### Caveat

The README says Perch Cloud scans pull requests in CI but does not describe the connection steps, so the dashboard step is inferred and must be checked against the CI docs.

Disclaimer: Third-party repos we don't own or vouch for. AI-generated use cases can be wrong: review everything and run at your own risk. Full text: https://dedupedai.com/disclaimer/

URL: https://dedupedai.com/use-cases/lakeday-org-perch/gate-pull-requests-with-perch-cloud/
