# reflect

Adopt this skill: https://proskills.md/skills/other/jtaroreh-agystack-skills-reflect

Page: https://proskills.md/skills/other/jtaroreh-agystack-skills-reflect
This document is the public skill bundle for that page. It contains SKILL.md and every helper file the catalog carries. No login is required.

## File: skills/reflect/SKILL.md
size: 5110
upstream: https://github.com/jtaroreh/agystack/blob/main/skills/reflect/SKILL.md

````text
---
name: reflect
description: Spawn three parallel review subagents over the active transcript, surface learnings, and route each to a concrete edit on an existing skill. Use when the user says reflect.
disable-model-invocation: true
---

# Reflect

Mine the current conversation for durable learnings, then route them into skill edits.

## When to invoke

- The user said "reflect" or "/reflect".
- A complex task (5+ tool calls) just landed cleanly and the recipe is worth keeping.
- The agent hit dead ends, found the working path, and the path generalizes.
- The user corrected the agent's approach mid-task.
- A non-trivial workflow emerged that isn't captured anywhere.

Skip when the conversation is trivial, off-topic, or already covered by an existing skill the parent followed correctly. One-offs are not learnings.

## Process

### 1. Locate the active transcript

The parent finds its own transcript file before fanning out. Antigravity IDE chats live under `~/.gemini/antigravity-ide/brain/<conversation-id>/`. Prefer `.system_generated/logs/transcript.jsonl` or `transcript_full.jsonl`. The current session's `transcriptPath` is authoritative. Do not glob across `~/.cursor/projects/*/`.

```bash
ls -t ~/.gemini/antigravity-ide/brain/*/.system_generated/logs/transcript.jsonl ~/.gemini/antigravity/brain/*/.system_generated/logs/transcript.jsonl 2>/dev/null | head -10
```

Three transcript layouts: legacy flat (`<id>.jsonl`), current nested (`<id>/<id>.jsonl`), and subagent (`<parent>/subagents/<child>.jsonl`).

For each candidate, read the first JSONL line and check that `message.content[0].text` contains the conversation's opening user prompt. Take the matching path. If no path resolves, write a tight digest of the session and pass that instead.

### 2. Spawn three reviewers in parallel

Spawn three subagents in a single `invoke_subagent` turn, `TypeName: "self"` (or `"poteto-agent"`), explicit `Model: "pro"`, `Workspace: "inherit"`. Reviewers need MCP access for context lookups (tickets, chat threads, observability traces referenced in the transcript). The prompt forbids file writes; the parent applies edits.

| Lens | `Model` | Prompt template |
|---|---|---|
| Judgment | your configured reflect-judgment model (default `pro`) | `references/judgment-reviewer.md` |
| Tooling | your configured reflect-tooling model (default `pro`) | `references/tooling-reviewer.md` |
| Divergent | your configured reflect-judgment model (default `pro`) | `references/divergent-reviewer.md` |

Pass each template verbatim, substituting the transcript path or digest where marked. Reviewers return findings in their subagent response body.

### 3. Synthesize

Spawn one subagent via `invoke_subagent`: `TypeName: "self"` (or `"poteto-agent"`), `Role: "Reflect Synthesizer"`, using your configured reflect-judgment model (default `pro`), `Workspace: "inherit"`. The synthesizer's quality check includes spot-verifying citations. Use `references/synthesizer.md` verbatim, with each reviewer's full output inlined where marked. The synthesizer returns a structured Accepted / Rejected / Backlog list.

### 4. Structural enforcement check

Sanity-check the synthesizer's Accepted list. For any item that would be enforced more reliably by a lint rule, script, metadata flag, or runtime check, move it from Accepted to Backlog. The synthesizer already applies this criterion; this is a final pass before edits land. See the **encode-lessons-in-structure** principle skill.

### 5. Apply

Before applying any Accepted edit, present the synthesizer's full Accepted/Rejected/Backlog output to the user and wait for explicit approval. The user picks which subset to apply and may redirect routings. Skill changes affect every future agent in the org; do not auto-apply.

Backlog items file to whatever devex / backlog tracker your team uses automatically. Those are tracker submissions, not skill edits. Only the Accepted list waits for approval.

For each approved Accepted item, follow the Routing field exactly:

- Trivial existing-skill edit (a one-line bullet, a tightened sentence, a stale fact corrected): parent does directly.
- Substantive existing-skill edit (a new section, a new pattern table, more than ~10 lines): draft the new section following the unslop skill and validate frontmatter/links.
- `tune description: <skill path>` (the skill exists but didn't trigger when it should have): update the YAML frontmatter `description` scalar with precise trigger keywords.
- `new skill: <kebab-name>`: create a new skill directory under `.agents/skills/<kebab-name>/SKILL.md` (or in this plugin) with valid YAML frontmatter.

If your environment ships a SKILL.md validator, run it on every touched skill before declaring done. Skip this step if it doesn't.

### 6. Summarize for the user

Short list, no preamble:

- Edits applied: `<skill path>`. What changed, one line each.
- New skills created: `<skill path>`. One line each (rare).
- Backlog filed to the devex tracker: `<issue title>` (`<tags>`). One line each.
- Dropped: one line per rejected finding + reason from the synthesizer.
````

## File: README.md
upstream: https://github.com/jtaroreh/agystack/blob/main/README.md

````text
# agystack

[![CI](https://github.com/jtaroreh/agystack/actions/workflows/ci.yml/badge.svg)](https://github.com/jtaroreh/agystack/actions/workflows/ci.yml)
[![License: MIT](https://img.shields.io/badge/License-MIT-blue.svg)](./LICENSE)
[![Antigravity Plugin](https://img.shields.io/badge/Antigravity-Plugin-purple.svg)](https://antigravity.google)
[![Python 3.11+](https://img.shields.io/badge/Python-3.11%2B-blue.svg)](./pyproject.toml)
[![Bun 1.0+](https://img.shields.io/badge/Bun-1.0%2B-orange.svg)](https://bun.sh)

**agystack** is an agentic engineering framework for Google Antigravity, created by [Joel Taroreh](https://x.com/joeltaroreh). It equips autonomous agents with a set of rigorous skills, playbooks, and cloud swarms built on the anti-slop foundation of [poteto](https://x.com/poteto)'s Cursor pstack.

Where pstack brought anti-slop rigor to editor chats, **agystack expands it into a distributed, multi-tier engineering fleet**:

- **Google Cloud Run Fleets (`/swarm`).** When local machines hit limits, fan out across headless cloud containers. Fleet workers run in parallel, stream real-time milestones, and deliver isolated candidate patches to GCS without git worktree collisions.
- **The `/loop` Hillclimb Engine.** Run automated hypothesis-and-verify loops against a concrete test command (`--verify "<cmd>"`). agystack applies discrete edits, reverts regressions, and reactively iterates until green without manual babysitting.
- **Automated PR Babysitting & Stack Shipping (`watch-pr`).** Eliminate GitHub PR friction. Dedicated tooling monitors CI checks, detects merge conflicts across Graphite stacks, and triages review comments. Real defects get fixed with runtime reproduction, while bot noise gets dismissed with concrete reasons.
- **Adversarial Reviews & Bakeoffs (`/interrogate`, `/arena`).** Prevent single-agent blind spots. Dispatch concurrent reviewers to attack diffs from independent angles before shipping, or run competing candidate implementations in parallel worktrees and graft winning pieces sequentially.
- **Subagent Context Isolation & Anti-Slop Discipline (`/deslop`, `comment-sicko`).** Coordinator contexts stay fast and clean by delegating code modifications over 50 lines to isolated subagents, while dedicated reviewers actively strip defensive bloat, AI apologies, and narrative comments before merge.

Underneath the platform additions is the core engineering philosophy that started it:

> "i'm not a president or ceo, but i've worked with millions of lines of code at Meta, Netflix, and Cursor. i'm also on the react core team where i help build and maintain react compiler.
> 
> there's a growing sense that ai writes too much slop code. i agree. i don't want to ship like a team of twenty slop artists. throughput without quality is not a goal i aspire to. if you want to go fast, go deep first."
> 
> — [Lauren Tan (poteto)](https://x.com/poteto)

**The goal is not to maximize lines of code.** In fact, it is the opposite. agystack helps you write less code, verify every change against real runtime evidence, and scale parallel work without multiplying slop.

Fork it. Improve it. Make it yours. PRs are welcome! 

## install (Antigravity)

this repository is **agystack**, the agentic engineering framework for Google Antigravity created by Joel Taroreh, built on Lauren Tan's pstack.

### prerequisites

- `bun` (v1.0+) is used for PR babysitting (`watch-pr`). Orchestration is native agentic markdown via Brain Artifacts. Node.js is not supported.
- `gh` (GitHub CLI) is required for PR automation and preflight checks.
- `gt` (Graphite CLI) is recommended for stacked PRs.

### installation methods

#### Option 1: Antigravity Marketplace (Recommended)

From the Antigravity CLI:
```bash
agy plugin install agystack
```

Or inside the Antigravity App:
1. Open the left sidebar and select **Customizations**.
2. Switch to the **Marketplace** tab.
3. Search for `agystack` and click **Install**.

#### Option 2: Ask the agent

In any conversation turn, prompt:
```text
install this antigravity plugin for me: https://github.com/jtaroreh/agystack
```

#### Option 3: Manual Git Clone

Global install (all workspaces):
```bash
git clone https://github.com/jtaroreh/agystack.git ~/.gemini/config/plugins/agystack
```

Workspace-local install:
```bash
git clone https://github.com/jtaroreh/agystack.git .agents/plugins/agystack
```

Native Antigravity tools (`invoke_subagent`, `run_command`, `manage_task`, `schedule`, `ask_question`, and visual Artifacts) are documented in [`skills/poteto-mode/references/antigravity-tools.md`](./skills/poteto-mode/references/antigravity-tools.md).

Restart Antigravity or open a new chat after install.

## get started

two steps:

1. run [`/setup-agystack`](./skills/setup-agystack/SKILL.md) and choose which models you want, choose if you want to setup cloud swarm with Google Cloud auth. 
2. use [`/agystack`](./skills/agystack/SKILL.md) or [`/poteto-mode`](./skills/poteto-mode/SKILL.md) whenever you're doing anything that requires rigor.

new here? the [agystack guide](./docs/guide/README.md) walks you through a first real task, from setup and prompting through verification and overnight runs.

that's it. the other skills are situational; the mode skill uses them for you as needed. out of the box on Antigravity the mode splits work by model tier: fast mechanical code and exploration runs on `flash`, while judgment, complex tasks, and deep code run on `pro`. the default review panel is `pro` / `flash` / `inherit`. [`/setup-agystack`](./skills/setup-agystack/SKILL.md) changes any of it.

## usage

use [`/agystack`](./skills/agystack/SKILL.md) or [`/poteto-mode`](./skills/poteto-mode/SKILL.md) at the start of a task. it reads your request, picks from a set of playbooks, and runs the other skills as the steps need them.

### just use [`/agystack`](./skills/agystack/SKILL.md) or [`/poteto-mode`](./skills/poteto-mode/SKILL.md)

this skill is the main shortcut. i use it whenever i need the agent to do rigorous engineering work. it comes with twenty-three playbooks:

```
/poteto-mode this pr has a subtle bug where the scroll drifts every 750ms even when idle. repro
first, then fix and verify.
```

```
/poteto-mode i'm going to bed. land the stack even if ci flakes. i want everything merged by
morning.
```

<details>
<summary>the twenty-three playbooks</summary>

| playbook | for |
|---|---|
| [investigation](./skills/poteto-mode/playbooks/investigation.md) | a read-only question. how does x work, why was y built this way, are we sure. |
| [bug fix](./skills/poteto-mode/playbooks/bug-fix.md) | reproduce a defect, root-cause it, and fix with runtime evidence. |
| [perf](./skills/poteto-mode/playbooks/perf-issue.md) | trace a measured slowness and improve it against a baseline. |
| [hillclimb](./skills/poteto-mode/playbooks/hillclimb.md) | sustained, scientific improvement of one metric against a target, looping hypotheses with before/after measurement and one commit per accepted win. |
| [runtime forensics](./skills/poteto-mode/playbooks/runtime-forensics.md) | diagnose a live symptom (leak, idle-cpu spin, glitch) from instrumentation. |
| [trace forensics](./skills/poteto-mode/playbooks/trace-forensics.md) | diagnose a captured profiling artifact (cpuprofile, trace, spindump, heap snapshot). |
| [feature](./skills/poteto-mode/playbooks/feature.md) | new or changed behavior, built from a named data shape. |
| [refactoring](./skills/poteto-mode/playbooks/refactoring.md) | a behavior-preserving change to structure or shape. |
| [prototype](./skills/poteto-mode/playbooks/prototype.md) | a throwaway sketch to make a design or behavioral decision cheaply, or to settle an empirical fork by observing it. |
| [visual parity](./skills/poteto-mode/playbooks/visual-parity.md) | pixel-exact ui equivalence between two implementations. |
| [authoring a skill](./skills/poteto-mode/playbooks/authoring-a-skill.md) | writing or editing a SKILL.md. |
| [eval](.
````
