Skip to content

Commit a9fde04

Browse files
gold-ak47claude
andcommitted
docs: Add pre-push checks, publishing, and auth patterns to CLAUDE.md
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 1061114 commit a9fde04

1 file changed

Lines changed: 25 additions & 0 deletions

File tree

CLAUDE.md

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,8 +70,33 @@ mise run test # cargo test
7070
mise run lint # clippy + fmt check
7171
```
7272

73+
**IMPORTANT:** Before pushing, ALWAYS run these checks:
74+
```bash
75+
cargo fmt # Fix formatting (CI enforces cargo fmt --check)
76+
cargo clippy # Catch lint warnings
77+
cargo test # Run tests
78+
cargo build # Verify it compiles
79+
```
80+
CI will reject the push if `cargo fmt --check` fails. Fix formatting BEFORE committing.
81+
7382
**IMPORTANT:** After ANY code change, always build and install immediately:
7483
```bash
7584
mise run install
7685
```
7786
This ensures the user's `treble` binary in PATH is always up to date.
87+
88+
## Publishing
89+
90+
- Pushes to `main` trigger semantic-release via GitHub Actions
91+
- Commit prefixes: `fix:` → patch, `feat:` → minor, `BREAKING CHANGE` → major
92+
- `chore:`, `docs:`, `style:`, `test:`, `ci:` do NOT trigger a release
93+
- CI cross-compiles for darwin-arm64/x64 + linux-x64/arm64, publishes to npm as `@treble-app/cli`
94+
95+
## Auth
96+
97+
The CLI supports two token types for Figma API:
98+
- **OAuth** (`treble login` device flow): uses `Authorization: Bearer` header
99+
- **PAT** (`treble login --pat`): uses `X-Figma-Token` header
100+
101+
`GlobalConfig::figma_client()` auto-detects which to use based on `session_token` presence.
102+
`FigmaClient::new()` = PAT, `FigmaClient::new_oauth()` = OAuth Bearer.

0 commit comments

Comments
 (0)