qatools-cli 1.2.25 → 1.2.27
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/agents.js +104 -0
- package/impact.js +2 -0
- package/package.json +3 -2
- package/qatools.js +82 -9
package/agents.js
ADDED
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
// review.requirement-aware-agents: Claude Code subagents that review a change against the project's own
|
|
2
|
+
// requirements and rules. qatools init writes them to .claude/agents/ (like the skills); other agent files are kept.
|
|
3
|
+
const fs = require("fs");
|
|
4
|
+
const path = require("path");
|
|
5
|
+
|
|
6
|
+
const MARK = "<!-- written by qatools init (review.requirement-aware-agents) — rewritten on every init -->";
|
|
7
|
+
|
|
8
|
+
const COMMON = `
|
|
9
|
+
## What you review
|
|
10
|
+
The change: uncommitted work (\`git diff HEAD\`) plus the commits on this branch that are not on main
|
|
11
|
+
(\`git log --oneline <main>..HEAD\`, \`git diff <main>...HEAD\`). Main is origin/HEAD, else origin/main, origin/master,
|
|
12
|
+
main or master. If the caller names a range or files, review those instead.
|
|
13
|
+
|
|
14
|
+
## Rules for you
|
|
15
|
+
- You only READ and REPORT. Never edit code, never change a requirement's status, never change a backlog item's status.
|
|
16
|
+
The only thing you write is signals (\`qatools backlog-create\`).
|
|
17
|
+
- Every finding cites file:line from the change. No citation, no finding — say "unsure" instead of guessing.
|
|
18
|
+
- Before creating a signal, check it is not already reported: \`qatools backlog --status open,in_progress,on_hold,ready_for_test -o <tmp>.json\`
|
|
19
|
+
and look for the same requirement key and file. Do not create duplicates.
|
|
20
|
+
- Signal types: a criterion or rule the change breaks → bug (AVV); a requirement that is missing or unclear → requirement_gap (GAP);
|
|
21
|
+
a technical problem (performance, robustness, infrastructure) → technical_defect (DEF). Always pass --requirement-key when one applies.
|
|
22
|
+
Description: what is wrong, file:line, what the requirement or rule says, what the code does.
|
|
23
|
+
- Never paste a secret into a signal or your report. Mask it (…last4).
|
|
24
|
+
- Write in the project's language (see \`qatools context\`).
|
|
25
|
+
|
|
26
|
+
## Your report (return it to the caller)
|
|
27
|
+
1. What you reviewed (range, number of files).
|
|
28
|
+
2. A table: item | verdict (met / not met / not covered / unsure) | evidence (file:line).
|
|
29
|
+
3. Signals you created (id, type, one line), and existing signals you found instead of creating duplicates.
|
|
30
|
+
4. Anything you could not check, and why.
|
|
31
|
+
`;
|
|
32
|
+
|
|
33
|
+
const AGENTS = {
|
|
34
|
+
"qa-reviewer.md": `---
|
|
35
|
+
name: qa-reviewer
|
|
36
|
+
description: Reviews a change against the acceptance criteria of the requirements it names, the project's rules (App Context) and regression risk to other verified requirements. Use before setting a requirement implemented or a backlog item ready_for_test. Read-only; findings become qa-tools signals.
|
|
37
|
+
tools: Read, Grep, Glob, Bash
|
|
38
|
+
---
|
|
39
|
+
${MARK}
|
|
40
|
+
|
|
41
|
+
# qa-reviewer — review against the project's requirements and rules
|
|
42
|
+
|
|
43
|
+
You review code the way the project owner would: against what the app is SUPPOSED to do, written down in qa-tools.
|
|
44
|
+
|
|
45
|
+
## Steps
|
|
46
|
+
1. Find the requirements the change belongs to: the keys its commit messages name (\`feat(<key>)\`, \`fix(AVV-n)\` → that item's
|
|
47
|
+
requirementKey) and the branch name. Read each one: \`qatools requirements --json -o <tmp>.json\` and pick them by key.
|
|
48
|
+
If the change names no requirement, say so and review against the rules only — do not guess a requirement.
|
|
49
|
+
2. For EACH acceptance criterion and EACH negative criterion of those requirements: does the change meet it? Find the code
|
|
50
|
+
that does it (file:line). Missing behaviour, a missing guard or a criterion nobody implemented is "not met".
|
|
51
|
+
A criterion that needs a test you cannot run is "unsure — needs: <test>".
|
|
52
|
+
3. The project's rules: \`qatools context\` (conventions, design principles, AI rules, constraints). Report where the change
|
|
53
|
+
breaks one (e.g. a native confirm(), hard-coded colours, a hard-coded string where i18n is required, overflow:auto).
|
|
54
|
+
4. Regression: \`qatools impact --since <main>\` — verified requirements whose code this change rewrote. List them; they
|
|
55
|
+
must be verified again.
|
|
56
|
+
5. Create signals for what is not met or broken (see the rules), then return the report.
|
|
57
|
+
${COMMON}`,
|
|
58
|
+
|
|
59
|
+
"qa-security-reviewer.md": `---
|
|
60
|
+
name: qa-security-reviewer
|
|
61
|
+
description: Reviews a change against the project's security requirements (including those inherited from the requirement library) and runs qatools doctor. Use before setting a requirement implemented or a backlog item ready_for_test when the change touches access, data, secrets, input or dependencies. Read-only; findings become qa-tools signals.
|
|
62
|
+
tools: Read, Grep, Glob, Bash
|
|
63
|
+
---
|
|
64
|
+
${MARK}
|
|
65
|
+
|
|
66
|
+
# qa-security-reviewer — review against the project's security requirements
|
|
67
|
+
|
|
68
|
+
You check a change against the security the project has DECIDED it needs — its own security requirements — and against
|
|
69
|
+
plain security mistakes.
|
|
70
|
+
|
|
71
|
+
## Steps
|
|
72
|
+
1. The project's security requirements: \`qatools requirements --json -o <tmp>.json\`, then those with category Security,
|
|
73
|
+
an epic about security, or a key starting with security., auth. or access (inherited library requirements included).
|
|
74
|
+
2. Which of them the change touches: access control and authorisation (who may read or change what — backend checks,
|
|
75
|
+
database rules, API guards), authentication, storing or sending secrets, personal data, input validation and output
|
|
76
|
+
encoding, file uploads, dependencies. For each one touched: does the change still meet its criteria? Cite file:line.
|
|
77
|
+
3. Plain mistakes even without a requirement: a check done only in the client, a query not scoped to the user's project
|
|
78
|
+
or tenant, a secret in code or config, injection (SQL, shell, HTML), missing rate limit on a public endpoint, a new
|
|
79
|
+
dependency with known vulnerabilities (\`npm audit\` / the ecosystem's equivalent if available). Report these as
|
|
80
|
+
findings too; if no requirement covers one, create a GAP signal so the user can decide.
|
|
81
|
+
4. Run \`qatools doctor\` (and \`--history\` if the change removed a secret). Report what it found; a secret in history
|
|
82
|
+
means the key must be rotated.
|
|
83
|
+
5. Create signals for what is not met or broken (see the rules), then return the report.
|
|
84
|
+
${COMMON}`,
|
|
85
|
+
};
|
|
86
|
+
|
|
87
|
+
// Write the agents; files the repo already has under other names are untouched. Returns the names written.
|
|
88
|
+
function installAgents(cwd = process.cwd()) {
|
|
89
|
+
const dir = path.join(cwd, ".claude", "agents");
|
|
90
|
+
fs.mkdirSync(dir, { recursive: true });
|
|
91
|
+
const written = [];
|
|
92
|
+
for (const [name, text] of Object.entries(AGENTS)) {
|
|
93
|
+
const file = path.join(dir, name);
|
|
94
|
+
if (fs.existsSync(file) && !fs.readFileSync(file, "utf8").includes(MARK)) continue; // the repo's own file with this name
|
|
95
|
+
fs.writeFileSync(file, text);
|
|
96
|
+
written.push(name);
|
|
97
|
+
}
|
|
98
|
+
return written;
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
const agentsInstalled = (cwd = process.cwd()) =>
|
|
102
|
+
Object.keys(AGENTS).every(n => { try { return fs.readFileSync(path.join(cwd, ".claude", "agents", n), "utf8").includes(MARK); } catch { return false; } });
|
|
103
|
+
|
|
104
|
+
module.exports = { AGENTS, installAgents, agentsInstalled, MARK };
|
package/impact.js
CHANGED
|
@@ -8,6 +8,8 @@ const { execFileSync } = require("child_process");
|
|
|
8
8
|
const DEFAULT_IGNORE = [
|
|
9
9
|
/(^|\/)package-lock\.json$/, /(^|\/)yarn\.lock$/, /(^|\/)pnpm-lock\.yaml$/, /(^|\/)packages\.lock\.json$/,
|
|
10
10
|
/(^|\/)version\.(json|ts)$/, /\.md$/i, /(^|\/)\.firebase\//,
|
|
11
|
+
// IMP-28: a changed test proves itself by running; it does not put the requirement it tests at risk
|
|
12
|
+
/(^|\/)(test|tests|__tests__)\//, /\.(test|spec)\.[cm]?[jt]sx?$/,
|
|
11
13
|
];
|
|
12
14
|
|
|
13
15
|
function git(cwd, args) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "qatools-cli",
|
|
3
|
-
"version": "1.2.
|
|
3
|
+
"version": "1.2.27",
|
|
4
4
|
"description": "CLI for QA Tools — requirements, epics, sprints, sessions, App Context sync, project agenda. The companion to qa-tools.com.",
|
|
5
5
|
"scripts": {
|
|
6
6
|
"release": "npm version patch --no-git-tag-version && npm publish",
|
|
@@ -16,7 +16,8 @@
|
|
|
16
16
|
"context-sync.js",
|
|
17
17
|
"hooks.js",
|
|
18
18
|
"brief.js",
|
|
19
|
-
"secrets.js"
|
|
19
|
+
"secrets.js",
|
|
20
|
+
"agents.js"
|
|
20
21
|
],
|
|
21
22
|
"keywords": [
|
|
22
23
|
"qa",
|
package/qatools.js
CHANGED
|
@@ -924,6 +924,7 @@ program
|
|
|
924
924
|
if (!h.commitMsg) warn.push("commit message check (feat(<key>) / fix(AVV-n))");
|
|
925
925
|
if (!h.preCommit) warn.push("secret check before commit");
|
|
926
926
|
if (!h.sessionBrief) warn.push("session brief for Claude Code");
|
|
927
|
+
if (!require("./agents").agentsInstalled(cwd)) warn.push("review agents (qa-reviewer, qa-security-reviewer)");
|
|
927
928
|
if (warn.length) console.log(`⚠ Missing qa-tools hooks: ${warn.join(", ")}. Run: qatools init`);
|
|
928
929
|
if (!result.claudeMd.syncedBlock) console.log(`⚠ ${result.claudeMd.file} has no synced qa-tools block. Run: qatools sync`);
|
|
929
930
|
else if (ageDays !== null && ageDays > 14) console.log(`⚠ ${result.claudeMd.file} was synced ${ageDays} days ago. Run: qatools sync`);
|
|
@@ -1307,8 +1308,9 @@ program
|
|
|
1307
1308
|
console.log("No templates found.");
|
|
1308
1309
|
} else {
|
|
1309
1310
|
for (const t of templates) {
|
|
1310
|
-
const statusIcon = { draft: "📝", pending_review: "🔍", approved: "✅", rejected: "❌" }[t.status] || "?";
|
|
1311
|
-
|
|
1311
|
+
const statusIcon = { draft: "📝", pending_review: "🔍", approved: "✅", rejected: "❌", superseded: "↷" }[t.status] || "?";
|
|
1312
|
+
const ch = t.changes ? ` — since v${t.changes.fromVersion}: +${t.changes.added.length} −${t.changes.removed.length}` : "";
|
|
1313
|
+
console.log(` ${statusIcon} ${t.name} v${t.versionNumber || 1} [${t.status}] ${(t.uploadedAt || "").slice(0, 10)} (${t.testCount ?? "?"} tests)${ch} ID: ${t.id}`);
|
|
1312
1314
|
if (t.reviewComment) console.log(` 💬 ${t.reviewComment}`);
|
|
1313
1315
|
}
|
|
1314
1316
|
}
|
|
@@ -1982,10 +1984,32 @@ program
|
|
|
1982
1984
|
process.exit(0);
|
|
1983
1985
|
});
|
|
1984
1986
|
|
|
1987
|
+
// testing.protocol-versions: close a protocol (e.g. a superseded version) without the web app
|
|
1988
|
+
program
|
|
1989
|
+
.command("template-reject")
|
|
1990
|
+
.description("Reject a test protocol with a reason (min 5 chars), e.g. a superseded version")
|
|
1991
|
+
.requiredOption("-i, --id <id>", "Test protocol ID")
|
|
1992
|
+
.requiredOption("--reason <text>", "Why it is rejected — kept with the protocol")
|
|
1993
|
+
.option("--project <id>", "Target project ID (overrides default)")
|
|
1994
|
+
.option("-e, --email <email>", "Login email")
|
|
1995
|
+
.option("-p, --password <password>", "Login password")
|
|
1996
|
+
.action(async (options) => {
|
|
1997
|
+
if (String(options.reason || "").trim().length < 5) { console.error("✗ --reason needs at least 5 characters"); process.exit(2); }
|
|
1998
|
+
await authenticate(options);
|
|
1999
|
+
const projectId = options.project || getCredentials()?.projectId;
|
|
2000
|
+
if (!projectId) { console.error("No project configured. Run: qatools setup, or pass --project <id>"); process.exit(1); }
|
|
2001
|
+
try {
|
|
2002
|
+
await httpsCallable(functions, "rejectTemplate")({ projectId, templateId: options.id, reason: options.reason });
|
|
2003
|
+
console.log(`✓ Test protocol ${options.id} rejected.`);
|
|
2004
|
+
} catch (e) { console.error("Failed:", e.message); process.exit(1); }
|
|
2005
|
+
process.exit(0);
|
|
2006
|
+
});
|
|
2007
|
+
|
|
1985
2008
|
program
|
|
1986
2009
|
.command("template-upload")
|
|
1987
|
-
.description("Upload a test
|
|
2010
|
+
.description("Upload a test protocol JSON. The same name as an existing protocol makes the next version (v1, v2 …); older unreviewed versions are superseded")
|
|
1988
2011
|
.requiredOption("-f, --file <path>", "Path to template JSON file")
|
|
2012
|
+
.option("--replaces <id>", "Make this the next version of that protocol (even under another name) and supersede it")
|
|
1989
2013
|
.option("--project <id>", "Target project ID (overrides default)")
|
|
1990
2014
|
.option("-e, --email <email>", "Login email")
|
|
1991
2015
|
.option("-p, --password <password>", "Login password")
|
|
@@ -2008,9 +2032,13 @@ program
|
|
|
2008
2032
|
name: data.name,
|
|
2009
2033
|
version: data.version || "",
|
|
2010
2034
|
sections: data.sections,
|
|
2035
|
+
...(options.replaces ? { replaces: options.replaces } : {}),
|
|
2011
2036
|
});
|
|
2012
|
-
|
|
2013
|
-
console.log(`
|
|
2037
|
+
const r = result.data;
|
|
2038
|
+
console.log(`Template uploaded: ${r.name} v${r.versionNumber || 1} (${r.sectionsCount} sections), pending review`);
|
|
2039
|
+
console.log(`ID: ${r.id}`);
|
|
2040
|
+
if (r.changes) console.log(`Since v${r.changes.fromVersion}: added ${r.changes.added.join(", ") || "none"}; removed ${r.changes.removed.join(", ") || "none"}`);
|
|
2041
|
+
if (r.superseded?.length) console.log(`Superseded: ${r.superseded.join(", ")}`);
|
|
2014
2042
|
} catch (e) {
|
|
2015
2043
|
console.error("Failed:", e.message);
|
|
2016
2044
|
process.exit(1);
|
|
@@ -2102,7 +2130,7 @@ program
|
|
|
2102
2130
|
.description("Update one or more backlog items. status=resolved REQUIRES --evidence (cite the verification).")
|
|
2103
2131
|
.option("-f, --file <path>", "JSON file with updates: { '<id>': { status, evidence, comment, ... } }")
|
|
2104
2132
|
.option("-i, --id <id>", "Single item ID to update")
|
|
2105
|
-
.option("--status <status>", "New status")
|
|
2133
|
+
.option("--status <status>", "New status: open, in_progress, on_hold (needs --comment saying what it waits for), ready_for_test, resolved, rejected")
|
|
2106
2134
|
.option("--evidence <text>", "REQUIRED when status=resolved (except for GAP). Cite the verification: test output, file:line, expected vs actual, or 'no test applies because <reason>'.")
|
|
2107
2135
|
.option("--attach <files...>", "Image file(s) as evidence (png/jpg/webp/gif, max 4 MB each)")
|
|
2108
2136
|
.option("--comment <text>", "Add comment")
|
|
@@ -2148,6 +2176,13 @@ program
|
|
|
2148
2176
|
process.exit(1);
|
|
2149
2177
|
}
|
|
2150
2178
|
|
|
2179
|
+
// backlog.on-hold-status: putting an item on hold says what it waits for (also checked by the backend)
|
|
2180
|
+
const noWait = Object.entries(updates).filter(([, u]) => u.status === "on_hold" && String(u.comment || "").trim().length < 5).map(([id]) => id);
|
|
2181
|
+
if (noWait.length) {
|
|
2182
|
+
console.error(`✗ Refusing status=on_hold without --comment saying what it waits for (min 5 chars): ${noWait.join(", ")}`);
|
|
2183
|
+
process.exit(2);
|
|
2184
|
+
}
|
|
2185
|
+
|
|
2151
2186
|
// Pre-flight: status=resolved needs evidence, and AVV/DEF/IMP must have been through ready_for_test.
|
|
2152
2187
|
// GAP is exempt (its "fix" is writing a requirement, not testing code).
|
|
2153
2188
|
if (Object.values(updates).some(u => u.status === 'resolved')) {
|
|
@@ -2944,6 +2979,8 @@ App Context → Epics → Requirements → Sprint → Implementation → Test
|
|
|
2944
2979
|
|
|
2945
2980
|
5. NEVER create requirements directly as backlog items. If a GAP needs to become a requirement, flag it — the user decides.
|
|
2946
2981
|
|
|
2982
|
+
5b. Before you set a requirement \`implemented\` or a backlog item \`ready_for_test\`: run the \`qa-reviewer\` subagent, and \`qa-security-reviewer\` when the change touches access, data, secrets, input or dependencies. Fix what they find, or leave it recorded as the signals they created — never skip them to save time.
|
|
2983
|
+
|
|
2947
2984
|
6. Check for pending test sessions:
|
|
2948
2985
|
\`qatools pending\`
|
|
2949
2986
|
\`qatools read-session -s <id> -o session.json\`
|
|
@@ -3411,6 +3448,8 @@ See \`.claude/skills/\` for role-specific instructions. Start with \`qa-purpose.
|
|
|
3411
3448
|
console.log(sh.installed ? ` ✓ Session brief hook ${sh.already ? "already in" : "added to"} .claude/settings.json (qatools brief --hook)` : ` ⚠ Session brief hook not added: ${sh.reason}`);
|
|
3412
3449
|
const ch = hooks.installCommitHook(cwd);
|
|
3413
3450
|
console.log(ch.installed ? ` ✓ Commit message check ${ch.already ? "already installed" : "installed"} (${path.relative(cwd, ch.path)})` : ` ⚠ Commit message check not installed: ${ch.reason}`);
|
|
3451
|
+
const ag = require("./agents").installAgents(cwd);
|
|
3452
|
+
console.log(ag.length ? ` ✓ Review agents written to .claude/agents/: ${ag.join(", ")}` : " ⚠ Review agents not written: the repo has its own files with these names");
|
|
3414
3453
|
const pc = hooks.installPreCommitHook(cwd);
|
|
3415
3454
|
console.log(pc.installed ? ` ✓ Secret check ${pc.already ? "already installed" : "installed"} (${path.relative(cwd, pc.path)})` : ` ⚠ Secret check not installed: ${pc.reason}`);
|
|
3416
3455
|
} catch (e) {
|
|
@@ -3923,7 +3962,7 @@ const MCP_PROTOCOL_VERSIONS = ["2025-11-25", "2025-06-18", "2025-03-26", "2024-1
|
|
|
3923
3962
|
const MCP_INSTRUCTIONS = `qa-tools: requirements-driven QA. Rules that apply to every tool:
|
|
3924
3963
|
- Build from requirements. Planning is Epics → Requirements → Sprints (requirement.sprintId).
|
|
3925
3964
|
- The backlog is signals (bug=AVV, requirement_gap=GAP, technical_defect=DEF, improvement=IMP), not a task list.
|
|
3926
|
-
- Backlog flow: open → in_progress → ready_for_test → resolved. Set ready_for_test when you believe a fix is done; resolved needs evidence (min 10 chars) and, except GAP, a prior ready_for_test.
|
|
3965
|
+
- Backlog flow: open → in_progress → ready_for_test → resolved. Set ready_for_test when you believe a fix is done; resolved needs evidence (min 10 chars) and, except GAP, a prior ready_for_test. on_hold = deliberately waiting for something outside the team (a decision, information); it needs a comment saying what it waits for, and goes back to open or in_progress when the wait is over.
|
|
3927
3966
|
- Requirement status implemented/tested needs evidence: test output, file:line, expected vs actual, or "no test applies because <reason>".
|
|
3928
3967
|
- Requirement flow: approved → in_progress → implemented → tested. When you start implementing an approved requirement, set status in_progress and assignedTo "me" (update_requirement); if you stop without finishing, set it back to approved.
|
|
3929
3968
|
- Requirements with a libraryId inherit from the account's requirement library: never try to change their title, description, criteria, type or category — only applicability, status, sprint, epic and assignee are the project's. When get_agenda lists libraryReverify, verify those requirements again against the new library text.
|
|
@@ -3937,7 +3976,7 @@ const mcpBool = (description) => ({ type: "boolean", description });
|
|
|
3937
3976
|
const mcpStrArray = (description, items = { type: "string" }) => ({ type: "array", items, description });
|
|
3938
3977
|
const MCP_PROJECT_PROP = { projectId: mcpStr("Project ID. Defaults to the configured project.") };
|
|
3939
3978
|
const MCP_REQ_STATUSES = ["draft", "approved", "in_progress", "rejected", "implemented", "tested", "superseded"];
|
|
3940
|
-
const MCP_BACKLOG_STATUSES = ["open", "in_progress", "ready_for_test", "resolved", "rejected"];
|
|
3979
|
+
const MCP_BACKLOG_STATUSES = ["open", "in_progress", "on_hold", "ready_for_test", "resolved", "rejected"];
|
|
3941
3980
|
const MCP_BACKLOG_TYPES = ["bug", "improvement", "requirement_gap", "technical_defect"];
|
|
3942
3981
|
const MCP_PRIORITY = mcpInt("Priority: 1 (high), 2 (medium), 3 (low)", { enum: [1, 2, 3] });
|
|
3943
3982
|
|
|
@@ -4389,6 +4428,7 @@ const mcpTools = [
|
|
|
4389
4428
|
if (a.comment) { u.comment = a.comment; u.authorName = a.authorName || "Claude"; }
|
|
4390
4429
|
if (a.tags) u.tags = a.tags.map(t => t.trim().toLowerCase());
|
|
4391
4430
|
if (Object.keys(u).length === 0) throw new McpToolError("No fields to update.");
|
|
4431
|
+
if (u.status === "on_hold" && String(u.comment || "").trim().length < 5) throw new McpToolError("Refusing status=on_hold without a comment saying what it waits for (min 5 chars).");
|
|
4392
4432
|
const updates = { [a.itemId]: u };
|
|
4393
4433
|
if (u.status === "resolved") {
|
|
4394
4434
|
// Fail closed: unlike the interactive CLI, the MCP server refuses when the pre-check can't run.
|
|
@@ -4441,6 +4481,27 @@ const mcpTools = [
|
|
|
4441
4481
|
inputSchema: mcpSchema(),
|
|
4442
4482
|
run: async () => require("./context-sync").requestsIntegrationPrompt(getCredentials()?.projectName || ""),
|
|
4443
4483
|
},
|
|
4484
|
+
{
|
|
4485
|
+
name: "new_app_questions",
|
|
4486
|
+
description: "projects.new-app-guide: the questions for a new app (purpose, users, client, backend and hosting, database, login, language, where code and CI live) with their choices. Ask them one at a time; then create_project and apply_new_app_answers. Prompt new_app has the whole flow.",
|
|
4487
|
+
inputSchema: { type: "object", properties: {}, additionalProperties: false },
|
|
4488
|
+
run: async () => mcpCall("getNewAppQuestions", {}),
|
|
4489
|
+
},
|
|
4490
|
+
{
|
|
4491
|
+
name: "create_project",
|
|
4492
|
+
description: "Create a new qa-tools project owned by the logged-in user. Needs the user's own login (qatools login --google); refused with a Claude API key, which belongs to one project.",
|
|
4493
|
+
inputSchema: { type: "object", properties: { name: mcpStr("The app's name"), description: mcpStr("One sentence: what it does") }, required: ["name"], additionalProperties: false },
|
|
4494
|
+
run: async (a) => mcpCall("createProject", { name: a.name, description: a.description || "" }),
|
|
4495
|
+
},
|
|
4496
|
+
{
|
|
4497
|
+
name: "apply_new_app_answers",
|
|
4498
|
+
description: "Fill a project's App Context from the new-app answers: { purpose, users, client, backend, database, auth: [], languages: [], codeHost } with choice values from new_app_questions, \"other:<text>\" or \"undecided\". Fields that already have content are reported as conflicts and not saved unless overwrite is true — ask the user first.",
|
|
4499
|
+
inputSchema: mcpSchema({
|
|
4500
|
+
answers: { type: "object", description: "The answers, keyed by question id", additionalProperties: true },
|
|
4501
|
+
overwrite: mcpBool("Replace fields that already have content — only after the user confirmed"),
|
|
4502
|
+
}, ["answers"]),
|
|
4503
|
+
run: async (a) => mcpCall("applyNewAppAnswers", { projectId: a.projectId || getCredentials()?.projectId, answers: a.answers, overwrite: !!a.overwrite }),
|
|
4504
|
+
},
|
|
4444
4505
|
{
|
|
4445
4506
|
name: "baseline_prompt",
|
|
4446
4507
|
description: "Procedure for reconstructing requirements for what is already built (requirements.baseline-from-code), with the project's language, its epics and all existing requirements. Use when code exists that qa-tools has no requirements for.",
|
|
@@ -4533,12 +4594,13 @@ const mcpTools = [
|
|
|
4533
4594
|
additionalProperties: false,
|
|
4534
4595
|
},
|
|
4535
4596
|
},
|
|
4597
|
+
replaces: mcpStr("Optional: the id of a protocol this is the next version of (it is superseded). The same name as an existing protocol makes the next version anyway"),
|
|
4536
4598
|
}, ["sprintId", "name", "sections"]),
|
|
4537
4599
|
run: async (a) => {
|
|
4538
4600
|
for (const sec of a.sections) for (const t of sec.tests || []) {
|
|
4539
4601
|
if (!String(t.purpose || "").trim()) throw new McpToolError(`Test "${t.name}" needs a purpose saying why a person must perform it`);
|
|
4540
4602
|
}
|
|
4541
|
-
const r = await mcpCall("uploadTemplate", { projectId: a.projectId, sprintId: a.sprintId, name: a.name, sections: a.sections });
|
|
4603
|
+
const r = await mcpCall("uploadTemplate", { projectId: a.projectId, sprintId: a.sprintId, name: a.name, sections: a.sections, ...(a.replaces ? { replaces: a.replaces } : {}) });
|
|
4542
4604
|
return { ...r, next: "Pending review. A project member approves it in qa-tools under Test protocols." };
|
|
4543
4605
|
},
|
|
4544
4606
|
},
|
|
@@ -4636,6 +4698,17 @@ Follow these steps in order:
|
|
|
4636
4698
|
arguments: [{ name: "projectId", description: "Project ID (default: configured project)", required: false }],
|
|
4637
4699
|
text: (a) => dailyAgendaRunPrompt(a.projectId),
|
|
4638
4700
|
},
|
|
4701
|
+
{
|
|
4702
|
+
name: "new_app",
|
|
4703
|
+
description: "projects.new-app-guide: start a new app — ask the user how it should be built, create the project and fill its App Context.",
|
|
4704
|
+
arguments: [{ name: "name", description: "The app's name, if already known", required: false }],
|
|
4705
|
+
text: (a) => `Help the user start a new app in qa-tools${a.name ? ` called "${a.name}"` : ""}.
|
|
4706
|
+
|
|
4707
|
+
1. Get the questions: new_app_questions. Ask them ONE AT A TIME in the user's language, offering the listed choices plus "other" and "not decided yet". Let the user skip any question. Do not choose for the user; "not decided yet" is a fine answer.
|
|
4708
|
+
2. When you have the answers and a name, create the project: create_project (name, description = the purpose). It needs the user's own login; if it is refused because the MCP server runs with a Claude API key, tell the user to create the project in the web app (or run qatools login --google) and give you its ID, then continue with step 3.
|
|
4709
|
+
3. Fill its App Context: apply_new_app_answers with projectId and the answers (choice values, "other:<text>" or "undecided"). If it reports conflicts (an App Context that already has content), show the user which fields would change and call it again with overwrite: true only if they say yes.
|
|
4710
|
+
4. Tell the user the next step: in the new repo, qatools setup (pick the project) and qatools init; then you can propose the first epics from the App Context.`,
|
|
4711
|
+
},
|
|
4639
4712
|
];
|
|
4640
4713
|
|
|
4641
4714
|
function mcpValidateArgs(tool, args) {
|