create-claude-rails 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 +21 -0
- package/README.md +129 -0
- package/bin/create-claude-rails.js +8 -0
- package/lib/cli.js +414 -0
- package/lib/copy.js +113 -0
- package/lib/db-setup.js +51 -0
- package/lib/metadata.js +41 -0
- package/lib/settings-merge.js +84 -0
- package/package.json +29 -0
- package/templates/EXTENSIONS.md +311 -0
- package/templates/README.md +485 -0
- package/templates/hooks/git-guardrails.sh +67 -0
- package/templates/hooks/skill-telemetry.sh +66 -0
- package/templates/hooks/skill-tool-telemetry.sh +54 -0
- package/templates/hooks/stop-hook.md +56 -0
- package/templates/memory/patterns/_pattern-template.md +119 -0
- package/templates/memory/patterns/pattern-intelligence-first.md +41 -0
- package/templates/rules/enforcement-pipeline.md +151 -0
- package/templates/scripts/finding-schema.json +94 -0
- package/templates/scripts/load-triage-history.js +151 -0
- package/templates/scripts/merge-findings.js +126 -0
- package/templates/scripts/pib-db-schema.sql +68 -0
- package/templates/scripts/pib-db.js +365 -0
- package/templates/scripts/triage-server.mjs +98 -0
- package/templates/scripts/triage-ui.html +536 -0
- package/templates/skills/audit/SKILL.md +269 -0
- package/templates/skills/audit/phases/finding-output.md +56 -0
- package/templates/skills/audit/phases/perspective-execution.md +63 -0
- package/templates/skills/audit/phases/perspective-selection.md +44 -0
- package/templates/skills/audit/phases/structural-checks.md +54 -0
- package/templates/skills/audit/phases/triage-history.md +45 -0
- package/templates/skills/debrief/SKILL.md +278 -0
- package/templates/skills/debrief/phases/auto-maintenance.md +48 -0
- package/templates/skills/debrief/phases/close-work.md +88 -0
- package/templates/skills/debrief/phases/health-checks.md +54 -0
- package/templates/skills/debrief/phases/inventory.md +40 -0
- package/templates/skills/debrief/phases/loose-ends.md +52 -0
- package/templates/skills/debrief/phases/record-lessons.md +67 -0
- package/templates/skills/debrief/phases/report.md +59 -0
- package/templates/skills/debrief/phases/update-state.md +48 -0
- package/templates/skills/execute/SKILL.md +293 -0
- package/templates/skills/execute/phases/commit-and-deploy.md +66 -0
- package/templates/skills/execute/phases/load-plan.md +49 -0
- package/templates/skills/execute/phases/perspectives.md +49 -0
- package/templates/skills/execute/phases/validators.md +50 -0
- package/templates/skills/execute/phases/verification-tools.md +67 -0
- package/templates/skills/investigate/SKILL.md +159 -0
- package/templates/skills/menu/SKILL.md +61 -0
- package/templates/skills/onboard/SKILL.md +301 -0
- package/templates/skills/onboard/phases/detect-state.md +70 -0
- package/templates/skills/onboard/phases/generate-context.md +81 -0
- package/templates/skills/onboard/phases/generate-session-loop.md +87 -0
- package/templates/skills/onboard/phases/interview.md +158 -0
- package/templates/skills/onboard/phases/modularity-menu.md +159 -0
- package/templates/skills/onboard/phases/summary.md +122 -0
- package/templates/skills/orient/SKILL.md +240 -0
- package/templates/skills/orient/phases/auto-maintenance.md +48 -0
- package/templates/skills/orient/phases/briefing.md +53 -0
- package/templates/skills/orient/phases/context.md +47 -0
- package/templates/skills/orient/phases/data-sync.md +35 -0
- package/templates/skills/orient/phases/health-checks.md +50 -0
- package/templates/skills/orient/phases/perspectives.md +46 -0
- package/templates/skills/orient/phases/work-scan.md +69 -0
- package/templates/skills/perspectives/_composition-patterns.md +240 -0
- package/templates/skills/perspectives/_context-template.md +152 -0
- package/templates/skills/perspectives/_eval-protocol.md +208 -0
- package/templates/skills/perspectives/_groups-template.yaml +49 -0
- package/templates/skills/perspectives/_lifecycle.md +93 -0
- package/templates/skills/perspectives/_prompt-guide.md +266 -0
- package/templates/skills/perspectives/accessibility/SKILL.md +177 -0
- package/templates/skills/perspectives/anti-confirmation/SKILL.md +170 -0
- package/templates/skills/perspectives/boundary-conditions/SKILL.md +261 -0
- package/templates/skills/perspectives/box-health/SKILL.md +338 -0
- package/templates/skills/perspectives/data-integrity/SKILL.md +152 -0
- package/templates/skills/perspectives/debugger/SKILL.md +218 -0
- package/templates/skills/perspectives/documentation/SKILL.md +166 -0
- package/templates/skills/perspectives/meta-process/SKILL.md +257 -0
- package/templates/skills/perspectives/mobile-responsiveness/SKILL.md +151 -0
- package/templates/skills/perspectives/organized-mind/SKILL.md +335 -0
- package/templates/skills/perspectives/output-contract.md +148 -0
- package/templates/skills/perspectives/performance/SKILL.md +165 -0
- package/templates/skills/perspectives/process/SKILL.md +235 -0
- package/templates/skills/perspectives/qa/SKILL.md +201 -0
- package/templates/skills/perspectives/security/SKILL.md +176 -0
- package/templates/skills/perspectives/technical-debt/SKILL.md +112 -0
- package/templates/skills/plan/SKILL.md +356 -0
- package/templates/skills/plan/phases/calibration-examples.md +75 -0
- package/templates/skills/plan/phases/completeness-check.md +44 -0
- package/templates/skills/plan/phases/composition-check.md +36 -0
- package/templates/skills/plan/phases/overlap-check.md +62 -0
- package/templates/skills/plan/phases/perspective-critique.md +47 -0
- package/templates/skills/plan/phases/plan-template.md +69 -0
- package/templates/skills/plan/phases/present.md +60 -0
- package/templates/skills/plan/phases/research.md +43 -0
- package/templates/skills/plan/phases/work-tracker.md +95 -0
- package/templates/skills/pulse/SKILL.md +242 -0
- package/templates/skills/pulse/phases/auto-fix-scope.md +40 -0
- package/templates/skills/pulse/phases/checks.md +58 -0
- package/templates/skills/pulse/phases/output.md +54 -0
- package/templates/skills/seed/SKILL.md +259 -0
- package/templates/skills/seed/phases/build-perspective.md +93 -0
- package/templates/skills/seed/phases/evaluate-existing.md +61 -0
- package/templates/skills/seed/phases/maintain.md +92 -0
- package/templates/skills/seed/phases/scan-signals.md +82 -0
- package/templates/skills/triage-audit/SKILL.md +251 -0
- package/templates/skills/triage-audit/phases/apply-verdicts.md +90 -0
- package/templates/skills/triage-audit/phases/load-findings.md +38 -0
- package/templates/skills/triage-audit/phases/triage-ui.md +66 -0
- package/templates/skills/upgrade/SKILL.md +265 -0
- package/templates/skills/upgrade/phases/apply.md +86 -0
- package/templates/skills/upgrade/phases/detect-current.md +82 -0
- package/templates/skills/upgrade/phases/diff-upstream.md +72 -0
- package/templates/skills/upgrade/phases/merge.md +97 -0
- package/templates/skills/validate/SKILL.md +116 -0
- package/templates/skills/validate/phases/validators.md +53 -0
package/lib/db-setup.js
ADDED
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
const { execSync } = require('child_process');
|
|
2
|
+
const fs = require('fs');
|
|
3
|
+
const path = require('path');
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* Set up the PIB database in the target project.
|
|
7
|
+
* - Copies pib-db.js and schema to scripts/
|
|
8
|
+
* - Runs npm init if no package.json
|
|
9
|
+
* - Installs better-sqlite3
|
|
10
|
+
* - Runs pib-db init
|
|
11
|
+
*/
|
|
12
|
+
function setupDb(projectDir) {
|
|
13
|
+
const scriptsDir = path.join(projectDir, 'scripts');
|
|
14
|
+
const results = [];
|
|
15
|
+
|
|
16
|
+
// Check if package.json exists; if not, init
|
|
17
|
+
const pkgPath = path.join(projectDir, 'package.json');
|
|
18
|
+
if (!fs.existsSync(pkgPath)) {
|
|
19
|
+
console.log(' Initializing package.json...');
|
|
20
|
+
execSync('npm init -y', { cwd: projectDir, stdio: 'pipe' });
|
|
21
|
+
results.push('Created package.json');
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
// pib-db.js uses ESM imports — ensure package.json has "type": "module"
|
|
25
|
+
const pkg = JSON.parse(fs.readFileSync(pkgPath, 'utf8'));
|
|
26
|
+
if (pkg.type !== 'module') {
|
|
27
|
+
pkg.type = 'module';
|
|
28
|
+
fs.writeFileSync(pkgPath, JSON.stringify(pkg, null, 2) + '\n');
|
|
29
|
+
results.push('Set package.json type to "module"');
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
// Install better-sqlite3 if not already installed
|
|
33
|
+
const nodeModules = path.join(projectDir, 'node_modules', 'better-sqlite3');
|
|
34
|
+
if (!fs.existsSync(nodeModules)) {
|
|
35
|
+
console.log(' Installing better-sqlite3...');
|
|
36
|
+
execSync('npm install better-sqlite3', { cwd: projectDir, stdio: 'pipe' });
|
|
37
|
+
results.push('Installed better-sqlite3');
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
// Initialize the database
|
|
41
|
+
const dbScript = path.join(scriptsDir, 'pib-db.js');
|
|
42
|
+
if (fs.existsSync(dbScript)) {
|
|
43
|
+
console.log(' Initializing database...');
|
|
44
|
+
execSync(`node ${dbScript} init`, { cwd: projectDir, stdio: 'pipe' });
|
|
45
|
+
results.push('Initialized pib.db');
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
return results;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
module.exports = { setupDb };
|
package/lib/metadata.js
ADDED
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
const fs = require('fs');
|
|
2
|
+
const path = require('path');
|
|
3
|
+
|
|
4
|
+
const METADATA_FILE = '.pibrc.json';
|
|
5
|
+
|
|
6
|
+
function metadataPath(projectDir) {
|
|
7
|
+
return path.join(projectDir, METADATA_FILE);
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
function read(projectDir) {
|
|
11
|
+
const file = metadataPath(projectDir);
|
|
12
|
+
if (!fs.existsSync(file)) return null;
|
|
13
|
+
return JSON.parse(fs.readFileSync(file, 'utf8'));
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
function write(projectDir, data) {
|
|
17
|
+
const file = metadataPath(projectDir);
|
|
18
|
+
fs.writeFileSync(file, JSON.stringify(data, null, 2) + '\n');
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
function create(projectDir, { modules, skipped, version }) {
|
|
22
|
+
const data = {
|
|
23
|
+
version,
|
|
24
|
+
installedAt: new Date().toISOString(),
|
|
25
|
+
upstreamPackage: 'create-claude-rails',
|
|
26
|
+
modules: {},
|
|
27
|
+
skipped: {},
|
|
28
|
+
};
|
|
29
|
+
|
|
30
|
+
for (const mod of modules) {
|
|
31
|
+
data.modules[mod] = true;
|
|
32
|
+
}
|
|
33
|
+
for (const [mod, reason] of Object.entries(skipped)) {
|
|
34
|
+
data.skipped[mod] = reason;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
write(projectDir, data);
|
|
38
|
+
return data;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
module.exports = { read, write, create, metadataPath, METADATA_FILE };
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
const fs = require('fs');
|
|
2
|
+
const path = require('path');
|
|
3
|
+
|
|
4
|
+
const DEFAULT_HOOKS = {
|
|
5
|
+
PreToolUse: [
|
|
6
|
+
{
|
|
7
|
+
matcher: 'Bash',
|
|
8
|
+
hooks: [
|
|
9
|
+
{
|
|
10
|
+
type: 'command',
|
|
11
|
+
command: '.claude/hooks/git-guardrails.sh',
|
|
12
|
+
},
|
|
13
|
+
],
|
|
14
|
+
},
|
|
15
|
+
],
|
|
16
|
+
UserPromptSubmit: [
|
|
17
|
+
{
|
|
18
|
+
matcher: '',
|
|
19
|
+
hooks: [
|
|
20
|
+
{
|
|
21
|
+
type: 'command',
|
|
22
|
+
command: '.claude/hooks/skill-telemetry.sh',
|
|
23
|
+
},
|
|
24
|
+
],
|
|
25
|
+
},
|
|
26
|
+
],
|
|
27
|
+
PostToolUse: [
|
|
28
|
+
{
|
|
29
|
+
matcher: 'Skill',
|
|
30
|
+
hooks: [
|
|
31
|
+
{
|
|
32
|
+
type: 'command',
|
|
33
|
+
command: '.claude/hooks/skill-tool-telemetry.sh',
|
|
34
|
+
},
|
|
35
|
+
],
|
|
36
|
+
},
|
|
37
|
+
],
|
|
38
|
+
};
|
|
39
|
+
|
|
40
|
+
/**
|
|
41
|
+
* Merge PIB hooks into the project's .claude/settings.json.
|
|
42
|
+
* Creates the file if it doesn't exist. Preserves existing hooks.
|
|
43
|
+
*/
|
|
44
|
+
function mergeSettings(projectDir, { includeDb = true } = {}) {
|
|
45
|
+
const settingsDir = path.join(projectDir, '.claude');
|
|
46
|
+
const settingsPath = path.join(settingsDir, 'settings.json');
|
|
47
|
+
|
|
48
|
+
if (!fs.existsSync(settingsDir)) {
|
|
49
|
+
fs.mkdirSync(settingsDir, { recursive: true });
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
let settings = {};
|
|
53
|
+
if (fs.existsSync(settingsPath)) {
|
|
54
|
+
settings = JSON.parse(fs.readFileSync(settingsPath, 'utf8'));
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
if (!settings.hooks) settings.hooks = {};
|
|
58
|
+
|
|
59
|
+
// Merge each hook event type
|
|
60
|
+
for (const [event, newHooks] of Object.entries(DEFAULT_HOOKS)) {
|
|
61
|
+
if (!settings.hooks[event]) {
|
|
62
|
+
settings.hooks[event] = newHooks;
|
|
63
|
+
} else {
|
|
64
|
+
// Add hooks that don't already exist (check by command path)
|
|
65
|
+
for (const newHook of newHooks) {
|
|
66
|
+
const existingCommands = settings.hooks[event].flatMap(h =>
|
|
67
|
+
h.hooks.map(hh => hh.command)
|
|
68
|
+
);
|
|
69
|
+
const newCommands = newHook.hooks.map(h => h.command);
|
|
70
|
+
const alreadyExists = newCommands.every(cmd =>
|
|
71
|
+
existingCommands.includes(cmd)
|
|
72
|
+
);
|
|
73
|
+
if (!alreadyExists) {
|
|
74
|
+
settings.hooks[event].push(newHook);
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
fs.writeFileSync(settingsPath, JSON.stringify(settings, null, 2) + '\n');
|
|
81
|
+
return settingsPath;
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
module.exports = { mergeSettings, DEFAULT_HOOKS };
|
package/package.json
ADDED
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "create-claude-rails",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"description": "Claude on Rails — opinionated process scaffolding for Claude Code projects",
|
|
5
|
+
"bin": {
|
|
6
|
+
"create-claude-rails": "bin/create-claude-rails.js"
|
|
7
|
+
},
|
|
8
|
+
"files": [
|
|
9
|
+
"bin/",
|
|
10
|
+
"lib/",
|
|
11
|
+
"templates/"
|
|
12
|
+
],
|
|
13
|
+
"keywords": [
|
|
14
|
+
"claude",
|
|
15
|
+
"claude-code",
|
|
16
|
+
"scaffolding",
|
|
17
|
+
"process",
|
|
18
|
+
"ai",
|
|
19
|
+
"workflow"
|
|
20
|
+
],
|
|
21
|
+
"author": "Oren Magid",
|
|
22
|
+
"license": "MIT",
|
|
23
|
+
"engines": {
|
|
24
|
+
"node": ">=18"
|
|
25
|
+
},
|
|
26
|
+
"dependencies": {
|
|
27
|
+
"prompts": "^2.4.2"
|
|
28
|
+
}
|
|
29
|
+
}
|
|
@@ -0,0 +1,311 @@
|
|
|
1
|
+
# Extension Examples: How Flow Uses Process-in-a-Box
|
|
2
|
+
|
|
3
|
+
PIB gives you skeletons. Your project fills them in via phase files —
|
|
4
|
+
replacing defaults with project-specific behavior, adding custom phases
|
|
5
|
+
the skeleton doesn't define. This document shows what that looks like
|
|
6
|
+
in practice, using Flow (PIB's reference implementation) as the example.
|
|
7
|
+
|
|
8
|
+
Flow is a cognitive workspace built on Claude Code — a GTD system,
|
|
9
|
+
research thread manager, and course management tool. It has a deployed
|
|
10
|
+
web app (Railway), a local SQLite cache, research threads, an inbox
|
|
11
|
+
pipeline, and 25+ skills. It's what happens when a project grows past
|
|
12
|
+
PIB's defaults while staying on PIB's rails.
|
|
13
|
+
|
|
14
|
+
You and Claude will make different choices for your project. These
|
|
15
|
+
examples show what choices Flow made and why — not what you should do,
|
|
16
|
+
but what's possible.
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
## Flow's Phase File Overrides by Skill
|
|
20
|
+
|
|
21
|
+
For each skeleton skill, the tables show: which PIB phase files Flow
|
|
22
|
+
overrides (replacing default behavior with Flow-specific content), and
|
|
23
|
+
which custom phase files Flow adds (concerns PIB doesn't define).
|
|
24
|
+
|
|
25
|
+
Phase file states: **default** = PIB's behavior is fine, no override
|
|
26
|
+
needed. **override** = Flow writes its own content. **custom** = Flow
|
|
27
|
+
adds a phase PIB doesn't have. **skip** = Flow actively opts out.
|
|
28
|
+
|
|
29
|
+
### orient
|
|
30
|
+
|
|
31
|
+
PIB's orient skeleton loads context, syncs data, scans work, checks
|
|
32
|
+
health, and presents a briefing. Flow's orient is its most complex
|
|
33
|
+
skill — 47 steps managing a deployed app, research threads, an inbox
|
|
34
|
+
pipeline, and multiple always-on perspectives.
|
|
35
|
+
|
|
36
|
+
| Phase | PIB Default | Flow Override |
|
|
37
|
+
|---|---|---|
|
|
38
|
+
| `context.md` | Read status files | `system-status.md`, 7 research threads (`thread.yaml` + `CLAUDE.md`), `MEMORY.md` index, active course syllabi |
|
|
39
|
+
| `data-sync.md` | Skip | DB pull from Railway (`sync-db-to-railway.sh --pull`). Report failure but don't block. |
|
|
40
|
+
| `work-scan.md` | Query pib-db for open actions | Inbox counts via API, open plans in Flow Dev folder, deferred triggers evaluation, stale articulation questions, unactioned audit findings, Needs Review projects |
|
|
41
|
+
| `health-checks.md` | Empty | Skill staleness (last-verified > 30d), telemetry compliance, LaunchAgent health |
|
|
42
|
+
| `auto-maintenance.md` | Empty | Morning briefing timestamp, cleanup stale locks |
|
|
43
|
+
| `perspectives.md` | Empty | Always-on: life-tracker, debugger, system-advocate, life-optimization |
|
|
44
|
+
| `briefing.md` | Present summary | Time-aware format: full briefing (morning), abbreviated (afternoon), minimal (quick variant) |
|
|
45
|
+
|
|
46
|
+
**Custom phases Flow adds:**
|
|
47
|
+
|
|
48
|
+
| Custom Phase | What It Does |
|
|
49
|
+
|---|---|
|
|
50
|
+
| `command-queue.md` | Fetch and process pending commands from the Flow app UI (re-prep, delete, re-articulate) |
|
|
51
|
+
| `articulation-sweep.md` | Process `pending-question` actions (follow-ups), then scan for vague candidates (capped at 3) |
|
|
52
|
+
| `prep-scout-sweep.md` | Auto-prep unprepped actions due within 7 days (capped at 3) |
|
|
53
|
+
| `feature-spotlight.md` | System advocate's adoption ladder — surface one underused feature per session |
|
|
54
|
+
|
|
55
|
+
**Why so many custom phases:** Flow's orient does operational maintenance
|
|
56
|
+
that most projects won't need early on. The command queue, articulation,
|
|
57
|
+
and prep scout are features that emerged from months of use. A new project
|
|
58
|
+
would start with just `context.md` and `work-scan.md` overrides and add
|
|
59
|
+
custom phases as concerns emerge.
|
|
60
|
+
|
|
61
|
+
### debrief
|
|
62
|
+
|
|
63
|
+
PIB's debrief skeleton inventories work, closes items, updates state,
|
|
64
|
+
records lessons, and captures loose ends. Flow's debrief is the second
|
|
65
|
+
most complex skill — it resolves feedback comments, runs prep scout and
|
|
66
|
+
articulation sweeps, checks machine-level drift, and enforces QA gates.
|
|
67
|
+
|
|
68
|
+
| Phase | PIB Default | Flow Override |
|
|
69
|
+
|---|---|---|
|
|
70
|
+
| `inventory.md` | Scan git log + conversation | Same approach, plus check for uncommitted work, unresolved preview tool sessions |
|
|
71
|
+
| `close-work.md` | Match session work against pib-db actions | Match against Railway API actions. QA perspective gate: actions can't be marked complete if QA report shows failures. Project auto-completion scan. |
|
|
72
|
+
| `auto-maintenance.md` | Empty | Commit + push changes, pull fresh DB after mutations |
|
|
73
|
+
| `update-state.md` | Update status files | Update `system-status.md` build log, move PLANNED items to COMPLETED |
|
|
74
|
+
| `health-checks.md` | Empty | Machine setup drift (LaunchAgents, hooks, env vars), telemetry compliance |
|
|
75
|
+
| `record-lessons.md` | Save to memory | Historian perspective (always activated) records lessons, updates memory patterns, prevents knowledge loss |
|
|
76
|
+
| `loose-ends.md` | Capture to inbox | Life-tracker perspective (always activated) sweeps for non-dev loose ends. Inbox routing via API. |
|
|
77
|
+
| `report.md` | Present summary | Evening preview if after 5pm, offer to archive conversation |
|
|
78
|
+
|
|
79
|
+
**Custom phases Flow adds:**
|
|
80
|
+
|
|
81
|
+
| Custom Phase | What It Does |
|
|
82
|
+
|---|---|
|
|
83
|
+
| `feedback-resolution.md` | Scan system-feedback comments, resolve ones addressed by session work |
|
|
84
|
+
| `prep-scout-sweep.md` | Same as orient — runs again at session close for newly relevant actions |
|
|
85
|
+
| `articulation-sweep.md` | Same as orient — process follow-ups, scan for new vague candidates |
|
|
86
|
+
| `project-completion.md` | Check if any projects have all actions completed, prompt for project close |
|
|
87
|
+
|
|
88
|
+
**Key pattern:** Flow's debrief has *mandatory perspectives* — historian
|
|
89
|
+
and life-tracker always activate. In PIB's skeleton, perspectives are
|
|
90
|
+
optional (the `perspectives.md` phase can be empty). Flow overrides this
|
|
91
|
+
by listing required perspectives in its close-work and loose-ends phases.
|
|
92
|
+
|
|
93
|
+
### validate
|
|
94
|
+
|
|
95
|
+
PIB's validate skeleton runs validators from a single phase file. Flow
|
|
96
|
+
overrides with 8 specific validators.
|
|
97
|
+
|
|
98
|
+
| Phase | PIB Default | Flow Override |
|
|
99
|
+
|---|---|---|
|
|
100
|
+
| `validators.md` | Commented-out examples | 8 validators: fid coverage (`validate-fids.sh`), thread structure (`validate-threads.sh`), folder integrity (`validate-folders.sh`), MEMORY.md references, TypeScript (`npx tsc --noEmit`), Vite build (`npx vite build`), ESLint (`npx eslint`), Mantine import check |
|
|
101
|
+
|
|
102
|
+
**No custom phases.** Validate is the simplest skeleton — one phase file
|
|
103
|
+
does the job. Flow just fills in its specific checks.
|
|
104
|
+
|
|
105
|
+
### plan
|
|
106
|
+
|
|
107
|
+
PIB's plan skeleton researches, checks overlap, drafts with template,
|
|
108
|
+
runs perspective critique, checks completeness, presents, and files work.
|
|
109
|
+
Flow's plan adds a design committee pattern and specific work tracking.
|
|
110
|
+
|
|
111
|
+
| Phase | PIB Default | Flow Override |
|
|
112
|
+
|---|---|---|
|
|
113
|
+
| `research.md` | Explore codebase | Same, plus check ecosystem memory (`reference-skill-ecosystem.md`) for prior art |
|
|
114
|
+
| `overlap-check.md` | Query pib-db | Query Railway DB via sqlite3 on local cache. Check open actions + recent completed. |
|
|
115
|
+
| `plan-template.md` | Generic sections | Flow template: Context, Approach, Surface Area (files grouped), Acceptance Criteria with `[auto]`/`[manual]`/`[deferred]` tags, Risk assessment |
|
|
116
|
+
| `perspective-critique.md` | Activate relevant perspectives | QA always-on. Design committee (information-design + usability) for UI plans with HTML mock generation. |
|
|
117
|
+
| `completeness-check.md` | Review for gaps | Same default behavior |
|
|
118
|
+
| `present.md` | Show plan for approval | Same, plus offer to post to Flow app's Review Plan view for async review |
|
|
119
|
+
| `work-tracker.md` | Create pib-db action | POST to Railway API. Default project: Flow Development (`prj:5740e09b`). Deferred folder: `fld:3557e5b4`. |
|
|
120
|
+
|
|
121
|
+
**Custom phases Flow adds:**
|
|
122
|
+
|
|
123
|
+
| Custom Phase | What It Does |
|
|
124
|
+
|---|---|
|
|
125
|
+
| `design-committee.md` | For UI plans: spawn information-design + usability perspectives, generate HTML mock, iterate before coding |
|
|
126
|
+
|
|
127
|
+
### execute
|
|
128
|
+
|
|
129
|
+
PIB's execute skeleton loads the plan, activates perspectives, implements
|
|
130
|
+
with checkpoints, validates, and commits. Flow adds QA enforcement and
|
|
131
|
+
design mock verification.
|
|
132
|
+
|
|
133
|
+
| Phase | PIB Default | Flow Override |
|
|
134
|
+
|---|---|---|
|
|
135
|
+
| `load-plan.md` | Read plan from conversation or file | Same, plus check for design mocks in action notes (`mock_path`) and `.claude/mocks/` |
|
|
136
|
+
| `perspectives.md` | Activate relevant perspectives | QA always-on. Boundary-conditions always-on. Others per plan's surface area. |
|
|
137
|
+
| `validators.md` | Run project validators | Delegates to `/validate` skill |
|
|
138
|
+
| `verification-tools.md` | Empty | Preview tool for manual AC verification. `[manual]` criteria MUST use preview tools — only legitimately untestable items get `[needs-user]` tag. |
|
|
139
|
+
| `commit-and-deploy.md` | Git commit | Classify changes (markdown-only vs code vs mixed). Markdown: `git push` (webhook pulls). Code: `git push` + `railway up`. Verify deploy via `/verify-deploy`. |
|
|
140
|
+
|
|
141
|
+
**Key pattern:** Flow's execute enforces a QA gate — the QA perspective
|
|
142
|
+
produces a verification report at checkpoint 3, and debrief won't mark
|
|
143
|
+
actions complete if QA shows failures. This is the "mandatory perspective"
|
|
144
|
+
pattern: a perspective that's advisory in PIB becomes load-bearing in Flow.
|
|
145
|
+
|
|
146
|
+
### audit
|
|
147
|
+
|
|
148
|
+
PIB's audit skeleton selects perspectives, runs structural checks, loads
|
|
149
|
+
triage suppression, spawns perspective agents, and persists findings.
|
|
150
|
+
Flow overrides the data layer and execution model.
|
|
151
|
+
|
|
152
|
+
| Phase | PIB Default | Flow Override |
|
|
153
|
+
|---|---|---|
|
|
154
|
+
| `perspective-selection.md` | Discover from SKILL.md files, use groups | Same discovery, but 21 additional domain perspectives available |
|
|
155
|
+
| `structural-checks.md` | Run fast structural scripts | Same validators as `/validate`, run before LLM analysis |
|
|
156
|
+
| `triage-history.md` | Load from pib-db or filesystem | Load from Railway DB via API (`GET /api/audit/findings?status=deferred`) |
|
|
157
|
+
| `perspective-execution.md` | Spawn parallel subprocess agents | Nested Agent tool calls (same session context). Two-phase protocol: explore thoroughly, then rank top 5-8 findings. |
|
|
158
|
+
| `finding-output.md` | Merge to JSON, optionally ingest to pib-db | POST findings to Railway API (`POST /api/audit/findings`). Per-perspective JSON files also saved locally. |
|
|
159
|
+
|
|
160
|
+
**Custom phases Flow adds:**
|
|
161
|
+
|
|
162
|
+
| Custom Phase | What It Does |
|
|
163
|
+
|---|---|
|
|
164
|
+
| `triage.md` | Programmatic triage of findings via Railway API PATCH endpoint (approve/reject/defer) |
|
|
165
|
+
| `next-steps.md` | Offer quick-fix, /plan, or bulk triage based on findings after output |
|
|
166
|
+
|
|
167
|
+
**Why nested agents instead of subprocesses:** PIB's default uses
|
|
168
|
+
`claude --print` for parallel perspective execution. Flow found that
|
|
169
|
+
subprocess spawning creates API concurrency errors during active
|
|
170
|
+
sessions. Nested Agent tool calls avoid this. A project without this
|
|
171
|
+
constraint can use PIB's subprocess default.
|
|
172
|
+
|
|
173
|
+
### pulse
|
|
174
|
+
|
|
175
|
+
PIB's pulse skeleton checks self-description accuracy, spots dead
|
|
176
|
+
references, and detects staleness. Flow overrides with extensive
|
|
177
|
+
count verification and principle practice checks.
|
|
178
|
+
|
|
179
|
+
| Phase | PIB Default | Flow Override |
|
|
180
|
+
|---|---|---|
|
|
181
|
+
| `checks.md` | Count freshness, dead references | Count freshness across 3 files (`project-skills-infrastructure.md`, `system-status.md`, `_context.md`). Dead reference spot-check with rotation tracking (`pulse-state.json`). Skill staleness (last-verified > 30d). Rules enforcement health. Session drift detection. Principle spot-check (samples different principle each run). Memory index auto-fix. |
|
|
182
|
+
| `auto-fix-scope.md` | Closed list of safe fixes | Same closed list: numeric counts, MEMORY.md filenames, system-status moves, `_context.md` perspective lists, last-verified dates |
|
|
183
|
+
| `output.md` | Stratified output | Same stratification: Fixed, Options, Questions, Tensions, Skill Assessments. Options create Flow Dev actions with `source: pulse`. |
|
|
184
|
+
|
|
185
|
+
**Key pattern:** Pulse's `checks.md` is where most project-specific
|
|
186
|
+
content lives. A new project starts with the default count-freshness
|
|
187
|
+
check and adds checks as it discovers what drifts. Flow's principle
|
|
188
|
+
spot-check (rotating through CLAUDE.md principles) is a pattern any
|
|
189
|
+
project could adopt.
|
|
190
|
+
|
|
191
|
+
### triage-audit
|
|
192
|
+
|
|
193
|
+
PIB's triage skeleton loads findings, presents via UI, and applies
|
|
194
|
+
verdicts. Flow overrides the data source and verdict application.
|
|
195
|
+
|
|
196
|
+
| Phase | PIB Default | Flow Override |
|
|
197
|
+
|---|---|---|
|
|
198
|
+
| `load-findings.md` | Query pib-db or read JSON files | Fetch from Railway DB via API with severity + perspective ordering |
|
|
199
|
+
| `triage-ui.md` | Start local `triage-server.mjs`, open browser | Same local server, but opened via Chrome MCP tool for reading verdicts |
|
|
200
|
+
| `apply-verdicts.md` | Update pib-db, attempt fixes | Three mechanisms: quick fix inline, create Flow Dev action (grouped by theme, `[Audit]` prefix), or defer/reject via Railway API PATCH. Project vs Single Action heuristic for 5+ coherent findings. Update perspective boundaries for rejected patterns. |
|
|
201
|
+
|
|
202
|
+
|
|
203
|
+
## Patterns in Flow-Specific Skills
|
|
204
|
+
|
|
205
|
+
Flow has 15+ skills beyond the 8 skeleton skills. These are fully specific
|
|
206
|
+
to Flow — they reference Flow's API, database schema, directory structure,
|
|
207
|
+
and domain concepts. But each embodies a reusable *pattern* that a different
|
|
208
|
+
project could implement for its own domain.
|
|
209
|
+
|
|
210
|
+
| Pattern | Flow Skill | What It Does | Generic Lesson |
|
|
211
|
+
|---|---|---|---|
|
|
212
|
+
| Entity scaffolding | `/scaffold` | Creates threads, skills, perspectives with templates, symlinks, and validation | Any project with repeatable entity types benefits from a scaffold skill that enforces the correct directory structure and metadata. |
|
|
213
|
+
| Prompt refinement loop | `/refine-prompts` | Discovers all prompt artifacts (perspectives, skills, tool configs), evaluates on 5 axes (clarity, calibration, accuracy, scope, anti-patterns), refines collaboratively | Any project with multiple prompt artifacts benefits from periodic prompt refinement. The discover-evaluate-refine loop is the pattern. |
|
|
214
|
+
| Command queue processing | `/handle-findings` | Reads queued commands from the app UI, routes to handlers (auto-fix, assess, create-action), updates status via API | Any project where async work gets queued for Claude to process later. The read-route-execute-update-status loop is the pattern. |
|
|
215
|
+
| Classify-and-route | `/process-inbox` | Classifies inbox items by cognitive type (action, idea, thread capture, reference, decision), routes to destinations via API | Any project with a capture inbox that needs triage. The classify-propose-confirm-route loop is the pattern. |
|
|
216
|
+
| Raw-capture-to-structured | `/incorporate` | Takes voice memo transcripts, verifies source passages, writes self-contained entries, places in development files, updates argument spine | Any project that receives raw input (voice memos, notes, screenshots) needing structured placement. Verify sources, write self-contained entries, update indexes. |
|
|
217
|
+
| Scan-filter-confirm-execute | `/prep-scout` | Scans actions for offloadable research, filters by exclusion categories (relationship, creative, spiritual), does legwork, writes summaries | Any project where Claude can do background research on queued items. The scan-filter-execute-summarize loop is the pattern. |
|
|
218
|
+
| Change-type deployment | `/deploy` | Classifies changes (markdown-only, code, mixed), takes appropriate deploy path (git push vs git push + platform deploy), verifies | Any project with multiple deployment paths depending on what changed. The classify-deploy-verify loop is the pattern. |
|
|
219
|
+
| Area health review | `/quarterly-review` | SQL-driven area-by-area walkthrough: stale actions, recurring cadence health, person context freshness, open loops, supply patterns | Any project with areas of responsibility benefits from periodic health queries. The SQL query templates are reusable. |
|
|
220
|
+
|
|
221
|
+
These are future extraction candidates. If PIB grows beyond Wave 6, the
|
|
222
|
+
highest-value patterns to skeleton would be: entity scaffolding (widely
|
|
223
|
+
applicable), prompt refinement (universal for Claude Code projects), and
|
|
224
|
+
command queue processing (needed by any project with an async work queue).
|
|
225
|
+
|
|
226
|
+
|
|
227
|
+
## Writing Domain-Specific Perspectives
|
|
228
|
+
|
|
229
|
+
PIB ships 14 generic perspectives. Flow has 19 additional domain-specific
|
|
230
|
+
perspectives. Here are three examples showing how to write your own.
|
|
231
|
+
|
|
232
|
+
### Example 1: GTD (encoding domain expertise)
|
|
233
|
+
|
|
234
|
+
Flow's `gtd` perspective encodes David Allen's Getting Things Done
|
|
235
|
+
methodology as an evaluation lens. What makes it effective:
|
|
236
|
+
|
|
237
|
+
- **Calibrated severity.** Three levels: *load-bearing* (system breaks
|
|
238
|
+
without this — e.g., inbox capture under 2 seconds), *useful* (improves
|
|
239
|
+
workflow — e.g., @context tags), *Allen-specific* (orthodoxy that may
|
|
240
|
+
not fit — e.g., formal tickler file). The perspective never dogmatically
|
|
241
|
+
insists on GTD purity.
|
|
242
|
+
- **Concrete checklists.** Each of Allen's 5 stages (capture, clarify,
|
|
243
|
+
organize, reflect, engage) has specific checkpoints mapped to system
|
|
244
|
+
features — not abstract principles but "does the inbox have < 2 second
|
|
245
|
+
friction?" and "does the weekly review cover all lists?"
|
|
246
|
+
- **Horizon alignment.** Maps Allen's horizons of focus (ground through
|
|
247
|
+
50,000 feet) to system concepts: Ground = Actions, 10K = Projects,
|
|
248
|
+
20K = Areas, 50K = CLAUDE.md principles. Flags missing levels.
|
|
249
|
+
|
|
250
|
+
**The pattern:** Pick a methodology you know well. Map its principles to
|
|
251
|
+
concrete system checks. Calibrate severity so the perspective gives
|
|
252
|
+
useful feedback without being a purist.
|
|
253
|
+
|
|
254
|
+
### Example 2: Goal-Alignment (meta-perspective)
|
|
255
|
+
|
|
256
|
+
Flow's `goal-alignment` perspective evaluates whether the system is
|
|
257
|
+
becoming what it's meant to become. It's a meta-perspective — it
|
|
258
|
+
evaluates the system itself, not just the code.
|
|
259
|
+
|
|
260
|
+
- **Four evaluation areas:** Purpose delivery (is the system doing its
|
|
261
|
+
job?), priority alignment (are the right things getting built?),
|
|
262
|
+
mission drift (has scope crept?), feedback responsiveness (are user
|
|
263
|
+
complaints being addressed?).
|
|
264
|
+
- **Evidence-based.** Every observation requires evidence: "4 feedback
|
|
265
|
+
items older than 2 weeks unanswered" not "could be better aligned."
|
|
266
|
+
- **Surface interaction.** Evaluates how the app and Claude Code
|
|
267
|
+
complement each other — are handoffs clean? Is information visible
|
|
268
|
+
in both surfaces?
|
|
269
|
+
|
|
270
|
+
**The pattern:** Write a perspective that asks "is this system becoming
|
|
271
|
+
what it should be?" Map your project's mission to evaluation criteria.
|
|
272
|
+
Require evidence for every observation.
|
|
273
|
+
|
|
274
|
+
### Example 3: Philosophical Grounding (academic discipline as lens)
|
|
275
|
+
|
|
276
|
+
Flow's `philosophical-grounding` perspective applies phenomenological
|
|
277
|
+
philosophy to system design. It checks whether the system respects
|
|
278
|
+
how humans actually encounter and understand things — pre-reflective
|
|
279
|
+
experience, temporal flow, embodied interaction.
|
|
280
|
+
|
|
281
|
+
**The pattern:** Any deep domain expertise can become a perspective.
|
|
282
|
+
The key is translating domain concepts into concrete system observations:
|
|
283
|
+
"phenomenological encounter" becomes "does the UI let you see the item
|
|
284
|
+
before it's been pre-categorized?" Academic rigor becomes evaluation
|
|
285
|
+
rigor.
|
|
286
|
+
|
|
287
|
+
### Writing your own
|
|
288
|
+
|
|
289
|
+
A good domain perspective has four elements:
|
|
290
|
+
1. **Identity** — who it is and what expertise it brings
|
|
291
|
+
2. **Boundaries** — what it does NOT evaluate (prevents overlap)
|
|
292
|
+
3. **Activation signals** — when it fires (audits, planning, always-on)
|
|
293
|
+
4. **Severity calibration** — what's critical vs nice-to-have, with
|
|
294
|
+
examples of each
|
|
295
|
+
|
|
296
|
+
See `_prompt-guide.md` in the perspectives infrastructure for the full
|
|
297
|
+
craft knowledge of writing perspective prompts.
|
|
298
|
+
|
|
299
|
+
|
|
300
|
+
## What We Found That Might Be Generic
|
|
301
|
+
|
|
302
|
+
During Wave 6, we scanned Flow's specific skills for accidentally-generic
|
|
303
|
+
code — patterns that are reusable but weren't extracted in Waves 1-5.
|
|
304
|
+
Eight skills contained reusable patterns (documented in the table above).
|
|
305
|
+
The full analysis is in the methodology essay's Wave 6 findings section.
|
|
306
|
+
|
|
307
|
+
These are patterns, not extraction candidates — yet. The patterns are
|
|
308
|
+
documented here so PIB users know what's possible. If your project needs
|
|
309
|
+
entity scaffolding or prompt refinement, you'll write your own version.
|
|
310
|
+
If PIB grows a Wave 7, the strongest candidates for skeleton extraction
|
|
311
|
+
are scaffold, refine-prompts, and handle-findings.
|