Refine Codeberg development skill

This commit is contained in:
matamune 2026-05-12 17:18:57 +00:00
parent cebe948fbc
commit 6e26e4bf09
Signed by: matamune
GPG key ID: 3BB8E7D3B968A324
3 changed files with 58 additions and 13 deletions

View file

@ -1,19 +1,20 @@
---
name: codeberg-development-flow
description: Use when working in this repository on development flow, remotes, Codeberg or Forgejo CLI operations, commit signing, mirroring to GitHub, npm trusted publishing, release validation, or publishing @peezy.tech/codex-flows.
description: Use when working in this repository on development flow, remotes, Codeberg or Forgejo CLI operations, Codeberg repo creation, branch tracking, commit signing, mirroring to GitHub, npm trusted publishing, release validation, or publishing @peezy.tech/codex-flows.
---
# Codeberg Development Flow
## Overview
Use Codeberg as the primary development forge and GitHub only as the npm trusted-publishing mirror.
Use Codeberg as the primary development forge. Keep GitHub as a mirror only for npm trusted publishing.
## Core Rules
- Treat `origin` as Codeberg: `git@codeberg.org:peezy-tech/codex-flows.git`.
- Treat `github` as the GitHub mirror: `https://github.com/peezy-tech/codex-flows.git`.
- Push normal development to Codeberg first.
- Keep `main` tracking `origin/main`, not `github/main`.
- Push normal development to Codeberg.
- Push to GitHub only when the release workflow must publish to npm.
- Do not add npm tokens to the repo or GitHub secrets. GitHub publishes through trusted publishing.
- Use package name `@peezy.tech/codex-flows`, not `@peezy-tech/codex-flows`.
@ -25,8 +26,9 @@ When asked to set up or verify the repo, check:
```bash
git remote -v
ssh -T git@codeberg.org
fj auth list
fj --host codeberg.org auth list
gpg --list-secret-keys --keyid-format=long
git status --short --branch
```
Expected local key files:
@ -38,6 +40,13 @@ Expected local key files:
## Release Workflow
Normal development:
```bash
git pull
git push
```
Before release, run:
```bash
@ -51,7 +60,7 @@ Then:
1. Bump `packages/codex-client/package.json`.
2. Commit.
3. Push to Codeberg: `git push origin main`.
3. Push to Codeberg: `git push`.
4. Push to GitHub mirror: `git push github main`.
5. Run GitHub workflow `.github/workflows/publish-codex-flows.yml` with `confirm_package=@peezy.tech/codex-flows`.
6. Verify `npm dist-tag ls @peezy.tech/codex-flows`.

View file

@ -1,4 +1,4 @@
interface:
display_name: "Codeberg Development Flow"
short_description: "Codeberg-first development and releases."
default_prompt: "Use the Codeberg-first development flow for remotes, commits, Forgejo CLI, mirrors, and npm releases."
short_description: "Codeberg-first development and release mirror flow."
default_prompt: "Use the Codeberg-first development flow for remotes, branch tracking, Forgejo CLI, signed commits, GitHub mirroring, and npm trusted publishing."

View file

@ -8,10 +8,19 @@ git remote -v
# github https://github.com/peezy-tech/codex-flows.git
```
Use Codeberg for day-to-day pushes:
`main` should track Codeberg:
```bash
git push origin main
git branch --set-upstream-to=origin/main main
git status --short --branch
# ## main...origin/main
```
Use Codeberg for day-to-day work:
```bash
git pull
git push
```
Use GitHub only to run npm trusted publishing:
@ -46,12 +55,32 @@ git config --global user.signingkey E3B0D5FB2E5CF11FAFB2EA113BB8E7D3B968A324
`forgejo-cli` is installed as `fj`.
After a Codeberg application token exists:
The configured Codeberg login should be visible as `matamune@codeberg.org`:
```bash
fj auth add-key <codeberg-username> <token>
fj auth use-ssh true
fj auth list
fj --host codeberg.org auth list
```
If authentication needs to be recreated:
```bash
fj --host codeberg.org auth add-key matamune <token>
fj --host codeberg.org auth use-ssh true
```
Create the organization repo when missing:
```bash
fj --host codeberg.org org repo create peezy-tech codex-flows \
-d "Public monorepo for @peezy.tech/codex-flows" \
-S true
```
Verify the repository:
```bash
fj --host codeberg.org repo view peezy-tech/codex-flows
git ls-remote origin HEAD refs/heads/main
```
## Package Release Gate
@ -69,3 +98,10 @@ Verify npm after GitHub Actions publishing:
npm dist-tag ls @peezy.tech/codex-flows
npm view @peezy.tech/codex-flows version repository --json
```
## Current Constructed State
- Codeberg repo: `https://codeberg.org/peezy-tech/codex-flows`
- GitHub mirror: `https://github.com/peezy-tech/codex-flows`
- `origin/main` and `github/main` should be kept aligned for release commits.
- Latest setup commit: `cebe948fbc44a027d905d26a972ab243f6a5d9c6`.