Markdown Converter
Agent skill for markdown-converter
This document provides instructions for AI coding assistants (GitHub Copilot, Cursor, Claude Code, etc.) working on the VideoStream project. These guidelines ensure consistent code quality, proper workflow adherence, and maintainable contributions.
Sign in to like and favorite skills
This document provides instructions for AI coding assistants (GitHub Copilot, Cursor, Claude Code, etc.) working on the VideoStream project. These guidelines ensure consistent code quality, proper workflow adherence, and maintainable contributions.
Version: 2.0 Last Updated: 2025-11-22 Applies To: EdgeFirst VideoStream Library
EdgeFirst VideoStream Library provides video I/O capabilities for embedded Linux applications, including camera capture, hardware encoding, and inter-process frame sharing.
When contributing to VideoStream, AI assistants should prioritize:
Branch:
feature/EDGEAI-###-description or bugfix/EDGEAI-###-description
Commit: EDGEAI-###: Brief description (50-72 chars, what changed not how)
PR: main=2 approvals, develop=1. Link JIRA ticket, ensure CI passes.
License Policy: ✅ MIT/Apache/BSD | ⚠️ LGPL (dynamic only) | ❌ GPL/AGPL Coverage: 70% minimum, 80%+ for core modules (lib/host.c, lib/client.c, lib/frame.c) Output: ❌ NEVER filter build/test/sbom with head/tail/grep | ✅ Use tee for long output
BANNED: Changing directories during command execution
❌ NEVER DO THIS:
cd build && cmake .. cd tests && pytest
✅ ALWAYS DO THIS:
cmake -S . -B build -DCMAKE_BUILD_TYPE=Release cmake --build build -j$(nproc) pytest tests/
Why: AI context doesn't reliably track current directory. Stay in project root, use paths.
❌ NEVER DO THIS:
pip install package python script.py pytest tests/
✅ ALWAYS DO THIS:
venv/bin/pip install package venv/bin/python script.py venv/bin/pytest tests/
Setup:
python3 -m venv venv venv/bin/pip install -r requirements.txt
# env.sh contains ephemeral tokens (<48h lifespan) - NEVER commit! [ -f env.sh ] && source env.sh venv/bin/pytest tests/ # Or use make test (handles venv + env.sh automatically) make test
Security: ✅ Ephemeral tokens | ❌ NEVER commit env.sh | ❌ NO passwords
BANNED: Using head, tail, grep to hide output that users need to monitor
❌ NEVER DO THIS:
make test | head -20 cmake --build build 2>&1 | grep -i error make sbom | tail -10 venv/bin/pytest tests/ | grep PASSED
✅ ALWAYS DO THIS:
# Show full output for commands users need to monitor make test cmake --build build make sbom venv/bin/pytest tests/ # For very long output, capture to file for review make test 2>&1 | tee test-output.log cmake --build build 2>&1 | tee build-output.log
Exception: Fast parsing commands are OK:
# Quick version checks - OK to filter grep "VSL_VERSION" include/videostream.h cat pyproject.toml | grep "^version"
Why:
What counts as "non-trivial":
Format:
<type>/EDGEAI-###[-description]
Types:
feature/ - New featuresbugfix/ - Bug fixeshotfix/ - Critical fixesExamples:
feature/EDGEAI-123-add-dmabuf-support bugfix/EDGEAI-456-fix-memory-leak
Format:
EDGEAI-###: Brief description
Good commits:
EDGEAI-123: Add DmaBuf support for zero-copy frame sharing EDGEAI-456: Fix memory leak in frame pool cleanup
C11:
-Wall -Wextra -Werrormake format)Rust:
cargo fmtcargo clippy -- -D warnings (make lint)Python:
Edge AI constraints:
# Using make (recommended - handles venv + env.sh + library path) make test # Manual (requires setup) [ -f env.sh ] && source env.sh source venv/bin/activate export VIDEOSTREAM_LIBRARY=./build/libvideostream.so.1 pytest tests/
Test files:
tests/test_frame.py - Frame lifecycletests/test_ipc.py - IPC protocoltests/test_host.py - Host-side managementtests/test_client.py - Client-side acquisitionMIT, Apache-2.0, BSD-2/3, ISC, 0BSD, Unlicense, Public Domain
LGPL (dynamic linking only - NEVER static) MPL-2.0 (external dependencies only)
GPL (any version), AGPL, SSPL, Commons Clause
# REQUIRED before release make sbom
CI/CD automatically blocks GPL/AGPL violations.
Email:
[email protected] (Subject: "Security Vulnerability - VideoStream")
Input Validation:
Credentials:
DmaBuf Security:
Pattern: Host/Client IPC with event-driven frame sharing
Layers:
Threading:
Error handling: Negative errno values (e.g., -EINVAL), 0 for success
See ARCHITECTURE.md for details.
IMPORTANT: Use modern CMake workflow - stay in project root.
# Build (Debug) cmake -S . -B build -DCMAKE_BUILD_TYPE=Debug cmake --build build -j$(nproc) # Build (Release) cmake -S . -B build -DCMAKE_BUILD_TYPE=Release cmake --build build -j$(nproc) # Run tests make test # Format code make format # Lint code make lint # Generate SBOM make sbom # Verify version consistency make verify-version # Generate PDF documentation make doc # All pre-release checks make pre-release # Cross-compile for ARM64 source /opt/fsl-imx-xwayland/5.4-zeus/environment-setup-aarch64-poky-linux cmake -S . -B build-arm64 -DCMAKE_BUILD_TYPE=Release cmake --build build-arm64 -j$(nproc) # Install cmake --install build # Clean make clean
CMake Options:
-DENABLE_GSTREAMER=ON/OFF - Build GStreamer plugins (default: ON)-DENABLE_DMABUF=ON/OFF - Enable DmaBuf support (default: ON on Linux)-DENABLE_G2D=ON/OFF - Enable G2D acceleration (default: ON on Linux)-DENABLE_VPU=ON/OFF - Enable VPU encode/decode (default: ON on Linux)-DBUILD_TESTING=ON/OFF - Build test suite (default: OFF)-DENABLE_COVER=ON/OFF - Enable code coverage (default: OFF)NXP i.MX8M Plus:
Critical paths:
Supported:
Acceleration:
Platform quirks:
/dev/dma_heap/system on Linux 5.6+video groupCRITICAL: VideoStream uses manual release requiring version sync across 6 files.
Cargo.toml - version = "X.Y.Z"include/videostream.h - #define VSL_VERSION "X.Y.Z"pyproject.toml - version = "X.Y.Z"doc/conf.py - version = 'X.Y.Z' (single quotes!)debian/changelog - videostream (X.Y.Z-1) stableCHANGELOG.md - ## [X.Y.Z] - YYYY-MM-DDNote:
CMakeLists.txt parses from include/videostream.h automatically.
Step 1: Pre-release checks
make pre-release # Runs: format, lint, verify-version, test, sbom
Step 2: Determine version
Step 3: Update CHANGELOG.md
## [Unreleased] to new versionStep 4: Update ALL 6 version files
make verify-version
Step 5: Commit
git commit -a -m "Prepare Version X.Y.Z - Updated all version files to X.Y.Z - Finalized CHANGELOG.md - See CHANGELOG.md for details" git push origin main
Step 6: Wait for CI/CD (all green checkmarks)
Step 7: Tag and push
# v prefix REQUIRED to trigger release workflow git tag -a -m "Version X.Y.Z" vX.Y.Z git push origin vX.Y.Z
❌ Forgetting to update all 6 version files ❌ Tagging before CI/CD passes ❌ Missing
v prefix on tag
❌ Running tests without venv or library path
❌ Using cd commands
❌ Filtering output of build/test/sbom commands
✅ Run
make pre-release, wait for CI, tag with vX.Y.Z
Verify:
Avoid:
cd commands (stay in root)Remember: Review all AI-generated code thoroughly. YOU are the author, AI is a tool.
Documentation:
Support: [email protected]
v2.0 | 2025-11-22 | EdgeFirst VideoStream Library
This file helps AI assistants contribute effectively to VideoStream while maintaining quality, security, and consistency.