Command Palette

Search for a command to run...

UnylyUnyly
Назад к скиллам

understanding-architecture

БесплатноБез исполняемых скриптовНе проверен

Provides architecture overview with state machines, SSE event flow, and file mappings. Use when understanding system design, debugging state issues, or…

microsoft-foundryот microsoft-foundry★ 137 звёзд на GitHub

Об этом скилле

Understanding Architecture

Load this skill when: Understanding system design, debugging state transitions, tracing SSE events, or updating architecture documentation.

Quick Reference

System Overview

Layer Tech Port Entry Point
Frontend React 19 + Vite 5173 frontend/src/App.tsx
Backend ASP.NET Core 9 8080 backend/WebApp.Api/Program.cs
Auth MSAL.js → JWT Bearer — frontend/src/config/authConfig.ts
AI SDK Azure.AI.Projects (GA) + Azure.AI.Extensions.OpenAI — backend/.../AgentFrameworkService.cs

Data Flow

User → ChatInput → CHAT_SEND_MESSAGE → ChatService.sendMessage()
     → POST /api/chat/stream (JWT) → AgentFrameworkService.StreamMessageAsync()
     → AI Foundry → SSE chunks → parseSseLine() → Reducer actions → UI update

State Machines

Chat States

idle ──CHAT_SEND_MESSAGE──► sending ──CHAT_START_STREAM──► streaming
  ▲                            │                              │
  │                            ▼                              ▼
  └──CHAT_CLEAR_ERROR─── error ◄──CHAT_ERROR──────────────────┤
  │                                                           │
  └──CHAT_STREAM_COMPLETE / CHAT_CANCEL_STREAM / CHAT_MCP_APPROVAL_REQUEST
State Input Enabled streamingMessageId
idle ✅ Yes undefined
sending ❌ No undefined
streaming ❌ No Message ID
error If recoverable undefined

Auth States

initializing ──AUTH_INITIALIZED──► authenticated ──AUTH_TOKEN_EXPIRED──► unauthenticated
                                         │                                    │
                                         └───────────AUTH_INITIALIZED──────────┘

SSE Event Flow

Backend → Frontend Mapping

SSE Event Backend Method Frontend Action Reducer Effect
conversationId WriteConversationIdEvent CHAT_START_STREAM Set conversationId
chunk WriteChunkEvent CHAT_STREAM_CHUNK Append content
annotations WriteAnnotationsEvent CHAT_STREAM_ANNOTATIONS Add citations
mcpApprovalRequest WriteMcpApprovalRequestEvent CHAT_MCP_APPROVAL_REQUEST Show approval UI
usage WriteUsageEvent CHAT_STREAM_COMPLETE Add token counts
done WriteDoneEvent CHAT_STREAM_COMPLETE Finalize
error WriteErrorEvent CHAT_ERROR Set error state

Event Sequence

1. conversationId  (always first)
2. chunk           (0-N times)
3. annotations     (0-N times, after item complete)
4. mcpApprovalRequest (0-1 times, pauses stream)
5. usage           (always before done)
6. done            (always last)

Key Files by Domain

State Management

File Purpose
frontend/src/types/appState.ts State & action type definitions
frontend/src/reducers/appReducer.ts All state transitions
frontend/src/contexts/AppContext.tsx Provider + dev logging

SSE Streaming

File Purpose
backend/WebApp.Api/Program.cs SSE endpoints + Write*Event helpers
frontend/src/services/chatService.ts SSE client + action dispatch
frontend/src/utils/sseParser.ts Line parsing + event types

AI Integration

File Purpose
backend/.../AgentFrameworkService.cs Agent loading + streaming
backend/.../Models/StreamChunk.cs Chunk types (text, annotations, MCP)
backend/.../Models/ChatRequest.cs Request payload structure

Full Documentation

For complete diagrams and detailed flows, see:

  • ARCHITECTURE-FLOW.md - Full Mermaid diagrams
  • Part 1: Backend flow (request pipeline, credential resolution, agent loading)
  • Part 2: Frontend state (auth, chat, UI state machines)
  • Part 3: Performance patterns (reducer optimizations)
  • Part 4: Extending the state (adding new actions)
  • Part 5: Backend patterns (validation, error format, async)
  • Part 6: File reference (all key files)

Maintaining ARCHITECTURE-FLOW.md

When to Update

Update the architecture document when:

Change Type What to Update
New SSE event type Section 1.5 (Backend SSE Event Types), Section 2.8 (SSE → Action Mapping)
New reducer action Section 2.7 (Action Reference), state machine diagrams
New API endpoint Section 1.1 (Request Pipeline flowchart)
New auth state Section 2.1 (Authentication State Machine)
New chat state Section 2.2 (Chat State Machine)
File moved/renamed Part 6 (File Reference tables)
Validation rules changed Section 5.1 (Attachment Validation)

Validation Checklist

Before committing architecture doc changes:

□ Mermaid Diagrams
  □ All states
Полный SKILL.md на GitHub

Установить understanding-architecture в Claude Code и Claude Desktop

Зарегайся, чтобы установить скилл

Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.

  • Открой команду установки в одну строку
  • Сохраняй скиллы в синхронизируемую библиотеку
  • Уведомления, когда скиллы обновляются
Зарегаться бесплатноУ меня уже есть аккаунт

Разрешённые инструменты

Инструменты, которые скиллу разрешено вызывать.

Без ограничений — скилл может использовать любой инструмент.

FAQ

Что делает скилл understanding-architecture?

Provides architecture overview with state machines, SSE event flow, and file mappings. Use when understanding system design, debugging state issues, or maintaining ARCHITECTURE-FLOW.md.

Как установить скилл understanding-architecture?

Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.

Скилл understanding-architecture запускает скрипты?

Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.

Похожие скиллы

Сравнить understanding-architecture с