feat: Added GEMINI.md asset file for init-ing task master-ai for gemi… (#1326)

Co-authored-by: Ralph Khreish <35776126+Crunchyman-ralph@users.noreply.github.com>
This commit is contained in:
BUILDER 2025-10-31 21:20:28 +03:00 committed by GitHub
parent 3b09b5da2a
commit 9d5812ba67
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
5 changed files with 130 additions and 7 deletions

View File

@ -0,0 +1,7 @@
---
"task-master-ai": patch
---
Improve gemini cli integration
When initializing Task Master with the `gemini` profile, you now get properly configured context files tailored specifically for Gemini CLI, including MCP configuration and Gemini-specific features like file references, session management, and headless mode.

110
assets/GEMINI.md Normal file
View File

@ -0,0 +1,110 @@
# Gemini CLI-Specific Instructions
> **Note:** This file works alongside `AGENTS.md` (generic AI agent instructions). AGENTS.md contains the core Task Master commands and workflows for all AI agents. This file contains only Gemini CLI-specific features and integrations.
## MCP Configuration for Gemini CLI
Configure Task Master MCP server in `~/.gemini/settings.json`:
```json
{
"mcpServers": {
"task-master-ai": {
"command": "npx",
"args": ["-y", "task-master-ai"]
}
}
}
```
**Note:** API keys are configured via `task-master models --setup`, not in MCP configuration.
## Gemini CLI-Specific Features
### Session Management
Built-in session commands:
- `/chat` - Start new conversation while keeping context
- `/checkpoint save <name>` - Save session state
- `/checkpoint load <name>` - Resume saved session
- `/memory show` - View loaded context
Both `AGENTS.md` and `GEMINI.md` are auto-loaded on every Gemini CLI session.
### Headless Mode for Automation
Non-interactive mode for scripts:
```bash
# Simple text response
gemini -p "What's the next task?"
# JSON output for parsing
gemini -p "List all pending tasks" --output-format json
# Stream events for long operations
gemini -p "Expand all tasks" --output-format stream-json
```
### Token Usage Monitoring
```bash
# In Gemini CLI session
/stats
# Shows: token usage, API costs, request counts
```
### Google Search Grounding
Leverage built-in Google Search as an alternative to Perplexity research mode:
- Best practices research
- Library documentation
- Security vulnerability checks
- Implementation patterns
## Important Differences from Other Agents
### No Slash Commands
Gemini CLI does not support custom slash commands (unlike Claude Code). Use natural language instead.
### No Tool Allowlist
Security is managed at the MCP level, not via agent configuration.
### Session Persistence
Use `/checkpoint` instead of git worktrees for managing multiple work contexts.
### Configuration Files
- Global: `~/.gemini/settings.json`
- Project: `.gemini/settings.json`
- **Not**: `.mcp.json` (that's for Claude Code)
## Recommended Model Configuration
For Gemini CLI users:
```bash
# Set Gemini as primary model
task-master models --set-main gemini-2.0-flash-exp
task-master models --set-fallback gemini-1.5-flash
# Optional: Use Perplexity for research (or rely on Google Search)
task-master models --set-research perplexity-llama-3.1-sonar-large-128k-online
```
## Your Role with Gemini CLI
As a Gemini CLI assistant with Task Master:
1. **Use MCP tools naturally** - They integrate transparently in conversation
2. **Reference files with @** - Leverage Gemini's file inclusion
3. **Save checkpoints** - Offer to save state after significant progress
4. **Monitor usage** - Remind users about `/stats` for long sessions
5. **Use Google Search** - Leverage search grounding for research
**Key Principle:** Focus on natural conversation. Task Master MCP tools work seamlessly with Gemini CLI's interface.
---
*See AGENTS.md for complete Task Master commands, workflows, and best practices.*

View File

@ -12,6 +12,7 @@ export const geminiProfile = createProfile({
mcpConfigName: 'settings.json', // Override default 'mcp.json'
includeDefaultRules: false,
fileMap: {
'AGENTS.md': 'GEMINI.md'
'AGENT.md': 'AGENTS.md', // Generic base for all AI agents
'GEMINI.md': 'GEMINI.md' // Gemini-specific features only
}
});

View File

@ -27,7 +27,8 @@ describe('Gemini Profile Initialization Functionality', () => {
expect(geminiProfileContent).toContain("rulesDir: '.'"); // non-default
expect(geminiProfileContent).toContain("mcpConfigName: 'settings.json'"); // non-default
expect(geminiProfileContent).toContain('includeDefaultRules: false'); // non-default
expect(geminiProfileContent).toContain("'AGENTS.md': 'GEMINI.md'");
expect(geminiProfileContent).toContain("'AGENT.md': 'AGENTS.md'");
expect(geminiProfileContent).toContain("'GEMINI.md': 'GEMINI.md'");
// Check the final computed properties on the profile object
expect(geminiProfile.profileName).toBe('gemini');
@ -38,7 +39,8 @@ describe('Gemini Profile Initialization Functionality', () => {
expect(geminiProfile.mcpConfigName).toBe('settings.json');
expect(geminiProfile.mcpConfigPath).toBe('.gemini/settings.json'); // computed
expect(geminiProfile.includeDefaultRules).toBe(false);
expect(geminiProfile.fileMap['AGENTS.md']).toBe('GEMINI.md');
expect(geminiProfile.fileMap['AGENT.md']).toBe('AGENTS.md');
expect(geminiProfile.fileMap['GEMINI.md']).toBe('GEMINI.md');
});
test('gemini.js has no lifecycle functions', () => {

View File

@ -16,7 +16,8 @@ describe('Rule Transformer - Gemini Profile', () => {
expect(geminiProfile.mcpConfigPath).toBe('.gemini/settings.json');
expect(geminiProfile.includeDefaultRules).toBe(false);
expect(geminiProfile.fileMap).toEqual({
'AGENTS.md': 'GEMINI.md'
'AGENT.md': 'AGENTS.md',
'GEMINI.md': 'GEMINI.md'
});
});
@ -41,15 +42,17 @@ describe('Rule Transformer - Gemini Profile', () => {
test('should have correct file mapping', () => {
const geminiProfile = getRulesProfile('gemini');
expect(geminiProfile.fileMap).toEqual({
'AGENTS.md': 'GEMINI.md'
'AGENT.md': 'AGENTS.md',
'GEMINI.md': 'GEMINI.md'
});
});
test('should place GEMINI.md in root directory', () => {
test('should place AGENTS.md and GEMINI.md in root directory', () => {
const geminiProfile = getRulesProfile('gemini');
// rulesDir determines where fileMap files go
expect(geminiProfile.rulesDir).toBe('.');
// This means AGENTS.md -> GEMINI.md will be placed in the root
// This means both AGENTS.md and GEMINI.md will be placed in the root
// Both files are auto-loaded by Gemini CLI
});
test('should place settings.json in .gemini directory', () => {