rulesync 0.44.0 → 0.45.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/dist/index.cjs CHANGED
@@ -589,9 +589,10 @@ function generateClaudeMarkdown(rootRules, detailRules) {
589
589
  lines.push("Please also reference the following documents as needed:");
590
590
  lines.push("");
591
591
  for (const rule of detailRules) {
592
- const globsText = rule.frontmatter.globs.length > 0 ? rule.frontmatter.globs.join(", ") : "";
592
+ const escapedDescription = rule.frontmatter.description.replace(/"/g, '\\"');
593
+ const globsText = rule.frontmatter.globs.join(",");
593
594
  lines.push(
594
- `@.claude/memories/${rule.filename}.md ${rule.frontmatter.description} ${globsText}`.trim()
595
+ `@.claude/memories/${rule.filename}.md description: "${escapedDescription}" globs: "${globsText}"`
595
596
  );
596
597
  }
597
598
  lines.push("");
@@ -2371,14 +2372,13 @@ async function initCommand() {
2371
2372
  console.log("2. Run 'rulesync generate' to create configuration files");
2372
2373
  }
2373
2374
  async function createSampleFiles(aiRulesDir) {
2374
- const sampleFiles = [
2375
- {
2376
- filename: "overview.md",
2377
- content: `---
2375
+ const sampleFile = {
2376
+ filename: "overview.md",
2377
+ content: `---
2378
2378
  root: true
2379
2379
  targets: ["*"]
2380
2380
  description: "Project overview and general development guidelines"
2381
- globs: ["**/*.ts", "**/*.js", "**/*.tsx", "**/*.jsx"]
2381
+ globs: ["**/*"]
2382
2382
  ---
2383
2383
 
2384
2384
  # Project Overview
@@ -2406,96 +2406,13 @@ globs: ["**/*.ts", "**/*.js", "**/*.tsx", "**/*.jsx"]
2406
2406
  - Implement proper error handling
2407
2407
  - Follow single responsibility principle
2408
2408
  `
2409
- },
2410
- {
2411
- filename: "frontend.md",
2412
- content: `---
2413
- root: false
2414
- targets: ["*"]
2415
- description: "Frontend development rules and best practices"
2416
- globs: ["src/components/**/*.tsx", "src/pages/**/*.tsx", "**/*.css", "**/*.scss"]
2417
- ---
2418
-
2419
- # Frontend Development Rules
2420
-
2421
- ## React Components
2422
-
2423
- - Use functional components with hooks
2424
- - Follow PascalCase naming for components
2425
- - Use TypeScript interfaces for props
2426
- - Implement proper error boundaries
2427
-
2428
- ## Styling
2429
-
2430
- - Use CSS modules or styled-components
2431
- - Follow BEM methodology for CSS classes
2432
- - Prefer flexbox and grid for layouts
2433
- - Use semantic HTML elements
2434
-
2435
- ## State Management
2436
-
2437
- - Use React hooks for local state
2438
- - Consider Redux or Zustand for global state
2439
- - Avoid prop drilling with context API
2440
- - Keep state as close to where it's used as possible
2441
-
2442
- ## Performance
2443
-
2444
- - Use React.memo for expensive components
2445
- - Implement lazy loading for routes
2446
- - Optimize images and assets
2447
- - Use proper key props in lists
2448
- `
2449
- },
2450
- {
2451
- filename: "backend.md",
2452
- content: `---
2453
- root: false
2454
- targets: ["*"]
2455
- description: "Backend development rules and API guidelines"
2456
- globs: ["src/api/**/*.ts", "src/services/**/*.ts", "src/models/**/*.ts"]
2457
- ---
2458
-
2459
- # Backend Development Rules
2460
-
2461
- ## API Design
2462
-
2463
- - Follow RESTful conventions
2464
- - Use consistent HTTP status codes
2465
- - Implement proper error handling with meaningful messages
2466
- - Use API versioning when necessary
2467
-
2468
- ## Database
2469
-
2470
- - Use proper indexing for performance
2471
- - Implement database migrations
2472
- - Follow naming conventions for tables and columns
2473
- - Use transactions for data consistency
2474
-
2475
- ## Security
2476
-
2477
- - Validate all input data
2478
- - Use proper authentication and authorization
2479
- - Implement rate limiting
2480
- - Sanitize database queries to prevent SQL injection
2481
-
2482
- ## Code Organization
2483
-
2484
- - Use service layer pattern
2485
- - Implement proper logging
2486
- - Use environment variables for configuration
2487
- - Write comprehensive tests for business logic
2488
- `
2489
- }
2490
- ];
2491
- for (const file of sampleFiles) {
2492
- const filepath = (0, import_node_path19.join)(aiRulesDir, file.filename);
2493
- if (!await fileExists(filepath)) {
2494
- await writeFileContent(filepath, file.content);
2495
- console.log(`Created ${filepath}`);
2496
- } else {
2497
- console.log(`Skipped ${filepath} (already exists)`);
2498
- }
2409
+ };
2410
+ const filepath = (0, import_node_path19.join)(aiRulesDir, sampleFile.filename);
2411
+ if (!await fileExists(filepath)) {
2412
+ await writeFileContent(filepath, sampleFile.content);
2413
+ console.log(`Created ${filepath}`);
2414
+ } else {
2415
+ console.log(`Skipped ${filepath} (already exists)`);
2499
2416
  }
2500
2417
  }
2501
2418
 
@@ -2634,7 +2551,7 @@ async function watchCommand() {
2634
2551
 
2635
2552
  // src/cli/index.ts
2636
2553
  var program = new import_commander.Command();
2637
- program.name("rulesync").description("Unified AI rules management CLI tool").version("0.44.0");
2554
+ program.name("rulesync").description("Unified AI rules management CLI tool").version("0.45.0");
2638
2555
  program.command("init").description("Initialize rulesync in current directory").action(initCommand);
2639
2556
  program.command("add <filename>").description("Add a new rule file").action(addCommand);
2640
2557
  program.command("gitignore").description("Add generated files to .gitignore").action(gitignoreCommand);
package/dist/index.js CHANGED
@@ -265,9 +265,10 @@ function generateClaudeMarkdown(rootRules, detailRules) {
265
265
  lines.push("Please also reference the following documents as needed:");
266
266
  lines.push("");
267
267
  for (const rule of detailRules) {
268
- const globsText = rule.frontmatter.globs.length > 0 ? rule.frontmatter.globs.join(", ") : "";
268
+ const escapedDescription = rule.frontmatter.description.replace(/"/g, '\\"');
269
+ const globsText = rule.frontmatter.globs.join(",");
269
270
  lines.push(
270
- `@.claude/memories/${rule.filename}.md ${rule.frontmatter.description} ${globsText}`.trim()
271
+ `@.claude/memories/${rule.filename}.md description: "${escapedDescription}" globs: "${globsText}"`
271
272
  );
272
273
  }
273
274
  lines.push("");
@@ -2033,14 +2034,13 @@ async function initCommand() {
2033
2034
  console.log("2. Run 'rulesync generate' to create configuration files");
2034
2035
  }
2035
2036
  async function createSampleFiles(aiRulesDir) {
2036
- const sampleFiles = [
2037
- {
2038
- filename: "overview.md",
2039
- content: `---
2037
+ const sampleFile = {
2038
+ filename: "overview.md",
2039
+ content: `---
2040
2040
  root: true
2041
2041
  targets: ["*"]
2042
2042
  description: "Project overview and general development guidelines"
2043
- globs: ["**/*.ts", "**/*.js", "**/*.tsx", "**/*.jsx"]
2043
+ globs: ["**/*"]
2044
2044
  ---
2045
2045
 
2046
2046
  # Project Overview
@@ -2068,96 +2068,13 @@ globs: ["**/*.ts", "**/*.js", "**/*.tsx", "**/*.jsx"]
2068
2068
  - Implement proper error handling
2069
2069
  - Follow single responsibility principle
2070
2070
  `
2071
- },
2072
- {
2073
- filename: "frontend.md",
2074
- content: `---
2075
- root: false
2076
- targets: ["*"]
2077
- description: "Frontend development rules and best practices"
2078
- globs: ["src/components/**/*.tsx", "src/pages/**/*.tsx", "**/*.css", "**/*.scss"]
2079
- ---
2080
-
2081
- # Frontend Development Rules
2082
-
2083
- ## React Components
2084
-
2085
- - Use functional components with hooks
2086
- - Follow PascalCase naming for components
2087
- - Use TypeScript interfaces for props
2088
- - Implement proper error boundaries
2089
-
2090
- ## Styling
2091
-
2092
- - Use CSS modules or styled-components
2093
- - Follow BEM methodology for CSS classes
2094
- - Prefer flexbox and grid for layouts
2095
- - Use semantic HTML elements
2096
-
2097
- ## State Management
2098
-
2099
- - Use React hooks for local state
2100
- - Consider Redux or Zustand for global state
2101
- - Avoid prop drilling with context API
2102
- - Keep state as close to where it's used as possible
2103
-
2104
- ## Performance
2105
-
2106
- - Use React.memo for expensive components
2107
- - Implement lazy loading for routes
2108
- - Optimize images and assets
2109
- - Use proper key props in lists
2110
- `
2111
- },
2112
- {
2113
- filename: "backend.md",
2114
- content: `---
2115
- root: false
2116
- targets: ["*"]
2117
- description: "Backend development rules and API guidelines"
2118
- globs: ["src/api/**/*.ts", "src/services/**/*.ts", "src/models/**/*.ts"]
2119
- ---
2120
-
2121
- # Backend Development Rules
2122
-
2123
- ## API Design
2124
-
2125
- - Follow RESTful conventions
2126
- - Use consistent HTTP status codes
2127
- - Implement proper error handling with meaningful messages
2128
- - Use API versioning when necessary
2129
-
2130
- ## Database
2131
-
2132
- - Use proper indexing for performance
2133
- - Implement database migrations
2134
- - Follow naming conventions for tables and columns
2135
- - Use transactions for data consistency
2136
-
2137
- ## Security
2138
-
2139
- - Validate all input data
2140
- - Use proper authentication and authorization
2141
- - Implement rate limiting
2142
- - Sanitize database queries to prevent SQL injection
2143
-
2144
- ## Code Organization
2145
-
2146
- - Use service layer pattern
2147
- - Implement proper logging
2148
- - Use environment variables for configuration
2149
- - Write comprehensive tests for business logic
2150
- `
2151
- }
2152
- ];
2153
- for (const file of sampleFiles) {
2154
- const filepath = join20(aiRulesDir, file.filename);
2155
- if (!await fileExists(filepath)) {
2156
- await writeFileContent(filepath, file.content);
2157
- console.log(`Created ${filepath}`);
2158
- } else {
2159
- console.log(`Skipped ${filepath} (already exists)`);
2160
- }
2071
+ };
2072
+ const filepath = join20(aiRulesDir, sampleFile.filename);
2073
+ if (!await fileExists(filepath)) {
2074
+ await writeFileContent(filepath, sampleFile.content);
2075
+ console.log(`Created ${filepath}`);
2076
+ } else {
2077
+ console.log(`Skipped ${filepath} (already exists)`);
2161
2078
  }
2162
2079
  }
2163
2080
 
@@ -2296,7 +2213,7 @@ async function watchCommand() {
2296
2213
 
2297
2214
  // src/cli/index.ts
2298
2215
  var program = new Command();
2299
- program.name("rulesync").description("Unified AI rules management CLI tool").version("0.44.0");
2216
+ program.name("rulesync").description("Unified AI rules management CLI tool").version("0.45.0");
2300
2217
  program.command("init").description("Initialize rulesync in current directory").action(initCommand);
2301
2218
  program.command("add <filename>").description("Add a new rule file").action(addCommand);
2302
2219
  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.44.0",
3
+ "version": "0.45.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",