Skip to content

Commit 6e8b9c7

Browse files
authored
Merge pull request #10 from RickCogley/feat/devkit-baseline
chore: adopt devkit baseline (CI, security, Claude rules) + fix 2 type errors
2 parents 5c2774c + 5e7098a commit 6e8b9c7

10 files changed

Lines changed: 1005 additions & 17 deletions

File tree

.claude/rules/change-management.md

Lines changed: 108 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,108 @@
1+
# Change Management Rule (ISO 27001)
2+
3+
All code and content changes must follow a traceable workflow that an auditor
4+
can verify: **issue → branch → PR → merge → verify**.
5+
6+
## Standard Workflow
7+
8+
Every change that modifies behavior, configuration, content, or dependencies:
9+
10+
1. **Issue first.** Create a GitHub issue describing the change before starting
11+
work. If an issue already exists, reference it.
12+
2. **Branch.** Create a feature branch from `main` named
13+
`{type}/{short-description}` (e.g., `feat/engagement-model`,
14+
`fix/css-banner-edge-case`).
15+
3. **Work.** Make changes on the branch. Run preflight checks before committing.
16+
4. **PR.** Create a pull request linking to the issue with `Closes #N` or
17+
`Fixes #N` in the body. PR body must include a Summary and Test Plan.
18+
5. **Merge.** Merge with `gh pr merge --admin --merge --delete-branch` (org
19+
policy blocks auto-merge; admin override is authorized for the repo owner).
20+
6. **Post-merge verification.** After every merge to main:
21+
- Check GitHub CI: `gh run list --limit 3`
22+
- Check Cloudflare build logs (docs site deploys to CF Workers): verify the
23+
build succeeds
24+
- Check Dependabot:
25+
`gh api repos/RickCogley/hibana/dependabot/alerts --jq '[.[] | select(.state=="open")] | length'`
26+
— address any new alerts
27+
7. **Release.** Releases are created periodically via
28+
`gh release create v<x.y.z>` with hand-written notes. **deno.land/x**
29+
auto-publishes from the tag via webhook (no GitHub Action involvement). JSR
30+
is intentionally not used — Lume's dev resists JSR because JSR doesn't
31+
support http imports, and hibana follows Lume's hosting choice so it can be
32+
pulled into Lume cleanly.
33+
34+
## Branching correctly
35+
36+
Use `git switch -c <branch>` from main, NOT
37+
`git checkout origin/main -b <branch>` (the latter sets the upstream to
38+
`origin/main`, which can cause `git push -u origin <branch>` to push directly to
39+
main and bypass review).
40+
41+
```bash
42+
git switch main && git pull --ff-only
43+
git switch -c feat/whatever
44+
# ...work...
45+
git push -u origin HEAD
46+
```
47+
48+
Pre-push sanity check on a new branch:
49+
50+
```bash
51+
git branch -vv
52+
# Current branch should NOT show [origin/main] or any [origin/something-else]
53+
# upstream. An unset upstream (no brackets) is what you want.
54+
```
55+
56+
## Writing PR and issue bodies
57+
58+
Always pass multi-line or markdown-rich bodies **by file**, never inline via a
59+
heredoc:
60+
61+
```bash
62+
gh pr create --body-file <path>
63+
gh pr edit N --body-file <path>
64+
gh issue create --body-file <path>
65+
git commit -F <path>
66+
```
67+
68+
Heredocs cause backslash artifacts in rendered markdown.
69+
70+
## Conventional Commits
71+
72+
```
73+
type(scope): description
74+
75+
Body explaining the change (if needed).
76+
77+
InfoSec: [security/quality/privacy consideration]
78+
```
79+
80+
**Types:** `feat`, `fix`, `docs`, `style`, `refactor`, `test`, `chore`
81+
82+
**InfoSec line** — required for all changes. Examples:
83+
84+
- `InfoSec: input validation added for user-supplied query parameters`
85+
- `InfoSec: no security impact — content-only change`
86+
- `InfoSec: dependency update addresses CVE-2026-XXXX`
87+
88+
If a change has no security implications, state that explicitly.
89+
90+
## Rationale
91+
92+
This workflow produces the evidence chain that ISO 27001 (A.8.9, A.8.25, A.8.32)
93+
requires:
94+
95+
- **Change request** → GitHub issue
96+
- **Authorization** → PR review and merge approval
97+
- **Testing** → CI checks
98+
- **Implementation** → Commits on feature branch
99+
- **Verification** → Post-merge CI confirmation
100+
101+
An auditor can trace any production change from PR → issue → commits → CI
102+
results.
103+
104+
---
105+
106+
_Originally synced from
107+
[eSolia/devkit](https://github.com/eSolia/devkit)/.claude/shared-rules/change-management.md.
108+
This repo is not a devkit sync consumer — edit locally as needed._

.github/dependabot.yml

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
version: 2
2+
updates:
3+
- package-ecosystem: "github-actions"
4+
directory: "/"
5+
schedule:
6+
interval: "weekly"
7+
day: "monday"
8+
labels:
9+
- "dependencies"
10+
- "github-actions"
11+
commit-message:
12+
prefix: "chore"
13+
include: "scope"
14+
15+
- package-ecosystem: "npm"
16+
directory: "/docs-site"
17+
schedule:
18+
interval: "weekly"
19+
day: "monday"
20+
labels:
21+
- "dependencies"
22+
- "docs-site"
23+
commit-message:
24+
prefix: "chore"
25+
include: "scope"

.github/workflows/ci.yml

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
branches: [main]
6+
pull_request:
7+
branches: [main]
8+
9+
permissions:
10+
contents: read
11+
12+
concurrency:
13+
group: ci-${{ github.ref }}
14+
cancel-in-progress: ${{ github.event_name == 'pull_request' }}
15+
16+
jobs:
17+
verify:
18+
name: Verify (fmt / lint / check)
19+
runs-on: ubuntu-latest
20+
steps:
21+
- uses: actions/checkout@v4
22+
23+
- name: Setup Deno
24+
uses: denoland/setup-deno@v2
25+
with:
26+
deno-version: "2.x"
27+
28+
- name: Format check
29+
run: deno fmt --check
30+
31+
- name: Lint
32+
run: deno lint
33+
34+
- name: Type check (mod.ts only)
35+
# Scoped to mod.ts because the **/*.ts glob picks up docs-site/ Astro
36+
# internals and root-level scripts that produce 11k+ unrelated errors.
37+
# Tests intentionally excluded — 7 pre-existing failures tracked
38+
# separately. See follow-up issue.
39+
run: deno task check

0 commit comments

Comments
 (0)