@lipter7/blueprint 2.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (125) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +626 -0
  3. package/agents/bp-codebase-mapper.md +761 -0
  4. package/agents/bp-debugger.md +1198 -0
  5. package/agents/bp-executor.md +403 -0
  6. package/agents/bp-integration-checker.md +423 -0
  7. package/agents/bp-phase-researcher.md +469 -0
  8. package/agents/bp-plan-checker.md +622 -0
  9. package/agents/bp-planner.md +1157 -0
  10. package/agents/bp-project-researcher.md +618 -0
  11. package/agents/bp-research-synthesizer.md +236 -0
  12. package/agents/bp-roadmapper.md +605 -0
  13. package/agents/bp-verifier.md +523 -0
  14. package/bin/install.js +1754 -0
  15. package/blueprint/bin/blueprint-tools.js +4597 -0
  16. package/blueprint/bin/blueprint-tools.test.js +2033 -0
  17. package/blueprint/references/checkpoints.md +775 -0
  18. package/blueprint/references/continuation-format.md +249 -0
  19. package/blueprint/references/decimal-phase-calculation.md +65 -0
  20. package/blueprint/references/git-integration.md +248 -0
  21. package/blueprint/references/git-planning-commit.md +38 -0
  22. package/blueprint/references/model-profile-resolution.md +32 -0
  23. package/blueprint/references/model-profiles.md +73 -0
  24. package/blueprint/references/phase-argument-parsing.md +61 -0
  25. package/blueprint/references/planning-config.md +194 -0
  26. package/blueprint/references/questioning.md +141 -0
  27. package/blueprint/references/tdd.md +263 -0
  28. package/blueprint/references/ui-brand.md +160 -0
  29. package/blueprint/references/verification-patterns.md +612 -0
  30. package/blueprint/templates/DEBUG.md +159 -0
  31. package/blueprint/templates/UAT.md +247 -0
  32. package/blueprint/templates/codebase/architecture.md +255 -0
  33. package/blueprint/templates/codebase/concerns.md +310 -0
  34. package/blueprint/templates/codebase/conventions.md +307 -0
  35. package/blueprint/templates/codebase/integrations.md +280 -0
  36. package/blueprint/templates/codebase/stack.md +186 -0
  37. package/blueprint/templates/codebase/structure.md +285 -0
  38. package/blueprint/templates/codebase/testing.md +480 -0
  39. package/blueprint/templates/config.json +35 -0
  40. package/blueprint/templates/context.md +283 -0
  41. package/blueprint/templates/continue-here.md +78 -0
  42. package/blueprint/templates/debug-subagent-prompt.md +91 -0
  43. package/blueprint/templates/discovery.md +146 -0
  44. package/blueprint/templates/milestone-archive.md +123 -0
  45. package/blueprint/templates/milestone.md +115 -0
  46. package/blueprint/templates/phase-prompt.md +567 -0
  47. package/blueprint/templates/planner-subagent-prompt.md +117 -0
  48. package/blueprint/templates/project.md +184 -0
  49. package/blueprint/templates/requirements.md +231 -0
  50. package/blueprint/templates/research-project/ARCHITECTURE.md +204 -0
  51. package/blueprint/templates/research-project/FEATURES.md +147 -0
  52. package/blueprint/templates/research-project/PITFALLS.md +200 -0
  53. package/blueprint/templates/research-project/STACK.md +120 -0
  54. package/blueprint/templates/research-project/SUMMARY.md +170 -0
  55. package/blueprint/templates/research.md +552 -0
  56. package/blueprint/templates/roadmap.md +202 -0
  57. package/blueprint/templates/state.md +176 -0
  58. package/blueprint/templates/summary-complex.md +59 -0
  59. package/blueprint/templates/summary-minimal.md +41 -0
  60. package/blueprint/templates/summary-standard.md +48 -0
  61. package/blueprint/templates/summary.md +246 -0
  62. package/blueprint/templates/user-setup.md +311 -0
  63. package/blueprint/templates/verification-report.md +322 -0
  64. package/blueprint/workflows/add-phase.md +111 -0
  65. package/blueprint/workflows/add-todo.md +157 -0
  66. package/blueprint/workflows/audit-milestone.md +241 -0
  67. package/blueprint/workflows/check-todos.md +176 -0
  68. package/blueprint/workflows/complete-milestone.md +644 -0
  69. package/blueprint/workflows/diagnose-issues.md +219 -0
  70. package/blueprint/workflows/discovery-phase.md +289 -0
  71. package/blueprint/workflows/discuss-phase.md +408 -0
  72. package/blueprint/workflows/execute-phase.md +338 -0
  73. package/blueprint/workflows/execute-plan.md +437 -0
  74. package/blueprint/workflows/help.md +470 -0
  75. package/blueprint/workflows/insert-phase.md +129 -0
  76. package/blueprint/workflows/list-phase-assumptions.md +178 -0
  77. package/blueprint/workflows/map-codebase.md +327 -0
  78. package/blueprint/workflows/new-milestone.md +373 -0
  79. package/blueprint/workflows/new-project.md +958 -0
  80. package/blueprint/workflows/pause-work.md +122 -0
  81. package/blueprint/workflows/plan-milestone-gaps.md +256 -0
  82. package/blueprint/workflows/plan-phase.md +376 -0
  83. package/blueprint/workflows/progress.md +385 -0
  84. package/blueprint/workflows/quick.md +230 -0
  85. package/blueprint/workflows/remove-phase.md +154 -0
  86. package/blueprint/workflows/research-phase.md +74 -0
  87. package/blueprint/workflows/resume-project.md +306 -0
  88. package/blueprint/workflows/set-profile.md +80 -0
  89. package/blueprint/workflows/settings.md +145 -0
  90. package/blueprint/workflows/transition.md +493 -0
  91. package/blueprint/workflows/update.md +212 -0
  92. package/blueprint/workflows/verify-phase.md +226 -0
  93. package/blueprint/workflows/verify-work.md +570 -0
  94. package/commands/bp/add-phase.md +39 -0
  95. package/commands/bp/add-todo.md +42 -0
  96. package/commands/bp/audit-milestone.md +42 -0
  97. package/commands/bp/check-todos.md +41 -0
  98. package/commands/bp/complete-milestone.md +136 -0
  99. package/commands/bp/debug.md +162 -0
  100. package/commands/bp/discuss-phase.md +86 -0
  101. package/commands/bp/execute-phase.md +42 -0
  102. package/commands/bp/help.md +22 -0
  103. package/commands/bp/insert-phase.md +33 -0
  104. package/commands/bp/join-discord.md +18 -0
  105. package/commands/bp/list-phase-assumptions.md +50 -0
  106. package/commands/bp/map-codebase.md +71 -0
  107. package/commands/bp/new-milestone.md +51 -0
  108. package/commands/bp/new-project.md +42 -0
  109. package/commands/bp/pause-work.md +35 -0
  110. package/commands/bp/plan-milestone-gaps.md +40 -0
  111. package/commands/bp/plan-phase.md +44 -0
  112. package/commands/bp/progress.md +24 -0
  113. package/commands/bp/quick.md +38 -0
  114. package/commands/bp/reapply-patches.md +110 -0
  115. package/commands/bp/remove-phase.md +32 -0
  116. package/commands/bp/research-phase.md +187 -0
  117. package/commands/bp/resume-work.md +40 -0
  118. package/commands/bp/set-profile.md +34 -0
  119. package/commands/bp/settings.md +36 -0
  120. package/commands/bp/update.md +37 -0
  121. package/commands/bp/verify-work.md +39 -0
  122. package/hooks/dist/bp-check-update.js +62 -0
  123. package/hooks/dist/bp-statusline.js +91 -0
  124. package/package.json +48 -0
  125. package/scripts/build-hooks.js +42 -0
@@ -0,0 +1,36 @@
1
+ ---
2
+ name: gsd:settings
3
+ description: Configure Blueprint workflow toggles and model profile
4
+ allowed-tools:
5
+ - Read
6
+ - Write
7
+ - Bash
8
+ - AskUserQuestion
9
+ ---
10
+
11
+ <objective>
12
+ Interactive configuration of Blueprint workflow agents and model profile via multi-question prompt.
13
+
14
+ Routes to the settings workflow which handles:
15
+ - Config existence ensuring
16
+ - Current settings reading and parsing
17
+ - Interactive 5-question prompt (model, research, plan_check, verifier, branching)
18
+ - Config merging and writing
19
+ - Confirmation display with quick command references
20
+ </objective>
21
+
22
+ <execution_context>
23
+ @~/.claude/blueprint/workflows/settings.md
24
+ </execution_context>
25
+
26
+ <process>
27
+ **Follow the settings workflow** from `@~/.claude/blueprint/workflows/settings.md`.
28
+
29
+ The workflow handles all logic including:
30
+ 1. Config file creation with defaults if missing
31
+ 2. Current config reading
32
+ 3. Interactive settings presentation with pre-selection
33
+ 4. Answer parsing and config merging
34
+ 5. File writing
35
+ 6. Confirmation display
36
+ </process>
@@ -0,0 +1,37 @@
1
+ ---
2
+ name: bp:update
3
+ description: Update Blueprint to latest version with changelog display
4
+ allowed-tools:
5
+ - Bash
6
+ - AskUserQuestion
7
+ ---
8
+
9
+ <objective>
10
+ Check for Blueprint updates, install if available, and display what changed.
11
+
12
+ Routes to the update workflow which handles:
13
+ - Version detection (local vs global installation)
14
+ - npm version checking
15
+ - Changelog fetching and display
16
+ - User confirmation with clean install warning
17
+ - Update execution and cache clearing
18
+ - Restart reminder
19
+ </objective>
20
+
21
+ <execution_context>
22
+ @~/.claude/blueprint/workflows/update.md
23
+ </execution_context>
24
+
25
+ <process>
26
+ **Follow the update workflow** from `@~/.claude/blueprint/workflows/update.md`.
27
+
28
+ The workflow handles all logic including:
29
+ 1. Installed version detection (local/global)
30
+ 2. Latest version checking via npm
31
+ 3. Version comparison
32
+ 4. Changelog fetching and extraction
33
+ 5. Clean install warning display
34
+ 6. User confirmation
35
+ 7. Update execution
36
+ 8. Cache clearing
37
+ </process>
@@ -0,0 +1,39 @@
1
+ ---
2
+ name: gsd:verify-work
3
+ description: Validate built features through conversational UAT
4
+ argument-hint: "[phase number, e.g., '4']"
5
+ allowed-tools:
6
+ - Read
7
+ - Bash
8
+ - Glob
9
+ - Grep
10
+ - Edit
11
+ - Write
12
+ - Task
13
+ ---
14
+ <objective>
15
+ Validate built features through conversational testing with persistent state.
16
+
17
+ Purpose: Confirm what Claude built actually works from user's perspective. One test at a time, plain text responses, no interrogation. When issues are found, automatically diagnose, plan fixes, and prepare for execution.
18
+
19
+ Output: {phase}-UAT.md tracking all test results. If issues found: diagnosed gaps, verified fix plans ready for /bp:execute-phase
20
+ </objective>
21
+
22
+ <execution_context>
23
+ @~/.claude/blueprint/workflows/verify-work.md
24
+ @~/.claude/blueprint/templates/UAT.md
25
+ </execution_context>
26
+
27
+ <context>
28
+ Phase: $ARGUMENTS (optional)
29
+ - If provided: Test specific phase (e.g., "4")
30
+ - If not provided: Check for active sessions or prompt for phase
31
+
32
+ @.blueprint/STATE.md
33
+ @.blueprint/ROADMAP.md
34
+ </context>
35
+
36
+ <process>
37
+ Execute the verify-work workflow from @~/.claude/blueprint/workflows/verify-work.md end-to-end.
38
+ Preserve all workflow gates (session management, test presentation, diagnosis, fix planning, routing).
39
+ </process>
@@ -0,0 +1,62 @@
1
+ #!/usr/bin/env node
2
+ // Check for Blueprint updates in background, write result to cache
3
+ // Called by SessionStart hook - runs once per session
4
+
5
+ const fs = require('fs');
6
+ const path = require('path');
7
+ const os = require('os');
8
+ const { spawn } = require('child_process');
9
+
10
+ const homeDir = os.homedir();
11
+ const cwd = process.cwd();
12
+ const cacheDir = path.join(homeDir, '.claude', 'cache');
13
+ const cacheFile = path.join(cacheDir, 'bp-update-check.json');
14
+
15
+ // VERSION file locations (check project first, then global)
16
+ const projectVersionFile = path.join(cwd, '.claude', 'blueprint', 'VERSION');
17
+ const globalVersionFile = path.join(homeDir, '.claude', 'blueprint', 'VERSION');
18
+
19
+ // Ensure cache directory exists
20
+ if (!fs.existsSync(cacheDir)) {
21
+ fs.mkdirSync(cacheDir, { recursive: true });
22
+ }
23
+
24
+ // Run check in background (spawn background process, windowsHide prevents console flash)
25
+ const child = spawn(process.execPath, ['-e', `
26
+ const fs = require('fs');
27
+ const { execSync } = require('child_process');
28
+
29
+ const cacheFile = ${JSON.stringify(cacheFile)};
30
+ const projectVersionFile = ${JSON.stringify(projectVersionFile)};
31
+ const globalVersionFile = ${JSON.stringify(globalVersionFile)};
32
+
33
+ // Check project directory first (local install), then global
34
+ let installed = '0.0.0';
35
+ try {
36
+ if (fs.existsSync(projectVersionFile)) {
37
+ installed = fs.readFileSync(projectVersionFile, 'utf8').trim();
38
+ } else if (fs.existsSync(globalVersionFile)) {
39
+ installed = fs.readFileSync(globalVersionFile, 'utf8').trim();
40
+ }
41
+ } catch (e) {}
42
+
43
+ let latest = null;
44
+ try {
45
+ latest = execSync('npm view @lipter7/blueprint version', { encoding: 'utf8', timeout: 10000, windowsHide: true }).trim();
46
+ } catch (e) {}
47
+
48
+ const result = {
49
+ update_available: latest && installed !== latest,
50
+ installed,
51
+ latest: latest || 'unknown',
52
+ checked: Math.floor(Date.now() / 1000)
53
+ };
54
+
55
+ fs.writeFileSync(cacheFile, JSON.stringify(result));
56
+ `], {
57
+ stdio: 'ignore',
58
+ windowsHide: true,
59
+ detached: true // Required on Windows for proper process detachment
60
+ });
61
+
62
+ child.unref();
@@ -0,0 +1,91 @@
1
+ #!/usr/bin/env node
2
+ // Claude Code Statusline - Blueprint Edition
3
+ // Shows: model | current task | directory | context usage
4
+
5
+ const fs = require('fs');
6
+ const path = require('path');
7
+ const os = require('os');
8
+
9
+ // Read JSON from stdin
10
+ let input = '';
11
+ process.stdin.setEncoding('utf8');
12
+ process.stdin.on('data', chunk => input += chunk);
13
+ process.stdin.on('end', () => {
14
+ try {
15
+ const data = JSON.parse(input);
16
+ const model = data.model?.display_name || 'Claude';
17
+ const dir = data.workspace?.current_dir || process.cwd();
18
+ const session = data.session_id || '';
19
+ const remaining = data.context_window?.remaining_percentage;
20
+
21
+ // Context window display (shows USED percentage scaled to 80% limit)
22
+ // Claude Code enforces an 80% context limit, so we scale to show 100% at that point
23
+ let ctx = '';
24
+ if (remaining != null) {
25
+ const rem = Math.round(remaining);
26
+ const rawUsed = Math.max(0, Math.min(100, 100 - rem));
27
+ // Scale: 80% real usage = 100% displayed
28
+ const used = Math.min(100, Math.round((rawUsed / 80) * 100));
29
+
30
+ // Build progress bar (10 segments)
31
+ const filled = Math.floor(used / 10);
32
+ const bar = 'â–ˆ'.repeat(filled) + 'â–‘'.repeat(10 - filled);
33
+
34
+ // Color based on scaled usage (thresholds adjusted for new scale)
35
+ if (used < 63) { // ~50% real
36
+ ctx = ` \x1b[32m${bar} ${used}%\x1b[0m`;
37
+ } else if (used < 81) { // ~65% real
38
+ ctx = ` \x1b[33m${bar} ${used}%\x1b[0m`;
39
+ } else if (used < 95) { // ~76% real
40
+ ctx = ` \x1b[38;5;208m${bar} ${used}%\x1b[0m`;
41
+ } else {
42
+ ctx = ` \x1b[5;31m💀 ${bar} ${used}%\x1b[0m`;
43
+ }
44
+ }
45
+
46
+ // Current task from todos
47
+ let task = '';
48
+ const homeDir = os.homedir();
49
+ const todosDir = path.join(homeDir, '.claude', 'todos');
50
+ if (session && fs.existsSync(todosDir)) {
51
+ try {
52
+ const files = fs.readdirSync(todosDir)
53
+ .filter(f => f.startsWith(session) && f.includes('-agent-') && f.endsWith('.json'))
54
+ .map(f => ({ name: f, mtime: fs.statSync(path.join(todosDir, f)).mtime }))
55
+ .sort((a, b) => b.mtime - a.mtime);
56
+
57
+ if (files.length > 0) {
58
+ try {
59
+ const todos = JSON.parse(fs.readFileSync(path.join(todosDir, files[0].name), 'utf8'));
60
+ const inProgress = todos.find(t => t.status === 'in_progress');
61
+ if (inProgress) task = inProgress.activeForm || '';
62
+ } catch (e) {}
63
+ }
64
+ } catch (e) {
65
+ // Silently fail on file system errors - don't break statusline
66
+ }
67
+ }
68
+
69
+ // Blueprint update available?
70
+ let bpUpdate = '';
71
+ const cacheFile = path.join(homeDir, '.claude', 'cache', 'bp-update-check.json');
72
+ if (fs.existsSync(cacheFile)) {
73
+ try {
74
+ const cache = JSON.parse(fs.readFileSync(cacheFile, 'utf8'));
75
+ if (cache.update_available) {
76
+ bpUpdate = '\x1b[33m⬆ /bp:update\x1b[0m │ ';
77
+ }
78
+ } catch (e) {}
79
+ }
80
+
81
+ // Output
82
+ const dirname = path.basename(dir);
83
+ if (task) {
84
+ process.stdout.write(`${bpUpdate}\x1b[2m${model}\x1b[0m │ \x1b[1m${task}\x1b[0m │ \x1b[2m${dirname}\x1b[0m${ctx}`);
85
+ } else {
86
+ process.stdout.write(`${bpUpdate}\x1b[2m${model}\x1b[0m │ \x1b[2m${dirname}\x1b[0m${ctx}`);
87
+ }
88
+ } catch (e) {
89
+ // Silent fail - don't break statusline on parse errors
90
+ }
91
+ });
package/package.json ADDED
@@ -0,0 +1,48 @@
1
+ {
2
+ "name": "@lipter7/blueprint",
3
+ "version": "2.0.0",
4
+ "description": "Blueprint: a meta-prompting, context engineering and spec-driven development system for Claude Code, OpenCode and Gemini CLI.",
5
+ "bin": {
6
+ "blueprint": "bin/install.js"
7
+ },
8
+ "files": [
9
+ "bin",
10
+ "commands",
11
+ "blueprint",
12
+ "agents",
13
+ "hooks/dist",
14
+ "scripts"
15
+ ],
16
+ "keywords": [
17
+ "claude",
18
+ "claude-code",
19
+ "ai",
20
+ "meta-prompting",
21
+ "context-engineering",
22
+ "spec-driven-development",
23
+ "gemini",
24
+ "gemini-cli"
25
+ ],
26
+ "author": "TÂCHES",
27
+ "license": "MIT",
28
+ "repository": {
29
+ "type": "git",
30
+ "url": "git+https://github.com/glittercowboy/blueprint.git"
31
+ },
32
+ "homepage": "https://github.com/glittercowboy/blueprint",
33
+ "bugs": {
34
+ "url": "https://github.com/glittercowboy/blueprint/issues"
35
+ },
36
+ "engines": {
37
+ "node": ">=16.7.0"
38
+ },
39
+ "dependencies": {},
40
+ "devDependencies": {
41
+ "esbuild": "^0.24.0"
42
+ },
43
+ "scripts": {
44
+ "build:hooks": "node scripts/build-hooks.js",
45
+ "prepublishOnly": "npm run build:hooks",
46
+ "test": "node --test blueprint/bin/blueprint-tools.test.js"
47
+ }
48
+ }
@@ -0,0 +1,42 @@
1
+ #!/usr/bin/env node
2
+ /**
3
+ * Copy Blueprint hooks to dist for installation.
4
+ */
5
+
6
+ const fs = require('fs');
7
+ const path = require('path');
8
+
9
+ const HOOKS_DIR = path.join(__dirname, '..', 'hooks');
10
+ const DIST_DIR = path.join(HOOKS_DIR, 'dist');
11
+
12
+ // Hooks to copy (pure Node.js, no bundling needed)
13
+ const HOOKS_TO_COPY = [
14
+ 'bp-check-update.js',
15
+ 'bp-statusline.js'
16
+ ];
17
+
18
+ function build() {
19
+ // Ensure dist directory exists
20
+ if (!fs.existsSync(DIST_DIR)) {
21
+ fs.mkdirSync(DIST_DIR, { recursive: true });
22
+ }
23
+
24
+ // Copy hooks to dist
25
+ for (const hook of HOOKS_TO_COPY) {
26
+ const src = path.join(HOOKS_DIR, hook);
27
+ const dest = path.join(DIST_DIR, hook);
28
+
29
+ if (!fs.existsSync(src)) {
30
+ console.warn(`Warning: ${hook} not found, skipping`);
31
+ continue;
32
+ }
33
+
34
+ console.log(`Copying ${hook}...`);
35
+ fs.copyFileSync(src, dest);
36
+ console.log(` → ${dest}`);
37
+ }
38
+
39
+ console.log('\nBuild complete.');
40
+ }
41
+
42
+ build();