|
| 1 | +# CodeQL Development Toolkit Repository Instructions |
| 2 | + |
| 3 | +## Project Overview |
| 4 | + |
| 5 | +The CodeQL Development Toolkit (QLT) is a command-line tool for CodeQL query development, testing, and automation. It provides scaffolding, lifecycle management, and CI/CD integration for CodeQL projects. |
| 6 | + |
| 7 | +## Repository Structure |
| 8 | + |
| 9 | +- `src/CodeQLToolkit.Core/` - Main CLI application entry point |
| 10 | +- `src/CodeQLToolkit.Features/` - Feature implementations (Query, Test, Bundle, Validation) |
| 11 | +- `src/CodeQLToolkit.Shared/` - Shared utilities, configuration, and base classes |
| 12 | +- `test/` - Unit tests for each component |
| 13 | +- `.github/workflows/` - CI/CD workflows for building and testing |
| 14 | +- `.github/actions/` - Reusable actions for CodeQL and QLT installation |
| 15 | + |
| 16 | +## Key Dependencies |
| 17 | + |
| 18 | +- **.NET 6.0+**: Primary development framework |
| 19 | +- **System.CommandLine**: CLI framework for command parsing |
| 20 | +- **Scriban**: Liquid template engine for code generation |
| 21 | +- **Newtonsoft.Json**: JSON serialization for configuration |
| 22 | +- **NUnit**: Testing framework |
| 23 | + |
| 24 | +## Development Workflow |
| 25 | + |
| 26 | +1. **Building**: Use `dotnet build` and `dotnet restore` |
| 27 | +2. **Testing**: Use `dotnet test` for unit tests |
| 28 | +3. **CLI Usage**: The main executable is `qlt` with features: query, test, bundle, validation, pack, codeql |
| 29 | + |
| 30 | +## Feature Architecture |
| 31 | + |
| 32 | +Each feature follows a consistent pattern: |
| 33 | +- `*FeatureMain.cs` - Feature registration and command setup |
| 34 | +- `Commands/` - Command implementations |
| 35 | +- `Lifecycle/` - Automation lifecycle targets |
| 36 | +- `Templates/` - Liquid templates for file generation |
| 37 | + |
| 38 | +## Automation Types |
| 39 | + |
| 40 | +The toolkit supports multiple automation platforms: |
| 41 | +- **Actions**: GitHub Actions integration |
| 42 | +- **Local**: Local development workflows |
| 43 | + |
| 44 | +## Configuration |
| 45 | + |
| 46 | +- `qlt.conf.json` - Project configuration file |
| 47 | +- Environment variables and CLI options for runtime configuration |
| 48 | +- Template-based configuration file generation |
| 49 | + |
| 50 | +## Contributing Guidelines |
| 51 | + |
| 52 | +- Follow existing code patterns and conventions |
| 53 | +- Add unit tests for new functionality |
| 54 | +- Update documentation for user-facing changes |
| 55 | +- Ensure compatibility with existing workflows |
| 56 | +- Test changes against sample CodeQL projects |
| 57 | + |
| 58 | +## CLI Command Structure |
| 59 | + |
| 60 | +``` |
| 61 | +qlt <feature> <action> [options] |
| 62 | +``` |
| 63 | + |
| 64 | +Features: query, test, bundle, validation, pack, codeql |
| 65 | +Common actions: init, create, validate, run |
0 commit comments