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

lccoder

v0.1.1

Published

小模型流水线编码工具 lccoder — 让小型 AI 模型也能高质量编码

Downloads

222

Readme

lccoder

小模型流水线编码工具 — 让小型 AI 模型也能高质量编码

lccoder 通过「流水线编排 + 文档交接 + 会话隔离」架构,让 4B 参数的小模型(如 Gemma 4 E4B)也能完成复杂的编码任务。

✨ 核心理念

传统 AI 编码工具把所有工作塞在一个会话里,导致上下文膨胀、模型失控。lccoder 采用制造业流水线思想:

  1. 角色分离 — 产品经理、项目经理、办事员、评估器各司其职
  2. 会话隔离 — 每个步骤都是独立会话,避免上下文污染
  3. 文档交接 — 通过结构化 JSON 文档传递信息,可审计可追溯
  4. 代码强约束 — 流程由代码硬编码控制,不依赖提示词引导

🚀 快速开始

前置条件

  • Bun >= 1.0
  • Ollama 已安装并运行
  • Gemma 4 E4B 模型已拉取
  • lccoder 是一个 Bun-only CLI;安装和运行都默认以 Bun 为前提
# 安装 Ollama 后拉取模型
ollama pull gemma4:e4b

安装

方式 1:从 npm 安装(推荐给使用者)

npm install -g lccoder

安装后直接运行:

lccoder

注意:

  • 这个包已经发布到 npm,但 CLI 入口是 src/index.ts
  • 因此目标环境仍然需要本机已安装 Bun
  • 如果你的机器没有 Bun,请先安装 Bun,再安装 lccoder

方式 2:直接运行源码(推荐给开发者)

git clone https://github.com/lazycoffee/lccoder.git lccoder
cd lccoder
bun install

方式 3:在本机链接为 CLI 命令

bun link
lccoder

运行

如果你是通过 npm 全局安装的,直接运行:

lccoder
lccoder init
lccoder resume
lccoder history
lccoder inspect <session-id>

如果你是在仓库里开发,直接运行:

bun start

或显式调用入口文件:

bun run src/index.ts
bun run src/index.ts init
bun run src/index.ts resume
bun run src/index.ts history
bun run src/index.ts inspect <session-id>

发布说明

  • [email protected] 已经发布到 npm 官方 registry。
  • 当前 package.json 已补充 binfilesrepositoryhomepagebugsenginesprepublishOnly
  • 发布前会自动执行 bun run check,即类型检查加单元测试。
  • 由于 CLI 入口当前仍然是 src/index.ts,这是一个明确的 Bun-only 包,而不是通用 Node CLI。

📋 工作流程

用户输入 → 分类器判断 → 简单请求:直接回答
                      → 复杂请求:
                          ↓
                    产品经理分析需求
                          ↓
                      用户确认需求
                          ↓
                    项目经理拆分任务
                          ↓
                      用户确认计划
                          ↓
                  办事员逐一执行任务 ←→ 评估器判断结果
                          ↓
                      生成总结报告

🏗 项目结构

lccoder/
├── src/
│   ├── cli/          # CLI 交互
│   ├── llm/          # LLM 通信层
│   ├── pipeline/     # 流水线编排
│   ├── roles/        # 角色定义
│   ├── schemas/      # 文档 Schema (Zod)
│   ├── tools/        # AI 可调用的工具
│   ├── documents/    # 文档存储
│   └── config/       # 配置管理
├── prompts/           # 角色 Prompt (Markdown)
│   ├── classifier.md
│   ├── product-manager.md
│   ├── project-manager.md
│   ├── clerk.md
│   └── evaluator.md
└── .lccoder/          # 运行时工作目录 (自动生成)

⚙️ 配置

在项目目录下创建 .lccoder/config.json

使用本地 Ollama(默认)

{
  "provider": "ollama",
  "model": "gemma4:latest",
  "ollamaHost": "http://localhost:11434",
  "roles": {
    "clerk": { "model": "gemma4:26b" }
  },
  "execution": {
    "maxRetries": 2,
    "parallelTasks": false,
    "autoConfirm": false
  },
  "safety": {
    "allowShellExec": false,
    "allowFileWrite": true,
    "workingDir": "/absolute/path/to/your/project"
  }
}

使用 Minimax / OpenAI 兼容 API

{
  "provider": "openai",
  "model": "abab6.5s-chat",
  "openai": {
    "apiKey": "your-minimax-api-key",
    "baseURL": "https://api.minimax.chat/v1"
  },
  "execution": {
    "maxRetries": 2,
    "parallelTasks": false,
    "autoConfirm": false
  },
  "safety": {
    "allowShellExec": false,
    "allowFileWrite": true,
    "workingDir": "/absolute/path/to/your/project"
  }
}

配置说明

  • roles.<role>.model 可以为不同角色指定不同模型。
  • roles.<role>.provider 可以为单个角色切换提供商。
  • execution.parallelTasks 开启后,会并行执行无依赖且无文件冲突的任务。
  • safety.workingDir 是工具实际操作的项目根目录;文件读写、搜索和 shell 命令都会以它为基准。
  • safety.allowShellExecfalse 时,执行 shell 命令前会要求确认;危险命令始终会被拦截。
  • safety.allowFileWritefalse 时,文件修改会要求确认。

🎯 设计特色

  • Prompt 外置 — 所有角色的 System Prompt 都是独立的 Markdown 文件,可随时查看和优化
  • 文档可审计 — 每个步骤的中间文档都保存在 .lccoder/documents/
  • 容错机制 — Tool call 解析失败时自动回退到文本解析
  • 工作目录隔离 — 所有工具都显式绑定到配置里的 workingDir,避免误操作当前 shell 目录
  • 保守策略 — 评估器在不确定时选择暂停,等待人工介入

🧪 测试

单元测试:

bun test

发布前自检:

bun run check

类型检查:

bunx tsc --noEmit

依赖真实模型的端到端脚本:

bun run tests/e2e-pipeline.ts
  • E2E 脚本会连接 README 中配置的 Ollama / 模型。
  • 它会在仓库内和临时 fixture 项目中实际创建或修改文件,适合在本地手动验证完整流水线行为。

📜 License

MIT