everything-gemini 1.1.1 → 1.8.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 (74) hide show
  1. package/.github/ISSUE_TEMPLATE/bug_report.md +29 -0
  2. package/.github/ISSUE_TEMPLATE/feature_request.md +27 -0
  3. package/.github/ISSUE_TEMPLATE/subagent_proposal.md +29 -0
  4. package/.github/workflows/ci.yml +72 -1
  5. package/.github/workflows/release.yml +17 -2
  6. package/.vscode/extensions.json +8 -0
  7. package/.vscode/settings.json +3 -0
  8. package/CHANGELOG.md +167 -0
  9. package/CONTRIBUTING.md +85 -4
  10. package/README.md +139 -18
  11. package/SECURITY.md +38 -0
  12. package/action.yml +35 -0
  13. package/agents/browser-qa.md +1 -1
  14. package/agents/database-migrator.md +26 -0
  15. package/agents/documentation-writer.md +27 -0
  16. package/agents/incident-responder.md +34 -0
  17. package/agents/performance-tuner.md +27 -0
  18. package/agents/release-engineer.md +34 -0
  19. package/bin/everything-gemini +1550 -86
  20. package/docs/COMMUNITY_SUBMISSIONS.md +88 -0
  21. package/docs/LAUNCH_KIT.md +148 -22
  22. package/docs/architecture/progressive-disclosure.md +3 -3
  23. package/docs/index.html +401 -37
  24. package/docs/launch-kit.md +163 -0
  25. package/examples/cli-workflows/README.md +45 -0
  26. package/examples/cli-workflows/demo_workflow.sh +39 -0
  27. package/examples/python-sdk/README.md +28 -5
  28. package/examples/python-sdk/documentation_audit_pipeline.py +83 -0
  29. package/examples/python-sdk/incident_triage_pipeline.py +170 -0
  30. package/examples/python-sdk/multi_agent_pipeline.py +95 -0
  31. package/examples/python-sdk/release_readiness_audit.py +144 -0
  32. package/hooks/secret-scrubber/hooks.json +16 -0
  33. package/hooks/secret-scrubber/scripts/scrub-secrets.sh +62 -0
  34. package/mcp/README.md +20 -0
  35. package/mcp/mcp_config.example.json +35 -0
  36. package/package.json +3 -1
  37. package/plugins/core/rules/core-practices.md +63 -4
  38. package/plugins/python-ai/rules/ai-agent-patterns.md +67 -4
  39. package/plugins/security-shield/rules/zero-trust.md +60 -4
  40. package/plugins/web-fullstack/rules/frontend-standards.md +74 -4
  41. package/rules/paradigms/security-hardened.md +53 -10
  42. package/rules/paradigms/tdd.md +65 -8
  43. package/scripts/install.ps1 +14 -0
  44. package/scripts/install.sh +15 -1
  45. package/scripts/validate.sh +103 -12
  46. package/skills/agent-evals/SKILL.md +61 -0
  47. package/skills/apache-kafka-streams/SKILL.md +152 -0
  48. package/skills/argo-workflows/SKILL.md +151 -0
  49. package/skills/axum-web-service/SKILL.md +159 -0
  50. package/skills/cilium-ebpf-networking/SKILL.md +145 -0
  51. package/skills/clickhouse-analytics/SKILL.md +128 -0
  52. package/skills/dbt-transformation/SKILL.md +179 -0
  53. package/skills/debezium-cdc/SKILL.md +166 -0
  54. package/skills/docker-compose-orchestrator/SKILL.md +85 -0
  55. package/skills/duckdb-local-olap/SKILL.md +134 -0
  56. package/skills/fastapi-production/SKILL.md +157 -0
  57. package/skills/graphql-architect/SKILL.md +78 -0
  58. package/skills/grpc-connect-rpc/SKILL.md +176 -0
  59. package/skills/langgraph-orchestrator/SKILL.md +144 -0
  60. package/skills/litellm-proxy-gateway/SKILL.md +154 -0
  61. package/skills/nats-jetstream/SKILL.md +122 -0
  62. package/skills/open-telemetry-tracing/SKILL.md +151 -0
  63. package/skills/playwright-visual-regression/SKILL.md +124 -0
  64. package/skills/redis-cache-patterns/SKILL.md +159 -0
  65. package/skills/svelte-kit-architect/SKILL.md +190 -0
  66. package/skills/temporal-workflows/SKILL.md +158 -0
  67. package/skills/trpc-react-query/SKILL.md +169 -0
  68. package/skills/turborepo-monorepo/SKILL.md +199 -0
  69. package/skills/vllm-inference/SKILL.md +144 -0
  70. package/skills/wasm-rust-optimizer/SKILL.md +130 -0
  71. package/templates/full-power/hooks.json +14 -0
  72. package/templates/full-power/mcp_config.json +43 -0
  73. package/templates/recommended/hooks.json +14 -0
  74. package/tests/cli.test.js +383 -0
@@ -0,0 +1,144 @@
1
+ #!/usr/bin/env python3
2
+ """
3
+ Everything Gemini (everything-gemini) Python SDK Example
4
+ Release Readiness & Multi-Agent Gate Pipeline
5
+
6
+ Orchestrates a 4-stage release qualification loop:
7
+ Planner -> Code Reviewer -> Security Auditor -> Release Engineer
8
+ """
9
+
10
+ import sys
11
+ import json
12
+ from dataclasses import dataclass, field
13
+ from typing import List, Dict, Any, Optional
14
+
15
+ @dataclass
16
+ class ReleaseCandidate:
17
+ target_version: str
18
+ target_branch: str = "main"
19
+ git_head_commit: str = "HEAD"
20
+ breaking_changes: List[str] = field(default_factory=list)
21
+ features: List[str] = field(default_factory=list)
22
+ fixes: List[str] = field(default_factory=list)
23
+ test_results: Dict[str, Any] = field(default_factory=dict)
24
+ security_scan: Dict[str, Any] = field(default_factory=dict)
25
+
26
+ class ReleaseAuditPipeline:
27
+ """Automates multi-agent release qualification using Antigravity principles."""
28
+
29
+ def __init__(self, rc: ReleaseCandidate):
30
+ self.rc = rc
31
+ self.audit_trail: List[Dict[str, str]] = []
32
+
33
+ def log_step(self, agent: str, action: str, status: str, details: str):
34
+ self.audit_trail.append({
35
+ "agent": agent,
36
+ "action": action,
37
+ "status": status,
38
+ "details": details
39
+ })
40
+ print(f"[{agent.upper()}] {action}: {status} - {details}")
41
+
42
+ def run_stage_1_planner(self) -> bool:
43
+ """Stage 1: Planner sets release perimeter and validation gates."""
44
+ self.log_step(
45
+ agent="planner",
46
+ action="define_release_gates",
47
+ status="SUCCESS",
48
+ details=f"Scope established for v{self.rc.target_version} on branch {self.rc.target_branch}."
49
+ )
50
+ return True
51
+
52
+ def run_stage_2_code_reviewer(self) -> bool:
53
+ """Stage 2: Code Reviewer verifies test coverage and conventional commits."""
54
+ all_passed = self.rc.test_results.get("all_tests_passed", True)
55
+ if not all_passed:
56
+ self.log_step(
57
+ agent="code-reviewer",
58
+ action="verify_tests",
59
+ status="FAILED",
60
+ details="Automated test suite reported regressions."
61
+ )
62
+ return False
63
+
64
+ self.log_step(
65
+ agent="code-reviewer",
66
+ action="verify_commits",
67
+ status="SUCCESS",
68
+ details=f"Conventional commit syntax validated for {len(self.rc.features)} features and {len(self.rc.fixes)} fixes."
69
+ )
70
+ return True
71
+
72
+ def run_stage_3_security_auditor(self) -> bool:
73
+ """Stage 3: Security Auditor inspects secrets, CVEs, and permissions."""
74
+ cves = self.rc.security_scan.get("critical_vulnerabilities", 0)
75
+ if cves > 0:
76
+ self.log_step(
77
+ agent="security-auditor",
78
+ action="scan_cves",
79
+ status="FAILED",
80
+ details=f"Found {cves} critical vulnerabilities."
81
+ )
82
+ return False
83
+
84
+ self.log_step(
85
+ agent="security-auditor",
86
+ action="secret_scrubbing",
87
+ status="SUCCESS",
88
+ details="Zero unmasked API keys or private keys found in build manifests."
89
+ )
90
+ return True
91
+
92
+ def run_stage_4_release_engineer(self) -> Dict[str, Any]:
93
+ """Stage 4: Release Engineer compiles changelog, calculates checksums, and signs release."""
94
+ bump_type = "major" if self.rc.breaking_changes else ("minor" if self.rc.features else "patch")
95
+
96
+ release_manifest = {
97
+ "version": self.rc.target_version,
98
+ "semver_bump": bump_type,
99
+ "git_tag": f"v{self.rc.target_version}",
100
+ "artifact_checksum_sha256": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855",
101
+ "ready_to_deploy": True
102
+ }
103
+
104
+ self.log_step(
105
+ agent="release-engineer",
106
+ action="generate_release_manifest",
107
+ status="SUCCESS",
108
+ details=f"Release {release_manifest['git_tag']} approved as {bump_type.upper()} bump."
109
+ )
110
+ return release_manifest
111
+
112
+ def execute(self) -> Optional[Dict[str, Any]]:
113
+ print(f"\n🚀 Initiating Release Readiness Audit for v{self.rc.target_version}...\n")
114
+
115
+ if not self.run_stage_1_planner():
116
+ return None
117
+ if not self.run_stage_2_code_reviewer():
118
+ return None
119
+ if not self.run_stage_3_security_auditor():
120
+ return None
121
+
122
+ manifest = self.run_stage_4_release_engineer()
123
+ print("\n✨ Release Readiness Audit PASSED! All 4 Subagent Gates Cleared.")
124
+ return manifest
125
+
126
+ if __name__ == "__main__":
127
+ candidate = ReleaseCandidate(
128
+ target_version="1.7.0",
129
+ features=[
130
+ "langgraph-orchestrator skill",
131
+ "playwright-visual-regression skill",
132
+ "open-telemetry-tracing skill",
133
+ "argo-workflows skill",
134
+ "audit CLI command"
135
+ ],
136
+ fixes=["strict subagent contract assertion"],
137
+ test_results={"all_tests_passed": True, "total_tests": 24},
138
+ security_scan={"critical_vulnerabilities": 0}
139
+ )
140
+
141
+ pipeline = ReleaseAuditPipeline(candidate)
142
+ result = pipeline.execute()
143
+ if not result:
144
+ sys.exit(1)
@@ -0,0 +1,16 @@
1
+ {
2
+ "secret-scrubber": {
3
+ "PreToolUse": [
4
+ {
5
+ "matcher": "write_to_file|replace_file_content|multi_replace_file_content",
6
+ "hooks": [
7
+ {
8
+ "type": "command",
9
+ "command": "bash ./scripts/scrub-secrets.sh",
10
+ "timeout": 10
11
+ }
12
+ ]
13
+ }
14
+ ]
15
+ }
16
+ }
@@ -0,0 +1,62 @@
1
+ #!/usr/bin/env bash
2
+ # Everything Gemini Secret Scrubber: PreToolUse Security Gate
3
+ # Reads protojson hook payload from stdin, inspects write content for plaintext credentials,
4
+ # and outputs JSON decision on stdout.
5
+
6
+ set -eo pipefail
7
+
8
+ PAYLOAD=$(cat)
9
+
10
+ # Extract content being written using node
11
+ SECRET_FOUND=$(node -e "
12
+ try {
13
+ const p = JSON.parse(process.argv[1]);
14
+ const args = p.toolCall?.args || {};
15
+ let content = '';
16
+
17
+ if (args.CodeContent) content += args.CodeContent + '\n';
18
+ if (args.ReplacementContent) content += args.ReplacementContent + '\n';
19
+ if (Array.isArray(args.ReplacementChunks)) {
20
+ content += args.ReplacementChunks.map(c => c.ReplacementContent || '').join('\n');
21
+ }
22
+
23
+ // Regex patterns for live production credentials
24
+ const patterns = [
25
+ { name: 'AWS Access Key', regex: /AKIA[0-9A-Z]{16}/ },
26
+ { name: 'OpenAI Secret Key', regex: /sk-[a-zA-Z0-9]{48}|sk-proj-[a-zA-Z0-9_-]{40,}/ },
27
+ { name: 'Google API Key', regex: /AIza[0-9A-Za-z\\-_]{35}/ },
28
+ { name: 'GitHub Personal Access Token', regex: /ghp_[0-9a-zA-Z]{36}|github_pat_[0-9a-zA-Z_]{82}/ },
29
+ { name: 'Slack Bot Token', regex: /xoxb-[0-9]{11,13}-[0-9]{11,13}-[a-zA-Z0-9]{24}/ },
30
+ { name: 'Stripe Live Secret Key', regex: /sk_live_[0-9a-zA-Z]{24}/ },
31
+ { name: 'Private Key', regex: /-----BEGIN [A-Z ]+PRIVATE KEY-----/ }
32
+ ];
33
+
34
+ for (const { name, regex } of patterns) {
35
+ if (regex.test(content)) {
36
+ console.log(name);
37
+ process.exit(0);
38
+ }
39
+ }
40
+ console.log('');
41
+ } catch (e) {
42
+ console.log('');
43
+ }
44
+ " "$PAYLOAD")
45
+
46
+ if [ -n "$SECRET_FOUND" ]; then
47
+ cat <<EOF
48
+ {
49
+ "decision": "deny",
50
+ "reason": "Security Alert: Secret Scrubber detected raw ${SECRET_FOUND} in file write payload. Do not commit or hardcode live credentials. Use environment variables (process.env / os.environ) instead."
51
+ }
52
+ EOF
53
+ exit 0
54
+ fi
55
+
56
+ # Clean content
57
+ cat <<EOF
58
+ {
59
+ "decision": "allow"
60
+ }
61
+ EOF
62
+ exit 0
package/mcp/README.md CHANGED
@@ -37,5 +37,25 @@ Antigravity connects to a remote MCP endpoint over HTTPS:
37
37
  }
38
38
  ```
39
39
 
40
+ ## Curated MCP Server Blueprints
41
+
42
+ Everything Gemini bundles ready-to-use blueprints in `mcp/mcp_config.example.json`:
43
+
44
+ | Server Name | Package | Purpose | Transport |
45
+ | :--- | :--- | :--- | :--- |
46
+ | **`memory`** | `@modelcontextprotocol/server-memory` | Persistent knowledge graph semantic memory across agent sessions | Stdio |
47
+ | **`fetch`** | `@modelcontextprotocol/server-fetch` | Efficient HTTP scraping and web documentation extraction | Stdio |
48
+ | **`redis`** | `@modelcontextprotocol/server-redis` | High-speed key-value caching, Pub/Sub, and distributed locks | Stdio |
49
+ | **`docker`** | `@modelcontextprotocol/server-docker` | Container lifecycle inspection, logs, and containerized testing | Stdio |
50
+ | **`clickhouse`** | `@modelcontextprotocol/server-clickhouse` | High-throughput OLAP analytics and vector similarity search | Stdio |
51
+ | **`sequential-thinking`** | `@modelcontextprotocol/server-sequential-thinking` | Dynamic multi-step reasoning, hypothesis testing & decomposition | Stdio |
52
+ | **`github`** | `@modelcontextprotocol/server-github` | Pull requests, issues, repo search, and commit inspection | Stdio |
53
+ | **`postgres`** | `@modelcontextprotocol/server-postgres` | PostgreSQL relational schema inspection and SQL queries | Stdio |
54
+ | **`sqlite`** | `@modelcontextprotocol/server-sqlite` | Local SQLite database querying and table inspection | Stdio |
55
+ | **`filesystem`** | `@modelcontextprotocol/server-filesystem` | Direct multi-directory filesystem inspection | Stdio |
56
+ | **`sentry`** | `@modelcontextprotocol/server-sentry` | Real-time production error tracking, issue triage, and stacktrace analysis | Stdio |
57
+ | **`slack`** | `@modelcontextprotocol/server-slack` | Automated incident channels, alert broadcasts, and team collaboration | Stdio |
58
+
40
59
  ## Tool Auto-Discovery & Execution
41
60
  Once connected, tools declared by MCP servers are automatically injected into the agent's system prompt and executed through Antigravity's Language Server. Inspect active MCP servers in the Antigravity UI via **Additional Options (...) > MCP Servers**.
61
+
@@ -22,9 +22,44 @@
22
22
  "command": "npx",
23
23
  "args": ["-y", "@modelcontextprotocol/server-filesystem", "./docs", "./src"]
24
24
  },
25
+ "memory": {
26
+ "command": "npx",
27
+ "args": ["-y", "@modelcontextprotocol/server-memory"]
28
+ },
25
29
  "fetch": {
26
30
  "command": "npx",
27
31
  "args": ["-y", "@modelcontextprotocol/server-fetch"]
32
+ },
33
+ "redis": {
34
+ "command": "npx",
35
+ "args": ["-y", "@modelcontextprotocol/server-redis", "redis://localhost:6379"]
36
+ },
37
+ "docker": {
38
+ "command": "npx",
39
+ "args": ["-y", "@modelcontextprotocol/server-docker"]
40
+ },
41
+ "clickhouse": {
42
+ "command": "npx",
43
+ "args": ["-y", "@modelcontextprotocol/server-clickhouse", "http://default:@localhost:8123/default"]
44
+ },
45
+ "sequential-thinking": {
46
+ "command": "npx",
47
+ "args": ["-y", "@modelcontextprotocol/server-sequential-thinking"]
48
+ },
49
+ "sentry": {
50
+ "command": "npx",
51
+ "args": ["-y", "@modelcontextprotocol/server-sentry"],
52
+ "env": {
53
+ "SENTRY_AUTH_TOKEN": "YOUR_SENTRY_AUTH_TOKEN"
54
+ }
55
+ },
56
+ "slack": {
57
+ "command": "npx",
58
+ "args": ["-y", "@modelcontextprotocol/server-slack"],
59
+ "env": {
60
+ "SLACK_BOT_TOKEN": "YOUR_SLACK_BOT_TOKEN",
61
+ "SLACK_TEAM_ID": "YOUR_SLACK_TEAM_ID"
62
+ }
28
63
  }
29
64
  }
30
65
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "everything-gemini",
3
- "version": "1.1.1",
3
+ "version": "1.8.0",
4
4
  "description": "Everything Gemini (everything-gemini) - The Ultimate Agent Harness, Multi-Agent Orchestrator & Performance Suite for Gemini & Google Antigravity",
5
5
  "main": "bin/everything-gemini",
6
6
  "bin": {
@@ -11,6 +11,8 @@
11
11
  "scripts": {
12
12
  "test": "bash scripts/validate.sh",
13
13
  "validate": "bash scripts/validate.sh",
14
+ "benchmark": "node bin/everything-gemini test-all",
15
+ "completion": "node bin/everything-gemini completion",
14
16
  "install:core": "bash scripts/install.sh --profile core",
15
17
  "install:dev": "bash scripts/install.sh --profile developer",
16
18
  "install:full": "bash scripts/install.sh --profile full"
@@ -1,5 +1,64 @@
1
- # Core Engineering Practices
1
+ # Core Engineering Practices (Antigravity & Gemini)
2
2
 
3
- - **Self-Healing Verification**: Whenever a command errors, parse the traceback before making subsequent edits.
4
- - **Atomic Operations**: Never leave files in half-written or unparseable states.
5
- - **Defensive Coding**: Validate all inputs at the boundary. Fail fast and fail clearly.
3
+ These principles govern all agentic interactions, tool executions, and file modifications within this repository and downstream Antigravity workspaces.
4
+
5
+ ---
6
+
7
+ ## 1. Zero Hallucination & Evidence-First Protocol
8
+ 1. **Verify Before Asserting**:
9
+ - Never assume file structures, function signatures, dependencies, or configuration schemas exist without inspecting them first.
10
+ - Use `view_file`, `grep_search`, or `list_dir` to confirm actual filesystem reality before proposing or applying code changes.
11
+ 2. **Clickable Markdown File References**:
12
+ - Always format file paths and symbols as clickable Markdown links with the `file://` scheme (e.g. `[filename](file:///absolute/path/to/file)`).
13
+ 3. **Truth Grounding**:
14
+ - When referencing APIs or libraries, rely on codebase evidence, lockfiles, or live search grounding over training-time assumptions.
15
+
16
+ ---
17
+
18
+ ## 2. Proactive Verification Loop
19
+ 1. **Automated Verification After Modification**:
20
+ - Every modification MUST be followed by automated verification (running tests, linters, or typecheckers like `npm test` or `bash scripts/validate.sh`).
21
+ 2. **Defect Isolation**:
22
+ - If a command fails, inspect the error output and stack trace immediately. Fix the root cause rather than guessing or applying speculative patches.
23
+ 3. **Never Repeat Blind Failures**:
24
+ - Never execute the identical failing command in a loop without modifying code or resolving the underlying dependency failure.
25
+
26
+ ---
27
+
28
+ ## 3. Minimal Surgical Diffs
29
+ 1. **Preserve Code Formatting & Comments**:
30
+ - Preserve all existing code formatting, comments, licenses, and docstrings unrelated to your immediate task.
31
+ 2. **Targeted Replacement**:
32
+ - Use targeted edit tools (`replace_file_content` or `multi_replace_file_content`) instead of overwriting whole files whenever possible.
33
+ 3. **Zero Accidental Refactoring**:
34
+ - Do not reformat untouched functions or change style conventions outside the scope of the requested change.
35
+
36
+ ---
37
+
38
+ ## 4. Self-Healing & Traceback Analysis
39
+ 1. **Traceback Parsing**:
40
+ - Extract exact file paths, line numbers, and error codes from compiler tracebacks.
41
+ 2. **Targeted Reproduction**:
42
+ - Craft minimal reproduction test cases before applying large structural alterations.
43
+ 3. **Clean Teardown**:
44
+ - When running scratch test scripts or temporary directories, ensure exit traps cleanly remove test artifacts.
45
+
46
+ ---
47
+
48
+ ## 5. Progressive Disclosure Discipline
49
+ 1. **Context Efficiency**:
50
+ - Keep conversation context lean. Rely on on-demand skills in `skills/` and reference documents in `references/`.
51
+ 2. **Cache-Friendly Structures**:
52
+ - Structure prompt headers and system guidelines deterministically to maximize Gemini 3.8 prefix caching (~75% cost savings).
53
+ 3. **Modular Plugin Separation**:
54
+ - Keep domain rules, skills, and hooks encapsulated in their respective namespaces.
55
+
56
+ ---
57
+
58
+ ## 6. Defensive Boundary Validation & Idempotency
59
+ 1. **Input Sanitization**:
60
+ - Validate and normalize all paths, CLI flags, and JSON payloads at system boundaries.
61
+ 2. **Idempotent Operations**:
62
+ - Ensure setup, install, and update commands can run repeatedly without duplicating configuration entries or corrupting files.
63
+ 3. **Safe Execution**:
64
+ - Never execute destructive shell operations (`rm -rf *`, `git reset --hard`) with unvalidated wildcard expansions.
@@ -1,5 +1,68 @@
1
- # AI Agent & LLM Engineering Standards
1
+ # AI Agent & LLM Engineering Standards (Python & Gemini)
2
2
 
3
- - **Streaming First**: Always stream LLM response tokens and reasoning thoughts for enhanced observability and interactive responsiveness.
4
- - **Strongly-Typed Tool Calls**: Validate tool schemas using Pydantic or TypedDict before exposing them to agents.
5
- - **Graceful Error Recovery**: Handle API rate limits, model overloads, and context length limits with exponential backoff and message compaction.
3
+ These principles guide the development and orchestration of AI agents, tool declarations, and model interactions using Python and the Gemini / Antigravity SDKs.
4
+
5
+ ---
6
+
7
+ ## 1. Streaming & Real-Time Reasoning
8
+ - **Streaming First**:
9
+ - Always stream response tokens for interactive user sessions (`client.models.generate_content_stream`) to minimize Time-to-First-Token (TTFT).
10
+ - **Separation of Reasoning & Final Output**:
11
+ - Distinguish agent thought sequences from final customer-facing responses. Stream thinking blocks to developer logs while streaming final text to UI clients.
12
+ - **Async Event Loops**:
13
+ - Leverage `asyncio` for non-blocking I/O when handling parallel agent invocations and external tool queries.
14
+
15
+ ---
16
+
17
+ ## 2. Strongly-Typed Tool Declarations
18
+ - **Pydantic Tool Schemas**:
19
+ - Define all agent tool parameters using Pydantic `BaseModel` with explicit type annotations and field descriptions:
20
+ ```python
21
+ from pydantic import BaseModel, Field
22
+
23
+ class QueryDatabaseArgs(BaseModel):
24
+ query: str = Field(description="Sanitized SQL query to execute")
25
+ limit: int = Field(default=50, ge=1, le=1000, description="Max rows to return")
26
+ ```
27
+ - **Unambiguous Parameter Descriptions**:
28
+ - Clearly document valid enum values, format constraints, and default behaviors so the model never generates hallucinated arguments.
29
+ - **Fail-Fast Boundary Validation**:
30
+ - Catch Pydantic `ValidationError` at the tool gate and return structured error messages back to the agent for self-correction.
31
+
32
+ ---
33
+
34
+ ## 3. Structured Output Guarantees
35
+ - **JSON Schema Enforcement**:
36
+ - Use `response_mime_type="application/json"` combined with `response_schema` to guarantee valid JSON formatting without regex post-processing.
37
+ - **Envelope Contracts**:
38
+ - Always wrap structured agent payloads in standardized envelopes containing status, findings, and metadata.
39
+
40
+ ---
41
+
42
+ ## 4. Context Caching & Token Optimization
43
+ - **Deterministic Prompt Prefixing**:
44
+ - Place static repository maps, immutable system instructions, and schema definitions at the very beginning of the prompt to maximize Gemini 3.8 static prefix cache hits.
45
+ - **Cache Eviction Discipline**:
46
+ - For corpuses exceeding 32,768 tokens, establish explicit TTL-based Context Caches (`client.caches.create`) to achieve ~75% cost reduction.
47
+ - **Progressive Disclosure Memory**:
48
+ - In long-running multi-turn sessions, summarize intermediate reasoning steps and compact transcript history to prevent context overflow.
49
+
50
+ ---
51
+
52
+ ## 5. Deterministic Subagent Orchestration
53
+ - **Explicit Scoping**:
54
+ - Delegate tasks to specialized subagents with strictly isolated toolsets (e.g. read-only subagents for code search, execution subagents for testing).
55
+ - **Structured Synthesis Handoff**:
56
+ - Child agents must return standardized Markdown reports containing:
57
+ 1. Executive Summary
58
+ 2. Modified Files List
59
+ 3. Test / Verification Output
60
+ 4. Open Risks & Blockers
61
+
62
+ ---
63
+
64
+ ## 6. Resilience & Fault Tolerance
65
+ - **Exponential Backoff with Jitter**:
66
+ - Wrap API calls in retry handlers catching HTTP 429 (rate limit) and 503 (service overloaded) with exponential backoff and randomized jitter.
67
+ - **Fallback Models**:
68
+ - Configure automatic failover from high-reasoning models (e.g. Gemini 1.5 Pro) to high-throughput models (e.g. Gemini 1.5 Flash) during transient network outages.
@@ -1,5 +1,61 @@
1
- # Zero-Trust Security Policies
1
+ # Zero-Trust Security Policies (Antigravity & Gemini)
2
2
 
3
- - **Least Privilege Tool Execution**: Agents operate with read-only defaults unless explicit write capabilities are granted.
4
- - **Network Boundaries**: Outbound network requests require explicit authorization unless calling approved APIs in the allowlist.
5
- - **Sandboxed Execution**: Destructive system utilities are restricted to isolated containers or sandboxes.
3
+ These mandatory policies establish defense-in-depth safety boundaries for automated AI agents, shell execution environments, and tool integrations.
4
+
5
+ ---
6
+
7
+ ## 1. Principle of Least Privilege (PoLP)
8
+ - **Read-Only Defaults**:
9
+ - Subagents and background tasks default to read-only tool permissions (`view_file`, `grep_search`, `list_dir`) unless explicit write permissions are necessary.
10
+ - **Granular Tool Grants**:
11
+ - Do not grant shell execution privileges to subagents that only require file inspection or documentation synthesis.
12
+ - **Explicit Confirmation Gates**:
13
+ - High-risk operations (production deployments, database schema migrations, repository configuration updates) require explicit confirmation gates.
14
+
15
+ ---
16
+
17
+ ## 2. Credential & Secret Leakage Prevention
18
+ - **Proactive Secret Scanning**:
19
+ - Outbound payloads, diffs, and generated files must be scanned for credential patterns:
20
+ - Google Cloud / Gemini API Keys (`AIza[0-9A-Za-z\\-_]{35}`)
21
+ - GitHub Personal Access Tokens (`ghp_[0-9A-Za-z]{36}`)
22
+ - Stripe Secret Keys (`sk_live_[0-9a-zA-Z]{24}`)
23
+ - Private SSH / TLS keys (`-----BEGIN.*PRIVATE KEY-----`)
24
+ - **Zero-Logging Policy**:
25
+ - Never print, echo, or log environment variables containing API keys, tokens, or credentials to terminal stdout/stderr.
26
+ - **Git Hygiene**:
27
+ - Never commit `.env`, `.env.local`, or secret credentials to version control. Always maintain sanitized `.env.example` templates.
28
+
29
+ ---
30
+
31
+ ## 3. Command Injection & Execution Guardrails
32
+ - **Lifecycle Interception (PreToolUse)**:
33
+ - All shell commands executed by agents are intercepted by deterministic safety gates (`gemini-shield` / `safety-shield`).
34
+ - **Blocked Catastrophic Commands**:
35
+ - The following commands are blocked unconditionally:
36
+ - Destructive filesystem deletion: `rm -rf /`, `rm -rf *`, `rm -rf ~`
37
+ - Production branch forced overwrites: `git push --force origin main`, `git push -f origin master`
38
+ - Destructive database operations: `DROP DATABASE`, `DROP TABLE`, `TRUNCATE`
39
+ - Unaudited remote execution: `curl ... | sh`, `wget ... | bash`
40
+ - **Argument Parameterization**:
41
+ - Never concatenate raw unvalidated strings into shell command strings. Prefer direct array-based argument passing (`child_process.execFile` or `subprocess.run(["cmd", arg])`).
42
+
43
+ ---
44
+
45
+ ## 4. Path Traversal & Filesystem Containment
46
+ - **Workspace Boundary Enforcement**:
47
+ - All file operations must resolve to paths strictly within the active workspace root (`process.cwd()`) or designated global config root (`~/.gemini/config/`).
48
+ - **Path Normalization**:
49
+ - Normalize all incoming file paths (`path.resolve()`) to eliminate directory traversal vectors (`../`, `..\`).
50
+ - **Forbidden Root Modifications**:
51
+ - Direct writes to `/tmp`, `/etc`, `/usr`, or system binaries outside the designated workspace are strictly prohibited.
52
+
53
+ ---
54
+
55
+ ## 5. Network Boundaries & Safe Integrations
56
+ - **Approved Outbound Endpoints**:
57
+ - Network requests made by MCP servers or tools must connect to approved domains or local loopback interfaces (`localhost`, `127.0.0.1`).
58
+ - **TLS Certificate Validation**:
59
+ - Outbound HTTPS calls must enforce valid TLS certificates. Disabling certificate verification (`rejectUnauthorized: false` or `verify=False`) is disallowed.
60
+ - **Deterministic Sandboxes**:
61
+ - When running untrusted code or third-party dependencies, execute inside isolated Docker containers or sandboxed virtual environments.
@@ -1,5 +1,75 @@
1
- # Frontend Engineering Standards
1
+ # Frontend & Web Engineering Standards
2
2
 
3
- - **Accessible HTML (a11y)**: Use semantic HTML5 elements (`<nav>`, `<main>`, `<article>`, `<section>`, `<button>`). Never use `<div onClick="...">` without keyboard accessibility.
4
- - **Visual Excellence**: Avoid plain, generic color schemes. Use curated palettes (HSL/OKLCH), subtle gradients, and smooth micro-animations.
5
- - **Zero Layout Shifts**: Always specify dimensions (`width`, `height`) on images and video embeds.
3
+ These principles define visual quality, accessibility standards, Core Web Vitals, and modern fullstack architectures across all web applications.
4
+
5
+ ---
6
+
7
+ ## 1. Visual Aesthetics & Design Excellence
8
+ - **Rich Aesthetics by Default**:
9
+ - Web applications must make a stunning first impression. Avoid plain, unstyled HTML or generic primary colors (pure red, green, blue).
10
+ - Use curated HSL or OKLCH color palettes with harmonic tonal contrast and sleek dark-mode backgrounds (e.g. `#07090e`, `#10141f`).
11
+ - **Modern Typography**:
12
+ - Avoid browser defaults (Times New Roman, basic Arial). Pair modern variable web fonts:
13
+ - Interface text: *Plus Jakarta Sans*, *Inter*, or *Outfit*
14
+ - Code / Monospace: *JetBrains Mono* or *Fira Code*
15
+ - **Dynamic Micro-Interactions**:
16
+ - Interface elements must feel responsive and alive:
17
+ - Hover states with subtle elevation (`transform: translateY(-2px)`)
18
+ - Smooth transition timings (`transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1)`)
19
+ - Polished button active states and copy confirmations
20
+
21
+ ---
22
+
23
+ ## 2. Semantic HTML5 & Accessibility (WCAG 2.2 AA)
24
+ - **Semantic Structure**:
25
+ - Always use structural landmark elements: `<header>`, `<nav>`, `<main>`, `<section>`, `<article>`, `<footer>`.
26
+ - Only one `<h1>` per page, followed by logical heading hierarchy (`<h2>`, `<h3>`).
27
+ - **Interactive Elements**:
28
+ - Never attach click handlers to unstyled `<div>` or `<span>` tags. Use `<button>` for actions and `<a>` for navigational URLs.
29
+ - Interactive custom widgets must provide proper ARIA attributes (`aria-expanded`, `aria-label`, `aria-haspopup`).
30
+ - **Keyboard & Focus Navigation**:
31
+ - Ensure all interactive elements are reachable via `Tab` and triggerable via `Enter` or `Space`.
32
+ - Maintain high-visibility focus indicators (`:focus-visible`). Never suppress focus rings with `outline: none` without providing an accessible alternative.
33
+ - **Color Contrast**:
34
+ - Maintain a minimum contrast ratio of 4.5:1 for body copy and 3:1 for large headers and graphical UI boundaries.
35
+
36
+ ---
37
+
38
+ ## 3. Core Web Vitals & Performance
39
+ - **Zero Cumulative Layout Shift (CLS < 0.1)**:
40
+ - Always declare explicit `width` and `height` attributes or CSS `aspect-ratio` on `<img>`, `<video>`, and canvas elements.
41
+ - Reserve placeholder dimensions for dynamically injected banners and async data cards.
42
+ - **Fast Largest Contentful Paint (LCP < 2.5s)**:
43
+ - Preconnect to critical font CDNs (`<link rel="preconnect" href="https://fonts.googleapis.com">`).
44
+ - Serve compressed next-generation image formats (WebP, AVIF) with appropriate `loading="lazy"` on below-the-fold content.
45
+ - **Interaction to Next Paint (INP < 200ms)**:
46
+ - Debounce high-frequency events (search input fields, resize listeners).
47
+ - Avoid heavy JavaScript calculations on the main UI thread.
48
+
49
+ ---
50
+
51
+ ## 4. Responsive Design & Fluid Layouts
52
+ - **Mobile-First Layout**:
53
+ - Build responsive layouts using CSS Flexbox and modern CSS Grid (`grid-template-columns: repeat(auto-fit, minmax(300px, 1fr))`).
54
+ - Standardized viewport breakpoints:
55
+ - Mobile: `< 640px`
56
+ - Tablet: `640px - 1024px`
57
+ - Desktop: `> 1024px`
58
+ - **Fluid Typography**:
59
+ - Scale headers smoothly between viewport sizes using CSS `clamp()`:
60
+ ```css
61
+ font-size: clamp(2rem, 5vw + 1rem, 3.75rem);
62
+ ```
63
+ - **Touch-Friendly Hit Targets**:
64
+ - Ensure touch targets on mobile viewports are at least `44x44px` with adequate margin spacing.
65
+
66
+ ---
67
+
68
+ ## 5. Modern Fullstack & React Server Components (RSC)
69
+ - **Server vs Client Separation**:
70
+ - Default to React Server Components (RSC) for data fetching, static rendering, and markdown processing.
71
+ - Restrict `'use client'` strictly to interactive leaf components requiring browser hooks (`useState`, `useEffect`, `onClick`).
72
+ - **Zero Hydration Mismatch**:
73
+ - Never reference browser-only APIs (`window`, `localStorage`, `document`) during initial component render passes without an `isMounted` guard.
74
+ - **Resilient Error Boundaries**:
75
+ - Wrap async route segments in React `<Suspense>` fallbacks and declarative `error.tsx` boundaries to isolate failures.