-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.windsurfrules
89 lines (77 loc) · 2.38 KB
/
.windsurfrules
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
# Essex AI Assistant Guidelines
## Project Identity
Essex is a Rust-based Docker project template generator focused on consistency and best practices.
## Code Style Requirements
1. ALWAYS enforce these Rust formatting rules:
```toml
# .rustfmt.toml settings
max_width = 100
hard_tabs = false
tab_spaces = 4
newline_style = "Auto"
use_small_heuristics = "Default"
reorder_imports = true
reorder_modules = true
remove_nested_parens = true
edition = "2021"
merge_derives = true
use_field_init_shorthand = true
use_try_shorthand = true
force_explicit_abi = true
```
2. ALWAYS enforce these Clippy rules via RUSTFLAGS:
```bash
RUSTFLAGS="-D warnings -D clippy::redundant-pattern-matching -D clippy::needless-borrows-for-generic-args"
```
## Development Rules
1. NEVER skip running these checks before committing:
- `cargo fmt --all -- --check`
- `cargo clippy` with required RUSTFLAGS
- `cargo test`
2. ALWAYS maintain these standards:
- Write tests before implementing features (TDD)
- Keep backward compatibility with existing templates
- Follow idiomatic Rust patterns
- Match cargo version with git tags for releases
3. ALWAYS follow these Docker best practices:
- Use multi-stage builds
- Include OCI labels
- Run as non-root user
- Provide comprehensive documentation
## Template Rules
1. ALWAYS include these components in generated projects:
- Dockerfile with best practices
- Makefile for Docker operations
- README.md
- runtime-assets directory
2. ALWAYS support these template variables:
- repo_username
- repo_namespace
- image_name
- vendor
- version
- build_date
- vcs_ref
## Documentation Rules
1. ALWAYS update documentation when:
- Adding new features
- Modifying template variables
- Changing project structure
- Updating dependencies
2. ALWAYS maintain these files:
- README.md for project overview
- CONTRIBUTING.md for development guidelines
- Template-specific documentation
## Error Handling Rules
1. ALWAYS provide:
- Clear error messages
- Proper error types
- Recovery suggestions
- Debug information when appropriate
## Testing Rules
1. ALWAYS verify:
- Template generation with various parameters
- Docker build success for generated projects
- Makefile functionality
- Unit test coverage
- Integration test coverage