ai-devkit 0.11.0 → 0.13.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/README.md +49 -198
- package/dist/cli.js +8 -0
- package/dist/cli.js.map +1 -1
- package/dist/commands/init.d.ts +2 -1
- package/dist/commands/init.d.ts.map +1 -1
- package/dist/commands/init.js +124 -13
- package/dist/commands/init.js.map +1 -1
- package/dist/commands/lint.d.ts +4 -0
- package/dist/commands/lint.d.ts.map +1 -0
- package/dist/commands/lint.js +53 -0
- package/dist/commands/lint.js.map +1 -0
- package/dist/commands/memory.d.ts.map +1 -1
- package/dist/commands/memory.js +40 -2
- package/dist/commands/memory.js.map +1 -1
- package/dist/commands/skill.d.ts.map +1 -1
- package/dist/commands/skill.js +2 -1
- package/dist/commands/skill.js.map +1 -1
- package/dist/lib/InitTemplate.d.ts +13 -0
- package/dist/lib/InitTemplate.d.ts.map +1 -0
- package/dist/lib/InitTemplate.js +169 -0
- package/dist/lib/InitTemplate.js.map +1 -0
- package/dist/lib/SkillManager.d.ts.map +1 -1
- package/dist/lib/SkillManager.js +9 -0
- package/dist/lib/SkillManager.js.map +1 -1
- package/dist/services/lint/constants.d.ts +14 -0
- package/dist/services/lint/constants.d.ts.map +1 -0
- package/dist/services/lint/constants.js +17 -0
- package/dist/services/lint/constants.js.map +1 -0
- package/dist/services/lint/lint.service.d.ts +6 -0
- package/dist/services/lint/lint.service.d.ts.map +1 -0
- package/dist/services/lint/lint.service.js +100 -0
- package/dist/services/lint/lint.service.js.map +1 -0
- package/dist/services/lint/rules/base-docs.rule.d.ts +3 -0
- package/dist/services/lint/rules/base-docs.rule.d.ts.map +1 -0
- package/dist/services/lint/rules/base-docs.rule.js +17 -0
- package/dist/services/lint/rules/base-docs.rule.js.map +1 -0
- package/dist/services/lint/rules/check-factories.d.ts +5 -0
- package/dist/services/lint/rules/check-factories.d.ts.map +1 -0
- package/dist/services/lint/rules/check-factories.js +36 -0
- package/dist/services/lint/rules/check-factories.js.map +1 -0
- package/dist/services/lint/rules/feature-docs.rule.d.ts +3 -0
- package/dist/services/lint/rules/feature-docs.rule.d.ts.map +1 -0
- package/dist/services/lint/rules/feature-docs.rule.js +16 -0
- package/dist/services/lint/rules/feature-docs.rule.js.map +1 -0
- package/dist/services/lint/rules/feature-name.rule.d.ts +7 -0
- package/dist/services/lint/rules/feature-name.rule.d.ts.map +1 -0
- package/dist/services/lint/rules/feature-name.rule.js +26 -0
- package/dist/services/lint/rules/feature-name.rule.js.map +1 -0
- package/dist/services/lint/rules/git-worktree.rule.d.ts +3 -0
- package/dist/services/lint/rules/git-worktree.rule.d.ts.map +1 -0
- package/dist/services/lint/rules/git-worktree.rule.js +26 -0
- package/dist/services/lint/rules/git-worktree.rule.js.map +1 -0
- package/dist/services/lint/rules/phase-docs.rule.d.ts +13 -0
- package/dist/services/lint/rules/phase-docs.rule.d.ts.map +1 -0
- package/dist/services/lint/rules/phase-docs.rule.js +54 -0
- package/dist/services/lint/rules/phase-docs.rule.js.map +1 -0
- package/dist/services/lint/types.d.ts +39 -0
- package/dist/services/lint/types.d.ts.map +1 -0
- package/dist/services/lint/types.js +3 -0
- package/dist/services/lint/types.js.map +1 -0
- package/dist/templates/commands/capture-knowledge.md +7 -45
- package/dist/templates/commands/check-implementation.md +4 -19
- package/dist/templates/commands/code-review.md +7 -81
- package/dist/templates/commands/debug.md +7 -45
- package/dist/templates/commands/execute-plan.md +6 -70
- package/dist/templates/commands/new-requirement.md +15 -128
- package/dist/templates/commands/remember.md +4 -21
- package/dist/templates/commands/review-design.md +1 -2
- package/dist/templates/commands/review-requirements.md +2 -3
- package/dist/templates/commands/simplify-implementation.md +6 -144
- package/dist/templates/commands/update-planning.md +6 -61
- package/dist/templates/commands/writing-test.md +6 -42
- package/dist/templates/templates/commands/capture-knowledge.md +7 -45
- package/dist/templates/templates/commands/check-implementation.md +4 -19
- package/dist/templates/templates/commands/code-review.md +7 -81
- package/dist/templates/templates/commands/debug.md +7 -45
- package/dist/templates/templates/commands/execute-plan.md +6 -70
- package/dist/templates/templates/commands/new-requirement.md +15 -128
- package/dist/templates/templates/commands/remember.md +4 -21
- package/dist/templates/templates/commands/review-design.md +1 -2
- package/dist/templates/templates/commands/review-requirements.md +2 -3
- package/dist/templates/templates/commands/simplify-implementation.md +6 -144
- package/dist/templates/templates/commands/update-planning.md +6 -61
- package/dist/templates/templates/commands/writing-test.md +6 -42
- package/dist/util/env.js +1 -1
- package/dist/util/env.js.map +1 -1
- package/dist/util/git.d.ts +8 -0
- package/dist/util/git.d.ts.map +1 -1
- package/dist/util/git.js +69 -0
- package/dist/util/git.js.map +1 -1
- package/dist/util/text.d.ts +2 -0
- package/dist/util/text.d.ts.map +1 -0
- package/dist/util/text.js +16 -0
- package/dist/util/text.js.map +1 -0
- package/package.json +2 -2
- package/templates/commands/capture-knowledge.md +7 -45
- package/templates/commands/check-implementation.md +4 -19
- package/templates/commands/code-review.md +7 -81
- package/templates/commands/debug.md +7 -45
- package/templates/commands/execute-plan.md +6 -70
- package/templates/commands/new-requirement.md +15 -128
- package/templates/commands/remember.md +4 -21
- package/templates/commands/review-design.md +1 -2
- package/templates/commands/review-requirements.md +2 -3
- package/templates/commands/simplify-implementation.md +6 -144
- package/templates/commands/update-planning.md +6 -61
- package/templates/commands/writing-test.md +6 -42
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.runBaseDocsRules = runBaseDocsRules;
|
|
4
|
+
const constants_1 = require("../constants");
|
|
5
|
+
const phase_docs_rule_1 = require("./phase-docs.rule");
|
|
6
|
+
function runBaseDocsRules(cwd, deps) {
|
|
7
|
+
return (0, phase_docs_rule_1.runPhaseDocRules)({
|
|
8
|
+
cwd,
|
|
9
|
+
phases: constants_1.LIFECYCLE_PHASES,
|
|
10
|
+
idPrefix: 'base',
|
|
11
|
+
category: 'base-docs',
|
|
12
|
+
filePathForPhase: (phase) => `${constants_1.DOCS_DIR}/${phase}/README.md`,
|
|
13
|
+
missingFix: 'Run: npx ai-devkit init',
|
|
14
|
+
deps
|
|
15
|
+
});
|
|
16
|
+
}
|
|
17
|
+
//# sourceMappingURL=base-docs.rule.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"base-docs.rule.js","sourceRoot":"","sources":["../../../../src/services/lint/rules/base-docs.rule.ts"],"names":[],"mappings":";;AAIA,4CAUC;AAdD,4CAA0D;AAE1D,uDAAqD;AAErD,SAAgB,gBAAgB,CAAC,GAAW,EAAE,IAAsB;IAClE,OAAO,IAAA,kCAAgB,EAAC;QACtB,GAAG;QACH,MAAM,EAAE,4BAAgB;QACxB,QAAQ,EAAE,MAAM;QAChB,QAAQ,EAAE,WAAW;QACrB,gBAAgB,EAAE,CAAC,KAAa,EAAE,EAAE,CAAC,GAAG,oBAAQ,IAAI,KAAK,YAAY;QACrE,UAAU,EAAE,yBAAyB;QACrC,IAAI;KACL,CAAC,CAAC;AACL,CAAC"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { LintCheckResult } from '../types';
|
|
2
|
+
export declare function createOkCheck(id: string, category: LintCheckResult['category'], message: string): LintCheckResult;
|
|
3
|
+
export declare function createMissingCheck(id: string, category: LintCheckResult['category'], message: string, fix?: string): LintCheckResult;
|
|
4
|
+
export declare function createWarnCheck(id: string, category: LintCheckResult['category'], message: string, fix?: string): LintCheckResult;
|
|
5
|
+
//# sourceMappingURL=check-factories.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"check-factories.d.ts","sourceRoot":"","sources":["../../../../src/services/lint/rules/check-factories.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,UAAU,CAAC;AAG3C,wBAAgB,aAAa,CAC3B,EAAE,EAAE,MAAM,EACV,QAAQ,EAAE,eAAe,CAAC,UAAU,CAAC,EACrC,OAAO,EAAE,MAAM,GACd,eAAe,CAQjB;AAED,wBAAgB,kBAAkB,CAChC,EAAE,EAAE,MAAM,EACV,QAAQ,EAAE,eAAe,CAAC,UAAU,CAAC,EACrC,OAAO,EAAE,MAAM,EACf,GAAG,CAAC,EAAE,MAAM,GACX,eAAe,CASjB;AAED,wBAAgB,eAAe,CAC7B,EAAE,EAAE,MAAM,EACV,QAAQ,EAAE,eAAe,CAAC,UAAU,CAAC,EACrC,OAAO,EAAE,MAAM,EACf,GAAG,CAAC,EAAE,MAAM,GACX,eAAe,CASjB"}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.createOkCheck = createOkCheck;
|
|
4
|
+
exports.createMissingCheck = createMissingCheck;
|
|
5
|
+
exports.createWarnCheck = createWarnCheck;
|
|
6
|
+
const constants_1 = require("../constants");
|
|
7
|
+
function createOkCheck(id, category, message) {
|
|
8
|
+
return {
|
|
9
|
+
id,
|
|
10
|
+
level: constants_1.LINT_LEVEL.OK,
|
|
11
|
+
category,
|
|
12
|
+
required: false,
|
|
13
|
+
message
|
|
14
|
+
};
|
|
15
|
+
}
|
|
16
|
+
function createMissingCheck(id, category, message, fix) {
|
|
17
|
+
return {
|
|
18
|
+
id,
|
|
19
|
+
level: constants_1.LINT_LEVEL.MISS,
|
|
20
|
+
category,
|
|
21
|
+
required: true,
|
|
22
|
+
message,
|
|
23
|
+
fix
|
|
24
|
+
};
|
|
25
|
+
}
|
|
26
|
+
function createWarnCheck(id, category, message, fix) {
|
|
27
|
+
return {
|
|
28
|
+
id,
|
|
29
|
+
level: constants_1.LINT_LEVEL.WARN,
|
|
30
|
+
category,
|
|
31
|
+
required: false,
|
|
32
|
+
message,
|
|
33
|
+
fix
|
|
34
|
+
};
|
|
35
|
+
}
|
|
36
|
+
//# sourceMappingURL=check-factories.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"check-factories.js","sourceRoot":"","sources":["../../../../src/services/lint/rules/check-factories.ts"],"names":[],"mappings":";;AAGA,sCAYC;AAED,gDAcC;AAED,0CAcC;AA9CD,4CAA0C;AAE1C,SAAgB,aAAa,CAC3B,EAAU,EACV,QAAqC,EACrC,OAAe;IAEf,OAAO;QACL,EAAE;QACF,KAAK,EAAE,sBAAU,CAAC,EAAE;QACpB,QAAQ;QACR,QAAQ,EAAE,KAAK;QACf,OAAO;KACR,CAAC;AACJ,CAAC;AAED,SAAgB,kBAAkB,CAChC,EAAU,EACV,QAAqC,EACrC,OAAe,EACf,GAAY;IAEZ,OAAO;QACL,EAAE;QACF,KAAK,EAAE,sBAAU,CAAC,IAAI;QACtB,QAAQ;QACR,QAAQ,EAAE,IAAI;QACd,OAAO;QACP,GAAG;KACJ,CAAC;AACJ,CAAC;AAED,SAAgB,eAAe,CAC7B,EAAU,EACV,QAAqC,EACrC,OAAe,EACf,GAAY;IAEZ,OAAO;QACL,EAAE;QACF,KAAK,EAAE,sBAAU,CAAC,IAAI;QACtB,QAAQ;QACR,QAAQ,EAAE,KAAK;QACf,OAAO;QACP,GAAG;KACJ,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"feature-docs.rule.d.ts","sourceRoot":"","sources":["../../../../src/services/lint/rules/feature-docs.rule.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,eAAe,EAAE,gBAAgB,EAAE,MAAM,UAAU,CAAC;AAG7D,wBAAgB,mBAAmB,CACjC,GAAG,EAAE,MAAM,EACX,cAAc,EAAE,MAAM,EACtB,IAAI,EAAE,gBAAgB,GACrB,eAAe,EAAE,CASnB"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.runFeatureDocsRules = runFeatureDocsRules;
|
|
4
|
+
const constants_1 = require("../constants");
|
|
5
|
+
const phase_docs_rule_1 = require("./phase-docs.rule");
|
|
6
|
+
function runFeatureDocsRules(cwd, normalizedName, deps) {
|
|
7
|
+
return (0, phase_docs_rule_1.runPhaseDocRules)({
|
|
8
|
+
cwd,
|
|
9
|
+
phases: constants_1.LIFECYCLE_PHASES,
|
|
10
|
+
idPrefix: 'feature-doc',
|
|
11
|
+
category: 'feature-docs',
|
|
12
|
+
filePathForPhase: (phase) => `${constants_1.DOCS_DIR}/${phase}/feature-${normalizedName}.md`,
|
|
13
|
+
deps
|
|
14
|
+
});
|
|
15
|
+
}
|
|
16
|
+
//# sourceMappingURL=feature-docs.rule.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"feature-docs.rule.js","sourceRoot":"","sources":["../../../../src/services/lint/rules/feature-docs.rule.ts"],"names":[],"mappings":";;AAIA,kDAaC;AAjBD,4CAA0D;AAE1D,uDAAqD;AAErD,SAAgB,mBAAmB,CACjC,GAAW,EACX,cAAsB,EACtB,IAAsB;IAEtB,OAAO,IAAA,kCAAgB,EAAC;QACtB,GAAG;QACH,MAAM,EAAE,4BAAgB;QACxB,QAAQ,EAAE,aAAa;QACvB,QAAQ,EAAE,cAAc;QACxB,gBAAgB,EAAE,CAAC,KAAa,EAAE,EAAE,CAAC,GAAG,oBAAQ,IAAI,KAAK,YAAY,cAAc,KAAK;QACxF,IAAI;KACL,CAAC,CAAC;AACL,CAAC"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { FeatureTarget, LintCheckResult } from '../types';
|
|
2
|
+
export declare function normalizeFeatureName(input: string): string;
|
|
3
|
+
export declare function validateFeatureNameRule(rawFeature: string): {
|
|
4
|
+
target: FeatureTarget;
|
|
5
|
+
check?: LintCheckResult;
|
|
6
|
+
};
|
|
7
|
+
//# sourceMappingURL=feature-name.rule.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"feature-name.rule.d.ts","sourceRoot":"","sources":["../../../../src/services/lint/rules/feature-name.rule.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,aAAa,EAAE,eAAe,EAAE,MAAM,UAAU,CAAC;AAG1D,wBAAgB,oBAAoB,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAG1D;AAED,wBAAgB,uBAAuB,CAAC,UAAU,EAAE,MAAM,GAAG;IAC3D,MAAM,EAAE,aAAa,CAAC;IACtB,KAAK,CAAC,EAAE,eAAe,CAAC;CACzB,CAqBA"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.normalizeFeatureName = normalizeFeatureName;
|
|
4
|
+
exports.validateFeatureNameRule = validateFeatureNameRule;
|
|
5
|
+
const constants_1 = require("../constants");
|
|
6
|
+
const check_factories_1 = require("./check-factories");
|
|
7
|
+
function normalizeFeatureName(input) {
|
|
8
|
+
const trimmed = input.trim();
|
|
9
|
+
return trimmed.startsWith('feature-') ? trimmed.slice('feature-'.length) : trimmed;
|
|
10
|
+
}
|
|
11
|
+
function validateFeatureNameRule(rawFeature) {
|
|
12
|
+
const normalizedName = normalizeFeatureName(rawFeature);
|
|
13
|
+
const target = {
|
|
14
|
+
raw: rawFeature,
|
|
15
|
+
normalizedName,
|
|
16
|
+
branchName: `feature-${normalizedName}`
|
|
17
|
+
};
|
|
18
|
+
if (constants_1.FEATURE_NAME_PATTERN.test(normalizedName)) {
|
|
19
|
+
return { target };
|
|
20
|
+
}
|
|
21
|
+
return {
|
|
22
|
+
target,
|
|
23
|
+
check: (0, check_factories_1.createMissingCheck)('feature-name', 'feature-docs', `Invalid feature name: ${rawFeature}`, 'Use kebab-case and optionally prefix with feature- (example: lint-command or feature-lint-command).')
|
|
24
|
+
};
|
|
25
|
+
}
|
|
26
|
+
//# sourceMappingURL=feature-name.rule.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"feature-name.rule.js","sourceRoot":"","sources":["../../../../src/services/lint/rules/feature-name.rule.ts"],"names":[],"mappings":";;AAIA,oDAGC;AAED,0DAwBC;AAjCD,4CAAoD;AAEpD,uDAAuD;AAEvD,SAAgB,oBAAoB,CAAC,KAAa;IAChD,MAAM,OAAO,GAAG,KAAK,CAAC,IAAI,EAAE,CAAC;IAC7B,OAAO,OAAO,CAAC,UAAU,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,KAAK,CAAC,UAAU,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC;AACrF,CAAC;AAED,SAAgB,uBAAuB,CAAC,UAAkB;IAIxD,MAAM,cAAc,GAAG,oBAAoB,CAAC,UAAU,CAAC,CAAC;IACxD,MAAM,MAAM,GAAkB;QAC5B,GAAG,EAAE,UAAU;QACf,cAAc;QACd,UAAU,EAAE,WAAW,cAAc,EAAE;KACxC,CAAC;IAEF,IAAI,gCAAoB,CAAC,IAAI,CAAC,cAAc,CAAC,EAAE,CAAC;QAC9C,OAAO,EAAE,MAAM,EAAE,CAAC;IACpB,CAAC;IAED,OAAO;QACL,MAAM;QACN,KAAK,EAAE,IAAA,oCAAkB,EACvB,cAAc,EACd,cAAc,EACd,yBAAyB,UAAU,EAAE,EACrC,qGAAqG,CACtG;KACF,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"git-worktree.rule.d.ts","sourceRoot":"","sources":["../../../../src/services/lint/rules/git-worktree.rule.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,eAAe,EAAE,gBAAgB,EAAE,MAAM,UAAU,CAAC;AAG7D,wBAAgB,mBAAmB,CACjC,GAAG,EAAE,MAAM,EACX,UAAU,EAAE,MAAM,EAClB,IAAI,EAAE,gBAAgB,GACrB,eAAe,EAAE,CAgDnB"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.runGitWorktreeRules = runGitWorktreeRules;
|
|
4
|
+
const git_1 = require("../../../util/git");
|
|
5
|
+
const check_factories_1 = require("./check-factories");
|
|
6
|
+
function runGitWorktreeRules(cwd, branchName, deps) {
|
|
7
|
+
const checks = [];
|
|
8
|
+
if (!(0, git_1.isInsideGitWorkTreeSync)(cwd, deps.execFileSync)) {
|
|
9
|
+
checks.push((0, check_factories_1.createMissingCheck)('git-repo', 'git-worktree', 'Current directory is not inside a git repository', 'Run lint --feature from the repository root or a repo worktree.'));
|
|
10
|
+
return checks;
|
|
11
|
+
}
|
|
12
|
+
const branchExists = (0, git_1.localBranchExistsSync)(cwd, branchName, deps.execFileSync);
|
|
13
|
+
if (!branchExists) {
|
|
14
|
+
checks.push((0, check_factories_1.createMissingCheck)('git-branch', 'git-worktree', `Branch ${branchName} does not exist`, `Run: git worktree add -b ${branchName} ../${branchName}`));
|
|
15
|
+
return checks;
|
|
16
|
+
}
|
|
17
|
+
checks.push((0, check_factories_1.createOkCheck)('git-branch', 'git-worktree', `Branch ${branchName} exists`));
|
|
18
|
+
const worktreePaths = (0, git_1.getWorktreePathsForBranchSync)(cwd, branchName, deps.execFileSync);
|
|
19
|
+
if (worktreePaths.length === 0) {
|
|
20
|
+
checks.push((0, check_factories_1.createWarnCheck)('git-worktree', 'git-worktree', `No dedicated worktree registered for ${branchName}`, `Suggested: git worktree add ../${branchName} ${branchName}`));
|
|
21
|
+
return checks;
|
|
22
|
+
}
|
|
23
|
+
checks.push((0, check_factories_1.createOkCheck)('git-worktree', 'git-worktree', `Worktree detected for ${branchName}: ${worktreePaths.join(', ')}`));
|
|
24
|
+
return checks;
|
|
25
|
+
}
|
|
26
|
+
//# sourceMappingURL=git-worktree.rule.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"git-worktree.rule.js","sourceRoot":"","sources":["../../../../src/services/lint/rules/git-worktree.rule.ts"],"names":[],"mappings":";;AAQA,kDAoDC;AA5DD,2CAI2B;AAE3B,uDAAuF;AAEvF,SAAgB,mBAAmB,CACjC,GAAW,EACX,UAAkB,EAClB,IAAsB;IAEtB,MAAM,MAAM,GAAsB,EAAE,CAAC;IAErC,IAAI,CAAC,IAAA,6BAAuB,EAAC,GAAG,EAAE,IAAI,CAAC,YAAY,CAAC,EAAE,CAAC;QACrD,MAAM,CAAC,IAAI,CACT,IAAA,oCAAkB,EAChB,UAAU,EACV,cAAc,EACd,kDAAkD,EAClD,iEAAiE,CAClE,CACF,CAAC;QACF,OAAO,MAAM,CAAC;IAChB,CAAC;IAED,MAAM,YAAY,GAAG,IAAA,2BAAqB,EAAC,GAAG,EAAE,UAAU,EAAE,IAAI,CAAC,YAAY,CAAC,CAAC;IAC/E,IAAI,CAAC,YAAY,EAAE,CAAC;QAClB,MAAM,CAAC,IAAI,CACT,IAAA,oCAAkB,EAChB,YAAY,EACZ,cAAc,EACd,UAAU,UAAU,iBAAiB,EACrC,4BAA4B,UAAU,OAAO,UAAU,EAAE,CAC1D,CACF,CAAC;QACF,OAAO,MAAM,CAAC;IAChB,CAAC;IAED,MAAM,CAAC,IAAI,CAAC,IAAA,+BAAa,EAAC,YAAY,EAAE,cAAc,EAAE,UAAU,UAAU,SAAS,CAAC,CAAC,CAAC;IAExF,MAAM,aAAa,GAAG,IAAA,mCAA6B,EAAC,GAAG,EAAE,UAAU,EAAE,IAAI,CAAC,YAAY,CAAC,CAAC;IACxF,IAAI,aAAa,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QAC/B,MAAM,CAAC,IAAI,CACT,IAAA,iCAAe,EACb,cAAc,EACd,cAAc,EACd,wCAAwC,UAAU,EAAE,EACpD,kCAAkC,UAAU,IAAI,UAAU,EAAE,CAC7D,CACF,CAAC;QACF,OAAO,MAAM,CAAC;IAChB,CAAC;IAED,MAAM,CAAC,IAAI,CACT,IAAA,+BAAa,EAAC,cAAc,EAAE,cAAc,EAAE,yBAAyB,UAAU,KAAK,aAAa,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,CAClH,CAAC;IAEF,OAAO,MAAM,CAAC;AAChB,CAAC"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { LintCheckResult, LintDependencies } from '../types';
|
|
2
|
+
interface PhaseDocRuleParams {
|
|
3
|
+
cwd: string;
|
|
4
|
+
phases: readonly string[];
|
|
5
|
+
idPrefix: string;
|
|
6
|
+
category: LintCheckResult['category'];
|
|
7
|
+
filePathForPhase: (phase: string) => string;
|
|
8
|
+
missingFix?: string;
|
|
9
|
+
deps: LintDependencies;
|
|
10
|
+
}
|
|
11
|
+
export declare function runPhaseDocRules(params: PhaseDocRuleParams): LintCheckResult[];
|
|
12
|
+
export {};
|
|
13
|
+
//# sourceMappingURL=phase-docs.rule.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"phase-docs.rule.d.ts","sourceRoot":"","sources":["../../../../src/services/lint/rules/phase-docs.rule.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,eAAe,EAAE,gBAAgB,EAAE,MAAM,UAAU,CAAC;AAG7D,UAAU,kBAAkB;IAC1B,GAAG,EAAE,MAAM,CAAC;IACZ,MAAM,EAAE,SAAS,MAAM,EAAE,CAAC;IAC1B,QAAQ,EAAE,MAAM,CAAC;IACjB,QAAQ,EAAE,eAAe,CAAC,UAAU,CAAC,CAAC;IACtC,gBAAgB,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,MAAM,CAAC;IAC5C,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,IAAI,EAAE,gBAAgB,CAAC;CACxB;AAED,wBAAgB,gBAAgB,CAAC,MAAM,EAAE,kBAAkB,GAAG,eAAe,EAAE,CAkB9E"}
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
35
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
|
+
exports.runPhaseDocRules = runPhaseDocRules;
|
|
37
|
+
const path = __importStar(require("path"));
|
|
38
|
+
const check_factories_1 = require("./check-factories");
|
|
39
|
+
function runPhaseDocRules(params) {
|
|
40
|
+
const checks = [];
|
|
41
|
+
const { cwd, phases, idPrefix, category, filePathForPhase, missingFix, deps } = params;
|
|
42
|
+
for (const phase of phases) {
|
|
43
|
+
const relativePath = filePathForPhase(phase);
|
|
44
|
+
const absolutePath = path.join(cwd, relativePath);
|
|
45
|
+
const id = `${idPrefix}-${phase}`;
|
|
46
|
+
if (deps.existsSync(absolutePath)) {
|
|
47
|
+
checks.push((0, check_factories_1.createOkCheck)(id, category, relativePath));
|
|
48
|
+
continue;
|
|
49
|
+
}
|
|
50
|
+
checks.push((0, check_factories_1.createMissingCheck)(id, category, relativePath, missingFix));
|
|
51
|
+
}
|
|
52
|
+
return checks;
|
|
53
|
+
}
|
|
54
|
+
//# sourceMappingURL=phase-docs.rule.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"phase-docs.rule.js","sourceRoot":"","sources":["../../../../src/services/lint/rules/phase-docs.rule.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAcA,4CAkBC;AAhCD,2CAA6B;AAE7B,uDAAsE;AAYtE,SAAgB,gBAAgB,CAAC,MAA0B;IACzD,MAAM,MAAM,GAAsB,EAAE,CAAC;IACrC,MAAM,EAAE,GAAG,EAAE,MAAM,EAAE,QAAQ,EAAE,QAAQ,EAAE,gBAAgB,EAAE,UAAU,EAAE,IAAI,EAAE,GAAG,MAAM,CAAC;IAEvF,KAAK,MAAM,KAAK,IAAI,MAAM,EAAE,CAAC;QAC3B,MAAM,YAAY,GAAG,gBAAgB,CAAC,KAAK,CAAC,CAAC;QAC7C,MAAM,YAAY,GAAG,IAAI,CAAC,IAAI,CAAC,GAAG,EAAE,YAAY,CAAC,CAAC;QAClD,MAAM,EAAE,GAAG,GAAG,QAAQ,IAAI,KAAK,EAAE,CAAC;QAElC,IAAI,IAAI,CAAC,UAAU,CAAC,YAAY,CAAC,EAAE,CAAC;YAClC,MAAM,CAAC,IAAI,CAAC,IAAA,+BAAa,EAAC,EAAE,EAAE,QAAQ,EAAE,YAAY,CAAC,CAAC,CAAC;YACvD,SAAS;QACX,CAAC;QAED,MAAM,CAAC,IAAI,CAAC,IAAA,oCAAkB,EAAC,EAAE,EAAE,QAAQ,EAAE,YAAY,EAAE,UAAU,CAAC,CAAC,CAAC;IAC1E,CAAC;IAED,OAAO,MAAM,CAAC;AAChB,CAAC"}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { GitExecFileSync } from '../../util/git';
|
|
2
|
+
import { LINT_LEVEL } from './constants';
|
|
3
|
+
export interface LintOptions {
|
|
4
|
+
feature?: string;
|
|
5
|
+
json?: boolean;
|
|
6
|
+
}
|
|
7
|
+
export type LintLevel = (typeof LINT_LEVEL)[keyof typeof LINT_LEVEL];
|
|
8
|
+
export interface LintCheckResult {
|
|
9
|
+
id: string;
|
|
10
|
+
level: LintLevel;
|
|
11
|
+
category: 'base-docs' | 'feature-docs' | 'git-worktree';
|
|
12
|
+
required: boolean;
|
|
13
|
+
message: string;
|
|
14
|
+
fix?: string;
|
|
15
|
+
}
|
|
16
|
+
export interface LintReport {
|
|
17
|
+
cwd: string;
|
|
18
|
+
feature?: FeatureTarget;
|
|
19
|
+
checks: LintCheckResult[];
|
|
20
|
+
summary: {
|
|
21
|
+
ok: number;
|
|
22
|
+
miss: number;
|
|
23
|
+
warn: number;
|
|
24
|
+
requiredFailures: number;
|
|
25
|
+
};
|
|
26
|
+
pass: boolean;
|
|
27
|
+
exitCode: 0 | 1;
|
|
28
|
+
}
|
|
29
|
+
export interface FeatureTarget {
|
|
30
|
+
raw: string;
|
|
31
|
+
normalizedName: string;
|
|
32
|
+
branchName: string;
|
|
33
|
+
}
|
|
34
|
+
export interface LintDependencies {
|
|
35
|
+
cwd: () => string;
|
|
36
|
+
existsSync: (targetPath: string) => boolean;
|
|
37
|
+
execFileSync: GitExecFileSync;
|
|
38
|
+
}
|
|
39
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/services/lint/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAC;AACjD,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAEzC,MAAM,WAAW,WAAW;IAC1B,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,IAAI,CAAC,EAAE,OAAO,CAAC;CAChB;AAED,MAAM,MAAM,SAAS,GAAG,CAAC,OAAO,UAAU,CAAC,CAAC,MAAM,OAAO,UAAU,CAAC,CAAC;AAErE,MAAM,WAAW,eAAe;IAC9B,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,EAAE,SAAS,CAAC;IACjB,QAAQ,EAAE,WAAW,GAAG,cAAc,GAAG,cAAc,CAAC;IACxD,QAAQ,EAAE,OAAO,CAAC;IAClB,OAAO,EAAE,MAAM,CAAC;IAChB,GAAG,CAAC,EAAE,MAAM,CAAC;CACd;AAED,MAAM,WAAW,UAAU;IACzB,GAAG,EAAE,MAAM,CAAC;IACZ,OAAO,CAAC,EAAE,aAAa,CAAC;IACxB,MAAM,EAAE,eAAe,EAAE,CAAC;IAC1B,OAAO,EAAE;QACP,EAAE,EAAE,MAAM,CAAC;QACX,IAAI,EAAE,MAAM,CAAC;QACb,IAAI,EAAE,MAAM,CAAC;QACb,gBAAgB,EAAE,MAAM,CAAC;KAC1B,CAAC;IACF,IAAI,EAAE,OAAO,CAAC;IACd,QAAQ,EAAE,CAAC,GAAG,CAAC,CAAC;CACjB;AAED,MAAM,WAAW,aAAa;IAC5B,GAAG,EAAE,MAAM,CAAC;IACZ,cAAc,EAAE,MAAM,CAAC;IACvB,UAAU,EAAE,MAAM,CAAC;CACpB;AAED,MAAM,WAAW,gBAAgB;IAC/B,GAAG,EAAE,MAAM,MAAM,CAAC;IAClB,UAAU,EAAE,CAAC,UAAU,EAAE,MAAM,KAAK,OAAO,CAAC;IAC5C,YAAY,EAAE,eAAe,CAAC;CAC/B"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/services/lint/types.ts"],"names":[],"mappings":""}
|
|
@@ -1,50 +1,12 @@
|
|
|
1
1
|
---
|
|
2
|
-
description:
|
|
2
|
+
description: Document a code entry point in knowledge docs.
|
|
3
3
|
---
|
|
4
4
|
|
|
5
|
-
# Knowledge Capture Assistant
|
|
6
|
-
|
|
7
5
|
Guide me through creating a structured understanding of a code entry point and saving it to the knowledge docs.
|
|
8
6
|
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
-
|
|
14
|
-
|
|
15
|
-
## Step 2: Validate Entry Point
|
|
16
|
-
- Determine entry point type and confirm it exists
|
|
17
|
-
- Surface ambiguity (multiple matches) and ask for clarification
|
|
18
|
-
- If not found, suggest likely alternatives or spelling fixes
|
|
19
|
-
|
|
20
|
-
## Step 3: Collect Source Context
|
|
21
|
-
- Read the primary file/module and summarize purpose, exports, key patterns
|
|
22
|
-
- For folders: list structure, highlight key modules
|
|
23
|
-
- For functions/APIs: capture signature, parameters, return values, error handling
|
|
24
|
-
- Extract essential snippets (avoid large dumps)
|
|
25
|
-
|
|
26
|
-
## Step 4: Analyze Dependencies
|
|
27
|
-
- Build a dependency view up to depth 3
|
|
28
|
-
- Track visited nodes to avoid loops
|
|
29
|
-
- Categorize dependencies (imports, function calls, services, external packages)
|
|
30
|
-
- Note important external systems or generated code that should be excluded
|
|
31
|
-
|
|
32
|
-
## Step 5: Synthesize Explanation
|
|
33
|
-
- Draft an overview (purpose, language, high-level behavior)
|
|
34
|
-
- Detail core logic, key components, execution flow, patterns
|
|
35
|
-
- Highlight error handling, performance, security considerations
|
|
36
|
-
- Identify potential improvements or risks discovered during analysis
|
|
37
|
-
|
|
38
|
-
## Step 6: Create Documentation
|
|
39
|
-
- Normalize entry point name to kebab-case (`calculateTotalPrice` → `calculate-total-price`)
|
|
40
|
-
- Create `docs/ai/implementation/knowledge-{name}.md` using the headings implied in Step 5 (Overview, Implementation Details, Dependencies, Visual Diagrams, Additional Insights, Metadata, Next Steps)
|
|
41
|
-
- Populate sections with findings, diagrams, and metadata (analysis date, depth, files touched)
|
|
42
|
-
- Include mermaid diagrams when they clarify flows or relationships
|
|
43
|
-
|
|
44
|
-
## Step 7: Review & Next Actions
|
|
45
|
-
- Summarize key insights and open questions for follow-up
|
|
46
|
-
- Suggest related areas for deeper dives or refactors
|
|
47
|
-
- Confirm the knowledge file path and remind to commit it
|
|
48
|
-
- Encourage running `/capture-knowledge` again for related entry points if needed
|
|
49
|
-
|
|
50
|
-
Let me know the entry point and goals when you’re ready to begin the knowledge capture.
|
|
7
|
+
1. **Gather & Validate Entry Point** — If not already provided, ask for: entry point (file, folder, function, API), why it matters (feature, bug, investigation), and desired depth or focus areas. Confirm the entry point exists; if ambiguous or not found, clarify or suggest alternatives.
|
|
8
|
+
2. **Collect Source Context** — Read the primary file/module and summarize purpose, exports, key patterns. For folders: list structure, highlight key modules. For functions/APIs: capture signature, parameters, return values, error handling. Extract essential snippets (avoid large dumps).
|
|
9
|
+
3. **Analyze Dependencies** — Build a dependency view up to depth 3, tracking visited nodes to avoid loops. Categorize: imports, function calls, services, external packages. Note external systems or generated code to exclude.
|
|
10
|
+
4. **Synthesize Explanation** — Draft overview (purpose, language, high-level behavior). Detail core logic, execution flow, key patterns. Highlight error handling, performance, security considerations. Identify potential improvements or risks.
|
|
11
|
+
5. **Create Documentation** — Normalize name to kebab-case (`calculateTotalPrice` → `calculate-total-price`). Create `docs/ai/implementation/knowledge-{name}.md` with sections: Overview, Implementation Details, Dependencies, Visual Diagrams, Additional Insights, Metadata, Next Steps. Include mermaid diagrams when they clarify flows or relationships. Add metadata (analysis date, depth, files touched).
|
|
12
|
+
6. **Review & Next Actions** — Summarize key insights and open questions. Suggest related areas for deeper dives. Confirm file path and remind to commit.
|
|
@@ -2,24 +2,9 @@
|
|
|
2
2
|
description: Compare implementation with design and requirements docs to ensure alignment.
|
|
3
3
|
---
|
|
4
4
|
|
|
5
|
-
Compare the current implementation with the design in docs/ai/design/ and requirements in docs/ai/requirements/.
|
|
6
|
-
|
|
7
|
-
1. Ask me for:
|
|
8
|
-
- Feature/branch description
|
|
9
|
-
- List of modified files
|
|
10
|
-
- Relevant design doc(s) (feature-specific and/or project-level)
|
|
11
|
-
- Any known constraints or assumptions
|
|
12
|
-
|
|
13
|
-
2. For each design doc:
|
|
14
|
-
- Summarize key architectural decisions and constraints
|
|
15
|
-
- Highlight components, interfaces, and data flows that must be respected
|
|
16
|
-
|
|
17
|
-
3. File-by-file comparison:
|
|
18
|
-
- Confirm implementation matches design intent
|
|
19
|
-
- Note deviations or missing pieces
|
|
20
|
-
- Flag logic gaps, edge cases, or security issues
|
|
21
|
-
- Suggest simplifications or refactors
|
|
22
|
-
- Identify missing tests or documentation updates
|
|
5
|
+
Compare the current implementation with the design in docs/ai/design/ and requirements in docs/ai/requirements/.
|
|
23
6
|
|
|
7
|
+
1. If not already provided, ask for: feature/branch description, list of modified files, relevant design doc(s), and any known constraints or assumptions.
|
|
8
|
+
2. For each design doc: summarize key architectural decisions and constraints, highlight components, interfaces, and data flows that must be respected.
|
|
9
|
+
3. File-by-file comparison: confirm implementation matches design intent, note deviations or missing pieces, flag logic gaps, edge cases, or security issues, suggest simplifications or refactors, and identify missing tests or documentation updates.
|
|
24
10
|
4. Summarize findings with recommended next steps.
|
|
25
|
-
|
|
@@ -1,85 +1,11 @@
|
|
|
1
1
|
---
|
|
2
|
-
description:
|
|
2
|
+
description: Pre-push code review against design docs.
|
|
3
3
|
---
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
Perform a local code review **before** pushing changes.
|
|
6
6
|
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
-
|
|
12
|
-
- List of modified files (with optional summaries)
|
|
13
|
-
- Relevant design doc(s) (e.g., `docs/ai/design/feature-{name}.md` or project-level design)
|
|
14
|
-
- Any known constraints or risky areas
|
|
15
|
-
- Any open bugs or TODOs linked to this work
|
|
16
|
-
- Which tests have already been run
|
|
17
|
-
|
|
18
|
-
If possible, request the latest diff:
|
|
19
|
-
```bash
|
|
20
|
-
git status -sb
|
|
21
|
-
git diff --stat
|
|
22
|
-
```
|
|
23
|
-
|
|
24
|
-
## Step 2: Understand Design Alignment
|
|
25
|
-
For each provided design doc:
|
|
26
|
-
- Summarize the architectural intent
|
|
27
|
-
- Note critical requirements, patterns, or constraints the design mandates
|
|
28
|
-
|
|
29
|
-
## Step 3: File-by-File Review
|
|
30
|
-
For every modified file:
|
|
31
|
-
1. Highlight deviations from the referenced design or requirements
|
|
32
|
-
2. Spot potential logic or flow issues and edge cases
|
|
33
|
-
3. Identify redundant or duplicate code
|
|
34
|
-
4. Suggest simplifications or refactors (prefer clarity over cleverness)
|
|
35
|
-
5. Flag security concerns (input validation, secrets, auth, data handling)
|
|
36
|
-
6. Check for performance pitfalls or scalability risks
|
|
37
|
-
7. Ensure error handling, logging, and observability are appropriate
|
|
38
|
-
8. Note any missing comments or docs
|
|
39
|
-
9. Flag missing or outdated tests related to this file
|
|
40
|
-
|
|
41
|
-
## Step 4: Cross-Cutting Concerns
|
|
42
|
-
- Verify naming consistency and adherence to project conventions
|
|
43
|
-
- Confirm documentation/comments are updated where the behavior changed
|
|
44
|
-
- Identify missing tests (unit, integration, E2E) needed to cover the changes
|
|
45
|
-
- Ensure configuration/migration updates are captured if applicable
|
|
46
|
-
|
|
47
|
-
## Step 5: Summarize Findings
|
|
48
|
-
Provide results in this structure:
|
|
49
|
-
```
|
|
50
|
-
### Summary
|
|
51
|
-
- Blocking issues: [count]
|
|
52
|
-
- Important follow-ups: [count]
|
|
53
|
-
- Nice-to-have improvements: [count]
|
|
54
|
-
|
|
55
|
-
### Detailed Notes
|
|
56
|
-
1. **[File or Component]**
|
|
57
|
-
- Issue/Observation: ...
|
|
58
|
-
- Impact: (e.g., blocking / important / nice-to-have)
|
|
59
|
-
- Recommendation: ...
|
|
60
|
-
- Design reference: [...]
|
|
61
|
-
|
|
62
|
-
2. ... (repeat per finding)
|
|
63
|
-
|
|
64
|
-
### Recommended Next Steps
|
|
65
|
-
- [ ] Address blocking issues
|
|
66
|
-
- [ ] Update design/implementation docs if needed
|
|
67
|
-
- [ ] Add/adjust tests:
|
|
68
|
-
- Unit:
|
|
69
|
-
- Integration:
|
|
70
|
-
- E2E:
|
|
71
|
-
- [ ] Rerun local test suite
|
|
72
|
-
- [ ] Re-run code review command after fixes
|
|
73
|
-
```
|
|
74
|
-
|
|
75
|
-
## Step 6: Final Checklist
|
|
76
|
-
Confirm whether each item is complete (yes/no/needs follow-up):
|
|
77
|
-
- Implementation matches design & requirements
|
|
78
|
-
- No obvious logic or edge-case gaps remain
|
|
79
|
-
- Redundant code removed or justified
|
|
80
|
-
- Security considerations addressed
|
|
81
|
-
- Tests cover new/changed behavior
|
|
82
|
-
- Documentation/design notes updated
|
|
83
|
-
|
|
84
|
-
---
|
|
85
|
-
Let me know when you're ready to begin the review.
|
|
7
|
+
1. **Gather Context** — If not already provided, ask for: feature/branch description, list of modified files, relevant design doc(s) (e.g., `docs/ai/design/feature-{name}.md`), known constraints or risky areas, and which tests have been run. Also review the latest diff via `git status` and `git diff --stat`.
|
|
8
|
+
2. **Understand Design Alignment** — For each design doc, summarize architectural intent and critical constraints.
|
|
9
|
+
3. **File-by-File Review** — For every modified file: check alignment with design/requirements and flag deviations, spot logic issues/edge cases/redundant code, flag security concerns (input validation, secrets, auth, data handling), check error handling/performance/observability, and identify missing or outdated tests.
|
|
10
|
+
4. **Cross-Cutting Concerns** — Verify naming consistency and project conventions. Confirm docs/comments updated where behavior changed. Identify missing tests (unit, integration, E2E). Check for needed configuration/migration updates.
|
|
11
|
+
5. **Summarize Findings** — Categorize each finding as **blocking**, **important**, or **nice-to-have** with: file, issue, impact, recommendation, and design reference.
|
|
@@ -1,49 +1,11 @@
|
|
|
1
1
|
---
|
|
2
|
-
description:
|
|
2
|
+
description: Debug an issue with structured root-cause analysis before changing code.
|
|
3
3
|
---
|
|
4
4
|
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
Help me debug an issue by clarifying expectations, identifying gaps, and agreeing on a fix plan before changing code.
|
|
8
|
-
|
|
9
|
-
## Step 1: Gather Context
|
|
10
|
-
Ask me for:
|
|
11
|
-
- Brief issue description (what is happening?)
|
|
12
|
-
- Expected behavior or acceptance criteria (what should happen?)
|
|
13
|
-
- Current behavior and any error messages/logs
|
|
14
|
-
- Recent related changes or deployments
|
|
15
|
-
- Scope of impact (users, services, environments)
|
|
16
|
-
|
|
17
|
-
## Step 2: Clarify Reality vs Expectation
|
|
18
|
-
- Restate the observed behavior vs the expected outcome
|
|
19
|
-
- Confirm relevant requirements, tickets, or docs that define the expectation
|
|
20
|
-
- Identify acceptance criteria for the fix (how we know it is resolved)
|
|
21
|
-
|
|
22
|
-
## Step 3: Reproduce & Isolate
|
|
23
|
-
- Determine reproducibility (always, intermittent, environment-specific)
|
|
24
|
-
- Capture reproduction steps or commands
|
|
25
|
-
- Note any available tests that expose the failure
|
|
26
|
-
- List suspected components, services, or modules
|
|
27
|
-
|
|
28
|
-
## Step 4: Analyze Potential Causes
|
|
29
|
-
- Brainstorm plausible root causes (data, config, code regressions, external dependencies)
|
|
30
|
-
- Gather supporting evidence (logs, metrics, traces, screenshots)
|
|
31
|
-
- Highlight gaps or unknowns that need investigation
|
|
32
|
-
|
|
33
|
-
## Step 5: Surface Options
|
|
34
|
-
- Present possible resolution paths (quick fix, deeper refactor, rollback, feature flag, etc.)
|
|
35
|
-
- For each option, list pros/cons, risks, and verification steps
|
|
36
|
-
- Consider required approvals or coordination
|
|
37
|
-
|
|
38
|
-
## Step 6: Confirm Path Forward
|
|
39
|
-
- Ask which option we should pursue
|
|
40
|
-
- Summarize chosen approach, required pre-work, and success criteria
|
|
41
|
-
- Plan validation steps (tests, monitoring, user sign-off)
|
|
42
|
-
|
|
43
|
-
## Step 7: Next Actions & Tracking
|
|
44
|
-
- Document tasks, owners, and timelines for the selected option
|
|
45
|
-
- Note follow-up actions after deployment (monitoring, comms, postmortem if needed)
|
|
46
|
-
- Encourage updating relevant docs/tests once resolved
|
|
47
|
-
|
|
48
|
-
Let me know when you're ready to walk through the debugging flow.
|
|
5
|
+
Help me debug an issue. Clarify expectations, identify gaps, and agree on a fix plan before changing code.
|
|
49
6
|
|
|
7
|
+
1. **Gather Context** — If not already provided, ask for: issue description (what is happening vs what should happen), error messages/logs/screenshots, recent related changes or deployments, and scope of impact.
|
|
8
|
+
2. **Clarify Reality vs Expectation** — Restate observed vs expected behavior. Confirm relevant requirements or docs that define the expectation. Define acceptance criteria for the fix.
|
|
9
|
+
3. **Reproduce & Isolate** — Determine reproducibility (always, intermittent, environment-specific). Capture reproduction steps. List suspected components or modules.
|
|
10
|
+
4. **Analyze Potential Causes** — Brainstorm root causes (data, config, code regressions, external dependencies). Gather supporting evidence (logs, metrics, traces). Highlight unknowns needing investigation.
|
|
11
|
+
5. **Resolve** — Present resolution options (quick fix, refactor, rollback, etc.) with pros/cons and risks. Ask which option to pursue. Summarize chosen approach, pre-work, success criteria, and validation steps.
|