agentic-team-templates 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/README.md +30 -24
- package/package.json +1 -1
- package/src/index.js +212 -123
- package/src/index.test.js +137 -66
- /package/templates/blockchain/{.cursorrules → .cursor/rules}/defi-patterns.md +0 -0
- /package/templates/blockchain/{.cursorrules → .cursor/rules}/gas-optimization.md +0 -0
- /package/templates/blockchain/{.cursorrules → .cursor/rules}/overview.md +0 -0
- /package/templates/blockchain/{.cursorrules → .cursor/rules}/security.md +0 -0
- /package/templates/blockchain/{.cursorrules → .cursor/rules}/smart-contracts.md +0 -0
- /package/templates/blockchain/{.cursorrules → .cursor/rules}/testing.md +0 -0
- /package/templates/blockchain/{.cursorrules → .cursor/rules}/web3-integration.md +0 -0
- /package/templates/cli-tools/{.cursorrules → .cursor/rules}/architecture.md +0 -0
- /package/templates/cli-tools/{.cursorrules → .cursor/rules}/arguments.md +0 -0
- /package/templates/cli-tools/{.cursorrules → .cursor/rules}/distribution.md +0 -0
- /package/templates/cli-tools/{.cursorrules → .cursor/rules}/error-handling.md +0 -0
- /package/templates/cli-tools/{.cursorrules → .cursor/rules}/overview.md +0 -0
- /package/templates/cli-tools/{.cursorrules → .cursor/rules}/testing.md +0 -0
- /package/templates/cli-tools/{.cursorrules → .cursor/rules}/user-experience.md +0 -0
- /package/templates/cpp-expert/{.cursorrules → .cursor/rules}/concurrency.md +0 -0
- /package/templates/cpp-expert/{.cursorrules → .cursor/rules}/error-handling.md +0 -0
- /package/templates/cpp-expert/{.cursorrules → .cursor/rules}/memory-and-ownership.md +0 -0
- /package/templates/cpp-expert/{.cursorrules → .cursor/rules}/modern-cpp.md +0 -0
- /package/templates/cpp-expert/{.cursorrules → .cursor/rules}/overview.md +0 -0
- /package/templates/cpp-expert/{.cursorrules → .cursor/rules}/performance.md +0 -0
- /package/templates/cpp-expert/{.cursorrules → .cursor/rules}/testing.md +0 -0
- /package/templates/cpp-expert/{.cursorrules → .cursor/rules}/tooling.md +0 -0
- /package/templates/csharp-expert/{.cursorrules → .cursor/rules}/aspnet-core.md +0 -0
- /package/templates/csharp-expert/{.cursorrules → .cursor/rules}/async-patterns.md +0 -0
- /package/templates/csharp-expert/{.cursorrules → .cursor/rules}/dependency-injection.md +0 -0
- /package/templates/csharp-expert/{.cursorrules → .cursor/rules}/error-handling.md +0 -0
- /package/templates/csharp-expert/{.cursorrules → .cursor/rules}/language-features.md +0 -0
- /package/templates/csharp-expert/{.cursorrules → .cursor/rules}/overview.md +0 -0
- /package/templates/csharp-expert/{.cursorrules → .cursor/rules}/performance.md +0 -0
- /package/templates/csharp-expert/{.cursorrules → .cursor/rules}/testing.md +0 -0
- /package/templates/csharp-expert/{.cursorrules → .cursor/rules}/tooling.md +0 -0
- /package/templates/data-engineering/{.cursorrules → .cursor/rules}/data-modeling.md +0 -0
- /package/templates/data-engineering/{.cursorrules → .cursor/rules}/data-quality.md +0 -0
- /package/templates/data-engineering/{.cursorrules → .cursor/rules}/overview.md +0 -0
- /package/templates/data-engineering/{.cursorrules → .cursor/rules}/performance.md +0 -0
- /package/templates/data-engineering/{.cursorrules → .cursor/rules}/pipeline-design.md +0 -0
- /package/templates/data-engineering/{.cursorrules → .cursor/rules}/security.md +0 -0
- /package/templates/data-engineering/{.cursorrules → .cursor/rules}/testing.md +0 -0
- /package/templates/devops-sre/{.cursorrules → .cursor/rules}/capacity-planning.md +0 -0
- /package/templates/devops-sre/{.cursorrules → .cursor/rules}/change-management.md +0 -0
- /package/templates/devops-sre/{.cursorrules → .cursor/rules}/chaos-engineering.md +0 -0
- /package/templates/devops-sre/{.cursorrules → .cursor/rules}/disaster-recovery.md +0 -0
- /package/templates/devops-sre/{.cursorrules → .cursor/rules}/incident-management.md +0 -0
- /package/templates/devops-sre/{.cursorrules → .cursor/rules}/observability.md +0 -0
- /package/templates/devops-sre/{.cursorrules → .cursor/rules}/overview.md +0 -0
- /package/templates/devops-sre/{.cursorrules → .cursor/rules}/postmortems.md +0 -0
- /package/templates/devops-sre/{.cursorrules → .cursor/rules}/runbooks.md +0 -0
- /package/templates/devops-sre/{.cursorrules → .cursor/rules}/slo-sli.md +0 -0
- /package/templates/devops-sre/{.cursorrules → .cursor/rules}/toil-reduction.md +0 -0
- /package/templates/documentation/{.cursorrules → .cursor/rules}/adr.md +0 -0
- /package/templates/documentation/{.cursorrules → .cursor/rules}/api-documentation.md +0 -0
- /package/templates/documentation/{.cursorrules → .cursor/rules}/code-comments.md +0 -0
- /package/templates/documentation/{.cursorrules → .cursor/rules}/maintenance.md +0 -0
- /package/templates/documentation/{.cursorrules → .cursor/rules}/overview.md +0 -0
- /package/templates/documentation/{.cursorrules → .cursor/rules}/readme-standards.md +0 -0
- /package/templates/educator/{.cursorrules → .cursor/rules}/accessibility.md +0 -0
- /package/templates/educator/{.cursorrules → .cursor/rules}/assessment.md +0 -0
- /package/templates/educator/{.cursorrules → .cursor/rules}/curriculum.md +0 -0
- /package/templates/educator/{.cursorrules → .cursor/rules}/engagement.md +0 -0
- /package/templates/educator/{.cursorrules → .cursor/rules}/instructional-design.md +0 -0
- /package/templates/educator/{.cursorrules → .cursor/rules}/overview.md +0 -0
- /package/templates/educator/{.cursorrules → .cursor/rules}/retention.md +0 -0
- /package/templates/fullstack/{.cursorrules → .cursor/rules}/api-contracts.md +0 -0
- /package/templates/fullstack/{.cursorrules → .cursor/rules}/architecture.md +0 -0
- /package/templates/fullstack/{.cursorrules → .cursor/rules}/overview.md +0 -0
- /package/templates/fullstack/{.cursorrules → .cursor/rules}/shared-types.md +0 -0
- /package/templates/fullstack/{.cursorrules → .cursor/rules}/testing.md +0 -0
- /package/templates/golang-expert/{.cursorrules → .cursor/rules}/concurrency.md +0 -0
- /package/templates/golang-expert/{.cursorrules → .cursor/rules}/error-handling.md +0 -0
- /package/templates/golang-expert/{.cursorrules → .cursor/rules}/interfaces-and-types.md +0 -0
- /package/templates/golang-expert/{.cursorrules → .cursor/rules}/overview.md +0 -0
- /package/templates/golang-expert/{.cursorrules → .cursor/rules}/performance.md +0 -0
- /package/templates/golang-expert/{.cursorrules → .cursor/rules}/production-patterns.md +0 -0
- /package/templates/golang-expert/{.cursorrules → .cursor/rules}/stdlib-and-tooling.md +0 -0
- /package/templates/golang-expert/{.cursorrules → .cursor/rules}/testing.md +0 -0
- /package/templates/java-expert/{.cursorrules → .cursor/rules}/concurrency.md +0 -0
- /package/templates/java-expert/{.cursorrules → .cursor/rules}/error-handling.md +0 -0
- /package/templates/java-expert/{.cursorrules → .cursor/rules}/modern-java.md +0 -0
- /package/templates/java-expert/{.cursorrules → .cursor/rules}/overview.md +0 -0
- /package/templates/java-expert/{.cursorrules → .cursor/rules}/performance.md +0 -0
- /package/templates/java-expert/{.cursorrules → .cursor/rules}/persistence.md +0 -0
- /package/templates/java-expert/{.cursorrules → .cursor/rules}/spring-boot.md +0 -0
- /package/templates/java-expert/{.cursorrules → .cursor/rules}/testing.md +0 -0
- /package/templates/java-expert/{.cursorrules → .cursor/rules}/tooling.md +0 -0
- /package/templates/javascript-expert/{.cursorrules → .cursor/rules}/language-deep-dive.md +0 -0
- /package/templates/javascript-expert/{.cursorrules → .cursor/rules}/node-patterns.md +0 -0
- /package/templates/javascript-expert/{.cursorrules → .cursor/rules}/overview.md +0 -0
- /package/templates/javascript-expert/{.cursorrules → .cursor/rules}/performance.md +0 -0
- /package/templates/javascript-expert/{.cursorrules → .cursor/rules}/react-patterns.md +0 -0
- /package/templates/javascript-expert/{.cursorrules → .cursor/rules}/testing.md +0 -0
- /package/templates/javascript-expert/{.cursorrules → .cursor/rules}/tooling.md +0 -0
- /package/templates/javascript-expert/{.cursorrules → .cursor/rules}/typescript-deep-dive.md +0 -0
- /package/templates/kotlin-expert/{.cursorrules → .cursor/rules}/coroutines.md +0 -0
- /package/templates/kotlin-expert/{.cursorrules → .cursor/rules}/error-handling.md +0 -0
- /package/templates/kotlin-expert/{.cursorrules → .cursor/rules}/frameworks.md +0 -0
- /package/templates/kotlin-expert/{.cursorrules → .cursor/rules}/language-features.md +0 -0
- /package/templates/kotlin-expert/{.cursorrules → .cursor/rules}/overview.md +0 -0
- /package/templates/kotlin-expert/{.cursorrules → .cursor/rules}/performance.md +0 -0
- /package/templates/kotlin-expert/{.cursorrules → .cursor/rules}/testing.md +0 -0
- /package/templates/kotlin-expert/{.cursorrules → .cursor/rules}/tooling.md +0 -0
- /package/templates/ml-ai/{.cursorrules → .cursor/rules}/data-engineering.md +0 -0
- /package/templates/ml-ai/{.cursorrules → .cursor/rules}/deployment.md +0 -0
- /package/templates/ml-ai/{.cursorrules → .cursor/rules}/model-development.md +0 -0
- /package/templates/ml-ai/{.cursorrules → .cursor/rules}/monitoring.md +0 -0
- /package/templates/ml-ai/{.cursorrules → .cursor/rules}/overview.md +0 -0
- /package/templates/ml-ai/{.cursorrules → .cursor/rules}/security.md +0 -0
- /package/templates/ml-ai/{.cursorrules → .cursor/rules}/testing.md +0 -0
- /package/templates/mobile/{.cursorrules → .cursor/rules}/navigation.md +0 -0
- /package/templates/mobile/{.cursorrules → .cursor/rules}/offline-first.md +0 -0
- /package/templates/mobile/{.cursorrules → .cursor/rules}/overview.md +0 -0
- /package/templates/mobile/{.cursorrules → .cursor/rules}/performance.md +0 -0
- /package/templates/mobile/{.cursorrules → .cursor/rules}/testing.md +0 -0
- /package/templates/platform-engineering/{.cursorrules → .cursor/rules}/ci-cd.md +0 -0
- /package/templates/platform-engineering/{.cursorrules → .cursor/rules}/developer-experience.md +0 -0
- /package/templates/platform-engineering/{.cursorrules → .cursor/rules}/infrastructure-as-code.md +0 -0
- /package/templates/platform-engineering/{.cursorrules → .cursor/rules}/kubernetes.md +0 -0
- /package/templates/platform-engineering/{.cursorrules → .cursor/rules}/observability.md +0 -0
- /package/templates/platform-engineering/{.cursorrules → .cursor/rules}/overview.md +0 -0
- /package/templates/platform-engineering/{.cursorrules → .cursor/rules}/security.md +0 -0
- /package/templates/platform-engineering/{.cursorrules → .cursor/rules}/testing.md +0 -0
- /package/templates/product-manager/{.cursorrules → .cursor/rules}/communication.md +0 -0
- /package/templates/product-manager/{.cursorrules → .cursor/rules}/discovery.md +0 -0
- /package/templates/product-manager/{.cursorrules → .cursor/rules}/metrics.md +0 -0
- /package/templates/product-manager/{.cursorrules → .cursor/rules}/overview.md +0 -0
- /package/templates/product-manager/{.cursorrules → .cursor/rules}/prioritization.md +0 -0
- /package/templates/product-manager/{.cursorrules → .cursor/rules}/requirements.md +0 -0
- /package/templates/python-expert/{.cursorrules → .cursor/rules}/async-python.md +0 -0
- /package/templates/python-expert/{.cursorrules → .cursor/rules}/overview.md +0 -0
- /package/templates/python-expert/{.cursorrules → .cursor/rules}/patterns-and-idioms.md +0 -0
- /package/templates/python-expert/{.cursorrules → .cursor/rules}/performance.md +0 -0
- /package/templates/python-expert/{.cursorrules → .cursor/rules}/testing.md +0 -0
- /package/templates/python-expert/{.cursorrules → .cursor/rules}/tooling.md +0 -0
- /package/templates/python-expert/{.cursorrules → .cursor/rules}/type-system.md +0 -0
- /package/templates/python-expert/{.cursorrules → .cursor/rules}/web-and-apis.md +0 -0
- /package/templates/qa-engineering/{.cursorrules → .cursor/rules}/automation.md +0 -0
- /package/templates/qa-engineering/{.cursorrules → .cursor/rules}/metrics.md +0 -0
- /package/templates/qa-engineering/{.cursorrules → .cursor/rules}/overview.md +0 -0
- /package/templates/qa-engineering/{.cursorrules → .cursor/rules}/quality-gates.md +0 -0
- /package/templates/qa-engineering/{.cursorrules → .cursor/rules}/test-design.md +0 -0
- /package/templates/qa-engineering/{.cursorrules → .cursor/rules}/test-strategy.md +0 -0
- /package/templates/rust-expert/{.cursorrules → .cursor/rules}/concurrency.md +0 -0
- /package/templates/rust-expert/{.cursorrules → .cursor/rules}/ecosystem-and-tooling.md +0 -0
- /package/templates/rust-expert/{.cursorrules → .cursor/rules}/error-handling.md +0 -0
- /package/templates/rust-expert/{.cursorrules → .cursor/rules}/overview.md +0 -0
- /package/templates/rust-expert/{.cursorrules → .cursor/rules}/ownership-and-borrowing.md +0 -0
- /package/templates/rust-expert/{.cursorrules → .cursor/rules}/performance-and-unsafe.md +0 -0
- /package/templates/rust-expert/{.cursorrules → .cursor/rules}/testing.md +0 -0
- /package/templates/rust-expert/{.cursorrules → .cursor/rules}/traits-and-generics.md +0 -0
- /package/templates/swift-expert/{.cursorrules → .cursor/rules}/concurrency.md +0 -0
- /package/templates/swift-expert/{.cursorrules → .cursor/rules}/error-handling.md +0 -0
- /package/templates/swift-expert/{.cursorrules → .cursor/rules}/language-features.md +0 -0
- /package/templates/swift-expert/{.cursorrules → .cursor/rules}/overview.md +0 -0
- /package/templates/swift-expert/{.cursorrules → .cursor/rules}/performance.md +0 -0
- /package/templates/swift-expert/{.cursorrules → .cursor/rules}/swiftui.md +0 -0
- /package/templates/swift-expert/{.cursorrules → .cursor/rules}/testing.md +0 -0
- /package/templates/swift-expert/{.cursorrules → .cursor/rules}/tooling.md +0 -0
- /package/templates/testing/{.cursorrules → .cursor/rules}/advanced-techniques.md +0 -0
- /package/templates/testing/{.cursorrules → .cursor/rules}/ci-cd-integration.md +0 -0
- /package/templates/testing/{.cursorrules → .cursor/rules}/overview.md +0 -0
- /package/templates/testing/{.cursorrules → .cursor/rules}/performance-testing.md +0 -0
- /package/templates/testing/{.cursorrules → .cursor/rules}/quality-metrics.md +0 -0
- /package/templates/testing/{.cursorrules → .cursor/rules}/reliability.md +0 -0
- /package/templates/testing/{.cursorrules → .cursor/rules}/tdd-methodology.md +0 -0
- /package/templates/testing/{.cursorrules → .cursor/rules}/test-data.md +0 -0
- /package/templates/testing/{.cursorrules → .cursor/rules}/test-design.md +0 -0
- /package/templates/testing/{.cursorrules → .cursor/rules}/test-types.md +0 -0
- /package/templates/utility-agent/{.cursorrules → .cursor/rules}/action-control.md +0 -0
- /package/templates/utility-agent/{.cursorrules → .cursor/rules}/context-management.md +0 -0
- /package/templates/utility-agent/{.cursorrules → .cursor/rules}/hallucination-prevention.md +0 -0
- /package/templates/utility-agent/{.cursorrules → .cursor/rules}/overview.md +0 -0
- /package/templates/utility-agent/{.cursorrules → .cursor/rules}/token-optimization.md +0 -0
- /package/templates/ux-designer/{.cursorrules → .cursor/rules}/accessibility.md +0 -0
- /package/templates/ux-designer/{.cursorrules → .cursor/rules}/emotional-design.md +0 -0
- /package/templates/ux-designer/{.cursorrules → .cursor/rules}/handoff.md +0 -0
- /package/templates/ux-designer/{.cursorrules → .cursor/rules}/information-architecture.md +0 -0
- /package/templates/ux-designer/{.cursorrules → .cursor/rules}/interaction-design.md +0 -0
- /package/templates/ux-designer/{.cursorrules → .cursor/rules}/overview.md +0 -0
- /package/templates/ux-designer/{.cursorrules → .cursor/rules}/research.md +0 -0
- /package/templates/ux-designer/{.cursorrules → .cursor/rules}/visual-design.md +0 -0
- /package/templates/web-backend/{.cursorrules → .cursor/rules}/api-design.md +0 -0
- /package/templates/web-backend/{.cursorrules → .cursor/rules}/authentication.md +0 -0
- /package/templates/web-backend/{.cursorrules → .cursor/rules}/database-patterns.md +0 -0
- /package/templates/web-backend/{.cursorrules → .cursor/rules}/error-handling.md +0 -0
- /package/templates/web-backend/{.cursorrules → .cursor/rules}/overview.md +0 -0
- /package/templates/web-backend/{.cursorrules → .cursor/rules}/security.md +0 -0
- /package/templates/web-backend/{.cursorrules → .cursor/rules}/testing.md +0 -0
- /package/templates/web-frontend/{.cursorrules → .cursor/rules}/accessibility.md +0 -0
- /package/templates/web-frontend/{.cursorrules → .cursor/rules}/component-patterns.md +0 -0
- /package/templates/web-frontend/{.cursorrules → .cursor/rules}/overview.md +0 -0
- /package/templates/web-frontend/{.cursorrules → .cursor/rules}/performance.md +0 -0
- /package/templates/web-frontend/{.cursorrules → .cursor/rules}/state-management.md +0 -0
- /package/templates/web-frontend/{.cursorrules → .cursor/rules}/styling.md +0 -0
- /package/templates/web-frontend/{.cursorrules → .cursor/rules}/testing.md +0 -0
package/src/index.test.js
CHANGED
|
@@ -7,6 +7,8 @@ import { run, _internals } from './index.js';
|
|
|
7
7
|
const {
|
|
8
8
|
PACKAGE_NAME,
|
|
9
9
|
CURRENT_VERSION,
|
|
10
|
+
CURSOR_RULES_DIR,
|
|
11
|
+
LEGACY_CURSORRULES_DIR,
|
|
10
12
|
TEMPLATES,
|
|
11
13
|
TEMPLATE_ALIASES,
|
|
12
14
|
SHARED_RULES,
|
|
@@ -715,104 +717,139 @@ describe('Install/Remove/Reset Operations', () => {
|
|
|
715
717
|
});
|
|
716
718
|
|
|
717
719
|
describe('install', () => {
|
|
718
|
-
it('should create .
|
|
719
|
-
install(tempDir, ['web-frontend'], false, false, ['cursor']);
|
|
720
|
-
|
|
721
|
-
expect(fs.existsSync(path.join(tempDir, '.
|
|
720
|
+
it('should create .cursor/rules directory', async () => {
|
|
721
|
+
await install(tempDir, ['web-frontend'], false, false, ['cursor']);
|
|
722
|
+
|
|
723
|
+
expect(fs.existsSync(path.join(tempDir, '.cursor', 'rules'))).toBe(true);
|
|
722
724
|
});
|
|
723
725
|
|
|
724
|
-
it('should install shared rules', () => {
|
|
725
|
-
install(tempDir, ['web-frontend'], false, false, ['cursor']);
|
|
726
|
-
|
|
726
|
+
it('should install shared rules', async () => {
|
|
727
|
+
await install(tempDir, ['web-frontend'], false, false, ['cursor']);
|
|
728
|
+
|
|
727
729
|
for (const rule of SHARED_RULES) {
|
|
728
|
-
expect(fs.existsSync(path.join(tempDir, '.
|
|
730
|
+
expect(fs.existsSync(path.join(tempDir, '.cursor', 'rules', rule))).toBe(true);
|
|
729
731
|
}
|
|
730
732
|
});
|
|
731
733
|
|
|
732
|
-
it('should install template-specific rules with prefix', () => {
|
|
733
|
-
install(tempDir, ['web-frontend'], false, false, ['cursor']);
|
|
734
|
-
|
|
734
|
+
it('should install template-specific rules with prefix', async () => {
|
|
735
|
+
await install(tempDir, ['web-frontend'], false, false, ['cursor']);
|
|
736
|
+
|
|
735
737
|
for (const rule of TEMPLATES['web-frontend'].rules) {
|
|
736
738
|
const prefixedName = `web-frontend-${rule}`;
|
|
737
|
-
expect(fs.existsSync(path.join(tempDir, '.
|
|
739
|
+
expect(fs.existsSync(path.join(tempDir, '.cursor', 'rules', prefixedName))).toBe(true);
|
|
738
740
|
}
|
|
739
741
|
});
|
|
740
742
|
|
|
741
|
-
it('should create CLAUDE.md for claude IDE', () => {
|
|
742
|
-
install(tempDir, ['web-frontend'], false, false, ['claude']);
|
|
743
|
-
|
|
743
|
+
it('should create CLAUDE.md for claude IDE', async () => {
|
|
744
|
+
await install(tempDir, ['web-frontend'], false, false, ['claude']);
|
|
745
|
+
|
|
744
746
|
expect(fs.existsSync(path.join(tempDir, 'CLAUDE.md'))).toBe(true);
|
|
745
747
|
const content = fs.readFileSync(path.join(tempDir, 'CLAUDE.md'), 'utf8');
|
|
746
748
|
expect(content).toContain('# CLAUDE.md - Development Guide');
|
|
747
749
|
});
|
|
748
750
|
|
|
749
|
-
it('should create copilot-instructions.md for codex IDE', () => {
|
|
750
|
-
install(tempDir, ['web-frontend'], false, false, ['codex']);
|
|
751
|
-
|
|
751
|
+
it('should create copilot-instructions.md for codex IDE', async () => {
|
|
752
|
+
await install(tempDir, ['web-frontend'], false, false, ['codex']);
|
|
753
|
+
|
|
752
754
|
expect(fs.existsSync(path.join(tempDir, '.github', 'copilot-instructions.md'))).toBe(true);
|
|
753
755
|
});
|
|
754
756
|
|
|
755
|
-
it('should install for all IDEs by default', () => {
|
|
756
|
-
install(tempDir, ['web-frontend'], false, false, DEFAULT_IDES);
|
|
757
|
-
|
|
758
|
-
expect(fs.existsSync(path.join(tempDir, '.
|
|
757
|
+
it('should install for all IDEs by default', async () => {
|
|
758
|
+
await install(tempDir, ['web-frontend'], false, false, DEFAULT_IDES);
|
|
759
|
+
|
|
760
|
+
expect(fs.existsSync(path.join(tempDir, '.cursor', 'rules'))).toBe(true);
|
|
759
761
|
expect(fs.existsSync(path.join(tempDir, 'CLAUDE.md'))).toBe(true);
|
|
760
762
|
expect(fs.existsSync(path.join(tempDir, '.github', 'copilot-instructions.md'))).toBe(true);
|
|
761
763
|
});
|
|
762
764
|
|
|
763
|
-
it('should not write files in dry-run mode', () => {
|
|
764
|
-
install(tempDir, ['web-frontend'], true, false, ['cursor']);
|
|
765
|
-
|
|
766
|
-
expect(fs.existsSync(path.join(tempDir, '.
|
|
765
|
+
it('should not write files in dry-run mode', async () => {
|
|
766
|
+
await install(tempDir, ['web-frontend'], true, false, ['cursor']);
|
|
767
|
+
|
|
768
|
+
expect(fs.existsSync(path.join(tempDir, '.cursor', 'rules'))).toBe(false);
|
|
767
769
|
});
|
|
768
770
|
|
|
769
|
-
it('should install multiple templates', () => {
|
|
770
|
-
install(tempDir, ['web-frontend', 'web-backend'], false, false, ['cursor']);
|
|
771
|
-
|
|
771
|
+
it('should install multiple templates', async () => {
|
|
772
|
+
await install(tempDir, ['web-frontend', 'web-backend'], false, false, ['cursor']);
|
|
773
|
+
|
|
772
774
|
// Check web-frontend rules
|
|
773
|
-
expect(fs.existsSync(path.join(tempDir, '.
|
|
775
|
+
expect(fs.existsSync(path.join(tempDir, '.cursor', 'rules', 'web-frontend-overview.md'))).toBe(true);
|
|
774
776
|
// Check web-backend rules
|
|
775
|
-
expect(fs.existsSync(path.join(tempDir, '.
|
|
777
|
+
expect(fs.existsSync(path.join(tempDir, '.cursor', 'rules', 'web-backend-overview.md'))).toBe(true);
|
|
778
|
+
});
|
|
779
|
+
|
|
780
|
+
it('should detect legacy .cursorrules/ and create notice when cleanup declined', async () => {
|
|
781
|
+
// Create a legacy .cursorrules/ directory
|
|
782
|
+
const legacyDir = path.join(tempDir, LEGACY_CURSORRULES_DIR);
|
|
783
|
+
fs.mkdirSync(legacyDir, { recursive: true });
|
|
784
|
+
fs.writeFileSync(path.join(legacyDir, 'old-rule.md'), '# Old rule');
|
|
785
|
+
|
|
786
|
+
// Install with skipConfirm=false but mock stdin to decline
|
|
787
|
+
// Since we can't easily mock stdin, use the fact that confirm defaults to 'N'
|
|
788
|
+
// We'll test the --yes path which auto-cleans, and also the notice path
|
|
789
|
+
// For the notice path, install without skipConfirm - the confirm() will fail in test env
|
|
790
|
+
// Actually, let's just test the --yes (skipConfirm) paths
|
|
791
|
+
|
|
792
|
+
// Test: skipConfirm=true should remove legacy dir
|
|
793
|
+
await install(tempDir, ['web-frontend'], false, false, ['cursor'], true);
|
|
794
|
+
|
|
795
|
+
expect(fs.existsSync(legacyDir)).toBe(false);
|
|
796
|
+
expect(fs.existsSync(path.join(tempDir, '.cursor', 'rules', 'web-frontend-overview.md'))).toBe(true);
|
|
797
|
+
});
|
|
798
|
+
|
|
799
|
+
it('should show legacy warning in dry-run mode without prompting', async () => {
|
|
800
|
+
// Create a legacy .cursorrules/ directory
|
|
801
|
+
const legacyDir = path.join(tempDir, LEGACY_CURSORRULES_DIR);
|
|
802
|
+
fs.mkdirSync(legacyDir, { recursive: true });
|
|
803
|
+
fs.writeFileSync(path.join(legacyDir, 'old-rule.md'), '# Old rule');
|
|
804
|
+
|
|
805
|
+
await install(tempDir, ['web-frontend'], true, false, ['cursor']);
|
|
806
|
+
|
|
807
|
+
// Legacy dir should still exist (dry-run doesn't modify)
|
|
808
|
+
expect(fs.existsSync(legacyDir)).toBe(true);
|
|
809
|
+
// Warning should have been printed
|
|
810
|
+
expect(consoleLogSpy).toHaveBeenCalledWith(
|
|
811
|
+
expect.stringContaining('Deprecated')
|
|
812
|
+
);
|
|
776
813
|
});
|
|
777
814
|
});
|
|
778
815
|
|
|
779
816
|
describe('remove', () => {
|
|
780
|
-
beforeEach(() => {
|
|
817
|
+
beforeEach(async () => {
|
|
781
818
|
// First install a template
|
|
782
|
-
install(tempDir, ['web-frontend'], false, false, ['cursor']);
|
|
819
|
+
await install(tempDir, ['web-frontend'], false, false, ['cursor']);
|
|
783
820
|
});
|
|
784
821
|
|
|
785
822
|
it('should remove template-specific files', async () => {
|
|
786
823
|
await remove(tempDir, ['web-frontend'], false, false, true, ['cursor']);
|
|
787
|
-
|
|
824
|
+
|
|
788
825
|
for (const rule of TEMPLATES['web-frontend'].rules) {
|
|
789
826
|
const prefixedName = `web-frontend-${rule}`;
|
|
790
|
-
expect(fs.existsSync(path.join(tempDir, '.
|
|
827
|
+
expect(fs.existsSync(path.join(tempDir, '.cursor', 'rules', prefixedName))).toBe(false);
|
|
791
828
|
}
|
|
792
829
|
});
|
|
793
830
|
|
|
794
831
|
it('should keep shared rules when removing template', async () => {
|
|
795
832
|
await remove(tempDir, ['web-frontend'], false, false, true, ['cursor']);
|
|
796
|
-
|
|
833
|
+
|
|
797
834
|
for (const rule of SHARED_RULES) {
|
|
798
|
-
expect(fs.existsSync(path.join(tempDir, '.
|
|
835
|
+
expect(fs.existsSync(path.join(tempDir, '.cursor', 'rules', rule))).toBe(true);
|
|
799
836
|
}
|
|
800
837
|
});
|
|
801
838
|
|
|
802
839
|
it('should not remove files in dry-run mode', async () => {
|
|
803
840
|
await remove(tempDir, ['web-frontend'], true, false, true, ['cursor']);
|
|
804
|
-
|
|
841
|
+
|
|
805
842
|
// Files should still exist
|
|
806
|
-
expect(fs.existsSync(path.join(tempDir, '.
|
|
843
|
+
expect(fs.existsSync(path.join(tempDir, '.cursor', 'rules', 'web-frontend-overview.md'))).toBe(true);
|
|
807
844
|
});
|
|
808
845
|
|
|
809
846
|
it('should skip modified files without force', async () => {
|
|
810
847
|
// Modify a file
|
|
811
|
-
const filePath = path.join(tempDir, '.
|
|
848
|
+
const filePath = path.join(tempDir, '.cursor', 'rules', 'web-frontend-overview.md');
|
|
812
849
|
fs.writeFileSync(filePath, '# Modified content');
|
|
813
|
-
|
|
850
|
+
|
|
814
851
|
await remove(tempDir, ['web-frontend'], false, false, true, ['cursor']);
|
|
815
|
-
|
|
852
|
+
|
|
816
853
|
// Modified file should still exist
|
|
817
854
|
expect(fs.existsSync(filePath)).toBe(true);
|
|
818
855
|
expect(fs.readFileSync(filePath, 'utf8')).toBe('# Modified content');
|
|
@@ -820,73 +857,107 @@ describe('Install/Remove/Reset Operations', () => {
|
|
|
820
857
|
|
|
821
858
|
it('should remove modified files with force', async () => {
|
|
822
859
|
// Modify a file
|
|
823
|
-
const filePath = path.join(tempDir, '.
|
|
860
|
+
const filePath = path.join(tempDir, '.cursor', 'rules', 'web-frontend-overview.md');
|
|
824
861
|
fs.writeFileSync(filePath, '# Modified content');
|
|
825
|
-
|
|
862
|
+
|
|
826
863
|
await remove(tempDir, ['web-frontend'], false, true, true, ['cursor']);
|
|
827
|
-
|
|
864
|
+
|
|
828
865
|
// Modified file should be removed
|
|
829
866
|
expect(fs.existsSync(filePath)).toBe(false);
|
|
830
867
|
});
|
|
868
|
+
|
|
869
|
+
it('should also remove files from legacy .cursorrules/ directory', async () => {
|
|
870
|
+
// Manually create files in legacy location
|
|
871
|
+
const legacyDir = path.join(tempDir, LEGACY_CURSORRULES_DIR);
|
|
872
|
+
fs.mkdirSync(legacyDir, { recursive: true });
|
|
873
|
+
for (const rule of TEMPLATES['web-frontend'].rules) {
|
|
874
|
+
fs.writeFileSync(path.join(legacyDir, `web-frontend-${rule}`), '# legacy content');
|
|
875
|
+
}
|
|
876
|
+
|
|
877
|
+
await remove(tempDir, ['web-frontend'], false, true, true, ['cursor']);
|
|
878
|
+
|
|
879
|
+
// Both new and legacy files should be removed
|
|
880
|
+
for (const rule of TEMPLATES['web-frontend'].rules) {
|
|
881
|
+
const prefixedName = `web-frontend-${rule}`;
|
|
882
|
+
expect(fs.existsSync(path.join(tempDir, '.cursor', 'rules', prefixedName))).toBe(false);
|
|
883
|
+
expect(fs.existsSync(path.join(legacyDir, prefixedName))).toBe(false);
|
|
884
|
+
}
|
|
885
|
+
});
|
|
831
886
|
});
|
|
832
887
|
|
|
833
888
|
describe('reset', () => {
|
|
834
|
-
beforeEach(() => {
|
|
889
|
+
beforeEach(async () => {
|
|
835
890
|
// Install templates
|
|
836
|
-
install(tempDir, ['web-frontend', 'web-backend'], false, false, DEFAULT_IDES);
|
|
891
|
+
await install(tempDir, ['web-frontend', 'web-backend'], false, false, DEFAULT_IDES);
|
|
837
892
|
});
|
|
838
893
|
|
|
839
|
-
it('should remove all template files from .
|
|
894
|
+
it('should remove all template files from .cursor/rules', async () => {
|
|
840
895
|
await reset(tempDir, false, false, true, ['cursor']);
|
|
841
|
-
|
|
896
|
+
|
|
842
897
|
// Template files should be removed
|
|
843
|
-
expect(fs.existsSync(path.join(tempDir, '.
|
|
844
|
-
expect(fs.existsSync(path.join(tempDir, '.
|
|
898
|
+
expect(fs.existsSync(path.join(tempDir, '.cursor', 'rules', 'web-frontend-overview.md'))).toBe(false);
|
|
899
|
+
expect(fs.existsSync(path.join(tempDir, '.cursor', 'rules', 'web-backend-overview.md'))).toBe(false);
|
|
845
900
|
});
|
|
846
901
|
|
|
847
902
|
it('should remove shared rules', async () => {
|
|
848
903
|
await reset(tempDir, false, false, true, ['cursor']);
|
|
849
|
-
|
|
904
|
+
|
|
850
905
|
for (const rule of SHARED_RULES) {
|
|
851
|
-
expect(fs.existsSync(path.join(tempDir, '.
|
|
906
|
+
expect(fs.existsSync(path.join(tempDir, '.cursor', 'rules', rule))).toBe(false);
|
|
852
907
|
}
|
|
853
908
|
});
|
|
854
909
|
|
|
855
910
|
it('should remove CLAUDE.md', async () => {
|
|
856
911
|
await reset(tempDir, false, false, true, ['claude']);
|
|
857
|
-
|
|
912
|
+
|
|
858
913
|
expect(fs.existsSync(path.join(tempDir, 'CLAUDE.md'))).toBe(false);
|
|
859
914
|
});
|
|
860
915
|
|
|
861
916
|
it('should remove copilot-instructions.md', async () => {
|
|
862
917
|
await reset(tempDir, false, false, true, ['codex']);
|
|
863
|
-
|
|
918
|
+
|
|
864
919
|
expect(fs.existsSync(path.join(tempDir, '.github', 'copilot-instructions.md'))).toBe(false);
|
|
865
920
|
});
|
|
866
921
|
|
|
867
922
|
it('should not remove files in dry-run mode', async () => {
|
|
868
923
|
await reset(tempDir, true, false, true, DEFAULT_IDES);
|
|
869
|
-
|
|
924
|
+
|
|
870
925
|
// All files should still exist
|
|
871
|
-
expect(fs.existsSync(path.join(tempDir, '.
|
|
926
|
+
expect(fs.existsSync(path.join(tempDir, '.cursor', 'rules'))).toBe(true);
|
|
872
927
|
expect(fs.existsSync(path.join(tempDir, 'CLAUDE.md'))).toBe(true);
|
|
873
928
|
});
|
|
874
929
|
|
|
875
|
-
it('should remove empty .
|
|
930
|
+
it('should remove empty .cursor/rules directory', async () => {
|
|
876
931
|
await reset(tempDir, false, false, true, ['cursor']);
|
|
877
|
-
|
|
878
|
-
expect(fs.existsSync(path.join(tempDir, '.
|
|
932
|
+
|
|
933
|
+
expect(fs.existsSync(path.join(tempDir, '.cursor', 'rules'))).toBe(false);
|
|
879
934
|
});
|
|
880
935
|
|
|
881
|
-
it('should keep .
|
|
936
|
+
it('should keep .cursor/rules if non-template files remain', async () => {
|
|
882
937
|
// Add a custom file
|
|
883
|
-
fs.writeFileSync(path.join(tempDir, '.
|
|
884
|
-
|
|
938
|
+
fs.writeFileSync(path.join(tempDir, '.cursor', 'rules', 'my-custom-rules.md'), '# Custom');
|
|
939
|
+
|
|
885
940
|
await reset(tempDir, false, false, true, ['cursor']);
|
|
886
|
-
|
|
941
|
+
|
|
887
942
|
// Directory should still exist with custom file
|
|
888
|
-
expect(fs.existsSync(path.join(tempDir, '.
|
|
889
|
-
expect(fs.existsSync(path.join(tempDir, '.
|
|
943
|
+
expect(fs.existsSync(path.join(tempDir, '.cursor', 'rules'))).toBe(true);
|
|
944
|
+
expect(fs.existsSync(path.join(tempDir, '.cursor', 'rules', 'my-custom-rules.md'))).toBe(true);
|
|
945
|
+
});
|
|
946
|
+
|
|
947
|
+
it('should also clean up legacy .cursorrules/ directory', async () => {
|
|
948
|
+
// Manually create legacy directory with template files
|
|
949
|
+
const legacyDir = path.join(tempDir, LEGACY_CURSORRULES_DIR);
|
|
950
|
+
fs.mkdirSync(legacyDir, { recursive: true });
|
|
951
|
+
for (const rule of SHARED_RULES) {
|
|
952
|
+
fs.writeFileSync(path.join(legacyDir, rule), '# legacy shared');
|
|
953
|
+
}
|
|
954
|
+
fs.writeFileSync(path.join(legacyDir, 'web-frontend-overview.md'), '# legacy template');
|
|
955
|
+
|
|
956
|
+
await reset(tempDir, false, true, true, ['cursor']);
|
|
957
|
+
|
|
958
|
+
// Both directories should be cleaned up
|
|
959
|
+
expect(fs.existsSync(path.join(tempDir, '.cursor', 'rules', 'web-frontend-overview.md'))).toBe(false);
|
|
960
|
+
expect(fs.existsSync(path.join(legacyDir, 'web-frontend-overview.md'))).toBe(false);
|
|
890
961
|
});
|
|
891
962
|
});
|
|
892
963
|
});
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
/package/templates/platform-engineering/{.cursorrules → .cursor/rules}/developer-experience.md
RENAMED
|
File without changes
|