Skip to content

Commit 985eee0

Browse files
fix(build): detect table formatting changes via git diff (#261)
## Description Fixes the table-format.yml workflow to properly detect when markdown tables need formatting. The previous implementation relied on the exit code of `markdown-table-formatter`, which always returns 0 regardless of whether it modified files. The fix uses `git diff --name-only` to detect actual file changes after running the formatter. Additionally formats all markdown files with misaligned table pipes to comply with repository conventions. - fix(build): replace exit code check with `git diff --name-only` detection in table-format.yml workflow - style(docs): align table pipes vertically in 9 documentation files per markdown.instructions.md ## Related Issue(s) Fixes #253 ## Type of Change Select all that apply: **Code & Documentation:** - [x] Bug fix (non-breaking change fixing an issue) - [ ] New feature (non-breaking change adding functionality) - [ ] Breaking change (fix or feature causing existing functionality to change) - [x] Documentation update **Infrastructure & Configuration:** - [x] GitHub Actions workflow - [ ] Linting configuration (markdown, PowerShell, etc.) - [ ] Security configuration - [ ] DevContainer configuration - [ ] Dependency update **AI Artifacts:** - [ ] Reviewed contribution with `prompt-builder` agent and addressed all feedback - [ ] Copilot instructions (`.github/instructions/*.instructions.md`) - [ ] Copilot prompt (`.github/prompts/*.prompt.md`) - [ ] Copilot agent (`.github/agents/*.agent.md`) > **Note for AI Artifact Contributors**: > > - **Agents**: Research, indexing/referencing other project (using standard VS Code GitHub Copilot/MCP tools), planning, and general implementation agents likely already exist. Review `.github/agents/` before creating new ones. > - **Model Versions**: Only contributions targeting the **latest Anthropic and OpenAI models** will be accepted. Older model versions (e.g., GPT-3.5, Claude 3) will be rejected. > - See [Agents Not Accepted](../docs/contributing/custom-agents.md#agents-not-accepted) and [Model Version Requirements](../docs/contributing/ai-artifacts-common.md#model-version-requirements). **Other:** - [ ] Script/automation (`.ps1`, `.sh`, `.py`) - [ ] Other (please describe): ## Sample Prompts (for AI Artifact Contributions) N/A - This PR does not include AI artifact contributions. ## Testing - Ran `npm run format:tables` locally to verify formatter execution - Verified `git diff --name-only` correctly lists modified files - Ran `npm run lint:yaml` - workflow syntax validated - Ran `npm run lint:md` - all markdown files pass linting ## Checklist ### Required Checks - [x] Documentation is updated (if applicable) - [x] Files follow existing naming conventions - [x] Changes are backwards compatible (if applicable) - [ ] Tests added for new functionality (if applicable) ### AI Artifact Contributions N/A ### Required Automated Checks The following validation commands must pass before merging: - [x] Markdown linting: `npm run lint:md` - [ ] Spell checking: `npm run spell-check` - [ ] Frontmatter validation: `npm run lint:frontmatter` - [ ] Link validation: `npm run lint:md-links` - [ ] PowerShell analysis: `npm run lint:ps` ## Security Considerations - [x] This PR does not contain any sensitive or NDA information - [x] Any new dependencies have been reviewed for security issues - [x] Security-related scripts follow the principle of least privilege ## Additional Notes The workflow now properly fails when tables need formatting by: 1. Running `npm run format:tables` (modifies files in-place) 2. Checking `git diff --name-only` for any changes 3. Setting `TABLE_FORMAT_FAILED=true` when changes detected 4. Listing affected files in workflow output 🔧 - Generated by Copilot
1 parent 4db1a18 commit 985eee0

10 files changed

Lines changed: 236 additions & 224 deletions

File tree

.github/workflows/table-format.yml

Lines changed: 28 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,18 @@ jobs:
3737
- name: Check table formatting
3838
id: table-format
3939
run: |
40-
npm run format:tables > table-format-output.txt 2>&1 || echo "TABLE_FORMAT_FAILED=true" >> $GITHUB_ENV
40+
set +e
41+
npm run format:tables > table-format-output.txt 2>&1
42+
FORMAT_EXIT_CODE=$?
43+
set -e
4144
cat table-format-output.txt
45+
if [ "$FORMAT_EXIT_CODE" -ne 0 ] || [ -n "$(git diff --name-only)" ]; then
46+
echo "TABLE_FORMAT_FAILED=true" >> "$GITHUB_ENV"
47+
if [ -n "$(git diff --name-only)" ]; then
48+
echo "Files with formatting issues:"
49+
git diff --name-only
50+
fi
51+
fi
4252
continue-on-error: true
4353

4454
- name: Create annotations
@@ -57,21 +67,23 @@ jobs:
5767
- name: Add job summary
5868
if: always()
5969
run: |
60-
echo "## Table Format Check Results" >> $GITHUB_STEP_SUMMARY
61-
if [ "${{ env.TABLE_FORMAT_FAILED }}" == "true" ]; then
62-
echo "❌ **Status**: Failed" >> $GITHUB_STEP_SUMMARY
63-
echo "" >> $GITHUB_STEP_SUMMARY
64-
echo "⚠️ **Note**: This check does NOT auto-fix tables." >> $GITHUB_STEP_SUMMARY
65-
echo "" >> $GITHUB_STEP_SUMMARY
66-
echo "**To fix manually:**" >> $GITHUB_STEP_SUMMARY
67-
echo "1. Run \`npm run format:tables\` locally" >> $GITHUB_STEP_SUMMARY
68-
echo "2. Review and commit the changes" >> $GITHUB_STEP_SUMMARY
69-
echo "3. Push to update this PR" >> $GITHUB_STEP_SUMMARY
70-
else
71-
echo "✅ **Status**: Passed" >> $GITHUB_STEP_SUMMARY
72-
echo "" >> $GITHUB_STEP_SUMMARY
73-
echo "All tables are properly formatted." >> $GITHUB_STEP_SUMMARY
74-
fi
70+
{
71+
echo "## Table Format Check Results"
72+
if [ "${{ env.TABLE_FORMAT_FAILED }}" == "true" ]; then
73+
echo "❌ **Status**: Failed"
74+
echo ""
75+
echo "⚠️ **Note**: This check does NOT auto-fix tables."
76+
echo ""
77+
echo "**To fix manually:**"
78+
echo "1. Run \`npm run format:tables\` locally"
79+
echo "2. Review and commit the changes"
80+
echo "3. Push to update this PR"
81+
else
82+
echo "✅ **Status**: Passed"
83+
echo ""
84+
echo "All tables are properly formatted."
85+
fi
86+
} >> "$GITHUB_STEP_SUMMARY"
7587
7688
- name: Fail job if issues found
7789
if: env.TABLE_FORMAT_FAILED == 'true' && !inputs.soft-fail

GOVERNANCE.md

Lines changed: 23 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -28,48 +28,48 @@ This project operates under a **corporate-sponsored maintainer model**:
2828

2929
The following matrix summarizes capabilities by role:
3030

31-
| Capability | Maintainer | Triage | Contributor |
32-
|:-----------|:----------:|:------:|:-----------:|
33-
| Code review ||| |
34-
| Merge pull requests ||| |
35-
| Release management ||| |
36-
| Architecture decisions | | Advise | Propose |
37-
| Issue triage ||| |
38-
| Label management ||| |
31+
| Capability | Maintainer | Triage | Contributor |
32+
|:-----------------------|:----------:|:------:|:-----------:|
33+
| Code review ||| |
34+
| Merge pull requests ||| |
35+
| Release management ||| |
36+
| Architecture decisions | | Advise | Propose |
37+
| Issue triage ||| |
38+
| Label management ||| |
3939

4040
### Maintainers
4141

4242
Maintainers guide project direction, manage releases, and resolve conflicts.
4343

44-
| Responsibility | Description |
45-
|:---------------|:------------|
44+
| Responsibility | Description |
45+
|:--------------------|:------------------------------------------------------------|
4646
| Technical direction | Set architectural standards and approve significant changes |
47-
| Release management | Coordinate versioning, changelogs, and publication |
48-
| Community health | Enforce code of conduct and foster inclusive participation |
49-
| Access management | Grant and revoke repository permissions |
47+
| Release management | Coordinate versioning, changelogs, and publication |
48+
| Community health | Enforce code of conduct and foster inclusive participation |
49+
| Access management | Grant and revoke repository permissions |
5050

5151
Current maintainers are members of the [@microsoft/edge-ai-core-dev](https://github.com/orgs/microsoft/teams/edge-ai-core-dev) team.
5252

5353
### Triage Contributors
5454

5555
Triage contributors assist maintainers by managing issue flow and initial assessments.
5656

57-
| Responsibility | Description |
58-
|:---------------|:------------|
59-
| Issue labeling | Apply appropriate labels to new issues |
57+
| Responsibility | Description |
58+
|:-------------------|:----------------------------------------------------------------------|
59+
| Issue labeling | Apply appropriate labels to new issues |
6060
| Initial assessment | Identify duplicates, request clarification, verify reproduction steps |
61-
| Community support | Answer questions and direct contributors to resources |
61+
| Community support | Answer questions and direct contributors to resources |
6262

6363
### Contributors
6464

6565
Contributors improve the project through code, documentation, and community engagement.
6666

67-
| Responsibility | Description |
68-
|:---------------|:------------|
69-
| Code contributions | Submit pull requests following contribution guidelines |
70-
| Documentation | Improve guides, fix errors, add examples |
71-
| Issue reporting | Report bugs with reproduction steps and suggest enhancements |
72-
| Community participation | Engage in discussions and help other users |
67+
| Responsibility | Description |
68+
|:------------------------|:-------------------------------------------------------------|
69+
| Code contributions | Submit pull requests following contribution guidelines |
70+
| Documentation | Improve guides, fix errors, add examples |
71+
| Issue reporting | Report bugs with reproduction steps and suggest enhancements |
72+
| Community participation | Engage in discussions and help other users |
7373

7474
## Decision-Making Process
7575

README.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -102,12 +102,12 @@ Get started with RPI:
102102

103103
HVE Core provides a structured approach to prompt engineering with four artifact types, each serving a distinct purpose:
104104

105-
| Artifact | Purpose | Activation |
106-
|----------|---------|------------|
107-
| **Instructions** | Passive reference guidance applied by file pattern | Automatic via `applyTo` glob |
108-
| **Prompts** | Task-specific procedures with input variables | Manual via `/` command |
109-
| **Agents** | Specialized personas with tool access and constraints | Manual via agent picker |
110-
| **Skills** | Executable utilities with cross-platform scripts | Read by Copilot on demand |
105+
| Artifact | Purpose | Activation |
106+
|------------------|-------------------------------------------------------|------------------------------|
107+
| **Instructions** | Passive reference guidance applied by file pattern | Automatic via `applyTo` glob |
108+
| **Prompts** | Task-specific procedures with input variables | Manual via `/` command |
109+
| **Agents** | Specialized personas with tool access and constraints | Manual via agent picker |
110+
| **Skills** | Executable utilities with cross-platform scripts | Read by Copilot on demand |
111111

112112
**Key capabilities:**
113113

docs/README.md

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,12 @@ HVE Core is an enterprise-ready prompt engineering framework for GitHub Copilot.
1010

1111
## Audience
1212

13-
| Role | Goal | Start Here | Key Resources |
14-
| ---- | ---- | ---------- | ------------- |
15-
| **Developers** | Use agents to ship features | [First Workflow](getting-started/first-workflow.md) | RPI agents, prompt patterns |
16-
| **TPMs & Leads** | Coordinate AI-assisted work | [Why RPI?](rpi/why-rpi.md) | Methodology, team adoption |
17-
| **Platform Engineers** | Maintain prompt libraries | [Build Workflows](architecture/workflows.md) | Validation pipeline, schemas |
18-
| **Contributors** | Create new artifacts | [AI Artifacts](contributing/ai-artifacts-common.md) | Authoring patterns, conventions |
13+
| Role | Goal | Start Here | Key Resources |
14+
|------------------------|-----------------------------|-----------------------------------------------------|---------------------------------|
15+
| **Developers** | Use agents to ship features | [First Workflow](getting-started/first-workflow.md) | RPI agents, prompt patterns |
16+
| **TPMs & Leads** | Coordinate AI-assisted work | [Why RPI?](rpi/why-rpi.md) | Methodology, team adoption |
17+
| **Platform Engineers** | Maintain prompt libraries | [Build Workflows](architecture/workflows.md) | Validation pipeline, schemas |
18+
| **Contributors** | Create new artifacts | [AI Artifacts](contributing/ai-artifacts-common.md) | Authoring patterns, conventions |
1919

2020
## Getting Started
2121

@@ -55,12 +55,12 @@ HVE Core provides a structured approach to building AI artifacts with protocol p
5555

5656
Key differentiators:
5757

58-
| Capability | Description |
59-
| ---------- | ----------- |
58+
| Capability | Description |
59+
|-------------------------|-----------------------------------------------------------|
6060
| Constraint-based design | Agents know their boundaries, preventing runaway behavior |
61-
| Subagent delegation | First-class pattern for decomposing complex tasks |
62-
| Maturity lifecycle | Four-stage model from experimental to deprecated |
63-
| Schema validation | JSON schema enforcement for all artifact types |
61+
| Subagent delegation | First-class pattern for decomposing complex tasks |
62+
| Maturity lifecycle | Four-stage model from experimental to deprecated |
63+
| Schema validation | JSON schema enforcement for all artifact types |
6464

6565
## Contributing
6666

@@ -98,9 +98,9 @@ Pre-built templates for common engineering documents:
9898

9999
## Quick Links
100100

101-
| Resource | Description |
102-
| -------- | ----------- |
103-
| [CHANGELOG](../CHANGELOG.md) | Release history and version notes |
104-
| [CONTRIBUTING](../CONTRIBUTING.md) | Repository contribution guidelines |
105-
| [Scripts README](../scripts/README.md) | Automation script reference |
106-
| [Extension README](../extension/README.md) | VS Code extension documentation |
101+
| Resource | Description |
102+
|--------------------------------------------|------------------------------------|
103+
| [CHANGELOG](../CHANGELOG.md) | Release history and version notes |
104+
| [CONTRIBUTING](../CONTRIBUTING.md) | Repository contribution guidelines |
105+
| [Scripts README](../scripts/README.md) | Automation script reference |
106+
| [Extension README](../extension/README.md) | VS Code extension documentation |

docs/architecture/README.md

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -27,19 +27,19 @@ graph TD
2727

2828
## Component Summary
2929

30-
| Component | Location | Purpose |
31-
| ------------------ | ----------------------------- | ----------------------------------------------------------------------- |
32-
| Extension | `extension/` | VS Code extension providing contribution points for AI artifacts |
33-
| Scripts | `scripts/` | PowerShell automation for linting, security validation, and dev tools |
34-
| Documentation | `docs/` | User guides, architecture docs, and contribution guidelines |
35-
| GitHub Assets | `.github/` | Workflows, instructions, prompts, agents, and issue templates |
36-
| Skills | `.github/skills/` | Self-contained packages combining scripts with domain-specific guidance |
37-
| Dev Container | `.devcontainer/` | Codespaces and local container development environment |
38-
| Frontmatter Schema | `scripts/linting/schemas/` | JSON schemas for AI artifact validation |
39-
| GitHub Workflows | `.github/workflows/` | CI/CD pipelines for validation, security, and release automation |
40-
| Access Control | `.github/CODEOWNERS` | Path-based review requirements and ownership |
41-
| MCP Configuration | `.vscode/mcp.json` | Model Context Protocol server definitions |
42-
| Test Infrastructure| `scripts/tests/` | Pester test suites with fixtures and mocks |
30+
| Component | Location | Purpose |
31+
|---------------------|----------------------------|-------------------------------------------------------------------------|
32+
| Extension | `extension/` | VS Code extension providing contribution points for AI artifacts |
33+
| Scripts | `scripts/` | PowerShell automation for linting, security validation, and dev tools |
34+
| Documentation | `docs/` | User guides, architecture docs, and contribution guidelines |
35+
| GitHub Assets | `.github/` | Workflows, instructions, prompts, agents, and issue templates |
36+
| Skills | `.github/skills/` | Self-contained packages combining scripts with domain-specific guidance |
37+
| Dev Container | `.devcontainer/` | Codespaces and local container development environment |
38+
| Frontmatter Schema | `scripts/linting/schemas/` | JSON schemas for AI artifact validation |
39+
| GitHub Workflows | `.github/workflows/` | CI/CD pipelines for validation, security, and release automation |
40+
| Access Control | `.github/CODEOWNERS` | Path-based review requirements and ownership |
41+
| MCP Configuration | `.vscode/mcp.json` | Model Context Protocol server definitions |
42+
| Test Infrastructure | `scripts/tests/` | Pester test suites with fixtures and mocks |
4343

4444
## Core Subsystems
4545

docs/architecture/ai-artifacts.md

Lines changed: 22 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -118,22 +118,22 @@ maturity: stable
118118

119119
**Required frontmatter fields:**
120120

121-
| Field | Description |
122-
| ----- | ----------- |
123-
| `name` | Lowercase kebab-case identifier matching directory name |
124-
| `description` | Brief capability description |
125-
| `maturity` | `stable`, `preview`, `experimental`, or `deprecated` |
121+
| Field | Description |
122+
|---------------|---------------------------------------------------------|
123+
| `name` | Lowercase kebab-case identifier matching directory name |
124+
| `description` | Brief capability description |
125+
| `maturity` | `stable`, `preview`, `experimental`, or `deprecated` |
126126

127127
Skills answer the question "what specialized utility does this task require?" and provide executable capabilities beyond conversational guidance.
128128

129129
**Key distinction from instructions:**
130130

131-
| Aspect | Instructions | Skills |
132-
| ------ | ------------ | ------ |
133-
| Nature | Passive reference | Active execution |
134-
| Content | Standards and conventions | Scripts and utilities |
135-
| Activation | Automatic via glob patterns | Explicit invocation |
136-
| Output | Guidance for Copilot | Executed operations |
131+
| Aspect | Instructions | Skills |
132+
|------------|-----------------------------|-----------------------|
133+
| Nature | Passive reference | Active execution |
134+
| Content | Standards and conventions | Scripts and utilities |
135+
| Activation | Automatic via glob patterns | Explicit invocation |
136+
| Output | Guidance for Copilot | Executed operations |
137137

138138
## Delegation Flow
139139

@@ -177,11 +177,11 @@ The referenced agent file (`pr-creator.agent.md`) must exist in `.github/agents/
177177

178178
Instructions use `applyTo:` patterns for automatic activation:
179179

180-
| Pattern | Matches |
181-
| ------- | ------- |
182-
| `**/*.py` | All Python files recursively |
183-
| `**/tests/**/*.ts` | TypeScript files in test directories |
184-
| `**/.copilot-tracking/pr/**` | PR tracking files |
180+
| Pattern | Matches |
181+
|------------------------------|--------------------------------------|
182+
| `**/*.py` | All Python files recursively |
183+
| `**/tests/**/*.ts` | TypeScript files in test directories |
184+
| `**/.copilot-tracking/pr/**` | PR tracking files |
185185

186186
Multiple instructions can apply to the same file. When patterns overlap, all matching instructions contribute guidance. Pattern specificity determines precedence for conflicting directives.
187187

@@ -215,12 +215,12 @@ The extension scans these directories at startup:
215215

216216
Each artifact's `maturity:` field controls channel inclusion:
217217

218-
| Maturity | Stable Channel | Pre-release Channel |
219-
| -------- | -------------- | ------------------- |
220-
| `stable` | Included | Included |
221-
| `preview` | Excluded | Included |
222-
| `experimental` | Excluded | Included |
223-
| `deprecated` | Excluded | Excluded |
218+
| Maturity | Stable Channel | Pre-release Channel |
219+
|----------------|----------------|---------------------|
220+
| `stable` | Included | Included |
221+
| `preview` | Excluded | Included |
222+
| `experimental` | Excluded | Included |
223+
| `deprecated` | Excluded | Excluded |
224224

225225
### Activation Context
226226

0 commit comments

Comments
 (0)