Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .opencode/agents/example-agent.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
name: default-agent
description: Provide responses for issues and PRs
mode: primary
model: openrouter/deepseek/deepseek-v4-flash
model: openrouter/openai/gpt-5.6-luna
temperature: 0.1
permission:
edit: deny
Expand Down
2 changes: 1 addition & 1 deletion .opencode/configuration/default-implementation/agent.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
name: default-implementation
description: Plan a small, safe first implementation for an approved issue and delegate to the executor
mode: primary
model: openrouter/openai/gpt-5.6-terra
model: openai/gpt-5.6-terra
temperature: 0.1
permission:
edit: deny
Expand Down
2 changes: 1 addition & 1 deletion .opencode/configuration/default-implementation/hashes.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"agent.md": "ac2835822721be972ab9c105d8c4032e9b77435cfdaf716d28c50af08824ddb3",
"agent.md": "82ba577bb10c0f4fb9a006c4a51c79f5cfd9c43edeb48d238bb2f3e50ee8f33d",
"executor.md": "7b161f2b6a330e19df1513467939907dec356c59cd69452d53a28fa829998caf",
"prompts/plan.md": "7043401e800af0d4974bff51577037369aa68518fc553e5d3b909445b00285df",
"skills/implementation-guardrails/SKILL.md": "68079fdded98ab2d364423bc6777a9cb1d0d40a0c1af5fc2e5333a73c90d9054"
Expand Down
2 changes: 1 addition & 1 deletion .opencode/configuration/documentation-review/agent.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
name: documentation-review
description: Provide documentation-focused review feedback for pull requests
mode: primary
model: deepseek/deepseek-v4-flash
model: openrouter/openai/gpt-5.6-luna
temperature: 0.1
permission:
edit: deny
Expand Down
2 changes: 1 addition & 1 deletion .opencode/configuration/documentation-review/hashes.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"agent.md": "c1627f63e6d213b0123d4bbb7e3f28dc903d9454d41f79a2ba1c488b1eb8fd04",
"agent.md": "5644211a621c02dc25ce0a835ef2652af4bbac57a29415e0691b9454e25432fe",
"prompts/review.md": "fdf01efc28af41a5a61b6575f3953c5c0708c6f9f4155b5e5b1e924e8b83fdf2",
"skills/documentation/SKILL.md": "f5540417be9a2fd2a9b7e21c91e64ad65744a9f9b66e76e8c1b73487527621a1"
}
2 changes: 1 addition & 1 deletion .opencode/configuration/issue-feedback/agent.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
name: issue-feedback
description: Provide concise, constructive feedback on open GitHub issues
mode: primary
model: openrouter/deepseek/deepseek-v4-flash
model: openrouter/openai/gpt-5.6-luna
temperature: 0.1
permission:
edit: deny
Expand Down
2 changes: 1 addition & 1 deletion .opencode/configuration/issue-feedback/hashes.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"agent.md": "3086084c2c34ce09b189d7ce55405d5366f36d64ff09e463fab7940c9ad4fe07",
"agent.md": "203fc61798cf669d88bca3356b438e6605e6ce687e8831801ca8f961d35a7e1a",
"prompts/feedback.md": "2bbbd5d18d256befe9c4c6bf202cdcb2c9fcb4a4a1b75c38ee01d7f2fd616348",
"skills/triage/SKILL.md": "a81ae45c2f03255acc9d04ae76e712965289cd036a1844bfaaaf2049b74d291d"
}
96 changes: 96 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,96 @@
# Contributing

Thanks for contributing to `generic-agentic-workflows`.

## Development workflow

1. Create a branch from the current default branch.
2. Keep changes focused; do not mix workflow, agent, and dependency changes unless they are required together.
3. Run the relevant tests before opening a pull request:

```text
python3 -m unittest
```

4. Run `git diff --check` to catch whitespace errors.
5. Describe the behavior change, the configuration bundles affected, and validation performed in the pull request.

## Editing OpenCode configuration bundles

Reusable profiles live under `.opencode/configuration/<profile>/`. A bundle normally contains:

- `manifest.json` — declares the workflow, agent, skills, prompt, and model profile.
- `agent.md` and optional additional agent files — OpenCode agent front matter and instructions.
- `skills/` and `prompts/` — the bundle's verified guidance.
- `hashes.json` — SHA-256 integrity hashes for every declared content file.

The resolver rejects a bundle when a declared file does not exactly match its entry in `hashes.json`. Therefore, **every content edit must update the corresponding hash**. This includes agent instructions and front matter such as `model:`, prompt templates, skills, and additional agents.

The organization-controlled model profile mapping is in `scripts/agentic_policy.py`. When changing the model for a bundle, update both:

1. The bundle agent's `model:` front-matter value.
2. The corresponding `provider_model` in `MODEL_PROFILES`.

Do not introduce credentials, endpoints, headers, or caller-controlled model identifiers in bundle files or policies.

## Updating `hashes.json`

From the repository root, calculate SHA-256 values for every edited bundle content file:

```text
sha256sum .opencode/configuration/<profile>/agent.md
sha256sum .opencode/configuration/<profile>/prompts/<prompt>.md
sha256sum .opencode/configuration/<profile>/skills/<skill>/SKILL.md
```

Copy each resulting 64-character digest into the matching key in that profile's `hashes.json`. Preserve the path spelling exactly; paths are relative to the bundle directory.

For example, after editing `documentation-review/agent.md`, update:

```json
{
"agent.md": "<sha256 of agent.md>"
}
```

Do not hash `manifest.json` into `hashes.json` unless the resolver is explicitly changed to require it. Do not alter an unrelated bundle's hashes merely to make a test pass—investigate the mismatch and update only when the checked-in content intentionally changed.

## Validate bundle changes

Resolve each changed bundle directly before opening a pull request:

```text
python3 scripts/agentic_configuration.py \
--workflow pr-documentation-review \
--bundle-root .opencode/configuration \
--configuration-profile documentation-review \
--result /tmp/documentation-review.json

python3 scripts/agentic_configuration.py \
--workflow issue-feedback \
--bundle-root .opencode/configuration \
--configuration-profile issue-feedback \
--result /tmp/issue-feedback.json
```

Use the appropriate workflow and profile for other bundles, such as `issue-implementation` and `default-implementation`. Then run the focused configuration and policy tests:

```text
python3 -m unittest -q \
tests.test_agentic_policy \
tests.test_agentic_configuration \
tests.test_revision2
```

Finally, confirm that obsolete model identifiers are absent from active configuration and policy files, and run:

```text
git diff --check
```

## Security requirements

- Treat issue text, pull-request text, diffs, and external configuration as untrusted data.
- Preserve the read-only boundaries of feedback agents and the policy restrictions on implementation agents.
- Do not add secrets to tracked files, logs, prompts, or test fixtures.
- Do not weaken pinned references, integrity validation, workflow permissions, or policy ceilings without an approved security review.
12 changes: 12 additions & 0 deletions docs/plans/documentation.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# Documentation

Guide for how to configure this for your repository

* Using the defaults
* Using your own local files
* Using remote files for agents and skills

Security documentation

* What mitigations are in place and why
* Why this is better than something like the opencode application in GitHub
4 changes: 2 additions & 2 deletions scripts/agentic_policy.py
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,7 @@ def intersect_string_sets(a: Iterable[str], b: Iterable[str]) -> frozenset[str]:
#: repository agents (no secrets, no placeholders).
MODEL_PROFILES: dict[str, dict[str, Any]] = {
"review-readonly": {
"provider_model": "openrouter/deepseek/deepseek-v4-flash",
"provider_model": "openrouter/openai/gpt-5.6-luna",
"max_tokens": 8000,
"temperature_max": 0.2,
"timeout_seconds": 180,
Expand All @@ -201,7 +201,7 @@ def intersect_string_sets(a: Iterable[str], b: Iterable[str]) -> frozenset[str]:
"data_classification": "repository-content",
},
"issue-feedback-readonly": {
"provider_model": "openrouter/deepseek/deepseek-v4-flash",
"provider_model": "openrouter/openai/gpt-5.6-luna",
"max_tokens": 8000,
"temperature_max": 0.2,
"timeout_seconds": 180,
Expand Down
Loading