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("BlazorJS/BlazorJS.csproj").findtext(".//VersionPrefix")
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)
35 changes: 35 additions & 0 deletions .github/workflows/libmentor-pages.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name: Documentation Pages
on:
push:
branches: [master]
workflow_dispatch:
permissions:
contents: read
concurrency:
group: pages
cancel-in-progress: true
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: ./.github/actions/libmentor
- name: Assemble documentation site
run: |
cp -R docs site
cp -R .libmentor site/ai
- uses: actions/upload-pages-artifact@v3
with:
path: site
deploy:
needs: build
runs-on: ubuntu-latest
permissions:
pages: write
id-token: write
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
steps:
- id: deployment
uses: actions/deploy-pages@v4
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: [master]
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
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -349,3 +349,6 @@ MigrationBackup/
# Ionide (cross platform F# VS Code tools) working folder
.ionide/
/.idea

.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/BlazorJS/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.
29 changes: 29 additions & 0 deletions libmentor.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
{
"schemaVersion": 1,
"name": "BlazorJS",
"repository": "https://github.com/fgilde/BlazorJS",
"revision": "master",
"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": "JavaScript loading, unloading and dynamic invocation for Blazor.",
"version": "2.3.0-source",
"documents": [
"README.md",
"docs/index.html"
],
"sources": [
"BlazorJS/**/*.cs"
],
"packages": [
"BlazorJS"
],
"baseUrl": "https://fgilde.github.io/BlazorJS/ai"
}
Loading