mirror of
https://github.com/Heretek-AI/awesome-opencode.git
synced 2026-11-07 10:45:57 -10:00
chore(org-sync): propagate Heretek-AI/.github@c18a8f5 standards
Signed-off-by: heretek-fleet-sync[bot] <heretek-fleet-sync[bot]@users.noreply.github.com>
This commit is contained in:
1 parent
86e93031fb
commit
afb34feb89
10 files changed
+263
-1
No files matched your search
@@ -0,0 +1,47 @@
|
||||
---
|
||||
name: adversarial-claim-check
|
||||
description: Stress-test repository claims, version pins, packaging artifacts, and security invariants in a disposable git worktree before release or audit sign-off. Use when cutting a release, auditing shipped work, or proving an [S] invariant is guarded by tests.
|
||||
license: MIT
|
||||
compatibility: opencode claude codex copilot
|
||||
metadata:
|
||||
audience: maintainers-and-agents
|
||||
workflow: audit-verification
|
||||
opencode/slash: "true"
|
||||
---
|
||||
|
||||
# Adversarial Claim & Release Verification
|
||||
|
||||
Proves that a repository's claims, dependency pins, and security invariants hold against real tools and sabotage testing in an isolated worktree without dirtying the working checkout.
|
||||
|
||||
## When to Use
|
||||
|
||||
- Verifying a repository before cutting a tagged release or publishing to npm/GHCR
|
||||
- Auditing an issue labeled `audit` or `security`
|
||||
- Confirming that a new test genuinely catches a broken invariant (sabotage check)
|
||||
|
||||
## Steps
|
||||
|
||||
1. **Create an isolated disposable worktree.** Never mutate the primary checkout for destructive or sabotage experiments:
|
||||
|
||||
```bash
|
||||
AUDIT_TMP="$(mktemp -d -t heretek-check-XXXXXX)"
|
||||
trap 'git worktree remove --force "$AUDIT_TMP/wt" || :; rm -rf "$AUDIT_TMP"' EXIT
|
||||
git worktree add --detach "$AUDIT_TMP/wt" HEAD
|
||||
```
|
||||
|
||||
2. **Verify package & lockfile truth.**
|
||||
- **Bun / Node**: Run `npm pack --dry-run` (or `bun pm pack --dry-run`) inside `"$AUDIT_TMP/wt"` and confirm every entry point (`main`, `exports`, `bin`, `files`) resolves to a built file that exists.
|
||||
- **Python (`uv`)**: Run `uv lock --check` and confirm `[tool.uv] exclude-newer = "7 days"` is respected.
|
||||
- **GitHub Actions (remote actions)**: Confirm each remote action `uses: owner/repo[/path]@ref` is pinned to a full 40-character commit SHA. Exclude local action paths (`./.github/actions/...`) and Docker references (`docker://...`) from this SHA check.
|
||||
- **GitHub Actions (reusable workflows)**: Separately confirm each remote workflow `uses: owner/repo/.github/workflows/file.yml@ref` is pinned to a full 40-character commit SHA. Exclude local workflow paths (`./.github/workflows/...`).
|
||||
|
||||
3. **Sabotage critical invariants.** For each security or correctness invariant changed in the PR:
|
||||
- Introduce a 1-line break in `"$AUDIT_TMP/wt"`.
|
||||
- Run the test suite in `"$AUDIT_TMP/wt"` and confirm it exits non-zero.
|
||||
- Restore the file with `git -C "$AUDIT_TMP/wt" checkout -- .`.
|
||||
|
||||
4. **Confirm clean working tree.** Verify `git status --porcelain` on the main checkout is empty after cleanup.
|
||||
|
||||
## Gotchas
|
||||
|
||||
- A test that passes when the production guard is commented out is a lie; fix the test before merging.
|
||||
@@ -0,0 +1,35 @@
|
||||
---
|
||||
name: cross-repo-contract-check
|
||||
description: Verify protocol contracts and version pins across Heretek-AI agent-tooling repositories without sharing runtime source code. Use when updating MCP gateway contracts, OpenCode v2 plugin APIs, or vendored golden fixtures.
|
||||
license: MIT
|
||||
compatibility: opencode claude codex copilot
|
||||
metadata:
|
||||
audience: maintainers-and-agents
|
||||
workflow: cross-repo
|
||||
opencode/slash: "true"
|
||||
---
|
||||
|
||||
# Cross-Repository Contract Verification
|
||||
|
||||
Per `Heretek-AI/.github` ADR 0001, repositories in the agent-tooling family (`IUMBTEMS`, `claude-4-opencode`, `scraper-swarm`, `opencode-4-openclaude`, `GDevelop-Unlocked`) never import each other's source code and integrate strictly over versioned protocols and golden fixtures.
|
||||
|
||||
## When to Use
|
||||
|
||||
- Modifying `/mcp` request/response schemas or `contract/v1/fixtures/` in `Heretek-AI/scraper-swarm`
|
||||
- Updating the vendored `scraper-swarm` client in `Heretek-AI/IUMBTEMS`
|
||||
- Bumping `@opencode/plugin` v2 across `Heretek-AI/IUMBTEMS` or `Heretek-AI/claude-4-opencode`
|
||||
|
||||
## Steps
|
||||
|
||||
1. **Check the governing boundary in `AGENTS.md`.** Confirm that no relative cross-repo filesystem imports or unpublished workspace links are introduced.
|
||||
2. **Validate golden fixtures against real schemas.**
|
||||
- When working in the producer (`Heretek-AI/scraper-swarm`), regenerate or validate `contract/v1/fixtures/` and record the producer commit SHA.
|
||||
- When working in the consumer (`Heretek-AI/IUMBTEMS`), vendor the exact fixture files at the recorded commit SHA and run the consumer contract test suite against them.
|
||||
3. **Apply lockstep or independent release rules.**
|
||||
- `IUMBTEMS` packages (`@heretek-ai/epistemic-swarm`, `es-core`, `es-cli`) release in lockstep at identical version numbers.
|
||||
- `@opencode/plugin` v2 pins move independently per repository (`package.json` is the source of truth).
|
||||
4. **Label cross-repo pull requests.** Apply the `cross-repo` label. Reference companion issues and pull requests as `Heretek-AI/<repo>#<number>`. Record commits with the repository name and full commit SHA, as `Heretek-AI/<repo>@<full-commit-sha>`.
|
||||
|
||||
## Gotchas
|
||||
|
||||
- Breaking changes to an existing contract path (`contract/v1/`) are forbidden; introduce a new contract version directory (`contract/v2/`) and open a tracking issue on the consumer repository.
|
||||
@@ -0,0 +1,73 @@
|
||||
---
|
||||
name: evidence-pr
|
||||
description: Prepare and verify an evidence-backed pull request following Heretek-AI conventions. Use whenever staging changes, running pre-PR verification, writing a pull request body, or checking CI status after a push.
|
||||
license: MIT
|
||||
compatibility: opencode claude codex copilot
|
||||
metadata:
|
||||
audience: maintainers-and-agents
|
||||
workflow: github-pr
|
||||
opencode/slash: "true"
|
||||
---
|
||||
|
||||
# Evidence-Backed Pull Request Workflow
|
||||
|
||||
Every pull request in a `Heretek-AI` repository must prove its claims with executed command output and explicitly state what was not run.
|
||||
|
||||
## When to Use
|
||||
|
||||
- Preparing a branch to open or update a pull request
|
||||
- Writing or updating a pull request description
|
||||
- Verifying that a push passes all required status checks
|
||||
|
||||
## Steps
|
||||
|
||||
1. **Work on a topic branch.** Confirm you are not on `main`:
|
||||
|
||||
```bash
|
||||
git branch --show-current
|
||||
```
|
||||
|
||||
2. **Stage explicit repo-relative paths.** Never run `git add .` or `git add -A`. Verify staged files contain no machine-local paths or untracked scratch files:
|
||||
|
||||
```bash
|
||||
git status --short
|
||||
git diff --cached --stat
|
||||
```
|
||||
|
||||
Scan the staged blobs using the repository's no-local-paths pattern (not just the working files):
|
||||
|
||||
```bash
|
||||
PATTERN='file:///(home|Users|root)/|/(home|Users)/[^/[:space:]"'"'"'`<>]+/(Projects|Documents|Desktop|Downloads|\.gemini|\.claude|\.codex|\.cursor)(/|[^A-Za-z0-9_-]|$)'
|
||||
if git grep --cached -nIE "$PATTERN" -- .; then
|
||||
echo "ERROR: Machine-local paths found in staged content." >&2
|
||||
exit 1
|
||||
else
|
||||
scan_status=$?
|
||||
[ "$scan_status" -eq 1 ] || exit "$scan_status"
|
||||
fi
|
||||
```
|
||||
|
||||
Resolve any matches or scan errors before claiming the no-local-paths invariant is verified.
|
||||
|
||||
3. **Run local pre-commit and test gates.** Execute Lefthook and the repository's canonical test command, capturing the exact output:
|
||||
|
||||
```bash
|
||||
lefthook run pre-commit
|
||||
```
|
||||
|
||||
4. **Draft the PR body using executed evidence.** Populate all three required sections from `.github/pull_request_template.md`:
|
||||
- `## What and why`: Concise summary of the behavior change and motivation.
|
||||
- `## Evidence`: Exact commands executed and their trimmed verbatim stdout/stderr. Explicitly list any check or integration that was **not** run and why.
|
||||
- `## Linked issues`: Closing or tracking references (`Closes #123` or `Part of Heretek-AI/<repo>#45`).
|
||||
|
||||
5. **Sign off commits and verify CI after push.** Organization governance requires commit sign-off (`git commit --signoff`). After pushing, inspect every triggered workflow run:
|
||||
|
||||
```bash
|
||||
gh pr checks --watch
|
||||
```
|
||||
|
||||
## Gotchas
|
||||
|
||||
- Never claim a test passed without executing it in the current working tree.
|
||||
- Never reference another repository by local filesystem path (`../other-repo` or `/Users/...`); always use `Heretek-AI/<repo>`.
|
||||
- Merging to `main` and cutting releases are human maintainer actions unless explicitly delegated.
|
||||
@@ -0,0 +1,56 @@
|
||||
---
|
||||
name: hygiene-and-workflow-audit
|
||||
description: Audit tracked files and GitHub Actions workflows for machine-local path leaks, unpinned actions, template injection, excessive permissions, and invalid SKILL.md frontmatter. Use when editing .github/workflows, adding skills, or debugging hygiene CI failures.
|
||||
license: MIT
|
||||
compatibility: opencode claude codex copilot
|
||||
metadata:
|
||||
audience: maintainers-and-agents
|
||||
workflow: security-hygiene
|
||||
opencode/slash: "true"
|
||||
---
|
||||
|
||||
# Hygiene and Workflow Security Audit
|
||||
|
||||
Enforces `Heretek-AI` repository hygiene and GitHub Actions supply-chain hardening locally before changes reach CI.
|
||||
|
||||
## When to Use
|
||||
|
||||
- Creating or modifying `.github/workflows/*.yml`
|
||||
- Creating or updating `.agents/skills/*/SKILL.md`
|
||||
- Diagnosing a failure in the `hygiene / No machine-local paths` status check
|
||||
- Preparing a repository for zero-bypass ruleset enforcement
|
||||
|
||||
## Steps
|
||||
|
||||
1. **Scan tracked files for machine-local paths.** Run the exact regex enforced by `Heretek-AI/.github/.github/workflows/hygiene.yml`:
|
||||
|
||||
```bash
|
||||
PATTERN='file:///(home|Users|root)/|/(home|Users)/[^/[:space:]"'"'"'`<>]+/(Projects|Documents|Desktop|Downloads|\.gemini|\.claude|\.codex|\.cursor)(/|[^A-Za-z0-9_-]|$)'
|
||||
! git grep -nIE "$PATTERN" -- .
|
||||
```
|
||||
|
||||
2. **Enforce GitHub Actions security invariants.** Every workflow under `.github/workflows/` must satisfy:
|
||||
- Top-level `permissions: contents: read` (or `permissions: {}` with job-level least-privilege grants).
|
||||
- Every third-party or official `uses:` step pinned to a full 40-character commit SHA with a `# vX.Y.Z` version comment.
|
||||
- `persist-credentials: false` on every `actions/checkout` step unless the job explicitly pushes git changes.
|
||||
- No untrusted context (`github.event.pull_request.title`, `github.event.issue.body`, `github.event.comment.body`, `github.head_ref`) interpolated directly inside `run:` blocks; always bind untrusted values to `env:` variables first.
|
||||
|
||||
3. **Run static workflow analyzers (`actionlint` and `zizmor`).**
|
||||
|
||||
```bash
|
||||
actionlint
|
||||
uvx [email protected] --format=plain .
|
||||
```
|
||||
|
||||
4. **Validate Agent Skills (`SKILL.md`).** In `Heretek-AI/.github` only, validate the canonical `skills/` directory:
|
||||
|
||||
```bash
|
||||
bash scripts/validate-skills.sh
|
||||
```
|
||||
|
||||
In downstream repositories, use their documented skill validation command when available. Fleet sync copies skills into `.agents/skills/` but does not install `scripts/validate-skills.sh`; do not assume that command exists there.
|
||||
|
||||
## Gotchas
|
||||
|
||||
- `actionlint` skips input validation on SHA-pinned actions; verify action input names against upstream `action.yml` when pinning.
|
||||
- Never add `pull_request_target` workflows that check out or execute untrusted PR head code.
|
||||
Symlink
+1
@@ -0,0 +1 @@
|
||||
../.agents/skills
|
||||
@@ -0,0 +1,9 @@
|
||||
# actionlint configuration for Heretek-AI repositories
|
||||
self-hosted-runner:
|
||||
labels: []
|
||||
|
||||
config-variables:
|
||||
- OPENCODE_MODEL
|
||||
- OCR_LLM_URL
|
||||
- OCR_LLM_MODEL
|
||||
- OCR_LLM_USE_ANTHROPIC
|
||||
Symlink
+1
@@ -0,0 +1 @@
|
||||
../.agents/skills
|
||||
@@ -37,5 +37,5 @@ permissions:
|
||||
|
||||
jobs:
|
||||
review:
|
||||
uses: Heretek-AI/.github/.github/workflows/ocr-review.yml@a440b485d779b9177b1602c4d4f7f58cff0483a2 # main
|
||||
uses: Heretek-AI/.github/.github/workflows/ocr-review.yml@c18a8f547aed325acf7d49bff1f8457e042d22ca # main
|
||||
secrets: inherit
|
||||
Symlink
+1
@@ -0,0 +1 @@
|
||||
../.agents/skills
|
||||
@@ -0,0 +1,39 @@
|
||||
# Standardized Lefthook v2 configuration — Profile: universal (Docs, Skills, Docker, Config repos)
|
||||
# Managed by Heretek-AI/.github fleet-sync. Local overrides belong in lefthook-local.yml.
|
||||
min_version: 1.10.0
|
||||
|
||||
pre-commit:
|
||||
parallel: true
|
||||
jobs:
|
||||
- name: no-local-paths
|
||||
run: |
|
||||
PATTERN='file:///(home|Users|root)/|/(home|Users)/[^/[:space:]"'"'"'`<>]+/(Projects|Documents|Desktop|Downloads|\.gemini|\.claude|\.codex|\.cursor)(/|[^A-Za-z0-9_-]|$)'
|
||||
if git grep -nIE "$PATTERN" -- {staged_files}; then
|
||||
echo "ERROR: Machine-local paths found in staged files. Use repo-relative paths or owner/name."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
- name: gitleaks
|
||||
run: |
|
||||
if command -v gitleaks >/dev/null 2>&1; then
|
||||
gitleaks protect --staged --redact --no-banner
|
||||
fi
|
||||
|
||||
- name: json-validate
|
||||
glob: "*.json"
|
||||
run: jq empty {staged_files}
|
||||
|
||||
- name: shellcheck
|
||||
glob: "*.sh"
|
||||
run: |
|
||||
if command -v shellcheck >/dev/null 2>&1; then
|
||||
shellcheck {staged_files}
|
||||
else
|
||||
bash -n {staged_files}
|
||||
fi
|
||||
|
||||
- name: workflow-audit
|
||||
glob: ".github/workflows/*.{yml,yaml}"
|
||||
run: |
|
||||
if command -v actionlint >/dev/null 2>&1; then actionlint {staged_files}; fi
|
||||
if command -v zizmor >/dev/null 2>&1; then zizmor --format=plain {staged_files}; fi
|
||||
Reference in new issue
Block a user