Skip to content

Commit 4566066

Browse files
authored
feat: add project context recovery skill for v0.0.50 (#197)
* feat: add cross-session search skill * feat: add executable cross-session search skill * fix: tighten cross-session search matching * feat: build project context recovery briefs * fix: address context recovery review findings * docs: clarify context recovery skill usage * chore: bump version to 0.0.50
1 parent 034e62b commit 4566066

6 files changed

Lines changed: 746 additions & 3 deletions

File tree

package-lock.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "codexmate",
3-
"version": "0.0.49",
3+
"version": "0.0.50",
44
"description": "Codex/Claude Code/OpenClaw 配置、会话与任务编排 CLI + Web 工具",
55
"main": "cli.js",
66
"bin": {
@@ -10,6 +10,7 @@
1010
"cli.js",
1111
"cli/",
1212
"plugins/",
13+
"skills/",
1314
"web-ui.html",
1415
"lib/",
1516
"web-ui/",
Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
---
2+
name: codexmate-project-context-recovery
3+
description: Recovers project handoff context from local Codex, Claude Code, Gemini, CodeBuddy, and codexmate-derived sessions. Use when the user asks what happened in prior project/PR/branch/file/error work, needs a handoff brief, wants old decisions or validations recovered, or asks to summarize cross-session project activity with evidence.
4+
---
5+
6+
# Codexmate Project Context Recovery
7+
8+
## Overview
9+
10+
Use this skill to build an evidence-first project handoff brief from local agent sessions. It is not semantic memory or a live GitHub source of truth. It works best with hard identifiers: `owner/repo`, branch names, file paths, commit hashes, exact errors, PR/issue numbers plus repo filters, or unique commands.
11+
12+
Old sessions are historical evidence. Mutable facts such as PR state, CI, releases, deployments, and current files still require live checks before action.
13+
14+
## Quick Start
15+
16+
Generate a context brief first. Resolve `scripts/search_sessions.py` relative to this skill directory; after npm installation the full package path is `node_modules/codexmate/skills/codexmate-project-context-recovery/scripts/search_sessions.py`.
17+
18+
```bash
19+
python3 scripts/search_sessions.py "SakuraByteCore/codexmate feat/task-orchestration-tab" --mode brief --source all --path-filter codexmate --match all --format text --limit 8
20+
```
21+
22+
Use plain search when you need raw candidates:
23+
24+
```bash
25+
python3 scripts/search_sessions.py "exact error text" --mode search --source all --path-filter codexmate --format text --limit 10
26+
```
27+
28+
## Workflow
29+
30+
1. **Confirm the object**: repo/project, PR/issue number, branch, file path, command, exact error text, person, or date range. If multiple projects match, state the chosen object before searching.
31+
2. **Prefer hard identifiers**: exact `owner/repo`, short repo name, PR/issue number with repo filter, branch, file path, commit hash, exact error, then user wording.
32+
3. **Generate a brief**: use `--mode brief`; add `--path-filter` for project/worktree isolation; use `--match all` when the query has strong identifiers.
33+
4. **Check confidence**: `high` means multiple hard signals appeared; `medium/weak` means re-query with stronger identifiers before relying on it; `none` means no hits were found.
34+
5. **Use the brief as a handoff**: extract timeline, decisions, validations, risks, files, commands, commits, and top evidence sessions.
35+
6. **Live-check mutable facts**: before commenting, merging, releasing, or claiming current status, check GitHub/current files directly.
36+
37+
## What Good Output Looks Like
38+
39+
- **Target Object:** repo / PR / branch / file / error
40+
- **Context Brief:** confidence, top sources, timeline, repos/branches/PRs/files
41+
- **Historical Evidence:** session source/id/path + snippets
42+
- **Handoff Summary:** decisions, validations, risks, commands, commits
43+
- **Live Verification:** PR/check/review/release/current-file facts that still need live verification
44+
45+
## Optional codexmate MCP Path
46+
47+
If codexmate MCP is configured and healthy, use it to inspect strong candidates:
48+
49+
- `codexmate.session.list` with `source`, `query`, `queryScope: "all"`, `limit`, and `forceRefresh: true`.
50+
- `codexmate.session.detail` for candidate session inspection.
51+
- `codexmate.session.export` only when a markdown export is useful.
52+
53+
If MCP is unavailable, do not block; run `scripts/search_sessions.py`.
54+
55+
## Limits
56+
57+
- Generic natural-language queries can be noisy.
58+
- Short PR numbers without repo/path filters are weak signals.
59+
- Session logs may contain stale, failed, or speculative work.
60+
- The brief should guide investigation; it must not replace current repo/GitHub verification.
61+
62+
## Privacy
63+
64+
Share only context relevant to the current task. Do not quote credentials, unrelated personal details, private memory, or large transcript chunks. In group chats, summarize narrowly and avoid exposing unrelated sessions.

0 commit comments

Comments
 (0)