/navigator:nav-initfrom navigator
Creates the .agent/ directory structure for Navigator documentation, copies templates, and sets up initial configuration. Auto-invokes on phrases like 'Initialize Navigator' or 'Set up Navigator'.
Ships in navigator. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
Creates the Navigator documentation structure (.agent/) in a new project, copies templates, and sets up initial configuration.
.agent/ directory structure:
.agent/
├── DEVELOPMENT-README.md
├── .nav-config.json
├── tasks/
├── system/
├── sops/
│ ├── integrations/
│ ├── debugging/
│ ├── development/
│ └── deployment/
└── grafana/
├── docker-compose.yml
├── otel-collector-config.yml
├── prometheus.yml
├── grafana-datasource.yml
├── grafana-dashboards.yml
├── navigator-dashboard.json
└── README.md
if [ -d ".agent" ]; then
echo "✅ Navigator already initialized in this project"
echo ""
echo "To start a session: 'Start my Navigator session'"
echo "To view documentation: Read .agent/DEVELOPMENT-README.md"
exit 0
fi
Read package.json, pyproject.toml, go.mod, Cargo.toml, or similar to extract:
Fallback: Use current directory name if no config found.
Use Write tool to create:
.agent/
.agent/tasks/
.agent/system/
.agent/sops/integrations/
.agent/sops/debugging/
.agent/sops/development/
.agent/sops/deployment/
.agent/grafana/
Copy from plugin's templates/ directory to .agent/:
DEVELOPMENT-README.md:
${PROJECT_NAME} with detected project name${TECH_STACK} with detected stack${DATE} with current date.nav-config.json:
{
"version": "5.5.0",
"project_name": "${PROJECT_NAME}",
"tech_stack": "${TECH_STACK}",
"project_management": "none",
"task_prefix": "TASK",
"task_id_source": "local",
"team_chat": "none",
"auto_load_navigator": true,
"compact_strategy": "conservative",
"auto_update": {
"enabled": true,
"check_interval_hours": 1,
"curl_fallback": false
},
"task_doc_guard_hook": {
"enabled": true,
"strict_block": true
}
}
Grafana Setup: Copy all Grafana dashboard files to enable metrics visualization:
# Find plugin installation directory
PLUGIN_DIR="${CLAUDE_PLUGIN_ROOT:-$(cat "${NAVIGATOR_CONFIG_HOME:-${XDG_CONFIG_HOME:-$HOME/.config}/navigator}/plugin-root" 2>/dev/null)}"
[ -d "$PLUGIN_DIR/skills" ] || PLUGIN_DIR="$HOME/.claude/plugins/marketplaces/navigator-marketplace"
# Copy Grafana files if plugin has them
if [ -d "${PLUGIN_DIR}/.agent/grafana" ]; then
cp -r "${PLUGIN_DIR}/.agent/grafana/"* .agent/grafana/
echo "✓ Grafana dashboard installed"
else
echo "⚠️ Grafana files not found in plugin"
fi
Files copied:
~/.claude/settings.json env block)If CLAUDE.md exists:
If CLAUDE.md doesn't exist:
templates/CLAUDE.md to project rootNavigator's lifecycle hooks ship with the plugin manifest (.claude-plugin/plugin.json's top-level hooks field) starting v6.13.0+. They are not merged into the project's .claude/settings.json — Claude Code only substitutes ${CLAUDE_PLUGIN_ROOT} for hooks declared in a plugin manifest, so merging them into user settings (the prior approach) produced broken commands like /hooks/X.py.
The plugin registers the following hooks automatically when the plugin is installed:
.agent/tasks/TASK-*.md unless /nav-task ran this session; GH-40)Nothing for nav-init to do here. The skill no longer writes to .claude/settings.json for hooks.
⚠️ RESTART REQUIRED to activate hooks after plugin install/update.
Claude Code caches plugin manifest hooks at session start.
Opt-out: Users can disable any hook via .agent/.nav-config.json:
{
"session_start_hook": { "enabled": false },
"compact_hook": { "enabled": false },
"workflow_state_hook": { "enabled": false },
"task_graph_sync_hook": { "enabled": false },
"profile_sync_hook": { "enabled": false },
"workflow_enforcer_hook":{ "enabled": false },
"task_doc_guard_hook": { "enabled": false }
}
(The hooks themselves read this config and short-circuit when disabled, so no settings.json mutation is needed.)
Add each of these lines to .gitignore unless it is already present (check line by
line — re-running nav-init must not duplicate entries):
# Navigator context markers
.context-markers/
# Navigator temporary files
.agent/.nav-temp/
# Navigator hook-runtime session state (regenerated every turn, never shared)
.agent/.nav-runtime-state.json
.agent/.nav-runtime-state.lock
# Navigator reject log (one line per refusal; local diagnostics, TASK-88)
.agent/.nav-rejects.jsonl
# Navigator personal config override (per contributor, see nav-features --local)
.agent/.nav-config.local.json
# Navigator onboarding state (per person; lives under ~/.config/navigator since v7.8)
.agent/onboarding/
Idempotent append, one command:
for line in ".context-markers/" ".agent/.nav-temp/" \
".agent/.nav-runtime-state.json" ".agent/.nav-runtime-state.lock" \
".agent/.nav-rejects.jsonl" \
".agent/.nav-config.local.json" ".agent/onboarding/"; do
grep -qxF "$line" .gitignore 2>/dev/null || echo "$line" >> .gitignore
done
✅ Navigator Initialized Successfully!
Created structure:
📁 .agent/ Navigator documentation
📁 .agent/tasks/ Implementation plans
📁 .agent/system/ Architecture docs
📁 .agent/sops/ Standard procedures
📁 .agent/grafana/ Metrics dashboard
📄 .agent/.nav-config.json Configuration
📄 CLAUDE.md Updated with Navigator workflow
Next steps:
1. Start session: "Start my Navigator session"
2. Optional: Enable metrics - see .agent/sops/integrations/opentelemetry-setup.md
3. Optional: Launch Grafana - cd .agent/grafana && docker compose up -d
Token monitoring is active - you'll be warned when approaching context limits.
Documentation: Read .agent/DEVELOPMENT-README.md
If .agent/ exists:
If templates not found:
If no write permissions:
project_detector.pydef detect_project_info(cwd: str) -> dict:
"""
Detect project name and tech stack from config files.
Checks (in order):
1. package.json (Node.js)
2. pyproject.toml (Python)
3. go.mod (Go)
4. Cargo.toml (Rust)
5. composer.json (PHP)
6. Gemfile (Ruby)
Returns:
{
"name": "project-name",
"tech_stack": "Next.js, TypeScript, Prisma",
"detected_from": "package.json"
}
"""
template_customizer.pydef customize_template(template_content: str, project_info: dict) -> str:
"""
Replace placeholders in template with project-specific values.
Placeholders:
- ${PROJECT_NAME}
- ${TECH_STACK}
- ${DATE}
- ${YEAR}
Returns customized template content.
"""
settings_merger.pydef merge(target_path: Path, fragment: dict) -> dict:
"""
Idempotent JSON merge for .claude/settings.json.
- If target doesn't exist: create from fragment.
- If target exists: deep-merge `hooks` arrays by event name; dedupe entries
by command string. Preserves user-defined hooks and other top-level keys.
- Refuses to clobber invalid JSON (exits 2).
"""
Status (v6.13.0+): Retained as general-purpose JSON merger for non-hook
keys (permissions, mcpServers, etc.) that downstream skills may want to
preserve. Navigator no longer passes a hooks fragment through it — hooks now
ship with the plugin manifest (.claude-plugin/plugin.json). The hook-merging
code path is dead-for-Navigator but kept intact for safety (existing call
sites that already pass non-hook fragments continue to work).
User says: "Initialize Navigator in this project"
Skill detects:
package.json existsResult:
.agent/ createdUser says: "Set up Navigator"
Skill detects:
pyproject.toml existsResult:
.agent/ createdUser says: "Initialize Navigator"
Skill checks:
.agent/ directory existsResult:
✅ Navigator already initialized in this project
To start a session: 'Start my Navigator session'
nav-start skill:
.agent/DEVELOPMENT-README.mdnav-task skill:
.agent/tasks/nav-sop skill:
.agent/sops//nav:init command from v2.xWhat SKILL.md sets; muted values are Claude Code's defaults
33 skills in this plugin
/backend-endpointCreate REST/GraphQL API endpoint with validation, error handling, and tests. Auto-invoke when user says "add endpoint", "create API", "new route", or "add route"./backend-testGenerate backend tests (unit, integration, mocks) for existing code. Auto-invoke when user says "write test for", "add test", "test this", or "create test"./database-migrationCreate database migration with schema changes and rollback. Auto-invoke when user says "create migration", "add table", "modify schema", or "change database"./frontend-componentCreate React/Vue component with TypeScript, tests, and styles. Auto-invoke when user says "create component", "add component", "new component", or "build component"./frontend-testGenerate frontend component tests (React Testing Library, Vue Test Utils, snapshot) for existing components. Auto-invoke when user says "test this component", "write component test", or "add component test"./nav-briefRender a one-screen intent brief (Goal/Scope/Approach/Limits/Verify/Won't-do/Contradiction) before implementing ambiguous task-shaped prompts, triggered by the prompt_brief op (UserPromptSubmit via hooks/nav_dispatch.py). Confirms scope with max 2 open questions before touching files; detects brief drift mid-task.npx claudepluginhub qf-studio/navigator --plugin navigatorOther plugins' skills for the same job