Skip to content

Commit 6a22041

Browse files
committed
chore: install ai conventions
1 parent 19d6a98 commit 6a22041

3 files changed

Lines changed: 134 additions & 0 deletions

File tree

.claude/ardenthq/core.md

Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
<!-- airc v0.3.0 — managed file, do not edit -->
2+
<!-- Local override: CLAUDE.local.md. Per-repo override: below the @imports in CLAUDE.md. Permanent override: PR to https://github.com/ardenthq/airc -->
3+
4+
# Baseline
5+
6+
Shared rules for every repo. Apply to any stack.
7+
8+
## Commits
9+
10+
- Format: [Conventional Commits](https://www.conventionalcommits.org)`feat:`, `fix:`, `chore:`, `style:`, `refactor:`, `test:`, `docs:`
11+
- Subject line only, ideally under 50 characters
12+
- Human, direct tone. Avoid formal or robotic voice ("this commit introduces…", "this change implements…")
13+
- **Never** add `Co-Authored-By` or any mention of Claude / AI / agents
14+
- **Never** add a description or body — subject only
15+
- Commit incrementally when a logical chunk lands — don't batch everything at the end
16+
- Examples: `feat: scaffold composer package`, `fix: stack detection for inertia`
17+
18+
## Pull Requests
19+
20+
- Always draft (`gh pr create --draft`)
21+
- Base branch: the repo's default
22+
- If the repo has a `.github/PULL_REQUEST_TEMPLATE.md`, fill it in as the PR body and check off the items that apply. `gh pr create` ignores the template unless you pass it yourself — write the filled body to a file and use `--body-file`
23+
- **Never** reference Claude / AI / agents in title, body, branch name, or comments
24+
25+
## Pre-push checks
26+
27+
Standard order before pushing:
28+
29+
1. Formatter → 2. Linter → 3. Static analysis → 4. Tests
30+
31+
Exact commands are repo-defined (see the repo's `CLAUDE.md` / `composer.json` / `package.json`). If the formatter modifies files, commit those changes before pushing so CI doesn't kick back automated `style:` cleanup commits.
32+
33+
**Mid-task (recommendation):** for long tasks, run only affected/new checks during the work; defer the full suite to the end. For short tasks, skip intermediate runs. Don't run checks repeatedly mid-work — once at completion is usually enough.
34+
35+
## Security
36+
37+
- Never commit `.env`, credentials, tokens, or any secret
38+
- Flag any new dependency as suspect before adding it (typosquatting, unknown maintainer, etc.)
39+
- No destructive operations (`force-push`, branch deletion, history rewrite, `git reset --hard`, `rm -rf`) without explicit confirmation from the dev
40+
- For external tools (CI, pastebins, gists): consider whether uploaded content could be sensitive — it may be cached or indexed even if later deleted
41+
42+
## Code style
43+
44+
- Follow existing patterns before introducing new ones
45+
- Reuse existing components/helpers before writing new ones
46+
- No comments unless explaining a non-obvious **why** (a hidden constraint, a subtle invariant, a workaround for a specific bug)
47+
- Well-named identifiers > a comment explaining the "what"
48+
- **Don't document changes in comments.** Comments describe the code as it is, not how it got there:
49+
-`// moved from backend to frontend`
50+
-`// renamed from foo to bar`
51+
-`// replaces the previous logic that used X`
52+
-`// added for issue #123`
53+
- ✅ omit the comment — git log / PR tells the story
54+
- Don't reference callers or temporal context: no `// used by X`, `// for the Y flow`, `// added in sprint Z`
55+
56+
## Claude reply style
57+
58+
- Concise. Skip the obvious.
59+
- End-of-turn summary: one or two sentences — what changed, what's next.
60+
- No long essays, no unnecessary disclaimers, no "sure, happy to help…"
61+
62+
## Overrides
63+
64+
- Personal override: create `CLAUDE.local.md` (gitignored)
65+
- Per-repo override: add rules below the `@imports` in this repo's `CLAUDE.md`
66+
- Permanent shared override: PR against the upstream guidelines repo

.gitignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,3 +11,7 @@ coverage.xml
1111
.vs
1212
.vscode
1313
/.venv/
14+
15+
# airc
16+
CLAUDE.local.md
17+
.claude/settings.local.json

CLAUDE.md

Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
@.claude/ardenthq/core.md
2+
# python-client - Mainsail Blockchain API Client
3+
4+
## Project Overview
5+
6+
Python API client for the ARK/Mainsail blockchain. Wraps the Mainsail REST API with resource classes for wallets, transactions, blocks, validators, commits, contracts, EVM, and more.
7+
8+
## Tech Stack
9+
10+
- **Language**: Python
11+
- **HTTP**: requests + backoff (retry with exponential backoff)
12+
- **Testing**: pytest + pytest-cov + pytest-responses
13+
- **Linting**: flake8
14+
15+
## Directory Structure
16+
17+
- `client/client.py` - Main client class (`ArkClient`), entry point for all API resources
18+
- `client/connection.py` - HTTP connection handler (GET/POST with retries), `Session`, `Connection`, `ClientHosts`
19+
- `client/resource.py` - Abstract base class for all API resources
20+
- `client/exceptions.py` - `ArkHTTPException`
21+
- `client/api/` - Resource classes (one per API domain):
22+
- `api_nodes.py`, `blockchain.py`, `blocks.py`, `commits.py`, `contracts.py`, `evm.py`, `node.py`, `peers.py`, `receipts.py`, `rounds.py`, `transactions.py`, `validators.py`, `votes.py`, `wallets.py`
23+
- `tests/` - Tests mirroring client structure
24+
- `Makefile` - `make test` and `make lint`
25+
26+
## Key Patterns
27+
28+
- **Resource classes** extend `Resource` base class, use `self.with_endpoint("api").request_get(path, params)`
29+
- **Fluent endpoint selection**: `.with_endpoint("api" | "transactions" | "evm")`
30+
- **ClientHosts**: TypedDict with `api`, `transactions` (optional), `evm` (optional) hosts
31+
- **Pagination**: most list methods accept `page` and `limit` params
32+
33+
## Branches
34+
35+
- Base branch: `feat/mainsail` (always use this as base for PRs)
36+
- **Always create a new branch** from `feat/mainsail` before starting any task
37+
- Branch names follow conventional commit prefixes: `feat/`, `fix/`, `chore/`, `refactor/`, `style/`, `docs/`, `test/`
38+
- Use short, descriptive kebab-case names after the prefix
39+
40+
## Testing
41+
42+
- Run tests: `make test` or `pytest -v -s`
43+
- Run lint: `make lint` or `flake8 .`
44+
- **100% code coverage is required** — CI enforces `--cov-fail-under=100`
45+
- Flake8 config: `max-line-length = 100` (in `setup.cfg`)
46+
47+
## After completing a task, ALWAYS run these checks (in order)
48+
49+
1. `make lint` - flake8
50+
2. `make test` - pytest (must pass with 100% coverage)
51+
52+
## Commits
53+
54+
- **Commit as you progress** — make commits incrementally as you complete logical chunks of work, don't wait until the end
55+
- Use conventional commits (feat:, fix:, chore:, style:, refactor:, etc.)
56+
- NEVER add Co-Authored-By or any collaborator line
57+
- NEVER add description/body to commits, ONLY the subject line
58+
- Keep commit messages SHORT — ideally under 50 chars, never long
59+
- Write commit messages naturally like a human would, not overly polished or perfect. Quick and casual is fine, minor typos are ok
60+
- Examples of good commit messages:
61+
- `feat: add wallet search endpoint`
62+
- `fix: wrong query param encoding`
63+
- `chore: update deps`
64+
- `refactor: extract shared pagination logic`

0 commit comments

Comments
 (0)