rulesync 0.56.0 → 0.57.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/README.ja.md CHANGED
@@ -20,7 +20,7 @@ rulesyncは以下の**10のAI開発ツール**の**生成**と**インポート*
20
20
  - **Roo Code Rules** (`.roo/rules/*.md` + `.roo/instructions.md`)
21
21
  - **Gemini CLI** (`GEMINI.md` + `.gemini/memories/*.md`)
22
22
  - **JetBrains Junie Guidelines** (`.junie/guidelines.md`)
23
- - **Windsurf AIコードエディター** (`.windsurfrules` + `.windsurfignore` + `.windsurf/mcp.json`)
23
+ - **Windsurf AIコードエディター** (`.windsurf/rules/*.md` + `.codeiumignore` + `.windsurf/mcp.json`)
24
24
  - **Kiro IDE カスタムステアリングドキュメント** (`.kiro/steering/*.md`) + **AI除外ファイル** (`.aiignore`)
25
25
 
26
26
  ## インストール
@@ -317,7 +317,7 @@ rulesyncは2レベルのルールシステムを使用します:
317
317
  | **Cline** | 標準フォーマット | 標準フォーマット | すべてのルールがプレーンMarkdownフォーマットを使用 |
318
318
  | **Roo Code** | 標準フォーマット | 標準フォーマット | すべてのルールが説明ヘッダー付きのプレーンMarkdownフォーマットを使用 |
319
319
  | **Gemini CLI** | `GEMINI.md` | `.gemini/memories/*.md` | GEMINI.mdがメモリファイルへの`@filename`参照を含む |
320
- | **Windsurf** | `.windsurfrules` | `.windsurf/rules/*.md` | 包括的統合:MCP設定、ignoreファイル、プレーンMarkdownフォーマット |
320
+ | **Windsurf** | `.windsurf/rules/*.md` | `.windsurf/rules/*.md` | 包括的統合:MCP設定、ignoreファイル、プレーンMarkdownフォーマット |
321
321
 
322
322
  ### 3. 設定ファイルの生成
323
323
 
@@ -656,7 +656,7 @@ globs: ["**/*.ts", "**/*.tsx"]
656
656
  | **Roo Code** | `.roo/rules/*.md` | プレーンMarkdown | 両レベルとも説明ヘッダー付きの同じフォーマットを使用 |
657
657
  | **Gemini CLI** | `GEMINI.md` (ルート)<br>`.gemini/memories/*.md` (非ルート) | プレーンMarkdown | ルートはGEMINI.mdに移動<br>非ルートは別メモリファイルに移動<br>GEMINI.mdは`@filename`参照を含む |
658
658
  | **JetBrains Junie** | `.junie/guidelines.md` | プレーンMarkdown | すべてのルールを単一のガイドラインファイルに統合 |
659
- | **Windsurf** | `.windsurfrules` (ルート)<br>`.windsurf/rules/*.md` (非ルート) | プレーンMarkdown | ルートはメインルールファイルに移動<br>非ルートは別ルールファイルに移動<br>MCP設定とignoreファイルを含む包括的統合 |
659
+ | **Windsurf** | `.windsurf/rules/*.md` (ルート)<br>`.windsurf/rules/*.md` (非ルート) | プレーンMarkdown | 両レベルとも`.windsurf/rules/`ディレクトリに統合<br>MCP設定とignoreファイルを含む包括的統合 |
660
660
  | **Kiro IDE** | `.kiro/steering/*.md` + `.aiignore` | プレーンMarkdown + 除外パターン | カスタムステアリングドキュメントで両レベルとも同じフォーマット使用<br>AI除外ファイルで機密パターンを除外 |
661
661
 
662
662
  ## バリデーション
package/README.md CHANGED
@@ -601,30 +601,46 @@ When `.rulesyncignore` exists, rulesync will:
601
601
 
602
602
  ### Frontmatter Schema
603
603
 
604
- Each rule file must include frontmatter with the following fields:
604
+ Each rule file includes frontmatter with the following fields. **As of v0.56.0, all frontmatter keys are now optional with sensible default values applied automatically**:
605
605
 
606
606
  ```yaml
607
607
  ---
608
- root: true | false # Required: Rule level (true for overview, false for details)
609
- targets: ["*"] # Required: Target tools (* = all, or specific tools)
610
- description: "Brief description" # Required: Rule description
611
- globs: ["**/*"] # Required: File patterns (array format)
608
+ root: true | false # Optional: Rule level (default: false)
609
+ targets: ["*"] # Optional: Target tools (default: ["*"] = all tools)
610
+ description: "Brief description" # Optional: Rule description (default: generated from filename)
611
+ globs: ["**/*"] # Optional: File patterns (default: ["**/*"])
612
612
  cursorRuleType: "always" # Optional: Cursor-specific rule type (always, manual, specificFiles, intelligently)
613
+ windsurfActivationMode: "always" # Optional: Windsurf-specific activation mode (always, manual, model-decision, glob)
614
+ windsurfOutputFormat: "directory" # Optional: Windsurf output format (single-file, directory)
615
+ tags: ["security", "typescript"] # Optional: Rule tags for categorization
613
616
  ---
614
617
  ```
615
618
 
616
- #### cursorRuleType Field (Optional)
617
-
618
- Additional metadata field for Cursor tool:
619
+ #### Optional Frontmatter Fields
619
620
 
621
+ **cursorRuleType** - Cursor-specific rule behavior:
620
622
  - **`always`**: Rules applied to the entire project constantly
621
623
  - **`manual`**: Rules applied manually (default)
622
624
  - **`specificFiles`**: Rules automatically applied to specific file patterns
623
625
  - **`intelligently`**: Rules applied by AI judgment
624
626
 
627
+ **windsurfActivationMode** - Windsurf AI activation behavior:
628
+ - **`always`**: Always-on rules injected in every prompt
629
+ - **`manual`**: Only when explicitly @mentioned
630
+ - **`model-decision`**: AI model decides when rule is relevant
631
+ - **`glob`**: Apply only when editing files matching glob pattern
632
+
633
+ **windsurfOutputFormat** - Windsurf file organization:
634
+ - **`single-file`**: Generate `.windsurf-rules` file
635
+ - **`directory`**: Generate `.windsurf/rules/*.md` files (default)
636
+
637
+ **tags** - Rule categorization and filtering:
638
+ - Array of strings for organizing and filtering rules
639
+ - Useful for complex projects with many rule files
640
+
625
641
  ### Example Files
626
642
 
627
- **Root file** (`.rulesync/overview.md`):
643
+ **Root file** (`.rulesync/overview.md`) - With explicit frontmatter:
628
644
  ```markdown
629
645
  ---
630
646
  root: true
@@ -638,12 +654,10 @@ globs: ["src/**/*.ts"]
638
654
  This project follows TypeScript-first development with clean architecture principles.
639
655
  ```
640
656
 
641
- **Non-root file** (`.rulesync/coding-rules.md`):
657
+ **Non-root file** (`.rulesync/coding-rules.md`) - With minimal frontmatter (using defaults):
642
658
  ```markdown
643
659
  ---
644
- root: false
645
660
  targets: ["copilot", "cursor", "roo"]
646
- description: "TypeScript coding standards"
647
661
  globs: ["**/*.ts", "**/*.tsx"]
648
662
  ---
649
663
 
@@ -654,6 +668,20 @@ globs: ["**/*.ts", "**/*.tsx"]
654
668
  - Use meaningful variable names
655
669
  ```
656
670
 
671
+ **Windsurf-specific rule** (`.rulesync/windsurf-ui-rules.md`):
672
+ ```markdown
673
+ ---
674
+ windsurfActivationMode: "glob"
675
+ windsurfOutputFormat: "directory"
676
+ globs: ["**/*.tsx", "**/*.jsx"]
677
+ tags: ["ui", "react"]
678
+ ---
679
+
680
+ # React UI Component Rules
681
+
682
+ Specific rules for React components that activate only when editing UI files.
683
+ ```
684
+
657
685
  ## Generated Configuration Files
658
686
 
659
687
  | Tool | Output Path | Format | Rule Level Handling |
package/dist/index.cjs CHANGED
@@ -873,10 +873,10 @@ var RulesyncMcpConfigSchema = import_mini5.z.object({
873
873
  var import_mini6 = require("zod/mini");
874
874
  init_tool_targets();
875
875
  var RuleFrontmatterSchema = import_mini6.z.object({
876
- root: import_mini6.z.boolean(),
877
- targets: RulesyncTargetsSchema,
878
- description: import_mini6.z.string(),
879
- globs: import_mini6.z.array(import_mini6.z.string()),
876
+ root: import_mini6.z.optional(import_mini6.z.boolean()),
877
+ targets: import_mini6.z.optional(RulesyncTargetsSchema),
878
+ description: import_mini6.z.optional(import_mini6.z.string()),
879
+ globs: import_mini6.z.optional(import_mini6.z.array(import_mini6.z.string())),
880
880
  cursorRuleType: import_mini6.z.optional(import_mini6.z.enum(["always", "manual", "specificFiles", "intelligently"])),
881
881
  windsurfActivationMode: import_mini6.z.optional(import_mini6.z.enum(["always", "manual", "model-decision", "glob"])),
882
882
  windsurfOutputFormat: import_mini6.z.optional(import_mini6.z.enum(["single-file", "directory"])),
@@ -2942,7 +2942,23 @@ async function parseRuleFile(filepath) {
2942
2942
  const content = await readFileContent(filepath);
2943
2943
  const parsed = (0, import_gray_matter.default)(content);
2944
2944
  try {
2945
- const frontmatter = RuleFrontmatterSchema.parse(parsed.data);
2945
+ const validatedData = RuleFrontmatterSchema.parse(parsed.data);
2946
+ const frontmatter = {
2947
+ root: validatedData.root ?? false,
2948
+ targets: validatedData.targets ?? ["*"],
2949
+ description: validatedData.description ?? "",
2950
+ globs: validatedData.globs ?? [],
2951
+ ...validatedData.cursorRuleType !== void 0 && {
2952
+ cursorRuleType: validatedData.cursorRuleType
2953
+ },
2954
+ ...validatedData.windsurfActivationMode !== void 0 && {
2955
+ windsurfActivationMode: validatedData.windsurfActivationMode
2956
+ },
2957
+ ...validatedData.windsurfOutputFormat !== void 0 && {
2958
+ windsurfOutputFormat: validatedData.windsurfOutputFormat
2959
+ },
2960
+ ...validatedData.tags !== void 0 && { tags: validatedData.tags }
2961
+ };
2946
2962
  const filename = (0, import_node_path9.basename)(filepath, ".md");
2947
2963
  return {
2948
2964
  frontmatter,
@@ -4603,7 +4619,7 @@ async function watchCommand() {
4603
4619
 
4604
4620
  // src/cli/index.ts
4605
4621
  var program = new import_commander.Command();
4606
- program.name("rulesync").description("Unified AI rules management CLI tool").version("0.56.0");
4622
+ program.name("rulesync").description("Unified AI rules management CLI tool").version("0.57.0");
4607
4623
  program.command("init").description("Initialize rulesync in current directory").action(initCommand);
4608
4624
  program.command("add <filename>").description("Add a new rule file").action(addCommand);
4609
4625
  program.command("gitignore").description("Add generated files to .gitignore").action(gitignoreCommand);
package/dist/index.js CHANGED
@@ -227,10 +227,10 @@ var RulesyncMcpConfigSchema = z4.object({
227
227
  // src/types/rules.ts
228
228
  import { z as z5 } from "zod/mini";
229
229
  var RuleFrontmatterSchema = z5.object({
230
- root: z5.boolean(),
231
- targets: RulesyncTargetsSchema,
232
- description: z5.string(),
233
- globs: z5.array(z5.string()),
230
+ root: z5.optional(z5.boolean()),
231
+ targets: z5.optional(RulesyncTargetsSchema),
232
+ description: z5.optional(z5.string()),
233
+ globs: z5.optional(z5.array(z5.string())),
234
234
  cursorRuleType: z5.optional(z5.enum(["always", "manual", "specificFiles", "intelligently"])),
235
235
  windsurfActivationMode: z5.optional(z5.enum(["always", "manual", "model-decision", "glob"])),
236
236
  windsurfOutputFormat: z5.optional(z5.enum(["single-file", "directory"])),
@@ -2293,7 +2293,23 @@ async function parseRuleFile(filepath) {
2293
2293
  const content = await readFileContent(filepath);
2294
2294
  const parsed = matter(content);
2295
2295
  try {
2296
- const frontmatter = RuleFrontmatterSchema.parse(parsed.data);
2296
+ const validatedData = RuleFrontmatterSchema.parse(parsed.data);
2297
+ const frontmatter = {
2298
+ root: validatedData.root ?? false,
2299
+ targets: validatedData.targets ?? ["*"],
2300
+ description: validatedData.description ?? "",
2301
+ globs: validatedData.globs ?? [],
2302
+ ...validatedData.cursorRuleType !== void 0 && {
2303
+ cursorRuleType: validatedData.cursorRuleType
2304
+ },
2305
+ ...validatedData.windsurfActivationMode !== void 0 && {
2306
+ windsurfActivationMode: validatedData.windsurfActivationMode
2307
+ },
2308
+ ...validatedData.windsurfOutputFormat !== void 0 && {
2309
+ windsurfOutputFormat: validatedData.windsurfOutputFormat
2310
+ },
2311
+ ...validatedData.tags !== void 0 && { tags: validatedData.tags }
2312
+ };
2297
2313
  const filename = basename(filepath, ".md");
2298
2314
  return {
2299
2315
  frontmatter,
@@ -3941,7 +3957,7 @@ async function watchCommand() {
3941
3957
 
3942
3958
  // src/cli/index.ts
3943
3959
  var program = new Command();
3944
- program.name("rulesync").description("Unified AI rules management CLI tool").version("0.56.0");
3960
+ program.name("rulesync").description("Unified AI rules management CLI tool").version("0.57.0");
3945
3961
  program.command("init").description("Initialize rulesync in current directory").action(initCommand);
3946
3962
  program.command("add <filename>").description("Add a new rule file").action(addCommand);
3947
3963
  program.command("gitignore").description("Add generated files to .gitignore").action(gitignoreCommand);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "rulesync",
3
- "version": "0.56.0",
3
+ "version": "0.57.0",
4
4
  "description": "Unified AI rules management CLI tool that generates configuration files for various AI development tools",
5
5
  "keywords": [
6
6
  "ai",