@ardenthq/airc 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +67 -0
- package/guidelines/core.md +65 -0
- package/guidelines/js.md +39 -0
- package/guidelines/php.md +75 -0
- package/guidelines/recommended.yaml +44 -0
- package/package.json +46 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 ArdentHQ
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
# airc
|
|
2
|
+
|
|
3
|
+
> Shared CLAUDE.md conventions for Ark/ArdentHQ repos, delivered by a single CLI.
|
|
4
|
+
|
|
5
|
+
Single source of truth for AI/agent conventions across the Ark/ArdentHQ ecosystem. One CLI works in any repo, whatever the stack — PHP, JS, Rust, and more.
|
|
6
|
+
|
|
7
|
+
## Philosophy
|
|
8
|
+
|
|
9
|
+
The goal is a small, shared baseline of AI instructions that every repo can pull in and that ages well — not a style guide.
|
|
10
|
+
|
|
11
|
+
**What belongs here**
|
|
12
|
+
|
|
13
|
+
- Preferences and conventions that aren't obvious: how commits, PRs, and overrides should work, and the few code habits a model wouldn't already follow.
|
|
14
|
+
- Rules that are universal and stable — true across stacks, and likely still true in six months.
|
|
15
|
+
- A clean separation: `guidelines/` holds rules for the AI; `recommended.yaml` holds tools to suggest installing. Never "install X" inside a guideline.
|
|
16
|
+
|
|
17
|
+
**What doesn't**
|
|
18
|
+
|
|
19
|
+
- Anything the linter, formatter, type system, or the model already enforces. If a tool can catch it, let the tool catch it.
|
|
20
|
+
- Project-specific detail (paths, scripts, gotchas) — that lives in each repo's own `CLAUDE.md`, below the imports.
|
|
21
|
+
- Personal preference — that goes in a gitignored `CLAUDE.local.md`.
|
|
22
|
+
- Volume. Fewer rules age better; when in doubt, leave it out. A stale rule the model follows literally is worse than no rule.
|
|
23
|
+
|
|
24
|
+
**How it behaves**
|
|
25
|
+
|
|
26
|
+
- Non-invasive and layered: the CLI only writes `.claude/ardenthq/*` and the `@import` lines — everything else in your `CLAUDE.md` is yours. Overrides go weakest to strongest: the managed baseline, then your repo's `CLAUDE.md`, then `CLAUDE.local.md`.
|
|
27
|
+
- Universal by default: rules read so that anyone could adopt them, not just this org.
|
|
28
|
+
|
|
29
|
+
## Usage
|
|
30
|
+
|
|
31
|
+
Run the installer once in a repo (needs Node ≥18):
|
|
32
|
+
|
|
33
|
+
```bash
|
|
34
|
+
npx @ardenthq/airc install
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
It writes the guideline files to `.claude/ardenthq/`, adds the matching `@import` lines to your `CLAUDE.md` (creating it if missing), ignores `CLAUDE.local.md`, and prints recommended tools that aren't installed yet. Set `AIRC_QUIET=1` to hide the recommendations.
|
|
38
|
+
|
|
39
|
+
Flags: `--path <dir>` to target another directory, `--no-gitignore` to skip the `.gitignore` edit.
|
|
40
|
+
|
|
41
|
+
### Keep it in sync
|
|
42
|
+
|
|
43
|
+
`update` re-syncs the managed `.claude/ardenthq/` files only — it never touches your `CLAUDE.md` or `.gitignore`. Wire it into the repo's native hook so it refreshes automatically:
|
|
44
|
+
|
|
45
|
+
```jsonc
|
|
46
|
+
// composer.json (PHP)
|
|
47
|
+
"scripts": { "post-update-cmd": ["npx @ardenthq/airc update"] }
|
|
48
|
+
|
|
49
|
+
// package.json (JS/TS)
|
|
50
|
+
"scripts": { "postinstall": "npx @ardenthq/airc update" }
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
For other stacks, run `npx @ardenthq/airc update` from a git hook or CI step.
|
|
54
|
+
|
|
55
|
+
`npx` caches by version — use `npx @ardenthq/airc@latest …` to be sure you're on the current release. In CI, `airc check` exits non-zero when the managed files drift or fall behind, so a stale or hand-edited baseline fails the build.
|
|
56
|
+
|
|
57
|
+
## Security
|
|
58
|
+
|
|
59
|
+
If you discover a security vulnerability, please email <security@ardenthq.com>. All reports will be promptly addressed.
|
|
60
|
+
|
|
61
|
+
## Credits
|
|
62
|
+
|
|
63
|
+
This project exists thanks to all the people who [contribute](../../contributors).
|
|
64
|
+
|
|
65
|
+
## License
|
|
66
|
+
|
|
67
|
+
[MIT](LICENSE) © [ArdentHQ](https://ardenthq.com)
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
<!-- airc v{{VERSION}} — 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
|
+
- **Never** reference Claude / AI / agents in title, body, branch name, or comments
|
|
23
|
+
|
|
24
|
+
## Pre-push checks
|
|
25
|
+
|
|
26
|
+
Standard order before pushing:
|
|
27
|
+
|
|
28
|
+
1. Formatter → 2. Linter → 3. Static analysis → 4. Tests
|
|
29
|
+
|
|
30
|
+
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.
|
|
31
|
+
|
|
32
|
+
**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.
|
|
33
|
+
|
|
34
|
+
## Security
|
|
35
|
+
|
|
36
|
+
- Never commit `.env`, credentials, tokens, or any secret
|
|
37
|
+
- Flag any new dependency as suspect before adding it (typosquatting, unknown maintainer, etc.)
|
|
38
|
+
- No destructive operations (`force-push`, branch deletion, history rewrite, `git reset --hard`, `rm -rf`) without explicit confirmation from the dev
|
|
39
|
+
- For external tools (CI, pastebins, gists): consider whether uploaded content could be sensitive — it may be cached or indexed even if later deleted
|
|
40
|
+
|
|
41
|
+
## Code style
|
|
42
|
+
|
|
43
|
+
- Follow existing patterns before introducing new ones
|
|
44
|
+
- Reuse existing components/helpers before writing new ones
|
|
45
|
+
- No comments unless explaining a non-obvious **why** (a hidden constraint, a subtle invariant, a workaround for a specific bug)
|
|
46
|
+
- Well-named identifiers > a comment explaining the "what"
|
|
47
|
+
- **Don't document changes in comments.** Comments describe the code as it is, not how it got there:
|
|
48
|
+
- ❌ `// moved from backend to frontend`
|
|
49
|
+
- ❌ `// renamed from foo to bar`
|
|
50
|
+
- ❌ `// replaces the previous logic that used X`
|
|
51
|
+
- ❌ `// added for issue #123`
|
|
52
|
+
- ✅ omit the comment — git log / PR tells the story
|
|
53
|
+
- Don't reference callers or temporal context: no `// used by X`, `// for the Y flow`, `// added in sprint Z`
|
|
54
|
+
|
|
55
|
+
## Claude reply style
|
|
56
|
+
|
|
57
|
+
- Concise. Skip the obvious.
|
|
58
|
+
- End-of-turn summary: one or two sentences — what changed, what's next.
|
|
59
|
+
- No long essays, no unnecessary disclaimers, no "sure, happy to help…"
|
|
60
|
+
|
|
61
|
+
## Overrides
|
|
62
|
+
|
|
63
|
+
- Personal override: create `CLAUDE.local.md` (gitignored)
|
|
64
|
+
- Per-repo override: add rules below the `@imports` in this repo's `CLAUDE.md`
|
|
65
|
+
- Permanent shared override: PR against the upstream guidelines repo
|
package/guidelines/js.md
ADDED
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
<!-- airc v{{VERSION}} — managed file, do not edit -->
|
|
2
|
+
|
|
3
|
+
# JavaScript / TypeScript
|
|
4
|
+
|
|
5
|
+
Code-writing rules for JS/TS files. Apply when writing or editing JS/TS code.
|
|
6
|
+
|
|
7
|
+
## Types
|
|
8
|
+
|
|
9
|
+
- TypeScript in strict mode. Don't disable strict checks per file.
|
|
10
|
+
- Avoid `any` — use `unknown` and narrow, or a precise type.
|
|
11
|
+
- Add explicit return types to exported functions.
|
|
12
|
+
- Prefer `type` aliases; use `interface` only when you need declaration merging.
|
|
13
|
+
- Keep shared/exported types in a dedicated `*.types.ts` file, not scattered across unrelated modules.
|
|
14
|
+
|
|
15
|
+
## Syntax
|
|
16
|
+
|
|
17
|
+
- Named exports over default exports (except where a framework requires default, e.g. a Next.js page).
|
|
18
|
+
- Use curly braces for every control structure, even single-line bodies.
|
|
19
|
+
|
|
20
|
+
## Comments
|
|
21
|
+
|
|
22
|
+
- No comments unless explaining a non-obvious **why** (see `core.md`).
|
|
23
|
+
- Well-named identifiers over a comment explaining the "what".
|
|
24
|
+
|
|
25
|
+
## Package manager
|
|
26
|
+
|
|
27
|
+
- Prefer **pnpm** over `npm` or `yarn`.
|
|
28
|
+
|
|
29
|
+
## Scripts
|
|
30
|
+
|
|
31
|
+
Use the standard scripts; don't invoke the underlying tool directly:
|
|
32
|
+
|
|
33
|
+
- `pnpm format` — formatter (Prettier)
|
|
34
|
+
- `pnpm lint` — linter (ESLint)
|
|
35
|
+
- `pnpm test` / `pnpm test:coverage` — tests
|
|
36
|
+
|
|
37
|
+
## Avoid
|
|
38
|
+
|
|
39
|
+
- Mutating arguments or inputs — take them immutable, return new values.
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
<!-- airc v{{VERSION}} — managed file, do not edit -->
|
|
2
|
+
|
|
3
|
+
# PHP
|
|
4
|
+
|
|
5
|
+
Code-writing rules for PHP files. Apply when writing or editing PHP code. In Laravel apps these rules layer on top of whatever `laravel/boost` provides.
|
|
6
|
+
|
|
7
|
+
## Types
|
|
8
|
+
|
|
9
|
+
- Declare `strict_types=1` at the top of every PHP file.
|
|
10
|
+
- Add explicit return type declarations to every method.
|
|
11
|
+
- Add type hints to every parameter.
|
|
12
|
+
- Use union and intersection types when they fit. Avoid `mixed` unless genuinely unbounded.
|
|
13
|
+
- Use `readonly` properties when the value doesn't change after construction.
|
|
14
|
+
|
|
15
|
+
## Syntax
|
|
16
|
+
|
|
17
|
+
- Use PHP 8 constructor property promotion. Don't leave empty `__construct()` methods.
|
|
18
|
+
- Use curly braces for every control structure, even single-line bodies.
|
|
19
|
+
- Use `match` instead of `switch` when assigning a value or returning early.
|
|
20
|
+
- Use first-class callable syntax (`Foo::bar(...)`) over closures wrapping a single call.
|
|
21
|
+
- Use named arguments when a call has multiple booleans or optional params and clarity beats brevity.
|
|
22
|
+
|
|
23
|
+
## Enums
|
|
24
|
+
|
|
25
|
+
- Use enum classes for fixed sets of values; don't use string constants on a class.
|
|
26
|
+
- TitleCase for enum case keys: `FavoritePerson`, `Monthly`.
|
|
27
|
+
|
|
28
|
+
## Comments and PHPDoc
|
|
29
|
+
|
|
30
|
+
- Prefer PHPDoc blocks over inline comments. Inline comments only for non-obvious WHY (see `core.md` rules on comments).
|
|
31
|
+
- Use array shape definitions in PHPDoc for structured arrays:
|
|
32
|
+
|
|
33
|
+
```php
|
|
34
|
+
/** @return array{name: string, age: int} */
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
## PHP 8.4+ array helpers
|
|
38
|
+
|
|
39
|
+
Prefer the built-in helpers over manual loops:
|
|
40
|
+
|
|
41
|
+
- `array_find` over `foreach` + early return
|
|
42
|
+
- `array_find_key` over manual key lookup
|
|
43
|
+
- `array_any` / `array_all` over `foreach` + boolean accumulator
|
|
44
|
+
|
|
45
|
+
## Method chaining on new instances (PHP 8.4+)
|
|
46
|
+
|
|
47
|
+
Chain directly without wrapping in parentheses:
|
|
48
|
+
|
|
49
|
+
```php
|
|
50
|
+
// avoid: $d = (new DateTime('now'))->modify('+1 day');
|
|
51
|
+
$d = new DateTime('now')->modify('+1 day');
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
## Composer scripts
|
|
55
|
+
|
|
56
|
+
Use the standard scripts; don't invoke the underlying tool directly:
|
|
57
|
+
|
|
58
|
+
- `composer format` — formatter (Pint)
|
|
59
|
+
- `composer analyse` — static analysis (phpstan)
|
|
60
|
+
- `composer test` / `composer test:coverage` — tests (Pest)
|
|
61
|
+
|
|
62
|
+
If a script is missing, add it to `composer.json`:
|
|
63
|
+
|
|
64
|
+
```json
|
|
65
|
+
"scripts": {
|
|
66
|
+
"format": "vendor/bin/pint",
|
|
67
|
+
"analyse": "vendor/bin/phpstan analyse",
|
|
68
|
+
"test": "vendor/bin/pest"
|
|
69
|
+
}
|
|
70
|
+
```
|
|
71
|
+
|
|
72
|
+
## Avoid
|
|
73
|
+
|
|
74
|
+
- Mutating function arguments — take immutable inputs, return new values.
|
|
75
|
+
- Static state (singletons, statics for caching). Prefer dependency injection.
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
# Optional recommendations the CLI prints after install.
|
|
2
|
+
# Filters: `stacks` empty = any repo; populated = only those stacks.
|
|
3
|
+
# Skip the recommendation if any `detect` rule resolves true.
|
|
4
|
+
|
|
5
|
+
skills:
|
|
6
|
+
- name: caveman
|
|
7
|
+
description: Compresses Claude's output (~65% token savings)
|
|
8
|
+
install: curl -fsSL https://raw.githubusercontent.com/JuliusBrussee/caveman/main/install.sh | bash
|
|
9
|
+
detect:
|
|
10
|
+
paths:
|
|
11
|
+
- ~/.claude/plugins/cache/caveman
|
|
12
|
+
- ~/.claude/skills/caveman
|
|
13
|
+
scope: user
|
|
14
|
+
stacks: []
|
|
15
|
+
|
|
16
|
+
composer:
|
|
17
|
+
- name: laravel/boost
|
|
18
|
+
description: Laravel-aware AI guidelines and MCP server (covers Laravel patterns we intentionally don't duplicate)
|
|
19
|
+
install: composer require --dev laravel/boost && php artisan boost:install
|
|
20
|
+
detect:
|
|
21
|
+
composerJson: laravel/boost
|
|
22
|
+
stacks: [laravel]
|
|
23
|
+
|
|
24
|
+
- name: laravel/pint
|
|
25
|
+
description: Standalone code formatter (works without Laravel). Backs `composer format`.
|
|
26
|
+
install: composer require --dev laravel/pint
|
|
27
|
+
detect:
|
|
28
|
+
composerJson: laravel/pint
|
|
29
|
+
stacks: [php]
|
|
30
|
+
|
|
31
|
+
npm:
|
|
32
|
+
- name: prettier
|
|
33
|
+
description: Code formatter. Backs `pnpm format`.
|
|
34
|
+
install: pnpm add -D prettier
|
|
35
|
+
detect:
|
|
36
|
+
npmJson: prettier
|
|
37
|
+
stacks: [js]
|
|
38
|
+
|
|
39
|
+
- name: eslint
|
|
40
|
+
description: Linter (pair with typescript-eslint on TS projects). Backs `pnpm lint`.
|
|
41
|
+
install: pnpm add -D eslint typescript-eslint
|
|
42
|
+
detect:
|
|
43
|
+
npmJson: eslint
|
|
44
|
+
stacks: [js]
|
package/package.json
ADDED
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@ardenthq/airc",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"description": "Shared Claude conventions for Ark/ArdentHQ repos — writes guideline files into a consumer repo's .claude/ardenthq/ and wires up the CLAUDE.md imports.",
|
|
5
|
+
"license": "MIT",
|
|
6
|
+
"type": "module",
|
|
7
|
+
"bin": {
|
|
8
|
+
"airc": "dist/cli.js"
|
|
9
|
+
},
|
|
10
|
+
"files": [
|
|
11
|
+
"dist",
|
|
12
|
+
"guidelines"
|
|
13
|
+
],
|
|
14
|
+
"engines": {
|
|
15
|
+
"node": ">=18"
|
|
16
|
+
},
|
|
17
|
+
"packageManager": "pnpm@10.0.0",
|
|
18
|
+
"scripts": {
|
|
19
|
+
"build": "tsup",
|
|
20
|
+
"format": "prettier --write \"**/*.{md,yaml,yml,json}\"",
|
|
21
|
+
"format:check": "prettier --check \"**/*.{md,yaml,yml,json}\"",
|
|
22
|
+
"lint": "eslint .",
|
|
23
|
+
"typecheck": "tsc --noEmit",
|
|
24
|
+
"test": "vitest run",
|
|
25
|
+
"test:coverage": "vitest run --coverage"
|
|
26
|
+
},
|
|
27
|
+
"dependencies": {
|
|
28
|
+
"yaml": "^2.6.1"
|
|
29
|
+
},
|
|
30
|
+
"pnpm": {
|
|
31
|
+
"onlyBuiltDependencies": [
|
|
32
|
+
"esbuild"
|
|
33
|
+
]
|
|
34
|
+
},
|
|
35
|
+
"devDependencies": {
|
|
36
|
+
"@eslint/js": "^9.17.0",
|
|
37
|
+
"@types/node": "^22.10.2",
|
|
38
|
+
"@vitest/coverage-v8": "^3.2.4",
|
|
39
|
+
"eslint": "^9.17.0",
|
|
40
|
+
"prettier": "^3.4.0",
|
|
41
|
+
"tsup": "^8.3.5",
|
|
42
|
+
"typescript": "^5.7.2",
|
|
43
|
+
"typescript-eslint": "^8.18.1",
|
|
44
|
+
"vitest": "^3.2.4"
|
|
45
|
+
}
|
|
46
|
+
}
|