[Feature]: Unify SDD artifacts under a configurable directory with staged legacy-layout retirement
维护者通常 1 天内回复
还没有人认领这个 Issue。
评估
- 难度
- 5/5
- 预计耗时
- 一周以上
- 新手友好度
- 22/100
调研方向
Start by reading the hardcoded constitution paths in templates/commands/constitution.md, src/specify_cli/command_init.py, and src/specify_cli/presets/_manager.py, then trace the legacy constitution readers and templates/commands/specify.md instructions. Map the shared path resolution and configuration behavior across initialization, constitution sync, feature numbering, and downstream commands. Done means the staged rollout, migration behavior, documentation, and cross-platform coverage meet the acceptance criteria.
由索引模型根据 Issue 内容生成。
描述
Problem and rationale
The project constitution currently lives at .specify/memory/constitution.md, while feature specifications and their related artifacts live under specs/. This separates governance from the artifacts it governs and mixes authored content with tooling/configuration.
Establish a clear boundary: .specify/ contains tooling/configuration; a configurable SDD root contains authored core-process artifacts. The selected proposed unified default is docs/speckit/sdd/, identifying ownership and purpose without claiming the generic specs/ directory. Deeper nesting and the assumption of a docs/ tree are tradeoffs, addressed by configurability.
Proposed solution
.specify/ # Tooling and configuration
docs/speckit/sdd/ # Unified SDD artifact root
constitution.md
001-user-auth/
spec.md
plan.md
tasks.md
Initially make the unified layout explicit opt-in. Support relocating the entire root through an environment variable, provisionally SPECIFY_SPECS_DIR. Separate unified-layout selection from a custom root override so opting in can use the proposed default without specifying a custom path.
Define persistent project-level selection so missing environment variables do not accidentally switch layouts across terminals, agents, or CI. Proposed precedence: environment override, project setting, applicable layout default. Do not automatically persist transient environment overrides. Relative roots resolve against the Spec Kit project root, not the current working directory.
Preserve SPECIFY_FEATURE_DIRECTORY as a per-feature override that does not relocate the project constitution. Do not silently reinterpret recorded .specify/feature.json paths under a changed root.
Centralize deterministic root/constitution resolution and provide resolved paths to commands. Wire initialization, constitution creation/amendment, preset synchronization/provenance, feature creation/numbering, prerequisite/path helpers, and downstream readers together. Agent instructions must consume the same resolved paths rather than independently guessing configuration.
Migration of existing projects is explicit: preserve authored content, detect the legacy constitution before creating a new one, and report competing constitutions rather than arbitrarily selecting, synchronizing, overwriting, or deleting them. Final selection syntax and migration mechanics remain implementation-design work.
Four-stage rollout
- Opt-in: Add unified/configurable paths while preserving legacy defaults for projects that have not opted in. Document selection and migration.
- Deprecation warnings: Warn on the legacy layout with actionable migration guidance. Do not move files or change behavior.
- Default flip with legacy opt-out: Default newly initialized projects to the unified layout. Preserve explicit legacy compatibility for existing projects, without silent moves or replacement constitutions.
- Removal: Retire legacy-layout compatibility after an adequate announced transition period. Unmigrated projects receive actionable migration errors, not missing-constitution behavior or replacement artifacts.
No specific release versions are committed. PR boundaries alone are not compatibility windows; allow real release/adoption time. Deprecation applies to the legacy layout, not to configurable artifact roots.
Acceptance criteria
- Initial opt-in leaves all non-opted-in defaults unchanged.
- Unified defaults place constitution and feature directories under
docs/speckit/sdd/; an environment override relocates the entire root. - Selection, configuration precedence, persistence, and existing-project detection are explicit and documented.
- Relative paths resolve consistently from the project root, including invocations in subdirectories; invalid configuration fails explicitly rather than silently falling back.
- Every relevant reader/writer uses the resolved paths, including initialization and constitution-sync preset reconciliation/provenance.
- Per-feature overrides and persisted feature paths retain their meaning.
- Numbering scans the selected root and ignores the constitution file.
- Migration preserves authored content and is deliberate; conflicting constitutions are reported without automatic overwrites or arbitrary precedence.
- Warning, default-flip/opt-out, and removal stages implement the compatibility behavior above.
- Positive and negative coverage demonstrates legacy compatibility, custom roots, absent overrides, invalid configuration, conflicts, and preserved feature selection.
- Bash, Python, and Windows PowerShell 5.1 behavior remains consistent with appropriate validation evidence.
- Core command instructions and directly related documentation explain layout, relocation, migration, and retirement.
- Default flip and removal are gated on compatibility evidence and adequate announced transition time, not predetermined version numbers.
Alternatives and scope
Keeping the split layout avoids migration but not the organization/relocation problem. specs/constitution.md is shallower but still claims a generic root; users may select it through configuration. Environment-only selection risks accidental switching, and automatic moves risk duplicate constitutions or broken workflows.
This is a tracking issue for separate staged PRs, not a request for an all-stages implementation. Bug and idea-assessment extensions follow the common convention in separate tracking issues: github/spec-kit#5038 (https://github.com/github/spec-kit/issues/5038) and github/spec-kit#5039 (https://github.com/github/spec-kit/issues/5039). Core must not become responsible for their domain-specific paths.
Repository evidence: constitution write paths are hardcoded in templates/commands/constitution.md, src/specify_cli/command_init.py, and src/specify_cli/presets/_manager.py; other core commands read the legacy constitution; templates/commands/specify.md explicitly instructs feature creation/numbering under specs/. Changing scripts alone would be incomplete.
Replaces the mistakenly filed fork issue https://github.com/mnriem/spec-kit/issues/58, with the user's authorization. All agents are affected.
AI disclosure
Drafted and filed on behalf of @mnriem using GitHub Copilot App, powered by GPT-6.1 Sol (gpt-6.1-sol), in human-supervised interactive discussion. The agent inspected relevant repository paths and drafted the rationale, rollout, and acceptance criteria. The user authorized filing upstream and selected docs/speckit/sdd/ as the proposed unified default. Reasoning-effort setting was not available to report. No implementation changes were made.
- 主要语言
- Python
- 星标
- 149k
- 派生
- 13.4k
- 平均合并
- 1 天 5 小时
- 30 天内合并 PR
- 223
环境准备
在浏览器里用你自己的 GitHub 账号启动这个项目的开发容器。
- 没有 Dockerfile 或 Docker Compose 文件
- 有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
github/spec-kit 的其他 Issue
-
难度 2/5 1-3 小时 新手友好度 68/100
维护者通常 1 天内回复
-
triage-must-have
难度 1/5 1 小时以内 新手友好度 78/100
维护者通常 1 天内回复
-
Workflow-step verifier test fixture breaks when the checkout path contains whitespace (4 failures on macOS)可能已有人在做 @mehdikarimi55 于 3 天前认领。 未关闭triage-can-wait
难度 2/5 1-3 小时 新手友好度 83/100
维护者通常 1 天内回复
-
Parity tests fail under the documented direct pytest invocation when the ambient python3 lacks PyYAML (11 failures)可能已有人在做 @mehdikarimi55 于 3 天前认领。 未关闭triage-must-have
难度 2/5 1-3 小时 新手友好度 82/100
维护者通常 1 天内回复
-
bug triage-out-of-scope
难度 2/5 1-3 小时 新手友好度 64/100
维护者通常 1 天内回复
相似的 Issue
-
bug
难度 2/5 1-3 小时 新手友好度 80/100
glossyio/traffic-monitor#312 ·
维护者通常 1 天内回复
-
documentation enhancement
难度 2/5 1-3 小时 新手友好度 76/100
es-ude/elastic-ai.creator#1046 ·
维护者通常 3 天内回复
-
feature request
难度 2/5 1-3 小时 新手友好度 65/100
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 72/100
confident-ai/deepteam#306 ·
维护者通常 1 天内回复
-
SslLibrary crashes with unhandled OSError: port/proto not found on non-standard SSL ports可能已有人在做 @himanchalkaushale 今天认领。 未关闭
难度 2/5 1-3 小时 新手友好度 82/100
OWASP/Nettacker#1884 · 1 条评论 ·
维护者通常 1 天内回复