You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: CONTRIBUTING.md
+63
Original file line number
Diff line number
Diff line change
@@ -41,6 +41,69 @@ vibesafe scan ./test-project
41
41
42
42
If you're improving output formats or adding rules, try --output and --report modes to check formatting.
43
43
44
+
## Codebase Overview
45
+
46
+
This repository contains a TypeScript-based CLI tool named VibeSafe. It scans Node/JavaScript projects for a variety of security issues and can check packages before installing them. The key features—secret scanning, dependency vulnerability checks, configuration inspection, upload validation, endpoint exposure detection, rate-limit heuristics, logging analysis, HTTP client checks, and optional AI suggestions—are summarized in the README.
Defined with Commander in `src/index.ts`. The `scan` command accepts optional output/report flags and supports `--high-only` filtering. The `install` command performs heuristic checks before running `npm install`.
62
+
63
+
### File Traversal
64
+
`src/utils/fileTraversal.ts` loads ignore patterns (including `.vibesafeignore`) and walks the directory tree while checking `.gitignore` for common secrets.
65
+
66
+
### Scanners
67
+
Located in `src/scanners/`. Each scanner returns a list of findings with a severity level. Examples include:
68
+
69
+
***Secrets** – Regex/entropy scanning with special handling for `.env` files.
70
+
***Dependencies** – Detects package managers, parses manifests, and queries the OSV database for CVEs.
71
+
***Configuration, Uploads, Endpoints, Rate Limiting, Logging, and HTTP Client scanners** each analyze code or configs for specific issues.
72
+
73
+
### Reporting
74
+
Markdown report generation with optional OpenAI-powered suggestions is in `src/reporting/markdown.ts` and `src/reporting/aiSuggestions.ts` (if AI suggestions are implemented).
75
+
76
+
### Installer Heuristics
77
+
`src/installer/heuristicChecks.ts` checks package age, download counts, README quality, license presence, and repository links to warn about suspicious packages.
78
+
79
+
### Usage
80
+
81
+
The README shows typical commands:
82
+
83
+
```bash
84
+
vibesafe scan
85
+
vibesafe scan ./path/to/project
86
+
vibesafe scan -r scan-report.md # Markdown report
87
+
vibesafe scan --high-only # Only high severity issues
88
+
```
89
+
90
+
For installation checks:
91
+
92
+
```bash
93
+
vibesafe install <package-name>
94
+
```
95
+
which runs age/download/license heuristics and prompts before installing.
96
+
97
+
### Next Steps for Learning
98
+
99
+
1.**Understand each scanner.** Explore `src/scanners/` to see how patterns are detected (regex, AST parsing via `@typescript-eslint`).
100
+
2.**Review the file traversal logic** to learn how `.vibesafeignore` and `.gitignore` rules are applied.
101
+
3.**Examine the installer heuristics** to see how package metadata is fetched and analyzed.
102
+
4.**Build and run locally** (`npm run build` then `npm link`) to test the CLI on the provided `test-data` projects.
103
+
5.**Check TODOs in the code** for areas under development: e.g., full lockfile parsing in dependency scanning and additional heuristics in the installer.
104
+
105
+
The repository offers a modular foundation for a security-focused CLI, and diving into each scanner will help you understand how to extend or refine VibeSafe's checks.
106
+
44
107
## 📛 Brand Reminder
45
108
The name VibeSafe™ is a trademark of Secret Society LLC.
46
109
Forks and derivative tools are welcome under the MIT License, but please use a different name and logo for your project.
0 commit comments