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-actions.mdc

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

Cursor rules

Quality

93/100

Scores the file, not the repository.

Length

820 words

14 headings · 8 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-actions.mdcRawGitHub
1---
2description: "Subagent task: Fix strict TypeScript errors in broker-protection action files and add to CORE_FILES"
3globs:
4 - "scripts/check-strict-core.js"
5 - "injected/src/features/broker-protection/actions/build-url.js"
6 - "injected/src/features/broker-protection/actions/build-url-transforms.js"
7 - "injected/src/features/broker-protection/actions/captcha-callback.js"
8 - "injected/src/features/broker-protection/actions/captcha-deprecated.js"
9 - "injected/src/features/broker-protection/actions/click.js"
10 - "injected/src/features/broker-protection/actions/extract.js"
11 - "injected/src/features/broker-protection/actions/fill-form.js"
12---
13 
14# Strict TypeScript: Broker Protection Actions
15 
16## Task
17 
18Fix all strict-mode TypeScript errors in 7 broker-protection action files and add them to `CORE_FILES`.
19 
20## Branch
21 
22```
23git checkout main && git pull origin main && git checkout -b cursor/strict/broker-protection-actions
24```
25 
26## Files (39 errors total)
27 
28### `injected/src/features/broker-protection/actions/build-url.js` (3 errors)
29```
30(11,26): error TS7006: Parameter 'action' implicitly has an 'any' type.
31(27,37): error TS7006: Parameter 'action' implicitly has an 'any' type.
32(27,45): error TS7006: Parameter 'userData' implicitly has an 'any' type.
33```
34 
35### `injected/src/features/broker-protection/actions/build-url-transforms.js` (5 errors)
36```
37(68,52): error TS7006: Parameter 'range' implicitly has an 'any' type.
38(149,41): error TS2345: Argument of type 'string | number | undefined' is not assignable to parameter of type 'string | number'.
39(168,50): error TS2345: Argument of type 'string | undefined' is not assignable to parameter of type 'string'.
40(177,21): error TS7006: Parameter 's' implicitly has an 'any' type.
41(179,41): error TS7006: Parameter 'word' implicitly has an 'any' type.
42```
43 
44### `injected/src/features/broker-protection/actions/captcha-callback.js` (12 errors)
45```
46(13,16): error TS2532: Object is possibly 'undefined'.
47(13,27): error TS2339: Property 'function' does not exist on type '{ id: string; version: string; }'.
48(15,13): error TS2532: Object is possibly 'undefined'.
49(15,24): error TS2339: Property 'function' does not exist on type '{ id: string; version: string; }'.
50(16,54): error TS2532: Object is possibly 'undefined'.
51(16,65): error TS2339: Property 'callback' does not exist on type '{ id: string; version: string; }'.
52(50,26): error TS2339: Property 'pageurl' does not exist on type '{ id: string; version: string; }'.
53(56,26): error TS2339: Property 'sitekey' does not exist on type '{ id: string; version: string; }'.
54(60,30): error TS2339: Property 'callback' does not exist on type '{ id: string; version: string; }'.
55(61,30): error TS2339: Property 'function' does not exist on type '{ id: string; version: string; }'.
56(63,30): error TS2339: Property 'function' does not exist on type '{ id: string; version: string; }'.
57(64,30): error TS2339: Property 'callback' does not exist on type '{ id: string; version: string; }'.
58```
59 
60### `injected/src/features/broker-protection/actions/captcha-deprecated.js` (1 error)
61```
62(95,30): error TS7006: Parameter 'action' implicitly has an 'any' type.
63```
64 
65### `injected/src/features/broker-protection/actions/click.js` (6 errors)
66```
67(48,102): error TS18046: 'error' is of type 'unknown'.
68(69,31): error TS18048: 'elem' is possibly 'undefined'.
69(74,28): error TS18048: 'elem' is possibly 'undefined'.
70(196,63): error TS18046: 'error' is of type 'unknown'.
71(203,79): error TS18046: 'error' is of type 'unknown'.
72(211,72): error TS18046: 'error' is of type 'unknown'.
73```
74 
75### `injected/src/features/broker-protection/actions/extract.js` (9 errors)
76```
77(94,37): error TS7006: Parameter '_' implicitly has an 'any' type.
78(94,40): error TS7006: Parameter 'value' implicitly has an 'any' type.
79(141,13): error TS7053: Element implicitly has an 'any' type because expression of type 'string' can't be used to index type '{}'.
80(156,13): error TS7053: Element implicitly has an 'any' type because expression of type 'string' can't be used to index type '{}'.
81(173,28): error TS7053: Element implicitly has an 'any' type because expression of type 'string' can't be used to index type '{ profileUrl: ... }'.
82(177,28): error TS7053: Element implicitly has an 'any' type because expression of type 'string' can't be used to index type '{ profileUrl: ... }'.
83(205,11): error TS7034: Variable 'matchedFields' implicitly has type 'any[]'.
84(211,18): error TS7005: Variable 'matchedFields' implicitly has an 'any[]' type.
85(376,27): error TS7006: Parameter 'link' implicitly has an 'any' type.
86```
87 
88### `injected/src/features/broker-protection/actions/fill-form.js` (3 errors)
89```
90(111,31): error TS7053: Element implicitly has an 'any' type because expression of type 'any' can't be used to index type (US state map).
91(232,25): error TS7006: Parameter 'element' implicitly has an 'any' type.
92(258,40): error TS18046: 'e' is of type 'unknown'.
93```
94 
95## Fix Patterns
96 
97- **TS7006** (Parameter implicitly any): Add `@param {Type}` JSDoc annotations. Look at how the param is used and what calling code passes.
98- **TS2339** (Property doesn't exist): The type `{ id: string; version: string; }` in captcha-callback.js is too narrow — find the actual type definition or extend it with the missing properties via `@typedef`.
99- **TS2532/TS18048** (Possibly undefined): Add null checks before accessing.
100- **TS18046** ('error' is unknown): Cast or check `error instanceof Error` before accessing `.message`.
101- **TS7053** (No index signature): Use `Record<string, X>` casts or narrow index types.
102- **TS7034/TS7005** (Variable implicitly any): Add explicit type annotations at declaration.
103- **TS2345** (Argument not assignable): Add null/undefined guards or narrow types.
104 
105## Workflow
106 
1071. `npm ci`
1082. Add all 7 files to CORE_FILES in `scripts/check-strict-core.js`
1093. Fix each file's errors using JSDoc type annotations
1104. `npm run tsc-strict-core` — must pass
1115. `npm run test-unit` — must pass
1126. `npm run lint` — must pass (run `npm run lint-fix` first if needed)
1137. Commit: `fix(types): add strict checking for broker-protection action files`
1148. `git push -u origin cursor/strict/broker-protection-actions`
115 
116## Constraints
117 
118- Do NOT use `any` — use `unknown`, specific types, or proper interfaces
119- Do NOT use `@ts-ignore` or `@ts-expect-error`
120- Do NOT modify files outside the assigned list (except `scripts/check-strict-core.js`)
121- Do NOT remove existing CORE_FILES entries
122- Preserve existing behavior — type fixes only, no logic changes
123 

Commands it names

  • git checkout main && git pull origin main && git checkout -b cursor/strict/broker-protection-actions
  • 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-actions

Sections

  • Strict TypeScript: Broker Protection Actions
  • Task
  • Branch
  • Files (39 errors total)
  • `injected/src/features/broker-protection/actions/build-url.js` (3 errors)
  • `injected/src/features/broker-protection/actions/build-url-transforms.js` (5 errors)
  • `injected/src/features/broker-protection/actions/captcha-callback.js` (12 errors)
  • `injected/src/features/broker-protection/actions/captcha-deprecated.js` (1 error)
  • `injected/src/features/broker-protection/actions/click.js` (6 errors)
  • `injected/src/features/broker-protection/actions/extract.js` (9 errors)
  • `injected/src/features/broker-protection/actions/fill-form.js` (3 errors)
  • Fix Patterns
  • Workflow
  • Constraints

What it covers

buildtestcode-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/actions/build-url.js
  • injected/src/features/broker-protection/actions/build-url-transforms.js
  • injected/src/features/broker-protection/actions/captcha-callback.js
  • injected/src/features/broker-protection/actions/captcha-deprecated.js
  • injected/src/features/broker-protection/actions/click.js
  • injected/src/features/broker-protection/actions/extract.js
  • injected/src/features/broker-protection/actions/fill-form.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-rest.mdc · 70Cursor rulestypescriptjavascript+5teststyletypesgit+389/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-rest.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
dodgecfr/combatfilms-webapp.cursor/rules/frontend.mdc · 0Cursor rulestypescriptturborepo+15setuptestlint-formatstyle+799/1003 days ago
deifos/clipmira-subtitles.cursor/rules/frontend.mdc · 1Cursor rulestypescriptnextjs+5setuptestlint-formatstyle+799/1003 days ago
TechSquidTV/Hermes.cursor/rules/20-hermes-api-tests.mdc · 45Cursor rulestypescriptpytest+15teststyletesting-strategysecurity+397/1003 days ago
langflow-ai/langflow.cursor/rules/docs_development.mdc · 153kCursor rulespythonnode+16setupbuildtestlint-format+797/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