pruff-skills 1.4.0 → 1.5.0
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.
- package/dist/cli.mjs +18 -0
- package/package.json +1 -1
package/dist/cli.mjs
CHANGED
|
@@ -6647,6 +6647,7 @@ const DB_READER_SERVICE = "pruff-db-reader";
|
|
|
6647
6647
|
const DB_READER_SECRET_PREFIX = "pruff/db-reader/";
|
|
6648
6648
|
const DB_READER_ALLOW_ENTRY = "Bash(pruff-db-query:*)";
|
|
6649
6649
|
const DB_READER_VERIFY_DATABASE = "pruff-sii";
|
|
6650
|
+
const DB_READER_SKILL = "prod-db-query";
|
|
6650
6651
|
const DB_READER_SCRIPTS = ["pruff-db-query", "pruff-db-verify"];
|
|
6651
6652
|
const RDS_CA_URL = `https://truststore.pki.rds.amazonaws.com/${DB_READER_REGION}/${DB_READER_REGION}-bundle.pem`;
|
|
6652
6653
|
const MAX_SUGGESTED_NAME_LENGTH = 23;
|
|
@@ -6775,6 +6776,22 @@ function mergeAllowlist(workspace) {
|
|
|
6775
6776
|
renameSync(tmp, path);
|
|
6776
6777
|
return "added";
|
|
6777
6778
|
}
|
|
6779
|
+
async function installReaderSkill(workspace, note) {
|
|
6780
|
+
if (existsSync(join(workspace, ".claude", "skills", DB_READER_SKILL, "SKILL.md"))) return;
|
|
6781
|
+
const prevCwd = process.cwd();
|
|
6782
|
+
try {
|
|
6783
|
+
process.chdir(workspace);
|
|
6784
|
+
await runAdd([PRUFF_CATALOG], {
|
|
6785
|
+
skill: [DB_READER_SKILL],
|
|
6786
|
+
agent: ["claude-code"],
|
|
6787
|
+
yes: true
|
|
6788
|
+
});
|
|
6789
|
+
} catch {} finally {
|
|
6790
|
+
process.chdir(prevCwd);
|
|
6791
|
+
}
|
|
6792
|
+
if (existsSync(join(workspace, ".claude", "skills", DB_READER_SKILL, "SKILL.md"))) M.success(`Skill ${DB_READER_SKILL} installed`);
|
|
6793
|
+
else note(`Skill ${DB_READER_SKILL} not installed — run ${import_picocolors.default.cyan(`npx pruff-skills add ${PRUFF_CATALOG} --skill ${DB_READER_SKILL}`)} from ${workspace}.`);
|
|
6794
|
+
}
|
|
6778
6795
|
async function setupDbReader({ workspace, note }) {
|
|
6779
6796
|
M.step("Setting up read-only prod database access…");
|
|
6780
6797
|
const identity = aws([
|
|
@@ -6853,6 +6870,7 @@ async function setupDbReader({ workspace, note }) {
|
|
|
6853
6870
|
if (mergeAllowlist(workspace) === "invalid") note(`Add ${import_picocolors.default.cyan(DB_READER_ALLOW_ENTRY)} to permissions.allow in ${join(workspace, ".claude", "settings.json")} by hand — the file is not valid JSON.`);
|
|
6854
6871
|
const hooks = await installHooks(["prod-db-guard"]);
|
|
6855
6872
|
for (const failure of hooks.failed) note(`Hook ${failure.name} not installed: ${failure.reason}`);
|
|
6873
|
+
await installReaderSkill(workspace, note);
|
|
6856
6874
|
if (!existsSync(join(workspace, ".claude", "rules", "prod-db-reads.md"))) note(`The prod-db-reads rule is missing from the workspace — run ${import_picocolors.default.cyan("npx pruff-skills rules add --all")} from ${workspace}.`);
|
|
6857
6875
|
}
|
|
6858
6876
|
const WORKSPACE_DIRS = [".claude/scripts"];
|