|
1 | | -# dev/ |
| 1 | +# Developer Documentation |
2 | 2 |
|
3 | | -Developer knowledge base and AI agent resources for the `opsmill.infrahub` Ansible collection. |
| 3 | +Internal documentation for `opsmill.infrahub` collection contributors. For |
| 4 | +user-facing docs, see the [Docusaurus site](https://docs.infrahub.app/ansible/) |
| 5 | +generated from `docs/`. |
4 | 6 |
|
5 | | -## Structure |
| 7 | +## Quick Navigation |
6 | 8 |
|
7 | | -### knowledge/ |
| 9 | +| I want to... | Go to | |
| 10 | +|------------------------------------|------------------------| |
| 11 | +| Understand how the collection works | `knowledge/` | |
| 12 | +| Follow coding and writing standards | `guidelines/` | |
| 13 | +| Do a specific task step by step | `guides/` | |
| 14 | +| Learn why we made a decision | `adr/` | |
| 15 | +| Read the project constitution | `constitution.md` | |
| 16 | +| Use agent commands | `../.agents/commands/` | |
8 | 17 |
|
9 | | -Deep reference material extracted from the codebase. |
| 18 | +## Directory Guide |
10 | 19 |
|
11 | | -- [architecture.md](knowledge/architecture.md) — Collection structure, plugin types, data flow, key abstractions |
12 | | -- [plugin-patterns.md](knowledge/plugin-patterns.md) — Ansible-specific conventions: boilerplate, docstrings, arg specs, conditional imports, state management |
13 | | -- [infrahub-sdk-usage.md](knowledge/infrahub-sdk-usage.md) — InfrahubclientWrapper, InfrahubModule, processor classes, sync-only pattern |
| 20 | +- **constitution.md**: Pointer to the binding project principles in |
| 21 | + `.specify/memory/constitution.md`. The authoritative reference. |
| 22 | +- **knowledge/**: Descriptive reference. How the system works. |
| 23 | +- **guidelines/**: Prescriptive rules. How code and docs should be written. |
| 24 | +- **guides/**: Step-by-step procedures for specific tasks. |
| 25 | +- **adr/**: Architecture Decision Records. Why we chose what we chose. |
| 26 | + |
| 27 | +## Current Knowledge |
14 | 28 |
|
15 | | -### guidelines/ |
| 29 | +- [architecture.md](knowledge/architecture.md) — Collection layout, plugin types, data flow, key abstractions |
| 30 | +- [plugin-patterns.md](knowledge/plugin-patterns.md) — Ansible conventions: boilerplate, docstrings, arg specs, conditional imports, state management |
| 31 | +- [infrahub-sdk-usage.md](knowledge/infrahub-sdk-usage.md) — InfrahubclientWrapper, InfrahubModule, processor classes, sync-only pattern |
| 32 | +- [inventory-and-lookup.md](knowledge/inventory-and-lookup.md) — Dynamic inventory and GraphQL lookup plugins, end to end |
| 33 | +- [processors-and-arg-spec.md](knowledge/processors-and-arg-spec.md) — `INFRAHUB_ARG_SPEC`, the `deepcopy` extension pattern, and the processor class hierarchy |
16 | 34 |
|
17 | | -Standards and conventions for contributing. |
| 35 | +## Current Guidelines |
18 | 36 |
|
19 | | -- [python.md](guidelines/python.md) — Ruff config, line length 120, rule selection, format settings |
20 | | -- [testing.md](guidelines/testing.md) — Docker-based test execution, unit tests with mocks, sanity tests |
| 37 | +- [python.md](guidelines/python.md) — Ruff config, line length 120, type hints, dependencies |
| 38 | +- [testing.md](guidelines/testing.md) — Docker-based test execution, mocking, sanity/unit/integration |
21 | 39 | - [documentation.md](guidelines/documentation.md) — Doc generation pipeline, Jinja2 templates, Docusaurus, Vale |
| 40 | +- [module-docstrings.md](guidelines/module-docstrings.md) — DOCUMENTATION/EXAMPLES/RETURN rules and doc fragments |
| 41 | +- [markdown.md](guidelines/markdown.md) — Markdown conventions, file naming, markdownlint/Vale/yamllint |
22 | 42 | - [git-workflow.md](guidelines/git-workflow.md) — Branch model (develop/stable), PR conventions, CI, versioning |
23 | 43 |
|
24 | | -### guides/ |
| 44 | +## Current Guides |
25 | 45 |
|
26 | | -Step-by-step how-tos for common tasks. |
27 | | - |
28 | | -- [creating-a-module.md](guides/creating-a-module.md) — Add a new module + action plugin + tests + docs |
| 46 | +- [creating-a-module.md](guides/creating-a-module.md) — Add a new module + action/module_utils + tests + docs |
29 | 47 | - [running-tests.md](guides/running-tests.md) — Invoke tasks, Docker Compose, pytest, troubleshooting |
| 48 | +- [adding-a-doc-fragment.md](guides/adding-a-doc-fragment.md) — When and how to add a shared doc fragment |
| 49 | +- [debugging-sanity-failures.md](guides/debugging-sanity-failures.md) — Reproduce and fix `ansible-test sanity` failures |
| 50 | +- [releasing-the-collection.md](guides/releasing-the-collection.md) — Cut a release: develop→stable, automated version bump, build, and Galaxy publish |
| 51 | + |
| 52 | +## Current ADRs |
| 53 | + |
| 54 | +- [0001-two-plugin-patterns.md](adr/0001-two-plugin-patterns.md) — Module-utils vs action plugin patterns |
| 55 | +- [0002-sdk-abstraction-wrapper.md](adr/0002-sdk-abstraction-wrapper.md) — Wrap the SDK behind `InfrahubclientWrapper` |
| 56 | +- [0003-sync-only-sdk.md](adr/0003-sync-only-sdk.md) — Synchronous-only SDK usage |
| 57 | +- [0004-docker-based-testing.md](adr/0004-docker-based-testing.md) — Run all test modes in Docker via a multi-stage image |
| 58 | +- [0005-doc-generation-pipeline.md](adr/0005-doc-generation-pipeline.md) — Generate plugin reference MDX from docstrings |
30 | 59 |
|
31 | | -### commands/ |
| 60 | +## Agent Commands |
32 | 61 |
|
33 | | -Claude Code slash commands (available via `/add-module`, `/fix-bug`). |
| 62 | +Agent commands live at the repository root under |
| 63 | +[`../.agents/commands/`](../.agents/commands/): |
34 | 64 |
|
35 | | -- [add-module.md](commands/add-module.md) — Scaffold a new Ansible module |
36 | | -- [fix-bug.md](commands/fix-bug.md) — Guided bug investigation and fix workflow |
| 65 | +- [add-module](../.agents/commands/add-module.md) — Scaffold a new Ansible module |
| 66 | +- [fix-bug](../.agents/commands/fix-bug.md) — Guided bug investigation and fix workflow |
| 67 | +- `speckit.*` — Spec-kit workflow commands (specify, plan, tasks, implement, …) |
0 commit comments