|
| 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. |
0 commit comments