rulesync 0.2.0 → 0.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +55 -43
- package/dist/index.js +231 -163
- package/dist/index.mjs +229 -161
- package/package.json +1 -1
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2024 dyoshikawa
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
CHANGED
|
@@ -3,123 +3,135 @@
|
|
|
3
3
|
[](https://github.com/dyoshikawa/rulesync/actions/workflows/ci.yml)
|
|
4
4
|
[](https://www.npmjs.com/package/rulesync)
|
|
5
5
|
|
|
6
|
-
|
|
6
|
+
A Node.js CLI tool that automatically generates configuration files for various AI development tools from unified AI rule files (`.rulesync/*.md`).
|
|
7
7
|
|
|
8
|
-
##
|
|
8
|
+
## Supported Tools
|
|
9
9
|
|
|
10
10
|
- **GitHub Copilot Custom Instructions** (`.github/instructions/*.instructions.md`)
|
|
11
11
|
- **Cursor Project Rules** (`.cursor/rules/*.md`)
|
|
12
12
|
- **Cline Rules** (`.clinerules/*.md`)
|
|
13
|
+
- **Claude Code Memory** (`./CLAUDE.md`)
|
|
13
14
|
|
|
14
|
-
##
|
|
15
|
+
## Installation
|
|
15
16
|
|
|
16
17
|
```bash
|
|
17
18
|
npm install -g rulesync
|
|
18
|
-
#
|
|
19
|
+
# or
|
|
19
20
|
pnpm add -g rulesync
|
|
20
|
-
#
|
|
21
|
+
# or
|
|
21
22
|
yarn global add rulesync
|
|
22
23
|
```
|
|
23
24
|
|
|
24
|
-
##
|
|
25
|
+
## Usage
|
|
25
26
|
|
|
26
|
-
### 1.
|
|
27
|
+
### 1. Initialize
|
|
27
28
|
|
|
28
29
|
```bash
|
|
29
30
|
rulesync init
|
|
30
31
|
```
|
|
31
32
|
|
|
32
|
-
`.rulesync/`
|
|
33
|
+
This creates a `.rulesync/` directory with sample rule files.
|
|
33
34
|
|
|
34
|
-
### 2.
|
|
35
|
+
### 2. Edit Rule Files
|
|
35
36
|
|
|
36
|
-
|
|
37
|
+
Define metadata in front matter for each Markdown file:
|
|
37
38
|
|
|
38
39
|
```markdown
|
|
39
40
|
---
|
|
40
|
-
|
|
41
|
-
targets: ["*"] #
|
|
42
|
-
description: "TypeScript
|
|
41
|
+
ruleLevel: overview # or detail
|
|
42
|
+
targets: ["*"] # or [copilot, cursor, cline, claudecode]
|
|
43
|
+
description: "TypeScript coding rules"
|
|
43
44
|
globs: ["**/*.ts", "**/*.tsx"]
|
|
44
45
|
---
|
|
45
46
|
|
|
46
47
|
# TypeScript Rules
|
|
47
48
|
|
|
48
|
-
- TypeScript
|
|
49
|
-
-
|
|
49
|
+
- Use TypeScript
|
|
50
|
+
- Write clear type annotations
|
|
50
51
|
```
|
|
51
52
|
|
|
52
|
-
###
|
|
53
|
+
### Rule Levels
|
|
54
|
+
|
|
55
|
+
- **overview**: Project-wide overview and policies (only one file allowed)
|
|
56
|
+
- **detail**: Specific implementation rules and detailed guidelines (multiple files allowed)
|
|
57
|
+
|
|
58
|
+
Each tool handles rule levels differently:
|
|
59
|
+
- **Claude Code**: overview → `CLAUDE.md`, detail → `.claude/memories/*.md`
|
|
60
|
+
- **Cursor**: overview → `ruletype: always`, detail → `ruletype: autoattached`
|
|
61
|
+
|
|
62
|
+
### 3. Generate Configuration Files
|
|
53
63
|
|
|
54
64
|
```bash
|
|
55
|
-
#
|
|
65
|
+
# Generate for all tools
|
|
56
66
|
rulesync generate
|
|
57
67
|
|
|
58
|
-
#
|
|
68
|
+
# Generate for specific tools
|
|
59
69
|
rulesync generate --copilot
|
|
60
70
|
rulesync generate --cursor
|
|
61
71
|
rulesync generate --cline
|
|
72
|
+
rulesync generate --claude
|
|
62
73
|
```
|
|
63
74
|
|
|
64
|
-
### 4.
|
|
75
|
+
### 4. Other Commands
|
|
65
76
|
|
|
66
77
|
```bash
|
|
67
|
-
#
|
|
78
|
+
# Validate configuration
|
|
68
79
|
rulesync validate
|
|
69
80
|
|
|
70
|
-
#
|
|
81
|
+
# Check current status
|
|
71
82
|
rulesync status
|
|
72
83
|
|
|
73
|
-
#
|
|
84
|
+
# Watch files and auto-generate
|
|
74
85
|
rulesync watch
|
|
75
86
|
```
|
|
76
87
|
|
|
77
|
-
##
|
|
88
|
+
## Configuration File Structure
|
|
78
89
|
|
|
79
90
|
```
|
|
80
|
-
.
|
|
81
|
-
├── coding-rules.md #
|
|
82
|
-
├── naming-conventions.md #
|
|
83
|
-
├── architecture.md #
|
|
84
|
-
├── security.md #
|
|
85
|
-
└── custom.md #
|
|
91
|
+
.rulesync/
|
|
92
|
+
├── coding-rules.md # Coding rules
|
|
93
|
+
├── naming-conventions.md # Naming conventions
|
|
94
|
+
├── architecture.md # Architecture guidelines
|
|
95
|
+
├── security.md # Security rules
|
|
96
|
+
└── custom.md # Project-specific rules
|
|
86
97
|
```
|
|
87
98
|
|
|
88
|
-
##
|
|
99
|
+
## Generated Configuration Files
|
|
89
100
|
|
|
90
|
-
|
|
|
91
|
-
|
|
101
|
+
| Tool | Output Path | Format |
|
|
102
|
+
|------|------------|--------|
|
|
92
103
|
| GitHub Copilot | `.github/instructions/*.instructions.md` | Front Matter + Markdown |
|
|
93
104
|
| Cursor | `.cursor/rules/*.md` | MDC (YAML header + Markdown) |
|
|
94
|
-
| Cline | `.clinerules/*.md` |
|
|
105
|
+
| Cline | `.clinerules/*.md` | Plain Markdown |
|
|
106
|
+
| Claude Code | `./CLAUDE.md` (overview), `.claude/memories/*.md` (detail) | Plain Markdown |
|
|
95
107
|
|
|
96
|
-
##
|
|
108
|
+
## Development
|
|
97
109
|
|
|
98
110
|
```bash
|
|
99
|
-
#
|
|
111
|
+
# Install dependencies
|
|
100
112
|
pnpm install
|
|
101
113
|
|
|
102
|
-
#
|
|
114
|
+
# Development run
|
|
103
115
|
pnpm dev
|
|
104
116
|
|
|
105
|
-
#
|
|
117
|
+
# Build
|
|
106
118
|
pnpm build
|
|
107
119
|
|
|
108
|
-
#
|
|
120
|
+
# Test
|
|
109
121
|
pnpm test
|
|
110
122
|
|
|
111
|
-
#
|
|
123
|
+
# Code quality checks
|
|
112
124
|
pnpm lint
|
|
113
125
|
pnpm format
|
|
114
126
|
pnpm secretlint
|
|
115
127
|
```
|
|
116
128
|
|
|
117
|
-
##
|
|
129
|
+
## License
|
|
118
130
|
|
|
119
131
|
MIT License
|
|
120
132
|
|
|
121
|
-
##
|
|
133
|
+
## Contributing
|
|
122
134
|
|
|
123
|
-
|
|
135
|
+
Issues and Pull Requests are welcome!
|
|
124
136
|
|
|
125
|
-
|
|
137
|
+
For detailed specifications, see [SPECIFICATION.md](./SPECIFICATION.md).
|