mirror of
https://github.com/bitsocialnet/5chan.git
synced 2026-08-03 07:41:04 +02:00
Update AGENTS.md
This commit is contained in:
@@ -118,14 +118,15 @@ Set up these hooks for this project:
|
|||||||
| Hook | Command | Purpose |
|
| Hook | Command | Purpose |
|
||||||
|------|---------|---------|
|
|------|---------|---------|
|
||||||
| `afterFileEdit` | `npx oxfmt <file>` | Auto-format files after AI edits |
|
| `afterFileEdit` | `npx oxfmt <file>` | Auto-format files after AI edits |
|
||||||
| `stop` | `yarn lint && yarn type-check && yarn audit` | Verify code and security when agent finishes |
|
| `stop` | `yarn build && yarn lint && yarn type-check && yarn audit` | Build, verify code, and check security when agent finishes |
|
||||||
|
|
||||||
### Why Use Hooks
|
### Why Use Hooks
|
||||||
|
|
||||||
- **Consistent formatting** — Every file follows the same style
|
- **Consistent formatting** — Every file follows the same style
|
||||||
|
- **Catch build errors** — `yarn build` catches compilation errors that would break production
|
||||||
- **Catch issues early** — Lint and type errors are caught before commit/CI
|
- **Catch issues early** — Lint and type errors are caught before commit/CI
|
||||||
- **Security awareness** — `yarn audit` flags known vulnerabilities in dependencies
|
- **Security awareness** — `yarn audit` flags known vulnerabilities in dependencies
|
||||||
- **Less manual work** — No need to run `yarn prettier`, `yarn lint`, `yarn type-check`, `yarn audit` manually
|
- **Less manual work** — No need to run `yarn build`, `yarn lint`, `yarn type-check`, `yarn audit` manually
|
||||||
|
|
||||||
### Example Hook Scripts
|
### Example Hook Scripts
|
||||||
|
|
||||||
@@ -147,9 +148,10 @@ exit 0
|
|||||||
**Verify hook** (runs when agent finishes):
|
**Verify hook** (runs when agent finishes):
|
||||||
```bash
|
```bash
|
||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
# Run lint, type-check, and security audit when agent finishes
|
# Run build, lint, type-check, and security audit when agent finishes
|
||||||
|
|
||||||
cat > /dev/null # consume stdin
|
cat > /dev/null # consume stdin
|
||||||
|
echo "=== yarn build ===" && yarn build
|
||||||
echo "=== yarn lint ===" && yarn lint
|
echo "=== yarn lint ===" && yarn lint
|
||||||
echo "=== yarn type-check ===" && yarn type-check
|
echo "=== yarn type-check ===" && yarn type-check
|
||||||
echo "=== yarn audit ===" && yarn audit
|
echo "=== yarn audit ===" && yarn audit
|
||||||
|
|||||||
Reference in New Issue
Block a user