Audite et génère des fichiers pour agents de codage IA, tels que CLAUDE.md et les règles Cursor, afin de réduire la consommation de tokens et de créer des spécifications de build complètes pour le projet.
Aussi connu sous THE-KIPDEV/specpack
- Étoiles
- 0
- Outils
- —
- Téléchargements, 30 jours
- —
- Dernière version
- 0.1.0
- Dernier commit
- 18 sept. 2026
- Licence
- MIT
Qu'est-ce que specpack MCP ?
specpack est un serveur MCP. Audite et génère des fichiers pour agents de codage IA, tels que CLAUDE.md et les règles Cursor, afin de réduire la consommation de tokens et de créer des spécifications de build complètes pour le projet.
Résumé généré à partir du README du projet
À propos du MCP server specpack
Specpack aide les développeurs à optimiser les fichiers d'instructions utilisés par les agents de codage IA, tels que CLAUDE.md, AGENTS.md et .cursorrules. Il se concentre sur la réduction du gaspillage de tokens en identifiant les informations redondantes, comme les préambules de jeu de rôle, les conseils génériques ou les données de manifeste répétées qui consomment de la mémoire sans apporter de valeur ajoutée. L'outil peut auditer des fichiers existants pour fournir un score de superflu et suggérer des lignes spécifiques à supprimer ou à déplacer vers des fichiers de documentation séparés.
Les utilisateurs peuvent initialiser de nouveaux fichiers d'agents légers en scannant les manifestes du projet comme package.json, tsconfig.json ou pyproject.toml. Pour les nouveaux projets, la commande spec génère une spécification de build complète et les fichiers d'agents correspondants à partir d'une description de projet. Le serveur peut être exécuté localement via npx ou connecté à des clients MCP comme Claude Code, Cursor et Windsurf. Bien que l'audit et l'initialisation se fassent hors ligne pour garantir la confidentialité, la génération de spécifications complètes nécessite une clé API du service prompt-generator-website.com, qui propose un niveau gratuit limité pour les premiers brouillons.
Ce que vous pouvez faire avec
- 1Auditer le superflu dans les fichiers d'agentsAnalysez un fichier CLAUDE.md pour trouver les lignes redondantes qui gaspillent des tokens lors des sessions d'IA.
- 2Initialiser des instructions de projet légèresCréez un fichier AGENTS.md minimal basé sur les fichiers de configuration existants du projet comme package.json ou Docker Compose.
- 3Générer des spécifications de build complètesTransformez une simple description de projet en une spécification technique complète incluant les schémas de base de données et les règles de l'agent.
Extrait du README du projet. Chaque cas d'utilisation est vérifié par rapport à une citation du document.
Comment installer specpack MCP
Formats vérifiés le 10 nov. 2026Ajouter à CursorAjouter à GooseInstaller specpack MCP dans Claude Code
$ claude mcp add --env 'SPECPACK_API_KEY=<YOUR_SPECPACK_API_KEY>' specpack -- npx -y specpackInstaller specpack MCP dans Cursor
~/.cursor/mcp.json
{
"mcpServers": {
"specpack": {
"command": "npx",
"args": [
"-y",
"specpack"
],
"env": {
"SPECPACK_API_KEY": "<YOUR_SPECPACK_API_KEY>"
}
}
}
}Installer specpack MCP dans VS Code
.vscode/mcp.json
{
"servers": {
"specpack": {
"type": "stdio",
"command": "npx",
"args": [
"-y",
"specpack"
],
"env": {
"SPECPACK_API_KEY": "<YOUR_SPECPACK_API_KEY>"
}
}
}
}Installer specpack MCP dans VS Code CLI
$ code --add-mcp '{"name":"specpack","type":"stdio","command":"npx","args":["-y","specpack"],"env":{"SPECPACK_API_KEY":"<YOUR_SPECPACK_API_KEY>"}}'Installer specpack MCP dans Claude Desktop
claude_desktop_config.json
{
"mcpServers": {
"specpack": {
"command": "npx",
"args": [
"-y",
"specpack"
],
"env": {
"SPECPACK_API_KEY": "<YOUR_SPECPACK_API_KEY>"
}
}
}
}Installer specpack MCP dans Codex
$ codex mcp add specpack --env 'SPECPACK_API_KEY=<YOUR_SPECPACK_API_KEY>' -- npx -y specpackInstaller specpack MCP dans Codex config.toml
~/.codex/config.toml
[mcp_servers.specpack] command = "npx" args = ["-y", "specpack"] [mcp_servers.specpack.env] SPECPACK_API_KEY = "<YOUR_SPECPACK_API_KEY>"
Installer specpack MCP dans Gemini CLI
$ gemini mcp add -s user -e 'SPECPACK_API_KEY=<YOUR_SPECPACK_API_KEY>' specpack npx -- -y specpackInstaller specpack MCP dans Gemini settings.json
~/.gemini/settings.json
{
"mcpServers": {
"specpack": {
"command": "npx",
"args": [
"-y",
"specpack"
],
"env": {
"SPECPACK_API_KEY": "<YOUR_SPECPACK_API_KEY>"
}
}
}
}Configuration
SPECPACK_API_KEYSecretOptional prompt-generator-website.com API key (pgw_…): more specs and AI drafts than the free quota.
| Nom | Description | Type |
|---|---|---|
| SPECPACK_API_KEY | Optional prompt-generator-website.com API key (pgw_…): more specs and AI drafts than the free quota. | Secret |
Vérifications automatisées
Exécuté le 14 nov. 2026Rapport complet →A passé nos vérifications automatisées. Il ne s'agit pas d'un audit de sécurité : lisez le code et donnez au serveur l'accès le plus restreint dont il a besoin. Fonctionnement des vérifications
- Dépôt source lié et accessiblethe-kipdev/specpack is public and reachablegithub.com/the-kipdev/specpack ↗Réussi
- Le nom du package correspond au dépôt sourcespecpack names the-kipdev/specpack as sourcenpmjs.com/package/specpack ↗Réussi
- Provenance du build (attestation Sigstore)No build attestation published for this releaseNon vérifié
- Licence open source (OSI)MITspdx.org/licenses/MIT.html ↗Réussi
- Commit ou version publiée au cours de l'année écouléeLast commit or release 2026-09-18github.com/the-kipdev/specpack ↗Réussi
- OpenSSF ScorecardNon vérifié
- Nom du package non proche d'un package populaireNo popular package one edit away from specpackRéussi
- Aucun avis critique dans le package ou ses dépendances99 resolved dependencies checked; no critical advisoryosv.dev ↗Réussi
- Aucune instruction cachée destinée au modèle0 tool descriptions and the README read; no override phrases, credential paths or hidden charactersRéussi
- Les outils destructifs sont étiquetésNon vérifié
- Le point de terminaison distant répond à la poignée de main MCPinitialize answered with protocol 2025-06-18 in 942 msRéussi
README
Voir sur GitHubspecpack
Lint and generate the files your AI coding agent reads — CLAUDE.md, AGENTS.md, .cursorrules,
Cursor rules — and turn a project description into a full build spec. CLI, library and MCP server.
npx specpack audit # bloat score for the agent files in this repo (offline)
npx specpack init # write a lean AGENTS.md from your manifests (offline)
npx specpack spec --describe "Booking app for dog groomers with deposits and SMS reminders"
CLAUDE.md / AGENTS.md are loaded into the agent's context on every session. Every line that
restates package.json, pastes a file tree or tells the model to "write clean code" costs tokens and
competes with the two rules that actually matter. specpack audit finds those lines; specpack init
starts you at the trimmed end.
Node ≥ 18. No account needed. audit and init never touch the network.
specpack audit — how much of your memory file does nothing?
Each line is classified keep, cut (removing it changes nothing: role-play preamble, generic
advice, restated manifests, duplicates, emphasis inflation, prose) or offload (true but
situational: file trees, schema dumps, endpoint lists, long code blocks, setup/deploy sections — move
them to their own file and reference them with @docs/…). Same rules as the browser tool at
prompt-generator-website.com/claude-md-audit.
Real output on a typical file:
$ npx specpack audit CLAUDE.md
CLAUDE.md 59% bloat · 44 lines · ~341 tokens every session
10 keep · 12 cut · 15 offload of 37 non-empty lines · ceiling 200, trimmed files land near 60
Over half of this file is doing nothing. It is not neutral weight — it is what your real rules are competing against.
3 cut You are an expert senior full-stack developer with 10 years of experience.
↳ role-play preamble: CLAUDE.md is project memory, not a system prompt. "You are an expert…" costs tokens and changes nothing about the code produced.
4 cut Please always write clean, readable and maintainable code.
↳ default behaviour: Removing this line does not make the model write worse code — it already tries to do this. It only dilutes the lines that matter.
5 cut IMPORTANT: follow best practices at all times.
…
12 cut - Next.js 15.1
↳ restates a manifest: package.json / composer.json / requirements.txt already state this, and the agent reads them. Keep it only if the version pin has a non-obvious reason.
…
18 offload ## Database schema
↳ situational section: Only a fraction of your sessions need this. Move the section to its own file and point at it with @docs/… so it loads when the task asks for it.
…
31 offload src/
↳ file tree: Root of a pasted directory tree. The agent can run ls and get the real one — a copy goes stale after the first refactor.
…
Trimmed copy (8 lines): specpack audit CLAUDE.md --trimmed
Without arguments it audits every agent file in the current directory: CLAUDE.md, AGENTS.md,
.cursorrules, .windsurfrules, .github/copilot-instructions.md, CLAUDE.local.md,
.cursor/rules/*.mdc. - reads stdin.
| Option | |
|---|---|
--trimmed |
print only the keep-only version (> CLAUDE.trimmed.md) |
--json |
every line with verdict, rule and reason, plus stats and the trimmed file |
--all |
also list the kept lines and why |
--max-bloat <pct> |
exit code 1 when a file is above the threshold |
In CI
# .github/workflows/agent-files.yml
name: Agent files
on: [pull_request]
jobs:
audit:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- run: npx -y specpack audit --max-bloat 30
specpack init — a lean AGENTS.md from what the repo already says
Reads package.json (scripts, lockfile → package manager, framework), tsconfig.json, the Prisma
schema, pyproject.toml / requirements*.txt (uv, Poetry), composer.json, go.mod, Cargo.toml,
Gemfile, Makefile, Docker Compose, .nvmrc, .env.example, .claude/commands. Only what a file
states is written: nothing is guessed, no patch versions, no "You are an expert" preamble. Sections with
nothing detected are left out.
Real output on a Next.js + Prisma repository:
$ npx specpack init
✓ Wrote AGENTS.md (37 lines, 0% bloat)
Scanned from package.json, tsconfig.json, prisma/schema.prisma, .nvmrc, docker-compose.yml, .env.example, .gitignore, .claude/commands/.
# AGENTS.md — ledgerly
Invoicing app for freelancers. A web application.
## Stack
- Next.js (App Router)
- Tailwind CSS
- Zod
- Stripe
- Vitest
- Playwright
- ESLint
- TypeScript (strict)
- Prisma + PostgreSQL (schema: prisma/schema.prisma)
- Local services via Docker Compose (docker-compose.yml): db
## Commands
- `pnpm dev` — `next dev --turbopack -p 3001` (port 3001)
- `pnpm build` — `next build`
- `pnpm start` — `next start`
- `pnpm test` — `vitest run`
- `pnpm test:e2e` — `playwright test`
- `pnpm lint` — `next lint`
- `pnpm db:migrate` — `prisma migrate dev`
- `pnpm db:seed` — `tsx prisma/seed.ts`
- `docker compose up -d`
## Project rules
These are things the agent cannot guess from the code. Follow them exactly.
- Use pnpm (pnpm-lock.yaml), not npm or yarn — another package manager ignores the lockfile.
- Runtime: Node 20 (.nvmrc).
- Environment variables are listed in `.env.example`; the real `.env` is git-ignored — do not commit it.
<!-- Add the rules the code cannot tell the agent, one per line: the directory scheduled for deletion,
money stored in cents, the command that must never run against staging. -->
Then add the rules only you know under Project rules — that is the part that matters.
| Option | |
|---|---|
--format agents |
AGENTS.md (default) |
--format claude |
CLAUDE.md — imports @AGENTS.md when it exists, plus Claude Code specifics (slash commands, .mcp.json servers) |
--format cursor |
.cursor/rules/project.mdc (always-applied rule) |
--format all |
the three |
--dry-run / --force |
preview / overwrite (existing files are never overwritten otherwise) |
specpack spec — a full build spec for a new project
For a project that does not exist yet, prompt-generator-website.com
turns a questionnaire (7 project types: SaaS, e-commerce, business site, marketplace, blog, web app,
landing page) into a complete specification — stack, database schema, authentication, type-specific
features, pages, design, SEO, security, legal, deployment, file structure — plus AGENTS.md,
CLAUDE.md, .cursor/rules/project.mdc, .cursorrules, .windsurfrules and
.github/copilot-instructions.md that keep the agent on-spec for the whole build.
# AI drafts the answers from a description (10–40 s), then the spec is generated
npx specpack spec --describe "Booking app for dog groomers with deposits and SMS reminders" --out ./groombook
# your own answers (see GET /questions in the API)
npx specpack spec --answers answers.json --type saas
# or answer the questionnaire in the terminal
npx specpack spec
The spec engine is deterministic: the same answers always give the same bytes. Free without an
account: 2 specs and 3 AI drafts. More: a 7-day Pass or Pro at
prompt-generator-website.com/pricing; then
specpack login pgw_… (or SPECPACK_API_KEY). specpack whoami shows what is left.
MCP server
Seven tools for Claude Code, Cursor, Windsurf, VS Code and any MCP client:
| Tool | Where it runs | |
|---|---|---|
audit_agent_file |
local | bloat score, lines to cut/offload with reasons, trimmed copy |
draft_agent_file |
local | lean AGENTS.md / CLAUDE.md / Cursor rule from the manifests (returns it, writes nothing) |
list_project_types |
API | the 7 project types |
get_questionnaire |
API | every question for a type; the agent fills it from the conversation and the repo |
generate_spec |
API | spec + agent files, written to output_dir if given (files picks which). No AI on the server |
draft_answers |
API | AI fills the questionnaire from a description (uses an AI draft) |
get_usage |
API | plan and what is left |
Claude Code
claude mcp add specpack -- npx -y specpack mcp
Cursor (.cursor/mcp.json), Windsurf, Claude Desktop
{
"mcpServers": {
"specpack": { "command": "npx", "args": ["-y", "specpack", "mcp"], "env": { "SPECPACK_API_KEY": "" } }
}
}
Remote, nothing to install (streamable HTTP; audit_agent_file and draft_agent_file read local files, so they only exist in the local server):
https://prompt-generator-website.com/mcp — optional header Authorization: Bearer pgw_….
claude mcp add --transport http specpack https://prompt-generator-website.com/mcp
Library
import { audit, scanProject, renderAgentsMd, SpecpackClient } from "specpack";
const { stats, lines, trimmed } = audit(fs.readFileSync("CLAUDE.md", "utf8"));
console.log(`${stats.bloat}% bloat`, lines.filter((l) => l.verdict === "cut").length, "lines to cut");
const agentsMd = renderAgentsMd(scanProject("."));
const client = new SpecpackClient({ apiKey: process.env.SPECPACK_API_KEY });
const draft = await client.draft("A booking app for dog groomers");
const spec = await client.createSpec(draft.type, draft.answers); // spec.spec, spec.files["AGENTS.md"]…
createMcpServer() is exported from specpack/mcp. API errors are SpecpackError with code
(quota_exceeded, unauthorized, invalid_request, …), status and upgradeUrl.
Reference
- Exit codes:
0ok ·1failure, or--max-bloatexceeded ·2usage error or quota exceeded. - Environment:
SPECPACK_API_KEY,SPECPACK_API_URL(testing),NO_COLOR. - Key storage:
~/.config/specpack/config.json($XDG_CONFIG_HOMEhonoured), mode 600. - HTTP API: API-V1.md.
- Privacy:
auditandinitread local files and send nothing.specsends your answers or description to prompt-generator-website.com.
License
MIT © Kipdev
Questions sur specpack MCP
Comment ajouter specpack MCP à Claude Code ?
Exécutez claude mcp add --env 'SPECPACK_API_KEY=<YOUR_SPECPACK_API_KEY>' specpack -- npx -y specpack dans votre terminal. Ajoutez --scope user pour le rendre disponible dans tous les projets.
Comment ajouter specpack MCP à Cursor ?
Ouvrez ~/.cursor/mcp.json et ajoutez le serveur sous mcpServers, avec la configuration Cursor indiquée dans la section d'installation ci-dessus.
L'audit de mes fichiers nécessite-t-il une connexion internet ?
Non, les commandes audit et init fonctionnent hors ligne et n'utilisent jamais le réseau.
Quel type de fichiers specpack peut-il auditer ?
Il peut auditer divers fichiers d'agents, notamment CLAUDE.md, AGENTS.md, .cursorrules, .windsurfrules et les instructions GitHub Copilot.
Comment specpack aide-t-il à gérer l'utilisation des tokens ?
Il identifie les lignes superflues, comme les préambules de jeu de rôle ou les manifestes redondants, qui consomment des tokens sans améliorer les performances de l'agent.