drafted 1.16.0 → 1.17.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/agent-instructions/global.md +1 -50
- package/install-mcp.sh +1 -50
- package/mcp/gates.mjs +5 -5
- package/mcp/server.mjs +921 -2663
- package/mcp/test-org-guards.mjs +22 -1
- package/mcp/widgets/canvas-overview.html +19 -3
- package/package.json +1 -1
- package/plugin/commands/create-project.md +7 -10
- package/plugin/commands/create-skill.md +3 -3
- package/plugin/commands/extract.md +2 -2
- package/plugin/commands/improve-project-harness.md +3 -3
- package/plugin/commands/improve-skill.md +2 -2
- package/plugin/commands/improve-wiki.md +3 -3
- package/plugin/commands/ingest.md +3 -3
- package/plugin/commands/onboard-drafted.md +2 -2
- package/plugin/skills/drafted/SKILL.md +35 -31
- package/src/shared/constants.mjs +1 -1
|
@@ -1,52 +1,3 @@
|
|
|
1
1
|
<drafted>
|
|
2
|
-
Drafted
|
|
3
|
-
|
|
4
|
-
Drafted terminology:
|
|
5
|
-
- Wiki: durable organization knowledge. It may also be called the knowledge base or database. Save, compound, curate, and retrieve knowledge here when it should benefit the business, teammates, other agents, or future work by the same person.
|
|
6
|
-
- Skills: reusable operating knowledge. Users may call them skills, procedures, SOPs, standard operating procedures, checklists, methods, protocols, playbooks, or templates for repeatable work. Use them actively before repeatable work, follow them while working, and maintain them when better methods emerge.
|
|
7
|
-
- Projects: client-facing or reviewable work products, organized as frames on a shared surface. Use projects when work should be seen, reviewed, reused, or developed over time rather than left only in chat.
|
|
8
|
-
|
|
9
|
-
Operating principle:
|
|
10
|
-
- Do not treat Drafted as passive storage. Actively use and maintain the wiki, skills, and projects when they fit the work.
|
|
11
|
-
- Default to creating or updating Drafted project frames for substantive outputs instead of leaving artifacts only in chat. If the user asks you to draft, write, plan, analyze, compare, design, document, summarize, report, spec, model, or make a deck/table, put the durable result on the Drafted surface unless the user explicitly wants chat-only output.
|
|
12
|
-
- Put durable knowledge in the wiki, reusable methods in skills, and producible artifacts in projects.
|
|
13
|
-
- Do not save reusable procedures, SOPs, checklists, methods, protocols, or repeatable work instructions to the wiki/knowledge base. Save them as Drafted skills.
|
|
14
|
-
|
|
15
|
-
Before working:
|
|
16
|
-
- Check whether Drafted MCP tools are available. If not authenticated, use auth(action="get_link") or auth(action="login") and give the user the sign-in link.
|
|
17
|
-
- Identify the correct organization and project first. Use get_org(action="get") and project(action="list"). Opening a project binds the agent session's context — the org derives from the project. There is no org switching: address existing resources by UUID (pageId/skillId/projectId — org self-derives), and pass org=... on creates and searches that name no resource (wiki write, skill add, project create, template actions).
|
|
18
|
-
- Check get_org(action="get") for googleDrive.connected. When Google Drive is connected for the org you are working in, Google Workspace frames are available and should be the strong default for documents, spreadsheets, and presentations.
|
|
19
|
-
- Never assume the current Drafted project or org context is correct. Verify the project/org echoed in each response before writing.
|
|
20
|
-
|
|
21
|
-
Wiki rules:
|
|
22
|
-
- Search the org wiki before substantive work: wiki(action="search") with relevant keywords.
|
|
23
|
-
- Read relevant pages before creating or changing artifacts.
|
|
24
|
-
- Maintain the wiki when you discover durable knowledge, decisions, client constraints, project context, research notes, or facts that should compound for the business or future agents.
|
|
25
|
-
- When creating or editing wiki pages, return a browser link the user can click.
|
|
26
|
-
|
|
27
|
-
Skill rules:
|
|
28
|
-
- Treat skill, procedure, SOP, checklist, method, protocol, playbook, and repeatable-work template as the same user intent.
|
|
29
|
-
- Search skills before starting repeatable work: skill(action="search") or skill(action="list").
|
|
30
|
-
- Load and follow relevant skills with skill(action="load"). Read supporting skill files when needed.
|
|
31
|
-
- When the user asks to record, distill, create, save, install, or update a skill/procedure/SOP/checklist/method/protocol/playbook, create or update a Drafted skill for the org with skill tools.
|
|
32
|
-
- Every skill has a portable part — its method, SKILL.md, and any script source — and that part always belongs in Drafted, not only in a local repo. When you build a runnable skill, push the source to Drafted (skill action="push", or skill action="add" for prose) and declare how to rebuild it in the skill's `setup:` frontmatter (e.g. ["npm ci"]) so any machine or agent can regenerate it. Do not leave a reusable skill authored only as local files when Drafted is connected.
|
|
33
|
-
- Machine-specific build output (node_modules, downloaded browsers, compiled binaries) is never portable: build it into a `.skillinstall/` directory inside the skill. Drafted always strips `.skillinstall/` from a pushed bundle and skill push auto-gitignores it, so the rebuildable bundle stays local while the method and recipe stay in Drafted.
|
|
34
|
-
- Improve skills when you find a better checklist, standard, or operating method.
|
|
35
|
-
|
|
36
|
-
Project/producible rules:
|
|
37
|
-
- For client-facing, durable, or reviewable artifacts, produce the work inside the appropriate Drafted project instead of leaving it only in chat.
|
|
38
|
-
- Prefer one visible frame per artifact or artifact section so the user can review, compare, and refine work on the surface.
|
|
39
|
-
- Use project(action="open") before frame/asset/connector/layout changes. For every write/edit, confirm the response project matches the intended project.
|
|
40
|
-
- Read anchored frames and existing neighboring frames before editing a layer.
|
|
41
|
-
- After creating frames, documents, diagrams, or other producibles, use focus when available and return the clickable Drafted frame or project link.
|
|
42
|
-
|
|
43
|
-
Google Workspace rules:
|
|
44
|
-
- If get_org reports googleDrive.connected, strongly prefer Google Workspace frames for business artifacts: google-doc for memos, reports, briefs, SOPs, proposals, and long-form documents; google-sheet for tables, trackers, budgets, research matrices, and models; google-slide for decks and presentation outlines.
|
|
45
|
-
- Create Google Workspace frames with frame(action="write", googleType="google-doc" | "google-sheet" | "google-slide", path="/{layer}/{lane}/{filename}", title="...") after opening the project.
|
|
46
|
-
- For flowcharts, process maps, architecture diagrams, system diagrams, data-flow diagrams, visual maps, or other editable diagrams, load and follow the system skill `excalidraw-drafted` (Drafted Excalidraw Diagram) and create native Drafted Excalidraw frames. Use normal Drafted HTML/markdown frames for web/UI mockups, rich visual layouts, or non-editable presentation artifacts.
|
|
47
|
-
- Use breadcrumbs in code or docs where useful: drafted:<frameId> for frames and drafted-project:<projectId> for projects.
|
|
48
|
-
|
|
49
|
-
Collaboration rules:
|
|
50
|
-
- Parallel agents must each open and verify their own Drafted project/org context.
|
|
51
|
-
- If there is any doubt about the correct org, project, wiki location, or skill, ask a short clarifying question before writing.
|
|
2
|
+
You have Drafted MCP tools — a shared surface for durable, reviewable work: produce substantive output as frames on the surface (not only in chat), put knowledge in the org wiki, and encode repeatable methods as skills. The full operating manual is the `drafted` skill installed with the plugin — follow it when working with Drafted. Address orgs by path: `fs(ls, path="/")` lists them, and `/o/<org>/<root>/...` (root ∈ wiki, skills, projects) is the canonical path form — the org is part of the path, never a separate switch. Before writing, verify the org/project echoed in the response is the one you intend.
|
|
52
3
|
</drafted>
|
package/install-mcp.sh
CHANGED
|
@@ -480,56 +480,7 @@ load_global_agent_instructions() {
|
|
|
480
480
|
fi
|
|
481
481
|
cat <<'DRAFTED_GLOBAL_INSTRUCTIONS'
|
|
482
482
|
<drafted>
|
|
483
|
-
Drafted
|
|
484
|
-
|
|
485
|
-
Drafted terminology:
|
|
486
|
-
- Wiki: durable organization knowledge. It may also be called the knowledge base or database. Save, compound, curate, and retrieve knowledge here when it should benefit the business, teammates, other agents, or future work by the same person.
|
|
487
|
-
- Skills: reusable operating knowledge. Users may call them skills, procedures, SOPs, standard operating procedures, checklists, methods, protocols, playbooks, or templates for repeatable work. Use them actively before repeatable work, follow them while working, and maintain them when better methods emerge.
|
|
488
|
-
- Projects: client-facing or reviewable work products, organized as frames on a shared surface. Use projects when work should be seen, reviewed, reused, or developed over time rather than left only in chat.
|
|
489
|
-
|
|
490
|
-
Operating principle:
|
|
491
|
-
- Do not treat Drafted as passive storage. Actively use and maintain the wiki, skills, and projects when they fit the work.
|
|
492
|
-
- Default to creating or updating Drafted project frames for substantive outputs instead of leaving artifacts only in chat. If the user asks you to draft, write, plan, analyze, compare, design, document, summarize, report, spec, model, or make a deck/table, put the durable result on the Drafted surface unless the user explicitly wants chat-only output.
|
|
493
|
-
- Put durable knowledge in the wiki, reusable methods in skills, and producible artifacts in projects.
|
|
494
|
-
- Do not save reusable procedures, SOPs, checklists, methods, protocols, or repeatable work instructions to the wiki/knowledge base. Save them as Drafted skills.
|
|
495
|
-
|
|
496
|
-
Before working:
|
|
497
|
-
- Check whether Drafted MCP tools are available. If not authenticated, use auth(action="get_link") or auth(action="login") and give the user the sign-in link.
|
|
498
|
-
- Select the correct organization first. Use get_org(action="get") and project(action="list") to identify the target org/project. Opening a project switches org context automatically; for wiki/skill-only work, use get_org(action="switch", orgId=...).
|
|
499
|
-
- Check get_org(action="get") for googleDrive.connected. When Google Drive is connected for the active org, Google Workspace frames are available and should be the strong default for documents, spreadsheets, and presentations.
|
|
500
|
-
- Never assume the current active Drafted project or organization is correct. Verify the returned project/org before writing.
|
|
501
|
-
|
|
502
|
-
Wiki rules:
|
|
503
|
-
- Search the org wiki before substantive work: wiki(action="search") with relevant keywords.
|
|
504
|
-
- Read relevant pages before creating or changing artifacts.
|
|
505
|
-
- Maintain the wiki when you discover durable knowledge, decisions, client constraints, project context, research notes, or facts that should compound for the business or future agents.
|
|
506
|
-
- When creating or editing wiki pages, return a browser link the user can click.
|
|
507
|
-
|
|
508
|
-
Skill rules:
|
|
509
|
-
- Treat skill, procedure, SOP, checklist, method, protocol, playbook, and repeatable-work template as the same user intent.
|
|
510
|
-
- Search skills before starting repeatable work: skill(action="search") or skill(action="list").
|
|
511
|
-
- Load and follow relevant skills with skill(action="load"). Read supporting skill files when needed.
|
|
512
|
-
- When the user asks to record, distill, create, save, install, or update a skill/procedure/SOP/checklist/method/protocol/playbook, create or update a Drafted skill for the org with skill tools.
|
|
513
|
-
- Every skill has a portable part — its method, SKILL.md, and any script source — and that part always belongs in Drafted, not only in a local repo. When you build a runnable skill, push the source to Drafted (skill action="push", or skill action="add" for prose) and declare how to rebuild it in the skill's `setup:` frontmatter (e.g. ["npm ci"]) so any machine or agent can regenerate it. Do not leave a reusable skill authored only as local files when Drafted is connected.
|
|
514
|
-
- Machine-specific build output (node_modules, downloaded browsers, compiled binaries) is never portable: build it into a `.skillinstall/` directory inside the skill. Drafted always strips `.skillinstall/` from a pushed bundle and skill push auto-gitignores it, so the rebuildable bundle stays local while the method and recipe stay in Drafted.
|
|
515
|
-
- Improve skills when you find a better checklist, standard, or operating method.
|
|
516
|
-
|
|
517
|
-
Project/producible rules:
|
|
518
|
-
- For client-facing, durable, or reviewable artifacts, produce the work inside the appropriate Drafted project instead of leaving it only in chat.
|
|
519
|
-
- Prefer one visible frame per artifact or artifact section so the user can review, compare, and refine work on the surface.
|
|
520
|
-
- Use project(action="open") before frame/asset/connector/layout changes. For every write/edit, confirm the response project matches the intended project.
|
|
521
|
-
- Read anchored frames and existing neighboring frames before editing a layer.
|
|
522
|
-
- After creating frames, documents, diagrams, or other producibles, use focus when available and return the clickable Drafted frame or project link.
|
|
523
|
-
|
|
524
|
-
Google Workspace rules:
|
|
525
|
-
- If get_org reports googleDrive.connected, strongly prefer Google Workspace frames for business artifacts: google-doc for memos, reports, briefs, SOPs, proposals, and long-form documents; google-sheet for tables, trackers, budgets, research matrices, and models; google-slide for decks and presentation outlines.
|
|
526
|
-
- Create Google Workspace frames with frame(action="write", googleType="google-doc" | "google-sheet" | "google-slide", path="/{layer}/{lane}/{filename}", title="...") after opening the project.
|
|
527
|
-
- For flowcharts, process maps, architecture diagrams, system diagrams, data-flow diagrams, visual maps, or other editable diagrams, load and follow the system skill `excalidraw-drafted` (Drafted Excalidraw Diagram) and create native Drafted Excalidraw frames. Use normal Drafted HTML/markdown frames for web/UI mockups, rich visual layouts, or non-editable presentation artifacts.
|
|
528
|
-
- Use breadcrumbs in code or docs where useful: drafted:<frameId> for frames and drafted-project:<projectId> for projects.
|
|
529
|
-
|
|
530
|
-
Collaboration rules:
|
|
531
|
-
- Parallel agents must each open and verify their own Drafted project/org context.
|
|
532
|
-
- If there is any doubt about the correct org, project, wiki location, or skill, ask a short clarifying question before writing.
|
|
483
|
+
You have Drafted MCP tools — a shared surface for durable, reviewable work: produce substantive output as frames on the surface (not only in chat), put knowledge in the org wiki, and encode repeatable methods as skills. The full operating manual is the `drafted` skill installed with the plugin — follow it when working with Drafted. Before writing, verify the org/project echoed in the response is the one you intend.
|
|
533
484
|
</drafted>
|
|
534
485
|
DRAFTED_GLOBAL_INSTRUCTIONS
|
|
535
486
|
}
|
package/mcp/gates.mjs
CHANGED
|
@@ -33,7 +33,7 @@ export function g1Block(gateState, wikiIndex) {
|
|
|
33
33
|
if (gateState.wikiSearched) return null;
|
|
34
34
|
let msg =
|
|
35
35
|
'G1: search the org wiki before reading or editing anything. ' +
|
|
36
|
-
'Call
|
|
36
|
+
'Call fs(search, path="/wiki", query="<relevant terms>") first, then retry. ' +
|
|
37
37
|
'More knowledge = less searching — start by drawing on what the org already knows.';
|
|
38
38
|
if (wikiIndex) msg += `\n\nWiki index (what exists to search):\n${wikiIndex}`;
|
|
39
39
|
return msg;
|
|
@@ -43,16 +43,16 @@ export function g2Block(gateState) {
|
|
|
43
43
|
if (gateState.skillSearched) return null;
|
|
44
44
|
return (
|
|
45
45
|
'G2: search for prior-art skills before creating one. ' +
|
|
46
|
-
'Call
|
|
46
|
+
'Call fs(search, path="/skills", query="<topic>") first — if a close match exists, improve it ' +
|
|
47
47
|
'(/drafted:improve-skill) instead of duplicating — then retry skill(action="add").'
|
|
48
48
|
);
|
|
49
49
|
}
|
|
50
50
|
|
|
51
51
|
export function g3Block(gateState) {
|
|
52
52
|
const missing = [];
|
|
53
|
-
if (!gateState.wikiSearched) missing.push('
|
|
54
|
-
if (!gateState.skillSearched) missing.push('
|
|
55
|
-
if (!gateState.templateSearched) missing.push('
|
|
53
|
+
if (!gateState.wikiSearched) missing.push('fs(search, path="/wiki")');
|
|
54
|
+
if (!gateState.skillSearched) missing.push('fs(search, path="/skills")');
|
|
55
|
+
if (!gateState.templateSearched) missing.push('fs(ls, path="/skills")');
|
|
56
56
|
if (missing.length === 0) return null;
|
|
57
57
|
return (
|
|
58
58
|
`G3: search before creating a project. Run ${missing.join(', ')} first ` +
|