@qubiit/lmagent 2.5.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/.editorconfig +18 -0
- package/AGENTS.md +169 -0
- package/CLAUDE.md +122 -0
- package/CONTRIBUTING.md +90 -0
- package/LICENSE +21 -0
- package/README.md +195 -0
- package/config/commands.yaml +194 -0
- package/config/levels.yaml +135 -0
- package/config/models.yaml +192 -0
- package/config/settings.yaml +405 -0
- package/config/tools-extended.yaml +534 -0
- package/config/tools.yaml +437 -0
- package/docs/assets/logo.png +0 -0
- package/docs/commands.md +132 -0
- package/docs/customization-guide.md +445 -0
- package/docs/getting-started.md +154 -0
- package/docs/how-to-start.md +242 -0
- package/docs/navigation-index.md +227 -0
- package/docs/usage-guide.md +113 -0
- package/install.js +1044 -0
- package/package.json +35 -0
- package/pyproject.toml +182 -0
- package/rules/_bootstrap.md +138 -0
- package/rules/agents-ia.md +607 -0
- package/rules/api-design.md +337 -0
- package/rules/automations-n8n.md +646 -0
- package/rules/code-style.md +570 -0
- package/rules/documentation.md +98 -0
- package/rules/security.md +316 -0
- package/rules/stack.md +395 -0
- package/rules/testing.md +326 -0
- package/rules/workflow.md +353 -0
- package/scripts/create_skill.js +300 -0
- package/scripts/validate_skills.js +283 -0
- package/skills/ai-agent-engineer/SKILL.md +394 -0
- package/skills/ai-agent-engineer/references/agent-patterns.md +149 -0
- package/skills/api-designer/SKILL.md +429 -0
- package/skills/api-designer/references/api-standards.md +13 -0
- package/skills/architect/SKILL.md +285 -0
- package/skills/architect/references/c4-model.md +133 -0
- package/skills/automation-engineer/SKILL.md +352 -0
- package/skills/automation-engineer/references/n8n-patterns.md +127 -0
- package/skills/backend-engineer/SKILL.md +261 -0
- package/skills/backend-engineer/assets/fastapi-project-structure.yaml +74 -0
- package/skills/backend-engineer/references/debugging-guide.md +174 -0
- package/skills/backend-engineer/references/design-patterns.md +208 -0
- package/skills/backend-engineer/scripts/scaffold_backend.py +313 -0
- package/skills/bmad-methodology/SKILL.md +202 -0
- package/skills/bmad-methodology/references/scale-adaptive-levels.md +141 -0
- package/skills/browser-agent/SKILL.md +502 -0
- package/skills/browser-agent/scripts/playwright_setup.ts +16 -0
- package/skills/code-reviewer/SKILL.md +306 -0
- package/skills/code-reviewer/references/code-review-checklist.md +16 -0
- package/skills/data-engineer/SKILL.md +474 -0
- package/skills/data-engineer/assets/pg-monitoring-queries.sql +154 -0
- package/skills/data-engineer/references/index-strategy.md +128 -0
- package/skills/data-engineer/scripts/backup_postgres.py +221 -0
- package/skills/devops-engineer/SKILL.md +547 -0
- package/skills/devops-engineer/references/ci-cd-patterns.md +265 -0
- package/skills/devops-engineer/scripts/docker_healthcheck.py +125 -0
- package/skills/document-generator/SKILL.md +746 -0
- package/skills/document-generator/references/pdf-generation.md +22 -0
- package/skills/frontend-engineer/SKILL.md +532 -0
- package/skills/frontend-engineer/references/accessibility-guide.md +146 -0
- package/skills/frontend-engineer/scripts/audit_bundle.py +144 -0
- package/skills/git-workflow/SKILL.md +374 -0
- package/skills/git-workflow/references/git-flow.md +25 -0
- package/skills/mcp-builder/SKILL.md +471 -0
- package/skills/mcp-builder/references/mcp-server-guide.md +23 -0
- package/skills/mobile-engineer/SKILL.md +502 -0
- package/skills/mobile-engineer/references/platform-guidelines.md +160 -0
- package/skills/orchestrator/SKILL.md +246 -0
- package/skills/orchestrator/references/methodology-routing.md +117 -0
- package/skills/orchestrator/references/persona-mapping.md +85 -0
- package/skills/orchestrator/references/routing-logic.md +110 -0
- package/skills/performance-engineer/SKILL.md +549 -0
- package/skills/performance-engineer/references/caching-patterns.md +181 -0
- package/skills/performance-engineer/scripts/profile_endpoint.py +170 -0
- package/skills/product-manager/SKILL.md +488 -0
- package/skills/product-manager/references/prioritization-frameworks.md +126 -0
- package/skills/prompt-engineer/SKILL.md +433 -0
- package/skills/prompt-engineer/references/prompt-patterns.md +158 -0
- package/skills/qa-engineer/SKILL.md +441 -0
- package/skills/qa-engineer/references/testing-strategy.md +166 -0
- package/skills/qa-engineer/scripts/run_coverage.py +147 -0
- package/skills/scrum-master/SKILL.md +225 -0
- package/skills/scrum-master/references/sprint-ceremonies.md +159 -0
- package/skills/security-analyst/SKILL.md +390 -0
- package/skills/security-analyst/references/owasp-top10.md +188 -0
- package/skills/security-analyst/scripts/audit_security.py +242 -0
- package/skills/seo-auditor/SKILL.md +523 -0
- package/skills/seo-auditor/references/seo-checklist.md +17 -0
- package/skills/spec-driven-dev/SKILL.md +342 -0
- package/skills/spec-driven-dev/references/phase-gates.md +107 -0
- package/skills/supabase-expert/SKILL.md +602 -0
- package/skills/supabase-expert/references/supabase-patterns.md +19 -0
- package/skills/swe-agent/SKILL.md +311 -0
- package/skills/swe-agent/references/trajectory-format.md +134 -0
- package/skills/systematic-debugger/SKILL.md +512 -0
- package/skills/systematic-debugger/references/debugging-guide.md +12 -0
- package/skills/tech-lead/SKILL.md +409 -0
- package/skills/tech-lead/references/code-review-checklist.md +111 -0
- package/skills/technical-writer/SKILL.md +631 -0
- package/skills/technical-writer/references/doc-templates.md +218 -0
- package/skills/testing-strategist/SKILL.md +476 -0
- package/skills/testing-strategist/references/testing-pyramid.md +16 -0
- package/skills/ux-ui-designer/SKILL.md +419 -0
- package/skills/ux-ui-designer/references/design-system-foundation.md +168 -0
- package/skills_overview.txt +94 -0
- package/templates/PROJECT_KICKOFF.md +284 -0
- package/templates/SKILL_TEMPLATE.md +131 -0
- package/templates/USAGE.md +95 -0
- package/templates/agent-python/README.md +71 -0
- package/templates/agent-python/agent.py +272 -0
- package/templates/agent-python/config.yaml +76 -0
- package/templates/agent-python/prompts/system.md +109 -0
- package/templates/agent-python/requirements.txt +7 -0
- package/templates/automation-n8n/README.md +14 -0
- package/templates/automation-n8n/webhook-handler.json +57 -0
- package/templates/backend-node/Dockerfile +12 -0
- package/templates/backend-node/README.md +15 -0
- package/templates/backend-node/package.json +30 -0
- package/templates/backend-node/src/index.ts +19 -0
- package/templates/backend-node/src/routes.ts +7 -0
- package/templates/backend-node/tsconfig.json +22 -0
- package/templates/backend-python/Dockerfile +11 -0
- package/templates/backend-python/README.md +78 -0
- package/templates/backend-python/app/core/config.py +12 -0
- package/templates/backend-python/app/core/database.py +12 -0
- package/templates/backend-python/app/main.py +17 -0
- package/templates/backend-python/app/routers/__init__.py +1 -0
- package/templates/backend-python/app/routers/health.py +7 -0
- package/templates/backend-python/requirements-dev.txt +6 -0
- package/templates/backend-python/requirements.txt +4 -0
- package/templates/backend-python/tests/test_health.py +9 -0
- package/templates/checkpoint.yaml +117 -0
- package/templates/database/README.md +474 -0
- package/templates/frontend-react/README.md +446 -0
- package/templates/plan.yaml +320 -0
- package/templates/session.yaml +125 -0
- package/templates/spec.yaml +229 -0
- package/templates/tasks.yaml +330 -0
- package/workflows/bugfix-backend.md +380 -0
- package/workflows/documentation.md +232 -0
- package/workflows/generate-prd.md +320 -0
- package/workflows/ideation.md +396 -0
- package/workflows/new-agent-ia.md +497 -0
- package/workflows/new-automation.md +374 -0
- package/workflows/new-feature.md +290 -0
- package/workflows/optimize-performance.md +373 -0
- package/workflows/resolve-github-issue.md +524 -0
- package/workflows/security-review.md +291 -0
- package/workflows/spec-driven.md +476 -0
- package/workflows/testing-strategy.md +296 -0
- package/workflows/third-party-integration.md +277 -0
|
@@ -0,0 +1,242 @@
|
|
|
1
|
+
#!/usr/bin/env python3
|
|
2
|
+
"""
|
|
3
|
+
LMAgent - Security Audit Script
|
|
4
|
+
Audita un proyecto buscando vulnerabilidades comunes.
|
|
5
|
+
|
|
6
|
+
Uso:
|
|
7
|
+
python audit_security.py --path ./mi-proyecto
|
|
8
|
+
python audit_security.py --path ./mi-proyecto --check secrets
|
|
9
|
+
python audit_security.py --path ./mi-proyecto --check dependencies
|
|
10
|
+
python audit_security.py --path ./mi-proyecto --check all
|
|
11
|
+
"""
|
|
12
|
+
|
|
13
|
+
import argparse
|
|
14
|
+
import json
|
|
15
|
+
import os
|
|
16
|
+
import re
|
|
17
|
+
import subprocess
|
|
18
|
+
import sys
|
|
19
|
+
from pathlib import Path
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
# Patrones de secretos comunes
|
|
23
|
+
SECRET_PATTERNS = [
|
|
24
|
+
(r'(?i)(api[_-]?key|apikey)\s*[=:]\s*["\']?[A-Za-z0-9_\-]{16,}', "API Key"),
|
|
25
|
+
(r'(?i)(secret[_-]?key|secretkey)\s*[=:]\s*["\']?[A-Za-z0-9_\-]{16,}', "Secret Key"),
|
|
26
|
+
(r'(?i)(password|passwd|pwd)\s*[=:]\s*["\']?[^\s"\']{8,}', "Password"),
|
|
27
|
+
(r'(?i)(token)\s*[=:]\s*["\']?[A-Za-z0-9_\-\.]{20,}', "Token"),
|
|
28
|
+
(r'(?i)(aws[_-]?access[_-]?key)\s*[=:]\s*["\']?AKIA[A-Z0-9]{12,}', "AWS Access Key"),
|
|
29
|
+
(r'(?i)(private[_-]?key)\s*[=:]\s*["\']?-----BEGIN', "Private Key"),
|
|
30
|
+
(r'postgresql://[^:]+:[^@]+@', "Database Connection String"),
|
|
31
|
+
(r'mongodb(\+srv)?://[^:]+:[^@]+@', "MongoDB Connection String"),
|
|
32
|
+
(r'redis://[^:]*:[^@]+@', "Redis Connection String"),
|
|
33
|
+
]
|
|
34
|
+
|
|
35
|
+
# Extensiones a escanear
|
|
36
|
+
SCAN_EXTENSIONS = {
|
|
37
|
+
".py", ".js", ".ts", ".jsx", ".tsx", ".env", ".yaml", ".yml",
|
|
38
|
+
".json", ".toml", ".cfg", ".ini", ".conf", ".sh",
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
# Archivos/directorios a ignorar
|
|
42
|
+
IGNORE_DIRS = {
|
|
43
|
+
"node_modules", ".git", "__pycache__", ".venv", "venv",
|
|
44
|
+
"dist", "build", ".next", "coverage",
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
|
|
48
|
+
def scan_secrets(project_path: Path) -> list[dict]:
|
|
49
|
+
"""Escanea archivos buscando secretos hardcodeados."""
|
|
50
|
+
findings = []
|
|
51
|
+
|
|
52
|
+
for root, dirs, files in os.walk(project_path):
|
|
53
|
+
# Filtrar directorios ignorados
|
|
54
|
+
dirs[:] = [d for d in dirs if d not in IGNORE_DIRS]
|
|
55
|
+
|
|
56
|
+
for filename in files:
|
|
57
|
+
filepath = Path(root) / filename
|
|
58
|
+
|
|
59
|
+
# Solo escanear extensiones relevantes
|
|
60
|
+
if filepath.suffix not in SCAN_EXTENSIONS:
|
|
61
|
+
continue
|
|
62
|
+
|
|
63
|
+
# Ignorar archivos .example y .template
|
|
64
|
+
if ".example" in filepath.name or ".template" in filepath.name:
|
|
65
|
+
continue
|
|
66
|
+
|
|
67
|
+
try:
|
|
68
|
+
content = filepath.read_text(encoding="utf-8", errors="ignore")
|
|
69
|
+
for line_num, line in enumerate(content.split("\n"), 1):
|
|
70
|
+
for pattern, secret_type in SECRET_PATTERNS:
|
|
71
|
+
if re.search(pattern, line):
|
|
72
|
+
# Verificar que no es un placeholder
|
|
73
|
+
if any(ph in line.lower() for ph in [
|
|
74
|
+
"example", "placeholder", "change-me",
|
|
75
|
+
"your-", "xxx", "todo", "fixme",
|
|
76
|
+
"os.getenv", "process.env", "environ",
|
|
77
|
+
]):
|
|
78
|
+
continue
|
|
79
|
+
|
|
80
|
+
findings.append({
|
|
81
|
+
"type": secret_type,
|
|
82
|
+
"file": str(filepath.relative_to(project_path)),
|
|
83
|
+
"line": line_num,
|
|
84
|
+
"severity": "HIGH",
|
|
85
|
+
"snippet": line.strip()[:80] + "...",
|
|
86
|
+
})
|
|
87
|
+
except (UnicodeDecodeError, PermissionError):
|
|
88
|
+
continue
|
|
89
|
+
|
|
90
|
+
return findings
|
|
91
|
+
|
|
92
|
+
|
|
93
|
+
def check_env_file(project_path: Path) -> list[dict]:
|
|
94
|
+
"""Verifica que no haya archivos .env versionados."""
|
|
95
|
+
findings = []
|
|
96
|
+
|
|
97
|
+
env_files = list(project_path.glob("**/.env"))
|
|
98
|
+
env_files += list(project_path.glob("**/.env.local"))
|
|
99
|
+
env_files += list(project_path.glob("**/.env.production"))
|
|
100
|
+
|
|
101
|
+
for env_file in env_files:
|
|
102
|
+
if ".git" not in str(env_file):
|
|
103
|
+
findings.append({
|
|
104
|
+
"type": "Unprotected .env file",
|
|
105
|
+
"file": str(env_file.relative_to(project_path)),
|
|
106
|
+
"severity": "MEDIUM",
|
|
107
|
+
"recommendation": "Asegurar que .env esté en .gitignore",
|
|
108
|
+
})
|
|
109
|
+
|
|
110
|
+
# Verificar .gitignore
|
|
111
|
+
gitignore = project_path / ".gitignore"
|
|
112
|
+
if gitignore.exists():
|
|
113
|
+
content = gitignore.read_text()
|
|
114
|
+
if ".env" not in content:
|
|
115
|
+
findings.append({
|
|
116
|
+
"type": ".env not in .gitignore",
|
|
117
|
+
"file": ".gitignore",
|
|
118
|
+
"severity": "HIGH",
|
|
119
|
+
"recommendation": "Agregar .env a .gitignore",
|
|
120
|
+
})
|
|
121
|
+
|
|
122
|
+
return findings
|
|
123
|
+
|
|
124
|
+
|
|
125
|
+
def check_dependencies(project_path: Path) -> list[dict]:
|
|
126
|
+
"""Verifica vulnerabilidades en dependencias."""
|
|
127
|
+
findings = []
|
|
128
|
+
|
|
129
|
+
# Python: pip audit
|
|
130
|
+
req_file = project_path / "requirements.txt"
|
|
131
|
+
if req_file.exists():
|
|
132
|
+
try:
|
|
133
|
+
result = subprocess.run(
|
|
134
|
+
[sys.executable, "-m", "pip", "audit", "-r", str(req_file)],
|
|
135
|
+
capture_output=True, text=True, timeout=60
|
|
136
|
+
)
|
|
137
|
+
if result.returncode != 0:
|
|
138
|
+
findings.append({
|
|
139
|
+
"type": "Python dependency vulnerabilities",
|
|
140
|
+
"output": result.stdout[:500],
|
|
141
|
+
"severity": "HIGH",
|
|
142
|
+
})
|
|
143
|
+
except (FileNotFoundError, subprocess.TimeoutExpired):
|
|
144
|
+
findings.append({
|
|
145
|
+
"type": "pip-audit not available",
|
|
146
|
+
"severity": "INFO",
|
|
147
|
+
"recommendation": "Instalar: pip install pip-audit",
|
|
148
|
+
})
|
|
149
|
+
|
|
150
|
+
# Node: npm audit
|
|
151
|
+
pkg_file = project_path / "package.json"
|
|
152
|
+
if pkg_file.exists():
|
|
153
|
+
try:
|
|
154
|
+
result = subprocess.run(
|
|
155
|
+
["npm", "audit", "--json"],
|
|
156
|
+
capture_output=True, text=True,
|
|
157
|
+
cwd=str(project_path), timeout=60
|
|
158
|
+
)
|
|
159
|
+
if result.returncode != 0:
|
|
160
|
+
try:
|
|
161
|
+
audit_data = json.loads(result.stdout)
|
|
162
|
+
vuln_count = audit_data.get("metadata", {}).get("vulnerabilities", {})
|
|
163
|
+
findings.append({
|
|
164
|
+
"type": "NPM dependency vulnerabilities",
|
|
165
|
+
"high": vuln_count.get("high", 0),
|
|
166
|
+
"critical": vuln_count.get("critical", 0),
|
|
167
|
+
"severity": "HIGH" if vuln_count.get("critical", 0) > 0 else "MEDIUM",
|
|
168
|
+
})
|
|
169
|
+
except json.JSONDecodeError:
|
|
170
|
+
pass
|
|
171
|
+
except (FileNotFoundError, subprocess.TimeoutExpired):
|
|
172
|
+
pass
|
|
173
|
+
|
|
174
|
+
return findings
|
|
175
|
+
|
|
176
|
+
|
|
177
|
+
def print_report(all_findings: dict):
|
|
178
|
+
"""Imprime el reporte de auditoría."""
|
|
179
|
+
print("\n" + "=" * 60)
|
|
180
|
+
print("🛡️ SECURITY AUDIT REPORT")
|
|
181
|
+
print("=" * 60)
|
|
182
|
+
|
|
183
|
+
total = sum(len(f) for f in all_findings.values())
|
|
184
|
+
|
|
185
|
+
for category, findings in all_findings.items():
|
|
186
|
+
if findings:
|
|
187
|
+
print(f"\n🔍 {category} ({len(findings)} hallazgos)")
|
|
188
|
+
print("-" * 40)
|
|
189
|
+
for f in findings:
|
|
190
|
+
severity_icon = {"HIGH": "🔴", "MEDIUM": "🟡", "LOW": "🟢", "INFO": "ℹ️"}.get(
|
|
191
|
+
f.get("severity", "INFO"), "ℹ️"
|
|
192
|
+
)
|
|
193
|
+
print(f" {severity_icon} [{f.get('severity', 'INFO')}] {f.get('type', 'Unknown')}")
|
|
194
|
+
if "file" in f:
|
|
195
|
+
print(f" File: {f['file']}")
|
|
196
|
+
if "line" in f:
|
|
197
|
+
print(f" Line: {f['line']}")
|
|
198
|
+
if "recommendation" in f:
|
|
199
|
+
print(f" Fix: {f['recommendation']}")
|
|
200
|
+
|
|
201
|
+
high_count = sum(1 for fs in all_findings.values() for f in fs if f.get("severity") == "HIGH")
|
|
202
|
+
print(f"\n{'=' * 60}")
|
|
203
|
+
print(f"Total: {total} hallazgos ({high_count} HIGH)")
|
|
204
|
+
print(f"{'=' * 60}")
|
|
205
|
+
|
|
206
|
+
return high_count
|
|
207
|
+
|
|
208
|
+
|
|
209
|
+
def main():
|
|
210
|
+
parser = argparse.ArgumentParser(description="LMAgent Security Audit")
|
|
211
|
+
parser.add_argument("--path", "-p", default=".", help="Ruta del proyecto")
|
|
212
|
+
parser.add_argument(
|
|
213
|
+
"--check", "-c",
|
|
214
|
+
choices=["secrets", "env", "dependencies", "all"],
|
|
215
|
+
default="all",
|
|
216
|
+
help="Tipo de check"
|
|
217
|
+
)
|
|
218
|
+
|
|
219
|
+
args = parser.parse_args()
|
|
220
|
+
project_path = Path(args.path).resolve()
|
|
221
|
+
|
|
222
|
+
if not project_path.exists():
|
|
223
|
+
print(f"❌ Ruta no encontrada: {project_path}")
|
|
224
|
+
sys.exit(1)
|
|
225
|
+
|
|
226
|
+
all_findings = {}
|
|
227
|
+
|
|
228
|
+
if args.check in ("secrets", "all"):
|
|
229
|
+
all_findings["Secretos Hardcodeados"] = scan_secrets(project_path)
|
|
230
|
+
|
|
231
|
+
if args.check in ("env", "all"):
|
|
232
|
+
all_findings["Archivos .env"] = check_env_file(project_path)
|
|
233
|
+
|
|
234
|
+
if args.check in ("dependencies", "all"):
|
|
235
|
+
all_findings["Dependencias Vulnerables"] = check_dependencies(project_path)
|
|
236
|
+
|
|
237
|
+
high_count = print_report(all_findings)
|
|
238
|
+
sys.exit(1 if high_count > 0 else 0)
|
|
239
|
+
|
|
240
|
+
|
|
241
|
+
if __name__ == "__main__":
|
|
242
|
+
main()
|