Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 12 additions & 1 deletion .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,18 @@
- [ ] Ran existing tests with `uv sync && uv run pytest`
- [ ] Tested with a sample project (if applicable)

## Community Catalog Submission

<!-- Complete this section for community extension or preset catalog changes. -->

- Submission route: <!-- pr-template | issue-template | n/a -->
- Catalog type: <!-- extension | preset | n/a -->
- Source repository: <!-- https://github.com/owner/repo or n/a -->
- Source version: <!-- vX.Y.Z / X.Y.Z or n/a -->
- Source commit: <!-- 40-character SHA or n/a -->
- Download URL: <!-- release archive or asset URL, or n/a -->
- Related issue: <!-- Closes #123 for issue-template route, or n/a -->

## AI Disclosure

<!-- Per our Contributing guidelines, AI assistance must be disclosed. -->
Expand All @@ -19,4 +31,3 @@
- [ ] I **did** use AI assistance (describe below)

<!-- If you used AI, briefly describe how (e.g., "Code generated by Copilot", "Consulted ChatGPT for approach"): -->

43 changes: 43 additions & 0 deletions .github/workflows/community-integration.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
name: Community Integration Validation

permissions:
contents: read

on:
pull_request:
workflow_dispatch:

jobs:
validate-community-integration:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
fetch-depth: 1

- name: Set up Python
uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6
with:
python-version: "3.11"

- name: Write PR body
if: github.event_name == 'pull_request'
shell: pwsh
env:
PR_BODY: ${{ github.event.pull_request.body }}
run: |
Set-Content -LiteralPath .pr-body.md -Value $env:PR_BODY -Encoding utf8

- name: Validate community integration workflow
shell: pwsh
run: |
$argsList = @(
'scripts/community/validate_integration.py',
'--branch',
'${{ github.head_ref }}'
)
if (Test-Path -LiteralPath .pr-body.md) {
$argsList += @('--pr-body-file', '.pr-body.md')
}
python @argsList
40 changes: 32 additions & 8 deletions .github/workflows/community-smoke.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ jobs:
test -f .specify/extensions/arch/extension.yml
test -f .specify/extensions/preview/extension.yml
test -f .specify/extensions/discovery/extension.yml
test -f .specify/extensions/intake/extension.yml
test -f .specify/extensions/repository-governance/extension.yml
test -f .specify/presets/workflow-preset/preset.yml
/tmp/specify-community-smoke-venv/bin/python - <<'PY'
Expand Down Expand Up @@ -92,7 +93,19 @@ jobs:
test -f .specify/presets/workflow-preset/.composed/speckit.plan.md
test -f .specify/presets/workflow-preset/.composed/speckit.tasks.md

test -f .claude/skills/speckit-arch-generate/SKILL.md
for arch_skill in \
speckit-arch-scenario-generate \
speckit-arch-logical-generate \
speckit-arch-process-generate \
speckit-arch-development-generate \
speckit-arch-physical-generate \
speckit-arch-scenario-reverse \
speckit-arch-logical-reverse \
speckit-arch-process-reverse \
speckit-arch-development-reverse \
speckit-arch-physical-reverse; do
test -f ".claude/skills/$arch_skill/SKILL.md"
done
for preview_skill in \
speckit-preview-low-md \
speckit-preview-low-html \
Expand All @@ -103,6 +116,9 @@ jobs:
test -f ".claude/skills/$preview_skill/SKILL.md"
done
test -f .claude/skills/speckit-discovery-feasibility/SKILL.md
test -f .claude/skills/speckit-intake-visual-design/SKILL.md
test -f .claude/skills/speckit-intake-prd/SKILL.md
test -f .claude/skills/speckit-intake-test-cases/SKILL.md
test -f .claude/skills/speckit-repository-governance-refresh/SKILL.md
test -f .claude/skills/speckit-specify/SKILL.md
test -f .claude/skills/speckit-clarify/SKILL.md
Expand All @@ -120,13 +136,12 @@ jobs:
grep -q "Vertical Planner Agent" .claude/skills/speckit-implement/SKILL.md
grep -q "Worker Agent" .claude/skills/speckit-implement/SKILL.md

for extension_id in arch discovery preview repository-governance; do
for extension_id in arch discovery intake preview repository-governance; do
/tmp/specify-community-smoke-venv/bin/specify extension remove "$extension_id" --force
test ! -d ".specify/extensions/$extension_id"
case "$extension_id" in
arch)
test ! -d .claude/skills/speckit-arch-generate
test ! -d .claude/skills/speckit-arch-reverse
test "$(find .claude/skills -maxdepth 1 -type d -name 'speckit-arch-*' | wc -l)" -eq 0
;;
preview)
for preview_skill in \
Expand All @@ -142,19 +157,22 @@ jobs:
discovery)
test "$(find .claude/skills -maxdepth 1 -type d -name 'speckit-discovery-*' | wc -l)" -eq 0
;;
intake)
test "$(find .claude/skills -maxdepth 1 -type d -name 'speckit-intake-*' | wc -l)" -eq 0
;;
repository-governance)
test ! -d .claude/skills/speckit-repository-governance-refresh
;;
esac
done

for extension_id in arch discovery preview repository-governance; do
for extension_id in arch discovery intake preview repository-governance; do
/tmp/specify-community-smoke-venv/bin/specify extension add "$GITHUB_WORKSPACE/extensions/$extension_id" --dev
case "$extension_id" in
arch)
test -f .claude/skills/speckit-arch-generate/SKILL.md
test -f .claude/skills/speckit-arch-reverse/SKILL.md
grep -q "4+1 architecture workflow" .claude/skills/speckit-arch-generate/SKILL.md
test -f .claude/skills/speckit-arch-scenario-generate/SKILL.md
test -f .claude/skills/speckit-arch-scenario-reverse/SKILL.md
grep -q "scenario view" .claude/skills/speckit-arch-scenario-generate/SKILL.md
;;
preview)
for preview_skill in \
Expand All @@ -172,6 +190,12 @@ jobs:
test -f .claude/skills/speckit-discovery-feasibility/SKILL.md
grep -q "evidence-backed feasibility study" .claude/skills/speckit-discovery-feasibility/SKILL.md
;;
intake)
test -f .claude/skills/speckit-intake-visual-design/SKILL.md
test -f .claude/skills/speckit-intake-prd/SKILL.md
test -f .claude/skills/speckit-intake-test-cases/SKILL.md
grep -q "visual design intake" .claude/skills/speckit-intake-visual-design/SKILL.md
;;
repository-governance)
test -f .claude/skills/speckit-repository-governance-refresh/SKILL.md
grep -q "Repository Governance Generate/Update" .claude/skills/speckit-repository-governance-refresh/SKILL.md
Expand Down
11 changes: 11 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,11 @@ __pycache__/
*.py[cod]
*$py.class
*.so
.pytest_cache/
.mypy_cache/
.ruff_cache/
.coverage
htmlcov/
.Python
build/
develop-eggs/
Expand All @@ -27,6 +32,12 @@ env/
.venv
.venv*/

# Local caches and generated artifacts
.tmp/
tmp/
temp/
.worktrees/

# IDE
.vscode/
.idea/
Expand Down
64 changes: 64 additions & 0 deletions AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,70 @@ The toolkit supports multiple AI coding assistants, allowing teams to use their

---

## Local Community Integration Workflow

This local checkout uses `spec-kit` as the fork of `github/spec-kit` that
integrates community extensions and presets. Sibling directories named
`spec-kit-*` are treated as source projects for community extensions or presets,
not as extra checkouts of this repository unless `git worktree list` proves they
are linked worktrees.

### Repository roles

- `C:\Users\24598\Documents\github\spec-kit` is the integration repository.
Keep its main working directory on `main`.
- `C:\Users\24598\Documents\github\spec-kit-*` directories are source
repositories for community extensions or presets. Develop, release, and tag
source packages there.
- Use temporary linked worktrees for concurrent integration PRs. Remove them
with `git worktree remove` and `git worktree prune` after the PR is merged,
closed, or abandoned.

### Community submission routes

Spec Kit supports two community submission routes:

1. **PR template route**: the contributor opens a direct PR. The PR body must
identify `Submission route: pr-template` and include source repository,
source version, source commit, changed catalog type, and validation evidence.
2. **Issue template route**: the contributor files an extension or preset issue
using `.github/ISSUE_TEMPLATE/extension_submission.yml` or
`.github/ISSUE_TEMPLATE/preset_submission.yml`. The catalog workflow creates
the integration PR from the issue. The PR body must identify
`Submission route: issue-template` and include `Closes #<issue-number>`.

Agents must preserve the route. Do not convert an issue-template submission into
a direct PR-template submission unless the maintainer explicitly asks for that
reroute.

### Required local steps for agents

When integrating a community extension or preset:

1. Start from `spec-kit` on `main`, fetch the upstream default branch, and make a
short-lived `community/*` branch or linked worktree.
2. Record source-backed metadata: source repository URL, release version,
source commit SHA, download URL, catalog type (`extension` or `preset`), and
submission route (`pr-template` or `issue-template`).
3. Update only the catalog, bundled extension or preset snapshot, docs, and
tests required by the integration. Do not develop the source project inside
this repository unless the integration requires a bundled snapshot change.
4. Run `scripts/community/validate-integration.ps1` before opening or updating
the PR.
5. Run targeted tests for touched surfaces, and run `uv run pytest` when shared
catalog, extension, preset, or init behavior changes.
6. Clean temporary linked worktrees with
`scripts/community/cleanup-worktrees.ps1` after they are no longer needed.

Community integration branches follow:

```
community/<issue-number>-<short-slug> # issue-template route
community/<short-slug> # pr-template route without an issue
```

---

## Integration Architecture

Each AI agent is a self-contained **integration subpackage** under `src/specify_cli/integrations/<key>/`. The subpackage exposes a single class that declares all metadata and inherits setup/teardown logic from a base class. Built-in integrations are then instantiated and added to the global `INTEGRATION_REGISTRY` by `src/specify_cli/integrations/__init__.py` via `_register_builtins()`.
Expand Down
29 changes: 22 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,8 @@ specify integration list

| 能力 | 来源 | 关键命令或产物 | 解决什么问题 |
| --- | --- | --- | --- |
| ARCH SSOT | `arch` 扩展 | `/speckit.arch.generate`、`/speckit.arch.reverse`、`.specify/memory/architecture*.md` | 把项目级 4+1 架构视图沉淀为稳定记忆,避免每个 feature 重新猜边界、约束和部署假设。 |
| ARCH SSOT | `arch` 扩展 | `/speckit.arch.scenario-generate`、`/speckit.arch.logical-generate`、`/speckit.arch.*-reverse`、`.specify/memory/architecture*.md` | 把项目级 4+1 架构视图沉淀为稳定记忆,避免每个 feature 重新猜边界、约束和部署假设。 |
| Intake 证据归一化 | `intake` 扩展 | `/speckit.intake.visual-design`、`/speckit.intake.prd`、`/speckit.intake.test-cases` | 把 PRD、设计和测试用例证据整理成 SDD 可消费的 intake artifact,再进入 specify/plan。 |
| 仓库治理规范 | `repository-governance` 扩展 | `/speckit.repository-governance.refresh`、受管 `SPECKIT GOVERNANCE` 段 | 统一 agent 的 SSOT 读取顺序、目录责任、平台适配和仓库事实证据。 |
| UI/UX 需求规格 | `workflow-preset` + `preview` 扩展 | `spec.md` 用户旅程、`behavior/uif.intent.json`、`contracts/uif/`、`/speckit.preview.mid-html` | 先把界面状态、断点、用户路径和交互假设写成规格/契约,再生成可打开的预览产物评审。 |
| BDD 引入 | `workflow-preset` | `/speckit.checklist`、`checklists/behavior-testability.md`、`contracts/bdd/` | 在规划前检查 Given/When/Then、可观察结果、边界和 NFR 声明,避免不可验证需求进入实现。 |
Expand All @@ -168,6 +169,7 @@ specify integration list
| 扩展 | 默认状态 | 你会用它做什么 |
| --- | --- | --- |
| `arch` | `specify init` 默认安装 | 生成或反向生成项目级 4+1 架构视图,形成 `.specify/memory/architecture*.md` 架构记忆。 |
| `intake` | `specify init` 默认安装 | 归一化 PRD、视觉设计和测试用例证据,生成下游 SDD 命令可读取的 intake artifact。 |
| `preview` | `specify init` 默认安装 | 根据当前 feature 的规格和计划生成低/中/高保真 Markdown wireflow 或自包含 HTML 预览,用于实现前验证 UI 和交互假设。 |
| `repository-governance` | `specify init` 默认安装 | 生成 Repository Governance Framework 治理说明,包含垂直 SSOT 注册、读取顺序、缺失 SSOT 处理和仓库事实证据。 |
| `git` | 初始化时默认安装,传 `--no-git` 可跳过 | 初始化 Git、创建 feature branch、校验分支、检测 remote,并可配置自动提交。 |
Expand All @@ -178,6 +180,7 @@ specify integration list

```bash
specify extension add arch
specify extension add intake
specify extension add preview
specify extension add repository-governance
specify extension add git
Expand All @@ -193,8 +196,11 @@ specify extension info arch
扩展命令示例:

```text
/speckit.arch.generate
/speckit.arch.reverse
/speckit.arch.scenario-generate
/speckit.arch.logical-generate
/speckit.arch.scenario-reverse
/speckit.intake.visual-design
/speckit.intake.prd
/speckit.preview.low-md
/speckit.preview.mid-html
/speckit.preview.high-html
Expand Down Expand Up @@ -226,8 +232,9 @@ specify preset info workflow-preset

### 什么时候用这些能力

- 新项目或架构正在变化:先跑 `/speckit.arch.generate`,让后续计划有稳定架构上下文。
- 接手旧仓库:跑 `/speckit.arch.reverse`,先从仓库事实反推架构记忆。
- 新项目或架构正在变化:按 scenario/logical/process/development/physical 顺序跑 `/speckit.arch.*-generate`,让后续计划有稳定架构上下文。
- 接手旧仓库:按 scenario/logical/process/development/physical 顺序跑 `/speckit.arch.*-reverse`,先从仓库事实反推架构记忆。
- 已有 PRD、设计稿或测试用例:先跑 `/speckit.intake.prd`、`/speckit.intake.visual-design` 或 `/speckit.intake.test-cases`,把外部证据归一化后再进入 `/speckit.specify`。
- 团队使用多个 agent 或新人频繁接手:跑 `/speckit.repository-governance.refresh`,把目录责任、SSOT 边界和 agent 执行规则写入上下文。
- 希望引入 BDD:保留默认 `workflow-preset`,让 `/speckit.checklist` 在规划前检查 BDD readiness,让 `/speckit.plan` 生成 BDD/UIF/fixture 行为草稿和正式契约。
- 做前端或交互功能:在 `/speckit.specify` 或 `/speckit.plan` 后跑 `/speckit.preview.mid-html` 或对应保真的 `*-md`/`*-html` 命令,先看预览再实现。
Expand Down Expand Up @@ -311,7 +318,11 @@ AGENTS.md

```text
/speckit.constitution
/speckit.arch.generate
/speckit.arch.scenario-generate
/speckit.arch.logical-generate
/speckit.arch.process-generate
/speckit.arch.development-generate
/speckit.arch.physical-generate
/speckit.specify
/speckit.clarify
/speckit.preview.mid-html
Expand All @@ -325,7 +336,11 @@ AGENTS.md

```text
/speckit.constitution
/speckit.arch.reverse
/speckit.arch.scenario-reverse
/speckit.arch.logical-reverse
/speckit.arch.process-reverse
/speckit.arch.development-reverse
/speckit.arch.physical-reverse
/speckit.repository-governance.refresh
/speckit.specify
/speckit.clarify
Expand Down
15 changes: 15 additions & 0 deletions docs/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,19 @@ obj/
# Temporary files
*.tmp
*.log
.tmp/
tmp/
temp/

# Local caches
__pycache__/
*.py[cod]
.pytest_cache/
.mypy_cache/
.ruff_cache/
.coverage
htmlcov/
.venv/
venv/
.DS_Store
Thumbs.db
Loading
Loading