Skip to content

Commit acfb011

Browse files
author
Lee Chagolla-Christensen
committed
dev guide claude code instructions
1 parent 15370c2 commit acfb011

1 file changed

Lines changed: 62 additions & 2 deletions

File tree

libs/file_enrichment_modules/DEVELOPMENT_GUIDE.md

Lines changed: 62 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ This guide covers how to create new enrichment modules for Nemesis. Enrichment m
44

55
There are two ways to build a new module:
66

7-
- **Manual (hard mode):** Follow the sections below to understand the module structure, implement the protocol, and wire up testing yourself. Best for learning how things work under the hood.
7+
- **Manual:** Follow the sections below to understand the module structure, implement the protocol, and wire up testing yourself. Best for learning how things work under the hood.
88
- **Claude Code skill (easy mode):** Run the `/new-enrichment-module` skill in Claude Code to get a guided, interactive workflow that handles scaffolding, library selection, implementation, and testing. Jump to [Quick Start with Claude Code](#quick-start-with-claude-code) to get started.
99

1010
## Table of Contents
@@ -16,7 +16,8 @@ There are two ways to build a new module:
1616
5. [Finding Categories & Severity](#finding-categories--severity)
1717
6. [Common Patterns](#common-patterns)
1818
7. [Testing](#testing)
19-
8. [Reference Modules](#reference-modules)
19+
8. [Quick Start with Claude Code](#quick-start-with-claude-code)
20+
9. [Reference Modules](#reference-modules)
2021

2122
---
2223

@@ -491,6 +492,65 @@ uv run python -m nemesis_cli.main submit --file /path/to/sample
491492

492493
---
493494

495+
## Quick Start with Claude Code
496+
497+
If you have [Claude Code](https://docs.anthropic.com/en/docs/claude-code) available or another coding AI agent, the `/new-enrichment-module` skill provides a guided workflow that handles design, implementation, and testing.
498+
499+
### Usage
500+
501+
Launch Claude Code from the Nemesis project root and run:
502+
503+
```
504+
/new-enrichment-module <description of file type to support>
505+
```
506+
507+
Examples:
508+
509+
```
510+
/new-enrichment-module Windows Prefetch files (.pf)
511+
/new-enrichment-module SSH private keys (RSA, ECDSA, Ed25519)
512+
/new-enrichment-module macOS Keychain database files
513+
/new-enrichment-module KeePass database files (.kdbx)
514+
```
515+
516+
### What the Skill Does
517+
518+
The skill walks through 8 steps, pausing at review gates for your input:
519+
520+
| Step | What Happens | Review Gate? |
521+
|------|-------------|:------------:|
522+
| 1. Problem Analysis | Gathers requirements about target file types and data to extract | |
523+
| 2. Output Mode | Choose Findings, Parsing-Only, or Hybrid mode | Yes |
524+
| 3. Library Research | Searches for and evaluates parsing libraries | Yes |
525+
| 4. Sample File | Obtain or generate a test file | Yes |
526+
| 5. Detection Strategy | Builds `should_process()` using magic types, extensions, YARA, etc. | |
527+
| 6. Implementation | Creates `analyzer.py`, `pyproject.toml`, and `rules.yar` as needed | |
528+
| 7. Standalone Tests | Writes and runs unit tests using the test harness | |
529+
| 8. Integration Test | Submits the test file to a running Nemesis instance and verifies results | Yes |
530+
531+
The review gates let you steer library choices, output format, and test file selection before the skill commits to an approach.
532+
533+
### Prerequisites
534+
535+
For the full workflow including integration testing (step 8), start Nemesis in development mode first:
536+
537+
```bash
538+
./tools/nemesis-ctl.sh start dev
539+
```
540+
541+
The skill can still scaffold and unit-test a module without Nemesis running, but the final integration test requires a live instance.
542+
543+
### Output
544+
545+
When complete, the skill produces a ready-to-use module at `libs/file_enrichment_modules/file_enrichment_modules/{module_name}/` with:
546+
547+
- `analyzer.py` — Full module implementation with `should_process()` and `process()`
548+
- `pyproject.toml` — Created if the module needs dependencies beyond the base package
549+
- `rules.yar` — Created if the detection strategy uses YARA rules
550+
- Unit tests in `tests/` using the test harness
551+
552+
---
553+
494554
## Reference Modules
495555

496556
These modules demonstrate the major patterns:

0 commit comments

Comments
 (0)