{"_id":"@defi-wonderland/ai-rules","_rev":"3-9fecdb044ccea9a27218e2aa5e811894","name":"@defi-wonderland/ai-rules","dist-tags":{"latest":"0.0.2"},"versions":{"0.0.1":{"name":"@defi-wonderland/ai-rules","version":"0.0.1","author":{"name":"Wonderland"},"license":"MIT","_id":"@defi-wonderland/ai-rules@0.0.1","maintainers":[{"name":"0xgorilla","email":"gori@wonderland.xyz"},{"name":"wonderland-bot","email":"alice@wonderland.xyz"}],"bin":{"ai-rules":"bin/ai-rules.js"},"dist":{"shasum":"53039f25ffad59b5c8ceacfb9dd8d75c8e93cae9","tarball":"https://registry.npmjs.org/@defi-wonderland/ai-rules/-/ai-rules-0.0.1.tgz","fileCount":75,"integrity":"sha512-FFPeN1ZTBR3v6qmnYqjynqDFbDpkFQtD1PMlBl89fDtcZrVnLFTdyJ9uy3wkRekmkzcX0fVDTKQTu/vyO5PGxQ==","signatures":[{"sig":"MEYCIQDnylj1QpNSeU2qQujbGSJt+dNJxIcxLysn2cH6Fvg9aAIhAJwVn73QgKFlj5zg87acF50aNFEAuVMxSEkhrc3apBem","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":183586},"main":"dist/index.js","type":"module","_from":"file:defi-wonderland-ai-rules-0.0.1.tgz","types":"dist/index.d.ts","engines":{"node":"20"},"private":false,"scripts":{"dev":"tsc -p tsconfig.build.json --watch","lint":"eslint \"src/**/*.ts\"","test":"vitest run","build":"tsc -p tsconfig.build.json","clean":"rimraf dist","format":"prettier --check \"src/**/*.ts\"","lint:fix":"eslint --fix \"src/**/*.ts\"","test:cov":"vitest run --coverage","format:fix":"prettier --write \"src/**/*.ts\"","test:watch":"vitest watch","check-types":"tsc --noEmit","test:integration":"vitest run --config vitest.config.integration.ts"},"_npmUser":{"name":"wonderland-bot","email":"alice@wonderland.xyz"},"_resolved":"/tmp/ccba0d23129afc4666b94f82e426a543/defi-wonderland-ai-rules-0.0.1.tgz","_integrity":"sha512-FFPeN1ZTBR3v6qmnYqjynqDFbDpkFQtD1PMlBl89fDtcZrVnLFTdyJ9uy3wkRekmkzcX0fVDTKQTu/vyO5PGxQ==","_npmVersion":"10.8.2","description":"Script to install standard AI configuration files","directories":{},"_nodeVersion":"20.19.1","dependencies":{"zod":"3.24.1","yaml":"2.7.0","inquirer":"12.4.1","handlebars":"4.7.8"},"_hasShrinkwrap":false,"devDependencies":{"memfs":"4.17.0","ts-node":"10.9.2","@types/node":"20","@types/yaml":"1.9.7","@types/inquirer":"9.0.7"},"_npmOperationalInternal":{"tmp":"tmp/ai-rules_0.0.1_1747864053992_0.6416796297695437","host":"s3://npm-registry-packages-npm-production"}},"0.0.2":{"name":"@defi-wonderland/ai-rules","version":"0.0.2","author":{"name":"Wonderland"},"license":"MIT","_id":"@defi-wonderland/ai-rules@0.0.2","maintainers":[{"name":"0xgorilla","email":"gori@wonderland.xyz"},{"name":"wonderland-bot","email":"alice@wonderland.xyz"}],"bin":{"ai-rules":"bin/ai-rules.js"},"dist":{"shasum":"4080488f4c8bbe994044060c5553bfda12507d1d","tarball":"https://registry.npmjs.org/@defi-wonderland/ai-rules/-/ai-rules-0.0.2.tgz","fileCount":76,"integrity":"sha512-dcG4MtJZ5rKOBHss7dPdRaRhCx7c77Tlzininrc/YLh1sCLH1urXTHVNu+4gMCKgtazHhK4Tmmth26Pt/2GSQQ==","signatures":[{"sig":"MEUCIQD2UcU51avYGJfhvQYro7WvSvIgmgl7VAGYn1BubcUAAQIgVBtX0KoDsCI0GV+TFU+fWUusaEh6fPtN3dYiw/a5B78=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":183628},"main":"dist/index.js","type":"module","_from":"file:defi-wonderland-ai-rules-0.0.2.tgz","types":"dist/index.d.ts","engines":{"node":"20"},"private":false,"scripts":{"dev":"tsc -p tsconfig.build.json --watch","lint":"eslint \"src/**/*.ts\"","test":"vitest run","build":"tsc -p tsconfig.build.json","clean":"rimraf dist","format":"prettier --check \"src/**/*.ts\"","lint:fix":"eslint --fix \"src/**/*.ts\"","test:cov":"vitest run --coverage","format:fix":"prettier --write \"src/**/*.ts\"","test:watch":"vitest watch","check-types":"tsc --noEmit","test:integration":"vitest run --config vitest.config.integration.ts"},"_npmUser":{"name":"wonderland-bot","email":"alice@wonderland.xyz"},"_resolved":"/tmp/781ebd9e8af6b9192f6c41e544f840e6/defi-wonderland-ai-rules-0.0.2.tgz","_integrity":"sha512-dcG4MtJZ5rKOBHss7dPdRaRhCx7c77Tlzininrc/YLh1sCLH1urXTHVNu+4gMCKgtazHhK4Tmmth26Pt/2GSQQ==","_npmVersion":"10.8.2","description":"Script to install standard AI configuration files","directories":{},"_nodeVersion":"20.19.1","dependencies":{"zod":"3.24.1","yaml":"2.7.0","inquirer":"12.4.1","handlebars":"4.7.8"},"_hasShrinkwrap":false,"devDependencies":{"memfs":"4.17.0","ts-node":"10.9.2","@types/node":"20","@types/yaml":"1.9.7","@types/inquirer":"9.0.7"},"_npmOperationalInternal":{"tmp":"tmp/ai-rules_0.0.2_1748488120545_0.3311655672451004","host":"s3://npm-registry-packages-npm-production"}}},"time":{"created":"2025-05-21T21:47:33.928Z","modified":"2025-07-25T08:28:16.196Z","0.0.1":"2025-05-21T21:47:34.186Z","0.0.2":"2025-05-29T03:08:40.746Z"},"author":{"name":"Wonderland"},"license":"MIT","description":"Script to install standard AI configuration files","maintainers":[{"email":"gori@wonderland.xyz","name":"0xgorilla"},{"email":"alice@wonderland.xyz","name":"wonderland-bot"},{"email":"turtlemoji@protonmail.com","name":"turtlemoji"}],"readme":"# @defi-wonderland/ai-rules (Core Script)\n\nScript entry point for generating and managing AI configuration files (Cursor rules and coderabbit.yaml)\n\n## Overview\n\nThis package provides the main script entry for generating standardized configuration files (such as `.coderabbit.yaml` and `.cursor/rules/*`) across teams and repositories. It is a script that can be run directly or via npx.\n\n## Directory Structure\n\n```\ncore/\n├── src/\n│   └── index.ts      # Script entry point\n├── bin/\n│   └── ai-rules.js   # Executable script for npx/global usage\n├── test/\n│   └── index.spec.ts # Tests for the script\n├── package.json\n└── README.md\n```\n\n## Usage\n\nYou can run the script directly with npx (no install required):\n\n```bash\nnpx @defi-wonderland/ai-rules\n```\n\nOr, after installing globally:\n\n```bash\npnpm add -g @defi-wonderland/ai-rules\nai-rules\n```\n\nOr, for development:\n\n```bash\ngit clone https://github.com/defi-wonderland/ai-rules.git\ncd ai-rules\npnpm install\npnpm build\nnode packages/core/bin/ai-rules.js\n```\n\n## Development\n\n### Prerequisites\n\n-   Node.js v20\n-   pnpm v9.7.1\n\n### Available Scripts\n\n| Script        | Description                                             |\n| ------------- | ------------------------------------------------------- |\n| `build`       | Build the script using tsc                              |\n| `check-types` | Check types issues using tsc                            |\n| `clean`       | Remove `dist` folder                                    |\n| `lint`        | Run ESLint to check for coding standards                |\n| `lint:fix`    | Run linter and automatically fix code formatting issues |\n| `format`      | Check code formatting and style using Prettier          |\n| `format:fix`  | Run formatter and automatically fix issues              |\n| `test`        | Run tests using vitest                                  |\n| `test:cov`    | Run tests with coverage report                          |\n\n## Features\n\n-   Generates `.coderabbit.yaml` and `.cursor/rules/*` files for standardizing AI configuration\n-   Supports multiple tech stacks and team types\n-   Semantic versioning for configuration\n-   Typesafe and extensible architecture\n-   File system-based operations with robust error handling\n\n## Versioning and File Management\n\nThe configuration files generated by `@defi-wonderland/ai-rules` (both `.coderabbit.yaml` and the individual rule files in `.cursor/rules/`) include a `version` field. This version corresponds to the version of the `ai-rules` package itself or its underlying base configuration.\n\nWhen you run the script:\n\n1.  **Version Comparison**: For files that the script manages (i.e., files it would normally generate), it reads the `version` from the existing file on your system. It then compares this version with its current internal version. An update (overwrite) to a managed file only occurs if the script's version is newer than the version found in the existing file. This ensures your configurations are kept up-to-date with the latest standards provided by the package without unnecessary changes.\n\n2.  **Preservation of Custom Files**: The script is designed to be non-destructive towards user-created customizations. If you create your own rule files within the `.cursor/rules/` directory (or its subdirectories like `Offchain`, `Solidity`, `UI`), these custom files will **not** be overwritten or deleted by the script. The script only manages and potentially overwrites files that are part of its standard generation process, identified by their expected names and paths. This allows you to extend the base rule set with your own specific guidelines without fear of them being removed when you update the standard configurations.\n\n## Contributing with Changesets\n\nThis project uses [Changesets](https://github.com/changesets/changesets) to manage versioning and changelogs. If you are making a change that should result in a new version of the `@defi-wonderland/ai-rules` package (e.g., bug fixes, new features, breaking changes), you need to add a changeset.\n\nTo add a changeset, run the following command in the root of the monorepo:\n\n```bash\npnpm changeset add\n```\n\nThis will prompt you to:\n\n1.  Select the package(s) that your changes affect (in this case, primarily `@defi-wonderland/ai-rules`).\n2.  Choose the appropriate version bump (patch, minor, or major) for each selected package based on [Semantic Versioning](https://semver.org/).\n3.  Write a concise summary of your changes. This summary will be used to generate the changelog.\n\nCommit the generated markdown file (located in the `.changeset` directory) along with your code changes. This file tells the automated release process what to do when your changes are merged into the `main` branch. Currently we are publishing on merges to main.\n\n## Contributing\n\nSee the root README for contribution guidelines, conventional commits, and package creation instructions.\n\n## License\n\nThe license for this codebase is MIT. See the [`LICENSE`](./LICENSE) file for details.\n","readmeFilename":"README.md"}