Skip to content

Commit 8ac7729

Browse files
authored
Merge pull request #4 from eSolia/feat/devkit-baseline
chore: adopt devkit baseline (CI, security, JSR publish hygiene)
2 parents dce9fd2 + b53b860 commit 8ac7729

11 files changed

Lines changed: 833 additions & 10 deletions

File tree

.claude/rules/change-management.md

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

.github/workflows/publish.yml

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
name: Publish to JSR
2+
3+
on:
4+
push:
5+
tags:
6+
- 'v*'
7+
workflow_dispatch:
8+
9+
permissions:
10+
contents: read
11+
id-token: write
12+
13+
jobs:
14+
test:
15+
name: Verify before publish
16+
runs-on: ubuntu-latest
17+
steps:
18+
- uses: actions/checkout@v4
19+
20+
- name: Setup Deno
21+
uses: denoland/setup-deno@v2
22+
with:
23+
deno-version: '2.x'
24+
25+
- name: Format check
26+
run: deno fmt --check
27+
28+
- name: Lint
29+
run: deno lint
30+
31+
- name: Type check
32+
run: deno check mod.ts
33+
34+
- name: Test
35+
run: deno task test
36+
37+
publish:
38+
name: Publish
39+
needs: [test]
40+
runs-on: ubuntu-latest
41+
if: startsWith(github.ref, 'refs/tags/v')
42+
43+
permissions:
44+
contents: read
45+
id-token: write
46+
47+
steps:
48+
- uses: actions/checkout@v4
49+
50+
- name: Setup Deno
51+
uses: denoland/setup-deno@v2
52+
with:
53+
deno-version: '2.x'
54+
55+
- name: Publish to JSR
56+
# --allow-slow-types: tracked as debt — see issue for follow-up to add
57+
# explicit types to ui/icon-button.ts (13 symbols missing types).
58+
run: deno publish --allow-slow-types

0 commit comments

Comments
 (0)