@crewpilot/agent 2.0.0 → 3.0.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/README.md +131 -131
- package/dist-npm/cli.js +5 -5
- package/dist-npm/index.js +100 -100
- package/package.json +69 -69
- package/prompts/agent.md +282 -282
- package/prompts/copilot-instructions.md +36 -36
- package/prompts/{catalyst.config.json → crewpilot.config.json} +72 -72
- package/prompts/skills/assure-code-quality/SKILL.md +112 -112
- package/prompts/skills/assure-pr-intelligence/SKILL.md +148 -148
- package/prompts/skills/assure-review-functional/SKILL.md +114 -114
- package/prompts/skills/assure-review-standards/SKILL.md +106 -106
- package/prompts/skills/assure-threat-model/SKILL.md +182 -182
- package/prompts/skills/assure-vulnerability-scan/SKILL.md +146 -146
- package/prompts/skills/autopilot-meeting/SKILL.md +434 -434
- package/prompts/skills/autopilot-worker/SKILL.md +737 -737
- package/prompts/skills/daily-digest/SKILL.md +188 -188
- package/prompts/skills/deliver-change-management/SKILL.md +132 -132
- package/prompts/skills/deliver-deploy-guard/SKILL.md +144 -144
- package/prompts/skills/deliver-doc-governance/SKILL.md +130 -130
- package/prompts/skills/engineer-feature-builder/SKILL.md +270 -270
- package/prompts/skills/engineer-root-cause-analysis/SKILL.md +150 -150
- package/prompts/skills/engineer-test-first/SKILL.md +148 -148
- package/prompts/skills/insights-knowledge-base/SKILL.md +202 -202
- package/prompts/skills/insights-pattern-detection/SKILL.md +142 -142
- package/prompts/skills/strategize-architecture-planner/SKILL.md +141 -141
- package/prompts/skills/strategize-solution-design/SKILL.md +118 -118
- package/scripts/postinstall.js +108 -108
|
@@ -1,144 +1,144 @@
|
|
|
1
|
-
# Deploy Guard
|
|
2
|
-
|
|
3
|
-
> **Pillar**: Deliver | **ID**: `deliver-deploy-guard`
|
|
4
|
-
|
|
5
|
-
## Purpose
|
|
6
|
-
|
|
7
|
-
Pre-deployment safety validation. Runs a structured checklist of quality gates before any code ships — catches what CI/CD pipelines often miss. Acts as the last line of defense.
|
|
8
|
-
|
|
9
|
-
## Activation Triggers
|
|
10
|
-
|
|
11
|
-
- "ready to deploy?", "pre-deploy check", "can I ship this?"
|
|
12
|
-
- "safety check", "deploy guard", "go/no-go"
|
|
13
|
-
- Automatically chained after `change-management` when `phase_gates` is `strict`
|
|
14
|
-
|
|
15
|
-
## Methodology
|
|
16
|
-
|
|
17
|
-
### Process Flow
|
|
18
|
-
|
|
19
|
-
```dot
|
|
20
|
-
digraph deploy_guard {
|
|
21
|
-
rankdir=TB;
|
|
22
|
-
node [shape=box];
|
|
23
|
-
|
|
24
|
-
g1 [label="Gate 1\nCode Quality"];
|
|
25
|
-
g2 [label="Gate 2\nTest Integrity"];
|
|
26
|
-
g3 [label="Gate 3\nSecurity"];
|
|
27
|
-
g4 [label="Gate 4\nConfiguration"];
|
|
28
|
-
g5 [label="Gate 5\nBreaking Changes"];
|
|
29
|
-
g6 [label="Gate 6\nOperational Readiness"];
|
|
30
|
-
verdict [label="Verdict", shape=diamond, style=filled, fillcolor="#ffcccc"];
|
|
31
|
-
go [label="GO \u2705", shape=doublecircle, style=filled, fillcolor="#ccffcc"];
|
|
32
|
-
nogo [label="NO-GO \u274c", shape=octagon, style=filled, fillcolor="#ff9999"];
|
|
33
|
-
conditional [label="CONDITIONAL \u26a0\ufe0f", shape=box, style=filled, fillcolor="#ffffcc"];
|
|
34
|
-
|
|
35
|
-
g1 -> g2;
|
|
36
|
-
g2 -> g3;
|
|
37
|
-
g3 -> g4;
|
|
38
|
-
g4 -> g5;
|
|
39
|
-
g5 -> g6;
|
|
40
|
-
g6 -> verdict;
|
|
41
|
-
verdict -> go [label="all pass"];
|
|
42
|
-
verdict -> nogo [label="critical blocker"];
|
|
43
|
-
verdict -> conditional [label="non-critical\nwarnings"];
|
|
44
|
-
}
|
|
45
|
-
```
|
|
46
|
-
|
|
47
|
-
### Gate 1 — Code Quality
|
|
48
|
-
- [ ] All linting passes (zero errors)
|
|
49
|
-
- [ ] No `TODO`/`FIXME`/`HACK` in files changed since last deploy
|
|
50
|
-
- [ ] No `console.log`/`print`/debug statements in production paths
|
|
51
|
-
- [ ] No commented-out code blocks
|
|
52
|
-
- Run: `
|
|
53
|
-
|
|
54
|
-
### Gate 2 — Test Integrity
|
|
55
|
-
- [ ] All tests pass
|
|
56
|
-
- [ ] Test coverage meets minimum threshold
|
|
57
|
-
- [ ] No skipped tests (`.skip`, `@disabled`, `@pytest.mark.skip`)
|
|
58
|
-
- [ ] No test files with zero assertions
|
|
59
|
-
- Run: `
|
|
60
|
-
|
|
61
|
-
### Gate 3 — Security
|
|
62
|
-
- [ ] No new vulnerabilities from `vulnerability-scan`
|
|
63
|
-
- [ ] No hardcoded secrets (API keys, passwords, tokens)
|
|
64
|
-
- [ ] Dependencies have no critical CVEs
|
|
65
|
-
- [ ] No `eval()`, `exec()`, `dangerouslySetInnerHTML` without sanitization
|
|
66
|
-
- Run: `terminal` for `npm audit` / `pip audit` / equivalent
|
|
67
|
-
|
|
68
|
-
### Gate 4 — Configuration
|
|
69
|
-
- [ ] Environment variables documented and present
|
|
70
|
-
- [ ] No development-only configuration in production paths
|
|
71
|
-
- [ ] Database migrations are forward-compatible and reversible
|
|
72
|
-
- [ ] Feature flags set correctly for this deployment
|
|
73
|
-
|
|
74
|
-
### Gate 5 — Breaking Changes
|
|
75
|
-
- [ ] API contract changes are backward-compatible (or versioned)
|
|
76
|
-
- [ ] Database schema changes are additive (no column drops without migration)
|
|
77
|
-
- [ ] No removed public exports/endpoints without deprecation period
|
|
78
|
-
- [ ] Breaking changes documented in CHANGELOG
|
|
79
|
-
|
|
80
|
-
### Gate 6 — Operational Readiness
|
|
81
|
-
- [ ] Health check endpoint exists and responds
|
|
82
|
-
- [ ] Logging is adequate for debugging production issues
|
|
83
|
-
- [ ] Error handling returns appropriate HTTP status codes
|
|
84
|
-
- [ ] Rate limiting is configured for public endpoints
|
|
85
|
-
|
|
86
|
-
### Verdict
|
|
87
|
-
|
|
88
|
-
<HARD-GATE>
|
|
89
|
-
If the verdict is NO-GO, do NOT proceed with deployment, merge, or marking as ready.
|
|
90
|
-
All critical blockers MUST be resolved and gates re-run before proceeding.
|
|
91
|
-
Do NOT downgrade a NO-GO to CONDITIONAL without fixing the underlying issue.
|
|
92
|
-
</HARD-GATE>
|
|
93
|
-
|
|
94
|
-
Produce a clear GO / NO-GO / CONDITIONAL decision:
|
|
95
|
-
- **GO**: All gates pass
|
|
96
|
-
- **CONDITIONAL**: Non-critical issues found — list what to fix or accept
|
|
97
|
-
- **NO-GO**: Critical blocker found — must fix before deployment
|
|
98
|
-
|
|
99
|
-
## Tools Required
|
|
100
|
-
|
|
101
|
-
- `terminal` — Run tests, linters, audit tools
|
|
102
|
-
- `codebase` — Scan for anti-patterns, secrets, debug statements
|
|
103
|
-
- `
|
|
104
|
-
- `
|
|
105
|
-
- `
|
|
106
|
-
|
|
107
|
-
## Output Format
|
|
108
|
-
|
|
109
|
-
```
|
|
110
|
-
## [
|
|
111
|
-
|
|
112
|
-
### Gate Results
|
|
113
|
-
|
|
114
|
-
| Gate | Status | Issues |
|
|
115
|
-
|---|---|---|
|
|
116
|
-
| Code Quality | {pass/warn/fail} | {count} |
|
|
117
|
-
| Test Integrity | {pass/warn/fail} | {count} |
|
|
118
|
-
| Security | {pass/warn/fail} | {count} |
|
|
119
|
-
| Configuration | {pass/warn/fail} | {count} |
|
|
120
|
-
| Breaking Changes | {pass/warn/fail} | {count} |
|
|
121
|
-
| Operational Readiness | {pass/warn/fail} | {count} |
|
|
122
|
-
|
|
123
|
-
### Blockers (if any)
|
|
124
|
-
{critical issues that block deployment}
|
|
125
|
-
|
|
126
|
-
### Warnings (if any)
|
|
127
|
-
{non-critical issues to be aware of}
|
|
128
|
-
|
|
129
|
-
### Verdict: {GO / NO-GO / CONDITIONAL}
|
|
130
|
-
{reasoning}
|
|
131
|
-
```
|
|
132
|
-
|
|
133
|
-
## Chains To
|
|
134
|
-
|
|
135
|
-
- `vulnerability-scan` — If security gate needs deeper analysis
|
|
136
|
-
- `change-management` — Fix and recommit if issues found
|
|
137
|
-
- `knowledge-base` — Record deployment decision and any exceptions made
|
|
138
|
-
|
|
139
|
-
## Anti-Patterns
|
|
140
|
-
|
|
141
|
-
- Do NOT always say GO — be honest about risks
|
|
142
|
-
- Do NOT block on style issues — only on functional and security concerns
|
|
143
|
-
- Do NOT check gates that aren't relevant (no DB gate for a pure frontend change)
|
|
144
|
-
- Do NOT skip the verdict — always provide a clear decision
|
|
1
|
+
# Deploy Guard
|
|
2
|
+
|
|
3
|
+
> **Pillar**: Deliver | **ID**: `deliver-deploy-guard`
|
|
4
|
+
|
|
5
|
+
## Purpose
|
|
6
|
+
|
|
7
|
+
Pre-deployment safety validation. Runs a structured checklist of quality gates before any code ships — catches what CI/CD pipelines often miss. Acts as the last line of defense.
|
|
8
|
+
|
|
9
|
+
## Activation Triggers
|
|
10
|
+
|
|
11
|
+
- "ready to deploy?", "pre-deploy check", "can I ship this?"
|
|
12
|
+
- "safety check", "deploy guard", "go/no-go"
|
|
13
|
+
- Automatically chained after `change-management` when `phase_gates` is `strict`
|
|
14
|
+
|
|
15
|
+
## Methodology
|
|
16
|
+
|
|
17
|
+
### Process Flow
|
|
18
|
+
|
|
19
|
+
```dot
|
|
20
|
+
digraph deploy_guard {
|
|
21
|
+
rankdir=TB;
|
|
22
|
+
node [shape=box];
|
|
23
|
+
|
|
24
|
+
g1 [label="Gate 1\nCode Quality"];
|
|
25
|
+
g2 [label="Gate 2\nTest Integrity"];
|
|
26
|
+
g3 [label="Gate 3\nSecurity"];
|
|
27
|
+
g4 [label="Gate 4\nConfiguration"];
|
|
28
|
+
g5 [label="Gate 5\nBreaking Changes"];
|
|
29
|
+
g6 [label="Gate 6\nOperational Readiness"];
|
|
30
|
+
verdict [label="Verdict", shape=diamond, style=filled, fillcolor="#ffcccc"];
|
|
31
|
+
go [label="GO \u2705", shape=doublecircle, style=filled, fillcolor="#ccffcc"];
|
|
32
|
+
nogo [label="NO-GO \u274c", shape=octagon, style=filled, fillcolor="#ff9999"];
|
|
33
|
+
conditional [label="CONDITIONAL \u26a0\ufe0f", shape=box, style=filled, fillcolor="#ffffcc"];
|
|
34
|
+
|
|
35
|
+
g1 -> g2;
|
|
36
|
+
g2 -> g3;
|
|
37
|
+
g3 -> g4;
|
|
38
|
+
g4 -> g5;
|
|
39
|
+
g5 -> g6;
|
|
40
|
+
g6 -> verdict;
|
|
41
|
+
verdict -> go [label="all pass"];
|
|
42
|
+
verdict -> nogo [label="critical blocker"];
|
|
43
|
+
verdict -> conditional [label="non-critical\nwarnings"];
|
|
44
|
+
}
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
### Gate 1 — Code Quality
|
|
48
|
+
- [ ] All linting passes (zero errors)
|
|
49
|
+
- [ ] No `TODO`/`FIXME`/`HACK` in files changed since last deploy
|
|
50
|
+
- [ ] No `console.log`/`print`/debug statements in production paths
|
|
51
|
+
- [ ] No commented-out code blocks
|
|
52
|
+
- Run: `crewpilot_metrics_complexity` on changed files — flag any high-complexity additions
|
|
53
|
+
|
|
54
|
+
### Gate 2 — Test Integrity
|
|
55
|
+
- [ ] All tests pass
|
|
56
|
+
- [ ] Test coverage meets minimum threshold
|
|
57
|
+
- [ ] No skipped tests (`.skip`, `@disabled`, `@pytest.mark.skip`)
|
|
58
|
+
- [ ] No test files with zero assertions
|
|
59
|
+
- Run: `crewpilot_metrics_coverage` to validate
|
|
60
|
+
|
|
61
|
+
### Gate 3 — Security
|
|
62
|
+
- [ ] No new vulnerabilities from `vulnerability-scan`
|
|
63
|
+
- [ ] No hardcoded secrets (API keys, passwords, tokens)
|
|
64
|
+
- [ ] Dependencies have no critical CVEs
|
|
65
|
+
- [ ] No `eval()`, `exec()`, `dangerouslySetInnerHTML` without sanitization
|
|
66
|
+
- Run: `terminal` for `npm audit` / `pip audit` / equivalent
|
|
67
|
+
|
|
68
|
+
### Gate 4 — Configuration
|
|
69
|
+
- [ ] Environment variables documented and present
|
|
70
|
+
- [ ] No development-only configuration in production paths
|
|
71
|
+
- [ ] Database migrations are forward-compatible and reversible
|
|
72
|
+
- [ ] Feature flags set correctly for this deployment
|
|
73
|
+
|
|
74
|
+
### Gate 5 — Breaking Changes
|
|
75
|
+
- [ ] API contract changes are backward-compatible (or versioned)
|
|
76
|
+
- [ ] Database schema changes are additive (no column drops without migration)
|
|
77
|
+
- [ ] No removed public exports/endpoints without deprecation period
|
|
78
|
+
- [ ] Breaking changes documented in CHANGELOG
|
|
79
|
+
|
|
80
|
+
### Gate 6 — Operational Readiness
|
|
81
|
+
- [ ] Health check endpoint exists and responds
|
|
82
|
+
- [ ] Logging is adequate for debugging production issues
|
|
83
|
+
- [ ] Error handling returns appropriate HTTP status codes
|
|
84
|
+
- [ ] Rate limiting is configured for public endpoints
|
|
85
|
+
|
|
86
|
+
### Verdict
|
|
87
|
+
|
|
88
|
+
<HARD-GATE>
|
|
89
|
+
If the verdict is NO-GO, do NOT proceed with deployment, merge, or marking as ready.
|
|
90
|
+
All critical blockers MUST be resolved and gates re-run before proceeding.
|
|
91
|
+
Do NOT downgrade a NO-GO to CONDITIONAL without fixing the underlying issue.
|
|
92
|
+
</HARD-GATE>
|
|
93
|
+
|
|
94
|
+
Produce a clear GO / NO-GO / CONDITIONAL decision:
|
|
95
|
+
- **GO**: All gates pass
|
|
96
|
+
- **CONDITIONAL**: Non-critical issues found — list what to fix or accept
|
|
97
|
+
- **NO-GO**: Critical blocker found — must fix before deployment
|
|
98
|
+
|
|
99
|
+
## Tools Required
|
|
100
|
+
|
|
101
|
+
- `terminal` — Run tests, linters, audit tools
|
|
102
|
+
- `codebase` — Scan for anti-patterns, secrets, debug statements
|
|
103
|
+
- `crewpilot_metrics_coverage` — Coverage report
|
|
104
|
+
- `crewpilot_metrics_complexity` — Complexity scores
|
|
105
|
+
- `crewpilot_git_diff` — Changes since last deploy/tag
|
|
106
|
+
|
|
107
|
+
## Output Format
|
|
108
|
+
|
|
109
|
+
```
|
|
110
|
+
## [CrewPilot → Deploy Guard]
|
|
111
|
+
|
|
112
|
+
### Gate Results
|
|
113
|
+
|
|
114
|
+
| Gate | Status | Issues |
|
|
115
|
+
|---|---|---|
|
|
116
|
+
| Code Quality | {pass/warn/fail} | {count} |
|
|
117
|
+
| Test Integrity | {pass/warn/fail} | {count} |
|
|
118
|
+
| Security | {pass/warn/fail} | {count} |
|
|
119
|
+
| Configuration | {pass/warn/fail} | {count} |
|
|
120
|
+
| Breaking Changes | {pass/warn/fail} | {count} |
|
|
121
|
+
| Operational Readiness | {pass/warn/fail} | {count} |
|
|
122
|
+
|
|
123
|
+
### Blockers (if any)
|
|
124
|
+
{critical issues that block deployment}
|
|
125
|
+
|
|
126
|
+
### Warnings (if any)
|
|
127
|
+
{non-critical issues to be aware of}
|
|
128
|
+
|
|
129
|
+
### Verdict: {GO / NO-GO / CONDITIONAL}
|
|
130
|
+
{reasoning}
|
|
131
|
+
```
|
|
132
|
+
|
|
133
|
+
## Chains To
|
|
134
|
+
|
|
135
|
+
- `vulnerability-scan` — If security gate needs deeper analysis
|
|
136
|
+
- `change-management` — Fix and recommit if issues found
|
|
137
|
+
- `knowledge-base` — Record deployment decision and any exceptions made
|
|
138
|
+
|
|
139
|
+
## Anti-Patterns
|
|
140
|
+
|
|
141
|
+
- Do NOT always say GO — be honest about risks
|
|
142
|
+
- Do NOT block on style issues — only on functional and security concerns
|
|
143
|
+
- Do NOT check gates that aren't relevant (no DB gate for a pure frontend change)
|
|
144
|
+
- Do NOT skip the verdict — always provide a clear decision
|
|
@@ -1,130 +1,130 @@
|
|
|
1
|
-
# Doc Governance
|
|
2
|
-
|
|
3
|
-
> **Pillar**: Deliver | **ID**: `deliver-doc-governance`
|
|
4
|
-
|
|
5
|
-
## Purpose
|
|
6
|
-
|
|
7
|
-
Documentation drift detection and synchronization. Ensures READMEs, API docs, and inline documentation stay accurate as code evolves. Treats documentation as a first-class deliverable.
|
|
8
|
-
|
|
9
|
-
## Activation Triggers
|
|
10
|
-
|
|
11
|
-
- "update docs", "docs are stale", "check documentation"
|
|
12
|
-
- "sync README", "API docs", "documentation drift"
|
|
13
|
-
- Automatically chained after `feature-builder` or `architecture-planner` when public APIs change
|
|
14
|
-
|
|
15
|
-
## Methodology
|
|
16
|
-
|
|
17
|
-
### Process Flow
|
|
18
|
-
|
|
19
|
-
```dot
|
|
20
|
-
digraph doc_governance {
|
|
21
|
-
rankdir=TB;
|
|
22
|
-
node [shape=box];
|
|
23
|
-
|
|
24
|
-
inventory [label="Phase 1\nDocumentation Inventory"];
|
|
25
|
-
drift [label="Phase 2\nDrift Detection"];
|
|
26
|
-
classify [label="Phase 3\nImpact Classification"];
|
|
27
|
-
fix [label="Phase 4\nRemediation"];
|
|
28
|
-
complete [label="Phase 5\nCompleteness Check", shape=doublecircle];
|
|
29
|
-
|
|
30
|
-
inventory -> drift;
|
|
31
|
-
drift -> classify [label="drift found"];
|
|
32
|
-
drift -> complete [label="no drift"];
|
|
33
|
-
classify -> fix;
|
|
34
|
-
fix -> complete;
|
|
35
|
-
}
|
|
36
|
-
```
|
|
37
|
-
|
|
38
|
-
### Phase 1 — Documentation Inventory
|
|
39
|
-
1. Locate all documentation files:
|
|
40
|
-
- `README.md` at root and in subdirectories
|
|
41
|
-
- `docs/` folder content
|
|
42
|
-
- API documentation (OpenAPI/Swagger, JSDoc, docstrings)
|
|
43
|
-
- Inline code comments in public interfaces
|
|
44
|
-
- `CHANGELOG.md`, `CONTRIBUTING.md`
|
|
45
|
-
2. Map documentation → code relationships
|
|
46
|
-
|
|
47
|
-
### Phase 2 — Drift Detection
|
|
48
|
-
Compare documentation against current code:
|
|
49
|
-
|
|
50
|
-
| Check | Method |
|
|
51
|
-
|---|---|
|
|
52
|
-
| **API signatures** | Compare documented function signatures vs. actual |
|
|
53
|
-
| **Configuration** | Compare documented env vars/config vs. actual usage |
|
|
54
|
-
| **Installation** | Verify documented install steps still work |
|
|
55
|
-
| **Examples** | Check if code examples still compile/run |
|
|
56
|
-
| **Architecture** | Compare documented structure vs. actual file tree |
|
|
57
|
-
| **Dependencies** | Compare documented requirements vs. actual manifests |
|
|
58
|
-
|
|
59
|
-
For each drift found:
|
|
60
|
-
```
|
|
61
|
-
DRIFT: {doc file}:{line} — {what's documented} ≠ {what's actual}
|
|
62
|
-
```
|
|
63
|
-
|
|
64
|
-
### Phase 3 — Impact Classification
|
|
65
|
-
|
|
66
|
-
| Severity | Criteria |
|
|
67
|
-
|---|---|
|
|
68
|
-
| **Critical** | Wrong API usage instructions — will cause errors for users |
|
|
69
|
-
| **High** | Missing documentation for new public features |
|
|
70
|
-
| **Medium** | Outdated examples, stale screenshots, wrong file paths |
|
|
71
|
-
| **Low** | Minor wording inaccuracies, formatting issues |
|
|
72
|
-
|
|
73
|
-
### Phase 4 — Remediation
|
|
74
|
-
For each drift:
|
|
75
|
-
1. Generate the corrected documentation
|
|
76
|
-
2. Preserve the existing documentation style and voice
|
|
77
|
-
3. Add/update code examples that are verified to work
|
|
78
|
-
4. Update any auto-generated content (table of contents, API reference)
|
|
79
|
-
|
|
80
|
-
### Phase 5 — Completeness Check
|
|
81
|
-
Verify minimum documentation exists:
|
|
82
|
-
- [ ] README with project description, setup, usage
|
|
83
|
-
- [ ] API documentation for all public interfaces
|
|
84
|
-
- [ ] Configuration reference for all env vars/settings
|
|
85
|
-
- [ ] Contributing guide (for open source)
|
|
86
|
-
- [ ] Changelog (if releases are managed)
|
|
87
|
-
|
|
88
|
-
## Tools Required
|
|
89
|
-
|
|
90
|
-
- `codebase` — Read source code and documentation files
|
|
91
|
-
- `terminal` — Verify install steps, run examples
|
|
92
|
-
- `
|
|
93
|
-
|
|
94
|
-
## Output Format
|
|
95
|
-
|
|
96
|
-
```
|
|
97
|
-
## [
|
|
98
|
-
|
|
99
|
-
### Documentation Map
|
|
100
|
-
| Doc File | Covers | Status |
|
|
101
|
-
|---|---|---|
|
|
102
|
-
| {path} | {what it documents} | {current/stale/missing} |
|
|
103
|
-
|
|
104
|
-
### Drift Detected
|
|
105
|
-
#### [{severity}] {doc file}:{line}
|
|
106
|
-
**Documented**: {what the doc says}
|
|
107
|
-
**Actual**: {what the code does}
|
|
108
|
-
**Fix**: {corrected content}
|
|
109
|
-
|
|
110
|
-
---
|
|
111
|
-
(repeat per drift)
|
|
112
|
-
|
|
113
|
-
### Completeness
|
|
114
|
-
{checklist with status}
|
|
115
|
-
|
|
116
|
-
### Summary
|
|
117
|
-
{N} drifts found: {critical}/{high}/{medium}/{low}
|
|
118
|
-
```
|
|
119
|
-
|
|
120
|
-
## Chains To
|
|
121
|
-
|
|
122
|
-
- `change-management` — Commit documentation updates
|
|
123
|
-
- `architecture-planner` — If architecture docs need major restructuring
|
|
124
|
-
|
|
125
|
-
## Anti-Patterns
|
|
126
|
-
|
|
127
|
-
- Do NOT rewrite documentation in a different voice/style
|
|
128
|
-
- Do NOT add documentation for internal/private APIs unless asked
|
|
129
|
-
- Do NOT remove valid documentation just because it's verbose
|
|
130
|
-
- Do NOT generate placeholder documentation ("TODO: add docs")
|
|
1
|
+
# Doc Governance
|
|
2
|
+
|
|
3
|
+
> **Pillar**: Deliver | **ID**: `deliver-doc-governance`
|
|
4
|
+
|
|
5
|
+
## Purpose
|
|
6
|
+
|
|
7
|
+
Documentation drift detection and synchronization. Ensures READMEs, API docs, and inline documentation stay accurate as code evolves. Treats documentation as a first-class deliverable.
|
|
8
|
+
|
|
9
|
+
## Activation Triggers
|
|
10
|
+
|
|
11
|
+
- "update docs", "docs are stale", "check documentation"
|
|
12
|
+
- "sync README", "API docs", "documentation drift"
|
|
13
|
+
- Automatically chained after `feature-builder` or `architecture-planner` when public APIs change
|
|
14
|
+
|
|
15
|
+
## Methodology
|
|
16
|
+
|
|
17
|
+
### Process Flow
|
|
18
|
+
|
|
19
|
+
```dot
|
|
20
|
+
digraph doc_governance {
|
|
21
|
+
rankdir=TB;
|
|
22
|
+
node [shape=box];
|
|
23
|
+
|
|
24
|
+
inventory [label="Phase 1\nDocumentation Inventory"];
|
|
25
|
+
drift [label="Phase 2\nDrift Detection"];
|
|
26
|
+
classify [label="Phase 3\nImpact Classification"];
|
|
27
|
+
fix [label="Phase 4\nRemediation"];
|
|
28
|
+
complete [label="Phase 5\nCompleteness Check", shape=doublecircle];
|
|
29
|
+
|
|
30
|
+
inventory -> drift;
|
|
31
|
+
drift -> classify [label="drift found"];
|
|
32
|
+
drift -> complete [label="no drift"];
|
|
33
|
+
classify -> fix;
|
|
34
|
+
fix -> complete;
|
|
35
|
+
}
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
### Phase 1 — Documentation Inventory
|
|
39
|
+
1. Locate all documentation files:
|
|
40
|
+
- `README.md` at root and in subdirectories
|
|
41
|
+
- `docs/` folder content
|
|
42
|
+
- API documentation (OpenAPI/Swagger, JSDoc, docstrings)
|
|
43
|
+
- Inline code comments in public interfaces
|
|
44
|
+
- `CHANGELOG.md`, `CONTRIBUTING.md`
|
|
45
|
+
2. Map documentation → code relationships
|
|
46
|
+
|
|
47
|
+
### Phase 2 — Drift Detection
|
|
48
|
+
Compare documentation against current code:
|
|
49
|
+
|
|
50
|
+
| Check | Method |
|
|
51
|
+
|---|---|
|
|
52
|
+
| **API signatures** | Compare documented function signatures vs. actual |
|
|
53
|
+
| **Configuration** | Compare documented env vars/config vs. actual usage |
|
|
54
|
+
| **Installation** | Verify documented install steps still work |
|
|
55
|
+
| **Examples** | Check if code examples still compile/run |
|
|
56
|
+
| **Architecture** | Compare documented structure vs. actual file tree |
|
|
57
|
+
| **Dependencies** | Compare documented requirements vs. actual manifests |
|
|
58
|
+
|
|
59
|
+
For each drift found:
|
|
60
|
+
```
|
|
61
|
+
DRIFT: {doc file}:{line} — {what's documented} ≠ {what's actual}
|
|
62
|
+
```
|
|
63
|
+
|
|
64
|
+
### Phase 3 — Impact Classification
|
|
65
|
+
|
|
66
|
+
| Severity | Criteria |
|
|
67
|
+
|---|---|
|
|
68
|
+
| **Critical** | Wrong API usage instructions — will cause errors for users |
|
|
69
|
+
| **High** | Missing documentation for new public features |
|
|
70
|
+
| **Medium** | Outdated examples, stale screenshots, wrong file paths |
|
|
71
|
+
| **Low** | Minor wording inaccuracies, formatting issues |
|
|
72
|
+
|
|
73
|
+
### Phase 4 — Remediation
|
|
74
|
+
For each drift:
|
|
75
|
+
1. Generate the corrected documentation
|
|
76
|
+
2. Preserve the existing documentation style and voice
|
|
77
|
+
3. Add/update code examples that are verified to work
|
|
78
|
+
4. Update any auto-generated content (table of contents, API reference)
|
|
79
|
+
|
|
80
|
+
### Phase 5 — Completeness Check
|
|
81
|
+
Verify minimum documentation exists:
|
|
82
|
+
- [ ] README with project description, setup, usage
|
|
83
|
+
- [ ] API documentation for all public interfaces
|
|
84
|
+
- [ ] Configuration reference for all env vars/settings
|
|
85
|
+
- [ ] Contributing guide (for open source)
|
|
86
|
+
- [ ] Changelog (if releases are managed)
|
|
87
|
+
|
|
88
|
+
## Tools Required
|
|
89
|
+
|
|
90
|
+
- `codebase` — Read source code and documentation files
|
|
91
|
+
- `terminal` — Verify install steps, run examples
|
|
92
|
+
- `crewpilot_knowledge_search` — Check if documentation decisions were previously recorded
|
|
93
|
+
|
|
94
|
+
## Output Format
|
|
95
|
+
|
|
96
|
+
```
|
|
97
|
+
## [CrewPilot → Doc Governance]
|
|
98
|
+
|
|
99
|
+
### Documentation Map
|
|
100
|
+
| Doc File | Covers | Status |
|
|
101
|
+
|---|---|---|
|
|
102
|
+
| {path} | {what it documents} | {current/stale/missing} |
|
|
103
|
+
|
|
104
|
+
### Drift Detected
|
|
105
|
+
#### [{severity}] {doc file}:{line}
|
|
106
|
+
**Documented**: {what the doc says}
|
|
107
|
+
**Actual**: {what the code does}
|
|
108
|
+
**Fix**: {corrected content}
|
|
109
|
+
|
|
110
|
+
---
|
|
111
|
+
(repeat per drift)
|
|
112
|
+
|
|
113
|
+
### Completeness
|
|
114
|
+
{checklist with status}
|
|
115
|
+
|
|
116
|
+
### Summary
|
|
117
|
+
{N} drifts found: {critical}/{high}/{medium}/{low}
|
|
118
|
+
```
|
|
119
|
+
|
|
120
|
+
## Chains To
|
|
121
|
+
|
|
122
|
+
- `change-management` — Commit documentation updates
|
|
123
|
+
- `architecture-planner` — If architecture docs need major restructuring
|
|
124
|
+
|
|
125
|
+
## Anti-Patterns
|
|
126
|
+
|
|
127
|
+
- Do NOT rewrite documentation in a different voice/style
|
|
128
|
+
- Do NOT add documentation for internal/private APIs unless asked
|
|
129
|
+
- Do NOT remove valid documentation just because it's verbose
|
|
130
|
+
- Do NOT generate placeholder documentation ("TODO: add docs")
|