跳到正文
Skillpedia
网站与界面(前端)48k · #5167

markstream-angular

它能做什么

这个工具可以帮你在 Angular(一种网页开发技术)项目中添加 Markstream 组件。它能让内容像聊天一样逐步显示出来,并确保显示的内容是安全的。

适用场景

  • ✓当你希望文字在 Angular 网站上逐个字符或逐个词语地出现时。
  • ✓需要在现代 Angular 应用中安全地显示内容时。
  • ✓如果你需要集成一个可以实时更新的文本显示系统。

技能链接

https://github.com/sickn33/agentic-awesome-skills/blob/main/plugins/agentic-awesome-skills-claude/skills/markstream-angular/SKILL.md

复制后粘贴给你的 AI(Claude、ChatGPT 或 Cursor),让它按照说明操作。

使用方法

最简单的方法:复制下面的消息,粘贴给你的 AI。它会读取这个技能并按说明操作。

可直接粘贴的消息

请用这个技能帮我:https://github.com/sickn33/agentic-awesome-skills/blob/main/plugins/agentic-awesome-skills-claude/skills/markstream-angular/SKILL.md 阅读该链接中的 SKILL.md 文件,并在我的任务中按照它的说明来做。
想让你的 AI 自己找到这样的技能吗?安装免费的 Skillpedia MCP:只需一行,每次任务前它都会在 15,000+ 个技能中搜索。1 分钟完成安装 →

可以这样问 AI

“我怎样才能让文字在我的 Angular 网站上逐步出现?”

每周 5 个新技能,1 分钟读完。

工作原理

这个工具会把一个特殊组件插入你的 Angular 代码中。该组件被配置为接收文本,并以可控的方式显示,同时提供动画和安全方面的选项。

技术内容(原始 SKILL.md)

作者在 GitHub 上的英文原文。

Markstream Angular

Overview

Add Markstream to Angular 20+ while preserving standalone-component patterns, signal-friendly bindings, safe rendering defaults, and explicit optional dependencies. Use markstream-install for framework selection; use this skill once Angular is confirmed.

When to Use

Use for Angular-specific standalone imports, CSS, signals, custom tags or components, streaming state, and optional peers. Do not use below Angular 20 or when the application cannot accept an alpha renderer API.

Workflow

Inspect the existing package manager, installed package version and project conventions. A requested scoped integration already authorizes routine source/dependency edits; seek approval only for a material scope expansion or unresolved beta/alpha adoption decision.

  1. Confirm Angular 20+ and record that markstream-angular is alpha.
  2. Install the package plus only requested peers. Import markstream-angular/index.css; add KaTeX CSS only for math.
  3. Import MarkstreamAngularComponent into the standalone component's imports.
  4. Start with [content] and [smoothStreaming]="'auto'". Use nodes plus final only when another layer owns the AST.
  5. For live chat use [fade]="false" and opt into [typewriter]="true". On completion set [final]="true", disable pacing/cursor, and enable fade only if desired.
  6. Use [customHtmlTags] and [customComponents] only for trusted tag workflows.
  7. Keep [htmlPolicy]="'safe'" and Mermaid strict mode unless a narrowly scoped trusted legacy surface requires otherwise.
  8. Validate with the smallest Angular build, typecheck, or dev command.

Example

import { Component, signal } from '@angular/core'
import { MarkstreamAngularComponent } from 'markstream-angular'
import 'markstream-angular/index.css'

@Component({
  selector: 'app-answer',
  standalone: true,
  imports: [MarkstreamAngularComponent],
  template: `
    <markstream-angular
      [content]="markdown()"
      [final]="done()"
      [fade]="done()"
      [typewriter]="!done()"
      [smoothStreaming]="done() ? false : 'auto'"
      [htmlPolicy]="'safe'"
    />
  `,
})
export class AnswerComponent {
  markdown = signal('# Streaming answer')
  done = signal(false)
}

Limitations

  • Requires Angular 20+ and an alpha package.
  • Browser-heavy peers may need bundler or client-boundary work.
  • This skill does not design the host chat architecture or visual system.

Security & Safety Notes

Review dependency changes before installation. Never broaden HTML or Mermaid trust settings for untrusted model output.

Verify props, export paths and peer ranges against the installed package, not a mutable upstream main. Test partial and completed streams, malformed/untrusted Markdown, links and image URLs, cancellation and reduced motion. Safe HTML and strict diagrams reduce exposure but do not alone enforce URL/network privacy or application component permissions.

常见问题

“alpha”是什么意思?

alpha 表示该工具仍处于测试阶段,可能会有变动。建议只在你清楚自己在做什么并了解相关风险的情况下使用。

什么是 standalone component(独立组件)?

这是 Angular 中一种更现代的代码组织方式,每个部分都更加独立。这个工具就是为了很好地配合这种模式而设计的。

“safe HTML defaults”是什么意思?

意思是该工具默认会阻止危险代码显示在你的网站上,从而保护用户。

详情

作者的原始描述

Integrate the alpha markstream-angular renderer into Angular 20+ applications with standalone components, signals, safe HTML defaults, and optional peer features.

repo: sickn33/agentic-awesome-skills

热度

GitHub 星标
48k
排名
#5167
许可证
MIT
更新时间
2026/10/15

这个技能有用吗?

0

登录 后即可投票。

评论

  • …

同一仓库的更多技能

相似技能