Skip to content

Commit f834bdc

Browse files
Add AGENTS.md documentation and automated quality checks for markdown (#8)
* Initial plan * Add AGENTS.md and quality checks with cspell and markdownlint Co-authored-by: Malcolmnixon <1863707+Malcolmnixon@users.noreply.github.com> * Improve quality checks configuration based on code review feedback Co-authored-by: Malcolmnixon <1863707+Malcolmnixon@users.noreply.github.com> * Add explicit permissions to quality-checks job for security Co-authored-by: Malcolmnixon <1863707+Malcolmnixon@users.noreply.github.com> --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: Malcolmnixon <1863707+Malcolmnixon@users.noreply.github.com>
1 parent 8f5358e commit f834bdc

File tree

6 files changed

+191
-4
lines changed

6 files changed

+191
-4
lines changed

.cspell.json

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
{
2+
"version": "0.2",
3+
"language": "en",
4+
"words": [
5+
"Dema",
6+
"DemaConsulting",
7+
"Dotnet",
8+
"dotnet",
9+
"nuget",
10+
"nuspec",
11+
"csproj",
12+
"runtimeconfig",
13+
"deps",
14+
"freebsd",
15+
"wasm",
16+
"markdownlint",
17+
"cspell",
18+
"SBOM",
19+
"SPDX",
20+
"demaconsulting",
21+
"DotnetToolWrapper",
22+
"github",
23+
"workflows",
24+
"yaml"
25+
],
26+
"ignorePaths": [
27+
"node_modules",
28+
".git",
29+
"**/bin/**",
30+
"**/obj/**",
31+
"**/drop/**",
32+
"*.dll",
33+
"*.exe",
34+
".vs",
35+
"*.bak"
36+
]
37+
}

.github/workflows/build_on_push.yaml

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,29 @@ name: Build
33
on: [push]
44

55
jobs:
6+
quality-checks:
7+
name: Quality Checks
8+
runs-on: ubuntu-latest
9+
permissions:
10+
contents: read
11+
steps:
12+
- name: Checkout
13+
uses: actions/checkout@v6
14+
15+
- name: Setup Node.js
16+
uses: actions/setup-node@v4
17+
with:
18+
node-version: '20'
19+
20+
- name: Run Spelling Check
21+
run: npx cspell "**/*.md"
22+
23+
- name: Run Markdown Linting
24+
run: npx markdownlint-cli "**/*.md"
25+
626
build:
727
name: Build Artifacts
28+
needs: quality-checks
829
uses: ./.github/workflows/build.yaml
930
with:
1031
semver: '0.0.0-run.${{ github.run_number }}'

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
11
.vs
22
*.bak
3+
node_modules

.markdownlint.json

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
{
2+
"default": true,
3+
"MD013": {
4+
"line_length": 120,
5+
"code_blocks": false,
6+
"tables": false
7+
},
8+
"MD033": false,
9+
"MD041": false
10+
}

AGENTS.md

Lines changed: 114 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,114 @@
1+
# GitHub Copilot Agents Configuration
2+
3+
This repository contains configuration and instructions for GitHub Copilot agents to assist with development tasks.
4+
5+
## Repository Overview
6+
7+
**DotnetToolWrapper** is a .NET 8.0, 9.0, and 10.0 console application that serves as a wrapper for native
8+
applications packaged as [.NET Tools](https://learn.microsoft.com/en-us/dotnet/core/tools/global-tools).
9+
10+
## Project Structure
11+
12+
```text
13+
DotnetToolWrapper/
14+
├── .github/
15+
│ └── workflows/ # GitHub Actions workflows
16+
│ ├── build.yaml # Reusable build workflow
17+
│ ├── build_on_push.yaml # Triggered on push events
18+
│ └── release.yaml # Release workflow
19+
├── src/
20+
│ └── DemaConsulting.DotnetToolWrapper/
21+
│ ├── Program.cs # Main application logic
22+
│ └── DemaConsulting.DotnetToolWrapper.csproj
23+
├── .cspell.json # Spelling check configuration
24+
├── .markdownlint.json # Markdown linting configuration
25+
├── README.md # Project documentation
26+
├── LICENSE # MIT License
27+
└── spdx-workflow.yaml # SBOM enhancement workflow
28+
```
29+
30+
## Key Technologies
31+
32+
- **.NET 8.0, 9.0, 10.0**: Multi-targeted framework versions
33+
- **C# 12**: Programming language
34+
- **GitHub Actions**: CI/CD automation
35+
- **SBOM Tools**: Software Bill of Materials generation
36+
37+
## Development Guidelines
38+
39+
### Building the Project
40+
41+
```bash
42+
dotnet restore
43+
dotnet build --configuration Release
44+
```
45+
46+
### Code Standards
47+
48+
- **Language Version**: C# 12
49+
- **Nullable Reference Types**: Enabled
50+
- **Implicit Usings**: Enabled
51+
- **Target Frameworks**: net8.0, net9.0, net10.0
52+
53+
### Workflow Structure
54+
55+
The project uses a modular workflow approach:
56+
57+
1. **build_on_push.yaml**: Triggers on every push, calls the reusable build workflow
58+
2. **build.yaml**: Reusable workflow that performs the actual build, SBOM generation, and artifact upload
59+
3. **release.yaml**: Handles release-specific tasks
60+
61+
### Quality Checks
62+
63+
Quality checks are automated through GitHub Actions:
64+
65+
- **Spelling**: Checked using `cspell` against `.cspell.json` configuration
66+
- **Markdown Linting**: Validated using `markdownlint-cli` against `.markdownlint.json` configuration
67+
68+
## Agent Instructions
69+
70+
### When Working with Code
71+
72+
1. **Multi-targeting**: Always ensure changes are compatible with .NET 8.0, 9.0, and 10.0
73+
2. **Cross-platform**: The tool must work on Windows, Linux, FreeBSD, and macOS
74+
3. **Architecture Support**: Support x86, x64, ARM, ARM64, WASM, and S390x architectures
75+
76+
### When Modifying Workflows
77+
78+
1. Preserve the reusable workflow pattern
79+
2. Update both `build.yaml` and `build_on_push.yaml` if needed
80+
3. Ensure SBOM generation continues to work
81+
82+
### When Updating Documentation
83+
84+
1. Follow the markdown linting rules in `.markdownlint.json`
85+
2. Check spelling against `.cspell.json` dictionary
86+
3. Keep README.md synchronized with actual functionality
87+
88+
## Common Tasks
89+
90+
### Adding New Dependencies
91+
92+
Update the `.csproj` file in `src/DemaConsulting.DotnetToolWrapper/`
93+
94+
### Modifying Build Output
95+
96+
Edit the "Create Drop Folder" step in `.github/workflows/build.yaml`
97+
98+
### Updating Supported Frameworks
99+
100+
1. Modify `<TargetFrameworks>` in the `.csproj` file
101+
2. Update workflow files to include new framework versions
102+
3. Update the "Create Drop Folder" step to copy artifacts for new frameworks
103+
104+
## Testing Changes
105+
106+
Before committing:
107+
108+
1. Build locally: `dotnet build --configuration Release`
109+
2. Run spelling checks: `npx cspell "**/*.md"`
110+
3. Run markdown linting: `npx markdownlint "**/*.md"`
111+
112+
## Contact
113+
114+
For questions or issues, please refer to the repository's issue tracker on GitHub.

README.md

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,9 @@
55

66
# About
77

8-
This project generates a .NET 8.0, 9.0, and 10.0 console application suitable for use in [Dotnet Tool](https://learn.microsoft.com/en-us/dotnet/core/tools/global-tools) packages which wrap native applications.
8+
This project generates a .NET 8.0, 9.0, and 10.0 console application suitable for use in
9+
[Dotnet Tool](https://learn.microsoft.com/en-us/dotnet/core/tools/global-tools) packages which wrap
10+
native applications.
911

1012
# Usage
1113

@@ -22,7 +24,7 @@ To create a DotNet tool for an existing application:
2224

2325
The following is an example folder structure for a tool:
2426

25-
```
27+
```text
2628
root
2729
|- tool.nuspec Nuspec file
2830
|- README.md README file
@@ -77,7 +79,8 @@ The following is a sample DotnetToolSettings.xml file:
7779
</DotNetCliTool>
7880
```
7981

80-
The `Name` should be customized to match the desired name of the Dotnet tool. Dotnet uses this information when installing the package.
82+
The `Name` should be customized to match the desired name of the Dotnet tool. Dotnet uses this information
83+
when installing the package.
8184

8285
## DotnetToolWrapper.json
8386

@@ -94,7 +97,8 @@ The following is a sample DotnetToolWrapper.json file indicating the program to
9497
}
9598
```
9699

97-
The target strings consist of the operating system and architecture. Supported operating systems are `win`, `linux`, `freebsd`, and `osx`. Supported architectures are `x86`, `x64`, `arm`, `arm64`, `wasm`, and `s390x`.
100+
The target strings consist of the operating system and architecture. Supported operating systems are `win`,
101+
`linux`, `freebsd`, and `osx`. Supported architectures are `x86`, `x64`, `arm`, `arm64`, `wasm`, and `s390x`.
98102

99103
## Packaging
100104

0 commit comments

Comments
 (0)