pmkit / reference
Command conventions
Every /pmkit:* command applies these rules. Read this file before the first step of any command. The commands do not repeat it.
Rules
- Read the config first. Load
.pmkit/config.yamland the capability manifest. If either is missing, stop and offer/pmkit:setup. - Talk in categories and call in operations. Commands use the common model (status categories, issue fields) and the CLI commands. They never use adapter details.
- Confirm by risk, as the write policy below says. Reads run freely.
- Say which path was used. When a result is derived or degraded, say so in one line, for example "velocity computed from the last 3 sprints". The CLI prints the line as
note:. Repeat it, do not rephrase it. - Keep the output short. Lead with the answer. Show a list of issues as a table. Write every issue ID in full so the user can copy it.
- Fail with a next step. An error names what went wrong and what to do, for example "no sprint is active; create one with
/pmkit:cycle:plan".
Write policy
Reads run freely. A single write shows before → after (from --dry-run) and asks once. A bulk change (more than one record), an archive, a scope move or a published status update shows a full preview first. write_policy.confirm: none skips the single-write question, never the preview of a bulk change (builder's call).
How to show a write
- Run the CLI command with
--dry-run --json. Nothing changes on disk. - Show the
beforeandafterof each record, field by field, and only the fields that change. For a create, show the new record. - Ask with
AskUserQuestion, followingwrite_policy.confirmin.pmkit/config.yaml. A bulk change, an archive, a scope move or a published status update always shows the full preview and asks, whateverconfirmsays. - When the user approves, run the same command again without
--dry-run. When the user declines, stop and change nothing.
Reading errors
Every CLI call ends with --json. On a failure the CLI exits with code 2 and prints { "error": { "code", "message", "nextStep" } }.
- Show
error.messageas it is. - Show
error.nextStepas the thing to do next, and offer to run it when it is a command. NOT_CONFIGUREDwith anerror.mappingslist means.pmkit/config.yamlmaps a team, status, field or label that the tracker no longer has. Stop the command before any other call. Show theproblemof each item. Ask once withAskUserQuestionwhether to run/pmkit:setupnow, which asks again only for these mappings. Never pick a replacement yourself, and do not retry the call.- Use
error.codeto decide what to do.NOT_CONFIGUREDmeans offer/pmkit:setup.NOT_FOUNDandINVALID_INPUTmean ask the user for a corrected value. Do not retry the same call. - An error whose
error.messagestarts with.pmkit/config.yaml is not validcomes from a broken config file, not from a value the user typed. Check for it before theINVALID_INPUTrule above, which asks the user for a corrected value. Stop that write and do not retry it. Showerror.messageas it is, and offerpmkit validateto list the problems and/pmkit:local:doctorto fix them. Then go on with the command's reads, if it has any. While the file stays broken, every write and dry run fails with this error, and reads printwarning: .pmkit/config.yaml is not valid, so writes are refused: ...on stderr. Show that warning once. If a read fails with this error too, the CLI cannot find the tracker, so stop the command. - Never hide an error or guess a fix.
Issue tables
A list of issues is a table with these columns, in this order: ID, title, status, assignee, estimate. Leave a cell empty when the issue has no value for it. A command may add a column its result needs, after these five.
Rows go in creation order, oldest first, unless the user asks for another order. A command that picks issues from a list, such as a recommended next issue or a sprint scope, also goes in creation order.
The tracker files
Commands never edit files under .issues/ by hand. Every change goes through a pmkit.mjs command, which validates the change and records an event. The one exception is /pmkit:local:doctor, which resolves git conflict markers file by file after the user approves each edit.