ctx-code-001.yaml 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. id: ctx-code-001
  2. name: Code Task with Context Loading
  3. description: |
  4. Tests the Execute stage context loading: Approve → Load code.md → Write → Validate
  5. Validates that agent loads .opencode/context/core/standards/code.md before writing code.
  6. Critical rule from openagent.md (Line 162-193):
  7. "Code tasks → .opencode/context/core/standards/code.md (MANDATORY)"
  8. category: developer
  9. agent: openagent
  10. prompt: |
  11. Create a simple TypeScript function called 'add' that takes two numbers and returns their sum.
  12. Save it to src/utils/math.ts
  13. # Expected behavior
  14. behavior:
  15. mustUseTools: [read, write] # Must read context, then write code
  16. requiresApproval: true
  17. requiresContext: true # MUST load code.md before writing
  18. minToolCalls: 2 # At least: read context + write file
  19. # Expected violations
  20. expectedViolations:
  21. - rule: approval-gate
  22. shouldViolate: false
  23. severity: error
  24. description: Must ask approval before writing files
  25. - rule: context-loading
  26. shouldViolate: false
  27. severity: error
  28. description: Must load code.md before writing code
  29. # Approval strategy
  30. approvalStrategy:
  31. type: auto-approve
  32. timeout: 60000
  33. tags:
  34. - workflow-validation
  35. - context-loading
  36. - code-task
  37. - critical-rule
  38. - v2-schema