Skip to content
python-cmd2Public

About

Design specifications and implementation plans for cmd2

Resources

Security policy

Stars

1 star

Watchers

0 watching

Forks

Repository files navigation

cmd2 design documents

Design specifications and implementation plans for cmd2.

This repository holds the written thinking behind larger pieces of cmd2 work: what a change is for, the approaches which were weighed, what was decided and why, how the work was staged, and what each stage found. The cmd2 code, its user documentation and its changelog are in the cmd2 repository.

Keeping these documents here, and not in the cmd2 repository, keeps working documents out of the library's history and its releases, while still giving them a history of their own and a place where they can be reviewed.

How the documents are written: Superpowers

The expectation is that anyone working on these documents does so with an AI coding agent which has the Superpowers skills installed. Superpowers is a set of skills which give an agent a method: find out what is wanted before building, write the design down, plan from the approved design, carry the plan out with tests first, and check before claiming. The documents here are what that method produces, and they are created, reviewed, revised and acted on with it.

Step Skill What it leaves here
Work out what is wanted and how to build it, and get the design approved brainstorming A design specification in specs/
Turn the approved design into steps a builder can follow writing-plans An implementation plan in plans/
Carry the plan out in the cmd2 repository executing-plans or subagent-driven-development, with test-driven-development Notes on each stage, in a directory beside the plan
Review a document or the work, and answer a review requesting-code-review, receiving-code-review Changes to the document which was reviewed
Check before saying that something is done verification-before-completion What was run and what it showed, in the notes

Two things follow from this for a reader:

  • A document is written to be acted on by an agent as well as read by a person. It states what was decided and why, what was actually run and seen, and what was not verified, so that whoever picks it up next does not have to rediscover any of it.
  • By default the skills put a design or a plan inside the project it is about. For cmd2 they go here instead, and AGENTS.md tells an agent so. That file is the guidance for agents working in this repository; CLAUDE.md imports it for Claude Code.

See the Superpowers repository for how to install it in your agent.

What is here

Directory What it holds
specs/ Design specifications. One for each piece of work: the intent, the goals and non-goals, the constraints, the approaches considered, the design which was chosen, and how it is to be tested.
plans/ Implementation plans. The notes written while a plan's stages were carried out, which say what each stage did and what evidence it left, are in a directory beside the plan.
plans/toolbar-flicker-harness/ The test harness which the toolbar's plans and notes rely on for their measurements. It is the one body of code here: see its README.
tests/ Checks on the documents themselves: that links resolve, that tables are well formed, and that nothing names a home directory.

A file is named for the day it was begun and for its subject, YYYY-MM-DD-subject.md, so that a directory lists in the order things happened. A specification and the plans which carry it out share a subject and refer to each other. The notes of a plan's stages are kept together in a directory named for the plan's day and subject, YYYY-MM-DD-subject-stage-notes/.

Documents

Work Specifications Plans and records
A bottom toolbar which stays on the screen without flickering Bottom toolbar flicker, then Persistent bottom toolbar through reserved terminal rows The implementation plan and its stage notes; a wrap-up plan; notes on a prototype hosted in Textual; and the test harness
An example application with a built-in MCP server (cmd2 issue 1852) An example cmd2 application with a built-in MCP server Not yet written

Reading the older documents

The documents dated up to 1 December 2026 were written before this repository existed, when they were kept in a directory on their author's machine. They are here as they were written, apart from formatting and three small corrections: a path which named a home directory is written with ~, one table cell had a | escaped so that its table renders, and a link from one document of this repository to another points at where that document is now. So:

  • A path such as ~/.superpowers/specs/... or ~/.superpowers/plans/... in one of them means specs/... or plans/... here. The toolbar's stage notes are one level further down, in plans/2026-09-07-reserved-row-stage-notes/.
  • The plans for the toolbar refer to a test harness, toolbar-flicker-harness, and to the records of its runs under runs/. The harness is here. Of the run records, only the result.json files which a document links to are here; the rest, about 37 MB of captured output, were not kept in this repository.
  • A path such as ~/src/python/cmd2 is a checkout of the cmd2 repository.
  • A few links point to documents which were not kept, such as the reviews of the reserved-row specification. tests/test_documents.py lists them.

Working here

You need uv, and, to format documents from an editor or with make format, Node.js with npm.

make install   # create the environment, install the Git hooks and Prettier (one time)
make check     # check formatting, spelling, lint and types
make test      # check the documents' links and tables, and test the harness
make format    # format the code with ruff and the documents with Prettier
make help      # list all targets

make check and make test must both pass before a change is committed. GitHub Actions runs the same on every pull request and on every push to main, in three workflows:

Workflow What it runs
Quality The prek hooks: Prettier for Markdown, YAML and JSON, with prose wrapped at 100 characters as in the cmd2 repository; typos for spelling; ruff to format and lint the code, and to format the Python inside a document's code blocks; and a few general checks
TypeCheck ty on the harness and the tests
Tests pytest: the checks on the documents in tests/, and the harness's own tests

The version of Prettier is set in two places, .pre-commit-config.yaml for the checks and package.json for make format and editors. Change both together: two versions can lay the same table out differently, and then the check and the format disagree.

In a table, write a | inside a cell as \|, even inside a code span. Otherwise it divides the cell, and the table may not render.

The code

The harness is held to what the cmd2 repository asks of its own tests: ruff with the same rules (ruff.toml began as a copy of cmd2's), and ty. Its tests run its controls, check that each control fails when the fault it guards against is put in, and check the function which decides which cmd2 checkout a run measures. They do not drive a terminal or a cmd2 application: the harness does that against a cmd2 checkout, by hand, as its README describes.

The harness imports cmd2's reserved-row toolbar, which is on the reserved_row_toolbar branch of cmd2 and in no release, so pyproject.toml takes cmd2 from that branch and uv.lock records the commit. Move it on with uv lock --upgrade-package cmd2.

Conventions

  • Documents are Markdown. The harness is the only code, and code which is not part of a document's evidence belongs in the cmd2 repository.
  • Name a new file YYYY-MM-DD-subject.md, in specs/ or in plans/.
  • Put the notes of a plan's stages in plans/YYYY-MM-DD-subject-stage-notes/, beside the plan.
  • Link to another document by its path from the document which links to it, so that the link works on GitHub.
  • Nothing private goes in a document or in code: no credentials, no personal details, and no path which names a person's home directory. Write ~.

License

The documents and the code are under the MIT License, as cmd2 is.

About

Design specifications and implementation plans for cmd2

Resources

Security policy

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Used by

Contributors

Languages