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.
git clone --depth 1 https://github.com/bernierllc/agents-environment-configWrote 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.
[](https://agentmods.dev/rules/bernierllc/agents-environment-config/port-management)<a href="https://agentmods.dev/rules/bernierllc/agents-environment-config/port-management"><img src="https://agentmods.dev/badge/rules/bernierllc/agents-environment-config/port-management/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.
<a href="https://agentmods.dev/rules/bernierllc/agents-environment-config/port-management"><img src="https://agentmods.dev/badge/rules/bernierllc/agents-environment-config/port-management.svg" alt="Reviewed on agentmods" width="80" height="20"></a>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.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5.1 | $0.01916 | $0.01916 |
| Opus 5.5 | $0.00766 | $0.00766 |
| Sonnet 5.5 | $0.00383 | $0.00383 |
| Haiku 4.5 | $0.00192 | $0.00192 |
Grade A, and why
port-management 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 1mo 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.
How it starts
The opening of the file, as written. The whole thing — 190 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Port Management Rules
Objective
Prevent port conflicts across all projects on this machine using AEC's port registry.
When this rule applies
The port registry is opt-in. Follow this rule only in a project whose AGENTINFO.md contains the <!-- aec-port-registry:start --> marker; AEC writes that marked block when the user enables the registry and removes it when they turn it off. Without the marker (a ## Port Registry heading alone does not count), the user has opted out: do not run aec ports or require registration, and choose ports as the project already does.
Port Management System
Where ports live
- Per project: the
portssection of the project's.aec.json(source of truth for that project) - Across projects: AEC's registry, maintained by
aec ports(never edit it by hand) - Updates: Declare a port in
.aec.jsonand register it before adding a service or changing a port
Port Allocation Rules
Port Registration Requirements
- MANDATORY: Declare every service port in the project's
.aec.jsonand register it withaec ports register - BEFORE: Adding new services or changing existing ports, run
aec ports check - VERIFY: Resolve every conflict
aec ports checkreports before committing - UPDATE: After a port change, run
aec ports unregisterthenaec ports register(register only adds)
Port Range Allocations
- System Ports: 1-1023 (reserved for system)
- User Ports: 1024-49151 (available for projects)
- Dynamic Ports: 49152-65535 (OS-assigned)
- Testing Range: 5000-5999 (test containers)
- Development Range: 3000-3999 (dev servers)
- Database Range: 5400-5499 (databases)
- Cache Range: 6300-6399 (Redis, Memcached)
- Webhook Range: 34000-34999 (test webhooks)
Declaring ports in .aec.json
{
"ports": {
"web": { "port": 3000, "protocol": "http", "description": "Next.js dev server" },
"db": { "port": 5432, "protocol": "tcp", "description": "Postgres" }
}
}
Name each entry for the service it serves; protocol and description are shown by aec ports list.
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.
- 1mo ago Changed · +4 lines · +455 tokens per session 26685da8164b
- 1mo ago First seen · 186 lines · 1,461 tokens per session scan A 698c5e4121f0
port-management is a cursor rule published in the GitHub repository bernierllc/agents-environment-config (11 stars, last pushed yesterday), licensed MIT. It adds 1,916 tokens to every session, about $0.0077 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-31.
Other cursor rules, from other repositories
05-web-development
Use the following format for code blocks.
po
AIOX agent @po - Product Owner.
github-workflow
Aggregating MCP server: one authenticated endpoint for every MCP server a platform runs, with meta-tool discovery, toolsets, OAuth 2.1 and SSO through Dex, and Kubernetes custom resources.
03-project-structure
The repository is organized in a monorepo using pnpm workspaces: pnpm-workspace.yaml. It contains the following.
on-load-rule
This guide outlines the critical development principles for this Swift project.
_base-jtbd-thinking
A product-planning rule based on Jobs To Be Done, a way to describe the real task a user is trying to accomplish. It uses Job Stories instead of User Stories and compares expected benefits with user costs or effort.