LightSpec Skill
LightSpec is a CLI tool that brings spec‑driven development to any AI‑assisted workflow. It helps you create feature specifications, track changes, and implement code based on those specs. This skill teaches your OpenClaw agent how to install, verify, update, uninstall, and use LightSpec effectively.
For more details on LightSpec, visit the Lightspec repository
Installation
LightSpec requires Node.js (v18 or later). The agent can install it globally via npm:
CODEBLOCK0
If Node.js is not present, the agent should first install Node.js (platform‑specific instructions can be provided if needed).
Verification
To confirm LightSpec is installed correctly, run:
CODEBLOCK1
The agent should expect a version number like 1.2.3. If the command fails, installation should be retried or the user notified.
Updating
To update LightSpec to the latest version:
CODEBLOCK2
After updating, verify again with lightspec --version.
Uninstalling
To remove LightSpec completely:
CODEBLOCK3
Basic Usage
All LightSpec commands follow the pattern:
CODEBLOCK4
Initialize a Project
Run inside a project directory to set up LightSpec:
CODEBLOCK5
This creates a lightspec/ folder and injects instructions into AGENTS.md (if present). The agent can then use the generated structure.
Create a New Feature Spec
CODEBLOCK6
Or using the spec subcommand (depending on version). The agent should inspect the output to see where the spec file was created (usually lightspec/changes/<change-name>/spec.md).
List Existing Changes or Specs
CODEBLOCK7
View Interactive Dashboard
CODEBLOCK8
The agent can run this to get a high‑level overview of all changes and specs.
Validate a Spec or Change
CODEBLOCK9
Checks for completeness and consistency.
Apply a Change (Implement)
After a spec is approved, the agent can apply it to the codebase:
CODEBLOCK10
This command generates code or updates files based on the spec (implementation details depend on the project’s configuration).
Show Details of a Change or Spec
CODEBLOCK11
Workflow Example
- 1. Initialize project (if not already done)
CODEBLOCK12
- 2. Create a change proposal
CODEBLOCK13
- 3. Read the generated spec
The agent can use
read_file to inspect
lightspec/changes/add-profile-search-filters/spec.md.
- 4. Ask the user what’s missing
The agent can summarise the spec and point out gaps (e.g., missing acceptance criteria).
- 5. Validate the spec
CODEBLOCK14
- 6. Implement after approval
CODEBLOCK15
Tips for the Agent
- - Always confirm with the user before running commands that change files (e.g.,
apply, init in an existing project). - Use
lightspec --help or lightspec help [command] if you need more details about a subcommand. - LightSpec respects
.lightspec/config.json for custom paths – the agent can read that to understand project‑specific settings. - Refer to the official LightSpec documentation for the most updated information, guidence and how to guide the user.
ClawHub Installation
To install this skill from ClawHub, the user can run:
CODEBLOCK16
Once installed, the agent will automatically load this skill and be able to assist with LightSpec tasks.
LightSpec 技能
LightSpec 是一款 CLI 工具,可为任何 AI 辅助工作流带来规范驱动开发。它帮助您创建功能规范、跟踪变更,并基于这些规范实现代码。本技能将教会您的 OpenClaw 代理如何有效安装、验证、更新、卸载和使用 LightSpec。
有关 LightSpec 的更多详情,请访问 Lightspec 仓库
安装
LightSpec 需要 Node.js(v18 或更高版本)。代理可通过 npm 全局安装:
npm install -g lightspec
如果未安装 Node.js,代理应首先安装 Node.js(如有需要,可提供特定平台的安装说明)。
验证
要确认 LightSpec 已正确安装,请运行:
lightspec --version
代理应看到类似 1.2.3 的版本号。如果命令失败,应重试安装或通知用户。
更新
要将 LightSpec 更新到最新版本:
npm update -g lightspec
更新后,再次使用 lightspec --version 进行验证。
卸载
要完全移除 LightSpec:
npm uninstall -g lightspec
基本用法
所有 LightSpec 命令遵循以下模式:
lightspec [command] [options]
初始化项目
在项目目录内运行以设置 LightSpec:
lightspec init
这将创建一个 lightspec/ 文件夹,并将指令注入 AGENTS.md(如果存在)。代理随后可使用生成的结构。
创建新功能规范
lightspec change 用户认证
或使用 spec 子命令(取决于版本)。代理应检查输出以查看规范文件创建的位置(通常为 lightspec/changes//spec.md)。
列出现有变更或规范
lightspec list # 列出活跃变更
lightspec list --specs # 列出所有规范
查看交互式仪表盘
lightspec view
代理可运行此命令以获取所有变更和规范的高级概览。
验证规范或变更
lightspec validate [change-name]
检查完整性和一致性。
应用变更(实现)
规范获批后,代理可将其应用到代码库:
lightspec apply [change-name]
此命令根据规范生成代码或更新文件(具体实现取决于项目配置)。
显示变更或规范的详情
lightspec show [change-name]
工作流示例
- 1. 初始化项目(如果尚未完成)
lightspec init
- 2. 创建变更提案
lightspec change 按角色和团队添加个人资料搜索筛选器
- 3. 读取生成的规范
代理可使用 read_file 检查 lightspec/changes/add-profile-search-filters/spec.md。
- 4. 询问用户缺少什么
代理可总结规范并指出差距(例如,缺少验收标准)。
- 5. 验证规范
lightspec validate add-profile-search-filters
- 6. 获批后实现
lightspec apply add-profile-search-filters
代理提示
- - 在运行会修改文件的命令(例如,在现有项目中执行 apply、init)之前,务必先与用户确认。
- 如需了解子命令的更多详情,请使用 lightspec --help 或 lightspec help [command]。
- LightSpec 遵循 .lightspec/config.json 中的自定义路径——代理可读取该文件以了解项目特定设置。
- 请参阅官方 LightSpec 文档以获取最新信息、指南以及如何引导用户。
ClawHub 安装
要从 ClawHub 安装此技能,用户可运行:
openclaw install lightspec
安装后,代理将自动加载此技能,并能够协助处理 LightSpec 相关任务。