@hanhnd/agent-kit 1.0.19 → 1.0.21

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 CHANGED
@@ -6,23 +6,24 @@
6
6
 
7
7
  ### Commands
8
8
 
9
- | Command | Description |
10
- | --------------------------------- | ------------------------------------------------------------------ |
11
- | `/ak:brainstorm [idea]` | Strategic architectural analysis |
12
- | `/ak:plan [file or idea]` | Create an implementation blueprint |
13
- | `/ak:code [file or task]` | Implement from a plan |
14
- | `/ak:code-simplify` | Simplify modified code for readability |
15
- | `/ak:code-refactor` | Refactor modified code for readability |
16
- | `/ak:research [topic]` | Research a topic |
17
- | `/ak:review-pr [PR URL]` | Review a pull request |
18
- | `/ak:review` | Review uncommitted local changes |
19
- | `/ak:debate [subject]` | Run adversarial debate (Gilfoyle vs Dinesh vs Judge) |
20
- | `/ak:ticket [ID]` | Fetch a Jira ticket and plan from it |
21
- | `/ak:git` | Git commit, branch, and PR workflow |
22
- | `/ak:init` | Create the project overview file |
23
- | `/ak:orchestrate [file or idea]` | Orchestrate agents to solve problems span across multiple projects |
24
- | `/ak:delegate <agent> <task>` | Delegate a task to Gemini or Claude CLI |
25
- | `/ak:wiki [compile\|query\|lint]` | Maintain a persistent, compounding project knowledge wiki |
9
+ | Command | Description |
10
+ | --------------------------------- | -------------------------------------------------------------------- |
11
+ | `/ak:brainstorm [idea]` | Strategic architectural analysis |
12
+ | `/ak:plan [file or idea]` | Create an implementation blueprint |
13
+ | `/ak:code [file or task]` | Implement from a plan |
14
+ | `/ak:code-simplify` | Simplify modified code for readability |
15
+ | `/ak:code-refactor` | Refactor modified code for readability |
16
+ | `/ak:validate [artifact]` | Validate artifacts against expectations (or append `with /validate`) |
17
+ | `/ak:research [topic]` | Research a topic |
18
+ | `/ak:review-pr [PR URL]` | Review a pull request |
19
+ | `/ak:review` | Review uncommitted local changes |
20
+ | `/ak:debate [subject]` | Run adversarial debate (Gilfoyle vs Dinesh vs Judge) |
21
+ | `/ak:ticket [ID]` | Fetch a Jira ticket and plan from it |
22
+ | `/ak:git` | Git commit, branch, and PR workflow |
23
+ | `/ak:init` | Create the project overview file |
24
+ | `/ak:orchestrate [file or idea]` | Orchestrate agents to solve problems span across multiple projects |
25
+ | `/ak:delegate <agent> <task>` | Delegate a task to Gemini or Claude CLI |
26
+ | `/ak:wiki [compile\|query\|lint]` | Maintain a persistent, compounding project knowledge wiki |
26
27
 
27
28
  ---
28
29
 
@@ -21049,22 +21049,32 @@ var FORBIDDEN_DIRS = [
21049
21049
  function registerCoreTools(server2) {
21050
21050
  server2.tool(
21051
21051
  "kit_save_handoff",
21052
- "Save a brainstorm, plan, or ticket handoff artifact to .agent-kit/handoffs/. Returns the saved file path to use in next-step instructions.",
21052
+ `Save a handoff artifact to .agent-kit/handoffs/. Returns the saved file path to use in next-step instructions. Do NOT append version numbers (v2, v3, etc.) to the slug.`,
21053
21053
  {
21054
- type: external_exports.enum(["brainstorm", "plan", "ticket"]).describe("Handoff type"),
21054
+ type: external_exports.enum(["brainstorm", "plan", "ticket", "research"]).describe("Handoff type"),
21055
21055
  content: external_exports.string().describe("Full markdown content to save"),
21056
- slug: external_exports.string().describe('Short identifier for the filename, e.g. "user-auth" or "PROJ-123"')
21056
+ slug: external_exports.string().describe(
21057
+ 'Short identifier for the filename, e.g. "user-auth" or "PROJ-123". Do NOT append version numbers (v2, v3, etc.).'
21058
+ )
21057
21059
  },
21058
21060
  async ({ type, content, slug }) => {
21059
21061
  try {
21060
- const timestamp = (/* @__PURE__ */ new Date()).toISOString().replace(/[:.]/g, "-").slice(0, 19);
21061
21062
  const safeSlug = slug.replace(/[^a-zA-Z0-9-_]/g, "-").toLowerCase();
21062
- const filename = `${type}-${timestamp}-${safeSlug}.md`;
21063
21063
  const handoffDir = path.join(getWorkspaceRoot(), ".agent-kit", "handoffs", `${type}s`);
21064
21064
  if (!fs.existsSync(handoffDir)) {
21065
21065
  fs.mkdirSync(handoffDir, { recursive: true });
21066
21066
  }
21067
- const filePath = path.join(handoffDir, filename);
21067
+ const files = fs.readdirSync(handoffDir);
21068
+ const slugPattern = new RegExp(`^${type}-([0-9T-]{19}-)?${safeSlug}\\.md$`);
21069
+ const existingFile = files.filter((f) => slugPattern.test(f)).sort().pop();
21070
+ let filePath;
21071
+ if (existingFile) {
21072
+ filePath = path.join(handoffDir, existingFile);
21073
+ } else {
21074
+ const timestamp = (/* @__PURE__ */ new Date()).toISOString().replace(/[:.]/g, "-").slice(0, 19);
21075
+ const filename = `${type}-${timestamp}-${safeSlug}.md`;
21076
+ filePath = path.join(handoffDir, filename);
21077
+ }
21068
21078
  fs.writeFileSync(filePath, content, "utf8");
21069
21079
  return mcpText(`\u2705 Saved to: ${filePath}`);
21070
21080
  } catch (error2) {
@@ -12,25 +12,37 @@ import { DEFAULT_EXTENSIONS } from './config.js';
12
12
  export function registerCoreTools(server) {
13
13
  // ═══════════════════════════════════════════════════════════════
14
14
  // TOOL: SAVE HANDOFF
15
- // Writes brainstorm/plan/ticket artifacts to the workspace
16
- // Returns the saved file path for use in next-step instructions
15
+ // Writes handoff artifacts to the workspace
16
+ // Returns the saved file path to use in next-step instructions
17
17
  // ═══════════════════════════════════════════════════════════════
18
- server.tool('kit_save_handoff', 'Save a brainstorm, plan, or ticket handoff artifact to .agent-kit/handoffs/. Returns the saved file path to use in next-step instructions.', {
19
- type: z.enum(['brainstorm', 'plan', 'ticket']).describe('Handoff type'),
18
+ server.tool('kit_save_handoff', `Save a handoff artifact to .agent-kit/handoffs/. Returns the saved file path to use in next-step instructions. Do NOT append version numbers (v2, v3, etc.) to the slug.`, {
19
+ type: z.enum(['brainstorm', 'plan', 'ticket', 'research']).describe('Handoff type'),
20
20
  content: z.string().describe('Full markdown content to save'),
21
21
  slug: z
22
22
  .string()
23
- .describe('Short identifier for the filename, e.g. "user-auth" or "PROJ-123"'),
23
+ .describe('Short identifier for the filename, e.g. "user-auth" or "PROJ-123". Do NOT append version numbers (v2, v3, etc.).'),
24
24
  }, async ({ type, content, slug }) => {
25
25
  try {
26
- const timestamp = new Date().toISOString().replace(/[:.]/g, '-').slice(0, 19);
27
26
  const safeSlug = slug.replace(/[^a-zA-Z0-9-_]/g, '-').toLowerCase();
28
- const filename = `${type}-${timestamp}-${safeSlug}.md`;
29
27
  const handoffDir = path.join(getWorkspaceRoot(), '.agent-kit', 'handoffs', `${type}s`);
30
28
  if (!fs.existsSync(handoffDir)) {
31
29
  fs.mkdirSync(handoffDir, { recursive: true });
32
30
  }
33
- const filePath = path.join(handoffDir, filename);
31
+ const files = fs.readdirSync(handoffDir);
32
+ const slugPattern = new RegExp(`^${type}-([0-9T-]{19}-)?${safeSlug}\\.md$`);
33
+ const existingFile = files
34
+ .filter((f) => slugPattern.test(f))
35
+ .sort()
36
+ .pop();
37
+ let filePath;
38
+ if (existingFile) {
39
+ filePath = path.join(handoffDir, existingFile);
40
+ }
41
+ else {
42
+ const timestamp = new Date().toISOString().replace(/[:.]/g, '-').slice(0, 19);
43
+ const filename = `${type}-${timestamp}-${safeSlug}.md`;
44
+ filePath = path.join(handoffDir, filename);
45
+ }
34
46
  fs.writeFileSync(filePath, content, 'utf8');
35
47
  return mcpText(`✅ Saved to: ${filePath}`);
36
48
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hanhnd/agent-kit",
3
- "version": "1.0.19",
3
+ "version": "1.0.21",
4
4
  "description": "Super Engineer - Team of AI Agents for software development (Claude Code Plugin)",
5
5
  "type": "module",
6
6
  "main": "dist/kit-server.js",