Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
74 changes: 33 additions & 41 deletions .agents/rules/code-core.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
name: code-core
description: Workflow rules shared by every code repo - DocVault, glossary, Plane, Infisical, debugging, memory, code search, editing, tests, spec gates, push rules, red flags, GitHub hygiene
library-version: 6b4e75d9e513
library-version: ce6718eb297b
---

# Code-core rules
Expand Down Expand Up @@ -35,7 +35,8 @@
- **Public repos:** before writing to `<repo>/DocVault/`, check nothing sensitive is going in. Sensitive
material goes to the private companion instead.
- If a page looks stale, flag it; do not silently act on suspected bad data.
- On conflicts between DocVault and mem0, the newest information wins. Ask when it is unclear.
- On conflicts between DocVault and SessionFlow memory, the newest information wins. Ask when it is
unclear.

## Domain glossary

Expand Down Expand Up @@ -96,10 +97,10 @@
- Shell: always quote paths; many contain spaces (iCloud, Cowork, vault paths).
- When comparing file counts against an index, use `git ls-files | wc -l`, not a raw filesystem count. Raw
counts include `.venv` and `node_modules`.
- A transient MCP, Plane or mem0 failure (empty payload, temporary error, unexpected empty result for a
known object): wait about 60 seconds and retry once. If it still fails, continue with local-safe steps.
An HTTP 429 or "quota exceeded" from mem0 is not transient: do not retry, continue without mem0 reads and
tell the user.
- A transient MCP, Plane or SessionFlow failure (empty payload, temporary error, unexpected empty result
for a known object): wait about 60 seconds and retry once. If it still fails, continue with local-safe
steps. A `memory_unavailable` error means the memory store has not started: say so and continue without

Check notice on line 102 in .agents/rules/code-core.md

View check run for this annotation

Codacy Production / Codacy Static Code Analysis

.agents/rules/code-core.md#L102

Expected: 80; Actual: 105
memory reads; `/health` names the reason.

## Memory: coexisting layers

Expand All @@ -108,49 +109,41 @@

| Layer | Scope | Role |
|---|---|---|
| **mem0** (hosted MCP connector; the tool prefix is account-specific) | cross-session and cross-harness | **The bigger picture**: one `/wrap` session summary per session (what, when, files, issues, decisions), plus explicit decisions and handoffs |
| **SessionFlow memory** (`mcp__sessionflow__` memory tools, Postgres-backed) | cross-session and cross-harness | **The bigger picture**: one `/wrap` session summary per session (what, when, files, issues, decisions), plus explicit decisions and handoffs |

Check notice on line 112 in .agents/rules/code-core.md

View check run for this annotation

Codacy Production / Codacy Static Code Analysis

.agents/rules/code-core.md#L112

Expected: 80; Actual: 256
| **local Codex memory** (`~/.codex/memories/`) | Codex only | **Day-to-day operating memory**: preferences, corrections, gotchas |
| **`.context/`** (in-repo) | per-project, all harnesses | **Long-term foundations** needed for implementation work: architecture, conventions, standards |
| **sessionflow** (`mcp__sessionflow__*`) | all harnesses, all projects | Transcript search over verbatim past turns; the session-start recall tier |
| **SessionFlow transcripts** (`mcp__sessionflow__search_all_sessions` and friends) | all harnesses, all projects | Transcript search over verbatim past turns; the session-start recall tier |
| **Plane** (`mcp__plane__*`) | per-project issues | Issue and planning state, not a memory store |

mem0 + sessionflow + git history together give the full picture of past work. Lessons ("when X, do Y") go
to local memory, not mem0. Durable foundations go to `.context/`.
SessionFlow memory, transcript search and git history together give the full picture of past work.
Lessons ("when X, do Y") go to local memory, not SessionFlow memory. Durable foundations go to `.context/`.

**Recall at session start (two sources):**
**Recall at session start:** the SessionFlow session-start hook already prints the three newest session
summaries and recent turns for the project, with session provenance. Go further only when the task needs it:

1. **sessionflow**: verbatim past turns, semantic search:
```javascript
mcp__sessionflow__list_memories({ project: "<project>", type: "session-summary", limit: 10 })
mcp__sessionflow__search_memories({ query: "<issue ID> <feature> handoff", project: "<project>", n: 10 })
mcp__sessionflow__search_all_sessions({ query: "<issue ID> <feature>", n: 5 })
```

```javascript
mcp__sessionflow__search_all_sessions({ query: "last session work decisions <project>", n: 5 })
```

2. **mem0**: session summaries, decisions, handoffs. The tool prefix is not fixed.
Resolve the hosted mem0 `search_memories` tool from the current tool catalog.

```javascript
search_memories({ query: "last session work decisions for <project>", limit: 10,
filters: { AND: [{ user_id: "lbruton" }, { metadata: { project: "<project>" } }] },
enable_graph: false })
```

**mem0 standard (DEVS-92)**: three keys on every record.
**Memory standard**: every record carries these keys.

| Key | Value | Source |
|---|---|---|
| `user_id` | `lbruton`, always | `project.json` → `mem0.userId` |
| `agent_id` | the harness writing: `codex` here (other harnesses write `claude-code`, `claude-cowork`, `codex`, `gemini`, `opencode` or `antigravity`) | the harness itself; never `project.json`, never a project name |
| `metadata.project` | lowercase project slug (`staktrakr`, `devops`) | `project.json` → `mem0.project`, else the lowercase `tag` |

- **Writes:** set all three plus `metadata.type` ∈ `session-summary` / `decision` / `handoff`. Routine
writes come from `/wrap` only (one paragraph `session-summary`). Use a direct `add_memory` call
(`type: decision` or `handoff`) only for an explicit decision or handoff that must be shared before the
session ends. Never write a mem0 entry per task: commits, PRs and Plane comments record each task.
- **Reads:** filter `user_id` + `metadata.project` server-side (the match is case-sensitive). Never filter
on `agent_id`: every harness must see the others' handoffs. Run TWO searches: one project-scoped, one
user-only cross-project workflow query.
- **Quota:** the plan allows 1,000 retrieval calls per month, shared by every harness. Never page through
the store in bulk; estimate call counts before any audit.
| `user_id` | `lbruton` (the default; omit it) | `project.json` → `memory.userId` |
| `agent_id` | the harness writing: `codex` here (one of `claude-code`, `codex`, `gemini`, `opencode`, `antigravity`) | the harness itself; never `project.json`, never a project name |
| `project` | lowercase project slug (`staktrakr`, `devops`) | `project.json` → `memory.project`, else the lowercase `tag` |
| `type` | `session-summary`, `decision`, `handoff`, `fact`, `workflow`, `discovery`, `contact`, `blocker`, `preference`, `open-item`, `milestone` or `guardrail` | the kind of note |

- **Writes:** routine writes come from `/wrap` only (one `session-summary` per session). Call
`mcp__sessionflow__add_memory` directly (`type: decision` or `handoff`) only for an explicit decision or
handoff that must be shared before the session ends. Never write a memory per task: commits, PRs and Plane
comments record each task.
- **Reads:** every memory call passes `project`; pass `"*"` for a cross-project query. Never filter on
`agent_id`: every harness must see the others' handoffs. Pass `format: "json"` when you parse the result.
- **Replace, do not duplicate:** a later `mcp__sessionflow__add_memory` with the same `topic_key` replaces that record. To
retire older notes, pass their IDs in `supersedes`.

## Code search order (cheapest first)

Expand All @@ -167,8 +160,7 @@

| Server | Use for |
|---|---|
| `mem0` (hosted connector) | Cross-session memory, sole backend |
| `sessionflow` | Session history search: semantic retrieval over past conversation turns |
| `sessionflow` | Session history search over past turns, and the cross-session memory store: `mcp__sessionflow__add_memory`, `mcp__sessionflow__search_memories`, `mcp__sessionflow__list_memories`, `mcp__sessionflow__get_memory`, `mcp__sessionflow__update_memory`, `mcp__sessionflow__delete_memory`, `mcp__sessionflow__get_memory_context` |
| `context7` | Library documentation lookup |
| `chrome-devtools` | Browser-page inspection and debugging |
| `infisical` | Secret inventory; fallback only, use the `infisical-agent` CLI first |
Expand Down
2 changes: 1 addition & 1 deletion .agents/rules/prose-core.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
library-version: 6b4e75d9e513
library-version: ce6718eb297b
---
# Prose-core rules

Expand Down
2 changes: 1 addition & 1 deletion .agents/skills/codacy-analysis-cli/SKILL.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ license: MIT
metadata:
author: Codacy
version: 1.5.0
library-version: 6b4e75d9e513
library-version: ce6718eb297b
---

# Codacy Analysis CLI
Expand Down
2 changes: 1 addition & 1 deletion .agents/skills/codacy-cloud-cli/SKILL.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ license: MIT
metadata:
author: Codacy
version: 1.6.1
library-version: 6b4e75d9e513
library-version: ce6718eb297b
---

# Codacy Cloud CLI
Expand Down
2 changes: 1 addition & 1 deletion .agents/skills/codacy-code-review/SKILL.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ license: MIT
metadata:
author: Codacy
version: 1.5.0
library-version: 6b4e75d9e513
library-version: ce6718eb297b
---

# Codacy Code Review
Expand Down
2 changes: 1 addition & 1 deletion .agents/skills/code-review/SKILL.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name: code-review
description: "Run CodeRabbit CLI reviews, retrieve saved local or GitHub PR fix prompts, and interpret CodeRabbit authentication and review output. Use for CodeRabbit review commands, committed/uncommitted or directory scopes, and CodeRabbit runbooks. Default code-review skill: also trigger for explicit code/PR/quality/security review requests or when a review is needed."
metadata:
version: "0.1.0"
library-version: 6b4e75d9e513
library-version: ce6718eb297b
---

# CodeRabbit Code Review
Expand Down
2 changes: 1 addition & 1 deletion .agents/skills/context-drift/SKILL.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ description: >-
`/vault-drift` for projects migrated to `.context/` (DEVS-37). Triggers: "context drift", "vault drift", "drift audit", "drift check",
"context-drift", "audit .context", "check context docs", "foundation drift", "verify foundation",
"what should be in .context".
library-version: 6b4e75d9e513
library-version: ce6718eb297b
---

# Context Drift
Expand Down
2 changes: 1 addition & 1 deletion .agents/skills/discernment-nudge/SKILL.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ description: >
to double-check, cite, or review — the skill file explains these
boundaries and the exact output format.
license: Complete terms in LICENSE.txt
library-version: 6b4e75d9e513
library-version: ce6718eb297b
---

# Discernment nudge
Expand Down
40 changes: 19 additions & 21 deletions .agents/skills/discover/SKILL.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
Triggers on "/discover", "/brainstorm", "research this issue", "explore this
before we spec it".
user-invocable: true
library-version: 6b4e75d9e513
library-version: ce6718eb297b
---

# Discover — Phase 1 Structured Brainstorm
Expand Down Expand Up @@ -65,9 +65,9 @@

## Research fan-out (Steps 1–3) — run as a read-only Workflow

Steps 1–3 are pure read work across independent angles — the canonical use for the `Workflow` orchestration tool. When the research surface is broad (multiple subsystems, prior art *and* external docs *and* mem0 history), dispatch the sweep as a **`Workflow` fan-out**: one parallel agent per angle —
Steps 1–3 are pure read work across independent angles — the canonical use for the `Workflow` orchestration tool. When the research surface is broad (multiple subsystems, prior art *and* external docs *and* memory history), dispatch the sweep as a **`Workflow` fan-out**: one parallel agent per angle —

1. **Prior context** — mem0 + sessionflow + the project and shared vaults (Grep).
1. **Prior context** — SessionFlow memory and transcripts + the project and shared vaults (Grep).

Check notice on line 70 in .agents/skills/discover/SKILL.md

View check run for this annotation

Codacy Production / Codacy Static Code Analysis

.agents/skills/discover/SKILL.md#L70

Expected: 80; Actual: 97
2. **Codebase impact** — Grep/Glob structural, plus the `Explore` subagent for broad sweeps.
3. **External** — context7 + Brave (only if libraries/APIs/platform features are involved).

Expand All @@ -77,16 +77,15 @@

Run these in parallel. **Record every query string used** — they go into the issue's Discovery block at Step 6 as Context Pointers so future sessions can re-hydrate deterministically.

### mem0 search
> mem0's live tool prefix is connection-specific (`mcp__<connector-id>__*`), not the fixed
> `mcp__mem0__`. `search_memories` and `add_memory` below name capabilities; resolve the live
> tool from your catalog before calling it.
### SessionFlow memory search
```
search_memories
mcp__sessionflow__search_memories
query: "{issue title} {key terms from description}"
limit: 10
filters: {AND: [{user_id: "lbruton"}, {metadata: {project: "<mem0.project from project.json, else lowercase tag>"}}]}
project: "<memory.project from project.json, else lowercase tag>"
n: 10
format: "json"
```
Pass `project: "*"` as a second query when the topic spans projects.

### Vault search
Search both the project vault and the shared vault. Grep for the key terms and their synonyms, then
Expand All @@ -107,7 +106,7 @@

Present any relevant past decisions, related work, or prior discussions.

**Track for Step 6:** the exact query strings and patterns used (mem0, sessionflow, vault Grep) and any Research Brief / KB / Foundation page hits — these become the Context Pointers list.
**Track for Step 6:** the exact query strings and patterns used (memory, transcripts, vault Grep) and any Research Brief / KB / Foundation page hits — these become the Context Pointers list.

Check notice on line 109 in .agents/skills/discover/SKILL.md

View check run for this annotation

Codacy Production / Codacy Static Code Analysis

.agents/skills/discover/SKILL.md#L109

Expected: 80; Actual: 190

---

Expand Down Expand Up @@ -245,8 +244,8 @@
- [Non-blocking question] — carry forward to spec

### Context Pointers
- **mem0:** `search: "<exact query used in Step 1>"` — [what it surfaces]
- **mem0:** `search: "<another query>"` — [what it surfaces]
- **Memory:** `mcp__sessionflow__search_memories` query `"<exact query used in Step 1>"` — [what it surfaces]

Check notice on line 247 in .agents/skills/discover/SKILL.md

View check run for this annotation

Codacy Production / Codacy Static Code Analysis

.agents/skills/discover/SKILL.md#L247

Expected: 80; Actual: 109
- **Memory:** `mcp__sessionflow__search_memories` query `"<another query>"` — [what it surfaces]

Check notice on line 248 in .agents/skills/discover/SKILL.md

View check run for this annotation

Codacy Production / Codacy Static Code Analysis

.agents/skills/discover/SKILL.md#L248

Expected: 80; Actual: 96
- **Research Brief:** [[Research/{topic}]] (if one exists or was created)
- **KB:** [[KnowledgeBase/{page}]] — [why relevant]
- **Foundation:** [[Foundation/{doc}]] — [why relevant]
Expand Down Expand Up @@ -288,20 +287,19 @@

## Step 7: Hand Off

### Save discovery summary to mem0 (semantic retrieval)
### Save discovery summary to SessionFlow memory (semantic retrieval)

The issue is now authoritative — mem0 is the semantic-retrieval mirror. Keep the memory **short** since the full detail lives in the issue.
The issue is now authoritative — the memory is its searchable mirror. Keep it **short** since the full detail lives in the issue. The topic key makes a re-run of `/discover` replace the earlier decision instead of adding a second one.

```
add_memory(
mcp__sessionflow__add_memory(
text: "Discovery complete for {ISSUE-ID} — {one-sentence recommended approach}. Full brief in Plane issue. Scope: {size}.",
user_id: "lbruton",
agent_id: "codex",
metadata: {
"type": "decision",
project: "<memory.project from project.json, else lowercase tag>",
type: "decision",
topic_key: "discover:{ISSUE-ID}",
extra: {
"source": "discover",
"project": "<mem0.project from project.json, else lowercase tag>",
"issue": "{ISSUE-ID}",
"issue_url": "https://plane.lbruton.cc/lbruton/browse/{ISSUE-ID}/",
"issue_uuid": "{plane issue uuid}",
"category": "architecture"
Expand Down
2 changes: 1 addition & 1 deletion .agents/skills/issue/SKILL.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ description: >
Triggers on: "create issue", "issue", "new issue", "new bug", "file a bug",
"track this".
user-invocable: false
library-version: 6b4e75d9e513
library-version: ce6718eb297b
---

# Issue Management
Expand Down
2 changes: 1 addition & 1 deletion .agents/skills/pr-cleanup/SKILL.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ description: >
local branches and their worktrees, pulls main fast-forward, and reports the result.
Run after a PR is merged, before /wrap.
Triggers: "pr-cleanup", "clean up branches", "prune worktrees", "clean after merge".
library-version: 6b4e75d9e513
library-version: ce6718eb297b
---

# PR Cleanup
Expand Down
2 changes: 1 addition & 1 deletion .agents/skills/pr-resolve/SKILL.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
name: pr-resolve
description: PR resolve — work through open PR review threads and Codacy issues to get a PR approved and merged.
library-version: 6b4e75d9e513
library-version: ce6718eb297b
---

# PR Resolve
Expand Down
2 changes: 1 addition & 1 deletion .agents/skills/receiving-code-review/SKILL.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
name: receiving-code-review
description: Receiving code review feedback — verify before implementing, never blindly agree.
library-version: 6b4e75d9e513
library-version: ce6718eb297b
---

# Code Review Reception
Expand Down
2 changes: 1 addition & 1 deletion .agents/skills/release/SKILL.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
name: release
description: Release workflow — version lock, worktree, bump, commit, PR, GitHub Release. Delegates to project overrides.
library-version: 6b4e75d9e513
library-version: ce6718eb297b
---

# Release — Universal Version Lock Workflow
Expand Down
2 changes: 1 addition & 1 deletion .agents/skills/requesting-code-review/SKILL.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
name: requesting-code-review
description: Use when completing tasks, implementing major features, or before merging to verify work meets requirements
library-version: 6b4e75d9e513
library-version: ce6718eb297b
---

# Requesting Code Review
Expand Down
2 changes: 1 addition & 1 deletion .agents/skills/setup-foundation-context/SKILL.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ description: >-
copies. Dry-run by default. Run once per project in a fresh session. Operationalizes
DEVS-37. Triggers: "/setup-foundation-context", "setup foundation context", "migrate
foundation docs to .context", "onboard foundation docs", "context foundation setup".
library-version: 6b4e75d9e513
library-version: ce6718eb297b
---

# Setup Foundation Context
Expand Down
2 changes: 1 addition & 1 deletion .agents/skills/spec-approach/SKILL.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
name: spec-approach
description: "Spec Phase 3 — architecture, key decisions, file map (+ UI Contract) into approach.md. Standalone, ISSUE-first. Reads universal + per-project conventions."
user-invocable: true
library-version: 6b4e75d9e513
library-version: ce6718eb297b
---

# /spec-approach ISSUE
Expand Down
6 changes: 3 additions & 3 deletions .agents/skills/spec-discovery/SKILL.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
name: spec-discovery
description: "Spec Phase 2 — research the codebase + prior art into discovery.md. Standalone, ISSUE-first. Uses a read-only Workflow fan-out for the research sweep."
user-invocable: true
library-version: 6b4e75d9e513
library-version: ce6718eb297b
---

# /spec-discovery ISSUE
Expand All @@ -28,13 +28,13 @@
3. **Research sweep — four read-only angles.**
Default to inline research. If the user explicitly asks for parallel agents, use read-only `explorer` subagents for independent angles. Subagents never edit files.
- **Structural** — Grep/Glob for affected modules, callers, dependencies. Grep each candidate identifier repo-wide and read the hits; that is the exhaustive path to a call list.
- **Prior decisions** — mem0 (and sessionflow if useful) for past choices on this area. Record exact query strings.
- **Prior decisions** — SessionFlow memory (`mcp__sessionflow__search_memories` with the project; transcripts too if useful) for past choices on this area. Record exact query strings.
- **External** — context7 / Brave for libraries, RFCs, platform docs — only if the work involves them.

Synthesize the returned findings yourself; do not let an agent write `discovery.md`. For a narrow spec where one or two angles obviously suffice, skip the Workflow and run those searches inline — match the fan-out to the surface area.
4. **Draft `discovery.md`** per the template:
- Existing code/files relevant to the work (with `path:line`).
- Prior decisions (mem0/sessionflow) — cite the query strings used.
- Prior decisions (SessionFlow memory and transcripts) — cite the query strings used.

Check notice on line 37 in .agents/skills/spec-discovery/SKILL.md

View check run for this annotation

Codacy Production / Codacy Static Code Analysis

.agents/skills/spec-discovery/SKILL.md#L37

Expected: 80; Actual: 88
- External references (libraries, RFCs, docs) with links.
- **Open questions** that block `approach.md`.
5. **Save `discovery.md`.** Touch no other file.
Expand Down
2 changes: 1 addition & 1 deletion .agents/skills/spec-reconcile/SKILL.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
name: spec-reconcile
description: "Spec process step — classify /spec-review marks for one phase, apply them with human approval, archive the originals. ISSUE PHASE first."
user-invocable: true
library-version: 6b4e75d9e513
library-version: ce6718eb297b
---

# /spec-reconcile ISSUE PHASE
Expand Down
2 changes: 1 addition & 1 deletion .agents/skills/spec-requirements/SKILL.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
name: spec-requirements
description: "Spec Phase 1 — grill the issue, then draft requirements.md in EARS. Standalone, ISSUE-first. Reads universal conventions + per-project overrides."
user-invocable: true
library-version: 6b4e75d9e513
library-version: ce6718eb297b
---

# /spec-requirements ISSUE
Expand Down
2 changes: 1 addition & 1 deletion .agents/skills/spec-review/SKILL.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
name: spec-review
description: "Reviewer-side /spec peer review. Reviews one phase of an active spec against the codebase."
library-version: 6b4e75d9e513
library-version: ce6718eb297b
---

# /spec-review
Expand Down
Loading
Loading