96SEO 2026-08-07 21:36 25
如题所见,为什么来这么久只写了 100 行代码。却在 Git 统计中看到 10 000 行代码?怎么说呢,这背后隐藏的痛点是:
为了解决这些痛点,这期分享一下了一个“工具”:OpenSpec

OpenSpec 是 AI‑Native 的规范驱动开发程序,为 AI 编码助手提供轻量级规范层。在第一行代码编写之前,先与 AI 对齐需求,让开发过程更可预测、更高效。
它不是模型。也不是 IDE,而是一个框架。它可以让 AI 输出更准确、规范化,让人与 AI 的沟通更加结构化。其实,使用命令 + 问答的模式取代传统的自由对话。使得 AI 更容易理解业务意图,也让开发者清晰看到 AI 正在做什么。
# 验证 Node.js 版本
node --version
# 使用 npm
npm install -g @fission-ai/openspec@latest
# 检查版本
openspec --version
OpenSpec 默认提供四个标准命令:
/opsx:propose/opsx:explore/opsx:apply/opsx:archive如果需要更多命令,可执行全局配置向导:
# 启动配置向导
openspec config profile
# 交互式选择:
# . Delivery and workflows - 基础命令
# . Both - 创建技能和命令
# . Custom Profile - 自定义配置
进入项目目录后执行初始化脚本:
cd your-project # 进入项目目录
openspec init # 初始化 OpenSpec
完成后会出现两个关键文件夹:
.trae/skill: 存放由 Trae 提供的技能。openspec/: 主工作区,包含规范、变更等主要文件。
openspec/
├── specs/ # 主规范
│ └── /
│ └── spec.md
├── changes/ # 提议中的变更
│ └── /
│ ├── proposal.md # 为什么做、做什么
│ ├── design.md # 如何实现
│ ├── tasks.md # 实现任务清单
│ └── specs/ # Delta 规范
│ └── /
│ └── spec.md
└── config.yaml # 项目配置
Trae 中对应的命令顺序如下:
/opsx:propose /opsx:explore /opsx:apply /opsx:verify Code archiving with /opsx:archive .
至于实战操作。从需求到交付,全程零手写代码!
1️⃣ openspec-explore
If requirement is vague or large,run this command before proposing. It will:
-
Acknowledge requirement.
-
If unclear。ask follow‑up questions.
-
Scan whole codebase – consumes more tokens.
The command does not create any files;its output lives only in AI conversation context.
/openspec-explore mcp获取任务id:。使用 getUserTaskList 新增两个接口:diff 和 log
Pain point addressed:
This step eliminates “需求不明确”导致的返工,从而避免了大量无效代码产生。
2️⃣ openspec-propose
Create a new change and generate all planning artefacts at once.
/openspec-propose
# 自动生成以下文件结构
openspec/changes/add-dark-mode/
✓ proposal.md
✓ specs/ui/spec.md
✓ design.md
✓ tasks.md
// 可继续补充细节,例如接口调用、风格要求等
You can add extra constraints on fly:
/openspec-propose 补充几个点:使用者点击日志时调用 log 接口;查看按钮调用 diff 接口;编码风格保持与现有代码一致;所有数据库操作封装在 Repository 类中。
Pain point addressed:
The change package makes “需求→实现” 一目了然大幅降低沟通成本和重复劳动。
3️⃣ opensped‑apply‑change
The AI reads tasks.md** and implements each task sequentially,marking m as completed.
再看You。/openspec-apply-change
AI的观点是,实现 add-dark-mode...
- 创建 ThemeContext → src/context/ThemeContext.tsx ✅ 完成
- 添加 CSS 自定义属性 → src/styles/globals.css ✅ 完成…
You should avoid manual edits while AI is working – let it finish all listed tasks.
Pain point addressed:
No more “手写一小段代码后发现遗漏”。因为任务清单驱动自动化实现,确保每一步都被覆盖。老实说,
4️⃣ opensped‑verify‑change
This step checks completeness,correctness and consistency of implementation against change artefacts.
说到You。/opensped‑verify‑change
说到AI,完整性 ✓ 所有 tasks 完成 ✓ 规范全部覆盖 ⚠ 场景缺少测试覆盖
正确性 ✓ 实现符合设计意图 ✓ 边缘情况已处理
一致性 ✓ 设计决策体现在代码结构中 ⚠ CSS 使用 Tailwind 而非变量
至于警告,CSS 实现方式不一致,可归档。
Pain point addressed:
Avoids “上线后发现功能不完整或不符合设计”,通过自动化审查提前捕获问题。
5️⃣ opensped‑archive‑change
The change is archived once verified and optionally synchronized back to main spec.
You的观点是。/opensped‑archive‑change opensped\changes\cost-config-diff-log
从AI来看,✅ proposal.md、design.md、tasks.md 均存在且已完成
✅ 同步 Delta 规范至 opensped/specs/...
✅ 移动至 opensped/changes/archive/---cost-config-diff-log
🎉 归档成功!可 push 到 Git 与团队共享。
Pain point addressed:
The archive serves as a single source of truth for completed work,eliminating “文档与代码不同步”的尴尬局面。
功能与实际方法
mcp 服务
If your organization provides an MCP service you can fetch task IDs or or business data directly via natural language. Orwise just paste PRD into OpenSpec – it works equally well.
自定义规则 & 技能
You can place tool‑level .trae-cn/rules & skills under C:\Users\<用户名>\.trae-cn\ . They will be automatically loaded according to IDE you selected during `opensped init`.
创建专属智能体
The framework allows you to define specialized agents for domain‑specific coding styles or compliance requirements.
其他 IDE 支持
The same workflow works in any mainstream IDE that supports Trae plugins. The command names differ only in prefix – for example in VSCode you may use /opsx:apply` instead of `/opensped-apply-change`. The underlying logic remains identical.
——从“百行代码”到“零手写” 的转变
A two‑month experiment with OpenSpec resulted in less than 100 lines of manually written code while delivering dozens of functional features. The key was moving from ad‑hoc AI chat to a structured specification driven process.
-
Clear requirement alignment → fewer reworks.
-
Task‑driven code generation → consistent quality.
-
Automated verification & archiving → reliable delivery traceability.
This isn’t广告;只是一次真实的经验分享,希望你也能用 OpenSpec 把“写了多少行代码”这件事从焦虑转化为生产力。下次见,"
作为专业的SEO优化服务提供商,我们致力于通过科学、系统的搜索引擎优化策略,帮助企业在百度、Google等搜索引擎中获得更高的排名和流量。我们的服务涵盖网站结构优化、内容优化、技术SEO和链接建设等多个维度。
| 服务项目 | 基础套餐 | 标准套餐 | 高级定制 |
|---|---|---|---|
| 关键词优化数量 | 10-20个核心词 | 30-50个核心词+长尾词 | 80-150个全方位覆盖 |
| 内容优化 | 基础页面优化 | 全站内容优化+每月5篇原创 | 个性化内容策略+每月15篇原创 |
| 技术SEO | 基本技术检查 | 全面技术优化+移动适配 | 深度技术重构+性能优化 |
| 外链建设 | 每月5-10条 | 每月20-30条高质量外链 | 每月50+条多渠道外链 |
| 数据报告 | 月度基础报告 | 双周详细报告+分析 | 每周深度报告+策略调整 |
| 效果保障 | 3-6个月见效 | 2-4个月见效 | 1-3个月快速见效 |
我们的SEO优化服务遵循科学严谨的流程,确保每一步都基于数据分析和行业最佳实践:
全面检测网站技术问题、内容质量、竞争对手情况,制定个性化优化方案。
基于用户搜索意图和商业目标,制定全面的关键词矩阵和布局策略。
解决网站技术问题,优化网站结构,提升页面速度和移动端体验。
创作高质量原创内容,优化现有页面,建立内容更新机制。
获取高质量外部链接,建立品牌在线影响力,提升网站权威度。
持续监控排名、流量和转化数据,根据效果调整优化策略。
基于我们服务的客户数据统计,平均优化效果如下:
我们坚信,真正的SEO优化不仅仅是追求排名,而是通过提供优质内容、优化用户体验、建立网站权威,最终实现可持续的业务增长。我们的目标是与客户建立长期合作关系,共同成长。
Demand feedback