Skip to content

Commit 2fdd9d1

Browse files
CopilotMalcolmnixon
andcommitted
Add VSCode tasks and AGENTS.md documentation
Co-authored-by: Malcolmnixon <1863707+Malcolmnixon@users.noreply.github.com>
1 parent 7cebdc7 commit 2fdd9d1

File tree

2 files changed

+248
-0
lines changed

2 files changed

+248
-0
lines changed

.vscode/tasks.json

Lines changed: 154 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,154 @@
1+
{
2+
"version": "2.0.0",
3+
"tasks": [
4+
{
5+
"label": "build",
6+
"command": "dotnet",
7+
"type": "process",
8+
"args": [
9+
"build",
10+
"--configuration",
11+
"Release",
12+
"${workspaceFolder}/DemaConsulting.TemplateDotNetTool.slnx"
13+
],
14+
"problemMatcher": "$msCompile",
15+
"group": {
16+
"kind": "build",
17+
"isDefault": true
18+
},
19+
"presentation": {
20+
"reveal": "always",
21+
"panel": "shared"
22+
}
23+
},
24+
{
25+
"label": "validate",
26+
"command": "dotnet",
27+
"type": "process",
28+
"args": [
29+
"run",
30+
"--project",
31+
"${workspaceFolder}/src/DemaConsulting.TemplateDotNetTool",
32+
"--configuration",
33+
"Release",
34+
"--framework",
35+
"net10.0",
36+
"--no-build",
37+
"--",
38+
"--validate"
39+
],
40+
"problemMatcher": "$msCompile",
41+
"group": {
42+
"kind": "test",
43+
"isDefault": true
44+
},
45+
"presentation": {
46+
"reveal": "always",
47+
"panel": "shared"
48+
}
49+
},
50+
{
51+
"label": "build and validate",
52+
"dependsOn": [
53+
"build",
54+
"validate"
55+
],
56+
"dependsOrder": "sequence",
57+
"problemMatcher": [],
58+
"presentation": {
59+
"reveal": "always",
60+
"panel": "shared"
61+
}
62+
},
63+
{
64+
"label": "format",
65+
"command": "dotnet",
66+
"type": "process",
67+
"args": [
68+
"format"
69+
],
70+
"problemMatcher": [],
71+
"presentation": {
72+
"reveal": "always",
73+
"panel": "shared"
74+
}
75+
},
76+
{
77+
"label": "lint markdown",
78+
"command": "npx",
79+
"type": "shell",
80+
"args": [
81+
"markdownlint-cli2",
82+
"\"**/*.md\"",
83+
"\"#node_modules\""
84+
],
85+
"problemMatcher": [],
86+
"presentation": {
87+
"reveal": "always",
88+
"panel": "shared"
89+
}
90+
},
91+
{
92+
"label": "spell check",
93+
"command": "npx",
94+
"type": "shell",
95+
"args": [
96+
"cspell",
97+
"\"**/*.{cs,md,json,yaml,yml}\"",
98+
"--no-progress"
99+
],
100+
"problemMatcher": [],
101+
"presentation": {
102+
"reveal": "always",
103+
"panel": "shared"
104+
}
105+
},
106+
{
107+
"label": "lint yaml",
108+
"command": "npx",
109+
"type": "shell",
110+
"args": [
111+
"yamllint",
112+
"."
113+
],
114+
"problemMatcher": [],
115+
"presentation": {
116+
"reveal": "always",
117+
"panel": "shared"
118+
}
119+
},
120+
{
121+
"label": "lint all",
122+
"dependsOn": [
123+
"format",
124+
"lint markdown",
125+
"spell check",
126+
"lint yaml"
127+
],
128+
"dependsOrder": "parallel",
129+
"problemMatcher": [],
130+
"presentation": {
131+
"reveal": "always",
132+
"panel": "shared"
133+
}
134+
},
135+
{
136+
"label": "verify requirements",
137+
"command": "dotnet",
138+
"type": "shell",
139+
"args": [
140+
"reqstream",
141+
"--requirements",
142+
"requirements.yaml",
143+
"--tests",
144+
"\"test-results/**/*.trx\"",
145+
"--enforce"
146+
],
147+
"problemMatcher": [],
148+
"presentation": {
149+
"reveal": "always",
150+
"panel": "shared"
151+
}
152+
}
153+
]
154+
}

AGENTS.md

Lines changed: 94 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,94 @@
1+
# Agent Quick Reference
2+
3+
Project-specific guidance for agents working on Template DotNet Tool - a reference implementation demonstrating best practices for DEMA Consulting .NET CLI tools.
4+
5+
## Tech Stack
6+
7+
- C# 12, .NET 8.0/9.0/10.0, dotnet CLI, NuGet
8+
9+
## Key Files
10+
11+
- **`requirements.yaml`** - All requirements with test linkage (enforced via `dotnet reqstream --enforce`)
12+
- **`.editorconfig`** - Code style (file-scoped namespaces, 4-space indent, UTF-8+BOM, LF endings)
13+
- **`.cspell.json`, `.markdownlint.json`, `.yamllint.yaml`** - Linting configs
14+
15+
## Requirements
16+
17+
- Link ALL requirements to tests (prefer `TemplateTool_*` self-validation tests)
18+
- Enforced in CI: `dotnet reqstream --requirements requirements.yaml --tests "test-results/**/*.trx" --enforce`
19+
- When adding features: add requirement + link to test
20+
21+
## Testing
22+
23+
- **Test Naming**: `TemplateTool_MethodUnderTest_Scenario` for self-validation tests
24+
- **Self-Validation**: All tests run via `--validate` flag and can output TRX/JUnit format
25+
- **Test Framework**: Uses DemaConsulting.TestResults library for test result generation
26+
27+
## Code Style
28+
29+
- **XML Docs**: On ALL members (public/internal/private) with spaces after `///` in summaries
30+
- **Errors**: `ArgumentException` for parsing, `InvalidOperationException` for runtime issues
31+
- **Namespace**: File-scoped namespaces only
32+
- **Using Statements**: Top of file only (no nested using declarations except for IDisposable)
33+
- **String Formatting**: Use interpolated strings ($"") for clarity
34+
35+
## Project Structure
36+
37+
- **Context.cs**: Handles command-line argument parsing, logging, and output
38+
- **Program.cs**: Main entry point with version/help/validation routing
39+
- **Validation.cs**: Self-validation tests with TRX/JUnit output support
40+
41+
## Standard Command-Line Arguments
42+
43+
All DEMA Consulting tools should support:
44+
- `-v`, `--version` - Display version information
45+
- `-?`, `-h`, `--help` - Display help message
46+
- `--silent` - Suppress console output
47+
- `--validate` - Run self-validation
48+
- `--results <file>` - Write validation results to file (TRX or JUnit format)
49+
- `--log <file>` - Write output to log file
50+
51+
## Build and Test
52+
53+
```bash
54+
# Build the project
55+
dotnet build --configuration Release
56+
57+
# Run self-validation
58+
dotnet run --project src/DemaConsulting.TemplateDotNetTool \
59+
--configuration Release --framework net10.0 --no-build -- --validate
60+
61+
# Use convenience scripts
62+
./build.sh # Linux/macOS
63+
build.bat # Windows
64+
```
65+
66+
## Documentation
67+
68+
- **User Guide**: `docs/guide/guide.md`
69+
- **Requirements**: `requirements.yaml` -> auto-generated docs
70+
- **Build Notes**: Auto-generated via BuildMark
71+
- **Code Quality**: Auto-generated via CodeQL and SonarMark
72+
- **Trace Matrix**: Auto-generated via ReqStream
73+
74+
## CI/CD
75+
76+
- **Quality Checks**: Markdown lint, spell check, YAML lint
77+
- **Build**: Multi-platform (Windows/Linux)
78+
- **CodeQL**: Security scanning
79+
- **Integration Tests**: .NET 8/9/10 on Windows/Linux
80+
- **Documentation**: Auto-generated via Pandoc + Weasyprint
81+
82+
## Common Tasks
83+
84+
```bash
85+
# Format code
86+
dotnet format
87+
88+
# Run all linters
89+
./lint.sh # Linux/macOS
90+
lint.bat # Windows
91+
92+
# Pack as NuGet tool
93+
dotnet pack --configuration Release
94+
```

0 commit comments

Comments
 (0)