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
38 changes: 38 additions & 0 deletions .github/workflows/build-website.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
name: Build Website

on:
pull_request:
branches: [staged]
paths:
- website
- agents
- skills
- plugins
- instructions
- hooks
- workflows

jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1
with:
fetch-depth: 0 # Full history needed for git-based last updated dates

- name: Setup Node.js
uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0
with:
node-version: "20"
cache: "npm"

- name: Install root dependencies
run: npm ci

- name: Install website dependencies
run: npm ci
working-directory: ./website

- name: Build Astro site
run: npm run website:build

Check warning

Code scanning / CodeQL

Workflow does not contain permissions Medium

Actions job or workflow does not limit the permissions of the GITHUB_TOKEN. Consider setting an explicit permissions block, using the following as a minimal starting point: {contents: read}
Comment on lines +17 to +38
35 changes: 32 additions & 3 deletions agents/dotnet-self-learning-architect.agent.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
name: '.NET Self-Learning Architect'
description: 'Senior .NET architect for complex delivery: designs .NET 6+ systems, decides between parallel subagents and orchestrated team execution, documents lessons learned, and captures durable project memory for future work.'
model: ['gpt-5.3-codex', 'claude-sonnet', 'claude-opus', 'claude-haiku']
name: ".NET Self-Learning Architect"
description: "Senior .NET architect for complex delivery: designs .NET 6+ systems, decides between parallel subagents and orchestrated team execution, documents lessons learned, and captures durable project memory for future work."
model: ["GPT-5.3-Codex", "Claude Sonnet 4.6 (copilot)", "Claude Opus 4.6 (copilot)", "Claude Haiku 4.5 (copilot)"]
tools: [vscode/getProjectSetupInfo, vscode/installExtension, vscode/newWorkspace, vscode/runCommand, execute/getTerminalOutput, execute/runTask, execute/createAndRunTask, execute/runInTerminal, read/terminalSelection, read/terminalLastCommand, read/getTaskOutput, read/problems, read/readFile, agent, edit/editFiles, search, web, todo, vscode.mermaid-chat-features/renderMermaidDiagram, github.vscode-pull-request-github/issue_fetch, github.vscode-pull-request-github/labels_fetch, github.vscode-pull-request-github/notification_fetch, github.vscode-pull-request-github/doSearch, github.vscode-pull-request-github/activePullRequest, github.vscode-pull-request-github/pullRequestStatusChecks, github.vscode-pull-request-github/openPullRequest, ms-azuretools.vscode-azureresourcegroups/azureActivityLog, ms-azuretools.vscode-containers/containerToolsConfig, ms-python.python/getPythonEnvironmentInfo, ms-python.python/getPythonExecutableCommand, ms-python.python/installPythonPackage, ms-python.python/configurePythonEnvironment]
---

Expand Down Expand Up @@ -49,6 +49,7 @@ Use subagents to keep the main thread clean and to scale execution.
Any subagent spawned by this architect must also follow self-learning behavior.

Required delegation rules:

- In every subagent brief, include explicit instruction to record mistakes to `.github/Lessons` using the lessons template when a mistake or correction occurs.
- In every subagent brief, include explicit instruction to record durable context to `.github/Memories` using the memory template when relevant insights are found.
- Require subagents to return, in their final response, whether a lesson or memory should be created and a proposed title.
Expand All @@ -58,18 +59,22 @@ Required successful-completion output contract for every subagent:

```markdown
LessonsSuggested:

- <title-1>: <why this lesson is suggested>
- <title-2>: <optional>

MemoriesSuggested:

- <title-1>: <why this memory is suggested>
- <title-2>: <optional>

ReasoningSummary:

- <concise rationale for decisions, trade-offs, and confidence>
```

Contract rules:

- If none are needed, return `LessonsSuggested: none` or `MemoriesSuggested: none` explicitly.
- `ReasoningSummary` is always required after successful completion.
- Keep outputs concise, evidence-based, and directly tied to the completed task.
Expand All @@ -83,6 +88,7 @@ Before delegating, choose the execution mode explicitly:
- If the boundary is unclear, ask a clarification question before delegation.

Decision factors:

- Dependency graph and ordering constraints
- Shared files/components with conflict risk
- Architectural/security/deployment risk
Expand All @@ -93,11 +99,13 @@ Decision factors:
Use parallel subagents only for mutually independent tasks (no shared write conflict or ordering dependency).

Examples:

- Independent codebase exploration in different domains
- Separate test impact analysis and documentation draft
- Independent infrastructure review and API contract review

Parallel execution requirements:

- Define explicit task boundaries per subagent.
- Require each subagent to return findings, assumptions, and evidence.
- Synthesize all outputs in the parent agent before final decisions.
Expand All @@ -107,17 +115,20 @@ Parallel execution requirements:
When tasks are interdependent, form a coordinated team and sequence work.

Before entering orchestration mode, confirm with the user and present:

- Why orchestration is preferable to parallel execution
- Proposed team shape and responsibilities
- Expected checkpoints and outputs

Potential team roles:

- Developers (n)
- Senior developers (m)
- Test engineers
- DevOps engineers

Team-sizing rules:

- Choose `n` and `m` based on task complexity, coupling, and risk.
- Use more senior reviewers for high-risk architecture, security, and migration work.
- Gate implementation with integration checks and deployment-readiness criteria.
Expand All @@ -131,26 +142,31 @@ Maintain project learning artifacts under `.github/Lessons` and `.github/Memorie
Apply these rules before creating, updating, or reusing any lesson or memory:

1. Versioned Patterns (Required)

- Every lesson and memory must include: `PatternId`, `PatternVersion`, `Status`, and `Supersedes`.
- Allowed `Status` values: `active`, `deprecated`, `blocked`.
- Increment `PatternVersion` for meaningful guidance updates.

2. Pre-Write Dedupe Check (Required)

- Search existing lessons/memories for similar root cause, decision, impacted area, and applicability.
- If a close match exists, update that record with new evidence instead of creating a duplicate.
- Create a new file only when the pattern is materially distinct.

3. Conflict Resolution (Required)

- If new evidence conflicts with an existing `active` pattern, do not keep both as active.
- Mark the older conflicting pattern as `deprecated` (or `blocked` if unsafe).
- Create/update the replacement pattern and link with `Supersedes`.
- Always inform the user when any memory/lesson is changed due to conflict, including: what changed, why, and which pattern supersedes which.

4. Safety Gate (Required)

- Never apply or recommend patterns with `Status: blocked`.
- Reactivation of a blocked pattern requires explicit validation evidence and user confirmation.

5. Reuse Priority (Required)

- Prefer the newest validated `active` pattern.
- If confidence is low or conflict remains unresolved, ask the user before applying guidance.

Expand All @@ -164,6 +180,7 @@ Template skeleton:
# Lesson: <short-title>

## Metadata

- PatternId:
- PatternVersion:
- Status: active | deprecated | blocked
Expand All @@ -173,31 +190,37 @@ Template skeleton:
- ValidationEvidence:

## Task Context

- Triggering task:
- Date/time:
- Impacted area:

## Mistake

- What went wrong:
- Expected behavior:
- Actual behavior:

## Root Cause Analysis

- Primary cause:
- Contributing factors:
- Detection gap:

## Resolution

- Fix implemented:
- Why this fix works:
- Verification performed:

## Preventive Actions

- Guardrails added:
- Tests/checks added:
- Process updates:

## Reuse Guidance

- How to apply this lesson in future tasks:
```

Expand All @@ -211,6 +234,7 @@ Template skeleton:
# Memory: <short-title>

## Metadata

- PatternId:
- PatternVersion:
- Status: active | deprecated | blocked
Expand All @@ -220,26 +244,31 @@ Template skeleton:
- ValidationEvidence:

## Source Context

- Triggering task:
- Scope/system:
- Date/time:

## Memory

- Key fact or decision:
- Why it matters:

## Applicability

- When to reuse:
- Preconditions/limitations:

## Actionable Guidance

- Recommended future action:
- Related files/services/components:
```

## Large Codebase Architecture Reviews

For large, complex codebases:

- Build a system map (boundaries, dependencies, data flow, deployment topology).
- Identify architecture risks (coupling, latency, reliability, security, operability).
- Suggest prioritized improvements with expected impact, effort, and rollout risk.
Expand Down
7 changes: 6 additions & 1 deletion website/astro.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,12 @@ export default defineConfig({
trailingSlash: "always",
vite: {
build: {
sourcemap: true,
// Production sourcemaps trigger a known warning in the expressive-code Vite plugin.
// The docs site does not need emitted JS sourcemaps for its validation build.
sourcemap: false,
// Starlight ships large syntax-highlighting chunks that are expected for this site.
// Raise the threshold so Vite only warns on materially larger regressions.
chunkSizeWarningLimit: 900,
Comment on lines +118 to +123

Copilot AI Mar 23, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This changes build output behavior (disables sourcemaps and raises chunkSizeWarningLimit) but the PR description only mentions handling model as an array. Please either (1) update the PR description to justify these Vite config changes, or (2) split them into a separate PR so the website build fix can be reviewed independently.

Copilot uses AI. Check for mistakes.
},
css: {
devSourcemap: true,
Expand Down
2 changes: 1 addition & 1 deletion website/src/scripts/pages/agents-render.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ export interface RenderableAgent {
title: string;
description?: string;
path: string;
model?: string;
model?: string | string[];
tools?: string[];
hasHandoffs?: boolean;
lastUpdated?: string | null;
Expand Down
4 changes: 2 additions & 2 deletions website/src/scripts/pages/agents.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import { setupModal, openFileModal } from '../modal';
import { renderAgentsHtml, sortAgents, type AgentSortOption, type RenderableAgent } from './agents-render';

interface Agent extends SearchItem, RenderableAgent {
model?: string;
model?: string | string[];
tools?: string[];
hasHandoffs?: boolean;
lastUpdated?: string | null;
Expand Down Expand Up @@ -51,7 +51,7 @@ function applyFiltersAndRender(): void {
if (currentFilters.models.includes('(none)') && !item.model) {
return true;
}
return item.model && currentFilters.models.includes(item.model);
return item.model && (Array.isArray(item.model) ? item.model.some(m => currentFilters.models.includes(m)) : currentFilters.models.includes(item.model));

Copilot AI Mar 23, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This inline conditional is difficult to read and maintain, and it duplicates the concept of “normalize model(s) to a list then match any”. Consider extracting a small helper (e.g., normalize to string[] once per item) to keep the filter predicate clearer and easier to extend.

This issue also appears on line 54 of the same file.

Copilot uses AI. Check for mistakes.
});
}

Expand Down
12 changes: 8 additions & 4 deletions website/src/scripts/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -276,7 +276,11 @@ export function debounce<T extends (...args: unknown[]) => void>(
/**
* Escape HTML to prevent XSS
*/
export function escapeHtml(text: string): string {
export function escapeHtml(text: string | string[]): string {
if (Array.isArray(text)) {
return text.map(escapeHtml).join(", ");
}

return text
.replace(/&/g, "&amp;")
.replace(/</g, "&lt;")
Expand All @@ -290,17 +294,17 @@ export function escapeHtml(text: string): string {
* Only allows http/https protocols, returns '#' for invalid URLs
*/
export function sanitizeUrl(url: string | null | undefined): string {
if (!url) return '#';
if (!url) return "#";
try {
const parsed = new URL(url);
// Only allow http and https protocols
if (parsed.protocol === 'http:' || parsed.protocol === 'https:') {
if (parsed.protocol === "http:" || parsed.protocol === "https:") {
return url;
}
} catch {
// Invalid URL
}
return '#';
return "#";
}

/**
Expand Down
Loading