Skip to content

Commit 3952379

Browse files
Merge branch 'main' of https://github.com/PSModule/Process-PSModule into 001-merge-workflows
2 parents 606c37d + de4f7a9 commit 3952379

File tree

9 files changed

+63
-71
lines changed

9 files changed

+63
-71
lines changed

.github/prompts/analyze.prompt.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -61,9 +61,9 @@ Execution steps:
6161

6262
5. Severity assignment heuristic:
6363
- CRITICAL: Violates constitution MUST, missing core spec artifact, or requirement with zero coverage that blocks baseline functionality.
64-
- HIGH: Duplicate or conflicting requirement, ambiguous security/performance attribute, untestable acceptance criterion.
65-
- MEDIUM: Terminology drift, missing non-functional task coverage, underspecified edge case.
66-
- LOW: Style/wording improvements, minor redundancy not affecting execution order.
64+
- HIGH: Duplicate or conflicting requirement, ambiguous security/performance attribute, or untestable acceptance criterion.
65+
- MEDIUM: Terminology drift, missing non-functional task coverage, or underspecified edge case.
66+
- LOW: Style/wording improvements, or minor redundancy not affecting execution order.
6767

6868
6. Produce a Markdown report (no file writes) with sections:
6969

@@ -95,9 +95,9 @@ Execution steps:
9595
* Critical Issues Count
9696

9797
7. At end of report, output a concise Next Actions block:
98-
- If CRITICAL issues exist: Recommend resolving before `/implement`.
99-
- If only LOW/MEDIUM: User may proceed, but provide improvement suggestions.
100-
- Provide explicit command suggestions: e.g., "Run /specify with refinement", "Run /plan to adjust architecture", "Manually edit tasks.md to add coverage for 'performance-metrics'".
98+
- If CRITICAL issues exist: Recommend resolving them before `/implement`.
99+
- If only LOW/MEDIUM issues: User may proceed, but provide improvement suggestions.
100+
- Provide explicit command suggestions: e.g., "Run /specify with refinement", "Run /plan to adjust architecture", or "Manually edit tasks.md to add coverage for 'performance-metrics'".
101101

102102
8. Ask the user: "Would you like me to suggest concrete remediation edits for the top N issues?" (Do NOT apply them automatically.)
103103

.github/prompts/clarify.prompt.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -79,10 +79,10 @@ Execution steps:
7979
- Information is better deferred to planning phase (note internally)
8080

8181
3. Generate (internally) a prioritized queue of candidate clarification questions (maximum 5). Do NOT output them all at once. Apply these constraints:
82-
- Maximum of 5 total questions across the whole session.
82+
- Maximum of 5 total questions across the entire session.
8383
- Each question must be answerable with EITHER:
8484
* A short multiple‑choice selection (2–5 distinct, mutually exclusive options), OR
85-
* A one-word / short‑phrase answer (explicitly constrain: "Answer in <=5 words").
85+
* A one-word / short‑phrase answer (explicitly constrain: "Answer in 5 words").
8686
- Only include questions whose answers materially impact architecture, data modeling, task decomposition, test design, UX behavior, operational readiness, or compliance validation.
8787
- Ensure category coverage balance: attempt to cover the highest impact unresolved categories first; avoid asking two low-impact questions when a single high-impact area (e.g., security posture) is unresolved.
8888
- Exclude questions already answered, trivial stylistic preferences, or plan-level execution details (unless blocking correctness).
@@ -102,9 +102,9 @@ Execution steps:
102102
| Short | Provide a different short answer (<=5 words) (Include only if free-form alternative is appropriate) |
103103
```
104104

105-
- For short‑answer style (no meaningful discrete options), output a single line after the question: `Format: Short answer (<=5 words)`.
105+
- For short‑answer style (no meaningful discrete options), output a single line after the question: `Format: Short answer (5 words)`.
106106
- After the user answers:
107-
* Validate the answer maps to one option or fits the <=5 word constraint.
107+
* Validate the answer maps to one option or fits the 5 word constraint.
108108
* If ambiguous, ask for a quick disambiguation (count still belongs to same question; do not advance).
109109
* Once satisfactory, record it in working memory (do not yet write to disk) and move to the next queued question.
110110
- Stop asking further questions when:

.github/prompts/constitution.prompt.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ Follow this execution flow:
9191
6. Validation before final output:
9292
- No remaining unexplained bracket tokens.
9393
- Version line matches report.
94-
- Dates ISO format YYYY-MM-DD.
94+
- Dates in ISO format (YYYY-MM-DD).
9595
- Principles are declarative, testable, and free of vague language ("should" → replace with MUST/SHOULD rationale where appropriate).
9696

9797
7. Write the completed constitution back to [`.specify/memory/constitution.md`](../../.specify/memory/constitution.md) (overwrite). Never write to the template path during iteration.

.github/prompts/implement.prompt.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -46,19 +46,19 @@ $ARGUMENTS
4646
- **Validation checkpoints**: Verify each phase completion before proceeding
4747

4848
5. Implementation execution rules:
49-
- **Setup first**: Initialize project structure, dependencies, configuration
49+
- **Setup first**: Initialize project structure, dependencies, and configuration
5050
- **Tests before code**: If you need to write tests for contracts, entities, and integration scenarios
51-
- **Core development**: Implement models, services, CLI commands, endpoints
52-
- **Integration work**: Database connections, middleware, logging, external services
53-
- **Polish and validation**: Unit tests, performance optimization, documentation
51+
- **Core development**: Implement models, services, CLI commands, and endpoints
52+
- **Integration work**: Database connections, middleware, logging, and external services
53+
- **Polish and validation**: Unit tests, performance optimization, and documentation
5454

5555
6. Progress tracking and error handling:
5656
- Report progress after each completed task
5757
- Halt execution if any non-parallel task fails
58-
- For parallel tasks [P], continue with successful tasks, report failed ones
58+
- For parallel tasks [P], continue with successful tasks and report failed ones
5959
- Provide clear error messages with context for debugging
6060
- Suggest next steps if implementation cannot proceed
61-
- **IMPORTANT** For completed tasks, make sure to mark the task off as [X] in the tasks file.
61+
- **IMPORTANT**: For completed tasks, make sure to mark the task as [X] in the tasks file.
6262

6363
7. Completion validation:
6464
- Verify all required tasks are completed

.github/prompts/tasks.prompt.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ $ARGUMENTS
5353
4. Task generation rules:
5454
- Each contract file → contract test task marked [P]
5555
- Each entity in data-model → model creation task marked [P]
56-
- Each endpoint → implementation task (not parallel if shared files)
56+
- Each endpoint → implementation task (not parallel if files are shared)
5757
- Each user story → integration test marked [P]
5858
- Different files = can be parallel [P]
5959
- Same file = sequential (no [P])
@@ -113,4 +113,4 @@ $ARGUMENTS
113113

114114
Context for task generation: $ARGUMENTS
115115

116-
The tasks.md should be immediately executable - each task must be specific enough that an LLM can complete it without additional context.
116+
The tasks.md should be immediately executable - each task must be specific enough that an LLM can complete it without requiring additional context.

.specify/memory/constitution.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -120,9 +120,9 @@ The `src/` folder contains the module source code that Build-PSModule compiles i
120120
- `data/` - Configuration data files (`.psd1`) loaded as module variables
121121
- `formats/` - Format definition files (`.ps1xml`) for object display
122122
- `functions/private/` - Private functions (internal implementation)
123-
- Supports subdirectories for grouping (e.g., `functions/public/CoponentA/`, `functions/public/ComponentB/`)
123+
- Supports subdirectories for grouping (e.g., `functions/public/ComponentA/`, `functions/public/ComponentB/`)
124124
- `functions/public/` - Public functions (exported to module consumers)
125-
- Supports subdirectories for grouping (e.g., `functions/public/CoponentA/`, `functions/public/ComponentB/`)
125+
- Supports subdirectories for grouping (e.g., `functions/public/ComponentA/`, `functions/public/ComponentB/`)
126126
- Optional category documentation files (e.g., `functions/public/PSModule/PSModule.md`)
127127
- `init/` - Initialization scripts (executed first during module load)
128128
- `modules/` - Nested PowerShell modules (`.psm1`) or additional assemblies

.specify/templates/plan-template.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@
1212
→ Set Structure Decision based on project type
1313
3. Fill the Constitution Check section based on the content of the constitution document.
1414
4. Evaluate Constitution Check section below
15-
→ If violations exist: Document in Complexity Tracking
16-
→ If no justification possible: ERROR "Simplify approach first"
15+
→ If violations exist: Document them in Complexity Tracking
16+
→ If no justification is possible: ERROR "Simplify approach first"
1717
→ Update Progress Tracking: Initial Constitution Check
1818
5. Execute Phase 0 → research.md
1919
→ If NEEDS CLARIFICATION remain: ERROR "Resolve unknowns"

.specify/templates/spec-template.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@
8888
5. Generate Functional Requirements
8989
→ Each requirement must be testable
9090
→ Mark ambiguous requirements
91-
6. Identify Key Entities (if data involved)
91+
6. Identify Key Entities (if data is involved)
9292
7. Run Review Checklist
9393
→ If any [NEEDS CLARIFICATION]: WARN "Spec has uncertainties"
9494
→ If implementation details found: ERROR "Remove tech details"

README.md

Lines changed: 39 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Process-PSModule
22

3-
A workflow for crafting PowerShell modules using the PSModule framework, which builds, tests and publishes PowerShell modules to the PowerShell
3+
A workflow for crafting PowerShell modules using the PSModule framework, which builds, tests, and publishes PowerShell modules to the PowerShell
44
Gallery and produces documentation that is published to GitHub Pages. The workflow is used by all PowerShell modules in the PSModule organization.
55

66
## How to get started
@@ -18,7 +18,7 @@ Gallery and produces documentation that is published to GitHub Pages. The workfl
1818

1919
## How it works
2020

21-
The workflow is designed to be trigger on pull requests to the repository's default branch.
21+
The workflow is designed to be triggered on pull requests to the repository's default branch.
2222
When a pull request is opened, closed, reopened, synchronized (push), or labeled, the workflow will run.
2323
Depending on the labels in the pull requests, the workflow will result in different outcomes.
2424

@@ -31,19 +31,23 @@ Depending on the labels in the pull requests, the workflow will result in differ
3131
- [Build module](./.github/workflows/Build-Module.yml)
3232
- Compiles the module source code into a PowerShell module.
3333
- [Test source code](./.github/workflows/Test-SourceCode.yml)
34-
- Tests the source code in parallel (matrix) using [PSModule framework settings for style and standards for source code](https://github.com/PSModule/Test-PSModule?tab=readme-ov-file#sourcecode-tests)
34+
- Tests the source code in parallel (matrix) using:
35+
- [PSModule framework settings for style and standards for source code](https://github.com/PSModule/Test-PSModule?tab=readme-ov-file#sourcecode-tests)
3536
- This produces a json based report that is used to later evaluate the results of the tests.
3637
- [Lint source code](./.github/workflows/Lint-SourceCode.yml)
37-
- Lints the source code in parallel (matrix) using [PSScriptAnalyzer rules](https://github.com/PSModule/Invoke-ScriptAnalyzer).
38+
- Lints the source code in parallel (matrix) using:
39+
- [PSScriptAnalyzer rules](https://github.com/PSModule/Invoke-ScriptAnalyzer).
3840
- This produces a json based report that is used to later evaluate the results of the linter.
3941
- [Framework test](./.github/workflows/Test-Module.yml)
40-
- Tests and lints the module in parallel (matrix) using [PSModule framework settings for style and standards foor modules](https://github.com/PSModule/Test-PSModule?tab=readme-ov-file#module-tests) + [PSScriptAnalyzer rules](https://github.com/PSModule/Invoke-ScriptAnalyzer).
42+
- Tests and lints the module in parallel (matrix) using:
43+
- [PSModule framework settings for style and standards for modules](https://github.com/PSModule/Test-PSModule?tab=readme-ov-file#module-tests)
44+
- [PSScriptAnalyzer rules](https://github.com/PSModule/Invoke-ScriptAnalyzer).
4145
- This produces a json based report that is used to later evaluate the results of the tests.
4246
- [Test module](./.github/workflows/Test-ModuleLocal.yml)
4347
- Import and tests the module in parallel (matrix) using Pester tests from the module repository.
4448
- Supports setup and teardown scripts executed via separate dedicated jobs:
45-
- **BeforeAll.ps1**: Runs once before all test matrix jobs to set up test environment (e.g., deploy infrastructure, download test data)
46-
- **AfterAll.ps1**: Runs once after all test matrix jobs complete to clean up test environment (e.g., remove test resources, cleanup databases)
49+
- `BeforeAll`: Runs once before all test matrix jobs to set up test environment (e.g., deploy infrastructure, download test data)
50+
- `AfterAll`: Runs once after all test matrix jobs complete to clean up test environment (e.g., remove test resources, cleanup databases)
4751
- Setup/teardown scripts are automatically detected in test directories and executed with the same environment variables as tests
4852
- This produces a json based report that is used to later evaluate the results of the tests.
4953
- [Get test results](./.github/workflows/Get-TestResults.yml)
@@ -53,16 +57,19 @@ Depending on the labels in the pull requests, the workflow will result in differ
5357
- Gathers the code coverage from the previous steps and creates a summary of the results.
5458
- If the code coverage is below the target, the workflow will fail here.
5559
- [Build docs](./.github/workflows/Build-Docs.yml)
56-
- Generates documentation and lints the documentation using [super-linter](https://github.com/super-linter/super-linter).
60+
- Generates documentation and lints the documentation using:
61+
- [super-linter](https://github.com/super-linter/super-linter).
5762
- [Build site](./.github/workflows/Build-Site.yml)
58-
- Generates a static site using [Material for MkDocs](https://squidfunk.github.io/mkdocs-material/).
63+
- Generates a static site using:
64+
- [Material for MkDocs](https://squidfunk.github.io/mkdocs-material/).
5965
- [Publish site](./.github/workflows/Publish-Site.yml)
60-
- Publishes the static site with the module documentationto GitHub Pages.
66+
- Publishes the static site with the module documentation to GitHub Pages.
6167
- [Publish module](./.github/workflows/Publish-Module.yml)
6268
- Publishes the module to the PowerShell Gallery.
6369
- Creates a release on the GitHub repository.
6470

6571
To use the workflow, create a new file in the `.github/workflows` directory of the module repository and add the following content.
72+
6673
<details>
6774
<summary>Workflow suggestion</summary>
6875

@@ -100,10 +107,9 @@ jobs:
100107
## Configuration
101108

102109
The workflow is configured using a settings file in the module repository.
103-
The file can be a `JSON`, `YAML` or `PSD1` file. By default it will look for `.github/PSModule.yml`.
110+
The file can be a `JSON`, `YAML`, or `PSD1` file. By default, it will look for `.github/PSModule.yml`.
104111

105112
The following settings are available in the settings file:
106-
Here's a Markdown-formatted table describing your PowerShell object structure clearly and concisely:
107113

108114
| Name | Type | Description | Default |
109115
|----------------------------------------|-----------|----------------------------------------------------------------------------------------------------------|---------------------|
@@ -265,19 +271,18 @@ Build:
265271

266272
The workflow supports automatic execution of setup and teardown scripts for module tests:
267273

268-
#### BeforeAll.ps1
269-
- **Location**: Place in your test directories (e.g., `tests/BeforeAll.ps1`)
270-
- **Purpose**: Runs once before all test matrix jobs to prepare the test environment
271-
- **Use cases**: Deploy test infrastructure, download test data, initialize databases, configure services
272-
- **Environment**: Has access to the same environment variables as your tests (secrets, GitHub token, etc.)
274+
- Scripts are automatically detected and executed if present
275+
- If no scripts are found, the workflow continues normally
276+
277+
#### Setup - `BeforeAll.ps1`
278+
279+
- Place in your test directories (`tests/BeforeAll.ps1`)
280+
- Runs once before all test matrix jobs to prepare the test environment
281+
- Deploy test infrastructure, download test data, initialize databases, or configure services
282+
- Has access to the same environment variables as your tests (secrets, GitHub token, etc.)
273283

274-
#### AfterAll.ps1
275-
- **Location**: Place in your test directories (e.g., `tests/AfterAll.ps1`)
276-
- **Purpose**: Runs once after all test matrix jobs complete to clean up the test environment
277-
- **Use cases**: Remove test resources, cleanup databases, stop services, upload artifacts
278-
- **Environment**: Has access to the same environment variables as your tests
284+
##### Example - `BeforeAll.ps1`
279285

280-
**Example BeforeAll.ps1:**
281286
```powershell
282287
Write-Host "Setting up test environment..."
283288
# Deploy test infrastructure
@@ -286,7 +291,15 @@ Write-Host "Setting up test environment..."
286291
Write-Host "Test environment ready!"
287292
```
288293

289-
**Example AfterAll.ps1:**
294+
#### Teardown - `AfterAll.ps1`
295+
296+
- Place in your test directories (`tests/AfterAll.ps1`)
297+
- Runs once after all test matrix jobs complete to clean up the test environment
298+
- Remove test resources, clean up databases, stop services, or upload artifacts
299+
- Has access to the same environment variables as your tests
300+
301+
##### Example - `AfterAll.ps1`
302+
290303
```powershell
291304
Write-Host "Cleaning up test environment..."
292305
# Remove test resources
@@ -295,25 +308,6 @@ Write-Host "Cleaning up test environment..."
295308
Write-Host "Cleanup completed!"
296309
```
297310

298-
**Notes:**
299-
- Scripts are automatically detected and executed if present
300-
- Each unique test directory path is processed only once
301-
- Scripts run with PowerShell and have access to PSModuleHelpers
302-
- If no scripts are found, the workflow continues normally
303-
304-
**Execution Order:**
305-
306-
The workflow executes setup and teardown scripts using separate dedicated jobs with the following order:
307-
308-
```plaintext
309-
BeforeAll-ModuleLocal → Test-ModuleLocal (matrix) → AfterAll-ModuleLocal → Get-TestResults/Get-CodeCoverage
310-
```
311-
312-
- **BeforeAll-ModuleLocal**: Runs once before all test matrix jobs
313-
- **Test-ModuleLocal**: Runs tests in parallel matrix configuration
314-
- **AfterAll-ModuleLocal**: Runs once after all test matrix jobs complete (always executes for cleanup, even if tests fail)
315-
- **Get-TestResults/Get-CodeCoverage**: Process results after cleanup is complete
316-
317311
### Secrets
318312

319313
The following secrets are used by the workflow. They can be automatically provided (if available) by setting the `secrets: inherit`
@@ -332,9 +326,7 @@ in the workflow file.
332326

333327
## Permissions
334328

335-
The action requires the following permissions:
336-
337-
If running the action in a restrictive mode, the following permissions needs to be granted to the action:
329+
If running the action in a restrictive mode, the following permissions need to be granted to the action:
338330

339331
```yaml
340332
permissions:
@@ -362,4 +354,4 @@ Process-PSModule follows:
362354
- [Test-Driven Development](https://testdriven.io/test-driven-development/) using [Pester](https://pester.dev) and [PSScriptAnalyzer](https://learn.microsoft.com/en-us/powershell/utility-modules/psscriptanalyzer/overview?view=ps-modules)
363355
- [GitHub Flow specifications](https://docs.github.com/en/get-started/using-github/github-flow)
364356
- [SemVer 2.0.0 specifications](https://semver.org)
365-
- [Continiuous Delivery practices](https://en.wikipedia.org/wiki/Continuous_delivery)
357+
- [Continuous Delivery practices](https://en.wikipedia.org/wiki/Continuous_delivery)

0 commit comments

Comments
 (0)