@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,127 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: "plan-audit"
|
|
3
|
+
version: "0.1.0"
|
|
4
|
+
updated: "2026-06-16"
|
|
5
|
+
description: "Closed-loop guardian of the /plan pipeline — audits a plan suite across the full cycle (spec → generate → review) and actively remediates findings rather than only reporting them, looping until zero findings remain or an iteration cap with a defined retreat is hit. Implicitly encompasses the pipeline from /plan-spec: it brings a suite at any stage to a reviewed, zero-finding whole, routes deferred or incomplete work to a sibling *-maintenance suite, and persists a bounded audit report to _outputs/."
|
|
6
|
+
argument-hint: "[suite-path] [--from spec|generate|review] [--remediate] [--cap N] [--maintenance] [--dry-run]"
|
|
7
|
+
disable-model-invocation: false
|
|
8
|
+
portability: "universal"
|
|
9
|
+
allowed-tools: "*"
|
|
10
|
+
---
|
|
11
|
+
|
|
12
|
+
<!-- SPDX-License-Identifier: MIT -->
|
|
13
|
+
|
|
14
|
+
# /plan-audit — Full-Cycle Pipeline Audit & Active Remediation
|
|
15
|
+
|
|
16
|
+
## Role
|
|
17
|
+
|
|
18
|
+
You are the closed-loop guardian of the `/plan` pipeline. Where `/plan-review` reports and refines a generated suite, `/plan-audit` **wraps the upstream cycle and drives the suite to a reviewed, zero-finding whole**. It runs any missing upstream stage, audits the result, fixes mechanically resolvable findings in place, surfaces judgment forks through the canonical inquiry channel, and loops until the suite is clean or a bounded retreat fires. Reporting is never the terminus — remediation is.
|
|
19
|
+
|
|
20
|
+
## Pipeline Contract
|
|
21
|
+
|
|
22
|
+
**Pipeline position.** **Wrapping / orthogonal.** `/plan-audit` encompasses the canonical sequence `/plan-spec → /plan-generate → /plan-review` and adds an active remediation loop. Invocable at any point; it inspects state and runs only the missing stages. It never executes phase implementation work — it leaves the suite ready for `/plan-execute`.
|
|
23
|
+
|
|
24
|
+
**Consumed.** The target suite's `_spec/spec.md`, `_inputs/handoff-manifest.yml`, infrastructure files, `phases/**/PHASE.md`, and any existing phase reports.
|
|
25
|
+
|
|
26
|
+
**Emitted.** A persistent, bounded report at `<suite>/_outputs/audit-report-<YYYY-MM-DD>.md`; an updated handoff manifest carrying the zero-finding verdict, the open-finding count, the remediation ledger, and any maintenance routing; and a non-zero terminal status when residual findings remain.
|
|
27
|
+
|
|
28
|
+
## Sequence Gate
|
|
29
|
+
|
|
30
|
+
`/plan-audit` wraps the upstream cycle and drives a suite to a zero-finding whole; it MUST NOT run without a suite to audit. Before Step 1, verify the predecessor precondition on disk:
|
|
31
|
+
|
|
32
|
+
- At least a generated suite is present — PREAMBLE.md, MASTER-PLAN.md, PROGRESS.md, and the per-phase folders under `phases/`.
|
|
33
|
+
|
|
34
|
+
When no generated suite exists, the stage REFUSES to run and emits the single definitive line `Blocked: run /plan-generate first` — `/plan-generate` is the predecessor that produces the suite this command audits and remediates. The audit's own Step 3 runs missing upstream stages on a suite that *exists*; it does not bootstrap a suite from nothing.
|
|
35
|
+
|
|
36
|
+
An explicit `--override` flag bypasses this gate. When `--override` is used, the bypass MUST be recorded as a finding in the suite's PLAN-NOTES.md (and the suite's findings surface) with the rationale and the missing precondition named, so the out-of-order run is auditable.
|
|
37
|
+
|
|
38
|
+
## Workflow
|
|
39
|
+
|
|
40
|
+
### Step 1: Resolve Target
|
|
41
|
+
|
|
42
|
+
Resolve the suite from the positional argument. If absent, choose the most recently modified suite under the host project's `.apothem/plans/` directory and state that resolution explicitly. `--dry-run` reports the detected suite, the current stage, the planned audit dimensions, and the would-write targets, then stops without file writes.
|
|
43
|
+
|
|
44
|
+
### Step 2: Assess Stage
|
|
45
|
+
|
|
46
|
+
Detect which artifacts exist: `_spec/spec.md` (spec-ready), suite infrastructure and `phases/` (generated), review scorecards and findings registries (reviewed), and per-phase `REPORT.md` files (executed). Name the current stage and the smallest gap to a reviewed, executable whole.
|
|
47
|
+
|
|
48
|
+
### Step 3: Bring to a Reviewable Whole
|
|
49
|
+
|
|
50
|
+
Run only the missing upstream stages, delegating to the canonical command for each gap: no authoritative spec → `/plan-spec`; spec without a generated suite → `/plan-generate`; generated suite without review evidence → `/plan-review`. Never re-run a satisfied stage merely to refresh prose. The audit loop is anti-inflationary: each pass names the exact missing surface it is producing.
|
|
51
|
+
|
|
52
|
+
### Step 4: Forensic Audit
|
|
53
|
+
|
|
54
|
+
Apply the `/plan-review` audit dimensions, the techniques in `rules/planning-techniques.md`, and the fifteen-bar pre-emission gate per `rules/pre-emission-gate.md`. Every finding carries ID, category, severity, evidence, impact, location, fix action, remediation class, and status.
|
|
55
|
+
|
|
56
|
+
### Step 5: Active Remediation
|
|
57
|
+
|
|
58
|
+
For each finding:
|
|
59
|
+
|
|
60
|
+
- **Mechanical finding:** Apply the fix in place when the correction is deterministic (naming drift, dead cross-reference, missing verification item, missing reciprocal binding, stale severity count, orphan-output metadata).
|
|
61
|
+
- **Judgment finding:** Surface the decision through the structured-inquiry channel per `rules/interactive-questions.md`; never silently pick a policy, scope, or authority-data value.
|
|
62
|
+
- **Deferred finding:** Route to Step 7 only when it is legitimately out of the current suite's scope or blocked by missing authority data.
|
|
63
|
+
|
|
64
|
+
Each applied fix records a remediation-ledger row naming the finding, the touched files, the verification run, and the resulting status. Re-audit the touched loci before proceeding.
|
|
65
|
+
|
|
66
|
+
### Step 6: Loop With Cap and Retreat
|
|
67
|
+
|
|
68
|
+
Repeat Steps 4–5 until zero open findings remain. The default iteration cap is 3 unless `--cap N` is supplied. On cap exhaustion, retreat: emit the residual findings to the audit report, route eligible items to maintenance, and exit non-zero. Unbounded retry loops and silent severity downgrades are structural failures.
|
|
69
|
+
|
|
70
|
+
### Step 7: Maintenance Routing
|
|
71
|
+
|
|
72
|
+
Deferred, incomplete, or out-of-scope items route to a sibling `<suite>-maintenance` suite, created if absent. Each maintenance item carries the source-suite path, the source finding ID, the original evidence, the rationale for deferral, and the downstream command expected to resolve it. Maintenance routing is not a pass condition for the source suite unless the original finding is out of scope by an explicit operator-ratified boundary.
|
|
73
|
+
|
|
74
|
+
### Step 8: Persist and Attest
|
|
75
|
+
|
|
76
|
+
Write the bounded audit report to `<suite>/_outputs/`. Update the handoff manifest and PROGRESS.md Phase Output Registry. **Strict zero-finding gate:** exit 0 only when zero open findings remain across all audited dimensions; otherwise exit non-zero with the residual list and the maintenance routes.
|
|
77
|
+
|
|
78
|
+
```mermaid
|
|
79
|
+
%%{ init: { "theme": "neutral" } }%%
|
|
80
|
+
%% verified: 2026-06-16 %%
|
|
81
|
+
%% provenance: commands/plan-audit.md §Workflow %%
|
|
82
|
+
%% cross-reference: rules/planning-techniques.md (audit dimensions + iteration safety) %%
|
|
83
|
+
flowchart TD
|
|
84
|
+
A[Resolve suite] --> B{Stage?}
|
|
85
|
+
B -->|no spec| S[delegate /plan-spec]
|
|
86
|
+
B -->|spec only| G[delegate /plan-generate]
|
|
87
|
+
B -->|generated| R[delegate /plan-review]
|
|
88
|
+
S --> G --> R
|
|
89
|
+
R --> AUD[Forensic audit]
|
|
90
|
+
AUD --> F{Open findings?}
|
|
91
|
+
F -->|none| Z[Persist _outputs report and exit 0]
|
|
92
|
+
F -->|yes| M{Mechanical?}
|
|
93
|
+
M -->|yes| FIX[Apply fix and log remediation] --> AUD
|
|
94
|
+
M -->|judgment| Q[structured inquiry] --> AUD
|
|
95
|
+
M -->|defer| D[Route to maintenance]
|
|
96
|
+
D --> C{Cap hit?}
|
|
97
|
+
C -->|yes| X[Persist residuals and exit non-zero]
|
|
98
|
+
C -->|no| AUD
|
|
99
|
+
```
|
|
100
|
+
|
|
101
|
+
## Disciplines
|
|
102
|
+
|
|
103
|
+
- **Zero-finding gate:** terminal success means zero open findings; CONDITIONAL scorecards with open findings do not pass.
|
|
104
|
+
- **Active remediation:** every finding carries a fix action and either resolves, routes to an operator decision, or exits as a residual.
|
|
105
|
+
- **Iteration cap and retreat:** every retry loop has a cap and a usable retreat state.
|
|
106
|
+
- **Anti-inflation:** reports are bounded and index-first; detail goes to `_outputs/`, not long PROGRESS.md narrative.
|
|
107
|
+
- **Maintenance pattern:** out-of-scope work moves to a sibling `*-maintenance` suite with source anchors.
|
|
108
|
+
- **Human-only authorship:** any git surface uses human authorship, conventional commits, and no AI attribution.
|
|
109
|
+
|
|
110
|
+
## Verification Recipe
|
|
111
|
+
|
|
112
|
+
1. `rg -nP '^name: "plan-audit"$' src/apothem/commands/plan-audit.md` returns one hit.
|
|
113
|
+
2. On a suite seeded with one mechanical finding, the command remediates, re-audits, writes `_outputs/audit-report-*.md`, and exits 0.
|
|
114
|
+
3. On a suite seeded with a non-mechanical finding beyond `--cap`, the command exits non-zero and records the residual findings plus the maintenance routing.
|
|
115
|
+
4. `/plan-execute` consumes the resulting manifest only when the open-finding count is zero or the residuals are explicitly out-of-scope and operator-waived.
|
|
116
|
+
|
|
117
|
+
## Recommended Next Step
|
|
118
|
+
|
|
119
|
+
**Run `/plan-execute` on the audited suite** once the zero-finding gate has cleared; `/plan-execute` is the canonical successor for implementation.
|
|
120
|
+
|
|
121
|
+
## Bindings (§0.j five-direction)
|
|
122
|
+
|
|
123
|
+
- **Drives →** ● The `<suite>/_outputs/` audit report. ● The `*-maintenance` suite routing pattern. ● The zero-finding verdict consumed by `/plan-execute`. ● The remediation ledger used by `/plan-review` and `/plan-status` to distinguish resolved, waived, deferred, and open findings.
|
|
124
|
+
- **Satisfies →** ● The planning-pipeline elevation mandate for active remediation, strict zero-finding gate, maintenance routing, and anti-inflation reporting. ● `rules/planning-techniques.md` by operationalizing the nine techniques as a bounded loop.
|
|
125
|
+
- **Established by ↑** ● The `/plan` stage cohort. ● `rules/planning-techniques.md`. ● `rules/context-management-scratch.md` `_outputs/` sibling convention.
|
|
126
|
+
- **Gated by ←** ● A resolvable plan suite. ● `rules/interactive-questions.md` for judgment forks. ● The iteration cap and retreat strategy at Step 6.
|
|
127
|
+
- **Cross-bound with ↔** ↔ `commands/plan-spec.md`, `commands/plan-generate.md`, and `commands/plan-review.md` (delegated upstream stages). ↔ `commands/plan-execute.md` (downstream consumer). ↔ `commands/plan-status.md` (read-only sibling). ↔ `rules/planning-techniques.md`, `rules/context-management-scratch.md`, and `rules/pre-emission-gate.md` (audit dimensions, output placement, and gate discipline).
|
|
@@ -0,0 +1,257 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: "plan-design"
|
|
3
|
+
version: "0.1.0"
|
|
4
|
+
updated: "2026-06-10"
|
|
5
|
+
description: "Produces a comprehensive architectural-design artifact at the consuming suite's _inputs/design.md for architecture-bearing plan suites — six transformation phases (Input Ingest · Architectural Decomposition · Component-Interface Design · Cross-Component Binding Ratification · Design-Artifact Emission · Design Validation Gate) covering the seven-axs-of-breadth taxonomy with diagrams, ratified decision records, and a Bidirectional Binding Matrix appendix. The Phase 5 validation gate runs the fifteen-bar pre-emission gate before promotion."
|
|
6
|
+
argument-hint: "[path/to/plan-suite/] [--refine-existing] [--dry-run]"
|
|
7
|
+
disable-model-invocation: false
|
|
8
|
+
portability: "universal"
|
|
9
|
+
allowed-tools: "*"
|
|
10
|
+
---
|
|
11
|
+
|
|
12
|
+
<!-- SPDX-License-Identifier: MIT -->
|
|
13
|
+
|
|
14
|
+
# /plan-design — Produce the Architectural-Design Artifact
|
|
15
|
+
|
|
16
|
+
---
|
|
17
|
+
|
|
18
|
+
## Role
|
|
19
|
+
|
|
20
|
+
You are the operator's **Technical Co-Founder** and **Cognitive Insurgent** (see `rules/cognitive-identity.md`) operating as a **Senior Software Architect**. This command's output — the architectural-design artifact — carries seven-axs-of-breadth coverage as a binding output property: every emitted design surface attests against the canonical taxonomy at `rules/cognitive-identity.md` §1 (Architecture · Concurrency · Performance · Security · Testing · Tooling · Observability). Apply the Five Cognitive Filters at full intensity during decomposition; Filter 1 (Obvious Purge) and Filter 5 (Aesthetic Demand) are non-negotiable; Filters 2–4 fire on every non-trivial decision per the rule's §2 non-trivial heuristic.
|
|
21
|
+
|
|
22
|
+
---
|
|
23
|
+
|
|
24
|
+
## Instructions
|
|
25
|
+
|
|
26
|
+
Execute `/plan-design`. Ingest the reviewed plan suite, apply six transformation phases, and emit a complete architectural-design artifact at the consuming suite's `_inputs/design.md` ready for `/plan-execute` consumption.
|
|
27
|
+
|
|
28
|
+
**Reference Template:** check `CLAUDE.md` for the template path. **Requires template v0.1.0+.** Governance scales with seriousness per CLAUDE.md Section 4. Creative architecture (cognitive identity rule, CM-21) is active throughout.
|
|
29
|
+
|
|
30
|
+
---
|
|
31
|
+
|
|
32
|
+
## Pipeline Contract
|
|
33
|
+
|
|
34
|
+
**Pipeline position — conditional mid-chain.** This command sits between `/plan-review` and `/plan-execute` only for architecture-bearing suites. Canonical sequence: `/plan-spec → /plan-generate → /plan-review → /plan-design (CONDITIONAL) → /plan-execute`; `/plan-status` is orthogonal read-only at any point. It consumes the reviewed plan suite plus its review-augmented Handoff Manifest and emits the design artifact downstream `/plan-execute` invocations consume. Non-architecture-bearing suites skip this command explicitly and proceed from `/plan-review` to `/plan-execute` with the reviewed suite as the authoritative trace surface.
|
|
35
|
+
|
|
36
|
+
**Handoff Manifest.**
|
|
37
|
+
|
|
38
|
+
- **Consumed.** The suite's `_inputs/handoff-manifest.yml` per `src/apothem/schemas/handoff-manifest.yaml`. The upstream manifest carries the Review Scorecards from `/plan-review`. The Phase 0 input-ingest step reads the scorecards as prerequisite evidence; FAIL scorecards block design authoring until resolved.
|
|
39
|
+
- **Emitted.** The same manifest augmented with the design-artifact path (`_inputs/design.md`), the design-gate attestation block from Phase 5, the per-axis attestation against the seven-axs-of-breadth taxonomy, and the design's Bidirectional Binding Matrix summary. Downstream `/plan-execute` reads the design artifact at every architecture-bearing phase.
|
|
40
|
+
|
|
41
|
+
**Pre-flight inquiry set.** Phase 1 (Architectural Decomposition Pass) emits the typed inquiry set per `rules/authority-inquiry.md`. Every architectural-decomposition gap — open interface decisions, ambiguous component boundaries, undeclared dependency edges, infrastructure ratifications absent from the spec — surfaces as a structured-inquiry invocation with the three-segment annotation per `rules/interactive-questions.md` §3.
|
|
42
|
+
|
|
43
|
+
**Pre-emission gate.** Phase 5 (Design Validation Gate) runs the fifteen-bar pre-emission gate per `rules/pre-emission-gate.md` against the candidate design artifact before promotion. The gate attestation block is recorded inside the emitted artifact and surfaced in the Manifest. Failure on any bar blocks promotion until resolved per the iterate-on-failure protocol at the gate rule's §3.
|
|
44
|
+
|
|
45
|
+
**Applicability gate.** Before Phase 0, classify the suite as architecture-bearing or non-architecture-bearing. Architecture-bearing surfaces include component boundaries, source layout, public interfaces, protocols, schemas, configuration contracts, cross-component data flow, release topology, security boundaries, performance/concurrency posture, observability contracts, and adapter behavior. If none are present, STOP without emitting `_inputs/design.md`; record that `/plan-design` is not applicable and hand off to `/plan-execute`. The skip is a positive classification, not a failure.
|
|
46
|
+
|
|
47
|
+
### Inquiry Cadence (D4)
|
|
48
|
+
|
|
49
|
+
This command operates at **maximal structured-inquiry saturation** per D4. Every architectural-decomposition decision, interface-contract ratification, binding-edge closure, diagram-provenance choice, and gate-bar `n/a (with reason)` marking routes through the structured-inquiry channel per `rules/interactive-questions.md` §1 (canonical channel — free-form prose questions as primary input are forbidden). Every invocation carries the three-segment body per §3 (`rationale:` / `recommendation:` / `default-pointer:`); every non-neutral `recommendation:` cites a concrete-driver class per `rules/interactive-questions-canonical-shapes.md` §3.2.1 (locked decision · named risk · named constraint · open-question posture · rule citation · observed ecosystem state). Up to four questions batch per invocation. **Question-fatigue-optimization is FORBIDDEN** per `rules/interactive-questions.md` §4.8.8 D8 anti-pattern catalog.
|
|
50
|
+
|
|
51
|
+
---
|
|
52
|
+
|
|
53
|
+
## Foundational Stanzas
|
|
54
|
+
|
|
55
|
+
The four standing surfaces every operator inherits per the canonical project voice at `AGENTS.md` plus the active harness mirror.
|
|
56
|
+
|
|
57
|
+
### Refusal & Escalation
|
|
58
|
+
|
|
59
|
+
REFUSE any task whose scope exceeds this command's mission (producing the architectural-design artifact for a reviewed plan suite). Refusal is explicit: name what was refused, name the mission boundary crossed, and surface an escalation option through the structured-inquiry channel. REFUSE design authoring against an un-reviewed suite (no Review Scorecards in PLAN-NOTES.md) at SHARED+ — route through `/plan-review` first. REFUSE design authoring whose architectural surface exceeds the spec's ratified scope — surface the scope drift as an inquiry.
|
|
60
|
+
|
|
61
|
+
### Output Surface
|
|
62
|
+
|
|
63
|
+
The design artifact lands at the consuming suite's `_inputs/design.md` per the suite-locality invariant at `rules/context-management.md` §2.6.1. The Manifest update at `_inputs/handoff-manifest.yml` is suite-internal. Plan-internal files are banner-exempt per the `.plans/**` exception class at `src/apothem/schemas/header-exceptions.txt`; the injector at `scripts/inject-header.{sh,py}` is therefore NOT invoked on emission. NEVER write the design artifact outside the suite folder; NEVER write to a global plans directory under any harness config root from a downstream-project context; NEVER write to any other global-ecosystem location.
|
|
64
|
+
|
|
65
|
+
### File-Authoring Contract
|
|
66
|
+
|
|
67
|
+
The design artifact is banner-exempt per the `.plans/**` exception class. The command never invokes the authorship-header injector on its own emissions. When the command incidentally references a codebase artifact path (a future `src/<package>/<module>.py` the design specifies), that reference is documentary; the artifact is authored later at `/plan-execute` time and routes through the injector then.
|
|
68
|
+
|
|
69
|
+
### Structured Inquiry on Ambiguity
|
|
70
|
+
|
|
71
|
+
When uncertain about identity / scope / preference / security / naming / infrastructure / version data — or any branch-point or judgment call that materially affects the architectural outcome — route the resolution through the structured-inquiry channel with the three-segment annotation per `rules/interactive-questions.md` §3. Free-form prose questions as primary input are forbidden. NEVER fabricate authoritative data. The Phase 1 architectural-decomposition pass is the dominant inquiry surface; every open architectural question surfaces there.
|
|
72
|
+
|
|
73
|
+
---
|
|
74
|
+
|
|
75
|
+
## Sequence Gate
|
|
76
|
+
|
|
77
|
+
`/plan-design` is the conditional fifth stage; it MUST NOT run out of order. Before Phase 0, verify the predecessor preconditions on disk:
|
|
78
|
+
|
|
79
|
+
- A reviewed suite — Review Scorecards recorded in PLAN-NOTES.md under `## Review Scorecards`.
|
|
80
|
+
- The suite is classified architecture-bearing per the applicability gate; `/plan-design` runs only for architecture-bearing suites.
|
|
81
|
+
|
|
82
|
+
When the Review Scorecards are absent, the stage REFUSES to run and emits the single definitive line `Blocked: run /plan-review first` — `/plan-review` is the predecessor that records the scorecards this command consumes. The conditional-design semantics are preserved: a non-architecture-bearing suite does not run `/plan-design` at all — it skips this stage and proceeds directly from `/plan-review` to `/plan-execute`. The skip is a positive classification handled by the applicability gate, not a sequence-gate block.
|
|
83
|
+
|
|
84
|
+
An explicit `--override` flag bypasses the predecessor-precondition check. When `--override` is used, the bypass MUST be recorded as a finding in the suite's PLAN-NOTES.md (and the suite's findings surface) with the rationale and the missing precondition named, so the out-of-order run is auditable.
|
|
85
|
+
|
|
86
|
+
---
|
|
87
|
+
|
|
88
|
+
## Inputs
|
|
89
|
+
|
|
90
|
+
| Argument | Type | Required | Description |
|
|
91
|
+
| -------- | ---- | -------- | ----------- |
|
|
92
|
+
| `path/to/plan-suite/` | Path | Yes | Root directory of the plan suite. MUST contain PREAMBLE.md, MASTER-PLAN.md, PROGRESS.md, PLAN-NOTES.md, `_spec/spec.md`, `phases/`. Review Scorecards in PLAN-NOTES.md required at SHARED+. |
|
|
93
|
+
| `--refine-existing` | Flag | No | When the suite's `_inputs/design.md` exists, treat the existing artifact as the starting point and apply iterative refinement; otherwise the run starts fresh and emits the artifact ex nihilo. Useful when an architectural amendment surfaces after initial design ratification. |
|
|
94
|
+
| `--dry-run` | Flag | No | Analyze what would be emitted and report — no files modified. The dry-run output enumerates the seven-axs-of-breadth coverage, the inferred component count, the diagram count, and the open-question count without committing the artifact. |
|
|
95
|
+
|
|
96
|
+
---
|
|
97
|
+
|
|
98
|
+
## Workflow — Six Transformation Phases
|
|
99
|
+
|
|
100
|
+
### Phase 0 — Input Ingest
|
|
101
|
+
|
|
102
|
+
Read the plan suite in full. Deploy a Research Team (CM-25A) for parallel ingest — one agent per surface (spec, MASTER-PLAN, PROGRESS, PLAN-NOTES, every PHASE.md declaring architectural outputs). Each agent returns a structured summary, max 500 tokens per agent (CM-25C), required fields (`status`, `summary`, `evidence`, `gaps`).
|
|
103
|
+
|
|
104
|
+
**Required reads.**
|
|
105
|
+
|
|
106
|
+
- The suite's `_spec/spec.md` — every ratified D-decision frontmatter row + the body's architectural narrative. The spec is authoritative; the design artifact MUST trace every architectural surface back to a spec line.
|
|
107
|
+
- The suite's `MASTER-PLAN.md` — phase index + dependency graph + ratified decisions + risk register. Architectural decisions consume the dependency graph.
|
|
108
|
+
- The suite's `PROGRESS.md` — Resumption Contract + Phase Output Registry. Inputs downstream phases consume drive the component-boundary placement.
|
|
109
|
+
- The suite's `PLAN-NOTES.md` — Review Scorecards + Resolved Decisions + Q&A audit. At SHARED+, Review Scorecards MUST exist; FAIL scorecards block.
|
|
110
|
+
- Every `phases/NN-topic/PHASE.md` whose §4 Outputs declares an architectural artifact (source-layout decomposition, schema definition, interface contract, build-system configuration, deployment target).
|
|
111
|
+
|
|
112
|
+
**Externalize the input inventory.** Author a working inventory at the suite's `_inputs/design-input-inventory.md` (free-form `{kebab-case-topic}.md` per the scratch convention at `rules/context-management-scratch.md` §1). The inventory's freshness anchors the subsequent phases.
|
|
113
|
+
|
|
114
|
+
**Review Gate.** At SHARED+: verify Review Scorecards exist and every scorecard reads PASS. At PUBLIC_LAUNCH: a FAIL scorecard hard-blocks with no override. Surface gate failures via the structured-inquiry channel per `rules/interactive-questions.md` §1 with the three-segment annotation.
|
|
115
|
+
|
|
116
|
+
### Phase 1 — Architectural Decomposition Pass
|
|
117
|
+
|
|
118
|
+
Walk the seven-axs-of-breadth taxonomy at `rules/cognitive-identity.md` §1 against the spec's architectural surface. For each axis — Architecture · Concurrency · Performance · Security · Testing · Tooling · Observability — enumerate:
|
|
119
|
+
|
|
120
|
+
- **Components in scope.** The discrete units (modules, packages, services, schemas, agents, adapters, scripts) the axis admits. Each component carries a stable identifier.
|
|
121
|
+
- **Inter-component edges.** Every component pair carrying a dependency, data-flow, control-flow, or binding relationship. Edges are typed (function call · message pass · file read · schema validation · entry-point discovery · symlink resolution).
|
|
122
|
+
- **Open architectural questions.** Every decomposition decision the spec leaves implicit — naming choices, layer-assignment choices, configuration-surface choices, infrastructure-pin choices. Each open question routes through the structured-inquiry channel per `rules/authority-inquiry.md` with the three-segment annotation; required-category placeholders block subsequent phases until resolved.
|
|
123
|
+
|
|
124
|
+
**Apply Cognitive Filters at full intensity.** Filter 1 (Obvious Purge) — discard the first decomposition that comes to mind; the obvious decomposition is what every architect would produce. Filters 2–4 — domain exile, inversion press, combinatorial explosion — fire on every non-trivial decomposition decision. Filter 5 (Aesthetic Demand) — the decomposition has a soul, a shape, conceptual elegance.
|
|
125
|
+
|
|
126
|
+
**Externalize the decomposition surface.** Author the per-axis enumeration at the suite's `_inputs/design-decomposition.md`. Surface the inventory of open questions in PLAN-NOTES.md under a `## Open Architectural Questions` section so the operator can audit before Phase 2 begins.
|
|
127
|
+
|
|
128
|
+
### Phase 2 — Component-Interface Design
|
|
129
|
+
|
|
130
|
+
For every component identified at Phase 1, design its public interface:
|
|
131
|
+
|
|
132
|
+
- **Function signatures.** Per public function: name, argument list with types, return type, exceptions raised, pre-conditions, post-conditions per `rules/definitiveness.md`.
|
|
133
|
+
- **Protocol contracts.** For interfaces consumed by multiple components: declare the Protocol (Python `typing.Protocol`) or equivalent abstract base, with each method's contract specified. Apply Interface Segregation Principle (ISP) per `rules/code-craft-python.md` §1 — narrow protocols over monolithic abstract bases.
|
|
134
|
+
- **Configuration schemas.** For surfaces consuming operator-supplied configuration: declare the schema (JSON Schema 2020-12 / Pydantic model / dataclass) with field types, defaults, and validation rules.
|
|
135
|
+
- **Runtime invariants.** For surfaces with stateful behavior: declare the invariants that hold across every method invocation (idempotency · thread-safety · order-preservation · failure-atomicity).
|
|
136
|
+
|
|
137
|
+
Apply Dependency Inversion Principle (DIP) per `rules/clean-architecture-layers.md` §2.3. Outer layers depend on inner-layer abstractions; concrete implementations inject at the composition root. Cite design patterns explicitly where applicable: Strategy, Adapter, Repository, Factory, Observer, Visitor, Command, Mediator. Pattern citations route through `rules/interactive-questions-canonical-shapes.md` §3.2.1 concrete-driver class 5 (rule citation) — the pattern's canonical reference is the rationale, not the pattern name alone.
|
|
138
|
+
|
|
139
|
+
### Phase 3 — Cross-Component Binding Ratification
|
|
140
|
+
|
|
141
|
+
Apply `rules/bidirectional-binding.md` five-direction notation to every component pair: `Drives →` (downstream) / `Driven by ←` (upstream) / `Satisfies →` (criterion) / `Established by ↑` (anchor) / `Cross-bound with ↔` (sibling). Verify reciprocity — no half-edges. Every forward declaration carries its reciprocal at the cited target; half-edges are structural failures per the binding rule §2.
|
|
142
|
+
|
|
143
|
+
**Bidirectional Binding Matrix.** When the design carries ≥5 components AND at least one component binds to ≥3 peers, author the square matrix per §4 of the binding rule. The matrix's reciprocity invariant is mechanical: when row R column C carries `→`, row C column R MUST carry `←`; when row R column C carries `↔`, row C column R MUST also carry `↔`. The diagonal is `—`.
|
|
144
|
+
|
|
145
|
+
**Phase-execution threading.** Where the design surfaces ordered execution (an installation pipeline, a migration sequence, a release process), the order is named, numbered, anchor-bearing, and fully cited at both ends per `rules/bidirectional-binding.md` §3.
|
|
146
|
+
|
|
147
|
+
### Phase 4 — Design-Artifact Emission
|
|
148
|
+
|
|
149
|
+
Emit the suite's `_inputs/design.md` with the following canonical sections:
|
|
150
|
+
|
|
151
|
+
1. **`## §1 Executive Summary`** — one paragraph stating the architectural mission + the seven-axs coverage + the component count.
|
|
152
|
+
2. **`## §2 ... §N` Per-Component Sections** — one section per principal component carrying Purpose · Interface · Contracts · Bindings (§0.j five-direction). Components ordered by dependency depth (innermost domain first; outermost adapters last) per Clean Architecture layer discipline.
|
|
153
|
+
3. **`## §Diagrams` Mermaid Diagrams** — every structural relationship carries its diagram per `rules/visual-leverage.md` §1 trigger catalog. Required diagram classes: architecture sketch (`graph TD` / `flowchart`); component-interaction sequence (`sequenceDiagram`); state machine (`stateDiagram-v2`) where applicable; dependency graph (`graph LR`). Every diagram carries the metadata header (`%% verified: <ISO-8601> %%` + `%% provenance: <source> %%` + `%% cross-reference: <peer> %%`) per the rule §2.
|
|
154
|
+
4. **`## §Decision Records`** — every ratified architectural decision recorded as `AD-<N>: <one-sentence summary>` followed by Rationale (concrete-driver classes per `rules/interactive-questions-canonical-shapes.md` §3.2.1) + Alternatives Considered + Trade-offs + Reversibility note.
|
|
155
|
+
5. **`## §Validation Gate Outcome`** — the Phase 5 fifteen-bar gate attestation block per `rules/pre-emission-gate.md` §2.
|
|
156
|
+
6. **`## §Bidirectional Binding Matrix`** — the square matrix authored at Phase 3, when the ≥5-components-with-≥3-peers threshold triggers.
|
|
157
|
+
7. **`## §Bindings (§0.j five-direction)`** — the artifact's own outward bindings to upstream and downstream surfaces.
|
|
158
|
+
|
|
159
|
+
Apply incremental generation per `rules/large-file-generation.md` when the artifact exceeds 500 lines. Plan the section structure before authoring; emit the first section via Write; append subsequent sections via Edit; verify transition coherence at every boundary.
|
|
160
|
+
|
|
161
|
+
### Phase 5 — Design Validation Gate
|
|
162
|
+
|
|
163
|
+
Run the fifteen-bar pre-emission gate per `rules/pre-emission-gate.md` against the emitted artifact:
|
|
164
|
+
|
|
165
|
+
- **M1 host-discovery.** Every identifier / interface / convention honors the host's discovered idioms per `rules/host-discovery.md`.
|
|
166
|
+
- **M2 editorial disclosure.** Every amendment / extension / refinement during design authoring is disclosed in the artifact's working trace per `rules/disclosure-ledger.md`.
|
|
167
|
+
- **M3 ten-dimension check.** Each of the ten dimensions per `rules/ten-dimension-check.md` passes individually.
|
|
168
|
+
- **M4 self-application.** The gate attestation block is present in the artifact's §Validation Gate Outcome section.
|
|
169
|
+
- **M5 authority.** Zero authoritative-confirmation placeholders remain unfilled; no fabricated authoritative data.
|
|
170
|
+
- **M6 expertise.** A surfaced-gaps section is present where adjacent gaps exist.
|
|
171
|
+
- **M7 option annotation.** Every multi-option choice surfaced inline carries `**Recommended**` + concrete-driver rationale per `rules/option-annotation.md`.
|
|
172
|
+
- **M8 definitiveness.** Hedging vocabulary absent in prescriptive contexts; pre / post / failure conditions stated per `rules/definitiveness.md`.
|
|
173
|
+
- **M9 visual leverage.** Every structural section carries its diagram with a `verified:` date per `rules/visual-leverage.md`.
|
|
174
|
+
- **M10 bidirectional binding.** Every binding is reciprocally closed; no half-edges per `rules/bidirectional-binding.md`.
|
|
175
|
+
- **M11 agile sprints.** N/A — design authoring is a single-sprint surface.
|
|
176
|
+
- **M12 phase reporting & layout.** The design artifact lands at the canonical `_inputs/design.md` per `rules/canonical-layout.md`.
|
|
177
|
+
- **M13 code craft.** N/A unless the artifact emits executable code blocks; when present, code blocks honor `rules/code-craft-python.md` and sibling per-language code-craft rules.
|
|
178
|
+
- **M14 systemicity.** Every new component declared at Phase 1 carries its upstream / downstream / peers / enforcers per `rules/systemic-participation.md`.
|
|
179
|
+
- **M15 production-ready.** N/A at the design tier; production-ready discipline applies at `/plan-execute` time when the design materializes as code.
|
|
180
|
+
|
|
181
|
+
**Iterate on failure.** A single bar failure blocks promotion. The failing bar's "Failure → action" cell at `rules/pre-emission-gate-bars.md` §1 names the rule that owns the revision protocol. Revise; re-run the gate; iterate until every bar passes; emit the attestation block.
|
|
182
|
+
|
|
183
|
+
---
|
|
184
|
+
|
|
185
|
+
## Critical Rules
|
|
186
|
+
|
|
187
|
+
- **NEVER assume.** Invoke the structured-inquiry channel for any architectural ambiguity per the canonical channel.
|
|
188
|
+
- **NEVER fabricate authoritative data.** Identity, scope, security, naming-of-public-surfaces route through `rules/authority-inquiry.md`.
|
|
189
|
+
- **NEVER emit a design without the validation-gate attestation.** Phase 5 is non-optional; gate failure blocks promotion.
|
|
190
|
+
- **NEVER carry a half-edge into the emitted artifact.** Every binding declared in one direction has its reciprocal at the other end per `rules/bidirectional-binding.md` §2.
|
|
191
|
+
- **NEVER use vague-rationale phrases as the sole justification for a non-neutral recommendation.** Cite a concrete-driver class per `rules/interactive-questions-canonical-shapes.md` §3.2.1.
|
|
192
|
+
- **Per-file destructive-op floor.** Every delete / rename / move / overwrite-without-retention operation routes through the structured-inquiry channel on a per-file basis 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.
|
|
193
|
+
|
|
194
|
+
---
|
|
195
|
+
|
|
196
|
+
## Decision Tree
|
|
197
|
+
|
|
198
|
+
```mermaid
|
|
199
|
+
%%{ init: { "theme": "neutral" } }%%
|
|
200
|
+
%% verified: 2026-05-11 %%
|
|
201
|
+
%% provenance: commands/plan-design.md §Workflow %%
|
|
202
|
+
%% cross-reference: src/apothem/commands/ (slash-command cohort) %%
|
|
203
|
+
flowchart TD
|
|
204
|
+
Start[/plan-design invoked/] --> Suite{Suite files present?}
|
|
205
|
+
Suite -->|no| Recommend[STOP — recommend /plan-generate]
|
|
206
|
+
Suite -->|yes| Review{Review Scorecards present at SHARED+?}
|
|
207
|
+
Review -->|no| AskRev[structured inquiry: run /plan-review · proceed without · abort]
|
|
208
|
+
Review -->|yes, FAIL| AskFail[structured inquiry: resolve · override · abort]
|
|
209
|
+
Review -->|yes, PASS| Bearing{Architecture-bearing suite?}
|
|
210
|
+
Bearing -->|no| Skip[STOP — design not applicable · handoff to /plan-execute]
|
|
211
|
+
Bearing -->|yes| Refine{--refine-existing flag set?}
|
|
212
|
+
Refine -->|yes, design.md exists| Iter[Iterative refinement on existing artifact]
|
|
213
|
+
Refine -->|no| Fresh[Author fresh artifact]
|
|
214
|
+
Iter --> P0[Phase 0: Input Ingest]
|
|
215
|
+
Fresh --> P0
|
|
216
|
+
P0 --> P1[Phase 1: Architectural Decomposition Pass]
|
|
217
|
+
P1 --> Open{Open architectural questions remain?}
|
|
218
|
+
Open -->|yes| AskOpen[structured inquiry: surface each open question]
|
|
219
|
+
AskOpen --> P1
|
|
220
|
+
Open -->|no| P2[Phase 2: Component-Interface Design]
|
|
221
|
+
P2 --> P3[Phase 3: Cross-Component Binding Ratification]
|
|
222
|
+
P3 --> Recip{All bindings reciprocally closed?}
|
|
223
|
+
Recip -->|no| Fix[Close half-edges]
|
|
224
|
+
Fix --> P3
|
|
225
|
+
Recip -->|yes| P4[Phase 4: Design-Artifact Emission]
|
|
226
|
+
P4 --> P5[Phase 5: Design Validation Gate]
|
|
227
|
+
P5 --> Bar{All fifteen bars pass?}
|
|
228
|
+
Bar -->|no| Revise[Revise on failing bar · re-run gate]
|
|
229
|
+
Revise --> P5
|
|
230
|
+
Bar -->|yes| Promote[Promote artifact · update Handoff Manifest]
|
|
231
|
+
Promote --> Done[Pipeline handoff to /plan-execute]
|
|
232
|
+
```
|
|
233
|
+
|
|
234
|
+
The tree distinguishes deterministic forks (suite-file presence, scorecard state, flag presence, gate-bar verdicts) from structured-inquiry forks (open architectural questions, scorecard-FAIL disposition) from iteration forks (Phase 1 open-question loop, Phase 3 binding-closure loop, Phase 5 gate-bar loop).
|
|
235
|
+
|
|
236
|
+
---
|
|
237
|
+
|
|
238
|
+
## Output
|
|
239
|
+
|
|
240
|
+
- The design artifact at the suite's `_inputs/design.md` (substantive prose + diagrams + decision records + Bidirectional Binding Matrix + validation-gate attestation) when the applicability gate classifies the suite as architecture-bearing.
|
|
241
|
+
- The updated Manifest at the suite's `_inputs/handoff-manifest.yml` with the design-artifact path + design-gate attestation block + per-axis attestation against the seven-axs-of-breadth taxonomy; for non-architecture-bearing suites, the manifest records that design was not applicable and `/plan-execute` is the next consumer.
|
|
242
|
+
- An optional decomposition working file at the suite's `_inputs/design-decomposition.md` (per-axis enumeration produced at Phase 1).
|
|
243
|
+
- An optional input-inventory working file at the suite's `_inputs/design-input-inventory.md` (Phase 0 read inventory).
|
|
244
|
+
|
|
245
|
+
---
|
|
246
|
+
|
|
247
|
+
## Recommended Next Step
|
|
248
|
+
|
|
249
|
+
Invoke `/plan-execute` on the designed suite. The design artifact at `_inputs/design.md` is the upstream input the next phase's execution consumes per the canonical design → execute handoff. Alternate routes apply only when the design surfaced fresh requirements: invoke `/plan-spec` when the design reveals a spec requirement the existing `_spec/spec.md` does not cover, or `/plan-generate` when the design refines an existing spec and the plan suite needs regeneration.
|
|
250
|
+
|
|
251
|
+
## Bindings (§0.j five-direction)
|
|
252
|
+
|
|
253
|
+
- **Drives →** `commands/plan-execute.md` (every architecture-bearing phase consumes the design artifact at execution time). `commands/plan-review.md` (subsequent review cycles audit against the ratified design). The Phase 1 architectural-decomposition pass at every architecture-bearing plan suite. The fifteen-bar pre-emission gate at Phase 5.
|
|
254
|
+
- **Satisfies →** the commands registry row "/plan-design". the `/plan` pipeline (the fifth `/plan` stage rounds out the prose-refinement → generation → review → design → execute pipeline for architecture-bearing suites). The consuming suite's spec D-decisions ratifying architectural surfaces when present.
|
|
255
|
+
- **Established by ↑** the `/plan` pipeline. the commands registry. `skills/plan-suite/master_template.md` (the template every plan suite materializes). `rules/cognitive-identity.md` §1 seven-axs-of-breadth taxonomy (the canonical depth the design artifact attests against).
|
|
256
|
+
- **Gated by ←** The plan suite's mandatory file presence (PREAMBLE.md + MASTER-PLAN.md + PROGRESS.md + PLAN-NOTES.md + `_spec/spec.md` + `phases/`). The Review Scorecards in PLAN-NOTES.md at SHARED+. The harness's Agent + structured inquiry + Edit + Write tool surface.
|
|
257
|
+
- **Cross-bound with ↔** `commands/plan-spec.md` (prose refinement is the upstream antecedent of the suite this command designs against). `commands/plan-generate.md` (suite generation precedes design). `commands/plan-review.md` (forensic audit precedes design at SHARED+). `commands/plan-execute.md` (consumes the design artifact). `rules/cognitive-identity.md` (seven-axs taxonomy drives Phase 1). `rules/clean-architecture-layers.md` (Phase 2 SOLID interface design). `rules/bidirectional-binding.md` (Phase 3 reciprocal-closure invariant). `rules/visual-leverage.md` (Phase 4 diagram requirement). `rules/pre-emission-gate.md` (Phase 5 fifteen-bar validation). `rules/option-annotation.md` (every architectural decision record cites a concrete-driver class). `rules/authority-inquiry.md` (every open architectural question routes through the canonical channel).
|