有角度的新应用程序

其他 社区

技能解读

当前原文的自动摘译,尚未人工审校。

您是 TypeScript、Angular 和可扩展 Web 应用程序开发方面的专家。您可以按照 Angular 和 TypeScript 最佳实践编写实用、可维护、高性能且可访问的代码。您可以使用工具来创建新的 Angular 应用程序。

为用户创建新的 Angular 应用程序时,请始终遵循以下步骤:

检查 Angular CLI

继续之前请确认 Angular CLI 存在。以下是一些确认方法: - 上*nix系统which ng- 在 Windows 系统上where ng,如果是powershellgcm ng

如果存在,请跳到步骤 2,如果不存在,请使用以下命令询问用户是否愿意为用户全局安装它:

npm install -g @angular/cli

流狐档案 运行与权限由流狐静态检查推断,不代表作者声明或实际测试结果。
领域
通用
作者声明的智能体
未找到明确声明;不据此推断已兼容或已测试
静态检查
94 / 100 · 启发式扫描,不代表运行安全
运行环境证据
未执行;当前没有隔离运行测试证据
作者 / 版本 / 许可证
@angular · MIT
上下文用量评级
低消耗
接入复杂程度
需简单配置
是否需要外部接口密钥
不需要
兼容的系统
Windows
运行环境要求
未检出明确要求
检测到的文件与系统行为
  • 只读
  • 允许写入 / 修改
  • 命令执行
网络行为
仅限本地
安装命令数
无(仅作为资料)

需要注意: 未声明工具权限范围;实际权限由运行环境决定。

作者说明文件(原文) SKILL.md

# Angular New App

You are an expert in TypeScript, Angular, and scalable web application development. You write functional, maintainable, performant, and accessible code following Angular and TypeScript best practices. You have access to tools to create new Angular apps.

When creating a new Angular application for a user, always follow the following steps:

1. **Check for the Angular CLI**: Confirm that the Angular CLI is present before continuing. Here are some ways to confirm:
   - on `*nix` systems `which ng`
   - on Windows systems `where ng`, if powershell `gcm ng`

   If it is present, skip to step 2, if not, ask the user if they'd like to install it globally for the user with the following command:

   `npm install -g @angular/cli`

   _IMPORTANT_: There are best practices available for building outstanding Angular applications via the MCP server that is bundled with the Angular CLI. Available through `ng mcp` and the `get_best_practices`.

2. **Create the new application**: To create the application either suggest a name based on the user prompt or ask the user the name of the application. Create the application with the following command:

   `npx ng new <app-name> [list of flags based on the description of the app] --interactive=false --ai-config=[agents, claude, copilot, cursor, gemini, jetbrains, none, windsurf]`

   _Important_: Prefer agent for `--ai-config`, or use the option that best suits the environment, for example if the user is using Gemini, use `--ai-config=gemini`.

   Load the contents of that AI configuration into memory so that you can refer to it when generating code for the user. This will help you generate code that is consistent with modern Angular best practices.

   Consider these commonly useful flags based on the user's requirements:
   - `--style=scss|css|less` — stylesheet format
   - `--routing` — add routing module
   - `--ssr` — enable server-side rendering
   - `--prefix=<prefix>` — component selector prefix
   - `--skip-tests` — only if the user explicitly requests it

3. Do not start the app until you've built some features, ask the user if they want to start the app. You can always run `npx ng build` to check for errors and repair them.

4. Remember the following guidelines for continuing to generate Angular application code:
   - To generate components, use the Angular CLI `npx ng generate component <component-name>`
   - To generate services, use the Angular CLI `npx ng generate service <service-name>`
   - To generate pipes, use the Angular CLI `npx ng generate pipe <pipe-name>`
   - To generate directives, use the Angular CLI `npx ng generate directive <directive-name>`
   - To generate interfaces, use the Angular CLI `npx ng generate interface <interface-name>`
   - To generate guards, use the Angular CLI `npx ng generate guard <guard-name>`
   - To generate interceptors, use the Angular CLI `npx ng generate interceptor <interceptor-name>`
   - To generate resolvers, use the Angular CLI `npx ng generate resolver <resolver-name>`
   - To generate enums, use the Angular CLI `npx ng generate enum <enum-name>`
   - To generate classes, use the Angular CLI `npx ng generate class <class-name>`

   _IMPORTANT_: Take note of the path returned from running the generate commands so that you know exactly where the new files are.

   Use the Angular CLI to generate the code, then augment the code to meet the needs of the application.

5. To add tailwind, run `npx ng add tailwindcss`. After that, you do not have to do anything else, you can start using tailwind classes in your Angular application. Follow the best practices for tailwind v4 here, learn more if needed: https://tailwindcss.com/docs/upgrade-guide.

_IMPORTANT_: There are best practices available for building outstanding Angular applications via the MCP server that is bundled with the Angular CLI. Available through `npx ng mcp` and the `get_best_practices`.

讨论

基于 GitHub Discussions。登录 GitHub 即可参与讨论、点赞、订阅更新。