agentifind-init
Agentifind Init
Set up AI-powered codebase indexing for better code navigation.
What This Does
-
Runs
npx agentifind init --skip-conventionsto generate:index.json- Symbol graph (functions, classes, references)test-map.json- Source file → test file mappingsentrypoints.json- API handlers, CLI commands, main functionsboundaries.md- Dependency impact analysis
-
Uses your intelligence to generate
conventions.mdby analyzing the actual codebase
Instructions
Step 1: Run the indexer
Execute this command in the repo root:
npx agentifind init --skip-conventions
Wait for it to complete. This creates the .agent/ folder with the structural analysis.
Step 2: Generate conventions.md
Now use your intelligence to analyze the codebase and document its coding conventions.
Read 10-15 representative files across different parts of the codebase:
-
Look for files in these categories:
- Core business logic (services, models, handlers)
- Tests (to understand testing patterns)
- Configuration files (to understand tooling)
- Entry points (main.py, index.ts, cmd/main.go)
-
Analyze these aspects:
- Error handling: How are errors created, propagated, and logged?
- Logging: What library? What format? What levels?
- Testing: What framework? How are mocks used? Fixture patterns?
- Naming: snake_case vs camelCase? File naming patterns?
- File organization: How is code structured into directories?
- Configuration: Environment variables? Config files? Patterns?
-
Write the findings to
.agent/conventions.mdusing this format:
# Repository Conventions
*Auto-generated on [DATE]*
---
## 1. Error Handling
[Document patterns found]
## 2. Logging
[Document patterns found]
## 3. Testing
[Document patterns found]
## 4. Naming Conventions
[Document patterns found]
## 5. File Organization
[Document patterns found]
## 6. Configuration
[Document patterns found]
Step 3: Verify setup
After completion, the .agent/ folder should contain:
index.json(largest file - symbol graph)test-map.jsonentrypoints.jsonboundaries.mdconventions.md(you just created this)
Step 4: Inform the user
Tell the user:
Agentifind setup complete! Restart your coding agent to enable the MCP tools.
You now have access to:
find_callers- Find all callers of a functiontrace_path- Trace call paths between functionsget_tests_for- Find tests for a fileget_conventions- Query coding conventionsget_boundaries- Check module boundaries
Usage Notes
- Run this once per repository
- Re-run if you add significant new code or change project structure
- The MCP server (
agentifind serve) is auto-configured in.mcp.json