rulesync 0.17.0 → 0.18.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.js +71 -31
- package/dist/index.mjs +71 -31
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -666,15 +666,15 @@ async function initCommand() {
|
|
|
666
666
|
async function createSampleFiles(aiRulesDir) {
|
|
667
667
|
const sampleFiles = [
|
|
668
668
|
{
|
|
669
|
-
filename: "
|
|
669
|
+
filename: "overview.md",
|
|
670
670
|
content: `---
|
|
671
671
|
root: true
|
|
672
672
|
targets: ["*"]
|
|
673
|
-
description: "
|
|
673
|
+
description: "Project overview and general development guidelines"
|
|
674
674
|
globs: ["**/*.ts", "**/*.js", "**/*.tsx", "**/*.jsx"]
|
|
675
675
|
---
|
|
676
676
|
|
|
677
|
-
#
|
|
677
|
+
# Project Overview
|
|
678
678
|
|
|
679
679
|
## General Guidelines
|
|
680
680
|
|
|
@@ -690,54 +690,94 @@ globs: ["**/*.ts", "**/*.js", "**/*.tsx", "**/*.jsx"]
|
|
|
690
690
|
- Use semicolons
|
|
691
691
|
- Use double quotes for strings
|
|
692
692
|
- Use trailing commas in multi-line objects and arrays
|
|
693
|
+
|
|
694
|
+
## Architecture Principles
|
|
695
|
+
|
|
696
|
+
- Organize code by feature, not by file type
|
|
697
|
+
- Keep related files close together
|
|
698
|
+
- Use dependency injection for better testability
|
|
699
|
+
- Implement proper error handling
|
|
700
|
+
- Follow single responsibility principle
|
|
693
701
|
`
|
|
694
702
|
},
|
|
695
703
|
{
|
|
696
|
-
filename: "
|
|
704
|
+
filename: "frontend.md",
|
|
697
705
|
content: `---
|
|
698
706
|
root: false
|
|
699
707
|
targets: ["*"]
|
|
700
|
-
description: "
|
|
701
|
-
globs: ["**/*.
|
|
708
|
+
description: "Frontend development rules and best practices"
|
|
709
|
+
globs: ["src/components/**/*.tsx", "src/pages/**/*.tsx", "**/*.css", "**/*.scss"]
|
|
702
710
|
---
|
|
703
711
|
|
|
704
|
-
#
|
|
712
|
+
# Frontend Development Rules
|
|
713
|
+
|
|
714
|
+
## React Components
|
|
715
|
+
|
|
716
|
+
- Use functional components with hooks
|
|
717
|
+
- Follow PascalCase naming for components
|
|
718
|
+
- Use TypeScript interfaces for props
|
|
719
|
+
- Implement proper error boundaries
|
|
720
|
+
|
|
721
|
+
## Styling
|
|
722
|
+
|
|
723
|
+
- Use CSS modules or styled-components
|
|
724
|
+
- Follow BEM methodology for CSS classes
|
|
725
|
+
- Prefer flexbox and grid for layouts
|
|
726
|
+
- Use semantic HTML elements
|
|
727
|
+
|
|
728
|
+
## State Management
|
|
705
729
|
|
|
706
|
-
|
|
707
|
-
-
|
|
708
|
-
-
|
|
709
|
-
-
|
|
730
|
+
- Use React hooks for local state
|
|
731
|
+
- Consider Redux or Zustand for global state
|
|
732
|
+
- Avoid prop drilling with context API
|
|
733
|
+
- Keep state as close to where it's used as possible
|
|
710
734
|
|
|
711
|
-
##
|
|
712
|
-
- Use kebab-case for file names
|
|
713
|
-
- Use PascalCase for component files
|
|
714
|
-
- Use lowercase for directory names
|
|
735
|
+
## Performance
|
|
715
736
|
|
|
716
|
-
|
|
717
|
-
-
|
|
718
|
-
-
|
|
737
|
+
- Use React.memo for expensive components
|
|
738
|
+
- Implement lazy loading for routes
|
|
739
|
+
- Optimize images and assets
|
|
740
|
+
- Use proper key props in lists
|
|
719
741
|
`
|
|
720
742
|
},
|
|
721
743
|
{
|
|
722
|
-
filename: "
|
|
744
|
+
filename: "backend.md",
|
|
723
745
|
content: `---
|
|
724
746
|
root: false
|
|
725
|
-
targets: ["
|
|
726
|
-
description: "
|
|
727
|
-
globs: ["src/**/*.ts"]
|
|
747
|
+
targets: ["*"]
|
|
748
|
+
description: "Backend development rules and API guidelines"
|
|
749
|
+
globs: ["src/api/**/*.ts", "src/services/**/*.ts", "src/models/**/*.ts"]
|
|
728
750
|
---
|
|
729
751
|
|
|
730
|
-
#
|
|
752
|
+
# Backend Development Rules
|
|
731
753
|
|
|
732
|
-
##
|
|
733
|
-
- Organize code by feature, not by file type
|
|
734
|
-
- Keep related files close together
|
|
735
|
-
- Use index files for clean imports
|
|
754
|
+
## API Design
|
|
736
755
|
|
|
737
|
-
|
|
738
|
-
- Use
|
|
739
|
-
- Implement proper error handling
|
|
740
|
-
-
|
|
756
|
+
- Follow RESTful conventions
|
|
757
|
+
- Use consistent HTTP status codes
|
|
758
|
+
- Implement proper error handling with meaningful messages
|
|
759
|
+
- Use API versioning when necessary
|
|
760
|
+
|
|
761
|
+
## Database
|
|
762
|
+
|
|
763
|
+
- Use proper indexing for performance
|
|
764
|
+
- Implement database migrations
|
|
765
|
+
- Follow naming conventions for tables and columns
|
|
766
|
+
- Use transactions for data consistency
|
|
767
|
+
|
|
768
|
+
## Security
|
|
769
|
+
|
|
770
|
+
- Validate all input data
|
|
771
|
+
- Use proper authentication and authorization
|
|
772
|
+
- Implement rate limiting
|
|
773
|
+
- Sanitize database queries to prevent SQL injection
|
|
774
|
+
|
|
775
|
+
## Code Organization
|
|
776
|
+
|
|
777
|
+
- Use service layer pattern
|
|
778
|
+
- Implement proper logging
|
|
779
|
+
- Use environment variables for configuration
|
|
780
|
+
- Write comprehensive tests for business logic
|
|
741
781
|
`
|
|
742
782
|
}
|
|
743
783
|
];
|
package/dist/index.mjs
CHANGED
|
@@ -643,15 +643,15 @@ async function initCommand() {
|
|
|
643
643
|
async function createSampleFiles(aiRulesDir) {
|
|
644
644
|
const sampleFiles = [
|
|
645
645
|
{
|
|
646
|
-
filename: "
|
|
646
|
+
filename: "overview.md",
|
|
647
647
|
content: `---
|
|
648
648
|
root: true
|
|
649
649
|
targets: ["*"]
|
|
650
|
-
description: "
|
|
650
|
+
description: "Project overview and general development guidelines"
|
|
651
651
|
globs: ["**/*.ts", "**/*.js", "**/*.tsx", "**/*.jsx"]
|
|
652
652
|
---
|
|
653
653
|
|
|
654
|
-
#
|
|
654
|
+
# Project Overview
|
|
655
655
|
|
|
656
656
|
## General Guidelines
|
|
657
657
|
|
|
@@ -667,54 +667,94 @@ globs: ["**/*.ts", "**/*.js", "**/*.tsx", "**/*.jsx"]
|
|
|
667
667
|
- Use semicolons
|
|
668
668
|
- Use double quotes for strings
|
|
669
669
|
- Use trailing commas in multi-line objects and arrays
|
|
670
|
+
|
|
671
|
+
## Architecture Principles
|
|
672
|
+
|
|
673
|
+
- Organize code by feature, not by file type
|
|
674
|
+
- Keep related files close together
|
|
675
|
+
- Use dependency injection for better testability
|
|
676
|
+
- Implement proper error handling
|
|
677
|
+
- Follow single responsibility principle
|
|
670
678
|
`
|
|
671
679
|
},
|
|
672
680
|
{
|
|
673
|
-
filename: "
|
|
681
|
+
filename: "frontend.md",
|
|
674
682
|
content: `---
|
|
675
683
|
root: false
|
|
676
684
|
targets: ["*"]
|
|
677
|
-
description: "
|
|
678
|
-
globs: ["**/*.
|
|
685
|
+
description: "Frontend development rules and best practices"
|
|
686
|
+
globs: ["src/components/**/*.tsx", "src/pages/**/*.tsx", "**/*.css", "**/*.scss"]
|
|
679
687
|
---
|
|
680
688
|
|
|
681
|
-
#
|
|
689
|
+
# Frontend Development Rules
|
|
690
|
+
|
|
691
|
+
## React Components
|
|
692
|
+
|
|
693
|
+
- Use functional components with hooks
|
|
694
|
+
- Follow PascalCase naming for components
|
|
695
|
+
- Use TypeScript interfaces for props
|
|
696
|
+
- Implement proper error boundaries
|
|
697
|
+
|
|
698
|
+
## Styling
|
|
699
|
+
|
|
700
|
+
- Use CSS modules or styled-components
|
|
701
|
+
- Follow BEM methodology for CSS classes
|
|
702
|
+
- Prefer flexbox and grid for layouts
|
|
703
|
+
- Use semantic HTML elements
|
|
704
|
+
|
|
705
|
+
## State Management
|
|
682
706
|
|
|
683
|
-
|
|
684
|
-
-
|
|
685
|
-
-
|
|
686
|
-
-
|
|
707
|
+
- Use React hooks for local state
|
|
708
|
+
- Consider Redux or Zustand for global state
|
|
709
|
+
- Avoid prop drilling with context API
|
|
710
|
+
- Keep state as close to where it's used as possible
|
|
687
711
|
|
|
688
|
-
##
|
|
689
|
-
- Use kebab-case for file names
|
|
690
|
-
- Use PascalCase for component files
|
|
691
|
-
- Use lowercase for directory names
|
|
712
|
+
## Performance
|
|
692
713
|
|
|
693
|
-
|
|
694
|
-
-
|
|
695
|
-
-
|
|
714
|
+
- Use React.memo for expensive components
|
|
715
|
+
- Implement lazy loading for routes
|
|
716
|
+
- Optimize images and assets
|
|
717
|
+
- Use proper key props in lists
|
|
696
718
|
`
|
|
697
719
|
},
|
|
698
720
|
{
|
|
699
|
-
filename: "
|
|
721
|
+
filename: "backend.md",
|
|
700
722
|
content: `---
|
|
701
723
|
root: false
|
|
702
|
-
targets: ["
|
|
703
|
-
description: "
|
|
704
|
-
globs: ["src/**/*.ts"]
|
|
724
|
+
targets: ["*"]
|
|
725
|
+
description: "Backend development rules and API guidelines"
|
|
726
|
+
globs: ["src/api/**/*.ts", "src/services/**/*.ts", "src/models/**/*.ts"]
|
|
705
727
|
---
|
|
706
728
|
|
|
707
|
-
#
|
|
729
|
+
# Backend Development Rules
|
|
708
730
|
|
|
709
|
-
##
|
|
710
|
-
- Organize code by feature, not by file type
|
|
711
|
-
- Keep related files close together
|
|
712
|
-
- Use index files for clean imports
|
|
731
|
+
## API Design
|
|
713
732
|
|
|
714
|
-
|
|
715
|
-
- Use
|
|
716
|
-
- Implement proper error handling
|
|
717
|
-
-
|
|
733
|
+
- Follow RESTful conventions
|
|
734
|
+
- Use consistent HTTP status codes
|
|
735
|
+
- Implement proper error handling with meaningful messages
|
|
736
|
+
- Use API versioning when necessary
|
|
737
|
+
|
|
738
|
+
## Database
|
|
739
|
+
|
|
740
|
+
- Use proper indexing for performance
|
|
741
|
+
- Implement database migrations
|
|
742
|
+
- Follow naming conventions for tables and columns
|
|
743
|
+
- Use transactions for data consistency
|
|
744
|
+
|
|
745
|
+
## Security
|
|
746
|
+
|
|
747
|
+
- Validate all input data
|
|
748
|
+
- Use proper authentication and authorization
|
|
749
|
+
- Implement rate limiting
|
|
750
|
+
- Sanitize database queries to prevent SQL injection
|
|
751
|
+
|
|
752
|
+
## Code Organization
|
|
753
|
+
|
|
754
|
+
- Use service layer pattern
|
|
755
|
+
- Implement proper logging
|
|
756
|
+
- Use environment variables for configuration
|
|
757
|
+
- Write comprehensive tests for business logic
|
|
718
758
|
`
|
|
719
759
|
}
|
|
720
760
|
];
|
package/package.json
CHANGED