ruledev-kit
v0.1.1
Published
Rules as Code toolkit for AI-driven development
Maintainers
Readme
RuleDev Kit
RuleDev Kit is a Rules as Code toolkit for AI-driven development.
It helps you define project-specific development rules, generate AI-readable instruction files, and check whether your source code follows those rules.
Concept
AI coding agents can read project instructions such as AGENTS.md, but instructions alone do not guarantee rule compliance.
RuleDev Kit provides a simple workflow:
- Define development rules as structured YAML files
- Generate AI-readable instruction files
- Check source files against rule definitions
The goal is to make AI-driven development more reliable, repeatable, and rule-based.
Features
- Define project rules in
.rules/rules/*.yml - Generate
AGENTS.mdfor AI coding agents - Generate AI instruction files to a custom output path
- Check source files against simple rule definitions
- Support repeatable AI-driven development workflows
- Prepare a foundation for future CI and review automation
Installation
Install globally from npm:
npm install -g ruledev-kitAfter installation, the ruledev command becomes available:
ruledev --helpYou can also run it without global installation:
npx ruledev-kit --helpUsage
Initialize rule files
Create the initial .rules directory and sample rules:
ruledev initThis generates:
.rules/
├── project.yml
└── rules
├── ai-workflow.yml
└── nextjs.ymlGenerate AGENTS.md
Compile YAML rule definitions into an AI-readable AGENTS.md file:
ruledev compileGenerate AGENTS.md to a custom path
By default, ruledev compile generates AGENTS.md in the current directory.
To avoid overwriting an existing development guide, use --out:
ruledev compile --out examples/basic/AGENTS.mdCheck rule violations
Check source files against rule definitions:
ruledev checkExample output:
No rule violations found.When a violation is found:
Found 1 rule violation(s).
✗ nextjs.no-client-fetch
Client Componentで直接fetchしない
severity: error
file: src/sample/BadComponent.tsx
Matched patterns: useEffect, fetch(Example Rule
id: nextjs.no-client-fetch
title: Client Componentで直接fetchしない
category: frontend
severity: error
instruction: |
データ取得は Server Component、page.tsx、actions.ts に集約してください。
Client Component 内で直接 fetch を呼ばないでください。
check:
type: text
include:
- "app/**/*.tsx"
- "src/**/*.tsx"
pattern:
- "useEffect"
- "fetch("Generated AGENTS.md
RuleDev Kit compiles rule definitions into an AGENTS.md file.
Example:
# AGENTS.md
This file is generated by RuleDev Kit.
Follow these rules when modifying this repository.
## ai-workflow
### AI開発の基本手順
- Rule ID: `ai.workflow.basic`
- Severity: `warning`
実装前に既存構造を確認してください。
推測で新しい設計を作らず、既存の命名規則・ディレクトリ構造に合わせてください。
実装後は lint、typecheck、test の実行結果を確認してください。Commands
ruledev init
ruledev compile
ruledev compile --out examples/basic/AGENTS.md
ruledev checkDevelopment
Clone the repository and install dependencies:
git clone https://github.com/yusukesugahara/ruledev-kit.git
cd ruledev-kit
npm installRun checks:
npm run check
npm run build
npm testUse the local CLI during development:
npm run build
npm link
ruledev --helpProject Structure
src/
├── cli.ts
├── commands/
│ ├── init.ts
│ ├── compile.ts
│ └── check.ts
└── core/
├── load-rules.ts
└── render-agents.tsDevelopment AGENTS.md
The root AGENTS.md is used as a development guide for AI agents working on this repository.
Do not overwrite it with generated output.
When testing generated instructions, use:
ruledev compile --out examples/basic/AGENTS.mdRoadmap
- Add rule presets for Next.js, NestJS, OpenAPI, and monorepos
- Generate instruction files for Claude, Copilot, Cursor, and Gemini
- Add ESLint-based rule checks
- Add CI integration
- Add rule severity handling
- Add JSON output for review automation
- Add rule documentation generation
License
MIT
