domain-readme
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseDomain README Generator
领域README生成器
Generate or update a for the domain library at .
README.md$ARGUMENTS为位于的领域库生成或更新文件。
$ARGUMENTSREADME.mdStep 1 — Resolve the Target Path
步骤1 — 解析目标路径
$ARGUMENTS- A relative path:
libs/widget-chat - A domain name: → look for
widget-chatlibs/widget-chat - An import path: → look it up in the Domain Registry in
@myapp/widget-chatCLAUDE.md
If the path cannot be resolved, ask the user.
$ARGUMENTS- 相对路径:
libs/widget-chat - 领域名:→ 查找
widget-chatlibs/widget-chat - 导入路径:→ 在
@myapp/widget-chat的领域注册表中查找CLAUDE.md
如果无法解析路径,请询问用户。
Step 2 — Inventory the Library
步骤2 — 清点库内容
Read the following files (skip those that don't exist):
<path>/
index.ts ← public API surface
src/lib/ ← all source files
src/index.ts ← re-exports
project.json ← name, tags, importPath
package.json ← name, version, peerDeps
ng-package.json ← Angular package configFor each subdirectory in :
src/lib/- Identify the layer type: ,
domain,feature,uiutil - List key exported symbols: services, stores, components, directives, pipes, types
Focus on:
- NgRx Stores: read the store file, extract state interface, computed signals, methods
- Facade services: extract public methods and their signatures
- Angular components: extract /
@Input()properties and selector@Output() - Public types/interfaces: exported from
index.ts
读取以下文件(不存在的文件直接跳过):
<path>/
index.ts ← public API surface
src/lib/ ← all source files
src/index.ts ← re-exports
project.json ← name, tags, importPath
package.json ← name, version, peerDeps
ng-package.json ← Angular package config对于下的每个子目录:
src/lib/- 识别层类型:,
domain,feature,uiutil - 列出核心导出符号:services, stores, components, directives, pipes, types
重点关注:
- NgRx Stores:读取store文件,提取state接口、计算信号、方法
- Facade services:提取公共方法及其签名
- Angular components:提取/
@Input()属性和选择器@Output() - 公共类型/接口:从导出的内容
index.ts
Step 3 — Generate the README
步骤3 — 生成README
Write a with this exact structure:
README.mdmarkdown
undefined按照以下固定结构编写:
README.mdmarkdown
undefined<Library Name>
<Library Name>
<One-sentence description. What this library does and why it exists.>
<One-sentence description. What this library does and why it exists.>
Architecture
Architecture
<Describe the layer structure. Include a text diagram if the library has multiple layers.>
```
<path>/
├── domain/ → NgRx store, facade, services
├── feature/ → Container components, routing
├── ui/ → Presentational components
└── util/ → Types, helpers
```
<Describe the layer structure. Include a text diagram if the library has multiple layers.>
```
<path>/
├── domain/ → NgRx store, facade, services
├── feature/ → Container components, routing
├── ui/ → Presentational components
└── util/ → Types, helpers
```
Public API
Public API
<ServiceName>
<ServiceName>
import { ServiceName } from '<importPath>'
| Method / Property | Type | Description |
|---|---|---|
| | What it does |
import { ServiceName } from '<importPath>'
| Method / Property | Type | Description |
|---|---|---|
| | What it does |
<StoreName> (NgRx Signal Store)
<StoreName> (NgRx Signal Store)
| Signal / Method | Type | Description |
|---|---|---|
| | List of items |
| | Fetches items from API |
| Signal / Method | Type | Description |
|---|---|---|
| | List of items |
| | Fetches items from API |
<ComponentName>
<ComponentName>
Selector:
<app-component-name>| Input | Type | Description |
|---|---|---|
| | Data to display |
| Output | Type | Description |
|---|---|---|
| | Emits on selection |
Selector:
<app-component-name>| Input | Type | Description |
|---|---|---|
| | Data to display |
| Output | Type | Description |
|---|---|---|
| | Emits on selection |
Key Patterns
Key Patterns
<Document any conventions specific to this domain:>
- State shape and update strategy
- Error handling approach
- How the facade wraps the store
- Any domain-specific patterns
<Document any conventions specific to this domain:>
- State shape and update strategy
- Error handling approach
- How the facade wraps the store
- Any domain-specific patterns
Usage Example
Usage Example
```typescript
import { FeatureComponent } from '<importPath>/feature';
import { DomainService } from '<importPath>/domain';
// Minimal example showing how to consume this library
```
```typescript
import { FeatureComponent } from '<importPath>/feature';
import { DomainService } from '<importPath>/domain';
// Minimal example showing how to consume this library
```
Dependencies
Dependencies
Depends on:
- — description
@scope/shared/...
Consumed by:
- — used as widget
apps/aero-host
Depends on:
- — description
@scope/shared/...
Consumed by:
- — used as widget
apps/aero-host
Development
Development
```bash
npx nx test <project-name> # Run unit tests
npx nx build <project-name> # Build library
npx nx lint <project-name> # Lint
```
undefined```bash
npx nx test <project-name> # Run unit tests
npx nx build <project-name> # Build library
npx nx lint <project-name> # Lint
```
undefinedStep 4 — Handle Existing README
步骤4 — 处理已有的README
If already exists:
README.md- Preserve any manually written sections that are not auto-generated
- Update sections that reflect code (Public API, Dependencies)
- Add a comment at the top of auto-generated sections:
<!-- auto-generated by domain-readme skill, do not edit manually -->
如果已存在:
README.md- 保留所有非自动生成的手动编写章节
- 更新反映代码的章节(公共API、依赖)
- 在自动生成章节的顶部添加注释:
<!-- auto-generated by domain-readme skill, do not edit manually -->
Step 5 — Write the File
步骤5 — 写入文件
Write the generated content to .
<path>/README.mdConfirm to the user:
✓ README.md written to <path>/README.md
Documented: N services, N stores, N components将生成的内容写入。
<path>/README.md向用户返回确认信息:
✓ README.md written to <path>/README.md
Documented: N services, N stores, N componentsArguments
参数
$ARGUMENTSExamples:
/domain-readme libs/widget-chat/domain-readme widget-chat/domain-readme libs/shared/sidebar- ← no args: ask the user which domain to document
/domain-readme
$ARGUMENTS示例:
/domain-readme libs/widget-chat/domain-readme widget-chat/domain-readme libs/shared/sidebar- ← 无参数:询问用户要生成文档的领域
/domain-readme