Skip to content

ddtcorex/maestro-skills / skills/magento2-dev-core

magento2-dev-core

Verified

Use for Magento 2 module work: architecture, dependency injection, repositories, plugins, secure backend code, CLI, cron. Core skill, always load it first. Keywords dependency injection, plugin.

scripts/report/lib/findings-layout.mjs

View on GitHub
import { escapeHtml as e } from './html.mjs'
import { mdTable } from './markdown.mjs'
import { SEVERITIES } from './validate.mjs'

const BADGE = { critical: 'badge-red', high: 'badge-red', medium: 'badge-yellow', low: 'badge-gray' }

export const FINDINGS_SECTIONS = ['Verdict', 'Summary', 'Findings', 'Coverage Note']

// Sentence template over the counts, for example "2 high, 1 medium findings; no critical".
export function findingsVerdict(summary) {
  const parts = SEVERITIES.filter((s) => summary[s] > 0).map((s) => `${summary[s]} ${s}`)
  if (parts.length === 0) return 'No findings'
  const tail = summary.critical > 0 ? '' : '; no critical'
  return `${parts.join(', ')} findings${tail}`
}

const location = (f) => (f.line ? `${f.file}:${f.line}` : f.file)
const label = (f) => f.code ?? f.rule

export function buildFindings(data, _audience) {
  const findings = [...data.findings].sort((a, b) => SEVERITIES.indexOf(a.severity) - SEVERITIES.indexOf(b.severity))
  const verdict = findingsVerdict(data.summary)
  const title = `${data.tool} report`
  const slots = {
    title: e(title),
    date: e((data.generatedAt ?? '').slice(0, 10)),
    tool: e(data.tool),
    scope: e(data.scope),
    target: e(data.target),
    verdict: e(verdict),
    summary_rows: SEVERITIES.map((s) => `<tr><td><span class="badge ${BADGE[s]}">${s}</span></td><td>${data.summary[s]}</td></tr>`).join('\n    '),
    finding_rows: findings
      .map((f) => `<tr><td><span class="badge ${BADGE[f.severity]}">${f.severity}</span></td><td><code>${e(label(f))}</code></td><td class="url"><code>${e(location(f))}</code></td><td>${e(f.message)}</td><td>${e(f.fix ?? '')}</td></tr>`)
      .join('\n    '),
    finding_count: String(findings.length),
    coverage_note: e(data.coverageNote ?? `${data.tool} on ${data.scope} scope, target ${data.target}`),
  }
  const md = {
    Verdict: verdict,
    Summary: mdTable(['Severity', 'Count'], SEVERITIES.map((s) => [s, data.summary[s]])),
    Findings: findings.map((f) => `- **[${label(f)}]** ${f.severity}, \`${location(f)}\`, ${f.message}${f.fix ? `, fix: ${f.fix}` : ''}`).join('\n'),
    'Coverage Note': slots.coverage_note,
  }
  return {
    slots,
    title,
    metaLines: [`Tool: ${data.tool} | Scope: ${data.scope} | Target: ${data.target}`],
    sections: FINDINGS_SECTIONS.map((t) => ({ title: t, body: md[t] })),
  }
}
reverse-engineer-anythingmorluto/reaReverse engineer native, managed, Electron/JavaScript, packaged, firmware, and browser targets with REA, and build agent environments (AgentEnv bundles) of web applications from a live instance or a capture, and of Linux desktop apps with a task from a request. Use shipped-artifact or requested runtime evidence to explain features, compare versions, decompile code, or guide a reconstruction. Skip REA for ordinary source-repository architecture analysis.Stars: 471kUpdated Claude CodeCodexVerifiedInstall
diagnosing-superpowersobra/superpowersUse when a superpowers session went wrong and your human partner wants to know why — repeated work, ignored plans, stumbles, poor results, a skill that didn't fire, "it took too long", "why is it so expensive", "what is it doing" — or wants to build a bug report for the superpowers maintainers, for the current session or a past one identified by id or path, on any harness.Stars: 322kUpdated Claude CodeCodexVerifiedInstall
dispatching-parallel-agentsobra/superpowersUse when facing 2+ independent tasks that can be worked on without shared state or sequential dependenciesStars: 322kUpdated Claude CodeCodexVerifiedInstall
executing-plansobra/superpowersUse when executing an implementation plan in the current session as the implementer yourself — your human partner chose inline execution, or no subagent tool is availableStars: 322kUpdated Claude CodeCodexVerifiedInstall