@1aboveio/skills 1.0.46 → 1.0.48

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (90) hide show
  1. package/.codex-plugin/plugin.json +1 -1
  2. package/.codex-plugin/resources.json +155 -154
  3. package/package.json +4 -4
  4. package/skills/app-dev/airflow/SKILL.md +1 -1
  5. package/skills/app-dev/android-development/SKILL.md +1 -1
  6. package/skills/app-dev/app-debug/SKILL.md +1 -1
  7. package/skills/app-dev/better-auth/SKILL.md +1 -1
  8. package/skills/app-dev/data-catalog/SKILL.md +1 -1
  9. package/skills/app-dev/data-catalog/scripts/persist-conventions-core.mjs +7 -3
  10. package/skills/app-dev/data-quality/SKILL.md +1 -1
  11. package/skills/app-dev/interaction-design/SKILL.md +1 -1
  12. package/skills/app-dev/ios-foundation/SKILL.md +1 -1
  13. package/skills/app-dev/maestro/SKILL.md +1 -1
  14. package/skills/app-dev/monorepo/SKILL.md +1 -1
  15. package/skills/app-dev/nextjs-fullstack/SKILL.md +1 -1
  16. package/skills/app-dev/prisma-setup/SKILL.md +1 -1
  17. package/skills/app-dev/pyspark/SKILL.md +1 -1
  18. package/skills/app-dev/python-backend/SKILL.md +1 -1
  19. package/skills/app-dev/shadcn/SKILL.md +1 -1
  20. package/skills/app-dev/zod-v4/SKILL.md +1 -1
  21. package/skills/cicd/cloud-build/SKILL.md +1 -1
  22. package/skills/cicd/cloud-debug/SKILL.md +1 -1
  23. package/skills/cicd/cloud-deploy/SKILL.md +1 -1
  24. package/skills/cicd/docker/SKILL.md +1 -1
  25. package/skills/cicd/github-actions/SKILL.md +67 -46
  26. package/skills/cicd/github-actions/references/audit-and-cleanup.md +80 -5
  27. package/skills/cicd/github-actions/references/conditional-ci.md +155 -178
  28. package/skills/cicd/github-actions/references/pipeline.md +63 -26
  29. package/skills/cicd/github-actions/references/two-pass-reading.md +50 -3
  30. package/skills/cicd/github-flow/SKILL.md +45 -19
  31. package/skills/cicd/github-flow/references/candidate-admission.md +51 -0
  32. package/skills/cicd/github-flow/references/ci-conventions.md +11 -12
  33. package/skills/cicd/github-flow/scripts/flow-core.mjs +10 -5
  34. package/skills/cicd/github-flow/scripts/persist-conventions-core.mjs +7 -3
  35. package/skills/cicd/github-flow/scripts/persist-conventions.mjs +55 -1
  36. package/skills/cicd/google-cloud/SKILL.md +1 -1
  37. package/skills/cicd/mergify/SKILL.md +1 -1
  38. package/skills/cicd/mergify/references/stacks.md +9 -2
  39. package/skills/cicd/mergify/scripts/stack-push-core.mjs +4 -1
  40. package/skills/cicd/podman/SKILL.md +1 -1
  41. package/skills/content/article-review/SKILL.md +1 -1
  42. package/skills/content/article-to-image/SKILL.md +1 -1
  43. package/skills/content/flowchart-svg/SKILL.md +1 -1
  44. package/skills/content/image-gen/SKILL.md +1 -1
  45. package/skills/content/mermaid/SKILL.md +1 -1
  46. package/skills/content/wechat-article-writer/SKILL.md +1 -1
  47. package/skills/content/wechat-publisher/SKILL.md +1 -1
  48. package/skills/content/wechat-search/SKILL.md +1 -1
  49. package/skills/content/xai-search/SKILL.md +1 -1
  50. package/skills/core/distill-writing/SKILL.md +1 -1
  51. package/skills/core/doc-to-md/SKILL.md +1 -1
  52. package/skills/core/editorial-review/SKILL.md +1 -1
  53. package/skills/core/house-style/SKILL.md +1 -1
  54. package/skills/core/plain-language/SKILL.md +1 -1
  55. package/skills/core/polish-cn/SKILL.md +1 -1
  56. package/skills/core/reg-parser/SKILL.md +1 -1
  57. package/skills/core/terminology/SKILL.md +1 -1
  58. package/skills/core/write-doc/SKILL.md +1 -1
  59. package/skills/core/write-report/SKILL.md +1 -1
  60. package/skills/engineering/acceptance-design/SKILL.md +1 -1
  61. package/skills/engineering/better-review/SKILL.md +1 -1
  62. package/skills/engineering/e2e-test/SKILL.md +1 -1
  63. package/skills/engineering/engineering/SKILL.md +1 -1
  64. package/skills/engineering/engineering/scripts/persist-conventions-core.mjs +7 -3
  65. package/skills/engineering/engineering-runtime/SKILL.md +1 -1
  66. package/skills/engineering/engineering-runtime/coherence/workflow.json +14 -14
  67. package/skills/engineering/ensure-coverage/SKILL.md +1 -1
  68. package/skills/engineering/golden-path/SKILL.md +1 -1
  69. package/skills/engineering/harness-runtime/SKILL.md +1 -1
  70. package/skills/engineering/resolve-issues/SKILL.md +2 -2
  71. package/skills/engineering/resolve-issues/references/ci.md +3 -0
  72. package/skills/engineering/resolve-issues/references/implementation.md +7 -2
  73. package/skills/engineering/resolve-issues/references/review.md +7 -2
  74. package/skills/engineering/resolve-issues/scripts/next-actions.mjs +5 -4
  75. package/skills/engineering/resolve-issues/scripts/review-verdict.mjs +19 -7
  76. package/skills/engineering/resolve-release/SKILL.md +1 -1
  77. package/skills/engineering/rush-issues/SKILL.md +1 -1
  78. package/skills/engineering/rush-release/SKILL.md +1 -1
  79. package/skills/engineering/test-quality/SKILL.md +1 -1
  80. package/skills/engineering/test-quality/scripts/persist-conventions-core.mjs +7 -3
  81. package/skills/risk-compliance/compliance-audit/SKILL.md +1 -1
  82. package/skills/risk-compliance/contract-compare/SKILL.md +1 -1
  83. package/skills/risk-compliance/contract-review/SKILL.md +1 -1
  84. package/skills/risk-compliance/doc-authenticity/SKILL.md +1 -1
  85. package/skills/risk-compliance/fraud-detection/SKILL.md +1 -1
  86. package/skills/risk-compliance/payment-analysis/SKILL.md +1 -1
  87. package/skills/risk-compliance/portfolio-payment-analysis/SKILL.md +1 -1
  88. package/skills/risk-compliance/rfi-writing/SKILL.md +1 -1
  89. package/skills/risk-compliance/similar-domain/SKILL.md +1 -1
  90. package/skills/risk-compliance/tld-detection/SKILL.md +1 -1
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  name: github-flow
3
- description: "Deliver a committed change to done: push, open a PR, wait for its checks, and merge through the repo's flow (direct push, pull request, or merge queue). Use whenever you commit or finish a change, when CONTRIBUTING.md has a Delivery section, and for asks like 'commit this', 'push it', 'open a PR', 'ship it', 'land it', 'get it merged', 'is my PR green', 'wait for CI', 'merge once the checks pass', 'confirm it really merged'. Every wait here runs the bundled scripts/watch-checks.mjs: never hand-roll a gh pr view or gh pr checks --watch polling loop, and never call a branch merged without the merge commit. Also: declare a repo's delivery flow, or write the CI conventions and Delivery section into CONTRIBUTING.md on request. NOT for writing workflow YAML (github-actions), Mergify config or a stuck queued PR (mergify), cutting a release (resolve-release), or PRs that resolve-issues or rush-issues deliver."
4
- release-version: 0.50.27
3
+ description: "Deliver a committed change through the repository's direct-push, pull-request, or merge-queue flow. Use to push, open a PR, wait for checks, confirm a merge, or save CI and delivery conventions in CONTRIBUTING.md. resolve-issues and rush-issues manage their own PRs."
4
+ release-version: 0.50.29
5
5
  ---
6
6
  **Updates:** Once/session run `node <skill-base-dir>/release-check.mjs`.
7
7
  # GitHub Flow
@@ -36,9 +36,9 @@ progress, and it cannot prove a merge. If you catch yourself typing one, stop an
36
36
  It prints `source` (`declared` or `detected`), `flow`, `done`, `mergeMethod`, `queue`,
37
37
  `autoMerge`, the default `branch`, and `evidence`.
38
38
  2. Decide how far to go:
39
- - `source: declared` and `done: merged`: run the whole flow. Do not stop at the commit.
40
- - The user asked in this session to push, open a PR, or merge: run the flow up to what they asked.
41
- - Otherwise: stop after the commit and ask once, naming the flow and its evidence:
39
+ - Honor an explicit stopping point first. For “push and stop”, admit the outgoing ref, push, and report its SHA. For “open a draft”, stop after confirming the draft exists.
40
+ - For an unqualified delivery request, use the declared completion policy. With `source: declared` and `done: merged`, run the whole flow. Otherwise carry out the push, PR, or merge requested this session.
41
+ - With neither standing nor current authorization to push, stop after the commit and ask once, naming the flow and its evidence:
42
42
  "Push and deliver through the `<flow>` flow?" Offer to declare the flow
43
43
  ([Persist](#persist-to-contributingmd)). Never end the session silently with unpushed commits.
44
44
  3. Run the steps for the flow: [direct](#flow-direct), [pull-request](#flow-pull-request),
@@ -47,23 +47,36 @@ progress, and it cannot prove a merge. If you catch yourself typing one, stop an
47
47
 
48
48
  Commit only the files of this change. Leave unrelated working-tree changes alone.
49
49
 
50
+ All publication paths use [candidate admission](references/candidate-admission.md).
51
+ Run the repository-declared admission and applicable focused checks before
52
+ publishing the outgoing commit, including when updating a PR or marking it
53
+ ready. Refresh the target and revalidate changed inputs. A blocked result
54
+ stops the publication.
55
+
50
56
  ## Flow: direct
51
57
 
52
- 1. Run the repo's local checks (the test, lint, and build commands `CONTRIBUTING.md` or `AGENTS.md`
53
- names). Fix failures before pushing.
54
- 2. `git pull --rebase origin <branch>`. Rerun the checks if the rebase brought in changes.
55
- 3. `git push origin HEAD:<branch>`. On a rejected push, pull with rebase and push once more; then report.
58
+ 1. Fetch the destination branch. If a rebase is needed, rebase the intended source branch in its worktree.
59
+ 2. Resolve its outgoing commit to `candidate`, admit it against the updated target and run the repo's local checks.
60
+ 3. Push the admitted commit to the requested destination with `git push origin "${candidate}:refs/heads/${destination}"`. On a non-fast-forward rejection, repeat steps 1–2 before retrying once. Fix a failed pre-push check before retrying.
56
61
  4. Never force-push.
57
62
 
58
63
  ## Flow: pull-request
59
64
 
60
- 1. If you committed on the default branch, move the commits to a branch: `git fetch origin`,
65
+ 1. Identify the requested source branch, published branch and PR target. If the requested commits are on the default branch, move them to a branch: `git fetch origin`,
61
66
  `git switch -c <type>/<short-slug>`, then `git branch -f <branch> origin/<branch>`.
62
- 2. `git push -u origin HEAD`.
63
- 3. `gh pr create --fill`, ready for review, not draft. Add `Closes #<n>` when the change resolves an issue.
67
+ 2. Resolve the source branch to `candidate`, admit that SHA against the PR target,
68
+ then `git push origin "${candidate}:refs/heads/${published}"`. For a new tracking
69
+ branch, set its upstream to `origin/${published}` on the named source branch.
70
+ 3. Confirm the target base and published head still match the admitted pair. Use
71
+ `gh pr create --base <target> --head <published> --fill` when a new PR is requested;
72
+ add `--draft` when requested. For a fork, qualify the published head with its
73
+ owner. Use the existing PR when
74
+ updating it. Add `Closes #<n>` when the change resolves an issue.
64
75
  - Stack repo (`mergify-hooks/` in the git hooks dir; the pre-push hook says "Use 'mergify stack
65
- push'"): replace steps 2–3 with the `mergify` skill's `scripts/stack-push.mjs`. Put
66
- `Closes #<n>` in the commit message. Never `--no-verify`.
76
+ push'"): replace steps 2–3 with the `mergify` skill's `scripts/stack-push.mjs`
77
+ from the requested stack's worktree. Put
78
+ `Closes #<n>` in the commit message. Apply admission to each published stack
79
+ member as described in [candidate admission](references/candidate-admission.md).
67
80
  4. Wait for the checks to settle:
68
81
 
69
82
  ```bash
@@ -82,7 +95,7 @@ Commit only the files of this change. Leave unrelated working-tree changes alone
82
95
  Avoid redraw-based waits: the elapsed clock in `gh pr checks --watch` looks like
83
96
  progress to a log monitor even while one check is stationary. Keep the repository's
84
97
  existing check policy; observation does not add optional checks as merge gates.
85
- 5. Merge once green: `gh pr merge --<mergeMethod> --delete-branch`, adding `--auto` when
98
+ 5. Merge once green: `gh pr merge <number> --<mergeMethod> --delete-branch`, adding `--auto` when
86
99
  `autoMerge: true`. On a refusal for review, go to [Stop at a human gate](#stop-at-a-human-gate).
87
100
  6. Prove the merge — a zero exit from `gh pr merge --auto` means the *request* was accepted:
88
101
 
@@ -102,7 +115,7 @@ Commit only the files of this change. Leave unrelated working-tree changes alone
102
115
  2. Enqueue:
103
116
  - `queue: mergify`: load the `mergify` skill. Enqueue as its watch contract says, then run its
104
117
  `scripts/watch-pr-delivery.mjs` to a verdict. Enqueue several ready PRs together.
105
- - `queue: github`: `gh pr merge --auto` with no merge method; the queue sets it.
118
+ - `queue: github`: `gh pr merge <number> --auto` with no merge method; the queue sets it.
106
119
  3. Dequeued: with Mergify, follow its dequeue-reason table. Re-enqueue only after the cause is fixed.
107
120
  4. Confirm the merge, then update the local default branch as in pull-request step 6.
108
121
  - `queue: mergify`: the queue watcher's `MERGED` verdict carries the merge commit. The
@@ -118,7 +131,7 @@ Commit only the files of this change. Leave unrelated working-tree changes alone
118
131
  Use `android-development` when available. Collect CI-only observations in
119
132
  the authorized lane.
120
133
  2. When the change caused the failure, fix it and confirm the same step locally
121
- when possible. Commit and push for the required CI check. In a stack repo,
134
+ when possible. Commit, reapply candidate admission, and push for the required CI check. In a stack repo,
122
135
  amend the PR's commit and push with
123
136
  `stack-push.mjs`; a new commit opens a new PR. Stop after three rounds and report.
124
137
  3. For a confirmed transient, follow the repository's retry policy. When a
@@ -133,7 +146,11 @@ Commit only the files of this change. Leave unrelated working-tree changes alone
133
146
  Stop and report when a merge needs what only a human gives: a required approval, a code-owner
134
147
  review, a `CHANGES_REQUESTED` review, or a fix outside this change. Never approve your own PR,
135
148
  merge with `--admin`, or bypass a rule. Pushing to the default branch is allowed only in the
136
- `direct` flow.
149
+ `direct` flow. Merge authorization covers the normal repository flow. A queue
150
+ failure, unavailable auto-merge, prior direct pushes or admin access grants no
151
+ exception. A separately permitted bypass needs explicit user authorization
152
+ for that specific operation and destination. Honor stronger repository rules
153
+ and never bypass to obtain green checks.
137
154
 
138
155
  ## Persist to CONTRIBUTING.md
139
156
 
@@ -148,6 +165,15 @@ node "$SKILL_DIR/scripts/persist-conventions.mjs" --flow <flow> ... --write
148
165
 
149
166
  - Writes [references/ci-conventions.md](references/ci-conventions.md) as `## CI conventions` and the
150
167
  flow as `## Delivery`, each between `conventions:<id>` markers; a re-run replaces only those blocks.
168
+ - During authorized setup, read the actual workflow, declared commands and active
169
+ hooks. Supply their paths, target-base rule, invocation and focused checks
170
+ as a Markdown section body to `persist-conventions.mjs --admission-file <file>`.
171
+ Preview first; add `--write` to persist the separate `## Candidate admission`
172
+ block in `CONTRIBUTING.md`. Ordinary CI and Delivery refreshes preserve it.
173
+ For an existing unmanaged section, update it in place when authorized.
174
+ If the repo has no admission command, record its existing check policy.
175
+ Inspect existing unmanaged CI/Delivery sections before running the writer;
176
+ keep conflicting policy and resolve it with its owner.
151
177
  - `--done` defaults to `merged`; `--merge-method` (default `squash`) applies to `pull-request`.
152
178
  - Pass `--delivery-only` for a repo without GitHub Actions workflows. Without `--flow`, writes CI
153
179
  conventions only.
@@ -167,6 +193,6 @@ node "$SKILL_DIR/scripts/persist-conventions.mjs" --flow <flow> ... --write
167
193
 
168
194
  ## Related skills
169
195
 
170
- - `github-actions`: write and debug workflow YAML, the one required check, CI speed.
196
+ - `github-actions`: design, audit and debug CI architecture, required checks and CI speed.
171
197
  - `mergify`: queue config, branch rulesets, the delivery watcher, stuck or dequeued PRs.
172
198
  - `resolve-issues` and `rush-issues` deliver their own PRs; do not run this skill inside them.
@@ -0,0 +1,51 @@
1
+ # Candidate admission before publication
2
+
3
+ Read the repository's delivery policy in `CONTRIBUTING.md`, including the
4
+ selector, applicable focused checks, hook setup, target-base rule and any
5
+ documented exceptions. Follow existing project guidance if the commands live
6
+ elsewhere. Use the checks the repository actually declares. When no selector
7
+ exists, continue with its existing local check policy.
8
+
9
+ 1. Identify the destination and resolve the outgoing commit and current target
10
+ base to SHAs. For a direct push the base is the destination branch. For a
11
+ new PR branch it is the intended PR target, for an existing PR its actual
12
+ target, and for a stack the target of each published member. A new remote
13
+ branch has no previous tip. Even on an update, its old tip can differ from
14
+ the PR base. Fetch the relevant base; follow the project's policy if the
15
+ target or required history cannot be established.
16
+ 2. Run the repository's lightweight admission and applicable focused checks for
17
+ that pair and lane. Use the same command as CI Stage 0. For a pnpm project,
18
+ invoke the admission script declared in the root `package.json` from the
19
+ workspace root. On pnpm 11, for example, use
20
+ `pnpm --config.verify-deps-before-run=false --silent run ci:admit <base> <candidate> <lane>`
21
+ to keep preflight free of implicit installs. Honor an existing equivalent
22
+ script name. Read from the named Git
23
+ objects, or use a clean detached worktree at the outgoing SHA for commands
24
+ that inspect files. A clean or dirty checkout at a different commit cannot
25
+ qualify the outgoing change. Report a blocked decision with its cause and
26
+ stop the affected publication.
27
+ 3. Apply this before pushing and before creating, updating, or marking a PR
28
+ ready. Reuse an admission only while base, candidate, lane and relevant
29
+ policy/inputs still match. Recheck after a rebase, amend, retarget, or a
30
+ parent/target advancing, including retries. Reuse focused results that
31
+ remain applicable under project policy.
32
+
33
+ **Hook.** Prefer the repository's native pre-push hook invoking the same
34
+ admission command. Preserve the active hook chain, including Mergify. For each
35
+ branch tuple Git sends on stdin (`local-ref local-oid remote-ref remote-oid`),
36
+ check the actual local OID against the intended target. Resolve new branches
37
+ with the repository's target-base rule, and handle deletions and non-branch
38
+ refs according to their own lifecycle. A nonzero result must abort that push.
39
+ Keep the hook enabled through stack publication. For a command that creates
40
+ or updates a PR without pushing a ref, perform the check explicitly.
41
+
42
+ **Stack.** Account for every outgoing member and its actual base. A publisher
43
+ may rebase after a manual preflight. Use the repository hook on the resulting
44
+ refs, or synchronize the stack first, admit the finalized members, then push
45
+ with automatic rebasing disabled. Apply the same rule to focused checks.
46
+
47
+ **CI.** Local and CI selection agree for identical revisions, lane and policy
48
+ inputs. CI independently admits its event's actual candidate, including a PR
49
+ test-merge commit or an assembled queue batch. The installed `github-actions`
50
+ skill owns the [CI architecture](https://github.com/1aboveio/ai/blob/main/skills/cicd-pipeline/github-actions/references/pipeline.md)
51
+ and repository-wide audit.
@@ -1,14 +1,13 @@
1
1
  ## CI conventions
2
2
 
3
- 1. Deploy only from Cloud Build; use workflows to verify.
4
- 2. Require one `gate` job (`if: always()`) per lane and nothing else.
5
- 3. Never put `paths:` or `paths-ignore:` on a workflow that reports a required check.
6
- 4. Keep PR checks under 10 minutes, run heavy suites in the merge queue, and test the deployed revision after deploy.
7
- 5. Keep the PR and queue lanes in one `ci.yml`; put repeated setup in a local composite action.
8
- 6. Set `timeout-minutes` on every job; cancel superseded runs on PRs only.
9
- 7. Set `permissions: contents: read`, SHA-pin third-party actions, and pass `${{ }}` through `env:`, never inline in `run:`.
10
- 8. Fail on a missing secret; never set `continue-on-error` on tests.
11
- 9. Fork-guard self-hosted jobs, set `persist-credentials: false`, and remove started containers in `if: always()`.
12
- 10. Alert on failed scheduled runs.
13
- 11. Never make an AI review the only gate or pass it on timeout.
14
- 12. Lint workflows with `actionlint`; don't write tests that read workflow files.
3
+ 1. For new or redesigned CI, use one automatic PR and merge-queue entry point. Keep an established single `ci.yml`; use `ci.yaml` for a new design. Keep release, scheduled and post-deploy workflows independent where they prove different outcomes.
4
+ 2. Admit each event's actual base and candidate before allocating expensive jobs. Use the repository's lightweight selector, primary toolchain and workspace. Account for shared inputs and downstream consumers. Jobs, including reusable workflow calls, depend on successful admission and consume its validated plan.
5
+ 3. Record the repository's admission command, target-base rule and applicable focused checks in this guide. In pnpm workspaces, pre-push and CI Stage 0 use the same root package script, conventionally `pnpm run ci:admit <base> <candidate> <lane>`; preserve an existing equivalent name. Other stacks use the same repository-native selector before publishing and in CI. Under strict admission, block on unresolved dependencies, untrusted diffs or invalid plans. Preserve an explicitly adopted full-suite fallback until the project changes it.
6
+ 4. Preserve required check names and meaning. The final gate runs even after failures and verifies the checks selected for this candidate. Keep path filters off any required workflow. Use one aggregate gate for new designs where appropriate.
7
+ 5. Target a complete PR run within 3 minutes, queue run within 10 minutes and individual jobs within 5 minutes, subject to agreed project exceptions. Measure scheduling separately. Keep job timeouts and cleanup headroom explicit. Cancel superseded PR runs only.
8
+ 6. Use Actions to verify and Cloud Build for GCP deployment. Test the serving revision after deployment. Alert on failed scheduled runs.
9
+ 7. Set minimal permissions (`contents: read` by default), SHA-pin third-party actions, and pass expressions through `env:` into shell scripts. Fail on missing secrets and failed tests. Fork-guard self-hosted jobs, set `persist-credentials: false`, and clean up started containers on failure too.
10
+ 8. Never make AI review the only gate or pass it on timeout. Lint workflow YAML with `actionlint`. Parsed trigger/job dependency checks and execution replays can verify admission and failure propagation; avoid assertions about YAML spelling.
11
+
12
+ For workflow design, timing definitions and repository-wide audit, use the
13
+ [github-actions skill](https://github.com/1aboveio/ai/tree/main/skills/cicd-pipeline/github-actions).
@@ -2,6 +2,8 @@
2
2
  // flow.mjs gathers the facts (CONTRIBUTING.md, git history, GitHub settings) and
3
3
  // persist-conventions.mjs writes the section.
4
4
 
5
+ import { withoutExamples } from './persist-conventions-core.mjs'
6
+
5
7
  export const FLOWS = ['direct', 'pull-request', 'merge-queue']
6
8
  export const DONE = ['merged', 'committed']
7
9
  export const MERGE_METHODS = ['squash', 'merge', 'rebase']
@@ -12,7 +14,7 @@ const HISTORY_PR_SHARE = 0.5
12
14
  const RECENT = 5
13
15
 
14
16
  const STEPS = {
15
- direct: (_method) => 'run the local checks, `git pull --rebase` onto `main`, and push to `main`. Never force-push.',
17
+ direct: (_method) => 'rebase onto the current target, run the local checks and push to the target. Never force-push.',
16
18
  'pull-request': (method) => `push a branch, open a ready PR, wait for the required checks, merge with \`${method}\`, and confirm the merge.`,
17
19
  'merge-queue': (_method) => 'push a branch, open a ready PR, wait for the checks, enqueue it with the `mergify` skill, and run its watcher to a verdict.',
18
20
  }
@@ -32,8 +34,9 @@ export function renderDelivery({ flow, done = 'merged', mergeMethod = 'squash' }
32
34
  lines.push('')
33
35
  const steps = STEPS[flow](mergeMethod)
34
36
  lines.push(done === 'merged'
35
- ? `After committing, deliver with the \`github-flow\` skill: ${steps} Do not stop at the commit.`
37
+ ? `For an unqualified delivery request, use the \`github-flow\` skill: ${steps} Do not stop at the commit. Honor a narrower stopping point specified by the user.`
36
38
  : `After committing, ask before pushing. Once approved, deliver with the \`github-flow\` skill: ${steps}`)
39
+ lines.push('Before publishing a commit or creating, updating or marking a PR ready, run this repository\'s declared admission and applicable focused checks against the actual outgoing commit and target base. Revalidate when either changes.')
37
40
  return `${lines.join('\n')}\n`
38
41
  }
39
42
 
@@ -41,12 +44,14 @@ export function renderDelivery({ flow, done = 'merged', mergeMethod = 'squash' }
41
44
  // written by persist-conventions or by hand. Null when absent or without a valid flow.
42
45
  export function parseDelivery(text) {
43
46
  if (typeof text !== 'string') return null
44
- const start = text.search(/^## Delivery\s*$/m)
47
+ if (!/^## Delivery\s*$/im.test(text)) return null
48
+ const active = withoutExamples(text, { showSectionMarkers: true })
49
+ const start = active.search(/^## Delivery\s*$/im)
45
50
  if (start === -1) return null
46
- const rest = text.slice(start).split('\n').slice(1)
51
+ const rest = active.slice(start).split('\n').slice(1)
47
52
  const end = rest.findIndex((line) => /^#{1,2} /.test(line))
48
53
  const body = (end === -1 ? rest : rest.slice(0, end)).join('\n')
49
- const field = (name) => body.match(new RegExp(`^\\s*[-*]?\\s*${name}:\\s*([\\w-]+)`, 'm'))?.[1]
54
+ const field = (name) => body.match(new RegExp(`^\\s*[-*]?\\s*${name}:\\s*([\\w-]+)`, 'im'))?.[1]
50
55
  const flow = field('flow')
51
56
  if (!FLOWS.includes(flow)) return null
52
57
  const done = DONE.includes(field('done')) ? field('done') : 'committed'
@@ -90,7 +90,7 @@ export function taskEntryBlock({ id, title, body }) {
90
90
  }
91
91
 
92
92
  const escape = (text) => text.replace(/[.*+?^${}()|[\]\\]/g, '\\$&')
93
- function withoutExamples(text) {
93
+ export function withoutExamples(text, { showSectionMarkers = false } = {}) {
94
94
  let fence = null
95
95
  let comment = false
96
96
  const active = text.split('\n').map(line => {
@@ -100,6 +100,7 @@ function withoutExamples(text) {
100
100
  && line.slice(match[0].length).trim() === '') fence = null
101
101
  return ''
102
102
  }
103
+ const beganInComment = comment
103
104
  let masked = ''
104
105
  let cursor = 0
105
106
  while (cursor < line.length) {
@@ -114,7 +115,10 @@ function withoutExamples(text) {
114
115
  }
115
116
  const match = /^ {0,3}(`{3,}|~{3,})/.exec(masked)
116
117
  if (match) { fence = match[1]; return '' }
117
- return /^(?: {4}|\t|\s*>)/.test(line) ? '' : line
118
+ if (/^(?: {4}|\t|\s*>)/.test(line)) return ''
119
+ if (!showSectionMarkers) return line
120
+ if (!beganInComment && /^ {0,3}<!-- conventions:[\w-]+:(?:start|end) -->\s*$/.test(line)) return line.trim()
121
+ return masked
118
122
  }).join('\n')
119
123
  if (fence) throw new Error('unclosed Markdown code fence; repair guidance before setup')
120
124
  if (comment) {
@@ -279,7 +283,7 @@ function apply(repoRoot, entries, write) {
279
283
  export function persist(repoRoot, section, { write = false } = {}) {
280
284
  const block = sectionBlock(section)
281
285
  const entries = [
282
- { name: CONTRIBUTING_FILE, render: (text) => renderConventions(text, section.id, block), loaders: [] },
286
+ { name: CONTRIBUTING_FILE, render: (text) => (section.render ?? renderConventions)(text, section.id, block), loaders: [] },
283
287
  ...indexEntries(section),
284
288
  ]
285
289
  return apply(repoRoot, entries, write)
@@ -8,9 +8,10 @@
8
8
  // [--flow direct|pull-request|merge-queue] [--done merged|committed] [--merge-method squash|merge|rebase]
9
9
  // [--delivery-only]
10
10
  import fs from 'node:fs'
11
+ import { resolve } from 'node:path'
11
12
  import { fileURLToPath } from 'node:url'
12
13
  import { renderDelivery, validateDelivery } from './flow-core.mjs'
13
- import { runCli } from './persist-conventions-core.mjs'
14
+ import { runCli, withoutExamples } from './persist-conventions-core.mjs'
14
15
 
15
16
  // One loader for both sections: whichever run happens first adds it, the other finds it.
16
17
  const LOADER = {
@@ -35,16 +36,69 @@ const CI = {
35
36
  }
36
37
 
37
38
  const DELIVERY_FLAGS = { '--flow': 'flow', '--done': 'done', '--merge-method': 'mergeMethod' }
39
+
40
+ function renderAdmission(current, id, block) {
41
+ const active = withoutExamples(current ?? '', { showSectionMarkers: true }).split('\n')
42
+ let owner = null, start = -1, end = -1
43
+ for (const [i, line] of active.entries()) {
44
+ const marker = /^<!-- conventions:([\w-]+):(start|end) -->$/.exec(line)
45
+ if (marker) {
46
+ const [, name, kind] = marker
47
+ if (kind === 'start') {
48
+ if (owner || (name === id && start >= 0)) throw new Error('ambiguous convention markers; reconcile existing guidance')
49
+ owner = name
50
+ if (name === id) start = i
51
+ } else {
52
+ if (owner !== name) throw new Error('unbalanced convention markers; reconcile existing guidance')
53
+ if (name === id) end = i
54
+ owner = null
55
+ }
56
+ } else if (owner !== id && /^ {0,3}##[ \t]+Candidate admission(?:[ \t]+#+)?\s*$/i.test(line)) {
57
+ throw new Error('preserve the existing unmanaged Candidate admission section; update it in place')
58
+ }
59
+ }
60
+ if (owner) throw new Error('unclosed convention block; reconcile existing guidance')
61
+ if (start < 0) {
62
+ if (current == null) return '# Contributing\n\n' + block
63
+ const separator = current.endsWith('\n\n') ? '' : current.endsWith('\n') ? '\n' : '\n\n'
64
+ return current + separator + block
65
+ }
66
+ const lines = current.split('\n')
67
+ return [...lines.slice(0, start), block.trimEnd(), ...lines.slice(end + 1)].join('\n')
68
+ }
38
69
  const rest = []
39
70
  const delivery = {}
40
71
  let deliveryOnly = false
72
+ let admissionFile
41
73
  const argv = process.argv.slice(2)
42
74
  for (let i = 0; i < argv.length; i++) {
43
75
  const key = DELIVERY_FLAGS[argv[i]]
44
76
  if (key && argv[i + 1]) delivery[key] = argv[++i]
45
77
  else if (argv[i] === '--delivery-only') deliveryOnly = true
78
+ else if (argv[i] === '--admission-file' && argv[i + 1]) admissionFile = argv[++i]
46
79
  else rest.push(argv[i])
47
80
  }
81
+
82
+ if (admissionFile) {
83
+ try {
84
+ if (deliveryOnly || Object.keys(delivery).length) throw new Error('use --admission-file separately from delivery options')
85
+ const body = fs.readFileSync(admissionFile, 'utf8').trim()
86
+ if (!body || body.includes('<!-- conventions:')) throw new Error('provide the admission section body without managed markers')
87
+ withoutExamples(body) // An unfinished fence or comment would hide the closing marker.
88
+ const rootArg = rest.lastIndexOf('--repo-root')
89
+ const guide = resolve(rootArg < 0 ? '.' : rest[rootArg + 1], 'CONTRIBUTING.md')
90
+ const stat = fs.lstatSync(guide, { throwIfNoEntry: false })
91
+ if (stat?.isSymbolicLink()) throw new Error('preserve the linked CONTRIBUTING.md; update its policy at its owner')
92
+ process.exitCode = runCli(rest, {
93
+ id: 'admission', owner: 'github-flow', title: 'Candidate admission',
94
+ body: '## Candidate admission\n\n' + body, loader: LOADER, render: renderAdmission,
95
+ })
96
+ } catch (error) {
97
+ console.error(`persist-conventions: ${error.message}`)
98
+ process.exitCode = 2
99
+ }
100
+ process.exit(process.exitCode)
101
+ }
48
102
  if (deliveryOnly && !delivery.flow) {
49
103
  console.log('persist-conventions: --delivery-only needs --flow')
50
104
  process.exit(2)
@@ -5,7 +5,7 @@ description: >
5
5
  project management. Use when configuring GCP resources, managing service
6
6
  accounts, setting up IAP access, configuring VPC networks, managing secrets,
7
7
  or debugging cloud infrastructure.
8
- release-version: 0.50.27
8
+ release-version: 0.50.29
9
9
  ---
10
10
  **Updates:** Once/session run `node <skill-base-dir>/release-check.mjs`.
11
11
  # Google Cloud Platform (GCP) Skill
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  name: mergify
3
3
  description: "Mergify merge queues and stacked PRs (`mergify stack`): push a stack, fix stack hooks or missing Change-Id, enqueue and watch a PR, or diagnose a stuck or dequeued PR. Use `mergify queue show` and `watch_delivery` (or the bundled watcher); GitHub checks cannot see a dequeue. Covers `.mergify.yml`, queue rules, merge protections, batch size, queue-only rulesets, bypass actors and freezes, CI Insights Auto-Retry and batch retries, manual vs automatic enqueue, and missing or unmet queue checks. Use when GitHub CI is green but Mergify is blocked, a batch bisects, or a PR merges outside the queue. Outranks vendor mergify-* skills. NOT for pushing PRs without stack hooks (github-flow), workflow YAML (github-actions), or GCP deploy pipelines (cloud-deploy)."
4
- release-version: 0.50.27
4
+ release-version: 0.50.29
5
5
  ---
6
6
  **Updates:** Once/session run `node <skill-base-dir>/release-check.mjs`.
7
7
  # Mergify Merge Queue
@@ -27,7 +27,14 @@ brew upgrade mergify-cli # untrusted-tap refusal: brew trust --formula merg
27
27
 
28
28
  1. Start a stack branch that tracks trunk: `mergify stack new <type>/<topic>`.
29
29
  2. Commit. **One commit = one PR.** Put `Closes #<n>` in the commit message, not only the PR body.
30
- 3. Push:
30
+ 3. Before the first push, every update, and marking a PR ready, apply the
31
+ repository's `CONTRIBUTING.md` admission policy to each outgoing commit and
32
+ its intended PR base (the installed `github-flow` skill's
33
+ `references/candidate-admission.md`). Keep the repository's pre-push hook
34
+ active on the actual Git refs, including after Mergify's automatic rebase.
35
+ For manual preflight, sync first, check each finalized pair and use
36
+ `stack-push.mjs --skip-rebase` so the publisher preserves those candidates.
37
+ If a member or its target moves, repeat admission before publishing it.
31
38
  ```bash
32
39
  node <mergify-skill>/scripts/stack-push.mjs # push, report PR numbers
33
40
  node <mergify-skill>/scripts/stack-push.mjs --enqueue # push, then enqueue every stack PR
@@ -60,7 +67,7 @@ brew upgrade mergify-cli # untrusted-tap refusal: brew trust --formula merg
60
67
  - **Find a PR by number from `mergify stack list --json`** (`entries[].pull_number`). Its head
61
68
  branch is `stack/<user>/<branch>/<slug>--<id>`; `gh pr view <local-branch>` finds nothing.
62
69
  - **Rebase conflict** ("rebase failed — there may be conflicts"): resolve, `git rebase
63
- --continue`, push again. `--skip-rebase` only to avoid dismissing approvals.
70
+ --continue`, admit the new candidates and push again.
64
71
  - **Retarget or dequeue after a parent merges** ("could not be retargeted"): see
65
72
  [traps.md](traps.md) (`delete_branch_on_merge`, `--force-rebase`).
66
73
 
@@ -21,13 +21,14 @@ export const REREAD_ATTEMPTS = 4
21
21
  export const REREAD_DELAY_MS = 5_000
22
22
  const sleepSync = (ms) => Atomics.wait(new Int32Array(new SharedArrayBuffer(4)), 0, 0, ms)
23
23
 
24
- const HELP = `stack-push --trunk origin/main [--enqueue] [--draft] [--dry-run]
24
+ const HELP = `stack-push --trunk origin/main [--enqueue] [--draft] [--dry-run] [--skip-rebase]
25
25
 
26
26
  Push the current branch's commits as a Mergify stack (one commit = one PR).
27
27
  --trunk <remote/branch> stack base (default origin/main)
28
28
  --enqueue post "@mergifyio queue" on every stack PR, in one pass
29
29
  --draft open new PRs as drafts
30
30
  --dry-run show the push plan; push nothing
31
+ --skip-rebase publish already-synchronized, locally admitted commits without rewriting them
31
32
  Always keeps PR titles and bodies; never skips git hooks.
32
33
  `
33
34
 
@@ -39,6 +40,7 @@ export function parseArgs(argv) {
39
40
  else if (arg === '--enqueue') opts.enqueue = true
40
41
  else if (arg === '--draft') opts.draft = true
41
42
  else if (arg === '--dry-run') opts.dryRun = true
43
+ else if (arg === '--skip-rebase') opts.skipRebase = true
42
44
  else if (arg === '--trunk') {
43
45
  const value = argv[++i]
44
46
  if (!value || !/^[^/\s]+\/\S+$/.test(value)) throw new Error('--trunk needs REMOTE/BRANCH, e.g. origin/main')
@@ -111,6 +113,7 @@ export function pushArgs(opts) {
111
113
  const args = ['stack', 'push', '--trunk', opts.trunk, '--keep-pull-request-title-and-body']
112
114
  if (opts.draft) args.push('--draft')
113
115
  if (opts.dryRun) args.push('--dry-run')
116
+ if (opts.skipRebase) args.push('--skip-rebase')
114
117
  return args
115
118
  }
116
119
 
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  name: podman
3
3
  description: "Debug, design, or fix Podman: rootless/rootful containers, pods, podman-compose, the socket and systemd services, Docker-compatible API (DOCKER_HOST/CONTAINER_HOST), networking, volumes, SELinux labels, Docker migration, and CI/SSH provisioning of rootless sockets (user lingering, XDG_RUNTIME_DIR). Covers FailedToOpenSocket and systemctl --user DBUS/XDG errors."
4
- release-version: 0.50.27
4
+ release-version: 0.50.29
5
5
  ---
6
6
  **Updates:** Once/session run `node <skill-base-dir>/release-check.mjs`.
7
7
  # Podman Operations
@@ -6,7 +6,7 @@ description: >
6
6
  Use when a user shares an article, pastes article text, sends a URL, or asks to
7
7
  review, rate, critique, evaluate, 评价, 点评, 分析, or 看看 any article, post, or 文章.
8
8
  Default template is 公众号-支付行业.
9
- release-version: 0.50.27
9
+ release-version: 0.50.29
10
10
  ---
11
11
  **Updates:** Once/session run `node <skill-base-dir>/release-check.mjs`.
12
12
  # 文章评审引擎
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  name: article-to-image
3
3
  description: "Generate article cover images: WeChat banner/square (公众号封面), Xiaohongshu (小红书封面), LinkedIn banner, general wide. Brainstorms 4 visual directions from the article, then renders each format with correct aspect ratios and title-safe zones. Use when given an article and asked for covers, banners, or 出图."
4
- release-version: 0.50.27
4
+ release-version: 0.50.29
5
5
  ---
6
6
  **Updates:** Once/session run `node <skill-base-dir>/release-check.mjs`.
7
7
  # Article-to-Image
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  name: flowchart-svg
3
3
  description: Create polished flowcharts directly as SVG and export PNG copies. Use when asked to draw, design, render, or deliver process diagrams, architecture diagrams, consulting workflows, decision flows, swimlanes, or other flowcharts as image files, especially when final outputs must include .svg and .png versions.
4
- release-version: 0.50.27
4
+ release-version: 0.50.29
5
5
  ---
6
6
  **Updates:** Once/session run `node <skill-base-dir>/release-check.mjs`.
7
7
  # Flowchart SVG
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  name: image-gen
3
3
  description: Generate an image from a text prompt with OpenAI gpt-image-2 or Google Nano Banana (Gemini), saved to an image file. Use whenever the user asks to generate, create, make, draw, paint, render, or design an image, picture, illustration, photo, artwork, logo, icon, avatar, banner, hero image, thumbnail, poster, wallpaper, sticker, or concept art — including phrasings like "an image of X", "a picture of X", "show me what X would look like", or a request for a visual for a slide, blog post, README, or social post. Also triggers on Chinese phrasings such as 生成图片, 画一张图, 做一张海报, 设计一个 logo. NOT for charts or data visualizations (dataviz), flowcharts or architecture diagrams (flowchart-svg), or editing an existing image file.
4
- release-version: 0.50.27
4
+ release-version: 0.50.29
5
5
  ---
6
6
  **Updates:** Once/session run `node <skill-base-dir>/release-check.mjs`.
7
7
  # Image Generation
@@ -2,7 +2,7 @@
2
2
  name: mermaid
3
3
  description: Create and edit Mermaid diagrams for architecture, API flows, database schemas, workflows, and data models.
4
4
  user-invocable: true
5
- release-version: 0.50.27
5
+ release-version: 0.50.29
6
6
  ---
7
7
  **Updates:** Once/session run `node <skill-base-dir>/release-check.mjs`.
8
8
  # Mermaid Diagram Creation
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  name: wechat-article-writer
3
3
  description: "Write WeChat 公众号 articles in Chinese content styles — 踩坑型 (pitfall-story), 实操型 (how-to), 对比型 (comparison), 观察型 (industry insight) — in the account's house style from the nearest WRITING.md. Use for drafting from scratch, rewriting a draft, adapting source material into a publishable article, or picking the right style. NOT for business or technical documents (write-doc)."
4
- release-version: 0.50.27
4
+ release-version: 0.50.29
5
5
  ---
6
6
  **Updates:** Once/session run `node <skill-base-dir>/release-check.mjs`.
7
7
  # WeChat Article Writer (公众号写作)
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  name: wechat-publisher
3
3
  description: "Publish articles to a WeChat Official Account (公众号) via API: push Markdown to the draft box (or auto-publish with --publish), convert Markdown to WeChat HTML, upload images to the media library. Requires AppID + AppSecret + whitelisted server IP on a 认证订阅号/服务号. Consumes wechat-article-writer's Markdown."
4
- release-version: 0.50.27
4
+ release-version: 0.50.29
5
5
  ---
6
6
  **Updates:** Once/session run `node <skill-base-dir>/release-check.mjs`.
7
7
  # WeChat Publisher (公众号发布)
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  name: wechat-search
3
3
  description: "Search WeChat 公众号 articles via Sogou Weixin, or read/summarize an article from a mp.weixin.qq.com URL (读/分析/总结) — suggest proactively when such a URL appears. Use for Chinese WeChat content, industry reports, competitor or trending topics. Requires Chrome Browser Relay. NOT general web search (web_search)."
4
- release-version: 0.50.27
4
+ release-version: 0.50.29
5
5
  ---
6
6
  **Updates:** Once/session run `node <skill-base-dir>/release-check.mjs`.
7
7
  # WeChat Article Search & Reader (搜狗微信搜索)
@@ -9,7 +9,7 @@ metadata:
9
9
  type: secret
10
10
  required: true
11
11
  description: API key for direct xAI or the explicitly configured Responses gateway
12
- release-version: 0.50.27
12
+ release-version: 0.50.29
13
13
  ---
14
14
  **Updates:** Once/session run `node <skill-base-dir>/release-check.mjs`.
15
15
  # xAI Search (X/Twitter + Web)
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  name: distill-writing
3
3
  description: "Learn a house writing style from approved sample documents, or save an explicitly stated project document preference, into WRITING.md and writing/templates/. Use for sample-based style learning, house-style setup or refresh, and requests such as 'remember this for future PRDs' or 'make this our report default', including handoffs from write-doc, write-report or plain-language. Preserve manual edits and separate document types. NOT for drafting a document (write-doc) or analytical report (write-report) or saving chat-only preferences (plain-language)."
4
- release-version: 0.50.27
4
+ release-version: 0.50.29
5
5
  ---
6
6
  **Updates:** Once/session run `node <skill-base-dir>/release-check.mjs`.
7
7
  # Distill a writing style
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  name: doc-to-md
3
3
  description: "Convert documents (PDF, DOCX, PPTX, XLSX, images) to Markdown so agents can read them. Use as the preprocessing step whenever binary files need to enter agent context — contract review, compliance audit, document analysis, evidence review."
4
- release-version: 0.50.27
4
+ release-version: 0.50.29
5
5
  ---
6
6
  **Updates:** Once/session run `node <skill-base-dir>/release-check.mjs`.
7
7
  # doc-to-md
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  name: editorial-review
3
3
  description: "Review a document or generated report for what it says (does the reader get the answer, is the argument sound, is anything unsupported, obvious or repeated), then fix the content. Use to review, tighten or clarify a doc or report, and as the review step of write-doc, write-report and domain report skills. NOT for Chinese wording (polish-cn) or code review (better-review)."
4
- release-version: 0.50.27
4
+ release-version: 0.50.29
5
5
  ---
6
6
  **Updates:** Once/session run `node <skill-base-dir>/release-check.mjs`.
7
7
  # Editorial review
@@ -3,7 +3,7 @@ name: house-style
3
3
  description: "Shared reference the writing skills read by path: WRITING.md lookup and precedence, template choice, gap markers, template shape, the bundled templates, and the default English and Chinese style guides. Never select or invoke it as a task."
4
4
  disable-model-invocation: true
5
5
  user-invocable: false
6
- release-version: 0.50.27
6
+ release-version: 0.50.29
7
7
  ---
8
8
  **Updates:** Once/session run `node <skill-base-dir>/release-check.mjs`.
9
9
  # House style
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  name: plain-language
3
3
  description: "Session mode: every reply and status line in plain language — lead with the point, everyday words, full sentences, no filler — in English or Chinese, until turned off. Enable by default when the project has an applicable WRITING.md, even without a slash command. Use for /plain-language, 'talk plainly', '说人话', and explicit requests to remember project reply preferences; an actual /plain-language invocation automatically configures the current directory's WRITING.md and loading pointers; init remains an alias. Save reply rules only under Agent replies; route document preferences to distill-writing. Natural-language toggles and off remain session-only. Turn off with '/plain-language off' or 'normal mode'. NOT for writing a document (write-doc) or analytical report (write-report) or reviewing one (editorial-review)."
4
- release-version: 0.50.27
4
+ release-version: 0.50.29
5
5
  ---
6
6
  **Updates:** Once/session run `node <skill-base-dir>/release-check.mjs`.
7
7
  # Plain language