devflow-kit 3.11.0 → 3.12.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (204) hide show
  1. package/CHANGELOG.md +43 -0
  2. package/dist/agents/architect.md +87 -0
  3. package/dist/agents/code.md +21 -25
  4. package/dist/agents/debug.md +21 -49
  5. package/dist/agents/design.md +9 -43
  6. package/dist/agents/fix.md +15 -29
  7. package/dist/agents/git.md +19 -22
  8. package/dist/agents/harden.md +14 -19
  9. package/dist/agents/knowledge.md +11 -19
  10. package/dist/agents/refactor.md +9 -14
  11. package/dist/agents/research.md +11 -34
  12. package/dist/agents/review.md +22 -52
  13. package/dist/agents/skim.md +7 -17
  14. package/dist/agents/triage.md +7 -14
  15. package/dist/commands/bug-analysis.md +31 -62
  16. package/dist/commands/code-review.md +38 -87
  17. package/dist/commands/debug.md +32 -82
  18. package/dist/commands/dynamic-build.md +155 -211
  19. package/dist/commands/dynamic-plan.md +71 -93
  20. package/dist/commands/dynamic-profile.md +7 -155
  21. package/dist/commands/dynamic-tickets.md +65 -186
  22. package/dist/commands/explore.md +27 -70
  23. package/dist/commands/implement.md +98 -186
  24. package/dist/commands/plan.md +60 -107
  25. package/dist/commands/release.md +25 -91
  26. package/dist/commands/research.md +34 -103
  27. package/dist/commands/resolve.md +64 -128
  28. package/dist/commands/self-review.md +35 -99
  29. package/dist/compliance-off/agents/git.md +15 -18
  30. package/dist/compliance-off/agents/triage.md +7 -14
  31. package/dist/compliance-off/commands/bug-analysis.md +31 -62
  32. package/dist/compliance-off/commands/code-review.md +34 -82
  33. package/dist/compliance-off/commands/dynamic-build.md +149 -205
  34. package/dist/compliance-off/commands/dynamic-tickets.md +65 -186
  35. package/dist/compliance-off/commands/implement.md +94 -180
  36. package/dist/compliance-off/commands/plan.md +60 -107
  37. package/dist/compliance-off/commands/release.md +25 -90
  38. package/dist/compliance-off/commands/resolve.md +54 -128
  39. package/dist/compliance-off/skills/git/references/tracker/github/ensure-pr-ready.md +3 -3
  40. package/dist/compliance-off/skills/git/references/tracker/jira/ensure-pr-ready.md +3 -3
  41. package/dist/compliance-off/skills/git/references/tracker/linear/ensure-pr-ready.md +3 -3
  42. package/dist/core/plugins.js +3 -3
  43. package/dist/curation-compliance-off/agents/triage.md +7 -13
  44. package/dist/curation-compliance-off/commands/bug-analysis.md +21 -41
  45. package/dist/curation-compliance-off/commands/code-review.md +25 -62
  46. package/dist/curation-compliance-off/commands/dynamic-build.md +142 -194
  47. package/dist/curation-compliance-off/commands/dynamic-tickets.md +54 -173
  48. package/dist/curation-compliance-off/commands/implement.md +86 -161
  49. package/dist/curation-compliance-off/commands/plan.md +51 -86
  50. package/dist/curation-compliance-off/commands/release.md +17 -78
  51. package/dist/curation-compliance-off/commands/resolve.md +45 -108
  52. package/dist/curation-off/agents/architect.md +81 -0
  53. package/dist/curation-off/agents/code.md +20 -23
  54. package/dist/curation-off/agents/debug.md +19 -47
  55. package/dist/curation-off/agents/design.md +8 -41
  56. package/dist/curation-off/agents/fix.md +14 -27
  57. package/dist/curation-off/agents/harden.md +13 -18
  58. package/dist/curation-off/agents/knowledge.md +9 -17
  59. package/dist/curation-off/agents/refactor.md +8 -12
  60. package/dist/curation-off/agents/research.md +9 -32
  61. package/dist/curation-off/agents/review.md +11 -40
  62. package/dist/curation-off/agents/skim.md +7 -17
  63. package/dist/curation-off/agents/triage.md +7 -13
  64. package/dist/curation-off/commands/bug-analysis.md +21 -41
  65. package/dist/curation-off/commands/code-review.md +29 -67
  66. package/dist/curation-off/commands/debug.md +24 -63
  67. package/dist/curation-off/commands/dynamic-build.md +148 -200
  68. package/dist/curation-off/commands/dynamic-plan.md +60 -80
  69. package/dist/curation-off/commands/dynamic-tickets.md +54 -173
  70. package/dist/curation-off/commands/explore.md +18 -50
  71. package/dist/curation-off/commands/implement.md +90 -167
  72. package/dist/curation-off/commands/plan.md +51 -86
  73. package/dist/curation-off/commands/release.md +17 -79
  74. package/dist/curation-off/commands/research.md +23 -81
  75. package/dist/curation-off/commands/resolve.md +55 -108
  76. package/dist/curation-off/commands/self-review.md +26 -78
  77. package/dist/skills/git/references/pr/update-pr-evidence.md +2 -1
  78. package/dist/skills/git/references/tracker/github/ensure-pr-ready.md +3 -3
  79. package/dist/skills/git/references/tracker/jira/ensure-pr-ready.md +3 -3
  80. package/dist/skills/git/references/tracker/linear/ensure-pr-ready.md +3 -3
  81. package/dist/targets/claude-code/curation-install.js +2 -2
  82. package/dist/variant-axes.json +5 -1
  83. package/package.json +1 -1
  84. package/src/assets/agents/_partials/_code.mds +3 -5
  85. package/src/assets/agents/_partials/_design.mds +86 -0
  86. package/src/assets/agents/architect.mds +41 -0
  87. package/src/assets/agents/code.mds +18 -20
  88. package/src/assets/agents/curate.md +26 -35
  89. package/src/assets/agents/debug.mds +21 -49
  90. package/src/assets/agents/design.mds +11 -114
  91. package/src/assets/agents/evaluate.md +6 -16
  92. package/src/assets/agents/explore.md +1 -2
  93. package/src/assets/agents/fix.mds +12 -24
  94. package/src/assets/agents/git.mds +20 -23
  95. package/src/assets/agents/harden.mds +14 -19
  96. package/src/assets/agents/knowledge.mds +10 -38
  97. package/src/assets/agents/polish.md +13 -39
  98. package/src/assets/agents/refactor.mds +6 -9
  99. package/src/assets/agents/research.mds +11 -34
  100. package/src/assets/agents/review.mds +12 -84
  101. package/src/assets/agents/skim.mds +7 -17
  102. package/src/assets/agents/synthesize.md +3 -21
  103. package/src/assets/agents/test.md +31 -32
  104. package/src/assets/agents/tracker.md +116 -229
  105. package/src/assets/agents/triage.mds +7 -26
  106. package/src/assets/agents/validate.md +1 -3
  107. package/src/assets/commands/_partials/_compliance.mds +2 -2
  108. package/src/assets/commands/_partials/_decisions.mds +17 -24
  109. package/src/assets/commands/_partials/_docs_root.mds +31 -10
  110. package/src/assets/commands/_partials/_engine.mds +34 -56
  111. package/src/assets/commands/_partials/_evidence_policy.mds +1 -1
  112. package/src/assets/commands/_partials/_factory.mds +10 -104
  113. package/src/assets/commands/_partials/_knowledge.mds +47 -51
  114. package/src/assets/commands/_partials/_plan_contract.mds +2 -2
  115. package/src/assets/commands/_partials/_preamble.mds +21 -21
  116. package/src/assets/commands/_partials/_publication.mds +3 -3
  117. package/src/assets/commands/_partials/_roster.mds +12 -13
  118. package/src/assets/commands/_partials/_settings.mds +6 -3
  119. package/src/assets/commands/_partials/_ticket_template.mds +3 -7
  120. package/src/assets/commands/_partials/_tracker.mds +10 -5
  121. package/src/assets/commands/_partials/_wave.mds +23 -32
  122. package/src/assets/commands/bug-analysis.mds +3 -7
  123. package/src/assets/commands/code-review.mds +12 -33
  124. package/src/assets/commands/debug.mds +5 -47
  125. package/src/assets/commands/dynamic-build.mds +48 -70
  126. package/src/assets/commands/dynamic-plan.mds +23 -42
  127. package/src/assets/commands/dynamic-profile.mds +7 -57
  128. package/src/assets/commands/dynamic-tickets.mds +9 -29
  129. package/src/assets/commands/explore.mds +5 -44
  130. package/src/assets/commands/implement.mds +75 -117
  131. package/src/assets/commands/plan.mds +27 -57
  132. package/src/assets/commands/release.mds +4 -62
  133. package/src/assets/commands/research.mds +7 -53
  134. package/src/assets/commands/resolve.mds +40 -87
  135. package/src/assets/commands/self-review.mds +5 -45
  136. package/src/assets/mds/git/_ops_pr.mds +1 -0
  137. package/src/assets/mds/git/_ops_steps.mds +4 -4
  138. package/src/assets/mds/git/_pr.mds +1 -1
  139. package/src/assets/rules/engineering.md +1 -1
  140. package/src/assets/rules/quality.md +2 -2
  141. package/src/assets/scripts/ci-wait.cjs +150 -18
  142. package/src/assets/scripts/hooks/assets/orchestrator-charter.md +3 -3
  143. package/src/assets/scripts/hooks/preamble +2 -3
  144. package/src/assets/scripts/pr-evidence.cjs +1 -0
  145. package/src/assets/scripts/resolve-evidence-policy.cjs +14 -13
  146. package/src/assets/scripts/resolve-root.cjs +186 -0
  147. package/src/assets/scripts/resolve-settings.cjs +14 -9
  148. package/src/assets/scripts/verify-evidence.cjs +355 -22
  149. package/src/assets/skills/accessibility/SKILL.md +28 -95
  150. package/src/assets/skills/agent-references/SKILL.md +2 -4
  151. package/src/assets/skills/agent-references/references/commands/implement-evidence-asks.md +1 -1
  152. package/src/assets/skills/agent-references/references/commands/implement-levels.md +4 -7
  153. package/src/assets/skills/agent-references/references/commands/implement-revalidate.md +1 -1
  154. package/src/assets/skills/agent-references/references/commands/plan-levels.md +2 -2
  155. package/src/assets/skills/apply-decisions/SKILL.md +5 -6
  156. package/src/assets/skills/apply-feature-knowledge/SKILL.md +3 -13
  157. package/src/assets/skills/architecture/SKILL.md +29 -105
  158. package/src/assets/skills/boundary-validation/SKILL.md +27 -78
  159. package/src/assets/skills/complexity/SKILL.md +8 -104
  160. package/src/assets/skills/compliance/SKILL.md +9 -67
  161. package/src/assets/skills/consistency/SKILL.md +7 -107
  162. package/src/assets/skills/database/SKILL.md +7 -72
  163. package/src/assets/skills/dependencies/SKILL.md +9 -109
  164. package/src/assets/skills/dependencies/references/detection.md +10 -0
  165. package/src/assets/skills/dependency-research/SKILL.md +9 -63
  166. package/src/assets/skills/design-review/SKILL.md +1 -35
  167. package/src/assets/skills/docs-framework/SKILL.md +4 -47
  168. package/src/assets/skills/documentation/SKILL.md +7 -71
  169. package/src/assets/skills/documentation/references/patterns.md +1 -1
  170. package/src/assets/skills/documentation/references/violations.md +1 -1
  171. package/src/assets/skills/feature-knowledge/SKILL.md +19 -222
  172. package/src/assets/skills/feature-knowledge/references/new-kb.md +128 -0
  173. package/src/assets/skills/gap-analysis/SKILL.md +1 -31
  174. package/src/assets/skills/git/SKILL.md +2 -22
  175. package/src/assets/skills/go/SKILL.md +24 -113
  176. package/src/assets/skills/java/SKILL.md +12 -98
  177. package/src/assets/skills/patterns/SKILL.md +8 -93
  178. package/src/assets/skills/performance/SKILL.md +29 -88
  179. package/src/assets/skills/python/SKILL.md +22 -120
  180. package/src/assets/skills/qa/SKILL.md +16 -54
  181. package/src/assets/skills/qa/references/browser-testing.md +0 -24
  182. package/src/assets/skills/qa/references/sources.md +2 -2
  183. package/src/assets/skills/quality-gates/SKILL.md +13 -100
  184. package/src/assets/skills/react/SKILL.md +33 -95
  185. package/src/assets/skills/regression/SKILL.md +8 -73
  186. package/src/assets/skills/reliability/SKILL.md +11 -120
  187. package/src/assets/skills/research-codebase/SKILL.md +7 -49
  188. package/src/assets/skills/research-competitor/SKILL.md +4 -39
  189. package/src/assets/skills/research-external/SKILL.md +5 -43
  190. package/src/assets/skills/research-market/SKILL.md +5 -43
  191. package/src/assets/skills/research-technology/SKILL.md +8 -68
  192. package/src/assets/skills/review-methodology/SKILL.md +10 -56
  193. package/src/assets/skills/rust/SKILL.md +19 -109
  194. package/src/assets/skills/security/SKILL.md +39 -66
  195. package/src/assets/skills/software-design/SKILL.md +20 -105
  196. package/src/assets/skills/software-design/references/patterns.md +84 -2
  197. package/src/assets/skills/software-design/references/violations.md +1 -1
  198. package/src/assets/skills/test-driven-development/SKILL.md +32 -107
  199. package/src/assets/skills/test-driven-development/references/rationalization-prevention.md +33 -1
  200. package/src/assets/skills/testing/SKILL.md +35 -53
  201. package/src/assets/skills/typescript/SKILL.md +23 -102
  202. package/src/assets/skills/ui-design/SKILL.md +26 -74
  203. package/src/assets/skills/worktree-support/SKILL.md +4 -10
  204. package/dist/curation-off/commands/dynamic-profile.md +0 -214
@@ -1,134 +1,38 @@
1
1
  ---
2
2
  name: complexity
3
- description: This skill should be used when reviewing code for deep nesting or long functions.
3
+ description: Use when reviewing code for deep nesting or long functions.
4
4
  user-invocable: false
5
5
  allowed-tools: Read, Grep, Glob
6
6
  ---
7
7
 
8
8
  # Complexity Patterns
9
9
 
10
- Domain expertise for code complexity and maintainability analysis. Use alongside `devflow:review-methodology` for complete complexity reviews.
10
+ Detection patterns for complexity and maintainability review. Use with `devflow:review-methodology`.
11
11
 
12
12
  ## Iron Law
13
13
 
14
- > **IF YOU CAN'T UNDERSTAND IT IN 5 MINUTES, IT'S TOO COMPLEX**
14
+ > **If you can't understand it in 5 minutes, it's too complex.**
15
15
  >
16
16
  > Every function should be explainable to a colleague in under 5 minutes. If you need a
17
17
  > diagram to understand control flow, refactor. If you need comments to explain what
18
18
  > (not why), the code is too clever. Simplicity is a feature, complexity is a bug.
19
19
 
20
- ---
21
-
22
20
  ## Complexity Categories
23
21
 
24
- ### 1. Cyclomatic Complexity
25
-
26
- High decision path count makes code hard to test and understand.
27
-
28
- **Violation**: Deep nesting (5+ levels)
29
- ```typescript
30
- if (order) {
31
- if (order.items) {
32
- for (const item of order.items) {
33
- if (item.quantity > 0) {
34
- if (item.product?.inStock) {
35
- // Buried logic
36
- ```
37
-
38
- **Solution**: Early returns and extraction
39
- ```typescript
40
- function processOrder(order: Order) {
41
- if (!order?.items) return;
42
- for (const item of order.items) processItem(item);
43
- }
44
-
45
- function processItem(item: OrderItem) {
46
- if (item.quantity <= 0 || !item.product?.inStock) return;
47
- // Logic at top level
48
- }
49
- ```
50
-
51
- ### 2. Readability Issues
52
-
53
- Code that requires mental effort to parse.
54
-
55
- **Violation**: Magic values
56
- ```typescript
57
- if (status === 3) {
58
- setTimeout(callback, 86400000);
59
- }
60
- ```
61
-
62
- **Solution**: Named constants
63
- ```typescript
64
- const OrderStatus = { COMPLETED: 3 } as const;
65
- const ONE_DAY_MS = 24 * 60 * 60 * 1000;
66
-
67
- if (status === OrderStatus.COMPLETED) {
68
- setTimeout(callback, ONE_DAY_MS);
69
- }
70
- ```
71
-
72
- ### 3. Maintainability Issues
73
-
74
- Code that's expensive to change.
75
-
76
- **Violation**: Long parameter lists
77
- ```typescript
78
- function createUser(name, email, password, role, dept, manager, startDate, salary) { }
79
- ```
80
-
81
- **Solution**: Object parameter
82
- ```typescript
83
- interface CreateUserParams {
84
- name: string; email: string; password: string;
85
- role: string; department: string; manager?: string;
86
- startDate: Date; salary: number;
87
- }
88
- function createUser(params: CreateUserParams) { }
89
- ```
90
-
91
- ### 4. Boolean Complexity
92
-
93
- Conditions that are hard to reason about.
94
-
95
- **Violation**: Complex boolean expression
96
- ```typescript
97
- if (user.active && !user.deleted && (user.role === 'admin' || user.role === 'moderator') && user.verified && (!user.suspended || user.suspendedUntil < Date.now())) { }
98
- ```
99
-
100
- **Solution**: Extract to named predicate
101
- ```typescript
102
- const canModerate = (user: User): boolean => {
103
- if (!user.active || user.deleted || !user.verified) return false;
104
- if (!['admin', 'moderator'].includes(user.role)) return false;
105
- if (user.suspended && user.suspendedUntil >= Date.now()) return false;
106
- return true;
107
- };
108
-
109
- if (canModerate(user)) { }
110
- ```
111
-
112
- ### 5. Reliability Patterns
113
-
114
- Operations that risk non-termination or resource exhaustion. See `devflow:reliability` for
115
- full coverage of bounded iteration, assertion density, allocation discipline, and indirection limits.
116
- Complexity-relevant: unbounded loops increase cyclomatic complexity and make termination reasoning harder.
117
-
118
- ---
22
+ 1. **Cyclomatic complexity**: many decision paths, deep nesting (5+ levels). Fix: early returns and extracted functions.
23
+ 2. **Readability**: magic values (`status === 3`, `86400000`). Fix: named constants.
24
+ 3. **Maintainability**: long parameter lists (5+). Fix: one typed object parameter.
25
+ 4. **Boolean complexity**: long compound conditions (5+ terms). Fix: extract a named predicate with early returns.
26
+ 5. **Reliability patterns**: operations that risk non-termination or resource exhaustion. Unbounded loops add decision paths and make termination hard to reason about. `devflow:reliability` covers bounded iteration, assertion density, allocation discipline and indirection limits.
119
27
 
120
28
  ## Extended References
121
29
 
122
- For extended examples and detection techniques:
123
-
124
30
  | Reference | Content |
125
31
  |-----------|---------|
126
32
  | `references/violations.md` | Extended violation examples for all categories |
127
33
  | `references/patterns.md` | Detailed refactoring solutions |
128
34
  | `references/detection.md` | Bash commands and static analysis setup |
129
35
 
130
- ---
131
-
132
36
  ## Severity Guidelines
133
37
 
134
38
  | Severity | Criteria |
@@ -1,16 +1,12 @@
1
1
  ---
2
2
  name: compliance
3
- description: This skill should be used when reviewing code that handles PII, payments or health data.
3
+ description: Use when reviewing code that handles PII, payments or health data.
4
4
  user-invocable: false
5
5
  allowed-tools: Read, Grep, Glob
6
6
  ---
7
7
 
8
8
  # Compliance Patterns
9
9
 
10
- <!-- Composition tokens (5): DEVFLOW_COMPLIANCE_SCOPE, DEVFLOW_COMPLIANCE_ACTIVE,
11
- DEVFLOW_COMPLIANCE_MAPPING, DEVFLOW_COMPLIANCE_CHECKLIST, DEVFLOW_COMPLIANCE_REFERENCES.
12
- Dynamic sections compose from frameworks/{id}/fragment.md at install time (C1: token-free shadows pass through). -->
13
-
14
10
  Regulatory compliance review for code that touches regulated data ${DEVFLOW_COMPLIANCE_SCOPE}. Use alongside `devflow:security` for complete coverage.
15
11
 
16
12
  ## Iron Law
@@ -26,7 +22,7 @@ ${DEVFLOW_COMPLIANCE_ACTIVE}
26
22
 
27
23
  ## Scope Boundary
28
24
 
29
- Compliance covers regulatory-specific gaps: retention, erasure/data-subject rights, audit-trail completeness (actor/purpose fields), segregation of duties, framework mapping, IaC exposure. Do NOT re-raise security lens findings (injection, secret handling, authN/Z) — reference those via framework mapping only.
25
+ Compliance covers regulatory-specific gaps: retention, erasure/data-subject rights, audit-trail completeness (actor/purpose fields), segregation of duties, framework mapping, IaC exposure. Do not re-raise security lens findings (injection, secret handling, authN/Z) — reference those via framework mapping only.
30
26
 
31
27
  **Lens only.** This skill shapes what a compliance review looks for in the diff or design. It does not decide how much evidence a change must carry: tracker links, test plans, approvals and release traces follow the repository's evidence policy. Never report a missing ticket, test plan or approval as a compliance finding.
32
28
 
@@ -36,61 +32,12 @@ If the diff/design has no regulated-data surface (no PII/PHI/payment fields, no
36
32
 
37
33
  ## Control Categories
38
34
 
39
- ### 1. Data Classification & Minimization
40
- ```typescript
41
- // VULNERABLE: full SSN stored when only last-4 needed
42
- user.ssn = req.body.ssn;
43
- // COMPLIANT: store minimum; annotate purpose + retention
44
- user.ssnLast4 = req.body.ssn.slice(-4); // retention: 90d for verification
45
- ```
46
-
47
- ### 2. Sensitive Data in Logs & Errors
48
- ```typescript
49
- // VULNERABLE: PII in structured log
50
- logger.info('login', { email, password, creditCard });
51
- // COMPLIANT: omit or mask regulated fields
52
- logger.info('login', { userId, ip });
53
- ```
54
-
55
- ### 3. Encryption In Transit & At Rest
56
- ```typescript
57
- // VULNERABLE: plaintext PHI written to disk
58
- fs.writeFileSync('/data/patients.json', JSON.stringify(records));
59
- // COMPLIANT: encrypt before write; TLS enforced at transport
60
- await vault.encrypt(records, { key: 'phi-key', algo: 'AES-256-GCM' });
61
- ```
62
-
63
- ### 4. Audit Trails & Change Traceability
64
- ```typescript
65
- // VULNERABLE: mutation with no audit entry; no segregation of duties
66
- await db.update('orders', { status: 'refunded' }, { id });
67
- // COMPLIANT: append-only audit before state change; actor ≠ approver
68
- await audit.append({ actor, action: 'refund', target: id, purpose, ts: Date.now() });
69
- await db.update('orders', { status: 'refunded' }, { id });
70
- ```
71
-
72
- ### 5. Retention & Erasure
73
- ```typescript
74
- // VULNERABLE: PII stored with no deletion path
75
- await db.insert('user_pii', { userId, ssn, email });
76
- // COMPLIANT: TTL field + erasure handler registered at write time
77
- await db.insert('user_pii', { userId, ssn, email, retainUntil: addDays(90) });
78
- await erasure.register(userId, ['user_pii']);
79
- ```
80
-
81
- ### 6. Environments & IaC
82
- ```hcl
83
- # VULNERABLE: public bucket, no encryption, no access logging
84
- resource "aws_s3_bucket" "data" { acl = "public-read" }
85
- # COMPLIANT: private, encrypted, logging enabled
86
- resource "aws_s3_bucket_acl" "data" { acl = "private" }
87
- resource "aws_s3_bucket_server_side_encryption_configuration" "data" {
88
- rule { apply_server_side_encryption_by_default { sse_algorithm = "AES256" } }
89
- }
90
- resource "aws_s3_bucket_logging" "data" { target_bucket = var.audit_bucket_id }
91
- ```
92
-
93
- ---
35
+ 1. **Data Classification & Minimization**: store the minimum the purpose needs (the last 4 digits, not the full SSN). Every stored field has a declared purpose and retention period.
36
+ 2. **Sensitive Data in Logs & Errors**: no PII/PHI/payment data in logs, errors or analytics events. Omit or mask regulated fields.
37
+ 3. **Encryption In Transit & At Rest**: encrypt regulated data before it is written, and enforce TLS 1.2+ in transit.
38
+ 4. **Audit Trails & Change Traceability**: every regulated mutation writes an append-only audit entry (actor, action, target, purpose, timestamp) before the state change. Segregation of duties: the actor is not the approver, and no one self-approves a regulated state change.
39
+ 5. **Retention & Erasure**: every stored regulated field has a retention limit and a deletion path, registered at write time.
40
+ 6. **Environments & IaC**: no public buckets or security groups, no unencrypted volumes or stores, no wildcard IAM, and access logging on.
94
41
 
95
42
  ## Severity
96
43
 
@@ -106,12 +53,7 @@ ${DEVFLOW_COMPLIANCE_MAPPING}
106
53
  ## Checklist
107
54
 
108
55
  - [ ] Frameworks in force are the ids your prompt names; their controls applied
109
- - [ ] No PII/PHI/payment data in logs, errors, or analytics events
110
- - [ ] Regulated data encrypted in transit (TLS 1.2+) and at rest
111
- - [ ] Every regulated mutation has an append-only audit entry (actor, purpose, timestamp)
112
- - [ ] All stored fields have a declared purpose, retention period, and deletion path
113
- - [ ] Segregation of duties enforced — no self-approval of regulated state changes
114
- - [ ] IaC scanned: no public buckets/SGs, no unencrypted volumes, no wildcard IAM
56
+ - [ ] Each control category above checked against the diff or design
115
57
  ${DEVFLOW_COMPLIANCE_CHECKLIST}
116
58
 
117
59
  ## Extended References
@@ -1,120 +1,35 @@
1
1
  ---
2
2
  name: consistency
3
- description: This skill should be used when reviewing code for naming or pattern inconsistencies.
3
+ description: Use when reviewing code for naming or pattern inconsistencies.
4
4
  user-invocable: false
5
5
  allowed-tools: Read, Grep, Glob
6
6
  ---
7
7
 
8
8
  # Consistency Patterns
9
9
 
10
- Domain expertise for code consistency and unnecessary simplification detection. Use alongside `devflow:review-methodology` for complete consistency reviews.
10
+ Detection patterns for consistency and unnecessary simplification review. Use with `devflow:review-methodology`.
11
11
 
12
12
  ## Iron Law
13
13
 
14
- > **MATCH EXISTING PATTERNS OR JUSTIFY DEVIATION**
14
+ > **Match existing patterns or justify deviation.**
15
15
  >
16
16
  > New code should look like existing code. If the codebase uses camelCase, use camelCase.
17
17
  > If errors return Result types, return Result types. Consistency trumps personal preference.
18
18
  > Deviation requires explicit justification and team agreement. One codebase, one style.
19
19
 
20
- ---
21
-
22
20
  ## Consistency Categories
23
21
 
24
- ### 1. Unnecessary Simplification
25
-
26
- Content truncation, stripped configuration, removed error context.
27
-
28
- ```typescript
29
- // VIOLATION: Oversimplified error messages
30
- const errorMessages = {
31
- INVALID_EMAIL: 'Invalid email', // Was: detailed format guidance
32
- USER_NOT_FOUND: 'Not found', // Was: helpful next steps
33
- };
34
-
35
- // CORRECT: Preserve helpful context
36
- const errorMessages = {
37
- INVALID_EMAIL: 'Please enter a valid email address in the format user@domain.com',
38
- USER_NOT_FOUND: 'We could not find an account with that email. Please check or create a new account.',
39
- };
40
- ```
41
-
42
- ### 2. Pattern Violations
43
-
44
- Naming conventions, error handling styles, import/export organization.
45
-
46
- ```typescript
47
- // EXISTING PATTERN: Result types
48
- function existingFunction(): Result<User, Error> {
49
- if (!valid) return Err(new ValidationError('...'));
50
- return Ok(user);
51
- }
52
-
53
- // VIOLATION: Throws instead of Result
54
- function newFunction(): User {
55
- if (!valid) throw new Error('...'); // Different pattern!
56
- return user;
57
- }
58
-
59
- // CORRECT: Match existing
60
- function newFunction(): Result<User, Error> {
61
- if (!valid) return Err(new ValidationError('...'));
62
- return Ok(user);
63
- }
64
- ```
65
-
66
- ### 3. Feature Regression
67
-
68
- Removed CLI options, changed return types, removed event emissions.
69
-
70
- ```typescript
71
- // VIOLATION: Removed event emissions break listeners
72
- class OrderService {
73
- async createOrder(data: OrderData) {
74
- const order = await this.repository.create(data);
75
- return order; // Events removed - listeners won't fire!
76
- }
77
- }
78
-
79
- // CORRECT: Preserve all event emissions
80
- class OrderService {
81
- async createOrder(data: OrderData) {
82
- const order = await this.repository.create(data);
83
- this.events.emit('order.created', order);
84
- this.events.emit('inventory.reserve', order.items);
85
- return order;
86
- }
87
- }
88
- ```
89
-
90
- ### 4. Style Inconsistency
91
-
92
- Brace style, quote style, trailing commas, naming conventions.
93
-
94
- ```typescript
95
- // EXISTING: camelCase for functions
96
- function getUserById(id: string) { }
97
- function createOrder(data: OrderData) { }
98
-
99
- // VIOLATION: Different naming style
100
- function Process_Payment(amount: number) { } // snake_case
101
-
102
- // CORRECT: Match existing
103
- function processPayment(amount: number) { }
104
- ```
105
-
106
- ---
22
+ 1. **Unnecessary simplification**: user-facing content shortened (detailed error messages cut to "Not found"), configuration options silently removed, error context stripped.
23
+ 2. **Pattern violations**: naming conventions, error-handling style (a new function throws where the codebase returns `Result`), import organization and export style that differ from existing modules.
24
+ 3. **Feature regression**: CLI options or flags removed without deprecation, return types changed, event emissions removed (listeners stop firing). Every removed function needs explicit justification.
25
+ 4. **Style inconsistency**: brace style, quote style, trailing commas, naming case (`Process_Payment` among camelCase functions).
107
26
 
108
27
  ## Extended References
109
28
 
110
- For extended examples and detection commands, see:
111
-
112
29
  - `references/violations.md` - Extended violation examples by category
113
30
  - `references/patterns.md` - Extended correct pattern examples
114
31
  - `references/detection.md` - Bash commands for detecting issues
115
32
 
116
- ---
117
-
118
33
  ## Severity Guidelines
119
34
 
120
35
  | Severity | Description | Examples |
@@ -123,18 +38,3 @@ For extended examples and detection commands, see:
123
38
  | **HIGH** | Inconsistency requiring attention | Error handling pattern mismatch, naming violations, export pattern change |
124
39
  | **MEDIUM** | Style inconsistency | Import organization, brace/quote style, formatting differences |
125
40
  | **LOW** | Minor observations | Personal preference territory, linter should catch |
126
-
127
- ---
128
-
129
- ## Consistency Checklist
130
-
131
- Before approving changes, verify:
132
-
133
- - [ ] Naming matches existing patterns (camelCase, PascalCase, etc.)
134
- - [ ] Error handling matches existing approach (throw vs Result)
135
- - [ ] Import organization matches existing files
136
- - [ ] Export style matches existing modules
137
- - [ ] No user-facing content was unnecessarily shortened
138
- - [ ] No configuration options were silently removed
139
- - [ ] No CLI flags/options were removed without deprecation
140
- - [ ] All removed functionality has explicit justification
@@ -1,17 +1,17 @@
1
1
  ---
2
2
  name: database
3
- description: This skill should be used when reviewing queries, migrations or schema changes.
3
+ description: Use when reviewing queries, migrations or schema changes.
4
4
  user-invocable: false
5
5
  allowed-tools: Read, Grep, Glob
6
6
  ---
7
7
 
8
8
  # Database Patterns
9
9
 
10
- Domain expertise for database design and optimization. Use alongside `devflow:review-methodology` for complete database reviews.
10
+ Detection patterns for database design and query review. Use with `devflow:review-methodology`.
11
11
 
12
12
  ## Iron Law
13
13
 
14
- > **EVERY QUERY MUST HAVE AN EXECUTION PLAN**
14
+ > **Every query must have an execution plan.**
15
15
  >
16
16
  > Never deploy a query without understanding its execution plan. Every WHERE clause needs
17
17
  > an index analysis. Every JOIN needs cardinality consideration. "It works in dev" is not
@@ -28,19 +28,6 @@ Domain expertise for database design and optimization. Use alongside `devflow:re
28
28
  | Poor Data Types | VARCHAR for everything, lost precision | Use appropriate types (DECIMAL, BOOLEAN, TIMESTAMP) |
29
29
  | Missing Constraints | No data validation at DB level | Add NOT NULL, CHECK, UNIQUE constraints |
30
30
 
31
- **Example - Missing Constraints:**
32
- ```sql
33
- -- VIOLATION
34
- CREATE TABLE products (id SERIAL, name VARCHAR(100), price DECIMAL);
35
-
36
- -- CORRECT
37
- CREATE TABLE products (
38
- id SERIAL PRIMARY KEY,
39
- name VARCHAR(100) NOT NULL CHECK (LENGTH(TRIM(name)) > 0),
40
- price DECIMAL(10, 2) NOT NULL CHECK (price >= 0)
41
- );
42
- ```
43
-
44
31
  ### 2. Query Optimization Issues
45
32
 
46
33
  | Issue | Problem | Solution |
@@ -50,17 +37,6 @@ CREATE TABLE products (
50
37
  | Full Table Scans | Functions prevent index use | Functional indexes or query rewrite |
51
38
  | Inefficient JOINs | Joining before filtering | Filter early, select specific columns |
52
39
 
53
- **Example - N+1 Query:**
54
- ```typescript
55
- // VIOLATION: 101 queries for 100 users
56
- for (const user of users) {
57
- user.orders = await db.query('SELECT * FROM orders WHERE user_id = ?', [user.id]);
58
- }
59
-
60
- // CORRECT: 2 queries total
61
- const orders = await db.query('SELECT * FROM orders WHERE user_id = ANY($1)', [userIds]);
62
- ```
63
-
64
40
  ### 3. Migration Issues
65
41
 
66
42
  | Issue | Problem | Solution |
@@ -68,17 +44,7 @@ const orders = await db.query('SELECT * FROM orders WHERE user_id = ANY($1)', [u
68
44
  | Breaking Changes | Data loss, no recovery path | Phased approach with backups |
69
45
  | Data Loss Risk | Type changes truncate data | Validate before changing types |
70
46
  | Missing Rollback | Cannot undo migration | Always implement down() method |
71
- | Performance Impact | Table locks during migration | Add columns nullable, backfill in batches |
72
-
73
- **Example - Safe Column Addition:**
74
- ```sql
75
- -- Step 1: Add nullable (instant)
76
- ALTER TABLE users ADD COLUMN phone VARCHAR(20);
77
- -- Step 2: Backfill in batches
78
- UPDATE users SET phone = 'UNKNOWN' WHERE phone IS NULL AND id BETWEEN 1 AND 10000;
79
- -- Step 3: Add constraint after backfill
80
- ALTER TABLE users ALTER COLUMN phone SET NOT NULL;
81
- ```
47
+ | Performance Impact | Table locks during migration | Add columns nullable, backfill in batches, then add the constraint |
82
48
 
83
49
  ### 4. Security Issues
84
50
 
@@ -87,27 +53,11 @@ ALTER TABLE users ALTER COLUMN phone SET NOT NULL;
87
53
  | SQL Injection | String interpolation in queries | Parameterized queries only |
88
54
  | Excessive Privileges | App has GRANT ALL | Minimum required privileges |
89
55
 
90
- **Example - SQL Injection:**
91
- ```typescript
92
- // VULNERABLE
93
- const query = `SELECT * FROM users WHERE email = '${email}'`;
94
-
95
- // SECURE
96
- const query = 'SELECT * FROM users WHERE email = $1';
97
- await db.query(query, [email]);
98
- ```
99
-
100
- ---
101
-
102
56
  ## Extended References
103
57
 
104
- For detailed examples and detection commands, see:
105
-
106
- - **[references/violations.md](references/violations.md)** - Extended violation examples with explanations
107
- - **[references/patterns.md](references/patterns.md)** - Correct patterns and migration strategies
108
- - **[references/detection.md](references/detection.md)** - Automated detection commands
109
-
110
- ---
58
+ - `references/violations.md` - Extended violation examples with explanations
59
+ - `references/patterns.md` - Correct patterns and migration strategies
60
+ - `references/detection.md` - Automated detection commands
111
61
 
112
62
  ## Severity Guidelines
113
63
 
@@ -117,18 +67,3 @@ For detailed examples and detection commands, see:
117
67
  | **HIGH** | Significant database issues | Inefficient JOINs, missing constraints, migrations without rollback |
118
68
  | **MEDIUM** | Moderate concerns | Minor denormalization, missing non-critical indexes |
119
69
  | **LOW** | Minor improvements | Naming conventions, index organization |
120
-
121
- ---
122
-
123
- ## Database Checklist
124
-
125
- Before approving database changes:
126
-
127
- - [ ] All queries have appropriate indexes
128
- - [ ] N+1 patterns identified and resolved
129
- - [ ] Migrations have rollback scripts
130
- - [ ] Data types are appropriate
131
- - [ ] Constraints enforce business rules
132
- - [ ] Foreign keys maintain referential integrity
133
- - [ ] No SQL injection vulnerabilities
134
- - [ ] Performance tested with production-like data volume
@@ -1,106 +1,35 @@
1
1
  ---
2
2
  name: dependencies
3
- description: This skill should be used when reviewing dependency or lock file changes.
3
+ description: Use when reviewing dependency or lock file changes.
4
4
  user-invocable: false
5
5
  allowed-tools: Read, Grep, Glob
6
6
  ---
7
7
 
8
8
  # Dependencies Patterns
9
9
 
10
- Domain expertise for dependency management and security analysis. Use alongside `devflow:review-methodology` for complete dependency reviews.
10
+ Detection patterns for dependency management and supply-chain review. Use with `devflow:review-methodology`.
11
11
 
12
12
  ## Iron Law
13
13
 
14
- > **EVERY DEPENDENCY IS AN ATTACK SURFACE**
14
+ > **Every dependency is an attack surface.**
15
15
  >
16
16
  > Each package you add is code you didn't write but must trust. Minimize dependencies.
17
17
  > Pin versions. Audit regularly. A single compromised transitive dependency can compromise
18
18
  > your entire application. "It's a popular package" is not a security review.
19
19
 
20
- ---
21
-
22
20
  ## Dependency Categories
23
21
 
24
- ### 1. Security Vulnerabilities
25
-
26
- Known CVEs, vulnerable version ranges, malicious packages.
27
-
28
- **Violation**: Wide version range includes vulnerable versions
29
- ```json
30
- { "lodash": "^4.0.0" } // Includes vulnerable 4.17.0-4.17.20
31
- ```
32
-
33
- **Correct**: Pin to safe version
34
- ```json
35
- { "lodash": "^4.17.21" } // First safe version
36
- ```
37
-
38
- ### 2. Version Management
39
-
40
- Unpinned versions, missing lockfiles, dependency conflicts.
41
-
42
- **Violation**: Unpinned allows any version
43
- ```json
44
- { "express": "*", "lodash": "latest" }
45
- ```
46
-
47
- **Correct**: Pin with lockfile
48
- ```json
49
- { "express": "^4.18.2" } // + committed lockfile
50
- ```
51
-
52
- ### 3. Dependency Health
53
-
54
- Outdated packages, unused dependencies, unnecessary heavy packages.
55
-
56
- **Violation**: Heavy dependency for simple task
57
- ```json
58
- { "moment": "^2.29.4" } // 300KB for date formatting
59
- ```
60
-
61
- **Correct**: Use native or lighter alternative
62
- ```typescript
63
- new Date().toLocaleDateString(); // Native
64
- ```
65
-
66
- ### 4. License Issues
67
-
68
- Incompatible licenses (GPL in MIT project), missing licenses.
69
-
70
- **Violation**: GPL in proprietary code
71
- ```bash
72
- # GPL-3.0: some-package # Requires your code to be GPL too!
73
- ```
74
-
75
- **Correct**: Use permissive licenses only
76
- ```bash
77
- npx license-checker --failOn "GPL-3.0;AGPL-3.0"
78
- ```
79
-
80
- ### 5. Supply Chain Risks
81
-
82
- Deep transitive dependencies, unmaintained packages, typosquatting.
83
-
84
- **Violation**: Typosquatted package
85
- ```json
86
- { "loadsh": "1.0.0" } // Typosquat of "lodash"
87
- ```
88
-
89
- **Correct**: Verify package authenticity
90
- ```bash
91
- npm view loadsh # Check downloads, repo, maintainers
92
- ```
93
-
94
- ---
22
+ 1. **Security vulnerabilities**: known CVEs in added packages, version ranges that include vulnerable versions (`"lodash": "^4.0.0"` includes 4.17.0-4.17.20), malicious packages.
23
+ 2. **Version management**: unpinned versions (`"*"`, `"latest"`), ranges too wide, lockfile missing or not updated, dependency conflicts.
24
+ 3. **Dependency health**: unmaintained or outdated packages, unused dependencies, heavy packages for simple tasks (`moment` for date formatting) where a native or lighter alternative exists, bundle size impact.
25
+ 4. **License issues**: incompatible licenses (GPL in MIT or proprietary code), missing licenses.
26
+ 5. **Supply chain risks**: deep transitive dependencies, unverified publishers, typosquatting (`loadsh` for `lodash`).
95
27
 
96
28
  ## Extended References
97
29
 
98
- For extended examples and detection commands, see:
99
30
  - `references/violations.md` - Extended violation examples by category
100
31
  - `references/patterns.md` - Correct dependency management patterns
101
- - `references/detection.md` - Detection commands and CI integration
102
-
103
- ---
32
+ - `references/detection.md` - Detection commands, CI integration and advisory sources
104
33
 
105
34
  ## Severity Guidelines
106
35
 
@@ -110,32 +39,3 @@ For extended examples and detection commands, see:
110
39
  | **HIGH** | High severity CVEs, unmaintained packages, GPL in proprietary code |
111
40
  | **MEDIUM** | Medium CVEs, significantly outdated, wide version ranges, missing lockfile |
112
41
  | **LOW** | Unused dependencies, lighter alternatives available, minor version behind |
113
-
114
- ---
115
-
116
- ## Dependency Review Checklist
117
-
118
- Before approving dependency changes:
119
-
120
- - [ ] No known CVEs in added packages
121
- - [ ] Version ranges appropriate (not too wide)
122
- - [ ] Lockfile updated and committed
123
- - [ ] Package actively maintained
124
- - [ ] License compatible
125
- - [ ] Package from verified publisher
126
- - [ ] Transitive dependencies reviewed
127
- - [ ] Package name verified (not typosquat)
128
- - [ ] Bundle size impact considered
129
- - [ ] Native alternatives considered
130
-
131
- ---
132
-
133
- ## Common Vulnerability Sources
134
-
135
- | Registry | URL |
136
- |----------|-----|
137
- | npm Advisory | https://www.npmjs.com/advisories |
138
- | Snyk Vuln DB | https://snyk.io/vuln |
139
- | GitHub Advisory | https://github.com/advisories |
140
- | NVD | https://nvd.nist.gov/ |
141
- | CISA KEV | https://www.cisa.gov/known-exploited-vulnerabilities-catalog |