ai-devkit 0.12.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.
Files changed (98) hide show
  1. package/README.md +49 -198
  2. package/dist/cli.js +8 -0
  3. package/dist/cli.js.map +1 -1
  4. package/dist/commands/init.d.ts +1 -0
  5. package/dist/commands/init.d.ts.map +1 -1
  6. package/dist/commands/init.js +111 -12
  7. package/dist/commands/init.js.map +1 -1
  8. package/dist/commands/lint.d.ts +4 -0
  9. package/dist/commands/lint.d.ts.map +1 -0
  10. package/dist/commands/lint.js +53 -0
  11. package/dist/commands/lint.js.map +1 -0
  12. package/dist/commands/memory.d.ts.map +1 -1
  13. package/dist/commands/memory.js +19 -0
  14. package/dist/commands/memory.js.map +1 -1
  15. package/dist/lib/InitTemplate.d.ts +13 -0
  16. package/dist/lib/InitTemplate.d.ts.map +1 -0
  17. package/dist/lib/InitTemplate.js +169 -0
  18. package/dist/lib/InitTemplate.js.map +1 -0
  19. package/dist/lib/SkillManager.d.ts.map +1 -1
  20. package/dist/lib/SkillManager.js +9 -0
  21. package/dist/lib/SkillManager.js.map +1 -1
  22. package/dist/services/lint/constants.d.ts +14 -0
  23. package/dist/services/lint/constants.d.ts.map +1 -0
  24. package/dist/services/lint/constants.js +17 -0
  25. package/dist/services/lint/constants.js.map +1 -0
  26. package/dist/services/lint/lint.service.d.ts +6 -0
  27. package/dist/services/lint/lint.service.d.ts.map +1 -0
  28. package/dist/services/lint/lint.service.js +100 -0
  29. package/dist/services/lint/lint.service.js.map +1 -0
  30. package/dist/services/lint/rules/base-docs.rule.d.ts +3 -0
  31. package/dist/services/lint/rules/base-docs.rule.d.ts.map +1 -0
  32. package/dist/services/lint/rules/base-docs.rule.js +17 -0
  33. package/dist/services/lint/rules/base-docs.rule.js.map +1 -0
  34. package/dist/services/lint/rules/check-factories.d.ts +5 -0
  35. package/dist/services/lint/rules/check-factories.d.ts.map +1 -0
  36. package/dist/services/lint/rules/check-factories.js +36 -0
  37. package/dist/services/lint/rules/check-factories.js.map +1 -0
  38. package/dist/services/lint/rules/feature-docs.rule.d.ts +3 -0
  39. package/dist/services/lint/rules/feature-docs.rule.d.ts.map +1 -0
  40. package/dist/services/lint/rules/feature-docs.rule.js +16 -0
  41. package/dist/services/lint/rules/feature-docs.rule.js.map +1 -0
  42. package/dist/services/lint/rules/feature-name.rule.d.ts +7 -0
  43. package/dist/services/lint/rules/feature-name.rule.d.ts.map +1 -0
  44. package/dist/services/lint/rules/feature-name.rule.js +26 -0
  45. package/dist/services/lint/rules/feature-name.rule.js.map +1 -0
  46. package/dist/services/lint/rules/git-worktree.rule.d.ts +3 -0
  47. package/dist/services/lint/rules/git-worktree.rule.d.ts.map +1 -0
  48. package/dist/services/lint/rules/git-worktree.rule.js +26 -0
  49. package/dist/services/lint/rules/git-worktree.rule.js.map +1 -0
  50. package/dist/services/lint/rules/phase-docs.rule.d.ts +13 -0
  51. package/dist/services/lint/rules/phase-docs.rule.d.ts.map +1 -0
  52. package/dist/services/lint/rules/phase-docs.rule.js +54 -0
  53. package/dist/services/lint/rules/phase-docs.rule.js.map +1 -0
  54. package/dist/services/lint/types.d.ts +39 -0
  55. package/dist/services/lint/types.d.ts.map +1 -0
  56. package/dist/services/lint/types.js +3 -0
  57. package/dist/services/lint/types.js.map +1 -0
  58. package/dist/templates/commands/capture-knowledge.md +7 -45
  59. package/dist/templates/commands/check-implementation.md +4 -19
  60. package/dist/templates/commands/code-review.md +7 -81
  61. package/dist/templates/commands/debug.md +7 -45
  62. package/dist/templates/commands/execute-plan.md +6 -70
  63. package/dist/templates/commands/new-requirement.md +15 -128
  64. package/dist/templates/commands/remember.md +4 -21
  65. package/dist/templates/commands/review-design.md +1 -2
  66. package/dist/templates/commands/review-requirements.md +2 -3
  67. package/dist/templates/commands/simplify-implementation.md +6 -144
  68. package/dist/templates/commands/update-planning.md +6 -61
  69. package/dist/templates/commands/writing-test.md +6 -42
  70. package/dist/templates/templates/commands/capture-knowledge.md +7 -45
  71. package/dist/templates/templates/commands/check-implementation.md +4 -19
  72. package/dist/templates/templates/commands/code-review.md +7 -81
  73. package/dist/templates/templates/commands/debug.md +7 -45
  74. package/dist/templates/templates/commands/execute-plan.md +6 -70
  75. package/dist/templates/templates/commands/new-requirement.md +15 -128
  76. package/dist/templates/templates/commands/remember.md +4 -21
  77. package/dist/templates/templates/commands/review-design.md +1 -2
  78. package/dist/templates/templates/commands/review-requirements.md +2 -3
  79. package/dist/templates/templates/commands/simplify-implementation.md +6 -144
  80. package/dist/templates/templates/commands/update-planning.md +6 -61
  81. package/dist/templates/templates/commands/writing-test.md +6 -42
  82. package/dist/util/git.d.ts +8 -0
  83. package/dist/util/git.d.ts.map +1 -1
  84. package/dist/util/git.js +69 -0
  85. package/dist/util/git.js.map +1 -1
  86. package/package.json +2 -2
  87. package/templates/commands/capture-knowledge.md +7 -45
  88. package/templates/commands/check-implementation.md +4 -19
  89. package/templates/commands/code-review.md +7 -81
  90. package/templates/commands/debug.md +7 -45
  91. package/templates/commands/execute-plan.md +6 -70
  92. package/templates/commands/new-requirement.md +15 -128
  93. package/templates/commands/remember.md +4 -21
  94. package/templates/commands/review-design.md +1 -2
  95. package/templates/commands/review-requirements.md +2 -3
  96. package/templates/commands/simplify-implementation.md +6 -144
  97. package/templates/commands/update-planning.md +6 -61
  98. package/templates/commands/writing-test.md +6 -42
@@ -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,3 @@
1
+ import { LintCheckResult, LintDependencies } from '../types';
2
+ export declare function runGitWorktreeRules(cwd: string, branchName: string, deps: LintDependencies): LintCheckResult[];
3
+ //# sourceMappingURL=git-worktree.rule.d.ts.map
@@ -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,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=types.js.map
@@ -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: Capture structured knowledge about a code entry point and save it to the knowledge docs.
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
- ## Step 1: Gather Context
10
- - Entry point (file, folder, function, API)
11
- - Why this entry point matters (feature, bug, investigation)
12
- - Relevant requirements/design docs (if any)
13
- - Desired depth or focus areas (logic, dependencies, data flow)
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/. Please follow this structured review:
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: Perform a local code review before pushing changes, ensuring alignment with design docs and best practices.
2
+ description: Pre-push code review against design docs.
3
3
  ---
4
4
 
5
- # Local Code Review Assistant
5
+ Perform a local code review **before** pushing changes.
6
6
 
7
- You are helping me perform a local code review **before** I push changes. Please follow this structured workflow.
8
-
9
- ## Step 1: Gather Context
10
- Ask me for:
11
- - Brief feature/branch description
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: Guide me through debugging a code issue by clarifying expectations, identifying gaps, and agreeing on a fix plan before changing code.
2
+ description: Debug an issue with structured root-cause analysis before changing code.
3
3
  ---
4
4
 
5
- # Local Debugging Assistant
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.
@@ -1,75 +1,11 @@
1
1
  ---
2
- description: Execute a feature plan interactively, guiding me through each task while referencing relevant docs and updating status.
2
+ description: Execute a feature plan task by task.
3
3
  ---
4
4
 
5
- # Feature Plan Execution Assistant
6
-
7
5
  Help me work through a feature plan one task at a time.
8
6
 
9
- ## Step 1: Gather Context
10
- Ask me for:
11
- - Feature name (kebab-case, e.g., `user-authentication`)
12
- - Brief feature/branch description
13
- - Relevant planning doc path (default `docs/ai/planning/feature-{name}.md`)
14
- - Any supporting design/implementation docs (design, requirements, implementation)
15
- - Current branch and latest diff summary (`git status -sb`, `git diff --stat`)
16
-
17
- ## Step 2: Load the Plan
18
- - Request the planning doc contents or offer commands like:
19
- ```bash
20
- cat docs/ai/planning/feature-<name>.md
21
- ```
22
- - Parse sections that represent task lists (look for headings + checkboxes `[ ]`, `[x]`).
23
- - Build an ordered queue of tasks grouped by section (e.g., Foundation, Core Features, Testing).
24
-
25
- ## Step 3: Present Task Queue
26
- Show an overview:
27
- ```
28
- ### Task Queue: <Feature Name>
29
- 1. [status] Section • Task title
30
- 2. ...
31
- ```
32
- Status legend: `todo`, `in-progress`, `done`, `blocked` (based on checkbox/notes if present).
33
-
34
- ## Step 4: Interactive Task Execution
35
- For each task in order:
36
- 1. Display the section/context, full bullet text, and any existing notes.
37
- 2. Suggest relevant docs to reference (requirements/design/implementation).
38
- 3. Ask: "Plan for this task?" Offer to outline sub-steps using the design doc.
39
- 4. Prompt to mark status (`done`, `in-progress`, `blocked`, `skipped`) and capture short notes/next steps.
40
- 5. Encourage code/document edits inside Cursor; offer commands/snippets when useful.
41
- 6. If blocked, record blocker info and move task to the end or into a "Blocked" list.
42
-
43
- ## Step 5: Update Planning Doc
44
- After each status change, generate a Markdown snippet the user can paste back into the planning doc, e.g.:
45
- ```
46
- - [x] Task: Implement auth service (Notes: finished POST /auth/login, tests added)
47
- ```
48
- Remind the user to keep the source doc updated.
49
-
50
- ## Step 6: Check for Newly Discovered Work
51
- After each section, ask if new tasks were discovered. If yes, capture them in a "New Work" list with status `todo` and include in the summary.
52
-
53
- ## Step 7: Session Summary
54
- Produce a summary table:
55
- ```
56
- ### Execution Summary
57
- - Completed: (list)
58
- - In Progress: (list + owners/next steps)
59
- - Blocked: (list + blockers)
60
- - Skipped / Deferred: (list + rationale)
61
- - New Tasks: (list)
62
- ```
63
-
64
- ## Step 8: Next Actions
65
- Remind the user to:
66
- - Update `docs/ai/planning/feature-{name}.md` with the new statuses
67
- - Sync related docs (requirements/design/implementation/testing) if decisions changed
68
- - Run `/check-implementation` to validate changes against design docs
69
- - Run `/writing-test` to produce unit/integration tests targeting 100% coverage
70
- - Run `/update-planning` to reconcile the planning doc with the latest status
71
- - Run `/code-review` when ready for final review
72
- - Run test suites relevant to completed tasks
73
-
74
- ---
75
- Let me know when you're ready to start executing the plan. Provide the feature name and planning doc first.
7
+ 1. **Gather Context** — If not already provided, ask for: feature name (kebab-case, e.g., `user-authentication`), brief feature/branch description, planning doc path (default `docs/ai/planning/feature-{name}.md`), and any supporting docs (design, requirements, implementation).
8
+ 2. **Load & Present Plan** — Read the planning doc and parse task lists (headings + checkboxes). Present an ordered task queue grouped by section, with status: `todo`, `in-progress`, `done`, `blocked`.
9
+ 3. **Interactive Task Execution** — For each task in order: display context and full bullet text, reference relevant design/requirements docs, offer to outline sub-steps before starting, prompt for status update (`done`, `in-progress`, `blocked`, `skipped`) with short notes after work, and if blocked record blocker and move to a "Blocked" list.
10
+ 4. **Update Planning Doc** — After each status change, generate a markdown snippet to paste back into the planning doc. After each section, ask if new tasks were discovered.
11
+ 5. **Session Summary** Produce a summary: Completed, In Progress (with next steps), Blocked (with blockers), Skipped/Deferred, and New Tasks. Remind to update `docs/ai/planning/feature-{name}.md` and sync related docs if decisions changed.