Skip to main content

Standard Trellis Template

开箱即用的 Trellis AI 编码工程化标准模板

适用于 Claude Code、OpenClaw、Hermes、Cursor、Windsurf 等 14+ AI Coding 平台

✨ 特性

  • 🚀 开箱即用 - 一行命令初始化项目
  • 📦 规范完整 - 包含语言、框架、测试、安全、风格五大核心规范
  • 🔄 持续更新 - 随 Trellis 框架同步更新
  • 👥 团队协作 - 规范随仓库版本化管理
  • 🌐 多平台 - 支持 Claude、OpenClaw、Hermes、Cursor 等

快速开始

方法 1: 使用 npm(推荐)

npm create trellis-standard my-project

方法 2: 克隆仓库

git clone https://github.com/your-username/standard-trellis-template.git my-project
cd my-project
trellis init -u your-name
cp -r .trellis-template/spec/* .trellis/spec/

方法 3: 作为远程模板

trellis init --template https://github.com/your-username/standard-trellis-template

项目结构

项目使用 Trellis 框架,包含以下目录和文件:

.trellis/spec/ - 规范文档目录,包含 6 个核心规范文件:

  • language.md(编程语言规范)
  • framework.md(框架使用规范)
  • architecture.md(架构设计原则)
  • testing.md(测试规范)
  • lint.md(代码风格规范)
  • security.md(安全规范)

.trellis/tasks/ - 任务跟踪目录,每个任务一个子目录,包含 PRD 和实现/审查上下文

.trellis/workspace/ - 个人工作区(不提交到版本控制)

CLAUDE.md - Claude Code 平台适配文件(自动生成)

AGENTS.md - 其他 AI Agent 平台适配文件(自动生成)

目录说明

  • .trellis/spec/ - 项目规范文档,随版本管理
  • .trellis/tasks/ - 任务跟踪和 PRD
  • .trellis/workspace/ - 个人工作区,不提交到版本控制
  • CLAUDE.md - Claude Code 适配(自动生成)
  • AGENTS.md - 其他 Agent 适配(自动生成)

规范说明

language.md

定义编程语言的最佳实践:

  • TypeScript/JavaScript 编码规范
  • Python PEP 8 遵循
  • 命名约定和类型注解

framework.md

定义框架使用规范:

  • React/Vue/Next.js 组件模式
  • Express/FastAPI/Django 路由设计
  • 状态管理和数据流

testing.md

定义测试规范:

  • TDD 测试先行原则
  • 80%+ 覆盖率要求
  • Mock 和测试命名规范

security.md

定义安全规范:

  • 输入验证和清洗
  • 认证授权机制
  • 敏感数据保护

lint.md

定义代码风格:

  • ESLint/Prettier 配置
  • Black/isort 配置
  • CI pipeline 集成

使用工作流

  1. 需求阶段 📝 - 与 AI 头脑风暴 → trellis-brainstorm → 产出 PRD

  2. 实现阶段 💻 - AI 调用 trellis-implement → 按规范编写代码

  3. 验证阶段 🔍 - AI 调用 trellis-check → lint + type-check + tests

  4. 收尾阶段 ✅ - /trellis:finish-work → 沉淀新认知到 Spec

支持的平台

  • ✅ Claude Code
  • ✅ OpenClaw
  • ✅ Hermes
  • ✅ Cursor
  • ✅ Windsurf
  • ✅ Continue
  • ✅ Aider
  • ✅ Sweep
  • ✅ Codeium
  • ✅ Tabnine
  • ✅ Sourcegraph
  • ✅ JetBrains AI
  • ✅ GitHub Copilot
  • ✅ VS Code Copilot

自定义规范

你可以根据项目需求修改 .trellis/spec/ 中的文件。

示例命令:

使用代码编辑器打开语言规范文件进行编辑。

团队协作

提交规范到版本控制

使用以下命令提交规范文件到版本控制:

git add .trellis/spec/ .trellis/tasks/ git commit -m "docs: 更新项目规范"

排除个人工作区

确保 .gitignore 文件包含以下内容:

.trellis/workspace/

常见问题

Q: 与 CLAUDE.md 的区别?

A: Trellis 提供了结构化的 Spec 系统、任务跟踪和工作区记忆,是 CLAUDE.md 的增强版。

Q: 如何在不同平台间切换?

A: 无需切换,同一套 .trellis/ 结构在所有平台自动适配。

Q: 必须使用所有规范文件吗?

A: 不必,可以根据项目需求选择性使用,甚至可以删除不适用的规范。

Q: 如何更新模板?

A: 使用 npm update trellis-standard 或 git pull 获取最新版本。

贡献指南

欢迎提交 PR 改进规范模板:

  1. Fork 本仓库
  2. 创建特性分支
  3. 提交改动
  4. 发起 Pull Request

许可证

MIT License - 自由使用和修改

链接


维护者: whoami 版本: 1.0.0 最后更新: 2026-06-13

Metadata

Release files for trellis-standard-template 1.0.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for trellis-standard-template 1.0.0
File Size Uploaded Provenance Actions
trellis_standard_template-1.0.0.tar.gz 13.4 kB Without provenance Details for trellis_standard_template-1.0.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for trellis-standard-template 1.0.0
File Interpreter ABI Platform Actions
trellis_standard_template-1.0.0-py3-none-any.whl Python 3 none any Details for trellis_standard_template-1.0.0-py3-none-any.whl

Total release size: 27.0 kB

Release files / trellis_standard_template-1.0.0.tar.gz

Download URL trellis_standard_template-1.0.0.tar.gz
Size 13.4 kB
Tags Source
SHA-256 checksum
How to use checksums
347a0b022420eea482ad5f021cbfd483e765fd5a552297ef76bbcd6680a27a48
BLAKE2b-256 checksum
How to use checksums
fa7b51554c977ee3bd6b76b8259b9dbe628fc8645e869aa050854990243f50d5
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.12.3

Release files / trellis_standard_template-1.0.0-py3-none-any.whl

Download URL trellis_standard_template-1.0.0-py3-none-any.whl
Size 13.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
1844a59ea8777f480bfb9b831e12a9a4dd10dcad57ae3f7e022c6deed98aebaf
BLAKE2b-256 checksum
How to use checksums
67bd856aa3d569e01d578f18fb549fc868b880d92e2e833bb106261303b1d567
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.12.3

Security for trellis-standard-template 1.0.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

1.0.0 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page