nexakit 0.0.0-stage → 0.2.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/.claude-plugin/marketplace.json +28 -0
- package/LICENSE +26 -0
- package/README.md +79 -2
- package/agents/claude/docs-researcher.md +9 -0
- package/agents/claude/implementation-tutor.md +9 -0
- package/agents/claude/project-explorer.md +9 -0
- package/agents/claude/quality-reviewer.md +9 -0
- package/agents/claude/requirements-analyst.md +9 -0
- package/agents/claude/solution-architect.md +9 -0
- package/agents/codex/docs-researcher.toml +10 -0
- package/agents/codex/implementation-tutor.toml +10 -0
- package/agents/codex/project-explorer.toml +10 -0
- package/agents/codex/quality-reviewer.toml +10 -0
- package/agents/codex/requirements-analyst.toml +11 -0
- package/agents/codex/solution-architect.toml +10 -0
- package/assets/brand/README.md +38 -0
- package/assets/brand/agent-toolkit-mark.png +0 -0
- package/assets/brand/agent-toolkit-mark.svg +13 -0
- package/assets/brand/agent-toolkit-tui-hero.png +0 -0
- package/assets/brand/nexakit-readme-hero.png +0 -0
- package/assets/brand/nexakit-readme-hero.svg +21 -0
- package/assets/runtime/package-lock.json +1425 -0
- package/bin/agent-task.js +14 -0
- package/bin/agent-toolkit-gemini.js +13 -0
- package/bin/agent-toolkit-inbox.js +14 -0
- package/bin/agent-toolkit-mcp.js +17 -0
- package/bin/agent-toolkit.js +13 -0
- package/bin/nexakit.js +13 -0
- package/bin/project-memory-mcp.js +22 -0
- package/bin/project-memory.js +7 -0
- package/catalogs/skills/api-design-principles/LICENSE.txt +21 -0
- package/catalogs/skills/api-design-principles/SKILL.md +110 -0
- package/catalogs/skills/api-design-principles/assets/api-design-checklist.md +155 -0
- package/catalogs/skills/api-design-principles/assets/rest-api-template.py +185 -0
- package/catalogs/skills/api-design-principles/references/details.md +413 -0
- package/catalogs/skills/api-design-principles/references/graphql-schema-design.md +589 -0
- package/catalogs/skills/api-design-principles/references/rest-best-practices.md +408 -0
- package/catalogs/skills/nodejs-backend-patterns/LICENSE.txt +21 -0
- package/catalogs/skills/nodejs-backend-patterns/SKILL.md +45 -0
- package/catalogs/skills/nodejs-backend-patterns/references/advanced-patterns.md +430 -0
- package/catalogs/skills/nodejs-backend-patterns/references/details.md +599 -0
- package/catalogs/skills/supabase-postgres-best-practices/CHANGELOG.md +73 -0
- package/catalogs/skills/supabase-postgres-best-practices/LICENSE.txt +21 -0
- package/catalogs/skills/supabase-postgres-best-practices/SKILL.md +64 -0
- package/catalogs/skills/supabase-postgres-best-practices/references/_contributing.md +170 -0
- package/catalogs/skills/supabase-postgres-best-practices/references/_sections.md +39 -0
- package/catalogs/skills/supabase-postgres-best-practices/references/_template.md +34 -0
- package/catalogs/skills/supabase-postgres-best-practices/references/advanced-full-text-search.md +55 -0
- package/catalogs/skills/supabase-postgres-best-practices/references/advanced-jsonb-indexing.md +49 -0
- package/catalogs/skills/supabase-postgres-best-practices/references/conn-idle-timeout.md +46 -0
- package/catalogs/skills/supabase-postgres-best-practices/references/conn-limits.md +44 -0
- package/catalogs/skills/supabase-postgres-best-practices/references/conn-pooling.md +41 -0
- package/catalogs/skills/supabase-postgres-best-practices/references/conn-prepared-statements.md +46 -0
- package/catalogs/skills/supabase-postgres-best-practices/references/data-batch-inserts.md +54 -0
- package/catalogs/skills/supabase-postgres-best-practices/references/data-n-plus-one.md +53 -0
- package/catalogs/skills/supabase-postgres-best-practices/references/data-pagination.md +50 -0
- package/catalogs/skills/supabase-postgres-best-practices/references/data-upsert.md +50 -0
- package/catalogs/skills/supabase-postgres-best-practices/references/lock-advisory.md +56 -0
- package/catalogs/skills/supabase-postgres-best-practices/references/lock-deadlock-prevention.md +68 -0
- package/catalogs/skills/supabase-postgres-best-practices/references/lock-short-transactions.md +50 -0
- package/catalogs/skills/supabase-postgres-best-practices/references/lock-skip-locked.md +54 -0
- package/catalogs/skills/supabase-postgres-best-practices/references/monitor-explain-analyze.md +45 -0
- package/catalogs/skills/supabase-postgres-best-practices/references/monitor-pg-stat-statements.md +55 -0
- package/catalogs/skills/supabase-postgres-best-practices/references/monitor-vacuum-analyze.md +55 -0
- package/catalogs/skills/supabase-postgres-best-practices/references/query-composite-indexes.md +44 -0
- package/catalogs/skills/supabase-postgres-best-practices/references/query-covering-indexes.md +40 -0
- package/catalogs/skills/supabase-postgres-best-practices/references/query-index-types.md +48 -0
- package/catalogs/skills/supabase-postgres-best-practices/references/query-missing-indexes.md +43 -0
- package/catalogs/skills/supabase-postgres-best-practices/references/query-partial-indexes.md +45 -0
- package/catalogs/skills/supabase-postgres-best-practices/references/schema-constraints.md +80 -0
- package/catalogs/skills/supabase-postgres-best-practices/references/schema-data-types.md +46 -0
- package/catalogs/skills/supabase-postgres-best-practices/references/schema-foreign-key-indexes.md +59 -0
- package/catalogs/skills/supabase-postgres-best-practices/references/schema-lowercase-identifiers.md +55 -0
- package/catalogs/skills/supabase-postgres-best-practices/references/schema-partitioning.md +55 -0
- package/catalogs/skills/supabase-postgres-best-practices/references/schema-primary-keys.md +61 -0
- package/catalogs/skills/supabase-postgres-best-practices/references/security-privileges.md +54 -0
- package/catalogs/skills/supabase-postgres-best-practices/references/security-rls-basics.md +50 -0
- package/catalogs/skills/supabase-postgres-best-practices/references/security-rls-performance.md +63 -0
- package/catalogs/skills/vercel-composition-patterns/AGENTS.md +946 -0
- package/catalogs/skills/vercel-composition-patterns/LICENSE.txt +27 -0
- package/catalogs/skills/vercel-composition-patterns/README.md +60 -0
- package/catalogs/skills/vercel-composition-patterns/SKILL.md +89 -0
- package/catalogs/skills/vercel-composition-patterns/metadata.json +11 -0
- package/catalogs/skills/vercel-composition-patterns/rules/_sections.md +29 -0
- package/catalogs/skills/vercel-composition-patterns/rules/_template.md +24 -0
- package/catalogs/skills/vercel-composition-patterns/rules/architecture-avoid-boolean-props.md +100 -0
- package/catalogs/skills/vercel-composition-patterns/rules/architecture-compound-components.md +112 -0
- package/catalogs/skills/vercel-composition-patterns/rules/patterns-children-over-render-props.md +87 -0
- package/catalogs/skills/vercel-composition-patterns/rules/patterns-explicit-variants.md +100 -0
- package/catalogs/skills/vercel-composition-patterns/rules/react19-no-forwardref.md +42 -0
- package/catalogs/skills/vercel-composition-patterns/rules/state-context-interface.md +191 -0
- package/catalogs/skills/vercel-composition-patterns/rules/state-decouple-implementation.md +113 -0
- package/catalogs/skills/vercel-composition-patterns/rules/state-lift-state.md +125 -0
- package/catalogs/skills/vercel-react-best-practices/AGENTS.md +3810 -0
- package/catalogs/skills/vercel-react-best-practices/LICENSE.txt +27 -0
- package/catalogs/skills/vercel-react-best-practices/README.md +123 -0
- package/catalogs/skills/vercel-react-best-practices/SKILL.md +149 -0
- package/catalogs/skills/vercel-react-best-practices/metadata.json +15 -0
- package/catalogs/skills/vercel-react-best-practices/rules/_sections.md +46 -0
- package/catalogs/skills/vercel-react-best-practices/rules/_template.md +28 -0
- package/catalogs/skills/vercel-react-best-practices/rules/advanced-effect-event-deps.md +56 -0
- package/catalogs/skills/vercel-react-best-practices/rules/advanced-event-handler-refs.md +55 -0
- package/catalogs/skills/vercel-react-best-practices/rules/advanced-init-once.md +42 -0
- package/catalogs/skills/vercel-react-best-practices/rules/advanced-use-latest.md +39 -0
- package/catalogs/skills/vercel-react-best-practices/rules/async-api-routes.md +38 -0
- package/catalogs/skills/vercel-react-best-practices/rules/async-cheap-condition-before-await.md +37 -0
- package/catalogs/skills/vercel-react-best-practices/rules/async-defer-await.md +82 -0
- package/catalogs/skills/vercel-react-best-practices/rules/async-dependencies.md +51 -0
- package/catalogs/skills/vercel-react-best-practices/rules/async-parallel.md +28 -0
- package/catalogs/skills/vercel-react-best-practices/rules/async-suspense-boundaries.md +99 -0
- package/catalogs/skills/vercel-react-best-practices/rules/bundle-analyzable-paths.md +63 -0
- package/catalogs/skills/vercel-react-best-practices/rules/bundle-barrel-imports.md +60 -0
- package/catalogs/skills/vercel-react-best-practices/rules/bundle-conditional.md +31 -0
- package/catalogs/skills/vercel-react-best-practices/rules/bundle-defer-third-party.md +49 -0
- package/catalogs/skills/vercel-react-best-practices/rules/bundle-dynamic-imports.md +35 -0
- package/catalogs/skills/vercel-react-best-practices/rules/bundle-preload.md +50 -0
- package/catalogs/skills/vercel-react-best-practices/rules/client-event-listeners.md +74 -0
- package/catalogs/skills/vercel-react-best-practices/rules/client-localstorage-schema.md +71 -0
- package/catalogs/skills/vercel-react-best-practices/rules/client-passive-event-listeners.md +48 -0
- package/catalogs/skills/vercel-react-best-practices/rules/client-swr-dedup.md +56 -0
- package/catalogs/skills/vercel-react-best-practices/rules/js-batch-dom-css.md +107 -0
- package/catalogs/skills/vercel-react-best-practices/rules/js-cache-function-results.md +80 -0
- package/catalogs/skills/vercel-react-best-practices/rules/js-cache-property-access.md +28 -0
- package/catalogs/skills/vercel-react-best-practices/rules/js-cache-storage.md +70 -0
- package/catalogs/skills/vercel-react-best-practices/rules/js-combine-iterations.md +32 -0
- package/catalogs/skills/vercel-react-best-practices/rules/js-early-exit.md +50 -0
- package/catalogs/skills/vercel-react-best-practices/rules/js-flatmap-filter.md +60 -0
- package/catalogs/skills/vercel-react-best-practices/rules/js-hoist-regexp.md +45 -0
- package/catalogs/skills/vercel-react-best-practices/rules/js-index-maps.md +37 -0
- package/catalogs/skills/vercel-react-best-practices/rules/js-length-check-first.md +49 -0
- package/catalogs/skills/vercel-react-best-practices/rules/js-min-max-loop.md +82 -0
- package/catalogs/skills/vercel-react-best-practices/rules/js-request-idle-callback.md +105 -0
- package/catalogs/skills/vercel-react-best-practices/rules/js-set-map-lookups.md +24 -0
- package/catalogs/skills/vercel-react-best-practices/rules/js-tosorted-immutable.md +57 -0
- package/catalogs/skills/vercel-react-best-practices/rules/rendering-activity.md +26 -0
- package/catalogs/skills/vercel-react-best-practices/rules/rendering-animate-svg-wrapper.md +47 -0
- package/catalogs/skills/vercel-react-best-practices/rules/rendering-conditional-render.md +40 -0
- package/catalogs/skills/vercel-react-best-practices/rules/rendering-content-visibility.md +38 -0
- package/catalogs/skills/vercel-react-best-practices/rules/rendering-hoist-jsx.md +46 -0
- package/catalogs/skills/vercel-react-best-practices/rules/rendering-hydration-no-flicker.md +82 -0
- package/catalogs/skills/vercel-react-best-practices/rules/rendering-hydration-suppress-warning.md +30 -0
- package/catalogs/skills/vercel-react-best-practices/rules/rendering-resource-hints.md +85 -0
- package/catalogs/skills/vercel-react-best-practices/rules/rendering-script-defer-async.md +68 -0
- package/catalogs/skills/vercel-react-best-practices/rules/rendering-svg-precision.md +28 -0
- package/catalogs/skills/vercel-react-best-practices/rules/rendering-usetransition-loading.md +75 -0
- package/catalogs/skills/vercel-react-best-practices/rules/rerender-defer-reads.md +39 -0
- package/catalogs/skills/vercel-react-best-practices/rules/rerender-dependencies.md +45 -0
- package/catalogs/skills/vercel-react-best-practices/rules/rerender-derived-state-no-effect.md +40 -0
- package/catalogs/skills/vercel-react-best-practices/rules/rerender-derived-state.md +29 -0
- package/catalogs/skills/vercel-react-best-practices/rules/rerender-functional-setstate.md +74 -0
- package/catalogs/skills/vercel-react-best-practices/rules/rerender-lazy-state-init.md +58 -0
- package/catalogs/skills/vercel-react-best-practices/rules/rerender-memo-with-default-value.md +38 -0
- package/catalogs/skills/vercel-react-best-practices/rules/rerender-memo.md +44 -0
- package/catalogs/skills/vercel-react-best-practices/rules/rerender-move-effect-to-event.md +45 -0
- package/catalogs/skills/vercel-react-best-practices/rules/rerender-no-inline-components.md +82 -0
- package/catalogs/skills/vercel-react-best-practices/rules/rerender-simple-expression-in-memo.md +35 -0
- package/catalogs/skills/vercel-react-best-practices/rules/rerender-split-combined-hooks.md +64 -0
- package/catalogs/skills/vercel-react-best-practices/rules/rerender-transitions.md +40 -0
- package/catalogs/skills/vercel-react-best-practices/rules/rerender-use-deferred-value.md +59 -0
- package/catalogs/skills/vercel-react-best-practices/rules/rerender-use-ref-transient-values.md +73 -0
- package/catalogs/skills/vercel-react-best-practices/rules/server-after-nonblocking.md +73 -0
- package/catalogs/skills/vercel-react-best-practices/rules/server-auth-actions.md +96 -0
- package/catalogs/skills/vercel-react-best-practices/rules/server-cache-lru.md +41 -0
- package/catalogs/skills/vercel-react-best-practices/rules/server-cache-react.md +76 -0
- package/catalogs/skills/vercel-react-best-practices/rules/server-dedup-props.md +65 -0
- package/catalogs/skills/vercel-react-best-practices/rules/server-hoist-static-io.md +149 -0
- package/catalogs/skills/vercel-react-best-practices/rules/server-no-shared-module-state.md +50 -0
- package/catalogs/skills/vercel-react-best-practices/rules/server-parallel-fetching.md +83 -0
- package/catalogs/skills/vercel-react-best-practices/rules/server-parallel-nested-fetching.md +34 -0
- package/catalogs/skills/vercel-react-best-practices/rules/server-serialization.md +38 -0
- package/catalogs/skills/webapp-testing/LICENSE.txt +202 -0
- package/catalogs/skills/webapp-testing/SKILL.md +96 -0
- package/catalogs/skills/webapp-testing/examples/console_logging.py +35 -0
- package/catalogs/skills/webapp-testing/examples/element_discovery.py +40 -0
- package/catalogs/skills/webapp-testing/examples/static_html_automation.py +33 -0
- package/catalogs/skills/webapp-testing/scripts/with_server.py +106 -0
- package/catalogs/skills.json +1115 -0
- package/docs/skills/evidencias/2026-10-28-evaluacion-inicial-mcp-seguridad.md +118 -0
- package/docs/skills/evidencias/2026-10-28-incorporacion-mcp-seguridad.json +152 -0
- package/docs/skills/evidencias/2026-10-28-recomendador-preparacion.md +50 -0
- package/package.json +73 -4
- package/plugins/nexakit-modelo/.claude-plugin/plugin.json +1 -0
- package/plugins/nexakit-modelo/hooks/hooks.json +1 -0
- package/plugins/nexakit-modelo/hooks/register.js +48 -0
- package/plugins/nexakit-modelo/hooks/status.js +8 -0
- package/plugins/nexakit-modelo/tests/register.test.ts +21 -0
- package/plugins/nexakit-panel/.claude-plugin/plugin.json +1 -0
- package/plugins/nexakit-panel/README.md +20 -0
- package/plugins/nexakit-panel/hooks/hooks.json +1 -0
- package/plugins/nexakit-panel/hooks/lienzo.js +382 -0
- package/plugins/nexakit-panel/hooks/panel.js +279 -0
- package/plugins/nexakit-panel/hooks/register.tsx +248 -0
- package/plugins/nexakit-panel/tests/lienzo.test.ts +142 -0
- package/plugins/nexakit-panel/tests/panel.test.ts +240 -0
- package/plugins/nexakit-panel/tests/register.test.ts +167 -0
- package/plugins/nexakit-panel/types/index.d.ts +41 -0
- package/plugins/nexakit-sesion/.claude-plugin/plugin.json +1 -0
- package/plugins/nexakit-sesion/README.md +12 -0
- package/plugins/nexakit-sesion/hooks/aviso.js +38 -0
- package/plugins/nexakit-sesion/hooks/hooks.json +1 -0
- package/plugins/nexakit-sesion/hooks/register.js +28 -0
- package/plugins/nexakit-sesion/tests/register.test.ts +96 -0
- package/plugins/niveles/.claude-plugin/plugin.json +5 -0
- package/plugins/niveles/agents/nivel-alto.md +13 -0
- package/plugins/niveles/agents/nivel-exigente.md +13 -0
- package/plugins/niveles/agents/nivel-ligero.md +13 -0
- package/plugins/niveles/agents/nivel-normal.md +13 -0
- package/schemas/agent-client-adapter.schema.json +786 -0
- package/schemas/agent-client-auth-diagnostic.schema.json +801 -0
- package/schemas/agent-client-isolated-variant.schema.json +105 -0
- package/schemas/agent-client-isolated-verification.schema.json +99 -0
- package/schemas/agent-client-managed-preferences-invocation.schema.json +67 -0
- package/schemas/agent-client-managed-preferences.schema.json +63 -0
- package/schemas/agent-client-native-diagnostics.schema.json +85 -0
- package/schemas/agent-client-native-evaluation.schema.json +171 -0
- package/schemas/agent-client-native-preflight.schema.json +90 -0
- package/schemas/agent-client-output.schema.json +551 -0
- package/schemas/agent-client-runtime-fixture.schema.json +90 -0
- package/schemas/agent-client-runtime-local.schema.json +95 -0
- package/schemas/agent-client-runtime.schema.json +1288 -0
- package/schemas/agent-client-selective-config.schema.json +77 -0
- package/schemas/agent-client-supervised-local.schema.json +135 -0
- package/schemas/agent-client-supervised.schema.json +186 -0
- package/schemas/agent-model-preference.schema.json +573 -0
- package/schemas/agent-model-selection.schema.json +311 -0
- package/schemas/agent-task-approvals.schema.json +362 -0
- package/schemas/agent-task-prepare.schema.json +1324 -0
- package/schemas/agent-task-verify.schema.json +198 -0
- package/schemas/project-memory-update.schema.json +33 -0
- package/schemas/project-memory.schema.json +298 -0
- package/schemas/skill-catalog.schema.json +246 -0
- package/schemas/task-workflow-plan-output.schema.json +35 -0
- package/scripts/prepare-package.js +6 -0
- package/scripts/validate-skill-catalog.js +41 -0
- package/skills/cerrar-avisens/SKILL.md +12 -0
- package/skills/cerrar-memoria/SKILL.md +96 -0
- package/skills/cerrar-memoria/references/cierre.md +76 -0
- package/skills/decision-records/SKILL.md +27 -0
- package/skills/decision-records/agents/openai.yaml +7 -0
- package/skills/decision-records/references/adr-template.md +35 -0
- package/skills/differential-review/LICENSE.txt +427 -0
- package/skills/differential-review/SKILL.md +225 -0
- package/skills/differential-review/adversarial.md +203 -0
- package/skills/differential-review/agents/openai.yaml +6 -0
- package/skills/differential-review/assets/trail-of-bits-mark.svg +1 -0
- package/skills/differential-review/methodology.md +234 -0
- package/skills/differential-review/patterns.md +300 -0
- package/skills/differential-review/reporting.md +369 -0
- package/skills/elegir-modelo/SKILL.md +68 -0
- package/skills/elegir-modelo/modelos.mjs +108 -0
- package/skills/frontend-design/LICENSE.txt +177 -0
- package/skills/frontend-design/SKILL.md +71 -0
- package/skills/gemini/SKILL.md +52 -0
- package/skills/imagen/SKILL.md +12 -0
- package/skills/investigar/SKILL.md +11 -0
- package/skills/mcp-builder/LICENSE.txt +202 -0
- package/skills/mcp-builder/SKILL.md +236 -0
- package/skills/mcp-builder/reference/evaluation.md +602 -0
- package/skills/mcp-builder/reference/mcp_best_practices.md +249 -0
- package/skills/mcp-builder/reference/node_mcp_server.md +970 -0
- package/skills/mcp-builder/reference/python_mcp_server.md +719 -0
- package/skills/mcp-builder/scripts/connections.py +151 -0
- package/skills/mcp-builder/scripts/evaluation.py +373 -0
- package/skills/mcp-builder/scripts/example_evaluation.xml +22 -0
- package/skills/mcp-builder/scripts/requirements.txt +2 -0
- package/skills/ordenar-proyecto/SKILL.md +56 -0
- package/skills/project-handoff/SKILL.md +53 -0
- package/skills/project-handoff/agents/openai.yaml +7 -0
- package/skills/project-handoff/references/handoff-template.md +35 -0
- package/skills/quality-gate/LICENSE.txt +26 -0
- package/skills/quality-gate/SKILL.md +44 -0
- package/skills/quality-gate/agents/openai.yaml +7 -0
- package/skills/quality-gate/references/review-checklist.md +42 -0
- package/skills/revisar/SKILL.md +11 -0
- package/skills/revisar-skill/LICENSE-find-skills.txt +26 -0
- package/skills/revisar-skill/SKILL.md +94 -0
- package/skills/revision-cruzada/SKILL.md +59 -0
- package/skills/web-design-guidelines/AGENTS.md +156 -0
- package/skills/web-design-guidelines/LICENSE.txt +21 -0
- package/skills/web-design-guidelines/SKILL.md +29 -0
- package/src/agent-models.js +131 -0
- package/src/brand.js +117 -0
- package/src/claude-code-runner.js +642 -0
- package/src/cli-executable.js +88 -0
- package/src/cli.js +778 -0
- package/src/client-adapter-plan.js +271 -0
- package/src/client-auth-diagnostic-parser.js +211 -0
- package/src/client-auth-diagnostic.js +257 -0
- package/src/client-isolated-variant.js +106 -0
- package/src/client-isolated-verification.js +130 -0
- package/src/client-local-platform.js +14 -0
- package/src/client-managed-preferences-invocation.js +209 -0
- package/src/client-managed-preferences.js +78 -0
- package/src/client-native-access.js +134 -0
- package/src/client-native-diagnostics.js +253 -0
- package/src/client-native-evaluation.js +106 -0
- package/src/client-native-preflight-files.js +68 -0
- package/src/client-native-preflight.js +95 -0
- package/src/client-output-json.js +118 -0
- package/src/client-output-parser.js +278 -0
- package/src/client-runtime-admission.js +80 -0
- package/src/client-runtime-coordinator.js +70 -0
- package/src/client-runtime-core.js +92 -0
- package/src/client-runtime-fixture-permit.js +20 -0
- package/src/client-runtime-fixture-protocol.js +39 -0
- package/src/client-runtime-state.js +67 -0
- package/src/client-runtime-store-files.js +91 -0
- package/src/client-runtime-store.js +239 -0
- package/src/client-runtime-supervisor.js +146 -0
- package/src/client-selective-config.js +195 -0
- package/src/client-selective-files.js +126 -0
- package/src/client-supervised-codes.js +32 -0
- package/src/client-supervised-contract.js +52 -0
- package/src/client-supervised-coordinator.js +36 -0
- package/src/client-supervised-permit.js +20 -0
- package/src/client-supervised-protocol.js +37 -0
- package/src/client-supervised-store.js +167 -0
- package/src/client-supervised-supervisor.js +167 -0
- package/src/client-supervised.js +160 -0
- package/src/codex-cli-runner.js +358 -0
- package/src/codex-delivery.js +101 -0
- package/src/connect.js +703 -0
- package/src/doctor.js +795 -0
- package/src/gemini-cli.js +76 -0
- package/src/gemini-files.js +45 -0
- package/src/gemini-tools.js +249 -0
- package/src/init.js +473 -0
- package/src/install-lock.js +127 -0
- package/src/install-registry.js +61 -0
- package/src/legacy-repair.js +71 -0
- package/src/level-agents.js +111 -0
- package/src/link-states.js +172 -0
- package/src/memory-connection-artifacts.js +192 -0
- package/src/memory-connection-descriptor.js +158 -0
- package/src/memory-connection-diagnostic.js +177 -0
- package/src/memory-connection-files.js +191 -0
- package/src/memory-connection-manifest.js +118 -0
- package/src/memory-connection-package.js +176 -0
- package/src/memory-connection-plan.js +211 -0
- package/src/memory-connection-skill.js +211 -0
- package/src/memory-connection-toml.js +153 -0
- package/src/memory-locator.js +118 -0
- package/src/memory-mcp-policy.js +181 -0
- package/src/memory-mcp-server.js +166 -0
- package/src/memory-mcp-transport.js +59 -0
- package/src/missing-dependencies.js +21 -0
- package/src/model-command.js +147 -0
- package/src/model-preference.js +235 -0
- package/src/model-selection.js +368 -0
- package/src/native/managed-preferences.c +100 -0
- package/src/native/managed-preferences.h +17 -0
- package/src/package-lock-path.js +13 -0
- package/src/panel-cli.js +182 -0
- package/src/peer-handoff.js +27 -0
- package/src/peer-inbox-cli.js +211 -0
- package/src/peer-review-mcp.js +210 -0
- package/src/peer-review-store.js +532 -0
- package/src/platform.js +24 -0
- package/src/project-root.js +41 -0
- package/src/project-signals.js +339 -0
- package/src/recommend-report.js +77 -0
- package/src/review-instructions.js +211 -0
- package/src/review-policy.js +35 -0
- package/src/revision-adapters.js +157 -0
- package/src/revision-context.js +86 -0
- package/src/revision-isolation.js +222 -0
- package/src/revision-process.js +103 -0
- package/src/revision-provenance.js +89 -0
- package/src/revision-snapshot.js +120 -0
- package/src/revision.js +242 -0
- package/src/runtime-fixtures/runtime-supervisor/child.cjs +3 -0
- package/src/runtime-fixtures/runtime-supervisor/fixture.cjs +49 -0
- package/src/runtime-fixtures/supervised/child.cjs +3 -0
- package/src/runtime-fixtures/supervised/fixture.cjs +47 -0
- package/src/sensitive-data.js +21 -0
- package/src/setup-apply.js +231 -0
- package/src/setup-plan.js +231 -0
- package/src/setup-state.js +277 -0
- package/src/setup-tui.js +555 -0
- package/src/skill-catalog-add.js +91 -0
- package/src/skill-catalog-audit.js +68 -0
- package/src/skill-catalog.js +170 -0
- package/src/skill-files.js +39 -0
- package/src/skill-recommendations.js +1673 -0
- package/src/skill-scan-report.js +14 -0
- package/src/skill-scan.js +178 -0
- package/src/stable-command.js +53 -0
- package/src/stable-install.js +222 -0
- package/src/status.js +200 -0
- package/src/superpowers.js +133 -0
- package/src/sync-apply.js +227 -0
- package/src/sync-files.js +109 -0
- package/src/sync-inspect.js +394 -0
- package/src/sync-ledger.js +94 -0
- package/src/sync-markdown.js +151 -0
- package/src/sync-proposal.js +84 -0
- package/src/sync-record.js +459 -0
- package/src/sync.js +360 -0
- package/src/task-approvals.js +367 -0
- package/src/task-cli.js +79 -0
- package/src/task-external-verifier.js +584 -0
- package/src/task-prepare-files.js +115 -0
- package/src/task-prepare.js +180 -0
- package/src/task-verify-cli.js +67 -0
- package/src/task-verify-files.js +188 -0
- package/src/task-verify.js +118 -0
- package/src/task-workflow-mcp.js +544 -0
- package/src/task-workflow-store.js +254 -0
- package/src/terminal-text.js +68 -0
- package/src/toolkit-cli.js +543 -0
- package/src/toolkit-commands-guide.js +107 -0
- package/src/toolkit-setup.js +614 -0
- package/src/usage-metrics.js +43 -0
- package/templates/agent-team/01-encargo.md +158 -0
- package/templates/agent-team/02-propuesta.md +132 -0
- package/templates/agent-team/03-revision.md +150 -0
- package/templates/agent-team/README.md +213 -0
- package/templates/model-inventory/01-inventario.md +154 -0
- package/templates/model-inventory/README.md +115 -0
- package/templates/project-memory/README.md +67 -0
- package/templates/project-memory/project-memory.example.json +53 -0
- package/templates/project-memory/skill/project-id/SKILL.md +37 -0
- package/templates/project-memory/skill/project-id/references/project-profile.md +44 -0
- package/templates/project-memory/vault/00-INICIO/Estado actual.md +44 -0
- package/templates/project-memory/vault/00-INICIO/Fuentes de verdad.md +30 -0
- package/templates/project-memory/vault/00-INICIO/Inicio del proyecto.md +44 -0
- package/templates/project-memory/vault/00-INICIO/Mantenimiento de la memoria.md +26 -0
- package/templates/project-memory/vault/00-INICIO/Mapa de la memoria.md +33 -0
- package/templates/project-memory/vault/00-INICIO/Registro de sincronizaci/303/263n.md" +28 -0
- package/templates/project-memory/vault/01-PRODUCTO/Producto.md +16 -0
- package/templates/project-memory/vault/02-ARQUITECTURA/Arquitectura.md +16 -0
- package/templates/project-memory/vault/03-IMPLEMENTACION/Implementaci/303/263n.md +15 -0
- package/templates/project-memory/vault/04-DECISIONES/Decisiones.md +19 -0
- package/templates/project-memory/vault/05-ENTREGAS/Entregas.md +12 -0
- package/templates/project-memory/vault/06-OPERACION/Operaci/303/263n.md +15 -0
- package/templates/project-memory/vault/07-AGENTES/Protocolo de agentes.md +33 -0
- package/templates/project-memory/vault/08-RECURSOS/Recursos.md +12 -0
- package/templates/project-memory/vault/09-ARCHIVO/README.md +5 -0
|
@@ -0,0 +1,203 @@
|
|
|
1
|
+
# Adversarial Vulnerability Analysis (Phase 5)
|
|
2
|
+
|
|
3
|
+
Structured methodology for finding vulnerabilities through attacker modeling.
|
|
4
|
+
|
|
5
|
+
**When to use:** After completing deep context analysis (Phase 4), apply this to all HIGH RISK changes.
|
|
6
|
+
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
## 1. Define Specific Attacker Model
|
|
10
|
+
|
|
11
|
+
**WHO is the attacker?**
|
|
12
|
+
- Unauthenticated external user
|
|
13
|
+
- Authenticated regular user
|
|
14
|
+
- Malicious administrator
|
|
15
|
+
- Compromised contract/service
|
|
16
|
+
- Front-runner/MEV bot
|
|
17
|
+
|
|
18
|
+
**WHAT access/privileges do they have?**
|
|
19
|
+
- Public API access only
|
|
20
|
+
- Authenticated user role
|
|
21
|
+
- Specific permissions/tokens
|
|
22
|
+
- Contract call capabilities
|
|
23
|
+
|
|
24
|
+
**WHERE do they interact with the system?**
|
|
25
|
+
- Specific HTTP endpoints
|
|
26
|
+
- Smart contract functions
|
|
27
|
+
- RPC interfaces
|
|
28
|
+
- External APIs
|
|
29
|
+
|
|
30
|
+
---
|
|
31
|
+
|
|
32
|
+
## 2. Identify Concrete Attack Vectors
|
|
33
|
+
|
|
34
|
+
```
|
|
35
|
+
ENTRY POINT: [Exact function/endpoint attacker can access]
|
|
36
|
+
|
|
37
|
+
ATTACK SEQUENCE:
|
|
38
|
+
1. [Specific API call/transaction with parameters]
|
|
39
|
+
2. [How this reaches the vulnerable code]
|
|
40
|
+
3. [What happens in the vulnerable code]
|
|
41
|
+
4. [Impact achieved]
|
|
42
|
+
|
|
43
|
+
PROOF OF ACCESSIBILITY:
|
|
44
|
+
- Show the function is public/external
|
|
45
|
+
- Demonstrate attacker has required permissions
|
|
46
|
+
- Prove attack path exists through actual interfaces
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
---
|
|
50
|
+
|
|
51
|
+
## 3. Rate Realistic Exploitability
|
|
52
|
+
|
|
53
|
+
**EASY:** Exploitable via public APIs with no special privileges
|
|
54
|
+
- Single transaction/call
|
|
55
|
+
- Common user access level
|
|
56
|
+
- No complex conditions required
|
|
57
|
+
|
|
58
|
+
**MEDIUM:** Requires specific conditions or elevated privileges
|
|
59
|
+
- Multiple steps or timing requirements
|
|
60
|
+
- Elevated but obtainable privileges
|
|
61
|
+
- Specific system state needed
|
|
62
|
+
|
|
63
|
+
**HARD:** Requires privileged access or rare conditions
|
|
64
|
+
- Admin/owner privileges needed
|
|
65
|
+
- Rare edge case conditions
|
|
66
|
+
- Significant resources required
|
|
67
|
+
|
|
68
|
+
---
|
|
69
|
+
|
|
70
|
+
## 4. Build Complete Exploit Scenario
|
|
71
|
+
|
|
72
|
+
```
|
|
73
|
+
ATTACKER STARTING POSITION:
|
|
74
|
+
[What the attacker has at the beginning]
|
|
75
|
+
|
|
76
|
+
STEP-BY-STEP EXPLOITATION:
|
|
77
|
+
Step 1: [Concrete action through accessible interface]
|
|
78
|
+
- Command: [Exact call/request]
|
|
79
|
+
- Parameters: [Specific values]
|
|
80
|
+
- Expected result: [What happens]
|
|
81
|
+
|
|
82
|
+
Step 2: [Next action]
|
|
83
|
+
- Command: [Exact call/request]
|
|
84
|
+
- Why this works: [Reference to code change]
|
|
85
|
+
- System state change: [What changed]
|
|
86
|
+
|
|
87
|
+
Step 3: [Final impact]
|
|
88
|
+
- Result: [Concrete harm achieved]
|
|
89
|
+
- Evidence: [How to verify impact]
|
|
90
|
+
|
|
91
|
+
CONCRETE IMPACT:
|
|
92
|
+
[Specific, measurable impact - not "could cause issues"]
|
|
93
|
+
- Exact amount of funds drained
|
|
94
|
+
- Specific privileges escalated
|
|
95
|
+
- Particular data exposed
|
|
96
|
+
```
|
|
97
|
+
|
|
98
|
+
---
|
|
99
|
+
|
|
100
|
+
## 5. Cross-Reference with Baseline Context
|
|
101
|
+
|
|
102
|
+
From baseline analysis (see [methodology.md](methodology.md#pre-analysis-baseline-context-building)), check:
|
|
103
|
+
- Does this violate a system-wide invariant?
|
|
104
|
+
- Does this break a trust boundary?
|
|
105
|
+
- Does this bypass a validation pattern?
|
|
106
|
+
- Is this a regression of a previous fix?
|
|
107
|
+
|
|
108
|
+
---
|
|
109
|
+
|
|
110
|
+
## Vulnerability Report Template
|
|
111
|
+
|
|
112
|
+
Generate this for each finding:
|
|
113
|
+
|
|
114
|
+
```markdown
|
|
115
|
+
## [SEVERITY] Vulnerability Title
|
|
116
|
+
|
|
117
|
+
**Attacker Model:**
|
|
118
|
+
- WHO: [Specific attacker type]
|
|
119
|
+
- ACCESS: [Exact privileges]
|
|
120
|
+
- INTERFACE: [Specific entry point]
|
|
121
|
+
|
|
122
|
+
**Attack Vector:**
|
|
123
|
+
[Step-by-step exploit through accessible interfaces]
|
|
124
|
+
|
|
125
|
+
**Exploitability:** EASY/MEDIUM/HARD
|
|
126
|
+
**Justification:** [Why this rating]
|
|
127
|
+
|
|
128
|
+
**Concrete Impact:**
|
|
129
|
+
[Specific, measurable harm - not theoretical]
|
|
130
|
+
|
|
131
|
+
**Proof of Concept:**
|
|
132
|
+
```code
|
|
133
|
+
// Exact code to reproduce
|
|
134
|
+
```
|
|
135
|
+
|
|
136
|
+
**Root Cause:**
|
|
137
|
+
[Reference specific code change at file.sol:L123]
|
|
138
|
+
|
|
139
|
+
**Blast Radius:** [N callers affected]
|
|
140
|
+
**Baseline Violation:** [Which invariant/pattern broken]
|
|
141
|
+
```
|
|
142
|
+
|
|
143
|
+
---
|
|
144
|
+
|
|
145
|
+
## Example: Complete Adversarial Analysis
|
|
146
|
+
|
|
147
|
+
**Change:** Removed `require(amount > 0)` check from `withdraw()` function
|
|
148
|
+
|
|
149
|
+
### 1. Attacker Model
|
|
150
|
+
- **WHO:** Unauthenticated external user
|
|
151
|
+
- **ACCESS:** Can call public contract functions
|
|
152
|
+
- **INTERFACE:** `withdraw(uint256 amount)` at 0x1234...
|
|
153
|
+
|
|
154
|
+
### 2. Attack Vector
|
|
155
|
+
**ENTRY POINT:** `withdraw(0)`
|
|
156
|
+
|
|
157
|
+
**ATTACK SEQUENCE:**
|
|
158
|
+
1. Call `withdraw(0)` from attacker address
|
|
159
|
+
2. Code bypasses amount check (removed)
|
|
160
|
+
3. Withdraw event emitted with 0 amount
|
|
161
|
+
4. Accounting updated incorrectly
|
|
162
|
+
|
|
163
|
+
**PROOF:** Function is `external`, no auth required
|
|
164
|
+
|
|
165
|
+
### 3. Exploitability
|
|
166
|
+
**RATING:** EASY
|
|
167
|
+
- Single transaction
|
|
168
|
+
- Public function
|
|
169
|
+
- No special state required
|
|
170
|
+
|
|
171
|
+
### 4. Exploit Scenario
|
|
172
|
+
**ATTACKER POSITION:** Has user account with 0 balance
|
|
173
|
+
|
|
174
|
+
**EXPLOITATION:**
|
|
175
|
+
```solidity
|
|
176
|
+
Step 1: attacker.withdraw(0)
|
|
177
|
+
- Passes removed validation
|
|
178
|
+
- Emits Withdraw(user, 0)
|
|
179
|
+
- Updates withdrawnAmount[user] += 0
|
|
180
|
+
|
|
181
|
+
Step 2: Off-chain indexer sees Withdraw event
|
|
182
|
+
- Credits attacker for 0 withdrawal
|
|
183
|
+
- But accounting thinks withdrawal happened
|
|
184
|
+
|
|
185
|
+
Step 3: Accounting mismatch exploited
|
|
186
|
+
- Total supply decremented
|
|
187
|
+
- User balance not changed
|
|
188
|
+
- System invariants broken
|
|
189
|
+
```
|
|
190
|
+
|
|
191
|
+
**IMPACT:**
|
|
192
|
+
- Protocol accounting corrupted
|
|
193
|
+
- Can be used to manipulate LP calculations
|
|
194
|
+
- Estimated $50K impact on pool prices
|
|
195
|
+
|
|
196
|
+
### 5. Baseline Violation
|
|
197
|
+
- Violates invariant: "All withdrawals must transfer non-zero value"
|
|
198
|
+
- Breaks validation pattern: Amount checks present in all other value transfers
|
|
199
|
+
- Regression: Check added in commit abc123 "Fix zero-amount exploit"
|
|
200
|
+
|
|
201
|
+
---
|
|
202
|
+
|
|
203
|
+
**Next:** Document all findings in final report (see [reporting.md](reporting.md))
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" width="94" height="56" fill="none" viewBox="0 0 94 56"><path fill="#F0F4F7" d="m34.04 54.662-7.61-4.147L24.593 56l9.433-1.335c-.029 0-.043 0 .014-.003"/><path fill="#F0F4F7" d="m34.039 54.662-.014.003c.035 0 .096-.003.014-.003m26.191-2.67 6.124-1.804 2.301-7.26-5.655.387zM74.805 5.478l-4.68-3.035-2.62 8.332 5.15 1.548zM43.224 3.532s3.172.973 4.423 1.328l4.508 1.335L52.234 0l-7.928 1.576zm-31.473 23.14 5.566.014 1.982-6.216-5.06-1.342c-.538 1.708-1.94 5.837-2.488 7.544M1.394 20.896l4.164 4.338 2.398-7.696-5.11-1.357zm88.205 24.841c-.086-2.18-.692-2.894-1.978-4.232l-6.71.447c1.871 1.175 3.018 2.63 3.255 4.583.261 2.145-2.068 4.623-4.322 4.623-1.258 0-1.885-.987-1.885-2.12.035-.845.333-1.942.777-2.673h-5.691c-.444 1.136-.813 2.418-.813 3.625 0 4.136 3.659 5.197 7.131 5.197 3.62 0 6.616-.696 8.501-4.03.85-1.505 1.806-3.663 1.735-5.42M18.804.56 1.362.576 0 4.86l6.394-.007-3.161 9.962 5.114 1.356 3.551-11.322 5.544-.007z"/><path fill="#F0F4F7" d="M20.707 15.898c.628-.04 1.258-.04 1.886-.04 1.035-.003 2.587.072 2.587 1.499.004.987-.366 2.233-.66 3.184-.551 1.942-1.214 3.88-1.325 5.858l5.727-.007c-.151-3.185 1.842-5.968 1.838-9.117 0-2.123-1.627-2.964-3.512-3.294l.552-.075c4.103-.554 6.39-3.738 6.386-7.729-.004-4.423-3.738-5.666-7.544-5.662l-6.576.007c-1.87 5.751-3.645 11.534-5.462 17.31l5.057 1.339zM24.245 4.58l1.849-.004c1.369 0 2.734.327 2.738 1.939.003 1.977-1.437 5.31-3.803 5.31l-3.031.004zm11.959 21.883 2.949-5.531 7.06-.008-.215 5.564 5.544-.004.441-18.94-4.763-1.43a89 89 0 0 0-.677 10.71h-.036l-5.322.004c1.914-3.586 3.749-7.2 5.4-10.906L42.77 4.775 30.437 26.466zm39.249-.036 1.402-4.214-7.43.01 2.753-8.612-5.15-1.548-4.584 14.375zm-34.411 1.658h-7.28l-6.834 21.18 8.698 4.694c5.208-.196 8.856-4.012 8.856-9.252 0-2.013-1.258-3.586-3.215-4.136 3.846-.877 6.319-3.33 6.319-7.356-.004-3.923-3.072-5.13-6.544-5.13m-2.993 20.318c-1.036 1.537-2.143 1.647-3.881 1.647h-2.254l2.476-7.611c1.81.07 5.024-.366 5.024 2.268 0 1.168-.698 2.744-1.365 3.696m-.444-9.667h-2.072l2.18-6.7c1.626.075 4.694-.436 4.694 2.053.04 2.928-1.846 4.647-4.802 4.647M58.67 9.582l-5.522 18.29-4.878 14.836 5.856-.447 4.23-13.2h.006l5.713-17.878c-.796-.22-3.964-1.228-5.404-1.601m2.738 18.542-1.37 4.278h6.398l-2.993 9.525 5.584-.38 2.913-9.145h5.541l1.37-4.278zm25.351-.259c-5.726 0-9.127 3.951-9.127 9.444.007.798.727 2.765 2.2 3.422l6.888-.462c-1.172-.98-3.243-3.29-3.243-4.519 0-1.686.95-3.891 2.91-3.891 1.33 0 2.143.366 2.143 1.793 0 .916-.444 1.757-.702 2.638h5.322c.333-.77.849-2.528.849-3.334.004-3.994-3.913-5.09-7.24-5.09m-63.15.372c-2.605 0-2.978 1.906-3.623 3.93-.215.728-.623 1.615-.623 2.379 0 1.47 1.315 1.75 2.537 1.75 1.494.01 2.29-.487 2.82-1.878.362-.952 1.305-3.568 1.305-4.488 0-1.303-1.326-1.693-2.416-1.693m.728 1.87c0 .328-.373 1.392-.498 1.765l-.577 1.782c-.226.675-.498 1.449-1.359 1.449-.487 0-.802-.28-.802-.785 0-.653.509-1.864.724-2.538.215-.671.498-2.01 1.247-2.269.168-.056.351-.078.534-.078.34 0 .749.302.749.664zm5.902 2.674.394-1.292H28.37l.613-1.928h2.38l.42-1.292h-4.126l-2.48 7.924h1.735l1.075-3.412z"/></svg>
|
|
@@ -0,0 +1,234 @@
|
|
|
1
|
+
# Differential Review Methodology
|
|
2
|
+
|
|
3
|
+
Detailed phase-by-phase workflow for security-focused code review.
|
|
4
|
+
|
|
5
|
+
## Pre-Analysis: Baseline Context Building
|
|
6
|
+
|
|
7
|
+
**FIRST ACTION - Build complete baseline understanding:**
|
|
8
|
+
|
|
9
|
+
If `audit-context-building` skill is available:
|
|
10
|
+
|
|
11
|
+
```bash
|
|
12
|
+
# Checkout baseline commit
|
|
13
|
+
git checkout <baseline_commit>
|
|
14
|
+
|
|
15
|
+
# Invoke audit-context-building skill on baseline codebase
|
|
16
|
+
# Scope = entire relevant project (e.g., packages/contracts/contracts/ for Solidity, src/ for Rust, etc.)
|
|
17
|
+
audit-context-building --scope [entire project or main contract directory] --focus invariants,trust-boundaries,validation-patterns,call-graphs,state-flows
|
|
18
|
+
|
|
19
|
+
# Examples:
|
|
20
|
+
# For Solidity: audit-context-building --scope packages/contracts/contracts
|
|
21
|
+
# For Rust: audit-context-building --scope src
|
|
22
|
+
# For full repo: audit-context-building --scope .
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
**Capture from baseline analysis:**
|
|
26
|
+
- System-wide invariants (what must ALWAYS be true across all code)
|
|
27
|
+
- Trust boundaries and privilege levels (who can do what)
|
|
28
|
+
- Validation patterns (what gets checked where - defense-in-depth)
|
|
29
|
+
- Complete call graphs for critical functions (who calls what)
|
|
30
|
+
- State flow diagrams (how state changes)
|
|
31
|
+
- External dependencies and trust assumptions
|
|
32
|
+
|
|
33
|
+
**Why this matters:**
|
|
34
|
+
- Understand what the code was SUPPOSED to do before changes
|
|
35
|
+
- Identify implicit security assumptions in baseline
|
|
36
|
+
- Detect when changes violate baseline invariants
|
|
37
|
+
- Know which patterns are system-wide vs local
|
|
38
|
+
- Catch when changes break defense-in-depth
|
|
39
|
+
|
|
40
|
+
**Store baseline context for reference during differential analysis.**
|
|
41
|
+
|
|
42
|
+
After baseline analysis, checkout back to head commit to analyze changes.
|
|
43
|
+
|
|
44
|
+
---
|
|
45
|
+
|
|
46
|
+
## Phase 0: Intake & Triage
|
|
47
|
+
|
|
48
|
+
**Extract changes:**
|
|
49
|
+
```bash
|
|
50
|
+
# For commit range
|
|
51
|
+
git diff <base>..<head> --stat
|
|
52
|
+
git log <base>..<head> --oneline
|
|
53
|
+
|
|
54
|
+
# For PR
|
|
55
|
+
gh pr view <number> --json files,additions,deletions
|
|
56
|
+
|
|
57
|
+
# Get all changed files
|
|
58
|
+
git diff <base>..<head> --name-only
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
**Assess codebase size:**
|
|
62
|
+
```bash
|
|
63
|
+
find . -name "*.sol" -o -name "*.rs" -o -name "*.go" -o -name "*.ts" | wc -l
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
**Classify complexity:**
|
|
67
|
+
- **SMALL**: <20 files → Deep analysis (read all deps)
|
|
68
|
+
- **MEDIUM**: 20-200 files → Focused analysis (1-hop deps)
|
|
69
|
+
- **LARGE**: 200+ files → Surgical (critical paths only)
|
|
70
|
+
|
|
71
|
+
**Risk score each file:**
|
|
72
|
+
- **HIGH**: Auth, crypto, external calls, value transfer, validation removal
|
|
73
|
+
- **MEDIUM**: Business logic, state changes, new public APIs
|
|
74
|
+
- **LOW**: Comments, tests, UI, logging
|
|
75
|
+
|
|
76
|
+
---
|
|
77
|
+
|
|
78
|
+
## Phase 1: Changed Code Analysis
|
|
79
|
+
|
|
80
|
+
For each changed file:
|
|
81
|
+
|
|
82
|
+
1. **Read both versions** (baseline and changed)
|
|
83
|
+
|
|
84
|
+
2. **Analyze each diff region:**
|
|
85
|
+
```
|
|
86
|
+
BEFORE: [exact code]
|
|
87
|
+
AFTER: [exact code]
|
|
88
|
+
CHANGE: [behavioral impact]
|
|
89
|
+
SECURITY: [implications]
|
|
90
|
+
```
|
|
91
|
+
|
|
92
|
+
3. **Git blame removed code:**
|
|
93
|
+
```bash
|
|
94
|
+
# When was it added? Why?
|
|
95
|
+
git log -S "removed_code" --all --oneline
|
|
96
|
+
git blame <baseline> -- file.sol | grep "pattern"
|
|
97
|
+
```
|
|
98
|
+
|
|
99
|
+
**Red flags:**
|
|
100
|
+
- Removed code from "fix", "security", "CVE" commits → CRITICAL
|
|
101
|
+
- Recently added (<1 month) then removed → HIGH
|
|
102
|
+
|
|
103
|
+
4. **Check for regressions (re-added code):**
|
|
104
|
+
```bash
|
|
105
|
+
git log -S "added_code" --all -p
|
|
106
|
+
```
|
|
107
|
+
|
|
108
|
+
Pattern: Code added → removed for security → re-added now = REGRESSION
|
|
109
|
+
|
|
110
|
+
5. **Micro-adversarial analysis** for each change:
|
|
111
|
+
- What attack did removed code prevent?
|
|
112
|
+
- What new surface does new code expose?
|
|
113
|
+
- Can modified logic be bypassed?
|
|
114
|
+
- Are checks weaker? Edge cases covered?
|
|
115
|
+
|
|
116
|
+
6. **Generate concrete attack scenarios:**
|
|
117
|
+
```
|
|
118
|
+
SCENARIO: [attack goal]
|
|
119
|
+
PRECONDITIONS: [required state]
|
|
120
|
+
STEPS:
|
|
121
|
+
1. [specific action]
|
|
122
|
+
2. [expected outcome]
|
|
123
|
+
3. [exploitation]
|
|
124
|
+
WHY IT WORKS: [reference code change]
|
|
125
|
+
IMPACT: [severity + scope]
|
|
126
|
+
```
|
|
127
|
+
|
|
128
|
+
---
|
|
129
|
+
|
|
130
|
+
## Phase 2: Test Coverage Analysis
|
|
131
|
+
|
|
132
|
+
**Identify coverage gaps:**
|
|
133
|
+
```bash
|
|
134
|
+
# Production code changes (exclude tests)
|
|
135
|
+
git diff <range> --name-only | grep -v "test"
|
|
136
|
+
|
|
137
|
+
# Test changes
|
|
138
|
+
git diff <range> --name-only | grep "test"
|
|
139
|
+
|
|
140
|
+
# For each changed function, search for tests
|
|
141
|
+
grep -r "test.*functionName" test/ --include="*.sol" --include="*.js"
|
|
142
|
+
```
|
|
143
|
+
|
|
144
|
+
**Risk elevation rules:**
|
|
145
|
+
- NEW function + NO tests → Elevate risk MEDIUM→HIGH
|
|
146
|
+
- MODIFIED validation + UNCHANGED tests → HIGH RISK
|
|
147
|
+
- Complex logic (>20 lines) + NO tests → HIGH RISK
|
|
148
|
+
|
|
149
|
+
---
|
|
150
|
+
|
|
151
|
+
## Phase 3: Blast Radius Analysis
|
|
152
|
+
|
|
153
|
+
**Calculate impact:**
|
|
154
|
+
```bash
|
|
155
|
+
# Count callers for each modified function
|
|
156
|
+
grep -r "functionName(" --include="*.sol" . | wc -l
|
|
157
|
+
```
|
|
158
|
+
|
|
159
|
+
**Classify blast radius:**
|
|
160
|
+
- 1-5 calls: LOW
|
|
161
|
+
- 6-20 calls: MEDIUM
|
|
162
|
+
- 21-50 calls: HIGH
|
|
163
|
+
- 50+ calls: CRITICAL
|
|
164
|
+
|
|
165
|
+
**Priority matrix:**
|
|
166
|
+
|
|
167
|
+
| Change Risk | Blast Radius | Priority | Analysis Depth |
|
|
168
|
+
|-------------|--------------|----------|----------------|
|
|
169
|
+
| HIGH | CRITICAL | P0 | Deep + all deps |
|
|
170
|
+
| HIGH | HIGH/MEDIUM | P1 | Deep |
|
|
171
|
+
| HIGH | LOW | P2 | Standard |
|
|
172
|
+
| MEDIUM | CRITICAL/HIGH | P1 | Standard + callers |
|
|
173
|
+
|
|
174
|
+
---
|
|
175
|
+
|
|
176
|
+
## Phase 4: Deep Context Analysis
|
|
177
|
+
|
|
178
|
+
**If `audit-context-building` skill is available**, invoke it to help answer all the questions below for each HIGH RISK changed function:
|
|
179
|
+
|
|
180
|
+
```bash
|
|
181
|
+
# Run audit-context-building on the changed function and its dependencies
|
|
182
|
+
audit-context-building --scope [file containing changed function] --focus flow-analysis,call-graphs,invariants,root-cause
|
|
183
|
+
```
|
|
184
|
+
|
|
185
|
+
**The audit-context-building skill will help you answer:**
|
|
186
|
+
|
|
187
|
+
1. **Map complete function flow:**
|
|
188
|
+
- Entry conditions (preconditions, requires, modifiers)
|
|
189
|
+
- State reads (which variables accessed)
|
|
190
|
+
- State writes (which variables modified)
|
|
191
|
+
- External calls (to contracts, APIs, system)
|
|
192
|
+
- Return values and side effects
|
|
193
|
+
|
|
194
|
+
2. **Trace internal calls:**
|
|
195
|
+
- List all functions called
|
|
196
|
+
- Recursively map their flows
|
|
197
|
+
- Build complete call graph
|
|
198
|
+
|
|
199
|
+
3. **Trace external calls:**
|
|
200
|
+
- Identify trust boundaries crossed
|
|
201
|
+
- List assumptions about external behavior
|
|
202
|
+
- Check for reentrancy risks
|
|
203
|
+
|
|
204
|
+
4. **Identify invariants:**
|
|
205
|
+
- What must ALWAYS be true?
|
|
206
|
+
- What must NEVER happen?
|
|
207
|
+
- Are invariants maintained after changes?
|
|
208
|
+
|
|
209
|
+
5. **Five Whys root cause:**
|
|
210
|
+
- WHY was this code changed?
|
|
211
|
+
- WHY did the original code exist?
|
|
212
|
+
- WHY might this break?
|
|
213
|
+
- WHY is this approach chosen?
|
|
214
|
+
- WHY could this fail in production?
|
|
215
|
+
|
|
216
|
+
**If `audit-context-building` skill is NOT available**, manually perform the line-by-line analysis above using Read, Grep, and code tracing.
|
|
217
|
+
|
|
218
|
+
**Cross-cutting pattern detection:**
|
|
219
|
+
```bash
|
|
220
|
+
# Find repeated validation patterns
|
|
221
|
+
grep -r "require.*amount > 0" --include="*.sol" .
|
|
222
|
+
grep -r "onlyOwner" --include="*.sol" .
|
|
223
|
+
|
|
224
|
+
# Check if any removed in diff
|
|
225
|
+
git diff <range> | grep "^-.*require.*amount > 0"
|
|
226
|
+
```
|
|
227
|
+
|
|
228
|
+
**Flag if removal breaks defense-in-depth.**
|
|
229
|
+
|
|
230
|
+
---
|
|
231
|
+
|
|
232
|
+
**Next steps:**
|
|
233
|
+
- For HIGH RISK changes, proceed to [adversarial.md](adversarial.md)
|
|
234
|
+
- For report generation, see [reporting.md](reporting.md)
|