code-foundry 0.1.4

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 (50) hide show
  1. package/.editorconfig +18 -0
  2. package/.env.example +3 -0
  3. package/.gitattributes +9 -0
  4. package/.githooks/pre-commit +67 -0
  5. package/.github/CODEOWNERS +4 -0
  6. package/.github/CODE_OF_CONDUCT.md +41 -0
  7. package/.github/CONTRIBUTING.md +198 -0
  8. package/.github/ISSUE_TEMPLATE/bug_report.yml +56 -0
  9. package/.github/ISSUE_TEMPLATE/config.yml +5 -0
  10. package/.github/ISSUE_TEMPLATE/feature_request.yml +38 -0
  11. package/.github/PULL_REQUEST_TEMPLATE.md +29 -0
  12. package/.github/SECURITY.md +23 -0
  13. package/.github/actions/cache/action.yml +43 -0
  14. package/.github/actions/codeql/action.yml +29 -0
  15. package/.github/actions/setup/action.yml +776 -0
  16. package/.github/dependabot.yml +42 -0
  17. package/.github/scripts/bootstrap.sh +20 -0
  18. package/.github/scripts/changed-files.sh +96 -0
  19. package/.github/scripts/ci.sh +636 -0
  20. package/.github/scripts/codeql-languages.sh +86 -0
  21. package/.github/scripts/doctor.sh +103 -0
  22. package/.github/scripts/format-fast-path.sh +80 -0
  23. package/.github/scripts/init-repo.sh +134 -0
  24. package/.github/scripts/security.sh +209 -0
  25. package/.github/scripts/sitecustomize.py +17 -0
  26. package/.github/scripts/sync-codeowners.sh +76 -0
  27. package/.github/scripts/sync-protection.sh +137 -0
  28. package/.github/scripts/sync-template.sh +432 -0
  29. package/.github/scripts/turbo-cache-probe.sh +102 -0
  30. package/.github/template.yml +7 -0
  31. package/.github/template.yml.example +8 -0
  32. package/.github/workflows/ci.yml +166 -0
  33. package/.github/workflows/codeql.yml +160 -0
  34. package/.github/workflows/draft-pr.yml +59 -0
  35. package/.github/workflows/release-pr.yml +66 -0
  36. package/.github/workflows/release.yml +103 -0
  37. package/.github/workflows/security.yml +228 -0
  38. package/.github/workflows/test.yml +175 -0
  39. package/.gitignore +77 -0
  40. package/.mise.toml +6 -0
  41. package/.prettierrc +6 -0
  42. package/AGENTS.md +155 -0
  43. package/CHANGELOG.md +3 -0
  44. package/LICENSE +616 -0
  45. package/NOTICE +7 -0
  46. package/README.md +172 -0
  47. package/package.json +44 -0
  48. package/release-please-config.json +16 -0
  49. package/ruff.toml +6 -0
  50. package/src/cli.mjs +137 -0
@@ -0,0 +1,228 @@
1
+ name: Security
2
+
3
+ on:
4
+ push:
5
+ branches: [main, staging]
6
+ pull_request:
7
+ branches: [staging]
8
+ workflow_dispatch:
9
+
10
+ permissions:
11
+ contents: read
12
+
13
+ env:
14
+ REPO_FOUNDRY_BASE_SHA: ${{ github.event_name == 'pull_request' && github.event.pull_request.base.sha || github.event.before || '' }}
15
+
16
+ concurrency:
17
+ group: ${{ github.workflow }}-${{ github.event.pull_request.head.repo.full_name || github.repository }}-${{ github.event.pull_request.head.ref || github.ref_name }}
18
+ cancel-in-progress: true
19
+
20
+ jobs:
21
+ profile:
22
+ name: Profile
23
+ runs-on: ubuntu-slim
24
+ timeout-minutes: 10
25
+ outputs:
26
+ javascript: ${{ steps.profile.outputs.javascript }}
27
+ rust: ${{ steps.profile.outputs.rust }}
28
+ python: ${{ steps.profile.outputs.python }}
29
+ python_requirements: ${{ steps.profile.outputs.python_requirements }}
30
+ steps:
31
+ - name: Checkout
32
+ uses: actions/checkout@v7
33
+ with:
34
+ fetch-depth: 2
35
+ filter: blob:none
36
+ sparse-checkout: |
37
+ .github
38
+ .mise.toml
39
+ mise.lock
40
+ .npmrc
41
+ .pnpmfile.cjs
42
+ .yarnrc*
43
+ **/package.json
44
+ **/bun.lock
45
+ **/bun.lockb
46
+ **/pnpm-lock.yaml
47
+ **/yarn.lock
48
+ **/package-lock.json
49
+ **/Cargo.toml
50
+ **/Cargo.lock
51
+ **/.cargo/**
52
+ **/pyproject.toml
53
+ **/requirements*.txt
54
+ **/setup.py
55
+ **/setup.cfg
56
+ **/Pipfile
57
+ **/Pipfile.lock
58
+ **/poetry.lock
59
+ **/uv.lock
60
+ sparse-checkout-cone-mode: false
61
+ - name: Detect
62
+ id: profile
63
+ run: bash .github/scripts/security.sh profile >> "$GITHUB_OUTPUT"
64
+
65
+ dependency-audit-javascript:
66
+ name: Dependency Audit (JavaScript)
67
+ runs-on: ubuntu-slim
68
+ timeout-minutes: 20
69
+ steps:
70
+ - name: Checkout
71
+ uses: actions/checkout@v7
72
+ with:
73
+ # JavaScript audits only need manifests, lockfiles, and audit config.
74
+ filter: blob:none
75
+ sparse-checkout: |
76
+ .github
77
+ .mise.toml
78
+ mise.lock
79
+ .npmrc
80
+ .pnpmfile.cjs
81
+ .yarnrc*
82
+ **/package.json
83
+ **/bun.lock
84
+ **/bun.lockb
85
+ **/pnpm-lock.yaml
86
+ **/yarn.lock
87
+ **/package-lock.json
88
+ sparse-checkout-cone-mode: false
89
+ - name: Detect
90
+ id: applicability
91
+ run: bash .github/scripts/security.sh should_run javascript >> "$GITHUB_OUTPUT"
92
+ - name: Setup
93
+ if: steps.applicability.outputs.applicable == 'true'
94
+ uses: ./.github/actions/setup
95
+ with:
96
+ mise-scope: javascript
97
+ cache-save: ${{ github.event_name != 'pull_request' }}
98
+ - name: Audit dependencies
99
+ if: steps.applicability.outputs.applicable == 'true'
100
+ run: bash .github/scripts/security.sh audit javascript
101
+
102
+ dependency-audit-rust:
103
+ name: Dependency Audit (Rust)
104
+ # ubuntu-latest ships with Cargo/Rust; use it for the audit-only job and
105
+ # fall back to the repository toolchain when the image lacks Rust.
106
+ runs-on: ${{ vars.REPO_FOUNDRY_RUST_AUDIT_RUNNER || 'ubuntu-latest' }}
107
+ timeout-minutes: 20
108
+ steps:
109
+ - name: Checkout
110
+ uses: actions/checkout@v7
111
+ with:
112
+ # Rust audits only need manifests, Cargo configuration, and audit config.
113
+ filter: blob:none
114
+ sparse-checkout: |
115
+ .github
116
+ .mise.toml
117
+ mise.lock
118
+ **/Cargo.toml
119
+ **/Cargo.lock
120
+ **/.cargo/**
121
+ sparse-checkout-cone-mode: false
122
+ - name: Detect
123
+ id: applicability
124
+ run: bash .github/scripts/security.sh should_run rust >> "$GITHUB_OUTPUT"
125
+ - name: Check Rust
126
+ id: system-rust
127
+ if: steps.applicability.outputs.applicable == 'true'
128
+ shell: bash
129
+ run: |
130
+ if command -v cargo >/dev/null 2>&1 && command -v rustc >/dev/null 2>&1; then
131
+ cargo --version
132
+ rustc --version
133
+ echo 'available=true' >> "$GITHUB_OUTPUT"
134
+ else
135
+ echo 'available=false' >> "$GITHUB_OUTPUT"
136
+ fi
137
+ - name: Setup
138
+ if: >-
139
+ steps.applicability.outputs.applicable == 'true' &&
140
+ steps.system-rust.outputs.available != 'true'
141
+ uses: ./.github/actions/setup
142
+ with:
143
+ mise-scope: rust
144
+ cache-save: ${{ github.event_name != 'pull_request' }}
145
+ - name: Install cargo-audit
146
+ if: steps.applicability.outputs.applicable == 'true'
147
+ uses: taiki-e/install-action@v2
148
+ with:
149
+ tool: cargo-audit
150
+ - name: Audit dependencies
151
+ if: steps.applicability.outputs.applicable == 'true'
152
+ run: bash .github/scripts/security.sh audit rust
153
+
154
+ dependency-audit-python:
155
+ name: Dependency Audit (Python) / ${{ matrix.requirement }}
156
+ needs: profile
157
+ if: >-
158
+ ${{ needs.profile.result == 'success' &&
159
+ needs.profile.outputs.python == 'true' &&
160
+ needs.profile.outputs.python_requirements != '["none"]' }}
161
+ strategy:
162
+ fail-fast: false
163
+ max-parallel: 8
164
+ matrix:
165
+ requirement: ${{ fromJSON(needs.profile.outputs.python_requirements) }}
166
+ runs-on: ubuntu-slim
167
+ timeout-minutes: 20
168
+ env:
169
+ REPO_FOUNDRY_PYTHON_REQUIREMENT: ${{ matrix.requirement }}
170
+ steps:
171
+ - name: Checkout
172
+ uses: actions/checkout@v7
173
+ with:
174
+ # Python audits only need manifests, lockfiles, and audit config.
175
+ filter: blob:none
176
+ sparse-checkout: |
177
+ .github
178
+ .mise.toml
179
+ mise.lock
180
+ **/pyproject.toml
181
+ **/requirements*.txt
182
+ **/setup.py
183
+ **/setup.cfg
184
+ **/Pipfile
185
+ **/Pipfile.lock
186
+ **/poetry.lock
187
+ **/uv.lock
188
+ sparse-checkout-cone-mode: false
189
+ - name: Setup
190
+ uses: ./.github/actions/setup
191
+ with:
192
+ mise-scope: python
193
+ cache-save: ${{ github.event_name != 'pull_request' }}
194
+ - name: Audit dependencies
195
+ run: bash .github/scripts/security.sh audit python
196
+
197
+ dependency-audit-python-gate:
198
+ name: Dependency Audit (Python)
199
+ needs: [profile, dependency-audit-python]
200
+ if: always()
201
+ runs-on: ubuntu-slim
202
+ timeout-minutes: 5
203
+ steps:
204
+ - name: Gate
205
+ env:
206
+ PROFILE_RESULT: ${{ needs.profile.result }}
207
+ AUDIT_RESULT: ${{ needs.dependency-audit-python.result }}
208
+ run: |
209
+ if [ "$PROFILE_RESULT" != success ]; then
210
+ echo "Python audit profile failed: $PROFILE_RESULT" >&2
211
+ exit 1
212
+ fi
213
+ case "$AUDIT_RESULT" in
214
+ success|skipped) exit 0 ;;
215
+ *) echo "Python dependency audit failed: $AUDIT_RESULT" >&2; exit 1 ;;
216
+ esac
217
+
218
+ dependency-review:
219
+ name: Dependency Review
220
+ if: ${{ github.event_name == 'pull_request' && !github.event.repository.private }}
221
+ runs-on: ubuntu-slim
222
+ timeout-minutes: 10
223
+ steps:
224
+ - name: Review
225
+ uses: actions/dependency-review-action@v5
226
+ with:
227
+ fail-on-severity: high
228
+ license-check: true
@@ -0,0 +1,175 @@
1
+ name: Test
2
+
3
+ on:
4
+ push:
5
+ branches: [main, staging]
6
+ pull_request:
7
+ branches: [staging]
8
+ workflow_dispatch:
9
+
10
+ permissions:
11
+ contents: read
12
+
13
+ env:
14
+ TURBO_TOKEN: ${{ secrets.TURBO_TOKEN }}
15
+ TURBO_TEAM: ${{ vars.TURBO_TEAM }}
16
+ REPO_FOUNDRY_BASE_SHA: ${{ github.event_name == 'pull_request' && github.event.pull_request.base.sha || github.event.before || '' }}
17
+
18
+ concurrency:
19
+ group: ${{ github.workflow }}-${{ github.event.pull_request.head.repo.full_name || github.repository }}-${{ github.event.pull_request.head.ref || github.ref_name }}
20
+ cancel-in-progress: true
21
+
22
+ jobs:
23
+ unit:
24
+ name: Unit
25
+ # Keep ordinary suites on the lean image. Set the repository variable
26
+ # REPO_FOUNDRY_UNIT_RUNNER=ubuntu-latest for native/system-dependent tests.
27
+ runs-on: ${{ vars.REPO_FOUNDRY_UNIT_RUNNER || 'ubuntu-slim' }}
28
+ timeout-minutes: 30
29
+ steps:
30
+ - name: Checkout
31
+ uses: actions/checkout@v7
32
+ with:
33
+ fetch-depth: 2
34
+ - name: Detect
35
+ id: applicability
36
+ run: bash .github/scripts/ci.sh task_profile unit >> "$GITHUB_OUTPUT"
37
+ - name: Setup
38
+ if: steps.applicability.outputs.applicable == 'true'
39
+ uses: ./.github/actions/setup
40
+ with:
41
+ install: true
42
+ install-javascript: ${{ steps.applicability.outputs.javascript == 'true' }}
43
+ install-python: ${{ steps.applicability.outputs.python == 'true' }}
44
+ install-rust: ${{ steps.applicability.outputs.rust == 'true' }}
45
+ cache-build: false
46
+ cache-environment: false
47
+ cache-packages: ${{ vars.REPO_FOUNDRY_CACHE_PACKAGES || 'auto' }}
48
+ task: unit
49
+ task-javascript: ${{ steps.applicability.outputs.javascript }}
50
+ task-python: ${{ steps.applicability.outputs.python }}
51
+ task-rust: ${{ steps.applicability.outputs.rust }}
52
+ - name: Unit
53
+ if: steps.applicability.outputs.applicable == 'true'
54
+ run: bash .github/scripts/ci.sh unit
55
+ - name: Upload coverage
56
+ if: >-
57
+ always() &&
58
+ steps.applicability.outputs.applicable == 'true' &&
59
+ hashFiles('coverage/**', 'htmlcov/**', '.coverage*', 'target/llvm-cov/**') != ''
60
+ uses: actions/upload-artifact@v7
61
+ with:
62
+ name: coverage-unit-${{ github.run_id }}
63
+ path: |
64
+ coverage/**
65
+ htmlcov/**
66
+ .coverage*
67
+ target/llvm-cov/**
68
+ compression-level: 1
69
+ if-no-files-found: ignore
70
+ retention-days: 14
71
+
72
+ integration:
73
+ name: Integration
74
+ runs-on: ubuntu-latest
75
+ timeout-minutes: 30
76
+ steps:
77
+ - name: Checkout
78
+ uses: actions/checkout@v7
79
+ with:
80
+ fetch-depth: 2
81
+ - name: Detect
82
+ id: applicability
83
+ run: bash .github/scripts/ci.sh task_profile integration >> "$GITHUB_OUTPUT"
84
+ - name: Setup
85
+ if: steps.applicability.outputs.applicable == 'true'
86
+ uses: ./.github/actions/setup
87
+ with:
88
+ install: true
89
+ install-javascript: ${{ steps.applicability.outputs.javascript == 'true' }}
90
+ install-python: ${{ steps.applicability.outputs.python == 'true' }}
91
+ install-rust: ${{ steps.applicability.outputs.rust == 'true' }}
92
+ cache-build: ${{ steps.applicability.outputs.rust == 'true' }}
93
+ cache-environment: false
94
+ cache-save: ${{ github.event_name == 'push' }}
95
+ task: integration
96
+ task-javascript: ${{ steps.applicability.outputs.javascript }}
97
+ task-python: ${{ steps.applicability.outputs.python }}
98
+ task-rust: ${{ steps.applicability.outputs.rust }}
99
+ - name: Integration
100
+ if: steps.applicability.outputs.applicable == 'true'
101
+ run: bash .github/scripts/ci.sh integration
102
+
103
+ e2e:
104
+ name: E2E
105
+ runs-on: ubuntu-latest
106
+ timeout-minutes: 45
107
+ steps:
108
+ - name: Checkout
109
+ uses: actions/checkout@v7
110
+ with:
111
+ fetch-depth: 2
112
+ - name: Detect
113
+ id: applicability
114
+ run: bash .github/scripts/ci.sh task_profile e2e >> "$GITHUB_OUTPUT"
115
+ - name: Cache browser binaries
116
+ if: steps.applicability.outputs.applicable == 'true' && steps.applicability.outputs.browser == 'true'
117
+ uses: ./.github/actions/cache
118
+ with:
119
+ save: ${{ github.event_name == 'push' }}
120
+ path: |
121
+ ~/.cache/ms-playwright
122
+ ~/.cache/Cypress
123
+ ~/.cache/puppeteer
124
+ key: ${{ runner.os }}-e2e-browsers-${{ hashFiles('**/package.json', '**/bun.lock', '**/bun.lockb', '**/pnpm-lock.yaml', '**/yarn.lock', '**/package-lock.json', '**/playwright.config.*', '**/cypress.config.*') }}
125
+ restore-keys: |
126
+ ${{ runner.os }}-e2e-browsers-
127
+ - name: Setup
128
+ if: steps.applicability.outputs.applicable == 'true'
129
+ uses: ./.github/actions/setup
130
+ with:
131
+ install: true
132
+ install-javascript: ${{ steps.applicability.outputs.javascript == 'true' }}
133
+ install-python: ${{ steps.applicability.outputs.python == 'true' }}
134
+ install-rust: ${{ steps.applicability.outputs.rust == 'true' }}
135
+ cache-build: false
136
+ cache-environment: false
137
+ cache-save: ${{ github.event_name == 'push' }}
138
+ task: e2e
139
+ task-javascript: ${{ steps.applicability.outputs.javascript }}
140
+ task-python: ${{ steps.applicability.outputs.python }}
141
+ task-rust: ${{ steps.applicability.outputs.rust }}
142
+ - name: E2E
143
+ if: steps.applicability.outputs.applicable == 'true'
144
+ run: bash .github/scripts/ci.sh e2e
145
+
146
+ smoke:
147
+ name: Smoke
148
+ runs-on: ubuntu-latest
149
+ timeout-minutes: 15
150
+ steps:
151
+ - name: Checkout
152
+ uses: actions/checkout@v7
153
+ with:
154
+ fetch-depth: 2
155
+ - name: Detect
156
+ id: applicability
157
+ run: bash .github/scripts/ci.sh task_profile smoke >> "$GITHUB_OUTPUT"
158
+ - name: Setup
159
+ if: steps.applicability.outputs.applicable == 'true'
160
+ uses: ./.github/actions/setup
161
+ with:
162
+ install: true
163
+ install-javascript: ${{ steps.applicability.outputs.javascript == 'true' }}
164
+ install-python: ${{ steps.applicability.outputs.python == 'true' }}
165
+ install-rust: ${{ steps.applicability.outputs.rust == 'true' }}
166
+ cache-build: false
167
+ cache-environment: false
168
+ cache-save: ${{ github.event_name == 'push' }}
169
+ task: smoke
170
+ task-javascript: ${{ steps.applicability.outputs.javascript }}
171
+ task-python: ${{ steps.applicability.outputs.python }}
172
+ task-rust: ${{ steps.applicability.outputs.rust }}
173
+ - name: Smoke
174
+ if: steps.applicability.outputs.applicable == 'true'
175
+ run: bash .github/scripts/ci.sh smoke
package/.gitignore ADDED
@@ -0,0 +1,77 @@
1
+ # Operating system
2
+ .DS_Store
3
+ Thumbs.db
4
+ .Trashes
5
+
6
+ # Secrets and local environment
7
+ .env
8
+ .env.*
9
+ !.env.example
10
+ *.pem
11
+ *.key
12
+
13
+ # JavaScript and TypeScript
14
+ node_modules/
15
+ .pnp/
16
+ .pnp.js
17
+ .turbo/
18
+ *.tsbuildinfo
19
+ next-env.d.ts
20
+
21
+ # Python
22
+ .venv/
23
+ venv/
24
+ __pycache__/
25
+ *.py[cod]
26
+ .pytest_cache/
27
+ .ruff_cache/
28
+ .mypy_cache/
29
+
30
+ # Rust
31
+ target/
32
+
33
+ # Build and test output
34
+ dist/
35
+ build/
36
+ out/
37
+ coverage/
38
+ htmlcov/
39
+ .coverage*
40
+ .next/
41
+ artifacts/
42
+ cache/
43
+ !.github/actions/cache/
44
+ !.github/actions/cache/action.yml
45
+ typechain/
46
+ coverage.json
47
+ tests/.bin/
48
+ **/.app/
49
+
50
+ # Logs and temporary files
51
+ *.log
52
+ *.tmp
53
+ *.pid
54
+ npm-debug.log*
55
+ yarn-debug.log*
56
+ pnpm-debug.log*
57
+
58
+ # Editors, agents, and local tools
59
+ .claude/
60
+ .kilo/
61
+ .codex/
62
+ .cursor/
63
+ .windsurf/
64
+ .vscode/
65
+ .idea/
66
+ .zed/
67
+ .fleet/
68
+ .opencode/
69
+ .kluster/
70
+ .direnv/
71
+ .envrc
72
+ .vercel/
73
+ mise.local.toml
74
+ .mise.local.toml
75
+ mise.local.lock
76
+ .mise.local.lock
77
+ *.code-workspace
package/.mise.toml ADDED
@@ -0,0 +1,6 @@
1
+ [tools]
2
+ node = "24.18.0"
3
+ bun = "1.3.14"
4
+
5
+ [settings]
6
+ experimental = true
package/.prettierrc ADDED
@@ -0,0 +1,6 @@
1
+ {
2
+ "semi": false,
3
+ "singleQuote": true,
4
+ "trailingComma": "es5",
5
+ "printWidth": 100
6
+ }
package/AGENTS.md ADDED
@@ -0,0 +1,155 @@
1
+ # Agent Instructions
2
+
3
+ These instructions are the repository-level operating contract for coding agents, including Hermes, OpenCode, and other automation.
4
+
5
+ They complement `CONTRIBUTING.md`. More specific instructions in nested `AGENTS.md` files and project documentation take precedence for their directory.
6
+
7
+ ## Mission
8
+
9
+ - Keep formatting, linting, type checking, builds, tests, and coverage reproducible locally and in CI.
10
+ - Prefer the versions pinned in `.mise.toml`.
11
+ - Do not commit secrets, generated credentials, local environment files, or machine-specific paths.
12
+ - Add tests for behavior changes and keep coverage thresholds explicit in the project configuration.
13
+ - Make the smallest complete, well-tested change that solves the requested problem without disturbing unrelated work.
14
+
15
+ This repository may contain TypeScript, Rust, Python, or any combination of them. Detect the active stack from the files present; do not assume every check applies.
16
+
17
+ ## Read before acting
18
+
19
+ Before editing:
20
+
21
+ 1. Read this file and `.github/CONTRIBUTING.md`.
22
+ 2. Find and read any nested `AGENTS.md` that covers the files you will touch.
23
+ 3. Read the nearest README, package manifest, build configuration, and relevant tests.
24
+ 4. Inspect the current branch, worktree, remotes, and recent history:
25
+
26
+ ```sh
27
+ git status --short --branch
28
+ git remote -v
29
+ git log -5 --oneline
30
+ ```
31
+
32
+ 5. Identify the repository's package manager, lockfile, runtime versions, test commands, deployment assumptions, and generated files.
33
+
34
+ If the worktree is dirty, preserve existing changes and avoid overlapping edits until their ownership is clear.
35
+
36
+ ## Priorities
37
+
38
+ When instructions conflict, use this order:
39
+
40
+ 1. System and user instructions
41
+ 2. This repository's instructions and explicit task scope
42
+ 3. Nested directory instructions
43
+ 4. Existing project conventions
44
+ 5. General best practices
45
+
46
+ Ask for clarification when a missing decision would materially change the implementation. Otherwise make the smallest reasonable assumption and document it.
47
+
48
+ ## Safety boundaries
49
+
50
+ - Do not discard, reset, overwrite, or rewrite user-owned changes.
51
+ - Do not expose or commit secrets, credentials, tokens, private keys, local environment files, or personal machine paths.
52
+ - Do not modify production resources, repository settings, branch protections, secrets, deployments, or external systems unless explicitly requested.
53
+ - Do not add organization- or product-specific details to this reusable baseline.
54
+ - Do not change dependency managers or lockfiles unnecessarily.
55
+ - Do not bypass hooks, tests, review requirements, or required checks to hide a failure.
56
+ - Do not claim completion while required validation, review, deployment, or user decisions remain pending.
57
+ - Publishing, committing, or opening a pull request requires explicit task scope or user authorization.
58
+
59
+ ## Standard workflow
60
+
61
+ 1. Restate the desired outcome and identify the files or systems in scope.
62
+ 2. Inspect before editing; preserve unrelated work.
63
+ 3. Plan the smallest coherent change.
64
+ 4. Implement with existing project patterns.
65
+ 5. Run bash .github/scripts/bootstrap.sh for a new checkout, or bash .github/scripts/doctor.sh to diagnose setup drift.
66
+ 6. Run focused checks while iterating.
67
+ 7. Inspect the final diff for accidental changes, secrets, formatting, and generated files.
68
+ 8. Run the broadest applicable validation available.
69
+ 9. Report what changed, exact checks and results, skipped checks with reasons, risks, and remaining work.
70
+
71
+ For normal feature work, branch from `staging` and target pull requests at `staging`. Treat `main` as the protected release branch. Follow `.github/CONTRIBUTING.md` for the complete internal and external contribution flow.
72
+
73
+ ## Toolchain and dependencies
74
+
75
+ - Use the versions pinned in `.mise.toml`; run `mise install` when needed.
76
+ - Use the package manager indicated by the existing lockfile:
77
+ - `bun.lock` or `bun.lockb` → Bun
78
+ - `pnpm-lock.yaml` → pnpm
79
+ - `yarn.lock` → Yarn
80
+ - `package-lock.json` → npm
81
+ - Use the existing Python environment and dependency manifest. Prefer a project-managed virtual environment.
82
+ - Use Cargo commands and the committed Cargo lockfile for Rust projects.
83
+ - Do not mix package managers or regenerate lockfiles as a side effect.
84
+ - Keep dependency additions narrowly scoped and explain security, licensing, and runtime impact.
85
+
86
+ ## Validation
87
+
88
+ Use the shared scripts when present. They detect supported tools and skip inapplicable checks:
89
+
90
+ ```sh
91
+ bash .github/scripts/ci.sh format
92
+ bash .github/scripts/ci.sh lint
93
+ bash .github/scripts/ci.sh type_check
94
+ bash .github/scripts/ci.sh build
95
+ bash .github/scripts/ci.sh unit
96
+ bash .github/scripts/ci.sh integration
97
+ bash .github/scripts/ci.sh e2e
98
+ bash .github/scripts/ci.sh smoke
99
+ bash .github/scripts/security.sh
100
+ ```
101
+
102
+ Run focused tests first, then the complete applicable set for release, security, workflow, dependency, and configuration changes.
103
+
104
+ At minimum:
105
+
106
+ - TypeScript/JavaScript: Prettier formatting, ESLint linting, type-check, build, and Bun's native test runner for unit/integration tests; use the project's native browser runner for E2E tests
107
+ - Do not add Vitest. Preserve specialized native runners such as Matchstick for The Graph and Hardhat for smart contracts.
108
+ - Rust: default rustfmt, Clippy with warnings treated as errors, check, unit/integration tests, and dependency audit
109
+ - Python: Ruff formatting and linting, compile or type checks, pytest, coverage, and dependency audit
110
+ - Mixed projects: validate each active ecosystem and its integration boundaries
111
+
112
+ If a check cannot run, state the exact reason. A skipped check is not a passing check.
113
+
114
+ ## Tests and coverage
115
+
116
+ - Add or update tests for behavior changes and regressions.
117
+ - Keep unit, integration, E2E, and smoke coverage in the suite where each applies.
118
+ - Preserve project-specific coverage thresholds; do not lower them to make CI green.
119
+ - Keep test data deterministic and remove secrets from logs and fixtures.
120
+ - Use the narrowest test command while iterating, then run the affected package or workspace suite.
121
+
122
+ ## GitHub workflows and configuration
123
+
124
+ - Keep workflows concise, independently runnable, and safe to re-run.
125
+ - Use `push` for `main, staging` and `pull_request` for `staging` unless a workflow has a documented event-specific reason.
126
+ - Give workflows clear names and jobs concise names; avoid repeating the workflow name in the job name.
127
+ - Use per-workflow concurrency groups that cancel superseded runs while allowing independent workflows to run in parallel.
128
+ - Keep setup language-aware and cache dependency downloads by lockfile; do not cache secrets, `node_modules`, virtual environments, or broad build output without a measured reason.
129
+ - Use least-privilege permissions and pin action versions consistently with the template.
130
+ - Keep CI, Test, Security, CodeQL, Draft PR, Release PR, and Release concerns separated.
131
+ - Security and CodeQL may skip when repository visibility or GitHub plan support does not permit them. Do not make an unavailable check required.
132
+ - Optional Turborepo Remote Caching uses `TURBO_TOKEN` and `TURBO_TEAM`; do not add Vercel deployment behavior just to enable caching.
133
+ - Update branch protection when adding or renaming required job checks; verify the actual GitHub status context.
134
+
135
+ ## Documentation and generated files
136
+
137
+ - Update documentation when behavior, setup, configuration, commands, or operational procedures change.
138
+ - Keep `.env.example` limited to variable names and safe placeholders.
139
+ - Do not commit build output, caches, coverage output, dependency directories, generated credentials, or temporary files.
140
+ - Preserve formatting and line-ending conventions from `.editorconfig` and `.gitattributes`.
141
+
142
+ ## Completion report
143
+
144
+ End every agent task with:
145
+
146
+ ```text
147
+ Summary:
148
+ Files changed:
149
+ Validation:
150
+ Skipped checks:
151
+ Risks or follow-up:
152
+ Branch/PR:
153
+ ```
154
+
155
+ Use exact command names and outcomes. Mention external changes separately from local changes, and distinguish completed work from recommendations.
package/CHANGELOG.md ADDED
@@ -0,0 +1,3 @@
1
+ # Changelog
2
+
3
+ All notable changes to this project are documented here.