context-mode 1.0.53 → 1.0.56
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.claude-plugin/marketplace.json +2 -2
- package/.claude-plugin/plugin.json +1 -1
- package/.openclaw-plugin/openclaw.plugin.json +1 -1
- package/.openclaw-plugin/package.json +1 -1
- package/README.md +103 -32
- package/build/adapters/antigravity/index.d.ts +1 -3
- package/build/adapters/antigravity/index.js +0 -30
- package/build/adapters/claude-code/hooks.d.ts +18 -0
- package/build/adapters/claude-code/hooks.js +23 -0
- package/build/adapters/claude-code/index.d.ts +1 -3
- package/build/adapters/claude-code/index.js +48 -35
- package/build/adapters/client-map.js +1 -0
- package/build/adapters/codex/index.d.ts +1 -3
- package/build/adapters/codex/index.js +1 -31
- package/build/adapters/cursor/index.d.ts +1 -3
- package/build/adapters/cursor/index.js +0 -11
- package/build/adapters/detect.d.ts +1 -0
- package/build/adapters/detect.js +18 -2
- package/build/adapters/gemini-cli/index.d.ts +1 -3
- package/build/adapters/gemini-cli/index.js +0 -30
- package/build/adapters/kiro/index.d.ts +1 -3
- package/build/adapters/kiro/index.js +0 -30
- package/build/adapters/openclaw/index.d.ts +1 -3
- package/build/adapters/openclaw/index.js +0 -38
- package/build/adapters/opencode/index.d.ts +5 -4
- package/build/adapters/opencode/index.js +37 -41
- package/build/adapters/types.d.ts +1 -14
- package/build/adapters/vscode-copilot/index.d.ts +1 -3
- package/build/adapters/vscode-copilot/index.js +0 -32
- package/build/adapters/zed/index.d.ts +1 -3
- package/build/adapters/zed/index.js +0 -30
- package/build/cli.js +12 -28
- package/build/executor.d.ts +0 -1
- package/build/executor.js +28 -16
- package/build/openclaw-plugin.js +12 -34
- package/build/opencode-plugin.d.ts +1 -0
- package/build/opencode-plugin.js +5 -9
- package/build/runtime.js +29 -11
- package/build/server.d.ts +2 -0
- package/build/server.js +69 -61
- package/build/store.d.ts +4 -3
- package/build/store.js +101 -34
- package/build/truncate.d.ts +4 -17
- package/build/truncate.js +4 -52
- package/cli.bundle.mjs +184 -157
- package/configs/codex/AGENTS.md +19 -0
- package/configs/kilo/AGENTS.md +58 -0
- package/configs/kilo/kilo.json +10 -0
- package/hooks/core/tool-naming.mjs +1 -0
- package/hooks/ensure-deps.mjs +80 -2
- package/hooks/pretooluse.mjs +25 -20
- package/hooks/routing-block.mjs +10 -1
- package/hooks/session-snapshot.bundle.mjs +13 -13
- package/hooks/sessionstart.mjs +25 -1
- package/openclaw.plugin.json +1 -1
- package/package.json +1 -1
- package/server.bundle.mjs +159 -129
- package/skills/context-mode-ops/SKILL.md +111 -0
- package/skills/context-mode-ops/agent-teams.md +198 -0
- package/skills/context-mode-ops/communication.md +224 -0
- package/skills/context-mode-ops/release.md +199 -0
- package/skills/context-mode-ops/review-pr.md +269 -0
- package/skills/context-mode-ops/tdd.md +329 -0
- package/skills/context-mode-ops/triage-issue.md +218 -0
- package/skills/context-mode-ops/validation.md +238 -0
- package/start.mjs +5 -52
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: context-mode-ops
|
|
3
|
+
description: Manage context-mode GitHub issues, PRs, and releases with parallel subagent army. Orchestrates 10-20 dynamic agents (Architects, Staff Engineers, QA) per task. Use when triaging issues, reviewing PRs, releasing versions, fixing bugs, merging contributions, validating ENV vars, testing adapters, or syncing branches.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Context Mode Ops
|
|
7
|
+
|
|
8
|
+
Parallel subagent army for issue triage, PR review, and releases.
|
|
9
|
+
|
|
10
|
+
## TDD-First: BLOCKING GATE
|
|
11
|
+
|
|
12
|
+
<tdd_enforcement>
|
|
13
|
+
STOP. Before writing ANY implementation code, you MUST have a failing test.
|
|
14
|
+
No exceptions. No "I'll add tests later." No "this change is too small for tests."
|
|
15
|
+
This codebase has 12 adapters, 3 OS, hooks, FTS5, sessions — it is FRAGILE.
|
|
16
|
+
One untested change breaks everything. TDD is not optional, it is the gate.
|
|
17
|
+
</tdd_enforcement>
|
|
18
|
+
|
|
19
|
+
**Read [tdd.md](tdd.md) FIRST. It is the law.** Summary:
|
|
20
|
+
|
|
21
|
+
1. **STOP** if you haven't written a failing test. You cannot write implementation code.
|
|
22
|
+
2. **Vertical slices ONLY**: ONE test → ONE implementation → repeat. NEVER all tests first.
|
|
23
|
+
3. **Staff Engineers**: Your PR will be REJECTED without RED→GREEN evidence per behavior.
|
|
24
|
+
4. **Architects**: REJECT any change without tests. No exceptions, no "trivial change" excuse.
|
|
25
|
+
5. **QA Engineer**: Run full suite after EVERY change. Report failures immediately.
|
|
26
|
+
|
|
27
|
+
## You Are the Engineering Manager
|
|
28
|
+
|
|
29
|
+
<delegation_enforcement>
|
|
30
|
+
You are the EM — you ORCHESTRATE, you do NOT code. You MUST delegate ALL work to subagents.
|
|
31
|
+
You are FORBIDDEN from: reading source code, writing fixes, running tests, or analyzing diffs yourself.
|
|
32
|
+
Your ONLY job: spawn agents, route results, make ship/no-ship decisions.
|
|
33
|
+
If the user sends multiple issues/PRs in sequence, spawn a SEPARATE agent army for EACH one.
|
|
34
|
+
Never fall back to doing the work yourself. If an agent fails, spawn another agent — not yourself.
|
|
35
|
+
</delegation_enforcement>
|
|
36
|
+
|
|
37
|
+
For every task:
|
|
38
|
+
|
|
39
|
+
1. **Analyze** — Read the issue/PR with `gh` (via agent), classify affected domains
|
|
40
|
+
2. **Recruit** — Spawn domain-specific agent teams from [agent-teams.md](agent-teams.md)
|
|
41
|
+
3. **Dispatch** — ALL agents in ONE parallel batch (10-20 agents minimum)
|
|
42
|
+
4. **Ping-pong** — Route Architect reviews ↔ Staff Engineer fixes
|
|
43
|
+
5. **Ship** — Push to `next`, comment, close
|
|
44
|
+
|
|
45
|
+
## Workflow Detection
|
|
46
|
+
|
|
47
|
+
| User says | Workflow | Reference |
|
|
48
|
+
|-----------|----------|-----------|
|
|
49
|
+
| "triage issue #N", "fix issue", "analyze issue" | Triage | [triage-issue.md](triage-issue.md) |
|
|
50
|
+
| "review PR #N", "merge PR", "check PR" | Review | [review-pr.md](review-pr.md) |
|
|
51
|
+
| "release", "version bump", "publish" | Release | [release.md](release.md) |
|
|
52
|
+
|
|
53
|
+
## GitHub CLI (`gh`) Is Mandatory
|
|
54
|
+
|
|
55
|
+
<gh_enforcement>
|
|
56
|
+
ALL GitHub operations MUST use the `gh` CLI. Never use raw git commands for GitHub interactions.
|
|
57
|
+
Never use curl/wget to GitHub API. `gh` handles auth, pagination, and rate limits correctly.
|
|
58
|
+
</gh_enforcement>
|
|
59
|
+
|
|
60
|
+
- `gh issue view`, `gh issue comment`, `gh issue close` — for issues
|
|
61
|
+
- `gh pr view`, `gh pr diff`, `gh pr merge --squash`, `gh pr edit --base next` — for PRs
|
|
62
|
+
- `gh release create` — for releases
|
|
63
|
+
|
|
64
|
+
## Agent Spawning Protocol
|
|
65
|
+
|
|
66
|
+
1. Read issue/PR body + comments + diff via `gh` (through agent)
|
|
67
|
+
2. Identify affected: adapters, OS, core modules
|
|
68
|
+
3. Build agent roster from [agent-teams.md](agent-teams.md) — context-driven, not static
|
|
69
|
+
4. Spawn ALL agents in ONE message with multiple `Agent` tool calls
|
|
70
|
+
5. Every code-changing agent gets `isolation: "worktree"`
|
|
71
|
+
6. Use context-mode MCP tools inside agents for large output
|
|
72
|
+
|
|
73
|
+
## Validation (Every Workflow)
|
|
74
|
+
|
|
75
|
+
Before shipping ANY change, validate per [validation.md](validation.md):
|
|
76
|
+
- [ ] ENV vars verified against real platform source (not LLM hallucinations)
|
|
77
|
+
- [ ] All 12 adapter tests pass: `npx vitest run tests/adapters/`
|
|
78
|
+
- [ ] TypeScript compiles: `npm run typecheck`
|
|
79
|
+
- [ ] Full test suite: `npm test`
|
|
80
|
+
- [ ] Cross-OS path handling checked
|
|
81
|
+
|
|
82
|
+
## Docs Must Stay Current
|
|
83
|
+
|
|
84
|
+
After ANY code change that affects adapters, features, or platform support:
|
|
85
|
+
- [ ] Update `docs/platform-support.md` if adapter capabilities changed
|
|
86
|
+
- [ ] Update `README.md` if install instructions, features, or platform list changed
|
|
87
|
+
- [ ] These updates are NOT optional — ship docs with code, not after
|
|
88
|
+
|
|
89
|
+
## Communication (Every Workflow)
|
|
90
|
+
|
|
91
|
+
Follow [communication.md](communication.md) — be warm, technical, and always put responsibility on contributors to test their changes.
|
|
92
|
+
|
|
93
|
+
## Cross-Cutting References
|
|
94
|
+
|
|
95
|
+
- [TDD Methodology](tdd.md) — Red-Green-Refactor, mandatory for all code changes
|
|
96
|
+
- [Dynamic Agent Organization](agent-teams.md)
|
|
97
|
+
- [Validation Patterns](validation.md)
|
|
98
|
+
- [Communication Templates](communication.md)
|
|
99
|
+
|
|
100
|
+
## Installation
|
|
101
|
+
|
|
102
|
+
```shell
|
|
103
|
+
# Install via skills CLI
|
|
104
|
+
npx skills add mksglu/context-mode --skill context-mode-ops
|
|
105
|
+
|
|
106
|
+
# Or install all context-mode skills
|
|
107
|
+
npx skills add mksglu/context-mode
|
|
108
|
+
|
|
109
|
+
# Or direct path
|
|
110
|
+
npx skills add https://github.com/mksglu/context-mode/tree/main/skills/context-mode-ops
|
|
111
|
+
```
|
|
@@ -0,0 +1,198 @@
|
|
|
1
|
+
# Dynamic Agent Organization
|
|
2
|
+
|
|
3
|
+
## Principle: Context-Driven Teams
|
|
4
|
+
|
|
5
|
+
Every issue and PR gets a **custom** team. Agents are spawned based on what the task touches — never a static roster. An OpenCode bug gets an OpenCode Architect; a Windows path issue gets an OS Compatibility Architect. A single task may spawn 10-20 agents.
|
|
6
|
+
|
|
7
|
+
## Engineering Manager Protocol
|
|
8
|
+
|
|
9
|
+
You (the main conversation) are the EM. You **ORCHESTRATE ONLY** — you NEVER do the work yourself.
|
|
10
|
+
|
|
11
|
+
<em_rules>
|
|
12
|
+
FORBIDDEN: Reading source code, writing fixes, running tests, analyzing diffs, investigating bugs.
|
|
13
|
+
REQUIRED: Spawning agents, routing results between agents, making ship/no-ship decisions.
|
|
14
|
+
If user sends multiple issues/PRs: spawn a SEPARATE agent army for EACH. Never queue them.
|
|
15
|
+
If an agent fails: spawn a replacement agent. NEVER fall back to doing it yourself.
|
|
16
|
+
</em_rules>
|
|
17
|
+
|
|
18
|
+
Your loop:
|
|
19
|
+
|
|
20
|
+
```
|
|
21
|
+
1. CLASSIFY → Read issue/PR via agent, identify affected domains
|
|
22
|
+
2. RECRUIT → Build agent roster from tables below
|
|
23
|
+
3. DISPATCH → Spawn ALL agents in ONE message (parallel)
|
|
24
|
+
4. MONITOR → Read agent results as they complete
|
|
25
|
+
5. PING-PONG → Route architect feedback to staff engineers
|
|
26
|
+
6. VALIDATE → All architects must APPROVE before shipping
|
|
27
|
+
7. SHIP → Merge, comment, close
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
**Critical**: Never spawn agents one at a time. Always ONE message, multiple `Agent` tool calls.
|
|
31
|
+
|
|
32
|
+
## Agent Roster
|
|
33
|
+
|
|
34
|
+
### Core Agents (Always Spawned)
|
|
35
|
+
|
|
36
|
+
| Agent | Role | When |
|
|
37
|
+
|-------|------|------|
|
|
38
|
+
| **Context Mode Architect** | Reviews ALL changes against core architecture. Validates FTS5, MCP protocol, session continuity. Final approval gate. | Always |
|
|
39
|
+
| **QA Engineer** | Runs full test suite, validates across all 12 adapters, checks typecheck. Reports pass/fail matrix. | Always |
|
|
40
|
+
| **DX Engineer** | Reviews user-facing output quality. Checks error messages, help text, diagnostic output. | Always |
|
|
41
|
+
|
|
42
|
+
### Platform Agents (Spawned When Platform Is Affected)
|
|
43
|
+
|
|
44
|
+
Spawn the **pair** (Architect + Staff Engineer) for each affected platform:
|
|
45
|
+
|
|
46
|
+
| Platform | Architect Prompt | Staff Engineer Prompt |
|
|
47
|
+
|----------|-----------------|----------------------|
|
|
48
|
+
| **Claude Code** | "You are the Claude Code Architect. Review changes to `src/adapters/claude-code/`, hooks, plugin.json, marketplace.json. Validate CLAUDE_PROJECT_DIR and CLAUDE_SESSION_ID env handling." | "You are the Claude Code Staff Engineer. Implement fixes in the claude-code adapter. Run `npx vitest run tests/adapters/claude-code.test.ts`." |
|
|
49
|
+
| **Gemini CLI** | "You are the Gemini CLI Architect. Review `src/adapters/gemini-cli/`, BeforeTool/AfterTool hook format, settings.json schema. Validate GEMINI_PROJECT_DIR and GEMINI_CLI env handling." | "You are the Gemini CLI Staff Engineer. Implement fixes in the gemini-cli adapter. Run `npx vitest run tests/adapters/gemini-cli.test.ts`." |
|
|
50
|
+
| **OpenCode** | "You are the OpenCode Architect. Review `src/adapters/opencode/`, AGENTS.md injection, config paths. Validate OPENCODE and OPENCODE_PID env handling." | "You are the OpenCode Staff Engineer. Implement fixes in the opencode adapter. Run `npx vitest run tests/adapters/opencode.test.ts`." |
|
|
51
|
+
| **OpenClaw** | "You are the OpenClaw Architect. Review `src/adapters/openclaw/`, openclaw.plugin.json, thinking block handling. Validate OPENCLAW_HOME and OPENCLAW_CLI env handling." | "You are the OpenClaw Staff Engineer. Implement fixes in the openclaw adapter. Run `npx vitest run tests/adapters/openclaw.test.ts` and `tests/plugins/openclaw.test.ts`." |
|
|
52
|
+
| **Kilo** | "You are the Kilo Architect. Review `src/adapters/kilo/`, config at `~/.config/kilo/`. Validate KILO and KILO_PID env handling." | "You are the Kilo Staff Engineer. Implement fixes in the kilo adapter. Run `npx vitest run tests/adapters/kilo.test.ts`." |
|
|
53
|
+
| **Codex** | "You are the Codex Architect. Review `src/adapters/codex/`. Validate CODEX_CI and CODEX_THREAD_ID env handling." | "You are the Codex Staff Engineer. Implement fixes in the codex adapter. Run `npx vitest run tests/adapters/codex.test.ts`." |
|
|
54
|
+
| **VS Code Copilot** | "You are the VS Code Copilot Architect. Review `src/adapters/vscode-copilot/`, `.vscode/mcp.json` format, `.github/hooks/` structure. Validate VSCODE_PID and VSCODE_CWD env handling." | "You are the VS Code Copilot Staff Engineer. Implement fixes. Run `npx vitest run tests/adapters/vscode-copilot.test.ts`." |
|
|
55
|
+
| **Cursor** | "You are the Cursor Architect. Review `src/adapters/cursor/`, `.cursor/mcp.json` format. Validate CURSOR_TRACE_ID and CURSOR_CLI env handling." | "You are the Cursor Staff Engineer. Implement fixes. Run `npx vitest run tests/adapters/cursor.test.ts`." |
|
|
56
|
+
| **Antigravity** | "You are the Antigravity Architect. Review `src/adapters/antigravity/`." | "You are the Antigravity Staff Engineer. Implement fixes. Run `npx vitest run tests/adapters/antigravity.test.ts`." |
|
|
57
|
+
| **Kiro** | "You are the Kiro Architect. Review `src/adapters/kiro/`, `~/.kiro/` config." | "You are the Kiro Staff Engineer. Implement fixes. Run `npx vitest run tests/adapters/kiro.test.ts`." |
|
|
58
|
+
| **Pi** | "You are the Pi Architect. Review `src/adapters/pi/`, `.pi/extensions/` structure." | "You are the Pi Staff Engineer. Implement fixes. Run `npx vitest run tests/adapters/pi.test.ts`." |
|
|
59
|
+
| **Zed** | "You are the Zed Architect. Review `src/adapters/zed/`, `~/.config/zed/` settings." | "You are the Zed Staff Engineer. Implement fixes. Run `npx vitest run tests/adapters/zed.test.ts`." |
|
|
60
|
+
|
|
61
|
+
### Domain Agents (Spawned When Domain Is Affected)
|
|
62
|
+
|
|
63
|
+
| Trigger Keywords | Agent | Focus |
|
|
64
|
+
|-----------------|-------|-------|
|
|
65
|
+
| FTS5, SQLite, better-sqlite3, `.db`, native binding | **Database Architect** | FTS5 schema, WAL mode, native bindings across OS, `better-sqlite3` build |
|
|
66
|
+
| Security, bypass, injection, file-writing, sandbox escape | **Security Engineer** | Sandbox boundaries, file write restrictions, path traversal, command injection |
|
|
67
|
+
| Windows, path separator, `\\`, WSL, Git Bash, `process.platform` | **OS Compatibility Architect** | Cross-platform paths, temp dirs, native bindings per OS |
|
|
68
|
+
| macOS + specific issue | **macOS Staff Engineer** | Homebrew paths, `.dylib` bindings, Gatekeeper |
|
|
69
|
+
| Linux + specific issue | **Linux Staff Engineer** | Snap/PATH limitations, `.so` bindings, CI envs |
|
|
70
|
+
| Windows + specific issue | **Windows Staff Engineer** | Path separators, native bindings, PowerShell vs Git Bash |
|
|
71
|
+
| Hook, PreToolUse, PostToolUse, SessionStart, PreCompact | **Hooks Architect** | Hook lifecycle, matcher patterns, stdin/stdout protocol |
|
|
72
|
+
| Session, compaction, resume, snapshot, continuity | **Session Architect** | SessionDB schema, event extraction, resume flow, PreCompact |
|
|
73
|
+
| Executor, sandbox, polyglot, truncation, timeout | **Executor Architect** | Language runtimes, smart truncation, FTS5 indexing pipeline |
|
|
74
|
+
| Fetch, turndown, HTML, markdown conversion, web | **Web/Fetch Architect** | fetch_and_index, HTML→markdown, chunking, URL handling |
|
|
75
|
+
| Performance, benchmark, tokens, context savings | **Performance Engineer** | Token counting, context savings ratio, benchmark comparisons |
|
|
76
|
+
| Version, release, publish, npm, manifest | **Release Engineer** | version-sync, manifest files, npm publish, GitHub releases |
|
|
77
|
+
|
|
78
|
+
## Ping-Pong Protocol
|
|
79
|
+
|
|
80
|
+
```
|
|
81
|
+
┌─────────────────┐ ┌──────────────────┐
|
|
82
|
+
│ Staff Engineer │─────▶│ Architect │
|
|
83
|
+
│ writes code │ │ reviews │
|
|
84
|
+
└─────────────────┘ └──────────────────┘
|
|
85
|
+
▲ │
|
|
86
|
+
│ CHANGES_NEEDED │
|
|
87
|
+
└─────────────────────────┘
|
|
88
|
+
|
|
89
|
+
│ APPROVED │
|
|
90
|
+
└─────────▶ EM validates ─▶ Ship
|
|
91
|
+
```
|
|
92
|
+
|
|
93
|
+
**Rules:**
|
|
94
|
+
1. Architects **NEVER** write code — they review and return verdicts
|
|
95
|
+
2. Staff Engineers **NEVER** merge — they implement and hand off to EM
|
|
96
|
+
3. EM decides when to ship based on ALL architect approvals
|
|
97
|
+
4. If any architect says CHANGES_NEEDED, route back to the paired Staff Engineer
|
|
98
|
+
5. Maximum 2 ping-pong rounds — after that, EM decides
|
|
99
|
+
|
|
100
|
+
## Agent Spawn Template
|
|
101
|
+
|
|
102
|
+
When creating agents, use this structure in the Agent tool prompt:
|
|
103
|
+
|
|
104
|
+
```
|
|
105
|
+
You are the {Platform/Domain} {Role} for context-mode.
|
|
106
|
+
|
|
107
|
+
## Context
|
|
108
|
+
- Issue/PR: #{number} — {title}
|
|
109
|
+
- Description: {summary}
|
|
110
|
+
- Affected files: {file list}
|
|
111
|
+
- Related adapter: src/adapters/{platform}/
|
|
112
|
+
- Related tests: tests/adapters/{platform}.test.ts
|
|
113
|
+
|
|
114
|
+
## Your Mission
|
|
115
|
+
{specific task — investigate/implement/review/test}
|
|
116
|
+
|
|
117
|
+
## TDD Protocol (MANDATORY for Staff Engineers)
|
|
118
|
+
Follow Red-Green-Refactor for EVERY behavior change:
|
|
119
|
+
1. RED: Write a failing test in tests/{dir}/{name}.test.ts
|
|
120
|
+
2. RUN: npx vitest run tests/{file} — verify it FAILS
|
|
121
|
+
3. GREEN: Write minimal code to make the test pass
|
|
122
|
+
4. RUN: npx vitest run tests/{file} — verify it PASSES
|
|
123
|
+
5. REFACTOR: Clean up, run tests again
|
|
124
|
+
6. REPEAT: Next behavior (vertical slices — one test, one impl, repeat)
|
|
125
|
+
|
|
126
|
+
NEVER write all tests first then all code (horizontal slicing).
|
|
127
|
+
Tests MUST verify behavior through public interfaces, NOT implementation details.
|
|
128
|
+
Do NOT mock internal modules — only mock system boundaries (external APIs, fs, network).
|
|
129
|
+
|
|
130
|
+
Report RED→GREEN evidence for each behavior:
|
|
131
|
+
"RED: test 'detects opencode via env var' — FAIL (expected)"
|
|
132
|
+
"GREEN: added env check in detect.ts — PASS"
|
|
133
|
+
|
|
134
|
+
## TDD Protocol (MANDATORY for Architects)
|
|
135
|
+
When reviewing code, REJECT any change that:
|
|
136
|
+
- Has no tests
|
|
137
|
+
- Tests implementation details instead of behavior
|
|
138
|
+
- Mocks internal collaborators
|
|
139
|
+
- Uses horizontal slicing (all tests first, then all code)
|
|
140
|
+
|
|
141
|
+
## Deliverables
|
|
142
|
+
Report back with ONE of:
|
|
143
|
+
- APPROVED: {brief reason, TDD compliance confirmed}
|
|
144
|
+
- CHANGES_NEEDED: {specific file:line changes required}
|
|
145
|
+
- FINDINGS: {investigation results}
|
|
146
|
+
|
|
147
|
+
## Tools Available
|
|
148
|
+
- Use context-mode MCP tools (ctx_execute, ctx_batch_execute) for large output
|
|
149
|
+
- Use Grep/Glob for targeted searches
|
|
150
|
+
- Use Read only for files you need to Edit
|
|
151
|
+
- Run tests with: npx vitest run {test file}
|
|
152
|
+
- Run typecheck with: npm run typecheck
|
|
153
|
+
```
|
|
154
|
+
|
|
155
|
+
## Parallelism Rules
|
|
156
|
+
|
|
157
|
+
1. **ONE message, ALL agents** — spawn every agent in a single response with multiple Agent tool calls
|
|
158
|
+
2. **Isolation** — every code-changing agent gets `isolation: "worktree"`
|
|
159
|
+
3. **Research agents** — use `subagent_type: "Explore"` for investigation-only tasks
|
|
160
|
+
4. **Minimum 5 agents** per task (Core + at least 2 domain/platform)
|
|
161
|
+
5. **Maximum 20 agents** — beyond that, context management overhead exceeds benefit
|
|
162
|
+
6. **Never sequential** — if you're waiting for Agent A before spawning Agent B, you're doing it wrong (exception: ping-pong within a pair)
|
|
163
|
+
|
|
164
|
+
## Classification Heuristic
|
|
165
|
+
|
|
166
|
+
To determine which agents to spawn, scan the issue/PR for:
|
|
167
|
+
|
|
168
|
+
```javascript
|
|
169
|
+
// Adapter detection
|
|
170
|
+
const adapterKeywords = {
|
|
171
|
+
"claude-code": ["claude", "claude code", "CLAUDE_", "plugin marketplace", ".claude/"],
|
|
172
|
+
"gemini-cli": ["gemini", "GEMINI_", ".gemini/", "BeforeTool", "AfterTool"],
|
|
173
|
+
"opencode": ["opencode", "OPENCODE", "AGENTS.md", ".config/opencode"],
|
|
174
|
+
"openclaw": ["openclaw", "OPENCLAW_", "thinking block", "redacted_thinking"],
|
|
175
|
+
"kilo": ["kilo", "KILO", "kilocode", ".config/kilo"],
|
|
176
|
+
"codex": ["codex", "CODEX_", "codex-cli", ".codex/"],
|
|
177
|
+
"vscode-copilot": ["vscode", "copilot", "VSCODE_", ".vscode/mcp.json"],
|
|
178
|
+
"cursor": ["cursor", "CURSOR_", ".cursor/"],
|
|
179
|
+
"antigravity": ["antigravity"],
|
|
180
|
+
"kiro": ["kiro", ".kiro/"],
|
|
181
|
+
"pi": ["pi adapter", ".pi/extensions"],
|
|
182
|
+
"zed": ["zed", ".config/zed"],
|
|
183
|
+
};
|
|
184
|
+
|
|
185
|
+
// Domain detection
|
|
186
|
+
const domainKeywords = {
|
|
187
|
+
database: ["sqlite", "fts5", "better-sqlite3", "native binding", ".db"],
|
|
188
|
+
security: ["bypass", "injection", "escape", "security", "file-writing"],
|
|
189
|
+
os: ["windows", "linux", "macos", "path separator", "process.platform", "tmpdir"],
|
|
190
|
+
hooks: ["pretooluse", "posttooluse", "sessionstart", "precompact", "hook"],
|
|
191
|
+
session: ["session", "compaction", "resume", "snapshot", "continuity"],
|
|
192
|
+
executor: ["executor", "sandbox", "truncat", "polyglot", "timeout"],
|
|
193
|
+
web: ["fetch", "turndown", "html", "markdown", "url"],
|
|
194
|
+
performance: ["benchmark", "performance", "token", "context saving"],
|
|
195
|
+
};
|
|
196
|
+
```
|
|
197
|
+
|
|
198
|
+
Use this as a mental model — scan the issue/PR text and spawn agents for every match.
|
|
@@ -0,0 +1,224 @@
|
|
|
1
|
+
# Communication Templates
|
|
2
|
+
|
|
3
|
+
Tone: warm, professional, technical, grateful. Always put testing responsibility on the contributor.
|
|
4
|
+
|
|
5
|
+
## Issue Comments
|
|
6
|
+
|
|
7
|
+
### After Fix (Standard)
|
|
8
|
+
|
|
9
|
+
```markdown
|
|
10
|
+
Hey @{author}! 👋
|
|
11
|
+
|
|
12
|
+
We investigated this and pushed a fix in #{PR_NUMBER}.
|
|
13
|
+
|
|
14
|
+
**Root cause:** {1-2 sentence technical explanation}
|
|
15
|
+
|
|
16
|
+
**Fix:** {1-2 sentence description of what changed}
|
|
17
|
+
|
|
18
|
+
**Affected area:** `{adapter/module path}`
|
|
19
|
+
|
|
20
|
+
This lands on the `next` branch and will ship in the next release. Once it's out, could you please test it in your setup and confirm it resolves the issue? 🙏
|
|
21
|
+
|
|
22
|
+
```
|
|
23
|
+
npm update -g context-mode
|
|
24
|
+
# or for plugin users:
|
|
25
|
+
/context-mode:ctx-upgrade
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
Thanks for reporting this — it helped improve context-mode for everyone!
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
### Needs More Information
|
|
32
|
+
|
|
33
|
+
```markdown
|
|
34
|
+
Hey @{author}, thanks for opening this!
|
|
35
|
+
|
|
36
|
+
To investigate further, could you share:
|
|
37
|
+
- Your platform (Claude Code / Gemini CLI / OpenCode / etc.)
|
|
38
|
+
- context-mode version (`ctx doctor` or `npm list -g context-mode`)
|
|
39
|
+
- The exact command or action that triggers this
|
|
40
|
+
- Any error messages or unexpected output
|
|
41
|
+
|
|
42
|
+
This will help us reproduce and fix the issue faster. 🙏
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
### Working As Intended
|
|
46
|
+
|
|
47
|
+
```markdown
|
|
48
|
+
Hey @{author}, thanks for raising this!
|
|
49
|
+
|
|
50
|
+
This is actually working as intended — here's why:
|
|
51
|
+
|
|
52
|
+
{Technical explanation of the design decision}
|
|
53
|
+
|
|
54
|
+
{If there's a workaround:}
|
|
55
|
+
That said, you can achieve what you're looking for by:
|
|
56
|
+
{workaround steps}
|
|
57
|
+
|
|
58
|
+
{If it's a reasonable feature request:}
|
|
59
|
+
I can see why this would be useful though. I'll re-label this as a feature request so we can discuss it with the community.
|
|
60
|
+
|
|
61
|
+
Let me know if you have any questions!
|
|
62
|
+
```
|
|
63
|
+
|
|
64
|
+
### Duplicate Issue
|
|
65
|
+
|
|
66
|
+
```markdown
|
|
67
|
+
Hey @{author}, thanks for reporting!
|
|
68
|
+
|
|
69
|
+
This is a duplicate of #{ORIGINAL_NUMBER} which tracks the same issue. I'm closing this one to keep discussion in one place — please follow #{ORIGINAL_NUMBER} for updates.
|
|
70
|
+
|
|
71
|
+
If your case is different from what's described there, please reopen and let us know what's different!
|
|
72
|
+
```
|
|
73
|
+
|
|
74
|
+
### LLM Hallucination (Feature/ENV Doesn't Exist)
|
|
75
|
+
|
|
76
|
+
```markdown
|
|
77
|
+
Hey @{author}, thanks for the detailed report!
|
|
78
|
+
|
|
79
|
+
After investigation, it looks like `{CLAIMED_FEATURE/ENV}` doesn't actually exist in {PLATFORM}. This is a common issue where AI assistants sometimes reference features or environment variables that don't exist in the actual platform.
|
|
80
|
+
|
|
81
|
+
Here's what we found:
|
|
82
|
+
- {What we checked}
|
|
83
|
+
- {Official docs reference showing it's not a real feature}
|
|
84
|
+
|
|
85
|
+
**What actually works:**
|
|
86
|
+
{The correct approach or existing alternative}
|
|
87
|
+
|
|
88
|
+
No worries at all — this kind of thing is surprisingly common! Let us know if you need help with the correct approach.
|
|
89
|
+
```
|
|
90
|
+
|
|
91
|
+
## PR Comments
|
|
92
|
+
|
|
93
|
+
### After Merge (Clean)
|
|
94
|
+
|
|
95
|
+
```markdown
|
|
96
|
+
Thanks for this contribution, @{author}! 🎉
|
|
97
|
+
|
|
98
|
+
Merged into `next` — this will ship in the next release.
|
|
99
|
+
|
|
100
|
+
Could you please test it in your setup once the release is out? You know this area best, so your verification would be really valuable. 🙏
|
|
101
|
+
|
|
102
|
+
Thanks for making context-mode better!
|
|
103
|
+
```
|
|
104
|
+
|
|
105
|
+
### After Merge (With Follow-Up Fixes)
|
|
106
|
+
|
|
107
|
+
```markdown
|
|
108
|
+
Thanks @{author}! Merged into `next`.
|
|
109
|
+
|
|
110
|
+
I made a few small adjustments on top in {commit_sha}:
|
|
111
|
+
- **{change 1}:** {reason — e.g., "aligned with existing pattern in other adapters"}
|
|
112
|
+
- **{change 2}:** {reason — e.g., "added missing test for edge case"}
|
|
113
|
+
|
|
114
|
+
Could you review those changes and test the complete flow in your environment? Since you're closest to this use case, your verification is important. 🙏
|
|
115
|
+
|
|
116
|
+
This will ship in the next release!
|
|
117
|
+
```
|
|
118
|
+
|
|
119
|
+
### After Merge (Significant Fixes Needed)
|
|
120
|
+
|
|
121
|
+
```markdown
|
|
122
|
+
Hey @{author}, thanks for putting this together! I've merged it into `next`.
|
|
123
|
+
|
|
124
|
+
I did need to make some adjustments though — the core idea is solid but a few things needed fixing:
|
|
125
|
+
|
|
126
|
+
**Changes I made:**
|
|
127
|
+
- {change 1}: {detailed reason}
|
|
128
|
+
- {change 2}: {detailed reason}
|
|
129
|
+
- {change 3}: {detailed reason}
|
|
130
|
+
|
|
131
|
+
These are in {commit_sha_1} and {commit_sha_2}.
|
|
132
|
+
|
|
133
|
+
**Important:** Could you please thoroughly test this in your environment? The responsibility for verifying this works end-to-end is yours since you're closest to the use case and these changes touch {what they touch}. 🙏
|
|
134
|
+
|
|
135
|
+
Let me know if anything doesn't work as expected!
|
|
136
|
+
```
|
|
137
|
+
|
|
138
|
+
### Closing Without Merge (Rare)
|
|
139
|
+
|
|
140
|
+
```markdown
|
|
141
|
+
Hey @{author}, thanks for taking the time to put this together — I appreciate the effort!
|
|
142
|
+
|
|
143
|
+
Unfortunately we can't merge this as-is:
|
|
144
|
+
- **{reason 1}:** {technical explanation}
|
|
145
|
+
- **{reason 2}:** {technical explanation}
|
|
146
|
+
|
|
147
|
+
{IF the work is salvageable:}
|
|
148
|
+
If you'd like to take another pass, here's what would make this mergeable:
|
|
149
|
+
1. {specific guidance}
|
|
150
|
+
2. {specific guidance}
|
|
151
|
+
|
|
152
|
+
Happy to help if you have questions!
|
|
153
|
+
|
|
154
|
+
{IF the direction is wrong:}
|
|
155
|
+
The direction we're going with {area} is {explanation}. This is to ensure {rationale}.
|
|
156
|
+
|
|
157
|
+
Thanks again for the contribution — hope to see more PRs from you! 🙌
|
|
158
|
+
```
|
|
159
|
+
|
|
160
|
+
### PR Has Hallucinated Features
|
|
161
|
+
|
|
162
|
+
```markdown
|
|
163
|
+
Hey @{author}, thanks for this PR!
|
|
164
|
+
|
|
165
|
+
While reviewing, I noticed that `{CLAIMED_FEATURE}` doesn't appear to exist in {PLATFORM}'s actual implementation:
|
|
166
|
+
|
|
167
|
+
- Searched {PLATFORM}'s source/docs — not found
|
|
168
|
+
- The ENV var `{VAR}` isn't documented or used by {PLATFORM}
|
|
169
|
+
|
|
170
|
+
This might be an AI assistant suggestion that doesn't match the real platform API. No worries — it's surprisingly common!
|
|
171
|
+
|
|
172
|
+
{IF core logic is still valid:}
|
|
173
|
+
The rest of the PR looks solid though. I'll merge it and remove the non-existent parts in a follow-up.
|
|
174
|
+
|
|
175
|
+
{IF the whole PR is based on the hallucination:}
|
|
176
|
+
Since the core change depends on this feature, we'd need to find an alternative approach. {Suggestion for correct approach}
|
|
177
|
+
|
|
178
|
+
Let me know how you'd like to proceed!
|
|
179
|
+
```
|
|
180
|
+
|
|
181
|
+
## Release Comments
|
|
182
|
+
|
|
183
|
+
### On Issues Fixed in Release
|
|
184
|
+
|
|
185
|
+
```markdown
|
|
186
|
+
🎉 Released in **v{VERSION}**!
|
|
187
|
+
|
|
188
|
+
Please update and test:
|
|
189
|
+
```
|
|
190
|
+
npm update -g context-mode
|
|
191
|
+
# or for plugin users:
|
|
192
|
+
/context-mode:ctx-upgrade
|
|
193
|
+
```
|
|
194
|
+
|
|
195
|
+
Let us know if this resolves your issue!
|
|
196
|
+
```
|
|
197
|
+
|
|
198
|
+
### Release Announcement (GitHub Release Body)
|
|
199
|
+
|
|
200
|
+
The `gh release create --generate-notes` handles this automatically. Only add a manual note if there are:
|
|
201
|
+
- Breaking changes
|
|
202
|
+
- Migration steps required
|
|
203
|
+
- Notable new features
|
|
204
|
+
|
|
205
|
+
## Tone Guidelines
|
|
206
|
+
|
|
207
|
+
### DO
|
|
208
|
+
|
|
209
|
+
- Start with gratitude: "Thanks for..."
|
|
210
|
+
- Use names: "@{author}"
|
|
211
|
+
- Be specific and technical
|
|
212
|
+
- Give clear next steps
|
|
213
|
+
- Use emoji sparingly (👋 🎉 🙏 at most)
|
|
214
|
+
- Frame responsibility clearly but kindly
|
|
215
|
+
|
|
216
|
+
### DON'T
|
|
217
|
+
|
|
218
|
+
- Be passive-aggressive
|
|
219
|
+
- Use corporate speak
|
|
220
|
+
- Leave ambiguity about next steps
|
|
221
|
+
- Promise timelines
|
|
222
|
+
- Blame the contributor for mistakes
|
|
223
|
+
- Use excessive emoji
|
|
224
|
+
- Write walls of text — keep it concise
|