@ahmed-g-gad/apothem 0.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +60 -0
- package/LICENSE +21 -0
- package/LICENSES/MIT.txt +18 -0
- package/LICENSES/PSF-2.0.txt +47 -0
- package/README.md +549 -0
- package/bin/README.md +37 -0
- package/bin/apothem.mjs +78 -0
- package/package.json +75 -0
- package/pyproject.toml +347 -0
- package/src/apothem/README.md +52 -0
- package/src/apothem/__init__.py +66 -0
- package/src/apothem/__main__.py +28 -0
- package/src/apothem/_vendor/.keep +0 -0
- package/src/apothem/_vendor/__init__.py +25 -0
- package/src/apothem/_vendor/attr/__init__.py +104 -0
- package/src/apothem/_vendor/attr/__init__.pyi +389 -0
- package/src/apothem/_vendor/attr/_cmp.py +160 -0
- package/src/apothem/_vendor/attr/_cmp.pyi +13 -0
- package/src/apothem/_vendor/attr/_compat.py +99 -0
- package/src/apothem/_vendor/attr/_config.py +31 -0
- package/src/apothem/_vendor/attr/_funcs.py +497 -0
- package/src/apothem/_vendor/attr/_make.py +3406 -0
- package/src/apothem/_vendor/attr/_next_gen.py +674 -0
- package/src/apothem/_vendor/attr/_typing_compat.pyi +15 -0
- package/src/apothem/_vendor/attr/_version_info.py +89 -0
- package/src/apothem/_vendor/attr/_version_info.pyi +9 -0
- package/src/apothem/_vendor/attr/converters.py +162 -0
- package/src/apothem/_vendor/attr/converters.pyi +19 -0
- package/src/apothem/_vendor/attr/exceptions.py +95 -0
- package/src/apothem/_vendor/attr/exceptions.pyi +17 -0
- package/src/apothem/_vendor/attr/filters.py +72 -0
- package/src/apothem/_vendor/attr/filters.pyi +6 -0
- package/src/apothem/_vendor/attr/py.typed +0 -0
- package/src/apothem/_vendor/attr/setters.py +79 -0
- package/src/apothem/_vendor/attr/setters.pyi +20 -0
- package/src/apothem/_vendor/attr/validators.py +750 -0
- package/src/apothem/_vendor/attr/validators.pyi +140 -0
- package/src/apothem/_vendor/attr.LICENSE +21 -0
- package/src/apothem/_vendor/attrs/__init__.py +72 -0
- package/src/apothem/_vendor/attrs/__init__.pyi +314 -0
- package/src/apothem/_vendor/attrs/converters.py +3 -0
- package/src/apothem/_vendor/attrs/exceptions.py +3 -0
- package/src/apothem/_vendor/attrs/filters.py +3 -0
- package/src/apothem/_vendor/attrs/py.typed +0 -0
- package/src/apothem/_vendor/attrs/setters.py +3 -0
- package/src/apothem/_vendor/attrs/validators.py +3 -0
- package/src/apothem/_vendor/attrs.LICENSE +21 -0
- package/src/apothem/_vendor/jsonschema/__init__.py +120 -0
- package/src/apothem/_vendor/jsonschema/__main__.py +6 -0
- package/src/apothem/_vendor/jsonschema/_format.py +546 -0
- package/src/apothem/_vendor/jsonschema/_keywords.py +449 -0
- package/src/apothem/_vendor/jsonschema/_legacy_keywords.py +449 -0
- package/src/apothem/_vendor/jsonschema/_types.py +204 -0
- package/src/apothem/_vendor/jsonschema/_typing.py +29 -0
- package/src/apothem/_vendor/jsonschema/_utils.py +355 -0
- package/src/apothem/_vendor/jsonschema/benchmarks/__init__.py +5 -0
- package/src/apothem/_vendor/jsonschema/benchmarks/const_vs_enum.py +30 -0
- package/src/apothem/_vendor/jsonschema/benchmarks/contains.py +28 -0
- package/src/apothem/_vendor/jsonschema/benchmarks/import_benchmark.py +31 -0
- package/src/apothem/_vendor/jsonschema/benchmarks/issue232/issue.json +2653 -0
- package/src/apothem/_vendor/jsonschema/benchmarks/issue232.py +25 -0
- package/src/apothem/_vendor/jsonschema/benchmarks/json_schema_test_suite.py +12 -0
- package/src/apothem/_vendor/jsonschema/benchmarks/nested_schemas.py +56 -0
- package/src/apothem/_vendor/jsonschema/benchmarks/subcomponents.py +42 -0
- package/src/apothem/_vendor/jsonschema/benchmarks/unused_registry.py +35 -0
- package/src/apothem/_vendor/jsonschema/benchmarks/useless_applicator_schemas.py +106 -0
- package/src/apothem/_vendor/jsonschema/benchmarks/useless_keywords.py +32 -0
- package/src/apothem/_vendor/jsonschema/benchmarks/validator_creation.py +14 -0
- package/src/apothem/_vendor/jsonschema/cli.py +292 -0
- package/src/apothem/_vendor/jsonschema/exceptions.py +490 -0
- package/src/apothem/_vendor/jsonschema/protocols.py +230 -0
- package/src/apothem/_vendor/jsonschema/validators.py +1410 -0
- package/src/apothem/_vendor/jsonschema.LICENSE +19 -0
- package/src/apothem/_vendor/jsonschema_specifications/__init__.py +12 -0
- package/src/apothem/_vendor/jsonschema_specifications/_core.py +38 -0
- package/src/apothem/_vendor/jsonschema_specifications/schemas/draft201909/metaschema.json +42 -0
- package/src/apothem/_vendor/jsonschema_specifications/schemas/draft201909/vocabularies/applicator +56 -0
- package/src/apothem/_vendor/jsonschema_specifications/schemas/draft201909/vocabularies/content +17 -0
- package/src/apothem/_vendor/jsonschema_specifications/schemas/draft201909/vocabularies/core +57 -0
- package/src/apothem/_vendor/jsonschema_specifications/schemas/draft201909/vocabularies/format +14 -0
- package/src/apothem/_vendor/jsonschema_specifications/schemas/draft201909/vocabularies/meta-data +37 -0
- package/src/apothem/_vendor/jsonschema_specifications/schemas/draft201909/vocabularies/validation +98 -0
- package/src/apothem/_vendor/jsonschema_specifications/schemas/draft202012/metaschema.json +58 -0
- package/src/apothem/_vendor/jsonschema_specifications/schemas/draft202012/vocabularies/applicator +48 -0
- package/src/apothem/_vendor/jsonschema_specifications/schemas/draft202012/vocabularies/content +17 -0
- package/src/apothem/_vendor/jsonschema_specifications/schemas/draft202012/vocabularies/core +51 -0
- package/src/apothem/_vendor/jsonschema_specifications/schemas/draft202012/vocabularies/format-annotation +14 -0
- package/src/apothem/_vendor/jsonschema_specifications/schemas/draft202012/vocabularies/format-assertion +14 -0
- package/src/apothem/_vendor/jsonschema_specifications/schemas/draft202012/vocabularies/meta-data +37 -0
- package/src/apothem/_vendor/jsonschema_specifications/schemas/draft202012/vocabularies/unevaluated +15 -0
- package/src/apothem/_vendor/jsonschema_specifications/schemas/draft202012/vocabularies/validation +98 -0
- package/src/apothem/_vendor/jsonschema_specifications/schemas/draft3/metaschema.json +172 -0
- package/src/apothem/_vendor/jsonschema_specifications/schemas/draft4/metaschema.json +149 -0
- package/src/apothem/_vendor/jsonschema_specifications/schemas/draft6/metaschema.json +153 -0
- package/src/apothem/_vendor/jsonschema_specifications/schemas/draft7/metaschema.json +166 -0
- package/src/apothem/_vendor/jsonschema_specifications.LICENSE +19 -0
- package/src/apothem/_vendor/referencing/__init__.py +7 -0
- package/src/apothem/_vendor/referencing/_attrs.py +31 -0
- package/src/apothem/_vendor/referencing/_attrs.pyi +21 -0
- package/src/apothem/_vendor/referencing/_core.py +739 -0
- package/src/apothem/_vendor/referencing/exceptions.py +165 -0
- package/src/apothem/_vendor/referencing/jsonschema.py +642 -0
- package/src/apothem/_vendor/referencing/py.typed +0 -0
- package/src/apothem/_vendor/referencing/retrieval.py +94 -0
- package/src/apothem/_vendor/referencing/typing.py +61 -0
- package/src/apothem/_vendor/referencing.LICENSE +19 -0
- package/src/apothem/_vendor/rpds/__init__.py +251 -0
- package/src/apothem/_vendor/typing_extensions.LICENSE +279 -0
- package/src/apothem/_vendor/typing_extensions.py +4317 -0
- package/src/apothem/_vendor/vendor.txt +22 -0
- package/src/apothem/_vendor/yaml/__init__.py +389 -0
- package/src/apothem/_vendor/yaml/composer.py +138 -0
- package/src/apothem/_vendor/yaml/constructor.py +748 -0
- package/src/apothem/_vendor/yaml/cyaml.py +100 -0
- package/src/apothem/_vendor/yaml/dumper.py +61 -0
- package/src/apothem/_vendor/yaml/emitter.py +1137 -0
- package/src/apothem/_vendor/yaml/error.py +74 -0
- package/src/apothem/_vendor/yaml/events.py +85 -0
- package/src/apothem/_vendor/yaml/loader.py +63 -0
- package/src/apothem/_vendor/yaml/nodes.py +48 -0
- package/src/apothem/_vendor/yaml/parser.py +588 -0
- package/src/apothem/_vendor/yaml/reader.py +185 -0
- package/src/apothem/_vendor/yaml/representer.py +388 -0
- package/src/apothem/_vendor/yaml/resolver.py +226 -0
- package/src/apothem/_vendor/yaml/scanner.py +1435 -0
- package/src/apothem/_vendor/yaml/serializer.py +110 -0
- package/src/apothem/_vendor/yaml/tokens.py +103 -0
- package/src/apothem/_vendor/yaml.LICENSE +20 -0
- package/src/apothem/agents/README.md +60 -0
- package/src/apothem/agents/codebase-explorer.md +91 -0
- package/src/apothem/agents/convention-auditor.md +93 -0
- package/src/apothem/agents/dependency-auditor.md +97 -0
- package/src/apothem/agents/fact-checker.md +84 -0
- package/src/apothem/agents/mcp-builder.md +86 -0
- package/src/apothem/agents/memory-auditor.md +93 -0
- package/src/apothem/agents/prompt-evaluator.md +87 -0
- package/src/apothem/agents/quality-gate.md +103 -0
- package/src/apothem/agents/refactor-surgeon.md +74 -0
- package/src/apothem/agents/research-scout.md +73 -0
- package/src/apothem/agents/security-scanner.md +83 -0
- package/src/apothem/agents/test-runner.md +84 -0
- package/src/apothem/audit/README.md +73 -0
- package/src/apothem/audit/_scan_lib.py +182 -0
- package/src/apothem/audit/analyze_graph.py +260 -0
- package/src/apothem/audit/build_capability_graph.py +607 -0
- package/src/apothem/audit/build_inventory.py +657 -0
- package/src/apothem/audit/build_plans_provenance.py +997 -0
- package/src/apothem/audit/check_links.py +389 -0
- package/src/apothem/audit/classify_artifacts.py +381 -0
- package/src/apothem/audit/deprecated-tokens.txt +10 -0
- package/src/apothem/audit/execute_plans_migration.py +491 -0
- package/src/apothem/audit/known-projects.txt +15 -0
- package/src/apothem/audit/render_capability_index.py +467 -0
- package/src/apothem/audit/render_inventory.py +405 -0
- package/src/apothem/audit/scan_ai_surfaces.py +1125 -0
- package/src/apothem/audit/scan_ai_surfaces_coarse.py +261 -0
- package/src/apothem/audit/scan_drift_features.py +143 -0
- package/src/apothem/audit/scan_frontmatter.py +293 -0
- package/src/apothem/audit/scan_header_coverage.py +1134 -0
- package/src/apothem/audit/scan_plan_leakage.py +540 -0
- package/src/apothem/audit/scan_plans_discipline.py +188 -0
- package/src/apothem/audit/scan_secrets_pii.py +245 -0
- package/src/apothem/audit/scan_stale_tokens.py +296 -0
- package/src/apothem/audit/synthesize_drift.py +205 -0
- package/src/apothem/benchmarks/README.md +33 -0
- package/src/apothem/benchmarks/__init__.py +3 -0
- package/src/apothem/benchmarks/bench_agents.py +63 -0
- package/src/apothem/benchmarks/bench_hooks.py +93 -0
- package/src/apothem/benchmarks/bench_install.py +58 -0
- package/src/apothem/benchmarks/bench_tests.py +93 -0
- package/src/apothem/benchmarks/bench_validate_ecosystem.py +84 -0
- package/src/apothem/cli/README.md +33 -0
- package/src/apothem/cli/__init__.py +229 -0
- package/src/apothem/cli/_cmd_completion.py +88 -0
- package/src/apothem/cli/_cmd_diff.py +181 -0
- package/src/apothem/cli/_cmd_doctor.py +143 -0
- package/src/apothem/cli/_cmd_harnesses.py +167 -0
- package/src/apothem/cli/_cmd_install.py +327 -0
- package/src/apothem/cli/_cmd_migrate_workspace.py +143 -0
- package/src/apothem/cli/_cmd_profile.py +341 -0
- package/src/apothem/cli/_cmd_status.py +180 -0
- package/src/apothem/cli/_cmd_uninstall.py +215 -0
- package/src/apothem/cli/_cmd_update.py +397 -0
- package/src/apothem/cli/_cmd_verify.py +194 -0
- package/src/apothem/cli/_common_flags.py +90 -0
- package/src/apothem/cli/_epilogs.py +296 -0
- package/src/apothem/cli/_helpers.py +857 -0
- package/src/apothem/cli/_json_formatter.py +21 -0
- package/src/apothem/cli/_materialize.py +376 -0
- package/src/apothem/cli/completions/apothem.bash +30 -0
- package/src/apothem/cli/completions/apothem.fish +19 -0
- package/src/apothem/cli/completions/apothem.ps1 +27 -0
- package/src/apothem/cli/completions/apothem.zsh +42 -0
- package/src/apothem/cli/reference_export.py +126 -0
- package/src/apothem/commands/README.md +125 -0
- package/src/apothem/commands/a11y-audit.md +203 -0
- package/src/apothem/commands/architecture-review.md +194 -0
- package/src/apothem/commands/audit.md +165 -0
- package/src/apothem/commands/code-audit.md +218 -0
- package/src/apothem/commands/code-review.md +193 -0
- package/src/apothem/commands/dependency-audit.md +209 -0
- package/src/apothem/commands/docs-review.md +199 -0
- package/src/apothem/commands/elevate.md +285 -0
- package/src/apothem/commands/eval.md +149 -0
- package/src/apothem/commands/fortress.md +172 -0
- package/src/apothem/commands/freshify.md +168 -0
- package/src/apothem/commands/github-deploy-fresh.md +178 -0
- package/src/apothem/commands/github-deploy-next.md +167 -0
- package/src/apothem/commands/perf-audit.md +198 -0
- package/src/apothem/commands/plan-amend.md +104 -0
- package/src/apothem/commands/plan-audit.md +127 -0
- package/src/apothem/commands/plan-design.md +257 -0
- package/src/apothem/commands/plan-execute.md +495 -0
- package/src/apothem/commands/plan-generate.md +351 -0
- package/src/apothem/commands/plan-review.md +555 -0
- package/src/apothem/commands/plan-spec.md +359 -0
- package/src/apothem/commands/plan-status.md +222 -0
- package/src/apothem/commands/plan.md +173 -0
- package/src/apothem/commands/projectify.md +142 -0
- package/src/apothem/commands/release-readiness.md +142 -0
- package/src/apothem/commands/research-analysis.md +241 -0
- package/src/apothem/commands/research-design.md +231 -0
- package/src/apothem/commands/research-disseminate.md +225 -0
- package/src/apothem/commands/research-experiment.md +232 -0
- package/src/apothem/commands/research-ideate.md +213 -0
- package/src/apothem/commands/research-paper.md +252 -0
- package/src/apothem/commands/research-proposal.md +220 -0
- package/src/apothem/commands/research-publish.md +255 -0
- package/src/apothem/commands/research-review.md +251 -0
- package/src/apothem/commands/research-sources.md +266 -0
- package/src/apothem/commands/research-spec.md +255 -0
- package/src/apothem/commands/research-synthesis.md +233 -0
- package/src/apothem/commands/research-theory.md +218 -0
- package/src/apothem/commands/research.md +181 -0
- package/src/apothem/commands/security-audit.md +196 -0
- package/src/apothem/commands/supply-chain-audit.md +192 -0
- package/src/apothem/commands/test-suite.md +146 -0
- package/src/apothem/commands/threat-model-audit.md +199 -0
- package/src/apothem/commands/ux-review.md +202 -0
- package/src/apothem/commands/workflow.md +162 -0
- package/src/apothem/conformity/README.md +173 -0
- package/src/apothem/conformity/__init__.py +1 -0
- package/src/apothem/conformity/_grep_base.py +93 -0
- package/src/apothem/conformity/agent_capability_grep.py +306 -0
- package/src/apothem/conformity/agents_md_coverage_grep.py +382 -0
- package/src/apothem/conformity/agnosticism_grep.py +311 -0
- package/src/apothem/conformity/always_on_budget_grep.py +318 -0
- package/src/apothem/conformity/bare_except_grep.py +115 -0
- package/src/apothem/conformity/binding_reciprocity_grep.py +151 -0
- package/src/apothem/conformity/brand_mark_grep.py +272 -0
- package/src/apothem/conformity/commented_out_code_grep.py +176 -0
- package/src/apothem/conformity/completion_claim_grep.py +169 -0
- package/src/apothem/conformity/conventional_commit_grep.py +319 -0
- package/src/apothem/conformity/copilot_instructions_presence_grep.py +324 -0
- package/src/apothem/conformity/cross_platform_matrix_grep.py +297 -0
- package/src/apothem/conformity/determinism_grep.py +306 -0
- package/src/apothem/conformity/diagram_staleness_grep.py +154 -0
- package/src/apothem/conformity/dynamism_grep.py +284 -0
- package/src/apothem/conformity/editorconfig_presence_grep.py +281 -0
- package/src/apothem/conformity/file_header_grep.py +502 -0
- package/src/apothem/conformity/freshness_token_grep.py +233 -0
- package/src/apothem/conformity/frontmatter_grep.py +274 -0
- package/src/apothem/conformity/frontmatter_value_grep.py +386 -0
- package/src/apothem/conformity/gate.py +1386 -0
- package/src/apothem/conformity/gitattributes_presence_grep.py +238 -0
- package/src/apothem/conformity/harden_runner_grep.py +320 -0
- package/src/apothem/conformity/hedging_grep.py +129 -0
- package/src/apothem/conformity/license_author_consistency_grep.py +204 -0
- package/src/apothem/conformity/link_check.py +327 -0
- package/src/apothem/conformity/magic_number_grep.py +182 -0
- package/src/apothem/conformity/multi_surface_coherence_grep.py +620 -0
- package/src/apothem/conformity/naming_grep.py +224 -0
- package/src/apothem/conformity/no_global_plans_grep.py +339 -0
- package/src/apothem/conformity/no_toplevel_docs_grep.py +120 -0
- package/src/apothem/conformity/oidc_trusted_publishing_grep.py +291 -0
- package/src/apothem/conformity/option_annotation_grep.py +352 -0
- package/src/apothem/conformity/orphan_output_grep.py +206 -0
- package/src/apothem/conformity/permissions_minimum_scope_grep.py +299 -0
- package/src/apothem/conformity/plain_language_grep.py +559 -0
- package/src/apothem/conformity/plan_next_step_consistency_grep.py +450 -0
- package/src/apothem/conformity/plan_suite_structure_grep.py +534 -0
- package/src/apothem/conformity/plans_discipline_language_grep.py +245 -0
- package/src/apothem/conformity/production_ready_pr_grep.py +200 -0
- package/src/apothem/conformity/recommend_next_step_grep.py +250 -0
- package/src/apothem/conformity/redundancy_grep.py +401 -0
- package/src/apothem/conformity/reference_token_grep.py +230 -0
- package/src/apothem/conformity/registry_capability_consistency_grep.py +368 -0
- package/src/apothem/conformity/secret_leak_grep.py +193 -0
- package/src/apothem/conformity/semver_stability_grep.py +358 -0
- package/src/apothem/conformity/smoke_install_grep.py +194 -0
- package/src/apothem/conformity/static_version_grep.py +284 -0
- package/src/apothem/conformity/token_efficiency_grep.py +185 -0
- package/src/apothem/conformity/unpinned_action_grep.py +115 -0
- package/src/apothem/conformity/user_confirm_grep.py +74 -0
- package/src/apothem/conformity/workflow_concurrency_grep.py +283 -0
- package/src/apothem/harnesses/README.md +63 -0
- package/src/apothem/harnesses/__init__.py +16 -0
- package/src/apothem/harnesses/_shared/README.md +36 -0
- package/src/apothem/harnesses/_shared/__init__.py +12 -0
- package/src/apothem/harnesses/_shared/install_driver.py +281 -0
- package/src/apothem/harnesses/_shared/install_driver_apply.py +612 -0
- package/src/apothem/harnesses/_shared/install_driver_backup.py +535 -0
- package/src/apothem/harnesses/_shared/install_driver_converters.py +310 -0
- package/src/apothem/harnesses/_shared/install_driver_lifecycle.py +495 -0
- package/src/apothem/harnesses/_shared/install_driver_materialize.py +675 -0
- package/src/apothem/harnesses/_shared/install_driver_merge.py +656 -0
- package/src/apothem/harnesses/_shared/install_driver_pathsafety.py +137 -0
- package/src/apothem/harnesses/_shared/install_driver_planvalidation.py +240 -0
- package/src/apothem/harnesses/_shared/install_driver_removal.py +366 -0
- package/src/apothem/harnesses/_shared/install_driver_treeops.py +248 -0
- package/src/apothem/harnesses/_shared/install_driver_types.py +330 -0
- package/src/apothem/harnesses/_shared/wrapper_factories.py +448 -0
- package/src/apothem/harnesses/antigravity/STANDARD-CONVENTION-PIN.md +91 -0
- package/src/apothem/harnesses/antigravity/__init__.py +70 -0
- package/src/apothem/harnesses/antigravity/capabilities.yml +40 -0
- package/src/apothem/harnesses/antigravity/install.py +63 -0
- package/src/apothem/harnesses/antigravity/templates/GEMINI.md +40 -0
- package/src/apothem/harnesses/antigravity/templates/plugin.json +5 -0
- package/src/apothem/harnesses/antigravity/uninstall.py +22 -0
- package/src/apothem/harnesses/antigravity/update.py +10 -0
- package/src/apothem/harnesses/antigravity/verify.py +11 -0
- package/src/apothem/harnesses/claude_code/STANDARD-CONVENTION-PIN.md +65 -0
- package/src/apothem/harnesses/claude_code/__init__.py +107 -0
- package/src/apothem/harnesses/claude_code/capabilities.yml +42 -0
- package/src/apothem/harnesses/claude_code/install.py +147 -0
- package/src/apothem/harnesses/claude_code/templates/settings.json +351 -0
- package/src/apothem/harnesses/claude_code/uninstall.py +23 -0
- package/src/apothem/harnesses/claude_code/update.py +10 -0
- package/src/apothem/harnesses/claude_code/verify.py +11 -0
- package/src/apothem/harnesses/codebuddy/STANDARD-CONVENTION-PIN.md +74 -0
- package/src/apothem/harnesses/codebuddy/__init__.py +49 -0
- package/src/apothem/harnesses/codebuddy/capabilities.yml +34 -0
- package/src/apothem/harnesses/codebuddy/install.py +40 -0
- package/src/apothem/harnesses/codebuddy/templates/apothem-rules.md +37 -0
- package/src/apothem/harnesses/codebuddy/uninstall.py +25 -0
- package/src/apothem/harnesses/codebuddy/update.py +10 -0
- package/src/apothem/harnesses/codebuddy/verify.py +11 -0
- package/src/apothem/harnesses/codex/STANDARD-CONVENTION-PIN.md +79 -0
- package/src/apothem/harnesses/codex/__init__.py +72 -0
- package/src/apothem/harnesses/codex/capabilities.yml +40 -0
- package/src/apothem/harnesses/codex/install.py +69 -0
- package/src/apothem/harnesses/codex/templates/AGENTS.md +40 -0
- package/src/apothem/harnesses/codex/templates/hooks.json +127 -0
- package/src/apothem/harnesses/codex/uninstall.py +23 -0
- package/src/apothem/harnesses/codex/update.py +10 -0
- package/src/apothem/harnesses/codex/verify.py +11 -0
- package/src/apothem/harnesses/cursor/STANDARD-CONVENTION-PIN.md +79 -0
- package/src/apothem/harnesses/cursor/__init__.py +48 -0
- package/src/apothem/harnesses/cursor/capabilities.yml +42 -0
- package/src/apothem/harnesses/cursor/install.py +38 -0
- package/src/apothem/harnesses/cursor/templates/apothem-rules.mdc +40 -0
- package/src/apothem/harnesses/cursor/uninstall.py +25 -0
- package/src/apothem/harnesses/cursor/update.py +10 -0
- package/src/apothem/harnesses/cursor/verify.py +11 -0
- package/src/apothem/harnesses/gemini_cli/STANDARD-CONVENTION-PIN.md +102 -0
- package/src/apothem/harnesses/gemini_cli/__init__.py +52 -0
- package/src/apothem/harnesses/gemini_cli/capabilities.yml +43 -0
- package/src/apothem/harnesses/gemini_cli/install.py +43 -0
- package/src/apothem/harnesses/gemini_cli/templates/GEMINI.md +38 -0
- package/src/apothem/harnesses/gemini_cli/uninstall.py +25 -0
- package/src/apothem/harnesses/gemini_cli/update.py +10 -0
- package/src/apothem/harnesses/gemini_cli/verify.py +11 -0
- package/src/apothem/harnesses/github_copilot/STANDARD-CONVENTION-PIN.md +84 -0
- package/src/apothem/harnesses/github_copilot/__init__.py +47 -0
- package/src/apothem/harnesses/github_copilot/capabilities.yml +42 -0
- package/src/apothem/harnesses/github_copilot/install.py +40 -0
- package/src/apothem/harnesses/github_copilot/templates/copilot-instructions.md +33 -0
- package/src/apothem/harnesses/github_copilot/uninstall.py +25 -0
- package/src/apothem/harnesses/github_copilot/update.py +10 -0
- package/src/apothem/harnesses/github_copilot/verify.py +11 -0
- package/src/apothem/harnesses/glm/STANDARD-CONVENTION-PIN.md +77 -0
- package/src/apothem/harnesses/glm/__init__.py +56 -0
- package/src/apothem/harnesses/glm/capabilities.yml +33 -0
- package/src/apothem/harnesses/glm/install.py +45 -0
- package/src/apothem/harnesses/glm/templates/glm.toml +58 -0
- package/src/apothem/harnesses/glm/uninstall.py +25 -0
- package/src/apothem/harnesses/glm/update.py +10 -0
- package/src/apothem/harnesses/glm/verify.py +11 -0
- package/src/apothem/harnesses/hermes/STANDARD-CONVENTION-PIN.md +57 -0
- package/src/apothem/harnesses/hermes/__init__.py +33 -0
- package/src/apothem/harnesses/hermes/capabilities.yml +36 -0
- package/src/apothem/harnesses/hermes/install.py +17 -0
- package/src/apothem/harnesses/hermes/materializer.py +35 -0
- package/src/apothem/harnesses/hermes/uninstall.py +33 -0
- package/src/apothem/harnesses/hermes/update.py +10 -0
- package/src/apothem/harnesses/hermes/verify.py +11 -0
- package/src/apothem/harnesses/kimi_code/STANDARD-CONVENTION-PIN.md +128 -0
- package/src/apothem/harnesses/kimi_code/__init__.py +59 -0
- package/src/apothem/harnesses/kimi_code/capabilities.yml +40 -0
- package/src/apothem/harnesses/kimi_code/install.py +42 -0
- package/src/apothem/harnesses/kimi_code/templates/AGENTS.md +43 -0
- package/src/apothem/harnesses/kimi_code/uninstall.py +27 -0
- package/src/apothem/harnesses/kimi_code/update.py +10 -0
- package/src/apothem/harnesses/kimi_code/verify.py +11 -0
- package/src/apothem/harnesses/kiro/STANDARD-CONVENTION-PIN.md +77 -0
- package/src/apothem/harnesses/kiro/__init__.py +49 -0
- package/src/apothem/harnesses/kiro/capabilities.yml +36 -0
- package/src/apothem/harnesses/kiro/install.py +39 -0
- package/src/apothem/harnesses/kiro/templates/apothem-rules.md +36 -0
- package/src/apothem/harnesses/kiro/uninstall.py +25 -0
- package/src/apothem/harnesses/kiro/update.py +10 -0
- package/src/apothem/harnesses/kiro/verify.py +11 -0
- package/src/apothem/harnesses/open_claw/STANDARD-CONVENTION-PIN.md +62 -0
- package/src/apothem/harnesses/open_claw/__init__.py +35 -0
- package/src/apothem/harnesses/open_claw/capabilities.yml +35 -0
- package/src/apothem/harnesses/open_claw/install.py +17 -0
- package/src/apothem/harnesses/open_claw/materializer.py +36 -0
- package/src/apothem/harnesses/open_claw/uninstall.py +32 -0
- package/src/apothem/harnesses/open_claw/update.py +10 -0
- package/src/apothem/harnesses/open_claw/verify.py +11 -0
- package/src/apothem/harnesses/opencode/STANDARD-CONVENTION-PIN.md +76 -0
- package/src/apothem/harnesses/opencode/__init__.py +35 -0
- package/src/apothem/harnesses/opencode/capabilities.yml +43 -0
- package/src/apothem/harnesses/opencode/install.py +17 -0
- package/src/apothem/harnesses/opencode/materializer.py +31 -0
- package/src/apothem/harnesses/opencode/uninstall.py +34 -0
- package/src/apothem/harnesses/opencode/update.py +10 -0
- package/src/apothem/harnesses/opencode/verify.py +11 -0
- package/src/apothem/harnesses/qwen_code/STANDARD-CONVENTION-PIN.md +87 -0
- package/src/apothem/harnesses/qwen_code/__init__.py +37 -0
- package/src/apothem/harnesses/qwen_code/capabilities.yml +43 -0
- package/src/apothem/harnesses/qwen_code/install.py +19 -0
- package/src/apothem/harnesses/qwen_code/materializer.py +174 -0
- package/src/apothem/harnesses/qwen_code/templates/QWEN.md +30 -0
- package/src/apothem/harnesses/qwen_code/uninstall.py +34 -0
- package/src/apothem/harnesses/qwen_code/update.py +10 -0
- package/src/apothem/harnesses/qwen_code/verify.py +11 -0
- package/src/apothem/harnesses/trae/STANDARD-CONVENTION-PIN.md +70 -0
- package/src/apothem/harnesses/trae/__init__.py +49 -0
- package/src/apothem/harnesses/trae/capabilities.yml +34 -0
- package/src/apothem/harnesses/trae/install.py +38 -0
- package/src/apothem/harnesses/trae/templates/apothem-rules.md +37 -0
- package/src/apothem/harnesses/trae/uninstall.py +25 -0
- package/src/apothem/harnesses/trae/update.py +10 -0
- package/src/apothem/harnesses/trae/verify.py +11 -0
- package/src/apothem/harnesses/windsurf/STANDARD-CONVENTION-PIN.md +91 -0
- package/src/apothem/harnesses/windsurf/__init__.py +52 -0
- package/src/apothem/harnesses/windsurf/capabilities.yml +40 -0
- package/src/apothem/harnesses/windsurf/install.py +41 -0
- package/src/apothem/harnesses/windsurf/templates/apothem-rules.md +37 -0
- package/src/apothem/harnesses/windsurf/uninstall.py +25 -0
- package/src/apothem/harnesses/windsurf/update.py +10 -0
- package/src/apothem/harnesses/windsurf/verify.py +11 -0
- package/src/apothem/harnesses/zed/STANDARD-CONVENTION-PIN.md +92 -0
- package/src/apothem/harnesses/zed/__init__.py +57 -0
- package/src/apothem/harnesses/zed/capabilities.yml +38 -0
- package/src/apothem/harnesses/zed/install.py +41 -0
- package/src/apothem/harnesses/zed/templates/apothem-rules.md +32 -0
- package/src/apothem/harnesses/zed/uninstall.py +28 -0
- package/src/apothem/harnesses/zed/update.py +10 -0
- package/src/apothem/harnesses/zed/verify.py +11 -0
- package/src/apothem/hooks/README.md +81 -0
- package/src/apothem/hooks/__init__.py +24 -0
- package/src/apothem/hooks/askuserquestion_validator.py +380 -0
- package/src/apothem/hooks/dispatch.py +296 -0
- package/src/apothem/hooks/emit_hook_context.py +444 -0
- package/src/apothem/hooks/hooks.json +318 -0
- package/src/apothem/hooks/lib/README.md +39 -0
- package/src/apothem/hooks/lib/__init__.py +18 -0
- package/src/apothem/hooks/lib/bootstrap.ps1 +129 -0
- package/src/apothem/hooks/lib/bootstrap.sh +103 -0
- package/src/apothem/hooks/lib/events.py +51 -0
- package/src/apothem/hooks/lib/find-pwsh.ps1 +78 -0
- package/src/apothem/hooks/lib/find-pwsh.sh +76 -0
- package/src/apothem/hooks/lib/find-python.ps1 +63 -0
- package/src/apothem/hooks/lib/find-python.sh +97 -0
- package/src/apothem/hooks/lib/log.py +43 -0
- package/src/apothem/hooks/lib/resolve_root.py +264 -0
- package/src/apothem/hooks/messages/postcompact.md +14 -0
- package/src/apothem/hooks/messages/posttooluse-proactive-compaction.md +46 -0
- package/src/apothem/hooks/messages/precompact.md +14 -0
- package/src/apothem/hooks/messages/pretooluse-askuserquestion-recommended.md +65 -0
- package/src/apothem/hooks/messages/pretooluse-bash-plan-guard.md +97 -0
- package/src/apothem/hooks/messages/pretooluse-bash.md +39 -0
- package/src/apothem/hooks/messages/pretooluse-conformity.md +70 -0
- package/src/apothem/hooks/messages/pretooluse-dependency-guard.md +21 -0
- package/src/apothem/hooks/messages/pretooluse-edit-header-guard.md +61 -0
- package/src/apothem/hooks/messages/pretooluse-edit.md +21 -0
- package/src/apothem/hooks/messages/pretooluse-eval-guard.md +39 -0
- package/src/apothem/hooks/messages/pretooluse-notebookedit.md +11 -0
- package/src/apothem/hooks/messages/pretooluse-write-header-guard.md +45 -0
- package/src/apothem/hooks/messages/pretooluse-write-plan-guard.md +72 -0
- package/src/apothem/hooks/messages/pretooluse-write.md +21 -0
- package/src/apothem/hooks/messages/sessionstart.md +15 -0
- package/src/apothem/hooks/messages/stop.md +27 -0
- package/src/apothem/hooks/proactive_compaction_tracker.py +327 -0
- package/src/apothem/hooks/session_start_bootstrap.py +472 -0
- package/src/apothem/lib/README.md +42 -0
- package/src/apothem/lib/__init__.py +13 -0
- package/src/apothem/lib/atomic_io.py +189 -0
- package/src/apothem/lib/auditor.py +687 -0
- package/src/apothem/lib/clean_slate.py +396 -0
- package/src/apothem/lib/contexts.py +352 -0
- package/src/apothem/lib/data_home.py +255 -0
- package/src/apothem/lib/frontmatter.py +101 -0
- package/src/apothem/lib/harness_materializer.py +213 -0
- package/src/apothem/lib/harness_protocol.py +59 -0
- package/src/apothem/lib/harness_registry.py +282 -0
- package/src/apothem/lib/harness_registry_data.py +843 -0
- package/src/apothem/lib/install_ledger.py +347 -0
- package/src/apothem/lib/learning.py +540 -0
- package/src/apothem/lib/memory.py +347 -0
- package/src/apothem/lib/parallel_sweep.py +234 -0
- package/src/apothem/lib/plan_tiers.py +200 -0
- package/src/apothem/lib/plugin_bootstrap.py +132 -0
- package/src/apothem/lib/plugin_tree.py +599 -0
- package/src/apothem/lib/profile.py +755 -0
- package/src/apothem/lib/profile_projection.py +198 -0
- package/src/apothem/lib/propagation-manifest.yaml +878 -0
- package/src/apothem/lib/propagation.py +220 -0
- package/src/apothem/lib/python_resolver.py +189 -0
- package/src/apothem/lib/reporter.py +62 -0
- package/src/apothem/lib/workspace_migration.py +323 -0
- package/src/apothem/output-styles/README.md +41 -0
- package/src/apothem/output-styles/concise-engineer.md +49 -0
- package/src/apothem/output-styles/default-architect.md +52 -0
- package/src/apothem/output-styles/default.md +113 -0
- package/src/apothem/output-styles/forensic-auditor.md +63 -0
- package/src/apothem/py.typed +0 -0
- package/src/apothem/rules/README.md +121 -0
- package/src/apothem/rules/agent-capability-discipline-matrix.md +89 -0
- package/src/apothem/rules/agent-capability-discipline.md +78 -0
- package/src/apothem/rules/agent-orchestration-patterns.md +144 -0
- package/src/apothem/rules/agent-orchestration.md +65 -0
- package/src/apothem/rules/agents-md-convention.md +86 -0
- package/src/apothem/rules/agile-sprints-elements.md +135 -0
- package/src/apothem/rules/agile-sprints.md +64 -0
- package/src/apothem/rules/agnostic-posture-checklist.md +47 -0
- package/src/apothem/rules/agnostic-posture.md +48 -0
- package/src/apothem/rules/authoritative-referencing-quotation.md +50 -0
- package/src/apothem/rules/authoritative-referencing.md +66 -0
- package/src/apothem/rules/authority-inquiry-categories.md +58 -0
- package/src/apothem/rules/authority-inquiry.md +54 -0
- package/src/apothem/rules/auto-memory-topic-files.md +86 -0
- package/src/apothem/rules/auto-memory.md +67 -0
- package/src/apothem/rules/bidirectional-binding.md +123 -0
- package/src/apothem/rules/canonical-layout-reporting-tiers.md +212 -0
- package/src/apothem/rules/canonical-layout.md +60 -0
- package/src/apothem/rules/clean-architecture-layers.md +186 -0
- package/src/apothem/rules/clean-room-generation-protocols.md +124 -0
- package/src/apothem/rules/clean-room-generation.md +59 -0
- package/src/apothem/rules/code-craft-conventions.md +101 -0
- package/src/apothem/rules/code-craft-markdown.md +138 -0
- package/src/apothem/rules/code-craft-python.md +154 -0
- package/src/apothem/rules/code-craft-shell.md +192 -0
- package/src/apothem/rules/cognitive-identity-techniques.md +180 -0
- package/src/apothem/rules/cognitive-identity.md +81 -0
- package/src/apothem/rules/context-management-budget.md +46 -0
- package/src/apothem/rules/context-management-protocol.md +161 -0
- package/src/apothem/rules/context-management-scratch.md +128 -0
- package/src/apothem/rules/context-management.md +85 -0
- package/src/apothem/rules/definitiveness-virtues.md +67 -0
- package/src/apothem/rules/definitiveness.md +58 -0
- package/src/apothem/rules/determinism.md +81 -0
- package/src/apothem/rules/disclosure-ledger-markers.md +58 -0
- package/src/apothem/rules/disclosure-ledger.md +52 -0
- package/src/apothem/rules/dynamism.md +38 -0
- package/src/apothem/rules/etc-extension.md +57 -0
- package/src/apothem/rules/expertise-posture-elements.md +68 -0
- package/src/apothem/rules/expertise-posture.md +54 -0
- package/src/apothem/rules/freshness-facade.md +64 -0
- package/src/apothem/rules/harness-adapter-shape-schemas.md +162 -0
- package/src/apothem/rules/harness-adapter-shape.md +42 -0
- package/src/apothem/rules/host-discovery-manifests.md +50 -0
- package/src/apothem/rules/host-discovery.md +56 -0
- package/src/apothem/rules/i18n-discipline-locale-cohorts.md +120 -0
- package/src/apothem/rules/i18n-discipline.md +70 -0
- package/src/apothem/rules/interactive-questions-canonical-shapes.md +590 -0
- package/src/apothem/rules/interactive-questions-detail.md +41 -0
- package/src/apothem/rules/interactive-questions-sweep-matchers.md +184 -0
- package/src/apothem/rules/interactive-questions.md +89 -0
- package/src/apothem/rules/large-file-generation.md +112 -0
- package/src/apothem/rules/large-file-reading.md +59 -0
- package/src/apothem/rules/living-docs.md +85 -0
- package/src/apothem/rules/multi-agent-workflow.md +57 -0
- package/src/apothem/rules/operational-mandates-expanded.md +78 -0
- package/src/apothem/rules/operational-mandates.md +88 -0
- package/src/apothem/rules/option-annotation-form.md +60 -0
- package/src/apothem/rules/option-annotation.md +45 -0
- package/src/apothem/rules/own-voice-reimplementation.md +86 -0
- package/src/apothem/rules/performance-discipline.md +91 -0
- package/src/apothem/rules/persistent-conventions-vigilance-checklist.md +54 -0
- package/src/apothem/rules/persistent-conventions-vigilance.md +61 -0
- package/src/apothem/rules/plain-language.md +56 -0
- package/src/apothem/rules/planning-techniques.md +130 -0
- package/src/apothem/rules/pre-emission-gate-bars.md +86 -0
- package/src/apothem/rules/pre-emission-gate.md +54 -0
- package/src/apothem/rules/production-ready-prs-surfaces.md +162 -0
- package/src/apothem/rules/production-ready-prs.md +83 -0
- package/src/apothem/rules/propagation.md +63 -0
- package/src/apothem/rules/recommend-next-step.md +106 -0
- package/src/apothem/rules/refactoring-discipline.md +76 -0
- package/src/apothem/rules/session-closure.md +44 -0
- package/src/apothem/rules/sota-elevation-exemplars.md +76 -0
- package/src/apothem/rules/sota-elevation.md +52 -0
- package/src/apothem/rules/source-accessibility.md +58 -0
- package/src/apothem/rules/surgical-manipulation.md +48 -0
- package/src/apothem/rules/systemic-participation-relations.md +108 -0
- package/src/apothem/rules/systemic-participation.md +70 -0
- package/src/apothem/rules/ten-dimension-check-dimensions.md +52 -0
- package/src/apothem/rules/ten-dimension-check.md +59 -0
- package/src/apothem/rules/token-budget-discipline.md +81 -0
- package/src/apothem/rules/token-efficiency-rewrite-protocol.md +79 -0
- package/src/apothem/rules/token-efficiency-rewrite.md +77 -0
- package/src/apothem/rules/tool-use-discipline.md +48 -0
- package/src/apothem/rules/visual-leverage.md +102 -0
- package/src/apothem/schemas/NOTICE.md +9 -0
- package/src/apothem/schemas/README.md +104 -0
- package/src/apothem/schemas/__init__.py +176 -0
- package/src/apothem/schemas/advisory-finding.schema.json +111 -0
- package/src/apothem/schemas/agent.schema.json +106 -0
- package/src/apothem/schemas/authorship-header.txt +1 -0
- package/src/apothem/schemas/cohort-manifest.yaml +248 -0
- package/src/apothem/schemas/cohort-metadata-vocabulary.yaml +168 -0
- package/src/apothem/schemas/cohort.schema.json +113 -0
- package/src/apothem/schemas/command.schema.json +68 -0
- package/src/apothem/schemas/compatibility-matrix.yaml +432 -0
- package/src/apothem/schemas/context-fragment.schema.json +64 -0
- package/src/apothem/schemas/freshness-token-denylist.txt +51 -0
- package/src/apothem/schemas/handoff-manifest.yaml +353 -0
- package/src/apothem/schemas/header-exceptions.txt +141 -0
- package/src/apothem/schemas/header-visibility.yaml +39 -0
- package/src/apothem/schemas/learning-signal.schema.json +46 -0
- package/src/apothem/schemas/memory-record.schema.json +61 -0
- package/src/apothem/schemas/output-style.schema.json +40 -0
- package/src/apothem/schemas/plan.schema.json +51 -0
- package/src/apothem/schemas/plugin.schema.json +83 -0
- package/src/apothem/schemas/profile.example.yaml +70 -0
- package/src/apothem/schemas/profile.minimal.yaml +6 -0
- package/src/apothem/schemas/profile.schema.json +396 -0
- package/src/apothem/schemas/reference-token-denylist.txt +25 -0
- package/src/apothem/schemas/skill.schema.json +75 -0
- package/src/apothem/skills/README.md +93 -0
- package/src/apothem/skills/dependency-upgrade/SKILL.md +105 -0
- package/src/apothem/skills/dev-toolkit/SKILL.md +120 -0
- package/src/apothem/skills/diagram-authoring/SKILL.md +113 -0
- package/src/apothem/skills/document-authoring/SKILL.md +118 -0
- package/src/apothem/skills/ecosystem-audit/SKILL.md +108 -0
- package/src/apothem/skills/ecosystem-audit/references/audit-fortress.md +85 -0
- package/src/apothem/skills/ecosystem-audit/references/procedure.md +162 -0
- package/src/apothem/skills/eval-harness/SKILL.md +88 -0
- package/src/apothem/skills/incident-runbook/SKILL.md +92 -0
- package/src/apothem/skills/multi-source-research/SKILL.md +90 -0
- package/src/apothem/skills/plan-suite/SKILL.md +118 -0
- package/src/apothem/skills/plan-suite/master_template.md +1324 -0
- package/src/apothem/skills/projectify/SKILL.md +117 -0
- package/src/apothem/skills/prompt-engineering/SKILL.md +122 -0
- package/src/apothem/skills/refactor-extract/SKILL.md +85 -0
- package/src/apothem/skills/research-suite/SKILL.md +170 -0
- package/src/apothem/skills/research-suite/references/directory-structure.md +47 -0
- package/src/apothem/skills/research-suite/references/lifecycle.md +67 -0
- package/src/apothem/skills/research-suite/references/principal-investigator-framework.md +37 -0
- package/src/apothem/skills/research-suite/references/rigor-mandates.md +30 -0
- package/src/apothem/skills/research-suite/research_template.md +476 -0
- package/src/apothem/skills/secret-rotation/SKILL.md +87 -0
- package/src/apothem/skills/source-synthesis/SKILL.md +92 -0
- package/src/apothem/skills/surgical-guard/SKILL.md +118 -0
- package/src/apothem/skills/test-authoring/SKILL.md +85 -0
- package/src/apothem/skills/vuln-triage/SKILL.md +91 -0
- package/src/apothem/skills/workflow/SKILL.md +139 -0
- package/src/apothem/statuslines/README.md +26 -0
- package/src/apothem/statuslines/__init__.py +20 -0
- package/src/apothem/statuslines/conformity.json +5 -0
- package/src/apothem/statuslines/render.py +334 -0
- package/src/apothem/statuslines/statusline.md +50 -0
- package/src/apothem/templates/README.md +43 -0
- package/src/apothem/templates/agents-md-template.md +80 -0
- package/src/apothem/templates/consideration-log.md +39 -0
- package/src/apothem/templates/expertise-gap-log.md +56 -0
- package/src/apothem/templates/master-index-template.md +93 -0
- package/src/apothem/templates/potency-map.md +53 -0
- package/src/apothem/templates/preservation-audit.md +60 -0
- package/src/apothem/templates/question-resolution-audit.md +52 -0
- package/src/apothem/templates/trace-matrix-template.md +77 -0
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: "secret-rotation"
|
|
3
|
+
version: "0.1.0"
|
|
4
|
+
updated: "2026-06-22"
|
|
5
|
+
description: "Safe secret-rotation template — matched when the user says 'rotate a secret', 'a key leaked', 'a token leaked', 'a credential is exposed', 'revoke and re-issue this key', 'an API key was committed', or any phrasing that asks to safely retire and replace an exposed credential. Treats a leaked credential as compromised the moment it touched a tracked file and enforces the revoke-before-re-issue ordering invariant: detects the coarse exposure surface, revokes the compromised credential at its issuer FIRST, re-issues a least-privilege replacement, rewires configuration through env-var or secret-manager indirection (never plaintext), and verifies no plaintext residue remains in the working tree or version-control history. NOT a full secret-scanner (routes the broad sweep to the host's scanner), NOT an issuer client, NOT a history-rewrite engine. User-invocable directly."
|
|
6
|
+
archetype: "security-template"
|
|
7
|
+
userInvocable: true
|
|
8
|
+
argument-hint: "[--scope PATH]"
|
|
9
|
+
disable-model-invocation: true
|
|
10
|
+
allowed-tools: "Read, Write, Edit, Glob, Grep, Bash"
|
|
11
|
+
---
|
|
12
|
+
|
|
13
|
+
<!-- SPDX-License-Identifier: MIT -->
|
|
14
|
+
|
|
15
|
+
## Purpose
|
|
16
|
+
|
|
17
|
+
Drive the safe rotation of an exposed secret end to end: detect the exposure surface, revoke the compromised credential at its issuer, re-issue a replacement, rewire configuration through indirection, and verify no plaintext residue remains.
|
|
18
|
+
|
|
19
|
+
The skill treats a leaked credential as **already compromised the moment it touched a tracked file**. This drives the one non-negotiable ordering invariant of the whole procedure: **revoke before re-issue.** A replacement minted before the leaked key is revoked leaves both keys live — doubling the attack surface instead of closing it. Every step downstream of detection assumes the leaked key is in an adversary's hands.
|
|
20
|
+
|
|
21
|
+
## Detection Signal
|
|
22
|
+
|
|
23
|
+
The user asks to retire and replace a compromised credential. Trigger phrases: "rotate a secret", "a key leaked", "a token leaked", "a credential is exposed", "an API key was committed", "revoke and re-issue this key".
|
|
24
|
+
|
|
25
|
+
## Non-Goals
|
|
26
|
+
|
|
27
|
+
The skill carries a deliberately narrow surface. It is NOT:
|
|
28
|
+
|
|
29
|
+
- **Not a full secret-scanner replacement.** Detection is coarse — high-entropy strings, known key prefixes, and the host's ratified secret patterns. Exhaustive scanning is `gitleaks` / `trufflehog` territory under `conformity/secret_leak_grep.py` and the host's CI; this skill routes the broad sweep there and acts on the confirmed exposure.
|
|
30
|
+
- **Not an issuer client.** The skill names the revocation and re-issue steps the operator performs at the credential's issuer (cloud console, registry, identity provider); it does not hold issuer credentials or call issuer APIs on the operator's behalf.
|
|
31
|
+
- **Not a history-rewrite engine.** History rewriting (`git filter-repo`, BFG) is surfaced as an operator decision under the per-file destructive-op floor, never executed silently.
|
|
32
|
+
|
|
33
|
+
## Workflow
|
|
34
|
+
|
|
35
|
+
Five ordered steps. The order is the safety contract — step 2 (revoke) MUST precede step 3 (re-issue); the procedure NEVER mints a replacement while the leaked key is still live.
|
|
36
|
+
|
|
37
|
+
1. **Detect the exposure surface.** Glob the scope (`--scope PATH`, default project root) and Grep for the host's ratified secret patterns, known key prefixes, and high-entropy literals. Enumerate **every** file and line where the credential appears. Run `git log -p -S '<fragment>'` to find the historical commits that introduced or carried the secret. **Criterion:** the full surface — working tree AND history — is reported; the skill never acts on a partial enumeration, because a missed occurrence is a credential still leaking after rotation "completes".
|
|
38
|
+
|
|
39
|
+
2. **Revoke the compromised credential at its issuer — FIRST.** Direct the operator to revoke the leaked credential at its issuer (cloud console, registry, identity provider) before any other action. A live leaked key is an open door; revocation closes it before a replacement exists. **Criterion:** revocation is confirmed by the operator. The skill does NOT advance to step 3 on an unconfirmed revocation — STOP and re-confirm.
|
|
40
|
+
|
|
41
|
+
3. **Re-issue a replacement.** Direct the operator to mint a new credential at the same issuer with the **minimum scope** the workload requires (least-privilege, not a copy of the old grant). Capture the new value only into the step-4 indirection surface — **never echo it to STDOUT, never write it to a tracked file, never paste it into a report.** **Criterion:** a replacement exists and its value is held only behind indirection.
|
|
42
|
+
|
|
43
|
+
4. **Rewire configuration through indirection.** Replace every plaintext occurrence from step 1 with an env-var reference or a secret-manager lookup discovered per `rules/host-discovery.md` (the host's ratified `.env` convention, vault path, or cloud secret-manager). The replacement reads the value at runtime; the tracked source carries only the **reference**. **Criterion:** zero plaintext secrets remain in tracked config — every site reads through indirection.
|
|
44
|
+
|
|
45
|
+
5. **Verify no plaintext residue remains.** Re-run the step-1 sweep over the working tree and confirm **zero** plaintext hits. Re-run `git log -p -S '<fragment>'`; when the secret persists in history, surface the history-rewrite decision under the per-file destructive-op floor (one structured-inquiry invocation per affected ref, every option's `default-pointer:` carrying the verbatim `no-default: user decision required` marker). Confirm the new credential resolves through indirection and the workload reaches a working run. **Criterion:** working-tree sweep is clean, history disposition is decided (rewritten or operator-accepted-with-rationale), and the workload runs green on the replacement.
|
|
46
|
+
|
|
47
|
+
## Return Contract
|
|
48
|
+
|
|
49
|
+
Maximum response: 800 tokens. Structure:
|
|
50
|
+
|
|
51
|
+
- **Summary:** one sentence stating the credential rotated and its disposition.
|
|
52
|
+
- **Exposure surface:** every file / line / historical commit where the secret appeared.
|
|
53
|
+
- **Actions taken:** revocation confirmation, re-issue confirmation, indirection rewiring per file.
|
|
54
|
+
- **Residue verification:** working-tree and history sweep results; pending history-rewrite decisions.
|
|
55
|
+
- **Surfaced gaps:** out-of-axis concerns (deeper scan, related credentials) per M6. Empty: `none`.
|
|
56
|
+
|
|
57
|
+
## Foundational Stanzas
|
|
58
|
+
|
|
59
|
+
The four standing surfaces every operator inherits, adapted to this skill's user-invocable security role so the destructive-op floor is preserved across the rotation surface.
|
|
60
|
+
|
|
61
|
+
### Refusal & Escalation
|
|
62
|
+
|
|
63
|
+
REFUSE any request that asks the skill to act outside its mission — exhaustive secret-scanning, holding issuer credentials, silent history rewriting, rotating a credential the operator has not confirmed exposed. Refusal is explicit: name what was refused, name the mission boundary crossed, and surface escalation through the structured-inquiry channel per `rules/interactive-questions.md` (canonical channel; three-segment option annotation; never free-form prose as primary input). When revocation cannot be confirmed, STOP before re-issue — a replacement minted beside a live leaked key doubles the exposure.
|
|
64
|
+
|
|
65
|
+
### Output Surface
|
|
66
|
+
|
|
67
|
+
The rotation report writes to STDOUT. NEVER write a captured secret value to a tracked file, a report, or STDOUT. Configuration edits land at the host's ratified paths per `rules/host-discovery.md`; indirection references replace plaintext in place. Audit-internal scratch lands under `.audit/` (gitignored-class per the canonical `.gitignore` snippet); NEVER write rotation working state to a global location.
|
|
68
|
+
|
|
69
|
+
### File-Authoring Contract
|
|
70
|
+
|
|
71
|
+
When the skill emits a NEW file (rare; the rotation path edits existing config in place), the file routes through `scripts/inject-header.py` so the canonical single-line SPDX license header is injected at the head; the injector is idempotent and detects the filetype variant automatically from the byte-exact fixture at `src/apothem/schemas/authorship-header.txt`. Exempt classes (LICENSE, JSON configuration files, lockfiles, generated assets, `.env` files, `.audit/` ephemera, binary files) are enumerated at `src/apothem/schemas/header-exceptions.txt`. Edits to existing config preserve any existing header.
|
|
72
|
+
|
|
73
|
+
### Structured Inquiry on Ambiguity
|
|
74
|
+
|
|
75
|
+
When the rotation reaches a decision in any of the seven authoritative-data categories per `rules/host-discovery.md` and `rules/authority-inquiry.md` — identity (credential owner), scope direction (which secret, which environment), preference (secret-manager choice), security (rotation cadence, allowed egress), naming of public surfaces, infrastructure endpoints (issuer, vault path), version pins — and the host is silent, route the resolution through the structured-inquiry channel with the three-segment option annotation per `rules/interactive-questions.md` §3 (rationale / recommendation / default-pointer). NEVER fabricate authoritative data. The replacement landing in production-ready form — config rewired, no plaintext residue, workload green — satisfies the same-change-set discipline per `rules/production-ready-prs.md`. **Per-file destructive-op floor.** Every history-rewriting step (`git filter-repo`, BFG, force-update of a ref) and every delete / overwrite-without-retention of an exposed file routes through the structured-inquiry channel on a per-file (per-ref) basis per `rules/interactive-questions.md` §6 — one invocation per ref, every time, no `multiSelect` batching, every option's `default-pointer:` carries the verbatim `no-default: user decision required` marker.
|
|
76
|
+
|
|
77
|
+
## Recommended Next Step
|
|
78
|
+
|
|
79
|
+
**Run `python -m apothem.conformity.gate --all .`** to run the host's mechanical conformity corpus — which includes the secret-leak matcher — and confirm zero plaintext-secret residue after rotation. (To scope the secret-leak matcher to a single touched file, use `--check secret-leak-grep <path>`; the bare `--check secret-leak-grep .` directory form is not a runnable invocation.)
|
|
80
|
+
|
|
81
|
+
## Bindings (§0.j five-direction)
|
|
82
|
+
|
|
83
|
+
- **Drives →** ● Every exposed-credential rotation the operator invokes. ● Every plaintext-to-indirection config rewiring under the host's ratified secret surface. ◐ The per-ref history-rewrite decision under the destructive-op floor.
|
|
84
|
+
- **Satisfies →** ● `CLAUDE.md` Source Layout row "secret-rotation" (skills/ class). ● `rules/production-ready-prs.md` supply-chain-posture preservation (no secret literal in tracked source).
|
|
85
|
+
- **Established by ↑** ● `CLAUDE.md` Source Layout (skills/ folder-with-`SKILL.md` convention). ● `CLAUDE.md` Ambiguity Handling (structured inquiry over fabrication).
|
|
86
|
+
- **Gated by ←** ● The harness's tool surface (Read / Write / Edit / Glob / Grep / Bash). ● Operator confirmation of revocation before re-issue.
|
|
87
|
+
- **Cross-bound with ↔** ↔ `rules/host-discovery.md` (secret-manager and `.env` convention discovery). ↔ `rules/interactive-questions.md` (per-ref destructive-op floor on history rewrites). ↔ `rules/production-ready-prs.md` (supply-chain posture). ↔ `conformity/secret_leak_grep.py` (the mechanical sweep this skill routes to). ↔ `skills/ecosystem-audit/SKILL.md` (sibling skill under the same registry section).
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: "source-synthesis"
|
|
3
|
+
version: "0.1.0"
|
|
4
|
+
updated: "2026-06-22"
|
|
5
|
+
description: "Reconcile a fixed set of provided sources into one cited synthesis — matched when the user says 'synthesize these sources', 'combine these documents', 'reconcile these', 'what do these say together', 'merge these notes into one', or any phrasing that hands over N specific documents and asks for a single consolidated reading. Extracts the claim set per source with citation anchors, reconciles agreements and contradictions across sources, and produces a cited synthesis that separates consensus from contested ground while flagging coverage gaps. User-invocable directly via `--sources`; never gathers or discovers sources of its own (that is the `multi-source-research` surface), never adjudicates which source is correct against ground truth (a contradiction is reported as contested, not resolved by fiat), and never synthesizes fewer than two sources (a lone source is summarized, not synthesized)."
|
|
6
|
+
archetype: "research-template"
|
|
7
|
+
userInvocable: true
|
|
8
|
+
argument-hint: "[--sources GLOB_OR_PATHS]"
|
|
9
|
+
disable-model-invocation: true
|
|
10
|
+
allowed-tools: "Read, Write, Edit, Glob, Grep"
|
|
11
|
+
---
|
|
12
|
+
|
|
13
|
+
<!-- SPDX-License-Identifier: MIT -->
|
|
14
|
+
|
|
15
|
+
## Purpose
|
|
16
|
+
|
|
17
|
+
Reconcile a **fixed set of operator-provided sources** into one cited synthesis. The skill reads each named source, extracts its claim set with per-claim citation anchors, cross-references the claims to surface agreement and contradiction, and emits a single synthesis that separates what the sources **agree on** from what they **contest** — with every synthesized claim attributed to the source(s) that assert it.
|
|
18
|
+
|
|
19
|
+
The discipline that distinguishes synthesis from summary: synthesis is **relational**. It does not merely report what each source says; it places each claim in relation to the others — consensus, contradiction, or solitary assertion — so the reader sees not just the content but its evidentiary weight. Per-claim attribution is non-negotiable: an unattributed synthesized claim is indistinguishable from a fabrication.
|
|
20
|
+
|
|
21
|
+
## Detection Signal
|
|
22
|
+
|
|
23
|
+
The user provides specific documents and asks for a consolidated reading. Trigger phrases: "synthesize these sources", "combine these documents", "reconcile these", "what do these say together", "merge these notes into one". The defining marker: the source set is **given, not requested** — the user names the inputs and asks for the union, never for new material.
|
|
24
|
+
|
|
25
|
+
## Non-Goals
|
|
26
|
+
|
|
27
|
+
The skill carries a deliberately narrow surface. It is NOT:
|
|
28
|
+
|
|
29
|
+
- **Not source discovery.** The skill consumes the sources the operator provides via `--sources`. It does NOT search for additional documents, follow citations to new material, or fetch external references. Discovery of sources to synthesize is the `multi-source-research` surface; this skill begins where the source set is already fixed.
|
|
30
|
+
- **Not a fact-checker.** The skill reconciles what the sources say against each other; it does NOT adjudicate which source is correct against ground truth. A contradiction is reported as contested, not resolved by fiat. External verification is out of scope.
|
|
31
|
+
- **Not a summarizer of a single document.** Synthesis requires two or more sources to reconcile. A lone source is summarized, not synthesized; that request routes elsewhere.
|
|
32
|
+
- **Not a content generator.** Every synthesized claim traces to a source claim. The skill introduces no assertion the sources do not support; unsupported ground is flagged as a gap, never filled.
|
|
33
|
+
|
|
34
|
+
## Workflow
|
|
35
|
+
|
|
36
|
+
Five ordered steps. Each step's output exists and is checkable before the next runs — the **Criterion** gates the advance.
|
|
37
|
+
|
|
38
|
+
1. **Resolve the source set.** Expand `--sources` (glob or explicit paths) to a concrete file list and read each source. **Criterion:** the resolved list holds **two or more** sources and every path read successfully. A missing or unreadable source STOPs the workflow and surfaces the gap; a resolved set of fewer than two routes to single-source summary, not synthesis (per Non-Goals).
|
|
39
|
+
|
|
40
|
+
2. **Extract the claim set per source.** For each source, enumerate its distinct claims and attach a **citation anchor** to each — source path plus the locating heading, line range, or quoted span — so a reader can verify the claim at its origin. **Criterion:** every source has a claim list, and every claim carries an anchor that resolves back to its source.
|
|
41
|
+
|
|
42
|
+
3. **Reconcile across sources.** Cross-reference the per-source claim sets. Cluster claims by **subject**; within each cluster, assign exactly one relation:
|
|
43
|
+
- **Agreement** — two or more sources assert the same claim.
|
|
44
|
+
- **Contradiction** — sources assert mutually incompatible claims about the same subject.
|
|
45
|
+
- **Singleton** — one source only asserts the claim.
|
|
46
|
+
|
|
47
|
+
**Criterion:** every claim lands in exactly one subject cluster with exactly one assigned relation — no claim is unclassified, none double-counted.
|
|
48
|
+
|
|
49
|
+
4. **Produce the cited synthesis.** Emit the consolidated reading with consensus and contested ground **visibly separated**: a **Consensus** section (agreed claims, citing every asserting source) and a **Contested** section (each contradiction, citing each side's source and conflicting anchors). **Criterion:** no synthesized claim lacks attribution; consensus and contested ground are structurally distinct, never blended into a single narrative that hides which ground is settled.
|
|
50
|
+
|
|
51
|
+
5. **Flag gaps.** Name the subjects the source set leaves uncovered, the singleton claims (unconfirmed by a second source), and the contradictions left unresolved. **Criterion:** a Gaps section exists — even when its content is the single word "none" — so the reader always knows the boundary of what the sources can settle.
|
|
52
|
+
|
|
53
|
+
## Return Contract
|
|
54
|
+
|
|
55
|
+
A cited synthesis with four labeled sections, in order:
|
|
56
|
+
|
|
57
|
+
- **Consensus** — claims asserted by two or more sources, each citing every agreeing source.
|
|
58
|
+
- **Contested** — contradictions across sources, each side attributed to its source with the conflicting anchors.
|
|
59
|
+
- **Singletons** — claims a single source asserts, marked **unconfirmed**.
|
|
60
|
+
- **Gaps** — subjects the source set leaves uncovered plus contradictions left unresolved (`none` when empty).
|
|
61
|
+
|
|
62
|
+
**Per-claim source attribution is mandatory.** A synthesized claim with no source anchor is a contract failure — it is the failure mode this skill exists to prevent, because an unattributed claim cannot be distinguished from invented material.
|
|
63
|
+
|
|
64
|
+
## Foundational Stanzas
|
|
65
|
+
|
|
66
|
+
### Refusal & Escalation
|
|
67
|
+
|
|
68
|
+
REFUSE any request that pushes the skill past its mission — discovering new sources, fact-checking against external ground truth, summarizing a single document, or generating claims the sources do not support. Refusal is explicit: name what was refused, name the mission boundary the request crossed, and route the operator to the correct surface via the structured-inquiry channel per `rules/interactive-questions.md` (canonical channel; three-segment option annotation; never free-form prose as primary input). When `--sources` resolves to fewer than two sources, REFUSE the synthesis and surface the single-source-summary boundary instead.
|
|
69
|
+
|
|
70
|
+
### Output Surface
|
|
71
|
+
|
|
72
|
+
The synthesis writes to STDOUT for direct invocation. When the operator requests a durable artifact, it lands at the operator-named path under the host project per `rules/host-discovery.md`; per `rules/operational-mandates.md` CM-7, the artifact carries natural domain language with zero plan-internal references. NEVER write to a global-ecosystem location and NEVER fabricate a source path the operator did not provide.
|
|
73
|
+
|
|
74
|
+
### File-Authoring Contract
|
|
75
|
+
|
|
76
|
+
When the skill emits a NEW file, it routes through `scripts/inject-header.py` so the canonical authorship header is injected at the head; the injector is idempotent and detects the filetype variant from the byte-exact fixture at `src/apothem/schemas/authorship-header.txt`. Exempt classes are enumerated at `src/apothem/schemas/header-exceptions.txt`. Edits to existing files preserve any present header.
|
|
77
|
+
|
|
78
|
+
### Structured Inquiry on Ambiguity
|
|
79
|
+
|
|
80
|
+
When the skill reaches a decision in any of the seven authoritative-data categories per `rules/authority-inquiry.md` — identity, scope direction, preference, security, naming of public surfaces, infrastructure endpoints, version pins — and the input is silent, route the resolution through the structured-inquiry channel with the three-segment option annotation per `rules/interactive-questions.md` §3 (rationale / recommendation / default-pointer). Free-form prose questions as primary input are forbidden. NEVER fabricate authoritative data. Clean-room discipline per `rules/clean-room-generation.md` governs the synthesis prose: it is re-derived from the extracted claim sets, never paraphrased from a single source's framing.
|
|
81
|
+
|
|
82
|
+
## Recommended Next Step
|
|
83
|
+
|
|
84
|
+
**Run the skill against the resolved source set** with `--sources` naming the documents to reconcile; review the Contested and Gaps sections first, since they name the claims the source set cannot settle on its own.
|
|
85
|
+
|
|
86
|
+
## Bindings (§0.j five-direction)
|
|
87
|
+
|
|
88
|
+
- **Drives →** ● Every per-source claim extraction with citation anchors. ● Every cross-source reconciliation pass separating consensus from contested ground. ● The Gaps surface naming uncovered subjects and unresolved contradictions.
|
|
89
|
+
- **Satisfies →** ● `CLAUDE.md` Source Layout row "source-synthesis" (skills/ class). ● The research cohort's provided-source reconciliation surface.
|
|
90
|
+
- **Established by ↑** ● `CLAUDE.md` Source Layout (skills/ class declaration with the folder-with-`SKILL.md` convention). ● `CLAUDE.md` Ambiguity Handling (structured inquiry over fabrication).
|
|
91
|
+
- **Gated by ←** ● The harness's Read tool surface. ● The presence of two or more resolvable sources in `--sources` (a single source routes to summary, not synthesis).
|
|
92
|
+
- **Cross-bound with ↔** ↔ `rules/clean-room-generation.md` (the synthesis is re-derived, not paraphrased). ↔ `rules/interactive-questions.md` (the structured-inquiry channel on ambiguity). ↔ `skills/plan-suite/SKILL.md` + `skills/ecosystem-audit/SKILL.md` (sibling skills under the same registry section).
|
|
@@ -0,0 +1,118 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: "surgical-guard"
|
|
3
|
+
version: "0.1.0"
|
|
4
|
+
updated: "2026-06-14"
|
|
5
|
+
description: "Surgical-edit + reactive-guard skill — matched when the operator asks to 'edit surgically', 'make a minimal diff', 'guard this change', 'review the diff for quality', 'don't rewrite the whole file', or otherwise needs a precise, anchor-bounded mutation plus a post-edit quality pass before it lands. Stage 1 is a minimal-diff editing discipline: mutate through a managed-block or anchor-bounded edit (e.g. swap only the sentinel-delimited region, preserving the surrounding bytes and the authorship banner) — never a blunt whole-file overwrite where a scoped edit suffices. Stage 2 is a reactive, diff-based quality guard that reviews only the change's diff and loads only the rule references the diff's context matches (progressive disclosure), catching the systematic failure modes of generated changes: clean-code (swallowed errors, hardcoded success returns, hallucinated APIs, premature abstraction, silent contract changes), test (mock-boundary violations, duplicate bodies, hollow assertions, missing coverage of the changed behavior), docs (hallucinated symbols, broken samples, docs-vs-code drift). Not for: green-field file creation with no existing content to preserve (below the surgical threshold — routes to ordinary authoring); domain-framework linting with vendor-specific rule packs (out of scope — only the generalized clean-code/test/docs guard pattern is carried); producing the change's content via debugging or TDD (routes to dev-toolkit — this skill governs how the change lands and whether it passes). Harness-agnostic; deterministic output. Feeds the harness-directive surgical-manipulation mandate."
|
|
6
|
+
archetype: "guard-template"
|
|
7
|
+
userInvocable: true
|
|
8
|
+
argument-hint: "[change target] [--guard clean-code|test|docs|all]"
|
|
9
|
+
disable-model-invocation: true
|
|
10
|
+
allowed-tools: "Read, Write, Edit, Glob, Grep, Bash, TodoWrite"
|
|
11
|
+
---
|
|
12
|
+
|
|
13
|
+
<!-- SPDX-License-Identifier: MIT -->
|
|
14
|
+
|
|
15
|
+
## Purpose
|
|
16
|
+
|
|
17
|
+
Land a change as a **precise, minimal, scoped mutation**, then **guard it reactively** before it is accepted. Two stages, one contract:
|
|
18
|
+
|
|
19
|
+
1. **Surgical edit** — mutate through a managed block (sentinel-delimited region swapped, boundaries preserved) or an anchor-bounded edit, touching only the lines the change requires. Everything outside the anchor stays byte-for-byte identical, including the authorship banner. A blunt whole-file overwrite where a scoped edit suffices is refused.
|
|
20
|
+
2. **Reactive guard** — a diff-based post-edit review that loads only the rule references the change's context matches (progressive disclosure) and catches the systematic failure modes of generated changes — swallowed errors, hollow tests, docs-vs-code drift — before the change is accepted.
|
|
21
|
+
|
|
22
|
+
The pairing is the skill's robustness: the change is **both** surgically minimal **and** quality-attested. This skill supplies the surgical-manipulation discipline the harness directives mandate.
|
|
23
|
+
|
|
24
|
+
## Detection Signal
|
|
25
|
+
|
|
26
|
+
The operator asks to edit surgically, make a minimal diff, or not rewrite a whole file; asks to guard or review a change for quality; or hands off a mutation that should land scoped and attested rather than sweeping.
|
|
27
|
+
|
|
28
|
+
**Falsifiable counter-signal.** A green-field file creation with no existing content to preserve is below the surgical threshold — it routes to ordinary authoring, not this skill.
|
|
29
|
+
|
|
30
|
+
## Non-Goals
|
|
31
|
+
|
|
32
|
+
A deliberately narrow surface. The skill is NOT:
|
|
33
|
+
|
|
34
|
+
- **A whole-file rewriter.** Where a scoped, anchor-bounded edit satisfies the change, a blunt whole-file overwrite is refused — minimality is the contract.
|
|
35
|
+
- **A domain-framework linter.** The source guard set carried framework-specific rule packs (a particular CMS / e-commerce platform); apothem generalizes the *guard pattern* (clean-code / test / docs) and does **not** carry those domain-specific packs — they are out of scope.
|
|
36
|
+
- **A writing-time constraint engine.** The guard is a **reactive** post-edit diff pass, not a constraint that bloats every edit as it is written — the change is made, then guarded.
|
|
37
|
+
- **The engineering-loop owner.** Producing the change's *content* (debugging, TDD, slicing) routes to `skills/dev-toolkit/SKILL.md`; this skill governs *how the change lands* (minimal diff) and *whether it passes* (the guard).
|
|
38
|
+
|
|
39
|
+
## Foundational Stanzas
|
|
40
|
+
|
|
41
|
+
The four standing surfaces every operator inherits per the canonical project voice at `AGENTS.md` plus the active harness mirror.
|
|
42
|
+
|
|
43
|
+
### Refusal & Escalation
|
|
44
|
+
|
|
45
|
+
REFUSE a whole-file overwrite where an anchor-bounded edit suffices — name the minimal alternative and apply it. REFUSE accepting a change the guard flags (swallowed error, hollow assertion, docs drift) without surfacing the finding — name it, never silently pass. REFUSE any request beyond surgical editing + reactive guarding; surface an escalation option through the structured-inquiry channel per `rules/interactive-questions.md`.
|
|
46
|
+
|
|
47
|
+
### Output Surface
|
|
48
|
+
|
|
49
|
+
Changes land at their domain-natural host locations per `rules/host-discovery.md` as minimal diffs; the guard report lands beside the change or in the working trace. Per `rules/operational-mandates.md` CM-7, the change and its commit carry natural domain language — zero process-internal scaffolding.
|
|
50
|
+
|
|
51
|
+
### File-Authoring Contract
|
|
52
|
+
|
|
53
|
+
Edits preserve any existing authorship banner — the surgical discipline never strips a header (corner case B of the header-inject-guard hook at `hooks/messages/pretooluse-{write,edit}-header-guard.md`). New files route through `scripts/inject-header.{sh,py}`; exempt classes at `src/apothem/schemas/header-exceptions.txt`.
|
|
54
|
+
|
|
55
|
+
### Structured Inquiry on Ambiguity
|
|
56
|
+
|
|
57
|
+
When the change's anchor / scope, the managed-block boundary, or a guard finding's disposition is ambiguous, route the resolution through the structured-inquiry channel with the three-segment option annotation per `rules/interactive-questions.md` §3 (rationale / recommendation / default-pointer). Every destructive operation (deletion, move, non-retaining overwrite) routes per-file through the §6 canonical destructive-op option sets — one invocation per file, every option's `default-pointer:` carrying the verbatim `no-default: user decision required`.
|
|
58
|
+
|
|
59
|
+
## Conformity Posture
|
|
60
|
+
|
|
61
|
+
**Discover-don't-assume preamble (M1).** Discover the host's managed-block / anchor convention (sentinel markers, comment-delimited regions) and its diff + review tooling per `rules/host-discovery.md`. The surgical anchor scheme is the host's, discovered — never imposed.
|
|
62
|
+
|
|
63
|
+
**Minimal-diff attestation.** The change's diff is attested against the golden corpus (the host's green-gate baseline): a surgical edit that leaves the gates green is the minimal-diff golden-corpus contract this skill establishes and that the surgical-manipulation harness directive depends on.
|
|
64
|
+
|
|
65
|
+
## Procedure
|
|
66
|
+
|
|
67
|
+
Four numbered, independently-verifiable steps. The change's *content* is supplied upstream; this procedure governs *how it lands and whether it passes*.
|
|
68
|
+
|
|
69
|
+
### 1. Locate the Anchor
|
|
70
|
+
|
|
71
|
+
Locate the precise mutation site — a managed-block sentinel region, an anchor-bounded span, or the smallest contiguous range the change requires. Read only that range plus a tight buffer (locate-before-read per `rules/large-file-reading.md`). The anchor is the scope contract: the edit touches it and nothing else.
|
|
72
|
+
|
|
73
|
+
### 2. Mutate Surgically
|
|
74
|
+
|
|
75
|
+
Apply the change as a minimal diff at the anchor — a managed-block replacement (sentinel-delimited content swapped, boundaries preserved) or an anchor-bounded edit. Preserve everything outside the anchor byte-for-byte, including the authorship banner. No whole-file overwrite where a scoped edit suffices.
|
|
76
|
+
|
|
77
|
+
### 3. Reactive Guard (diff-based, progressive-disclosure)
|
|
78
|
+
|
|
79
|
+
Review the change's **diff** — not the whole file — against the guard set selected by `--guard` (default `all`), loading only the rule references the diff's context matches:
|
|
80
|
+
|
|
81
|
+
- **clean-code guard** — swallowed / catch-all errors, hardcoded success returns, hallucinated APIs, premature abstraction, silent contract changes.
|
|
82
|
+
- **test guard** — mock-boundary violations, duplicate test bodies, hollow assertions, missing coverage of the changed behavior.
|
|
83
|
+
- **docs guard** — hallucinated symbols, broken samples, docs-vs-code drift introduced by the change.
|
|
84
|
+
|
|
85
|
+
Each finding is surfaced with its offending diff locus. An accepted change carries no surviving guard finding — or each finding is explicitly dispositioned by the operator through the structured-inquiry channel.
|
|
86
|
+
|
|
87
|
+
### 4. Attest & Self-Check
|
|
88
|
+
|
|
89
|
+
Attest the minimal-diff golden-corpus contract: the change is scoped, the gates are green, the guard is clear. Run the fifteen-bar pre-emission gate per `rules/pre-emission-gate.md`. Emit the change, the guard report, and the single recommended next move.
|
|
90
|
+
|
|
91
|
+
## Arguments
|
|
92
|
+
|
|
93
|
+
- `[change target]` — the change to land, in natural language (the behavior to mutate, the anchor it touches).
|
|
94
|
+
- `--guard clean-code|test|docs|all` — the reactive guard set (default: `all`).
|
|
95
|
+
|
|
96
|
+
## Return Contract
|
|
97
|
+
|
|
98
|
+
The skill returns:
|
|
99
|
+
|
|
100
|
+
- **Minimal diff** — scoped to the anchor; everything outside it byte-identical.
|
|
101
|
+
- **Guard report** — per-guard findings with diff loci, or a clean attestation.
|
|
102
|
+
- **Minimal-diff golden-corpus attestation** — scope + green gates.
|
|
103
|
+
- **Fifteen-bar gate attestation** per `rules/pre-emission-gate.md`.
|
|
104
|
+
- A single `## Recommended Next Step`.
|
|
105
|
+
|
|
106
|
+
Deterministic per `rules/determinism.md`: the same change target + anchor yields the same minimal diff.
|
|
107
|
+
|
|
108
|
+
## Recommended Next Step
|
|
109
|
+
|
|
110
|
+
**Invoke the `surgical-guard` skill via the Skill tool** with `<change> --guard all` — apply the change as a managed-block / anchor-bounded minimal diff, then review the guard report and disposition any finding before accepting. Route the change's *content* (the debugging / TDD that produced it) through the `dev-toolkit` skill, and keep this skill for *how the change lands and whether it passes*.
|
|
111
|
+
|
|
112
|
+
## Bindings (§0.j five-direction)
|
|
113
|
+
|
|
114
|
+
- **Drives →** ● Every surgical (minimal-diff, anchor-bounded) mutation across the host. ● The reactive diff-based quality guard on every guarded change. ● **The surgical-manipulation discipline the harness directives weave in** (this skill is its mechanism).
|
|
115
|
+
- **Satisfies →** ● `CLAUDE.md` Source Layout row "surgical-guard" (skills/ class). ● The elevation dimension **robustness** (minimal-diff editing + reactive diff-based guard with progressive-disclosure rule loading).
|
|
116
|
+
- **Established by ↑** ● `CLAUDE.md` Source Layout (skills/ folder-with-`SKILL.md` class). ● `CLAUDE.md` Ambiguity Handling (structured inquiry over fabrication). ● `rules/own-voice-reimplementation.md` (zero-verbatim; `reference-token-grep` = 0). ● `rules/agnostic-posture.md` (17-harness agnostic floor).
|
|
117
|
+
- **Gated by ←** ● The host's discovered managed-block / anchor convention + diff tooling. ● The minimal-diff contract (no whole-file overwrite where a scoped edit suffices). ● The host's structured-inquiry + Edit + Write + Bash tool surface; the per-file destructive-op floor.
|
|
118
|
+
- **Cross-bound with ↔** ↔ `skills/dev-toolkit/SKILL.md` (produces the change's content; this skill governs how it lands + whether it passes). ↔ `rules/own-voice-reimplementation.md` + `rules/agnostic-posture.md` (own-voice + agnostic floors). ↔ `rules/interactive-questions.md` (§6 destructive-op floor). ↔ `skills/diagram-authoring/SKILL.md` + `skills/document-authoring/SKILL.md` (sibling own-voice authoring skills).
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: "test-authoring"
|
|
3
|
+
version: "0.1.0"
|
|
4
|
+
updated: "2026-06-09"
|
|
5
|
+
description: "Behavior-first test authoring with strict Arrange-Act-Assert discipline — matched when the developer asks to 'write tests', 'add coverage', 'add a test for', 'test this function', 'cover this module', 'write a failing test', 'increase coverage', or any phrasing requesting new test cases that assert observable behavior against a unit under test. Discovers the unit's behavior contract (input domains, return shapes, side effects, raised exception types, edge boundaries — empty/null/zero/max/Unicode/off-by-one), writes failing AAA assertions before the implementation satisfies them, partitions coverage across the happy path, the edge boundaries, and the failure modes (with a regression test pinning any named bug), and reports residual coverage gaps for operator triage. Authors tests only — never edits, writes, or repairs the implementation under test, never executes the suite, never computes a coverage percentage, never edits coverage config, and never mocks the unit under test itself (mocks only at owned boundaries: adapters, injected ports). A request to fix a failing test by editing the implementation, scaffold a project, or run an existing suite is NOT a match."
|
|
6
|
+
archetype: "authoring-template"
|
|
7
|
+
userInvocable: true
|
|
8
|
+
argument-hint: "[--focus PATH] [--framework NAME]"
|
|
9
|
+
disable-model-invocation: true
|
|
10
|
+
allowed-tools: "Read, Write, Edit, Glob, Grep, Bash"
|
|
11
|
+
---
|
|
12
|
+
|
|
13
|
+
<!-- SPDX-License-Identifier: MIT -->
|
|
14
|
+
|
|
15
|
+
## Purpose
|
|
16
|
+
|
|
17
|
+
Author behavior-first test cases for a named unit under test. Every emitted test asserts one observable behavior contract — an input-to-output mapping, a side effect, a raised exception, or an edge boundary — under a strict Arrange-Act-Assert shape. The skill writes the tests; it never touches the implementation those tests exercise.
|
|
18
|
+
|
|
19
|
+
## Detection Signal
|
|
20
|
+
|
|
21
|
+
The developer asks to "write tests", "add coverage", "add a test for", "test this function", "cover this module", "write a failing test", or "increase coverage" — any phrasing that requests new test cases asserting observable behavior against a unit under test.
|
|
22
|
+
|
|
23
|
+
**Falsifiable counter-signal.** A request to fix a failing test by editing the implementation, scaffold a project, or run an existing suite is NOT a match — those route to the implementation, project-setup, and test-execution surfaces respectively.
|
|
24
|
+
|
|
25
|
+
## Non-Goals
|
|
26
|
+
|
|
27
|
+
A deliberately narrow surface. The skill is NOT:
|
|
28
|
+
|
|
29
|
+
- **An implementation generator.** It authors tests against the unit's behavior contract; it never writes, edits, or repairs the production code the tests exercise. Implementation lands through the host's normal codegen surface, governed by `rules/host-discovery.md`.
|
|
30
|
+
- **A green-bar chaser.** A test that passes before the implementation exists asserts nothing. The skill writes assertions that fail against the absent or current behavior first; the contract is satisfied by implementation outside this skill.
|
|
31
|
+
- **A test runner.** It authors test files; it does not execute the suite, compute a coverage percentage, or gate on a threshold. Execution is the host's `pytest` / `vitest` / `go test` surface and the consuming command's responsibility.
|
|
32
|
+
- **A mock-everything tool.** Tests assert behavior, not implementation detail. The skill mocks only at owned boundaries (adapters, injected ports) and never mocks the unit under test itself.
|
|
33
|
+
- **A coverage-config editor.** Threshold configuration, CI wiring, and coverage-tool selection are operator decisions surfaced as findings, never silently installed.
|
|
34
|
+
|
|
35
|
+
## Workflow
|
|
36
|
+
|
|
37
|
+
Five numbered, independently-verifiable steps. Test authoring only — no implementation edits.
|
|
38
|
+
|
|
39
|
+
1. **Resolve the unit and the framework.** Discover the host's ratified test framework, test-directory layout, fixture conventions, and naming idioms by walking the host's source-of-truth files per `rules/host-discovery.md` (e.g., `pyproject.toml [tool.pytest.ini_options]`, sibling `test_*.py`, `*.test.ts`, `*_test.go`). `--focus PATH` names the unit; `--framework NAME` overrides the discovered framework when the host runs more than one.
|
|
40
|
+
2. **Extract the behavior contract.** Read the unit under test and enumerate its observable contract — every input domain, every return shape, every side effect, every raised exception type, every edge boundary (empty, null, zero, max, Unicode, boundary off-by-one). Record each contract item as a distinct row; one row becomes one test.
|
|
41
|
+
3. **Write failing AAA assertions first.** For each contract row, author one test in strict Arrange-Act-Assert form: the **Arrange** block builds the fixture and inputs, the **Act** block invokes the unit once, the **Assert** block checks exactly one observable outcome. The assertion fails against absent or current behavior before the implementation satisfies it. One behavioral claim per test; behavior-descriptive names (`test_<unit>_<condition>_<expected>`).
|
|
42
|
+
4. **Cover happy, edge, and failure paths.** Partition the contract into the **happy path** (valid in-domain inputs), the **edge boundaries** (empty, null, zero, max, Unicode), and the **failure modes** (invalid inputs, missing dependencies, raised exceptions asserted with the framework's exception-matcher). Every partition carries at least one covering test; a bug-fix request adds a regression test pinning the prior defect.
|
|
43
|
+
5. **Report residual coverage gaps.** Name every contract row left uncovered and why (data not yet discoverable, behavior under-specified, boundary requires host input). Uncovered rows surface as findings for operator triage, never silently dropped.
|
|
44
|
+
|
|
45
|
+
## Return Contract
|
|
46
|
+
|
|
47
|
+
Output is the set of authored test files plus a coverage-map summary (markdown). Maximum response: 800 tokens. Structure:
|
|
48
|
+
|
|
49
|
+
- **Tests authored:** bulleted list — file path, test name, contract row, partition (happy / edge / failure).
|
|
50
|
+
- **Coverage map:** contract rows covered vs. residual, with each residual row's triage reason.
|
|
51
|
+
- **Gaps:** behavior contracts the host has not yet specified (if applicable).
|
|
52
|
+
|
|
53
|
+
**Token-budget override.** The invoker may request a higher budget for exhaustive enumeration; honor it. Prefer raising the budget over truncating the coverage map.
|
|
54
|
+
|
|
55
|
+
## Foundational Stanzas
|
|
56
|
+
|
|
57
|
+
The four standing surfaces, adapted to this skill's user-invocable test-authoring role.
|
|
58
|
+
|
|
59
|
+
### Refusal & Escalation
|
|
60
|
+
|
|
61
|
+
REFUSE any request that asks the skill to act outside its mission — editing the implementation under test, scaffolding a project, running the suite, computing coverage percentages, or mutating coverage configuration. Refusal is explicit: name what was refused, name the mission boundary crossed, and route the developer to the correct surface through the structured-inquiry channel per `rules/interactive-questions.md` (canonical channel; three-segment option annotation; never free-form prose as primary input). When the unit under test cannot be located or its behavior contract is unreadable, STOP and surface the recovery options — never invent a contract from training-time memory.
|
|
62
|
+
|
|
63
|
+
### Output Surface
|
|
64
|
+
|
|
65
|
+
The skill emits test files at the host's ratified test location, discovered per `rules/host-discovery.md` (mirror-the-source layout where the host uses one; sibling-of-source where it does not). NEVER write a test outside the host's test tree, NEVER write to a global location, and NEVER edit the implementation under test. Per `rules/operational-mandates.md` CM-7, authored tests carry zero plan-internal references — natural domain language only.
|
|
66
|
+
|
|
67
|
+
### File-Authoring Contract
|
|
68
|
+
|
|
69
|
+
Every NEW test file routes through `scripts/inject-header.py` so the canonical `SPDX-License-Identifier: MIT` header is injected at the head in the comment family matching the filetype; the injector is idempotent and resolves the variant from the byte-exact fixture at `src/apothem/schemas/authorship-header.txt`. Exempt classes are enumerated at `src/apothem/schemas/header-exceptions.txt`. The header-inject-guard hook at `hooks/messages/pretooluse-{write,edit}-header-guard.md` enforces the contract at every Write / Edit invocation.
|
|
70
|
+
|
|
71
|
+
### Structured Inquiry on Ambiguity
|
|
72
|
+
|
|
73
|
+
When the skill reaches a decision in any of the seven authoritative-data categories per `rules/authority-inquiry.md` — identity, scope direction (which unit, which subtree), preference (test framework, fixture style, mocking library, coverage tool), security (test-fixture credentials), naming of public surfaces (test-file naming), infrastructure endpoints (integration-test targets), version pins — and the host is silent, route the resolution through the structured-inquiry channel with the three-segment annotation per `rules/interactive-questions.md` §3 (rationale / recommendation / default-pointer). NEVER fabricate authoritative data. Every overwrite of an existing test file routes through the per-file destructive-op floor per `rules/interactive-questions.md` §6 — one invocation per file, no `multiSelect` batching, every option's `default-pointer:` carrying the verbatim `no-default: user decision required` marker.
|
|
74
|
+
|
|
75
|
+
## Recommended Next Step
|
|
76
|
+
|
|
77
|
+
**Run the host's test command against the authored files** (e.g., `python -m pytest <focus-path>`) to confirm every new assertion fails before the implementation lands, then hand the failing suite to the implementation surface.
|
|
78
|
+
|
|
79
|
+
## Bindings (§0.j five-direction)
|
|
80
|
+
|
|
81
|
+
- **Drives →** ● Every behavior-first test file authored at the host's ratified test location. ● The AAA-shaped assertion discipline at every emitted test. ● The coverage-map summary that surfaces residual gaps for operator triage.
|
|
82
|
+
- **Satisfies →** ● `CLAUDE.md` Source Layout row "test-authoring" (skills/ class). ● The behavior-first test-authoring mission with strict Arrange-Act-Assert discipline.
|
|
83
|
+
- **Established by ↑** ● `CLAUDE.md` Source Layout (skills/ folder-with-`SKILL.md` class). ● `rules/code-craft-python.md` §3 Testing Directives (AAA shape, behavior-descriptive names, one assertion per test). ● `rules/ten-dimension-check-dimensions.md` dimension 10 (examples / tests / docstrings).
|
|
84
|
+
- **Gated by ←** ● The harness's Write / Edit / Read / Glob / Grep / Bash tool surface. ● The presence of a locatable unit under test and a discoverable test framework per `rules/host-discovery.md`.
|
|
85
|
+
- **Cross-bound with ↔** ↔ `rules/code-craft-python.md` (test-craft discipline for Python units). ↔ `rules/host-discovery.md` (framework and layout discovery). ↔ `rules/interactive-questions.md` (structured-inquiry channel for ambiguity and destructive-op floor). ↔ `rules/clean-room-generation.md` §4.2 (test-behavioral derivation). ↔ `skills/ecosystem-audit/SKILL.md` + `skills/plan-suite/SKILL.md` (sibling skills under the same registry section).
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: "vuln-triage"
|
|
3
|
+
version: "0.1.0"
|
|
4
|
+
updated: "2026-06-09"
|
|
5
|
+
description: "Vulnerability and security-advisory triage — matched when the user references a 'CVE', cites a 'security advisory' (GHSA, OSV, vendor bulletin), asks to 'triage this vuln', or asks 'is this vulnerable'. Targets one named advisory per invocation: severity-classifies it with a CVSS-style band (critical 9.0–10.0 / high 7.0–8.9 / medium 4.0–6.9 / low 0.1–3.9 / none 0.0) plus the justifying vector string, maps it to the affected surface in the host tree against the resolved lockfile, determines reachability and exploitability (reachable / unreachable / conditional + applicable attack vector), routes remediation from the closed set {patch, upgrade, mitigate, accept} (or not-applicable when no affected surface exists), and records a seven-field triage record with cited rationale. The output drives the operator's remediation decision; the skill does NOT apply the remediation, construct or run exploit payloads, scan the repository, re-publish CVSS scores, or re-solve the dependency graph. The 'accept' route is a security ratification — when the host has not ratified an accepted-risk threshold, it blocks on inquiry."
|
|
6
|
+
archetype: "security-template"
|
|
7
|
+
userInvocable: true
|
|
8
|
+
argument-hint: "[--advisory ID] [--focus PATH]"
|
|
9
|
+
disable-model-invocation: true
|
|
10
|
+
allowed-tools: "Read, Write, Edit, Glob, Grep, Bash"
|
|
11
|
+
---
|
|
12
|
+
|
|
13
|
+
<!-- SPDX-License-Identifier: MIT -->
|
|
14
|
+
|
|
15
|
+
## Purpose
|
|
16
|
+
|
|
17
|
+
Triage one vulnerability or security advisory against the host tree. The skill severity-classifies the advisory with a named scheme, locates the affected surface in the host, determines whether the affected code is reachable and exploitable, selects a remediation route, and records the disposition with cited rationale as a structured triage record. The output drives the operator's remediation decision; the skill does not apply the remediation itself.
|
|
18
|
+
|
|
19
|
+
## Detection Signal
|
|
20
|
+
|
|
21
|
+
The user references a `CVE` identifier, cites a `security advisory` (GHSA, OSV, vendor bulletin), asks to `triage this vuln`, or asks `is this vulnerable`. Any single phrasing that names a concrete advisory or asks whether the host carries a known vulnerability matches.
|
|
22
|
+
|
|
23
|
+
**Falsifiable counter-signal.** A request for a repository-wide scan, an exploit proof-of-concept, or the application of a fix is NOT a match — those route to the host's scanner CI, a penetration-test surface, and the remediation change-set respectively.
|
|
24
|
+
|
|
25
|
+
## Non-Goals
|
|
26
|
+
|
|
27
|
+
A deliberately narrow surface. The skill is NOT:
|
|
28
|
+
|
|
29
|
+
- **A full vulnerability scanner.** It triages one named advisory per invocation against a known surface. Repository-wide scanning is `pip-audit` / `gitleaks` / `trivy` / `osv-scanner` territory under the host's CI; the skill consumes a scanner's output, it does not replace it.
|
|
30
|
+
- **A remediation executor.** It selects a remediation route and records it; it does not apply the patch, bump the dependency, or edit the vulnerable code. Remediation lands as a separate operator-driven change-set governed by `rules/production-ready-prs.md`.
|
|
31
|
+
- **A penetration tester.** Exploitability is assessed by reachability analysis and advisory metadata, not by constructing or executing an exploit. No proof-of-concept payload is authored or run.
|
|
32
|
+
- **A CVSS authority.** It applies a CVSS-style classification to rank the advisory against the host's actual exposure; it does not publish or amend the upstream CVSS base score.
|
|
33
|
+
- **A dependency-graph resolver.** Transitive-dependency math is the package manager's job; the skill reads the resolved lockfile, it does not re-solve the graph.
|
|
34
|
+
|
|
35
|
+
## Workflow
|
|
36
|
+
|
|
37
|
+
Five numbered steps. Step 2 may short-circuit the workflow to step 5 when no affected surface exists (`not-applicable`).
|
|
38
|
+
|
|
39
|
+
1. **Classify severity using a named scheme.** Read the advisory metadata (CVSS vector, affected version range, attack vector, attack complexity, privileges required, user interaction). Assign a CVSS-style band — `critical` (9.0–10.0) / `high` (7.0–8.9) / `medium` (4.0–6.9) / `low` (0.1–3.9) / `none` (0.0) — and record the vector string that justifies it.
|
|
40
|
+
2. **Map the advisory to the affected surface in the host tree.** Use Glob and Grep to locate the affected package, module, or call site under `--focus PATH` (default: host root). Read the host's resolved manifest or lockfile (`pyproject.toml`, `uv.lock`, `package-lock.json`, the host's ratified equivalent per `rules/host-discovery.md`) and confirm the installed version falls inside the advisory's affected range. When no affected surface exists, the disposition is `not-applicable` and the workflow terminates at step 5.
|
|
41
|
+
3. **Determine exploitability and reachability.** Grep for call sites that reach the vulnerable function, configuration, or code path. Record whether the path is reachable (`reachable` / `unreachable` / `conditional`), whether the attack vector applies to the host's deployment (network-exposed, local-only, build-time-only), and whether a precondition (specific config, untrusted-input flow) is required.
|
|
42
|
+
4. **Route remediation.** Select exactly one route from the closed set `{patch, upgrade, mitigate, accept}` — `patch` (apply the upstream fix or backport), `upgrade` (bump to a fixed version), `mitigate` (configuration change, input validation, or network restriction that removes reachability), `accept` (document and accept the residual risk when unreachable or out of scope). The selection cites the severity band from step 1 and the reachability verdict from step 3.
|
|
43
|
+
5. **Record the disposition with rationale.** Emit the triage record per the Return Contract. The rationale cites the advisory ID, the affected-surface path, the reachability verdict, and the concrete driver for the chosen route. The record is the disposition's authoritative source.
|
|
44
|
+
|
|
45
|
+
## Return Contract
|
|
46
|
+
|
|
47
|
+
The skill emits one triage record per invocation. The record carries seven fields, every field populated:
|
|
48
|
+
|
|
49
|
+
| Field | Content |
|
|
50
|
+
|-------|---------|
|
|
51
|
+
| `id` | The advisory identifier (CVE / GHSA / OSV / vendor-bulletin ID) |
|
|
52
|
+
| `severity` | The CVSS-style band from step 1 plus the vector string |
|
|
53
|
+
| `affected-surface` | The host path mapped in step 2 (package + module + installed version), or `none` |
|
|
54
|
+
| `exploitability` | The reachability verdict from step 3 (`reachable` / `unreachable` / `conditional`) plus the applicable attack vector |
|
|
55
|
+
| `disposition` | The remediation route from step 4 (`patch` / `upgrade` / `mitigate` / `accept`), or `not-applicable` |
|
|
56
|
+
| `rationale` | The cited justification linking severity + reachability + route |
|
|
57
|
+
| `date` | ISO-8601 triage date |
|
|
58
|
+
|
|
59
|
+
A record with any field unpopulated is non-conformant. The record writes to STDOUT for direct invocation; when the host maintains a security-advisory ledger, the record appends to it at the host's ratified path.
|
|
60
|
+
|
|
61
|
+
## Foundational Stanzas
|
|
62
|
+
|
|
63
|
+
The four standing surfaces every operator inherits, adapted to this skill's single-advisory triage role.
|
|
64
|
+
|
|
65
|
+
### Refusal & Escalation
|
|
66
|
+
|
|
67
|
+
REFUSE any request that asks the skill to act outside its triage mission — applying remediation edits, constructing or running exploit payloads, repository-wide scanning, re-publishing CVSS scores. Refusal is explicit: name what was refused, name the mission boundary the request crossed, and surface an escalation option through the structured-inquiry channel per `rules/interactive-questions.md` (canonical channel; three-segment option annotation; never free-form prose as primary input). When the advisory cannot be resolved to host state — the advisory ID is malformed, the affected package is absent, or the lockfile is unreadable — the skill STOPs and surfaces the recovery options; it never guesses a severity or fabricates an affected surface.
|
|
68
|
+
|
|
69
|
+
### Output Surface
|
|
70
|
+
|
|
71
|
+
The skill emits one triage record (the Return Contract). The record writes to STDOUT for direct invocation; when the host maintains a security-advisory ledger or `SECURITY.md` tracking surface, the record appends there at the host's ratified path per `rules/host-discovery.md`. NEVER write the record to a global-ecosystem location, and NEVER edit the vulnerable code as part of triage. Remediation artifacts a downstream change-set emits land at their domain-natural host locations per `rules/host-discovery.md`; per `rules/operational-mandates.md` CM-7, those artifacts carry natural domain language and zero plan-internal references.
|
|
72
|
+
|
|
73
|
+
### File-Authoring Contract
|
|
74
|
+
|
|
75
|
+
When the skill emits a NEW file — a fresh security-advisory ledger where the host has none — the file routes through `scripts/inject-header.py` so the canonical authorship-header banner is injected at the head; the injector is idempotent and detects the filetype variant automatically from the byte-exact fixture at `src/apothem/schemas/authorship-header.txt`. The exempt classes (LICENSE, JSON configuration files, lockfiles, generated assets, vendored trees, `.audit/` ephemera, `<project-root>/.apothem/plans/` ephemera, `.keep` / `.gitkeep` markers, binary files) are enumerated at `src/apothem/schemas/header-exceptions.txt`. Triage records emitted to STDOUT are banner-exempt. Edits that append a record to an existing ledger preserve the ledger's existing banner.
|
|
76
|
+
|
|
77
|
+
### Structured Inquiry on Ambiguity
|
|
78
|
+
|
|
79
|
+
When triage reaches a decision in any of the seven authoritative-data categories per `rules/host-discovery.md` and `rules/interactive-questions.md` — identity, scope direction (which subtree to triage), preference (which severity scheme when the host ratifies one over CVSS), security posture (accepted-risk threshold, deployment exposure model), naming of public surfaces, infrastructure endpoints, version pins (the fixed-version target for an `upgrade` route) — and the host is silent, route the resolution through the structured-inquiry channel with the three-segment option annotation per `rules/interactive-questions.md` §3 (rationale / recommendation / default-pointer). Free-form prose questions as primary input are forbidden. NEVER fabricate authoritative data — a severity band, an affected version range, or an accepted-risk disposition is discovered or inquired, never invented. The `accept` route is a security ratification; when the host has not ratified an accepted-risk threshold, the route blocks on inquiry.
|
|
80
|
+
|
|
81
|
+
## Recommended Next Step
|
|
82
|
+
|
|
83
|
+
**Run the host's remediation change-set for the chosen route** — apply the `patch` / `upgrade` / `mitigate` action recorded in the triage record under `rules/production-ready-prs.md`, shipping the fix with its test, CHANGELOG entry, and CI-green attestation in one change-set. When the disposition is `accept`, record the operator-ratified accepted-risk entry in the host's `SECURITY.md` instead.
|
|
84
|
+
|
|
85
|
+
## Bindings (§0.j five-direction)
|
|
86
|
+
|
|
87
|
+
- **Drives →** ● Every single-advisory triage record's seven-field shape (the Return Contract is the disposition's authoritative surface). ● Every remediation route selection against the closed `{patch, upgrade, mitigate, accept}` set. ● Every downstream remediation change-set the triage record routes to. ◐ The host's security-advisory ledger append where one exists.
|
|
88
|
+
- **Satisfies →** ● `CLAUDE.md` Source Layout row "vuln-triage" (skills/ class). ● The security-cohort triage mission (severity-classify and route remediation for vulnerabilities and advisories).
|
|
89
|
+
- **Established by ↑** ● `CLAUDE.md` Source Layout (skills/ class declaration with the folder-with-`SKILL.md` convention). ● `CLAUDE.md` Ambiguity Handling (structured inquiry over fabrication).
|
|
90
|
+
- **Gated by ←** ● The harness's Read / Glob / Grep / Bash surface (the skill maps the advisory to host state by discovery). ● The presence of a resolvable advisory ID and a readable host manifest (the skill STOPs and surfaces recovery when either is absent).
|
|
91
|
+
- **Cross-bound with ↔** ↔ `rules/host-discovery.md` (M1 — affected surface and manifest discovered, never assumed). ↔ `rules/interactive-questions.md` (the structured-inquiry channel for accepted-risk and version-pin decisions). ↔ `rules/production-ready-prs.md` (M15 — the remediation change-set the Recommended Next Step routes to). ↔ `rules/disclosure-ledger.md` (M2 — triage dispositions recorded as findings). ↔ `skills/ecosystem-audit/SKILL.md` (sibling skill under the same registry section).
|