Skip to content

Keith-CY/idx.md / data

idx-md

Flagged

AgentSkill for https://idx.md. Use the index to locate AI agent library topics and fetch HEAD/BODY markdown.

FileKindSize
SKILL.mdskill md4.8 KB
agentskills-skill/BODY.mdmarkdown13.1 KB
agentskills-skill/HEAD.mdmarkdown792 B
agentskills-skill/vectors.jsonconfig1.2 KB
carmahhawwari-ui-design-brain-skill/BODY.mdmarkdown8.1 KB
carmahhawwari-ui-design-brain-skill/HEAD.mdmarkdown1.5 KB
carmahhawwari-ui-design-brain-skill/vectors.jsonconfig1.9 KB
category/ai-llms/index.mdmarkdown1.0 KB
category/calendar-scheduling/index.mdmarkdown1.1 KB
category/coding-agents-ides/index.mdmarkdown2.5 KB
category/communication/index.mdmarkdown9.7 KB
category/data-analytics/index.mdmarkdown10.8 KB
category/finance/index.mdmarkdown8.6 KB
category/git-github/index.mdmarkdown3.0 KB
category/index.mdmarkdown855 B
category/marketing-sales/index.mdmarkdown18.6 KB
category/productivity-tasks/index.mdmarkdown19.8 KB
category/search-research/index.mdmarkdown12.9 KB
category/security-passwords/index.mdmarkdown1.0 KB
category/transportation/index.mdmarkdown946 B
category/uncategorized/index.mdmarkdown495.2 KB
github-markup-readme/BODY.mdmarkdown3.3 KB
github-markup-readme/HEAD.mdmarkdown1.6 KB
github-markup-readme/vectors.jsonconfig2.0 KB
github-skill-actionbook-rust-skills-m04-zero-cost/BODY.mdmarkdown4.6 KB
github-skill-actionbook-rust-skills-m04-zero-cost/HEAD.mdmarkdown928 B
github-skill-actionbook-rust-skills-m04-zero-cost/vectors.jsonconfig1.6 KB
github-skill-agno-agi-agno-git-workflow-cdbf56f5/BODY.mdmarkdown2.2 KB
github-skill-agno-agi-agno-git-workflow-cdbf56f5/HEAD.mdmarkdown765 B
github-skill-agno-agi-agno-git-workflow-cdbf56f5/vectors.jsonconfig1.4 KB
github-skill-anthropics-knowledge-work-plugins-call-prep/BODY.mdmarkdown5.8 KB
github-skill-anthropics-knowledge-work-plugins-call-prep/HEAD.mdmarkdown987 B
github-skill-anthropics-knowledge-work-plugins-call-prep/vectors.jsonconfig1.7 KB
github-skill-composiohq-awesome-claude-skills-forcemanager-automation-185f86fa/BODY.mdmarkdown2.9 KB
github-skill-composiohq-awesome-claude-skills-forcemanager-automation-185f86fa/HEAD.mdmarkdown879 B
github-skill-composiohq-awesome-claude-skills-forcemanager-automation-185f86fa/vectors.jsonconfig1.7 KB
github-skill-composiohq-awesome-claude-skills-ip2location-io-automation-e171a20b/BODY.mdmarkdown3.0 KB
github-skill-composiohq-awesome-claude-skills-ip2location-io-automation-e171a20b/HEAD.mdmarkdown889 B
github-skill-composiohq-awesome-claude-skills-ip2location-io-automation-e171a20b/vectors.jsonconfig1.7 KB
github-skill-composiohq-awesome-claude-skills-kickbox-automation-3347ff5a/BODY.mdmarkdown2.9 KB
github-skill-composiohq-awesome-claude-skills-kickbox-automation-3347ff5a/HEAD.mdmarkdown854 B
github-skill-composiohq-awesome-claude-skills-kickbox-automation-3347ff5a/vectors.jsonconfig1.6 KB
github-skill-coreyhaines31-marketingskills-programmatic-seo/BODY.mdmarkdown7.2 KB
github-skill-coreyhaines31-marketingskills-programmatic-seo/HEAD.mdmarkdown1.0 KB
github-skill-coreyhaines31-marketingskills-programmatic-seo/vectors.jsonconfig1.8 KB
github-skill-darrenhinde-openagentscontrol-task-breakdown/BODY.mdmarkdown4.4 KB
github-skill-darrenhinde-openagentscontrol-task-breakdown/HEAD.mdmarkdown957 B
github-skill-darrenhinde-openagentscontrol-task-breakdown/vectors.jsonconfig1.7 KB
github-skill-davepoon-buildwithclaude-content-research-writer/BODY.mdmarkdown13.9 KB
github-skill-davepoon-buildwithclaude-content-research-writer/HEAD.mdmarkdown1004 B
github-skill-davepoon-buildwithclaude-content-research-writer/vectors.jsonconfig1.7 KB
github-skill-davila7-claude-code-templates-scientific-schematics/BODY.mdmarkdown23.2 KB
github-skill-davila7-claude-code-templates-scientific-schematics/HEAD.mdmarkdown1.1 KB
github-skill-davila7-claude-code-templates-scientific-schematics/vectors.jsonconfig1.9 KB
github-skill-davila7-claude-code-templates-writing-hookify-rules/BODY.mdmarkdown8.2 KB
github-skill-davila7-claude-code-templates-writing-hookify-rules/HEAD.mdmarkdown967 B
github-skill-davila7-claude-code-templates-writing-hookify-rules/vectors.jsonconfig1.7 KB
github-skill-deanpeters-product-manager-skills-pestel-analysis/BODY.mdmarkdown14.1 KB
github-skill-deanpeters-product-manager-skills-pestel-analysis/HEAD.mdmarkdown891 B
github-skill-deanpeters-product-manager-skills-pestel-analysis/vectors.jsonconfig1.6 KB
github-skill-dicklesworthstone-pi-agent-rust-deploying-monitoring-stacks/BODY.mdmarkdown3.9 KB
github-skill-dicklesworthstone-pi-agent-rust-deploying-monitoring-stacks/HEAD.mdmarkdown1.2 KB
github-skill-dicklesworthstone-pi-agent-rust-deploying-monitoring-stacks/vectors.jsonconfig2.0 KB
github-skill-dicklesworthstone-pi-agent-rust-websocket-client-creator/BODY.mdmarkdown2.2 KB
github-skill-dicklesworthstone-pi-agent-rust-websocket-client-creator/HEAD.mdmarkdown1.2 KB
github-skill-dicklesworthstone-pi-agent-rust-websocket-client-creator/vectors.jsonconfig2.0 KB
github-skill-dicklesworthstone-pi-agent-rust-windsurf-common-errors/BODY.mdmarkdown2.3 KB
github-skill-dicklesworthstone-pi-agent-rust-windsurf-common-errors/HEAD.mdmarkdown1.1 KB
github-skill-dicklesworthstone-pi-agent-rust-windsurf-common-errors/vectors.jsonconfig1.9 KB
github-skill-dlt-hub-dlt-review-pr/BODY.mdmarkdown8.7 KB
github-skill-dlt-hub-dlt-review-pr/HEAD.mdmarkdown713 B
github-skill-dlt-hub-dlt-review-pr/vectors.jsonconfig1.3 KB
github-skill-epicweb-dev-epic-stack-epic-ui-guidelines/BODY.mdmarkdown17.0 KB
github-skill-epicweb-dev-epic-stack-epic-ui-guidelines/HEAD.mdmarkdown768 B
github-skill-epicweb-dev-epic-stack-epic-ui-guidelines/vectors.jsonconfig1.5 KB
github-skill-florianbruniaux-claude-code-ultimate-guide-rtk-optimizer/BODY.mdmarkdown4.1 KB
github-skill-florianbruniaux-claude-code-ultimate-guide-rtk-optimizer/HEAD.mdmarkdown837 B
github-skill-florianbruniaux-claude-code-ultimate-guide-rtk-optimizer/vectors.jsonconfig1.6 KB
github-skill-github-awesome-copilot-copilot-instructions-blueprint-generator/BODY.mdmarkdown14.4 KB
github-skill-github-awesome-copilot-copilot-instructions-blueprint-generator/HEAD.mdmarkdown1.0 KB
github-skill-github-awesome-copilot-copilot-instructions-blueprint-generator/vectors.jsonconfig1.8 KB
github-skill-jeffallan-claude-skills-websocket-engineer/BODY.mdmarkdown6.4 KB
github-skill-jeffallan-claude-skills-websocket-engineer/HEAD.mdmarkdown872 B
github-skill-jeffallan-claude-skills-websocket-engineer/vectors.jsonconfig1.6 KB
github-skill-jeremylongshore-claude-code-plugins-plus-skills-ideogram-common-errors/BODY.mdmarkdown4.4 KB
github-skill-jeremylongshore-claude-code-plugins-plus-skills-ideogram-common-errors/HEAD.mdmarkdown1.1 KB
github-skill-jeremylongshore-claude-code-plugins-plus-skills-ideogram-common-errors/vectors.jsonconfig2.0 KB
github-skill-jeremylongshore-claude-code-plugins-plus-skills-juicebox-migration-deep-dive/BODY.mdmarkdown2.9 KB
github-skill-jeremylongshore-claude-code-plugins-plus-skills-juicebox-migration-deep-dive/HEAD.mdmarkdown1.2 KB
github-skill-jeremylongshore-claude-code-plugins-plus-skills-juicebox-migration-deep-dive/vectors.jsonconfig2.1 KB
github-skill-jeremylongshore-claude-code-plugins-plus-skills-klingai-pricing-basics/BODY.mdmarkdown7.1 KB
github-skill-jeremylongshore-claude-code-plugins-plus-skills-klingai-pricing-basics/HEAD.mdmarkdown1.1 KB
github-skill-jeremylongshore-claude-code-plugins-plus-skills-klingai-pricing-basics/vectors.jsonconfig1.9 KB
github-skill-jeremylongshore-claude-code-plugins-plus-skills-prisma-schema-helper/BODY.mdmarkdown2.2 KB
github-skill-jeremylongshore-claude-code-plugins-plus-skills-prisma-schema-helper/HEAD.mdmarkdown1.1 KB
github-skill-jeremylongshore-claude-code-plugins-plus-skills-prisma-schema-helper/vectors.jsonconfig2.0 KB
github-skill-jeremylongshore-claude-code-plugins-plus-skills-testing-load-balancers/BODY.mdmarkdown6.1 KB
github-skill-jeremylongshore-claude-code-plugins-plus-skills-testing-load-balancers/HEAD.mdmarkdown1.1 KB
github-skill-jeremylongshore-claude-code-plugins-plus-skills-testing-load-balancers/vectors.jsonconfig1.9 KB
github-skill-jeremylongshore-claude-code-plugins-plus-skills-twinmind-security-basics/BODY.mdmarkdown3.6 KB
github-skill-jeremylongshore-claude-code-plugins-plus-skills-twinmind-security-basics/HEAD.mdmarkdown1.2 KB
github-skill-jeremylongshore-claude-code-plugins-plus-skills-twinmind-security-basics/vectors.jsonconfig2.0 KB
github-skill-jeremylongshore-claude-code-plugins-plus-skills-vercel-upgrade-migration/BODY.mdmarkdown6.0 KB
github-skill-jeremylongshore-claude-code-plugins-plus-skills-vercel-upgrade-migration/HEAD.mdmarkdown1.2 KB
github-skill-jeremylongshore-claude-code-plugins-plus-skills-vercel-upgrade-migration/vectors.jsonconfig2.0 KB
github-skill-jeremylongshore-claude-code-plugins-plus-skills-websocket-client-creator/BODY.mdmarkdown2.3 KB
github-skill-jeremylongshore-claude-code-plugins-plus-skills-websocket-client-creator/HEAD.mdmarkdown1.2 KB
github-skill-jeremylongshore-claude-code-plugins-plus-skills-websocket-client-creator/vectors.jsonconfig2.0 KB
github-skill-kevoreilly-capev2-cape-sandbox-developer/BODY.mdmarkdown15.4 KB
github-skill-kevoreilly-capev2-cape-sandbox-developer/HEAD.mdmarkdown736 B
github-skill-kevoreilly-capev2-cape-sandbox-developer/vectors.jsonconfig1.4 KB
github-skill-kurtosis-tech-kurtosis-cluster-manage/BODY.mdmarkdown1.5 KB
github-skill-kurtosis-tech-kurtosis-cluster-manage/HEAD.mdmarkdown876 B
github-skill-kurtosis-tech-kurtosis-cluster-manage/vectors.jsonconfig1.5 KB
github-skill-luongnv89-claude-howto-brand-voice-consistency/BODY.mdmarkdown2.5 KB
github-skill-luongnv89-claude-howto-brand-voice-consistency/HEAD.mdmarkdown894 B
github-skill-luongnv89-claude-howto-brand-voice-consistency/vectors.jsonconfig1.6 KB
github-skill-mukul975-anthropic-cybersecurity-skills-analyzing-ransomware-leak-site-intelligence/BODY.mdmarkdown13.9 KB
github-skill-mukul975-anthropic-cybersecurity-skills-analyzing-ransomware-leak-site-intelligence/HEAD.mdmarkdown1.0 KB
github-skill-mukul975-anthropic-cybersecurity-skills-analyzing-ransomware-leak-site-intelligence/vectors.jsonconfig1.9 KB
github-skill-neolabhq-context-engineering-kit-sadd-multi-agent-patterns/BODY.mdmarkdown23.4 KB
github-skill-neolabhq-context-engineering-kit-sadd-multi-agent-patterns/HEAD.mdmarkdown973 B
github-skill-neolabhq-context-engineering-kit-sadd-multi-agent-patterns/vectors.jsonconfig1.7 KB
github-skill-novuhq-novu-react-email/BODY.mdmarkdown14.1 KB
github-skill-novuhq-novu-react-email/HEAD.mdmarkdown799 B
github-skill-novuhq-novu-react-email/vectors.jsonconfig1.4 KB
github-skill-onmax-nuxt-skills-nuxt-seo/BODY.mdmarkdown2.9 KB
github-skill-onmax-nuxt-skills-nuxt-seo/HEAD.mdmarkdown785 B
github-skill-onmax-nuxt-skills-nuxt-seo/vectors.jsonconfig1.4 KB
github-skill-openai-openai-agents-python-pr-draft-summary/BODY.mdmarkdown7.0 KB
github-skill-openai-openai-agents-python-pr-draft-summary/HEAD.mdmarkdown996 B
github-skill-openai-openai-agents-python-pr-draft-summary/vectors.jsonconfig1.7 KB
github-skill-openclaw-openclaw-gh-issues/BODY.mdmarkdown6.2 KB
github-skill-openclaw-openclaw-gh-issues/HEAD.mdmarkdown973 B
github-skill-openclaw-openclaw-gh-issues/vectors.jsonconfig1.6 KB
github-skill-prompt-security-clawsec-claw-release/BODY.mdmarkdown7.5 KB
github-skill-prompt-security-clawsec-claw-release/HEAD.mdmarkdown778 B
github-skill-prompt-security-clawsec-claw-release/vectors.jsonconfig1.4 KB
github-skill-quickwit-oss-quickwit-simple-pr/BODY.mdmarkdown2.3 KB
github-skill-quickwit-oss-quickwit-simple-pr/HEAD.mdmarkdown734 B
github-skill-quickwit-oss-quickwit-simple-pr/vectors.jsonconfig1.4 KB
github-skill-quickwit-oss-tantivy-simple-pr/BODY.mdmarkdown1.7 KB
github-skill-quickwit-oss-tantivy-simple-pr/HEAD.mdmarkdown730 B
github-skill-quickwit-oss-tantivy-simple-pr/vectors.jsonconfig1.4 KB
github-skill-resend-react-email-react-email/BODY.mdmarkdown14.1 KB
github-skill-resend-react-email-react-email/HEAD.mdmarkdown815 B
github-skill-resend-react-email-react-email/vectors.jsonconfig1.4 KB
github-skill-sickn33-antigravity-awesome-skills-hubspot-integration/BODY.mdmarkdown1.6 KB
github-skill-sickn33-antigravity-awesome-skills-hubspot-integration/HEAD.mdmarkdown940 B
github-skill-sickn33-antigravity-awesome-skills-hubspot-integration/vectors.jsonconfig1.7 KB
github-skill-sickn33-antigravity-awesome-skills-outlook-calendar-automation/BODY.mdmarkdown10.6 KB
github-skill-sickn33-antigravity-awesome-skills-outlook-calendar-automation/HEAD.mdmarkdown952 B
github-skill-sickn33-antigravity-awesome-skills-outlook-calendar-automation/vectors.jsonconfig1.7 KB
github-skill-sickn33-antigravity-awesome-skills-upstash-qstash/BODY.mdmarkdown1.4 KB
github-skill-sickn33-antigravity-awesome-skills-upstash-qstash/HEAD.mdmarkdown926 B
github-skill-sickn33-antigravity-awesome-skills-upstash-qstash/vectors.jsonconfig1.7 KB
github-skill-vllm-project-vllm-ascend-vllm-ascend-model-adapter/BODY.mdmarkdown8.5 KB
github-skill-vllm-project-vllm-ascend-vllm-ascend-model-adapter/HEAD.mdmarkdown968 B
github-skill-vllm-project-vllm-ascend-vllm-ascend-model-adapter/vectors.jsonconfig1.7 KB
github-skill-wavetermdev-waveterm-electron-api/BODY.mdmarkdown4.5 KB
github-skill-wavetermdev-waveterm-electron-api/HEAD.mdmarkdown803 B
github-skill-wavetermdev-waveterm-electron-api/vectors.jsonconfig1.5 KB
github-skill-zjunlp-skillnet-webshop-query-parser/BODY.mdmarkdown2.6 KB
github-skill-zjunlp-skillnet-webshop-query-parser/HEAD.mdmarkdown1.1 KB
github-skill-zjunlp-skillnet-webshop-query-parser/vectors.jsonconfig1.8 KB
ibelick-baseline-ui/BODY.mdmarkdown3.3 KB
ibelick-baseline-ui/HEAD.mdmarkdown957 B
ibelick-baseline-ui/vectors.jsonconfig1.4 KB
ibelick-fixing-accessibility/BODY.mdmarkdown4.6 KB
ibelick-fixing-accessibility/HEAD.mdmarkdown1.0 KB
ibelick-fixing-accessibility/vectors.jsonconfig1.5 KB
ibelick-fixing-metadata/BODY.mdmarkdown4.3 KB
ibelick-fixing-metadata/HEAD.mdmarkdown991 B
ibelick-fixing-metadata/vectors.jsonconfig1.4 KB
ibelick-fixing-motion-performance/BODY.mdmarkdown5.4 KB
ibelick-fixing-motion-performance/HEAD.mdmarkdown1.1 KB
ibelick-fixing-motion-performance/vectors.jsonconfig1.6 KB
index.mdmarkdown582.8 KB
industry/finance/index.mdmarkdown1.2 KB
industry/index.mdmarkdown169 B
industry/uncategorized/index.mdmarkdown145 B
knowledge-work-plugins-bio-research-skills-instrument-data-to-allotrope-skill/BODY.mdmarkdown10.5 KB
knowledge-work-plugins-bio-research-skills-instrument-data-to-allotrope-skill/HEAD.mdmarkdown1.3 KB
knowledge-work-plugins-bio-research-skills-instrument-data-to-allotrope-skill/vectors.jsonconfig2.1 KB
knowledge-work-plugins-bio-research-skills-nextflow-development-skill/BODY.mdmarkdown8.6 KB
knowledge-work-plugins-bio-research-skills-nextflow-development-skill/HEAD.mdmarkdown1.1 KB
knowledge-work-plugins-bio-research-skills-nextflow-development-skill/vectors.jsonconfig1.8 KB
knowledge-work-plugins-bio-research-skills-scientific-problem-selection-skill/BODY.mdmarkdown10.9 KB
knowledge-work-plugins-bio-research-skills-scientific-problem-selection-skill/HEAD.mdmarkdown1.3 KB
knowledge-work-plugins-bio-research-skills-scientific-problem-selection-skill/vectors.jsonconfig2.1 KB
knowledge-work-plugins-bio-research-skills-scvi-tools-skill/BODY.mdmarkdown7.2 KB
knowledge-work-plugins-bio-research-skills-scvi-tools-skill/HEAD.mdmarkdown1.4 KB
knowledge-work-plugins-bio-research-skills-scvi-tools-skill/vectors.jsonconfig2.1 KB
knowledge-work-plugins-bio-research-skills-single-cell-rna-qc-skill/BODY.mdmarkdown7.8 KB
knowledge-work-plugins-bio-research-skills-single-cell-rna-qc-skill/HEAD.mdmarkdown1.0 KB
knowledge-work-plugins-bio-research-skills-single-cell-rna-qc-skill/vectors.jsonconfig1.8 KB
knowledge-work-plugins-bio-research-skills-start-skill/BODY.mdmarkdown3.4 KB
knowledge-work-plugins-bio-research-skills-start-skill/HEAD.mdmarkdown963 B
knowledge-work-plugins-bio-research-skills-start-skill/vectors.jsonconfig1.6 KB
knowledge-work-plugins-cowork-plugin-management-skills-cowork-plugin-customizer-skill/BODY.mdmarkdown9.5 KB

github-skill-kevoreilly-capev2-cape-sandbox-developer/BODY.md

View on GitHub
---
name: cape-sandbox-developer
description: Comprehensive guide for architecture, development patterns, and advanced troubleshooting in CAPE Sandbox (v2).
---

# CAPE Sandbox Developer Skills & Architecture Guide

This document outlines the architectural structure, core concepts, and development patterns for the CAPE Sandbox (v2). It serves as a guide for extending functionality, debugging, and maintaining the codebase.

> **Agent Hint:** Use the referenced documentation files (`docs/book/src/...`) to dive deeper into specific topics.

## 1. Project Overview
CAPE (Config And Payload Extraction) is a malware analysis sandbox derived from Cuckoo Sandbox. It focuses on automated malware analysis with a specific emphasis on extracting payloads and configuration from malware.

*   **Ref:** `docs/book/src/introduction/what.rst`

**Core Tech Stack:**
- **Language:** Python 3
- **Web Framework:** Django
- **Database:** PostgreSQL (SQLAlchemy) for task management, MongoDB/Elasticsearch for results storage.
- **Virtualization:** KVM/QEMU (preferred), VirtualBox, VMWare, Azure, Google Cloud.
- **Frontend:** HTML5, Bootstrap, Jinja2 Templates.
- **Dependency Management:** uv (`.python-version` pinned to Python 3.14, `uv.lock`).

## 2. Directory Structure Key
| Directory | Purpose |
| :--- | :--- |
| `agent/` | Python script (`agent.py`) running *inside* the Guest VM to handle communication. |
| `analyzer/` | Core analysis components running *inside* the Guest VM (monitor, analyzers, packages). |
| `conf/` | Default configuration files. **Do not edit directly**; use `custom/conf/`. |
| `custom/conf/` | User overrides for configuration files. |
| `data/` | Static assets, yara rules, monitor binaries, and HTML templates (`data/html`). |
| `lib/cuckoo/` | Core logic (Scheduler, Database, Guest Manager, Result Processor). |
| `modules/` | Pluggable components (Signatures, Processing, Reporting, Auxiliary, Machinery). |
| `web/` | Django-based web interface (Views, URLs, Templates). |
| `utils/` | Standalone CLI utilities (`process.py`, `submit.py`, `rooter.py`, `community.py`). |

## 3. Core Workflows

### A. The Analysis Lifecycle
1.  **Submission:** User submits file/URL via WebUI (`web/submission/`) or API (`web/api/`).
    *   **Ref:** `docs/book/src/usage/submit.rst`, `docs/book/src/usage/api.rst`
2.  **Scheduling:** Task is added to SQL DB. `lib/cuckoo/core/scheduler.py` picks it up.
3.  **Infrastructure:** 
    *   `modules/machinery` starts the VM.
    *   `utils/rooter.py` configures network routing (if applicable).
    *   **Ref:** `docs/book/src/usage/rooter.rst`
4.  **Execution:**
    *   VM is restored/started.
    *   `analyzer` is uploaded to VM.
    *   Sample is injected/executed using specific **Analysis Packages** (`analyzer/windows/modules/packages/`).
        *   **Ref:** `docs/book/src/usage/packages.rst`
    *   Behavior is monitored via API hooking (CAPE Monitor).
    *   **Auxiliary Modules** (`modules/auxiliary/`) run in parallel on the Host (e.g., Sniffer).
5.  **Result Collection:** Logs, PCAP, and dropped files are transferred back to Host.
6.  **Processing:** `modules/processing/` parses raw logs into a structured dictionary (Global Container).
7.  **Signatures:** `modules/signatures/` runs logic against the processed data.
8.  **Reporting:** `modules/reporting/` exports data (JSON, HTML, MongoDB, MAEC).

## 4. Configuration Management
*   **Overrides:** Never edit files in `conf/` directly. Create a copy in `custom/conf/` with the same name.
*   **Environment Variables:** You can use env vars in configs: `%(ENV:VARIABLE_NAME)s`.
*   **Conf.d:** You can create directories like `custom/conf/reporting.conf.d/` and add `.conf` files there for granular overrides.
*   **Ref:** `docs/book/src/installation/host/configuration.rst`

## 5. Development Guides
*   **Coding Style:** See `docs/book/src/development/code_style.rst`

### Coding Standards (PEP 8+)
*   **Imports:** Explicit imports only (`from lib import a, b`). No `from lib import *`. Group standard library, 3rd party, and local imports.
*   **Strings:** Use double quotes (`"`) for strings. (This line was corrected from the original prompt to reflect the actual change needed for the example.)
*   **Logging:** Use `import logging; log = logging.getLogger(__name__)`. Do not use `print()`.
    *   Pass arguments lazily, `%`-style: `log.warning("Failed to parse %s: %s", url, err)`. Never pre-format the message (`log.warning(f"...")`, `"..." % x`, `"...".format()`, `+`): formatting is then paid even when the level is disabled, and the varying message breaks log grouping. Enforced by the ruff `G` rules (G001-G004) enabled in `pyproject.toml`.
*   **String formatting (non-logging):** Prefer f-strings for building values (`f"0x{n:x}"`, `f"{scheme}://{host}{path}"`) over `%` or `str.format()`.
*   **Type hints:** The project requires Python >= 3.10. Use builtin generics and PEP 604 unions (`dict[str, list[int]]`, `str | None`) instead of `typing.Dict`, `typing.List`, `typing.Optional`. `ruff check --target-version py310 --select UP006,UP035,UP045 --fix <files>` converts touched files.
*   **Exceptions:** Use custom exceptions from `lib/cuckoo/common/exceptions.py` (e.g., `CuckooOperationalError`).

### Local Development Environment

Dependencies are managed with **uv** (Python 3.14 via `.python-version`); the
test suite imports `sqlalchemy`, `django` and friends, so a system Python
without the project environment will fail at collection time in `tests/conftest.py`.

```bash
uv sync --locked --all-groups
uv run pytest tests/ -q
```

Use `uv run <cmd>` (or activate `.venv`) for *every* Python invocation -
`pytest`, `ruff`, `black`, `alembic`, `python utils/...`.

**Linting.** `ruff` is the fast gate and is expected to be clean:

```bash
uv run ruff check <changed files>
```

`black` and `ruff format` are configured with `line-length = 132` in
`pyproject.toml`. Some long-lived modules predate the current settings, so
`black --check` reports findings unrelated to your change. Format only the
lines you touched; reformatting a whole module turns a small fix into an
unreviewable diff.

**Tests.** Third-party dependencies emit several hundred deprecation warnings
that bury the result; `-p no:warnings` keeps the output readable:

```bash
uv run pytest tests/test_something.py -p no:warnings -q
```

### Isolated Checkouts for Review and Testing

Reviewing a PR or reproducing a bug against another branch should never
disturb your working clone - most clones carry uncommitted work, and
`git checkout` / `git stash` in the wrong directory loses it. Use
`utils/agent_worktree.py`, a thin wrapper over `git worktree` that handles the
PR plumbing. It is stdlib-only and repository-agnostic.

```bash
python utils/agent_worktree.py new --pr 3219      # resolve PR head via gh, fetch, branch, check out
python utils/agent_worktree.py new --branch topic # existing remote branch
python utils/agent_worktree.py new --from origin/master --name scratch

python utils/agent_worktree.py list               # flags: main / managed / dirty / pr#N
python utils/agent_worktree.py path pr3219        # for use in $(...)
python utils/agent_worktree.py update pr3219      # re-fetch after the author pushes
python utils/agent_worktree.py remove pr3219      # also drops the branch it created
python utils/agent_worktree.py cleanup            # remove every worktree it created
python utils/agent_worktree.py info               # repo, remotes, virtualenv, dirty state
```

`new --pr N` asks `gh` which fork the head branch lives in, fetches from the
matching remote (or straight from the fork URL if no remote is configured),
creates a local branch tracking it, and prints the path plus the project
virtualenv. Add `--json` to any command for scripted use.

Notes:

* Worktrees default to `~/.cache/agent-worktrees/<repo>/<name>`; override with
  `--base-dir`, `--path`, or `$AGENT_WORKTREE_DIR`.
* Only worktrees created by the tool are ever removed. They are tagged with an
  `agent-meta.json` inside the repository's git admin directory, so nothing
  extra shows up in `git status`.
* `remove` and `cleanup` refuse to discard uncommitted changes or unpushed
  commits; `cleanup` reports what it skipped and why. `--force` overrides.
* Worktrees do not contain their own `.venv` until synced. Run `uv run --project <main_clone>`
  or use the interpreter reported by `info`.

Tests live in `tests/test_agent_worktree.py` and run against throwaway local
repositories - no network, credentials or CAPE configuration required.

### Codebase Gotchas

Behaviours that regularly cause silent, hard-to-debug failures:

* **`lib/cuckoo/common/dictionary.py`** - `Dictionary.__getattr__` returns
  `None` for missing keys instead of raising. Consequently
  `getattr(section, "key", default)` **never applies its default**; use
  `section.get("key", default)`.
* **`lib/cuckoo/common/config.py`** - `_BaseConfig.get(section)` takes exactly
  one argument and raises `CuckooOperationalError` for an unknown section, so
  `conf.get(name, default)` is a `TypeError`, not a fallback. `Config` is
  cached per configuration file by its metaclass, so repeated
  `Config("processing")` calls are cheap.
* **`lib/cuckoo/common/integrations/utils.py`** - `run_tool()` returns
  **stdout only**. Callers that need stderr must pass
  `stderr=subprocess.PIPE` themselves.
* **`lib/cuckoo/common/integrations/file_extra_info_modules/__init__.py`** -
  `extractor_ctx()` wraps extractors in `except Exception: log.exception(...)`.
  A `TypeError` or `NameError` therefore surfaces as an empty result rather
  than a crash; check the log before assuming the logic is wrong.
* Broad `except Exception` around encode/decode helpers hides missing
  module-level imports, which then look like a working fallback path. Verify
  the import exists.

### How to Add a Detection Signature
Signatures live in `modules/signatures/`.
*   **Ref:** `docs/book/src/customization/signatures.rst`

```python
from lib.cuckoo.common.abstracts import Signature

class MyMalware(Signature):
    name = "my_malware_behavior"
    description = "Detects specific bad behavior"
    severity = 3
    categories = ["trojan"]
    authors = ["You"]
    minimum = "2.0"

    def run(self):
        # Helper methods: check_file, check_key, check_mutex, check_api, check_ip, check_domain
        return self.check_file(pattern=".*evil\\.exe$", regex=True)
    
    # For performance, use evented signatures (on_call) for high-volume API checks
    # evented = True
    # def on_call(self, call, process): ...
```

### How to Add a Processing Module
Processing modules (`modules/processing/`) run after analysis to extract specific data.
*   **Ref:** `docs/book/src/customization/processing.rst`

```python
from lib.cuckoo.common.abstracts import Processing

class MyExtractor(Processing):
    def run(self):
        self.key = "my_data" # Key in the final report JSON
        result = {}
        # Access raw data via self.analysis_path, self.log_path, etc.
        return result
```

### How to Add a Reporting Module
Reporting modules (`modules/reporting/`) consume the processed data (Global Container).
*   **Ref:** `docs/book/src/customization/reporting.rst`

```python
from lib.cuckoo.common.abstracts import Report
from lib.cuckoo.common.exceptions import CuckooReportError

class MyReport(Report):
    def run(self, results):
        # 'results' is the big dictionary containing all processed data
        try:
            # Write to file or database
            pass
        except Exception as e:
            raise CuckooReportError(f"Failed to report: {e}")
```

### How to Add a Machinery Module
Machinery modules (`modules/machinery/`) control the virtualization layer.
*   **Ref:** `docs/book/src/customization/machinery.rst`

```python
from lib.cuckoo.common.abstracts import Machinery
from lib.cuckoo.common.exceptions import CuckooMachineError

class MyHypervisor(Machinery):
    def start(self, label):
        # Start the VM
        pass

    def stop(self, label):
        # Stop the VM
        pass
```

### How to Add an Analysis Package
Packages (`analyzer/windows/modules/packages/`) define how to execute the sample inside the VM.
*   **Ref:** `docs/book/src/customization/packages.rst`

```python
from lib.common.abstracts import Package

class MyPackage(Package):
    def start(self, path):
        args = self.options.get("arguments")
        # 'execute' handles injection and monitoring
        return self.execute(path, args, suspended=False)
```

## 6. Best Practices

### Web & UI
1.  **Conditionally Render:** Always check if a dictionary key exists in templates (`{% if analysis.key %}`) before rendering to avoid UI breaks on different analysis types (Static vs Dynamic).
2.  **Keep Views Light:** Perform heavy data crunching in `modules/processing`, not in Django views.
3.  **Modular CSS/JS:** Keep custom styles in `web/static/` rather than inline in templates when possible.

### Performance
1.  **Evented Signatures:** Use `evented = True` and `on_call()` in signatures to process API calls in a single loop instead of iterating the whole log multiple times.
2.  **Ram-boost:** Enable `ram_boost` in `processing.conf` behavior section to keep API logs in memory if the Host has >20GB RAM.
3.  **Disable Unused Reports:** Disable heavy reporting modules (e.g., HTML, MAEC) in `reporting.conf` if not strictly needed for automation.

### Security
1.  **Guest Isolation:** Always use static IPs and consider isolated/host-only networks. Disable noisy services (LLMNR, Teredo) in Guest to reduce PCAP noise.
2.  **Stealth:** Use the `no-stealth` option sparingly. CAPE's anti-anti-VM features are enabled by default and are critical for modern malware.

## 7. Troubleshooting & Debugging
*   **Ref:** `docs/book/src/Issues/Debugging_VM_issues.rst` (VM hangs, High CPU)
*   **Ref:** `docs/book/src/installation/guest/troubleshooting.rst` (Network, Agent issues)

### Common Issues
*   **"Waiting for container":** Check `conf/cuckoo.conf` (IPs) or network configuration. Ensure `cape-rooter` is running if routing is enabled.
*   **VM Stuck/Hanging:**
    *   Check `ps aux | grep qemu` or `grep python`.
    *   **100% CPU:** Livelock.
    *   **0% CPU:** Waiting for I/O (likely network or agent).
    *   Check `lib/cuckoo/core/guest.py` timeouts.
*   **Permissions:** Ensure `cape` user owns the directories and files.
*   **Database Migrations:** If DB errors occur, run `cd utils/db_migration && uv run --no-sync alembic upgrade head`.

### Advanced Debugging (py-spy)
If the Python controller is unresponsive, use `py-spy` to inspect the stack trace without stopping the process:
1.  **Install:** `pip install py-spy`
2.  **Dump:** `sudo py-spy dump --pid <PYTHON_PID>`
3.  **Analyze:** Look for `wait_for_completion` (waiting for Guest/Agent) or network calls like `select`, `poll`, `recv` that may be blocked.

### Important Commands
*   **Start CAPE:** `sudo -u cape uv run --no-sync python cuckoo.py`
*   **Debug Mode:** `sudo -u cape uv run --no-sync python cuckoo.py -d`
*   **Reprocess Task:** `sudo -u cape uv run --no-sync python utils/process.py -r <task_id>`
*   **Clean All:** `sudo -u cape uv run --no-sync python utils/cleaners.py --clean` (Destructive!)
*   **Download Signatures:** `sudo -u cape uv run --no-sync python utils/community.py -waf`
*   **Test Rooter:** `sudo uv run --no-sync python utils/rooter.py -g cape -v`
*   **Check Out a PR Safely:** `python utils/agent_worktree.py new --pr <pr_id>` (isolated worktree; your clone is untouched)

### Database Querying (MongoDB)
CAPE stores unstructured analysis results in the `analysis` collection.
```bash
mongo cuckoo
db.analysis.find({"info.id": 123}, {"behavior.summary": 1}).pretty()
```
reverse-engineer-anythingmorluto/reaReverse engineer native, managed, Electron/JavaScript, packaged, firmware, and browser targets with REA, and build agent environments (AgentEnv bundles) of web applications from a live instance or a capture, and of Linux desktop apps with a task from a request. Use shipped-artifact or requested runtime evidence to explain features, compare versions, decompile code, or guide a reconstruction. Skip REA for ordinary source-repository architecture analysis.Stars: 472kUpdated Claude CodeCodexVerifiedInstall
diagnosing-superpowersobra/superpowersUse when a superpowers session went wrong and your human partner wants to know why — repeated work, ignored plans, stumbles, poor results, a skill that didn't fire, "it took too long", "why is it so expensive", "what is it doing" — or wants to build a bug report for the superpowers maintainers, for the current session or a past one identified by id or path, on any harness.Stars: 322kUpdated Claude CodeCodexVerifiedInstall
dispatching-parallel-agentsobra/superpowersUse when facing 2+ independent tasks that can be worked on without shared state or sequential dependenciesStars: 322kUpdated Claude CodeCodexVerifiedInstall
executing-plansobra/superpowersUse when executing an implementation plan in the current session as the implementer yourself — your human partner chose inline execution, or no subagent tool is availableStars: 322kUpdated Claude CodeCodexVerifiedInstall