Skip to content

Commit f3aa0d5

Browse files
Benoit Kohlerclaude
andcommitted
chore(agentic): align AGENTS.md navigation + minimal .claude settings
Add a router-framing sentence + Navigation (and File Structure) section to AGENTS.md indexing dev/ docs and .agents/commands; add a minimal .claude/settings.json (+ uv session-start hook) adapted from peer repos (Node/TS bits stripped); gitignore runtime .claude/ artifacts. CLAUDE.md unchanged. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
1 parent 1beb51d commit f3aa0d5

4 files changed

Lines changed: 69 additions & 0 deletions

File tree

.claude/hooks/session-start.sh

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
#!/usr/bin/env bash
2+
set -euo pipefail
3+
4+
# Ensure the project virtualenv exists and is exported into the session.
5+
# Kept minimal: dev/integration dependency groups have incompatible transitive
6+
# pins, so we do not run `uv sync` here — just guarantee a venv is present.
7+
8+
REPO_ROOT="${CLAUDE_PROJECT_DIR:-$(pwd)}"
9+
VENV_PATH="$REPO_ROOT/.venv"
10+
11+
if [ ! -d "$VENV_PATH" ]; then
12+
if command -v uv >/dev/null 2>&1; then
13+
uv venv "$VENV_PATH" >&2
14+
else
15+
echo "session-start hook: 'uv' not found on PATH; skipping venv creation" >&2
16+
exit 0
17+
fi
18+
fi
19+
20+
if [ -n "${CLAUDE_ENV_FILE:-}" ]; then
21+
printf 'export VIRTUAL_ENV=%q\n' "$VENV_PATH" >> "$CLAUDE_ENV_FILE"
22+
printf 'export PATH=%q:$PATH\n' "$VENV_PATH/bin" >> "$CLAUDE_ENV_FILE"
23+
fi

.claude/settings.json

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
{
2+
"enabledPlugins": {
3+
"pyright-lsp@claude-plugins-official": true
4+
},
5+
"hooks": {
6+
"SessionStart": [
7+
{
8+
"matcher": "startup|resume",
9+
"hooks": [
10+
{
11+
"type": "command",
12+
"command": "${CLAUDE_PROJECT_DIR}/.claude/hooks/session-start.sh"
13+
}
14+
]
15+
}
16+
]
17+
}
18+
}

.gitignore

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,5 +13,10 @@ docs/_build/*
1313
**/.pytest_cache
1414
.pytest_collections/
1515

16+
# Runtime Claude Code artifacts (never tracked; settings.json and commands are tracked)
17+
.claude/quality-gates/
18+
.claude/scheduled_tasks.lock
19+
.claude/settings.local.json
20+
1621
# https://github.com/ansible/ansible/issues/68499
1722
# ansible_collections/

AGENTS.md

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,34 @@
22

33
Ansible collection — modules, plugins, and inventory sources for [Infrahub](https://github.com/opsmill/infrahub), an infrastructure data platform.
44

5+
This file is the portable router: repo-wide facts every agent needs up front. Deeper how-tos, architecture notes, and decision records live under [dev/](dev/) — see Navigation below.
6+
57
- **Namespace / Collection:** `opsmill.infrahub` · **License:** GPLv3
68
- **Repo:** <https://github.com/opsmill/infrahub-ansible> · **Docs:** <https://docs.infrahub.app/ansible/>
79
- **Constitution (binding principles):** [.specify/memory/constitution.md](.specify/memory/constitution.md)
810
- **Dev docs index:** [dev/README.md](dev/README.md) · **Decision records:** [dev/adr/](dev/adr/)
911

12+
## Navigation
13+
14+
Internal developer docs are indexed in [dev/README.md](dev/README.md): architecture in [dev/knowledge/](dev/knowledge/) ([architecture](dev/knowledge/architecture.md), [plugin-patterns](dev/knowledge/plugin-patterns.md), [infrahub-sdk-usage](dev/knowledge/infrahub-sdk-usage.md)), how-to guides in [dev/guides/](dev/guides/) ([creating-a-module](dev/guides/creating-a-module.md), [running-tests](dev/guides/running-tests.md)), coding rules in [dev/guidelines/](dev/guidelines/) ([python](dev/guidelines/python.md), [testing](dev/guidelines/testing.md), [documentation](dev/guidelines/documentation.md), [git-workflow](dev/guidelines/git-workflow.md)), decisions in [dev/adr/](dev/adr/), binding principles in [.specify/memory/constitution.md](.specify/memory/constitution.md), and agent commands in [.agents/commands/](.agents/commands/).
15+
16+
## File Structure
17+
18+
```text
19+
plugins/modules/ Module stubs (DOCUMENTATION + AnsibleModule)
20+
plugins/action/ Action plugins (controller-side logic)
21+
plugins/module_utils/ Core shared code (infrahub_utils, node, branch, exception)
22+
plugins/inventory/ Dynamic inventory plugin
23+
plugins/lookup/ GraphQL lookup plugin
24+
plugins/doc_fragments/ Reusable DOCUMENTATION fragments
25+
tests/ Unit + integration + sanity tests
26+
docs/ Docusaurus site + generated plugin reference
27+
dev/ Internal developer docs (knowledge, guides, guidelines, adr)
28+
.agents/ Portable agent sources (commands, skills)
29+
.specify/ Spec-kit (constitution, templates, workflows)
30+
.claude/ Claude Code adapter (settings, symlinked commands)
31+
```
32+
1033
## Tech Stack
1134

1235
| Component | Version/Tool |

0 commit comments

Comments
 (0)