@uluops/setup 0.2.0 → 0.6.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/LICENSE +21 -0
- package/README.md +109 -89
- package/assets/auto-tracker-save.mjs +142 -0
- package/assets/claude-code/agents/anxiety-reader-agent.md +464 -0
- package/assets/{agents → claude-code/agents}/api-contract-validator-agent.md +9 -228
- package/assets/{agents → claude-code/agents}/aristotle-analyst-agent.md +51 -4
- package/assets/{agents → claude-code/agents}/aristotle-explorer-agent.md +6 -2
- package/assets/{agents → claude-code/agents}/aristotle-forecaster-agent.md +15 -230
- package/assets/{agents → claude-code/agents}/aristotle-validator-agent.md +12 -252
- package/assets/{agents → claude-code/agents}/assumption-excavator-agent.md +21 -247
- package/assets/{agents → claude-code/agents}/code-auditor-agent.md +12 -255
- package/assets/{agents → claude-code/agents}/code-optimizer-agent.md +15 -236
- package/assets/{agents → claude-code/agents}/code-validator-agent.md +31 -300
- package/assets/claude-code/agents/docs-validator-agent.md +472 -0
- package/assets/{agents → claude-code/agents}/frontend-validator-agent.md +15 -258
- package/assets/{agents → claude-code/agents}/mcp-validator-agent.md +8 -252
- package/assets/{agents → claude-code/agents}/pre-implementation-architect-agent.md +8 -224
- package/assets/{agents → claude-code/agents}/prompt-engineer-agent.md +57 -290
- package/assets/{agents → claude-code/agents}/prompt-pattern-analyzer-agent.md +10 -225
- package/assets/{agents → claude-code/agents}/prompt-quality-validator-agent.md +11 -249
- package/assets/{agents → claude-code/agents}/public-interface-validator-agent.md +15 -268
- package/assets/claude-code/agents/release-readiness-agent.md +495 -0
- package/assets/{agents → claude-code/agents}/security-analyst-agent.md +236 -480
- package/assets/{agents → claude-code/agents}/test-architect-agent.md +16 -259
- package/assets/{agents → claude-code/agents}/type-safety-validator-agent.md +23 -266
- package/assets/{agents → claude-code/agents}/workflow-synthesis-agent.md +23 -226
- package/assets/claude-code/commands/agents/anxiety-reader.md +157 -0
- package/assets/{commands → claude-code/commands}/agents/api-contract.md +156 -135
- package/assets/{commands → claude-code/commands}/agents/architect.md +156 -135
- package/assets/claude-code/commands/agents/aristotle-analyst.md +157 -0
- package/assets/claude-code/commands/agents/aristotle-explorer.md +157 -0
- package/assets/claude-code/commands/agents/aristotle-forecaster.md +157 -0
- package/assets/claude-code/commands/agents/aristotle-validator.md +157 -0
- package/assets/{commands → claude-code/commands}/agents/assumption-excavator.md +49 -6
- package/assets/{commands → claude-code/commands}/agents/audit.md +156 -136
- package/assets/{commands → claude-code/commands}/agents/docs-validate.md +156 -133
- package/assets/{commands → claude-code/commands}/agents/frontend.md +156 -135
- package/assets/{commands → claude-code/commands}/agents/mcp-validate.md +156 -136
- package/assets/{commands → claude-code/commands}/agents/optimize.md +156 -133
- package/assets/{commands → claude-code/commands}/agents/pattern-analyzer.md +150 -126
- package/assets/{commands → claude-code/commands}/agents/prompt-quality.md +155 -134
- package/assets/claude-code/commands/agents/prompt-validate.md +155 -0
- package/assets/{commands → claude-code/commands}/agents/public-interface.md +156 -134
- package/assets/{commands → claude-code/commands}/agents/release.md +156 -135
- package/assets/{commands → claude-code/commands}/agents/security.md +156 -137
- package/assets/{commands → claude-code/commands}/agents/test-review.md +156 -136
- package/assets/{commands → claude-code/commands}/agents/type-safety.md +156 -135
- package/assets/{commands → claude-code/commands}/agents/validate.md +156 -134
- package/assets/claude-code/commands/agents/workflow-synthesis.md +157 -0
- package/assets/claude-code/commands/pipelines/aristotle.md +143 -0
- package/assets/claude-code/commands/pipelines/ship.md +188 -0
- package/assets/claude-code/commands/workflows/post-implementation.md +60 -0
- package/assets/claude-code/commands/workflows/pre-implementation.md +46 -0
- package/assets/claude-code/commands/workflows/prompt-audit.md +44 -0
- package/assets/codex/agents/anxiety-reader-agent.toml +462 -0
- package/assets/codex/agents/api-contract-validator-agent.toml +738 -0
- package/assets/codex/agents/aristotle-analyst-agent.toml +750 -0
- package/assets/codex/agents/aristotle-explorer-agent.toml +155 -0
- package/assets/codex/agents/aristotle-forecaster-agent.toml +449 -0
- package/assets/codex/agents/aristotle-validator-agent.toml +424 -0
- package/assets/codex/agents/assumption-excavator-agent.toml +1126 -0
- package/assets/codex/agents/code-auditor-agent.toml +815 -0
- package/assets/codex/agents/code-optimizer-agent.toml +652 -0
- package/assets/codex/agents/code-validator-agent.toml +573 -0
- package/assets/codex/agents/docs-validator-agent.toml +468 -0
- package/assets/codex/agents/frontend-validator-agent.toml +598 -0
- package/assets/codex/agents/mcp-validator-agent.toml +580 -0
- package/assets/codex/agents/pre-implementation-architect-agent.toml +817 -0
- package/assets/codex/agents/prompt-engineer-agent.toml +922 -0
- package/assets/codex/agents/prompt-pattern-analyzer-agent.toml +689 -0
- package/assets/codex/agents/prompt-quality-validator-agent.toml +777 -0
- package/assets/codex/agents/public-interface-validator-agent.toml +695 -0
- package/assets/codex/agents/release-readiness-agent.toml +491 -0
- package/assets/codex/agents/security-analyst-agent.toml +847 -0
- package/assets/codex/agents/test-architect-agent.toml +615 -0
- package/assets/codex/agents/type-safety-validator-agent.toml +686 -0
- package/assets/codex/agents/workflow-synthesis-agent.toml +631 -0
- package/assets/gemini-cli/agents/anxiety-reader-agent.md +470 -0
- package/assets/gemini-cli/agents/api-contract-validator-agent.md +747 -0
- package/assets/gemini-cli/agents/aristotle-analyst-agent.md +758 -0
- package/assets/gemini-cli/agents/aristotle-explorer-agent.md +163 -0
- package/assets/gemini-cli/agents/aristotle-forecaster-agent.md +457 -0
- package/assets/gemini-cli/agents/aristotle-validator-agent.md +432 -0
- package/assets/gemini-cli/agents/assumption-excavator-agent.md +1134 -0
- package/assets/gemini-cli/agents/code-auditor-agent.md +827 -0
- package/assets/gemini-cli/agents/code-optimizer-agent.md +661 -0
- package/assets/gemini-cli/agents/code-validator-agent.md +582 -0
- package/assets/gemini-cli/agents/docs-validator-agent.md +477 -0
- package/assets/gemini-cli/agents/frontend-validator-agent.md +610 -0
- package/assets/gemini-cli/agents/mcp-validator-agent.md +589 -0
- package/assets/gemini-cli/agents/pre-implementation-architect-agent.md +826 -0
- package/assets/gemini-cli/agents/prompt-engineer-agent.md +931 -0
- package/assets/gemini-cli/agents/prompt-pattern-analyzer-agent.md +698 -0
- package/assets/gemini-cli/agents/prompt-quality-validator-agent.md +786 -0
- package/assets/gemini-cli/agents/public-interface-validator-agent.md +707 -0
- package/assets/gemini-cli/agents/release-readiness-agent.md +500 -0
- package/assets/gemini-cli/agents/security-analyst-agent.md +859 -0
- package/assets/gemini-cli/agents/test-architect-agent.md +624 -0
- package/assets/gemini-cli/agents/type-safety-validator-agent.md +695 -0
- package/assets/gemini-cli/agents/workflow-synthesis-agent.md +639 -0
- package/assets/gemini-cli/commands/agents/anxiety-reader.toml +155 -0
- package/assets/gemini-cli/commands/agents/api-contract.toml +154 -0
- package/assets/gemini-cli/commands/agents/architect.toml +154 -0
- package/assets/gemini-cli/commands/agents/aristotle-analyst.toml +155 -0
- package/assets/gemini-cli/commands/agents/aristotle-explorer.toml +155 -0
- package/assets/gemini-cli/commands/agents/aristotle-forecaster.toml +155 -0
- package/assets/gemini-cli/commands/agents/aristotle-validator.toml +155 -0
- package/assets/gemini-cli/commands/agents/assumption-excavator.toml +155 -0
- package/assets/gemini-cli/commands/agents/audit.toml +154 -0
- package/assets/gemini-cli/commands/agents/docs-validate.toml +154 -0
- package/assets/gemini-cli/commands/agents/frontend.toml +154 -0
- package/assets/gemini-cli/commands/agents/mcp-validate.toml +154 -0
- package/assets/gemini-cli/commands/agents/optimize.toml +154 -0
- package/assets/gemini-cli/commands/agents/pattern-analyzer.toml +148 -0
- package/assets/gemini-cli/commands/agents/prompt-quality.toml +153 -0
- package/assets/gemini-cli/commands/agents/prompt-validate.toml +153 -0
- package/assets/gemini-cli/commands/agents/public-interface.toml +154 -0
- package/assets/gemini-cli/commands/agents/release.toml +154 -0
- package/assets/gemini-cli/commands/agents/security.toml +154 -0
- package/assets/gemini-cli/commands/agents/test-review.toml +154 -0
- package/assets/gemini-cli/commands/agents/type-safety.toml +154 -0
- package/assets/gemini-cli/commands/agents/validate.toml +154 -0
- package/assets/gemini-cli/commands/agents/workflow-synthesis.toml +155 -0
- package/assets/gemini-cli/commands/pipelines/aristotle.toml +139 -0
- package/assets/gemini-cli/commands/pipelines/ship.toml +184 -0
- package/assets/gemini-cli/commands/workflows/post-implementation.toml +56 -0
- package/assets/gemini-cli/commands/workflows/pre-implementation.toml +42 -0
- package/assets/gemini-cli/commands/workflows/prompt-audit.toml +40 -0
- package/assets/opencode/agents/anxiety-reader-agent.md +472 -0
- package/assets/opencode/agents/api-contract-validator-agent.md +749 -0
- package/assets/opencode/agents/aristotle-analyst-agent.md +760 -0
- package/assets/opencode/agents/aristotle-explorer-agent.md +164 -0
- package/assets/opencode/agents/aristotle-forecaster-agent.md +459 -0
- package/assets/opencode/agents/aristotle-validator-agent.md +434 -0
- package/assets/opencode/agents/assumption-excavator-agent.md +1136 -0
- package/assets/opencode/agents/code-auditor-agent.md +826 -0
- package/assets/opencode/agents/code-optimizer-agent.md +663 -0
- package/assets/opencode/agents/code-validator-agent.md +584 -0
- package/assets/opencode/agents/docs-validator-agent.md +479 -0
- package/assets/opencode/agents/frontend-validator-agent.md +609 -0
- package/assets/opencode/agents/mcp-validator-agent.md +591 -0
- package/assets/opencode/agents/pre-implementation-architect-agent.md +828 -0
- package/assets/opencode/agents/prompt-engineer-agent.md +933 -0
- package/assets/opencode/agents/prompt-pattern-analyzer-agent.md +700 -0
- package/assets/opencode/agents/prompt-quality-validator-agent.md +788 -0
- package/assets/opencode/agents/public-interface-validator-agent.md +706 -0
- package/assets/opencode/agents/release-readiness-agent.md +502 -0
- package/assets/opencode/agents/security-analyst-agent.md +858 -0
- package/assets/opencode/agents/test-architect-agent.md +626 -0
- package/assets/opencode/agents/type-safety-validator-agent.md +697 -0
- package/assets/opencode/agents/workflow-synthesis-agent.md +641 -0
- package/dist/cli.js +22 -380
- package/dist/commands/helpers.d.ts +73 -0
- package/dist/commands/helpers.js +274 -0
- package/dist/commands/setup.d.ts +13 -0
- package/dist/commands/setup.js +93 -0
- package/dist/commands/uninstall.d.ts +3 -0
- package/dist/commands/uninstall.js +126 -0
- package/dist/commands/verify.d.ts +1 -0
- package/dist/commands/verify.js +28 -0
- package/dist/harnesses/claude-code.d.ts +8 -0
- package/dist/harnesses/claude-code.js +74 -0
- package/dist/harnesses/codex.d.ts +15 -0
- package/dist/harnesses/codex.js +54 -0
- package/dist/harnesses/gemini-cli.d.ts +12 -0
- package/dist/harnesses/gemini-cli.js +80 -0
- package/dist/harnesses/index.d.ts +27 -0
- package/dist/harnesses/index.js +54 -0
- package/dist/harnesses/opencode.d.ts +14 -0
- package/dist/harnesses/opencode.js +139 -0
- package/dist/harnesses/types.d.ts +106 -0
- package/dist/harnesses/types.js +26 -0
- package/dist/lib/agent-transform.d.ts +12 -0
- package/dist/lib/agent-transform.js +129 -0
- package/dist/lib/asset-catalog.d.ts +9 -0
- package/dist/lib/asset-catalog.js +56 -0
- package/dist/lib/atomic-write.d.ts +11 -0
- package/dist/lib/atomic-write.js +28 -0
- package/dist/lib/config-merger.d.ts +9 -2
- package/dist/lib/config-merger.js +44 -7
- package/dist/lib/display.d.ts +14 -0
- package/dist/lib/display.js +66 -0
- package/dist/lib/file-ops.d.ts +11 -0
- package/dist/lib/file-ops.js +40 -4
- package/dist/lib/hash.d.ts +1 -0
- package/dist/lib/hash.js +2 -1
- package/dist/lib/health.d.ts +2 -0
- package/dist/lib/health.js +10 -0
- package/dist/lib/manifest.d.ts +51 -5
- package/dist/lib/manifest.js +146 -13
- package/dist/lib/paths.d.ts +30 -3
- package/dist/lib/paths.js +98 -12
- package/dist/lib/settings-merger.d.ts +31 -8
- package/dist/lib/settings-merger.js +87 -24
- package/dist/lib/version.d.ts +2 -0
- package/dist/lib/version.js +10 -0
- package/dist/steps/agents.d.ts +4 -1
- package/dist/steps/agents.js +48 -9
- package/dist/steps/auth.js +26 -10
- package/dist/steps/cli.d.ts +53 -0
- package/dist/steps/cli.js +90 -0
- package/dist/steps/commands.d.ts +6 -1
- package/dist/steps/commands.js +36 -9
- package/dist/steps/detect.d.ts +3 -0
- package/dist/steps/detect.js +11 -0
- package/dist/steps/mcp.d.ts +6 -2
- package/dist/steps/mcp.js +39 -22
- package/dist/steps/metrics.d.ts +26 -10
- package/dist/steps/metrics.js +108 -108
- package/dist/steps/shell.d.ts +2 -0
- package/dist/steps/shell.js +26 -9
- package/dist/steps/signup.d.ts +7 -4
- package/dist/steps/signup.js +29 -20
- package/dist/steps/verify.d.ts +2 -2
- package/dist/steps/verify.js +118 -112
- package/package.json +40 -14
- package/assets/agents/docs-validator-agent.md +0 -490
- package/assets/agents/release-readiness-agent.md +0 -482
- package/assets/commands/agents/aristotle-analyst.md +0 -115
- package/assets/commands/agents/aristotle-explorer.md +0 -92
- package/assets/commands/agents/aristotle-forecaster.md +0 -114
- package/assets/commands/agents/aristotle-validator.md +0 -114
- package/assets/commands/agents/prompt-validate.md +0 -135
- package/assets/commands/agents/workflow-synthesis.md +0 -101
- package/assets/commands/workflows/aristotle.md +0 -543
- package/assets/commands/workflows/post-implementation.md +0 -577
- package/assets/commands/workflows/pre-implementation.md +0 -670
- package/assets/commands/workflows/prompt-audit.md +0 -754
- package/assets/commands/workflows/ship.md +0 -721
- package/dist/test/auth.test.d.ts +0 -1
- package/dist/test/auth.test.js +0 -43
- package/dist/test/config-io.test.d.ts +0 -1
- package/dist/test/config-io.test.js +0 -56
- package/dist/test/config-merger.test.d.ts +0 -1
- package/dist/test/config-merger.test.js +0 -94
- package/dist/test/detect.test.d.ts +0 -1
- package/dist/test/detect.test.js +0 -25
- package/dist/test/file-ops.test.d.ts +0 -1
- package/dist/test/file-ops.test.js +0 -100
- package/dist/test/hash.test.d.ts +0 -1
- package/dist/test/hash.test.js +0 -14
- package/dist/test/manifest.test.d.ts +0 -1
- package/dist/test/manifest.test.js +0 -78
- package/dist/test/paths.test.d.ts +0 -1
- package/dist/test/paths.test.js +0 -30
- package/dist/test/settings-merger.test.d.ts +0 -1
- package/dist/test/settings-merger.test.js +0 -167
- package/dist/test/shell-profile.test.d.ts +0 -1
- package/dist/test/shell-profile.test.js +0 -40
- package/dist/test/shell.test.d.ts +0 -1
- package/dist/test/shell.test.js +0 -71
- package/dist/test/signup.test.d.ts +0 -1
- package/dist/test/signup.test.js +0 -83
|
@@ -1,754 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
name: prompt-audit
|
|
3
|
-
description: Comprehensive audit of agent definitions, commands, or workflows. Uses prompt-pattern-analyzer for ecosystem context, prompt-engineer for validation, and prompt-quality-validator for best practices analysis. Use when reviewing existing prompts or before significant changes.
|
|
4
|
-
tools: Read, Grep, Glob, Bash
|
|
5
|
-
model: sonnet
|
|
6
|
-
---
|
|
7
|
-
|
|
8
|
-
# Prompt Audit
|
|
9
|
-
|
|
10
|
-
Comprehensive audit of agent definitions, commands, or workflows. Uses prompt-pattern-analyzer for ecosystem context, prompt-engineer for validation, and prompt-quality-validator for best practices analysis. Use when reviewing existing prompts or before significant changes.
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
**Philosophy**: Context-aware auditing. Understand ecosystem conventions first, then validate and improve with that context.
|
|
14
|
-
### Prompt Audit vs prompt-validate
|
|
15
|
-
|
|
16
|
-
| Aspect | Prompt Audit | prompt-validate |
|
|
17
|
-
|--------|------|------|
|
|
18
|
-
| Focus | Full audit with ecosystem context | Quick validation only |
|
|
19
|
-
| Duration | 6-15 minutes | 2-5 minutes |
|
|
20
|
-
| Agents Used | pattern-analyzer + prompt-engineer + prompt-quality | prompt-engineer only |
|
|
21
|
-
| Output | Features list + conditional refactored draft | Pass/fail with suggestions |
|
|
22
|
-
|
|
23
|
-
---
|
|
24
|
-
|
|
25
|
-
## Workflow Overview
|
|
26
|
-
|
|
27
|
-
```
|
|
28
|
-
┌──────────────────┐
|
|
29
|
-
│ pattern-analyzer │ ◄── Ecosystem context
|
|
30
|
-
└────────┬─────────┘
|
|
31
|
-
│
|
|
32
|
-
┌────────▼─────────┐
|
|
33
|
-
│ prompt-engineer │ ◄── Validate with context (gate)
|
|
34
|
-
│ + type-specific │ Includes inline structural checks
|
|
35
|
-
│ checks │ based on artifact type
|
|
36
|
-
└────────┬─────────┘
|
|
37
|
-
│
|
|
38
|
-
┌────────▼─────────┐
|
|
39
|
-
│ prompt-quality │ ◄── Best practices review
|
|
40
|
-
│ validator │
|
|
41
|
-
└────────┬─────────┘
|
|
42
|
-
│
|
|
43
|
-
═════════▼══════════
|
|
44
|
-
PERSIST TO TRACKER
|
|
45
|
-
+ Conditional draft
|
|
46
|
-
(if score < 75)
|
|
47
|
-
════════════════════
|
|
48
|
-
|
|
49
|
-
```
|
|
50
|
-
|
|
51
|
-
Phase 0 establishes ecosystem conventions that inform all subsequent phases
|
|
52
|
-
Type-specific structural checks are performed inline by the orchestrator between prompt-engineer and prompt-quality phases
|
|
53
|
-
Refactored draft is a conditional output artifact generated only if prompt-engineer score < 75
|
|
54
|
-
|
|
55
|
-
Duration: 6-15 minutes (includes ecosystem analysis)
|
|
56
|
-
### Token Estimation
|
|
57
|
-
|
|
58
|
-
| Scope | Input Tokens | Output Tokens |
|
|
59
|
-
|-------|-------------|---------------|
|
|
60
|
-
| Single agent prompt | ~35,000 | ~4,000 |
|
|
61
|
-
| Workflow command | ~45,000 | ~6,000 |
|
|
62
|
-
| Large workflow (500+ lines) | ~60,000 | ~8,000 |
|
|
63
|
-
**Cost Drivers**:
|
|
64
|
-
- Ecosystem size: more agents = more pattern analysis tokens
|
|
65
|
-
- Prompt length: longer prompts = more validation tokens
|
|
66
|
-
- Issue count: more findings = more detailed output
|
|
67
|
-
Prompt audit is always sequential—each phase depends on prior context.
|
|
68
|
-
Phase 0 ecosystem context informs Phase 1 scoring benchmarks.
|
|
69
|
-
Phase 2 type checks depend on Phase 1 results.
|
|
70
|
-
|
|
71
|
-
---
|
|
72
|
-
|
|
73
|
-
## Agent Handoff Formats
|
|
74
|
-
|
|
75
|
-
Each agent passes structured data to the next in the pipeline:
|
|
76
|
-
|
|
77
|
-
| From | To | Passes | Expects |
|
|
78
|
-
|------|-----|--------|---------|
|
|
79
|
-
| Pattern Analyzer | Prompt Engineer | Ecosystem conventions, threshold benchmarks, decision pair standards, expected sections | Context-aware validation scoring using ecosystem baselines |
|
|
80
|
-
| Prompt Engineer | Prompt Quality Validator | Score, category breakdown, identified issues, structural compliance results | Best practice improvements with specific rewrite suggestions |
|
|
81
|
-
|
|
82
|
-
**Handoff Contract:**
|
|
83
|
-
- Pattern Analyzer provides context that informs all subsequent scoring
|
|
84
|
-
- Each phase builds on prior findings rather than re-checking
|
|
85
|
-
- Critical failures from Prompt Engineer block the pipeline
|
|
86
|
-
- All findings feed into tracker persistence regardless of outcome
|
|
87
|
-
|
|
88
|
-
---
|
|
89
|
-
|
|
90
|
-
## Pre-Flight: Target Detection and Configuration
|
|
91
|
-
|
|
92
|
-
Before running agents, determine the target path and which optional validators should run.
|
|
93
|
-
|
|
94
|
-
### Context Detection
|
|
95
|
-
|
|
96
|
-
**Detection criteria**: A detector returns TRUE if its command exits with code 0.
|
|
97
|
-
|
|
98
|
-
| Detector ID | Description |
|
|
99
|
-
|-------------|-------------|
|
|
100
|
-
| `is_agent_definition` | Run command: echo "{{ file }}" | grep -qE "agents/.*-agent\.md$" |
|
|
101
|
-
| `is_agent_command` | Run command: echo "{{ file }}" | grep -qE "commands/agents/" |
|
|
102
|
-
| `is_workflow_command` | Run command: echo "{{ file }}" | grep -qE "commands/workflows/" |
|
|
103
|
-
| `is_general_command` | Run command: echo "{{ file }}" | grep -qE "commands/" | grep -vE "commands/(agents|workflows)/" |
|
|
104
|
-
|
|
105
|
-
**is_agent_definition**:
|
|
106
|
-
```bash
|
|
107
|
-
echo "{{ file }}" | grep -qE "agents/.*-agent\.md$" && echo "DETECTED" || echo "NOT DETECTED"
|
|
108
|
-
```
|
|
109
|
-
|
|
110
|
-
**is_agent_command**:
|
|
111
|
-
```bash
|
|
112
|
-
echo "{{ file }}" | grep -qE "commands/agents/" && echo "DETECTED" || echo "NOT DETECTED"
|
|
113
|
-
```
|
|
114
|
-
|
|
115
|
-
**is_workflow_command**:
|
|
116
|
-
```bash
|
|
117
|
-
echo "{{ file }}" | grep -qE "commands/workflows/" && echo "DETECTED" || echo "NOT DETECTED"
|
|
118
|
-
```
|
|
119
|
-
|
|
120
|
-
**is_general_command**:
|
|
121
|
-
```bash
|
|
122
|
-
echo "{{ file }}" | grep -qE "commands/" | grep -vE "commands/(agents|workflows)/" && echo "DETECTED" || echo "NOT DETECTED"
|
|
123
|
-
```
|
|
124
|
-
|
|
125
|
-
### Metadata Extraction
|
|
126
|
-
|
|
127
|
-
Before running phases, extract the following metadata from the target:
|
|
128
|
-
|
|
129
|
-
| Step | Type | Description |
|
|
130
|
-
|------|------|-------------|
|
|
131
|
-
| `frontmatter_metadata` | frontmatter | Extract name, description, model, and tools from target file frontmatter |
|
|
132
|
-
| `section_count` | command | Count ## headings in the target file |
|
|
133
|
-
| `file_size` | command | Count lines in the target file |
|
|
134
|
-
|
|
135
|
-
**frontmatter_metadata**: Extract name, description, model, tools from `{{ file }}`
|
|
136
|
-
**section_count**:
|
|
137
|
-
```bash
|
|
138
|
-
grep -c '^## ' {{ file }}
|
|
139
|
-
```
|
|
140
|
-
|
|
141
|
-
**file_size**:
|
|
142
|
-
```bash
|
|
143
|
-
wc -l < {{ file }}
|
|
144
|
-
```
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
---
|
|
148
|
-
|
|
149
|
-
## Arguments
|
|
150
|
-
|
|
151
|
-
### Positional Arguments
|
|
152
|
-
|
|
153
|
-
| Argument | Required | Description |
|
|
154
|
-
|----------|----------|-------------|
|
|
155
|
-
| file | Yes | Path to the prompt artifact to audit (agent, command, or workflow file) |
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
### Usage Examples
|
|
159
|
-
|
|
160
|
-
| Command | Behavior |
|
|
161
|
-
|---------|----------|
|
|
162
|
-
| `/workflows:prompt-audit agents/security-analyst-agent.md` | Audits agent definition with ecosystem context |
|
|
163
|
-
| `/workflows:prompt-audit commands/agents/validate.md` | Audits agent invocation command |
|
|
164
|
-
| `/workflows:prompt-audit commands/workflows/ship.md` | Audits workflow command |
|
|
165
|
-
|
|
166
|
-
---
|
|
167
|
-
|
|
168
|
-
## Execution Mode Selection
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
| Mode | Description | Best For |
|
|
172
|
-
|------|-------------|----------|
|
|
173
|
-
| Sequential | - | - |
|
|
174
|
-
| Parallel | - | - |
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
Prompt audit is always sequential—each phase depends on prior context.
|
|
178
|
-
Phase 0 ecosystem context informs Phase 1 scoring benchmarks.
|
|
179
|
-
Phase 2 type checks depend on Phase 1 results.
|
|
180
|
-
|
|
181
|
-
---
|
|
182
|
-
|
|
183
|
-
## Execution
|
|
184
|
-
|
|
185
|
-
Run each agent in sequence (or parallel groups if selected). Stop and fix if any agent fails. **Collect all recommendations for tracker persistence.**
|
|
186
|
-
|
|
187
|
-
### Phase 1: Ecosystem Pattern Analysis
|
|
188
|
-
**Commands**: pattern-analyzer@1.0.0
|
|
189
|
-
|
|
190
|
-
**Invoke via Task tool:**
|
|
191
|
-
```
|
|
192
|
-
Task(
|
|
193
|
-
subagent_type: "pattern-analyzer",
|
|
194
|
-
prompt: "[validator:pattern-analyzer] Validate {TARGET_DIRECTORY}. Return structured JSON OUTPUT.",
|
|
195
|
-
description: "Pattern Analyzer"
|
|
196
|
-
)
|
|
197
|
-
```
|
|
198
|
-
|
|
199
|
-
**Gate**: threshold >= 50, on fail: warn
|
|
200
|
-
|
|
201
|
-
**Focus**:
|
|
202
|
-
- Discover all prompt artifacts (agents, commands, workflows)
|
|
203
|
-
- Extract scoring patterns and point allocations
|
|
204
|
-
- Identify decision vocabulary conventions
|
|
205
|
-
- Analyze threshold standards by agent type
|
|
206
|
-
- Detect structural patterns and inconsistencies
|
|
207
|
-
|
|
208
|
-
**Capture for tracker**: Ecosystem context (conventions, thresholds, patterns) for downstream phases.
|
|
209
|
-
|
|
210
|
-
**If failing**: Ecosystem data is limited (<5 agents). Proceed with generic conventions.
|
|
211
|
-
|
|
212
|
-
**Decision criteria**:
|
|
213
|
-
- INSIGHTFUL (✅): Score ≥75 AND ≥50% ecosystem coverage
|
|
214
|
-
- INCOMPLETE (⚠️): Score <75 OR <5 agents in ecosystem
|
|
215
|
-
|
|
216
|
-
**Alternatives**:
|
|
217
|
-
- `strategy-analyst@1.0.0` — Must override model to sonnet — default is opus. Use when deeper strategic analysis is needed.
|
|
218
|
-
|
|
219
|
-
**Key Outputs**:
|
|
220
|
-
|
|
221
|
-
| Output | Downstream Usage |
|
|
222
|
-
|--------|-----------------|
|
|
223
|
-
| threshold_convention | Benchmark for Phase 1 scoring — e.g., expected >=75 for validators |
|
|
224
|
-
| decision_pair_convention | Consistency check in Phase 1 — e.g., PASS/FAIL, DEPLOY/REVISE pairs |
|
|
225
|
-
| expected_sections | Type-specific validation — e.g., Mission, Output Format, Decision for agents |
|
|
226
|
-
| common_failure_modes | Focus areas for Phase 2 improvement suggestions |
|
|
227
|
-
|
|
228
|
-
---
|
|
229
|
-
|
|
230
|
-
### Phase 2: Prompt Engineer Validation
|
|
231
|
-
**Commands**: prompt-validate@1.0.0
|
|
232
|
-
|
|
233
|
-
**Invoke via Task tool:**
|
|
234
|
-
```
|
|
235
|
-
Task(
|
|
236
|
-
subagent_type: "prompt-validate",
|
|
237
|
-
prompt: "[validator:prompt-validate] Validate {TARGET_DIRECTORY}. Return structured JSON OUTPUT.",
|
|
238
|
-
description: "Prompt Validator"
|
|
239
|
-
)
|
|
240
|
-
```
|
|
241
|
-
|
|
242
|
-
**Gate**: threshold >= 75, on fail: stop
|
|
243
|
-
|
|
244
|
-
**Why this threshold?** Prompts below 75 produce inconsistent agent behavior. The threshold ensures minimum deployment quality.
|
|
245
|
-
|
|
246
|
-
**Focus**:
|
|
247
|
-
- Clarity & Specificity (25 pts)
|
|
248
|
-
- Structure & Organization (20 pts)
|
|
249
|
-
- Completeness (25 pts)
|
|
250
|
-
- Effectiveness (20 pts)
|
|
251
|
-
- Consistency (10 pts)
|
|
252
|
-
- Type-specific structural compliance (inline checks per artifact type)
|
|
253
|
-
|
|
254
|
-
**Capture for tracker**: Overall score, category breakdown, vague language instances with line numbers, missing sections, improvement suggestions, and type-specific structural compliance.
|
|
255
|
-
|
|
256
|
-
**If failing**: Apply critical fixes from the improvement suggestions. Prompt does not meet deployment quality.
|
|
257
|
-
|
|
258
|
-
**Decision criteria**:
|
|
259
|
-
- DEPLOY (✅): Score ≥75 AND no critical issues AND structural checks pass
|
|
260
|
-
- REVISE (❌): Score <75 OR critical issues present OR structural elements missing
|
|
261
|
-
|
|
262
|
-
### For Agent Definitions
|
|
263
|
-
|
|
264
|
-
**Runs when**: `is_agent_definition`
|
|
265
|
-
|
|
266
|
-
Check for required elements:
|
|
267
|
-
|
|
268
|
-
| Check | What to Look For | Report |
|
|
269
|
-
|-------|------------------|--------|
|
|
270
|
-
| Required sections | "Mission", "Output Format", "Decision" | [OK]/[X] for each |
|
|
271
|
-
| Scoring framework | Contains "points", "pts", or "/100" | Show first 5 matches |
|
|
272
|
-
| Auto-fail conditions | Contains "auto.*fail", "critical.*issue", "must.*fix" | List if found |
|
|
273
|
-
| Quality gate | Contains checklist or gate criteria | List if found |
|
|
274
|
-
| Edge case handling | Has subsections (### headings) | Count found |
|
|
275
|
-
|
|
276
|
-
### For Agent Commands
|
|
277
|
-
|
|
278
|
-
**Runs when**: `is_agent_command`
|
|
279
|
-
|
|
280
|
-
Check for required elements:
|
|
281
|
-
|
|
282
|
-
| Check | What to Look For | Report |
|
|
283
|
-
|-------|------------------|--------|
|
|
284
|
-
| Agent reference | Contains "agents:" or "agent-" | [OK]/[X] |
|
|
285
|
-
| Argument handling | Contains "ARGUMENTS", "<directory>", "<path>" | [OK]/[X] |
|
|
286
|
-
| Threshold mention | Contains ">=[0-9]+", "Threshold", or "Score" | [OK]/[X] |
|
|
287
|
-
|
|
288
|
-
### For Workflows
|
|
289
|
-
|
|
290
|
-
**Runs when**: `is_workflow_command`
|
|
291
|
-
|
|
292
|
-
Check for required elements:
|
|
293
|
-
|
|
294
|
-
| Check | What to Look For | Report |
|
|
295
|
-
|-------|------------------|--------|
|
|
296
|
-
| Phase structure | Contains "### Phase" or "Phase [0-9]" | List phases found |
|
|
297
|
-
| Agent invocations | Contains "/agents:" or "agent" references | List agents used |
|
|
298
|
-
| Decision gates | Contains "PASS", "FAIL", "STOP", "Continue", "proceed" | [OK]/[X] |
|
|
299
|
-
| Summary format | Contains "Summary", "Report", or "Result" | [OK]/[X] |
|
|
300
|
-
|
|
301
|
-
**Depends on**: pattern-analyzer
|
|
302
|
-
|
|
303
|
-
---
|
|
304
|
-
|
|
305
|
-
### Phase 3: Prompt Quality Best Practices
|
|
306
|
-
**Commands**: prompt-quality@1.0.0
|
|
307
|
-
|
|
308
|
-
**Invoke via Task tool:**
|
|
309
|
-
```
|
|
310
|
-
Task(
|
|
311
|
-
subagent_type: "prompt-quality",
|
|
312
|
-
prompt: "[validator:prompt-quality] Validate {TARGET_DIRECTORY}. Return structured JSON OUTPUT.",
|
|
313
|
-
description: "Prompt Quality Validator"
|
|
314
|
-
)
|
|
315
|
-
```
|
|
316
|
-
|
|
317
|
-
**Gate**: threshold >= 70, on fail: warn
|
|
318
|
-
|
|
319
|
-
**Focus**:
|
|
320
|
-
- Clarity: Vague language → specific alternatives
|
|
321
|
-
- Structure: Missing sections → template additions
|
|
322
|
-
- Completeness: Missing edge cases → defined behaviors
|
|
323
|
-
- Effectiveness: Subjective criteria → objective measures
|
|
324
|
-
|
|
325
|
-
**Capture for tracker**: Best practices analysis with specific rewrite suggestions.
|
|
326
|
-
|
|
327
|
-
**If failing**: Review improvement suggestions. Prompt is functional but could be more effective.
|
|
328
|
-
|
|
329
|
-
**Decision criteria**:
|
|
330
|
-
- STRONG (✅): Score ≥75 AND no high-priority findings
|
|
331
|
-
- ADEQUATE (⚠️): Score 60-74
|
|
332
|
-
- WEAK (❌): Score <60
|
|
333
|
-
|
|
334
|
-
**Depends on**: prompt-engineer
|
|
335
|
-
|
|
336
|
-
---
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
---
|
|
340
|
-
|
|
341
|
-
## Summary Report
|
|
342
|
-
|
|
343
|
-
After all phases complete, summarize:
|
|
344
|
-
|
|
345
|
-
```
|
|
346
|
-
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
347
|
-
SUMMARY
|
|
348
|
-
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
349
|
-
|
|
350
|
-
Target: [path]
|
|
351
|
-
Run: [N]
|
|
352
|
-
|
|
353
|
-
┌─────────────────────┬────────┬────────────┐
|
|
354
|
-
│ Agent │ Score │ Status │
|
|
355
|
-
├─────────────────────┼────────┼────────────┤
|
|
356
|
-
│ ... │ [X]/100│ ✅/❌/⏭️ │
|
|
357
|
-
└─────────────────────┴────────┴────────────┘
|
|
358
|
-
|
|
359
|
-
```
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
### Scoring
|
|
363
|
-
|
|
364
|
-
**Method**: weighted_average
|
|
365
|
-
|
|
366
|
-
| Phase | Weight |
|
|
367
|
-
|-------|--------|
|
|
368
|
-
| pattern-analyzer | 15% |
|
|
369
|
-
| prompt-engineer | 55% |
|
|
370
|
-
| prompt-quality | 30% |
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
## Output: Consolidated Report
|
|
374
|
-
|
|
375
|
-
```
|
|
376
|
-
+=============================================================================+
|
|
377
|
-
| PROMPT AUDIT REPORT |
|
|
378
|
-
+=============================================================================+
|
|
379
|
-
|
|
380
|
-
File: $ARGUMENTS
|
|
381
|
-
Type: {agent | command | workflow}
|
|
382
|
-
Name: {extracted name}
|
|
383
|
-
|
|
384
|
-
==============================================================================
|
|
385
|
-
|
|
386
|
-
PHASE 0: ECOSYSTEM PATTERN ANALYSIS
|
|
387
|
-
|
|
388
|
-
Ecosystem Inventory:
|
|
389
|
-
- Agents: [N]
|
|
390
|
-
- Commands: [N]
|
|
391
|
-
- Workflows: [N]
|
|
392
|
-
|
|
393
|
-
Ecosystem Conventions:
|
|
394
|
-
- Threshold standard: >=[X] ([N]% of agents)
|
|
395
|
-
- Decision pair: [KEYWORD_A]/[KEYWORD_B]
|
|
396
|
-
- Required sections: [list]
|
|
397
|
-
- Point distribution: [pattern]
|
|
398
|
-
|
|
399
|
-
Consistency Check:
|
|
400
|
-
{If target diverges from conventions:}
|
|
401
|
-
- Target uses [X] but ecosystem standard is [Y]
|
|
402
|
-
- Consider aligning for consistency
|
|
403
|
-
|
|
404
|
-
{If target follows conventions:}
|
|
405
|
-
- [OK] Target aligns with ecosystem conventions
|
|
406
|
-
|
|
407
|
-
Status: [OK INSIGHTFUL | WARNING INCOMPLETE]
|
|
408
|
-
|
|
409
|
-
-------------------------------------------------------------------------------
|
|
410
|
-
|
|
411
|
-
PHASE 1: PROMPT ENGINEER VALIDATION
|
|
412
|
-
|
|
413
|
-
Score: [X]/100
|
|
414
|
-
|
|
415
|
-
Clarity & Specificity: [X]/25
|
|
416
|
-
Structure: [X]/20
|
|
417
|
-
Completeness: [X]/25
|
|
418
|
-
Effectiveness: [X]/20
|
|
419
|
-
Consistency: [X]/10
|
|
420
|
-
|
|
421
|
-
Status: [DEPLOY | REVISE]
|
|
422
|
-
|
|
423
|
-
-------------------------------------------------------------------------------
|
|
424
|
-
|
|
425
|
-
PHASE 2: TYPE-SPECIFIC CHECKS
|
|
426
|
-
|
|
427
|
-
Type: {artifact_type}
|
|
428
|
-
|
|
429
|
-
Required Elements:
|
|
430
|
-
[OK] {present element}
|
|
431
|
-
[OK] {present element}
|
|
432
|
-
[X] {missing element}
|
|
433
|
-
|
|
434
|
-
Convention Compliance:
|
|
435
|
-
| Element | Found | Expected | Status |
|
|
436
|
-
|---------|-------|----------|--------|
|
|
437
|
-
| Decision keywords | X | Y | OK/X |
|
|
438
|
-
| Threshold format | X | Y | OK/X |
|
|
439
|
-
| Scoring format | X | Y | OK/X |
|
|
440
|
-
|
|
441
|
-
-------------------------------------------------------------------------------
|
|
442
|
-
|
|
443
|
-
PHASE 3: IMPROVEMENT ANALYSIS
|
|
444
|
-
|
|
445
|
-
CRITICAL (Must Fix):
|
|
446
|
-
1. [Issue]: Line [N]
|
|
447
|
-
Problem: {why it matters}
|
|
448
|
-
Fix: {specific rewrite}
|
|
449
|
-
|
|
450
|
-
RECOMMENDED (Should Fix):
|
|
451
|
-
1. [Issue]: Line [N]
|
|
452
|
-
Problem: {impact}
|
|
453
|
-
Fix: {suggestion}
|
|
454
|
-
|
|
455
|
-
SUGGESTIONS (Consider):
|
|
456
|
-
1. [Enhancement]: {description}
|
|
457
|
-
|
|
458
|
-
-------------------------------------------------------------------------------
|
|
459
|
-
|
|
460
|
-
IMPROVEMENT EXAMPLES
|
|
461
|
-
|
|
462
|
-
### Example 1: {issue type}
|
|
463
|
-
|
|
464
|
-
**Location:** Line [N]
|
|
465
|
-
|
|
466
|
-
**Current:**
|
|
467
|
-
{current text}
|
|
468
|
-
|
|
469
|
-
**Improved:**
|
|
470
|
-
{better text}
|
|
471
|
-
|
|
472
|
-
**Why better:** {explanation}
|
|
473
|
-
|
|
474
|
-
-------------------------------------------------------------------------------
|
|
475
|
-
|
|
476
|
-
PHASE 4: REFACTORED DRAFT
|
|
477
|
-
|
|
478
|
-
{If score < 75, include full refactored prompt}
|
|
479
|
-
{If score >= 75, show "Not required - prompt passes validation"}
|
|
480
|
-
|
|
481
|
-
===============================================================================
|
|
482
|
-
|
|
483
|
-
AUDIT DECISION
|
|
484
|
-
|
|
485
|
-
[APPROVED - Ready for use]
|
|
486
|
-
No changes required. Prompt meets project standards.
|
|
487
|
-
|
|
488
|
-
OR
|
|
489
|
-
|
|
490
|
-
[IMPROVEMENTS AVAILABLE - Optional enhancements]
|
|
491
|
-
Prompt is functional but could be improved.
|
|
492
|
-
See SUGGESTIONS section above.
|
|
493
|
-
|
|
494
|
-
OR
|
|
495
|
-
|
|
496
|
-
[REVISION REQUIRED - Must fix before deployment]
|
|
497
|
-
Critical issues found. See CRITICAL section.
|
|
498
|
-
Refactored draft provided in Phase 4.
|
|
499
|
-
|
|
500
|
-
===============================================================================
|
|
501
|
-
|
|
502
|
-
NEXT STEPS
|
|
503
|
-
|
|
504
|
-
{If APPROVED}
|
|
505
|
-
- No action required
|
|
506
|
-
- Consider suggestions for future iterations
|
|
507
|
-
|
|
508
|
-
{If IMPROVEMENTS AVAILABLE}
|
|
509
|
-
- Review suggestions
|
|
510
|
-
- Apply changes that add value
|
|
511
|
-
- Re-run audit to verify (optional)
|
|
512
|
-
|
|
513
|
-
{If REVISION REQUIRED}
|
|
514
|
-
1. Apply critical fixes from Phase 3
|
|
515
|
-
2. OR use refactored draft from Phase 4
|
|
516
|
-
3. Re-run: /workflows:prompt-audit $ARGUMENTS
|
|
517
|
-
4. Iterate until APPROVED
|
|
518
|
-
|
|
519
|
-
+=============================================================================+
|
|
520
|
-
|
|
521
|
-
```
|
|
522
|
-
|
|
523
|
-
### Decision Criteria
|
|
524
|
-
|
|
525
|
-
| Score | Issues | Decision |
|
|
526
|
-
|-------|--------|----------|
|
|
527
|
-
| >=85 | None critical | [OK] APPROVED |
|
|
528
|
-
| 75-84 | None critical | [FIX] IMPROVEMENTS AVAILABLE |
|
|
529
|
-
| <75 OR critical issues | Any | [LOOP] REVISION REQUIRED |
|
|
530
|
-
|
|
531
|
-
**[LOOP] REVISION REQUIRED Auto-Triggers:**
|
|
532
|
-
- Undefined or vague mission statement
|
|
533
|
-
- No output format specification
|
|
534
|
-
- Conflicting instructions
|
|
535
|
-
- Missing scoring/threshold for validation agents
|
|
536
|
-
- Decision criteria are purely subjective
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
---
|
|
540
|
-
|
|
541
|
-
## Final Phase: Outputs (MANDATORY)
|
|
542
|
-
|
|
543
|
-
**This phase runs regardless of pass/fail status.** All agent recommendations must be captured.
|
|
544
|
-
|
|
545
|
-
### Artifacts
|
|
546
|
-
|
|
547
|
-
**features-list** (markdown):
|
|
548
|
-
Consolidated recommendations from all phases with scoring breakdown, category analysis, and actionable improvement items for tracker persistence.
|
|
549
|
-
|
|
550
|
-
Generate a timestamp for the filename:
|
|
551
|
-
|
|
552
|
-
```bash
|
|
553
|
-
TIMESTAMP=$(date +%Y-%m-%dT%H-%M-%S)
|
|
554
|
-
echo "Timestamp: $TIMESTAMP"
|
|
555
|
-
```
|
|
556
|
-
|
|
557
|
-
Write file to: `docs/{{ features_file }}`
|
|
558
|
-
|
|
559
|
-
**Content template:**
|
|
560
|
-
|
|
561
|
-
# Prompt Audit: {{ file_name }}
|
|
562
|
-
|
|
563
|
-
**Date**: {{ timestamp }}
|
|
564
|
-
**Target**: {{ file_path }}
|
|
565
|
-
**Type**: {{ artifact_type }}
|
|
566
|
-
|
|
567
|
-
## Scores
|
|
568
|
-
|
|
569
|
-
| Phase | Score | Status |
|
|
570
|
-
|-------|-------|--------|
|
|
571
|
-
| Pattern Analyzer | {score}/100 | {PASS/WARN} |
|
|
572
|
-
| Prompt Engineer | {score}/100 | {PASS/FAIL} |
|
|
573
|
-
| Prompt Quality | {score}/100 | {PASS/WARN} |
|
|
574
|
-
| **Weighted Average** | **{score}/100** | |
|
|
575
|
-
|
|
576
|
-
## Recommendations
|
|
577
|
-
|
|
578
|
-
### Critical (fix before deployment)
|
|
579
|
-
- [ ] {recommendation with file:line reference}
|
|
580
|
-
|
|
581
|
-
### Suggested (review before deployment)
|
|
582
|
-
- [ ] {recommendation with file:line reference}
|
|
583
|
-
|
|
584
|
-
### Backlog (post-deployment)
|
|
585
|
-
- [ ] {recommendation}
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
**refactored-draft** (markdown):
|
|
589
|
-
A refactored version of the target prompt with all critical fixes applied from Phases 0-2. Generated only when prompt-engineer score is below deployment threshold.
|
|
590
|
-
**Condition**: Generated only when `phases.prompt-engineer.score < 75`
|
|
591
|
-
|
|
592
|
-
Generate a timestamp for the filename:
|
|
593
|
-
|
|
594
|
-
```bash
|
|
595
|
-
TIMESTAMP=$(date +%Y-%m-%dT%H-%M-%S)
|
|
596
|
-
echo "Timestamp: $TIMESTAMP"
|
|
597
|
-
```
|
|
598
|
-
|
|
599
|
-
Write file to: `docs/{{ file_name }}-refactored.md`
|
|
600
|
-
|
|
601
|
-
#### Granularity Rules
|
|
602
|
-
|
|
603
|
-
**DO NOT consolidate multiple findings into single entries.** The tracker handles deduplication via fingerprinting. Save ALL raw findings:
|
|
604
|
-
|
|
605
|
-
| Agent Reports | You Save |
|
|
606
|
-
|---------------|----------|
|
|
607
|
-
| "N+1 pattern in 14 locations" | 14 separate recommendations, one per file:line |
|
|
608
|
-
| "Missing null checks on 8 .find() calls" | 8 separate recommendations |
|
|
609
|
-
| "6 endpoints missing from docs" | 6 separate recommendations |
|
|
610
|
-
|
|
611
|
-
**Rule:** If validator output has a file:line reference, it becomes a separate recommendation entry.
|
|
612
|
-
|
|
613
|
-
### Save to Tracker (MANDATORY — Always Save First)
|
|
614
|
-
|
|
615
|
-
**CRITICAL: Always save to the tracker. Never skip this step.**
|
|
616
|
-
|
|
617
|
-
After writing the markdown file, save results via `mcp__uluops-tracker__save_features_list`:
|
|
618
|
-
|
|
619
|
-
```
|
|
620
|
-
mcp__uluops-tracker__save_features_list({
|
|
621
|
-
project: claude-agent-workflows,
|
|
622
|
-
workflow_type: "prompt-audit",
|
|
623
|
-
timestamp: {ISO8601 timestamp},
|
|
624
|
-
validators: [
|
|
625
|
-
{
|
|
626
|
-
"name": "{Agent Name}",
|
|
627
|
-
"score": {numeric},
|
|
628
|
-
"status": "{PASS|FAIL|SKIP}",
|
|
629
|
-
"model": "{haiku|sonnet|opus}"
|
|
630
|
-
}
|
|
631
|
-
// ... one entry per agent
|
|
632
|
-
],
|
|
633
|
-
recommendations: [
|
|
634
|
-
{
|
|
635
|
-
"validator": "{agent-name}",
|
|
636
|
-
"title": "{short title}",
|
|
637
|
-
"priority": "{critical|suggested|backlog}",
|
|
638
|
-
"severity": "{critical|high|medium|low|info}",
|
|
639
|
-
"description": "{details}",
|
|
640
|
-
"file_path": "{path}",
|
|
641
|
-
"line_number": {number}
|
|
642
|
-
}
|
|
643
|
-
// ... one entry per recommendation
|
|
644
|
-
]
|
|
645
|
-
})
|
|
646
|
-
```
|
|
647
|
-
|
|
648
|
-
**Priority mapping:**
|
|
649
|
-
- Blocking (fix before ship) → `"critical"`
|
|
650
|
-
- Warnings (review before ship) → `"suggested"`
|
|
651
|
-
- Post-ship/backlog items → `"backlog"`
|
|
652
|
-
|
|
653
|
-
### Post-Save Verification
|
|
654
|
-
|
|
655
|
-
After saving, verify the data was persisted correctly. **These are warnings, not blockers.**
|
|
656
|
-
|
|
657
|
-
**Query validation-tracker and compare to tracker_payload_length**
|
|
658
|
-
|
|
659
|
-
- On mismatch: **warn** (do NOT block or re-attempt)
|
|
660
|
-
- Saved count differs from payload - some recommendations may not have persisted.
|
|
661
|
-
|
|
662
|
-
**Verification procedure:**
|
|
663
|
-
|
|
664
|
-
1. Query the tracker for the saved run
|
|
665
|
-
2. Compare saved recommendation count against your payload count
|
|
666
|
-
3. If counts differ, log the discrepancy as a note — cross-phase deduplication is expected when multiple validators flag the same issue
|
|
667
|
-
4. **Proceed regardless** — the save already succeeded
|
|
668
|
-
|
|
669
|
-
|
|
670
|
-
---
|
|
671
|
-
|
|
672
|
-
|
|
673
|
-
|
|
674
|
-
|
|
675
|
-
|
|
676
|
-
---
|
|
677
|
-
|
|
678
|
-
## Iteration Pattern
|
|
679
|
-
|
|
680
|
-
```
|
|
681
|
-
Existing Prompt
|
|
682
|
-
│
|
|
683
|
-
▼
|
|
684
|
-
/workflows:prompt-audit
|
|
685
|
-
│
|
|
686
|
-
├── APPROVED ──────▶ Done (optional improvements noted)
|
|
687
|
-
│
|
|
688
|
-
├── IMPROVEMENTS ──▶ Apply suggestions ──▶ (optional re-audit)
|
|
689
|
-
│
|
|
690
|
-
└── REVISION ──────▶ Apply fixes OR use refactored draft
|
|
691
|
-
│
|
|
692
|
-
└──▶ /workflows:prompt-audit (repeat)
|
|
693
|
-
|
|
694
|
-
```
|
|
695
|
-
|
|
696
|
-
**Typical iterations**:
|
|
697
|
-
- Well-written prompt: 1 run (APPROVED or IMPROVEMENTS)
|
|
698
|
-
- Prompt with issues: 2-3 runs
|
|
699
|
-
- Legacy or undocumented prompt: 2-4 runs
|
|
700
|
-
|
|
701
|
-
**Report behavior across iterations**:
|
|
702
|
-
- Each run creates a features list documenting current state and recommendations
|
|
703
|
-
- Previous runs are preserved for audit trail
|
|
704
|
-
- Resolved items from previous runs will not appear if agents no longer flag them
|
|
705
|
-
- Tracker detects regressions when previously fixed issues reappear
|
|
706
|
-
|
|
707
|
-
---
|
|
708
|
-
|
|
709
|
-
## Quick Reference
|
|
710
|
-
|
|
711
|
-
| Agent | Threshold | Group |
|
|
712
|
-
|-------|-----------|-------|
|
|
713
|
-
| Ecosystem Pattern Analysis | threshold >= 50, on fail: warn | 1 |
|
|
714
|
-
| Prompt Engineer Validation | threshold >= 75, on fail: stop | 2 |
|
|
715
|
-
| Prompt Quality Best Practices | threshold >= 70, on fail: warn | 3 |
|
|
716
|
-
|
|
717
|
-
|
|
718
|
-
---
|
|
719
|
-
|
|
720
|
-
## Troubleshooting
|
|
721
|
-
|
|
722
|
-
### Phase 3 suggestions conflict with each other
|
|
723
|
-
|
|
724
|
-
The prompt-quality-validator generates suggestions independently. If suggestions conflict:
|
|
725
|
-
1. Prioritize CRITICAL over RECOMMENDED over SUGGESTIONS
|
|
726
|
-
2. When two suggestions target the same section, choose the more specific one
|
|
727
|
-
3. Use your judgment on which improves clarity most
|
|
728
|
-
|
|
729
|
-
|
|
730
|
-
### Refactored draft is too different from original
|
|
731
|
-
|
|
732
|
-
The refactored draft prioritizes correctness over minimal changes. If you prefer incremental updates:
|
|
733
|
-
1. Apply only the CRITICAL fixes manually
|
|
734
|
-
2. Re-audit to verify those fixes
|
|
735
|
-
3. Then consider RECOMMENDED items one by one
|
|
736
|
-
|
|
737
|
-
|
|
738
|
-
### Type detection is wrong
|
|
739
|
-
|
|
740
|
-
Override by specifying in your prompt:
|
|
741
|
-
"Treat this as an agent definition and audit accordingly."
|
|
742
|
-
/workflows:prompt-audit agents/my-prompt.md
|
|
743
|
-
|
|
744
|
-
|
|
745
|
-
### Score seems too low for a working prompt
|
|
746
|
-
|
|
747
|
-
The audit is strict because prompts compound errors. A 65-score prompt may work but produces inconsistent results. The refactored draft shows what a higher-scoring version looks like.
|
|
748
|
-
|
|
749
|
-
|
|
750
|
-
### Pattern analyzer shows INCOMPLETE
|
|
751
|
-
|
|
752
|
-
This happens when the ecosystem has fewer than 5 agents. The audit proceeds with generic conventions instead of project-specific patterns. Results are still valid but less context-aware.
|
|
753
|
-
|
|
754
|
-
|