Skip to content

feat(memory): /init generates standard AGENTS.md with exploration-first prompt - #2768

Merged
topcheer merged 1 commit into
mainfrom
chore/agents-md-standard
Sep 25, 2026
Merged

topcheer merged 1 commit into
mainfrom
chore/agents-md-standard

Conversation

@topcheer

Copy link
Copy Markdown
Owner

Summary

User-directed change (3 parts):

  1. Repo's own memory file → standard AGENTS.md: GGCODE.md renamed to AGENTS.md (content unchanged, history preserved); GGCODE.md kept as a thin compat stub (one-liner pointer) so legacy lookups still work without duplicate context injection.

  2. /init now generates AGENTS.md: DefaultProjectMemoryFilename → "AGENTS.md"; startup "create memory?" prompt and /init target AGENTS.md. The loader still reads all four filenames (GGCODE.md / AGENTS.md / CLAUDE.md / COPILOT.md) — full backward compatibility; startup prompt only triggers when NONE exist.

  3. Exploration-first /init prompt (fixes the "template dump" problem): the old prompt handed the agent a pre-baked heuristic document to write verbatim. The new prompt instructs the agent to FIRST understand the repository (README, build manifests, entrypoints, Makefile/CI, representative sources) and THEN write AGENTS.md from what it actually found; the heuristic snapshot (detected paths/validation/conventions) is demoted to a verify-first hint block.

Files

  • GGCODE.md → AGENTS.md (rename) + compat stub
  • internal/memory/project.go — default filename const
  • internal/memory/init.go — template header # AGENTS.md, comments
  • internal/tui/commands.go — exploration-first prompt
  • internal/tui/ — i18n (11 languages), completion, comments; four-filename enumeration strings untouched
  • internal/memory/project_test.go — target assertion updated

Validation

  • go build -tags goolm ./... OK
  • go test -tags goolm ./internal/memory/ OK (incl. TestResolveProjectMemoryInitTarget with new default)
  • go test -tags goolm ./internal/tui/ OK (full package, i18n catalogs)
  • gofmt -l clean

Note: opened while PR throttle window shows 6 open PRs — this is a direct user request, not an issue-round fix.

…st prompt

- DefaultProjectMemoryFilename GGCODE.md -> AGENTS.md; /init and the
  startup prompt now target AGENTS.md (cross-CLI standard). Loader still
  reads GGCODE.md/CLAUDE.md/COPILOT.md as before.
- /init prompt rewritten: the agent must explore the repository (README,
  manifests, entrypoints, CI/Makefile, representative sources) and write
  AGENTS.md from what it actually found; the heuristic snapshot is now a
  verify-first hint block instead of verbatim content.
- Repo's own memory file converted: GGCODE.md -> AGENTS.md (renamed,
  content unchanged), with a thin GGCODE.md compat stub to avoid
  duplicate injection.
- i18n (11 languages), completion, and related comments updated;
  enumeration strings listing all four memory filenames untouched.

Co-Authored-By: ggcode <noreply@ggcode.dev>
@topcheer

Copy link
Copy Markdown
Owner Author

合并说明:techwriter_techwriter222_agent 代裁 approve(reviewer 作者回避;四复核:GGCODE.md→AGENTS.md 逐字迁移零丢失+stub 指向/四文件名枚举保留 GGCODE.md 仍优先/exploration-first prompt 全只读匹配含 plan 模式/i18n 11 语言 en fallback)。CI 9/9。执行合并。

@topcheer
topcheer merged commit 29fad0a into main Sep 25, 2026
9 checks passed
@topcheer
topcheer deleted the chore/agents-md-standard branch September 25, 2026 11:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant