kingmadoc 0.2.0__tar.gz → 0.3.0.dev7__tar.gz
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.
- {kingmadoc-0.2.0 → kingmadoc-0.3.0.dev7}/.github/workflows/release.yml +38 -15
- {kingmadoc-0.2.0 → kingmadoc-0.3.0.dev7}/CHANGELOG.md +36 -0
- {kingmadoc-0.2.0 → kingmadoc-0.3.0.dev7}/CLAUDE.md +1 -1
- {kingmadoc-0.2.0 → kingmadoc-0.3.0.dev7}/PKG-INFO +24 -13
- {kingmadoc-0.2.0 → kingmadoc-0.3.0.dev7}/README.md +23 -12
- {kingmadoc-0.2.0 → kingmadoc-0.3.0.dev7}/docs/releasing.md +9 -0
- {kingmadoc-0.2.0 → kingmadoc-0.3.0.dev7}/docs/test-plan.md +3 -3
- kingmadoc-0.3.0.dev7/evals/results/2026-09-27T162715Z.json +95 -0
- {kingmadoc-0.2.0 → kingmadoc-0.3.0.dev7}/scripts/run_evals.py +2 -2
- {kingmadoc-0.2.0 → kingmadoc-0.3.0.dev7}/skill/SKILL.md +2 -1
- {kingmadoc-0.2.0 → kingmadoc-0.3.0.dev7}/skill/codex.md +2 -1
- {kingmadoc-0.2.0 → kingmadoc-0.3.0.dev7}/skill/copilot.md +2 -1
- {kingmadoc-0.2.0 → kingmadoc-0.3.0.dev7}/skill/cursor.md +2 -1
- {kingmadoc-0.2.0 → kingmadoc-0.3.0.dev7}/skill/explaining-code/SKILL.md +34 -7
- {kingmadoc-0.2.0 → kingmadoc-0.3.0.dev7}/skill/explaining-code/reference/arc42.md +7 -1
- {kingmadoc-0.2.0 → kingmadoc-0.3.0.dev7}/skill/explaining-code/reference/c4-model.md +9 -6
- {kingmadoc-0.2.0 → kingmadoc-0.3.0.dev7}/skill/explaining-code/reference/c4.md +6 -1
- {kingmadoc-0.2.0 → kingmadoc-0.3.0.dev7}/skill/explaining-code/reference/models.md +68 -1
- {kingmadoc-0.2.0 → kingmadoc-0.3.0.dev7}/skill/explaining-code/reference/split.md +5 -1
- {kingmadoc-0.2.0 → kingmadoc-0.3.0.dev7}/src/kingmadoc/cli.py +73 -12
- {kingmadoc-0.2.0 → kingmadoc-0.3.0.dev7}/src/kingmadoc/facts/collect.py +95 -29
- kingmadoc-0.3.0.dev7/src/kingmadoc/facts/dominators.py +109 -0
- {kingmadoc-0.2.0 → kingmadoc-0.3.0.dev7}/src/kingmadoc/facts/js_modules.py +6 -2
- {kingmadoc-0.2.0 → kingmadoc-0.3.0.dev7}/src/kingmadoc/render.py +69 -0
- {kingmadoc-0.2.0 → kingmadoc-0.3.0.dev7}/tests/test_facts.py +32 -0
- kingmadoc-0.3.0.dev7/tests/test_facts_dominators.py +70 -0
- {kingmadoc-0.2.0 → kingmadoc-0.3.0.dev7}/tests/test_render.py +69 -1
- {kingmadoc-0.2.0 → kingmadoc-0.3.0.dev7}/tests/test_skill_explaining_code.py +28 -2
- {kingmadoc-0.2.0 → kingmadoc-0.3.0.dev7}/tests/test_skill_models.py +45 -1
- {kingmadoc-0.2.0 → kingmadoc-0.3.0.dev7}/tests/test_vscode_preview.py +46 -0
- {kingmadoc-0.2.0 → kingmadoc-0.3.0.dev7}/.featuredoc.yml +0 -0
- {kingmadoc-0.2.0 → kingmadoc-0.3.0.dev7}/.github/ISSUE_TEMPLATE/bug_report.md +0 -0
- {kingmadoc-0.2.0 → kingmadoc-0.3.0.dev7}/.github/ISSUE_TEMPLATE/feature_request.md +0 -0
- {kingmadoc-0.2.0 → kingmadoc-0.3.0.dev7}/.github/workflows/ci.yml +0 -0
- {kingmadoc-0.2.0 → kingmadoc-0.3.0.dev7}/.gitignore +0 -0
- {kingmadoc-0.2.0 → kingmadoc-0.3.0.dev7}/CONTRIBUTING.md +0 -0
- {kingmadoc-0.2.0 → kingmadoc-0.3.0.dev7}/LICENSE +0 -0
- {kingmadoc-0.2.0 → kingmadoc-0.3.0.dev7}/docs/conventions.md +0 -0
- {kingmadoc-0.2.0 → kingmadoc-0.3.0.dev7}/docs/index.md +0 -0
- {kingmadoc-0.2.0 → kingmadoc-0.3.0.dev7}/docs/roadmap.md +0 -0
- {kingmadoc-0.2.0 → kingmadoc-0.3.0.dev7}/evals/README.md +0 -0
- {kingmadoc-0.2.0 → kingmadoc-0.3.0.dev7}/evals/fixtures/shop/manage.py +0 -0
- {kingmadoc-0.2.0 → kingmadoc-0.3.0.dev7}/evals/fixtures/shop/requirements.txt +0 -0
- {kingmadoc-0.2.0 → kingmadoc-0.3.0.dev7}/evals/fixtures/shop/shop/__init__.py +0 -0
- {kingmadoc-0.2.0 → kingmadoc-0.3.0.dev7}/evals/fixtures/shop/shop/models.py +0 -0
- {kingmadoc-0.2.0 → kingmadoc-0.3.0.dev7}/evals/fixtures/shop/shop/services.py +0 -0
- {kingmadoc-0.2.0 → kingmadoc-0.3.0.dev7}/evals/fixtures/shop/shop/settings.py +0 -0
- {kingmadoc-0.2.0 → kingmadoc-0.3.0.dev7}/evals/fixtures/shop/shop/urls.py +0 -0
- {kingmadoc-0.2.0 → kingmadoc-0.3.0.dev7}/evals/fixtures/shop/shop/views.py +0 -0
- {kingmadoc-0.2.0 → kingmadoc-0.3.0.dev7}/evals/fixtures/shop-discount/shop/discounts.py +0 -0
- {kingmadoc-0.2.0 → kingmadoc-0.3.0.dev7}/evals/fixtures/shop-discount/shop/services.py +0 -0
- {kingmadoc-0.2.0 → kingmadoc-0.3.0.dev7}/evals/results/2026-09-27T111837Z.json +0 -0
- {kingmadoc-0.2.0 → kingmadoc-0.3.0.dev7}/evals/results/2026-09-27T112600Z.json +0 -0
- {kingmadoc-0.2.0 → kingmadoc-0.3.0.dev7}/evals/scenarios/explain-branch.yml +0 -0
- {kingmadoc-0.2.0 → kingmadoc-0.3.0.dev7}/evals/scenarios/explain-feature.yml +0 -0
- {kingmadoc-0.2.0 → kingmadoc-0.3.0.dev7}/evals/scenarios/plan-feature.yml +0 -0
- {kingmadoc-0.2.0 → kingmadoc-0.3.0.dev7}/examples/verify-mode-plan.md +0 -0
- {kingmadoc-0.2.0 → kingmadoc-0.3.0.dev7}/pyproject.toml +0 -0
- {kingmadoc-0.2.0 → kingmadoc-0.3.0.dev7}/scripts/build_skill_variants.py +0 -0
- {kingmadoc-0.2.0 → kingmadoc-0.3.0.dev7}/skill/reference/diagram-rules.md +0 -0
- {kingmadoc-0.2.0 → kingmadoc-0.3.0.dev7}/skill/reference/formats.md +0 -0
- {kingmadoc-0.2.0 → kingmadoc-0.3.0.dev7}/src/kingmadoc/__init__.py +0 -0
- {kingmadoc-0.2.0 → kingmadoc-0.3.0.dev7}/src/kingmadoc/about.py +0 -0
- {kingmadoc-0.2.0 → kingmadoc-0.3.0.dev7}/src/kingmadoc/adr.py +0 -0
- {kingmadoc-0.2.0 → kingmadoc-0.3.0.dev7}/src/kingmadoc/config.py +0 -0
- {kingmadoc-0.2.0 → kingmadoc-0.3.0.dev7}/src/kingmadoc/d2_binary.py +0 -0
- {kingmadoc-0.2.0 → kingmadoc-0.3.0.dev7}/src/kingmadoc/diagrams/__init__.py +0 -0
- {kingmadoc-0.2.0 → kingmadoc-0.3.0.dev7}/src/kingmadoc/diagrams/base.py +0 -0
- {kingmadoc-0.2.0 → kingmadoc-0.3.0.dev7}/src/kingmadoc/diagrams/d2.py +0 -0
- {kingmadoc-0.2.0 → kingmadoc-0.3.0.dev7}/src/kingmadoc/diagrams/mermaid.py +0 -0
- {kingmadoc-0.2.0 → kingmadoc-0.3.0.dev7}/src/kingmadoc/diagrams/plantuml.py +0 -0
- {kingmadoc-0.2.0 → kingmadoc-0.3.0.dev7}/src/kingmadoc/documents.py +0 -0
- {kingmadoc-0.2.0 → kingmadoc-0.3.0.dev7}/src/kingmadoc/exceptions.py +0 -0
- {kingmadoc-0.2.0 → kingmadoc-0.3.0.dev7}/src/kingmadoc/explain.py +0 -0
- {kingmadoc-0.2.0 → kingmadoc-0.3.0.dev7}/src/kingmadoc/facts/__init__.py +0 -0
- {kingmadoc-0.2.0 → kingmadoc-0.3.0.dev7}/src/kingmadoc/facts/branch.py +0 -0
- {kingmadoc-0.2.0 → kingmadoc-0.3.0.dev7}/src/kingmadoc/facts/data_model.py +0 -0
- {kingmadoc-0.2.0 → kingmadoc-0.3.0.dev7}/src/kingmadoc/facts/projects.py +0 -0
- {kingmadoc-0.2.0 → kingmadoc-0.3.0.dev7}/src/kingmadoc/facts/routes.py +0 -0
- {kingmadoc-0.2.0 → kingmadoc-0.3.0.dev7}/src/kingmadoc/facts/services.py +0 -0
- {kingmadoc-0.2.0 → kingmadoc-0.3.0.dev7}/src/kingmadoc/git.py +0 -0
- {kingmadoc-0.2.0 → kingmadoc-0.3.0.dev7}/src/kingmadoc/naming.py +0 -0
- {kingmadoc-0.2.0 → kingmadoc-0.3.0.dev7}/src/kingmadoc/plan/__init__.py +0 -0
- {kingmadoc-0.2.0 → kingmadoc-0.3.0.dev7}/src/kingmadoc/plan/analyzer.py +0 -0
- {kingmadoc-0.2.0 → kingmadoc-0.3.0.dev7}/src/kingmadoc/plan/dependencies.py +0 -0
- {kingmadoc-0.2.0 → kingmadoc-0.3.0.dev7}/src/kingmadoc/plan/generator.py +0 -0
- {kingmadoc-0.2.0 → kingmadoc-0.3.0.dev7}/src/kingmadoc/plan/models.py +0 -0
- {kingmadoc-0.2.0 → kingmadoc-0.3.0.dev7}/src/kingmadoc/plandoc.py +0 -0
- {kingmadoc-0.2.0 → kingmadoc-0.3.0.dev7}/src/kingmadoc/skills.py +0 -0
- {kingmadoc-0.2.0 → kingmadoc-0.3.0.dev7}/src/kingmadoc/templates/adr.md.j2 +0 -0
- {kingmadoc-0.2.0 → kingmadoc-0.3.0.dev7}/src/kingmadoc/templates/domain_design.md.j2 +0 -0
- {kingmadoc-0.2.0 → kingmadoc-0.3.0.dev7}/src/kingmadoc/templates/functional_design.md.j2 +0 -0
- {kingmadoc-0.2.0 → kingmadoc-0.3.0.dev7}/src/kingmadoc/templates/plan_default.md.j2 +0 -0
- {kingmadoc-0.2.0 → kingmadoc-0.3.0.dev7}/src/kingmadoc/templates/security_design.md.j2 +0 -0
- {kingmadoc-0.2.0 → kingmadoc-0.3.0.dev7}/src/kingmadoc/templates/technical_design.md.j2 +0 -0
- {kingmadoc-0.2.0 → kingmadoc-0.3.0.dev7}/src/kingmadoc/templating.py +0 -0
- {kingmadoc-0.2.0 → kingmadoc-0.3.0.dev7}/src/kingmadoc/verify/__init__.py +0 -0
- {kingmadoc-0.2.0 → kingmadoc-0.3.0.dev7}/src/kingmadoc/verify/changes.py +0 -0
- {kingmadoc-0.2.0 → kingmadoc-0.3.0.dev7}/src/kingmadoc/verify/commands.py +0 -0
- {kingmadoc-0.2.0 → kingmadoc-0.3.0.dev7}/src/kingmadoc/verify/deviations.py +0 -0
- {kingmadoc-0.2.0 → kingmadoc-0.3.0.dev7}/src/kingmadoc/verify/locate.py +0 -0
- {kingmadoc-0.2.0 → kingmadoc-0.3.0.dev7}/src/kingmadoc/verify/report.py +0 -0
- {kingmadoc-0.2.0 → kingmadoc-0.3.0.dev7}/src/kingmadoc/vscode.py +0 -0
- {kingmadoc-0.2.0 → kingmadoc-0.3.0.dev7}/tests/fixtures/backends/d2/class.d2 +0 -0
- {kingmadoc-0.2.0 → kingmadoc-0.3.0.dev7}/tests/fixtures/backends/d2/component.d2 +0 -0
- {kingmadoc-0.2.0 → kingmadoc-0.3.0.dev7}/tests/fixtures/backends/d2/container.d2 +0 -0
- {kingmadoc-0.2.0 → kingmadoc-0.3.0.dev7}/tests/fixtures/backends/d2/context.d2 +0 -0
- {kingmadoc-0.2.0 → kingmadoc-0.3.0.dev7}/tests/fixtures/backends/d2/sequence.d2 +0 -0
- {kingmadoc-0.2.0 → kingmadoc-0.3.0.dev7}/tests/fixtures/backends/mermaid/class.mmd +0 -0
- {kingmadoc-0.2.0 → kingmadoc-0.3.0.dev7}/tests/fixtures/backends/mermaid/component.mmd +0 -0
- {kingmadoc-0.2.0 → kingmadoc-0.3.0.dev7}/tests/fixtures/backends/mermaid/container.mmd +0 -0
- {kingmadoc-0.2.0 → kingmadoc-0.3.0.dev7}/tests/fixtures/backends/mermaid/context.mmd +0 -0
- {kingmadoc-0.2.0 → kingmadoc-0.3.0.dev7}/tests/fixtures/backends/mermaid/sequence.mmd +0 -0
- {kingmadoc-0.2.0 → kingmadoc-0.3.0.dev7}/tests/fixtures/backends/plantuml/class.puml +0 -0
- {kingmadoc-0.2.0 → kingmadoc-0.3.0.dev7}/tests/fixtures/backends/plantuml/component.puml +0 -0
- {kingmadoc-0.2.0 → kingmadoc-0.3.0.dev7}/tests/fixtures/backends/plantuml/container.puml +0 -0
- {kingmadoc-0.2.0 → kingmadoc-0.3.0.dev7}/tests/fixtures/backends/plantuml/context.puml +0 -0
- {kingmadoc-0.2.0 → kingmadoc-0.3.0.dev7}/tests/fixtures/backends/plantuml/sequence.puml +0 -0
- {kingmadoc-0.2.0 → kingmadoc-0.3.0.dev7}/tests/fixtures/mermaid/component.mmd +0 -0
- {kingmadoc-0.2.0 → kingmadoc-0.3.0.dev7}/tests/fixtures/mermaid/container.mmd +0 -0
- {kingmadoc-0.2.0 → kingmadoc-0.3.0.dev7}/tests/fixtures/mermaid/context.mmd +0 -0
- {kingmadoc-0.2.0 → kingmadoc-0.3.0.dev7}/tests/test_adr.py +0 -0
- {kingmadoc-0.2.0 → kingmadoc-0.3.0.dev7}/tests/test_adr_numbering.py +0 -0
- {kingmadoc-0.2.0 → kingmadoc-0.3.0.dev7}/tests/test_analyzer.py +0 -0
- {kingmadoc-0.2.0 → kingmadoc-0.3.0.dev7}/tests/test_cli.py +0 -0
- {kingmadoc-0.2.0 → kingmadoc-0.3.0.dev7}/tests/test_cli_encoding.py +0 -0
- {kingmadoc-0.2.0 → kingmadoc-0.3.0.dev7}/tests/test_cli_init.py +0 -0
- {kingmadoc-0.2.0 → kingmadoc-0.3.0.dev7}/tests/test_cli_plan_custom_template.py +0 -0
- {kingmadoc-0.2.0 → kingmadoc-0.3.0.dev7}/tests/test_cli_sigint.py +0 -0
- {kingmadoc-0.2.0 → kingmadoc-0.3.0.dev7}/tests/test_cli_verify_config.py +0 -0
- {kingmadoc-0.2.0 → kingmadoc-0.3.0.dev7}/tests/test_config.py +0 -0
- {kingmadoc-0.2.0 → kingmadoc-0.3.0.dev7}/tests/test_config_poetry.py +0 -0
- {kingmadoc-0.2.0 → kingmadoc-0.3.0.dev7}/tests/test_config_shape.py +0 -0
- {kingmadoc-0.2.0 → kingmadoc-0.3.0.dev7}/tests/test_d2_download.py +0 -0
- {kingmadoc-0.2.0 → kingmadoc-0.3.0.dev7}/tests/test_dependencies.py +0 -0
- {kingmadoc-0.2.0 → kingmadoc-0.3.0.dev7}/tests/test_dependency_graph_model.py +0 -0
- {kingmadoc-0.2.0 → kingmadoc-0.3.0.dev7}/tests/test_design_models.py +0 -0
- {kingmadoc-0.2.0 → kingmadoc-0.3.0.dev7}/tests/test_diagram_backends.py +0 -0
- {kingmadoc-0.2.0 → kingmadoc-0.3.0.dev7}/tests/test_diagrams_mermaid.py +0 -0
- {kingmadoc-0.2.0 → kingmadoc-0.3.0.dev7}/tests/test_documents.py +0 -0
- {kingmadoc-0.2.0 → kingmadoc-0.3.0.dev7}/tests/test_duplicate_names.py +0 -0
- {kingmadoc-0.2.0 → kingmadoc-0.3.0.dev7}/tests/test_evals.py +0 -0
- {kingmadoc-0.2.0 → kingmadoc-0.3.0.dev7}/tests/test_explain.py +0 -0
- {kingmadoc-0.2.0 → kingmadoc-0.3.0.dev7}/tests/test_explain_config.py +0 -0
- {kingmadoc-0.2.0 → kingmadoc-0.3.0.dev7}/tests/test_explain_status.py +0 -0
- {kingmadoc-0.2.0 → kingmadoc-0.3.0.dev7}/tests/test_extra_designs_coverage.py +0 -0
- {kingmadoc-0.2.0 → kingmadoc-0.3.0.dev7}/tests/test_facts_code.py +0 -0
- {kingmadoc-0.2.0 → kingmadoc-0.3.0.dev7}/tests/test_facts_data_model.py +0 -0
- {kingmadoc-0.2.0 → kingmadoc-0.3.0.dev7}/tests/test_functional_design.py +0 -0
- {kingmadoc-0.2.0 → kingmadoc-0.3.0.dev7}/tests/test_generator.py +0 -0
- {kingmadoc-0.2.0 → kingmadoc-0.3.0.dev7}/tests/test_grep_performance.py +0 -0
- {kingmadoc-0.2.0 → kingmadoc-0.3.0.dev7}/tests/test_manifests.py +0 -0
- {kingmadoc-0.2.0 → kingmadoc-0.3.0.dev7}/tests/test_max_lines_per_file.py +0 -0
- {kingmadoc-0.2.0 → kingmadoc-0.3.0.dev7}/tests/test_output_dir.py +0 -0
- {kingmadoc-0.2.0 → kingmadoc-0.3.0.dev7}/tests/test_plan_e2e.py +0 -0
- {kingmadoc-0.2.0 → kingmadoc-0.3.0.dev7}/tests/test_plandoc.py +0 -0
- {kingmadoc-0.2.0 → kingmadoc-0.3.0.dev7}/tests/test_properties.py +0 -0
- {kingmadoc-0.2.0 → kingmadoc-0.3.0.dev7}/tests/test_security_domain_designs.py +0 -0
- {kingmadoc-0.2.0 → kingmadoc-0.3.0.dev7}/tests/test_skill.py +0 -0
- {kingmadoc-0.2.0 → kingmadoc-0.3.0.dev7}/tests/test_skills_install.py +0 -0
- {kingmadoc-0.2.0 → kingmadoc-0.3.0.dev7}/tests/test_source_dirs.py +0 -0
- {kingmadoc-0.2.0 → kingmadoc-0.3.0.dev7}/tests/test_summary_slug_diagram_defaults.py +0 -0
- {kingmadoc-0.2.0 → kingmadoc-0.3.0.dev7}/tests/test_technical_design.py +0 -0
- {kingmadoc-0.2.0 → kingmadoc-0.3.0.dev7}/tests/test_templating_security.py +0 -0
- {kingmadoc-0.2.0 → kingmadoc-0.3.0.dev7}/tests/test_verify.py +0 -0
- {kingmadoc-0.2.0 → kingmadoc-0.3.0.dev7}/tests/test_verify_locate.py +0 -0
- {kingmadoc-0.2.0 → kingmadoc-0.3.0.dev7}/tests/test_version.py +0 -0
- {kingmadoc-0.2.0 → kingmadoc-0.3.0.dev7}/uv.lock +0 -0
|
@@ -1,10 +1,17 @@
|
|
|
1
1
|
name: Release
|
|
2
2
|
|
|
3
|
-
#
|
|
4
|
-
#
|
|
3
|
+
# Two channels, both with PyPI trusted publishing (no API token; setup: docs/releasing.md):
|
|
4
|
+
# - Release: push a tag like v0.2.0. Publishes 0.2.0 and creates the GitHub release.
|
|
5
|
+
# - Beta: every commit on main whose CI passed. Publishes its development version
|
|
6
|
+
# (e.g. 0.3.0.dev12, from hatch-vcs). pip installs it only when asked for pre-releases
|
|
7
|
+
# (pipx install --pip-args=--pre kingmadoc), so ordinary installs keep the release.
|
|
5
8
|
on:
|
|
6
9
|
push:
|
|
7
10
|
tags: ["v*"]
|
|
11
|
+
workflow_run:
|
|
12
|
+
workflows: [CI]
|
|
13
|
+
types: [completed]
|
|
14
|
+
branches: [main]
|
|
8
15
|
|
|
9
16
|
permissions:
|
|
10
17
|
contents: read
|
|
@@ -12,12 +19,20 @@ permissions:
|
|
|
12
19
|
jobs:
|
|
13
20
|
build:
|
|
14
21
|
name: Build and test the distribution
|
|
22
|
+
# Beta: only a push to this repository's main whose CI passed (not a pull request).
|
|
23
|
+
if: >-
|
|
24
|
+
github.event_name == 'push' || (
|
|
25
|
+
github.event.workflow_run.conclusion == 'success' &&
|
|
26
|
+
github.event.workflow_run.event == 'push' &&
|
|
27
|
+
github.event.workflow_run.head_repository.full_name == github.repository
|
|
28
|
+
)
|
|
15
29
|
runs-on: ubuntu-latest
|
|
16
30
|
steps:
|
|
17
|
-
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1
|
|
31
|
+
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
|
18
32
|
with:
|
|
19
|
-
fetch-depth: 0
|
|
20
|
-
|
|
33
|
+
fetch-depth: 0 # the version comes from the tag (hatch-vcs)
|
|
34
|
+
ref: ${{ github.event.workflow_run.head_sha || github.ref }}
|
|
35
|
+
- uses: actions/setup-python@5fda3b95a4ea91299a34e894583c3862153e4b97 # v7.0.0
|
|
21
36
|
with:
|
|
22
37
|
python-version: "3.11"
|
|
23
38
|
- name: Build
|
|
@@ -25,10 +40,14 @@ jobs:
|
|
|
25
40
|
python -m pip install build twine
|
|
26
41
|
python -m build
|
|
27
42
|
twine check --strict dist/*
|
|
28
|
-
- name: The version is the tag
|
|
43
|
+
- name: The version is the tag (release) or a development version (beta)
|
|
29
44
|
run: |
|
|
30
|
-
|
|
31
|
-
|
|
45
|
+
if [ "$GITHUB_EVENT_NAME" = push ]; then
|
|
46
|
+
version="${GITHUB_REF_NAME#v}"
|
|
47
|
+
ls dist/kingmadoc-"$version".tar.gz dist/kingmadoc-"$version"-py3-none-any.whl
|
|
48
|
+
else
|
|
49
|
+
ls dist/kingmadoc-*.dev*-py3-none-any.whl
|
|
50
|
+
fi
|
|
32
51
|
- name: The wheel works on its own (skills and templates included)
|
|
33
52
|
run: |
|
|
34
53
|
python -m venv "$RUNNER_TEMP/venv"
|
|
@@ -36,9 +55,9 @@ jobs:
|
|
|
36
55
|
cd "$RUNNER_TEMP"
|
|
37
56
|
"$RUNNER_TEMP/venv/bin/kingmadoc" --version
|
|
38
57
|
"$RUNNER_TEMP/venv/bin/kingmadoc" plan "Release check." --no-input --stdout > /dev/null
|
|
39
|
-
"$RUNNER_TEMP/venv/bin/kingmadoc" skills install
|
|
58
|
+
"$RUNNER_TEMP/venv/bin/kingmadoc" skills install --no-vscode
|
|
40
59
|
test -f .claude/skills/explaining-code/SKILL.md
|
|
41
|
-
- uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a
|
|
60
|
+
- uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
|
|
42
61
|
with:
|
|
43
62
|
name: dist
|
|
44
63
|
path: dist/
|
|
@@ -52,23 +71,27 @@ jobs:
|
|
|
52
71
|
name: pypi
|
|
53
72
|
url: https://pypi.org/p/kingmadoc
|
|
54
73
|
permissions:
|
|
55
|
-
id-token: write
|
|
74
|
+
id-token: write # trusted publishing
|
|
56
75
|
steps:
|
|
57
|
-
- uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c
|
|
76
|
+
- uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
|
|
58
77
|
with:
|
|
59
78
|
name: dist
|
|
60
79
|
path: dist/
|
|
61
|
-
- uses: pypa/gh-action-pypi-publish@dc37677b2e1c63e2034f94d8a5b11f265b73ba33
|
|
80
|
+
- uses: pypa/gh-action-pypi-publish@dc37677b2e1c63e2034f94d8a5b11f265b73ba33 # v1.14.2
|
|
81
|
+
with:
|
|
82
|
+
# A re-run of the same commit builds the same version: not an error.
|
|
83
|
+
skip-existing: true
|
|
62
84
|
|
|
63
85
|
github-release:
|
|
64
86
|
name: GitHub release
|
|
65
87
|
needs: pypi
|
|
88
|
+
if: github.event_name == 'push'
|
|
66
89
|
runs-on: ubuntu-latest
|
|
67
90
|
permissions:
|
|
68
91
|
contents: write
|
|
69
92
|
steps:
|
|
70
|
-
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1
|
|
71
|
-
- uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c
|
|
93
|
+
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
|
94
|
+
- uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
|
|
72
95
|
with:
|
|
73
96
|
name: dist
|
|
74
97
|
path: dist/
|
|
@@ -7,6 +7,42 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
7
7
|
|
|
8
8
|
## [Unreleased]
|
|
9
9
|
|
|
10
|
+
### Changed
|
|
11
|
+
|
|
12
|
+
- Beta channel: every commit on `main` that passes CI is published to PyPI as a
|
|
13
|
+
development version (`0.3.0.devN`); follow it with
|
|
14
|
+
`pipx install --pip-args=--pre kingmadoc` and `pipx upgrade kingmadoc`.
|
|
15
|
+
- Fewer tokens for agents: `kingmadoc render` prints one line per document
|
|
16
|
+
(`--verbose` lists every image), `kingmadoc explain facts --only routes,data` prints
|
|
17
|
+
only the sections asked for, and `explaining-code` 5.6 works quietly, loads reference
|
|
18
|
+
sections on demand (each long reference starts with its contents), lets a subagent
|
|
19
|
+
read a big codebase and return a compact summary, fixes a figure by editing its
|
|
20
|
+
`.d2`, and hands over in at most five lines. The `kingmadoc` skill does not paste the
|
|
21
|
+
plan into the chat either.
|
|
22
|
+
- `kingmadoc skills install` asks in a terminal whether VS Code should open explainers
|
|
23
|
+
as a rendered preview (default yes); `--vscode` / `--no-vscode` answer up front, and
|
|
24
|
+
agents or pipes only get a tip. `kingmadoc render` says how to see the pictures
|
|
25
|
+
(Ctrl+Shift+V) while that setting is missing.
|
|
26
|
+
|
|
27
|
+
### Added
|
|
28
|
+
|
|
29
|
+
- `kingmadoc explain facts` lists private modules from the dominator tree of the module
|
|
30
|
+
graph (Python and JavaScript/TypeScript): what only one module leads to belongs to
|
|
31
|
+
it, which shows the real component boundaries. A single entry point is left out.
|
|
32
|
+
- `explaining-code` model "Algorithm": a flowchart, at most 15 lines of pseudocode, the
|
|
33
|
+
formula as `$$ … $$` (GitHub and VS Code render it), the invariant, the complexity and
|
|
34
|
+
a trace table on a small input.
|
|
35
|
+
|
|
36
|
+
### Fixed
|
|
37
|
+
|
|
38
|
+
- Dark mode: the C4 style of `explaining-code` (5.5) set black title text and white
|
|
39
|
+
boundaries and nodes, which were unreadable or glaring in dark mode. Titles and
|
|
40
|
+
labels now follow the theme and boundaries are transparent; `kingmadoc render` warns
|
|
41
|
+
about such styles in existing diagrams (fixed text colour without a fill, white
|
|
42
|
+
fills, a `sequence_diagram` whose container key shows as a heading).
|
|
43
|
+
- `kingmadoc render`: images get normal file permissions (0644) instead of D2's private
|
|
44
|
+
0600.
|
|
45
|
+
|
|
10
46
|
## [0.2.0] - 2026-09-27
|
|
11
47
|
|
|
12
48
|
Explain existing code with pictures, machine-readable plans, and a `verify` that
|
|
@@ -36,7 +36,7 @@ Flow for `plan "<description>"` (`cli.py`): `config.load_config` → `plan.analy
|
|
|
36
36
|
- `render.py` (`kingmadoc render <doc>`): renders each ```` ```d2 ```` block to `img/<doc>-<n>.svg` (D2 via `d2_binary.ensure_d2`), moves its source to `img/<doc>-<n>.d2`, and leaves only `<!-- kingmadoc:diagram img/<doc>-<n>.d2 -->` + the image in the document (the comment is invisible in previews; re-rendering reads the `.d2` files, so edit those). Converts the older `<details>` format. Renders everything to a temp dir first, so a failing diagram changes nothing.
|
|
37
37
|
- `d2_binary.py`: `ensure_d2` finds D2 (`KINGMADOC_D2`, PATH, cache) or downloads the pinned release once into the user cache; the SHA-256 per platform is pinned in `D2_ASSETS` (update version + all hashes together, cross-checked with the release's SHA256SUMS). `skills.py` + `kingmadoc skills install`: the skills in `skill/` ship as package data (hatch force-include) and are copied into the agent's skills dir; a `.kingmadoc-skill.json` manifest per skill folder records the installed hashes, so a reinstall updates unchanged files and only blocks local edits (`PREVIOUS_RELEASES` is the frozen hash list for installs from before the manifest).
|
|
38
38
|
- `skill/explaining-code/`: second product skill; explains existing code (feature, branch, project, part) with D2 pictures, one folder per subject `docs/explain/<NNNN>-<slug>/README.md` (`explain.py` + `kingmadoc explain new`: next ID, never reused, same subject reuses its folder; regenerates the index `docs/explain/README.md`, also after `render` of such a file; `explain status` → `freshness`: `git diff --relative --name-only <Based on commit>` over the paths the explainer names in code spans (else the whole project), excluding `docs/explain`; `render` names a README's images `figure-<n>`). `SKILL.md` = workflow and D2 examples; the formats are `reference/arc42.md` (default) and `reference/c4.md`, chosen by `explain.format`; `reference/split.md` for `explain.documents: split` (cover + `functional.md` + `technical.md`); `reference/c4-model.md` (Simon Brown's C4: abstractions, 7 diagrams, notation, D2 style block, checklist) and `reference/models.md` (decision table + rules + one example per other model). `tests/test_skill_explaining_code.py` checks its format and compiles every D2 example with the real `d2` when available (`D2_BIN`); `tests/test_skill_models.py` checks every example obeys its model's rules. D2 pitfalls: quote labels with `[`/`:`; `source-arrowhead` only works on `<->`.
|
|
39
|
-
- `facts/` (`kingmadoc explain facts`): pure parsers `projects.project_references` (.csproj) and `data_model.data_model` (EF Core via `DbSet<T>`, Prisma, Django, SQLAlchemy, TypeORM; regex, test files skipped) → frozen `Entity`/`Field`/`Relation`; `routes.routes` (ASP.NET controllers + minimal APIs, Next.js app/pages, Django urls + decorators, FastAPI, Flask, Express; `access` = what the code states), `services.services` (.NET DI), `js_modules.js_dependencies` (relative + tsconfig `paths` imports, `plan.dependencies.collapse` above 25 modules); `branch.branch_changes` (git I/O via `git.run_git`, merge base → working tree); `collect.collect_facts` reads files from the `CodebaseReport` and renders Markdown/JSON.
|
|
39
|
+
- `facts/` (`kingmadoc explain facts`): pure parsers `projects.project_references` (.csproj) and `data_model.data_model` (EF Core via `DbSet<T>`, Prisma, Django, SQLAlchemy, TypeORM; regex, test files skipped) → frozen `Entity`/`Field`/`Relation`; `routes.routes` (ASP.NET controllers + minimal APIs, Next.js app/pages, Django urls + decorators, FastAPI, Flask, Express; `access` = what the code states), `services.services` (.NET DI), `js_modules.js_dependencies` (relative + tsconfig `paths` imports, `plan.dependencies.collapse` above 25 modules, `max_nodes=None` for the raw graph), `dominators.private_modules` (Cooper–Harvey–Kennedy on the raw Python + JS graphs; virtual root above the modules nothing imports; a single entry point is left out); `branch.branch_changes` (git I/O via `git.run_git`, merge base → working tree); `collect.collect_facts` reads files from the `CodebaseReport` and renders Markdown/JSON.
|
|
40
40
|
- `plandoc.py` (not a mode; pure): the plan frontmatter (B2) and `REQ-n` requirements (B1): `check_plan` (every problem as a message), `parse_plan` → `PlanMeta`, `set_status` (frontmatter + header table). `kingmadoc check <slug>` / `approve <slug>` in `cli.py` use `verify.locate.find_plan`. The template renders the frontmatter from `PlanContext.slug/requirements/files_expected` (`generator.requirements_from_answers`: acceptance answer split on `;`/newlines; `files_from_answers`: existing paths only).
|
|
41
41
|
- `verify/` (`kingmadoc verify <slug> [--run-checks]`): `locate.find_plan` (bad slug / missing plan → `VerificationError`) → `changes.detect_changes` (git; base = parent of the commit that added the plan, else last commit before **Generated** + 59 s; working tree incl. untracked; the plan's folder ignored) → `deviations.find_deviations` (pure: draft plan with code = process, `files_expected` untouched / changes outside, `REQ-n` not mentioned in tests or commit messages, containers vs `planned_containers` from the plan text; the CLI passes `infer_containers` names since verify may not import plan) → `commands.detect_commands` (config `verify:` > Makefile > npm > cargo > go > dotnet > pytest/ruff) and `run_check` (no shell; only with `--run-checks`, never enabled by the repo's config) → `report.render_verify` + `verify_status`; the plan's status becomes `implemented`/`partial` unless draft or not verified (written together, `write_documents`). Modes may not import each other (E5, auto-checked), so shared I/O lives in `documents.py`.
|
|
42
42
|
- `diagrams/`: backend pattern, selected by `diagram_format` (`mermaid` default, `plantuml`, `d2`) via `diagrams.get_backend`. `base.py` has the `DiagramBackend` Protocol (`render_context/container/component/sequence/class`) and the shared pure model: `build_*` validate input, assign unique aliases and resolve relationships into frozen `Diagram`/`Node`/`Edge`. Backend modules (`mermaid.py`, `plantuml.py`, `d2.py`) only format that model and return a fenced block (templates must not add fences). Escaping differs per backend and is verified against the real tools: Mermaid `"`→`#quot;` (C4 titles drop `#`/`;`), PlantUML `"`→`<U+0022>`, D2 escapes `\`, `"`, `$`. Adding a backend: a module, an entry in `diagrams.BACKENDS` and `config.DIAGRAM_FORMATS`, snapshots via `KINGMADOC_UPDATE_SNAPSHOTS=1 pytest tests/test_diagram_backends.py`. Extra-doc templates pick their ER/flowchart placeholder by `diagram_format`. No knowledge of analysis: `generator.build_plan_context` maps analysis → C4 elements.
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.5
|
|
2
2
|
Name: kingmadoc
|
|
3
|
-
Version: 0.
|
|
3
|
+
Version: 0.3.0.dev7
|
|
4
4
|
Summary: Feature docs for AI coding agents: a plan with C4 diagrams before the code, a verification doc after.
|
|
5
5
|
Project-URL: Homepage, https://github.com/ATkingma/KingmaDoc
|
|
6
6
|
Project-URL: Issues, https://github.com/ATkingma/KingmaDoc/issues
|
|
@@ -75,16 +75,25 @@ for Claude Code, Cursor, Codex or GitHub Copilot.
|
|
|
75
75
|
Requires Python 3.11+.
|
|
76
76
|
|
|
77
77
|
```bash
|
|
78
|
-
pipx install
|
|
78
|
+
pipx install kingmadoc # from PyPI
|
|
79
|
+
pipx upgrade kingmadoc # later: update to the newest release
|
|
79
80
|
```
|
|
80
81
|
|
|
81
|
-
|
|
82
|
-
`
|
|
82
|
+
**Beta:** every commit on `main` that passes CI is published as a development version
|
|
83
|
+
(e.g. `0.3.0.dev12`). Plain installs ignore it; to follow the beta:
|
|
83
84
|
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
85
|
+
```bash
|
|
86
|
+
pipx install --pip-args=--pre kingmadoc # once (pipx remembers --pre)
|
|
87
|
+
pipx upgrade kingmadoc # later: the newest beta
|
|
88
|
+
```
|
|
89
|
+
|
|
90
|
+
For the latest commit instead of a release, install from GitHub with
|
|
91
|
+
`pipx install git+https://github.com/ATkingma/KingmaDoc` and update it with
|
|
92
|
+
`pipx reinstall kingmadoc`; `kingmadoc --version` then shows the commit
|
|
93
|
+
(`0.2.1.dev3 (git 1a2b3c4)`). (`pipx install --force` fails on recent pipx versions with
|
|
94
|
+
"Failed to create virtual environment" and keeps the old version.) An install from
|
|
95
|
+
before 0.2.0 came from GitHub: `pipx uninstall kingmadoc && pipx install kingmadoc`
|
|
96
|
+
switches it to the releases.
|
|
88
97
|
|
|
89
98
|
Then, in your project, install the agent skills; that's all:
|
|
90
99
|
|
|
@@ -98,15 +107,17 @@ them are updated; files you edited are kept (`--force` replaces them too).
|
|
|
98
107
|
|
|
99
108
|
Nothing else to install: the first `kingmadoc render` downloads the D2 diagram renderer by
|
|
100
109
|
itself (pinned version, checksum-verified; `KINGMADOC_D2_DOWNLOAD=0` turns that off).
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
110
|
+
VS Code opens a `.md` file as text, which shows no pictures. `kingmadoc skills install`
|
|
111
|
+
asks whether VS Code should open explainers (`docs/explain/`) as a rendered preview
|
|
112
|
+
instead, so you see the pictures right away (one setting in `.vscode/settings.json`;
|
|
113
|
+
`--vscode` / `--no-vscode` answer up front). Without it, press Ctrl+Shift+V in an
|
|
114
|
+
explainer. Visual Studio shows a preview by default. The pictures follow VS Code's light
|
|
115
|
+
or dark theme.
|
|
105
116
|
|
|
106
117
|
### pip
|
|
107
118
|
|
|
108
119
|
```bash
|
|
109
|
-
pip install
|
|
120
|
+
pip install kingmadoc # into the current environment
|
|
110
121
|
```
|
|
111
122
|
|
|
112
123
|
### Markdown-only (no Python)
|
|
@@ -21,16 +21,25 @@ for Claude Code, Cursor, Codex or GitHub Copilot.
|
|
|
21
21
|
Requires Python 3.11+.
|
|
22
22
|
|
|
23
23
|
```bash
|
|
24
|
-
pipx install
|
|
24
|
+
pipx install kingmadoc # from PyPI
|
|
25
|
+
pipx upgrade kingmadoc # later: update to the newest release
|
|
25
26
|
```
|
|
26
27
|
|
|
27
|
-
|
|
28
|
-
`
|
|
28
|
+
**Beta:** every commit on `main` that passes CI is published as a development version
|
|
29
|
+
(e.g. `0.3.0.dev12`). Plain installs ignore it; to follow the beta:
|
|
29
30
|
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
31
|
+
```bash
|
|
32
|
+
pipx install --pip-args=--pre kingmadoc # once (pipx remembers --pre)
|
|
33
|
+
pipx upgrade kingmadoc # later: the newest beta
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
For the latest commit instead of a release, install from GitHub with
|
|
37
|
+
`pipx install git+https://github.com/ATkingma/KingmaDoc` and update it with
|
|
38
|
+
`pipx reinstall kingmadoc`; `kingmadoc --version` then shows the commit
|
|
39
|
+
(`0.2.1.dev3 (git 1a2b3c4)`). (`pipx install --force` fails on recent pipx versions with
|
|
40
|
+
"Failed to create virtual environment" and keeps the old version.) An install from
|
|
41
|
+
before 0.2.0 came from GitHub: `pipx uninstall kingmadoc && pipx install kingmadoc`
|
|
42
|
+
switches it to the releases.
|
|
34
43
|
|
|
35
44
|
Then, in your project, install the agent skills; that's all:
|
|
36
45
|
|
|
@@ -44,15 +53,17 @@ them are updated; files you edited are kept (`--force` replaces them too).
|
|
|
44
53
|
|
|
45
54
|
Nothing else to install: the first `kingmadoc render` downloads the D2 diagram renderer by
|
|
46
55
|
itself (pinned version, checksum-verified; `KINGMADOC_D2_DOWNLOAD=0` turns that off).
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
56
|
+
VS Code opens a `.md` file as text, which shows no pictures. `kingmadoc skills install`
|
|
57
|
+
asks whether VS Code should open explainers (`docs/explain/`) as a rendered preview
|
|
58
|
+
instead, so you see the pictures right away (one setting in `.vscode/settings.json`;
|
|
59
|
+
`--vscode` / `--no-vscode` answer up front). Without it, press Ctrl+Shift+V in an
|
|
60
|
+
explainer. Visual Studio shows a preview by default. The pictures follow VS Code's light
|
|
61
|
+
or dark theme.
|
|
51
62
|
|
|
52
63
|
### pip
|
|
53
64
|
|
|
54
65
|
```bash
|
|
55
|
-
pip install
|
|
66
|
+
pip install kingmadoc # into the current environment
|
|
56
67
|
```
|
|
57
68
|
|
|
58
69
|
### Markdown-only (no Python)
|
|
@@ -20,6 +20,15 @@ git has a higher version than the one before. Never set the version by hand.
|
|
|
20
20
|
is the tag, installs the wheel and runs it (plan, skills install), publishes to PyPI,
|
|
21
21
|
and creates the GitHub release with the changelog section and the built files.
|
|
22
22
|
|
|
23
|
+
## Beta channel
|
|
24
|
+
|
|
25
|
+
`release.yml` also runs after every successful CI run on `main` and publishes that
|
|
26
|
+
commit's development version (`0.3.0.devN`) to PyPI with the same trusted publisher;
|
|
27
|
+
it creates no GitHub release. pip installs development versions only with `--pre`, so
|
|
28
|
+
`pipx install kingmadoc` keeps getting releases, and
|
|
29
|
+
`pipx install --pip-args=--pre kingmadoc` follows the beta. A re-run of the same commit
|
|
30
|
+
skips the upload (`skip-existing`). Pull requests never publish.
|
|
31
|
+
|
|
23
32
|
## Supply chain
|
|
24
33
|
|
|
25
34
|
- `uv.lock` pins the development dependencies; CI fails when it is out of date
|
|
@@ -23,9 +23,9 @@ every problem in the [results table](#results) at the end.
|
|
|
23
23
|
- [ ] Install the CLI (Python 3.11+) and check the version:
|
|
24
24
|
|
|
25
25
|
```bash
|
|
26
|
-
pipx install
|
|
27
|
-
pipx
|
|
28
|
-
kingmadoc --version
|
|
26
|
+
pipx install kingmadoc # first time (a release from PyPI)
|
|
27
|
+
pipx upgrade kingmadoc # update to the newest release
|
|
28
|
+
kingmadoc --version # shows the version (and the commit for a git install)
|
|
29
29
|
```
|
|
30
30
|
|
|
31
31
|
Do not update with `pipx install --force`: recent pipx versions (uv backend) fail with
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
{
|
|
2
|
+
"agent": "claude -p {request} --output-format json --max-turns 80 --allowedTools 'Read,Write,Edit,Glob,Grep,Skill,Bash(kingmadoc:*),Bash(git log:*),Bash(git diff:*),Bash(git status:*),Bash(git show:*),Bash(git branch:*),Bash(git rev-parse:*),Bash(ls:*)'",
|
|
3
|
+
"results": [
|
|
4
|
+
{
|
|
5
|
+
"scenario": "explain-feature",
|
|
6
|
+
"variant": "with skill",
|
|
7
|
+
"agent": {
|
|
8
|
+
"exit_code": 0,
|
|
9
|
+
"seconds": 94,
|
|
10
|
+
"total_cost_usd": 0.6629856000000001,
|
|
11
|
+
"num_turns": 12,
|
|
12
|
+
"reply": "aren't caught.\n5. Paying is a separate call, `POST /orders/<id>/pay/`. It only changes the status from `new` to `paid` and doesn't contact any payment provider. It only finds the customer's own orders, and paying an order that isn't `new` returns 409.\n6. The `shipped` status exists, but no code ever sets it.\n\n**Couldn't work out:** how users log in. There's no login route, and `settings.py` sets no `MIDDLEWARE`, so it's unclear where `request.user` comes from. If you tell me the intended setup, I'll add it to the explainer.\n\nTo see the diagrams in VS Code, open the file and press Ctrl+Shift+V."
|
|
13
|
+
},
|
|
14
|
+
"checks": [
|
|
15
|
+
{
|
|
16
|
+
"check": "exists docs/explain/0001-*/README.md",
|
|
17
|
+
"ok": true,
|
|
18
|
+
"detail": "docs/explain/0001-placing-an-order/README.md"
|
|
19
|
+
},
|
|
20
|
+
{
|
|
21
|
+
"check": "exists docs/explain/README.md",
|
|
22
|
+
"ok": true,
|
|
23
|
+
"detail": "docs/explain/README.md"
|
|
24
|
+
},
|
|
25
|
+
{
|
|
26
|
+
"check": "contains docs/explain/0001-*/README.md",
|
|
27
|
+
"ok": true,
|
|
28
|
+
"detail": "all present"
|
|
29
|
+
},
|
|
30
|
+
{
|
|
31
|
+
"check": "pictures_only docs/explain/0001-*/*.md",
|
|
32
|
+
"ok": true,
|
|
33
|
+
"detail": "6 images"
|
|
34
|
+
},
|
|
35
|
+
{
|
|
36
|
+
"check": "max_questions docs/explain/0001-*/README.md",
|
|
37
|
+
"ok": true,
|
|
38
|
+
"detail": "1 question(s)"
|
|
39
|
+
},
|
|
40
|
+
{
|
|
41
|
+
"check": "unchanged_outside [docs/, .claude/]",
|
|
42
|
+
"ok": true,
|
|
43
|
+
"detail": "14 change(s), all allowed"
|
|
44
|
+
}
|
|
45
|
+
],
|
|
46
|
+
"passed": 6,
|
|
47
|
+
"total": 6
|
|
48
|
+
},
|
|
49
|
+
{
|
|
50
|
+
"scenario": "explain-feature",
|
|
51
|
+
"variant": "with skill",
|
|
52
|
+
"agent": {
|
|
53
|
+
"exit_code": 0,
|
|
54
|
+
"seconds": 93,
|
|
55
|
+
"total_cost_usd": 0.6364946500000002,
|
|
56
|
+
"num_turns": 12,
|
|
57
|
+
"reply": " the status from `new` to `paid`. If the order isn't `new`, the caller gets 409. No payment provider is involved.\n\nStock is taken off when the order is placed, not when it's paid.\n\n**Things the code doesn't explain** (listed at the end of the explainer; tell me the answers and I'll add them):\n- **How do users log in?** `@login_required` needs session and authentication middleware, but `shop/settings.py` sets no `MIDDLEWARE` and there's no login route.\n- **What sets `shipped`, and what creates `Customer` rows?** No code does either.\n\nIn VS Code, Ctrl+Shift+V opens the preview with the pictures."
|
|
58
|
+
},
|
|
59
|
+
"checks": [
|
|
60
|
+
{
|
|
61
|
+
"check": "exists docs/explain/0001-*/README.md",
|
|
62
|
+
"ok": true,
|
|
63
|
+
"detail": "docs/explain/0001-placing-an-order/README.md"
|
|
64
|
+
},
|
|
65
|
+
{
|
|
66
|
+
"check": "exists docs/explain/README.md",
|
|
67
|
+
"ok": true,
|
|
68
|
+
"detail": "docs/explain/README.md"
|
|
69
|
+
},
|
|
70
|
+
{
|
|
71
|
+
"check": "contains docs/explain/0001-*/README.md",
|
|
72
|
+
"ok": true,
|
|
73
|
+
"detail": "all present"
|
|
74
|
+
},
|
|
75
|
+
{
|
|
76
|
+
"check": "pictures_only docs/explain/0001-*/*.md",
|
|
77
|
+
"ok": true,
|
|
78
|
+
"detail": "6 images"
|
|
79
|
+
},
|
|
80
|
+
{
|
|
81
|
+
"check": "max_questions docs/explain/0001-*/README.md",
|
|
82
|
+
"ok": true,
|
|
83
|
+
"detail": "2 question(s)"
|
|
84
|
+
},
|
|
85
|
+
{
|
|
86
|
+
"check": "unchanged_outside [docs/, .claude/]",
|
|
87
|
+
"ok": true,
|
|
88
|
+
"detail": "14 change(s), all allowed"
|
|
89
|
+
}
|
|
90
|
+
],
|
|
91
|
+
"passed": 6,
|
|
92
|
+
"total": 6
|
|
93
|
+
}
|
|
94
|
+
]
|
|
95
|
+
}
|
|
@@ -195,8 +195,8 @@ def prepare_workspace(scenario: dict[str, Any], target: Path, with_skills: bool)
|
|
|
195
195
|
_git(target, "commit", "-qm", f"Work on {branch['name']}")
|
|
196
196
|
if with_skills:
|
|
197
197
|
subprocess.run(
|
|
198
|
-
[_kingmadoc(), "skills", "install", "--root", str(target)],
|
|
199
|
-
check=True, capture_output=True,
|
|
198
|
+
[_kingmadoc(), "skills", "install", "--root", str(target), "--no-vscode"],
|
|
199
|
+
check=True, capture_output=True, stdin=subprocess.DEVNULL,
|
|
200
200
|
)
|
|
201
201
|
# The skills are part of the setup, not a change by the agent.
|
|
202
202
|
_git(target, "add", ".")
|
|
@@ -130,7 +130,8 @@ the diagrams, but never beyond what the user said or the code shows.
|
|
|
130
130
|
`<slug>-technical-design.md`
|
|
131
131
|
([format](reference/formats.md#technical-design-doc-docsfeaturesslug-technical-designmd)), in that
|
|
132
132
|
order. Fill in only what the answers and code support; leave the rest as TODOs.
|
|
133
|
-
2. Show the paths and a three-line summary (scope, biggest risk, open questions count)
|
|
133
|
+
2. Show the paths and a three-line summary (scope, biggest risk, open questions count);
|
|
134
|
+
do not paste the plan into the chat, and do not narrate while you work.
|
|
134
135
|
3. Ask the user to reply **yes** (approve), **edit <changes>**, or **stop**. On
|
|
135
136
|
**edit**, update the doc and ask again. On **yes**, run `kingmadoc approve <slug>`
|
|
136
137
|
(with the CLI; otherwise set `status: approved` in the frontmatter and **Status** to
|
|
@@ -130,7 +130,8 @@ the diagrams, but never beyond what the user said or the code shows.
|
|
|
130
130
|
`<slug>-technical-design.md`
|
|
131
131
|
([format](#technical-design-doc-docsfeaturesslug-technical-designmd)), in that
|
|
132
132
|
order. Fill in only what the answers and code support; leave the rest as TODOs.
|
|
133
|
-
2. Show the paths and a three-line summary (scope, biggest risk, open questions count)
|
|
133
|
+
2. Show the paths and a three-line summary (scope, biggest risk, open questions count);
|
|
134
|
+
do not paste the plan into the chat, and do not narrate while you work.
|
|
134
135
|
3. Ask the user to reply **yes** (approve), **edit <changes>**, or **stop**. On
|
|
135
136
|
**edit**, update the doc and ask again. On **yes**, run `kingmadoc approve <slug>`
|
|
136
137
|
(with the CLI; otherwise set `status: approved` in the frontmatter and **Status** to
|
|
@@ -130,7 +130,8 @@ the diagrams, but never beyond what the user said or the code shows.
|
|
|
130
130
|
`<slug>-technical-design.md`
|
|
131
131
|
([format](#technical-design-doc-docsfeaturesslug-technical-designmd)), in that
|
|
132
132
|
order. Fill in only what the answers and code support; leave the rest as TODOs.
|
|
133
|
-
2. Show the paths and a three-line summary (scope, biggest risk, open questions count)
|
|
133
|
+
2. Show the paths and a three-line summary (scope, biggest risk, open questions count);
|
|
134
|
+
do not paste the plan into the chat, and do not narrate while you work.
|
|
134
135
|
3. Ask the user to reply **yes** (approve), **edit <changes>**, or **stop**. On
|
|
135
136
|
**edit**, update the doc and ask again. On **yes**, run `kingmadoc approve <slug>`
|
|
136
137
|
(with the CLI; otherwise set `status: approved` in the frontmatter and **Status** to
|
|
@@ -131,7 +131,8 @@ the diagrams, but never beyond what the user said or the code shows.
|
|
|
131
131
|
`<slug>-technical-design.md`
|
|
132
132
|
([format](#technical-design-doc-docsfeaturesslug-technical-designmd)), in that
|
|
133
133
|
order. Fill in only what the answers and code support; leave the rest as TODOs.
|
|
134
|
-
2. Show the paths and a three-line summary (scope, biggest risk, open questions count)
|
|
134
|
+
2. Show the paths and a three-line summary (scope, biggest risk, open questions count);
|
|
135
|
+
do not paste the plan into the chat, and do not narrate while you work.
|
|
135
136
|
3. Ask the user to reply **yes** (approve), **edit <changes>**, or **stop**. On
|
|
136
137
|
**edit**, update the doc and ask again. On **yes**, run `kingmadoc approve <slug>`
|
|
137
138
|
(with the CLI; otherwise set `status: approved` in the frontmatter and **Status** to
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: explaining-code
|
|
3
3
|
description: "Explains existing code with rendered diagrams (C4 in Simon Brown's notation; UML sequence, state, class, activity, use case; ER; data flow) and short tables, as an arc42 or compact C4 document, one file or split into functional and technical. Fixes code blindness, e.g. after an agent wrote the code. Scope: a feature, a branch or PR, a whole project, or a folder, service or module. Use when the user asks to explain, describe, document, map, diagram, draw, visualise or give an overview of existing code or architecture; asks how something works, what it does, how the parts fit together, where something happens, or what a branch, PR, commit or task changed; wants onboarding, a walkthrough, a codebase tour, an architecture or design document, arc42, C4, UML, sequence, ER or deployment diagrams of existing code; or no longer understands the code. The request may be in any language. Not for features that are not built yet."
|
|
4
|
-
version: 5.
|
|
4
|
+
version: 5.6.0
|
|
5
5
|
allowed-tools: [Read, Write, Glob, Grep, Bash]
|
|
6
6
|
---
|
|
7
7
|
|
|
@@ -54,6 +54,27 @@ Rules:
|
|
|
54
54
|
- Never invent. If something essential cannot be worked out, ask at most three
|
|
55
55
|
questions (Step 6).
|
|
56
56
|
|
|
57
|
+
## Working efficiently
|
|
58
|
+
|
|
59
|
+
The context window is shared with the user's work; keep what you load and say small.
|
|
60
|
+
|
|
61
|
+
- **Work quietly.** No running commentary, no file contents, D2 sources or draft text in
|
|
62
|
+
the chat. Speak only to ask (Step 1, at most three questions in Step 6) or to hand
|
|
63
|
+
over (Step 6).
|
|
64
|
+
- **Load on demand.** Read the format file you write, and in
|
|
65
|
+
[reference/c4-model.md](reference/c4-model.md) and
|
|
66
|
+
[reference/models.md](reference/models.md) only the sections of the models you draw:
|
|
67
|
+
each reference starts with a table of contents.
|
|
68
|
+
- **Facts before files.** `kingmadoc explain facts --only <sections>` (e.g.
|
|
69
|
+
`routes,data`) gives just the part you need; read source files only for what the facts
|
|
70
|
+
cannot show.
|
|
71
|
+
- **Big codebase** (several services, or more than about 100 source files): let a
|
|
72
|
+
subagent read the code if your agent can run one (in Claude Code: the Explore agent),
|
|
73
|
+
and have it return a compact list of containers, components, flows and data with
|
|
74
|
+
their paths (about 1,500 tokens), not the files themselves.
|
|
75
|
+
- **Fix, don't rewrite.** When a diagram fails to render or needs a change, edit its
|
|
76
|
+
`img/*.d2` file and render again; do not re-read or rewrite the whole document.
|
|
77
|
+
|
|
57
78
|
## Step 1. Pin down the scope, the format and the documents
|
|
58
79
|
|
|
59
80
|
Decide the scope (table above). If it is unclear what is meant, search first and ask one
|
|
@@ -92,7 +113,8 @@ kingmadoc explain facts --base main # a branch: plus its commits and changed
|
|
|
92
113
|
```
|
|
93
114
|
|
|
94
115
|
Draw from them and never contradict them: the project references and module
|
|
95
|
-
dependencies are the arrows between containers and components, the
|
|
116
|
+
dependencies are the arrows between containers and components, the private modules
|
|
117
|
+
(dominator tree: everything only one module leads to) are its components' boundaries, the routes and access
|
|
96
118
|
table is the source for routes and permissions, the DI services name the components,
|
|
97
119
|
the data model is the ER diagram's source, the changed files are what a branch explains. (No `explain` command: update KingmaDoc, see Step 5.)
|
|
98
120
|
|
|
@@ -138,6 +160,9 @@ Write every diagram in **D2** (Step 5 turns them into images).
|
|
|
138
160
|
says: e.g. arc42 section 6 for flows and lifecycles, section 8 for data and domain.
|
|
139
161
|
4. **Readable in dark mode:** the images follow the viewer's light or dark theme. Give
|
|
140
162
|
every shape you fill (`fill:`) a `font-color` too, and black dots a grey `stroke`.
|
|
163
|
+
Never set a `font-color` without a fill (titles, labels: the theme picks the colour),
|
|
164
|
+
and never fill white: boundaries and nodes are `fill: transparent`. Put
|
|
165
|
+
`shape: sequence_diagram` at the top level, or give its container the label `""`.
|
|
141
166
|
|
|
142
167
|
For a **branch**, mark changes by border, so the C4 colours stay meaningful, and add
|
|
143
168
|
both to the legend:
|
|
@@ -197,7 +222,7 @@ on the PATH: `kingmadoc render` does not need it.
|
|
|
197
222
|
|
|
198
223
|
- A diagram D2 rejects: fix it and run again.
|
|
199
224
|
- `kingmadoc` has no `render` command: it is outdated; ask the user to update it with
|
|
200
|
-
`pipx
|
|
225
|
+
`pipx upgrade kingmadoc` (installed from GitHub: `pipx reinstall kingmadoc`), then render.
|
|
201
226
|
- `kingmadoc` is not installed at all: render with `d2` if it happens to be available
|
|
202
227
|
(save each diagram as `img/figure-<n>.d2` in the subject's folder, run
|
|
203
228
|
`d2 --pad 20 <that>.d2 <that>.svg`, and replace the block with
|
|
@@ -208,7 +233,9 @@ on the PATH: `kingmadoc render` does not need it.
|
|
|
208
233
|
|
|
209
234
|
Go through the checklist of each figure's model (end of
|
|
210
235
|
[reference/c4-model.md](reference/c4-model.md) and [reference/models.md](reference/models.md))
|
|
211
|
-
and fix what fails
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
236
|
+
and fix what fails; check that the document embeds every image. Then hand over in at most five lines:
|
|
237
|
+
the path, one or two sentences on what the system is, the number of figures, and the
|
|
238
|
+
"Couldn't work out" questions (at most three), which you then answer into the explainer.
|
|
239
|
+
Do not paste the explainer or its figures into the chat. If VS Code opens it as text,
|
|
240
|
+
say once that Ctrl+Shift+V shows the pictures, or `kingmadoc skills install --vscode`
|
|
241
|
+
always does; never run that without the user's consent.
|
|
@@ -1,5 +1,11 @@
|
|
|
1
1
|
# Format: arc42 (default)
|
|
2
2
|
|
|
3
|
+
Contents: Output format · What changed (branch only) · 1. Introduction and goals · 2.
|
|
4
|
+
Constraints · 3. Context and scope · 4. Solution strategy · 5. Building block view · 6.
|
|
5
|
+
Runtime view · 7. Deployment view · 8. Cross-cutting concepts · 9. Architecture
|
|
6
|
+
decisions · 10. Quality requirements · 11. Risks and technical debt · 12. Glossary ·
|
|
7
|
+
Appendix: where to find what · Couldn't work out (optional, at most three).
|
|
8
|
+
|
|
3
9
|
The default explainer format (`explain: {format: arc42}` in `.featuredoc.yml`): the
|
|
4
10
|
twelve sections of the arc42 architecture template, each a figure or a table with a short
|
|
5
11
|
explanation. Follow the rules in `../SKILL.md` (numbered figures, tables that decode
|
|
@@ -57,7 +63,7 @@ Text in `<angle brackets>` is filled in; leave out subsections marked optional.
|
|
|
57
63
|
| **Scope** | <feature / branch `<branch>` vs `<base>` / project / part `<path>`> |
|
|
58
64
|
| **Stack** | <languages, frameworks, data stores> |
|
|
59
65
|
| **Entry points** | <`path`, …> |
|
|
60
|
-
| **Based on** | <commit hash (branch)> · <ISO date> · KingmaDoc skill explaining-code 5.
|
|
66
|
+
| **Based on** | <commit hash (branch)> · <ISO date> · KingmaDoc skill explaining-code 5.6.0 (arc42) |
|
|
61
67
|
|
|
62
68
|
## What changed (branch only)
|
|
63
69
|
|