SuperAPI AI Directory

intent-check

Agents & models

View repository

Updated 10-15 17:17

About this skill

Intent Check

Triggers the Intent check process, serving as the user-friendly entry point for the intent-validate and intent-sync agents.

Features

  1. Format Validation (intent-validate) - Checks whether Intent files conform to the IDD specification
  2. Code Sync (intent-sync) - Checks the consistency between code implementation and Intent
  3. Comprehensive Report - Summarizes the results of both checks

Workflow

/intent-check [options]
        ↓
┌───────────────────────────────────┐
│  确定检查范围                      │
│  - 指定路径 or 当前目录            │
│  - 单模块 or 全项目                │
└─────────────┬─────────────────────┘
              ↓
┌───────────────────────────────────┐
│  调用 intent-validate agent       │
│  → 格式合规报告                    │
└─────────────┬─────────────────────┘
              ↓
┌───────────────────────────────────┐
│  调用 intent-sync agent           │
│  → 代码一致性报告                  │
└─────────────┬─────────────────────┘
              ↓
┌───────────────────────────────────┐
│  汇总报告                          │
│  - 问题列表                        │
│  - 修复建议                        │
│  - 行动项                          │
└───────────────────────────────────┘

Usage

Full Check

/intent-check

Checks the Intent in the current directory, including format validation and code sync.

Specify Path

/intent-check src/core/

Checks the specified module.

Format Validation Only

/intent-check --validate

Runs only intent-validate to check the Intent file format.

Code Sync Only

/intent-check --sync

Runs only intent-sync to check the consistency between code and Intent.

Full Project Check

/intent-check --all

Scans and checks all Intent files in the project.

Git Diff Check

/intent-check --git-diff origin/main

Checks only the modules that have changes relative to the base branch.

Output Example

# Intent Check Report

> 检查时间: 2026-01-19 14:30
> 检查范围: src/core/

## 概览

| 检查项 | 状态 | 问题数 |
|--------|------|--------|
| 格式验证 | ⚠️ | 3 |
| 代码同步 | ❌ | 5 |

## 格式问题 (intent-validate)

### ⚠️ 警告

1. `src/core/intent/INTENT.md:45`
   - 缺少 ASCII 结构图

2. `src/core/intent/INTENT.md:78`
   - API 定义缺少返回值说明

### ❌ 错误

1. `src/core/intent/INTENT.md:12`
   - Section 标记语法错误: `::: lock` → `::: locked`

## 同步问题 (intent-sync)

### 新增未记录

| API | 文件 | 建议 |
|-----|------|------|
| `getChamberStats()` | chamber.js:89 | 添加到 Intent |

### 签名不一致

```diff
# deleteChamber
- Intent: deleteChamber(app, name)
+ Code:   deleteChamber(app, name, options)

Boundary Violation

Rule Location Description
Direct path concatenation is prohibited routes/apps.js:45 Should use chamber.getPath()

Action Recommendations

Fix Immediately (P0)

  1. Fix Section marker syntax errors
  2. Fix boundary violations

Recommended Fixes (P1)

  1. Update Intent: add getChamberStats() API
  2. Update Intent: deleteChamber add the options parameter

Optional Improvements (P2)

  1. Add ASCII structure diagram
  2. Supplement API return value descriptions

## 退出码

| 码 | 含义 |
|----|------|
| 0 | 全部通过 |
| 1 | 有警告 |
| 2 | 有错误 |

可用于 CI/CD 集成:

```bash
/intent-check || exit 1

Working with Other Commands

/intent-init              # 初始化
    ↓
/intent-interview         # 创建 Intent
    ↓
/intent-review            # 审批
    ↓
[开发实现]
    ↓
/intent-check             # ← 检查(本命令)
    ↓
修复问题 or 更新 Intent
    ↓
/intent-check             # 再次检查直到通过