-
Notifications
You must be signed in to change notification settings - Fork 470
docs: harden and scope agent guidance #583
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,26 @@ | ||
| # GitHub automation instructions | ||
|
|
||
| This file applies to `.github/` and inherits the repository-wide rules in `/AGENTS.md`. | ||
|
|
||
| ## Security boundary | ||
|
|
||
| Every workflow, ownership, branch-enforcement, release, or repository-automation | ||
| change requires explicit security review under `MAINTAINERS.md`. | ||
|
|
||
| ## Workflow rules | ||
|
|
||
| - Grant the minimum required `permissions`. | ||
| - Pin third-party actions to immutable full commit SHAs. | ||
| - Preserve the human-readable version comment beside each pinned action. | ||
| - Do not run untrusted pull-request code with secrets or write permissions. | ||
| - Treat `pull_request_target`, workflow dispatch, reusable workflows, artifacts, caches, and generated command input as trust boundaries. | ||
| - Do not broaden triggers, write permissions, token exposure, release eligibility, or publish capability without an explicit task requirement. | ||
| - Preserve cross-platform coverage where the workflow currently promises Linux, macOS, and Windows behavior. | ||
| - Keep branch-enforcement text synchronized with `AGENTS.md`, `MAINTAINERS.md`, and the public contributing guide. | ||
|
|
||
| ## Validation | ||
|
|
||
| - Inspect the complete workflow diff, including event triggers, permissions, conditions, interpolation, and shell behavior. | ||
| - Run the local commands represented by changed workflow steps where possible. | ||
| - Run `bun run prepush` for CI, release, dependency, packaging, or cross-platform workflow changes. | ||
| - Do not claim the workflow itself passed until GitHub Actions reports success for the exact commit. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,30 @@ | ||
| # Documentation-site instructions | ||
|
|
||
| This file applies to `docs-site/` and inherits the repository-wide rules in `/AGENTS.md`. | ||
|
|
||
| ## Source-of-truth rules | ||
|
|
||
| - `docs-site/` is the public user-documentation source. | ||
| - Document current shipped or intentionally pending behavior. Do not copy claims from historical `docs/` or `devlog/` material without verifying them against current code and configuration. | ||
| - English documentation is the canonical source. Translated content must not contradict it. | ||
| - Keep commands, paths, configuration keys, defaults, branch names, and URLs synchronized with the repository. | ||
| - Do not edit generated build output. | ||
|
|
||
| ## Editing rules | ||
|
|
||
| - Reuse the existing Astro and Starlight structure, navigation, components, and style. | ||
| - Update all directly affected pages when a user workflow changes. | ||
| - Do not add duplicated policy text when a stable canonical document can be linked instead. | ||
| - Use repository-relative links for repository files and site-relative links for documentation pages where the existing site does so. | ||
|
|
||
| ## Required validation | ||
|
|
||
| Run: | ||
|
|
||
| ```bash | ||
| cd docs-site | ||
| bun install --frozen-lockfile | ||
| bun run build | ||
| ``` | ||
|
|
||
| Do not claim documentation validation passed unless this build completes successfully. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,27 @@ | ||
| # Script and release-tooling instructions | ||
|
|
||
| This file applies to `scripts/` and inherits the repository-wide rules in `/AGENTS.md`. | ||
|
|
||
| ## Safety boundary | ||
|
|
||
| - `scripts/release.ts` is the release authority. | ||
| - Release, publish, version-bump, deployment, and package-signing behavior is maintainer-controlled. | ||
| - Never run `bun run release`, a publish command, or a deployment command unless the task explicitly requires the action and `MAINTAINERS.md` permits it. | ||
| - Changes to release, packaging, dependency-installation, credential, or repository-automation scripts require explicit security review. | ||
|
|
||
| ## Implementation rules | ||
|
|
||
| - Preserve Linux, macOS, and Windows behavior. Do not add shell-specific assumptions to cross-platform scripts. | ||
| - Use explicit paths, deterministic inputs, bounded resource use, and actionable failures. | ||
| - Use atomic replacement for files whose partial write would corrupt configuration, package metadata, release state, or recovery data. | ||
| - Do not log secrets, tokens, request bodies, account identifiers, private paths, or personal data. | ||
| - Do not weaken dry-run, exact-commit, CI-success, or explicit-confirmation gates. | ||
| - Generated package assets must be produced by the owning preparation command, not edited manually. | ||
|
|
||
| ## Required validation | ||
|
|
||
| - Run focused tests or probes for the changed script. | ||
| - Run `bun run typecheck`. | ||
| - Run `bun run privacy:scan` when the script handles configuration, credentials, requests, logs, or account data. | ||
| - Run `bun run prepush` for release, packaging, dependency, or cross-platform tooling changes. | ||
| - Report any platform-specific validation that was not executed. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,28 @@ | ||
| # Source runtime instructions | ||
|
|
||
| This file applies to `src/` and inherits the repository-wide rules in `/AGENTS.md`. | ||
|
|
||
| ## Runtime and module rules | ||
|
|
||
| - `src/` is Bun-native TypeScript in strict mode and uses ES modules only. | ||
| - Do not assume a separate server compilation step. | ||
| - Prefer Bun and Web-platform APIs. Introduce a Node-only runtime dependency only when the task explicitly requires compatibility code and the owning module already has that role. | ||
| - Preserve existing public exports and configuration compatibility unless the task explicitly changes them. | ||
| - Read the applicable documents in `structure/` before changing shared routing, adapters, transports, sidecars, authentication, configuration, or server architecture. | ||
|
|
||
| ## Implementation rules | ||
|
|
||
| - Follow the existing subsystem boundaries and naming patterns. | ||
| - Do not combine unrelated responsibilities to avoid creating another large shared module. | ||
| - Handle asynchronous failures at request, transport, and sidecar boundaries. Optional integrations must degrade through the existing failure representation rather than crash the request path. | ||
| - Provider catalog metadata belongs in the canonical provider registry and derivation flow. Do not duplicate provider facts across independent pickers or seeds. | ||
| - Adapter changes must preserve the internal event contract, streaming behavior, tool calls, cancellation, error mapping, and image handling relevant to that adapter. | ||
| - Authentication, OAuth, token, credential, management API, and CORS changes are security-boundary changes. | ||
|
|
||
| ## Tests and validation | ||
|
|
||
| - Place focused regression coverage near the existing tests for the affected subsystem. | ||
| - For focused behavior, run the relevant `bun test tests/<name>.test.ts` and `bun run typecheck`. | ||
| - For shared routing, adapters, config, OAuth, or server behavior, also run `bun run test`. | ||
| - For logging, requests, credentials, account data, or fixtures, also run `bun run privacy:scan`. | ||
| - Update `docs-site/` when the change affects user-visible behavior or configuration. |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.