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.
Files changed (96) hide show
  1. package/.agents/hooks.json +16 -0
  2. package/.agents/rules/everything-gemini-dev.md +5 -0
  3. package/.agents/rules/instincts.md +8 -0
  4. package/.agents/skills/everything-gemini-maintainer/SKILL.md +22 -0
  5. package/.github/ISSUE_TEMPLATE/skill_proposal.md +24 -0
  6. package/.github/pull_request_template.md +9 -0
  7. package/.github/workflows/ci.yml +35 -0
  8. package/AGENTS.md +15 -0
  9. package/CONTRIBUTING.md +114 -0
  10. package/GEMINI.md +15 -0
  11. package/LICENSE +176 -0
  12. package/README.md +310 -2
  13. package/agents/architect.md +21 -0
  14. package/agents/browser-qa.md +26 -0
  15. package/agents/build-repair.md +20 -0
  16. package/agents/code-reviewer.md +22 -0
  17. package/agents/planner.md +21 -0
  18. package/agents/security-auditor.md +21 -0
  19. package/bin/everything-gemini +514 -0
  20. package/docs/architecture/cortex-loop.md +57 -0
  21. package/docs/architecture/memory-and-context.md +50 -0
  22. package/docs/architecture/progressive-disclosure.md +41 -0
  23. package/docs/customization/hooks-reference.md +78 -0
  24. package/docs/ecc-vs-everything-gemini.md +59 -0
  25. package/docs/surfaces/cli.md +46 -0
  26. package/docs/surfaces/desktop-2.0.md +30 -0
  27. package/docs/surfaces/ide.md +29 -0
  28. package/docs/surfaces/python-sdk.md +53 -0
  29. package/docs/workflows/slash-commands.md +27 -0
  30. package/hooks/auto-lint-formatter/hooks.json +16 -0
  31. package/hooks/auto-lint-formatter/scripts/auto-format.sh +48 -0
  32. package/hooks/ephemeral-context/hooks.json +11 -0
  33. package/hooks/ephemeral-context/scripts/inject-context.sh +8 -0
  34. package/hooks/gemini-shield/hooks.json +16 -0
  35. package/hooks/gemini-shield/scripts/shield-gate.sh +72 -0
  36. package/hooks/goal-verifier/hooks.json +11 -0
  37. package/hooks/goal-verifier/scripts/verify-goal.sh +26 -0
  38. package/hooks/learned-instincts/hooks.json +11 -0
  39. package/hooks/learned-instincts/scripts/save-instinct.sh +23 -0
  40. package/hooks/safety-shield/hooks.json +16 -0
  41. package/hooks/safety-shield/scripts/safety-gate.sh +64 -0
  42. package/mcp/README.md +41 -0
  43. package/mcp/mcp_config.example.json +30 -0
  44. package/package.json +39 -4
  45. package/plugins/core/hooks.json +16 -0
  46. package/plugins/core/plugin.json +3 -0
  47. package/plugins/core/rules/core-practices.md +5 -0
  48. package/plugins/python-ai/plugin.json +3 -0
  49. package/plugins/python-ai/rules/ai-agent-patterns.md +5 -0
  50. package/plugins/python-ai/skills/antigravity-sdk-orchestrator/SKILL.md +54 -0
  51. package/plugins/security-shield/hooks.json +16 -0
  52. package/plugins/security-shield/plugin.json +3 -0
  53. package/plugins/security-shield/rules/zero-trust.md +5 -0
  54. package/plugins/web-fullstack/plugin.json +3 -0
  55. package/plugins/web-fullstack/rules/frontend-standards.md +5 -0
  56. package/plugins/web-fullstack/skills/responsive-design/SKILL.md +23 -0
  57. package/rules/common/AGENTS.md +30 -0
  58. package/rules/common/GEMINI.md +30 -0
  59. package/rules/languages/golang.md +10 -0
  60. package/rules/languages/python.md +16 -0
  61. package/rules/languages/typescript.md +18 -0
  62. package/rules/paradigms/security-hardened.md +17 -0
  63. package/rules/paradigms/tdd.md +19 -0
  64. package/scripts/install.ps1 +26 -0
  65. package/scripts/install.sh +52 -0
  66. package/scripts/validate.sh +73 -0
  67. package/skills/api-craftsman/SKILL.md +45 -0
  68. package/skills/api-craftsman/examples/openapi-spec.yaml +37 -0
  69. package/skills/architecture-designer/SKILL.md +33 -0
  70. package/skills/architecture-designer/examples/c4-architecture.md +33 -0
  71. package/skills/browser-qa-tester/SKILL.md +43 -0
  72. package/skills/browser-qa-tester/references/browser-recipes.md +21 -0
  73. package/skills/context-caching/SKILL.md +48 -0
  74. package/skills/continuous-learning/SKILL.md +31 -0
  75. package/skills/database-architect/SKILL.md +26 -0
  76. package/skills/database-architect/references/migration-checklist.md +9 -0
  77. package/skills/devops-pipeline/SKILL.md +23 -0
  78. package/skills/devops-pipeline/templates/github-ci.yml +31 -0
  79. package/skills/fullstack-nextjs/SKILL.md +27 -0
  80. package/skills/fullstack-nextjs/references/app-router-patterns.md +46 -0
  81. package/skills/gemini-multimodal/SKILL.md +43 -0
  82. package/skills/git-craftsman/SKILL.md +43 -0
  83. package/skills/performance-profiler/SKILL.md +35 -0
  84. package/skills/performance-profiler/scripts/profile-node.sh +13 -0
  85. package/skills/repo-onboarding/SKILL.md +35 -0
  86. package/skills/repo-onboarding/references/knowledge-item-schema.md +30 -0
  87. package/skills/root-cause-debugger/SKILL.md +35 -0
  88. package/skills/root-cause-debugger/scripts/git-bisect-helper.sh +13 -0
  89. package/skills/security-audit/SKILL.md +29 -0
  90. package/skills/security-audit/scripts/scan-secrets.sh +26 -0
  91. package/skills/subagent-handoff/SKILL.md +28 -0
  92. package/skills/subagent-handoff/references/handoff-patterns.md +30 -0
  93. package/skills/tdd-workflow/SKILL.md +40 -0
  94. package/skills/tdd-workflow/references/tdd-patterns.md +23 -0
  95. package/templates/minimal/GEMINI.md +5 -0
  96. package/templates/minimal/hooks.json +16 -0
@@ -0,0 +1,78 @@
1
+ # Lifecycle Hooks Reference (`hooks.json`)
2
+
3
+ Lifecycle hooks allow executing external shell commands at deterministic interception points during Antigravity's agent execution loop.
4
+
5
+ ---
6
+
7
+ ## 1. Schema & Common Contract
8
+
9
+ All hook payloads sent to `stdin` contain common metadata in camelCase format:
10
+ ```json
11
+ {
12
+ "conversationId": "950f349d-7f23-47e6-ba8f-41603dd7d295",
13
+ "workspacePaths": ["/Users/project"],
14
+ "transcriptPath": "/Users/project/.gemini/antigravity/transcript.jsonl",
15
+ "artifactDirectoryPath": "/Users/project/.gemini/antigravity/artifacts",
16
+ "modelName": "auto"
17
+ }
18
+ ```
19
+
20
+ ---
21
+
22
+ ## 2. Event Contracts
23
+
24
+ ### A. `PreToolUse`
25
+ Fires immediately before a tool runs. Used for safety gating, parameter overwriting, or policy enforcement.
26
+ - **Payload (`stdin`)**: Includes `toolCall: { name, args }` and `stepIdx`.
27
+ - **Response (`stdout`)**:
28
+ ```json
29
+ {
30
+ "decision": "allow | deny | ask | force_ask",
31
+ "reason": "Detailed explanation if denied or asking user",
32
+ "overwrite": {
33
+ "CommandLine": "safe command"
34
+ }
35
+ }
36
+ ```
37
+
38
+ ### B. `PostToolUse`
39
+ Fires after a tool step completes. Used for cleanup, logging, or auto-formatting.
40
+ - **Payload (`stdin`)**: Includes `stepIdx`, `error` (if tool failed), plus common fields.
41
+ - **Response (`stdout`)**: Expects an empty JSON object: `{}`.
42
+
43
+ ### C. `PreInvocation`
44
+ Fires before the model is called. Used to inject ephemeral warnings or dynamic context.
45
+ - **Payload (`stdin`)**: Includes `invocationNum`, `initialNumSteps`, plus common fields.
46
+ - **Response (`stdout`)**:
47
+ ```json
48
+ {
49
+ "injectSteps": [
50
+ {
51
+ "ephemeralMessage": "Transient warning: Ensure all unit tests pass before finishing."
52
+ }
53
+ ]
54
+ }
55
+ ```
56
+
57
+ ### D. `PostInvocation`
58
+ Fires after the model produces output and tool calls.
59
+ - **Payload (`stdin`)**: Includes `invocationNum`, plus common fields.
60
+ - **Response (`stdout`)**:
61
+ ```json
62
+ {
63
+ "injectSteps": [],
64
+ "terminationBehavior": "force_continue | terminate | \"\""
65
+ }
66
+ ```
67
+
68
+ ### E. `Stop`
69
+ Fires when the agent's execution loop attempts to terminate. Used to verify goals.
70
+ - **Payload (`stdin`)**: Includes `executionNum`, `terminationReason`, `fullyIdle`, `error`.
71
+ - **Response (`stdout`)**:
72
+ ```json
73
+ {
74
+ "decision": "continue",
75
+ "reason": "Tests are still failing. Fix them before finishing."
76
+ }
77
+ ```
78
+ *(Return `{}` to allow the agent to stop).*
@@ -0,0 +1,59 @@
1
+ # Everything Claude Code (ECC) vs. Everything Gemini (`everything-gemini`)
2
+
3
+ An objective architectural comparison between **Everything Claude Code (ECC)** by Affan Mustafa and **Everything Gemini (`everything-gemini`)** native-built for Google Antigravity & Gemini.
4
+
5
+ ---
6
+
7
+ ## 🎯 Executive Summary
8
+
9
+ While ECC provided an outstanding template for structuring agent instructions in Claude Code, **`everything-gemini`** represents an architectural evolution designed specifically for Google Antigravity's multi-surface platform and Gemini's state-of-the-art frontier capabilities:
10
+
11
+ 1. **Massive Context Economics**: Gemini’s 1M-2M token context window paired with native Prefix Context Caching offers an order of magnitude higher repository capacity at a fraction of the cost.
12
+ 2. **Native Multimodality**: Direct visual reasoning over UI mockups, architecture whiteboard diagrams, and automated WebP browser recordings.
13
+ 3. **Four Unified Surfaces**: Works seamlessly across Desktop 2.0, Antigravity IDE (VS Code-based), `agy` CLI, and the Antigravity Python SDK.
14
+ 4. **Deterministic Lifecycle Safety**: Built-in `PreToolUse` security gates (GeminiShield) that prevent catastrophic filesystem and database accidents before execution.
15
+
16
+ ---
17
+
18
+ ## 📊 Feature Comparison Matrix
19
+
20
+ | Architectural Dimension | Everything Claude Code (ECC) | Everything Gemini (`everything-gemini`) | Architectural Advantage |
21
+ | :--- | :--- | :--- | :--- |
22
+ | **Foundational Model** | Claude 3.5 Sonnet / Opus | **Gemini 3.8 / 1.5 Flash & Pro** | Native multimodal reasoning, faster TTFT, massive context |
23
+ | **Context Window** | 200,000 tokens | **1,000,000 – 2,000,000+ tokens** | Ingest complete enterprise monorepos without lossy truncation |
24
+ | **Context Caching** | Ephemeral prompt caching | **Native Explicit & Implicit Prefix Caching** | ~75% cost reduction on repeated repository index lookups |
25
+ | **Visual Reasoning** | Terminal-only / text output | **Autonomous Browser Subagent + WebP Video** | Interactive E2E QA testing, DOM inspection, visual regressions |
26
+ | **Multi-Surface Runtime** | CLI only | **4 Surfaces (Desktop 2.0, IDE, CLI, Python SDK)** | Seamless workflow whether in visual IDE or headless pipelines |
27
+ | **Memory System** | Static text instructions | **Adaptive Learned Instincts + Knowledge Items (KI)** | Dynamic cross-session memory that records corrections |
28
+ | **Subagent Delegation** | Manual sub-prompts | **Scoped Subagent Fleet (`agents/`) + Handoff Protocol** | Formal boundaries for Architect, Reviewer, QA, Repair agents |
29
+ | **Safety Guardrails** | Advisory prompt rules | **Deterministic Shell & Command Hook Gates** | Hard blocks on `rm -rf`, raw DROP statements, and API leaks |
30
+ | **Packaging & Distribution** | Git clone / copy paste | **Zero-Dependency CLI (`everything-gemini install`)** | Presets for `core`, `developer`, and `full` workspaces |
31
+
32
+ ---
33
+
34
+ ## 🧠 Architectural Deep Dive
35
+
36
+ ### 1. Progressive Disclosure vs. Context Bloat
37
+ In standard agent setups, loading hundreds of lines of instructions into every conversational turn consumes up to 30% of the active reasoning window.
38
+
39
+ `everything-gemini` strictly implements **Progressive Disclosure**:
40
+ - The agent only sees lightweight skill metadata (name + description) in its initial prompt.
41
+ - High-depth procedural playbooks (`SKILL.md`) and technical manuals (`references/`) are pulled into context **only when triggered by the user's intent**.
42
+
43
+ ### 2. Multi-Agent Scoped Orchestration
44
+ Rather than relying on a single monolithic agent persona, `everything-gemini` provides specialized subagent specifications:
45
+ - **`agents/planner.md`**: Strategic exploration and phased execution roadmaps.
46
+ - **`agents/code-reviewer.md`**: Strict non-destructive code review and type auditing.
47
+ - **`agents/build-repair.md`**: Automated test and build failure triage.
48
+ - **`agents/browser-qa.md`**: Autonomous browser subagent driving visual assertions.
49
+ - **`agents/security-auditor.md`**: Adversarial credential scanning and injection prevention.
50
+ - **`agents/architect.md`**: C4 architecture diagrams and ADR formulation.
51
+
52
+ ### 3. Continuous Learning Engine
53
+ With the **Learned Instincts** hook suite (`hooks/learned-instincts/`), the system listens to user feedback and session outcomes. Lessons learned are codified into `.agents/rules/instincts.md`, ensuring that mistakes are never repeated in future sessions.
54
+
55
+ ---
56
+
57
+ ## 🚀 Conclusion
58
+
59
+ `everything-gemini` takes the inspirational vision of agent harness engineering and elevates it to production-grade enterprise readiness, championing **Gemini** as the premier coding intelligence engine.
@@ -0,0 +1,46 @@
1
+ # Antigravity CLI (`agy`) Reference
2
+
3
+ The Antigravity CLI (`agy`) is the high-performance, terminal-based interface designed for keyboard-driven workflows, headless CI/CD automation, and fast local prototyping.
4
+
5
+ ---
6
+
7
+ ## 1. Getting Started
8
+
9
+ - **Launch Interactive TUI**:
10
+ ```bash
11
+ agy
12
+ ```
13
+ - **Run Headless Non-Interactive Task**:
14
+ ```bash
15
+ agy -p "Run tests and fix all lint errors"
16
+ ```
17
+ - **Exit CLI**: `Ctrl+D Ctrl+D` or type `/exit`.
18
+
19
+ ---
20
+
21
+ ## 2. CLI Flags & Subcommands
22
+
23
+ ```text
24
+ Usage: agy [options] [prompt]
25
+
26
+ Options:
27
+ -p, --prompt <string> Execute prompt in headless mode and exit
28
+ --model <string> Select Gemini model (e.g. gemini-3.8-flash, gemini-3.5-pro)
29
+ --sandbox Run terminal commands inside isolated container
30
+ --strict Strict permission policy (ask before every tool call)
31
+ --version Show CLI version
32
+ -h, --help Show help
33
+ ```
34
+
35
+ ---
36
+
37
+ ## 3. Configuration
38
+
39
+ Configured via `~/.gemini/antigravity-cli/settings.json`:
40
+ ```json
41
+ {
42
+ "model": "auto",
43
+ "toolExecutionPolicy": "request-review",
44
+ "notifications": true
45
+ }
46
+ ```
@@ -0,0 +1,30 @@
1
+ # Antigravity 2.0 (Desktop Application) Guide
2
+
3
+ Antigravity 2.0 is the standalone desktop Electron application providing a complete, IDE-independent command center for agent orchestration.
4
+
5
+ ---
6
+
7
+ ## 1. Unified Interface Surfaces
8
+
9
+ ### Left-Hand Navigation
10
+ - **New Conversation**: Starts a fresh agent thread with isolated context.
11
+ - **Projects**: Switch between different workspace directories. Project-level settings take precedence over global defaults.
12
+ - **Scheduled Tasks**: Manage recurring background tasks (cron expressions) and delayed timers.
13
+ - **Skills & Customizations**: View active skills, rules, plugins, and MCP servers.
14
+ - **Settings**: Global configuration for models, sandbox permissions, and tool policies.
15
+
16
+ ### Chat Canvas
17
+ - **Slash Commands (`/`)**: Type `/` to invoke `/goal`, `/plan`, `/grill-me`, `/learn`, or `/schedule`.
18
+ - **`@` Mentions**: Attach context directly to messages:
19
+ - `@files` and `@folders`
20
+ - `@conversations` (previous chats)
21
+ - `@terminals` (active terminal buffers)
22
+ - `@rules` and `@mcp` tools
23
+ - **Media Uploads**: Drag-and-drop screenshots or architecture diagrams directly into the canvas.
24
+
25
+ ### Auxiliary Panes
26
+ - **Subagents**: Real-time status of running subagents (e.g. `browser_subagent`).
27
+ - **Background Tasks**: Live logs and outputs of background commands and test runners.
28
+ - **Artifacts**: Dedicated viewer for rendered Markdown artifacts, Mermaid diagrams, and WebP session recordings.
29
+ - **Files Changed**: Git-style diff viewer of files modified during the conversation.
30
+ - **Terminals**: Interactive shell tabs running alongside the agent.
@@ -0,0 +1,29 @@
1
+ # Antigravity IDE Reference
2
+
3
+ Antigravity IDE is an AI-first integrated development environment built on top of VS Code, embedding agentic pair programming directly into the code editor.
4
+
5
+ ---
6
+
7
+ ## 1. Core AI Modalities
8
+
9
+ ### A. Passive: Antigravity Tab (Autocomplete & Supercomplete)
10
+ - **Next-Intent Prediction**: Predicts your next keystroke, multi-line diff, or import statement.
11
+ - **Tab to Jump**: Anticipates your next navigation point across the file and jumps there upon pressing `Tab`.
12
+ - **Tab to Import**: Automatically resolves and inserts missing imports when new symbols are used.
13
+ - **Supercomplete**: Suggests larger structural diffs (including refactorings and deletions) in floating inline windows.
14
+
15
+ ### B. Instructive: Inline Command (`Cmd+I` / `Ctrl+I`)
16
+ - Highlight any code block and press `Cmd+I` (macOS) or `Ctrl+I` (Linux/Windows) to refactor, explain, or optimize.
17
+ - Run without a selection to generate net-new code at the cursor.
18
+
19
+ ### C. Collaborative: Sidebar Chat & Agent Mode
20
+ - Launch multi-step agent workflows capable of file navigation, terminal execution, and browser testing.
21
+ - Automatically reads workspace-scoped configurations from `.agents/`.
22
+
23
+ ---
24
+
25
+ ## 2. Editor UI Integrations
26
+
27
+ - **Inline Code Lenses**: Buttons directly above function declarations for quick actions: `Refactor`, `Write Tests`, `Explain Code`.
28
+ - **Visual Diff Overlays**: In-editor red/green diff gutters allowing one-click review and acceptance.
29
+ - **Diagnostic Auto-Fix**: Triggers the agent directly from inline compiler or linter errors to apply instant fixes.
@@ -0,0 +1,53 @@
1
+ # Antigravity Python SDK Reference
2
+
3
+ The public Python SDK allows developers to embed Antigravity agents programmatically into Python scripts, backend pipelines, and automated test runners.
4
+
5
+ - **PyPI Package**: `google-antigravity`
6
+ - **GitHub Repository**: [google-antigravity/antigravity-sdk-python](https://github.com/google-antigravity/antigravity-sdk-python)
7
+
8
+ ---
9
+
10
+ ## 1. Installation
11
+
12
+ ```bash
13
+ pip install google-antigravity
14
+ ```
15
+
16
+ ---
17
+
18
+ ## 2. Core Concepts
19
+
20
+ ### Async Context Management
21
+ Agents are managed via `async with Agent(config) as agent:` which guarantees binary discovery, tool lifecycle orchestration, and process cleanup.
22
+
23
+ ### Streaming Reasoning Thoughts & Tools
24
+ ```python
25
+ import asyncio
26
+ import sys
27
+ from google.antigravity import Agent, LocalAgentConfig, CapabilitiesConfig
28
+
29
+ async def main():
30
+ config = LocalAgentConfig(
31
+ system_instructions="You are an autonomous code auditor.",
32
+ capabilities=CapabilitiesConfig()
33
+ )
34
+
35
+ async with Agent(config) as agent:
36
+ response = await agent.chat("Review the auth flow in src/auth.ts")
37
+
38
+ # Stream reasoning thoughts
39
+ async for thought in response.thoughts:
40
+ print(f"[Reasoning] {thought}")
41
+
42
+ # Stream tool calls
43
+ async for call in response.tool_calls:
44
+ print(f"[Tool] {call.name}({call.args})")
45
+
46
+ # Stream final output tokens
47
+ async for token in response:
48
+ sys.stdout.write(token)
49
+ sys.stdout.flush()
50
+
51
+ if __name__ == "__main__":
52
+ asyncio.run(main())
53
+ ```
@@ -0,0 +1,27 @@
1
+ # Antigravity Slash Commands Playbook
2
+
3
+ Slash commands in Antigravity chat trigger specialized cognitive modes, prompt routines, and subagent orchestrations.
4
+
5
+ ---
6
+
7
+ ## 1. Core Slash Commands
8
+
9
+ ### `/goal <prompt>`
10
+ - **Behavior**: Enters autonomous goal-seeking mode. The agent continues executing multi-step actions until the objective is fully verified.
11
+ - **eagy Synergy**: Combines with `hooks/goal-verifier/` to prevent premature stops if test suites or linters fail.
12
+
13
+ ### `/plan <prompt>`
14
+ - **Behavior**: Generates a comprehensive architectural plan and step-by-step implementation blueprint before touching any code.
15
+ - **eagy Synergy**: Activates the `architecture-designer` skill, automatically producing C4 Mermaid diagrams and risk analyses.
16
+
17
+ ### `/grill-me`
18
+ - **Behavior**: The agent acts as an architectural interviewer, grilling the developer on edge cases, non-functional constraints, and trade-offs before generating solutions.
19
+ - **When to Use**: Ideal when starting ambiguous features or refactoring legacy modules.
20
+
21
+ ### `/learn`
22
+ - **Behavior**: Persists lessons learned from mistakes, corrections, or complex configurations into a permanent Knowledge Item (`<appDataDir>/knowledge`).
23
+ - **eagy Synergy**: Connects with `repo-onboarding` and Knowledge Items schemas to build an enduring project memory.
24
+
25
+ ### `/schedule`
26
+ - **Behavior**: Schedules delayed one-shot timers or recurring cron jobs with reactive wakeup.
27
+ - **When to Use**: Long-running builds, server polling, health checks, or automated periodic tests.
@@ -0,0 +1,16 @@
1
+ {
2
+ "auto-lint-formatter": {
3
+ "PostToolUse": [
4
+ {
5
+ "matcher": "replace_file_content|write_to_file|multi_replace_file_content",
6
+ "hooks": [
7
+ {
8
+ "type": "command",
9
+ "command": "bash ./scripts/auto-format.sh",
10
+ "timeout": 15
11
+ }
12
+ ]
13
+ }
14
+ ]
15
+ }
16
+ }
@@ -0,0 +1,48 @@
1
+ #!/usr/bin/env bash
2
+ # eagy Auto-Lint Formatter: PostToolUse Hook
3
+ # Silently runs language-appropriate formatters on modified files.
4
+
5
+ set -eo pipefail
6
+
7
+ PAYLOAD=$(cat)
8
+
9
+ TARGET_FILE=$(node -e "
10
+ try {
11
+ const p = JSON.parse(process.argv[1]);
12
+ const file = p.toolCall?.args?.TargetFile || '';
13
+ console.log(file);
14
+ } catch (e) {
15
+ console.log('');
16
+ }
17
+ " "$PAYLOAD")
18
+
19
+ if [ -z "$TARGET_FILE" ] || [ ! -f "$TARGET_FILE" ]; then
20
+ echo "{}"
21
+ exit 0
22
+ fi
23
+
24
+ EXT="${TARGET_FILE##*.}"
25
+
26
+ case "$EXT" in
27
+ js|jsx|ts|tsx|json|md)
28
+ if command -v prettier >/dev/null 2>&1; then
29
+ prettier --write "$TARGET_FILE" >/dev/null 2>&1 || true
30
+ fi
31
+ ;;
32
+ py)
33
+ if command -v ruff >/dev/null 2>&1; then
34
+ ruff format "$TARGET_FILE" >/dev/null 2>&1 || true
35
+ elif command -v black >/dev/null 2>&1; then
36
+ black -q "$TARGET_FILE" >/dev/null 2>&1 || true
37
+ fi
38
+ ;;
39
+ go)
40
+ if command -v gofmt >/dev/null 2>&1; then
41
+ gofmt -w "$TARGET_FILE" >/dev/null 2>&1 || true
42
+ fi
43
+ ;;
44
+ esac
45
+
46
+ # PostToolUse expects an empty JSON object
47
+ echo "{}"
48
+ exit 0
@@ -0,0 +1,11 @@
1
+ {
2
+ "ephemeral-context": {
3
+ "PreInvocation": [
4
+ {
5
+ "type": "command",
6
+ "command": "bash ./scripts/inject-context.sh",
7
+ "timeout": 5
8
+ }
9
+ ]
10
+ }
11
+ }
@@ -0,0 +1,8 @@
1
+ #!/usr/bin/env bash
2
+ # eagy Ephemeral Context Injector: PreInvocation Hook
3
+ # Sends a transient reminder to the agent prior to model invocation.
4
+
5
+ set -eo pipefail
6
+
7
+ echo '{"injectSteps": [{"ephemeralMessage": "[eagy Harness Active]: Verify code with tests, follow progressive disclosure, and ensure all file links use markdown file:// scheme."}]}'
8
+ exit 0
@@ -0,0 +1,16 @@
1
+ {
2
+ "gemini-shield": {
3
+ "PreToolUse": [
4
+ {
5
+ "matcher": "run_command",
6
+ "hooks": [
7
+ {
8
+ "type": "command",
9
+ "command": "bash ./scripts/shield-gate.sh",
10
+ "timeout": 15
11
+ }
12
+ ]
13
+ }
14
+ ]
15
+ }
16
+ }
@@ -0,0 +1,72 @@
1
+ #!/usr/bin/env bash
2
+ # GeminiShield: Advanced PreToolUse Guardrail
3
+ # Inspects command line execution for catastrophic commands, secret leaks, and security violations.
4
+
5
+ set -eo pipefail
6
+
7
+ PAYLOAD=$(cat)
8
+
9
+ CMD=$(node -e "
10
+ try {
11
+ const p = JSON.parse(process.argv[1]);
12
+ const cmd = p.toolCall?.args?.CommandLine || '';
13
+ console.log(cmd);
14
+ } catch (e) {
15
+ console.log('');
16
+ }
17
+ " "$PAYLOAD")
18
+
19
+ # 1. Hard Blocked Catastrophic Patterns
20
+ BLOCKED_PATTERNS=(
21
+ "rm -rf /"
22
+ "rm -rf ~"
23
+ "rm -rf *"
24
+ ":(){ :|:& };:"
25
+ "mkfs"
26
+ "dd if="
27
+ "> /dev/sda"
28
+ "chmod -R 777 /"
29
+ "git push --force origin main"
30
+ "git push -f origin main"
31
+ "git push --force origin master"
32
+ "git push -f origin master"
33
+ "drop database"
34
+ "drop schema"
35
+ "truncate table"
36
+ )
37
+
38
+ for pattern in "${BLOCKED_PATTERNS[@]}"; do
39
+ if [[ "$CMD" == *"$pattern"* ]]; then
40
+ echo "{\"decision\": \"deny\", \"reason\": \"[GeminiShield] Execution blocked: detected catastrophic destructive command pattern '$pattern'.\"}"
41
+ exit 0
42
+ fi
43
+ done
44
+
45
+ # 2. Sensitive Patterns Requiring Explicit User Review
46
+ ASK_PATTERNS=(
47
+ "git reset --hard"
48
+ "git clean -fd"
49
+ "npm publish"
50
+ "pnpm publish"
51
+ "docker system prune"
52
+ "kubectl delete namespace"
53
+ "terraform destroy"
54
+ )
55
+
56
+ for pattern in "${ASK_PATTERNS[@]}"; do
57
+ if [[ "$CMD" == *"$pattern"* ]]; then
58
+ echo "{\"decision\": \"ask\", \"reason\": \"[GeminiShield] Sensitive administrative command requires confirmation: '$pattern'.\"}"
59
+ exit 0
60
+ fi
61
+ done
62
+
63
+ # 3. Secret Leakage Heuristic
64
+ SECRET_MATCH=$(echo "$CMD" | grep -Ei "(export\s+[A-Z0-9_]*TOKEN=[a-zA-Z0-9_\-]{20,}|export\s+[A-Z0-9_]*KEY=[a-zA-Z0-9_\-]{20,})" || true)
65
+ if [ -n "$SECRET_MATCH" ]; then
66
+ echo "{\"decision\": \"deny\", \"reason\": \"[GeminiShield] Hardcoded credential or API secret detected in command line arguments.\"}"
67
+ exit 0
68
+ fi
69
+
70
+ # Default allow
71
+ echo "{\"decision\": \"allow\"}"
72
+ exit 0
@@ -0,0 +1,11 @@
1
+ {
2
+ "goal-verifier": {
3
+ "Stop": [
4
+ {
5
+ "type": "command",
6
+ "command": "bash ./scripts/verify-goal.sh",
7
+ "timeout": 20
8
+ }
9
+ ]
10
+ }
11
+ }
@@ -0,0 +1,26 @@
1
+ #!/usr/bin/env bash
2
+ # eagy Goal Verifier: Stop Hook
3
+ # Checks if the workspace has uncommitted broken tests before allowing termination.
4
+
5
+ set -eo pipefail
6
+
7
+ PAYLOAD=$(cat)
8
+
9
+ # Inspect git status if in a git repository
10
+ if git rev-parse --is-inside-work-tree >/dev/null 2>&1; then
11
+ # Check if there are modified files
12
+ CHANGES=$(git status --porcelain)
13
+ if [ -n "$CHANGES" ]; then
14
+ # If package.json has a test script, verify tests pass
15
+ if [ -f "package.json" ] && grep -q '"test"' package.json; then
16
+ if ! npm test >/dev/null 2>&1; then
17
+ echo "{\"decision\": \"continue\", \"reason\": \"[eagy Goal Verifier] Uncommitted changes failed 'npm test'. Please resolve failing tests before stopping.\"}"
18
+ exit 0
19
+ fi
20
+ fi
21
+ fi
22
+ fi
23
+
24
+ # Allow stop
25
+ echo "{}"
26
+ exit 0
@@ -0,0 +1,11 @@
1
+ {
2
+ "learned-instincts": {
3
+ "Stop": [
4
+ {
5
+ "type": "command",
6
+ "command": "bash ./scripts/save-instinct.sh",
7
+ "timeout": 10
8
+ }
9
+ ]
10
+ }
11
+ }
@@ -0,0 +1,23 @@
1
+ #!/usr/bin/env bash
2
+ # Everything Gemini: Continuous Learning & Instinct Saver
3
+ # Captures session outcomes into .agents/rules/instincts.md
4
+
5
+ set -eo pipefail
6
+
7
+ PAYLOAD=$(cat)
8
+
9
+ TARGET_FILE=".agents/rules/instincts.md"
10
+
11
+ # If instincts file doesn't exist, initialize it
12
+ if [ ! -f "$TARGET_FILE" ]; then
13
+ mkdir -p .agents/rules
14
+ cat << 'INIT' > "$TARGET_FILE"
15
+ # Learned Repository Instincts
16
+
17
+ This file is automatically updated by Everything Gemini to retain project-specific preferences across sessions.
18
+ INIT
19
+ fi
20
+
21
+ # Post-session hook completes cleanly
22
+ echo "{}"
23
+ exit 0
@@ -0,0 +1,16 @@
1
+ {
2
+ "safety-shield": {
3
+ "PreToolUse": [
4
+ {
5
+ "matcher": "run_command",
6
+ "hooks": [
7
+ {
8
+ "type": "command",
9
+ "command": "bash ./scripts/safety-gate.sh",
10
+ "timeout": 10
11
+ }
12
+ ]
13
+ }
14
+ ]
15
+ }
16
+ }
@@ -0,0 +1,64 @@
1
+ #!/usr/bin/env bash
2
+ # eagy Safety Shield: PreToolUse Security Gate
3
+ # Reads protojson hook payload from stdin, evaluates safety, outputs JSON on stdout.
4
+
5
+ set -eo pipefail
6
+
7
+ PAYLOAD=$(cat)
8
+
9
+ # Extract CommandLine using node or python
10
+ CMD=$(node -e "
11
+ try {
12
+ const p = JSON.parse(process.argv[1]);
13
+ const cmd = p.toolCall?.args?.CommandLine || '';
14
+ console.log(cmd);
15
+ } catch (e) {
16
+ console.log('');
17
+ }
18
+ " "$PAYLOAD")
19
+
20
+ # Dangerous patterns list
21
+ BLOCKED_PATTERNS=(
22
+ "rm -rf /"
23
+ "rm -rf ~"
24
+ "rm -rf *"
25
+ ":(){ :|:& };:"
26
+ "mkfs"
27
+ "dd if="
28
+ "chmod -R 777 /"
29
+ "git push --force origin main"
30
+ "git push -f origin main"
31
+ "git push --force origin master"
32
+ "git push -f origin master"
33
+ "drop database"
34
+ "truncate table"
35
+ )
36
+
37
+ # Sensitive patterns that should ask user confirmation
38
+ ASK_PATTERNS=(
39
+ "git reset --hard"
40
+ "git clean -fd"
41
+ "npm publish"
42
+ "docker system prune -a"
43
+ "kubectl delete namespace"
44
+ )
45
+
46
+ # Check blocked patterns
47
+ for pattern in "${BLOCKED_PATTERNS[@]}"; do
48
+ if [[ "$CMD" == *"$pattern"* ]]; then
49
+ echo "{\"decision\": \"deny\", \"reason\": \"[eagy Safety Shield] Catastrophic command pattern detected and blocked: '$pattern'\"}"
50
+ exit 0
51
+ fi
52
+ done
53
+
54
+ # Check ask patterns
55
+ for pattern in "${ASK_PATTERNS[@]}"; do
56
+ if [[ "$CMD" == *"$pattern"* ]]; then
57
+ echo "{\"decision\": \"ask\", \"reason\": \"[eagy Safety Shield] Potentially destructive command requires user confirmation: '$pattern'\"}"
58
+ exit 0
59
+ fi
60
+ done
61
+
62
+ # Default allow
63
+ echo "{\"decision\": \"allow\"}"
64
+ exit 0