intent-check

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Intent Check

Intent Check

触发 Intent 检查流程,是 intent-validate 和 intent-sync agents 的用户友好入口。
Trigger the Intent check process, a user-friendly entry point for intent-validate and intent-sync agents.

功能

Features

  1. 格式验证 (intent-validate) - 检查 Intent 文件是否符合 IDD 规范
  2. 代码同步 (intent-sync) - 检查代码实现与 Intent 的一致性
  3. 综合报告 - 汇总两项检查结果
  1. Format Validation (intent-validate) - Check if Intent files comply with IDD specifications
  2. Code Sync (intent-sync) - Verify consistency between code implementation and Intent
  3. Comprehensive Report - Aggregate results from both checks

工作流程

Workflow

/intent-check [options]
┌───────────────────────────────────┐
│  确定检查范围                      │
│  - 指定路径 or 当前目录            │
│  - 单模块 or 全项目                │
└─────────────┬─────────────────────┘
┌───────────────────────────────────┐
│  调用 intent-validate agent       │
│  → 格式合规报告                    │
└─────────────┬─────────────────────┘
┌───────────────────────────────────┐
│  调用 intent-sync agent           │
│  → 代码一致性报告                  │
└─────────────┬─────────────────────┘
┌───────────────────────────────────┐
│  汇总报告                          │
│  - 问题列表                        │
│  - 修复建议                        │
│  - 行动项                          │
└───────────────────────────────────┘
/intent-check [options]
┌───────────────────────────────────┐
│  Determine check scope             │
│  - Specify path or current directory│
│  - Single module or entire project │
└─────────────┬─────────────────────┘
┌───────────────────────────────────┐
│  Call intent-validate agent        │
│  → Format compliance report        │
└─────────────┬─────────────────────┘
┌───────────────────────────────────┐
│  Call intent-sync agent            │
│  → Code consistency report         │
└─────────────┬─────────────────────┘
┌───────────────────────────────────┐
│  Aggregate report                  │
│  - Issue list                      │
│  - Fix suggestions                 │
│  - Action items                    │
└───────────────────────────────────┘

使用方法

Usage

完整检查

Full Check

/intent-check
检查当前目录的 Intent,包括格式验证和代码同步。
/intent-check
Check Intents in the current directory, including format validation and code sync.

指定路径

Specify Path

/intent-check src/core/
检查指定模块。
/intent-check src/core/
Check the specified module.

仅格式验证

Format Validation Only

/intent-check --validate
只运行 intent-validate,检查 Intent 文件格式。
/intent-check --validate
Only run intent-validate to check Intent file formats.

仅代码同步

Code Sync Only

/intent-check --sync
只运行 intent-sync,检查代码与 Intent 一致性。
/intent-check --sync
Only run intent-sync to verify code consistency with Intents.

全项目检查

Full Project Check

/intent-check --all
扫描并检查项目中所有 Intent 文件。
/intent-check --all
Scan and check all Intent files in the project.

Git 差异检查

Git Diff Check

/intent-check --git-diff origin/main
只检查相对于基准分支有变更的模块。
/intent-check --git-diff origin/main
Only check modules that have changes relative to the base branch.

输出示例

Output Example

markdown
undefined
markdown
undefined

Intent Check Report

Intent Check Report

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

概览

Overview

检查项状态问题数
格式验证⚠️3
代码同步5
Check ItemStatusNumber of Issues
Format Validation⚠️3
Code Sync5

格式问题 (intent-validate)

Format Issues (intent-validate)

⚠️ 警告

⚠️ Warnings

  1. src/core/intent/INTENT.md:45
    • 缺少 ASCII 结构图
  2. src/core/intent/INTENT.md:78
    • API 定义缺少返回值说明
  1. src/core/intent/INTENT.md:45
    • Missing ASCII structure diagram
  2. src/core/intent/INTENT.md:78
    • API definition lacks return value description

❌ 错误

❌ Errors

  1. src/core/intent/INTENT.md:12
    • Section 标记语法错误:
      ::: lock
      ::: locked
  1. src/core/intent/INTENT.md:12
    • Section tag syntax error:
      ::: lock
      ::: locked

同步问题 (intent-sync)

Sync Issues (intent-sync)

新增未记录

Newly Added Not Documented

API文件建议
getChamberStats()
chamber.js:89添加到 Intent
APIFileSuggestion
getChamberStats()
chamber.js:89Add to Intent

签名不一致

Signature Mismatch

diff
undefined
diff
undefined

deleteChamber

deleteChamber

  • Intent: deleteChamber(app, name)
  • Code: deleteChamber(app, name, options)
undefined
  • Intent: deleteChamber(app, name)
  • Code: deleteChamber(app, name, options)
undefined

边界违规

Boundary Violation

规则位置说明
禁止直接拼接路径routes/apps.js:45应使用 chamber.getPath()
RuleLocationDescription
Direct path concatenation prohibitedroutes/apps.js:45Should use chamber.getPath()

行动建议

Action Suggestions

立即修复 (P0)

Immediate Fix (P0)

  1. 修复 Section 标记语法错误
  2. 修复边界违规
  1. Fix section tag syntax error
  2. Fix boundary violation

建议修复 (P1)

Recommended Fix (P1)

  1. 更新 Intent: 添加
    getChamberStats()
    API
  2. 更新 Intent:
    deleteChamber
    添加 options 参数
  1. Update Intent: Add
    getChamberStats()
    API
  2. Update Intent: Add options parameter to
    deleteChamber

可选改进 (P2)

Optional Improvements (P2)

  1. 添加 ASCII 结构图
  2. 补充 API 返回值说明
undefined
  1. Add ASCII structure diagram
  2. Supplement API return value descriptions
undefined

退出码

Exit Codes

含义
0全部通过
1有警告
2有错误
可用于 CI/CD 集成:
bash
/intent-check || exit 1
CodeMeaning
0All passed
1Has warnings
2Has errors
Can be used for CI/CD integration:
bash
/intent-check || exit 1

与其他命令配合

Integration with Other Commands

/intent-init              # 初始化
/intent-interview         # 创建 Intent
/intent-review            # 审批
[开发实现]
/intent-check             # ← 检查(本命令)
修复问题 or 更新 Intent
/intent-check             # 再次检查直到通过
/intent-init              # Initialize
/intent-interview         # Create Intent
/intent-review            # Approve
[Development Implementation]
/intent-check             # ← Check (this command)
Fix issues or update Intent
/intent-check             # Recheck until passed