shaian4000/shaian4000-first-assistant icon
public
Published on 6/2/2025
My First Assistant

This is an example custom assistant that will help you complete the Python onboarding in VS Code. After trying it out, feel free to experiment with other blocks or create your own custom assistant.

Rules
Prompts
Models
Context
relace Relace Instant Apply model icon

Relace Instant Apply

relace

40kinput·32koutput
anthropic Claude 3.7 Sonnet model icon

Claude 3.7 Sonnet

anthropic

200kinput·8.192koutput
anthropic Claude 3.5 Haiku model icon

Claude 3.5 Haiku

anthropic

200kinput·8.192koutput
mistral Codestral model icon

Codestral

mistral

voyage Voyage AI rerank-2 model icon

Voyage AI rerank-2

voyage

voyage voyage-code-3 model icon

voyage-code-3

voyage

anthropic Claude 4 Sonnet model icon

Claude 4 Sonnet

anthropic

200kinput·64koutput
openai OpenAI GPT-4o Mini model icon

OpenAI GPT-4o Mini

OpenAI

128kinput·16.384koutput
# Continue Extension Rules for Embedded C Development

## Build & Development Commands
- Always use `make clean && make` for full rebuilds to avoid stale object files
- Use `make flash` or `make program` for deploying to target hardware
- Include `make debug` commands that generate debug symbols (-g flag) and disable optimizations (-O0)
- Set up cross-compilation toolchain commands (arm-none-eabi-gcc, avr-gcc, etc.) based on target MCU
- Use `make size` to check binary size against flash/RAM constraints
- Include static analysis commands: `cppcheck --enable=all src/`, `pc-lint`, or `splint`
- Set up MISRA-C compliance checking commands when applicable
- Use `objdump -d` for disassembly analysis and `nm` for symbol table inspection
- Include commands for generating map files to analyze memory usage
- Set up automated builds with different optimization levels (-Os, -O2, -O3)

## Testing Guidelines
- Write unit tests using Unity, CppUTest, or similar embedded-friendly frameworks
- Test on actual hardware, not just simulation - "it works on my simulator" isn't enough
- Create mock HAL (Hardware Abstraction Layer) functions for testing hardware-dependent code
- Test boundary conditions: maximum/minimum values, buffer overflows, timeout scenarios
- Use hardware-in-the-loop (HIL) testing for critical real-time functions
- Test interrupt service routines (ISRs) for timing constraints and reentrancy
- Validate memory usage doesn't exceed stack/heap limits using tools like Valgrind or static analysis
- Test power consumption scenarios and sleep/wake cycles
- Create stress tests that run for extended periods to catch memory leaks or stack overflow
- Test with different compiler optimization levels to catch optimization-related bugs

## Code Style & Guidelines
- Follow MISRA-C guidelines for safety-critical applications
- Use explicit integer types: `uint8_t`, `int16_t`, `uint32_t` instead of `int`, `char`
- Declare variables at the smallest possible scope
- Use `const` keyword extensively for read-only data and function parameters
- Avoid dynamic memory allocation (`malloc`, `free`) - use static allocation
- Keep functions small and single-purpose (max 50 lines recommended)
- Use meaningful variable names: `timer_count` not `tc`, `sensor_data` not `sd`
- Initialize all variables at declaration: `uint8_t status = 0;`
- Use `volatile` for variables accessed by interrupts or hardware registers
- Prefer bit manipulation over arithmetic: `flag |= (1 << BIT_POS)` instead of `flag += pow(2, BIT_POS)`
- Use `#define` for constants and bit masks: `#define LED_PIN (1 << 5)`
- Implement defensive programming: check function parameters, return values
- Use consistent indentation (4 spaces) and brace placement
- Limit line length to 80-100 characters for readability
- Use header guards or `#pragma once` in all header files

## Documentation Guidelines
- Document all public functions with purpose, parameters, return values, and side effects
- Include timing requirements and constraints in function documentation
- Document interrupt priorities and timing-critical sections
- Maintain a memory map document showing RAM/Flash usage
- Document pin assignments and hardware connections
- Include power consumption estimates for different operational modes
- Document communication protocols (UART, SPI, I2C) with timing diagrams
- Maintain a register map for custom peripherals or complex configurations
- Document calibration procedures and factory default values
- Include example usage code in header file comments
- Document known limitations, workarounds, and hardware errata
- Use Doxygen-style comments for automatic documentation generation:
  ```c
  /**
   * @brief Initializes the ADC peripheral
   * @param[in] channel ADC channel to configure (0-7)
   * @param[in] resolution ADC resolution in bits (8, 10, 12)
   * @return 0 on success, -1 on error
   * @note This function must be called before any ADC operations
   * @warning Calling this function disables all ADC interrupts
   */
  ```
- Include revision history and change logs in source file headers
- Document any assembly language sections with clear explanations
Pythonhttps://docs.python.org/3/

Prompts

Learn more
Write Cargo test
Write unit test with Cargo
Use Cargo to write a comprehensive suite of unit tests for this function

Context

Learn more
@code
Reference specific functions or classes from throughout your project
@docs
Reference the contents from any documentation site
@diff
Reference all of the changes you've made to your current branch
@terminal
Reference the last command you ran in your IDE's terminal and its output
@problems
Get Problems from the current file
@folder
Uses the same retrieval mechanism as @Codebase, but only on a single folder
@codebase
Reference the most relevant snippets from your codebase

No Data configured

MCP Servers

Learn more

No MCP Servers configured