Closing the intent-to-code chasm - specification-driven development with BDD verification chain
Overall
score
96%
Does it follow best practices?
Validation for skill structure
#!/usr/bin/env pwsh
[CmdletBinding()] param( [switch]$Json, [Parameter(Position = 0)] [string]$ProjectPath, [switch]$Help )
$ErrorActionPreference = 'Stop'
if ($Help) { Write-Output @" Usage: validate-premise.ps1 [-Json] [ProjectPath]
Validates PREMISE.md exists at project root and contains all 5 required sections (What, Who, Why, Domain, Scope) with non-placeholder content.
Options: -Json Output results as JSON ProjectPath Path to project root (default: git repo root) -Help Show this help message
Exit codes: 0 PASS - all sections present and filled 1 FAIL - missing file, missing sections, placeholders, or empty sections "@ exit 0 }
. "$PSScriptRoot/common.ps1"
if ($ProjectPath) { $repoRoot = $ProjectPath } else { $repoRoot = Get-RepoRoot }
$premiseFile = Join-Path $repoRoot 'PREMISE.md'
$requiredSections = @('What', 'Who', 'Why', 'Domain', 'Scope')
$status = 'PASS' $missingSections = @() $emptySections = @() $details = @() $placeholdersRemaining = 0 $sectionsFound = 0
if (-not (Test-Path $premiseFile)) { $status = 'FAIL' $details += "PREMISE.md not found at $premiseFile"
if ($Json) {
$result = [ordered]@{
status = 'FAIL'
sections_found = 0
sections_required = $requiredSections.Count
placeholders_remaining = 0
missing_sections = $requiredSections
details = $details
}
Write-Output ($result | ConvertTo-Json -Compress)
} else {
Write-Error "FAIL: PREMISE.md not found at $premiseFile"
Write-Host "Run /iikit-core init to create one."
}
exit 1}
$premiseContent = Get-Content -Path $premiseFile -ErrorAction SilentlyContinue $premiseRaw = Get-Content -Path $premiseFile -Raw -ErrorAction SilentlyContinue
foreach ($line in $premiseContent) { $matches = [regex]::Matches($line, '[[A-Z][A-Z_]*]') $placeholdersRemaining += $matches.Count }
if ($placeholdersRemaining -gt 0) { $status = 'FAIL' $details += "Found $placeholdersRemaining unresolved placeholder(s)" }
foreach ($section in $requiredSections) { # Look for ## Section heading (case-insensitive) $headingPattern = "(?mi)^##\s*$section" if ($premiseRaw -notmatch $headingPattern) { $missingSections += $section $status = 'FAIL' $details += "Missing required section: $section" continue }
$sectionsFound++
# Extract content between this heading and the next heading (or EOF)
$sectionPattern = "(?msi)^##\s*$section\s*\r?\n(.*?)(?=^##\s|\z)"
if ($premiseRaw -match $sectionPattern) {
$sectionContent = $Matches[1]
# Filter out empty lines and comment-only lines (<!-- ... -->)
$contentLines = $sectionContent -split '\r?\n' |
Where-Object { $_.Trim() -ne '' } |
Where-Object { $_ -notmatch '^\s*<!--.*-->\s*$' }
if (-not $contentLines -or $contentLines.Count -lt 1) {
$emptySections += $section
$status = 'FAIL'
$details += "Section '$section' has no content (only comments or blank lines)"
}
}}
if ($missingSections.Count -gt 0) { $details += "Missing sections: $($missingSections -join ', ')" }
if ($Json) { $result = [ordered]@{ status = $status sections_found = $sectionsFound sections_required = $requiredSections.Count placeholders_remaining = $placeholdersRemaining missing_sections = @($missingSections) empty_sections = @($emptySections) details = @($details) } Write-Output ($result | ConvertTo-Json -Compress) } else { if ($status -eq 'PASS') { Write-Output "PASS: PREMISE.md is valid ($sectionsFound/$($requiredSections.Count) sections, 0 placeholders)" } else { Write-Error "FAIL: PREMISE.md validation failed" foreach ($detail in $details) { Write-Host " - $detail" } } }
if ($status -eq 'PASS') { exit 0 } else { exit 1 }
Install with Tessl CLI
npx tessl i tessl-labs/intent-integrity-kit@2.3.5rules
skills
iikit-00-constitution
scripts
iikit-01-specify
iikit-02-clarify
iikit-03-plan
iikit-04-checklist
scripts
dashboard
iikit-05-testify
iikit-06-tasks
iikit-07-analyze
iikit-08-implement
iikit-09-taskstoissues
iikit-bugfix
scripts
iikit-core
scripts
bash
dashboard
powershell