everything-gemini 0.0.0-stage → 1.0.0
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/hooks.json +16 -0
- package/.agents/rules/everything-gemini-dev.md +5 -0
- package/.agents/rules/instincts.md +8 -0
- package/.agents/skills/everything-gemini-maintainer/SKILL.md +22 -0
- package/.github/ISSUE_TEMPLATE/skill_proposal.md +24 -0
- package/.github/pull_request_template.md +9 -0
- package/.github/workflows/ci.yml +35 -0
- package/AGENTS.md +15 -0
- package/CONTRIBUTING.md +114 -0
- package/GEMINI.md +15 -0
- package/LICENSE +176 -0
- package/README.md +310 -2
- package/agents/architect.md +21 -0
- package/agents/browser-qa.md +26 -0
- package/agents/build-repair.md +20 -0
- package/agents/code-reviewer.md +22 -0
- package/agents/planner.md +21 -0
- package/agents/security-auditor.md +21 -0
- package/bin/everything-gemini +514 -0
- package/docs/architecture/cortex-loop.md +57 -0
- package/docs/architecture/memory-and-context.md +50 -0
- package/docs/architecture/progressive-disclosure.md +41 -0
- package/docs/customization/hooks-reference.md +78 -0
- package/docs/ecc-vs-everything-gemini.md +59 -0
- package/docs/surfaces/cli.md +46 -0
- package/docs/surfaces/desktop-2.0.md +30 -0
- package/docs/surfaces/ide.md +29 -0
- package/docs/surfaces/python-sdk.md +53 -0
- package/docs/workflows/slash-commands.md +27 -0
- package/hooks/auto-lint-formatter/hooks.json +16 -0
- package/hooks/auto-lint-formatter/scripts/auto-format.sh +48 -0
- package/hooks/ephemeral-context/hooks.json +11 -0
- package/hooks/ephemeral-context/scripts/inject-context.sh +8 -0
- package/hooks/gemini-shield/hooks.json +16 -0
- package/hooks/gemini-shield/scripts/shield-gate.sh +72 -0
- package/hooks/goal-verifier/hooks.json +11 -0
- package/hooks/goal-verifier/scripts/verify-goal.sh +26 -0
- package/hooks/learned-instincts/hooks.json +11 -0
- package/hooks/learned-instincts/scripts/save-instinct.sh +23 -0
- package/hooks/safety-shield/hooks.json +16 -0
- package/hooks/safety-shield/scripts/safety-gate.sh +64 -0
- package/mcp/README.md +41 -0
- package/mcp/mcp_config.example.json +30 -0
- package/package.json +39 -4
- package/plugins/core/hooks.json +16 -0
- package/plugins/core/plugin.json +3 -0
- package/plugins/core/rules/core-practices.md +5 -0
- package/plugins/python-ai/plugin.json +3 -0
- package/plugins/python-ai/rules/ai-agent-patterns.md +5 -0
- package/plugins/python-ai/skills/antigravity-sdk-orchestrator/SKILL.md +54 -0
- package/plugins/security-shield/hooks.json +16 -0
- package/plugins/security-shield/plugin.json +3 -0
- package/plugins/security-shield/rules/zero-trust.md +5 -0
- package/plugins/web-fullstack/plugin.json +3 -0
- package/plugins/web-fullstack/rules/frontend-standards.md +5 -0
- package/plugins/web-fullstack/skills/responsive-design/SKILL.md +23 -0
- package/rules/common/AGENTS.md +30 -0
- package/rules/common/GEMINI.md +30 -0
- package/rules/languages/golang.md +10 -0
- package/rules/languages/python.md +16 -0
- package/rules/languages/typescript.md +18 -0
- package/rules/paradigms/security-hardened.md +17 -0
- package/rules/paradigms/tdd.md +19 -0
- package/scripts/install.ps1 +26 -0
- package/scripts/install.sh +52 -0
- package/scripts/validate.sh +73 -0
- package/skills/api-craftsman/SKILL.md +45 -0
- package/skills/api-craftsman/examples/openapi-spec.yaml +37 -0
- package/skills/architecture-designer/SKILL.md +33 -0
- package/skills/architecture-designer/examples/c4-architecture.md +33 -0
- package/skills/browser-qa-tester/SKILL.md +43 -0
- package/skills/browser-qa-tester/references/browser-recipes.md +21 -0
- package/skills/context-caching/SKILL.md +48 -0
- package/skills/continuous-learning/SKILL.md +31 -0
- package/skills/database-architect/SKILL.md +26 -0
- package/skills/database-architect/references/migration-checklist.md +9 -0
- package/skills/devops-pipeline/SKILL.md +23 -0
- package/skills/devops-pipeline/templates/github-ci.yml +31 -0
- package/skills/fullstack-nextjs/SKILL.md +27 -0
- package/skills/fullstack-nextjs/references/app-router-patterns.md +46 -0
- package/skills/gemini-multimodal/SKILL.md +43 -0
- package/skills/git-craftsman/SKILL.md +43 -0
- package/skills/performance-profiler/SKILL.md +35 -0
- package/skills/performance-profiler/scripts/profile-node.sh +13 -0
- package/skills/repo-onboarding/SKILL.md +35 -0
- package/skills/repo-onboarding/references/knowledge-item-schema.md +30 -0
- package/skills/root-cause-debugger/SKILL.md +35 -0
- package/skills/root-cause-debugger/scripts/git-bisect-helper.sh +13 -0
- package/skills/security-audit/SKILL.md +29 -0
- package/skills/security-audit/scripts/scan-secrets.sh +26 -0
- package/skills/subagent-handoff/SKILL.md +28 -0
- package/skills/subagent-handoff/references/handoff-patterns.md +30 -0
- package/skills/tdd-workflow/SKILL.md +40 -0
- package/skills/tdd-workflow/references/tdd-patterns.md +23 -0
- package/templates/minimal/GEMINI.md +5 -0
- package/templates/minimal/hooks.json +16 -0
|
@@ -0,0 +1,514 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Everything Antigravity (eagy) CLI
|
|
5
|
+
* Zero-dependency harness manager for Google Antigravity
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
const fs = require('fs');
|
|
9
|
+
const path = require('path');
|
|
10
|
+
const os = require('os');
|
|
11
|
+
const { execSync } = require('child_process');
|
|
12
|
+
|
|
13
|
+
const REPO_ROOT = path.resolve(__dirname, '..');
|
|
14
|
+
const GLOBAL_CONFIG_DIR = path.join(os.homedir(), '.gemini', 'config');
|
|
15
|
+
const WORKSPACE_DIR = process.cwd();
|
|
16
|
+
const AGENTS_DIR = path.join(WORKSPACE_DIR, '.agents');
|
|
17
|
+
|
|
18
|
+
// ANSI Colors
|
|
19
|
+
const RESET = '\x1b[0m';
|
|
20
|
+
const BOLD = '\x1b[1m';
|
|
21
|
+
const BLUE = '\x1b[34m';
|
|
22
|
+
const CYAN = '\x1b[36m';
|
|
23
|
+
const GREEN = '\x1b[32m';
|
|
24
|
+
const YELLOW = '\x1b[33m';
|
|
25
|
+
const RED = '\x1b[31m';
|
|
26
|
+
const GRAY = '\x1b[90m';
|
|
27
|
+
|
|
28
|
+
function printBanner() {
|
|
29
|
+
console.log(`
|
|
30
|
+
${CYAN}${BOLD}🪐 Everything Gemini (${GREEN}everything-gemini${CYAN}) v1.0.0${RESET}
|
|
31
|
+
${GRAY}The open-source agent harness & multi-agent orchestrator for Google Gemini & Antigravity${RESET}
|
|
32
|
+
`);
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
function printHelp() {
|
|
36
|
+
printBanner();
|
|
37
|
+
console.log(`${BOLD}USAGE:${RESET}`);
|
|
38
|
+
console.log(` everything-gemini <command> [options]\n`);
|
|
39
|
+
console.log(`${BOLD}COMMANDS:${RESET}`);
|
|
40
|
+
console.log(` ${GREEN}doctor${RESET} Inspect system, AGY surfaces, and configuration health`);
|
|
41
|
+
console.log(` ${GREEN}install${RESET} [options] Install eagy profiles into workspace or globally`);
|
|
42
|
+
console.log(` ${GREEN}list${RESET} Show all available skills, rules, hooks, and plugins`);
|
|
43
|
+
console.log(` ${GREEN}new-skill${RESET} <name> Scaffold a new progressive-disclosure skill`);
|
|
44
|
+
console.log(` ${GREEN}new-agent${RESET} <name> Scaffold a new scoped subagent specification`);
|
|
45
|
+
console.log(` ${GREEN}add${RESET} <type> <name> Add a specific skill, rule, or plugin to workspace`);
|
|
46
|
+
console.log(` ${GREEN}validate${RESET} Run self-test on frontmatter, JSON schemas & hooks`);
|
|
47
|
+
console.log(` ${GREEN}help${RESET} Show this help message\n`);
|
|
48
|
+
console.log(`${BOLD}OPTIONS for 'install':${RESET}`);
|
|
49
|
+
console.log(` ${CYAN}--profile <core|developer|full>${RESET} Installation preset profile (default: developer)`);
|
|
50
|
+
console.log(` ${CYAN}--global${RESET} Install globally into ~/.gemini/config/`);
|
|
51
|
+
console.log(` ${CYAN}--workspace <path>${RESET} Install into custom workspace directory`);
|
|
52
|
+
console.log(` ${CYAN}--force${RESET} Overwrite existing configuration files\n`);
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
function runDoctor() {
|
|
56
|
+
printBanner();
|
|
57
|
+
console.log(`${BOLD}🔍 Running Antigravity & Environment Diagnostics...${RESET}\n`);
|
|
58
|
+
|
|
59
|
+
let allGood = true;
|
|
60
|
+
|
|
61
|
+
// 1. Node.js Version
|
|
62
|
+
const nodeVersion = process.version;
|
|
63
|
+
console.log(` ${GREEN}✔${RESET} Node.js runtime: ${BOLD}${nodeVersion}${RESET}`);
|
|
64
|
+
|
|
65
|
+
// 2. Check for Antigravity CLI ('agy')
|
|
66
|
+
let agyFound = false;
|
|
67
|
+
try {
|
|
68
|
+
const agyVer = execSync('agy --version 2>/dev/null || which agy 2>/dev/null', { encoding: 'utf8' }).trim();
|
|
69
|
+
if (agyVer) {
|
|
70
|
+
console.log(` ${GREEN}✔${RESET} Antigravity CLI ('agy'): ${BOLD}${agyVer}${RESET}`);
|
|
71
|
+
agyFound = true;
|
|
72
|
+
}
|
|
73
|
+
} catch (e) {
|
|
74
|
+
// Not found in path
|
|
75
|
+
}
|
|
76
|
+
if (!agyFound) {
|
|
77
|
+
console.log(` ${YELLOW}ℹ${RESET} Antigravity CLI ('agy'): ${GRAY}Not found in standard PATH (Desktop 2.0 or IDE may be active)${RESET}`);
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
// 3. Check for Global Gemini Config
|
|
81
|
+
const hasGlobal = fs.existsSync(GLOBAL_CONFIG_DIR);
|
|
82
|
+
if (hasGlobal) {
|
|
83
|
+
console.log(` ${GREEN}✔${RESET} Global Config Root: ${BOLD}${GLOBAL_CONFIG_DIR}${RESET}`);
|
|
84
|
+
} else {
|
|
85
|
+
console.log(` ${GRAY}○${RESET} Global Config Root: ${GRAY}${GLOBAL_CONFIG_DIR} (Not yet created)${RESET}`);
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
// 4. Check for Workspace .agents
|
|
89
|
+
const hasWorkspaceAgents = fs.existsSync(AGENTS_DIR);
|
|
90
|
+
if (hasWorkspaceAgents) {
|
|
91
|
+
console.log(` ${GREEN}✔${RESET} Workspace Customizations: ${BOLD}${AGENTS_DIR}${RESET}`);
|
|
92
|
+
} else {
|
|
93
|
+
console.log(` ${GRAY}○${RESET} Workspace Customizations: ${GRAY}No .agents/ directory in current CWD${RESET}`);
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
// 5. Git Status
|
|
97
|
+
try {
|
|
98
|
+
execSync('git rev-parse --is-inside-work-tree 2>/dev/null');
|
|
99
|
+
let gitBranch = 'main';
|
|
100
|
+
try {
|
|
101
|
+
gitBranch = execSync('git rev-parse --abbrev-ref HEAD 2>/dev/null', { encoding: 'utf8' }).trim();
|
|
102
|
+
} catch (e) {
|
|
103
|
+
gitBranch = 'initial (main)';
|
|
104
|
+
}
|
|
105
|
+
console.log(` ${GREEN}✔${RESET} Git repository detected (${BOLD}${gitBranch}${RESET})`);
|
|
106
|
+
} catch (e) {
|
|
107
|
+
console.log(` ${YELLOW}ℹ${RESET} Current directory is not a git repository`);
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
console.log(`\n${GREEN}${BOLD}Diagnostics completed! Antigravity surfaces are ready.${RESET}\n`);
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
function listComponents() {
|
|
114
|
+
printBanner();
|
|
115
|
+
console.log(`${BOLD}📦 Everything Gemini Catalog:${RESET}\n`);
|
|
116
|
+
|
|
117
|
+
|
|
118
|
+
// Scoped Subagents
|
|
119
|
+
console.log(`\n${CYAN}${BOLD}🤖 Scoped Subagents (agents/):${RESET}`);
|
|
120
|
+
const agentsDir = path.join(REPO_ROOT, 'agents');
|
|
121
|
+
if (fs.existsSync(agentsDir)) {
|
|
122
|
+
const agents = fs.readdirSync(agentsDir).filter(f => f.endsWith('.md'));
|
|
123
|
+
for (const ag of agents) {
|
|
124
|
+
const name = ag.replace('.md', '');
|
|
125
|
+
console.log(` ${BOLD}${name.padEnd(24)}${RESET}`);
|
|
126
|
+
}
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
// Skills
|
|
130
|
+
console.log(`${CYAN}${BOLD}⚡ Skills (Progressive Disclosure):${RESET}`);
|
|
131
|
+
const skillsDir = path.join(REPO_ROOT, 'skills');
|
|
132
|
+
if (fs.existsSync(skillsDir)) {
|
|
133
|
+
const skills = fs.readdirSync(skillsDir, { withFileTypes: true })
|
|
134
|
+
.filter(d => d.isDirectory())
|
|
135
|
+
.map(d => d.name);
|
|
136
|
+
for (const skill of skills) {
|
|
137
|
+
const skillMd = path.join(skillsDir, skill, 'SKILL.md');
|
|
138
|
+
let desc = 'No description';
|
|
139
|
+
if (fs.existsSync(skillMd)) {
|
|
140
|
+
const content = fs.readFileSync(skillMd, 'utf8');
|
|
141
|
+
const match = content.match(/description:\s*>?-?\s*([^\n\r]+)/);
|
|
142
|
+
if (match) desc = match[1].trim();
|
|
143
|
+
}
|
|
144
|
+
console.log(` ${BOLD}${skill.padEnd(24)}${RESET} ${GRAY}${desc}${RESET}`);
|
|
145
|
+
}
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
// Rules
|
|
149
|
+
console.log(`\n${CYAN}${BOLD}📏 Rules & Guidelines:${RESET}`);
|
|
150
|
+
const rulesDir = path.join(REPO_ROOT, 'rules');
|
|
151
|
+
if (fs.existsSync(rulesDir)) {
|
|
152
|
+
function findRules(dir, prefix = '') {
|
|
153
|
+
const items = fs.readdirSync(dir, { withFileTypes: true });
|
|
154
|
+
for (const item of items) {
|
|
155
|
+
if (item.isDirectory()) {
|
|
156
|
+
findRules(path.join(dir, item.name), `${prefix}${item.name}/`);
|
|
157
|
+
} else if (item.name.endsWith('.md')) {
|
|
158
|
+
console.log(` ${BOLD}${(prefix + item.name).padEnd(32)}${RESET}`);
|
|
159
|
+
}
|
|
160
|
+
}
|
|
161
|
+
}
|
|
162
|
+
findRules(rulesDir);
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
// Hooks
|
|
166
|
+
console.log(`\n${CYAN}${BOLD}🛡️ Lifecycle Hooks:${RESET}`);
|
|
167
|
+
const hooksDir = path.join(REPO_ROOT, 'hooks');
|
|
168
|
+
if (fs.existsSync(hooksDir)) {
|
|
169
|
+
const hooks = fs.readdirSync(hooksDir, { withFileTypes: true })
|
|
170
|
+
.filter(d => d.isDirectory())
|
|
171
|
+
.map(d => d.name);
|
|
172
|
+
for (const hook of hooks) {
|
|
173
|
+
console.log(` ${BOLD}${hook.padEnd(24)}${RESET}`);
|
|
174
|
+
}
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
// Plugins
|
|
178
|
+
console.log(`\n${CYAN}${BOLD}🔌 Domain Plugins:${RESET}`);
|
|
179
|
+
const pluginsDir = path.join(REPO_ROOT, 'plugins');
|
|
180
|
+
if (fs.existsSync(pluginsDir)) {
|
|
181
|
+
const plugins = fs.readdirSync(pluginsDir, { withFileTypes: true })
|
|
182
|
+
.filter(d => d.isDirectory())
|
|
183
|
+
.map(d => d.name);
|
|
184
|
+
for (const plugin of plugins) {
|
|
185
|
+
const pJson = path.join(pluginsDir, plugin, 'plugin.json');
|
|
186
|
+
let name = plugin;
|
|
187
|
+
if (fs.existsSync(pJson)) {
|
|
188
|
+
try {
|
|
189
|
+
const parsed = JSON.parse(fs.readFileSync(pJson, 'utf8'));
|
|
190
|
+
if (parsed.name) name = parsed.name;
|
|
191
|
+
} catch (e) {}
|
|
192
|
+
}
|
|
193
|
+
console.log(` ${BOLD}${plugin.padEnd(24)}${RESET} ${GRAY}(${name})${RESET}`);
|
|
194
|
+
}
|
|
195
|
+
}
|
|
196
|
+
console.log('');
|
|
197
|
+
}
|
|
198
|
+
|
|
199
|
+
function copyRecursiveSync(src, dest) {
|
|
200
|
+
const exists = fs.existsSync(src);
|
|
201
|
+
const stats = exists && fs.statSync(src);
|
|
202
|
+
const isDirectory = exists && stats.isDirectory();
|
|
203
|
+
if (isDirectory) {
|
|
204
|
+
if (!fs.existsSync(dest)) fs.mkdirSync(dest, { recursive: true });
|
|
205
|
+
fs.readdirSync(src).forEach(childItemName => {
|
|
206
|
+
copyRecursiveSync(path.join(src, childItemName), path.join(dest, childItemName));
|
|
207
|
+
});
|
|
208
|
+
} else {
|
|
209
|
+
fs.mkdirSync(path.dirname(dest), { recursive: true });
|
|
210
|
+
fs.copyFileSync(src, dest);
|
|
211
|
+
}
|
|
212
|
+
}
|
|
213
|
+
|
|
214
|
+
function installProfile(profile = 'developer', isGlobal = false, customTarget = null) {
|
|
215
|
+
printBanner();
|
|
216
|
+
const targetDir = customTarget
|
|
217
|
+
? path.resolve(customTarget)
|
|
218
|
+
: (isGlobal ? GLOBAL_CONFIG_DIR : AGENTS_DIR);
|
|
219
|
+
|
|
220
|
+
console.log(`${BOLD}🚀 Installing eagy Profile: [${GREEN}${profile}${RESET}${BOLD}]${RESET}`);
|
|
221
|
+
console.log(`Target Directory: ${CYAN}${targetDir}${RESET}\n`);
|
|
222
|
+
|
|
223
|
+
if (!fs.existsSync(targetDir)) {
|
|
224
|
+
fs.mkdirSync(targetDir, { recursive: true });
|
|
225
|
+
}
|
|
226
|
+
|
|
227
|
+
// Ensure subdirectories exist
|
|
228
|
+
const targetSkills = path.join(targetDir, 'skills');
|
|
229
|
+
const targetRules = path.join(targetDir, 'rules');
|
|
230
|
+
const targetPlugins = path.join(targetDir, 'plugins');
|
|
231
|
+
fs.mkdirSync(targetSkills, { recursive: true });
|
|
232
|
+
fs.mkdirSync(targetRules, { recursive: true });
|
|
233
|
+
fs.mkdirSync(targetPlugins, { recursive: true });
|
|
234
|
+
|
|
235
|
+
const skillsSrc = path.join(REPO_ROOT, 'skills');
|
|
236
|
+
const rulesSrc = path.join(REPO_ROOT, 'rules');
|
|
237
|
+
const hooksSrc = path.join(REPO_ROOT, 'hooks');
|
|
238
|
+
const pluginsSrc = path.join(REPO_ROOT, 'plugins');
|
|
239
|
+
|
|
240
|
+
// Copy Common Base Rules
|
|
241
|
+
const commonGemini = path.join(rulesSrc, 'common', 'GEMINI.md');
|
|
242
|
+
const commonAgents = path.join(rulesSrc, 'common', 'AGENTS.md');
|
|
243
|
+
if (fs.existsSync(commonGemini)) {
|
|
244
|
+
fs.copyFileSync(commonGemini, path.join(targetDir, 'GEMINI.md'));
|
|
245
|
+
console.log(` ${GREEN}✔${RESET} Installed base GEMINI.md`);
|
|
246
|
+
}
|
|
247
|
+
if (fs.existsSync(commonAgents)) {
|
|
248
|
+
fs.copyFileSync(commonAgents, path.join(targetDir, 'AGENTS.md'));
|
|
249
|
+
console.log(` ${GREEN}✔${RESET} Installed base AGENTS.md`);
|
|
250
|
+
}
|
|
251
|
+
|
|
252
|
+
// Determine what to copy based on profile
|
|
253
|
+
if (profile === 'core' || profile === 'developer' || profile === 'full') {
|
|
254
|
+
// Core Skills
|
|
255
|
+
const coreSkills = ['tdd-workflow', 'repo-onboarding'];
|
|
256
|
+
for (const s of coreSkills) {
|
|
257
|
+
const src = path.join(skillsSrc, s);
|
|
258
|
+
if (fs.existsSync(src)) {
|
|
259
|
+
copyRecursiveSync(src, path.join(targetSkills, s));
|
|
260
|
+
console.log(` ${GREEN}✔${RESET} Installed skill: ${s}`);
|
|
261
|
+
}
|
|
262
|
+
}
|
|
263
|
+
// Core Hook (Safety Shield)
|
|
264
|
+
const safetyHookJson = path.join(hooksSrc, 'safety-shield', 'hooks.json');
|
|
265
|
+
if (fs.existsSync(safetyHookJson)) {
|
|
266
|
+
copyRecursiveSync(path.join(hooksSrc, 'safety-shield'), path.join(targetDir, 'hooks', 'safety-shield'));
|
|
267
|
+
console.log(` ${GREEN}✔${RESET} Installed safety-shield hook`);
|
|
268
|
+
}
|
|
269
|
+
}
|
|
270
|
+
|
|
271
|
+
if (profile === 'developer' || profile === 'full') {
|
|
272
|
+
// Developer Skills
|
|
273
|
+
const devSkills = ['browser-qa-tester', 'architecture-designer', 'git-craftsman', 'performance-profiler', 'fullstack-nextjs'];
|
|
274
|
+
for (const s of devSkills) {
|
|
275
|
+
const src = path.join(skillsSrc, s);
|
|
276
|
+
if (fs.existsSync(src)) {
|
|
277
|
+
copyRecursiveSync(src, path.join(targetSkills, s));
|
|
278
|
+
console.log(` ${GREEN}✔${RESET} Installed skill: ${s}`);
|
|
279
|
+
}
|
|
280
|
+
}
|
|
281
|
+
|
|
282
|
+
// Developer Language Rules
|
|
283
|
+
const langRules = path.join(rulesSrc, 'languages');
|
|
284
|
+
if (fs.existsSync(langRules)) {
|
|
285
|
+
copyRecursiveSync(langRules, targetRules);
|
|
286
|
+
console.log(` ${GREEN}✔${RESET} Installed language rules (TypeScript, Python, Go)`);
|
|
287
|
+
}
|
|
288
|
+
|
|
289
|
+
// Auto-lint formatter hook
|
|
290
|
+
const lintHook = path.join(hooksSrc, 'auto-lint-formatter');
|
|
291
|
+
if (fs.existsSync(lintHook)) {
|
|
292
|
+
copyRecursiveSync(lintHook, path.join(targetDir, 'hooks', 'auto-lint-formatter'));
|
|
293
|
+
console.log(` ${GREEN}✔${RESET} Installed auto-lint-formatter hook`);
|
|
294
|
+
}
|
|
295
|
+
|
|
296
|
+
// Developer Plugins
|
|
297
|
+
const devPlugins = ['web-fullstack', 'python-ai'];
|
|
298
|
+
for (const p of devPlugins) {
|
|
299
|
+
const src = path.join(pluginsSrc, p);
|
|
300
|
+
if (fs.existsSync(src)) {
|
|
301
|
+
copyRecursiveSync(src, path.join(targetPlugins, p));
|
|
302
|
+
console.log(` ${GREEN}✔${RESET} Installed plugin: ${p}`);
|
|
303
|
+
}
|
|
304
|
+
}
|
|
305
|
+
}
|
|
306
|
+
|
|
307
|
+
if (profile === 'full') {
|
|
308
|
+
// All Skills
|
|
309
|
+
copyRecursiveSync(skillsSrc, targetSkills);
|
|
310
|
+
console.log(` ${GREEN}✔${RESET} Installed entire skills library`);
|
|
311
|
+
|
|
312
|
+
// All Rules
|
|
313
|
+
copyRecursiveSync(rulesSrc, targetRules);
|
|
314
|
+
console.log(` ${GREEN}✔${RESET} Installed entire rules library`);
|
|
315
|
+
|
|
316
|
+
// All Plugins
|
|
317
|
+
copyRecursiveSync(pluginsSrc, targetPlugins);
|
|
318
|
+
console.log(` ${GREEN}✔${RESET} Installed all modular plugins`);
|
|
319
|
+
|
|
320
|
+
// All Hooks
|
|
321
|
+
copyRecursiveSync(hooksSrc, path.join(targetDir, 'hooks'));
|
|
322
|
+
console.log(` ${GREEN}✔${RESET} Installed full lifecycle hooks suite`);
|
|
323
|
+
|
|
324
|
+
// MCP Config Example
|
|
325
|
+
const mcpExample = path.join(REPO_ROOT, 'mcp', 'mcp_config.example.json');
|
|
326
|
+
if (fs.existsSync(mcpExample)) {
|
|
327
|
+
fs.copyFileSync(mcpExample, path.join(targetDir, 'mcp_config.json'));
|
|
328
|
+
console.log(` ${GREEN}✔${RESET} Installed mcp_config.json`);
|
|
329
|
+
}
|
|
330
|
+
}
|
|
331
|
+
|
|
332
|
+
// Create or Merge Master hooks.json in targetDir
|
|
333
|
+
const masterHooks = {
|
|
334
|
+
"safety-shield": {
|
|
335
|
+
"PreToolUse": [
|
|
336
|
+
{
|
|
337
|
+
"matcher": "run_command",
|
|
338
|
+
"hooks": [
|
|
339
|
+
{
|
|
340
|
+
"type": "command",
|
|
341
|
+
"command": "bash ./hooks/safety-shield/scripts/safety-gate.sh",
|
|
342
|
+
"timeout": 15
|
|
343
|
+
}
|
|
344
|
+
]
|
|
345
|
+
}
|
|
346
|
+
]
|
|
347
|
+
}
|
|
348
|
+
};
|
|
349
|
+
fs.writeFileSync(path.join(targetDir, 'hooks.json'), JSON.stringify(masterHooks, null, 2));
|
|
350
|
+
console.log(` ${GREEN}✔${RESET} Generated master hooks.json`);
|
|
351
|
+
|
|
352
|
+
console.log(`\n${GREEN}${BOLD}🎉 Installation complete! Everything Gemini is active.${RESET}\n`);
|
|
353
|
+
}
|
|
354
|
+
|
|
355
|
+
function runValidate() {
|
|
356
|
+
printBanner();
|
|
357
|
+
console.log(`${BOLD}🧪 Validating everything-gemini components...${RESET}\n`);
|
|
358
|
+
try {
|
|
359
|
+
const validateScript = path.join(REPO_ROOT, 'scripts', 'validate.sh');
|
|
360
|
+
execSync(`bash "${validateScript}"`, { stdio: 'inherit' });
|
|
361
|
+
} catch (err) {
|
|
362
|
+
console.error(`\n${RED}Validation failed.${RESET}`);
|
|
363
|
+
process.exit(1);
|
|
364
|
+
}
|
|
365
|
+
}
|
|
366
|
+
|
|
367
|
+
function scaffoldSkill(name) {
|
|
368
|
+
if (!name) {
|
|
369
|
+
console.error(`${RED}Error: Skill name required. Example: everything-gemini new-skill my-skill${RESET}`);
|
|
370
|
+
process.exit(1);
|
|
371
|
+
}
|
|
372
|
+
const cleanName = name.toLowerCase().replace(/[^a-z0-9-]/g, '-');
|
|
373
|
+
const targetDir = path.join(REPO_ROOT, 'skills', cleanName);
|
|
374
|
+
if (fs.existsSync(targetDir)) {
|
|
375
|
+
console.error(`${RED}Error: Skill '${cleanName}' already exists at ${targetDir}${RESET}`);
|
|
376
|
+
process.exit(1);
|
|
377
|
+
}
|
|
378
|
+
|
|
379
|
+
fs.mkdirSync(path.join(targetDir, 'references'), { recursive: true });
|
|
380
|
+
fs.mkdirSync(path.join(targetDir, 'scripts'), { recursive: true });
|
|
381
|
+
|
|
382
|
+
const titleCase = cleanName.split('-').map(s => s.charAt(0).toUpperCase() + s.slice(1)).join(' ');
|
|
383
|
+
const skillMd = `---
|
|
384
|
+
name: ${cleanName}
|
|
385
|
+
description: >-
|
|
386
|
+
Use this skill when ... (describe triggering conditions in third person).
|
|
387
|
+
---
|
|
388
|
+
|
|
389
|
+
# ${titleCase}
|
|
390
|
+
|
|
391
|
+
## Overview
|
|
392
|
+
Provide a concise overview of what this skill achieves and when it is invoked.
|
|
393
|
+
|
|
394
|
+
## Progressive Disclosure Architecture
|
|
395
|
+
- Keep this main \`SKILL.md\` focused on procedural step-by-step instructions.
|
|
396
|
+
- Put deep technical documentation and schemas in [references/spec.md](./references/spec.md).
|
|
397
|
+
- Place deterministic automation or verification scripts in [scripts/](./scripts/).
|
|
398
|
+
|
|
399
|
+
## Procedural Workflow
|
|
400
|
+
1. **Analyze Requirements**: Inspect the target environment and configuration.
|
|
401
|
+
2. **Execute Actions**: Run necessary tasks sequentially.
|
|
402
|
+
3. **Verify Outcome**: Run validation checks.
|
|
403
|
+
|
|
404
|
+
## Verification Checklist
|
|
405
|
+
- [ ] Task completed with zero side-effects
|
|
406
|
+
- [ ] Tests and linters pass cleanly
|
|
407
|
+
`;
|
|
408
|
+
|
|
409
|
+
const specMd = `# Reference Documentation for ${cleanName}
|
|
410
|
+
|
|
411
|
+
Detailed architecture, API contracts, edge cases, and background reference material.
|
|
412
|
+
`;
|
|
413
|
+
|
|
414
|
+
const helperSh = `#!/usr/bin/env bash
|
|
415
|
+
set -euo pipefail
|
|
416
|
+
|
|
417
|
+
# Helper script for ${cleanName}
|
|
418
|
+
echo "Executing ${cleanName} automated helper..."
|
|
419
|
+
`;
|
|
420
|
+
|
|
421
|
+
fs.writeFileSync(path.join(targetDir, 'SKILL.md'), skillMd);
|
|
422
|
+
fs.writeFileSync(path.join(targetDir, 'references', 'spec.md'), specMd);
|
|
423
|
+
const scriptPath = path.join(targetDir, 'scripts', 'helper.sh');
|
|
424
|
+
fs.writeFileSync(scriptPath, helperSh);
|
|
425
|
+
try { fs.chmodSync(scriptPath, 0o755); } catch (e) {}
|
|
426
|
+
|
|
427
|
+
console.log(`${GREEN}✔ Created progressive disclosure skill:${RESET} ${BOLD}${cleanName}${RESET}`);
|
|
428
|
+
console.log(` 📁 ${targetDir}`);
|
|
429
|
+
console.log(` 📄 SKILL.md (YAML frontmatter + procedural workflow)`);
|
|
430
|
+
console.log(` 📄 references/spec.md (progressive reference docs)`);
|
|
431
|
+
console.log(` 🔧 scripts/helper.sh (executable helper)\n`);
|
|
432
|
+
}
|
|
433
|
+
|
|
434
|
+
function scaffoldAgent(name) {
|
|
435
|
+
if (!name) {
|
|
436
|
+
console.error(`${RED}Error: Agent name required. Example: everything-gemini new-agent my-agent${RESET}`);
|
|
437
|
+
process.exit(1);
|
|
438
|
+
}
|
|
439
|
+
const cleanName = name.toLowerCase().replace(/[^a-z0-9-]/g, '-');
|
|
440
|
+
const targetDir = path.join(REPO_ROOT, 'agents');
|
|
441
|
+
if (!fs.existsSync(targetDir)) fs.mkdirSync(targetDir, { recursive: true });
|
|
442
|
+
const targetFile = path.join(targetDir, `${cleanName}.md`);
|
|
443
|
+
if (fs.existsSync(targetFile)) {
|
|
444
|
+
console.error(`${RED}Error: Agent '${cleanName}' already exists at ${targetFile}${RESET}`);
|
|
445
|
+
process.exit(1);
|
|
446
|
+
}
|
|
447
|
+
|
|
448
|
+
const titleCase = cleanName.split('-').map(s => s.charAt(0).toUpperCase() + s.slice(1)).join(' ');
|
|
449
|
+
const agentMd = `# Subagent: ${titleCase}
|
|
450
|
+
|
|
451
|
+
## Role & Mission
|
|
452
|
+
Describe the specific purpose and focus area of this subagent.
|
|
453
|
+
|
|
454
|
+
## Permitted Tools & Scope
|
|
455
|
+
- **Allowed Tools**: (e.g. view_file, grep_search, run_command)
|
|
456
|
+
- **Restricted Tools**: (e.g. no destructive file overwrites or network calls)
|
|
457
|
+
|
|
458
|
+
## Operating Principles
|
|
459
|
+
1. **Surgical Precision**: Focus exclusively on the delegated objective.
|
|
460
|
+
2. **Context Efficiency**: Keep intermediate reasoning concise and return structured findings.
|
|
461
|
+
3. **Deterministic Verification**: Verify all claims with code evidence before reporting.
|
|
462
|
+
|
|
463
|
+
## Handoff & Synthesis
|
|
464
|
+
Return structured report to parent agent:
|
|
465
|
+
- **Findings / Actions Taken**:
|
|
466
|
+
- **Modified Files**:
|
|
467
|
+
- **Open Questions / Recommended Next Steps**:
|
|
468
|
+
`;
|
|
469
|
+
|
|
470
|
+
fs.writeFileSync(targetFile, agentMd);
|
|
471
|
+
console.log(`${GREEN}✔ Created subagent profile:${RESET} ${BOLD}${cleanName}${RESET}`);
|
|
472
|
+
console.log(` 📄 ${targetFile}\n`);
|
|
473
|
+
}
|
|
474
|
+
|
|
475
|
+
// CLI Argument Parsing
|
|
476
|
+
const args = process.argv.slice(2);
|
|
477
|
+
const command = args[0] || 'help';
|
|
478
|
+
|
|
479
|
+
switch (command) {
|
|
480
|
+
case 'doctor':
|
|
481
|
+
runDoctor();
|
|
482
|
+
break;
|
|
483
|
+
case 'list':
|
|
484
|
+
listComponents();
|
|
485
|
+
break;
|
|
486
|
+
case 'new-skill':
|
|
487
|
+
scaffoldSkill(args[1]);
|
|
488
|
+
break;
|
|
489
|
+
case 'new-agent':
|
|
490
|
+
scaffoldAgent(args[1]);
|
|
491
|
+
break;
|
|
492
|
+
case 'install': {
|
|
493
|
+
let profile = 'developer';
|
|
494
|
+
let isGlobal = false;
|
|
495
|
+
let customTarget = null;
|
|
496
|
+
for (let i = 1; i < args.length; i++) {
|
|
497
|
+
if (args[i] === '--profile' && args[i + 1]) profile = args[++i];
|
|
498
|
+
else if (args[i] === '--global') isGlobal = true;
|
|
499
|
+
else if (args[i] === '--workspace' && args[i + 1]) customTarget = args[++i];
|
|
500
|
+
}
|
|
501
|
+
installProfile(profile, isGlobal, customTarget);
|
|
502
|
+
break;
|
|
503
|
+
}
|
|
504
|
+
case 'validate':
|
|
505
|
+
runValidate();
|
|
506
|
+
break;
|
|
507
|
+
case 'help':
|
|
508
|
+
case '--help':
|
|
509
|
+
case '-h':
|
|
510
|
+
default:
|
|
511
|
+
printHelp();
|
|
512
|
+
break;
|
|
513
|
+
}
|
|
514
|
+
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
# The Cortex Execution Loop & Reactive Wakeup
|
|
2
|
+
|
|
3
|
+
At the core of Google Antigravity is **Cortex**, an asynchronous, event-driven agent runtime designed to eliminate busy-waiting, minimize token latency, and reliably coordinate tools and subagents.
|
|
4
|
+
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
## 1. Traditional Agents vs. Antigravity Cortex
|
|
8
|
+
|
|
9
|
+
```
|
|
10
|
+
[Traditional Agent Loop]
|
|
11
|
+
Prompt -> Model -> Tool Call -> Busy-Poll / Sleep Loop -> Read stdout -> Model (Repeats)
|
|
12
|
+
Problem: Burns CPU cycles, wastes tokens on polling messages, times out easily.
|
|
13
|
+
|
|
14
|
+
[Antigravity Cortex Loop]
|
|
15
|
+
Prompt -> Model -> Tool Call Launched (Async) -> Cortex Suspends Turn
|
|
16
|
+
^ |
|
|
17
|
+
|=== Wakeup Event (Process Finished / Timer) ==|
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
In Antigravity:
|
|
21
|
+
1. **Async by Default**: Tools such as `run_command` or background tasks return immediately if long-running.
|
|
22
|
+
2. **Reactive Wakeup**: When a background process terminates or writes output, or when a scheduled timer fires, the system automatically resumes the agent turn with the complete message payload.
|
|
23
|
+
3. **Zero Polling**: Agents are instructed never to run loops or poll status endpoints.
|
|
24
|
+
|
|
25
|
+
---
|
|
26
|
+
|
|
27
|
+
## 2. The Five Lifecycle Hook Stages
|
|
28
|
+
|
|
29
|
+
Cortex exposes five deterministic interception points for custom code:
|
|
30
|
+
|
|
31
|
+
```mermaid
|
|
32
|
+
sequenceDiagram
|
|
33
|
+
autonumber
|
|
34
|
+
participant U as User / Turn
|
|
35
|
+
participant PreI as PreInvocation Hook
|
|
36
|
+
participant M as Gemini Model
|
|
37
|
+
participant PostI as PostInvocation Hook
|
|
38
|
+
participant PreT as PreToolUse Hook
|
|
39
|
+
participant Tool as Tool / Sandbox
|
|
40
|
+
participant PostT as PostToolUse Hook
|
|
41
|
+
participant S as Stop Hook
|
|
42
|
+
|
|
43
|
+
U->>PreI: Turn Triggered
|
|
44
|
+
PreI-->>M: Context Injected (ephemeralMessage)
|
|
45
|
+
M->>PostI: Model Generates Actions / Text
|
|
46
|
+
PostI-->>M: Continue or Terminate?
|
|
47
|
+
alt Tool Called
|
|
48
|
+
M->>PreT: Inspect Tool Call
|
|
49
|
+
PreT-->>Tool: Allow / Deny / Ask / Overwrite
|
|
50
|
+
Tool->>PostT: Output / Error
|
|
51
|
+
PostT-->>M: Clean up / Lint
|
|
52
|
+
end
|
|
53
|
+
M->>S: Model Decides to Stop
|
|
54
|
+
S-->>U: Verify Goal (Allow Stop or Continue)
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
Each stage communicates over standard `stdin` and `stdout` using protojson camelCase structures.
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
# Memory & Context Architecture
|
|
2
|
+
|
|
3
|
+
Antigravity employs a three-tier memory model to balance long-term project recall, immediate trajectory history, and structured user-facing reporting:
|
|
4
|
+
|
|
5
|
+
```
|
|
6
|
+
+---------------------------------------------------------------------------------+
|
|
7
|
+
| ANTIGRAVITY MEMORY |
|
|
8
|
+
+--------------------------+------------------------------+-----------------------+
|
|
9
|
+
| 1. Knowledge Items (KI) | 2. Dual Transcripts | 3. Brain Artifacts |
|
|
10
|
+
| (Persistent Architecture)| (Execution Trajectory) | (Structured Output) |
|
|
11
|
+
+--------------------------+------------------------------+-----------------------+
|
|
12
|
+
| - Stored in | - transcript.jsonl (Compact) | - Markdown files in |
|
|
13
|
+
| <appDataDir>/knowledge | - transcript_full.jsonl | <appDataDir>/brain/ |
|
|
14
|
+
| - metadata.json + | (Untruncated) | - Alerts, Mermaid, |
|
|
15
|
+
| artifacts/ | - Keyed by Conversation ID | Tables, Carousels, |
|
|
16
|
+
| - Checked before | - Token-efficient recall | Live Diff blocks |
|
|
17
|
+
| research | | |
|
|
18
|
+
+--------------------------+------------------------------+-----------------------+
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
---
|
|
22
|
+
|
|
23
|
+
## 1. Knowledge Items (KI)
|
|
24
|
+
|
|
25
|
+
**Knowledge Items** capture curated, localized context about specific repositories.
|
|
26
|
+
- **Location**: `<appDataDir>/knowledge/<ki-id>/`
|
|
27
|
+
- **Contents**:
|
|
28
|
+
- `metadata.json`: Summary, timestamps, and references to original source files.
|
|
29
|
+
- `artifacts/`: Related architecture blueprints, setup instructions, and known bug gotchas.
|
|
30
|
+
- **Mandatory Agent Rule**: Antigravity agents check KI summaries *before* performing redundant codebase research.
|
|
31
|
+
|
|
32
|
+
---
|
|
33
|
+
|
|
34
|
+
## 2. Dual Transcripts
|
|
35
|
+
|
|
36
|
+
Every Antigravity conversation produces two parallel chronological logs in JSON Lines (`.jsonl`) format under `<appDataDir>/brain/<conversation-id>/.system_generated/logs`:
|
|
37
|
+
|
|
38
|
+
1. **`transcript.jsonl`**: Token-efficient version where very large outputs (such as massive grep results or lengthy terminal logs) are truncated. Ideal for rapid history search and recalling earlier steps.
|
|
39
|
+
2. **`transcript_full.jsonl`**: The untruncated record containing verbatim outputs for deep debugging.
|
|
40
|
+
|
|
41
|
+
---
|
|
42
|
+
|
|
43
|
+
## 3. Brain Artifacts
|
|
44
|
+
|
|
45
|
+
Rather than flooding the user chat with 500-line code blocks or raw terminal dumps, Antigravity renders **Artifacts** stored in `<appDataDir>/brain/<conversation-id>/`:
|
|
46
|
+
- **Alert Callouts**: `> [!NOTE]`, `> [!TIP]`, `> [!IMPORTANT]`, `> [!WARNING]`, `> [!CAUTION]`.
|
|
47
|
+
- **Mermaid Diagrams**: System architectures, sequence diagrams, and class structures.
|
|
48
|
+
- **Diff Blocks**: Clean visual before/after changes.
|
|
49
|
+
- **Carousels**: Four-backtick (````carousel ... ````) interactive slides.
|
|
50
|
+
- **Media Embeds**: Embedded WebP recordings from `browser_subagent` and image assets (``).
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
# Progressive Disclosure in Antigravity
|
|
2
|
+
|
|
3
|
+
One of the greatest bottlenecks in modern agentic coding is **prompt bloat**. When an agent harness attempts to inject 50 different rules, 30 different stack guides, and full documentation on every single turn, it degrades the model's instruction-following accuracy and consumes tens of thousands of tokens per turn.
|
|
4
|
+
|
|
5
|
+
Antigravity solves this with **Progressive Disclosure**.
|
|
6
|
+
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
## 1. How Progressive Disclosure Works
|
|
10
|
+
|
|
11
|
+
Instead of injecting entire skill files (`SKILL.md`) into the system prompt:
|
|
12
|
+
1. **Metadata-Only Injection**: Only the `name` and `description` from the YAML frontmatter are provided to the model in the system prompt.
|
|
13
|
+
2. **Intent Recognition**: When a user's prompt or subtask matches a skill's description, the model proactively reads the complete `SKILL.md` using `view_file`.
|
|
14
|
+
3. **Subdocument Linking**: Inside `SKILL.md`, bulky references are stored in `references/` or `examples/`, which are only fetched if specific edge-case guidance is required.
|
|
15
|
+
|
|
16
|
+
---
|
|
17
|
+
|
|
18
|
+
## 2. Comparative Token Consumption
|
|
19
|
+
|
|
20
|
+
```
|
|
21
|
+
+------------------------------------+--------------------------+
|
|
22
|
+
| Harness Strategy | Baseline Prompt Overhead |
|
|
23
|
+
+------------------------------------+--------------------------+
|
|
24
|
+
| Monolithic Prompts (e.g. naive) | ~48,000 tokens / turn |
|
|
25
|
+
| eagy Progressive Disclosure | ~3,200 tokens / turn |
|
|
26
|
+
+------------------------------------+--------------------------+
|
|
27
|
+
| Net Token Savings | 85% - 93% |
|
|
28
|
+
+------------------------------------+--------------------------+
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
---
|
|
32
|
+
|
|
33
|
+
## 3. Best Practices for Writing Skills
|
|
34
|
+
|
|
35
|
+
1. **Third-Person Triggers**: Write descriptions in third-person stating *what* the skill does and *when* to invoke it:
|
|
36
|
+
```yaml
|
|
37
|
+
description: >-
|
|
38
|
+
Enforces strict Test-Driven Development (Red-Green-Refactor). Use this skill when the user asks to implement a new feature, fix a bug, or refactor logic using TDD.
|
|
39
|
+
```
|
|
40
|
+
2. **Lean Instructions**: Keep the root `SKILL.md` concise (< 200 lines).
|
|
41
|
+
3. **Move Bulky Tables to `references/`**: Link them via standard Markdown links (`[patterns.md](./references/patterns.md)`).
|