/404kidwiz:powershell-module-architectfrom 404kidwiz
Use when user needs PowerShell module design, function structure, reusable libraries, profile optimization, or cross-version compatibility across PowerShell 5.1 and PowerShell 7+.
Ships in 404kidwiz. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them; scripts run unread.
Provides PowerShell module design and architecture expertise specializing in creating structured, reusable, and maintainable PowerShell modules. Focuses on module architecture, function design, cross-version compatibility, and profile optimization for enterprise PowerShell environments.
Invoke this skill when:
Do NOT invoke when:
| Scenario | Recommendation |
|---|---|
| 3+ related functions | Create module |
| Cross-team sharing needed | Create module + manifest |
| Single-use automation | Keep as script |
| Complex parameter sets | Advanced function in module |
| Version compatibility needed | Module with compatibility layer |
Script Organization Need
│
├─ Few related functions (3-10)?
│ └─ Single .psm1 with inline functions
│
├─ Many functions (10+)?
│ └─ Dot-source pattern (Public/Private folders)
│
├─ Publishing to gallery?
│ └─ Full manifest + tests + docs
│
└─ Team collaboration?
└─ Git repo + CI/CD + Pester tests
Use case: Refactor 10-50 scattered .ps1 scripts into organized module
# Inventory existing scripts
$scripts = Get-ChildItem -Path ./scripts -Filter *.ps1 -Recurse
# Analyze function signatures
foreach ($script in $scripts) {
$content = Get-Content $script.FullName -Raw
$functions = [regex]::Matches($content, 'function\s+(\S+)')
Write-Host "$($script.Name): $($functions.Count) functions"
}
# Expected output:
# AD-UserManagement.ps1: 12 functions
# AD-GroupManagement.ps1: 8 functions
# Common-Helpers.ps1: 15 functions (candidates for Private/)
# Create module skeleton
$moduleName = "Organization.ActiveDirectory"
$modulePath = "./modules/$moduleName"
New-Item -Path "$modulePath/Public" -ItemType Directory -Force
New-Item -Path "$modulePath/Private" -ItemType Directory -Force
New-Item -Path "$modulePath/Tests" -ItemType Directory -Force
New-Item -Path "$modulePath/$moduleName.psm1" -ItemType File -Force
New-Item -Path "$modulePath/$moduleName.psd1" -ItemType File -Force
Public functions (exported to users):
├─ Get-OrgADUser
├─ New-OrgADUser
├─ Set-OrgADUser
├─ Remove-OrgADUser
└─ ... (user-facing functions)
Private functions (internal helpers):
├─ _ValidateDomainConnection
├─ _BuildDistinguishedName
├─ _ConvertToCanonicalName
└─ ... (utility functions)
# Organization.ActiveDirectory.psm1
# Dot-source Private functions first
$Private = @(Get-ChildItem -Path $PSScriptRoot\Private\*.ps1 -ErrorAction SilentlyContinue)
foreach ($import in $Private) {
try {
. $import.FullName
} catch {
Write-Error "Failed to import private function $($import.FullName): $_"
}
}
# Dot-source Public functions
$Public = @(Get-ChildItem -Path $PSScriptRoot\Public\*.ps1 -ErrorAction SilentlyContinue)
foreach ($import in $Public) {
try {
. $import.FullName
} catch {
Write-Error "Failed to import public function $($import.FullName): $_"
}
}
# Export Public functions explicitly
Export-ModuleMember -Function $Public.BaseName
# Generate manifest
$manifestParams = @{
Path = "$modulePath/$moduleName.psd1"
RootModule = "$moduleName.psm1"
ModuleVersion = '1.0.0'
Author = 'IT Team'
CompanyName = 'Organization'
Description = 'Active Directory management functions'
PowerShellVersion = '5.1' # Minimum version
FunctionsToExport = @(
'Get-OrgADUser',
'New-OrgADUser',
'Set-OrgADUser',
'Remove-OrgADUser'
)
VariablesToExport = @()
AliasesToExport = @()
}
New-ModuleManifest @manifestParams
# Tests/Module.Tests.ps1
BeforeAll {
Import-Module "$PSScriptRoot/../Organization.ActiveDirectory.psd1" -Force
}
Describe "Organization.ActiveDirectory Module" {
It "Exports expected functions" {
$commands = Get-Command -Module Organization.ActiveDirectory
$commands.Count | Should -BeGreaterThan 0
}
It "Has valid module manifest" {
$manifest = Test-ModuleManifest -Path "$PSScriptRoot/../Organization.ActiveDirectory.psd1"
$manifest.Version | Should -Be '1.0.0'
}
}
Describe "Get-OrgADUser" {
It "Accepts Identity parameter" {
{ Get-OrgADUser -Identity "testuser" -WhatIf } | Should -Not -Throw
}
}
function Get-OrgUser {
<#
.SYNOPSIS
Retrieves Active Directory user by name.
.DESCRIPTION
Queries Active Directory for user object and returns detailed properties.
.PARAMETER Name
The username or SamAccountName to search for.
.EXAMPLE
Get-OrgUser -Name "jdoe"
Returns all properties for user jdoe.
.EXAMPLE
"jdoe", "asmith" | Get-OrgUser
Retrieves multiple users via pipeline.
#>
[CmdletBinding()]
param(
[Parameter(Mandatory, ValueFromPipeline)]
[ValidateNotNullOrEmpty()]
[string]$Name
)
process {
Get-ADUser -Identity $Name -Properties *
}
}
| Observation | Action |
|---|---|
| 100+ functions in single module | Consider splitting into sub-modules |
| Complex cross-version issues | Consult powershell-5.1 and 7 experts |
| Performance <1s profile load | Apply lazy loading patterns |
| Security-sensitive operations | Involve powershell-security-hardening |
Detailed Technical Reference: See REFERENCE.md
Code Examples & Patterns: See EXAMPLES.md
EXAMPLES.md (opens in a new tab)REFERENCE.md (opens in a new tab)references/best_practices.md (opens in a new tab)references/module_development.md (opens in a new tab)scripts/create_manifest.ps1 (opens in a new tab)scripts/module_architect_wrapper.ts (opens in a new tab)scripts/scaffold_module.ps1 (opens in a new tab)scripts/validate_functions.ps1 (opens in a new tab)What SKILL.md sets; muted values are Claude Code's defaults
Other plugins' skills for the same job
119 skills in this plugin
/accessibility-testerWCAG 2.2 AA compliance expert specializing in audits, automated testing, screen reader validation, and remediation./agent-organizerExpert in designing, orchestrating, and managing multi-agent systems (MAS). Specializes in agent collaboration patterns, hierarchical structures, and swarm intelligence. Use when building agent teams, designing agent communication, or orchestrating autonomous workflows./ai-engineerBuild production-ready LLM applications, advanced RAG systems, and intelligent agents. Implements vector search, multimodal AI, agent orchestration, and enterprise AI integrations./algorithmic-artCreating algorithmic art using p5.js with seeded randomness and interactive parameter exploration. Use this when users request creating art using code, generative art, algorithmic art, flow fields, or particle systems. Create original algorithmic art rather than copying existing artists' work to avoid copyright violations./angular-architectGenerates Angular 17+ standalone components, configures advanced routing with lazy loading and guards, implements NgRx state management, applies RxJS patterns, and optimizes bundle performance. Use when building Angular 17+ applications with standalone components or signals, setting up NgRx stores, establishing RxJS reactive patterns, performance tuning, or writing Angular tests for enterprise apps./api-designerUse when designing REST or GraphQL APIs, creating OpenAPI specifications, or planning API architecture. Invoke for resource modeling, versioning strategies, pagination patterns, error handling standards.npx claudepluginhub ulpi-io/plugin-marketplace --plugin 404kidwiz