@pedrocivita/tocket 1.0.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 ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Pedro Civita
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,38 @@
1
+ # Tocket
2
+
3
+ **The Context Engineering Framework for Multi-Agent Workspaces**
4
+
5
+ Tocket structures how AI agents share context, hand off work, and build on each other's output. It turns ad-hoc prompting into a repeatable engineering workflow.
6
+
7
+ ## Core Pillars
8
+
9
+ - **Triangulation** — Architect + Executor pattern. One agent plans, another implements, with structured handoff payloads between them.
10
+ - **Context as Code** — Memory Bank protocol. Project context lives in version-controlled files (`.context/`), not ephemeral chat history.
11
+
12
+ ## Commands
13
+
14
+ | Command | Description |
15
+ |---------|-------------|
16
+ | `tocket init` | Scaffold an agentic workspace with Memory Bank and triangulation config |
17
+ | `tocket generate` | Build payload XMLs interactively for Architect-Executor handoff |
18
+ | `tocket sync` | Update Memory Bank from git history and session artifacts |
19
+
20
+ ## Installation
21
+
22
+ ```bash
23
+ npx @pedrocivita/tocket
24
+ ```
25
+
26
+ ## Development
27
+
28
+ ```bash
29
+ git clone https://github.com/pedrocivita/tocket.git
30
+ cd tocket
31
+ npm install
32
+ npm run build
33
+ node dist/index.js --help
34
+ ```
35
+
36
+ ## License
37
+
38
+ MIT
@@ -0,0 +1,2 @@
1
+ import type { Command } from "commander";
2
+ export declare function registerGenerateCommand(program: Command): void;
@@ -0,0 +1,89 @@
1
+ import { input, select, number } from "@inquirer/prompts";
2
+ import clipboard from "clipboardy";
3
+ function inferMode(score) {
4
+ if (score <= 6)
5
+ return "solo";
6
+ if (score <= 10)
7
+ return "team-small";
8
+ return "team-full";
9
+ }
10
+ function buildPayloadXml(opts) {
11
+ const mode = inferMode(opts.complexity);
12
+ const skillLines = opts.skills
13
+ .split(",")
14
+ .map((s) => s.trim())
15
+ .filter(Boolean)
16
+ .map((s) => ` <skill>${s}</skill>`)
17
+ .join("\n");
18
+ return `<payload version="3.0">
19
+ <meta>
20
+ <intent>${opts.intent}</intent>
21
+ <scope>${opts.scope}</scope>
22
+ <priority>${opts.priority}</priority>
23
+ <complexity score="${opts.complexity}" mode="${mode}" />
24
+ <model>${opts.model}</model>
25
+ </meta>
26
+
27
+ <skills>
28
+ ${skillLines || " <!-- Add skills here -->"}
29
+ </skills>
30
+
31
+ <context>
32
+ <!-- Provide relevant context for the Architect -->
33
+ </context>
34
+
35
+ <tasks>
36
+ <!-- The Architect will populate tasks based on the intent -->
37
+ </tasks>
38
+
39
+ <validate>
40
+ <!-- Define acceptance criteria -->
41
+ </validate>
42
+ </payload>`;
43
+ }
44
+ export function registerGenerateCommand(program) {
45
+ program
46
+ .command("generate")
47
+ .description("Build payload XMLs interactively for Architect-Executor handoff")
48
+ .action(async () => {
49
+ const intent = await input({ message: "Intent (goal in one line):" });
50
+ const scope = await input({ message: "Scope (files/folders affected):" });
51
+ const priority = await select({
52
+ message: "Priority:",
53
+ choices: [
54
+ { value: "high", name: "high" },
55
+ { value: "medium", name: "medium" },
56
+ { value: "low", name: "low" },
57
+ ],
58
+ });
59
+ const skills = await input({
60
+ message: "Skills/plugins (comma-separated):",
61
+ });
62
+ const model = await select({
63
+ message: "Architect model:",
64
+ choices: [
65
+ {
66
+ value: "gemini-3.1-pro-preview-customtools",
67
+ name: "gemini-3.1-pro-preview-customtools (default)",
68
+ },
69
+ { value: "gemini-2.5-pro", name: "gemini-2.5-pro" },
70
+ ],
71
+ });
72
+ const complexity = await number({
73
+ message: "Complexity score (0-15):",
74
+ min: 0,
75
+ max: 15,
76
+ required: true,
77
+ });
78
+ const xml = buildPayloadXml({
79
+ intent,
80
+ scope,
81
+ priority,
82
+ skills,
83
+ model,
84
+ complexity: complexity ?? 0,
85
+ });
86
+ clipboard.writeSync(xml);
87
+ console.log("\n\x1b[32m✓\x1b[0m Payload XML (v3.0) copied to clipboard! Paste it into your Architect to continue.");
88
+ });
89
+ }
@@ -0,0 +1,2 @@
1
+ import type { Command } from "commander";
2
+ export declare function registerInitCommand(program: Command): void;
@@ -0,0 +1,27 @@
1
+ import { input } from "@inquirer/prompts";
2
+ import { mkdir, writeFile } from "node:fs/promises";
3
+ import { join } from "node:path";
4
+ import { claudeMd, geminiMd, activeContextMd, systemPatternsMd, } from "../templates/memory-bank.js";
5
+ export function registerInitCommand(program) {
6
+ program
7
+ .command("init")
8
+ .description("Scaffold an agentic workspace with Memory Bank and triangulation config")
9
+ .action(async () => {
10
+ const projectName = await input({ message: "Project Name:" });
11
+ const description = await input({ message: "Short Description:" });
12
+ const contextDir = join(process.cwd(), ".context");
13
+ await mkdir(contextDir, { recursive: true });
14
+ const files = [
15
+ ["CLAUDE.md", claudeMd(projectName, description)],
16
+ ["GEMINI.md", geminiMd(projectName, description)],
17
+ [join(".context", "activeContext.md"), activeContextMd(projectName)],
18
+ [join(".context", "systemPatterns.md"), systemPatternsMd(projectName)],
19
+ ];
20
+ for (const [filePath, content] of files) {
21
+ const fullPath = join(process.cwd(), filePath);
22
+ await writeFile(fullPath, content, "utf-8");
23
+ console.log(` created ${filePath}`);
24
+ }
25
+ console.log(`\nAgentic workspace initialized for ${projectName}! Ready to launch.`);
26
+ });
27
+ }
@@ -0,0 +1,2 @@
1
+ import type { Command } from "commander";
2
+ export declare function registerSyncCommand(program: Command): void;
@@ -0,0 +1,51 @@
1
+ import { input } from "@inquirer/prompts";
2
+ import { existsSync } from "node:fs";
3
+ import { appendFile, writeFile } from "node:fs/promises";
4
+ import { execSync } from "node:child_process";
5
+ import { join } from "node:path";
6
+ function getRecentCommits() {
7
+ try {
8
+ return execSync("git log --oneline -5", { encoding: "utf-8" }).trim();
9
+ }
10
+ catch {
11
+ return "_No commits found or not a git repository._";
12
+ }
13
+ }
14
+ export function registerSyncCommand(program) {
15
+ program
16
+ .command("sync")
17
+ .description("Update Memory Bank from git history and session artifacts")
18
+ .action(async () => {
19
+ const progressPath = join(process.cwd(), ".context", "progress.md");
20
+ const contextDir = join(process.cwd(), ".context");
21
+ if (!existsSync(contextDir)) {
22
+ console.error("\x1b[31mMemory Bank not found. Run 'tocket init' first.\x1b[0m");
23
+ process.exitCode = 1;
24
+ return;
25
+ }
26
+ const summary = await input({
27
+ message: "What did you accomplish in this session?",
28
+ });
29
+ const commits = getRecentCommits();
30
+ const date = new Date().toISOString().split("T")[0];
31
+ const block = `## Session: ${date}
32
+
33
+ **Summary**: ${summary}
34
+
35
+ **Recent Commits**:
36
+ \`\`\`
37
+ ${commits}
38
+ \`\`\`
39
+
40
+ ---
41
+
42
+ `;
43
+ if (!existsSync(progressPath)) {
44
+ await writeFile(progressPath, `# Progress Log\n\n<!-- Appended by tocket sync -->\n\n${block}`, "utf-8");
45
+ }
46
+ else {
47
+ await appendFile(progressPath, block, "utf-8");
48
+ }
49
+ console.log("\n\x1b[32m✓\x1b[0m Memory Bank synchronized successfully!");
50
+ });
51
+ }
@@ -0,0 +1,2 @@
1
+ #!/usr/bin/env node
2
+ export {};
package/dist/index.js ADDED
@@ -0,0 +1,14 @@
1
+ #!/usr/bin/env node
2
+ import { Command } from "commander";
3
+ import { registerInitCommand } from "./commands/init.cmd.js";
4
+ import { registerGenerateCommand } from "./commands/generate.cmd.js";
5
+ import { registerSyncCommand } from "./commands/sync.cmd.js";
6
+ const program = new Command();
7
+ program
8
+ .name("tocket")
9
+ .description("The Context Engineering Framework for Multi-Agent Workspaces")
10
+ .version("1.0.0");
11
+ registerInitCommand(program);
12
+ registerGenerateCommand(program);
13
+ registerSyncCommand(program);
14
+ program.parse();
@@ -0,0 +1,4 @@
1
+ export declare const claudeMd: (projectName: string, description: string) => string;
2
+ export declare const geminiMd: (projectName: string, description: string) => string;
3
+ export declare const activeContextMd: (projectName: string) => string;
4
+ export declare const systemPatternsMd: (projectName: string) => string;
@@ -0,0 +1,141 @@
1
+ export const claudeMd = (projectName, description) => `# CLAUDE.md - ${projectName}
2
+
3
+ <!-- LLM_CONTEXT: Executor instructions for Claude Code -->
4
+ <!-- Generated by Tocket CLI -->
5
+
6
+ ## Role
7
+
8
+ You are the **Executor** for **${projectName}**.
9
+ ${description ? `\n> ${description}\n` : ""}
10
+ Your job is to **implement**, not to plan. Read the Memory Bank before every session, follow the Architect's decisions, and write code.
11
+
12
+ ---
13
+
14
+ ## Rules
15
+
16
+ 1. **Always read \`.context/\` first** — Start every session by reading activeContext.md and systemPatterns.md.
17
+ 2. **Follow the Architect's plan** — Implementation decisions come from GEMINI.md or mission briefs. Do not redesign.
18
+ 3. **Ask before deviating** — If the plan is unclear or blocked, ask the user. Do not improvise architecture.
19
+ 4. **Write code in English** — Variables, functions, comments, commits — all in \`en-US\`.
20
+ 5. **Update Memory Bank on completion** — After finishing a task, update activeContext.md with what changed.
21
+
22
+ ---
23
+
24
+ ## Memory Bank
25
+
26
+ | File | Purpose |
27
+ |------|---------|
28
+ | \`.context/activeContext.md\` | Current focus, recent changes, open decisions |
29
+ | \`.context/systemPatterns.md\` | Architecture patterns, tech stack, conventions |
30
+ | \`GEMINI.md\` | Architect instructions (read-only for you) |
31
+
32
+ ---
33
+
34
+ ## Workflow
35
+
36
+ \`\`\`
37
+ 1. Read .context/ → 2. Receive task → 3. Implement → 4. Update .context/
38
+ \`\`\`
39
+ `;
40
+ export const geminiMd = (projectName, description) => `# GEMINI.md - ${projectName}
41
+
42
+ <!-- LLM_CONTEXT: Architect instructions for Gemini -->
43
+ <!-- Generated by Tocket CLI -->
44
+
45
+ ## Role
46
+
47
+ You are the **Architect** (Planner) for **${projectName}**.
48
+ ${description ? `\n> ${description}\n` : ""}
49
+ Your job is to **analyze, plan, and decide**. You do not write code directly — you produce structured mission briefs that the Executor (Claude Code) implements.
50
+
51
+ ---
52
+
53
+ ## Rules
54
+
55
+ 1. **Read \`.context/\` first** — Understand current state before planning.
56
+ 2. **Produce mission briefs** — Use \`<mission-brief>\` XML format for handoff to the Executor.
57
+ 3. **Never write code inline** — Provide specs, not implementations. The Executor handles code.
58
+ 4. **Update systemPatterns.md** — When you make architectural decisions, record them.
59
+ 5. **Think in constraints** — Define what the system should and should not do.
60
+
61
+ ---
62
+
63
+ ## Memory Bank
64
+
65
+ | File | Purpose |
66
+ |------|---------|
67
+ | \`.context/activeContext.md\` | Current focus, recent changes, open decisions |
68
+ | \`.context/systemPatterns.md\` | Architecture patterns, tech stack, conventions |
69
+ | \`CLAUDE.md\` | Executor instructions (read-only for you) |
70
+
71
+ ---
72
+
73
+ ## Mission Brief Format
74
+
75
+ \`\`\`xml
76
+ <mission-brief version="1.0">
77
+ <meta>
78
+ <goal>What needs to happen</goal>
79
+ <scope>Which files/modules are affected</scope>
80
+ <priority>high | medium | low</priority>
81
+ </meta>
82
+ <context>
83
+ <summary>Background and reasoning</summary>
84
+ <architect-decisions>Key decisions made</architect-decisions>
85
+ </context>
86
+ <tasks>
87
+ <task id="1" type="create|edit|delete">
88
+ <target>file/path</target>
89
+ <action>What to do</action>
90
+ <spec>Detailed specification</spec>
91
+ <done>Definition of done</done>
92
+ </task>
93
+ </tasks>
94
+ <validate>
95
+ <check>Verification step</check>
96
+ </validate>
97
+ </mission-brief>
98
+ \`\`\`
99
+ `;
100
+ export const activeContextMd = (projectName) => `# Active Context - ${projectName}
101
+
102
+ <!-- Updated by both Architect and Executor after each session -->
103
+
104
+ ## Current Focus
105
+
106
+ _No active tasks yet. Run \`tocket generate\` to create your first mission brief._
107
+
108
+ ## Recent Changes
109
+
110
+ | Date | Change | Agent |
111
+ |------|--------|-------|
112
+ | ${new Date().toISOString().split("T")[0]} | Initialized agentic workspace | Tocket CLI |
113
+
114
+ ## Open Decisions
115
+
116
+ _None yet._
117
+ `;
118
+ export const systemPatternsMd = (projectName) => `# System Patterns - ${projectName}
119
+
120
+ <!-- Architectural decisions and conventions. Updated by the Architect. -->
121
+
122
+ ## Tech Stack
123
+
124
+ _To be defined by the Architect._
125
+
126
+ ## Architecture Patterns
127
+
128
+ _To be defined._
129
+
130
+ ## Conventions
131
+
132
+ - Code language: \`en-US\`
133
+ - Commit language: \`en-US\`
134
+ - Triangulation: Gemini (Architect) + Claude (Executor)
135
+
136
+ ## Key Decisions
137
+
138
+ | Decision | Rationale | Date |
139
+ |----------|-----------|------|
140
+ | Adopted Tocket triangulation | Structured multi-agent workflow | ${new Date().toISOString().split("T")[0]} |
141
+ `;
package/package.json ADDED
@@ -0,0 +1,47 @@
1
+ {
2
+ "name": "@pedrocivita/tocket",
3
+ "version": "1.0.0",
4
+ "description": "The Context Engineering Framework for Multi-Agent Workspaces",
5
+ "type": "module",
6
+ "main": "dist/index.js",
7
+ "bin": {
8
+ "tocket": "dist/index.js"
9
+ },
10
+ "files": [
11
+ "dist"
12
+ ],
13
+ "scripts": {
14
+ "build": "tsc",
15
+ "start": "node dist/index.js",
16
+ "prepublishOnly": "npm run build",
17
+ "test": "echo \"Error: no test specified\" && exit 1"
18
+ },
19
+ "repository": {
20
+ "type": "git",
21
+ "url": "git+https://github.com/pedrocivita/tocket.git"
22
+ },
23
+ "keywords": [
24
+ "context-engineering",
25
+ "multi-agent",
26
+ "cli"
27
+ ],
28
+ "author": "Pedro Civita",
29
+ "license": "MIT",
30
+ "bugs": {
31
+ "url": "https://github.com/pedrocivita/tocket/issues"
32
+ },
33
+ "homepage": "https://github.com/pedrocivita/tocket#readme",
34
+ "publishConfig": {
35
+ "registry": "https://registry.npmjs.org/",
36
+ "access": "public"
37
+ },
38
+ "dependencies": {
39
+ "@inquirer/prompts": "^8.3.0",
40
+ "clipboardy": "^5.3.0",
41
+ "commander": "^14.0.3"
42
+ },
43
+ "devDependencies": {
44
+ "@types/node": "^25.3.0",
45
+ "typescript": "^5.9.3"
46
+ }
47
+ }