diff --git a/openspec/changes/update-agent-file-name/proposal.md b/openspec/changes/update-agent-file-name/proposal.md new file mode 100644 index 00000000..365d6553 --- /dev/null +++ b/openspec/changes/update-agent-file-name/proposal.md @@ -0,0 +1,29 @@ +# Update Agent Instruction File Name + +## Problem +The agent instructions live in `openspec/README.md`, which clashes with conventional project README usage and creates confusion for tooling and contributors. + +## Solution +Rename the agent instruction file to `openspec/AGENTS.md` and update OpenSpec tooling to use the new filename: +- `openspec init` generates `AGENTS.md` instead of `README.md` +- Templates and code reference `AGENTS.md` +- Specifications and documentation are updated accordingly + +## Benefits +- Clear separation from project documentation +- Consistent naming with other agent instruction files +- Simplifies tooling and project onboarding + +## Implementation +- Rename instruction file and template +- Update CLI commands (`init`, `update`) to read/write `AGENTS.md` +- Adjust specs and documentation to reference the new path + +## Risks +- Existing projects may still rely on `README.md` +- Tooling may miss lingering references to the old filename + +## Success Metrics +- `openspec init` creates `openspec/AGENTS.md` +- `openspec update` refreshes `AGENTS.md` +- All specs reference `openspec/AGENTS.md` diff --git a/openspec/changes/update-agent-file-name/specs/cli-init/spec.md b/openspec/changes/update-agent-file-name/specs/cli-init/spec.md new file mode 100644 index 00000000..76a23758 --- /dev/null +++ b/openspec/changes/update-agent-file-name/specs/cli-init/spec.md @@ -0,0 +1,36 @@ +## MODIFIED Requirements + +### Requirement: Directory Creation +The command SHALL create the complete OpenSpec directory structure with all required directories and files. + +#### Scenario: Creating OpenSpec structure +- **WHEN** `openspec init` is executed +- **THEN** create the following directory structure: +``` +openspec/ +├── project.md +├── AGENTS.md +├── specs/ +└── changes/ + └── archive/ +``` + +### Requirement: File Generation +The command SHALL generate required template files with appropriate content for immediate use. + +#### Scenario: Generating template files +- **WHEN** initializing OpenSpec +- **THEN** generate `AGENTS.md` containing complete OpenSpec instructions for AI assistants +- **AND** generate `project.md` with project context template + +### Requirement: AI Tool Configuration Details + +#### Scenario: Creating new CLAUDE.md +- **WHEN** CLAUDE.md does not exist +- **THEN** create new file with OpenSpec content wrapped in markers including reference to `@openspec/AGENTS.md` + +### Requirement: Success Output + +#### Scenario: Displaying success message +- **WHEN** initialization completes successfully +- **THEN** include prompt: "Please explain the OpenSpec workflow from openspec/AGENTS.md and how I should work with you on this project" diff --git a/openspec/changes/update-agent-file-name/specs/cli-update/spec.md b/openspec/changes/update-agent-file-name/specs/cli-update/spec.md new file mode 100644 index 00000000..32f7e284 --- /dev/null +++ b/openspec/changes/update-agent-file-name/specs/cli-update/spec.md @@ -0,0 +1,22 @@ +## MODIFIED Requirements + +### Requirement: Update Behavior +The update command SHALL update OpenSpec instruction files to the latest templates in a team-friendly manner. + +#### Scenario: Running update command +- **WHEN** a user runs `openspec update` +- **THEN** replace `openspec/AGENTS.md` with the latest template + +### Requirement: File Handling +The update command SHALL handle file updates in a predictable and safe manner. + +#### Scenario: Updating files +- **WHEN** updating files +- **THEN** completely replace `openspec/AGENTS.md` with the latest template + +### Requirement: Core Files Always Updated +The update command SHALL always update the core OpenSpec files and display an ASCII-safe success message. + +#### Scenario: Successful update +- **WHEN** the update completes successfully +- **THEN** replace `openspec/AGENTS.md` with the latest template diff --git a/openspec/changes/update-agent-file-name/specs/openspec-conventions/spec.md b/openspec/changes/update-agent-file-name/specs/openspec-conventions/spec.md new file mode 100644 index 00000000..9844b70d --- /dev/null +++ b/openspec/changes/update-agent-file-name/specs/openspec-conventions/spec.md @@ -0,0 +1,27 @@ +## MODIFIED Requirements + +### Requirement: Project Structure +An OpenSpec project SHALL maintain a consistent directory structure for specifications and changes. + +#### Scenario: Initializing project structure +- **WHEN** an OpenSpec project is initialized +- **THEN** it SHALL have this structure: +``` +openspec/ +├── project.md # Project-specific context +├── AGENTS.md # AI assistant instructions +├── specs/ # Current deployed capabilities +│ └── [capability]/ # Single, focused capability +│ ├── spec.md # WHAT and WHY +│ └── design.md # HOW (optional, for established patterns) +└── changes/ # Proposed changes + ├── [change-name]/ # Descriptive change identifier + │ ├── proposal.md # Why, what, and impact + │ ├── tasks.md # Implementation checklist + │ ├── design.md # Technical decisions (optional) + │ └── specs/ # Complete future state + │ └── [capability]/ + │ └── spec.md # Clean markdown (no diff syntax) + └── archive/ # Completed changes + └── YYYY-MM-DD-[name]/ +``` diff --git a/openspec/changes/update-agent-file-name/tasks.md b/openspec/changes/update-agent-file-name/tasks.md new file mode 100644 index 00000000..43fb206d --- /dev/null +++ b/openspec/changes/update-agent-file-name/tasks.md @@ -0,0 +1,22 @@ +# Update Agent Instruction File Name - Tasks + +## 1. Rename Instruction File +- [ ] Rename `openspec/README.md` to `openspec/AGENTS.md` +- [ ] Update root references to new path + +## 2. Update Templates +- [ ] Rename `src/core/templates/readme-template.ts` to `agents-template.ts` +- [ ] Update exported constant from `readmeTemplate` to `agentsTemplate` + +## 3. Adjust CLI Commands +- [ ] Modify `openspec init` to generate `AGENTS.md` +- [ ] Update `openspec update` to refresh `AGENTS.md` +- [ ] Ensure CLAUDE.md markers link to `@openspec/AGENTS.md` + +## 4. Update Specifications +- [ ] Modify `cli-init` spec to reference `AGENTS.md` +- [ ] Modify `cli-update` spec to reference `AGENTS.md` +- [ ] Modify `openspec-conventions` spec to include `AGENTS.md` in project structure + +## 5. Validation +- [ ] `pnpm test`