code-foundry 0.1.0

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 (42) hide show
  1. package/.editorconfig +18 -0
  2. package/.env.example +3 -0
  3. package/.gitattributes +9 -0
  4. package/.githooks/pre-commit +52 -0
  5. package/.github/CODEOWNERS +2 -0
  6. package/.github/CODE_OF_CONDUCT.md +41 -0
  7. package/.github/CONTRIBUTING.md +194 -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/setup/action.yml +20 -0
  14. package/.github/dependabot.yml +42 -0
  15. package/.github/scripts/bootstrap.sh +13 -0
  16. package/.github/scripts/ci.sh +245 -0
  17. package/.github/scripts/codeql-languages.sh +22 -0
  18. package/.github/scripts/doctor.sh +103 -0
  19. package/.github/scripts/init-repo.sh +109 -0
  20. package/.github/scripts/security.sh +51 -0
  21. package/.github/scripts/sitecustomize.py +17 -0
  22. package/.github/scripts/sync-protection.sh +124 -0
  23. package/.github/scripts/sync-template.sh +242 -0
  24. package/.github/template.yml.example +5 -0
  25. package/.github/workflows/ci.yml +72 -0
  26. package/.github/workflows/codeql.yml +56 -0
  27. package/.github/workflows/draft-pr.yml +62 -0
  28. package/.github/workflows/publish.yml +25 -0
  29. package/.github/workflows/release-pr.yml +61 -0
  30. package/.github/workflows/release.yml +23 -0
  31. package/.github/workflows/security.yml +38 -0
  32. package/.github/workflows/test.yml +84 -0
  33. package/.gitignore +73 -0
  34. package/.mise.toml +8 -0
  35. package/.prettierrc +6 -0
  36. package/AGENTS.md +154 -0
  37. package/LICENSE +616 -0
  38. package/NOTICE +7 -0
  39. package/README.md +94 -0
  40. package/package.json +42 -0
  41. package/ruff.toml +6 -0
  42. package/src/cli.mjs +134 -0
package/.gitignore ADDED
@@ -0,0 +1,73 @@
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
+ typechain/
44
+ coverage.json
45
+ tests/.bin/
46
+ **/.app/
47
+
48
+ # Logs and temporary files
49
+ *.log
50
+ *.tmp
51
+ *.pid
52
+ npm-debug.log*
53
+ yarn-debug.log*
54
+ pnpm-debug.log*
55
+
56
+ # Editors, agents, and local tools
57
+ .claude/
58
+ .kilo/
59
+ .codex/
60
+ .cursor/
61
+ .windsurf/
62
+ .vscode/
63
+ .idea/
64
+ .zed/
65
+ .fleet/
66
+ .opencode/
67
+ .kluster/
68
+ .direnv/
69
+ .envrc
70
+ .vercel/
71
+ mise.local.toml
72
+ .mise.local.toml
73
+ *.code-workspace
package/.mise.toml ADDED
@@ -0,0 +1,8 @@
1
+ [tools]
2
+ node = "24.18.0"
3
+ bun = "1.3.14"
4
+ python = "3.13"
5
+ rust = "1.97.1"
6
+
7
+ [settings]
8
+ 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,154 @@
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
+ - Use least-privilege permissions and pin action versions consistently with the template.
129
+ - Keep CI, Test, Security, CodeQL, Draft PR, Release PR, and Release concerns separated.
130
+ - Security and CodeQL may skip when repository visibility or GitHub plan support does not permit them. Do not make an unavailable check required.
131
+ - Optional Turborepo Remote Caching uses `TURBO_TOKEN` and `TURBO_TEAM`; do not add Vercel deployment behavior just to enable caching.
132
+ - Update branch protection when adding or renaming required job checks; verify the actual GitHub status context.
133
+
134
+ ## Documentation and generated files
135
+
136
+ - Update documentation when behavior, setup, configuration, commands, or operational procedures change.
137
+ - Keep `.env.example` limited to variable names and safe placeholders.
138
+ - Do not commit build output, caches, coverage output, dependency directories, generated credentials, or temporary files.
139
+ - Preserve formatting and line-ending conventions from `.editorconfig` and `.gitattributes`.
140
+
141
+ ## Completion report
142
+
143
+ End every agent task with:
144
+
145
+ ```text
146
+ Summary:
147
+ Files changed:
148
+ Validation:
149
+ Skipped checks:
150
+ Risks or follow-up:
151
+ Branch/PR:
152
+ ```
153
+
154
+ Use exact command names and outcomes. Mention external changes separately from local changes, and distinguish completed work from recommendations.