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

@zhanglichen/create-ai-context

v1.0.3

Published

Bootstrap .ai context layer for AI coding tools (Codex/Cursor/Claude/Aider).

Downloads

53

Readme

create-ai-context

A CLI tool to bootstrap an AI Context Layer (.ai/) for codebases. It creates human-maintained rules and generates machine indexes so AI coding tools (Codex / Cursor / Claude Code / Aider) can understand your project faster and follow your team conventions.


Quick Start (Recommended)

Run at your project root (must contain package.json):

npx @zhanglichen/create-ai-context --yes

This will:

  • Create .ai/ (lowercase human-maintained spec files)
  • Add scripts/ai/generate-ai-context.mjs
  • Add ai:context script to package.json
  • (Optional) append .gitignore rules for generated artifacts
  • (Optional) run npm run ai:context

Installation (Optional)

Global install

npm i -g @zhanglichen/create-ai-context

Then run:

create-ai-context --yes

Note: This package is published as @zhanglichen/create-ai-context.


Usage

Initialize (default)

npx @zhanglichen/create-ai-context init --yes

Options:

  • -y, --yes - non-interactive, accept defaults
  • --skip-run - do not run ai:context after init
  • --skip-gitignore - do not append .gitignore rules

Examples:

npx @zhanglichen/create-ai-context init --yes --skip-run

Scan / Generate indexes

Run whenever the codebase structure changes (new components/hooks/services, moved folders, etc.):

npx @zhanglichen/create-ai-context scan

Or:

npm run ai:context

Doctor (diagnostics)

Useful when setup or generation fails:

npx @zhanglichen/create-ai-context doctor

Update (placeholder)

npx @zhanglichen/create-ai-context update

Output

Human-maintained (lowercase, commit to git)

These files define your team rules and should be reviewed/maintained:

  • .ai/agent.md
  • .ai/stack.md
  • .ai/architecture.md
  • .ai/conventions.md
  • .ai/codebase.md
  • .ai/task_workflow.md
  • .ai/readme.md

Generated (uppercase, do not edit manually)

Generated by npm run ai:context:

  • .ai/AI_CONTEXT.json
  • .ai/COMPONENT_MAP.md
  • .ai/COMPONENT_TREE.json
  • .ai/HOOK_MAP.json
  • .ai/API_MAP.json
  • .ai/ROUTE_MAP.json
  • .ai/DEP_GRAPH.json
  • .ai/COMPONENT_RELATION_GRAPH.json
  • .ai/HOOK_DEP_GRAPH.json
  • .ai/API_SCHEMA_MAP.json

Generated files may be ignored in git (recommended). See .gitignore section below.


Recommended .gitignore

Commit the lowercase files, ignore generated uppercase artifacts:

# AI Context Layer (generated)
.ai/AI_CONTEXT.json
.ai/COMPONENT_*.*
.ai/HOOK_*.json
.ai/API_*.json
.ai/ROUTE_*.json
.ai/DEP_*.json
.ai/*_GRAPH.json
.ai/*_MAP.json
.ai/*_TREE.json

Prompt Template (Works Great in Codex/Cursor)

Copy this into your AI tool:

Follow `.ai/agent.md`.
Before coding, read: `.ai/stack.md`, `.ai/architecture.md`, `.ai/COMPONENT_MAP.md`, `.ai/AI_CONTEXT.json`.

Notes

  • Run this tool from the project root where package.json exists.
  • If .ai/ already exists, the tool will not overwrite existing files.
  • After large refactors, run npm run ai:context to keep indexes up to date.