Guidelines for AI assistants (Claude, Cursor, Gemini, etc.) when working on this project.
SecDevAI is an AI-powered security code review tool that integrates with Cursor, Claude Code, and Gemini CLI. It deploys a Lola AI Context Module containing security skills and security context such as OWASP/WSTG patterns into project directories, enabling slash-command-driven security analysis from within AI coding assistants.
# Install for development
uv pip install -e ".[dev]"
# Run all tests
python -m pytest
# Run a single test class
python -m pytest tests/test_module_deployer.py::TestDetectPlatforms
# Run a single test
python -m pytest tests/test_cli.py::TestInitCommand::test_init_copies_lola_module -v
# Lint
ruff check src/ tests/
# Format
ruff format src/ tests/
# Install CLI tool locally for manual testing
uv tool install --no-cache .
secdevai --help-
CLI (
src/secdevai_cli/__init__.py) -- A Typer app with a singleinitcommand. TheModuleDeployerclass copies the entirelola-module/tree into platform-specific directories (.cursor/,.claude/,.gemini/) in a target project. For Gemini CLI,.mdfiles undercommands/are converted to.tomlformat. Shell scripts get+xpermissions. -
Lola Module (
lola-module/skills/) -- The actual security content delivered to projects. Each skill has aSKILL.mdfollowing the Agent Skills pattern. The module follows the Lola pattern for cross-assistant distribution.
/secdevai dispatches to sub-skills (expandable):
secdevai-review-- Security review using OWASP Top 10 and WSTG patterns (context files incontext/)secdevai-fix-- Apply fixes with explicit user approvalsecdevai-tool-- Run external toolssecdevai-oci-image-security-- Scan OCI/container images for CVEs and misconfigurationssecdevai-export-- Export findings to Markdown/SARIF viascripts/results_exporter.pysecdevai-help-- Show available commands
The CLI finds lola-module/ via hatchling shared-data: {sysconfig.get_path("data")}/share/secdevai/lola-module. This works across uv run, uv tool install, uvx, and pip install.
ModuleDeployer.detect_platforms() checks for .cursor/, .claude/, .gemini/ directories in the target. If none exist, defaults to ["cursor", "claude"].
Tests use pytest with typer.testing.CliRunner. The conftest.py provides three fixtures:
lola_module_dir-- reallola-module/from project root (integration tests skip if absent)fake_lola_module-- minimal in-memory structure for isolated unit teststarget_project-- temp directory simulating a user project
The CLI's _find_module_dir is patched in most tests since sysconfig paths differ in test environments.
Since init is the only @app.command(), Typer auto-delegates: invoke as runner.invoke(app, [project_path]) not ["init", project_path].
- Python 3.11+, ruff with line-length 100, rules: E, F, I, N, W
- Bash scripts:
set -euo pipefail, portable across macOS/Linux - Skill files:
SKILL.md(uppercase), commands/scripts:kebab-case - Security patterns in context files use Python examples; AI adapts to the reviewed language at runtime