Skip to content
Back to skills

En

ASecurity

`anl skill` is an Agent Skill initialization tool that generates AI-assisted development Skill files in your project. Currently supports two Skills: | Skill | Description | | -------------- | ------------------------------------------------------------------------------------------------------------------------------------------- | | **api-report** | API Cha...

  • 4 stars
  • 0 votes
  • 0 copies
  • 3 views
  • Added May 28, 2026
toolsgobashgitapi

Works with

  • claude code
  • cursor
  • api

Security analysis

A100/100

Pro scans all 8 files and shows the line behind each finding

Scanned May 28, 2026

npx -y skills add bianliuzhu/an-cli --skill en --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of En?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for En
[![Security: A β€” Skills Directory](https://www.skillsdirectory.com/api/skills/bianliuzhu-en/badge)](https://www.skillsdirectory.com/skills/bianliuzhu-en)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
# `anl skill` Command

### Feature Overview

`anl skill` is an Agent Skill initialization tool that generates AI-assisted development Skill files in your project.

Currently supports two Skills:

| Skill          | Description                                                                                                                                 |
| -------------- | ------------------------------------------------------------------------------------------------------------------------------------------- |
| **api-report** | API Change Detection Report β€” compares API file changes via git diff, analyzes type changes and impact scope, generates a structured report |
| **api-mock**   | Mock Data Generation β€” generates MockJS-compliant mock data files based on API definitions and associated types                             |

### Prerequisites

- An `an.config.json` configuration file must exist in the project root
- `an.config.json` must contain `swaggerConfig` (with `apiListFileName`, `url`, etc.)
- It is recommended to run `anl type` first to generate API files and type definitions before using `anl skill`

### Usage

```bash
$ anl skill
```

### Interactive Flow

```
πŸ›‘οΈ  an skill - Agent Skill Initializer

? Select Skills to initialize (multi-select):
  [x] api-report  - API Change Detection Report
  [x] api-mock    - Mock Data Generation

? Skill output target:
  ❯ .cursor/skills    (Cursor Skill)
    .claude/commands  (Claude Code /command)
    Custom path...

πŸ“‹ Configuration read from an.config.json:
  - API directory: src/api
  - API files: op.ts, index.ts
  - Types directory: src/types
  - Output: .cursor/skills  (Skill mode)

? Directories to scan for API usage (comma-separated, glob supported): src/pages/**,src/components/**
? Mock data output directory: mocks/

πŸ₯‚ Skill file written: .cursor/skills/api-report/SKILL.md
πŸ₯‚ Skill file written: .cursor/skills/api-mock/SKILL.md

βœ… Skill initialization complete!
```

### Interactive Options

#### 1. Select Skills

Multi-select supported. Use spacebar to toggle selection, Enter to confirm. At least one Skill must be selected.

#### 2. Select Output Target

Choose the output format based on your AI tool:

| Option             | Output Path                      | File Structure       | Tool        |
| ------------------ | -------------------------------- | -------------------- | ----------- |
| `.cursor/skills`   | `.cursor/skills/<name>/SKILL.md` | Directory + SKILL.md | Cursor      |
| `.claude/commands` | `.claude/commands/<name>.md`     | Single file          | Claude Code |
| Custom path        | User-specified                   | Either of the above  | Others      |

#### 3. api-report Configuration

| Prompt                            | Default                          | Description                                                                                        |
| --------------------------------- | -------------------------------- | -------------------------------------------------------------------------------------------------- |
| Directories to scan for API usage | `src/pages/**,src/components/**` | Comma-separated, glob supported. Used to detect where changed APIs are referenced in business code |

#### 4. api-mock Configuration

| Prompt                     | Default  | Description                             |
| -------------------------- | -------- | --------------------------------------- |
| Mock data output directory | `mocks/` | Directory for generated mock JSON files |

### Auto-detected Configuration

The command automatically reads the following from the project's `an.config.json` β€” no manual input required:

| Config              | Source Field                      | Description                                      |
| ------------------- | --------------------------------- | ------------------------------------------------ |
| API file directory  | `saveApiListFolderPath`           | e.g. `src/api`                                   |
| Types directory     | `saveTypeFolderPath`              | e.g. `src/types`                                 |
| API file names      | `swaggerConfig[].apiListFileName` | e.g. `op.ts`, `index.ts`                         |
| Swagger source URLs | `swaggerConfig[].url`             | Written into the Skill template for AI reference |

### Using in Different Tools

#### Using in Cursor

After Skill files are generated to `.cursor/skills/`, Cursor's AI will automatically recognize and use them when appropriate.

Usage: simply describe your needs in natural language in Cursor chat, for example:

- **API change detection**: `"Detect API changes and generate a change report"` or `"Analyze the impact of changes in src/api"`
- **Mock data generation**: `"Generate mock data for all endpoints"` or `"Generate mock data for opTradeOrderQuerypage_POST"`

#### Using in Claude Code

After Skill files are generated to `.claude/commands/`, invoke them via slash commands:

```bash
/api-report    # Run API change detection
/api-mock      # Run mock data generation
```

### Skill Details

#### api-report β€” API Change Detection Report

**How it works:**

1. Compares API files (e.g. `op.ts`, `index.ts`) against git history via `git diff`
2. Parses changed API endpoints (based on the `export const xxx_GET/POST` naming pattern)
3. Detects request/response type changes in `types/connectors/`
4. Detects shared model changes in `types/models/`
5. Scans specified directories for references to changed APIs
6. Outputs a structured report categorized as Breaking Changes / Warnings / Compatible Changes

**Detected change types:**

| Change Type           | Severity   | Description                                |
| --------------------- | ---------- | ------------------------------------------ |
| Endpoint removed      | Breaking   | `export const xxx` line deleted            |
| Path changed          | Breaking   | URL path of same-named function changed    |
| Parameter changed     | Breaking   | Function signature parameter types changed |
| HTTP method changed   | Breaking   | GET/POST/PUT/DELETE changed                |
| Response type changed | Warning    | Generic `<ResponseType>` changed           |
| Endpoint added        | Compatible | New `export const xxx` added               |

#### api-mock β€” Mock Data Generation

**How it works:**

1. Parses all exported API functions from API files, extracting function name, HTTP method, URL path, and response type
2. Traces Response types from `types/connectors/` to actual interface definitions in `types/models/`
3. Recursively resolves nested type references to obtain full field structure
4. Generates mock data intelligently based on field names and types
5. Outputs mock JSON files in the project's established format

**Generated mock file format:**

```json
/**
 * @url /api/forward/op/trade/order/queryPage
 * @method POST
 */
{
	"success": true,
	"code": 0,
	"message": "success",
	"data": {
		"records|20": [
			{
				"id": 1,
				"orderNo": "TP20260115112050937",
				"phone": "13401050329",
				"orderStatus": "COMPLETE"
			}
		],
		"total": 100,
		"size": 10,
		"current": 1,
		"pages": 10
	}
}
```

**Features:**

- File header `@url` + `@method` comments for mock middleware route matching
- Unified `{ success, code, message, data }` response structure
- MockJS syntax for paginated lists (e.g. `"records|20": [...]`)
- Intelligent data inference based on field names (phone numbers, timestamps, prices, enum values, etc.)
- Checks existing mock files before generation to avoid overwrites

### Generated Files

Depending on the selected output target, the file structure is:

**Cursor mode:**

```
project/
β”œβ”€β”€ .cursor/
β”‚   └── skills/
β”‚       β”œβ”€β”€ api-report/
β”‚       β”‚   └── SKILL.md          # API Change Detection Report Skill
β”‚       └── api-mock/
β”‚           └── SKILL.md          # Mock Data Generation Skill
```

**Claude Code mode:**

```
project/
β”œβ”€β”€ .claude/
β”‚   └── commands/
β”‚       β”œβ”€β”€ api-report.md         # /api-report command
β”‚       └── api-mock.md           # /api-mock command
```

### Notes

1. Skill file configurations (API paths, type paths, etc.) are sourced from `an.config.json`; re-run `anl skill` to update after config changes
2. Re-running `anl skill` will overwrite existing Skill files
3. It is recommended to commit generated Skill files to version control for team sharing
4. The api-report Skill relies on git history; on first API generation with no prior version, it will only list current endpoints
5. Mock files generated by api-mock use JSON format, but the header `/** ... */` comment is a project convention (not standard JSON)

Files in this skill

  • README.md2.9 KB
  • _sidebar.md194 B
  • anl-git.md3.1 KB
  • anl-lint.md2.4 KB
  • anl-skill.md8.5 KB
  • anl-type.md80 KB
  • install.md933 B

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.