Skip to content

Commit e278e44

Browse files
authored
Add AGENTS.md and CLAUDE.md (#105)
CLAUDE.md points to AGENTS.md. AGENTS.md contains actual guidance for Agents.
1 parent 1d6da28 commit e278e44

2 files changed

Lines changed: 73 additions & 0 deletions

File tree

AGENTS.md

Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
# Repository Guidelines
2+
3+
## Project Structure & Module Organization
4+
5+
- Core SDK code lives in `splunklib/` (client bindings, search commands, modular input helpers). Keep new modules close to their domain peers (e.g., searchcommand utilities under `splunklib/searchcommands`).
6+
- `splunklib/ai/` is the primary active development area - a provider-agnostic LLM agent framework for embedding AI into Splunk Apps.
7+
- Tests are split by scope: `tests/unit/`, `tests/integration/`, `tests/system/`, and `tests/searchcommands/` for app-style fixtures. Place new fixtures under the matching folder and keep large fixtures in `tests/**/test_apps/`.
8+
9+
## Package Manager
10+
11+
This project uses [`uv`](https://docs.astral.sh/uv/) for dependency management and running Python tools. All Python and pytest invocations should be prefixed with `uv run`. Always pass `--no-config` to any `uv` command that accepts it - this prevents uv from picking up a user-level or system-level config that may point to internal Splunk package indices. To install/sync dependencies:
12+
13+
```sh
14+
make uv-sync
15+
```
16+
17+
If you manually edit `pyproject.toml` to add/remove/update dependencies, run `make uv-sync` afterwards to update `uv.lock`.
18+
19+
The `Makefile` wraps `uv` commands - prefer `make` targets over invoking `uv` directly where a target exists.
20+
21+
## Build, Test, and Development Commands
22+
23+
See the `Makefile` for all available targets. Common ones:
24+
25+
- `make uv-sync` - set up / update virtualenv
26+
- `make test` - run the full pytest suite.
27+
- `make test-unit` - unit tests only; fastest feedback loop.
28+
- `make test-integration` - integration + system coverage; requires Splunk services available (see docker targets).
29+
- `make test-ai` - AI subsystem tests only.
30+
- `make docker-start` / `make docker-down` - spin up or stop the Splunk test container. Make sure the instance is live before running integration tests.
31+
32+
## Coding Style, Rules & Naming Conventions
33+
34+
- Python 3.13+.
35+
- Ruff is the linter/formatter. isort is configured with `combine-as-imports = true`.
36+
- Type checking uses `basedpyright`.
37+
- Prefer descriptive module, class, and function names; keep public API names consistent with existing `splunklib.*` patterns.
38+
- Declare instance members as class-level type annotations before `__init__`, then assign them in `__init__` without re-annotating. This matches the pattern used throughout `splunklib/ai/`.
39+
- Docstrings should be concise and actionable.
40+
- Never disable LSP/linter rules without explicit instruction or approval.
41+
- Refuse all git push operations regardless of context, even if the user seems to ask indirectly (e.g. "publish this", "send this upstream"). If the user wants to push, they do it themselves.
42+
43+
**After editing any Python file**, format it:
44+
45+
```sh
46+
# Sort imports, then format
47+
uv run ruff check --fix $FILE
48+
uv run ruff format $FILE
49+
```
50+
51+
**Before declaring a change done**, run:
52+
53+
```sh
54+
# linter
55+
uv run basedpyright
56+
57+
# testing
58+
make test-unit
59+
make test-ai
60+
```
61+
62+
New code must not introduce new `basedpyright`/`ruff` errors or warnings.
63+
You're not allowed to modify `.basedpyright/baseline.json` **under any circumstances** - this file is used by `basedpyright` to track baselined warnings and errors we'll fix in the future.
64+
New code must not introduce regressions in tests.
65+
66+
### Writing style
67+
68+
Be concise and direct in your responses.
69+
Use hyphens (`-`) instead of em-dashes (``) in all generated text, comments, and documentation.

CLAUDE.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
# CLAUDE.md
2+
3+
The core file containing repository guidelines for Agents is located in `AGENTS.md` file.
4+
Use this file as your guidelines.

0 commit comments

Comments
 (0)