edgeone-makers-middleware

edgeone-makers-middleware is a cursor rule for Cursor from TencentEdgeOne/edgeone-makers-tools. It costs 33 tokens per session (1,191 once invoked), scanned A, original, MIT.

Rules for running code at the edge of the network, close to users, before a request reaches your application.

In plain words
What is it for?
They support redirects, URL rewrites, login checks, A/B tests, and adding HTTP headers in the EdgeOne Makers V8 runtime.
Why use it?
They help handle common request changes in one place instead of repeating them throughout your application.

Cursor rule for Cursor

Written for Cursor: a Cursor rule (.mdc).

Good fit They support redirects, URL rewrites, login checks, A/B tests, and adding HTTP headers in the EdgeOne Makers V8 runtime.

Compare 6 cursor rules from other repositories ↓
Install with agentmods
npx agentmods add rules/tencentedgeone/edgeone-makers-tools/makers-middleware
About the project

EdgeOne Makers Tools is a collection of AI-agent skills and related workflow files for developing and deploying projects on EdgeOne Makers. It covers agent development, deployment, edge and cloud functions, storage, middleware, command-line usage, and project templates. The catalogue entries package these capabilities as skills, rules, instructions, a hook, and a plugin for coding agents.

TencentEdgeOne/edgeone-makers-tools · 1,840 stars · on GitHub

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Clone the repo
git clone --depth 1 https://github.com/TencentEdgeOne/edgeone-makers-tools

Made for: Cursor.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for edgeone-makers-middleware

README.md
[![agentmods](https://agentmods.dev/badge/rules/tencentedgeone/edgeone-makers-tools/makers-middleware/github.svg)](https://agentmods.dev/rules/tencentedgeone/edgeone-makers-tools/makers-middleware)
Your own site
<a href="https://agentmods.dev/rules/tencentedgeone/edgeone-makers-tools/makers-middleware"><img src="https://agentmods.dev/badge/rules/tencentedgeone/edgeone-makers-tools/makers-middleware/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for edgeone-makers-middleware

Your own site · 80×15
<a href="https://agentmods.dev/rules/tencentedgeone/edgeone-makers-tools/makers-middleware"><img src="https://agentmods.dev/badge/rules/tencentedgeone/edgeone-makers-tools/makers-middleware.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 33 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 1,191 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00033 $0.01191
Opus 5.5 $0.00013 $0.00476
Sonnet 5.5 $0.00007 $0.00238
Haiku 4.5 $0.00003 $0.00119

Measured 3mo ago against content hash 983b61864d94, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

edgeone-makers-middleware scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 3mo ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

cursor/rules/makers-middleware.mdc · 197 lines

How it starts

The opening of the file, as written. The whole thing — 197 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Middleware

Lightweight request interception running at the edge (V8 runtime). Use for redirects, rewrites, auth guards, A/B testing, and header injection.

⚠️ Framework projects (Next.js, Nuxt, etc.): Do NOT use this platform middleware format. Use the framework's built-in middleware instead (e.g. Next.js middleware.ts with NextRequest/NextResponse). The patterns below are for non-framework or pure static projects only.

Basic middleware

File: middleware.js (project root)

export function middleware(context) {
  const { request, next, redirect, rewrite } = context;

  // Pass through — no modification
  return next();
}

Context API

Property Type Description
request Request Current request object
next(options?) Function Continue to origin; optionally modify headers
redirect(url, status?) Function Redirect (default 307)
rewrite(url) Function Rewrite request path (transparent to client)
geo GeoProperties Client geolocation
clientIp string Client IP address

Route matching

By default middleware runs on ALL routes. Use config.matcher to limit scope:

// Only run on /api/* routes
export const config = {
  matcher: ['/api/:path*'],
};

export function middleware(context) {
  // Auth check for API routes only
  const token = context.request.headers.get('Authorization');
  if (!token) {
    return new Response('Unauthorized', { status: 401 });
  }
  return context.next();
}

Matcher patterns:

// Single path
export const config = { matcher: '/about' };

// Multiple paths
export const config = { matcher: ['/api/:path*', '/admin/:path*'] };

// Regex
export const config = { matcher: ['/api/.*', '^/user/\\d+$'] };

Common patterns

URL Redirect

export function middleware(context) {
  const url = new URL(context.request.url);

  if (url.pathname === '/old-page') {
    return context.redirect('/new-page', 301);
  }
  return context.next();
}

Read the full file on GitHub · 197 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 3mo ago First seen · 197 lines · 33 tokens per session scan A 983b61864d94

Subscribe to this mod's changes

edgeone-makers-middleware is a cursor rule published in the GitHub repository TencentEdgeOne/edgeone-makers-tools (1,840 stars, last pushed yesterday), licensed MIT. It adds 33 tokens to every session and 1,191 once invoked, about $0.0001 per session on Opus 5.5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.

Related

edgeone-makers-middleware compared with cursor rules from other repositories

edgeone-makers-middleware next to 6 cursor rules from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
edgeone-makers-middlewareTencentEdgeOne/edgeone-makers-toolsCursor rule1.8kyesterdayMITA33Cursor
cloudflare-email-telegram-cursorrules-prompt-filePatrickJS/awesome-cursorrulesCursor rule41k6mo agoCC0-1.0A720Cursor
service-bindingslouisbrulenaudet/monorepo-templateCursor rule19yesterdayApache-2.0A775Cursor
implement-graceful-shutdown-for-your-applicationPaulJPhilp/EffectPatternsCursor rule8075mo agoMITA702Cursor
hatch3r-scalabilityhatch3r/hatch3rCursor rule262mo agoMITA0Cursor
cloudflare-workers-hono-angular-saas-cursorrules-prompt-fileXD3an/awesome-ai-coding-all-in-oneCursor rule144d agononeA1,335Cursor
knative-istio-typesense-gpu-cursorrules-prompt-filXD3an/awesome-ai-coding-all-in-oneCursor rule144d agononeA613Cursor