@garethdaine/agentops 0.9.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 (148) hide show
  1. package/.claude-plugin/plugin.json +10 -0
  2. package/LICENSE +21 -0
  3. package/README.md +410 -0
  4. package/agents/architecture-researcher.md +115 -0
  5. package/agents/code-critic.md +190 -0
  6. package/agents/delegation-router.md +40 -0
  7. package/agents/feature-researcher.md +117 -0
  8. package/agents/interrogator.md +11 -0
  9. package/agents/pitfalls-researcher.md +112 -0
  10. package/agents/plan-validator.md +173 -0
  11. package/agents/proposer.md +61 -0
  12. package/agents/security-reviewer.md +189 -0
  13. package/agents/skill-builder.md +43 -0
  14. package/agents/spec-compliance-reviewer.md +154 -0
  15. package/agents/stack-researcher.md +89 -0
  16. package/commands/build.md +766 -0
  17. package/commands/code-analysis.md +39 -0
  18. package/commands/code-field.md +22 -0
  19. package/commands/compliance-check.md +34 -0
  20. package/commands/configure.md +178 -0
  21. package/commands/cost-report.md +17 -0
  22. package/commands/enterprise/adr.md +78 -0
  23. package/commands/enterprise/brainstorm.md +461 -0
  24. package/commands/enterprise/design.md +203 -0
  25. package/commands/enterprise/dev-setup.md +136 -0
  26. package/commands/enterprise/docker-dev.md +229 -0
  27. package/commands/enterprise/e2e.md +233 -0
  28. package/commands/enterprise/feature.md +218 -0
  29. package/commands/enterprise/gap-analysis.md +204 -0
  30. package/commands/enterprise/handover.md +195 -0
  31. package/commands/enterprise/herd.md +152 -0
  32. package/commands/enterprise/knowledge.md +173 -0
  33. package/commands/enterprise/onboard.md +86 -0
  34. package/commands/enterprise/qa-check.md +80 -0
  35. package/commands/enterprise/reason.md +196 -0
  36. package/commands/enterprise/review.md +177 -0
  37. package/commands/enterprise/scaffold.md +153 -0
  38. package/commands/enterprise/status-report.md +101 -0
  39. package/commands/enterprise/tech-catalog.md +170 -0
  40. package/commands/enterprise/test-gen.md +138 -0
  41. package/commands/evolve.md +39 -0
  42. package/commands/flags.md +44 -0
  43. package/commands/interrogate.md +263 -0
  44. package/commands/lesson.md +15 -0
  45. package/commands/lessons.md +10 -0
  46. package/commands/plan.md +44 -0
  47. package/commands/prune.md +27 -0
  48. package/commands/star.md +17 -0
  49. package/commands/supply-chain-scan.md +44 -0
  50. package/commands/unicode-scan.md +63 -0
  51. package/commands/verify.md +41 -0
  52. package/commands/workflow.md +436 -0
  53. package/hooks/ai-guardrails.sh +114 -0
  54. package/hooks/audit-log.sh +26 -0
  55. package/hooks/auto-delegate.sh +45 -0
  56. package/hooks/auto-evolve.sh +22 -0
  57. package/hooks/auto-lesson.sh +26 -0
  58. package/hooks/auto-plan.sh +59 -0
  59. package/hooks/auto-test.sh +46 -0
  60. package/hooks/auto-verify.sh +30 -0
  61. package/hooks/budget-check.sh +24 -0
  62. package/hooks/code-field-preamble.sh +30 -0
  63. package/hooks/compliance-gate.sh +50 -0
  64. package/hooks/content-trust.sh +22 -0
  65. package/hooks/credential-redact.sh +23 -0
  66. package/hooks/delegation-trust.sh +15 -0
  67. package/hooks/detect-test-run.sh +19 -0
  68. package/hooks/enforcement-lib.sh +60 -0
  69. package/hooks/evolve-gate.sh +32 -0
  70. package/hooks/evolve-lib.sh +32 -0
  71. package/hooks/exfiltration-check.sh +67 -0
  72. package/hooks/failure-collector.sh +27 -0
  73. package/hooks/feature-flags.sh +67 -0
  74. package/hooks/file-provenance.sh +31 -0
  75. package/hooks/flag-utils.sh +36 -0
  76. package/hooks/hooks.json +145 -0
  77. package/hooks/injection-scan.sh +58 -0
  78. package/hooks/integrity-verify.sh +91 -0
  79. package/hooks/lessons-check.sh +17 -0
  80. package/hooks/lockfile-audit.sh +109 -0
  81. package/hooks/patterns-lib.sh +22 -0
  82. package/hooks/plan-gate.sh +18 -0
  83. package/hooks/redact-lib.sh +15 -0
  84. package/hooks/runtime-mode.sh +56 -0
  85. package/hooks/session-cleanup.sh +74 -0
  86. package/hooks/skill-validator.sh +28 -0
  87. package/hooks/standards-enforce.sh +106 -0
  88. package/hooks/star-gate.sh +93 -0
  89. package/hooks/star-preamble.sh +10 -0
  90. package/hooks/telemetry.sh +33 -0
  91. package/hooks/todo-prune.sh +84 -0
  92. package/hooks/unicode-firewall.sh +122 -0
  93. package/hooks/unicode-lib.sh +66 -0
  94. package/hooks/unicode-scan-session.sh +96 -0
  95. package/hooks/validate-command.sh +103 -0
  96. package/hooks/validate-env.sh +51 -0
  97. package/hooks/validate-path.sh +81 -0
  98. package/package.json +40 -0
  99. package/settings.json +6 -0
  100. package/templates/ai-config/tool-standards.md +56 -0
  101. package/templates/architecture/api-first.md +192 -0
  102. package/templates/architecture/auth-patterns.md +302 -0
  103. package/templates/architecture/caching-strategy.md +359 -0
  104. package/templates/architecture/database-patterns.md +347 -0
  105. package/templates/architecture/event-driven.md +252 -0
  106. package/templates/architecture/integration-patterns.md +185 -0
  107. package/templates/architecture/multi-tenancy.md +104 -0
  108. package/templates/architecture/service-boundaries.md +200 -0
  109. package/templates/build/brief-template.md +86 -0
  110. package/templates/build/summary-template.md +100 -0
  111. package/templates/build/task-plan-template.md +133 -0
  112. package/templates/communication/effort-estimate.md +54 -0
  113. package/templates/communication/incident-response.md +59 -0
  114. package/templates/communication/post-mortem.md +109 -0
  115. package/templates/communication/risk-register.md +43 -0
  116. package/templates/communication/sprint-demo-checklist.md +64 -0
  117. package/templates/communication/stakeholder-presentation-outline.md +84 -0
  118. package/templates/communication/technical-proposal.md +77 -0
  119. package/templates/delivery/deployment/deployment-checklist.md +49 -0
  120. package/templates/delivery/design/solution-design-checklist.md +37 -0
  121. package/templates/delivery/discovery/stakeholder-questions.md +33 -0
  122. package/templates/delivery/handover/knowledge-transfer-checklist.md +75 -0
  123. package/templates/delivery/handover/operational-runbook.md +117 -0
  124. package/templates/delivery/handover/support-escalation-matrix.md +56 -0
  125. package/templates/delivery/implementation/blocker-escalation-template.md +55 -0
  126. package/templates/delivery/implementation/sprint-planning-template.md +49 -0
  127. package/templates/delivery/implementation/task-decomposition-guide.md +59 -0
  128. package/templates/delivery/qa/test-plan-template.md +76 -0
  129. package/templates/delivery/qa/test-results-template.md +55 -0
  130. package/templates/delivery/qa/uat-signoff-template.md +44 -0
  131. package/templates/governance/codeowners.md +60 -0
  132. package/templates/integration/adapter-pattern.md +160 -0
  133. package/templates/scaffolds/env-validation.md +85 -0
  134. package/templates/scaffolds/error-handling.md +171 -0
  135. package/templates/scaffolds/graceful-shutdown.md +139 -0
  136. package/templates/scaffolds/health-check.md +109 -0
  137. package/templates/scaffolds/structured-logging.md +134 -0
  138. package/templates/standards/engineering-standards.md +413 -0
  139. package/templates/standards/standards-checklist.md +125 -0
  140. package/templates/tech-catalog.json +663 -0
  141. package/templates/utilities/project-detection.md +75 -0
  142. package/templates/utilities/requirements-collection.md +68 -0
  143. package/templates/utilities/template-rendering.md +81 -0
  144. package/templates/workflows/architecture-decision.md +90 -0
  145. package/templates/workflows/bug-investigation.md +83 -0
  146. package/templates/workflows/feature-implementation.md +80 -0
  147. package/templates/workflows/refactoring.md +83 -0
  148. package/templates/workflows/spike-exploration.md +82 -0
@@ -0,0 +1,56 @@
1
+ # Delivery Template: Support Escalation Matrix
2
+
3
+ ```markdown
4
+ # Support Escalation Matrix — [Project Name]
5
+
6
+ **Effective from:** [date]
7
+ **Review date:** [date + 3 months]
8
+
9
+ ## Severity Definitions
10
+
11
+ | Level | Definition | Example | Response Target | Resolution Target |
12
+ |-------|-----------|---------|----------------|-------------------|
13
+ | P1 — Critical | System down, data loss, security breach | Production API returning 500 for all users | 15 minutes | 4 hours |
14
+ | P2 — High | Major feature broken, significant user impact | Authentication failing for subset of users | 1 hour | 8 hours |
15
+ | P3 — Medium | Feature degraded, workaround available | Report generation slow but functional | 4 hours | 2 business days |
16
+ | P4 — Low | Minor issue, cosmetic, enhancement request | UI alignment issue on one browser | 1 business day | Next sprint |
17
+
18
+ ## Escalation Path
19
+
20
+ ### Level 1: Client Internal Team
21
+ **Handles:** Known issues, configuration changes, password resets, FAQ questions
22
+ **Contact:** [client support email/channel]
23
+ **Hours:** Business hours
24
+
25
+ ### Level 2: Development Team
26
+ **Handles:** Bug investigation, code fixes, performance issues
27
+ **Contact:** [dev team email/Slack channel]
28
+ **Hours:** Business hours (P1/P2: on-call after hours)
29
+
30
+ ### Level 3: Architecture / Infrastructure
31
+ **Handles:** System design issues, infrastructure failures, security incidents
32
+ **Contact:** [tech lead / architect contact]
33
+ **Hours:** On-call for P1 only
34
+
35
+ ### Emergency
36
+ **Handles:** Security breaches, data loss, complete system failure
37
+ **Contact:** [emergency phone number]
38
+ **Process:** Call immediately, do not wait for email response
39
+
40
+ ## Escalation Triggers
41
+
42
+ | Situation | Escalate To |
43
+ |-----------|------------|
44
+ | Issue unresolved past response target | Next level |
45
+ | Issue affects >50% of users | Level 2 minimum |
46
+ | Security incident suspected | Level 3 + emergency |
47
+ | Data loss or corruption | Level 3 + emergency |
48
+ | Client executive escalation | Level 3 |
49
+
50
+ ## Communication Protocol
51
+
52
+ - P1/P2: Status updates every 30 minutes until resolved
53
+ - P3: Status update within 4 hours, then daily
54
+ - P4: Update in weekly status report
55
+ - All incidents: Post-mortem within 5 business days for P1/P2
56
+ ```
@@ -0,0 +1,55 @@
1
+ # Delivery Template: Blocker Escalation
2
+
3
+ ```markdown
4
+ # Blocker Escalation Report
5
+
6
+ **Date:** [date]
7
+ **Raised by:** [name]
8
+ **Sprint:** [sprint number]
9
+ **Blocked item:** [task/story reference]
10
+
11
+ ## Blocker Description
12
+
13
+ [Clear, specific description of what is blocking progress]
14
+
15
+ ## Impact
16
+
17
+ - **What is blocked:** [specific tasks that cannot proceed]
18
+ - **Who is affected:** [team members waiting]
19
+ - **Delivery impact:** [sprint goal at risk? deadline affected?]
20
+ - **Business impact:** [client-facing consequences if not resolved]
21
+
22
+ ## Timeline
23
+
24
+ | Event | Date |
25
+ |-------|------|
26
+ | Blocker identified | [date] |
27
+ | First attempt to resolve | [date] |
28
+ | Escalation raised | [date] |
29
+ | Resolution deadline | [date] |
30
+
31
+ ## What Has Been Tried
32
+
33
+ 1. [Attempted resolution and outcome]
34
+ 2. [Attempted resolution and outcome]
35
+ 3. [Attempted resolution and outcome]
36
+
37
+ ## Help Needed
38
+
39
+ **Specific ask:** [What exactly do you need to unblock?]
40
+ **From whom:** [Person or team who can help]
41
+ **By when:** [Deadline for resolution]
42
+
43
+ ## Proposed Workarounds
44
+
45
+ | Option | Trade-offs | Recommendation |
46
+ |--------|-----------|---------------|
47
+ | [workaround] | [trade-offs] | Recommended / Not recommended |
48
+
49
+ ## Decision
50
+
51
+ **Decision:** [What was decided]
52
+ **Decided by:** [name]
53
+ **Date:** [date]
54
+ **Follow-up actions:** [any remaining work]
55
+ ```
@@ -0,0 +1,49 @@
1
+ # Delivery Template: Sprint Planning
2
+
3
+ ```markdown
4
+ # Sprint Planning — Sprint [N]
5
+
6
+ **Sprint dates:** [start] — [end]
7
+ **Sprint goal:** [one sentence describing the sprint's primary objective]
8
+ **Team capacity:** [available person-days]
9
+
10
+ ## Committed Items
11
+
12
+ | # | Item | Type | Estimate | Assignee | Dependencies | Risk |
13
+ |---|------|------|----------|----------|-------------|------|
14
+ | 1 | [description] | Feature/Bug/Tech Debt | S/M/L | [name] | [deps] | [risk] |
15
+ | 2 | [description] | Feature/Bug/Tech Debt | S/M/L | [name] | [deps] | [risk] |
16
+
17
+ ## Capacity
18
+
19
+ | Team Member | Available Days | Committed Days | Buffer |
20
+ |------------|---------------|---------------|--------|
21
+ | [name] | [N] | [N] | [N] |
22
+
23
+ **Total capacity:** [N] days
24
+ **Total committed:** [N] days
25
+ **Buffer:** [N] days ([%])
26
+
27
+ *Target: commit to 80% of capacity, reserve 20% for unplanned work*
28
+
29
+ ## Sprint Risks
30
+
31
+ | Risk | Likelihood | Impact | Mitigation |
32
+ |------|-----------|--------|------------|
33
+ | [risk] | H/M/L | H/M/L | [plan] |
34
+
35
+ ## Carry-over from Previous Sprint
36
+
37
+ | Item | Reason for Carry-over | Adjusted Estimate |
38
+ |------|----------------------|------------------|
39
+ | [item] | [why it wasn't completed] | [new estimate] |
40
+
41
+ ## Definition of Done
42
+
43
+ - [ ] Code complete and reviewed
44
+ - [ ] Tests passing (unit + integration)
45
+ - [ ] No critical or high code review findings
46
+ - [ ] Documentation updated (if applicable)
47
+ - [ ] Deployed to staging and verified
48
+ - [ ] Product owner acceptance
49
+ ```
@@ -0,0 +1,59 @@
1
+ # Delivery Template: Task Decomposition Guide
2
+
3
+ ## Hierarchy
4
+
5
+ ```
6
+ Epic (business capability)
7
+ └── Story (user-facing value)
8
+ └── Task (implementable unit of work)
9
+ └── Sub-task (atomic step)
10
+ ```
11
+
12
+ ## Sizing Guide
13
+
14
+ | Size | Description | Typical Effort | Example |
15
+ |------|-------------|---------------|---------|
16
+ | XS | Trivial change, no unknowns | <2 hours | Fix typo, update config value |
17
+ | S | Well-understood, single file | 2-4 hours | Add validation to existing endpoint |
18
+ | M | Multiple files, some complexity | 1-2 days | New API endpoint with tests |
19
+ | L | Cross-cutting, moderate unknowns | 3-5 days | New service with adapter integration |
20
+ | XL | Significant scope, high unknowns | 1-2 weeks | New module or subsystem — break this down further |
21
+
22
+ **Rule: If a task is XL, it must be decomposed further.** No task should take more than 5 days.
23
+
24
+ ## Decomposition Checklist
25
+
26
+ For each story, identify:
27
+
28
+ 1. **Data model changes** — New tables, columns, migrations, indexes
29
+ 2. **Backend logic** — Service functions, business rules, validation
30
+ 3. **API layer** — Route handlers, middleware, request/response schemas
31
+ 4. **Frontend** — Components, pages, state management, API calls
32
+ 5. **Integration** — External API adapters, contracts, mocks
33
+ 6. **Tests** — Unit, integration, contract, E2E for each component
34
+ 7. **Documentation** — API docs, ADRs, README updates
35
+ 8. **Infrastructure** — Environment variables, Docker changes, CI/CD updates
36
+
37
+ ## Dependency Mapping
38
+
39
+ For each task, document:
40
+ - **Depends on:** [which tasks must complete first]
41
+ - **Blocks:** [which tasks are waiting on this]
42
+ - **Can parallelize with:** [tasks that can run simultaneously]
43
+
44
+ ## Example Decomposition
45
+
46
+ **Story:** "As a user, I can view my procurement orders filtered by status"
47
+
48
+ | # | Task | Size | Dependencies |
49
+ |---|------|------|-------------|
50
+ | 1 | Add Order model to Prisma schema + migration | S | — |
51
+ | 2 | Create OrderRepository with tenant-scoped queries | M | 1 |
52
+ | 3 | Create OrderService with filtering logic | M | 2 |
53
+ | 4 | Create GET /api/v1/orders endpoint | M | 3 |
54
+ | 5 | Add input validation schema (zod) | S | 4 |
55
+ | 6 | Write unit tests for OrderService | M | 3 |
56
+ | 7 | Write integration tests for orders endpoint | M | 4 |
57
+ | 8 | Create OrderList frontend component | M | 4 |
58
+ | 9 | Add status filter UI with query params | S | 8 |
59
+ | 10 | Write component tests | S | 8, 9 |
@@ -0,0 +1,76 @@
1
+ # Delivery Template: Test Plan
2
+
3
+ ```markdown
4
+ # Test Plan — [Project/Feature Name]
5
+
6
+ **Version:** [1.0]
7
+ **Prepared by:** [name]
8
+ **Date:** [date]
9
+ **Status:** Draft / Approved / In Execution / Complete
10
+
11
+ ## 1. Scope
12
+
13
+ ### In Scope
14
+ - [Feature/component to test]
15
+ - [Feature/component to test]
16
+
17
+ ### Out of Scope
18
+ - [What is NOT being tested and why]
19
+
20
+ ## 2. Test Strategy
21
+
22
+ | Test Type | Scope | Framework | Responsibility |
23
+ |-----------|-------|-----------|---------------|
24
+ | Unit | Business logic, utilities | Vitest/Jest | Developer |
25
+ | Integration | API endpoints, database | Supertest | Developer |
26
+ | Component | UI components | Testing Library | Frontend dev |
27
+ | Contract | External API adapters | Pact/manual | Backend dev |
28
+ | E2E | Critical user flows | Playwright | QA |
29
+ | Performance | API response times | k6/Artillery | DevOps |
30
+ | Security | OWASP Top 10 | /agentops:review | Developer |
31
+
32
+ ## 3. Test Environment
33
+
34
+ | Environment | URL | Database | Purpose |
35
+ |-------------|-----|----------|---------|
36
+ | Local | localhost:3000 | SQLite/Docker | Development |
37
+ | CI | — | Docker | Automated pipeline |
38
+ | Staging | staging.example.com | Staging DB | Pre-production validation |
39
+ | Production | app.example.com | Production DB | Smoke tests only |
40
+
41
+ ## 4. Entry Criteria
42
+ - [ ] Code complete and merged to feature branch
43
+ - [ ] Unit tests passing in CI
44
+ - [ ] Test environment provisioned and accessible
45
+ - [ ] Test data seeded
46
+
47
+ ## 5. Exit Criteria
48
+ - [ ] All critical and high test cases passing
49
+ - [ ] No unresolved critical or high defects
50
+ - [ ] Test coverage meets target (statements >80%)
51
+ - [ ] Performance benchmarks within acceptable thresholds
52
+ - [ ] Security review completed with no critical findings
53
+
54
+ ## 6. Test Cases
55
+
56
+ | ID | Category | Description | Priority | Status |
57
+ |----|----------|-------------|----------|--------|
58
+ | TC-001 | Functional | [test description] | Critical | Pass/Fail/Blocked |
59
+ | TC-002 | Security | [test description] | High | Pass/Fail/Blocked |
60
+
61
+ ## 7. Risks
62
+
63
+ | Risk | Likelihood | Impact | Mitigation |
64
+ |------|-----------|--------|------------|
65
+ | Incomplete test data | Medium | High | Seed scripts verified before testing |
66
+ | Environment instability | Low | High | Fallback to local testing |
67
+
68
+ ## 8. Schedule
69
+
70
+ | Phase | Start | End | Owner |
71
+ |-------|-------|-----|-------|
72
+ | Unit/Integration | [date] | [date] | Dev team |
73
+ | E2E | [date] | [date] | QA |
74
+ | Performance | [date] | [date] | DevOps |
75
+ | UAT | [date] | [date] | Client |
76
+ ```
@@ -0,0 +1,55 @@
1
+ # Delivery Template: Test Results Report
2
+
3
+ ```markdown
4
+ # Test Results Report — [Project/Feature Name]
5
+
6
+ **Date:** [date]
7
+ **Tester:** [name]
8
+ **Environment:** [staging/production]
9
+ **Build:** [commit hash or version]
10
+
11
+ ## Executive Summary
12
+
13
+ [2-3 sentences: overall result, key findings, recommendation to proceed or hold]
14
+
15
+ ## Results Overview
16
+
17
+ | Metric | Value |
18
+ |--------|-------|
19
+ | Total test cases | [N] |
20
+ | Passed | [N] ([%]) |
21
+ | Failed | [N] ([%]) |
22
+ | Blocked | [N] ([%]) |
23
+ | Skipped | [N] ([%]) |
24
+
25
+ ## Coverage
26
+
27
+ | Category | Statements | Branches | Functions | Lines |
28
+ |----------|-----------|----------|-----------|-------|
29
+ | Overall | [%] | [%] | [%] | [%] |
30
+ | Critical paths | [%] | [%] | [%] | [%] |
31
+
32
+ ## Failed Test Cases
33
+
34
+ | ID | Description | Expected | Actual | Severity | Status |
35
+ |----|-------------|----------|--------|----------|--------|
36
+ | TC-NNN | [description] | [expected] | [actual] | Critical/High/Med | Open/Fixed |
37
+
38
+ ## Defects Found
39
+
40
+ | ID | Title | Severity | Status | Assigned To |
41
+ |----|-------|----------|--------|-------------|
42
+ | DEF-001 | [title] | Critical/High/Med/Low | Open/Fixed/Deferred | [name] |
43
+
44
+ ## Performance Results
45
+
46
+ | Endpoint | p50 | p95 | p99 | Target | Status |
47
+ |----------|-----|-----|-----|--------|--------|
48
+ | GET /api/orders | [ms] | [ms] | [ms] | <200ms | Pass/Fail |
49
+
50
+ ## Recommendation
51
+
52
+ - [ ] **GO** — All critical tests pass, no unresolved critical defects
53
+ - [ ] **CONDITIONAL GO** — Minor issues to address post-deployment
54
+ - [ ] **NO GO** — Critical issues must be resolved before deployment
55
+ ```
@@ -0,0 +1,44 @@
1
+ # Delivery Template: UAT Sign-off
2
+
3
+ ```markdown
4
+ # User Acceptance Testing Sign-off — [Project/Feature Name]
5
+
6
+ **Date:** [date]
7
+ **Sprint/Release:** [identifier]
8
+ **UAT Lead:** [name]
9
+
10
+ ## Acceptance Criteria
11
+
12
+ | # | Criteria | Status | Tested By | Date | Notes |
13
+ |---|---------|--------|-----------|------|-------|
14
+ | 1 | [acceptance criterion from requirements] | Pass/Fail/N/A | [name] | [date] | [notes] |
15
+ | 2 | [acceptance criterion] | Pass/Fail/N/A | [name] | [date] | |
16
+
17
+ ## Demo Walkthrough
18
+
19
+ - [ ] Feature demonstrated to stakeholders
20
+ - [ ] Edge cases discussed and verified
21
+ - [ ] Error handling shown
22
+ - [ ] Performance acceptable to stakeholders
23
+
24
+ ## Outstanding Issues
25
+
26
+ | Issue | Severity | Decision | Owner |
27
+ |-------|----------|----------|-------|
28
+ | [description] | [severity] | Fix before release / Accept / Defer | [name] |
29
+
30
+ ## Sign-off
31
+
32
+ | Role | Name | Decision | Signature | Date |
33
+ |------|------|----------|-----------|------|
34
+ | Product Owner | [name] | Approve / Reject | _________ | [date] |
35
+ | QA Lead | [name] | Approve / Reject | _________ | [date] |
36
+ | Tech Lead | [name] | Approve / Reject | _________ | [date] |
37
+
38
+ ## Conditions of Acceptance
39
+
40
+ By signing above, stakeholders confirm:
41
+ 1. All acceptance criteria have been tested and verified
42
+ 2. Outstanding issues have been reviewed and dispositioned
43
+ 3. The feature is approved for production deployment
44
+ ```
@@ -0,0 +1,60 @@
1
+ # Governance Template: Code Ownership
2
+
3
+ ## CODEOWNERS Template
4
+
5
+ Generate a CODEOWNERS file by analysing the project structure:
6
+
7
+ ```
8
+ # Code Ownership — Auto-generated by AgentOps
9
+ # Format: path @owner
10
+
11
+ # Global — default reviewers for everything
12
+ * @team-lead
13
+
14
+ # Frontend
15
+ src/components/ @frontend-team
16
+ src/pages/ @frontend-team
17
+ src/styles/ @frontend-team
18
+
19
+ # Backend / API
20
+ src/services/ @backend-team
21
+ src/routes/ @backend-team
22
+ src/middleware/ @backend-team
23
+
24
+ # Data Layer
25
+ src/models/ @backend-team
26
+ src/repositories/ @backend-team
27
+ prisma/ @backend-team
28
+
29
+ # Infrastructure
30
+ Dockerfile @devops-team
31
+ docker-compose.yml @devops-team
32
+ .github/workflows/ @devops-team
33
+ terraform/ @devops-team
34
+
35
+ # Security-sensitive
36
+ src/auth/ @security-lead @team-lead
37
+ src/middleware/auth* @security-lead
38
+
39
+ # Configuration
40
+ package.json @team-lead
41
+ tsconfig.json @team-lead
42
+ ```
43
+
44
+ ## Review Assignment Rules
45
+
46
+ - PRs require at least 1 approval from a code owner
47
+ - Security-sensitive files require 2 approvals
48
+ - Infrastructure changes require DevOps team review
49
+ - Schema changes require backend lead review
50
+
51
+ ## Domain Expertise Map
52
+
53
+ | Domain | Expert | Backup |
54
+ |--------|--------|--------|
55
+ | Authentication | [name] | [name] |
56
+ | API Design | [name] | [name] |
57
+ | Database | [name] | [name] |
58
+ | Frontend | [name] | [name] |
59
+ | Infrastructure | [name] | [name] |
60
+ | Security | [name] | [name] |
@@ -0,0 +1,160 @@
1
+ # Mock Integration Framework: Adapter Pattern
2
+
3
+ ## Overview
4
+
5
+ This template provides a complete adapter pattern for integrating with external enterprise systems. It includes an interface, mock implementation, real implementation, factory, and contract tests.
6
+
7
+ ## File Structure
8
+
9
+ ```
10
+ src/adapters/
11
+ procurement/
12
+ types.ts # Domain types (NOT external API types)
13
+ procurement-adapter.ts # Interface definition
14
+ mock-adapter.ts # Mock implementation (dev/test)
15
+ http-adapter.ts # Real HTTP implementation
16
+ adapter-factory.ts # Factory that selects implementation
17
+ __tests__/
18
+ contract.test.ts # Contract tests (verify mock == real behaviour)
19
+ ```
20
+
21
+ ## Step 1: Domain Types (`types.ts`)
22
+
23
+ Define your domain types independently of external API schemas:
24
+
25
+ ```typescript
26
+ export interface Order {
27
+ id: string;
28
+ tenantId: string;
29
+ orderNumber: string;
30
+ status: OrderStatus;
31
+ items: OrderItem[];
32
+ totalAmount: number;
33
+ currency: string;
34
+ createdAt: Date;
35
+ updatedAt: Date;
36
+ }
37
+
38
+ export type OrderStatus = 'draft' | 'submitted' | 'approved' | 'rejected' | 'fulfilled' | 'cancelled';
39
+
40
+ export interface OrderItem {
41
+ id: string;
42
+ sku: string;
43
+ description: string;
44
+ quantity: number;
45
+ unitPrice: number;
46
+ }
47
+
48
+ export interface CreateOrderInput {
49
+ items: Omit<OrderItem, 'id'>[];
50
+ currency?: string;
51
+ metadata?: Record<string, string>;
52
+ }
53
+
54
+ export interface PaginatedResult<T> {
55
+ data: T[];
56
+ total: number;
57
+ limit: number;
58
+ offset: number;
59
+ }
60
+ ```
61
+
62
+ ## Step 2: Interface (`procurement-adapter.ts`)
63
+
64
+ ```typescript
65
+ import type { Order, OrderStatus, CreateOrderInput, PaginatedResult } from './types';
66
+
67
+ export interface ProcurementAdapter {
68
+ getOrders(tenantId: string, options?: { status?: OrderStatus; limit?: number; offset?: number }): Promise<PaginatedResult<Order>>;
69
+ getOrderById(tenantId: string, orderId: string): Promise<Order | null>;
70
+ createOrder(tenantId: string, input: CreateOrderInput): Promise<Order>;
71
+ updateOrderStatus(tenantId: string, orderId: string, status: OrderStatus): Promise<Order>;
72
+ deleteOrder(tenantId: string, orderId: string): Promise<void>;
73
+ }
74
+ ```
75
+
76
+ ## Step 3: Mock Implementation (`mock-adapter.ts`)
77
+
78
+ ```typescript
79
+ import { randomUUID } from 'node:crypto';
80
+ import type { ProcurementAdapter } from './procurement-adapter';
81
+ import type { Order, OrderStatus, CreateOrderInput, PaginatedResult } from './types';
82
+
83
+ export class MockProcurementAdapter implements ProcurementAdapter {
84
+ private store = new Map<string, Order>();
85
+
86
+ constructor() {
87
+ this.seed();
88
+ }
89
+
90
+ private seed(): void {
91
+ // Pre-populate with realistic demo data
92
+ const demoOrders: Order[] = [
93
+ {
94
+ id: randomUUID(), tenantId: 'acme-corp', orderNumber: 'PO-2026-001',
95
+ status: 'approved', currency: 'USD', totalAmount: 45_000,
96
+ items: [{ id: randomUUID(), sku: 'SRV-ENT-100', description: 'Enterprise Server License', quantity: 10, unitPrice: 4_500 }],
97
+ createdAt: new Date('2026-03-01'), updatedAt: new Date('2026-03-10'),
98
+ },
99
+ // ... more seed data
100
+ ];
101
+ demoOrders.forEach((o) => this.store.set(o.id, o));
102
+ }
103
+
104
+ async getOrders(tenantId: string, options?: { status?: OrderStatus; limit?: number; offset?: number }): Promise<PaginatedResult<Order>> {
105
+ let orders = [...this.store.values()].filter((o) => o.tenantId === tenantId);
106
+ if (options?.status) orders = orders.filter((o) => o.status === options.status);
107
+ const offset = options?.offset ?? 0;
108
+ const limit = options?.limit ?? 20;
109
+ return { data: orders.slice(offset, offset + limit), total: orders.length, limit, offset };
110
+ }
111
+
112
+ async getOrderById(tenantId: string, orderId: string): Promise<Order | null> {
113
+ const order = this.store.get(orderId);
114
+ if (!order || order.tenantId !== tenantId) return null;
115
+ return order;
116
+ }
117
+
118
+ async createOrder(tenantId: string, input: CreateOrderInput): Promise<Order> {
119
+ const order: Order = {
120
+ id: randomUUID(), tenantId, orderNumber: `PO-${Date.now()}`,
121
+ status: 'draft', currency: input.currency ?? 'USD',
122
+ totalAmount: input.items.reduce((sum, i) => sum + i.quantity * i.unitPrice, 0),
123
+ items: input.items.map((i) => ({ ...i, id: randomUUID() })),
124
+ createdAt: new Date(), updatedAt: new Date(),
125
+ };
126
+ this.store.set(order.id, order);
127
+ return order;
128
+ }
129
+
130
+ async updateOrderStatus(tenantId: string, orderId: string, status: OrderStatus): Promise<Order> {
131
+ const order = await this.getOrderById(tenantId, orderId);
132
+ if (!order) throw new Error(`Order ${orderId} not found`);
133
+ order.status = status;
134
+ order.updatedAt = new Date();
135
+ return order;
136
+ }
137
+
138
+ async deleteOrder(tenantId: string, orderId: string): Promise<void> {
139
+ const order = this.store.get(orderId);
140
+ if (order?.tenantId === tenantId) this.store.delete(orderId);
141
+ }
142
+ }
143
+ ```
144
+
145
+ ## Step 4: Factory (`adapter-factory.ts`)
146
+
147
+ ```typescript
148
+ import type { ProcurementAdapter } from './procurement-adapter';
149
+ import { MockProcurementAdapter } from './mock-adapter';
150
+ // import { HttpProcurementAdapter } from './http-adapter';
151
+
152
+ export function createProcurementAdapter(): ProcurementAdapter {
153
+ const useMock = process.env.USE_MOCK_ADAPTERS === 'true' || process.env.NODE_ENV === 'test';
154
+ if (useMock) {
155
+ return new MockProcurementAdapter();
156
+ }
157
+ // return new HttpProcurementAdapter(env.PROCUREMENT_API_URL, env.PROCUREMENT_API_KEY);
158
+ throw new Error('Real procurement adapter not configured. Set USE_MOCK_ADAPTERS=true for development.');
159
+ }
160
+ ```