Metadata-Version: 2.4
Name: worldos-autocode
Version: 0.1.0
Summary: 基于世界模型的自动化编码系统
Project-URL: Homepage, https://worldos.io
Project-URL: Documentation, https://docs.worldos.io
Project-URL: Repository, https://github.com/worldos/world-os-autocode
Project-URL: Bug Tracker, https://github.com/worldos/world-os-autocode/issues
Project-URL: Discussions, https://github.com/worldos/world-os-autocode/discussions
Project-URL: Changelog, https://github.com/worldos/world-os-autocode/blob/main/CHANGELOG.md
Author-email: World OS Team <team@worldos.io>
License: Apache-2.0
License-File: LICENSE
Keywords: agile,ai,automation,coding,cognitive-skills,harness,world-model
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: Apache Software License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Topic :: Software Development :: Code Generators
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Requires-Python: >=3.9
Requires-Dist: aiofiles>=23.0
Requires-Dist: anyio>=4.0
Requires-Dist: click>=8.0
Requires-Dist: jsonschema>=4.0
Requires-Dist: pydantic>=2.0.0
Requires-Dist: python-dotenv>=1.0
Requires-Dist: pyyaml>=6.0
Requires-Dist: rich>=13.0
Requires-Dist: structlog>=23.0
Provides-Extra: all
Requires-Dist: black>=23.0; extra == 'all'
Requires-Dist: click>=8.0; extra == 'all'
Requires-Dist: flake8>=6.0; extra == 'all'
Requires-Dist: hatch>=1.7; extra == 'all'
Requires-Dist: isort>=5.12; extra == 'all'
Requires-Dist: mike>=1.1; extra == 'all'
Requires-Dist: mkdocs-material>=9.0; extra == 'all'
Requires-Dist: mkdocs-minify-plugin>=0.7; extra == 'all'
Requires-Dist: mkdocs>=1.5; extra == 'all'
Requires-Dist: mkdocstrings[python]>=0.23; extra == 'all'
Requires-Dist: mypy>=1.5; extra == 'all'
Requires-Dist: packaging>=23.0; extra == 'all'
Requires-Dist: pre-commit>=3.0; extra == 'all'
Requires-Dist: pytest-asyncio>=0.21; extra == 'all'
Requires-Dist: pytest-cov>=4.0; extra == 'all'
Requires-Dist: pytest-mock>=3.10; extra == 'all'
Requires-Dist: pytest>=7.0; extra == 'all'
Requires-Dist: rich>=13.0; extra == 'all'
Provides-Extra: dev
Requires-Dist: black>=23.0; extra == 'dev'
Requires-Dist: flake8>=6.0; extra == 'dev'
Requires-Dist: hatch>=1.7; extra == 'dev'
Requires-Dist: isort>=5.12; extra == 'dev'
Requires-Dist: mypy>=1.5; extra == 'dev'
Requires-Dist: pre-commit>=3.0; extra == 'dev'
Requires-Dist: pytest-asyncio>=0.21; extra == 'dev'
Requires-Dist: pytest-cov>=4.0; extra == 'dev'
Requires-Dist: pytest-mock>=3.10; extra == 'dev'
Requires-Dist: pytest>=7.0; extra == 'dev'
Provides-Extra: docs
Requires-Dist: mike>=1.1; extra == 'docs'
Requires-Dist: mkdocs-material>=9.0; extra == 'docs'
Requires-Dist: mkdocs-minify-plugin>=0.7; extra == 'docs'
Requires-Dist: mkdocs>=1.5; extra == 'docs'
Requires-Dist: mkdocstrings[python]>=0.23; extra == 'docs'
Provides-Extra: skills
Requires-Dist: click>=8.0; extra == 'skills'
Requires-Dist: packaging>=23.0; extra == 'skills'
Requires-Dist: rich>=13.0; extra == 'skills'
Description-Content-Type: text/markdown

# 🌍 World OS AutoCode

<p align="center">
  <strong>基于世界模型的自动化编码系统 —— 让 AI 编码有法可依，有据可查</strong>
</p>

<p align="center">
  <a href="https://github.com/worldos/world-os-autocode/actions"><img src="https://github.com/worldos/world-os-autocode/workflows/CI/badge.svg" alt="CI Status"></a>
  <a href="https://pypi.org/project/worldos-autocode/"><img src="https://img.shields.io/pypi/v/worldos-autocode.svg" alt="PyPI Version"></a>
  <a href="https://opensource.org/licenses/Apache-2.0"><img src="https://img.shields.io/badge/License-Apache%202.0-blue.svg" alt="License"></a>
  <a href="https://pypi.org/project/worldos-autocode/"><img src="https://img.shields.io/pypi/pyversions/worldos-autocode.svg" alt="Python Versions"></a>
</p>

---

## 🎯 什么是 World OS AutoCode

**核心思想：将你的项目转化为一个「世界模型」，让 AI 真正理解你的项目**

```
World Model = State + Goals + Invariants + Ontology
Agent Actions = Read / Write / Edit / Bash / Grep / Glob / Agent / TodoWrite
```

| 组件 | 作用 | 存储 |
|------|------|------|
| **State** | 项目运行态，记录每个模块的状态和验证结果 | `harness/state.json` |
| **Goals** | 形式化需求，每个需求都有验收标准 | `harness/requirements/*.req.md` |
| **Invariants** | 不变量约束，每次变更后自动验证 | `harness/invariants/*.sh` |
| **Ontology** | 实体知识图谱，明确业务实体和依赖关系 | `harness/entity-map.json` |

---

## ✨ 核心特性

### 🧠 16+ 敏捷认知技能覆盖全研发流程

| 阶段 | 技能 |
|------|------|
| **核心认知** | 需求追溯 • DoD 检查 • 变更影响分析 |
| **需求阶段** | 用户故事拆解 • 完整性检查 • 优先级矩阵 |
| **产品阶段** | PMF 验证 • 用户旅程分析 • 复杂度-价值象限 |
| **架构阶段** | ADR 记录 • NFR 量化 • 技术债务评估 |

### 👥 角色化权限控制

| 角色 | 职责 |
|------|------|
| 产品经理 | 优先级决策、PMF 验证 |
| 架构师 | 架构决策、技术债务评估 |
| 开发者 | DoD 检查、影响分析 |
| QA 工程师 | 需求追溯、验收检查 |
| 数据分析师 | 数据驱动决策 |

### 🚀 命令行集成

```bash
worldos-harness --help
```

---

## 🚀 快速开始

### 安装

```bash
# PyPI 安装
pip install worldos-autocode

# 同时安装 skills 管理工具
pip install worldos-autocode[skills]

# 从源码安装最新版
git clone https://github.com/worldos/world-os-autocode.git
cd world-os-autocode
pip install -e .
```

### 初始化新项目

```bash
# 创建项目目录并初始化
mkdir my-project && cd my-project
worldos-harness init
```

这将生成以下目录结构：

```
my-project/
└── harness/
    ├── state.json          # 项目状态
    ├── entity-map.json     # 实体图谱
    ├── knowledge/          # 知识文档
    │   ├── index.yaml
    │   ├── product/       # PRD/用户故事
    │   ├── technical/     # API/设计
    │   └── domain/        # 术语/规则
    ├── requirements/       # 形式化需求
    └── invariants/         # 验证脚本
```

### 同步知识

```bash
# 仅同步本地知识（无需飞书）
worldos-harness sync --local-only

# 同步并深度分析项目
worldos-harness sync --deep
```

### 查看状态

```bash
worldos-harness status
```

### 使用敏捷认知技能

```bash
# 列出所有技能
worldos-harness agile list

# 按角色过滤
worldos-harness agile list --role=developer

# 调用技能（定义完成检查）
worldos-harness agile invoke definition-of-done \
  --role=developer \
  --context='{"task_type": "feature", "artifacts": ["code", "tests"]}'

# 执行工作流（Sprint 规划）
worldos-harness agile workflow sprint_planning
```

---

## 📦 发布包说明

本项目提供三个 PyPI 包：

| 包 | 用途 | 安装 |
|----|------|------|
| **worldos-autocode** | 核心框架 + CLI 工具 | `pip install worldos-autocode` |
| **reqharness** | 独立敏捷研发技能包 | `pip install reqharness` |
| **worldos-skills** | Claude Code 技能安装工具 | `pip install worldos-skills` |

### 安装 Claude Code Skills

安装完成 `worldos-skills` 后，可以一键安装技能到 Claude Code：

```bash
# 安装所有 skills 到默认位置 (~/.claude/skills)
worldos-skills install --all

# 检查安装状态
worldos-skills status

# 只安装 worldos-harness
worldos-skills install --worldos
```

---

## 🏗️ 架构

```
┌─────────────────────────────────────────────┐
│   CLI / API          Skill Hub    Workflow  │
└─────────────┬─────────────┬─────────────────┘
              │             │
              ▼             ▼
        ┌───────────────────────┐
        │     Harness Core      │
        │  State  Goals  Inv    │
        └───────────────────────┘
```

**设计原则**：
- **知识优先**：知识文档驱动开发，而非代码驱动
- **不变量验证**：每次变更后自动验证，不把问题带到下一环节
- **角色协同**：不同角色专注不同职责，权限清晰
- **渐进式**：可从小项目开始，逐步扩展知识体系

---

## 📚 文档

- [CLAUDE.md](./CLAUDE.md) - Agent 执行协议
- [ARCHITECTURE.md](./ARCHITECTURE.md) - 详细架构设计
- [PROJECT_ROADMAP.md](./PROJECT_ROADMAP.md) - 项目路线图
- [SKILLS_INSTALL.md](./SKILLS_INSTALL.md) - 技能安装指南
- [CHANGELOG.md](./CHANGELOG.md) - 版本变更记录

---

## 🤝 贡献

欢迎所有形式的贡献！请参阅 [CONTRIBUTING.md](./CONTRIBUTING.md) 了解详情。

```bash
# 开发环境搭建
git clone https://github.com/your-username/world-os-autocode.git
cd world-os-autocode
python -m venv venv && source venv/bin/activate
pip install -e ".[dev]"
pytest tests/
```

---

## 👥 社区

- [GitHub Discussions](https://github.com/worldos/world-os-autocode/discussions) - 讨论交流
- [Issue Tracker](https://github.com/worldos/world-os-autocode/issues) - 问题反馈

---

## 📄 许可证

[Apache-2.0](./LICENSE) © World OS Team

---

<p align="center">
  由 <a href="https://worldos.io">World OS Team</a> 用 ❤️ 构建
</p>
