@jakkrichm/create-nexus-devflow 2.0.11 → 2.0.13

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 (125) hide show
  1. package/bin/create-nexus-devflow.js +15 -3
  2. package/lib/update.js +15 -1
  3. package/package.json +1 -1
  4. package/template/.agents/skills/70-release/SKILL.md +2 -0
  5. package/template/.agents/skills/ci/SKILL.md +25 -78
  6. package/template/.agents/skills/commit/SKILL.md +39 -43
  7. package/template/.agents/skills/debug/SKILL.md +43 -104
  8. package/template/.agents/skills/deploy/SKILL.md +37 -65
  9. package/template/.agents/skills/insight/SKILL.md +27 -116
  10. package/template/.agents/skills/preview/SKILL.md +24 -103
  11. package/template/.agents/skills/review/SKILL.md +53 -37
  12. package/template/.agents/skills/rollback/SKILL.md +1 -0
  13. package/template/.agents/skills/security-review/SKILL.md +44 -147
  14. package/template/.agents/skills/simplify/SKILL.md +48 -57
  15. package/template/.agents/skills/test/SKILL.md +63 -51
  16. package/template/.claude/skills/70-release/SKILL.md +2 -0
  17. package/template/.claude/skills/ci/SKILL.md +25 -78
  18. package/template/.claude/skills/commit/SKILL.md +39 -43
  19. package/template/.claude/skills/debug/SKILL.md +43 -104
  20. package/template/.claude/skills/deploy/SKILL.md +37 -65
  21. package/template/.claude/skills/insight/SKILL.md +27 -116
  22. package/template/.claude/skills/preview/SKILL.md +24 -103
  23. package/template/.claude/skills/review/SKILL.md +53 -37
  24. package/template/.claude/skills/rollback/SKILL.md +1 -0
  25. package/template/.claude/skills/security-review/SKILL.md +44 -147
  26. package/template/.claude/skills/simplify/SKILL.md +48 -57
  27. package/template/.claude/skills/test/SKILL.md +63 -51
  28. package/template/devflow/history/HISTORY.md +27 -0
  29. package/template/devflow/reference/running-id-contract.md +1 -1
  30. package/template/.agents/skills/9arm-skills/README.md +0 -51
  31. package/template/.agents/skills/9arm-skills/debug-mantra/SKILL.md +0 -86
  32. package/template/.agents/skills/9arm-skills/management-talk/SKILL.md +0 -79
  33. package/template/.agents/skills/9arm-skills/post-mortem/SKILL.md +0 -71
  34. package/template/.agents/skills/9arm-skills/scrutinize/SKILL.md +0 -72
  35. package/template/.agents/skills/browser-testing-with-devtools/SKILL.md +0 -302
  36. package/template/.agents/skills/ci-cd-and-automation/SKILL.md +0 -390
  37. package/template/.agents/skills/code-review-and-quality/SKILL.md +0 -392
  38. package/template/.agents/skills/code-simplification/SKILL.md +0 -331
  39. package/template/.agents/skills/debugging-and-error-recovery/SKILL.md +0 -298
  40. package/template/.agents/skills/deployment-procedures/SKILL.md +0 -241
  41. package/template/.agents/skills/deprecation-and-migration/SKILL.md +0 -206
  42. package/template/.agents/skills/diagnosing-bugs/SKILL.md +0 -93
  43. package/template/.agents/skills/git-workflow-and-versioning/SKILL.md +0 -300
  44. package/template/.agents/skills/human-review-decisions/SKILL.md +0 -74
  45. package/template/.agents/skills/idea-refine/SKILL.md +0 -178
  46. package/template/.agents/skills/idea-refine/examples.md +0 -238
  47. package/template/.agents/skills/idea-refine/frameworks.md +0 -99
  48. package/template/.agents/skills/idea-refine/refinement-criteria.md +0 -113
  49. package/template/.agents/skills/idea-refine/scripts/idea-refine.sh +0 -15
  50. package/template/.agents/skills/incremental-implementation/SKILL.md +0 -248
  51. package/template/.agents/skills/insight-capture/SKILL.md +0 -84
  52. package/template/.agents/skills/intelligent-routing/SKILL.md +0 -176
  53. package/template/.agents/skills/md2html/SKILL.md +0 -154
  54. package/template/.agents/skills/md2html/components.md +0 -505
  55. package/template/.agents/skills/md2html/template.html +0 -1152
  56. package/template/.agents/skills/planning-and-task-breakdown/SKILL.md +0 -239
  57. package/template/.agents/skills/pr-review/SKILL.md +0 -143
  58. package/template/.agents/skills/pr-review-analysis/SKILL.md +0 -89
  59. package/template/.agents/skills/preview-local-check/SKILL.md +0 -59
  60. package/template/.agents/skills/release-git-operations/SKILL.md +0 -97
  61. package/template/.agents/skills/review-followup-routing/SKILL.md +0 -98
  62. package/template/.agents/skills/security-and-hardening/SKILL.md +0 -349
  63. package/template/.agents/skills/security-and-hardening/security-checklist.md +0 -134
  64. package/template/.agents/skills/shipping-and-launch/SKILL.md +0 -311
  65. package/template/.agents/skills/silent-failure-audit/SKILL.md +0 -73
  66. package/template/.agents/skills/spec-orchestration/SKILL.md +0 -91
  67. package/template/.agents/skills/specialist-agent-routing/SKILL.md +0 -107
  68. package/template/.agents/skills/test-driven-development/SKILL.md +0 -422
  69. package/template/.agents/skills/test-driven-development/testing-patterns.md +0 -236
  70. package/template/.agents/skills/test-execution-and-coverage/SKILL.md +0 -56
  71. package/template/.agents/skills/using-agent-skills/SKILL.md +0 -171
  72. package/template/.agents/skills/verification-orchestration/SKILL.md +0 -68
  73. package/template/.agents/skills/vulnerability-scanner/SKILL.md +0 -276
  74. package/template/.agents/skills/vulnerability-scanner/checklists.md +0 -121
  75. package/template/.agents/skills/vulnerability-scanner/scripts/security_scan.py +0 -458
  76. package/template/.agents/skills/wiki/SKILL.md +0 -149
  77. package/template/.agents/skills/workflow-documentation-sync/SKILL.md +0 -87
  78. package/template/.claude/skills/9arm-skills/README.md +0 -51
  79. package/template/.claude/skills/9arm-skills/debug-mantra/SKILL.md +0 -86
  80. package/template/.claude/skills/9arm-skills/management-talk/SKILL.md +0 -79
  81. package/template/.claude/skills/9arm-skills/post-mortem/SKILL.md +0 -71
  82. package/template/.claude/skills/9arm-skills/scrutinize/SKILL.md +0 -72
  83. package/template/.claude/skills/browser-testing-with-devtools/SKILL.md +0 -302
  84. package/template/.claude/skills/ci-cd-and-automation/SKILL.md +0 -390
  85. package/template/.claude/skills/code-review-and-quality/SKILL.md +0 -392
  86. package/template/.claude/skills/code-simplification/SKILL.md +0 -331
  87. package/template/.claude/skills/debugging-and-error-recovery/SKILL.md +0 -298
  88. package/template/.claude/skills/deployment-procedures/SKILL.md +0 -241
  89. package/template/.claude/skills/deprecation-and-migration/SKILL.md +0 -206
  90. package/template/.claude/skills/diagnosing-bugs/SKILL.md +0 -93
  91. package/template/.claude/skills/git-workflow-and-versioning/SKILL.md +0 -300
  92. package/template/.claude/skills/human-review-decisions/SKILL.md +0 -74
  93. package/template/.claude/skills/idea-refine/SKILL.md +0 -178
  94. package/template/.claude/skills/idea-refine/examples.md +0 -238
  95. package/template/.claude/skills/idea-refine/frameworks.md +0 -99
  96. package/template/.claude/skills/idea-refine/refinement-criteria.md +0 -113
  97. package/template/.claude/skills/idea-refine/scripts/idea-refine.sh +0 -15
  98. package/template/.claude/skills/incremental-implementation/SKILL.md +0 -248
  99. package/template/.claude/skills/insight-capture/SKILL.md +0 -84
  100. package/template/.claude/skills/intelligent-routing/SKILL.md +0 -176
  101. package/template/.claude/skills/md2html/SKILL.md +0 -154
  102. package/template/.claude/skills/md2html/components.md +0 -505
  103. package/template/.claude/skills/md2html/template.html +0 -1152
  104. package/template/.claude/skills/planning-and-task-breakdown/SKILL.md +0 -239
  105. package/template/.claude/skills/pr-review/SKILL.md +0 -143
  106. package/template/.claude/skills/pr-review-analysis/SKILL.md +0 -89
  107. package/template/.claude/skills/preview-local-check/SKILL.md +0 -59
  108. package/template/.claude/skills/release-git-operations/SKILL.md +0 -97
  109. package/template/.claude/skills/review-followup-routing/SKILL.md +0 -98
  110. package/template/.claude/skills/security-and-hardening/SKILL.md +0 -349
  111. package/template/.claude/skills/security-and-hardening/security-checklist.md +0 -134
  112. package/template/.claude/skills/shipping-and-launch/SKILL.md +0 -311
  113. package/template/.claude/skills/silent-failure-audit/SKILL.md +0 -73
  114. package/template/.claude/skills/spec-orchestration/SKILL.md +0 -91
  115. package/template/.claude/skills/specialist-agent-routing/SKILL.md +0 -107
  116. package/template/.claude/skills/test-driven-development/SKILL.md +0 -422
  117. package/template/.claude/skills/test-driven-development/testing-patterns.md +0 -236
  118. package/template/.claude/skills/test-execution-and-coverage/SKILL.md +0 -56
  119. package/template/.claude/skills/using-agent-skills/SKILL.md +0 -171
  120. package/template/.claude/skills/verification-orchestration/SKILL.md +0 -68
  121. package/template/.claude/skills/vulnerability-scanner/SKILL.md +0 -276
  122. package/template/.claude/skills/vulnerability-scanner/checklists.md +0 -121
  123. package/template/.claude/skills/vulnerability-scanner/scripts/security_scan.py +0 -458
  124. package/template/.claude/skills/wiki/SKILL.md +0 -149
  125. package/template/.claude/skills/workflow-documentation-sync/SKILL.md +0 -87
@@ -1,458 +0,0 @@
1
- #!/usr/bin/env python3
2
- """
3
- Skill: vulnerability-scanner
4
- Script: security_scan.py
5
- Purpose: Validate that security principles from SKILL.md are applied correctly
6
- Usage: python security_scan.py <project_path> [--scan-type all|deps|secrets|patterns|config]
7
- Output: JSON with validation findings
8
-
9
- This script verifies:
10
- 1. Dependencies - Supply chain security (OWASP A03)
11
- 2. Secrets - No hardcoded credentials (OWASP A04)
12
- 3. Code Patterns - Dangerous patterns identified (OWASP A05)
13
- 4. Configuration - Security settings validated (OWASP A02)
14
- """
15
- import subprocess
16
- import json
17
- import os
18
- import sys
19
- import re
20
- import argparse
21
- from pathlib import Path
22
- from typing import Dict, List, Any
23
- from datetime import datetime
24
-
25
- # Fix Windows console encoding for Unicode output
26
- try:
27
- sys.stdout.reconfigure(encoding='utf-8', errors='replace')
28
- sys.stderr.reconfigure(encoding='utf-8', errors='replace')
29
- except AttributeError:
30
- pass # Python < 3.7
31
-
32
-
33
- # ============================================================================
34
- # CONFIGURATION
35
- # ============================================================================
36
-
37
- SECRET_PATTERNS = [
38
- # API Keys & Tokens
39
- (r'api[_-]?key\s*[=:]\s*["\'][^"\']{10,}["\']', "API Key", "high"),
40
- (r'token\s*[=:]\s*["\'][^"\']{10,}["\']', "Token", "high"),
41
- (r'bearer\s+[a-zA-Z0-9\-_.]+', "Bearer Token", "critical"),
42
-
43
- # Cloud Credentials
44
- (r'AKIA[0-9A-Z]{16}', "AWS Access Key", "critical"),
45
- (r'aws[_-]?secret[_-]?access[_-]?key\s*[=:]\s*["\'][^"\']+["\']', "AWS Secret", "critical"),
46
- (r'AZURE[_-]?[A-Z_]+\s*[=:]\s*["\'][^"\']+["\']', "Azure Credential", "critical"),
47
- (r'GOOGLE[_-]?[A-Z_]+\s*[=:]\s*["\'][^"\']+["\']', "GCP Credential", "critical"),
48
-
49
- # Database & Connections
50
- (r'password\s*[=:]\s*["\'][^"\']{4,}["\']', "Password", "high"),
51
- (r'(mongodb|postgres|mysql|redis):\/\/[^\s"\']+', "Database Connection String", "critical"),
52
-
53
- # Private Keys
54
- (r'-----BEGIN\s+(RSA|PRIVATE|EC)\s+KEY-----', "Private Key", "critical"),
55
- (r'ssh-rsa\s+[A-Za-z0-9+/]+', "SSH Key", "critical"),
56
-
57
- # JWT
58
- (r'eyJ[A-Za-z0-9-_]+\.eyJ[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+', "JWT Token", "high"),
59
- ]
60
-
61
- DANGEROUS_PATTERNS = [
62
- # Injection risks
63
- (r'eval\s*\(', "eval() usage", "critical", "Code Injection risk"),
64
- (r'exec\s*\(', "exec() usage", "critical", "Code Injection risk"),
65
- (r'new\s+Function\s*\(', "Function constructor", "high", "Code Injection risk"),
66
- (r'child_process\.exec\s*\(', "child_process.exec", "high", "Command Injection risk"),
67
- (r'subprocess\.call\s*\([^)]*shell\s*=\s*True', "subprocess with shell=True", "high", "Command Injection risk"),
68
-
69
- # XSS risks
70
- (r'dangerouslySetInnerHTML', "dangerouslySetInnerHTML", "high", "XSS risk"),
71
- (r'\.innerHTML\s*=', "innerHTML assignment", "medium", "XSS risk"),
72
- (r'document\.write\s*\(', "document.write", "medium", "XSS risk"),
73
-
74
- # SQL Injection indicators
75
- (r'["\'][^"\']*\+\s*[a-zA-Z_]+\s*\+\s*["\'].*(?:SELECT|INSERT|UPDATE|DELETE)', "SQL String Concat", "critical", "SQL Injection risk"),
76
- (r'f"[^"]*(?:SELECT|INSERT|UPDATE|DELETE)[^"]*\{', "SQL f-string", "critical", "SQL Injection risk"),
77
-
78
- # Insecure configurations
79
- (r'verify\s*=\s*False', "SSL Verify Disabled", "high", "MITM risk"),
80
- (r'--insecure', "Insecure flag", "medium", "Security disabled"),
81
- (r'disable[_-]?ssl', "SSL Disabled", "high", "MITM risk"),
82
-
83
- # Unsafe deserialization
84
- (r'pickle\.loads?\s*\(', "pickle usage", "high", "Deserialization risk"),
85
- (r'yaml\.load\s*\([^)]*\)(?!\s*,\s*Loader)', "Unsafe YAML load", "high", "Deserialization risk"),
86
- ]
87
-
88
- SKIP_DIRS = {'node_modules', '.git', 'dist', 'build', '__pycache__', '.venv', 'venv', '.next'}
89
- CODE_EXTENSIONS = {'.js', '.ts', '.jsx', '.tsx', '.py', '.go', '.java', '.rb', '.php'}
90
- CONFIG_EXTENSIONS = {'.json', '.yaml', '.yml', '.toml', '.env', '.env.local', '.env.development'}
91
-
92
-
93
- # ============================================================================
94
- # SCANNING FUNCTIONS
95
- # ============================================================================
96
-
97
- def scan_dependencies(project_path: str) -> Dict[str, Any]:
98
- """
99
- Validate supply chain security (OWASP A03).
100
- Checks: npm audit, lock file presence, dependency age.
101
- """
102
- results = {"tool": "dependency_scanner", "findings": [], "status": "[OK] Secure"}
103
-
104
- # Check for lock files
105
- lock_files = {
106
- "npm": ["package-lock.json", "npm-shrinkwrap.json"],
107
- "yarn": ["yarn.lock"],
108
- "pnpm": ["pnpm-lock.yaml"],
109
- "pip": ["requirements.txt", "Pipfile.lock", "poetry.lock"],
110
- }
111
-
112
- found_locks = []
113
- missing_locks = []
114
-
115
- for manager, files in lock_files.items():
116
- pkg_file = "package.json" if manager in ["npm", "yarn", "pnpm"] else "setup.py"
117
- pkg_path = Path(project_path) / pkg_file
118
-
119
- if pkg_path.exists() or (manager == "pip" and (Path(project_path) / "requirements.txt").exists()):
120
- has_lock = any((Path(project_path) / f).exists() for f in files)
121
- if has_lock:
122
- found_locks.append(manager)
123
- else:
124
- missing_locks.append(manager)
125
- results["findings"].append({
126
- "type": "Missing Lock File",
127
- "severity": "high",
128
- "message": f"{manager}: No lock file found. Supply chain integrity at risk."
129
- })
130
-
131
- # Run npm audit if applicable
132
- if (Path(project_path) / "package.json").exists():
133
- try:
134
- result = subprocess.run(
135
- ["npm", "audit", "--json"],
136
- cwd=project_path,
137
- capture_output=True,
138
- text=True,
139
- timeout=60
140
- )
141
-
142
- try:
143
- audit_data = json.loads(result.stdout)
144
- vulnerabilities = audit_data.get("vulnerabilities", {})
145
-
146
- severity_count = {"critical": 0, "high": 0, "moderate": 0, "low": 0}
147
- for vuln in vulnerabilities.values():
148
- sev = vuln.get("severity", "low").lower()
149
- if sev in severity_count:
150
- severity_count[sev] += 1
151
-
152
- if severity_count["critical"] > 0:
153
- results["status"] = "[!!] Critical vulnerabilities"
154
- results["findings"].append({
155
- "type": "npm audit",
156
- "severity": "critical",
157
- "message": f"{severity_count['critical']} critical vulnerabilities in dependencies"
158
- })
159
- elif severity_count["high"] > 0:
160
- results["status"] = "[!] High vulnerabilities"
161
- results["findings"].append({
162
- "type": "npm audit",
163
- "severity": "high",
164
- "message": f"{severity_count['high']} high severity vulnerabilities"
165
- })
166
-
167
- results["npm_audit"] = severity_count
168
-
169
- except json.JSONDecodeError:
170
- pass
171
-
172
- except (FileNotFoundError, subprocess.TimeoutExpired):
173
- pass
174
-
175
- if not results["findings"]:
176
- results["status"] = "[OK] Supply chain checks passed"
177
-
178
- return results
179
-
180
-
181
- def scan_secrets(project_path: str) -> Dict[str, Any]:
182
- """
183
- Validate no hardcoded secrets (OWASP A04).
184
- Checks: API keys, tokens, passwords, cloud credentials.
185
- """
186
- results = {
187
- "tool": "secret_scanner",
188
- "findings": [],
189
- "status": "[OK] No secrets detected",
190
- "scanned_files": 0,
191
- "by_severity": {"critical": 0, "high": 0, "medium": 0}
192
- }
193
-
194
- for root, dirs, files in os.walk(project_path):
195
- dirs[:] = [d for d in dirs if d not in SKIP_DIRS]
196
-
197
- for file in files:
198
- ext = Path(file).suffix.lower()
199
- if ext not in CODE_EXTENSIONS and ext not in CONFIG_EXTENSIONS:
200
- continue
201
-
202
- filepath = Path(root) / file
203
- results["scanned_files"] += 1
204
-
205
- try:
206
- with open(filepath, 'r', encoding='utf-8', errors='ignore') as f:
207
- content = f.read()
208
-
209
- for pattern, secret_type, severity in SECRET_PATTERNS:
210
- matches = re.findall(pattern, content, re.IGNORECASE)
211
- if matches:
212
- results["findings"].append({
213
- "file": str(filepath.relative_to(project_path)),
214
- "type": secret_type,
215
- "severity": severity,
216
- "count": len(matches)
217
- })
218
- results["by_severity"][severity] += len(matches)
219
-
220
- except Exception:
221
- pass
222
-
223
- if results["by_severity"]["critical"] > 0:
224
- results["status"] = "[!!] CRITICAL: Secrets exposed!"
225
- elif results["by_severity"]["high"] > 0:
226
- results["status"] = "[!] HIGH: Secrets found"
227
- elif sum(results["by_severity"].values()) > 0:
228
- results["status"] = "[?] Potential secrets detected"
229
-
230
- # Limit findings for output
231
- results["findings"] = results["findings"][:15]
232
-
233
- return results
234
-
235
-
236
- def scan_code_patterns(project_path: str) -> Dict[str, Any]:
237
- """
238
- Validate dangerous code patterns (OWASP A05).
239
- Checks: Injection risks, XSS, unsafe deserialization.
240
- """
241
- results = {
242
- "tool": "pattern_scanner",
243
- "findings": [],
244
- "status": "[OK] No dangerous patterns",
245
- "scanned_files": 0,
246
- "by_category": {}
247
- }
248
-
249
- for root, dirs, files in os.walk(project_path):
250
- dirs[:] = [d for d in dirs if d not in SKIP_DIRS]
251
-
252
- for file in files:
253
- ext = Path(file).suffix.lower()
254
- if ext not in CODE_EXTENSIONS:
255
- continue
256
-
257
- filepath = Path(root) / file
258
- results["scanned_files"] += 1
259
-
260
- try:
261
- with open(filepath, 'r', encoding='utf-8', errors='ignore') as f:
262
- lines = f.readlines()
263
-
264
- for line_num, line in enumerate(lines, 1):
265
- for pattern, name, severity, category in DANGEROUS_PATTERNS:
266
- if re.search(pattern, line, re.IGNORECASE):
267
- results["findings"].append({
268
- "file": str(filepath.relative_to(project_path)),
269
- "line": line_num,
270
- "pattern": name,
271
- "severity": severity,
272
- "category": category,
273
- "snippet": line.strip()[:80]
274
- })
275
- results["by_category"][category] = results["by_category"].get(category, 0) + 1
276
-
277
- except Exception:
278
- pass
279
-
280
- critical_count = sum(1 for f in results["findings"] if f["severity"] == "critical")
281
- high_count = sum(1 for f in results["findings"] if f["severity"] == "high")
282
-
283
- if critical_count > 0:
284
- results["status"] = f"[!!] CRITICAL: {critical_count} dangerous patterns"
285
- elif high_count > 0:
286
- results["status"] = f"[!] HIGH: {high_count} risky patterns"
287
- elif results["findings"]:
288
- results["status"] = "[?] Some patterns need review"
289
-
290
- # Limit findings
291
- results["findings"] = results["findings"][:20]
292
-
293
- return results
294
-
295
-
296
- def scan_configuration(project_path: str) -> Dict[str, Any]:
297
- """
298
- Validate security configuration (OWASP A02).
299
- Checks: Security headers, CORS, debug modes.
300
- """
301
- results = {
302
- "tool": "config_scanner",
303
- "findings": [],
304
- "status": "[OK] Configuration secure",
305
- "checks": {}
306
- }
307
-
308
- # Check common config files for issues
309
- config_issues = [
310
- (r'"DEBUG"\s*:\s*true', "Debug mode enabled", "high"),
311
- (r'debug\s*=\s*True', "Debug mode enabled", "high"),
312
- (r'NODE_ENV.*development', "Development mode in config", "medium"),
313
- (r'"CORS_ALLOW_ALL".*true', "CORS allow all origins", "high"),
314
- (r'"Access-Control-Allow-Origin".*\*', "CORS wildcard", "high"),
315
- (r'allowCredentials.*true.*origin.*\*', "Dangerous CORS combo", "critical"),
316
- ]
317
-
318
- for root, dirs, files in os.walk(project_path):
319
- dirs[:] = [d for d in dirs if d not in SKIP_DIRS]
320
-
321
- for file in files:
322
- ext = Path(file).suffix.lower()
323
- if ext not in CONFIG_EXTENSIONS and file not in ['next.config.js', 'webpack.config.js', '.eslintrc.js']:
324
- continue
325
-
326
- filepath = Path(root) / file
327
-
328
- try:
329
- with open(filepath, 'r', encoding='utf-8', errors='ignore') as f:
330
- content = f.read()
331
-
332
- for pattern, issue, severity in config_issues:
333
- if re.search(pattern, content, re.IGNORECASE):
334
- results["findings"].append({
335
- "file": str(filepath.relative_to(project_path)),
336
- "issue": issue,
337
- "severity": severity
338
- })
339
-
340
- except Exception:
341
- pass
342
-
343
- # Check for security header configurations
344
- header_files = ["next.config.js", "next.config.mjs", "middleware.ts", "nginx.conf"]
345
- for hf in header_files:
346
- hf_path = Path(project_path) / hf
347
- if hf_path.exists():
348
- results["checks"]["security_headers_config"] = True
349
- break
350
- else:
351
- results["checks"]["security_headers_config"] = False
352
- results["findings"].append({
353
- "issue": "No security headers configuration found",
354
- "severity": "medium",
355
- "recommendation": "Configure CSP, HSTS, X-Frame-Options headers"
356
- })
357
-
358
- if any(f["severity"] == "critical" for f in results["findings"]):
359
- results["status"] = "[!!] CRITICAL: Configuration issues"
360
- elif any(f["severity"] == "high" for f in results["findings"]):
361
- results["status"] = "[!] HIGH: Configuration review needed"
362
- elif results["findings"]:
363
- results["status"] = "[?] Minor configuration issues"
364
-
365
- return results
366
-
367
-
368
- # ============================================================================
369
- # MAIN
370
- # ============================================================================
371
-
372
- def run_full_scan(project_path: str, scan_type: str = "all") -> Dict[str, Any]:
373
- """Execute security validation scans."""
374
-
375
- report = {
376
- "project": project_path,
377
- "timestamp": datetime.now().isoformat(),
378
- "scan_type": scan_type,
379
- "scans": {},
380
- "summary": {
381
- "total_findings": 0,
382
- "critical": 0,
383
- "high": 0,
384
- "overall_status": "[OK] SECURE"
385
- }
386
- }
387
-
388
- scanners = {
389
- "deps": ("dependencies", scan_dependencies),
390
- "secrets": ("secrets", scan_secrets),
391
- "patterns": ("code_patterns", scan_code_patterns),
392
- "config": ("configuration", scan_configuration),
393
- }
394
-
395
- for key, (name, scanner) in scanners.items():
396
- if scan_type == "all" or scan_type == key:
397
- result = scanner(project_path)
398
- report["scans"][name] = result
399
-
400
- findings_count = len(result.get("findings", []))
401
- report["summary"]["total_findings"] += findings_count
402
-
403
- for finding in result.get("findings", []):
404
- sev = finding.get("severity", "low")
405
- if sev == "critical":
406
- report["summary"]["critical"] += 1
407
- elif sev == "high":
408
- report["summary"]["high"] += 1
409
-
410
- # Determine overall status
411
- if report["summary"]["critical"] > 0:
412
- report["summary"]["overall_status"] = "[!!] CRITICAL ISSUES FOUND"
413
- elif report["summary"]["high"] > 0:
414
- report["summary"]["overall_status"] = "[!] HIGH RISK ISSUES"
415
- elif report["summary"]["total_findings"] > 0:
416
- report["summary"]["overall_status"] = "[?] REVIEW RECOMMENDED"
417
-
418
- return report
419
-
420
-
421
- def main():
422
- parser = argparse.ArgumentParser(
423
- description="Validate security principles from vulnerability-scanner skill"
424
- )
425
- parser.add_argument("project_path", nargs="?", default=".", help="Project directory to scan")
426
- parser.add_argument("--scan-type", choices=["all", "deps", "secrets", "patterns", "config"],
427
- default="all", help="Type of scan to run")
428
- parser.add_argument("--output", choices=["json", "summary"], default="json",
429
- help="Output format")
430
-
431
- args = parser.parse_args()
432
-
433
- if not os.path.isdir(args.project_path):
434
- print(json.dumps({"error": f"Directory not found: {args.project_path}"}))
435
- sys.exit(1)
436
-
437
- result = run_full_scan(args.project_path, args.scan_type)
438
-
439
- if args.output == "summary":
440
- print(f"\n{'='*60}")
441
- print(f"Security Scan: {result['project']}")
442
- print(f"{'='*60}")
443
- print(f"Status: {result['summary']['overall_status']}")
444
- print(f"Total Findings: {result['summary']['total_findings']}")
445
- print(f" Critical: {result['summary']['critical']}")
446
- print(f" High: {result['summary']['high']}")
447
- print(f"{'='*60}\n")
448
-
449
- for scan_name, scan_result in result['scans'].items():
450
- print(f"\n{scan_name.upper()}: {scan_result['status']}")
451
- for finding in scan_result.get('findings', [])[:5]:
452
- print(f" - {finding}")
453
- else:
454
- print(json.dumps(result, indent=2))
455
-
456
-
457
- if __name__ == "__main__":
458
- main()
@@ -1,149 +0,0 @@
1
- ---name: wiki
2
-
3
- description: "[Devflow] Knowledge base management, ingestion, linting, and querying under devflow/wiki/."
4
- ---
5
- # Wiki
6
-
7
- In DevFlow 2.0, `Wiki` is a companion command, not a numbered mainline workflow. Its operational behavior remains detailed because wiki compilation is still an active workflow capability.
8
-
9
- ## Purpose
10
-
11
- Use `Wiki` to compile reusable knowledge from verified DevFlow artifacts into a structured Markdown wiki without replacing source artifacts.
12
-
13
- ## Usage
14
-
15
- ```text
16
- Wiki project ingest {source}
17
- Wiki framework ingest {source}
18
- Wiki query {framework|project|all} "{question}"
19
- Wiki lint
20
- Wiki promote project-to-framework {page}
21
- ```
22
-
23
- ## When To Use
24
-
25
- Use `Wiki` when:
26
-
27
- - verified knowledge should be preserved
28
- - framework or project conventions should be documented
29
- - a final report should be promoted into durable knowledge
30
- - review, debug, research, or release output contains reusable patterns
31
-
32
- Preferred DevFlow 2.0 pairing:
33
-
34
- - after `50-verify`
35
- - after `70-release`
36
- - after `60-report`
37
- - after meaningful `Debug` or review output
38
-
39
- ## Process
40
-
41
- `Wiki` turns verified specs, verify reports, RCA reports, PR reviews, research, release notes, and final reports into durable linked pages.
42
-
43
- It supports two namespaces:
44
-
45
- - `framework`: knowledge about Nexus-DevFlow itself
46
- - `project`: knowledge about the project that uses Nexus-DevFlow
47
-
48
- Rules:
49
-
50
- 1. The wiki is compiled knowledge, not source of truth
51
- 2. Ingest only reusable knowledge
52
- 3. Prefer small, focused updates over broad rewrites
53
- 4. Always include source references
54
- 5. Do not promote unresolved hypotheses as settled project knowledge
55
-
56
- ## Canonical Layout
57
-
58
- ```text
59
- devflow/wiki/
60
- |-- framework/
61
- | |-- index.md
62
- | |-- agents/
63
- | |-- commands/
64
- | |-- decisions/
65
- | |-- gotchas/
66
- | |-- token-context/
67
- | `-- workflows/
68
- `-- project/
69
- |-- index.md
70
- |-- architecture/
71
- |-- decisions/
72
- |-- domain/
73
- |-- gotchas/
74
- |-- patterns/
75
- |-- tasks/
76
- |-- token-context/
77
- `-- _drafts/
78
- ```
79
-
80
- ## Process Detail
81
-
82
- ### 1. Classify Scope
83
-
84
- Choose the namespace before editing:
85
-
86
- - use `framework` for DevFlow workflow, agent, command, install, token/context, or framework design knowledge
87
- - use `project` for target project architecture, domain, patterns, decisions, gotchas, and task lessons
88
- - use `promote project-to-framework` only after confirming the lesson applies beyond one project
89
-
90
- ### 2. Load Source Evidence
91
-
92
- Read the source path or range:
93
-
94
- - `devflow/runs/{ID}-*/`
95
- - `devflow/debug/*.md`
96
- - `devflow/reports/*.md`
97
- - `devflow/research/*.md`
98
- - `devflow/lessons.md`
99
- - git diff or commit range when explicit source artifacts are missing
100
-
101
- ### 3. Draft Or Update Pages
102
-
103
- Prefer the smallest page set:
104
-
105
- - create or update one concept page when possible
106
- - add backlinks to related pages with `[[wikilinks]]`
107
- - include a `Sources` section with paths, commits, or reports
108
- - put uncertain or unreviewed pages under `_drafts/`
109
- - avoid broad rewrites of unrelated wiki pages
110
-
111
- ### 4. Lint Before Reporting Complete
112
-
113
- For `lint`, inspect wiki pages for:
114
-
115
- - missing `Sources`
116
- - broken local links or stale paths
117
- - duplicate concept pages
118
- - orphan pages without incoming links
119
- - framework/project namespace leakage
120
-
121
- ## Output
122
-
123
- Return:
124
-
125
- - pages created or updated
126
- - source artifacts used
127
- - unresolved questions or stale-risk notes
128
- - lint result if run
129
-
130
- ## Relationship To DevFlow 2.0
131
-
132
- - Classification: Companion command
133
- - Mainline status: Knowledge system command, not a numbered stage
134
- - Typical entry points: after `50-verify`, `60-report`, `70-release`, `Debug`, `Insight`, `PR-Review`
135
- - Typical handoff targets: return to the originating stage or finish as documentation-only work
136
-
137
- ## Sources
138
-
139
- - `AGENTS.md`
140
- - `.agent/resources/schemas/wiki_page.template.md`
141
- - `.agent/resources/schemas/wiki_project_index.template.md`
142
- - Related commands: `50-verify`, `60-report`, `70-release`, `Debug`, `Insight`, `PR-Review`, `Help`
143
-
144
- ## Next Workflow Recommendation
145
-
146
- - **Primary**: return to the stage or artifact flow that produced the reusable knowledge
147
- - **Why**: `Wiki` compiles lessons after the source work is already validated
148
- - **Common routes**: `60-report`, `70-release`, or `50-verify`
149
-