RuleStack

Configs

Stacks

Compare

Diff

RuleStack

Configs

Stacks

Compare

Diff

Read API

RuleStack

Configs

Stacks

Compare

Diff

Read API

Configs/Cursor rules/duckduckgo/content-scope-scripts

Cursor rule

.cursor/rules/strict-broker-protection-rest.mdc

Subagent task: Fix strict TypeScript errors in remaining broker-protection files and add to CORE_FILES

Cursor rules

Quality

89/100

Scores the file, not the repository.

Length

592 words

15 headings · 9 code blocks

Repository

70

— · pushed 0 days ago

Last changed

3 days ago

First indexed 3 days ago.
duckduckgo/content-scope-scripts/.cursor/rules/strict-broker-protection-rest.mdcRawGitHub
1---
2description: "Subagent task: Fix strict TypeScript errors in remaining broker-protection files and add to CORE_FILES"
3globs:
4 - "scripts/check-strict-core.js"
5 - "injected/src/features/broker-protection.js"
6 - "injected/src/features/broker-protection/captcha-services/captcha.service.js"
7 - "injected/src/features/broker-protection/captcha-services/providers/cloudflare-turnstile.js"
8 - "injected/src/features/broker-protection/comparisons/address.js"
9 - "injected/src/features/broker-protection/comparisons/is-same-age.js"
10 - "injected/src/features/broker-protection/execute.js"
11 - "injected/src/features/broker-protection/extractors/address.js"
12 - "injected/src/features/broker-protection/utils/utils.js"
13---
14 
15# Strict TypeScript: Broker Protection (Rest)
16 
17## Task
18 
19Fix all strict-mode TypeScript errors in 8 remaining broker-protection files and add them to `CORE_FILES`.
20 
21## Branch
22 
23```
24git checkout main && git pull origin main && git checkout -b cursor/strict/broker-protection-rest
25```
26 
27## Files (22 errors total)
28 
29### `injected/src/features/broker-protection.js` (3 errors)
30```
31(44,66): error TS18046: 'e' is of type 'unknown'.
32(80,20): error TS7006: Parameter 'action' implicitly has an 'any' type.
33(121,43): error TS7006: Parameter 'x' implicitly has an 'any' type.
34```
35 
36### `injected/src/features/broker-protection/captcha-services/captcha.service.js` (1 error)
37```
38(80,26): error TS2345: Argument of type 'string | PirError' is not assignable to parameter of type 'object'.
39```
40 
41### `injected/src/features/broker-protection/captcha-services/providers/cloudflare-turnstile.js` (4 errors)
42```
43(74,30): error TS2345: Argument of type 'string | PirError' is not assignable to parameter of type 'object'.
44(82,30): error TS2345: Argument of type 'HTMLElement | PirError | null' is not assignable to parameter of type 'object'.
45(111,30): error TS2345: Argument of type 'string | PirError' is not assignable to parameter of type 'object'.
46(122,24): error TS7015: Element implicitly has an 'any' type because index expression is not of type 'number'.
47```
48 
49### `injected/src/features/broker-protection/comparisons/address.js` (2 errors)
50```
51(17,42): error TS7006: Parameter 'stateAbbreviation' implicitly has an 'any' type.
52(24,12): error TS7053: Element implicitly has an 'any' type because expression of type 'any' can't be used to index type (US state map).
53```
54 
55### `injected/src/features/broker-protection/comparisons/is-same-age.js` (2 errors)
56```
57(6,27): error TS7006: Parameter 'userAge' implicitly has an 'any' type.
58(6,36): error TS7006: Parameter 'ageFound' implicitly has an 'any' type.
59```
60 
61### `injected/src/features/broker-protection/execute.js` (1 error)
62```
63(43,46): error TS18046: 'e' is of type 'unknown'.
64```
65 
66### `injected/src/features/broker-protection/extractors/address.js` (1 error)
67```
68(4,26): error TS7016: Could not find a declaration file for module 'parse-address'.
69```
70 
71### `injected/src/features/broker-protection/utils/utils.js` (8 errors)
72```
73(101,40): error TS7006: Parameter 'selector' implicitly has an 'any' type.
74(116,37): error TS7006: Parameter 'selector' implicitly has an 'any' type.
75(132,42): error TS7006: Parameter 'selector' implicitly has an 'any' type.
76(151,45): error TS7006: Parameter 'selector' implicitly has an 'any' type.
77(239,13): error TS2314: Generic type 'Array<T>' requires 1 type argument(s).
78(242,28): error TS7006: Parameter 'a' implicitly has an 'any' type.
79(242,31): error TS7006: Parameter 'b' implicitly has an 'any' type.
80(256,34): error TS7006: Parameter 'profile' implicitly has an 'any' type.
81```
82 
83## Fix Patterns
84 
85- **TS7006** (Parameter implicitly any): Add `@param {Type}` JSDoc.
86- **TS18046** ('e' is unknown): Use `error instanceof Error ? error.message : String(error)` pattern.
87- **TS2345** (Argument not assignable): Narrow types with guards or adjust the function signature upstream.
88- **TS7016** (No declaration file for module): Add `// @ts-ignore` only as last resort, or create a minimal `.d.ts` declaration in the project. Better: use `/** @type {import('parse-address')} */` if types exist, or `/** @type {Record<string, Function>} */` for the default import.
89- **TS2314** (Generic requires type args): Change `Array` → `Array<string>` or appropriate type.
90- **TS7053/TS7015** (No index signature): Cast with `Record<string, X>` or narrow the index.
91 
92## Workflow
93 
941. `npm ci`
952. Add all 8 files to CORE_FILES in `scripts/check-strict-core.js`
963. Fix each file's errors
974. `npm run tsc-strict-core` — must pass
985. `npm run test-unit` — must pass
996. `npm run lint` — must pass (run `npm run lint-fix` first if needed)
1007. Commit: `fix(types): add strict checking for broker-protection files`
1018. `git push -u origin cursor/strict/broker-protection-rest`
102 
103## Constraints
104 
105- Do NOT use `any` — use `unknown`, specific types, or proper interfaces
106- Do NOT use `@ts-ignore` or `@ts-expect-error` (except for the `parse-address` module if no types exist)
107- Do NOT modify files outside the assigned list (except `scripts/check-strict-core.js`)
108- Do NOT remove existing CORE_FILES entries
109- Preserve existing behavior — type fixes only, no logic changes
110 

Commands it names

  • git checkout main && git pull origin main && git checkout -b cursor/strict/broker-protection-rest
  • npm ci
  • npm run tsc-strict-core
  • npm run test-unit
  • npm run lint
  • npm run lint-fix
  • git push -u origin cursor/strict/broker-protection-rest

Sections

  • Strict TypeScript: Broker Protection (Rest)
  • Task
  • Branch
  • Files (22 errors total)
  • `injected/src/features/broker-protection.js` (3 errors)
  • `injected/src/features/broker-protection/captcha-services/captcha.service.js` (1 error)
  • `injected/src/features/broker-protection/captcha-services/providers/cloudflare-turnstile.js` (4 errors)
  • `injected/src/features/broker-protection/comparisons/address.js` (2 errors)
  • `injected/src/features/broker-protection/comparisons/is-same-age.js` (2 errors)
  • `injected/src/features/broker-protection/execute.js` (1 error)
  • `injected/src/features/broker-protection/extractors/address.js` (1 error)
  • `injected/src/features/broker-protection/utils/utils.js` (8 errors)
  • Fix Patterns
  • Workflow
  • Constraints

What it covers

testcode-styletypesgit-prdo-notagent-behaviourdocs

Stack — with the evidence

typescript

(1.00)

javascript

(1.00)

node

(1.00)

eslint

(1.00)

playwright

(0.70)

swift

(0.60)

github-actions

(0.60)

Glob targeting

  • scripts/check-strict-core.js
  • injected/src/features/broker-protection.js
  • injected/src/features/broker-protection/captcha-services/captcha.service.js
  • injected/src/features/broker-protection/captcha-services/providers/cloudflare-turnstile.js
  • injected/src/features/broker-protection/comparisons/address.js
  • injected/src/features/broker-protection/comparisons/is-same-age.js
  • injected/src/features/broker-protection/execute.js
  • injected/src/features/broker-protection/extractors/address.js
  • injected/src/features/broker-protection/utils/utils.js

Format

Cursor rules

The most expressive format here. Many small .mdc files, each with frontmatter declaring when it should load, so a rule about migrations only enters context when a migration is open. Costs the most to maintain and only one editor reads it.

What the corpus says about it

Repository

Owner
duckduckgo
Language
—
License
—
Archived
no

All configs in this repo

Also in duckduckgo/content-scope-scripts

Diff this repo’s formats

One repository carrying more than one format is the comparison this product exists for: does anyone actually write different content in each file, or is one a copy of the other?

The other instruction files in this repository
RepositoryFormatStackCoversScoreChanged
duckduckgo/content-scope-scriptstypes-generator/AGENTS.md · 70AGENTS.mdtypescriptjavascript+5testarchtypesdo-not73/1003 days ago
duckduckgo/content-scope-scripts.cursor/rules/strict-broker-protection-actions.mdc · 70Cursor rulestypescriptjavascript+5buildteststyletypes+493/1003 days ago
duckduckgo/content-scope-scripts.cursor/rules/strict-click-to-load.mdc · 70Cursor rulestypescriptjavascript+5teststyletypesgit+289/1003 days ago
duckduckgo/content-scope-scripts.cursor/rules/strict-detectors.mdc · 70Cursor rulestypescriptjavascript+5teststyletypesgit+389/1003 days ago
duckduckgo/content-scope-scripts.cursor/rules/strict-duckplayer-native.mdc · 70Cursor rulestypescriptjavascript+5teststyletypesgit+389/1003 days ago
duckduckgo/content-scope-scripts.cursor/rules/strict-duckplayer.mdc · 70Cursor rulestypescriptjavascript+5setupteststyletypes+489/1003 days ago
duckduckgo/content-scope-scripts.cursor/rules/strict-fingerprinting.mdc · 70Cursor rulestypescriptjavascript+5teststyletypesgit+389/1003 days ago
duckduckgo/content-scope-scripts.cursor/rules/strict-message-bridge.mdc · 70Cursor rulestypescriptjavascript+5teststyletypesgit+389/1003 days ago
duckduckgo/content-scope-scripts.cursor/rules/strict-standalone-features-a.mdc · 70Cursor rulestypescriptjavascript+5teststyletypesgit+489/1003 days ago
duckduckgo/content-scope-scripts.cursor/rules/strict-standalone-features-b.mdc · 70Cursor rulestypescriptjavascript+5teststyletypesgit+389/1003 days ago
duckduckgo/content-scope-scripts.cursor/rules/strict-standalone-features-c.mdc · 70Cursor rulestypescriptjavascript+5teststyletypesgit+489/1003 days ago
duckduckgo/content-scope-scripts.cursor/rules/strict-web-compat-and-telemetry.mdc · 70Cursor rulestypescriptjavascript+5teststyletypesgit+389/1003 days ago
duckduckgo/content-scope-scripts.cursor/rules/strict-zero-errors-batch.mdc · 70Cursor rulestypescriptjavascript+5testtypesgitdo-not+181/1003 days ago
duckduckgo/content-scope-scriptsAGENTS.md · 70AGENTS.mdtypescriptjavascript+6buildtestlint-formatstyle+583/1003 days ago
duckduckgo/content-scope-scriptsinjected/AGENTS.md · 70AGENTS.mdtypescriptjavascript+5buildteststylearch+292/1003 days ago
duckduckgo/content-scope-scriptsmessaging/AGENTS.md · 70AGENTS.mdtypescriptjavascript+5testarchtesting-strategyapi66/1003 days ago
duckduckgo/content-scope-scriptsspecial-pages/AGENTS.md · 70AGENTS.mdtypescriptjavascript+5buildteststylearch+3100/1003 days ago
Diff against types-generator/AGENTS.md Diff against .cursor/rules/strict-broker-protection-actions.mdc Diff against .cursor/rules/strict-click-to-load.mdc Diff against .cursor/rules/strict-detectors.mdc Diff against .cursor/rules/strict-duckplayer-native.mdc Diff against .cursor/rules/strict-duckplayer.mdc Diff against .cursor/rules/strict-fingerprinting.mdc Diff against .cursor/rules/strict-message-bridge.mdc Diff against .cursor/rules/strict-standalone-features-a.mdc Diff against .cursor/rules/strict-standalone-features-b.mdc Diff against .cursor/rules/strict-standalone-features-c.mdc Diff against .cursor/rules/strict-web-compat-and-telemetry.mdc Diff against .cursor/rules/strict-zero-errors-batch.mdc Diff against AGENTS.md Diff against injected/AGENTS.md Diff against messaging/AGENTS.md Diff against special-pages/AGENTS.md

Similar configs

Same format, overlapping stack, ranked by quality.

Same format, overlapping stack, ranked by quality
RepositoryFormatStackCoversScoreChanged
hiromaily/go-crypto-wallet.cursor/rules/typescript.mdc · 126Cursor rulesgobun+5setupbuildtestlint-format+6100/1003 days ago
TechSquidTV/Hermes.cursor/rules/10-hermes-api.mdc · 45Cursor rulestypescriptpytest+15testlint-formatstylearch+5100/1003 days ago
markstev/mark-starter.cursor/rules/frontend.mdc · 0Cursor rulestypescriptturborepo+14setuptestlint-formatstyle+699/1003 days ago
Allymahmoud/case-intake-platform.cursor/rules/frontend.mdc · 0Cursor rulestypescriptturborepo+13setuptestlint-formatstyle+799/1003 days ago
deifos/clipmira-subtitles.cursor/rules/frontend.mdc · 1Cursor rulestypescriptnextjs+5setuptestlint-formatstyle+799/1003 days ago
dodgecfr/combatfilms-webapp.cursor/rules/frontend.mdc · 0Cursor rulestypescriptturborepo+15setuptestlint-formatstyle+799/1003 days ago
langflow-ai/langflow.cursor/rules/docs_development.mdc · 153kCursor rulespythonnode+16setupbuildtestlint-format+797/1003 days ago
TechSquidTV/Hermes.cursor/rules/20-hermes-api-tests.mdc · 45Cursor rulestypescriptpytest+15teststyletesting-strategysecurity+397/1003 days ago
RuleStack

Built by

Kynth Studio

Directory

Configs
Stacks
Compare formats
Diff two configs
Best AGENTS.md examples

Formats

AGENTS.md
CLAUDE.md
Cursor rules
Copilot instructions

Reference

Read API
Corpus health
Privacy Policy
Terms

RuleStack

RuleStack

Built by

Kynth Studio

Directory

Configs
Stacks
Compare formats
Diff two configs
Best AGENTS.md examples

Formats

AGENTS.md
CLAUDE.md
Cursor rules
Copilot instructions

Reference

Read API
Corpus health
Privacy Policy
Terms

RuleStack

RuleStack

Built by

Kynth Studio

Directory

Configs
Stacks
Compare formats
Diff two configs
Best AGENTS.md examples

Formats

AGENTS.md
CLAUDE.md
Cursor rules
Copilot instructions

Reference

Read API
Corpus health
Privacy Policy
Terms

RuleStack