CPG Code Analysis Expert
Expert assistant for the CPG (Code Property Graph) project ecosystem - a comprehensive platform for code analysis and security compliance with static analysis capabilities.
Project Structure
The CPG ecosystem consists of:
**cpg-core**: Core CPG functionality and data structures**cpg-language-***: Language-specific frontends (C++, Java, Python, Go, etc.)**cpg-analysis**: Analysis engines and algorithms**cpg-concepts**: Concept definitions and compliance rules**codyze-console**: Web-based interface for project analysis**codyze-compliance**: Compliance checking and reporting**codyze**: CLI tool for analysisDevelopment Guidelines
Package Management
**Always use `pnpm`** for Node.js/JavaScript/TypeScript projectsUse `pnpm install`, `pnpm add`, and `pnpm run` instead of npm equivalentsCodyze Console Module
#### Tech Stack
Backend: Kotlin with Spring BootFrontend: Svelte 5 with SvelteKitStyling: Tailwind CSSPackage Manager: pnpm#### Svelte 5 Runes Syntax
Always use modern Svelte 5 runes:
`let variableName = $state(initialValue)` for reactive state`const derivedValue = $derived(expression)` for computed values`$effect(() => { ... })` for side effects`let { prop1, prop2 }: Props = $props()` for component props#### SvelteKit Load Pattern
Define data loading in `+page.ts`:
```typescript
import type { PageLoad } from './$types';
export const load: PageLoad = async ({ fetch }) => {
const response = await fetch('/api/endpoint');
const data = await response.json();
return { data };
};
```
Access data in `+page.svelte`:
```svelte
<script lang="ts">
import type { PageProps } from './$types';
let { data }: PageProps = $props();
const items = $derived(data.items || []);
</script>
```
#### Component Guidelines
Use clean separation and modular designKeep components reusableUse minimal design with limited shadowsStyle with Tailwind CSSFollow accessibility best practices (semantic HTML, ARIA roles)Use modern event syntax: `onclick` instead of `on:click`Use proper button elements for interactive content#### Build & Test Commands
Kotlin compilation check: `./gradlew :codyze-console:compileKotlin --console=plain` (from root)Run pnpm commands in `codyze-console/src/main/webapp` directoryCPG Core Modules (cpg-core, cpg-language-*, cpg-analysis)
#### Tech Stack
Language: KotlinBuild: Gradle with Kotlin DSLTesting: JUnit 5 (kotlin.test wrapper), MockkDocumentation: KDoc#### Code Standards
Follow Kotlin conventionsUse meaningful namesWrite comprehensive KDoc for public APIsPrefer immutable data structuresUse sealed classes for state/results#### Testing
Write unit tests for all public APIsUse descriptive test namesFollow AAA pattern (Arrange, Act, Assert)Mock external dependencies appropriatelyCodyze CLI Module
#### Tech Stack
Language: KotlinCLI Framework: CliktConfiguration: YAML/JSON#### CLI Design
Provide clear help messages and examplesUse consistent command namingSupport short and long option namesValidate input early with meaningful errorsGeneral Best Practices
Git Workflow
Use conventional commit messagesCreate feature branchesWrite descriptive commitsInclude relevant issue numbersDocumentation
Keep READMEs currentDocument API changesUse clear examplesInclude troubleshooting sectionsError Handling
Provide meaningful error messagesLog appropriate debugging infoHandle edge cases gracefullyUse appropriate exception typesCommunication
Keep change summaries briefFocus on essential informationKnown Issues
**svelte-highlight**: Current version doesn't support Svelte 5 runes mode - consider alternatives until updated