clideck 1.31.17 → 1.31.19
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/README.md +4 -4
- package/agent-presets.json +19 -1
- package/bin/claude-hook.js +3 -0
- package/handlers.js +80 -4
- package/package.json +1 -1
- package/pi-bridge.js +51 -0
- package/pi-extension/clideck-bridge.ts +34 -0
- package/public/img/pi.svg +13 -0
- package/public/index.html +4 -1
- package/public/js/app.js +15 -4
- package/public/js/creator.js +9 -1
- package/public/js/hotkeys.js +11 -0
- package/public/js/terminals.js +2 -1
- package/public/tailwind.css +1 -1
- package/server.js +27 -5
- package/sessions.js +12 -4
- package/transcript.js +1 -0
- package/skills/autonomous-session/SKILL.md +0 -211
- package/skills/research-experiment/SKILL.md +0 -411
- package/skills/research-experiment/SKILL.md.bak +0 -224
- package/skills/research-experiment/scripts/init-research-layout.mjs +0 -184
|
@@ -1,184 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
|
|
3
|
-
import { mkdirSync, writeFileSync, existsSync } from 'node:fs';
|
|
4
|
-
import { dirname, join, resolve } from 'node:path';
|
|
5
|
-
|
|
6
|
-
function usage() {
|
|
7
|
-
console.error('Usage: node init-research-layout.mjs <experiment_dir> [researcher_count] [mode]');
|
|
8
|
-
console.error(' mode: code | knowledge');
|
|
9
|
-
process.exit(1);
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
const [, , experimentDirArg, researcherCountArg = '3', modeArg = 'knowledge'] = process.argv;
|
|
13
|
-
|
|
14
|
-
if (!experimentDirArg) usage();
|
|
15
|
-
|
|
16
|
-
const researcherCount = Number.parseInt(researcherCountArg, 10);
|
|
17
|
-
const mode = String(modeArg).toLowerCase();
|
|
18
|
-
|
|
19
|
-
if (!Number.isInteger(researcherCount) || researcherCount < 1 || researcherCount > 20) {
|
|
20
|
-
console.error('researcher_count must be an integer between 1 and 20');
|
|
21
|
-
process.exit(1);
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
if (!['code', 'knowledge'].includes(mode)) {
|
|
25
|
-
console.error('mode must be "code" or "knowledge"');
|
|
26
|
-
process.exit(1);
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
const experimentDir = resolve(experimentDirArg);
|
|
30
|
-
const defaultThinkingStyles = [
|
|
31
|
-
'first-principles',
|
|
32
|
-
'evidence-first',
|
|
33
|
-
'systems-level',
|
|
34
|
-
'contrarian',
|
|
35
|
-
'creative/wildcard',
|
|
36
|
-
];
|
|
37
|
-
|
|
38
|
-
function ensureDir(dir) {
|
|
39
|
-
mkdirSync(dir, { recursive: true });
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
function writeIfMissing(path, content) {
|
|
43
|
-
ensureDir(dirname(path));
|
|
44
|
-
if (!existsSync(path)) writeFileSync(path, content, 'utf8');
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
function fileHeader(title) {
|
|
48
|
-
return `# ${title}\n\n`;
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
function thinkingStyleFor(index) {
|
|
52
|
-
return defaultThinkingStyles[(index - 1) % defaultThinkingStyles.length];
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
function promptTemplate(index, thinkingStyle) {
|
|
56
|
-
return `${fileHeader(`Researcher ${index} Prompt`)}## Goal
|
|
57
|
-
|
|
58
|
-
## Decision Supported
|
|
59
|
-
|
|
60
|
-
## Assigned Workspace
|
|
61
|
-
|
|
62
|
-
Use an absolute path here when researchers will be launched manually in separate sessions.
|
|
63
|
-
|
|
64
|
-
## Canonical Brief
|
|
65
|
-
../EXPERIMENT.md
|
|
66
|
-
|
|
67
|
-
## Log File
|
|
68
|
-
./LOG.md
|
|
69
|
-
|
|
70
|
-
## Findings File
|
|
71
|
-
./FINDINGS.md
|
|
72
|
-
|
|
73
|
-
## Ideas File
|
|
74
|
-
./IDEAS.md
|
|
75
|
-
|
|
76
|
-
## Allowed Tools And Sources
|
|
77
|
-
|
|
78
|
-
## Forbidden Actions
|
|
79
|
-
|
|
80
|
-
## Evidence Standard
|
|
81
|
-
|
|
82
|
-
## Stop Conditions
|
|
83
|
-
|
|
84
|
-
## Thinking Style
|
|
85
|
-
${thinkingStyle}
|
|
86
|
-
|
|
87
|
-
Use this thinking style to widen exploration, not to force a predetermined conclusion.
|
|
88
|
-
|
|
89
|
-
## Researcher Operating Rules
|
|
90
|
-
|
|
91
|
-
- Work independently.
|
|
92
|
-
- Do not ask "should I continue?"
|
|
93
|
-
- Keep working until you reach a credible conclusion or a real blocker.
|
|
94
|
-
- Do not redefine the goal, evidence standard, constraints, or assigned workspace.
|
|
95
|
-
- Do not read other researchers' interim work unless the manager explicitly allows collaboration.
|
|
96
|
-
- Start with a question-generation round before choosing your first approach.
|
|
97
|
-
- Explore multiple materially different approaches when the task is open-ended.
|
|
98
|
-
- Explore at least one non-obvious or unconventional path.
|
|
99
|
-
- Separate facts, evidence, and hypotheses clearly.
|
|
100
|
-
- Record meaningful progress in \`LOG.md\`.
|
|
101
|
-
- Record promising deferred ideas in \`IDEAS.md\`.
|
|
102
|
-
- Write your final conclusion in \`FINDINGS.md\`.
|
|
103
|
-
|
|
104
|
-
## Anti-Bias Rules
|
|
105
|
-
|
|
106
|
-
- Do not assume the manager knows the answer.
|
|
107
|
-
- Do not anchor on the most obvious solution too early.
|
|
108
|
-
- Use the problem definition and constraints as your guide, not implied preferences.
|
|
109
|
-
- Treat your assigned thinking style as a way to widen search, not to distort evidence.
|
|
110
|
-
|
|
111
|
-
## Question Round
|
|
112
|
-
|
|
113
|
-
Before taking your first action, generate a short list of high-value questions.
|
|
114
|
-
|
|
115
|
-
Use the questions to widen the search space before committing to an approach.
|
|
116
|
-
|
|
117
|
-
Also generate a new short question round after major failed or inconclusive attempts.
|
|
118
|
-
|
|
119
|
-
Example questions:
|
|
120
|
-
|
|
121
|
-
- what is actually expensive here?
|
|
122
|
-
- what is actually causing the token bloat?
|
|
123
|
-
- what is the current hard limit?
|
|
124
|
-
- what happens if we remove this step entirely?
|
|
125
|
-
- what happens if we compress, batch, defer, cache, or approximate it?
|
|
126
|
-
- what quality signal might break if we optimize too aggressively?
|
|
127
|
-
- what is the theoretical lower bound?
|
|
128
|
-
- what assumptions are probably wrong?
|
|
129
|
-
- what would a contrarian approach try first?
|
|
130
|
-
- if the obvious path fails, what structurally different path is left?
|
|
131
|
-
|
|
132
|
-
## Working Loop
|
|
133
|
-
|
|
134
|
-
1. Re-read the goal, constraints, and evidence standard.
|
|
135
|
-
2. Inspect the workspace and relevant context.
|
|
136
|
-
3. Generate high-value questions about limits, assumptions, and overlooked paths.
|
|
137
|
-
4. Form multiple candidate approaches from those questions.
|
|
138
|
-
5. Choose one explainable experiment or line of inquiry.
|
|
139
|
-
6. Execute it and gather evidence.
|
|
140
|
-
7. Record what happened in \`LOG.md\`.
|
|
141
|
-
8. Keep, revise, or reject the approach.
|
|
142
|
-
9. Re-question after major failures or surprises.
|
|
143
|
-
10. Repeat until success, exhaustion, or a true blocker.
|
|
144
|
-
|
|
145
|
-
## Final Output Requirements
|
|
146
|
-
|
|
147
|
-
Before stopping, complete \`FINDINGS.md\` with:
|
|
148
|
-
|
|
149
|
-
- Executive summary
|
|
150
|
-
- Recommendation
|
|
151
|
-
- Confidence level
|
|
152
|
-
- Approaches tried
|
|
153
|
-
- Evidence collected
|
|
154
|
-
- Failed or rejected paths
|
|
155
|
-
- Remaining uncertainties
|
|
156
|
-
- Suggested next steps
|
|
157
|
-
`;
|
|
158
|
-
}
|
|
159
|
-
|
|
160
|
-
ensureDir(experimentDir);
|
|
161
|
-
|
|
162
|
-
writeIfMissing(join(experimentDir, 'EXPERIMENT.md'), `${fileHeader('Experiment Brief')}## Objective\n\n## Decision Supported\n\n## Mode\n${mode}\n\n## Success Criteria\n\n## Evidence Standard\n\n## Constraints\n\n## Allowed Tools And Sources\n\n## Domain Context\n\n## Shared Resources\n\n## Stop Conditions\n\n## Researcher Independence Rules\n`);
|
|
163
|
-
|
|
164
|
-
writeIfMissing(join(experimentDir, 'MANAGER.md'), `${fileHeader('Manager Notes')}## Intake Checklist\n\n## Open Questions\n\n## Round Control\n\n## Researcher Assignments\n`);
|
|
165
|
-
|
|
166
|
-
writeIfMissing(join(experimentDir, 'SYNTHESIS.md'), `${fileHeader('Synthesis')}## Experiment Summary\n\n## Convergences\n\n## Divergences\n\n## Ranked Recommendations\n\n## Follow-Up Work\n`);
|
|
167
|
-
|
|
168
|
-
for (let i = 1; i <= researcherCount; i += 1) {
|
|
169
|
-
const researcherDir = join(experimentDir, `researcher-${i}`);
|
|
170
|
-
const thinkingStyle = thinkingStyleFor(i);
|
|
171
|
-
ensureDir(researcherDir);
|
|
172
|
-
|
|
173
|
-
writeIfMissing(join(researcherDir, 'PROMPT.md'), promptTemplate(i, thinkingStyle));
|
|
174
|
-
|
|
175
|
-
writeIfMissing(join(researcherDir, 'LOG.md'), `${fileHeader(`Researcher ${i} Log`)}- Start here.\n`);
|
|
176
|
-
writeIfMissing(join(researcherDir, 'FINDINGS.md'), `${fileHeader(`Researcher ${i} Findings`)}## Executive Summary\n\n## Recommendation\n\n## Confidence Level\n\n## Approaches Tried\n\n## Evidence Collected\n\n## Failed Or Rejected Paths\n\n## Remaining Uncertainties\n\n## Suggested Next Steps\n`);
|
|
177
|
-
writeIfMissing(join(researcherDir, 'IDEAS.md'), `${fileHeader(`Researcher ${i} Ideas`)}- Add promising deferred ideas here.\n`);
|
|
178
|
-
writeIfMissing(join(researcherDir, 'WORKSPACE.md'), `${fileHeader(`Researcher ${i} Workspace`)}Mode: ${mode}\n\nUse this file to record the assigned workspace path and any workspace-specific rules.\n`);
|
|
179
|
-
}
|
|
180
|
-
|
|
181
|
-
console.log(`Created research layout at ${experimentDir}`);
|
|
182
|
-
console.log(`Researchers: ${researcherCount}`);
|
|
183
|
-
console.log(`Mode: ${mode}`);
|
|
184
|
-
console.log(`Thinking styles: ${Array.from({ length: researcherCount }, (_, idx) => `r${idx + 1}=${thinkingStyleFor(idx + 1)}`).join(', ')}`);
|