github / github/copilot-cli

Feature: long-running goals via .copilot/goals.md (per-repo + global)

Đang mở
#3,364 2 bình luận 3 reaction 0 người được giao Xem trên GitHub
area:configuration area:context-memory
Ngôn ngữ chính
Shell
Star
11.2k
Fork
1.9k
Merge trung bình
14 giờ 16 phút
Pull request đã merge (30 ngày)
6

Mô tả

## Summary

Add first-class support for **long-running, cross-session goals** via a declarative `.copilot/goals.md` file (per-repo) and `~/.copilot/goals.md` (global) that the agent reads at session start and updates as work progresses.

Complements (but does not overlap with) #1912 (full session persistence) and #2129 (scheduled/loop tasks). This is the **simplest possible primitive**: a user-owned markdown file the agent treats as durable intent.

## Problem

Today, Copilot CLI sessions are stateless across `/new`, `/clear`, and compaction. Users working on multi-day or multi-session efforts must re-explain objectives every time. The existing `AGENTS.md` / `CLAUDE.md` patterns are great for *instructions*, but not for *goals with state* (in-progress, paused, done).

## Proposed solution

1. On session start, if `.copilot/goals.md` (cwd) or `~/.copilot/goals.md` (home) exists, load them into context and surface active goals to the user.
2. Provide a `/goals` slash command:
- `/goals` — list active goals
- `/goals add ` — append a new active goal (per-repo by default; `--global` for home)
- `/goals done <id>` / `/goals pause <id> <reason>`
- `/goals edit` — open in `$EDITOR`
3. File format is **plain markdown** with a minimal convention (sections `## active` / `## paused` / `## done`, one `### goal: <id>` per entry, key/value lines). Users can edit by hand; the agent reads/writes idempotently.
4. Auto-add `.copilot/goals.md` to `.gitignore` on first write (configurable).

### Example file

```markdown
# Goals

## active

### goal: migrate-to-pnpm
- title: Migrate all repos from npm to pnpm
- created: 2026-05-18
- updated: 2026-05-18
- progress: 3/12 repos
- notes: |
Done: coven-docs, coven-web, coven-cli.
Convention: pnpm@9, workspace protocol for internal deps.
- next: Convert openhands-agent-canvas — has a postinstall script that breaks under pnpm.
```

## Why a file (not a DB)?

- **Survives compaction by construction** — it's on disk.
- **User-owned and grep-able** — no opaque session blobs.
- **Agent-agnostic** — same file works for Copilot CLI, Claude Code, Codex.
- **Zero infra** — no daemon, no migration story.

## Prior art / parallel work

I built this as a portable skill that works today across multiple agents: <https://github.com/BunsDev/copilot-skills/tree/master/long-running-goals>. Installable via `npx skills add BunsDev/copilot-skills@long-running-goals`.

Promoting it to a first-class CLI feature would give:
- Native slash command (no skill-injection round-trip)
- Auto-loading without depending on the skill being installed
- Editor integration (`/goals edit`)
- Consistent path conventions across users

## Out of scope (for this issue)

- Full conversation persistence (tracked in #1912)
- Scheduled/loop execution (tracked in #2129)
- Multi-user shared goals (could come later)

## Related

- #1912 Context Manager for Persistent Sessions Per Folder
- #2129 Loop / Scheduled commands to allow long-running tasks
- #868 `--additional-skills` option

Happy to iterate on the spec or contribute (CLI is closed-source, but I can refine the design and ship the skill as a stopgap).

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

Đánh giá

Issue này chưa được đánh giá.

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.