This document defines coding, documentation, and testing standards for IdentityLifecycleEngine (IdLE). It follows widely accepted GitHub and PowerShell community conventions.
- Prefer clarity over cleverness
- Fail early and explicitly
- Keep behavior deterministic
- Avoid hidden side effects
- PowerShell Core 7+ only
- Verb-Noun cmdlet naming
- Singular nouns
- Avoid abbreviations
- Only approved Verbs
- 4 spaces indentation
- UTF-8, LF
- One statement per line
All exported functions must include comment-based help with:
.SYNOPSIS.DESCRIPTION.PARAMETER.EXAMPLE.OUTPUTS
Public APIs are part of the contract and must remain stable.
- Explain why, not what
- Avoid restating obvious code
- PSD1 only
- No script blocks
- No PowerShell expressions
- Configuration must be data-only
Steps must:
- be idempotent
- produce data-only actions
- not perform authentication
- write only declared
State.*outputs
All step implementations must validate their inputs using the centralized helper:
Assert-IdleNoScriptBlock -InputObject $config -Path 'With.Config'- Do not implement custom ScriptBlock checks
- Use
Assert-IdleNoScriptBlockfromIdLE.Corefor consistent enforcement - The helper recursively validates hashtables, arrays, and PSCustomObjects
Providers:
- handle authentication
- use
ExecutionContext.AcquireAuthSession() - must be mockable
- must not assume global state
- Pester only
- No live system calls in unit tests
- Providers require contract tests
IdLE uses static analysis and automated tests to keep the codebase consistent and maintainable.
-
PSScriptAnalyzer is the required linter for PowerShell code.
- Repository policy is defined in
PSScriptAnalyzerSettings.psd1(repo root). - Run locally via
pwsh -NoProfile -File ./tools/Invoke-IdleScriptAnalyzer.ps1. - CI publishes analyzer outputs under
artifacts/. - On default-branch runs, CI also uploads SARIF to GitHub Code Scanning.
- Repository policy is defined in
-
Pester is the required test framework.
- Run locally via
pwsh -NoProfile -File ./tools/Invoke-IdlePesterTests.ps1. - CI publishes test results and coverage under
artifacts/.
- Run locally via
Documentation process lives in CONTRIBUTING.md. This style guide focuses on in-code documentation rules (comment-based help, inline comments).
- validate early
- write tests
- document decisions
- keep surface small, no private function exports
- add UI to the engine
- add auth to steps
- hide logic in config
- introduce global state