akm-cli
Version:
akm (Agent Knowledge Manager) — a portable, local-first capability library for AI agents. Discover, load, share, and improve reusable skills, scripts, workflows, and knowledge across any shell-capable coding agent, including Claude Code, OpenCode, and Cur
15 lines (14 loc) • 689 B
JavaScript
// This Source Code Form is subject to the terms of the Mozilla Public
// License, v. 2.0. If a copy of the MPL was not distributed with this
// file, You can obtain one at https://mozilla.org/MPL/2.0/.
import { withProjectLine } from "../../core/projects.js";
/** The project line when one applies, then each rule under its ref. */
export function formatRulesText(result) {
const body = result.rules.length === 0
? "No rules apply here."
: result.rules.map((rule) => `## ${rule.ref}\n\n${rule.content}`).join("\n\n");
return withProjectLine(body, result.project);
}
export const rulesFormatters = [
{ command: "rules", handler: (r) => formatRulesText(r) },
];