- Code structure:
crates/rs162: Core library with AIS message decoding (types 1-27), NMEA parsing, and DSP pipeline (demodulation, filters, sample rate adaptation)crates/ship162: Full-featured application with TUI, source handling and state management
- Feature flags such as
mqtt,pluto,rtlsdr,soapycontrol the supported data sources for the library/application. Unless explicitly asked, always run Cargo commands with--all-features. - Code quality:
- Always use
--all-targets. - Run
cargo clippywith-- -D warnings. - Run
cargo testwith--docand--workspaceif applicable. - Formatting: Run
cargo fmt --all
- Always use
- Markdown: use
prettierfor formatting documentation and markdown files. Follow CommonMark specification. - Decoding specifications and test data:
crates/rs162/data/ais_nmea.txt: nmea sentences for testing parserscrates/rs162/data/ais_96k.bin: iq data for testing demodulators
- Rustdoc: run with
RUSTDOCFLAGS="-D rustdoc::all -A rustdoc::private-doc-tests" cargo doc --all-features --no-deps
- Use descriptive variable names (e.g.,
mmsi,speed_over_ground,latitude) - Prefer declarative deku attributes for binary decoding
- Document public APIs with
///doc comments - Use
tracingfor logging, notprintln! - Handle errors with
Result<T, E>, avoid unwrap in library code - Use
#[must_use]for important return values
- Ensure latest commmit on master has no failing CI actions
cargo release [patch,minor]
master: Main development branch (protected)- Feature branches:
feature/descriptionorfix/issue-number - Always create PRs for review, never push directly to master
IMPORTANT:
- Never commit without explicit user approval
- If the user gives you approval for one commit, do not commit again later without explicit user approval.
- Always ask for confirmation before creating commits
- If fixing a GitHub issue, create a dedicated branch and PR
Conventional Commit message format:
type: brief description (imperative mood)
Optional longer explanation of what changed and why.
Fixes #123
Opening issues:
# Never open issues without user acknowledgement
gh issue create --title "Title" --body "Description"Analyzing issues:
# Always read ALL comments before planning
gh issue view 123
gh issue view 123 --commentsCreating pull requests:
# After user approves commits
gh pr create --title "Title" --body "Description"
# Link to issue
gh pr create --title "Fix altitude bug" --body "Fixes #123"Update changelog after fixing issues
-
Always use
plan.mdto track complex tasks -
Update frequently as you work through tasks
-
CRITICAL: Always include a final task item reminding yourself to get user approval before committing
-
Structure:
## Current task: [Brief description] - [ ] Step 1 - [ ] Step 2 - [x] Completed step - [ ] ⚠️ STOP: Get explicit user approval before committing ## Next: - Future tasks
-
Prune completed tasks after commits are merged
- Understand the requirement - Read issue, analyze code context
- Plan steps - Break into discrete, testable units (always include "Get user approval before committing" as final step)
- Execute incrementally - Small commits, test frequently
- Verify - Run tests, check lints, update docs
- Review - Self-review changes before proposing to user
⚠️ Get explicit user approval - NEVER commit without asking first
- Test thoroughly before proposing changes
- Document breaking changes clearly in PRs