Skip to content

feat: add /solve (ticket to PR) and /memory (persistent session memory)#403

Open
johnbanr wants to merge 3 commits intogarrytan:mainfrom
johnbanr:feat/solve-and-memory
Open

feat: add /solve (ticket to PR) and /memory (persistent session memory)#403
johnbanr wants to merge 3 commits intogarrytan:mainfrom
johnbanr:feat/solve-and-memory

Conversation

@johnbanr
Copy link

Summary

  • /solve TICKET-ID chains all existing skills into one command. Takes a Linear, Jira, or GitHub Issues ticket and runs the full loop: fetch ticket, /investigate (with memory search), code the fix, /review (self-review), test, /ship, update ticket. Only asks the user when confidence is below 80% or tests fail after 2 attempts. Everything else is autonomous.

  • /memory adds persistent knowledge across sessions. Stores bug patterns, fixes, lessons, and anti-patterns in ~/.gstack/memory/ as markdown files. Other skills use it automatically: /investigate searches for similar patterns before debugging, /review checks for known anti-patterns in the diff, /ship indexes the fix after merge. Includes /memory import for one-time backfill from git history with quality filters (skips reverted commits, incomplete fixes).

  • Memory compounds over time. Session 1 indexes 0 patterns. Session 101 starts with 100 patterns to search against. Extends "Search Before Building" (Layer 1-3: external knowledge) to Layer 0: your own past work.

What changed

File Purpose
solve/SKILL.md.tmpl Template with {{PREAMBLE}} + memory-specific preamble extension
solve/SKILL.md Generated skill (ticket fetch, investigate, code, review, test, ship, memory update)
memory/SKILL.md.tmpl Template with {{PREAMBLE}} + memory stats preamble extension
memory/SKILL.md Generated skill (search, add, import, prune, dashboard + integration hooks)

Context

Built this after running gstack on our CI pipeline (~50 issues, 4500+ PRs). Two gaps we hit:

  1. /investigate found a null-check bug Monday. Wednesday, exact same pattern in a different service, started from zero. Memory would have flagged it in seconds.
  2. Wanted to go from a Linear ticket to a merged PR. All the skills exist but no orchestrator. /solve is that orchestrator as a native skill.

Both follow gstack conventions: .tmpl files with {{PREAMBLE}}, standard preamble, telemetry, proactive config, Boil the Lake intro. Happy to adapt anything to fit the build system better.

…t session memory)

/solve TICKET-ID: chains fetch → investigate → code → review → test → ship
from a single ticket ID. Supports Linear, Jira, and GitHub Issues.

/memory: indexes patterns, fixes, and lessons from past sessions so future
sessions compound. Integrates with /investigate (search before debugging),
/review (check for anti-patterns), and /ship (auto-index after shipping).

Storage: ~/.gstack/memory/ as markdown files (patterns.md, fixes.md,
lessons.md, anti-patterns.md). Includes backfill from git history and
quality filters to prevent indexing bad fixes.
Both skills now include the full preamble (update check, session tracking,
telemetry, repo mode, lake intro, proactive config) matching the pattern
used by /ship, /investigate, /review, and other existing skills.
Follow gstack convention: .tmpl files use {{PREAMBLE}} placeholder,
SKILL.md files are auto-generated with the standard preamble expanded.
Both skills include skill-specific preamble extensions (memory count,
pattern count) after the standard block.
@sevastyanovio
Copy link

Hey John! Really cool PR — /solve is genuinely exciting as a ticket-to-PR orchestrator. Read through the whole diff.

I wanted to flag that I've been working on a related but different approach to the "sessions compound over time" problem: PR #405 (/meditate). It comes at it from a different angle so figured it's worth comparing notes.

Where /memory shines that /meditate doesn't:

  • Structured bug/fix/lesson records with searchable metadata (domain, tags, quality rating) — great for "we fixed this exact pattern before" recall
  • The anti-patterns.md file is smart — tracking what DIDN'T work is as valuable as tracking what did
  • /solve is independently awesome and doesn't overlap with anything in my PR

Where /meditate takes a different approach:

  • Proactive vs. reactive — /meditate scans the whole repo + past AI conversations automatically (daily background via preamble), rather than requiring manual /memory add or post-ship append. It discovers things you never thought to ask about.
  • Multi-AI — mines sessions from Claude Code, Codex CLI, and Gemini CLI (reuses gstack-global-discover.ts patterns)
  • Compiled binary scanner — deterministic data collection with zero LLM cost, runs in <1s
  • Preamble-integrated — every skill reads .gstack/context.md automatically, not just /investigate and /review
  • Broader scope — architecture map, hotspots, conventions, user taste, recurring problems, skill-specific foresight (not just bug patterns)

I think these are complementary, not competing. /meditate provides repo-wide consciousness (the "body scan"), /memory provides structured recall of specific incidents (the "long-term memory"). The ideal v2 could have /meditate's conversation mining feed into /memory's structured storage — best of both.

One technical note on /memory's storage: append-only markdown files (patterns.md, fixes.md) might get unwieldy at scale (500+ entries). JSON or JSONL with structured fields would make search/prune/dedup more reliable — the gstack codebase already uses this pattern extensively (analytics, eval-store, review logs).

Would love to coordinate if both PRs land. Happy to make /meditate aware of /memory's files so it can incorporate bug patterns into the "Recurring Problems" section.

@johnbanr
Copy link
Author

Fair point — /meditate and /memory come at the same problem from different angles. The triage was an automated first pass, not a deep review of each PR. Happy to coordinate if both land.

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.

2 participants