Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ A conformance report listing each violation, grouped macro and micro, with sever
1. **Load.** Read the architecture sources: the architecture memory, the micro diagrams for an in-scope module, and the decision records. Extract the expected project tree.
2. **Macro.** Compare the code structure against the documented tree. Flag files outside their boundary and direct imports between independent services.
3. **Micro.** For each in-scope module, check import directions against the layer constraints. The domain layer imports nothing external. The application layer reaches the domain only through ports. No circular dependencies. Adapters implement their interfaces.
4. **Report.** One entry per violation, grouped macro and micro, each with severity (`critical` or `warning`), file, constraint, and a one-line fix.
4. **Report.** One entry per violation, grouped macro and micro, each with severity (`critical` or `major`), file, constraint, and a one-line fix.
5. **Summarize.** The total violations, the critical count, and the recommended next actions.

## Test
Expand Down
4 changes: 2 additions & 2 deletions plugins/aidd-dev/skills/04-audit/assets/audit-template.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ argument-hint: N/A
- **Date**: {{yyyy_mm_dd}}
- **Scope**: {{scope}}
- **Health**: {{good | fair | poor}}
- **Findings**: {{n_critical}} critical, {{n_warning}} warning, {{n_minor}} minor
- **Findings**: {{n_critical}} critical, {{n_major}} major, {{n_minor}} minor

Health: `good` = no critical findings; `fair` = critical findings exist but are isolated and addressable; `poor` = systemic or widespread critical findings.

Expand All @@ -21,7 +21,7 @@ One row per issue. Every row MUST cite a concrete `file:line`. Sort by severity

Severity (shared rubric across every audit pillar, so a full audit ranks consistently):
- 🔴 critical - exploitable security hole, data loss, or broken correctness. Fix now.
- 🟡 warning - real debt or risk that will bite later. Fix soon.
- 🟡 major - real debt or risk that will bite later. Fix soon.
- 🟢 minor - nit or cleanup. Fix when convenient.

Effort: `S` (under 1h), `M` (under 1d), `L` (over 1d).
Expand Down
2 changes: 1 addition & 1 deletion plugins/aidd-dev/skills/07-refactor/SKILL.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,5 +25,5 @@ Before running an action, read its file in `actions/`, not only the table or ass
- Scope: run the one named axis, or for an unscoped request ask once "all applicable axes, or one?" before running. A request to delete or remove code runs `cleanup` directly, with no axis question. Never silently default to one axis.
- Behavior-preserving for cleanup, performance, and architecture: public inputs and outputs stay identical, verified by tests, type checks, or a side-by-side run. Security may alter behavior to close a vulnerability, and must call that out explicitly.
- Audit-fed, optional: when the caller pushes an audit report (a path under `aidd_docs/tasks/audits/` or pasted findings), take its findings for this axis as the fix list and skip the scan. The bridge is the report artifact; this skill never loads or calls another skill. The audit `code-quality` pillar feeds the `cleanup` axis; the other axes map by name.
- Severity uses the shared 3-level scale: 🔴 critical, 🟡 warning, 🟢 minor.
- Severity uses the shared 3-level scale: 🔴 critical, 🟡 major, 🟢 minor.
- Stay inside the axis: dependency upgrades and UI redesign are out of scope. Add tests only as a regression for a security fix, never otherwise.
47 changes: 47 additions & 0 deletions scripts/__tests__/aidd-dev-severities-share-one-scale.test.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
const assert = require("node:assert/strict");
const fs = require("node:fs");
const path = require("node:path");
const { describe, it } = require("node:test");

const SKILLS = path.resolve(__dirname, "../../plugins/aidd-dev/skills");

/**
* An audit feeds refactor, and assert and review grade the same code: a finding keeps its severity
* from one skill to the next only when every skill names the same three levels.
*/

function read(relative) {
return fs.readFileSync(path.join(SKILLS, relative), "utf8");
}

function everyMarkdown(directory, into) {
for (const entry of fs.readdirSync(directory, { withFileTypes: true })) {
const full = path.join(directory, entry.name);
if (entry.isDirectory()) everyMarkdown(full, into);
else if (entry.name.endsWith(".md")) into.push(full);
}
return into;
}

describe("aidd-dev severities share one scale", () => {
it("no skill names a severity the scale does not have", () => {
const strays = everyMarkdown(SKILLS, [])
.filter((file) => /\bwarning\b/iu.test(fs.readFileSync(file, "utf8")))
.map((file) => path.relative(SKILLS, file));
assert.deepEqual(strays, []);
});

it("an audit counts and defines its findings as critical, major, minor", () => {
const template = read("04-audit/assets/audit-template.md");
assert.match(template, /\{\{n_critical\}\} critical, \{\{n_major\}\} major, \{\{n_minor\}\} minor/u);
assert.match(template, /^- 🟡 major - /mu);
});

it("refactor reads an audit's findings on the same scale", () => {
assert.match(read("07-refactor/SKILL.md"), /🔴 critical, 🟡 major, 🟢 minor/u);
});

it("an architecture violation is critical or major", () => {
assert.match(read("03-assert/actions/02-assert-architecture.md"), /severity \(`critical` or `major`\)/u);
});
});
Loading