agentleFS
kumaran-iskumaran-is/claude-code-onboarding/.claude/skills/ai-chat/SKILL.md

ai-chat

Skill36 starsChanged 6 months agoMITView on GitHub

AI chat interface patterns for Angular 21.x and Flutter 3.41.x. Use when building streaming chat UI, conversational AI assistants, copilots, token context indicators, feedback loops, multi-modal inputs, tool visualization, or AI-specific error handling. Covers streaming markdown, auto-scroll heuristics, memoized rendering, token limit UI, regeneration controls, thumbs up/down feedback, and AI error states.

2 other projects use a version of this.

Adopted by

Most recently taken up by

The file

Show its rules and text

We split this skill into the rules it gives an agent

14 rules. About 0 are common, 4 are distinctive, and 10 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈4

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 10

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Before writing any component:

    line 35
  2. Very specific:

    Angular: Read angular-spa skill — verify signal/OnPush/daisyUI baseline

    line 37
  3. Very specific:

    Flutter: Read flutter-mobile skill — verify Riverpod/AppSpacing/colorScheme baseline

    line 38
  4. Very specific:

    Docs: Use Context7 MCP for any library not confirmed in this session (e.g., marked, flutter_markdown)

    line 39
  5. Very specific:

    Use AbortController to cancel in-flight SSE streams

    line 60
  6. Very specific:

    Check MediaQuery.of(context).disableAnimations before scroll animations

    line 68
  7. Distinctive:

    Always display "~N messages remaining" not raw token numbers

    line 73
  8. Very specific:

    Every AI error type has a distinct UI state — see reference/ai-error-handling.md

    line 76
  9. Distinctive:

    NEVER swallow AI errors silently — always show user-visible feedback with an action

    line 77
  10. Very specific:

    NEVER: use constructor DI in Angular — use inject()

    line 105
  11. Very specific:

    NEVER: use @Input()/@Output() decorators — use input(), output(), model() signals

    line 106
  12. Very specific:

    NEVER: use raw EdgeInsets numeric literals in Flutter — use AppSpacing tokens

    line 107
  13. Very specific:

    NEVER: use Color(0x...) literals in Flutter — use Theme.of(context).colorScheme

    line 108
  14. Distinctive:

    After implementation, dispatch these reviewer agents:

    line 112

≈ “Common” is an estimate: at least 1 in 5 of the 213,897 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Iron Law: Load this skill before building any chat interface; never hardcode streaming or message formats without verifying against the skill's patterns.

AI Chat Interface Skill

Tech Stack: Angular 21.x (signals, daisyUI, TailwindCSS) | Flutter 3.41.x (Riverpod, Dart 3.10.9)

When to Activate

Load this skill when the task involves any of:

  • Streaming LLM response rendering (SSE / chunked HTTP)
  • Chat message list with assistant/user bubbles
  • Token context window indicators
  • Regenerate / stop generation controls
  • Thumbs up/down feedback collection
  • Multi-modal input (file/image attachment in a chat box)
  • AI-specific error states (refusal, rate limit, context exceeded)
  • Tool call visualization in the message thread

Pre-Code Checklist

Before writing any component:

  1. Angular: Read angular-spa skill — verify signal/OnPush/daisyUI baseline
  2. Flutter: Read flutter-mobile skill — verify Riverpod/AppSpacing/colorScheme baseline
  3. Docs: Use Context7 MCP for any library not confirmed in this session (e.g., marked, flutter_markdown)

Core Component Overview

ComponentAngularFlutter
Message bubble listChatMessageListComponentChatMessageList widget
Streaming message displayStreamingMessageComponentStreamedMessageWidget
Token context indicatorTokenIndicatorComponentTokenIndicatorWidget
Chat input (multi-modal)ChatInputComponentChatInputWidget
Feedback barFeedbackComponentFeedbackBar widget
AI error displayAiErrorComponentAiErrorWidget
Tool call visualizationToolCallCardComponentToolCallCard widget

Quick Start

See reference/quick-start.md for entry-point wiring (Angular ChatComponent + Flutter ChatScreen).

Key Patterns (brief — details in reference files)

Streaming (Angular)

  • Use AbortController to cancel in-flight SSE streams
  • Auto-scroll: scroll only when user is within 100px of bottom
  • computed() signal to derive rendered markdown — prevents re-parsing on every chunk
  • aria-live="polite" wraps the message list

Streaming (Flutter)

  • AsyncNotifier with Stream.listen updates state incrementally
  • ScrollController + addPostFrameCallback for auto-scroll after frame
  • Check MediaQuery.of(context).disableAnimations before scroll animations

Token Context

  • Angular: TokenIndicatorComponent uses daisyUI progress + text-warning/text-error classes at 80%/100% thresholds
  • Flutter: LinearProgressIndicator with colorScheme.error / colorScheme.tertiary
  • Always display "~N messages remaining" not raw token numbers

AI Errors

  • Every AI error type has a distinct UI state — see reference/ai-error-handling.md
  • NEVER swallow AI errors silently — always show user-visible feedback with an action

Feedback

  • Angular: signal<'up'|'down'|null> tracks selected thumb; regenerate re-emits prompt
  • Flutter: HapticFeedback.lightImpact() on thumb press; colorScheme.primary for active state

Multi-Modal Input

  • Angular: Angular CDK drag-drop for file zone; Enter sends, Shift+Enter newlines
  • Flutter: image_picker for attachments; maxLines: null for auto-expanding TextField

Reference Files

FileContents
reference/quick-start.mdEntry-point wiring for Angular ChatComponent and Flutter ChatScreen
reference/streaming-patterns.mdStreaming UX, auto-scroll, memoization, stop controls
reference/context-management.mdToken indicator, threshold logic, summarization trigger
reference/ai-error-handling.mdRefusal, rate limit, context exceeded, timeout, hallucination flag
reference/feedback-loops.mdThumbs up/down, copy, regenerate — Angular & Flutter
reference/multimodal-input.mdFile attach, preview chips, auto-expand textarea/field

Anti-Patterns — Hard Prohibitions

  • NEVER re-parse markdown on every streaming chunk — memoize with computed() / derived state
  • NEVER auto-scroll unconditionally — it steals user scroll position mid-read
  • NEVER display raw token counts to end users — use human-readable approximations
  • NEVER silently ignore AI error responses — every error must log + show user feedback
  • NEVER hardcode colors for error/warning states — use daisyUI tokens or colorScheme
  • NEVER use constructor DI in Angular — use inject()
  • NEVER use @Input()/@Output() decorators — use input(), output(), model() signals
  • NEVER use raw EdgeInsets numeric literals in Flutter — use AppSpacing tokens
  • NEVER use Color(0x...) literals in Flutter — use Theme.of(context).colorScheme

Post-Code Review

After implementation, dispatch these reviewer agents:

ConcernAgent
Angular code qualitycode-reviewer
Accessibility (ARIA, keyboard nav)accessibility-auditor
Flutter/Riverpod patternsriverpod-reviewer
Security (file uploads, content rendering)security-reviewer
UI/UX consistencyui-standards-expert

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.