@tryinget/pi-designmd-foundry 0.1.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 +78 -0
- package/README.md +193 -0
- package/docs/adr/.gitkeep +0 -0
- package/docs/engineering.local.md +68 -0
- package/docs/org/operating_model.md +34 -0
- package/docs/project/contributing.md +51 -0
- package/docs/project/extension-sop.md +47 -0
- package/docs/project/foundation.md +31 -0
- package/docs/project/incentives.md +17 -0
- package/docs/project/integration-contract.md +74 -0
- package/docs/project/resources.md +23 -0
- package/docs/project/trusted-publishing.md +47 -0
- package/docs/project/vision.md +18 -0
- package/examples/.gitkeep +0 -0
- package/extensions/designmd.ts +1576 -0
- package/package.json +97 -0
- package/policy/engineering-lane.json +36 -0
- package/policy/security-policy.json +10 -0
- package/prompts/pi-designmd-foundry-implementation-planning.md +21 -0
- package/prompts/pi-designmd-foundry-security-review.md +21 -0
- package/skills/designmd-foundry/SKILL.md +112 -0
- package/src/.gitkeep +0 -0
- package/src/toolboxBundle.ts +67 -0
package/package.json
ADDED
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@tryinget/pi-designmd-foundry",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"description": "Pi extension and skill package for using DesignMD Foundry as a design-contract tool surface.",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"exports": {
|
|
7
|
+
"./toolbox-bundle": "./src/toolboxBundle.ts"
|
|
8
|
+
},
|
|
9
|
+
"license": "SEE LICENSE IN LICENSE",
|
|
10
|
+
"repository": {
|
|
11
|
+
"type": "git",
|
|
12
|
+
"url": "git+https://github.com/tryingET/pi-extensions.git",
|
|
13
|
+
"directory": "packages/pi-designmd-foundry"
|
|
14
|
+
},
|
|
15
|
+
"bugs": {
|
|
16
|
+
"url": "https://github.com/tryingET/pi-extensions/issues"
|
|
17
|
+
},
|
|
18
|
+
"homepage": "https://github.com/tryingET/pi-extensions/tree/main/packages/pi-designmd-foundry",
|
|
19
|
+
"keywords": [
|
|
20
|
+
"pi-package",
|
|
21
|
+
"pi-extension",
|
|
22
|
+
"designmd",
|
|
23
|
+
"design-system",
|
|
24
|
+
"monorepo"
|
|
25
|
+
],
|
|
26
|
+
"publishConfig": {
|
|
27
|
+
"registry": "https://registry.npmjs.org/",
|
|
28
|
+
"access": "public"
|
|
29
|
+
},
|
|
30
|
+
"engines": {
|
|
31
|
+
"node": ">=22.19.0"
|
|
32
|
+
},
|
|
33
|
+
"scripts": {
|
|
34
|
+
"fix": "bash ./scripts/quality-gate.sh fix",
|
|
35
|
+
"lint": "bash ./scripts/quality-gate.sh lint",
|
|
36
|
+
"typecheck": "bash ./scripts/quality-gate.sh typecheck",
|
|
37
|
+
"quality:pre-commit": "bash ./scripts/quality-gate.sh pre-commit",
|
|
38
|
+
"quality:pre-push": "bash ./scripts/quality-gate.sh pre-push",
|
|
39
|
+
"quality:ci": "bash ./scripts/quality-gate.sh ci",
|
|
40
|
+
"check": "npm run quality:ci",
|
|
41
|
+
"test": "npm run quality:ci",
|
|
42
|
+
"docs:list": "bash ./scripts/docs-list.sh",
|
|
43
|
+
"docs:list:workspace": "bash ./scripts/docs-list.sh --workspace --discover",
|
|
44
|
+
"docs:list:json": "bash ./scripts/docs-list.sh --json",
|
|
45
|
+
"release:check": "bash ./scripts/release-check.sh",
|
|
46
|
+
"release:check:quick": "SKIP_PI_SMOKE=1 bash ./scripts/release-check.sh",
|
|
47
|
+
"loop-doctor": "bash -lc 'node --version; npm --version; npm pkg get name version >/dev/null; git status --short -- . || true; exit 0'",
|
|
48
|
+
"loop-verify-fast": "npm run quality:pre-commit",
|
|
49
|
+
"loop-impact-plan": "bash -lc 'echo \"loop-impact-plan: package-local impact planner is coarse; run npm run loop-impact-run for the full package gate.\"; git status --short -- . || true'",
|
|
50
|
+
"loop-impact-run": "npm run check",
|
|
51
|
+
"loop-impact-wide": "npm run check",
|
|
52
|
+
"loop-landing-check": "npm run check"
|
|
53
|
+
},
|
|
54
|
+
"files": [
|
|
55
|
+
"extensions/designmd.ts",
|
|
56
|
+
"src",
|
|
57
|
+
"skills",
|
|
58
|
+
"prompts",
|
|
59
|
+
"examples",
|
|
60
|
+
"docs",
|
|
61
|
+
"policy/security-policy.json",
|
|
62
|
+
"policy/engineering-lane.json"
|
|
63
|
+
],
|
|
64
|
+
"pi": {
|
|
65
|
+
"extensions": [
|
|
66
|
+
"./extensions/designmd.ts"
|
|
67
|
+
],
|
|
68
|
+
"skills": [
|
|
69
|
+
"./skills"
|
|
70
|
+
],
|
|
71
|
+
"prompts": [
|
|
72
|
+
"./prompts"
|
|
73
|
+
]
|
|
74
|
+
},
|
|
75
|
+
"x-pi-template": {
|
|
76
|
+
"scaffoldMode": "simple-package",
|
|
77
|
+
"workspacePath": "packages/pi-designmd-foundry",
|
|
78
|
+
"releaseComponent": "pi-designmd-foundry",
|
|
79
|
+
"releaseConfigMode": "component"
|
|
80
|
+
},
|
|
81
|
+
"devDependencies": {
|
|
82
|
+
"@biomejs/biome": "2.3.14",
|
|
83
|
+
"@earendil-works/pi-ai": "^0.80.6",
|
|
84
|
+
"@earendil-works/pi-coding-agent": "^0.80.6",
|
|
85
|
+
"@types/node": "^22.0.0",
|
|
86
|
+
"@typescript/native-preview": "7.0.0-dev.20260417.1",
|
|
87
|
+
"typebox": "^1.0.0"
|
|
88
|
+
},
|
|
89
|
+
"overrides": {
|
|
90
|
+
"fast-xml-parser": "5.3.6"
|
|
91
|
+
},
|
|
92
|
+
"peerDependencies": {
|
|
93
|
+
"@earendil-works/pi-ai": "*",
|
|
94
|
+
"@earendil-works/pi-coding-agent": "*",
|
|
95
|
+
"typebox": "*"
|
|
96
|
+
}
|
|
97
|
+
}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
{
|
|
2
|
+
"lane": "ts",
|
|
3
|
+
"engineering_core": {
|
|
4
|
+
"tool": "engineering-core",
|
|
5
|
+
"lane": "pi-ts",
|
|
6
|
+
"repository": "https://github.com/lightningralf/engineering-core",
|
|
7
|
+
"ref": "workspace-local-unpinned",
|
|
8
|
+
"command": "uv tool -n run --from ~/ai-society/core/engineering-core engineering-core show pi-ts --prefer-repo",
|
|
9
|
+
"catalog_command": "uv tool -n run --from ~/ai-society/core/engineering-core engineering-core catalog --pretty",
|
|
10
|
+
"list_disciplines_command": "uv tool -n run --from ~/ai-society/core/engineering-core engineering-core list-disciplines",
|
|
11
|
+
"list_templates_command": "uv tool -n run --from ~/ai-society/core/engineering-core engineering-core list-templates",
|
|
12
|
+
"disciplines": [
|
|
13
|
+
"validation",
|
|
14
|
+
"testing",
|
|
15
|
+
"security-privacy",
|
|
16
|
+
"documentation",
|
|
17
|
+
"dependency-governance",
|
|
18
|
+
"design-system",
|
|
19
|
+
"accessibility",
|
|
20
|
+
"specification-and-dsls",
|
|
21
|
+
"engineering-reasoning"
|
|
22
|
+
],
|
|
23
|
+
"loop_validation": {
|
|
24
|
+
"version": "repo-loop-validation-v1",
|
|
25
|
+
"contract_doc": "docs/engineering.local.md#repo-loop-validation",
|
|
26
|
+
"commands": {
|
|
27
|
+
"loop-doctor": "npm run loop-doctor",
|
|
28
|
+
"loop-verify-fast": "npm run loop-verify-fast",
|
|
29
|
+
"loop-impact-plan": "npm run loop-impact-plan",
|
|
30
|
+
"loop-impact-run": "npm run loop-impact-run",
|
|
31
|
+
"loop-impact-wide": "npm run loop-impact-wide",
|
|
32
|
+
"loop-landing-check": "npm run loop-landing-check"
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
---
|
|
2
|
+
summary: "Draft an implementation plan for a requested pi-designmd-foundry change"
|
|
3
|
+
read_when:
|
|
4
|
+
- "Using or maintaining this package prompt template."
|
|
5
|
+
- "Checking prompt metadata for pi package discovery or docs-list validation."
|
|
6
|
+
description: Draft an implementation plan for a requested pi-designmd-foundry change
|
|
7
|
+
system4d:
|
|
8
|
+
container: "Prompt template for implementation planning."
|
|
9
|
+
compass: "Turn requests into actionable, risk-aware plans."
|
|
10
|
+
engine: "Scope -> tasks -> validation -> rollout."
|
|
11
|
+
fog: "Hidden constraints unless assumptions are surfaced."
|
|
12
|
+
---
|
|
13
|
+
|
|
14
|
+
Create a pi-designmd-foundry implementation plan for this request: $@
|
|
15
|
+
|
|
16
|
+
Include:
|
|
17
|
+
- Scope and non-goals
|
|
18
|
+
- Key risks and mitigations
|
|
19
|
+
- Step-by-step implementation tasks
|
|
20
|
+
- Validation commands and expected outcomes
|
|
21
|
+
- Rollout and rollback notes
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
---
|
|
2
|
+
summary: "Review a pi-designmd-foundry change for security risks and mitigations"
|
|
3
|
+
read_when:
|
|
4
|
+
- "Using or maintaining this package prompt template."
|
|
5
|
+
- "Checking prompt metadata for pi package discovery or docs-list validation."
|
|
6
|
+
description: Review a pi-designmd-foundry change for security risks and mitigations
|
|
7
|
+
system4d:
|
|
8
|
+
container: "Prompt template for security-focused review."
|
|
9
|
+
compass: "Identify practical vulnerabilities before release."
|
|
10
|
+
engine: "Threats -> impact -> mitigations -> verification."
|
|
11
|
+
fog: "Partial context can hide exploit paths."
|
|
12
|
+
---
|
|
13
|
+
|
|
14
|
+
Review this pi-designmd-foundry change for security concerns: $@
|
|
15
|
+
|
|
16
|
+
Focus on:
|
|
17
|
+
- Input validation and injection risk
|
|
18
|
+
- Privilege boundaries and secret handling
|
|
19
|
+
- Dependency and supply-chain risk
|
|
20
|
+
- Safe failure modes and logging
|
|
21
|
+
- Concrete remediations with priority
|
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
---
|
|
2
|
+
summary: "Use DesignMD Foundry when doing UI, CSS, design-token, design-system, Penpot/OpenPencil/Pigmnts/Oat, or AI design handoff work. It tells the agent to lint DESIGN.md, export verified design context/tokens, preserve tokens unless intentionally changing the design contract, and avoid wrapping unverified external tool paths."
|
|
3
|
+
read_when:
|
|
4
|
+
- "Using or maintaining this Pi skill."
|
|
5
|
+
- "Checking skill metadata for Pi package discovery or docs-list validation."
|
|
6
|
+
name: designmd-foundry
|
|
7
|
+
description: Use DesignMD Foundry when doing UI, CSS, design-token, design-system, Penpot/OpenPencil/Pigmnts/Oat, or AI design handoff work. It tells the agent to lint DESIGN.md, export verified design context/tokens, preserve tokens unless intentionally changing the design contract, and avoid wrapping unverified external tool paths.
|
|
8
|
+
system4d:
|
|
9
|
+
container: "Skill guidance for DesignMD Foundry-backed design contract workflows."
|
|
10
|
+
compass: "Keep UI/design work grounded in DESIGN.md before implementation."
|
|
11
|
+
engine: "Read DESIGN.md -> lint/export context -> implement/propose patch -> re-lint."
|
|
12
|
+
fog: "External design CLIs may be unavailable; do not overclaim live integration readiness."
|
|
13
|
+
---
|
|
14
|
+
|
|
15
|
+
# DesignMD Foundry
|
|
16
|
+
|
|
17
|
+
Use this skill when a task touches UI implementation, CSS, HTML, component styling, design tokens, `DESIGN.md`, generated design prompts, or integrations such as Penpot, OpenPencil, Pigmnts, and Oat.
|
|
18
|
+
|
|
19
|
+
## Core principle
|
|
20
|
+
|
|
21
|
+
`DESIGN.md` is the design contract. Treat it as source of truth before generating or editing UI.
|
|
22
|
+
|
|
23
|
+
Do not invent colors, radii, spacing scales, type stacks, or component-token names unless the task explicitly asks for a design-system change. If a change is needed, propose the `DESIGN.md` patch separately and run lint before promotion.
|
|
24
|
+
|
|
25
|
+
## Preferred Pi tools
|
|
26
|
+
|
|
27
|
+
When the `pi-designmd-foundry` extension is installed, prefer its tools over ad-hoc shell commands:
|
|
28
|
+
|
|
29
|
+
1. `designmd_lint`
|
|
30
|
+
2. `designmd_export`
|
|
31
|
+
3. `designmd_agent_prompt`
|
|
32
|
+
4. `designmd_oat_visual_snapshot`
|
|
33
|
+
5. `designmd_openpencil_prompt`
|
|
34
|
+
6. `designmd_openpencil_info`
|
|
35
|
+
7. `designmd_openpencil_lint`
|
|
36
|
+
8. `designmd_openpencil_export`
|
|
37
|
+
9. `designmd_import_penpot`
|
|
38
|
+
10. `designmd_palette_from_text`
|
|
39
|
+
11. `designmd_penpot_mcp_inspect`
|
|
40
|
+
12. `designmd_penpot_mcp_bridge`
|
|
41
|
+
13. `designmd_penpot_mcp_export`
|
|
42
|
+
14. `designmd_session_plan`
|
|
43
|
+
15. `designmd_session_variants`
|
|
44
|
+
16. `designmd_session_handoff`
|
|
45
|
+
17. `designmd_session_guided_run`
|
|
46
|
+
18. `designmd_session_browser_agent_handoff`
|
|
47
|
+
19. `designmd_session_closeout`
|
|
48
|
+
20. `designmd_session_promotion_candidate`
|
|
49
|
+
21. `designmd_readiness`
|
|
50
|
+
|
|
51
|
+
Use shell commands only when the extension is unavailable.
|
|
52
|
+
|
|
53
|
+
## Standard workflow for UI/code implementation
|
|
54
|
+
|
|
55
|
+
1. Find the nearest relevant `DESIGN.md`.
|
|
56
|
+
2. Run a design lint check.
|
|
57
|
+
3. Export agent context and concrete implementation artifacts:
|
|
58
|
+
- `agent-prompt` for guidance
|
|
59
|
+
- `css`, `tailwind`, `dtcg`, `tokens`, `xstate`, or `rive` as appropriate
|
|
60
|
+
4. Implement using the exported tokens and prose constraints.
|
|
61
|
+
5. If implementation requires design-system changes, return them as a separate `DESIGN.md` patch proposal.
|
|
62
|
+
6. Re-run lint after any proposed design contract change.
|
|
63
|
+
|
|
64
|
+
## CLI fallback
|
|
65
|
+
|
|
66
|
+
From the DesignMD Foundry repo:
|
|
67
|
+
|
|
68
|
+
```bash
|
|
69
|
+
npm run readiness:integrations
|
|
70
|
+
node dist/cli.js lint DESIGN.md
|
|
71
|
+
node dist/cli.js export --format agent-prompt DESIGN.md
|
|
72
|
+
node dist/cli.js export --format css DESIGN.md
|
|
73
|
+
node dist/cli.js export --format dtcg DESIGN.md
|
|
74
|
+
node dist/cli.js export --format xstate DESIGN.md
|
|
75
|
+
node dist/cli.js export --format rive DESIGN.md
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
If `dist/` is unavailable:
|
|
79
|
+
|
|
80
|
+
```bash
|
|
81
|
+
npm run build
|
|
82
|
+
```
|
|
83
|
+
|
|
84
|
+
## Integration readiness rule
|
|
85
|
+
|
|
86
|
+
Do not claim a live integration just because an adapter exists.
|
|
87
|
+
|
|
88
|
+
- Penpot: file-based DTCG/Penpot token import is stable; official Penpot MCP inspect and existing-board SVG export are read-only; official Penpot MCP bridge board create/update is available only as a plan-by-default / explicit-apply operation from `designmd.canvas-bridge.v1`; update selectors may rebuild selected/latest DesignMD bridge boards only; do not claim continuous sync or unattended mutation automation.
|
|
89
|
+
- OpenPencil: prompt handoff, info/lint, and export to `svg`, `png`, `jpg`, `webp`, or `fig` are stable when DesignMD readiness reports the project-local `openpencil` dev dependency; `jsx` export remains unwrapped until fixture-verified.
|
|
90
|
+
- Pigmnts: text-output palette parsing is stable; image extraction requires installed `pigmnts` and a real image fixture.
|
|
91
|
+
- Oat: theme/preview export and visual snapshot HTML are stable; CDN remains explicit opt-in.
|
|
92
|
+
- Agent prompt export: stable for handoff, but quality should be evaluated in a real implementation task before adding more automation.
|
|
93
|
+
|
|
94
|
+
## Output discipline
|
|
95
|
+
|
|
96
|
+
## Watch Mode reporting
|
|
97
|
+
|
|
98
|
+
If the operator wants to watch progress in the Foundry UI, set `DESIGNMD_SESSION_ENDPOINT` to the Foundry session API root before using the tools:
|
|
99
|
+
|
|
100
|
+
```bash
|
|
101
|
+
export DESIGNMD_SESSION_ENDPOINT=http://127.0.0.1:8788/api/session
|
|
102
|
+
```
|
|
103
|
+
|
|
104
|
+
The adapter will reuse the current running session or create one, then post tool activity and attach generated artifacts. Treat this as an operator watch surface only, not canonical task/evidence authority.
|
|
105
|
+
|
|
106
|
+
When using DesignMD context in a final answer or implementation note, report:
|
|
107
|
+
|
|
108
|
+
1. Which `DESIGN.md` was used.
|
|
109
|
+
2. Lint status.
|
|
110
|
+
3. Which export formats informed the work.
|
|
111
|
+
4. Any token/design-system assumptions.
|
|
112
|
+
5. Any proposed `DESIGN.md` changes separately from code changes.
|
package/src/.gitkeep
ADDED
|
File without changes
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
import type { ExtensionAPI } from "@earendil-works/pi-coding-agent";
|
|
2
|
+
|
|
3
|
+
import registerDesignmdExtension from "../extensions/designmd.ts";
|
|
4
|
+
|
|
5
|
+
type ToolboxRisk = "read" | "mutating";
|
|
6
|
+
|
|
7
|
+
interface ToolboxBundleContext {
|
|
8
|
+
profile: string;
|
|
9
|
+
requestedTools?: string[];
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
interface ToolboxRegisteredToolSummary {
|
|
13
|
+
name: string;
|
|
14
|
+
profile: string;
|
|
15
|
+
risk: ToolboxRisk;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
const PROFILE_TOOLS: Record<string, ToolboxRegisteredToolSummary[]> = {
|
|
19
|
+
read: [
|
|
20
|
+
{ name: "designmd_lint", profile: "read", risk: "read" },
|
|
21
|
+
{ name: "designmd_export", profile: "read", risk: "read" },
|
|
22
|
+
{ name: "designmd_agent_prompt", profile: "read", risk: "read" },
|
|
23
|
+
{ name: "designmd_oat_visual_snapshot", profile: "read", risk: "read" },
|
|
24
|
+
{ name: "designmd_openpencil_prompt", profile: "read", risk: "read" },
|
|
25
|
+
{ name: "designmd_openpencil_info", profile: "read", risk: "read" },
|
|
26
|
+
{ name: "designmd_openpencil_lint", profile: "read", risk: "read" },
|
|
27
|
+
{ name: "designmd_palette_from_text", profile: "read", risk: "read" },
|
|
28
|
+
{ name: "designmd_penpot_mcp_inspect", profile: "read", risk: "read" },
|
|
29
|
+
{ name: "designmd_visual_dossier_pi_critique", profile: "read", risk: "read" },
|
|
30
|
+
{ name: "designmd_readiness", profile: "read", risk: "read" },
|
|
31
|
+
],
|
|
32
|
+
mutating: [
|
|
33
|
+
{ name: "designmd_openpencil_export", profile: "mutating", risk: "mutating" },
|
|
34
|
+
{ name: "designmd_penpot_mcp_bridge", profile: "mutating", risk: "mutating" },
|
|
35
|
+
{ name: "designmd_penpot_mcp_export", profile: "mutating", risk: "mutating" },
|
|
36
|
+
{ name: "designmd_session_plan", profile: "mutating", risk: "mutating" },
|
|
37
|
+
{ name: "designmd_session_variants", profile: "mutating", risk: "mutating" },
|
|
38
|
+
{ name: "designmd_session_closeout", profile: "mutating", risk: "mutating" },
|
|
39
|
+
{ name: "designmd_session_handoff", profile: "mutating", risk: "mutating" },
|
|
40
|
+
{ name: "designmd_session_guided_run", profile: "mutating", risk: "mutating" },
|
|
41
|
+
{
|
|
42
|
+
name: "designmd_session_browser_agent_handoff",
|
|
43
|
+
profile: "mutating",
|
|
44
|
+
risk: "mutating",
|
|
45
|
+
},
|
|
46
|
+
{ name: "designmd_session_promotion_candidate", profile: "mutating", risk: "mutating" },
|
|
47
|
+
{ name: "designmd_import_penpot", profile: "mutating", risk: "mutating" },
|
|
48
|
+
],
|
|
49
|
+
};
|
|
50
|
+
|
|
51
|
+
export const id = "designmd";
|
|
52
|
+
export const version = 1;
|
|
53
|
+
|
|
54
|
+
export function registerToolboxBundle(
|
|
55
|
+
pi: ExtensionAPI,
|
|
56
|
+
context: ToolboxBundleContext = { profile: "read" },
|
|
57
|
+
): ToolboxRegisteredToolSummary[] {
|
|
58
|
+
registerDesignmdExtension(pi);
|
|
59
|
+
|
|
60
|
+
const profile = context.profile || "read";
|
|
61
|
+
const summaries = PROFILE_TOOLS[profile] ?? Object.values(PROFILE_TOOLS).flat();
|
|
62
|
+
const requested = new Set(context.requestedTools ?? []);
|
|
63
|
+
if (requested.size === 0) return summaries;
|
|
64
|
+
return summaries.filter((summary) => requested.has(summary.name));
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
export default registerToolboxBundle;
|