context-loading-code.yaml 1.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. id: context-loading-code
  2. name: Context Loading Before Code Implementation
  3. description: |
  4. Tests that opencoder loads context files BEFORE implementing code.
  5. Agent should:
  6. 1. Present plan and get approval
  7. 2. Load .opencode/context/core/standards/code.md
  8. 3. Then implement the code
  9. This is CRITICAL - code without context = inconsistent patterns.
  10. category: developer
  11. agent: opencoder
  12. model: anthropic/claude-sonnet-4-5
  13. prompts:
  14. - text: "Create a simple User class in src/models/User.js with name and email properties"
  15. expectContext: false
  16. - text: "approve"
  17. delayMs: 2000
  18. expectContext: true
  19. contextFile: "code.md"
  20. # Expected behavior
  21. behavior:
  22. mustUseTools: [read, write]
  23. requiresContext: true
  24. minToolCalls: 2
  25. # Context loading should NOT be violated
  26. expectedViolations:
  27. - rule: context-loading
  28. shouldViolate: false
  29. severity: error
  30. - rule: approval-gate
  31. shouldViolate: false
  32. severity: error
  33. approvalStrategy:
  34. type: auto-approve
  35. timeout: 120000
  36. tags:
  37. - context-loading
  38. - critical
  39. - code-standards