命令
实现计划套件流水线的斜杠命令定义,外加用于代码、架构、安全、依赖与文档评审的审计。
斜杠命令定义以扁平 .md 文件的形式存放在 src/apothem/commands/ 下。规范集合以具备架构感知的计划套件流水线为首,它以八个一等阶段命令的形式交付,各自可直接以 /plan-<stage> 的形式调用,外加 /plan——端到端驱动阶段链的编排器。每个阶段都是位于 src/apothem/commands/plan-<stage>.md 的、独立注册的命令文件,而 /plan 不重新实现其中任何一个。
| 调用 | 命令文件 | 说明 |
|---|---|---|
/plan | src/apothem/commands/plan.md | 将 spec、generate、review 与 design 阶段作为一个经过验证的工作流运行,并在每次移交时进行确认;execute 仍是一个手动步骤 |
/plan-spec | src/apothem/commands/plan-spec.md | 将非结构化内容精炼为规格级的散文 |
/plan-generate | src/apothem/commands/plan-generate.md | 依据散文 / 需求物化一个计划套件 |
/plan-review | src/apothem/commands/plan-review.md | 带记分卡的取证式审计 |
/plan-design | src/apothem/commands/plan-design.md | 为承载架构的套件生成 _inputs/design.md |
/plan-execute | src/apothem/commands/plan-execute.md | 在质量闸门下执行一个阶段 |
/plan-status | src/apothem/commands/plan-status.md | 只读的进度报告 |
/plan-amend | src/apothem/commands/plan-amend.md | 修订、扩展、精炼或回退一个现有套件,而不丢失已解决的决策 |
/plan-audit | src/apothem/commands/plan-audit.md | 对 spec → generate → review 进行带主动补救的闭环封装(正交,先于 execute) |
在计划流水线之外,面向整个项目的工具命令也随之交付——用于焕新与发布的 /freshify、/github-deploy-fresh、/github-deploy-next 和 /elevate;用于多智能体评审与编排的 /audit、/fortress 和 /workflow;用于聊天应用 Project 提升的 /projectify——另外还有十一项审计/评审扫查(code-review、code-audit、architecture-review、docs-review、security-audit、dependency-audit、supply-chain-audit、threat-model-audit、perf-audit、a11y-audit、ux-review)以及 /research 流水线:
| 调用 | 命令文件 | 说明 |
|---|---|---|
/freshify | src/apothem/commands/freshify.md | 将项目呈现为全新、无痕迹且可投入生产的状态;每个破坏性步骤都以确认为闸门 |
/github-deploy-fresh | src/apothem/commands/github-deploy-fresh.md | /freshify 的 GitHub 特化版本,产出单个全新的首版发布 |
/github-deploy-next | src/apothem/commands/github-deploy-next.md | 在 GitHub 发布表面上运行一次完整的下一版发布周期 |
/elevate | src/apothem/commands/elevate.md | 通过独立的批评智能体将项目的每个表面提升至当前 SOTA,然后移交给 /freshify |
完整的、作为事实来源的命令集——包括每一项审计评审扫查——就是本页底部生成的清单。
Frontmatter 契约
每个命令文件都携带规范的八键 frontmatter。机器可读的契约是 command.schema.json(additionalProperties: false);以下代码块与其保持一致:
---
name: <slash-command name without leading slash>
version: <semver>
updated: <YYYY-MM-DD>
description: <one-line role>
argument-hint: <placeholder for the slash-command argument>
disable-model-invocation: <true | false>
portability: <portability classification, e.g. universal>
allowed-tools: <comma-separated read-only tools and scoped rules, e.g. "Read, Glob, Grep" or "Read, Bash(git log *)">
---校验器的 frontmatter-cohort 检查(Command 分支)会在每个命令文件上验证该契约。allowed-tools 列出命令处于活动状态时,工具可以不经询问就运行的那些工具,因此它默认保持只读:有副作用的工具(Bash、PowerShell、Write、Edit、NotebookEdit、WebFetch)只能以作用域规则的形式出现,例如 Bash(git log *),而裸的 "*" 通配符会被 schema 拒绝。具有不可逆副作用或由操作者选定时机的命令设置 disable-model-invocation: true,因此只有操作者才能启动它们:freshify、github-deploy-fresh、github-deploy-next、release-readiness、elevate、fortress、workflow、plan-execute、research-experiment 和 research-publish。其余 35 个命令设置 false,并依据其描述与请求进行匹配。
编写纪律
- 自包含的工作流。 每个命令的正文都以编号步骤列出工作流,以便助手能够从冷启动开始执行。
- Bindings 区块。 每个命令都以规范的五方向 Bindings 区块结尾。
- 仅使用领域语言。 正文中不包含计划内部引用。
生成的命令清单
| Name | Description | Source |
|---|---|---|
README | Slash-command definitions — flat .md files, each defining one /command-name invocable. A command file's YAML frontmatter declares the command's identity and argument surface; i | src/apothem/commands/README.md |
a11y-audit | Audits rendered pages of a web surface against WCAG 2.2 AA and reports severity-ranked findings per page, without fixing anything. Use when the user asks to 'audit accessibility', 'check WCAG compliance', or 'find keyboard or contrast problems'. Not for visual design critique (design-critic). | src/apothem/commands/a11y-audit.md |
architecture-review | Reviews a repository against its design document and layer rules, reporting boundary violations, coupling and wiring gaps as ranked findings. Use when the user asks to 'review the architecture', 'check layer boundaries', or 'compare code to the design'. Not for per-file style (code-review). | src/apothem/commands/architecture-review.md |
audit | Sweeps a repository across all eleven review dimensions in one multi-agent run and returns one verified, severity-ranked report; it never fixes anything. Use when the user asks to 'audit the whole repo', 'run every review', or 'full audit'. For a single dimension use that dimension's own review. | src/apothem/commands/audit.md |
code-audit | Cross-file forensic audit: hidden coupling, type-hint gaps, coverage holes, dead and duplicate code. Use when the user asks to 'find hidden coupling', 'find dead code' or 'check cross-file consistency'. Not per-file style (code-review), layer rules (architecture-review) or a full sweep (audit). | src/apothem/commands/code-audit.md |
code-review | Reviews source files one at a time for readability, naming, complexity, idiom fit and comment quality, and reports severity-ranked findings without editing. Use when the user asks to 'review the code', 'check code quality', or 'review these files'. Not for cross-file issues (code-audit). | src/apothem/commands/code-review.md |
dependency-audit | Audits direct and transitive dependencies for known vulnerabilities, license conflicts, deprecation and loose pins, ranking findings per dependency. Use when the user asks to 'audit dependencies' or 'review licenses'. Not for one named CVE (vuln-triage) or release signing (supply-chain-audit). | src/apothem/commands/dependency-audit.md |
docs-review | Reviews documentation pages for prose clarity, broken links, code-block tags, citations and public-API coverage, reporting severity-ranked findings per page. Use when the user asks to 'review the docs', 'check documentation quality', or 'find broken doc links'. Does not rewrite pages. | src/apothem/commands/docs-review.md |
elevate | Whole-repository elevation: runs the audit sweep, then critiques naming, structure, storytelling and extensibility, remediates what it finds (deletions are confirmation-gated), propagates each change and hands off to freshify. A long multi-pass run that edits files, so it runs only when the user invokes it; bound it with --dimensions or --max-passes. | src/apothem/commands/elevate.md |
eval | Runs one evaluation campaign for a language model or prompt: scores each output over a dataset and reports metrics by category plus regressions against a baseline. Use when the user asks to 'run an eval campaign', 'evaluate this prompt' or 'check for regressions'. A reusable harness is eval-harness. | src/apothem/commands/eval.md |
fortress | Hardens a repository end to end: runs the audit sweep, verifies each finding, remediates survivors through the surgical-guard, secret-rotation and vuln-triage skills, re-audits within --max-rounds, then gates through release-readiness and reports one next move. Runs only when the user invokes it; every irreversible step is confirmed. | src/apothem/commands/fortress.md |
freshify | Use when a repository must be made fresh and release-clean: purges caches and stale artifacts, removes legacy narrative and back-references, normalizes file and folder names, keeps a current-version-only changelog, and drives quality gates green. Forge-agnostic. Runs only when the user invokes it; every destructive step is confirmation-gated. | src/apothem/commands/freshify.md |
github-deploy-fresh | Use when a GitHub repository needs one clean first release on origin/main: a single v0.1.0 release commit, green workflow cards, a first-version changelog, and no residual runs, branches, tags, releases or history. Builds on freshify. Runs only when the user invokes it; every destructive step is confirmed. | src/apothem/commands/github-deploy-fresh.md |
github-deploy-next | Use to run the next release cycle on a GitHub repository: merge ready pull requests, resolve the issues the release addresses, derive the SemVer bump from commits, roll the changelog, and publish a signed tag with release notes. For the first release use github-deploy-fresh. Runs only when the user invokes it; merge and publish are confirmed. | src/apothem/commands/github-deploy-next.md |
perf-audit | Audits an Apothem installation's per-class budgets (hooks, ecosystem verification, conformity gate, tests, agents, shell, lint) with its benchmark drivers, ranking findings HIGH, MEDIUM or LOW. Use for 'audit performance' or 'check the performance budgets' on an Apothem tree. Measures only. | src/apothem/commands/perf-audit.md |
plan-amend | Changes an existing plan suite without losing resolved decisions, re-deriving only the affected spec, phases and notes. Use when the user asks to 'amend the plan', 'add a phase to the plan' or 'revert a plan change'. Needs an existing suite; to create one use plan-generate. | src/apothem/commands/plan-amend.md |
plan-audit | Audits a plan suite across spec, generate and review, then fixes findings in a loop without per-revision approval until none remain or the cap is hit. Use for 'audit and fix the plan', 'get the plan suite to zero findings' or 'loop until the plan is clean'. Approve revisions first: plan-review. | src/apothem/commands/plan-audit.md |
plan-design | Writes the architectural design for a reviewed plan suite at _inputs/design.md: components, interfaces, decisions and diagrams. Use for 'design the architecture for this plan' or 'write the design doc for the suite'. Runs after plan-review, only for suites with architecture-bearing surfaces. | src/apothem/commands/plan-design.md |
plan-execute | Use to implement one phase of a reviewed plan suite: reads the phase file and progress notes, verifies prerequisites and review scorecards, implements each task with per-task commits, runs quality gates, and writes the phase report. Runs only when the user invokes it, because it changes code and commits. | src/apothem/commands/plan-execute.md |
plan-generate | Generates a full plan suite (master plan, progress log, decision notes, per-phase files) from a written spec or raw prose. Use when the user asks to 'generate the plan suite', 'turn this spec into a phased plan', or 'break this project into phases'. Not for refining prose (plan-spec). | src/apothem/commands/plan-generate.md |
plan-review | Reads an existing plan suite line by line for fidelity, consistency, completeness and risk, then applies only the revisions the user approves. Use when the user asks to 'review the plan', 'check the phases for gaps' or 'is the plan complete'. Writes no new plan; unattended fix loop: plan-audit. | src/apothem/commands/plan-review.md |
plan-spec | Turns free-form prose, notes or rough requirements into a spec-grade _spec/spec.md that keeps the author's wording and settles open questions by inquiry. Use when the user asks to 'turn these notes into a spec', 'refine these requirements' or 'prepare this for planning'. Research: research-spec. | src/apothem/commands/plan-spec.md |
plan-status | Reports plan-suite progress from its tracking files across tasks, phases and artifacts, read-only. Use when the user asks 'where are we on the plan', 'show plan status', or 'what is left in the phases'. Changes no files; --verbose adds a health grade and spot checks. | src/apothem/commands/plan-status.md |
plan | Runs the planning pipeline (spec, generate, review, design) with independent verification, confirming at each hand-off; execute stays a manual step the operator runs. Use when the user asks to 'plan this end to end' or 'run the full plan pipeline'. For one stage, use that stage's command. | src/apothem/commands/plan.md |
projectify | Builds the Description, Instruction and knowledge files for a chat-app Project or custom assistant through guided questions, within the platform's context budget. Use when the user asks to 'projectify this', 'write the project instructions', or 'set up a custom assistant'. | src/apothem/commands/projectify.md |
release-readiness | Pre-release gate sweep: use before shipping a repository to check lint, format, types, tests, dependency and supply-chain risk, visibility surfaces, changelog and version-to-tag consistency. Writes a READY or BLOCKED verdict with a blocking list to _inputs/release-readiness-findings.md. Manual only. | src/apothem/commands/release-readiness.md |
research-analysis | Runs the preregistered statistical analysis on collected data: effect sizes with confidence intervals, multiple-comparison correction, robustness checks, deviation log. Use when the user asks to 'run the preregistered analysis' or 'compute effect sizes and CIs'. | src/apothem/commands/research-analysis.md |
research-design | Turns a synthesized research gap into testable predictions, a study design and a frozen preregistration. Use when the user asks to 'design the experiment', 'run the power analysis', or 'preregister the plan'. Writes study-design.md and preregistration.md; collects no data. | src/apothem/commands/research-design.md |
research-disseminate | Plans post-acceptance dissemination and impact: preprint announcement, FAIR data and code archive, altmetrics tracking, rebuttal loop. Use when the user asks to 'plan the dissemination', 'archive the data and code', or 'draft the reviewer rebuttal'. Stops at a plan; the user posts. | src/apothem/commands/research-disseminate.md |
research-experiment | Runs the preregistered study protocol and records raw data with provenance: experiment log, data, and reproducibility manifest (environment, seed, version pins). Manual only, because it executes the protocol and writes data. Deviations are disclosed; null results are recorded as faithfully as confirming ones. | src/apothem/commands/research-experiment.md |
research-ideate | Finds a research question from zero by scanning opportunities, gaps, and invalidated hypotheses, then ranking candidates. Use when the user asks to 'help me find a research question', 'what is worth studying here', or 'generate research questions'. Not for framing a chosen one (research-spec). | src/apothem/commands/research-ideate.md |
research-paper | Assembles a paper draft from the synthesis, study design, and analysis, with every citation checked to resolve. Use when the user asks to 'write up the results as a paper', 'assemble the manuscript' or 'build the references section'. Not for critique (research-review) or theses (document-authoring). | src/apothem/commands/research-paper.md |
research-proposal | Turns a research gap and theoretical framework into a fundable proposal: SMART aims, feasibility, risk register with contingencies, impact pathway, data management and sharing plan, reporting-guideline choice, and a requirement matrix for a supplied funder call. Also runs standalone on a funder's critique of an earlier application. Use when the user asks to 'write the research proposal', 'build the aims hierarchy', or 'answer the grant reviewers'. Precedes study design, which owns preregistration. | src/apothem/commands/research-proposal.md |
research-publish | Builds the venue submission package for a reviewed paper: template formatting, cover letter, data and code availability statement, ethics and conflict declarations, tool-and-model use statement, license, archival deposit plan, and a submission checklist. Runs only when the user invokes it, because it prepares a submission. Stops at a ready package; the user submits. | src/apothem/commands/research-publish.md |
research-review | Hostile peer review of a paper, from a research suite or a supplied PDF or text: scores novelty, rigor, reproducibility, ethics; ranks revisions. Use for 'review this paper like Reviewer 2', 'referee this PDF'. Rebuttal: research-disseminate; rewrite: research-paper; references: citation-auditor. | src/apothem/commands/research-review.md |
research-sources | Collects and screens the literature for a ratified research spec: deduplication, ranking and extraction with provenance. Use when the user asks to 'collect the sources', 'build the source ledger' or 'screen the literature for the spec'. No spec yet: multi-source-research. Does not synthesize. | src/apothem/commands/research-sources.md |
research-spec | Frames a research question or notes into a testable spec: falsifiable hypotheses, inclusion and exclusion scope, success metrics. Use when the user asks to 'frame this research question', 'turn my notes into a research spec', or 'scope this study'. Not for generating questions (research-ideate). | src/apothem/commands/research-spec.md |
research-synthesis | Reconciles collected sources into a state-of-the-art map, a literature matrix and a research-gap statement. Use when the user asks to 'map the SOTA', 'build the literature matrix' or 'state the research gap'. Needs a source ledger from research-sources; loose documents: source-synthesis. | src/apothem/commands/research-synthesis.md |
research-theory | Builds the conceptual framework for a framed research question: theory of change, constructs with operational definitions and a conceptual-model diagram. Use when the user asks to 'build the theoretical framework', 'draw the theory of change' or 'define the constructs'. Needs a research spec. | src/apothem/commands/research-theory.md |
research | Runs the research pipeline from idea to peer-reviewed paper, verifying each stage hand-off and halting before data collection or publication. Use for 'take this question all the way to a paper' or 'run the study from idea to paper'. Literature report: multi-source-research; one stage: that stage. | src/apothem/commands/research.md |
security-audit | Audits a repository's security posture: secrets, injection, unsafe deserialization, path traversal, vulnerable dependencies. Use when the user asks to 'run a security audit', 'check this repo for vulnerabilities' or 'look for leaked secrets'. Writes findings. One named CVE goes to vuln-triage. | src/apothem/commands/security-audit.md |
supply-chain-audit | Audits a repository's release pipeline: build provenance, artifact signing, SBOM completeness, pinned CI actions and minimum permissions. Use when the user asks to 'audit the supply chain', 'check our SLSA and SBOM posture' or 'are our CI actions pinned'. Writes a findings file; never edits source. | src/apothem/commands/supply-chain-audit.md |
test-suite | Authors and runs behavior-first tests for a repository, triages failures and reports coverage gaps on critical paths. Use when the user asks to 'build a test suite', 'write and run tests for this repo' or 'find coverage gaps'. Tests for one named unit alone fit test-authoring. | src/apothem/commands/test-suite.md |
threat-model-audit | Threat-models a repository with STRIDE per element and trust boundaries, classifying actors and rating residual risk. Use when the user asks to 'threat model this repo', 'map the attack surface' or 'run STRIDE on this design'. Read-only; writes severity-ranked findings. | src/apothem/commands/threat-model-audit.md |
ux-review | Reviews a repository's developer experience from a first-time user's view: CLI ergonomics, error messages, install flow and docs discoverability. Use when the user asks to 'review the CLI UX', 'audit the install flow' or 'is this easy to adopt'. Read-only. Screens: design-critic. | src/apothem/commands/ux-review.md |
workflow | Use to run a non-trivial mission as an independent multi-agent workflow: parallel subagents under named return contracts, refute-by-default verification of every finding, disclosed beyond-mission fixes and one recommended next step. Runs only when the user invokes it as '/workflow <mission>'; dispatch is confirmation-gated. | src/apothem/commands/workflow.md |