npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

scene-capability-engine

v3.6.67

Published

SCE (Scene Capability Engine) - A CLI tool and npm package for spec-driven development with AI coding assistants.

Downloads

2,270

Readme

SCE - Scene Capability Engine

npm version License: MIT

SCE 是面向 AI 原生软件交付的场景治理与执行引擎。 它把开放式的 Agent 工作,收敛为一条可治理的路径:goal -> scene -> spec -> task -> patch -> verify -> release

English | 简体中文


SCE 解决什么问题

AI Agent 可以很快生成代码,但也很容易出现这些问题:

  • 上下文漂移,越聊越散
  • 需求、设计、任务混在会话里,难以治理
  • 过程资产只存在本地会话中,没推 Git 就容易丢
  • 自动执行虽然快,但缺少稳定门禁和发布证据

SCE 提供的就是这一层控制能力:

  • Scene 主导上下文scene 是稳定语义边界,一个项目可并行存在多条 channel/session,每条通道各自维护当前 scene + spec 焦点
  • Spec 先行治理:需求、设计、任务、门禁都绑定到 spec,而不是散落在聊天记录里
  • 自动闭环可控close-loopclose-loop-programclose-loop-controller 都能在边界内自动收敛
  • 本地历史可恢复:timeline、task ref、SQLite 状态让过程资产可回看、可恢复、可重跑
  • 发布级治理:handoff 证据、git 管理门禁、errorbook 学习闭环,让“看起来完成”变成“可验证完成”

核心对象模型

SCE 用一条稳定的“语义链 + 协作链”来管理 Agent 工作:

  • project -> scene -> spec
  • project -> channel/session -> (scene + spec focus) -> task -> event
  • scene 是业务连续性的主边界
  • channel/session 是协作线程,不是问题域本身
  • spec 是被治理的工作包
  • task 是面向人的最小执行单元
  • event 保留原始审计流,作为 task 背后的底层记录

这让长周期 Agent 执行不再依赖脆弱的聊天上下文,而是依赖可治理的结构化对象。


主要能力

1. Scene + Spec 治理

  • studio plan 自动做目标 intake,并绑定或创建 spec
  • scene 维度的 spec 组合治理与历史 spec 回填
  • 场景/规格/任务契约统一落在 .sce/
  • 支持按 scene 组织长期连续交付

2. Studio 执行流

  • studio plan -> generate -> apply -> verify -> release
  • 面向 IDE / 前端的结构化 task 流
  • 层级任务引用(scene.spec.task / SS.PP.TT),支持查询、受控重跑与按原 project + channel 焦点生成重跑提示
  • 写操作支持 auth lease 保护

3. 自动闭环交付

  • sce auto close-loop
  • sce auto close-loop-batch
  • sce auto close-loop-program
  • sce auto close-loop-controller
  • 内建 retry、fallback-chain、governance replay、异常感知调度

4. 问题闭环与 Errorbook

  • problem-domain map / chain / contract / closure gate
  • incident staging,先保留试错过程,再沉淀高价值错题
  • 本地错题本 + 远程注册表联动
  • 默认规则:重复失败后必须补充 debug 证据

5. 时间线与 SQLite 状态

  • timeline save/list/show/restore/push
  • SQLite 持久化 task/event/session 状态
  • task ref 与 rerun 具备可追踪性和可重放性
  • 支持文件到 SQLite 的渐进迁移与对账

6. 能力资产化与场景化能力

  • scene/capability inventory 与治理视图
  • 能力抽取、评估、发布闭环
  • 支持语义观测、replay 评估、本地推广、共享 delta 导出与 native 回流重排
  • 支持 shared-library mirror 发布,把合格能力从 publish_pending 推进到 published-shared
  • semantic promote 默认按 adopt-implied 模型立即自动共享发布合格能力
  • 支持 shared-sync handoff bundle 导出,把本地 semantic mirror 打包成 spec 内受治理的 bundle/index/shards/receipt
  • 支持 shared-sync intake,把其他终端导出的受治理 bundle 同步回本地 semantic mirror
  • 支持 scene runtime 与 ontology 驱动执行
  • 支持面向 Moqui 的能力校验与 handoff 基线

快速开始

安装

npm install -g scene-capability-engine

在项目中启用

sce adopt

启动一个 scene 治理流程

sce studio plan --scene scene.demo --from-chat session-demo --goal "bootstrap first feature" --json
sce spec bootstrap --name 01-00-first-feature --scene scene.demo --non-interactive
sce spec pipeline run --spec 01-00-first-feature --scene scene.demo

自动闭环推进

sce auto close-loop "deliver customer + order + inventory baseline"

推荐使用路径

功能交付

sce studio plan --scene scene.customer-order --from-chat session-20260308 --goal "optimize checkout" --json
sce spec bootstrap --name 02-00-checkout-optimization --scene scene.customer-order --non-interactive
sce spec gate run --spec 02-00-checkout-optimization --scene scene.customer-order --json

程序级自动交付

sce auto close-loop-program "stabilize order lifecycle and release governance" --program-govern-until-stable --json

时间线保护

sce timeline save --summary "before risky refactor"
sce timeline list --limit 20
sce timeline restore <snapshot-id>

受保护写入

sce auth grant --scope studio:* --reason "apply approved patch" --auth-password <password> --json
sce auth status --json

默认治理行为

SCE 默认是强治理的。

  • studio plan 默认执行 intake 与 scene/spec 治理,除非策略显式允许绕过
  • 缺少业务场景/模块/页面/实体上下文时,SCE 必须先进入澄清,而不是把未知业务范围直接变成一刀切禁用
  • 连续两轮以上仍未成功定位问题时,SCE 默认要求先补 errorbook incident,再用二分式 debug 日志快速收敛范围
  • 单 spec 的 spec pipelinespec gate 现在都会附带只读策略建议;当问题已经更适合 multi-spec-program / research-program 时,SCE 会显式提示,而不是继续把复杂问题盲目压进同一个 spec
  • 当 spec 绑定时,verifyrelease 默认执行 problem-closure 等相关门禁
  • close-loop-program 默认带 gate 评估、fallback-chain、governance replay、auto-remediation
  • co-work 基线默认开启:初始化或接管后的 SCE 项目会落地 .sce/config/multi-agent.jsonenabled=true,但中央 coordinator 仍保持按需开启
  • 状态持久化默认优先走 SQLite,而不是零散本地缓存
  • CORE_PRINCIPLES.md 的最高原则层默认只保留“四句教 + 小九条”;四句教先判断该不该做,小九条再判断如何把正确的事做对;治理基线进入 RULES_GUIDE.md,执行经验与案例进入 docs/steering-governance.md.sce/knowledge/lessons/
  • studio plan / studio intake / native ask 默认先经过“四句教”判定闸门;对失范目标会执行 clarify / rewrite / narrow / refuse,并把判定结果写入 session/job/spec 证据链
  • Agent 生成的脚本、报告、调试日志、测试脚本和临时分析默认进入当前 Spec 子目录;没有明确 Spec 时先用通用 Spec 承接
  • 默认遵守“小九条”执行姿态:勤奋推进、先领会真实意图、先看事实、维护项目活地图、想透问题、证据足够时敢下判断、统筹 Spec/错题本/测试/现状代码/关注点、先拆解定位阻塞、持续收敛直到闭环
  • 超大源文件必须定期触发重构评估;SCE 优先建议按项目给出阈值,若项目尚未设定,则默认参考 2000 / 4000 / 10000
  • 发布默认验证走 integration gate:npm run test:release

关键集成点

如果你要对接 IDE、AI 助手或前端,优先关注这些接口面:

  • sce studio plan|generate|apply|verify|release
  • sce studio events
  • sce task ref|show|rerun
  • sce timeline save|list|show|restore
  • sce capability inventory
  • sce auth grant|status|revoke
  • SQLite 状态库:.sce/state/sce-state.sqlite

面向 MagicBall 的当前关键接口还包括:

  • sce device current
  • sce device override show|upsert
  • sce app bundle list|show|register
  • sce app collection list|show|apply
  • sce app install-state list
  • sce scene delivery show
  • sce scene workspace list|show|apply
  • sce app registry status|configure|sync*
  • sce app runtime show|releases|install|activate|uninstall
  • sce app engineering preview|ownership|open|import|show|attach|hydrate|scaffold|activate
  • sce project portfolio show|candidate inspect|onboarding import|target resolve|supervision show
  • sce mode application|ontology|engineering home
  • sce pm requirement|tracking|planning|change|issue ... --json
  • sce ontology er|br|dl ... --json
  • sce ontology triad summary --json
  • sce assurance resource|logs|backup|config ... --json

远端示例 registry:

  • magicball-app-bundle-registry
  • magicball-app-service-catalog
  • 示例 app key:customer-order-demo

面向场景的安装管理参考:

  • 示例:docs/examples/app-intent-phase1/.sce/app/...
  • apply JSON 契约:docs/app-intent-apply-contract.md

文档入口

建议先看:

Moqui 与能力矩阵相关:


社区

扫码添加微信并备注 sce 入群。


License

MIT,见 LICENSE


版本:3.6.67 最后更新:2026-03-29