ワンクリックで
chatto-architecture
Update docs/ARCHITECTURE.md to reflect the current state of the codebase by examining code and documentation.
Codex または Claude でインストール この Prompt をコピーして Codex、Claude、または他のアシスタントに貼り付けると、Skill ページを確認してインストールできます。
メニュー
Update docs/ARCHITECTURE.md to reflect the current state of the codebase by examining code and documentation.
Codex または Claude でインストール この Prompt をコピーして Codex、Claude、または他のアシスタントに貼り付けると、Skill ページを確認してインストールできます。
SOC 職業分類に基づく
Use when designing, implementing, reviewing, debugging, or documenting Chatto event-sourced domain behavior, including EVT subjects, aggregate boundaries, Services, projections, optimistic concurrency control, read-your-writes, live/reconnect delivery, replay compatibility, migration safety, and rollback/deployment implications.
Create or update Chatto docs website release pages by comparing release-please state, tags, commits, changelog entries, and PRs
Run a full review of all Architecture Decision Records for implementation drift, contradictions, stale decisions, missing supersession notes, weak rationale, and missing cross-references. Use when the user asks for an ADR review, ADR audit, stale ADR check, architecture decision consistency check, or wants to verify ADRs against the current codebase, feature/design records, architecture docs, glossary, or public API state.
Run a documentation-focused maintenance checkup of the Chatto codebase. Fans out to /fdr, /adr, and /chatto-architecture, then compiles a single consolidated report. Always propose-only — no changes applied without explicit user approval. At the end, points the human at other maintenance skills (/update-project-dependencies, /chatto-security-review) they may want to run themselves.
Production debugging tools for NATS streams, KV buckets, and protobuf events. Covers nats CLI commands, stream inspection, protobuf decoding, and message iteration.
Pre-merge PR checklist for the Chatto codebase. Contains instructions for tasks that must run before a PR is merged. This skill should automatically run when a PR is opened.
| name | chatto-architecture |
| description | Update docs/ARCHITECTURE.md to reflect the current state of the codebase by examining code and documentation. |
Update docs/ARCHITECTURE.md to reflect the current state of the codebase. Examine the code and update the documentation while preserving the established structure and format.
ARCHITECTURE.md follows this exact structure. Preserve all sections and their ordering:
docs/GLOSSARY.md/api/connect mount and generated service paths/api/realtime:
corev1.Event vs transient corev1.LiveEventevt.{aggregateType}.{aggregateId}.{eventType} families and wildcard filterslive.sync.> subjectsDo not add detailed inventories for removed or historical pre-0.1 storage. docs/ARCHITECTURE.md describes the current version of the runtime architecture, not migration archaeology.
Use parallel research where the active agent environment allows it. If subagents are available and the user has authorized delegation, launch multiple focused explorers. Otherwise, run the same searches locally and parallelize read-only shell commands where possible.
Recommended independent research slices:
ConnectRPC API: "Find all services and RPCs in proto/chatto/api/v1/*.proto, all generated handlers registered in cli/internal/connectapi/api.go, and the HTTP mount in cli/internal/http_server/connect.go. List each /api/connect/{fully.qualified.Service}/{Method} endpoint with auth/authorization behavior and a one-line description."
Realtime WebSocket API: "Read proto/chatto/api/v1/realtime.proto, cli/internal/http_server/realtime.go, cli/internal/core/my_events_model.go, and apps/frontend/src/lib/state/server/eventBus.svelte.ts. Summarize hello/auth behavior, frame shape, delivery filtering, and reconnect semantics."
RBAC: "Find all permission constants in cli/internal/core/permissions.go and all Can* functions in cli/internal/core/can.go. Document each permission and what it controls."
Core Models and Services: "Read cli/internal/core/core.go, cli/internal/core/*_service.go, and cli/internal/video/service.go. List current services/model families with their responsibilities and lifecycle/readiness role."
Projections: "Read NewChattoCore, all New*Projection constructors, Subjects() methods, and projection_subjects_test.go. List registered projections, nested read models, and subject filters."
Current Storage: "Find all current CreateOrUpdateStream, CreateOrUpdateKeyValue, and CreateOrUpdateObjectStore calls in cli/internal/core/. List current resources and key/object patterns used by runtime code."
EVT Subjects: "Read cli/internal/events/subjects.go, proto/chatto/core/v1/event.proto, and cli/internal/core/subjects/subjects.go. List durable EVT subject patterns mapped to concrete protobuf event message types, plus transient live.sync.> subjects."
Once research completes:
docs/ARCHITECTURE.mdExamine the codebase to understand current state:
proto/chatto/ for protobuf definitions (event types, messages)cli/internal/core/core.go for service/projection/storage wiringcli/internal/core/*_service.go for current core servicescli/internal/events/subjects.go for durable EVT subject and event-token definitionscli/internal/core/subjects/subjects.go for transient live subject helperscli/internal/core/projection_subjects_test.go for projection subject policydocs/GLOSSARY.md when changing or relying on canonical vocabulary in the Overview/Core Concepts sectioncli/internal/core/permissions.go for permission definitionscli/internal/core/can.go for permission check functionsCreateOrUpdateKeyValue, CreateOrUpdateStream, CreateOrUpdateObjectStore callsEventPublisher, publishLiveEvent, and LiveSync* helpers to find current publish pathsFor ConnectRPC API Overview:
.proto files in proto/chatto/api/v1/cli/internal/connectapi/api.go to verify which generated service handlers are registeredcli/internal/http_server/connect.go to verify the /api/connect mount behaviorcli/internal/connectapi/ to identify auth/authorization behavior and core service delegationEndpoint Inventory table in docs/ARCHITECTURE.md with one row per mounted RPC/api/connect/{proto package}.{Service}/{Method} (for example /api/connect/chatto.api.v1.ServerService/GetServer)For Realtime WebSocket API Overview:
proto/chatto/api/v1/realtime.protocli/internal/http_server/realtime.go for /api/realtime transport behaviorcli/internal/core/my_events_model.go and live/reconnect delivery code to verify authorization and replay behaviorFor RBAC Pointers:
cli/internal/core/permissions.go for all permission constantscli/internal/core/can.go for all Can* functionsowners.emails configuration in server setupdocs/ARCHITECTURE.md as an inventory: link to the authoritative FDRs/rules/source files instead of duplicating the full RBAC model thereFor Overview and Glossary Cross-Reference:
Core Concepts as a pointer to docs/GLOSSARY.md; do not duplicate term definitions theredocs/GLOSSARY.md in the same changedocs/ARCHITECTURE.md for detailed architectureFor Core Services and Projections:
NewChattoCore as the authoritative wiring point for current services and registered projectionsprojection_subjects_test.go to verify subject filtersFor NATS Resource Inventory:
CreateOrUpdateStream calls to list streamsCreateOrUpdateKeyValue calls to list KV bucketsCreateOrUpdateObjectStore calls to list object storesEVT: use cli/internal/events/subjects.go and proto/chatto/core/v1/event.proto as the source of truth for subject patterns and concrete protobuf event message typescli/internal/core/subjects/subjects.go and publishLiveEvent callersGet, Put, Create, Update calls to find all key patternsCompare with existing documentation:
docs/ARCHITECTURE.mdUpdate documentation:
Validation checklist:
NewChattoCore appear in Core Modelsdocs/GLOSSARY.mddocs/GLOSSARY.md is updated if architecture vocabulary changedevents/subjects.go appear in Durable EVT Event Inventory with their concrete protobuf event message typelive.sync.> subjects appear in Transient Live SubjectsEndpoint Inventory tableproto/chatto/api/v1/*.proto that is registered by cli/internal/connectapi/api.go appears in the ConnectRPC endpoint inventory with its full /api/connect/... pathcli/internal/connectapi/Generate a Table of Contents at the beginning of the document (after the title, before the first section). The ToC should:
## (h2) sections as top-level items### (h3) subsections as nested items under their parentFormat:
## Table of Contents
- [Overview](#overview)
- [Core Concepts](#core-concepts)
- [NATS Authentication](#nats-authentication)
- [Embedded NATS](#embedded-nats)
- [External NATS](#external-nats)
- [Architecture & APIs](#architecture--apis)
...
Anchor rules:
&, replace with nothing (e.g., "Architecture & APIs" → #architecture--apis)Always use aligned markdown tables so the source markdown is pleasant to read. Align columns by padding cells with spaces:
| Column1 | Column2 | Column3 |
| ------- | ------- | ---------------------------- |
| value1 | value2 | Longer description text here |
| short | x | Another row |
Not like this (hard to read in source):
| Column1 | Column2 | Column3 |
| --- | --- | --- |
| value1 | value2 | Longer description text here |
| short | x | Another row |
Notes appear after tables as plain text starting with "Notes:" when additional context is needed.
Each major section should include relative links to the most important related source files. This helps readers (human or agent) quickly navigate to the implementation when learning about the architecture.
Where to add links:
Format:
## Core Services
Key files: [`cli/internal/core/core.go`](cli/internal/core/core.go), [`cli/internal/core/*_service.go`](cli/internal/core/), [`cli/internal/video/service.go`](cli/internal/video/service.go)
The Core Services section provides...
Example sections and their key files:
| Section | Key Files |
|---|---|
| Core / Architecture | cli/internal/core/core.go |
| Core Services | cli/internal/core/core.go, cli/internal/core/*_service.go, cli/internal/video/service.go |
| Projection Inventory | cli/internal/core/core.go, cli/internal/core/projection_subjects_test.go, cli/internal/events/projector.go |
| ConnectRPC API | proto/chatto/api/v1/*.proto, cli/internal/connectapi/api.go, cli/internal/http_server/connect.go |
| Realtime WebSocket API | proto/chatto/api/v1/realtime.proto, cli/internal/http_server/realtime.go, cli/internal/core/my_events_model.go |
| Roles and Permissions | cli/internal/core/permissions.go, cli/internal/core/can.go, cli/internal/rbac/ |
| KV Buckets / Streams | cli/internal/core/core.go, cli/internal/events/subjects.go, proto/chatto/core/v1/event.proto |
| Messages | cli/internal/core/rooms.go |
| Encryption | cli/internal/encryption/ |