Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions .config/dotnet-tools.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{
"version": 1,
"isRoot": true,
"tools": {
"libmentor": {
"version": "0.1.0",
"commands": [
"libmentor"
],
"rollForward": false
}
}
}
19 changes: 19 additions & 0 deletions .github/actions/libmentor/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
name: Generate LibMentor documentation
description: Build validated AI documentation from a versioned source snapshot
runs:
using: composite
steps:
- uses: actions/setup-dotnet@v4
with:
dotnet-version: 10.0.x
- name: Restore pinned CLI
shell: bash
working-directory: ${{ github.workspace }}
run: dotnet tool restore
- name: Generate and verify
shell: bash
working-directory: ${{ github.workspace }}
run: |
version="$(python3 .github/scripts/libmentor-version.py)"
dotnet tool run libmentor -- generate --revision "$GITHUB_SHA" --library-version "$version"
dotnet tool run libmentor -- generate --check --revision "$GITHUB_SHA" --library-version "$version"
11 changes: 11 additions & 0 deletions .github/scripts/libmentor-version.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import json
import os
from pathlib import Path
import xml.etree.ElementTree as ET

version = ET.parse("Version.props").findtext(".//PackageVersion")
if not version:
raise SystemExit("Library version could not be resolved.")
revision = os.environ.get("GITHUB_SHA", "local")[:12]
base = version.split("+", 1)[0]
print(base + (".source." if "-" in base else "-source.") + revision)
19 changes: 19 additions & 0 deletions .github/workflows/libmentor.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
name: LibMentor validation
on:
pull_request:
push:
branches: [main]
workflow_dispatch:
permissions:
contents: read
jobs:
validate:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: ./.github/actions/libmentor
- uses: actions/upload-artifact@v4
with:
name: libmentor-documentation
path: .libmentor
include-hidden-files: true
12 changes: 12 additions & 0 deletions .github/workflows/pages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,13 @@ on:
branches: [main]
paths:
- 'docs/**'
- 'Nextended.*/**'
- 'Version.props'
- 'README.md'
- 'libmentor.json'
- '.config/dotnet-tools.json'
- '.github/actions/libmentor/**'
- '.github/scripts/libmentor-version.py'
- 'icon.png'
- '.github/workflows/pages.yml'
workflow_dispatch:
Expand Down Expand Up @@ -52,6 +59,11 @@ jobs:
working-directory: docs
run: npm run build

- uses: ./.github/actions/libmentor

- name: Include AI documentation
run: cp -R .libmentor docs/.vitepress/dist/ai

- uses: actions/configure-pages@v5

- uses: actions/upload-pages-artifact@v3
Expand Down
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -364,3 +364,6 @@ MigrationBackup/
docs/node_modules/
docs/.vitepress/dist/
docs/.vitepress/cache/

.libmentor/
.libmentor-inputs/
11 changes: 11 additions & 0 deletions LIBMENTOR.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# AI documentation

LibMentor generates versioned documentation from this repository. Restore the pinned tool with `dotnet tool restore`, then run `dotnet tool run libmentor -- generate`.

CI resolves the library version from its existing metadata and adds a source revision suffix. This describes the source snapshot, rather than claiming that a package with the same version has already been released. Files are generated under `.libmentor/`; repository contributor instructions are preserved.

The consumer entry point after deployment is [llms.txt](https://fgilde.github.io/Nextended/ai/llms.txt). The same output is available as the `libmentor-documentation` workflow artifact. The first LibMentor 0.1.0 NuGet release must exist before tool restore can succeed.

The published skill is under `ai/skills/`. Copy the complete library folder, including its references, to your client's skills directory.

Generation validates local Markdown links and explicit API-symbol links. C# source declarations are parsed without a project build; see extraction evidence in `knowledge.json`. Compiled Razor APIs require compiler XML input. Markdown code fences are not compiled automatically.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
| **Documentation portal** | [fgilde.github.io/Nextended](https://fgilde.github.io/Nextended/) | [Dokumentationsportal](docs/de/index.md) |
| **Getting started** | [Installation](docs/guides/installation.md) | [Installation](docs/de/guides/installation.md) |
| **Architecture** | [Overview](docs/guides/architecture.md) | [Überblick](docs/de/guides/architecture.md) |
| **Per-package guides** | [Projects](docs/projects/README.md) | [Projekte](docs/de/projects/README.md) |
| **Per-package guides** | [Projects](docs/projects/index.md) | [Projekte](docs/de/projects/index.md) |
| **Examples** | [Common use cases](docs/examples/common-use-cases.md) | [Typische Anwendungsfälle](docs/de/examples/common-use-cases.md) |

## Packages
Expand Down
33 changes: 33 additions & 0 deletions libmentor.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
{
"schemaVersion": 1,
"name": "Nextended",
"repository": "https://github.com/fgilde/Nextended",
"revision": "main",
"output": ".libmentor",
"exclude": [
"**/*.de.md",
"docs/de/**",
"**/node_modules/**"
],
"examples": [],
"guidance": [
"This is a source snapshot. Check the installed package version and API evidence before suggesting code."
],
"description": "Extension packages for .NET, Blazor, EF Core and Aspire.",
"version": "10.1.51-source",
"documents": [
"README.md",
"Nextended.*/README.md",
"docs/**/*.md"
],
"sources": [
"Nextended.*/**/*.cs"
],
"packages": [
"Nextended.Core",
"Nextended.Blazor",
"Nextended.EF",
"Nextended.Aspire"
],
"baseUrl": "https://fgilde.github.io/Nextended/ai"
}
Loading