Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
34 commits
Select commit Hold shift + click to select a range
d6c5b44
Initial plan
Copilot Dec 31, 2025
9ae0621
Add SmartBrain orchestrator, GitAntivirus workflow, and comprehensive…
Copilot Dec 31, 2025
2924de6
Add PR summary and final validation
Copilot Dec 31, 2025
eb0a9bf
Add branch information documentation
Copilot Dec 31, 2025
b1b6d6d
Update docs/SMARTBRAIN.md
SolanaRemix Jan 8, 2026
48150c9
Update scripts/master.sh
SolanaRemix Jan 8, 2026
d8b8b17
Update .github/workflows/gitantivirus.yml
SolanaRemix Jan 8, 2026
9a0c96a
Update scripts/master.sh
SolanaRemix Jan 8, 2026
362dcb7
Update .github/bots/agent-x-antivirus.json
SolanaRemix Jan 8, 2026
35edaef
Update scripts/master.sh
SolanaRemix Jan 8, 2026
01c977b
Update .github/bots/agent-b-healer.json
SolanaRemix Jan 8, 2026
a86f950
Update scripts/master.sh
SolanaRemix Jan 8, 2026
f5a8bbf
Add portable date format and DRY_RUN check to port cleanup, remove un…
Copilot Jan 8, 2026
0225a73
Fix regex pattern: remove unnecessary backslash before backtick in ev…
Copilot Jan 8, 2026
6aae776
Update master.sh
SolanaRemix Mar 4, 2026
cf02ce6
Update SMARTBRAIN.md
SolanaRemix Mar 4, 2026
9cfc52d
Update SECURITY.md
SolanaRemix Mar 4, 2026
dcae5e4
Update README.md
SolanaRemix Mar 4, 2026
3c24c26
Update master.sh
SolanaRemix Mar 4, 2026
b8eb7ce
Update gitantivirus.yml
SolanaRemix Mar 4, 2026
3571434
Update master.sh
SolanaRemix Mar 5, 2026
09f30de
Update gitantivirus.yml
SolanaRemix Mar 5, 2026
89c7186
Update audit.sh
SolanaRemix Mar 5, 2026
feadd07
Update master.sh
SolanaRemix Mar 5, 2026
318bc9f
Update gitantivirus.yml
SolanaRemix Mar 5, 2026
da80d9e
Pin pnpm version to 8.15.0 consistently across all workflow jobs
Copilot Mar 5, 2026
a23f1cf
Make cmd_scan return non-zero on findings and remove continue-on-erro…
Copilot Mar 5, 2026
b617061
Update SECURITY.md
SolanaRemix Mar 5, 2026
8abaeec
Update master.sh
SolanaRemix Mar 5, 2026
496b929
Update README.md
SolanaRemix Mar 5, 2026
95cd09b
Update audit.sh
SolanaRemix Mar 5, 2026
fad20b3
Update SMARTBRAIN.md
SolanaRemix Mar 5, 2026
cf6b0aa
Clear quarantine files at scan start to prevent duplicate accumulation
Copilot Mar 5, 2026
aaa0c84
Make health/integrity checks skip gracefully when package.json missin…
Copilot Mar 5, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
302 changes: 302 additions & 0 deletions .github/ONBOARDING/DEVELOPMENT.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,302 @@
# Developer Setup Guide

This guide provides detailed setup instructions for developers contributing to SmartContractAudit.

## Environment Setup

### 1. System Requirements

- **Operating System**: Linux, macOS, or WSL2 on Windows
- **Node.js**: Version 18.x or higher
- **pnpm**: Version 8.x or higher
- **Git**: Version 2.x or higher
- **RAM**: Minimum 4GB, recommended 8GB+
- **Disk Space**: At least 2GB free

### 2. Install Required Tools

#### Install Node.js
```bash
# Using nvm (recommended)
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.0/install.sh | bash
nvm install 18
nvm use 18

# Or download from https://nodejs.org/
```

#### Install pnpm
```bash
npm install -g pnpm
```

#### Verify installations
```bash
node --version # Should show v18.x or higher
pnpm --version # Should show 8.x or higher
git --version # Should show 2.x or higher
```

### 3. Clone and Setup Repository

```bash
# Clone repository
git clone https://github.com/SolanaRemix/SmartContractAudit.git
cd SmartContractAudit

# Install dependencies
pnpm install

# Make scripts executable
chmod +x scripts/*.sh
```

### 4. Verify Setup

```bash
# Run health check
scripts/master.sh health

# Run a test scan
scripts/master.sh scan

# Check logs
cat SMARTBRAIN.log
```

## Development Workflow

### Branch Strategy

We follow a Git Flow inspired workflow:

```
main # Production-ready code
├── develop # Integration branch
├── gitantivirus-node # GitAntivirus feature branch
└── feature/* # Feature branches
```

### Creating a Feature Branch

```bash
# Update main
git checkout main
git pull origin main

# Create feature branch
git checkout -b feature/your-feature-name

# Make changes...

# Run pre-commit checks
scripts/master.sh health
scripts/master.sh scan
```

### Commit Guidelines

Follow conventional commits:

```
feat: add new antivirus pattern detection
fix: resolve port cleanup issue on macOS
docs: update onboarding guide
chore: update dependencies
test: add unit tests for Agent X
refactor: improve SmartBrain logging
```

### Pull Request Process

1. **Before Creating PR**:
```bash
# Run full audit
scripts/master.sh audit

# Ensure tests pass
pnpm test

# Check linting
pnpm lint
```

2. **Create PR**:
- Use descriptive title following conventional commits
- Fill out PR template completely
- Link related issues
- Add labels appropriately

3. **PR Checks**:
- GitAntivirus workflow must pass
- Health checks must succeed
- Code review approval required
- No merge conflicts

## Testing

### Running Tests

```bash
# Run all tests
pnpm test

# Run tests in watch mode
pnpm test:watch

# Run tests with coverage
pnpm test:coverage

# Run specific test file
pnpm test path/to/test.spec.ts
```

### Writing Tests

Follow existing test patterns:

```typescript
import { describe, it, expect } from 'vitest';

describe('SmartBrain Agent', () => {
it('should run in DRY_RUN mode by default', () => {
const config = loadConfig();
expect(config.dryRun).toBe(true);
});
});
```

## Debugging

### SmartBrain Logs

All agent activities are logged to `SMARTBRAIN.log`:

```bash
# Tail logs in real-time
tail -f SMARTBRAIN.log

# Search for errors
grep ERROR SMARTBRAIN.log

# Filter by agent
grep "AgentX" SMARTBRAIN.log
```

### Quarantine Directory

Suspicious files are quarantined:

```bash
# List quarantined files
ls -la .quarantine/

# View suspicious files list
cat .quarantine/suspicious-files.txt

# Review archives
cat .quarantine/archives-review.txt
```

### Debug Mode

Enable debug output:

```bash
# Set debug environment variable
export DEBUG=smartbrain:*

# Run with verbose logging
scripts/master.sh scan
```

## IDE Setup

### Visual Studio Code

Recommended extensions:
- ESLint
- Prettier
- GitLens
- Error Lens
- TypeScript Vue Plugin (if applicable)

### Settings

Add to `.vscode/settings.json`:

```json
{
"editor.formatOnSave": true,
"editor.defaultFormatter": "esbenp.prettier-vscode",
"eslint.validate": ["javascript", "typescript"],
"typescript.tsdk": "node_modules/typescript/lib"
}
```

## Troubleshooting

### Common Issues

#### Port Already in Use
```bash
# Clean up ports manually
scripts/master.sh heal

# Or kill specific port
lsof -ti:3000 | xargs kill
```

#### Dependencies Out of Sync
```bash
# Clean and reinstall
rm -rf node_modules pnpm-lock.yaml
pnpm install
```

#### Permission Denied on Scripts
```bash
# Make all scripts executable
chmod +x scripts/*.sh
```

#### SMARTBRAIN.log Growing Large
```bash
# Rotate log file
mv SMARTBRAIN.log SMARTBRAIN.log.old
touch SMARTBRAIN.log
```

### Getting Help

1. Check `SMARTBRAIN.log` for detailed error messages
2. Review `.quarantine/` for security-related issues
3. Search existing GitHub issues
4. Ask in team communication channels
5. Create a new issue with reproduction steps

## Performance Tips

1. **Use pnpm**: Faster than npm, saves disk space
2. **Parallel builds**: Enabled by default in `master.sh`
3. **Cache**: pnpm uses content-addressable storage
4. **Frozen lockfile**: Speeds up CI/CD installations

## Security Best Practices

1. **Never commit secrets**: Use environment variables
2. **Review quarantine reports**: Check all flagged files
3. **Keep dependencies updated**: Run `pnpm update` regularly
4. **Run scans frequently**: Use `scripts/master.sh scan`
5. **Follow DRY_RUN principle**: Test before deploying

## Next Steps

- Review [WELCOME.md](WELCOME.md) for project overview
- Read [SECURITY.md](SECURITY.md) for security guidelines
Copy link

Copilot AI Mar 5, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The “Next Steps” link to SECURITY.md is broken (there is no SECURITY.md in .github/ONBOARDING/). It should link to the actual security policy at ../../docs/SECURITY.md (or an appropriate root-relative path).

Suggested change
- Read [SECURITY.md](SECURITY.md) for security guidelines
- Read [SECURITY.md](../../docs/SECURITY.md) for security guidelines

Copilot uses AI. Check for mistakes.
- Check [../bots/README.md](../bots/README.md) for BOT configurations
- Join the team and start contributing!

---

**Need help?** Open an issue or reach out to the maintainers.
Loading