Skip to content

Commit 703fff4

Browse files
committed
update contributing.md with a basi get to know the project section
1 parent bb6662b commit 703fff4

File tree

1 file changed

+63
-0
lines changed

1 file changed

+63
-0
lines changed

CONTRIBUTING.md

+63
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,69 @@ vibesafe scan ./test-project
4141

4242
If you're improving output formats or adding rules, try --output and --report modes to check formatting.
4343

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.
47+
48+
### Project Structure
49+
50+
```
51+
src/
52+
├── index.ts # CLI entry point
53+
├── scanners/ # Individual scanners (secrets, dependencies, config, etc.)
54+
├── reporting/ # Markdown/AI report generation
55+
├── installer/ # "vibesafe install" helpers
56+
├── utils/ # File traversal & ignore handling
57+
test-data/ # Sample projects/files for testing
58+
```
59+
60+
### CLI Commands
61+
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+
44107
## 📛 Brand Reminder
45108
The name VibeSafe™ is a trademark of Secret Society LLC.
46109
Forks and derivative tools are welcome under the MIT License, but please use a different name and logo for your project.

0 commit comments

Comments
 (0)