npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@ignaciocastro0713/cortex

v0.2.4

Published

Knowledge distribution engine — syncs AI skills, agents, and MCP configs across projects.

Readme

Cortex

npm version npm downloads Node.js >= 22 License: MIT

Write your AI knowledge once. Distribute it everywhere.

AI coding assistants like GitHub Copilot, Gemini, and Claude read instructions from platform-specific directories (~/.copilot/, ~/.gemini/, ~/.claude/). If you use multiple assistants, you end up duplicating the same agent definitions and skill prompts in each — keeping them in sync is tedious and error-prone.

Cortex solves this by storing your knowledge in one central place (~/.cortex/ai/) and copying it to each platform's global directory. Edit the source once — run cortex sync to propagate the changes everywhere.

Install

npm install -g @ignaciocastro0713/cortex

Requirements: Node.js >= 22 · Git (for cortex update)

Quick start

1. Initialize (run once)

cortex init

Creates the following structure in your home directory:

~/.cortex/
  cortex.toml       ← configuration file
  ai/
    agents/         ← AI agent definitions (.md files)
    skills/         ← skill and instruction prompts (.md files)
  deps/             ← third-party knowledge cloned from Git

2. Add your knowledge files

Create .md files in ~/.cortex/ai/agents/ and ~/.cortex/ai/skills/. These are plain Markdown files that your AI assistant will read as instructions.

Example — ~/.cortex/ai/agents/code-review.md:

# Code Review Agent
Review code for correctness, edge cases, and style issues.
Always suggest tests for uncovered paths.

Example — ~/.cortex/ai/skills/testing.md:

# Testing Skill
Write unit tests using the AAA pattern (Arrange, Act, Assert).
Prefer pure functions and avoid mocking unless necessary.

3. Configuration

~/.cortex/cortex.toml controls everything:

platforms = ["copilot", "gemini", "claude"]

[deps]
# Clone a third-party knowledge repo as a dependency
design-doc-mermaid = "https://github.com/SpillwaveSolutions/design-doc-mermaid"

[skills]
paths = [
  "~/.cortex/ai/skills/*",   # your own skills
  "@design-doc-mermaid",     # all files from the dep above
]

[agents]
paths = ["~/.cortex/ai/agents/*"]

# MCP servers synced globally to ~/.copilot/mcp-config.json and ~/.gemini/settings.json
[mcp.playwright]
command = "npx"
args = ["@playwright/mcp@latest"]

[mcp.context7]
command = "npx"
args = ["-y", "@upstash/context7-mcp"]

4. Sync

cortex sync

Cortex copies your files to ~/.copilot/ (Copilot), ~/.gemini/ (Gemini), and ~/.claude/ (Claude). Run this once after editing your knowledge sources — the files are available globally in every project. Only files managed by Cortex are overwritten — files you created manually are left untouched. If Cortex previously synced a file and you've edited it locally, that file is skipped with a warning in the tree; use --force to overwrite it.

Files removed from your config are automatically detected and deleted on the next sync. Empty directories are cleaned up automatically; directories containing files not managed by Cortex are preserved.

MCP server configs defined in [mcp] are synced to each platform's config file using a merge strategy — your manually-defined servers are preserved, and Cortex-managed servers are added or updated.

How it works

graph TB
    Source["🧠 ~/.cortex/ai/
    ─────────────────
    agents/
      └─ code-review.md
    skills/
      ├─ planning/
      └─ implementation/"]

    subgraph cortex sync
        CMD["cortex sync"]
    end

    Source -->|copies| CMD

    CMD --> PA["💻 ~/.copilot/
      agents/
      skills/"]

    CMD --> PB["💻 ~/.gemini/
      agents/
      skills/"]

    CMD --> PC["💻 ~/.claude/
      agents/
      skills/"]

    style Source fill:#2d5a27,color:#fff,stroke:#4a9e42
    style CMD fill:#1a3a5c,color:#fff,stroke:#2e6da4

Commands

| Command | Description | |---------|-------------| | cortex init | Create ~/.cortex/cortex.toml and the ~/.cortex/ai/ folder structure | | cortex sync | Copy knowledge files to global platform directories and sync MCP configs | | cortex list | Show the map of knowledge sources configured in cortex.toml | | cortex clean | Remove all cortex-managed files and MCP entries from platform directories. Asks for confirmation unless --force is passed. Also cleans files from platforms removed from the config. | | cortex update | Pull latest changes for ~/.cortex/ai/ and all deps |

Options

| Flag | Short | Description | |------|-------|-------------| | --dry-run | -d | Preview sync without making any changes | | --force | -f | sync: overwrite locally modified files · clean: skip confirmation prompt | | --version | -v | Print the current version and exit | | --help | -h | Show the help message |

Configuration reference

Path prefixes

| Prefix | Resolves to | |--------|-------------| | ~ | User home directory | | @alias | ~/.cortex/deps/{alias} (a cloned dependency) |

Platforms

| Platform | Files copied to | MCP config path | |----------|---------------------|---------------------| | copilot | ~/.copilot/ | ~/.copilot/mcp-config.json | | gemini | ~/.gemini/ | ~/.gemini/settings.json | | claude | ~/.claude/ | ~/.claude.json |

Project structure

src/
  index.ts          Entry point and argument parsing
  core/
    constants.ts    Shared paths and platform definitions
    hash-db.ts      MD5 hash tracking for dirty-file detection
    mcp.ts          MCP server config merge into platform JSON files
    parser.ts       TOML config reader/writer
    resolver.ts     Config resolution and entry deduplication
  utils/
    fs-utils.ts     Filesystem operations (copy, glob, path expansion)
    git-utils.ts    Git wrapper (clone, pull)
    log.ts          Colored terminal output via node:util styleText
    tree.ts         ASCII tree renderer
  commands/
    init.ts
    update.ts
    sync.ts
    list.ts
    clean.ts
test/
  commands/
    init.test.ts
    sync.test.ts
    list.test.ts
    clean.test.ts
    update.test.ts
  fs-utils.test.ts
  fs-utils-io.test.ts
  mcp.test.ts
  resolver.test.ts
  parser.test.ts
  sync-filters.test.ts
  git-utils.test.ts

License

MIT — see LICENSE for details.