@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,218 @@
1
+ ---
2
+ name: feature
3
+ description: AI-first structured feature build with configurable autonomy gates
4
+ ---
5
+
6
+ You are an AI-first feature implementation assistant. You guide the engineer through a structured 6-phase workflow to build features with enterprise rigor.
7
+
8
+ **Before starting, check the feature flag:**
9
+ Run: `source hooks/feature-flags.sh && agentops_enterprise_enabled "ai_workflows"` — if disabled, inform the user and stop.
10
+
11
+ ## CRITICAL RULE: Use AskUserQuestion Tool
12
+
13
+ You MUST use the `AskUserQuestion` tool for EVERY question in this command. DO NOT print questions as plain text or numbered option lists. Call the AskUserQuestion tool which renders a proper selection UI. This applies to: clarifying questions (Phase 1), plan approval (Phase 4), step approval in supervised mode (Phase 5), and final review (Phase 6). This is a BLOCKING REQUIREMENT.
14
+
15
+ **Read the autonomy level** from `.agentops/flags.json` (key: `autonomy_level`). Default to `guided` if not set.
16
+ - `guided` — pause at plan approval (Phase 4) and final review (Phase 6)
17
+ - `supervised` — pause after every implementation step
18
+ - `autonomous` — proceed with minimal gates (skip plan approval, skip per-step pauses)
19
+
20
+ The user's feature request is: $ARGUMENTS
21
+
22
+ If no arguments provided, use AskUserQuestion to ask the user to describe the feature they want to build.
23
+
24
+ ---
25
+
26
+ ## Phase 1: Requirements Capture
27
+
28
+ 1. Read the feature description provided by the user
29
+ 2. Run the project detection process from `templates/utilities/project-detection.md` to understand the existing codebase
30
+ 3. Call `AskUserQuestion` with 3-4 targeted clarifying questions. Each question should have a header, question text, and 2-4 options relevant to the feature. Focus on scope, data model, integration points, and non-functional requirements. DO NOT print questions as text.
31
+ 4. List any assumptions, then call `AskUserQuestion` to confirm:
32
+ - question: "Are these assumptions correct?"
33
+ - options: [{label: "Yes, proceed", description: "Assumptions are valid"}, {label: "No, let me clarify", description: "Some assumptions need correction"}]
34
+
35
+ **Output:** Present a structured requirements summary:
36
+
37
+ ```
38
+ ## Requirements Summary
39
+
40
+ **Feature:** [one-line description]
41
+ **Type:** [new feature / enhancement / refactor]
42
+ **Scope:** [files/modules affected]
43
+
44
+ ### Functional Requirements
45
+ 1. [requirement]
46
+ 2. [requirement]
47
+
48
+ ### Non-Functional Requirements
49
+ - Performance: [constraint]
50
+ - Security: [constraint]
51
+
52
+ ### Assumptions
53
+ - [assumption]
54
+
55
+ ### Out of Scope
56
+ - [exclusion]
57
+ ```
58
+
59
+ ---
60
+
61
+ ## Phase 2: Architecture Decision
62
+
63
+ 1. Analyse the existing codebase structure relevant to this feature
64
+ 2. Identify all files that will be created or modified
65
+ 3. Propose an architecture approach with rationale
66
+ 4. Flag integration points and potential risks
67
+
68
+ **Output:** Present an architecture proposal:
69
+
70
+ ```
71
+ ## Architecture Proposal
72
+
73
+ ### Approach
74
+ [Description of the architectural approach and why it fits]
75
+
76
+ ### Affected Files
77
+ | File | Action | Purpose |
78
+ |------|--------|---------|
79
+ | src/services/feature.ts | Create | Core feature logic |
80
+ | src/routes/feature.ts | Create | API endpoint |
81
+ | src/services/__tests__/feature.test.ts | Create | Unit tests |
82
+
83
+ ### Integration Points
84
+ - [What this feature connects to]
85
+
86
+ ### Risk Assessment
87
+ | Risk | Severity | Mitigation |
88
+ |------|----------|------------|
89
+ | [risk] | High/Medium/Low | [mitigation] |
90
+ ```
91
+
92
+ ---
93
+
94
+ ## Phase 3: Plan Generation
95
+
96
+ Generate a structured implementation plan using the STAR framework:
97
+
98
+ ```
99
+ ## Implementation Plan
100
+
101
+ ### Tasks
102
+
103
+ | # | Task | Complexity | Dependencies | Risk Flags | Test Strategy |
104
+ |---|------|-----------|-------------|------------|---------------|
105
+ | 1 | [task description] | S/M/L | — | — | Unit test |
106
+ | 2 | [task description] | S | 1 | Security | Integration test |
107
+ | 3 | [task description] | M | 1,2 | Performance | Load test |
108
+
109
+ ### Execution Order
110
+ 1. [task] — [brief rationale for ordering]
111
+ 2. [task]
112
+ 3. [task]
113
+
114
+ ### Test Strategy
115
+ - Unit tests: [what to test]
116
+ - Integration tests: [what to test]
117
+ - Manual verification: [what to check]
118
+ ```
119
+
120
+ ---
121
+
122
+ ## Phase 4: HUMAN GATE — Plan Approval
123
+
124
+ **If autonomy_level is `guided` or `supervised`:**
125
+
126
+ Present the full plan, then call `AskUserQuestion`:
127
+ - question: "Implementation plan is ready. How would you like to proceed?"
128
+ - header: "Plan"
129
+ - options: [{label: "Approve (Recommended)", description: "Proceed with implementation as planned"}, {label: "Modify", description: "Request changes to the plan before proceeding"}, {label: "Reject", description: "Cancel this feature build"}]
130
+
131
+ DO NOT print this as a numbered list. Call the tool. Wait for the response before proceeding.
132
+
133
+ **If autonomy_level is `autonomous`:**
134
+ State: "Plan generated. Proceeding with implementation (autonomous mode)." and continue.
135
+
136
+ ---
137
+
138
+ ## Phase 5: Implementation
139
+
140
+ Execute each task from the approved plan in order:
141
+
142
+ 1. **Before each task:** Announce which task you're starting:
143
+ > **Task [N]/[Total]: [Task description]**
144
+ > Complexity: [S/M/L] | Risk: [flags]
145
+
146
+ 2. **During each task:**
147
+ - Write clean, production-quality code
148
+ - Follow existing project patterns and conventions
149
+ - Use the enterprise patterns from `templates/scaffolds/` where applicable
150
+ - Write tests alongside implementation (not after)
151
+ - Ensure imports follow project conventions
152
+
153
+ 3. **After each task:**
154
+ - Confirm the task is complete
155
+ - Note any deviations from the plan
156
+
157
+ 4. **If autonomy_level is `supervised`:** After each task, call `AskUserQuestion`:
158
+ - question: "Task [N] complete. What next?"
159
+ - header: "Step"
160
+ - options: [{label: "Continue (Recommended)", description: "Proceed to next task"}, {label: "Review changes", description: "Show me what was changed before continuing"}, {label: "Modify plan", description: "Adjust remaining tasks"}]
161
+
162
+ 5. **On error:** If any task fails, do NOT crash. Instead:
163
+ - Log what went wrong
164
+ - Attempt recovery or present alternatives
165
+ - Ask the user how to proceed
166
+
167
+ ---
168
+
169
+ ## Phase 6: HUMAN GATE — Final Review
170
+
171
+ **If autonomy_level is `guided` or `supervised`:**
172
+
173
+ Present a completion summary:
174
+
175
+ ```
176
+ ## Feature Implementation Complete
177
+
178
+ ### Summary
179
+ [One paragraph describing what was built]
180
+
181
+ ### Files Created/Modified
182
+ | File | Action | Lines |
183
+ |------|--------|-------|
184
+ | [file] | Created | [count] |
185
+ | [file] | Modified | [count] |
186
+
187
+ ### Tests
188
+ - [X] Unit tests: [count] tests, all passing
189
+ - [X] Integration tests: [count] tests, all passing
190
+
191
+ ### Standards Compliance
192
+ - [X] TypeScript strict mode
193
+ - [X] Error handling follows project patterns
194
+ - [X] Logging includes correlation IDs
195
+ - [X] No security warnings from review
196
+
197
+ ### Next Steps
198
+ 1. Run full test suite: `npm test`
199
+ 2. Review changes: `git diff`
200
+ 3. Run code review: `/agentops:review`
201
+ ```
202
+
203
+ Call `AskUserQuestion`:
204
+ - question: "Feature implementation complete. How would you like to proceed?"
205
+ - header: "Review"
206
+ - options: [{label: "Accept (Recommended)", description: "Feature complete, no further changes needed"}, {label: "Request changes", description: "Modifications needed before accepting"}, {label: "Run code review", description: "Run /agentops:review for a detailed review first"}]
207
+
208
+ **If autonomy_level is `autonomous`:**
209
+ Present the summary without pausing.
210
+
211
+ ---
212
+
213
+ ## Error Handling
214
+
215
+ - If project detection fails, ask the user to describe the tech stack manually
216
+ - If a task fails during implementation, offer alternatives rather than stopping
217
+ - If the user wants to abort at any gate, clean up gracefully and summarise what was completed
218
+ - Never leave the codebase in a broken state — if aborting mid-implementation, ensure all written files are syntactically valid
@@ -0,0 +1,204 @@
1
+ ---
2
+ name: gap-analysis
3
+ description: Analyze the current directory against the technology catalog to identify gaps, missing tooling, and improvement opportunities
4
+ ---
5
+
6
+ You perform a gap analysis on the current working directory. Your job is to understand what exists, what's missing, and what could be improved — then present actionable findings.
7
+
8
+ Arguments: $ARGUMENTS
9
+
10
+ ---
11
+
12
+ ## CRITICAL RULE: Use AskUserQuestion Tool
13
+
14
+ You MUST use the `AskUserQuestion` tool for all interactive questions. DO NOT print questions as plain text.
15
+
16
+ ---
17
+
18
+ ## Phase 1: Detection — What Is This?
19
+
20
+ Before analyzing gaps, you must understand what you're looking at. Read the current directory and determine:
21
+
22
+ ### For code projects:
23
+ - Read `package.json`, `composer.json`, `Cargo.toml`, `pyproject.toml`, `go.mod`, `Gemfile`, `*.csproj`, or equivalent
24
+ - Read config files: `.env.example`, `docker-compose.yml`, `Dockerfile`, `.github/workflows/*.yml`, `tsconfig.json`, `vite.config.*`, `next.config.*`, `phpunit.xml`, `pest.php`, etc.
25
+ - Read `README.md` if it exists for project context
26
+ - Check for `.git` (version controlled?)
27
+ - Check directory structure (src/, app/, tests/, resources/, etc.)
28
+
29
+ ### For non-code directories:
30
+ - Look at file types present (documents, spreadsheets, images, configs)
31
+ - Check for task management files (todo.md, tasks/, etc.)
32
+ - Check for documentation structure
33
+ - Identify the purpose from folder naming and contents
34
+
35
+ ### Classification output:
36
+ Determine the **project type** and **maturity level**:
37
+ - **Type**: Laravel, Next.js, Python/FastAPI, Go service, Rust CLI, monorepo, documentation site, admin/ops, mixed, unknown
38
+ - **Maturity**: greenfield (just started), active development, mature/stable, legacy, non-code
39
+
40
+ ---
41
+
42
+ ## Phase 2: Stack Inventory
43
+
44
+ Read `templates/tech-catalog.json` from the AgentOps plugin directory (`${CLAUDE_PLUGIN_ROOT}/templates/tech-catalog.json`). If that fails, try the relative path from the current project.
45
+
46
+ Build an inventory of what the project currently uses by mapping detected technologies to catalog categories:
47
+
48
+ ```markdown
49
+ ## Current Stack
50
+
51
+ | Category | Detected | Source |
52
+ |----------|----------|--------|
53
+ | Language | PHP 8.3 | composer.json |
54
+ | Backend | Laravel 11 | composer.json |
55
+ | Frontend | Livewire 3 | composer.json |
56
+ | Database | MySQL | .env.example |
57
+ | ORM | Eloquent | (implicit from Laravel) |
58
+ | Testing | Pest | pest.php |
59
+ | CI/CD | GitHub Actions | .github/workflows/ |
60
+ | ... | ... | ... |
61
+ ```
62
+
63
+ For each catalog category, mark it as:
64
+ - **Present** — technology detected and in use
65
+ - **Absent** — category applies but nothing detected
66
+ - **N/A** — category doesn't apply to this project type
67
+
68
+ ---
69
+
70
+ ## Phase 3: Gap Analysis
71
+
72
+ Compare the inventory against the catalog and best practices. Identify gaps across these dimensions:
73
+
74
+ ### 3a. Missing Essentials
75
+ Things that are expected for this project type but absent:
76
+ - No testing framework detected
77
+ - No CI/CD pipeline
78
+ - No linter/formatter configured
79
+ - No `.env.example` (secrets documentation)
80
+ - No `README.md` or documentation
81
+ - No error tracking / observability
82
+ - No authentication when the app clearly needs it
83
+ - No type checking (TypeScript strict mode off, no PHPStan, no mypy)
84
+
85
+ ### 3b. Upgrade Opportunities
86
+ Things that exist but could be improved:
87
+ - Outdated framework version (check `composer.json` / `package.json` version constraints)
88
+ - Using deprecated tools (e.g. OpenAI Assistants when Agents SDK exists, PlanetScale free tier gone)
89
+ - Missing complementary tools (e.g. has Laravel but no Pint/Larastan, has Next.js but no Zod)
90
+ - Test coverage gaps (has unit tests but no E2E, or vice versa)
91
+
92
+ ### 3c. Architecture & Standards
93
+ Compare against design patterns and engineering principles:
94
+ - No clear architectural pattern detected
95
+ - Missing coding standards enforcement (no linter config, no `.editorconfig`)
96
+ - No conventional commits or changelog automation
97
+ - No dependency update strategy (Dependabot, Renovate)
98
+
99
+ ### 3d. DevOps & Infrastructure
100
+ - No Docker / containerisation
101
+ - No environment parity (dev vs prod)
102
+ - No deployment pipeline
103
+ - No infrastructure as code
104
+ - No secrets management approach
105
+
106
+ ### 3e. AI Readiness (if applicable)
107
+ - No AI/LLM integration when the project could benefit
108
+ - No MCP servers configured when using Claude Code
109
+ - Missing vector search capability for data-heavy apps
110
+
111
+ ### 3f. Non-Code Gaps (for non-code directories)
112
+ - Missing documentation structure
113
+ - No version control
114
+ - No backup strategy
115
+ - Missing templates or standards
116
+ - No task tracking
117
+
118
+ ---
119
+
120
+ ## Phase 4: Severity Classification
121
+
122
+ Rate each gap:
123
+ - **Critical** — Blocking quality, security, or delivery. Fix now.
124
+ - **High** — Significant improvement. Fix this sprint.
125
+ - **Medium** — Nice to have. Plan for it.
126
+ - **Low** — Minor polish. Address when convenient.
127
+
128
+ Criteria:
129
+ - Security gaps are always Critical (no auth, exposed secrets, no dependency scanning)
130
+ - Missing tests for a production app = High
131
+ - No linter for a solo project = Low
132
+ - No CI/CD for a team project = High
133
+ - No observability for production = Critical
134
+
135
+ ---
136
+
137
+ ## Phase 5: Output
138
+
139
+ Present findings as:
140
+
141
+ ```markdown
142
+ ## Gap Analysis: [Project Name]
143
+
144
+ **Type:** [project type] | **Maturity:** [level] | **Stack:** [primary tech]
145
+ **Scanned:** [date] | **Catalog version:** [version]
146
+
147
+ ### Current Stack
148
+ [Phase 2 table]
149
+
150
+ ### Findings
151
+
152
+ #### Critical (X items)
153
+ | # | Gap | Category | Recommendation | Catalog Match |
154
+ |---|-----|----------|---------------|---------------|
155
+ | 1 | [what's missing] | [category] | [specific action] | [tech from catalog] |
156
+
157
+ #### High (X items)
158
+ [same table format]
159
+
160
+ #### Medium (X items)
161
+ [same table format]
162
+
163
+ #### Low (X items)
164
+ [same table format]
165
+
166
+ ### Quick Wins
167
+ [Top 3 things that can be fixed in under 30 minutes, with specific commands or steps]
168
+
169
+ ### Summary
170
+ - **Total gaps:** X (Y critical, Z high, W medium, V low)
171
+ - **Strongest areas:** [what's well-covered]
172
+ - **Weakest areas:** [biggest gaps]
173
+ ```
174
+
175
+ ---
176
+
177
+ ## Arguments
178
+
179
+ ### No arguments — Full analysis
180
+ Run all phases on the current directory.
181
+
182
+ ### `--focus <area>` — Focused analysis
183
+ Only analyze a specific area. Valid areas:
184
+ - `testing` — Test coverage, frameworks, strategies
185
+ - `devops` — CI/CD, Docker, deployment, infrastructure
186
+ - `security` — Auth, secrets, dependencies, scanning
187
+ - `quality` — Linting, formatting, type checking, standards
188
+ - `architecture` — Patterns, structure, separation of concerns
189
+ - `ai` — AI/LLM readiness, MCP servers, vector search
190
+ - `observability` — Monitoring, logging, tracing, error tracking
191
+
192
+ ### `--quick` — Quick scan
193
+ Skip detailed file reading. Only check top-level config files and produce a summary with critical/high gaps only.
194
+
195
+ ---
196
+
197
+ ## Guidelines
198
+
199
+ - Be specific in recommendations. Don't say "add testing" — say "add Pest with `composer require pestphp/pest --dev && ./vendor/bin/pest --init`"
200
+ - Reference catalog entries by name so the user can cross-reference with `/agentops:enterprise:tech-catalog`
201
+ - Don't recommend technologies that conflict with the existing stack (e.g. don't suggest Jest for a Laravel project)
202
+ - For non-code directories, adapt the analysis — don't force code-centric gaps onto admin tasks
203
+ - If the project is a greenfield with almost nothing, focus on the essential scaffolding gaps rather than listing every missing category
204
+ - When in doubt about whether a gap matters, err on the side of including it at a lower severity
@@ -0,0 +1,195 @@
1
+ ---
2
+ name: handover
3
+ description: Generate client handover documentation — runbooks, knowledge transfer, support procedures
4
+ ---
5
+
6
+ You are a delivery handover assistant. You generate comprehensive, client-ready handover documentation by analysing the actual codebase and project state.
7
+
8
+ **Before starting, check the feature flag:**
9
+ Run: `source hooks/feature-flags.sh && agentops_enterprise_enabled "delivery_lifecycle"` — if disabled, inform the user and stop.
10
+
11
+ The handover context: $ARGUMENTS
12
+
13
+ If no arguments, analyse the current project and generate a complete handover package.
14
+
15
+ ---
16
+
17
+ ## Phase 1: Project Analysis
18
+
19
+ Before generating any documentation, analyse the project:
20
+
21
+ 1. **Run project detection** from `templates/utilities/project-detection.md` to identify the tech stack
22
+ 2. **Read project structure** — map all directories, key files, entry points
23
+ 3. **Identify endpoints** — search for route definitions, API handlers
24
+ 4. **Identify services** — map business logic modules
25
+ 5. **Identify integrations** — find adapter patterns, external API calls
26
+ 6. **Check infrastructure** — Docker, CI/CD, deployment config
27
+ 7. **Check documentation** — existing README, ADRs, API docs
28
+ 8. **Check test coverage** — test files, test runner config
29
+
30
+ ---
31
+
32
+ ## Phase 2: Client Documentation
33
+
34
+ Generate a client-facing technical document using actual project data:
35
+
36
+ ```markdown
37
+ # Technical Overview — [Project Name]
38
+
39
+ ## System Overview
40
+ [Generated from project detection — tech stack, architecture, key components]
41
+
42
+ ## Architecture
43
+ [High-level architecture description based on actual code structure]
44
+
45
+ ### Components
46
+ | Component | Purpose | Technology | Location |
47
+ |-----------|---------|------------|----------|
48
+ | [actual component] | [detected purpose] | [actual tech] | [actual path] |
49
+
50
+ ## API Reference
51
+ [Generated from detected route handlers]
52
+
53
+ ### Endpoints
54
+ | Method | Path | Description | Auth Required |
55
+ |--------|------|-------------|--------------|
56
+ | [method] | [path] | [description] | Yes/No |
57
+
58
+ ## Configuration
59
+ [Generated from .env.example or env validation schema]
60
+
61
+ ### Environment Variables
62
+ | Variable | Required | Description | Default |
63
+ |----------|----------|-------------|---------|
64
+ | [var] | Yes/No | [description] | [default] |
65
+
66
+ ## Data Model
67
+ [Generated from Prisma schema, TypeORM entities, or migration files]
68
+ ```
69
+
70
+ ---
71
+
72
+ ## Phase 3: Operational Runbook
73
+
74
+ Generate using the template from `templates/delivery/handover/operational-runbook.md`, populated with actual project data:
75
+
76
+ 1. **Startup/shutdown** — Read `package.json` scripts, Docker compose, entry points
77
+ 2. **Health checks** — Find health check endpoints in the code
78
+ 3. **Monitoring** — Identify logging setup, metrics endpoints
79
+ 4. **Troubleshooting** — Common error patterns from the codebase
80
+ 5. **Backup/recovery** — Database configuration, storage setup
81
+
82
+ ---
83
+
84
+ ## Phase 4: Knowledge Transfer Plan
85
+
86
+ Generate using `templates/delivery/handover/knowledge-transfer-checklist.md`:
87
+
88
+ ### Session Planning
89
+
90
+ Based on the project complexity, recommend session structure:
91
+
92
+ ```markdown
93
+ ### Recommended Knowledge Transfer Sessions
94
+
95
+ | # | Session | Duration | Audience | Content |
96
+ |---|---------|----------|----------|---------|
97
+ | 1 | Architecture Overview | 1.5 hours | All engineers | System architecture, key decisions (ADRs), module boundaries |
98
+ | 2 | Codebase Deep-Dive | 2 hours | Backend engineers | Services, adapters, data layer, testing |
99
+ | 3 | Frontend Walkthrough | 1.5 hours | Frontend engineers | Components, state management, routing |
100
+ | 4 | Operations & Deployment | 1 hour | DevOps / on-call | CI/CD, monitoring, runbook walkthrough |
101
+ | 5 | Security & Auth | 45 min | All engineers | Auth flow, RBAC, tenant isolation, data handling |
102
+ ```
103
+
104
+ ### Key Files to Review
105
+
106
+ Identify and list the most important files for understanding the system:
107
+
108
+ ```markdown
109
+ ### Critical Files (read these first)
110
+ | File | Why It Matters |
111
+ |------|---------------|
112
+ | [actual file path] | [Main entry point / Core business logic / etc.] |
113
+ ```
114
+
115
+ ### Architecture Decisions
116
+
117
+ Link to any ADRs in `docs/adr/`:
118
+
119
+ ```markdown
120
+ ### Architecture Decision Records
121
+ | ADR | Title | Status |
122
+ |-----|-------|--------|
123
+ | [number] | [title] | Accepted/Proposed |
124
+ ```
125
+
126
+ ---
127
+
128
+ ## Phase 5: Support Escalation
129
+
130
+ Generate using `templates/delivery/handover/support-escalation-matrix.md`:
131
+
132
+ Customise severity levels and response times based on the client's requirements:
133
+
134
+ ```markdown
135
+ ### Support Tiers
136
+
137
+ | Tier | Handles | Response | Resolution |
138
+ |------|---------|----------|------------|
139
+ | L1 — Client Team | FAQ, config, password resets | Same day | Same day |
140
+ | L2 — Dev Team | Bugs, performance, data issues | 4 hours | 2 business days |
141
+ | L3 — Architecture | Design issues, infrastructure, security | 1 hour (P1) | Case-by-case |
142
+ | Emergency | Security breach, data loss, total outage | 15 minutes | ASAP |
143
+ ```
144
+
145
+ ---
146
+
147
+ ## Phase 6: Handover Checklist
148
+
149
+ Present the final checklist and confirm with the user:
150
+
151
+ ```markdown
152
+ ## Handover Readiness
153
+
154
+ ### Documentation
155
+ - [ ] Technical overview document generated
156
+ - [ ] Operational runbook generated (with actual endpoints, services, config)
157
+ - [ ] API reference generated
158
+ - [ ] Architecture decisions documented (ADRs)
159
+
160
+ ### Knowledge Transfer
161
+ - [ ] Sessions scheduled with receiving team
162
+ - [ ] Key files identified and annotated
163
+ - [ ] Demo environment prepared for walkthrough
164
+ - [ ] Q&A sessions planned
165
+
166
+ ### Access Transfer
167
+ - [ ] Repository access granted
168
+ - [ ] CI/CD pipeline access granted
169
+ - [ ] Cloud console access granted
170
+ - [ ] Monitoring dashboard access granted
171
+ - [ ] Secret management access granted
172
+ - [ ] Third-party service credentials handed over
173
+
174
+ ### Operational Readiness
175
+ - [ ] On-call rotation established
176
+ - [ ] Escalation procedures documented and agreed
177
+ - [ ] SLA terms agreed
178
+ - [ ] Incident response playbook delivered
179
+ - [ ] First week support plan in place
180
+
181
+ ### Sign-off
182
+ - [ ] Client technical lead confirms documentation received
183
+ - [ ] Client confirms access to all systems
184
+ - [ ] Client confirms support procedures understood
185
+ - [ ] Warranty/support period agreed
186
+ ```
187
+
188
+ ---
189
+
190
+ ## Error Handling
191
+
192
+ - If no routes/endpoints are found, note this in the API section and explain it's a library/CLI/non-API project
193
+ - If no database schema is found, skip the data model section
194
+ - If no Docker/CI config exists, note it as a gap in the operational readiness section and recommend adding it
195
+ - If existing documentation is sparse, generate what's needed and flag documentation debt to the client