Skip to content

Commit 01b6afa

Browse files
committed
introduced uv por dependency and hanlde groups for aces
1 parent c9251f4 commit 01b6afa

35 files changed

Lines changed: 1940 additions & 466 deletions
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
alwaysApply: false
2+
description: "Consult the BloodHound MCP documentation whenever you need BloodHound-specific details."
3+
examples:
4+
applies:
5+
- "Before implementing or debugging Cypher queries for BloodHound CE or Legacy."
6+
- "When verifying API endpoints, relationship semantics, or query limitations."
7+
doesNotApply:
8+
- "Generic Python refactors unrelated to BloodHound features."
9+
---
10+
# BloodHound MCP Usage
11+
12+
Follow this rule whenever a task involves BloodHound query syntax, API behaviour, or feature constraints.
13+
14+
## Required Actions
15+
16+
- Use the BloodHound MCP knowledge base as the first source of truth for queries, relationship types, API endpoints, and feature support.
17+
- When in doubt about Cypher syntax, supported constructs, or REST contract details, open the MCP resource and confirm instead of relying on memory.
18+
- Document relevant findings (query shapes, limitations) in the code comments or README if they influence implementation decisions.
19+
20+
## Additional Notes
21+
22+
- Prefer examples from MCP docs to craft or validate `MATCH`, `WHERE`, and relationship traversal clauses.
23+
- If information is missing from MCP, call it out explicitly in the response and request clarification or gather manual evidence (e.g. via testing).
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
---
2+
description: Apply when adding or modifying configuration for the CLI (environment variables, .env files, python-dotenv usage).
3+
alwaysApply: false
4+
---
5+
- Store secrets and environment-specific values in `.env` files kept out of version control (see `.env.example` for keys to maintain).
6+
- Model configuration with `pydantic-settings` so CLI options, environment variables, and `.env` files are validated automatically.
7+
- Centralise configuration loading in a single module (for example `core/settings.py`) and reuse those settings across commands.
8+
- Document any new environment variable in `README.md` and update `.env.example` accordingly.
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
---
2+
description: Apply when adding or upgrading Python dependencies so environments stay consistent via uv.
3+
alwaysApply: false
4+
---
5+
- Use `uv` for every dependency operation: `uv pip install <pkg>`, `uv pip compile`, and `uv sync` (no plain `pip`).
6+
- Keep lockfiles updated by running `uv pip compile pyproject.toml --output-file requirements.lock` when dependencies change.
7+
- Document new dependencies in `README.md` (Dependencies section) with the command used to install them.

.cursor/rules/error-checks.mdc

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
---
2+
description: Apply after completing Python code changes to ensure lint checks pass.
3+
alwaysApply: false
4+
---
5+
- After completing Python changes, run `uv run ruff check` and `uv run pylint src/bloodhound_cli` before marking the task complete.
6+
- Record any intentional lint suppressions inline with a comment explaining why they are safe.
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
---
2+
description: Apply when touching error handling or logging in the CLI to ensure consistent context-rich logs.
3+
alwaysApply: false
4+
---
5+
- Wrap external I/O (network, filesystem, subprocess) in explicit try/except blocks; bubble up unexpected exceptions after logging.
6+
- Configure and reuse `structlog` for logging (see `src/bloodhound_cli/core/logging_utils.py` once added) and log at `error` level with contextual identifiers (command, entity ids, API endpoint).
7+
- When recovering from an exception, include the original exception message with `exc_info=True` (or `structlog`'s `exception()` helper) to preserve the traceback.
8+
- Add structured context (dict-style fields) so logs can be filtered; avoid bare `print` for error paths, and only fall back to Rich console output for user-facing summaries.
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
---
2+
description: Applies when editing or refactoring Python CLI modules under `src/bloodhound_cli` and related tooling.
3+
alwaysApply: false
4+
---
5+
- Before changing code, inspect existing modules in `src/bloodhound_cli` to understand current patterns and reuse shared helpers where possible.
6+
- Default to writing composable functions and classes with clear responsibilities; avoid monolithic scripts.
7+
- Automate repetitive CLI tasks by extending the tooling under `scripts/` rather than adding ad-hoc shell commands in docs or comments.
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
---
2+
description: Apply when creating or reorganising files so the project keeps source, tests, docs, and config separated.
3+
alwaysApply: false
4+
---
5+
- Keep runtime code under `src/bloodhound_cli/`, tests under `tests/`, documentation under `docs/`, and configuration under `.cursor/` or `config/`.
6+
- When introducing a new module, add matching tests in `tests/` and update package `__init__.py` files to expose public APIs intentionally.
7+
- Avoid placing executable scripts in the project root; add them to `scripts/` with an explanatory README entry.
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
---
2+
description: Apply when preparing Python code explanations or snippets so they remain clear for AI-assisted workflows.
3+
alwaysApply: false
4+
---
5+
- When sharing code in responses, include short context snippets plus an explanation of the intent before the snippet.
6+
- Use descriptive variable and function names that reflect domain concepts (e.g., `ace_result` instead of `data`).
7+
- Add type hints for function signatures and complex variables.
8+
- Comment non-trivial logic paths, focusing on the "why" rather than restating the code.
9+
- Raise or log errors with actionable context (input parameters, API endpoints, ids) to simplify triage.
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
---
2+
description: Apply when designing or restructuring Python modules to keep architecture modular, SRP-compliant, and DRY.
3+
alwaysApply: false
4+
---
5+
- Modular design with distinct files for models, services, controllers, and utilities.
6+
- Follow Single Responsibility Principle.
7+
- Follow DRY (Don't Repeat Yourself) Principle.
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
---
2+
description: Apply when formatting Python code so we stay aligned with Black, Pylint, and PEP 8 conventions.
3+
alwaysApply: false
4+
---
5+
- Use Black for code formatting.
6+
- Use Pylint for linting.
7+
- Follow PEP 8 and project-specific rules.

0 commit comments

Comments
 (0)