gm-kilo 2.0.455 → 2.0.457
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/agents/memorize.md +8 -8
- package/gm-kilo.mjs +26 -2
- package/package.json +1 -1
- package/scripts/bootstrap.js +1 -1
- package/scripts/postinstall-kilo.js +5 -7
- package/scripts/postinstall-oc.js +5 -6
- package/skills/gm-complete/SKILL.md +1 -1
- package/skills/planning/SKILL.md +1 -1
- package/skills/update-docs/SKILL.md +3 -3
package/agents/memorize.md
CHANGED
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: memorize
|
|
3
|
-
description: Background memory agent. Classifies context into memory/ dir and
|
|
3
|
+
description: Background memory agent. Classifies context into memory/ dir and AGENTS.md. Aggressively prunes stale/derivable/duplicate entries.
|
|
4
4
|
agent: true
|
|
5
5
|
---
|
|
6
6
|
|
|
7
7
|
# Memorize — Background Memory Agent
|
|
8
8
|
|
|
9
9
|
Memory dir: C:/Users/user/.claude/projects/C--dev-plugforge/memory/
|
|
10
|
-
|
|
10
|
+
AGENTS.md: C:/dev/plugforge/AGENTS.md
|
|
11
11
|
|
|
12
12
|
## STEP 1: READ
|
|
13
13
|
|
|
14
|
-
Read memory dir contents and MEMORY.md index. Read all existing memory files. Read
|
|
14
|
+
Read memory dir contents and MEMORY.md index. Read all existing memory files. Read AGENTS.md in full.
|
|
15
15
|
|
|
16
16
|
If memory dir does not exist, create it. If MEMORY.md does not exist, create it empty.
|
|
17
17
|
|
|
@@ -20,7 +20,7 @@ If memory dir does not exist, create it. If MEMORY.md does not exist, create it
|
|
|
20
20
|
Run BEFORE writing any new content.
|
|
21
21
|
|
|
22
22
|
Remove entries that are:
|
|
23
|
-
- Contradicted or superseded by current
|
|
23
|
+
- Contradicted or superseded by current AGENTS.md or observable codebase facts
|
|
24
24
|
- Duplicates of other entries (merge into one)
|
|
25
25
|
- Derivable at runtime via exec:codesearch: file paths, function names, API shapes, architecture patterns
|
|
26
26
|
- Active task state, current progress, session narration
|
|
@@ -39,7 +39,7 @@ Examine the ## CONTEXT TO MEMORIZE section at the end of this prompt. For each f
|
|
|
39
39
|
- reference: pointers to external systems, URLs, paths
|
|
40
40
|
|
|
41
41
|
Discard:
|
|
42
|
-
- Facts already covered in
|
|
42
|
+
- Facts already covered in AGENTS.md (exact or paraphrase)
|
|
43
43
|
- Obvious facts derivable from reading the code
|
|
44
44
|
- Active task state or session progress
|
|
45
45
|
|
|
@@ -76,14 +76,14 @@ No frontmatter. Max 200 lines.
|
|
|
76
76
|
|
|
77
77
|
## STEP 6: CONSOLIDATE
|
|
78
78
|
|
|
79
|
-
For each memory file: if its content is already fully covered by
|
|
79
|
+
For each memory file: if its content is already fully covered by AGENTS.md (exact or equivalent), delete the memory file and remove its line from MEMORY.md.
|
|
80
80
|
|
|
81
|
-
## STEP 7:
|
|
81
|
+
## STEP 7: AGENTS.md
|
|
82
82
|
|
|
83
83
|
A non-obvious technical caveat qualifies if it required multiple failed runs to discover and would not be apparent from reading code or docs.
|
|
84
84
|
|
|
85
85
|
For each qualifying fact from context:
|
|
86
|
-
- If
|
|
86
|
+
- If AGENTS.md already covers it → skip
|
|
87
87
|
- If genuinely non-obvious → append to the appropriate section
|
|
88
88
|
|
|
89
89
|
Never add: obvious patterns, active task progress, redundant restatements.
|
package/gm-kilo.mjs
CHANGED
|
@@ -68,6 +68,14 @@ function runExecSync(rawLang, code, cwd) {
|
|
|
68
68
|
return result;
|
|
69
69
|
}
|
|
70
70
|
|
|
71
|
+
const BANNED_BASH = ['grep','rg','find','glob','awk','sed','cat','head','tail'];
|
|
72
|
+
function bashBannedTool(code) {
|
|
73
|
+
for (const t of BANNED_BASH) { if (new RegExp('(^|\\||;|&&|\\$\\()\\s*'+t+'(\\s|$)').test(code)) return t; }
|
|
74
|
+
return null;
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
let sessionStarted = false;
|
|
78
|
+
|
|
71
79
|
export async function GmPlugin({ directory }) {
|
|
72
80
|
const agentMd = join(__dirname, '..', 'agents', 'gm.md');
|
|
73
81
|
const prdFile = join(directory, '.prd');
|
|
@@ -86,6 +94,11 @@ export async function GmPlugin({ directory }) {
|
|
|
86
94
|
}
|
|
87
95
|
} catch(e) {}
|
|
88
96
|
} catch(e) {}
|
|
97
|
+
if (!sessionStarted) {
|
|
98
|
+
sessionStarted = true;
|
|
99
|
+
try { runPlugkit(['hook', 'session-start']); } catch(e) {}
|
|
100
|
+
try { runPlugkit(['bootstrap', directory]); } catch(e) {}
|
|
101
|
+
}
|
|
89
102
|
try { const rules = readFileSync(agentMd,'utf-8'); if (rules) output.system.unshift(rules); } catch(e) {}
|
|
90
103
|
try {
|
|
91
104
|
if (existsSync(prdFile)) {
|
|
@@ -128,14 +141,20 @@ export async function GmPlugin({ directory }) {
|
|
|
128
141
|
if (input.tool === 'Task' && input.args?.subagent_type === 'Explore') {
|
|
129
142
|
throw new Error('The Explore agent is blocked. Use exec:codesearch in the Bash tool instead.\n\nexec:codesearch\n<natural language description of what to find>');
|
|
130
143
|
}
|
|
144
|
+
if (input.tool === 'Skill') {
|
|
145
|
+
const skill = ((input.args && input.args.skill) || '').toLowerCase().replace(/^gm:/,'');
|
|
146
|
+
if (skill === 'explore' || skill === 'search') {
|
|
147
|
+
throw new Error('The search/explore skill is blocked. Use exec:codesearch instead.\n\nexec:codesearch\n<natural language description>');
|
|
148
|
+
}
|
|
149
|
+
}
|
|
131
150
|
if (input.tool === 'write' || input.tool === 'Write' || input.tool === 'edit') {
|
|
132
151
|
const fp = (output.args && output.args.file_path) || (input.args && input.args.file_path) || '';
|
|
133
152
|
const base = basename(fp).toLowerCase();
|
|
134
153
|
const ext = extname(fp);
|
|
135
154
|
const blocked = FORBIDDEN_FILE_RE.some(re => re.test(base)) || FORBIDDEN_PATH_RE.some(p => fp.includes(p))
|
|
136
|
-
|| (DOC_BLOCK_RE.test(ext) && !base.startsWith('claude') && !base.startsWith('readme') && !fp.includes('/skills/'));
|
|
155
|
+
|| (DOC_BLOCK_RE.test(ext) && !base.startsWith('claude') && !base.startsWith('agents') && !base.startsWith('readme') && !fp.includes('/skills/'));
|
|
137
156
|
if (blocked) {
|
|
138
|
-
throw new Error('Cannot create test/doc files. Use .prd for task notes,
|
|
157
|
+
throw new Error('Cannot create test/doc files. Use .prd for task notes, AGENTS.md for permanent notes.');
|
|
139
158
|
}
|
|
140
159
|
}
|
|
141
160
|
if (input.tool !== 'bash' && input.tool !== 'Bash') return;
|
|
@@ -147,6 +166,11 @@ export async function GmPlugin({ directory }) {
|
|
|
147
166
|
output.args.command = "echo 'Bash tool can only be used with exec syntax:\n\nexec[:lang]\n<command>\n\nExamples:\nexec\nls -la\n\nexec:nodejs\nconsole.log(\"hello\")' 1>&2 && false";
|
|
148
167
|
return;
|
|
149
168
|
}
|
|
169
|
+
const rawLang = (m[1]||'').toLowerCase();
|
|
170
|
+
if (rawLang === 'bash' || rawLang === 'sh' || rawLang === '') {
|
|
171
|
+
const banned = bashBannedTool(m[2]);
|
|
172
|
+
if (banned) throw new Error('`'+banned+'` is blocked in exec:bash. Use exec:codesearch instead.');
|
|
173
|
+
}
|
|
150
174
|
const result = runExecSync(m[1]||'', m[2], output.args.workdir || directory);
|
|
151
175
|
output.args = { ...output.args, command: safePrintf('exec:'+(m[1]||'nodejs')+' output:\n\n'+result) };
|
|
152
176
|
}
|
package/package.json
CHANGED
package/scripts/bootstrap.js
CHANGED
|
@@ -5,7 +5,7 @@ const path = require('path');
|
|
|
5
5
|
const https = require('https');
|
|
6
6
|
const { execFileSync } = require('child_process');
|
|
7
7
|
|
|
8
|
-
const pluginRoot = process.env.CLAUDE_PLUGIN_ROOT || process.env.CODEX_PLUGIN_ROOT;
|
|
8
|
+
const pluginRoot = process.env.CLAUDE_PLUGIN_ROOT || process.env.CODEX_PLUGIN_ROOT || process.env.KILO_PLUGIN_ROOT || process.env.OC_PLUGIN_ROOT || process.env.extensionPath;
|
|
9
9
|
if (!pluginRoot) process.exit(0);
|
|
10
10
|
|
|
11
11
|
const IS_WIN = process.platform === 'win32';
|
|
@@ -102,19 +102,17 @@ function install() {
|
|
|
102
102
|
safeCopyDirectory(path.join(sourceDir, 'skills'), path.join(kiloDir, 'skills'));
|
|
103
103
|
safeCopyFile(path.join(sourceDir, 'kilocode.json'), path.join(kiloDir, 'kilocode.json'));
|
|
104
104
|
safeCopyFile(path.join(sourceDir, '.mcp.json'), path.join(kiloDir, '.mcp.json'));
|
|
105
|
-
safeCopyFile(path.join(sourceDir, 'gm.mjs'), path.join(kiloDir, 'gm.mjs'));
|
|
106
|
-
safeCopyFile(path.join(sourceDir, '
|
|
105
|
+
safeCopyFile(path.join(sourceDir, 'gm-kilo.mjs'), path.join(kiloDir, 'plugins', 'gm-kilo.mjs'));
|
|
106
|
+
safeCopyFile(path.join(sourceDir, 'gm.json'), path.join(kiloDir, 'gm.json'));
|
|
107
107
|
safeCopyFile(path.join(sourceDir, 'README.md'), path.join(kiloDir, 'README.md'));
|
|
108
108
|
safeCopyFile(path.join(sourceDir, 'LICENSE'), path.join(kiloDir, 'LICENSE'));
|
|
109
109
|
safeCopyFile(path.join(sourceDir, 'CONTRIBUTING.md'), path.join(kiloDir, 'CONTRIBUTING.md'));
|
|
110
110
|
safeCopyFile(path.join(sourceDir, '.gitignore'), path.join(kiloDir, '.gitignore'));
|
|
111
111
|
safeCopyFile(path.join(sourceDir, '.editorconfig'), path.join(kiloDir, '.editorconfig'));
|
|
112
112
|
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
if (fs.existsSync(gmMjsSrc)) safeCopyFile(gmMjsSrc, path.join(pluginDir, 'gm.mjs'));
|
|
117
|
-
fs.writeFileSync(path.join(pluginDir, 'index.js'), "export { default } from './gm.mjs';\n", 'utf-8');
|
|
113
|
+
safeCopyDirectory(path.join(sourceDir, 'skills'), path.join(kiloDir, 'skills'));
|
|
114
|
+
safeCopyDirectory(path.join(sourceDir, 'lang'), path.join(kiloDir, 'lang'));
|
|
115
|
+
safeCopyDirectory(path.join(sourceDir, 'bin'), path.join(kiloDir, 'bin'));
|
|
118
116
|
|
|
119
117
|
updateGitignore(projectRoot);
|
|
120
118
|
|
|
@@ -104,18 +104,17 @@ function install() {
|
|
|
104
104
|
safeCopyDirectory(path.join(sourceDir, 'skills'), path.join(ocDir, 'skills'));
|
|
105
105
|
safeCopyFile(path.join(sourceDir, 'opencode.json'), path.join(ocDir, 'opencode.json'));
|
|
106
106
|
safeCopyFile(path.join(sourceDir, '.mcp.json'), path.join(ocDir, '.mcp.json'));
|
|
107
|
-
safeCopyFile(path.join(sourceDir, 'gm.mjs'), path.join(ocDir, 'gm.mjs'));
|
|
108
|
-
safeCopyFile(path.join(sourceDir, '
|
|
107
|
+
safeCopyFile(path.join(sourceDir, 'gm-oc.mjs'), path.join(ocDir, 'plugins', 'gm-oc.mjs'));
|
|
108
|
+
safeCopyFile(path.join(sourceDir, 'gm.json'), path.join(ocDir, 'gm.json'));
|
|
109
109
|
safeCopyFile(path.join(sourceDir, 'README.md'), path.join(ocDir, 'README.md'));
|
|
110
110
|
safeCopyFile(path.join(sourceDir, 'LICENSE'), path.join(ocDir, 'LICENSE'));
|
|
111
111
|
safeCopyFile(path.join(sourceDir, 'CONTRIBUTING.md'), path.join(ocDir, 'CONTRIBUTING.md'));
|
|
112
112
|
safeCopyFile(path.join(sourceDir, '.gitignore'), path.join(ocDir, '.gitignore'));
|
|
113
113
|
safeCopyFile(path.join(sourceDir, '.editorconfig'), path.join(ocDir, '.editorconfig'));
|
|
114
114
|
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
if (fs.existsSync(gmMjsSrc)) safeCopyFile(gmMjsSrc, path.join(pluginsDir, 'gm-oc.mjs'));
|
|
115
|
+
safeCopyDirectory(path.join(sourceDir, 'skills'), path.join(ocDir, 'skills'));
|
|
116
|
+
safeCopyDirectory(path.join(sourceDir, 'lang'), path.join(ocDir, 'lang'));
|
|
117
|
+
safeCopyDirectory(path.join(sourceDir, 'bin'), path.join(ocDir, 'bin'));
|
|
119
118
|
|
|
120
119
|
updateGitignore(projectRoot);
|
|
121
120
|
|
|
@@ -118,7 +118,7 @@ gh run view <run_id> --log-failed
|
|
|
118
118
|
|
|
119
119
|
5. All runs must reach `conclusion: success` before advancing. A failed CI run is a KNOWN mutable that blocks completion — never ignore it.
|
|
120
120
|
|
|
121
|
-
**Cascade awareness**: pushes to this repo may trigger downstream workflows (see
|
|
121
|
+
**Cascade awareness**: pushes to this repo may trigger downstream workflows (see AGENTS.md Rust Binary Update Pipeline). After local CI passes, check downstream repos for triggered runs:
|
|
122
122
|
```
|
|
123
123
|
exec:bash
|
|
124
124
|
gh run list --repo AnEntrypoint/<downstream-repo> --limit 3 --json databaseId,name,status,conclusion
|
package/skills/planning/SKILL.md
CHANGED
|
@@ -111,7 +111,7 @@ Invoke `browser` skill. Escalation: (1) `exec:browser <js>` → (2) browser skil
|
|
|
111
111
|
|
|
112
112
|
## MANDATORY DEV WORKFLOW
|
|
113
113
|
|
|
114
|
-
No comments. No test files. 200-line limit — split before continuing. Fail loud. No duplication. Scan before every edit. Duplicate concern = regress to PLAN. Errors throw with context — no `|| default`, no `catch { return null }`. `window.__debug` exposes all client state.
|
|
114
|
+
No comments. No test files. 200-line limit — split before continuing. Fail loud. No duplication. Scan before every edit. Duplicate concern = regress to PLAN. Errors throw with context — no `|| default`, no `catch { return null }`. `window.__debug` exposes all client state. AGENTS.md via memorize only. CHANGELOG.md: append per commit.
|
|
115
115
|
|
|
116
116
|
**Minimal code / maximal DX process**: Before writing any logic, run this process in order — stop at the first step that resolves the need:
|
|
117
117
|
1. **Native first** — does the language or runtime already do this? Use it exactly as designed.
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: update-docs
|
|
3
|
-
description: UPDATE-DOCS phase. Refresh README.md,
|
|
3
|
+
description: UPDATE-DOCS phase. Refresh README.md, AGENTS.md, and docs/index.html to reflect changes made this session. Commits and pushes doc updates. Terminal phase — declares COMPLETE.
|
|
4
4
|
---
|
|
5
5
|
|
|
6
6
|
# GM UPDATE-DOCS — Documentation Refresh
|
|
@@ -35,7 +35,7 @@ Witness which files changed. Identify doc-sensitive changes: new skills, new sta
|
|
|
35
35
|
```
|
|
36
36
|
exec:nodejs
|
|
37
37
|
const fs = require('fs');
|
|
38
|
-
['README.md', '
|
|
38
|
+
['README.md', 'AGENTS.md', 'docs/index.html',
|
|
39
39
|
'gm-starter/agents/gm.md'].forEach(f => {
|
|
40
40
|
try { console.log(`=== ${f} ===\n` + fs.readFileSync(f, 'utf8')); }
|
|
41
41
|
catch(e) { console.log(`MISSING: ${f}`); }
|
|
@@ -50,7 +50,7 @@ Write only sections that changed. Do not rewrite unchanged content. Rules per fi
|
|
|
50
50
|
|
|
51
51
|
**README.md**: platform count matches adapters in `platforms/`, skill tree diagram matches current state machine, quick start commands work.
|
|
52
52
|
|
|
53
|
-
**
|
|
53
|
+
**AGENTS.md**: Launch memorize sub-agent in background with session learnings. Do not inline-edit AGENTS.md — the memorize agent handles extraction, deduplication, and writing. Use: `Agent(subagent_type='memorize', model='haiku', run_in_background=true, prompt='## CONTEXT TO MEMORIZE\n<session learnings>')`
|
|
54
54
|
|
|
55
55
|
**docs/index.html**: `PHASES` array matches current skill state machine phases. Platform lists match `platforms/` directory. State machine diagram updated if new phases added.
|
|
56
56
|
|