Skip to content

Commit 91d221b

Browse files
help me please
1 parent 2351301 commit 91d221b

File tree

4 files changed

+177
-0
lines changed

4 files changed

+177
-0
lines changed

.cursor/rules/01-core.rule

Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
// Core Project Context and Principles
2+
description "walkerOS core principles and context"
3+
4+
# Core Principles and Guidelines
5+
6+
## Overview
7+
8+
This document outlines the core principles and guidelines for the walkerOS project, focusing on package interaction, event processing, and overall project goals.
9+
10+
## Package Interaction and Event Processing
11+
12+
### Types Package
13+
- **Purpose:** Provides a unified typing system to ensure consistency across all packages.
14+
- **Guideline:** All packages must use the types defined here to ensure seamless integration and consistent data structures.
15+
16+
### Utils Package
17+
- **Purpose:** Contains shared utility functions to avoid code duplication.
18+
- **Guideline:** Utilize functions from this package to maintain standardized and reliable implementations across packages.
19+
20+
### Sources Package
21+
- **Purpose:** Designed for specific environments to create and manage `WalkerOS.Events`.
22+
- **Guideline:** Sources must handle state management, initialize triggers, manage consent, and enrich event context. Events should be sent to destinations using the `push` function.
23+
24+
### Destinations Package
25+
- **Purpose:** Receives and processes events, potentially translating them for third-party tools.
26+
- **Guideline:** Implement the `push` interface to receive events in the `WalkerOS.Events` format and process them according to the destination's requirements.
27+
28+
## Event Schema and Structure
29+
30+
- **Schema Influence:** Follow the descriptive framework provided in `event-model.mdx` for understanding the purpose and meaning of each event key.
31+
- **Dynamic Creation:** Use `eventGenerator.ts` as a reference for creating events that reflect real-world scenarios.
32+
33+
## Integration and Interaction
34+
35+
- **Consistency:** Ensure all packages use the `types` package to maintain a consistent structure.
36+
- **Event Flow:** Events should be created in sources, configured, and then sent to destinations for processing.
37+
38+
## Specific Format Requirements
39+
40+
- **Standardization:** Events must be created in the `WalkerOS.Events` format to allow for standardized processing, mapping, and validation.
41+
- **Rules and Constraints:** Adhere to the defined types to ensure proper event creation and processing.
42+
43+
## Core Principles
44+
45+
- **Type Safety:** Never use the `any` type; explicit typing is required to ensure type safety.
46+
- **Efficiency:** Write lean, efficient code with minimal dependencies.
47+
- **Best Practices:** Follow the DRY principle and ensure full test coverage.
48+
- **Environment Separation:** Maintain clear separation between web and node environments.
49+
- **Adaptability:** Be open to adapting new technologies and methodologies.
50+
51+
## Expertise and Focus
52+
53+
- **Role:** Senior TypeScript Developer
54+
- **Expertise Areas:**
55+
- Data collection systems
56+
- Event handling
57+
- Type safety
58+
- Performance optimization
59+
- Critical thinking
60+
61+
## Conclusion
62+
63+
By following these guidelines, the system will maintain a high level of consistency, reliability, and flexibility, ensuring that events are accurately created, processed, and utilized across different environments and tools.

.cursor/rules/02-packages.rule

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
// Package Structure and Organization
2+
description "walkerOS package organization and naming conventions"
3+
4+
# Package Structure and Organization
5+
6+
## Overview
7+
8+
This document provides guidelines for the organization and naming conventions of packages within the walkerOS project, ensuring clarity and consistency.
9+
10+
## Package Naming Conventions
11+
12+
- **walker.js:** `packages/sources/walkerjs/`
13+
- **Web Destinations:** `packages/destinations/web/*`
14+
- **Node Destinations:** `packages/destinations/node/*`
15+
- **Web Sources:** `packages/sources/web/*`
16+
- **Node Sources:** `packages/sources/node/*`
17+
- **Utils:** `packages/utils`
18+
- **Types:** `packages/types`
19+
20+
## Rules and Guidelines
21+
22+
### Environment Separation
23+
- **Path:** `packages/**/src/**/*.ts`
24+
- **Guideline:** Maintain clear separation between web and node code. Use only available environment APIs.
25+
26+
### Utils Organization
27+
- **Path:** `packages/utils/**/*.ts`
28+
- **Guideline:** Separate utils into `code/`, `web/`, and `node/` folders. Check for shared patterns before implementing new utilities.
29+
30+
### Interdependencies
31+
- **Path:** `packages/*`
32+
- **Guideline:** Document interdependencies and shared utilities. Ensure compatibility across packages.
33+
34+
## Conclusion
35+
36+
By adhering to these guidelines, the walkerOS project will maintain a well-organized and consistent package structure, facilitating easier maintenance and development.

.cursor/rules/03-priorities.rule

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
// File Priorities and Patterns
2+
description "Priority levels for different file types"
3+
4+
# File Priorities and Patterns
5+
6+
## Overview
7+
8+
This document outlines the priority levels assigned to different file types within the project, ensuring that critical files receive the attention they deserve.
9+
10+
## High Priority (1.0-0.9)
11+
12+
### Core Type Definitions
13+
- **Path:** `packages/types/src/**/*.ts`
14+
- **Priority:** 1.0
15+
- **Guideline:** These files contain core type definitions. It's crucial to avoid using the `any` type to maintain type safety and consistency.
16+
17+
### Package Source Code
18+
- **Path:** `packages/*/src/**/*.{ts,tsx}`
19+
- **Priority:** 0.9
20+
- **Guideline:** Source code for packages should have explicit typing to ensure clarity and maintainability.
21+
22+
## Medium Priority (0.7-0.6)
23+
24+
### Package Functionality Tests
25+
- **Path:** `packages/*/__tests__/**/*.{ts,tsx}`
26+
- **Priority:** 0.7
27+
- **Guideline:** Focus on testing package functionality rather than granular function testing to ensure comprehensive coverage.
28+
29+
## Lower Priority (0.4)
30+
31+
### Shared Configurations
32+
- **Path:** `packages/config/**/*`
33+
- **Priority:** 0.4
34+
- **Guideline:** These files contain shared configurations and are less critical than core type definitions and source code.
35+
36+
## Exclusions
37+
38+
- **Paths:**
39+
- `**/.turbo/**`
40+
- `**/dist/**`
41+
- `**/node_modules/**`
42+
- `**/coverage/**`
43+
- `**/*.log`
44+
- `**/*.map`
45+
- **Guideline:** These paths are excluded from priority considerations as they contain generated or non-essential files.

.cursor/rules/04-standards.rule

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
// Code and Documentation Standards
2+
description "walkerOS coding and documentation standards"
3+
4+
# Overview
5+
6+
This document provides the coding and documentation standards to be followed across the walkerOS project, ensuring consistency and quality.
7+
8+
## Coding Standards
9+
10+
- **Type Definitions:** Start with proper type definitions from `@elbwalker/types` to ensure type safety.
11+
- **Shared Functionality:** Check the `utils` package before implementing new shared functionality to avoid duplication.
12+
- **Testing Focus:** Focus on package functionality in tests to ensure comprehensive coverage.
13+
- **Implementation Preference:** Prefer vanilla implementations over external dependencies to reduce complexity.
14+
- **Coding Patterns:** Include examples of preferred coding patterns to guide developers.
15+
16+
## Documentation Standards
17+
18+
- **README Files:** Maintain `README.md` files for package context, including purpose, usage examples, and API documentation.
19+
- **Usage Examples:** Include usage examples in documentation to aid understanding.
20+
- **Type Documentation:** Document type definitions thoroughly to ensure clarity.
21+
- **Data Flow Explanation:** Explain complex data flow patterns to provide insight into system operations.
22+
- **Documentation Styles:** Provide examples of documentation styles to maintain consistency.
23+
24+
## Patterns
25+
26+
### README Files
27+
- **Path:** `packages/*/README.md`
28+
- **Enforcement:** Include package purpose, usage examples, and API documentation.
29+
30+
### Source Files
31+
- **Path:** `packages/*/src/**/*.ts`
32+
- **Enforcement:** Include JSDoc comments for public APIs.
33+
- **Validation:** No `any` types allowed to maintain type safety.

0 commit comments

Comments
 (0)