Skip to content

For AI agents

AI coding assistants (Claude Code, Cursor, GitHub Copilot, Codex and others) install packages for you. Left alone, an agent that can't find a package will often "fix" the problem by adding PyPI or the npm registry as a fallback, which installs exactly what SWNDX left out. These rules stop that. Paste the version for your project into its agent instructions.

Machine-readable versions of these docs: /llms.txt and /llms-full.txt.

The rules

  1. Use only the SWNDX indexes. Python: https://py.swndx.dev/public/default/simple/ (default), or https://py.swndx.dev/public/relaxed/simple/ (relaxed) if the project uses that one. npm: https://node.swndx.dev/public/default/.
  2. Never add a fallback. Never add --extra-index-url, pypi.org, registry.npmjs.org or another registry, scope or mirror. That includes adding relaxed next to default, or moving a project from one to the other: which Python index a project uses is the user's decision.
  3. Read the error. A 404 or a missing version means SWNDX's policy left it out; a timeout, TLS or DNS error is a network problem; 401/403 is a token problem; 429 is the rate limit.
  4. When a package or version isn't available, stop and tell the user. Suggest the feedback form (https://swndx.dev/feedback/). Don't work around it: no vendoring, no git or tarball URLs, no other index.
  5. Prefer versions the index lists. Don't pin a newer version the index doesn't serve; it may still be in quarantine.
  6. Keep tokens out of files. Read a SWNDX token only from an environment variable or the tool's credential store, and never write one into a committed file.
  7. Treat unfamiliar package names as suspect. If you aren't sure a package exists, check before installing. A 404 from SWNDX is a safety signal, not an obstacle.

The snippets below use the default Python index. For a project on relaxed (which one?), replace https://py.swndx.dev/public/default/simple/ with https://py.swndx.dev/public/relaxed/simple/.

Python projects: AGENTS.md or CLAUDE.md

## Python packages
- Install Python packages only from https://py.swndx.dev/public/default/simple/
  (uv: `[[tool.uv.index]]` with `default = true`; pip: `--index-url`).
- Never add `--extra-index-url`, pypi.org or any other index, even if a package is missing.
  Don't switch to or add the other SWNDX Python index either; ask me.
- A 404 or missing version means the curated index left it out on purpose. Stop and tell me;
  suggest https://swndx.dev/feedback/. Don't vendor it, install from git, or use another index.
- Prefer versions the index lists over pinning newer ones.
- If you're unsure a package name exists, ask before installing it.
- Read the SWNDX token only from the environment (UV_INDEX_SWNDX_PASSWORD); never write it to a file.

Node projects: AGENTS.md or CLAUDE.md

## npm packages
- The registry is https://node.swndx.dev/public/default/ (set in .npmrc). Don't change it.
- Never add registry.npmjs.org, a scoped registry or a mirror as a fallback.
- A 404 or missing version means the curated registry left it out on purpose. Stop and tell me;
  suggest https://swndx.dev/feedback/. Don't install from git, a tarball URL or another registry.
- Prefer versions the registry lists over pinning newer ones.
- If you're unsure a package name exists, ask before installing it.
- The token comes from ${SWNDX_TOKEN} in .npmrc; never write a token into a file.

Both: AGENTS.md or CLAUDE.md

## Package sources
- Python packages only from https://py.swndx.dev/public/default/simple/; npm packages only from https://node.swndx.dev/public/default/.
- Never add a fallback index or registry (--extra-index-url, pypi.org, registry.npmjs.org, mirrors).
- A 404 or missing version is the curated index's decision. Stop and tell me, and suggest
  https://swndx.dev/feedback/. No vendoring, git URLs or other indexes.
- Prefer listed versions; ask before installing a package name you aren't sure exists.
- Tokens come only from the environment or a credential store; never write one into a file.

Cursor: .cursor/rules/packages.mdc

---
description: Package sources (SWNDX)
alwaysApply: true
---
Use https://py.swndx.dev/public/default/simple/ for Python and https://node.swndx.dev/public/default/ for npm, and nothing else.
Never fall back to pypi.org or registry.npmjs.org. If a package or version is missing, stop and ask.
Never write a token into a file.

GitHub Copilot: .github/copilot-instructions.md

Install Python packages only from https://py.swndx.dev/public/default/simple/ and npm packages only from https://node.swndx.dev/public/default/.
Never add --extra-index-url, pypi.org, registry.npmjs.org or another registry as a fallback.
If a package or version isn't available, stop and tell me instead of working around it.
Never write a token into a committed file.