GravionLabs/elysion / .agents/skills/ng-create-project
ng-create-project
VerifiedScaffold an Angular 21+ app or workspace with strict TypeScript, Vitest and ESLint/Prettier. Use when starting a new Angular project.
| File | Kind | Size |
|---|---|---|
| SKILL.md | skill md | 2.4 KB |
| scripts/New-AngularProject.ps1 | script | 3.7 KB |
| templates/tsconfig.json | config | 656 B |
| templates/vitest.config.ts | script | 211 B |
| templates/vitest.setup.ts | script | 113 B |
scripts/New-AngularProject.ps1
View on GitHub<#
.SYNOPSIS
Scaffold a new Angular 21+ application using the Angular CLI with strict TypeScript, Vitest, and ESLint/Prettier.
.PARAMETER ProjectName
Name for the Angular project (directory and package name).
.PARAMETER SelectorPrefix
Component and directive selector prefix. Default: 'app'.
.PARAMETER ProjectType
Project type: 'app' (standard application) or 'workspace' (multi-project workspace).
.PARAMETER SkipVitest
Do not set up Vitest (Vitest with the template config is installed by default).
.PARAMETER SkipEslint
Do not set up ESLint + Prettier + Husky via Setup-CodeQuality.ps1 (set up by default).
.PARAMETER OutputDirectory
Directory in which the project folder is created. Default: current directory.
#>
param(
[Parameter(Mandatory)][string]$ProjectName,
[string]$SelectorPrefix = 'app',
[ValidateSet('app', 'workspace')][string]$ProjectType = 'app',
[switch]$SkipVitest,
[switch]$SkipEslint,
[string]$OutputDirectory = '.'
)
$ErrorActionPreference = 'Stop'
$ScriptDir = $PSScriptRoot
$TemplatesDir = Join-Path $ScriptDir '../templates'
# Check ng CLI is available
if (-not (Get-Command ng -ErrorAction SilentlyContinue)) {
Write-Error "Angular CLI not found. Install it with: npm install -g @angular/cli"
}
Write-Host "Scaffolding Angular project: $ProjectName" -ForegroundColor Cyan
# Run ng new
$ngArgs = @(
'new', $ProjectName,
'--style', 'scss',
'--ssr', 'false',
'--skip-tests' # we'll set up Vitest separately
)
if ($SelectorPrefix -ne 'app') { $ngArgs += @('--prefix', $SelectorPrefix) }
Push-Location $OutputDirectory
try {
ng @ngArgs
} finally {
Pop-Location
}
$TargetDir = Join-Path $OutputDirectory $ProjectName
Push-Location $TargetDir
try {
# Replace tsconfig.json with strict settings
Write-Host "Applying strict TypeScript configuration..." -ForegroundColor Cyan
Copy-Item (Join-Path $TemplatesDir 'tsconfig.json') 'tsconfig.json' -Force
# Set up Vitest
if (-not $SkipVitest) {
Write-Host "Setting up Vitest..." -ForegroundColor Cyan
npm install --save-dev vitest jsdom
Copy-Item (Join-Path $TemplatesDir 'vitest.config.ts') 'vitest.config.ts' -Force
Copy-Item (Join-Path $TemplatesDir 'vitest.setup.ts') 'vitest.setup.ts' -Force
# Patch package.json test script
$pkgPath = 'package.json'
$pkg = Get-Content $pkgPath -Raw | ConvertFrom-Json
$pkg.scripts.test = 'vitest run'
$pkg.scripts | Add-Member -NotePropertyName 'test:watch' -NotePropertyValue 'vitest' -Force
$pkg | ConvertTo-Json -Depth 10 | Set-Content $pkgPath
Write-Host "Vitest configured (test script updated)" -ForegroundColor Green
}
# Set up ESLint + Prettier + Husky
if (-not $SkipEslint) {
Write-Host "Setting up ESLint + Prettier + Husky..." -ForegroundColor Cyan
# installed: a sibling skill (skills-manage ng brings it along); in GravionLabs/skills: skills/ts/
$candidates = @(
(Join-Path $ScriptDir '../../setup-prettier-eslint-husky/scripts/Setup-CodeQuality.ps1'),
(Join-Path $ScriptDir '../../../ts/setup-prettier-eslint-husky/scripts/Setup-CodeQuality.ps1')
)
$setupScript = $candidates | Where-Object { Test-Path $_ } | Select-Object -First 1
if ($setupScript) {
& pwsh $setupScript -ProjectType angular -SelectorPrefix $SelectorPrefix
} else {
Write-Warning "Setup-CodeQuality.ps1 not found at '$setupScript' — run the setup-prettier-eslint-husky skill manually."
}
}
Write-Host "`nDone! Next steps:" -ForegroundColor Green
Write-Host " ng serve — start dev server at http://localhost:4200" -ForegroundColor DarkGray
Write-Host " ng build — production build" -ForegroundColor DarkGray
Write-Host " npm test — run unit tests with Vitest" -ForegroundColor DarkGray
} finally {
Pop-Location
}
Related skills
| Skill | Stars | Updated | Works with | Status | Install |
|---|---|---|---|---|---|
| receiving-code-reviewobra/superpowersUse when receiving code review feedback, before implementing suggestions, especially if feedback seems unclear or technically questionable - requires technical rigor and verification, not performative agreement or blind implementation | Stars: 322k | Updated | Claude CodeCodex | Verified | Install |
| requesting-code-reviewobra/superpowersUse when completing tasks, implementing major features, or before merging to verify work meets requirements | Stars: 322k | Updated | Claude CodeCodex | Verified | Install |
| using-git-worktreesobra/superpowersUse when starting feature work that needs isolation from current workspace or before executing implementation plans - ensures an isolated workspace exists via native tools or git worktree fallback | Stars: 322k | Updated | Claude CodeCodex | Verified | Install |
| verification-before-completionobra/superpowersUse when about to claim work is complete, fixed, or passing, before committing or creating PRs - requires running verification commands and confirming output before making any success claims; evidence before assertions always | Stars: 322k | Updated | Claude CodeCodex | Verified | Install |