@createsomething/pi-policy-os 0.0.0-bootstrap
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/CHANGELOG.md +5 -0
- package/LICENSE +21 -0
- package/README.md +49 -0
- package/extensions/policy-os-starter.ts +115 -0
- package/package.json +44 -0
- package/prompts/policy-audit.md +64 -0
- package/prompts/subtractive-review.md +53 -0
- package/skills/debug-feedback-loop/SKILL.md +111 -0
- package/skills/intent-mapping/SKILL.md +145 -0
- package/skills/policy-os-starter/SKILL.md +83 -0
- package/skills/tdd-vertical-slice/SKILL.md +91 -0
package/CHANGELOG.md
ADDED
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2025 Create Something
|
|
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,49 @@
|
|
|
1
|
+
# @createsomething/pi-policy-os
|
|
2
|
+
|
|
3
|
+
**Policy OS starter** for [Pi](https://pi.dev) coding agents — governed AI execution with quality gates, policy auditing, and the Subtractive Triad review methodology.
|
|
4
|
+
|
|
5
|
+
## Install
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
pi install npm:@createsomething/pi-policy-os
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
Source price: **$0 under the MIT License**. Managed CREATE SOMETHING Control is a separate service, available from $900/month.
|
|
12
|
+
|
|
13
|
+
## What You Get
|
|
14
|
+
|
|
15
|
+
### Extension
|
|
16
|
+
|
|
17
|
+
A lightweight quality gate extension that:
|
|
18
|
+
|
|
19
|
+
- Warns when code files lack basic quality signals (missing types, untested exports)
|
|
20
|
+
- Provides a `/policy-check` command to audit any codebase against Policy OS patterns
|
|
21
|
+
- Shows governance status in the Pi footer
|
|
22
|
+
|
|
23
|
+
### Skills
|
|
24
|
+
|
|
25
|
+
- `/skill:policy-os-starter` — What Policy OS is, how contract bundles work, the MCP-First Thesis
|
|
26
|
+
- `/skill:debug-feedback-loop` — Repro-first debugging for bugs, failing checks, and performance regressions
|
|
27
|
+
- `/skill:intent-mapping` — Decision, scope, validation, and handoff capture before ambiguous or long-running work
|
|
28
|
+
- `/skill:tdd-vertical-slice` — Test-first vertical-slice development through public interfaces
|
|
29
|
+
|
|
30
|
+
### Prompt Templates
|
|
31
|
+
|
|
32
|
+
- `/policy-audit` — Audit a codebase for governance gaps (missing tests, untyped exports, policy artifacts)
|
|
33
|
+
- `/subtractive-review` — Apply the Subtractive Triad as code review methodology (DRY → Rams → Heidegger)
|
|
34
|
+
|
|
35
|
+
## What Is Policy OS?
|
|
36
|
+
|
|
37
|
+
Policy OS is CREATE SOMETHING's governed execution platform:
|
|
38
|
+
|
|
39
|
+
1. **MCP servers establish trust** — controlled, permissioned access to your tools
|
|
40
|
+
2. **Skills provide capabilities** — reusable, portable across agent platforms
|
|
41
|
+
3. **Agents produce outcomes** — with approval gates, escalation policies, and quality controls
|
|
42
|
+
|
|
43
|
+
**The MCP-First Thesis**: The entry point to automation is connectivity, not intelligence. MCP consumption is commoditized. MCP creation is not.
|
|
44
|
+
|
|
45
|
+
## Go Further
|
|
46
|
+
|
|
47
|
+
- [CREATE SOMETHING](https://createsomething.agency) — Custom MCP development and Policy OS delivery
|
|
48
|
+
- [Three-Tier Framework](https://www.npmjs.com/package/@createsomething/pi-three-tier-framework) — The architectural model
|
|
49
|
+
- [Policy OS paper](https://createsomething.io/papers/policy-os-development-infrastructure)
|
|
@@ -0,0 +1,115 @@
|
|
|
1
|
+
import type { ExtensionAPI } from "@earendil-works/pi-coding-agent";
|
|
2
|
+
import { execSync } from "node:child_process";
|
|
3
|
+
import * as fs from "node:fs";
|
|
4
|
+
import * as path from "node:path";
|
|
5
|
+
|
|
6
|
+
function run(cmd: string, cwd?: string): string {
|
|
7
|
+
try {
|
|
8
|
+
return execSync(cmd, { cwd: cwd ?? process.cwd(), encoding: "utf-8", timeout: 30_000, stdio: ["pipe", "pipe", "pipe"] }).trim();
|
|
9
|
+
} catch { return ""; }
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
export default function (pi: ExtensionAPI) {
|
|
13
|
+
|
|
14
|
+
// Show governance status in footer
|
|
15
|
+
pi.on("session_start", async (_event, ctx) => {
|
|
16
|
+
const root = process.cwd();
|
|
17
|
+
|
|
18
|
+
// Quick governance signal scan
|
|
19
|
+
const signals: string[] = [];
|
|
20
|
+
if (fs.existsSync(path.join(root, ".husky"))) signals.push("hooks");
|
|
21
|
+
if (fs.existsSync(path.join(root, ".github/workflows"))) signals.push("CI");
|
|
22
|
+
if (fs.existsSync(path.join(root, "docs/policies"))) signals.push("policies");
|
|
23
|
+
|
|
24
|
+
const score = signals.length === 0 ? "ungoverned" : signals.join("+");
|
|
25
|
+
ctx.ui.setStatus("policy-os", `⚖️ ${score}`);
|
|
26
|
+
});
|
|
27
|
+
|
|
28
|
+
// /policy-check command
|
|
29
|
+
pi.registerCommand("policy-check", {
|
|
30
|
+
description: "Quick Policy OS governance check on this project",
|
|
31
|
+
handler: async (_args, ctx) => {
|
|
32
|
+
const root = process.cwd();
|
|
33
|
+
ctx.ui.setStatus("policy-os", "🔍 Checking…");
|
|
34
|
+
|
|
35
|
+
const checks: Array<{ name: string; pass: boolean; detail: string }> = [];
|
|
36
|
+
|
|
37
|
+
// 1. Pre-commit hooks
|
|
38
|
+
const hasHusky = fs.existsSync(path.join(root, ".husky"));
|
|
39
|
+
const hasLintStaged = fs.existsSync(path.join(root, ".lintstagedrc")) || fs.existsSync(path.join(root, "lint-staged.config.js"));
|
|
40
|
+
checks.push({
|
|
41
|
+
name: "Pre-commit hooks",
|
|
42
|
+
pass: hasHusky || hasLintStaged,
|
|
43
|
+
detail: hasHusky ? "Husky configured" : hasLintStaged ? "lint-staged configured" : "No pre-commit hooks found",
|
|
44
|
+
});
|
|
45
|
+
|
|
46
|
+
// 2. CI pipeline
|
|
47
|
+
const hasGHA = fs.existsSync(path.join(root, ".github/workflows"));
|
|
48
|
+
checks.push({
|
|
49
|
+
name: "CI pipeline",
|
|
50
|
+
pass: hasGHA,
|
|
51
|
+
detail: hasGHA ? "GitHub Actions found" : "No CI configuration found",
|
|
52
|
+
});
|
|
53
|
+
|
|
54
|
+
// 3. Type checking
|
|
55
|
+
const hasTsConfig = fs.existsSync(path.join(root, "tsconfig.json")) || fs.existsSync(path.join(root, "tsconfig.base.json"));
|
|
56
|
+
checks.push({
|
|
57
|
+
name: "TypeScript",
|
|
58
|
+
pass: hasTsConfig,
|
|
59
|
+
detail: hasTsConfig ? "TypeScript configured" : "No tsconfig found",
|
|
60
|
+
});
|
|
61
|
+
|
|
62
|
+
// 4. Agent context files
|
|
63
|
+
const hasAgentsMd = fs.existsSync(path.join(root, "AGENTS.md")) || fs.existsSync(path.join(root, "CLAUDE.md"));
|
|
64
|
+
checks.push({
|
|
65
|
+
name: "Agent context",
|
|
66
|
+
pass: hasAgentsMd,
|
|
67
|
+
detail: hasAgentsMd ? "AGENTS.md or CLAUDE.md found" : "No agent context file",
|
|
68
|
+
});
|
|
69
|
+
|
|
70
|
+
// 5. Policy artifacts
|
|
71
|
+
const hasPolicies = fs.existsSync(path.join(root, "docs/policies"));
|
|
72
|
+
const policyCount = hasPolicies ? run("ls docs/policies/v1/*.md 2>/dev/null | wc -l", root).trim() : "0";
|
|
73
|
+
checks.push({
|
|
74
|
+
name: "Policy artifacts",
|
|
75
|
+
pass: hasPolicies,
|
|
76
|
+
detail: hasPolicies ? `${policyCount} versioned policies` : "No policy directory",
|
|
77
|
+
});
|
|
78
|
+
|
|
79
|
+
// 6. Tests
|
|
80
|
+
const pkgJson = path.join(root, "package.json");
|
|
81
|
+
let hasTest = false;
|
|
82
|
+
if (fs.existsSync(pkgJson)) {
|
|
83
|
+
try { hasTest = !!JSON.parse(fs.readFileSync(pkgJson, "utf-8")).scripts?.test; } catch {}
|
|
84
|
+
}
|
|
85
|
+
checks.push({
|
|
86
|
+
name: "Test scripts",
|
|
87
|
+
pass: hasTest,
|
|
88
|
+
detail: hasTest ? "Root test script found" : "No test script in package.json",
|
|
89
|
+
});
|
|
90
|
+
|
|
91
|
+
// Build report
|
|
92
|
+
const passed = checks.filter((c) => c.pass).length;
|
|
93
|
+
const total = checks.length;
|
|
94
|
+
const score = Math.round((passed / total) * 100);
|
|
95
|
+
|
|
96
|
+
const lines = [
|
|
97
|
+
`## Policy OS Governance Check`,
|
|
98
|
+
``,
|
|
99
|
+
`**Score: ${score}/100** (${passed}/${total} checks passing)`,
|
|
100
|
+
``,
|
|
101
|
+
...checks.map((c) => `${c.pass ? "✅" : "❌"} **${c.name}**: ${c.detail}`),
|
|
102
|
+
``,
|
|
103
|
+
`### Recommended Tier`,
|
|
104
|
+
score >= 80 ? "→ **Policy OS Core** — strong governance foundation" :
|
|
105
|
+
score >= 50 ? "→ **Policy OS Trial** — governance gaps to address" :
|
|
106
|
+
"→ **MCP Audit** — needs governance foundation before Policy OS",
|
|
107
|
+
``,
|
|
108
|
+
`Learn more: https://createsomething.agency`,
|
|
109
|
+
];
|
|
110
|
+
|
|
111
|
+
ctx.ui.setStatus("policy-os", score >= 80 ? "✓ Governed" : `⚠️ ${score}/100`);
|
|
112
|
+
pi.sendUserMessage(lines.join("\n"), { deliverAs: "followUp" });
|
|
113
|
+
},
|
|
114
|
+
});
|
|
115
|
+
}
|
package/package.json
ADDED
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@createsomething/pi-policy-os",
|
|
3
|
+
"version": "0.0.0-bootstrap",
|
|
4
|
+
"description": "Policy OS starter for Pi coding agents — governed AI execution with quality gates, policy checks, and the MCP-First Thesis. The entry point to CREATE SOMETHING's governed automation platform.",
|
|
5
|
+
"keywords": [
|
|
6
|
+
"pi-package",
|
|
7
|
+
"policy-os",
|
|
8
|
+
"governance",
|
|
9
|
+
"mcp",
|
|
10
|
+
"quality-gates",
|
|
11
|
+
"agent-systems"
|
|
12
|
+
],
|
|
13
|
+
"author": "CREATE SOMETHING <hello@createsomething.agency>",
|
|
14
|
+
"license": "MIT",
|
|
15
|
+
"type": "module",
|
|
16
|
+
"files": [
|
|
17
|
+
"skills",
|
|
18
|
+
"prompts",
|
|
19
|
+
"extensions",
|
|
20
|
+
"README.md",
|
|
21
|
+
"LICENSE",
|
|
22
|
+
"CHANGELOG.md"
|
|
23
|
+
],
|
|
24
|
+
"repository": {
|
|
25
|
+
"type": "git",
|
|
26
|
+
"url": "git+https://github.com/createsomethingtoday/create-something-monorepo.git",
|
|
27
|
+
"directory": "packages/pi-policy-os"
|
|
28
|
+
},
|
|
29
|
+
"publishConfig": {
|
|
30
|
+
"access": "public",
|
|
31
|
+
"provenance": false
|
|
32
|
+
},
|
|
33
|
+
"pi": {
|
|
34
|
+
"skills": [
|
|
35
|
+
"./skills"
|
|
36
|
+
],
|
|
37
|
+
"prompts": [
|
|
38
|
+
"./prompts"
|
|
39
|
+
],
|
|
40
|
+
"extensions": [
|
|
41
|
+
"./extensions"
|
|
42
|
+
]
|
|
43
|
+
}
|
|
44
|
+
}
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: Audit a codebase for Policy OS governance gaps
|
|
3
|
+
argument-hint: "[path]"
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
Load the policy-os-starter skill, then audit `$@` for governance gaps.
|
|
7
|
+
|
|
8
|
+
## Checks
|
|
9
|
+
|
|
10
|
+
### 1. Quality Gate Coverage
|
|
11
|
+
- Are there pre-commit hooks? (`husky`, `lint-staged`, `.husky/`)
|
|
12
|
+
- Are there CI checks? (`.github/workflows/`, type check, lint, test)
|
|
13
|
+
- Is there a design system enforced? (token compliance, component library)
|
|
14
|
+
|
|
15
|
+
### 2. Agent Legibility
|
|
16
|
+
- Does each package have a clear entry point?
|
|
17
|
+
- Is there a boot command documented?
|
|
18
|
+
- Is there a smoke/validation path?
|
|
19
|
+
- Is there an escalation rule?
|
|
20
|
+
|
|
21
|
+
### 3. Policy Artifacts
|
|
22
|
+
- Are there versioned policy files? (`policies/`, `*.policy.*`)
|
|
23
|
+
- Are approval gates defined?
|
|
24
|
+
- Are escalation paths documented?
|
|
25
|
+
|
|
26
|
+
### 4. Evidence Surface
|
|
27
|
+
- Where is delivery evidence recorded?
|
|
28
|
+
- Is there an issue tracker integration?
|
|
29
|
+
- Are deploys traceable to issues?
|
|
30
|
+
|
|
31
|
+
### 5. Subtractive Triad Compliance
|
|
32
|
+
- **DRY**: Any obvious duplication across packages?
|
|
33
|
+
- **Rams**: Any packages/files that don't earn their existence?
|
|
34
|
+
- **Heidegger**: Any orphaned code that doesn't serve the whole?
|
|
35
|
+
|
|
36
|
+
## Output
|
|
37
|
+
|
|
38
|
+
```
|
|
39
|
+
## Policy Audit: [path]
|
|
40
|
+
|
|
41
|
+
### Governance Score: [0-100]
|
|
42
|
+
|
|
43
|
+
### Quality Gates: [score]
|
|
44
|
+
- ...
|
|
45
|
+
|
|
46
|
+
### Agent Legibility: [score]
|
|
47
|
+
- ...
|
|
48
|
+
|
|
49
|
+
### Policy Artifacts: [score]
|
|
50
|
+
- ...
|
|
51
|
+
|
|
52
|
+
### Evidence Surface: [score]
|
|
53
|
+
- ...
|
|
54
|
+
|
|
55
|
+
### Recommendations (prioritized)
|
|
56
|
+
1. ...
|
|
57
|
+
2. ...
|
|
58
|
+
3. ...
|
|
59
|
+
|
|
60
|
+
### Policy OS Fit
|
|
61
|
+
- Current tier: [MCP-only | Policy OS Trial | Policy OS Core]
|
|
62
|
+
- Recommended tier: ...
|
|
63
|
+
- Key gap: ...
|
|
64
|
+
```
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: Apply the Subtractive Triad as code review methodology (DRY → Rams → Heidegger)
|
|
3
|
+
argument-hint: "[path or git diff]"
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
Load the policy-os-starter skill, then review `$@` through the Subtractive Triad lens.
|
|
7
|
+
|
|
8
|
+
## Pass 1: DRY (Implementation)
|
|
9
|
+
|
|
10
|
+
**Question**: "Have I built this before?"
|
|
11
|
+
|
|
12
|
+
- Scan for code duplication within the diff
|
|
13
|
+
- Check for patterns existing elsewhere in the codebase
|
|
14
|
+
- Look for reinvented utilities
|
|
15
|
+
- Identify copy-paste from other files
|
|
16
|
+
|
|
17
|
+
## Pass 2: Rams (Artifact)
|
|
18
|
+
|
|
19
|
+
**Question**: "Does this earn its existence?"
|
|
20
|
+
|
|
21
|
+
Apply Rams' principles:
|
|
22
|
+
1. Is it useful? Does it solve a real problem?
|
|
23
|
+
2. Is it honest? Does it promise only what it delivers?
|
|
24
|
+
3. Is it understandable? Is purpose self-evident?
|
|
25
|
+
4. Is it unobtrusive? Does complexity recede?
|
|
26
|
+
5. Is it as little as possible? Can anything be removed?
|
|
27
|
+
|
|
28
|
+
## Pass 3: Heidegger (System)
|
|
29
|
+
|
|
30
|
+
**Question**: "Does this serve the whole?"
|
|
31
|
+
|
|
32
|
+
- Does the change strengthen system coherence?
|
|
33
|
+
- Are there circular dependencies?
|
|
34
|
+
- Are there orphaned files?
|
|
35
|
+
- Does this automation enable dwelling or merely accelerate consumption? (Gestell check)
|
|
36
|
+
- Are we adopting patterns because they're common, or because this work demands them? (Das Man check)
|
|
37
|
+
|
|
38
|
+
## Output
|
|
39
|
+
|
|
40
|
+
```
|
|
41
|
+
# Subtractive Review
|
|
42
|
+
|
|
43
|
+
## Summary
|
|
44
|
+
Files: N | Added: +X | Removed: -Y
|
|
45
|
+
|
|
46
|
+
## Pass 1: DRY — [findings]
|
|
47
|
+
## Pass 2: Rams — [findings]
|
|
48
|
+
## Pass 3: Heidegger — [findings]
|
|
49
|
+
|
|
50
|
+
## Verdict: [✅ APPROVED | ⚠️ COMMENTS | ❌ CHANGES REQUESTED]
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
If no path given, review `git diff HEAD`.
|
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: debug-feedback-loop
|
|
3
|
+
description: Repro-first debugging for bugs, failing checks, and performance regressions. Use when something is broken, slow, flaky, or throwing and the next step needs evidence rather than a theory.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Debug Feedback Loop
|
|
7
|
+
|
|
8
|
+
Use this skill to keep debugging sessions evidence-led. The goal is one tight
|
|
9
|
+
command that can prove the bug is present before changing code, then prove it is
|
|
10
|
+
gone after the fix.
|
|
11
|
+
|
|
12
|
+
This is a Policy OS execution loop:
|
|
13
|
+
|
|
14
|
+
| Tier | Debug question | Evidence |
|
|
15
|
+
| -------------- | ----------------------------------------------------------------------------- | -------------------------------------------------------------------- |
|
|
16
|
+
| **Database** | Is the source data, config, fixture, or external state correct and available? | fixture, API response, DB row, env binding, log excerpt |
|
|
17
|
+
| **Automation** | Did the code path, tool, worker, or job execute correctly? | test, CLI run, smoke, trace, workflow log |
|
|
18
|
+
| **Judgment** | Was the right policy, approval, route, or fallback applied? | policy artifact, Linear evidence, approval record, expected decision |
|
|
19
|
+
|
|
20
|
+
Check tiers in that order. Lower-tier failures make higher-tier theories noisy.
|
|
21
|
+
|
|
22
|
+
## Required Loop
|
|
23
|
+
|
|
24
|
+
Do not start with a likely cause. Start by building a feedback loop.
|
|
25
|
+
|
|
26
|
+
A valid loop is:
|
|
27
|
+
|
|
28
|
+
- **Red-capable**: it drives the reported failure path and asserts the specific
|
|
29
|
+
symptom, not just "does not crash".
|
|
30
|
+
- **Deterministic**: same verdict every run, or a known high reproduction rate
|
|
31
|
+
for flaky failures.
|
|
32
|
+
- **Fast enough**: seconds when possible; narrow minutes when the real path is a
|
|
33
|
+
worker, browser, or CI workflow.
|
|
34
|
+
- **Agent-runnable**: a command the agent can run without manual clicking unless
|
|
35
|
+
the task is explicitly human-in-the-loop.
|
|
36
|
+
|
|
37
|
+
Preferred loop shapes:
|
|
38
|
+
|
|
39
|
+
1. Package-local test or smoke.
|
|
40
|
+
2. CLI command with a fixture and explicit expected output.
|
|
41
|
+
3. HTTP `curl` or route smoke against a local or preview server.
|
|
42
|
+
4. Browser automation for UI regressions.
|
|
43
|
+
5. Captured trace replay, HAR replay, queue payload, or workflow log replay.
|
|
44
|
+
6. Small throwaway harness when no public command reaches the path.
|
|
45
|
+
|
|
46
|
+
For CREATE SOMETHING repos, prefer existing commands before inventing new ones:
|
|
47
|
+
|
|
48
|
+
```bash
|
|
49
|
+
pnpm exports <package> <symbol>
|
|
50
|
+
pnpm --filter <package> test
|
|
51
|
+
pnpm --filter <package> check
|
|
52
|
+
pnpm check
|
|
53
|
+
pnpm lint
|
|
54
|
+
pnpm agent:solo-loop:check
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
Use Context7 for unstable third-party APIs. Use Ground before claiming duplicate
|
|
58
|
+
code, dead exports, orphaned modules, or environment-boundary mistakes.
|
|
59
|
+
|
|
60
|
+
## Workflow
|
|
61
|
+
|
|
62
|
+
1. **Name the symptom**
|
|
63
|
+
- Quote or summarize the exact failure, error, wrong output, slow timing, or
|
|
64
|
+
user-visible behavior.
|
|
65
|
+
- Identify the owning truth surface: local command, package test, browser
|
|
66
|
+
route, deployed worker, Linear issue, GitHub check, Airtable/Admin state,
|
|
67
|
+
or another external source.
|
|
68
|
+
|
|
69
|
+
2. **Build the loop**
|
|
70
|
+
- Produce one command or scripted check that can go red for this bug.
|
|
71
|
+
- If no loop is possible, stop and state what artifact is missing: access,
|
|
72
|
+
logs, fixture, HAR, trace, screen recording, or permission to add temporary
|
|
73
|
+
instrumentation.
|
|
74
|
+
|
|
75
|
+
3. **Reproduce and minimize**
|
|
76
|
+
- Run the loop and capture the failing output.
|
|
77
|
+
- Remove inputs, config, fixtures, and steps one at a time until the smallest
|
|
78
|
+
load-bearing failure remains.
|
|
79
|
+
|
|
80
|
+
4. **Rank hypotheses**
|
|
81
|
+
- Write 3 to 5 falsifiable hypotheses only after the loop exists.
|
|
82
|
+
- Each hypothesis must predict what observation or one-variable change would
|
|
83
|
+
confirm or falsify it.
|
|
84
|
+
|
|
85
|
+
5. **Instrument narrowly**
|
|
86
|
+
- Probe one hypothesis at a time.
|
|
87
|
+
- Tag temporary logs with a unique prefix such as `[DEBUG-20260629-a]`.
|
|
88
|
+
- For performance work, measure before changing code.
|
|
89
|
+
|
|
90
|
+
6. **Fix with a regression check**
|
|
91
|
+
- Add the smallest regression test or smoke at the correct public interface.
|
|
92
|
+
- If no correct interface exists, record that as an architecture finding and
|
|
93
|
+
keep the original loop as completion evidence.
|
|
94
|
+
- Apply the fix, rerun the regression check, then rerun the original loop.
|
|
95
|
+
|
|
96
|
+
7. **Clean up and record evidence**
|
|
97
|
+
- Remove temporary logs and throwaway harnesses unless they became real tests.
|
|
98
|
+
- For tracked work, record commands, pass/fail results, branch or worktree,
|
|
99
|
+
deploy or smoke evidence, rollback note, and caveats in Linear.
|
|
100
|
+
|
|
101
|
+
## Completion Bar
|
|
102
|
+
|
|
103
|
+
Do not call the bug fixed until all of these are true:
|
|
104
|
+
|
|
105
|
+
- Original loop now passes.
|
|
106
|
+
- Regression check passes, or the lack of a correct test surface is documented.
|
|
107
|
+
- Temporary instrumentation is removed.
|
|
108
|
+
- The final explanation names the proven cause and the evidence that ruled out
|
|
109
|
+
the wrong theories.
|
|
110
|
+
- Linear evidence is updated when the work is shared, delegated, production
|
|
111
|
+
bound, or needed for handoff.
|
|
@@ -0,0 +1,145 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: intent-mapping
|
|
3
|
+
description: Intent mapping for ambiguous, long-running, shared, or production-bound work. Use when the user wants to clarify a plan, scope a goal, prepare Linear work, or resolve decisions before implementation.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Intent Mapping
|
|
7
|
+
|
|
8
|
+
Use this skill to turn fuzzy intent into a durable execution packet before work
|
|
9
|
+
starts. The goal is shared understanding, not a planning ceremony.
|
|
10
|
+
|
|
11
|
+
Intent mapping is the CREATE SOMETHING adaptation of a relentless interview:
|
|
12
|
+
ask one useful question, recommend the likely answer, then wait. Continue until
|
|
13
|
+
the open decisions are resolved enough to choose the correct workflow lane.
|
|
14
|
+
|
|
15
|
+
## Repo Rules
|
|
16
|
+
|
|
17
|
+
- Read `AGENTS.md`, package-local `AGENTS.md`, relevant README files, and nearby
|
|
18
|
+
tests or docs before asking questions that the repo can answer.
|
|
19
|
+
- Use Linear for shared, delegated, long-running, production-bound, or
|
|
20
|
+
evidence-bearing work.
|
|
21
|
+
- Use `pnpm agent:solo-loop` for solo current-checkout exploration.
|
|
22
|
+
- Use `pnpm agent:claim-worktree -- --issue CRE-123` for isolated
|
|
23
|
+
implementation work that needs a durable handoff.
|
|
24
|
+
- Do not create Loom tasks, local issue files, GitHub issues, or a second
|
|
25
|
+
tracker for this workflow.
|
|
26
|
+
|
|
27
|
+
## Question Loop
|
|
28
|
+
|
|
29
|
+
Ask one question at a time. Multiple questions at once hide dependencies between
|
|
30
|
+
decisions and make it harder for the user to correct the path.
|
|
31
|
+
|
|
32
|
+
Each question must include:
|
|
33
|
+
|
|
34
|
+
- the decision being resolved
|
|
35
|
+
- your recommended answer
|
|
36
|
+
- why that recommendation fits the repo, product, or workflow
|
|
37
|
+
- what the answer will change about implementation, validation, or handoff
|
|
38
|
+
|
|
39
|
+
If the answer can be discovered from the codebase, docs, Linear issue, browser
|
|
40
|
+
state, logs, or another owning truth surface, inspect that source instead of
|
|
41
|
+
asking the user.
|
|
42
|
+
|
|
43
|
+
Prefer concrete choices over abstract discussion. Good questions ask for a
|
|
44
|
+
decision that changes the work.
|
|
45
|
+
|
|
46
|
+
## Map Mode
|
|
47
|
+
|
|
48
|
+
Use map mode when one intent-mapping session reveals more decision work than a
|
|
49
|
+
single agent session should hold, or when the work is shared, delegated,
|
|
50
|
+
long-running, production-bound, or explicitly needs many grilling sessions.
|
|
51
|
+
Map mode is the Linear-native way to orchestrate that breadth; do not install a
|
|
52
|
+
second tracker or copy an external issue workflow wholesale.
|
|
53
|
+
|
|
54
|
+
Stay out of map mode when the way is already clear enough to produce one Intent
|
|
55
|
+
Packet. In that case, finish the packet and let the user correct it before
|
|
56
|
+
implementation starts.
|
|
57
|
+
|
|
58
|
+
When map mode is needed:
|
|
59
|
+
|
|
60
|
+
1. Create or use one Linear issue as the map. Its body is an index, not the
|
|
61
|
+
source of every answer.
|
|
62
|
+
2. Name the destination first. The destination fixes scope, non-goals, and stop
|
|
63
|
+
conditions.
|
|
64
|
+
3. Use these map sections: `Destination`, `Notes`, `Decisions so far`, `Not yet
|
|
65
|
+
specified`, and `Out of scope`.
|
|
66
|
+
4. Create child or linked Linear issues only for questions that are sharp enough
|
|
67
|
+
to state now. Each issue should resolve one decision and fit in one agent
|
|
68
|
+
session.
|
|
69
|
+
5. Put unclear future work in `Not yet specified` as fog, not as premature
|
|
70
|
+
tickets. Graduate fog into tickets only when the question becomes precise.
|
|
71
|
+
6. Use Linear-native parent, relation, assignment, and blocking fields where
|
|
72
|
+
available. If a native relationship is unavailable, link the map and child
|
|
73
|
+
issues explicitly in their descriptions.
|
|
74
|
+
7. Treat the frontier as the open, unblocked, unclaimed child issues. Claim one
|
|
75
|
+
frontier issue before working it.
|
|
76
|
+
8. Never resolve more than one map ticket in a single session. Record the answer
|
|
77
|
+
on that ticket, close it, then append only a short pointer to the map's
|
|
78
|
+
`Decisions so far`.
|
|
79
|
+
9. If a ticket turns out to sit beyond the destination, close it as out of scope
|
|
80
|
+
and link it from the map's `Out of scope` section instead of treating it as a
|
|
81
|
+
decision on the route.
|
|
82
|
+
|
|
83
|
+
Ticket types are:
|
|
84
|
+
|
|
85
|
+
- `Grilling`: human-in-the-loop decision work, one question at a time.
|
|
86
|
+
- `Research`: agent-driven reading of docs, code, logs, or external sources.
|
|
87
|
+
- `Prototype`: a cheap artifact created to make a decision concrete.
|
|
88
|
+
- `Task`: manual or agent work that must happen before a decision can be made.
|
|
89
|
+
|
|
90
|
+
Charting a map is one session of work. Stop after the map and first frontier are
|
|
91
|
+
created; do not also start resolving tickets unless the user explicitly asks to
|
|
92
|
+
continue and the next ticket has been claimed.
|
|
93
|
+
|
|
94
|
+
## Tier Mapping
|
|
95
|
+
|
|
96
|
+
Classify the work before recommending a lane:
|
|
97
|
+
|
|
98
|
+
| Tier | Intent question | Useful evidence |
|
|
99
|
+
| -------------- | --------------------------------------------------------------- | ---------------------------------------------------- |
|
|
100
|
+
| **Database** | What state, resource, artifact, or source of truth must change? | schema, fixture, API response, config, policy doc |
|
|
101
|
+
| **Automation** | What execution path, tool, worker, route, or command must run? | test, CLI, smoke, workflow log, browser proof |
|
|
102
|
+
| **Judgment** | What policy, approval, fallback, or operator decision applies? | Linear evidence, approval note, policy artifact, ADR |
|
|
103
|
+
|
|
104
|
+
If the work crosses tiers, keep the tier ownership explicit in the packet.
|
|
105
|
+
|
|
106
|
+
## Intent Packet
|
|
107
|
+
|
|
108
|
+
Stop asking once you can produce this packet without guessing:
|
|
109
|
+
|
|
110
|
+
```text
|
|
111
|
+
Linear: <CRE-123, create one, or none>
|
|
112
|
+
Lane: <solo-loop | claim-worktree | PR/promotion | research/no-edit>
|
|
113
|
+
Tier: <Database | Automation | Judgment | mixed>
|
|
114
|
+
Goal: <one concrete outcome>
|
|
115
|
+
Decisions:
|
|
116
|
+
- <decision and chosen answer>
|
|
117
|
+
Non-goals:
|
|
118
|
+
- <explicitly excluded work>
|
|
119
|
+
Acceptance criteria:
|
|
120
|
+
- <observable done condition>
|
|
121
|
+
Verification:
|
|
122
|
+
- <commands, smoke checks, browser checks, or external truth surfaces>
|
|
123
|
+
Stop conditions:
|
|
124
|
+
- <when to pause, ask, or escalate>
|
|
125
|
+
Policy artifacts:
|
|
126
|
+
- <AGENTS.md, policy docs, runbooks, issue links, approval requirements>
|
|
127
|
+
Evidence target:
|
|
128
|
+
- <Linear comment, PR body, deploy note, local summary, or none>
|
|
129
|
+
```
|
|
130
|
+
|
|
131
|
+
For Linear-tracked work, include the packet in the issue description or a Linear
|
|
132
|
+
comment before implementation starts. For solo-loop work, include the packet in
|
|
133
|
+
the starter prompt or first agent message.
|
|
134
|
+
|
|
135
|
+
## Completion Bar
|
|
136
|
+
|
|
137
|
+
Intent mapping is complete only when:
|
|
138
|
+
|
|
139
|
+
- every open decision that affects implementation, validation, or handoff has a
|
|
140
|
+
chosen answer or an explicit stop condition
|
|
141
|
+
- the correct lane is selected
|
|
142
|
+
- the verification surface is named
|
|
143
|
+
- production, deploy, merge, credential, and third-party mutation boundaries are
|
|
144
|
+
explicit
|
|
145
|
+
- the user has had a chance to correct the packet before implementation begins
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: policy-os-starter
|
|
3
|
+
description: Policy OS product overview, contract bundles, the MCP-First Thesis, and the Subtractive Triad. Use when reasoning about governance, quality gates, or agent delivery patterns.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Policy OS Starter
|
|
7
|
+
|
|
8
|
+
The essential knowledge for working with CREATE SOMETHING's governed execution platform.
|
|
9
|
+
|
|
10
|
+
## The MCP-First Thesis
|
|
11
|
+
|
|
12
|
+
**The entry point to automation is connectivity, not intelligence.**
|
|
13
|
+
|
|
14
|
+
The pattern from industry adoption:
|
|
15
|
+
1. **MCP servers establish trust** (controlled, permissioned access)
|
|
16
|
+
2. **Skills provide capabilities** (reusable, portable across platforms)
|
|
17
|
+
3. **Agents produce outcomes** (the monetizable layer)
|
|
18
|
+
|
|
19
|
+
**MCP consumption is commoditized. MCP creation is not.** — This is the moat.
|
|
20
|
+
|
|
21
|
+
## Policy OS Definition
|
|
22
|
+
|
|
23
|
+
Policy OS is the canonical paid CREATE SOMETHING package for governed AI execution. It combines:
|
|
24
|
+
|
|
25
|
+
- Custom MCP connectivity
|
|
26
|
+
- Agent and workflow behavior contracts
|
|
27
|
+
- Policy artifacts and approval boundaries
|
|
28
|
+
- Operator runbooks and golden-task regressions
|
|
29
|
+
- Recurring review, tuning, and escalation operations
|
|
30
|
+
|
|
31
|
+
## Service Tiers
|
|
32
|
+
|
|
33
|
+
| Tier | Scope |
|
|
34
|
+
|------|-------|
|
|
35
|
+
| **MCP Audit** | Diagnose what MCPs to build |
|
|
36
|
+
| **MCP-only** | Free discovery/compliance wedge |
|
|
37
|
+
| **Policy OS Trial** | Time-limited paid trial |
|
|
38
|
+
| **Policy OS Core** | Full governed execution |
|
|
39
|
+
|
|
40
|
+
## Contract Bundle
|
|
41
|
+
|
|
42
|
+
Every Policy OS engagement ships these artifacts:
|
|
43
|
+
|
|
44
|
+
| Artifact | Purpose |
|
|
45
|
+
|----------|---------|
|
|
46
|
+
| `mcp_contract.yaml` | MCP connectivity scope and permissions |
|
|
47
|
+
| `agent_contract.yaml` | Agent behavior boundaries and tool access |
|
|
48
|
+
| `outcome_contract.md` | Expected outcomes and success metrics |
|
|
49
|
+
| `golden_tasks.yaml` | Regression test tasks for quality assurance |
|
|
50
|
+
| `runbook.md` | Operator procedures, escalation paths |
|
|
51
|
+
|
|
52
|
+
## The Subtractive Triad
|
|
53
|
+
|
|
54
|
+
The code review and decision-making methodology:
|
|
55
|
+
|
|
56
|
+
| Level | Discipline | Question | Action |
|
|
57
|
+
|-------|-----------|----------|--------|
|
|
58
|
+
| **Implementation** | DRY | "Have I built this before?" | Unify |
|
|
59
|
+
| **Artifact** | Rams | "Does this earn its existence?" | Remove |
|
|
60
|
+
| **System** | Heidegger | "Does this serve the whole?" | Reconnect |
|
|
61
|
+
|
|
62
|
+
Apply in order. Each level enables the next.
|
|
63
|
+
|
|
64
|
+
## Quality Gate Patterns
|
|
65
|
+
|
|
66
|
+
Policy OS governance translates to agent quality gates:
|
|
67
|
+
|
|
68
|
+
| Gate | When | What |
|
|
69
|
+
|------|------|------|
|
|
70
|
+
| **Pre-execution** | Before tool calls | Block dangerous commands, enforce naming |
|
|
71
|
+
| **Post-execution** | After writes/edits | Check design system compliance, import validity |
|
|
72
|
+
| **Pre-completion** | Before agent finishes | Type check, lint, uncommitted changes |
|
|
73
|
+
| **Evidence** | Session end | Record delivery evidence in issue tracker |
|
|
74
|
+
|
|
75
|
+
## Applying Policy OS to Any Codebase
|
|
76
|
+
|
|
77
|
+
Ask these questions to identify governance gaps:
|
|
78
|
+
|
|
79
|
+
1. **What breaks today?** → Identifies quality gate needs
|
|
80
|
+
2. **What actions need approval?** → Identifies judgment boundaries
|
|
81
|
+
3. **What should never happen?** → Identifies bash guard rules
|
|
82
|
+
4. **How do you verify correctness?** → Identifies pre-completion checks
|
|
83
|
+
5. **Where is delivery evidence recorded?** → Identifies evidence surface
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: tdd-vertical-slice
|
|
3
|
+
description: Test-first vertical-slice development for CREATE SOMETHING packages. Use when adding behavior or fixing bugs where a public interface test can drive the change.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# TDD Vertical Slice
|
|
7
|
+
|
|
8
|
+
Use this skill when the work should be driven by one behavior at a time. The
|
|
9
|
+
goal is not "write all tests first"; the goal is a tight red-green-refactor loop
|
|
10
|
+
through the same public interface real callers use.
|
|
11
|
+
|
|
12
|
+
## Policy
|
|
13
|
+
|
|
14
|
+
This is a Policy OS quality loop:
|
|
15
|
+
|
|
16
|
+
- **Database**: fixtures, records, bindings, resources, and policy artifacts are
|
|
17
|
+
explicit.
|
|
18
|
+
- **Automation**: one test or smoke drives one executable behavior.
|
|
19
|
+
- **Judgment**: acceptance criteria and approval boundaries stay visible.
|
|
20
|
+
|
|
21
|
+
Do not create issue-tracker state from this skill. Use Linear only when the work
|
|
22
|
+
is shared, delegated, long-running, production-bound, or needs durable evidence.
|
|
23
|
+
|
|
24
|
+
## Before Writing Tests
|
|
25
|
+
|
|
26
|
+
1. Read the nearest `AGENTS.md`, package README, and existing tests.
|
|
27
|
+
2. Verify local package imports with `pnpm exports` before using
|
|
28
|
+
`@create-something/*` symbols.
|
|
29
|
+
3. Use Context7 for unstable third-party APIs.
|
|
30
|
+
4. Identify the public interface that should carry the behavior.
|
|
31
|
+
5. Name the first observable behavior in user or operator language.
|
|
32
|
+
|
|
33
|
+
Ask only when the public interface or acceptance behavior is ambiguous. For a
|
|
34
|
+
narrow confirmed bug or implementation request, proceed with the smallest
|
|
35
|
+
defensible behavior.
|
|
36
|
+
|
|
37
|
+
## Loop
|
|
38
|
+
|
|
39
|
+
Run one vertical slice at a time:
|
|
40
|
+
|
|
41
|
+
1. **Red**: add one failing test or smoke for one behavior.
|
|
42
|
+
2. **Green**: implement the smallest code path that passes it.
|
|
43
|
+
3. **Refactor**: remove duplication and improve locality while tests stay green.
|
|
44
|
+
4. **Repeat**: add the next behavior only after the previous slice is green.
|
|
45
|
+
|
|
46
|
+
Never write a batch of speculative tests for imagined behavior. Tests should
|
|
47
|
+
respond to the real interface and what the previous slice revealed.
|
|
48
|
+
|
|
49
|
+
## Test Surface Rules
|
|
50
|
+
|
|
51
|
+
Prefer tests that:
|
|
52
|
+
|
|
53
|
+
- cross the same interface callers use
|
|
54
|
+
- assert observable behavior rather than private structure
|
|
55
|
+
- keep fixtures small and explicit
|
|
56
|
+
- survive internal refactors
|
|
57
|
+
- use real code paths unless an external boundary must be adapted
|
|
58
|
+
|
|
59
|
+
Avoid tests that:
|
|
60
|
+
|
|
61
|
+
- mock internal collaborators just to reach private functions
|
|
62
|
+
- assert implementation shape instead of behavior
|
|
63
|
+
- check a database or filesystem side effect while bypassing the owning
|
|
64
|
+
interface
|
|
65
|
+
- require broad environment setup when a smaller public command can prove the
|
|
66
|
+
same behavior
|
|
67
|
+
|
|
68
|
+
## Useful Commands
|
|
69
|
+
|
|
70
|
+
```bash
|
|
71
|
+
pnpm exports <package> <symbol>
|
|
72
|
+
pnpm --filter <package> test
|
|
73
|
+
pnpm --filter <package> check
|
|
74
|
+
pnpm check
|
|
75
|
+
pnpm lint
|
|
76
|
+
git diff --check
|
|
77
|
+
```
|
|
78
|
+
|
|
79
|
+
For fresh worktrees, run `pnpm bootstrap:worktree` before commands that expect
|
|
80
|
+
workspace binaries such as `pnpm exec tsc` or `pnpm exec tsx`.
|
|
81
|
+
|
|
82
|
+
## Completion Bar
|
|
83
|
+
|
|
84
|
+
The slice is complete only when:
|
|
85
|
+
|
|
86
|
+
- the new behavior test or smoke passes
|
|
87
|
+
- relevant package checks pass
|
|
88
|
+
- no unrelated tests were weakened or deleted
|
|
89
|
+
- imports and public exports are verified when changed
|
|
90
|
+
- Linear evidence is updated when the work requires handoff, review, promotion,
|
|
91
|
+
rollback, or durable completion evidence
|