@akjamie/agentic-sdlc 0.0.0-stage → 1.1.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/LICENSE +21 -0
- package/README.md +219 -2
- package/assets/ci/asdlc-ai-review.yml +65 -0
- package/assets/config/config.yaml +76 -0
- package/assets/githooks/post-merge +22 -0
- package/assets/githooks/pre-push +17 -0
- package/assets/policy/policy.yaml +46 -0
- package/assets/schema/schema.yaml +168 -0
- package/assets/schema/templates/design.md +134 -0
- package/assets/schema/templates/proposal.md +25 -0
- package/assets/schema/templates/review.md +24 -0
- package/assets/schema/templates/spec.md +37 -0
- package/assets/schema/templates/tasks.md +10 -0
- package/assets/skills/asdlc-apply/SKILL.md +128 -0
- package/assets/skills/asdlc-approve/SKILL.md +107 -0
- package/assets/skills/asdlc-archive/SKILL.md +49 -0
- package/assets/skills/asdlc-doctor/SKILL.md +82 -0
- package/assets/skills/asdlc-impl-review/SKILL.md +219 -0
- package/assets/skills/asdlc-init/SKILL.md +68 -0
- package/assets/skills/asdlc-lint/SKILL.md +59 -0
- package/assets/skills/asdlc-new/SKILL.md +107 -0
- package/assets/skills/asdlc-pr/SKILL.md +59 -0
- package/assets/skills/asdlc-review/SKILL.md +80 -0
- package/assets/skills/asdlc-spec-review/SKILL.md +206 -0
- package/assets/skills/asdlc-status/SKILL.md +49 -0
- package/assets/skills/asdlc-upgrade/SKILL.md +34 -0
- package/assets/skills/asdlc-verify/SKILL.md +55 -0
- package/assets/skills/batch-grill-me/SKILL.md +136 -0
- package/assets/skills/grilling/SKILL.md +136 -0
- package/bin/asdlc.js +6 -0
- package/package.json +43 -4
- package/src/cli.js +89 -0
- package/src/commands/apply.js +114 -0
- package/src/commands/approve.js +166 -0
- package/src/commands/archive.js +143 -0
- package/src/commands/doctor.js +163 -0
- package/src/commands/init.js +201 -0
- package/src/commands/lint.js +127 -0
- package/src/commands/new.js +171 -0
- package/src/commands/pr.js +495 -0
- package/src/commands/skills.js +184 -0
- package/src/commands/status.js +65 -0
- package/src/commands/test.js +137 -0
- package/src/commands/update.js +103 -0
- package/src/commands/upgrade.js +175 -0
- package/src/commands/verify.js +229 -0
- package/src/index.js +3 -0
- package/src/lib/agents.js +73 -0
- package/src/lib/cliutil.js +99 -0
- package/src/lib/errors.js +18 -0
- package/src/lib/exec.js +23 -0
- package/src/lib/fs.js +83 -0
- package/src/lib/git.js +76 -0
- package/src/lib/graphify.js +106 -0
- package/src/lib/log.js +15 -0
- package/src/lib/openspec.js +91 -0
- package/src/lib/paths.js +43 -0
- package/src/lib/policy.js +60 -0
- package/src/lib/prtype.js +41 -0
- package/src/lib/schema.js +86 -0
- package/src/lib/speclint.js +173 -0
- package/src/lib/tdd.js +71 -0
- package/src/lib/yaml.js +18 -0
package/src/lib/tdd.js
ADDED
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
// Pure TDD analysis functions (deterministic, no side effects)
|
|
2
|
+
|
|
3
|
+
export function isTestFile(file) {
|
|
4
|
+
const normalized = String(file).replace(/\\/g, '/');
|
|
5
|
+
return (
|
|
6
|
+
/(?:^|\/)(?:tests?|__tests__|spec)\//i.test(normalized) ||
|
|
7
|
+
/\.(?:test|spec)\.[a-zA-Z0-9]+$/i.test(normalized)
|
|
8
|
+
);
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
export function isSourceFile(file) {
|
|
12
|
+
const normalized = String(file).replace(/\\/g, '/');
|
|
13
|
+
if (isTestFile(normalized)) return false;
|
|
14
|
+
// Ignore governance, docs, config, openspec change specs
|
|
15
|
+
if (/^(?:openspec|\.sdlc|docs|\.githooks|jenkins)\//i.test(normalized)) return false;
|
|
16
|
+
if (/\.(?:md|markdown|json|ya?ml|toml|lock|gitignore|editorconfig|png|jpg|svg|ico)$/i.test(normalized)) return false;
|
|
17
|
+
// Source code files
|
|
18
|
+
return (
|
|
19
|
+
/\.(?:js|mjs|cjs|ts|tsx|jsx|py|go|java|rs|rb|c|cpp|cs|php|swift|kt)$/i.test(normalized) ||
|
|
20
|
+
/^(?:src|lib|app|bin)\//i.test(normalized)
|
|
21
|
+
);
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
export function checkTestPresence(changedFiles = []) {
|
|
25
|
+
const sources = changedFiles.filter(isSourceFile);
|
|
26
|
+
const tests = changedFiles.filter(isTestFile);
|
|
27
|
+
|
|
28
|
+
if (sources.length > 0 && tests.length === 0) {
|
|
29
|
+
return {
|
|
30
|
+
ok: false,
|
|
31
|
+
sources,
|
|
32
|
+
tests,
|
|
33
|
+
detail: `${sources.length} source file(s) modified (${sources.slice(0, 3).join(', ')}${sources.length > 3 ? '...' : ''}) without corresponding test files in diff`,
|
|
34
|
+
};
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
return {
|
|
38
|
+
ok: true,
|
|
39
|
+
sources,
|
|
40
|
+
tests,
|
|
41
|
+
detail: sources.length === 0
|
|
42
|
+
? 'no source files modified'
|
|
43
|
+
: `${sources.length} source file(s), ${tests.length} test file(s) in diff`,
|
|
44
|
+
};
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
export function checkTaskEvidence(tasksText) {
|
|
48
|
+
if (!tasksText || !tasksText.trim()) {
|
|
49
|
+
return { ok: false, detail: 'tasks.md is empty' };
|
|
50
|
+
}
|
|
51
|
+
const lines = tasksText.split('\n');
|
|
52
|
+
const checked = lines.filter((l) => /^\s*-\s*\[[xX]\]/.test(l));
|
|
53
|
+
if (checked.length === 0) {
|
|
54
|
+
return { ok: false, detail: 'no completed tasks found' };
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
// Each completed task should indicate verification:
|
|
58
|
+
// e.g. verify:, test:, (test: ...), (AC...), evidence:, or [TEST]
|
|
59
|
+
const missingVerification = checked.filter((l) => {
|
|
60
|
+
return !/(?:verify:|test:|\(test:|\(AC\d+\)|evidence:|\[TEST\]|\[IMPL\])/i.test(l);
|
|
61
|
+
});
|
|
62
|
+
|
|
63
|
+
if (missingVerification.length > 0) {
|
|
64
|
+
return {
|
|
65
|
+
ok: false,
|
|
66
|
+
detail: `${missingVerification.length} completed task(s) lack verification statement or test mapping`,
|
|
67
|
+
};
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
return { ok: true, detail: `${checked.length} completed task(s) verified` };
|
|
71
|
+
}
|
package/src/lib/yaml.js
ADDED
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import YAML from 'yaml';
|
|
2
|
+
import { readText, writeText } from './fs.js';
|
|
3
|
+
|
|
4
|
+
export function parseYaml(text) {
|
|
5
|
+
return YAML.parse(text);
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
export function stringifyYaml(value) {
|
|
9
|
+
return YAML.stringify(value, { lineWidth: 0 });
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
export function readYaml(p) {
|
|
13
|
+
return parseYaml(readText(p));
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
export function writeYaml(p, value) {
|
|
17
|
+
return writeText(p, stringifyYaml(value));
|
|
18
|
+
}
|