@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.
- package/.claude-plugin/plugin.json +10 -0
- package/LICENSE +21 -0
- package/README.md +410 -0
- package/agents/architecture-researcher.md +115 -0
- package/agents/code-critic.md +190 -0
- package/agents/delegation-router.md +40 -0
- package/agents/feature-researcher.md +117 -0
- package/agents/interrogator.md +11 -0
- package/agents/pitfalls-researcher.md +112 -0
- package/agents/plan-validator.md +173 -0
- package/agents/proposer.md +61 -0
- package/agents/security-reviewer.md +189 -0
- package/agents/skill-builder.md +43 -0
- package/agents/spec-compliance-reviewer.md +154 -0
- package/agents/stack-researcher.md +89 -0
- package/commands/build.md +766 -0
- package/commands/code-analysis.md +39 -0
- package/commands/code-field.md +22 -0
- package/commands/compliance-check.md +34 -0
- package/commands/configure.md +178 -0
- package/commands/cost-report.md +17 -0
- package/commands/enterprise/adr.md +78 -0
- package/commands/enterprise/brainstorm.md +461 -0
- package/commands/enterprise/design.md +203 -0
- package/commands/enterprise/dev-setup.md +136 -0
- package/commands/enterprise/docker-dev.md +229 -0
- package/commands/enterprise/e2e.md +233 -0
- package/commands/enterprise/feature.md +218 -0
- package/commands/enterprise/gap-analysis.md +204 -0
- package/commands/enterprise/handover.md +195 -0
- package/commands/enterprise/herd.md +152 -0
- package/commands/enterprise/knowledge.md +173 -0
- package/commands/enterprise/onboard.md +86 -0
- package/commands/enterprise/qa-check.md +80 -0
- package/commands/enterprise/reason.md +196 -0
- package/commands/enterprise/review.md +177 -0
- package/commands/enterprise/scaffold.md +153 -0
- package/commands/enterprise/status-report.md +101 -0
- package/commands/enterprise/tech-catalog.md +170 -0
- package/commands/enterprise/test-gen.md +138 -0
- package/commands/evolve.md +39 -0
- package/commands/flags.md +44 -0
- package/commands/interrogate.md +263 -0
- package/commands/lesson.md +15 -0
- package/commands/lessons.md +10 -0
- package/commands/plan.md +44 -0
- package/commands/prune.md +27 -0
- package/commands/star.md +17 -0
- package/commands/supply-chain-scan.md +44 -0
- package/commands/unicode-scan.md +63 -0
- package/commands/verify.md +41 -0
- package/commands/workflow.md +436 -0
- package/hooks/ai-guardrails.sh +114 -0
- package/hooks/audit-log.sh +26 -0
- package/hooks/auto-delegate.sh +45 -0
- package/hooks/auto-evolve.sh +22 -0
- package/hooks/auto-lesson.sh +26 -0
- package/hooks/auto-plan.sh +59 -0
- package/hooks/auto-test.sh +46 -0
- package/hooks/auto-verify.sh +30 -0
- package/hooks/budget-check.sh +24 -0
- package/hooks/code-field-preamble.sh +30 -0
- package/hooks/compliance-gate.sh +50 -0
- package/hooks/content-trust.sh +22 -0
- package/hooks/credential-redact.sh +23 -0
- package/hooks/delegation-trust.sh +15 -0
- package/hooks/detect-test-run.sh +19 -0
- package/hooks/enforcement-lib.sh +60 -0
- package/hooks/evolve-gate.sh +32 -0
- package/hooks/evolve-lib.sh +32 -0
- package/hooks/exfiltration-check.sh +67 -0
- package/hooks/failure-collector.sh +27 -0
- package/hooks/feature-flags.sh +67 -0
- package/hooks/file-provenance.sh +31 -0
- package/hooks/flag-utils.sh +36 -0
- package/hooks/hooks.json +145 -0
- package/hooks/injection-scan.sh +58 -0
- package/hooks/integrity-verify.sh +91 -0
- package/hooks/lessons-check.sh +17 -0
- package/hooks/lockfile-audit.sh +109 -0
- package/hooks/patterns-lib.sh +22 -0
- package/hooks/plan-gate.sh +18 -0
- package/hooks/redact-lib.sh +15 -0
- package/hooks/runtime-mode.sh +56 -0
- package/hooks/session-cleanup.sh +74 -0
- package/hooks/skill-validator.sh +28 -0
- package/hooks/standards-enforce.sh +106 -0
- package/hooks/star-gate.sh +93 -0
- package/hooks/star-preamble.sh +10 -0
- package/hooks/telemetry.sh +33 -0
- package/hooks/todo-prune.sh +84 -0
- package/hooks/unicode-firewall.sh +122 -0
- package/hooks/unicode-lib.sh +66 -0
- package/hooks/unicode-scan-session.sh +96 -0
- package/hooks/validate-command.sh +103 -0
- package/hooks/validate-env.sh +51 -0
- package/hooks/validate-path.sh +81 -0
- package/package.json +40 -0
- package/settings.json +6 -0
- package/templates/ai-config/tool-standards.md +56 -0
- package/templates/architecture/api-first.md +192 -0
- package/templates/architecture/auth-patterns.md +302 -0
- package/templates/architecture/caching-strategy.md +359 -0
- package/templates/architecture/database-patterns.md +347 -0
- package/templates/architecture/event-driven.md +252 -0
- package/templates/architecture/integration-patterns.md +185 -0
- package/templates/architecture/multi-tenancy.md +104 -0
- package/templates/architecture/service-boundaries.md +200 -0
- package/templates/build/brief-template.md +86 -0
- package/templates/build/summary-template.md +100 -0
- package/templates/build/task-plan-template.md +133 -0
- package/templates/communication/effort-estimate.md +54 -0
- package/templates/communication/incident-response.md +59 -0
- package/templates/communication/post-mortem.md +109 -0
- package/templates/communication/risk-register.md +43 -0
- package/templates/communication/sprint-demo-checklist.md +64 -0
- package/templates/communication/stakeholder-presentation-outline.md +84 -0
- package/templates/communication/technical-proposal.md +77 -0
- package/templates/delivery/deployment/deployment-checklist.md +49 -0
- package/templates/delivery/design/solution-design-checklist.md +37 -0
- package/templates/delivery/discovery/stakeholder-questions.md +33 -0
- package/templates/delivery/handover/knowledge-transfer-checklist.md +75 -0
- package/templates/delivery/handover/operational-runbook.md +117 -0
- package/templates/delivery/handover/support-escalation-matrix.md +56 -0
- package/templates/delivery/implementation/blocker-escalation-template.md +55 -0
- package/templates/delivery/implementation/sprint-planning-template.md +49 -0
- package/templates/delivery/implementation/task-decomposition-guide.md +59 -0
- package/templates/delivery/qa/test-plan-template.md +76 -0
- package/templates/delivery/qa/test-results-template.md +55 -0
- package/templates/delivery/qa/uat-signoff-template.md +44 -0
- package/templates/governance/codeowners.md +60 -0
- package/templates/integration/adapter-pattern.md +160 -0
- package/templates/scaffolds/env-validation.md +85 -0
- package/templates/scaffolds/error-handling.md +171 -0
- package/templates/scaffolds/graceful-shutdown.md +139 -0
- package/templates/scaffolds/health-check.md +109 -0
- package/templates/scaffolds/structured-logging.md +134 -0
- package/templates/standards/engineering-standards.md +413 -0
- package/templates/standards/standards-checklist.md +125 -0
- package/templates/tech-catalog.json +663 -0
- package/templates/utilities/project-detection.md +75 -0
- package/templates/utilities/requirements-collection.md +68 -0
- package/templates/utilities/template-rendering.md +81 -0
- package/templates/workflows/architecture-decision.md +90 -0
- package/templates/workflows/bug-investigation.md +83 -0
- package/templates/workflows/feature-implementation.md +80 -0
- package/templates/workflows/refactoring.md +83 -0
- package/templates/workflows/spike-exploration.md +82 -0
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: code-analysis
|
|
3
|
+
description: Run a structured code analysis on the current project or specified path
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
Run a structured code analysis using the `code-critic` agent.
|
|
7
|
+
|
|
8
|
+
## Process
|
|
9
|
+
|
|
10
|
+
1. **Determine scope:** If `$ARGUMENTS` specifies a path or glob pattern, use that. Otherwise, analyze the full project working directory.
|
|
11
|
+
2. **Snapshot:** Use Glob and Grep to build a quick inventory of the codebase:
|
|
12
|
+
- File count and types (by extension)
|
|
13
|
+
- Tech stack detection (package.json, composer.json, Cargo.toml, go.mod, requirements.txt, Gemfile, etc.)
|
|
14
|
+
- Entry points and key structural files
|
|
15
|
+
3. **Plan analysis tasks:** Based on the detected stack, select relevant analysis passes from:
|
|
16
|
+
- **Filesystem manifest:** directory structure, file distribution, naming conventions
|
|
17
|
+
- **Dependency audit:** outdated/unused/duplicate dependencies, version constraints
|
|
18
|
+
- **Architecture patterns:** separation of concerns, layering, module boundaries
|
|
19
|
+
- **Code quality:** readability, naming, DRY, SOLID violations, complexity hotspots
|
|
20
|
+
- **Performance risks:** N+1 queries, unnecessary allocations, missing indexes, blocking I/O
|
|
21
|
+
- **Test coverage map:** test file to source file mapping, coverage gaps, assertion quality
|
|
22
|
+
- **Risk hotspots:** files with high churn + high complexity, large files, deeply nested logic
|
|
23
|
+
- **Security surface:** credential exposure, injection vectors, auth gaps (delegate to `security-reviewer` agent if available)
|
|
24
|
+
4. **Execute:** Dispatch the `code-critic` agent (and optionally `security-reviewer` agent in parallel) to perform each analysis pass. Each agent should reference exact file paths and line numbers.
|
|
25
|
+
5. **Report:** Compile findings into a structured report and write it to `docs/discovery/code-analysis/{project-name}.md` with:
|
|
26
|
+
- Summary stats (files, lines, stack, dependencies)
|
|
27
|
+
- Findings by category, ordered by severity (critical > high > medium > low)
|
|
28
|
+
- Concrete recommendations with file:line references
|
|
29
|
+
- A risk score (0-100) based on finding density and severity
|
|
30
|
+
|
|
31
|
+
## IMPORTANT: This is a read-only, reporting tool.
|
|
32
|
+
|
|
33
|
+
- Do NOT fix, patch, or modify any code during or after analysis.
|
|
34
|
+
- Do NOT edit any files other than the report output in `docs/discovery/code-analysis/`.
|
|
35
|
+
- Present the report summary to the user and STOP.
|
|
36
|
+
- Wait for explicit user instructions before taking any action on findings.
|
|
37
|
+
- If the user asks you to fix findings, treat that as a separate task requiring its own STAR plan.
|
|
38
|
+
|
|
39
|
+
Arguments: $ARGUMENTS
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: code-field
|
|
3
|
+
description: Apply the Code Field methodology (decompose, solve, verify, synthesize, reflect)
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
Apply the **Code Field** methodology to the current task or technical answer:
|
|
7
|
+
|
|
8
|
+
1. **DECOMPOSE** — Sub-problems: parts, dependencies, order.
|
|
9
|
+
2. **SOLVE** — Each part with confidence 0.0–1.0 (0.9+ proceed; 0.7–0.8 extra test; 0.5–0.6 verify first; <0.5 research/clarify).
|
|
10
|
+
3. **VERIFY** — Logic, facts, completeness, bias.
|
|
11
|
+
4. **SYNTHESIZE** — Weighted confidence; flag anything <0.7.
|
|
12
|
+
5. **REFLECT** — If <0.8 overall: weakness, research/ask, retry.
|
|
13
|
+
|
|
14
|
+
For complex solutions, end with:
|
|
15
|
+
|
|
16
|
+
```
|
|
17
|
+
✅ Answer: [clear solution or recommendation]
|
|
18
|
+
📊 Confidence: [0.0–1.0] ([brief justification])
|
|
19
|
+
⚠️ Caveats: [assumptions, limitations, conditions]
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
Arguments: $ARGUMENTS
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: compliance-check
|
|
3
|
+
description: Run AgentOps compliance checks manually
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
Run all AgentOps compliance gates and report their status:
|
|
7
|
+
|
|
8
|
+
## Checks
|
|
9
|
+
|
|
10
|
+
### 1. Plan Gate
|
|
11
|
+
- Count modified files tracked in `.agentops/modified-files.txt`
|
|
12
|
+
- If 3+ files modified, verify `tasks/todo.md` exists and is non-empty
|
|
13
|
+
- Report: PASS/FAIL with file count
|
|
14
|
+
|
|
15
|
+
### 2. Verification Gate
|
|
16
|
+
- Read `tasks/todo.md` and count unchecked items (`- [ ]`)
|
|
17
|
+
- Report: PASS/FAIL with count of remaining items
|
|
18
|
+
|
|
19
|
+
### 3. Test Gate
|
|
20
|
+
- Check if `.agentops/tests-ran` exists (populated by ci-guard hook)
|
|
21
|
+
- If 3+ files modified and no tests run, report FAIL
|
|
22
|
+
- Report: PASS/FAIL with last test timestamp if available
|
|
23
|
+
|
|
24
|
+
### 4. Lessons Check
|
|
25
|
+
- Check if `tasks/lessons.md` exists
|
|
26
|
+
- Count total lessons
|
|
27
|
+
- Report: INFO with lesson count
|
|
28
|
+
|
|
29
|
+
Present results in a table format:
|
|
30
|
+
|
|
31
|
+
| Gate | Status | Details |
|
|
32
|
+
|------|--------|---------|
|
|
33
|
+
|
|
34
|
+
Arguments: $ARGUMENTS
|
|
@@ -0,0 +1,178 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: configure
|
|
3
|
+
description: Unified configuration interface for all AgentOps plugin settings
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
You are the AgentOps configuration assistant. You provide a single entry point for viewing and modifying all plugin settings.
|
|
7
|
+
|
|
8
|
+
**Important:** The plugin root is wherever this command file lives — use the `CLAUDE_PLUGIN_ROOT` environment variable or detect the plugin directory by finding `hooks/feature-flags.sh` relative to this command. The configuration file is always at `{plugin_root}/.agentops/flags.json`. If it doesn't exist, create it with defaults.
|
|
9
|
+
|
|
10
|
+
Arguments: $ARGUMENTS
|
|
11
|
+
|
|
12
|
+
---
|
|
13
|
+
|
|
14
|
+
## No Arguments — Show Full Configuration
|
|
15
|
+
|
|
16
|
+
If no arguments provided, read `.agentops/flags.json` and `.agentops/budget.json` (both relative to the project root), then display the complete configuration:
|
|
17
|
+
|
|
18
|
+
```
|
|
19
|
+
## AgentOps Configuration
|
|
20
|
+
|
|
21
|
+
### Enforcement
|
|
22
|
+
| Setting | Value |
|
|
23
|
+
|---------|-------|
|
|
24
|
+
| Enforcement mode | advisory / blocking |
|
|
25
|
+
| Autonomy level | guided / supervised / autonomous |
|
|
26
|
+
|
|
27
|
+
### Security Hooks
|
|
28
|
+
| Flag | Status |
|
|
29
|
+
|------|--------|
|
|
30
|
+
| command_validation_enabled | on/off |
|
|
31
|
+
| path_validation_enabled | on/off |
|
|
32
|
+
| env_validation_enabled | on/off |
|
|
33
|
+
| injection_scan_enabled | on/off |
|
|
34
|
+
| content_trust_enabled | on/off |
|
|
35
|
+
| exfiltration_detection_enabled | on/off |
|
|
36
|
+
| credential_redaction_enabled | on/off |
|
|
37
|
+
| llm_content_firewall_enabled | on/off |
|
|
38
|
+
|
|
39
|
+
### Workflow Automation
|
|
40
|
+
| Flag | Status |
|
|
41
|
+
|------|--------|
|
|
42
|
+
| star_preamble_enabled | on/off |
|
|
43
|
+
| code_field_rules_enabled | on/off |
|
|
44
|
+
| plan_gate_enabled | on/off |
|
|
45
|
+
| verification_gate_enabled | on/off |
|
|
46
|
+
| test_gate_enabled | on/off |
|
|
47
|
+
| lessons_enabled | on/off |
|
|
48
|
+
| auto_plan_enabled | on/off |
|
|
49
|
+
| auto_test_enabled | on/off |
|
|
50
|
+
| auto_lesson_enabled | on/off |
|
|
51
|
+
| auto_verify_enabled | on/off |
|
|
52
|
+
| auto_evolve_enabled | on/off |
|
|
53
|
+
| auto_delegate_enabled | on/off |
|
|
54
|
+
|
|
55
|
+
### Enterprise Features
|
|
56
|
+
| Flag | Status |
|
|
57
|
+
|------|--------|
|
|
58
|
+
| enterprise_scaffold | on/off |
|
|
59
|
+
| ai_workflows | on/off |
|
|
60
|
+
| unified_review | on/off |
|
|
61
|
+
| architecture_guardrails | on/off |
|
|
62
|
+
| delivery_lifecycle | on/off |
|
|
63
|
+
| team_governance | on/off |
|
|
64
|
+
| client_comms | on/off |
|
|
65
|
+
|
|
66
|
+
### Budget
|
|
67
|
+
| Setting | Value |
|
|
68
|
+
|---------|-------|
|
|
69
|
+
| Budget | $X.XX |
|
|
70
|
+
| Spent | $X.XX |
|
|
71
|
+
| Remaining | $X.XX |
|
|
72
|
+
| Warning threshold | X% |
|
|
73
|
+
|
|
74
|
+
To change a setting: `/agentops:configure <setting> <value>`
|
|
75
|
+
```
|
|
76
|
+
|
|
77
|
+
---
|
|
78
|
+
|
|
79
|
+
## With Arguments — Update Settings
|
|
80
|
+
|
|
81
|
+
Parse the arguments as `<setting> <value>` and update accordingly.
|
|
82
|
+
|
|
83
|
+
### Supported Settings
|
|
84
|
+
|
|
85
|
+
**Modes:**
|
|
86
|
+
- `enforcement advisory` or `enforcement blocking` — set enforcement mode
|
|
87
|
+
- `autonomy guided`, `autonomy supervised`, or `autonomy autonomous` — set autonomy level
|
|
88
|
+
|
|
89
|
+
**Budget:**
|
|
90
|
+
- `budget <amount>` — set session budget in USD (e.g., `budget 10`)
|
|
91
|
+
- `budget-warn <percent>` — set warning threshold percentage (e.g., `budget-warn 90`)
|
|
92
|
+
|
|
93
|
+
**Feature flags (any flag name):**
|
|
94
|
+
- `<flag_name> on` or `<flag_name> true` — enable a flag
|
|
95
|
+
- `<flag_name> off` or `<flag_name> false` — disable a flag
|
|
96
|
+
|
|
97
|
+
**Presets (bulk operations):**
|
|
98
|
+
- `preset minimal` — disable all automation hooks, keep security hooks on
|
|
99
|
+
- `preset standard` — all defaults (security on, automation on, enterprise on)
|
|
100
|
+
- `preset security-only` — security hooks on, everything else off
|
|
101
|
+
- `preset enterprise` — all enterprise features on, autonomy guided
|
|
102
|
+
- `preset autonomous` — all enterprise features on, autonomy autonomous
|
|
103
|
+
|
|
104
|
+
### Preset Definitions
|
|
105
|
+
|
|
106
|
+
**minimal:**
|
|
107
|
+
```json
|
|
108
|
+
{
|
|
109
|
+
"auto_plan_enabled": false, "auto_test_enabled": false,
|
|
110
|
+
"auto_lesson_enabled": false, "auto_verify_enabled": false,
|
|
111
|
+
"auto_evolve_enabled": false, "auto_delegate_enabled": false,
|
|
112
|
+
"plan_gate_enabled": false, "verification_gate_enabled": false,
|
|
113
|
+
"test_gate_enabled": false, "star_preamble_enabled": false,
|
|
114
|
+
"code_field_rules_enabled": false
|
|
115
|
+
}
|
|
116
|
+
```
|
|
117
|
+
|
|
118
|
+
**security-only:**
|
|
119
|
+
All automation and enterprise flags set to `false`. All security flags remain `true`.
|
|
120
|
+
|
|
121
|
+
**enterprise:**
|
|
122
|
+
All flags `true`, `enforcement_mode: "advisory"`, `autonomy_level: "guided"`.
|
|
123
|
+
|
|
124
|
+
**autonomous:**
|
|
125
|
+
All flags `true`, `enforcement_mode: "advisory"`, `autonomy_level: "autonomous"`.
|
|
126
|
+
|
|
127
|
+
---
|
|
128
|
+
|
|
129
|
+
## Update Process
|
|
130
|
+
|
|
131
|
+
1. Read the current `.agentops/flags.json` (create with defaults if missing)
|
|
132
|
+
2. Apply the requested change
|
|
133
|
+
3. Write back the updated JSON
|
|
134
|
+
4. Display confirmation: "Updated `<setting>` to `<value>`"
|
|
135
|
+
5. Show the affected section of the configuration table
|
|
136
|
+
|
|
137
|
+
## Defaults (used when creating flags.json)
|
|
138
|
+
|
|
139
|
+
```json
|
|
140
|
+
{
|
|
141
|
+
"command_validation_enabled": true,
|
|
142
|
+
"path_validation_enabled": true,
|
|
143
|
+
"env_validation_enabled": true,
|
|
144
|
+
"injection_scan_enabled": true,
|
|
145
|
+
"content_trust_enabled": true,
|
|
146
|
+
"exfiltration_detection_enabled": true,
|
|
147
|
+
"credential_redaction_enabled": true,
|
|
148
|
+
"llm_content_firewall_enabled": true,
|
|
149
|
+
"plan_gate_enabled": true,
|
|
150
|
+
"verification_gate_enabled": true,
|
|
151
|
+
"test_gate_enabled": true,
|
|
152
|
+
"star_preamble_enabled": true,
|
|
153
|
+
"code_field_rules_enabled": true,
|
|
154
|
+
"lessons_enabled": true,
|
|
155
|
+
"auto_plan_enabled": true,
|
|
156
|
+
"auto_test_enabled": true,
|
|
157
|
+
"auto_lesson_enabled": true,
|
|
158
|
+
"auto_verify_enabled": true,
|
|
159
|
+
"auto_evolve_enabled": true,
|
|
160
|
+
"auto_delegate_enabled": true,
|
|
161
|
+
"enforcement_mode": "advisory",
|
|
162
|
+
"enterprise_scaffold": true,
|
|
163
|
+
"ai_workflows": true,
|
|
164
|
+
"unified_review": true,
|
|
165
|
+
"architecture_guardrails": true,
|
|
166
|
+
"delivery_lifecycle": true,
|
|
167
|
+
"team_governance": true,
|
|
168
|
+
"client_comms": true,
|
|
169
|
+
"autonomy_level": "guided"
|
|
170
|
+
}
|
|
171
|
+
```
|
|
172
|
+
|
|
173
|
+
## Error Handling
|
|
174
|
+
|
|
175
|
+
- If an unrecognised setting name is provided, suggest the closest match (fuzzy)
|
|
176
|
+
- If an invalid value is provided (e.g., `autonomy fast`), show allowed values
|
|
177
|
+
- If `.agentops/` directory doesn't exist, create it
|
|
178
|
+
- Never crash — always provide helpful feedback
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: cost-report
|
|
3
|
+
description: Display current session cost tracking and budget status
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
Read `.agentops/budget.json` and display the current budget status:
|
|
7
|
+
|
|
8
|
+
- **Budget:** Total allocated USD
|
|
9
|
+
- **Spent:** Amount used so far
|
|
10
|
+
- **Remaining:** Budget minus spent
|
|
11
|
+
- **Warning threshold:** Percentage at which warnings trigger
|
|
12
|
+
- **Status:** OK / WARNING / EXCEEDED
|
|
13
|
+
- **Session started:** Timestamp
|
|
14
|
+
|
|
15
|
+
If `.agentops/budget.json` doesn't exist, report that budget tracking is not initialized and suggest starting a session with `AGENTOPS_BUDGET_USD` set.
|
|
16
|
+
|
|
17
|
+
Arguments: $ARGUMENTS
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: adr
|
|
3
|
+
description: Generate Architecture Decision Records capturing the why behind technical decisions
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
You are an Architecture Decision Record (ADR) assistant. You help engineers document technical decisions in a structured, searchable format.
|
|
7
|
+
|
|
8
|
+
**Before starting, check the feature flag:**
|
|
9
|
+
Run: `source hooks/feature-flags.sh && agentops_enterprise_enabled "architecture_guardrails"` — if disabled, inform the user and stop.
|
|
10
|
+
|
|
11
|
+
The decision to document: $ARGUMENTS
|
|
12
|
+
|
|
13
|
+
If no arguments provided, ask: "What technical decision would you like to document as an ADR?"
|
|
14
|
+
|
|
15
|
+
---
|
|
16
|
+
|
|
17
|
+
## Step 1: Determine ADR Number
|
|
18
|
+
|
|
19
|
+
Check `docs/adr/` in the project for existing ADRs. The new ADR number is the next sequential number. If no `docs/adr/` directory exists, create it and start at 0001.
|
|
20
|
+
|
|
21
|
+
## Step 2: Gather Context
|
|
22
|
+
|
|
23
|
+
Ask the user:
|
|
24
|
+
1. **What is the decision?** (one sentence)
|
|
25
|
+
2. **What problem does this solve?** (context)
|
|
26
|
+
3. **What alternatives were considered?** (at least 2)
|
|
27
|
+
4. **Why was this option chosen?** (rationale)
|
|
28
|
+
|
|
29
|
+
If the user provides all context upfront, skip questions and proceed directly.
|
|
30
|
+
|
|
31
|
+
## Step 3: Generate ADR
|
|
32
|
+
|
|
33
|
+
Write the ADR to `docs/adr/NNNN-title-in-kebab-case.md`:
|
|
34
|
+
|
|
35
|
+
```markdown
|
|
36
|
+
# ADR-NNNN: [Title]
|
|
37
|
+
|
|
38
|
+
## Status
|
|
39
|
+
|
|
40
|
+
Accepted
|
|
41
|
+
|
|
42
|
+
## Date
|
|
43
|
+
|
|
44
|
+
[today's date]
|
|
45
|
+
|
|
46
|
+
## Context
|
|
47
|
+
|
|
48
|
+
[What is the issue that motivates this decision? What forces are at play?]
|
|
49
|
+
|
|
50
|
+
## Decision
|
|
51
|
+
|
|
52
|
+
[What is the change that we're proposing and/or doing?]
|
|
53
|
+
|
|
54
|
+
## Consequences
|
|
55
|
+
|
|
56
|
+
### Positive
|
|
57
|
+
- [benefit]
|
|
58
|
+
|
|
59
|
+
### Negative
|
|
60
|
+
- [trade-off]
|
|
61
|
+
|
|
62
|
+
### Neutral
|
|
63
|
+
- [observation]
|
|
64
|
+
|
|
65
|
+
## Alternatives Considered
|
|
66
|
+
|
|
67
|
+
### [Alternative 1]
|
|
68
|
+
**Rejected because:** [reason]
|
|
69
|
+
|
|
70
|
+
### [Alternative 2]
|
|
71
|
+
**Rejected because:** [reason]
|
|
72
|
+
```
|
|
73
|
+
|
|
74
|
+
## Step 4: Update Index
|
|
75
|
+
|
|
76
|
+
If a `docs/adr/README.md` or `docs/adr/index.md` exists, add the new ADR to the list. If not, create one with all existing ADRs listed.
|
|
77
|
+
|
|
78
|
+
Report: "ADR-NNNN created at docs/adr/NNNN-title.md"
|