pixelcrew 0.2.3 β†’ 0.2.6

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 (171) hide show
  1. package/README.md +389 -315
  2. package/bin/pixel-agents.js +306 -149
  3. package/package.json +3 -1
  4. package/skill/SKILL.md +185 -0
  5. package/skill/references/anti-ai-rubric.md +30 -0
  6. package/skill/references/anti-ai-slop-encyclopedia.md +181 -0
  7. package/skill/references/commands-reference.md +135 -0
  8. package/skill/references/testing-and-qa-strategy.md +25 -0
  9. package/skill/references/token-efficiency.md +20 -0
  10. package/src/adapters/adapter.interface.js +77 -0
  11. package/src/adapters/antigravity.js +138 -0
  12. package/src/adapters/claude-code.js +149 -0
  13. package/src/adapters/codex.js +131 -0
  14. package/src/adapters/cursor.js +133 -0
  15. package/src/adapters/generic.js +63 -0
  16. package/src/adapters/index.js +15 -0
  17. package/src/adapters/kiro.js +134 -0
  18. package/src/adapters/registry.js +150 -0
  19. package/src/backend/analyzer/complexity-analyzer.js +104 -0
  20. package/src/backend/analyzer/requirement-analyzer.js +213 -0
  21. package/src/backend/analyzer/threat-analyzer.js +122 -0
  22. package/src/backend/api/api-designer.js +90 -0
  23. package/src/backend/api/error-contract.js +132 -0
  24. package/src/backend/api/route-generator.js +92 -0
  25. package/src/backend/api/schema-generator.js +64 -0
  26. package/src/backend/architecture/adr-generator.js +62 -0
  27. package/src/backend/architecture/architecture-reasoner.js +119 -0
  28. package/src/backend/architecture/architecture-selector.js +57 -0
  29. package/src/backend/architecture/tradeoff-analyzer.js +92 -0
  30. package/src/backend/data/data-modeler.js +114 -0
  31. package/src/backend/data/index-analyzer.js +93 -0
  32. package/src/backend/data/query-analyzer.js +41 -0
  33. package/src/backend/data/schema-generator.js +92 -0
  34. package/src/backend/data/transaction-analyzer.js +49 -0
  35. package/src/backend/index.js +67 -0
  36. package/src/backend/observability/logging-engine.js +80 -0
  37. package/src/backend/observability/metrics-engine.js +31 -0
  38. package/src/backend/observability/tracing-engine.js +16 -0
  39. package/src/backend/patterns/pattern-registry.js +74 -0
  40. package/src/backend/patterns/pattern-selector.js +39 -0
  41. package/src/backend/patterns/tradeoff-engine.js +17 -0
  42. package/src/backend/performance/cache-analyzer.js +31 -0
  43. package/src/backend/performance/concurrency-analyzer.js +34 -0
  44. package/src/backend/performance/performance-engine.js +98 -0
  45. package/src/backend/performance/query-optimizer.js +16 -0
  46. package/src/backend/reliability/failure-analyzer.js +22 -0
  47. package/src/backend/reliability/idempotency-engine.js +56 -0
  48. package/src/backend/reliability/resilience-engine.js +141 -0
  49. package/src/backend/reliability/retry-analyzer.js +15 -0
  50. package/src/backend/security/auth-selector.js +33 -0
  51. package/src/backend/security/authorization-engine.js +90 -0
  52. package/src/backend/security/policy-engine.js +49 -0
  53. package/src/backend/security/secret-analyzer.js +39 -0
  54. package/src/backend/security/security-engine.js +122 -0
  55. package/src/backend/security/threat-model.js +59 -0
  56. package/src/backend/synthesis/backend-synthesizer.js +98 -0
  57. package/src/backend/synthesis/infrastructure-synthesizer.js +108 -0
  58. package/src/backend/synthesis/module-synthesizer.js +262 -0
  59. package/src/backend/validation/architecture-validator.js +70 -0
  60. package/src/backend/validation/backend-quality-validator.js +71 -0
  61. package/src/backend/validation/dependency-validator.js +20 -0
  62. package/src/backend/validation/performance-validator.js +38 -0
  63. package/src/backend/validation/security-validator.js +73 -0
  64. package/src/commands/adapt.js +105 -0
  65. package/src/commands/add.js +78 -0
  66. package/src/commands/animate.js +48 -0
  67. package/src/commands/assemble.js +57 -0
  68. package/src/commands/audit.js +93 -0
  69. package/src/commands/backend.js +125 -0
  70. package/src/commands/bento.js +25 -0
  71. package/src/commands/blueprint.js +65 -0
  72. package/src/commands/bolder.js +48 -0
  73. package/src/commands/boss-fight.js +60 -0
  74. package/src/commands/build.js +39 -0
  75. package/src/commands/calibrate.js +25 -0
  76. package/src/commands/chromatic.js +25 -0
  77. package/src/commands/clarify.js +52 -0
  78. package/src/commands/colorize.js +57 -0
  79. package/src/commands/command.interface.js +28 -0
  80. package/src/commands/commands.js +84 -0
  81. package/src/commands/craft.js +57 -0
  82. package/src/commands/crew.js +66 -0
  83. package/src/commands/critique.js +25 -0
  84. package/src/commands/de-slop.js +25 -0
  85. package/src/commands/delight.js +46 -0
  86. package/src/commands/deploy.js +42 -0
  87. package/src/commands/distill.js +48 -0
  88. package/src/commands/doctor.js +89 -0
  89. package/src/commands/document.js +83 -0
  90. package/src/commands/eight-bit.js +25 -0
  91. package/src/commands/extract.js +75 -0
  92. package/src/commands/fix.js +46 -0
  93. package/src/commands/harden.js +85 -0
  94. package/src/commands/index.js +67 -0
  95. package/src/commands/install.js +75 -0
  96. package/src/commands/layout.js +48 -0
  97. package/src/commands/live.js +44 -0
  98. package/src/commands/manifest.js +25 -0
  99. package/src/commands/office.js +25 -0
  100. package/src/commands/onboard.js +46 -0
  101. package/src/commands/oneshot.js +60 -0
  102. package/src/commands/optimize.js +46 -0
  103. package/src/commands/overdrive.js +46 -0
  104. package/src/commands/parser.js +143 -0
  105. package/src/commands/pixelcrew.js +96 -0
  106. package/src/commands/plan.js +66 -0
  107. package/src/commands/polish.js +45 -0
  108. package/src/commands/quieter.js +48 -0
  109. package/src/commands/recap.js +358 -0
  110. package/src/commands/registry.js +353 -0
  111. package/src/commands/render.js +26 -0
  112. package/src/commands/retrofit.js +25 -0
  113. package/src/commands/review.js +118 -0
  114. package/src/commands/roster.js +25 -0
  115. package/src/commands/sentinel.js +25 -0
  116. package/src/commands/shape.js +66 -0
  117. package/src/commands/skills.js +57 -0
  118. package/src/commands/status.js +48 -0
  119. package/src/commands/stop.js +50 -0
  120. package/src/commands/sync.js +58 -0
  121. package/src/commands/typeset.js +58 -0
  122. package/src/commands/warp.js +25 -0
  123. package/src/core/agent-runtime.js +94 -0
  124. package/src/core/event-bus.js +98 -0
  125. package/src/core/index.js +9 -0
  126. package/src/core/orchestrator.js +234 -0
  127. package/src/core/scheduler.js +124 -0
  128. package/src/core/task-graph.js +185 -0
  129. package/src/dashboard/app.js +1172 -30
  130. package/src/dashboard/index.html +223 -23
  131. package/src/dashboard/styles.css +870 -0
  132. package/src/index.js +16 -0
  133. package/src/orchestrator/artifact-graph.js +104 -0
  134. package/src/orchestrator/ast-normalizer.js +147 -0
  135. package/src/orchestrator/code-generator.js +632 -780
  136. package/src/orchestrator/design-engine.js +203 -0
  137. package/src/orchestrator/engine.js +307 -38
  138. package/src/orchestrator/oneshot.js +367 -380
  139. package/src/orchestrator/ontology.js +394 -0
  140. package/src/orchestrator/planner.js +231 -258
  141. package/src/orchestrator/repair-planner.js +67 -0
  142. package/src/orchestrator/requirement-contract.js +177 -0
  143. package/src/orchestrator/requirement-validator.js +39 -0
  144. package/src/orchestrator/semantic-engine.js +582 -0
  145. package/src/orchestrator/semantic-reviewer.js +179 -0
  146. package/src/orchestrator/task-planner.js +111 -0
  147. package/src/orchestrator/telemetry.js +209 -0
  148. package/src/orchestrator/ui-synthesizer.js +245 -0
  149. package/src/orchestrator/visual-critic.js +106 -0
  150. package/src/policies/architecture/layering.policy.js +14 -0
  151. package/src/policies/performance/indexing.policy.js +13 -0
  152. package/src/policies/reliability/resilience.policy.js +13 -0
  153. package/src/policies/security/auth.policy.js +31 -0
  154. package/src/protocol/agent.js +124 -0
  155. package/src/protocol/event.js +78 -0
  156. package/src/protocol/index.js +8 -0
  157. package/src/protocol/skill.js +54 -0
  158. package/src/protocol/task.js +100 -0
  159. package/src/scaffold/claude-generator.js +60 -0
  160. package/src/scaffold/commands-catalog.js +321 -0
  161. package/src/scaffold/cursor-generator.js +74 -0
  162. package/src/scaffold/ide-rules.js +133 -0
  163. package/src/scaffold/init.js +415 -91
  164. package/src/scaffold/installer.js +571 -0
  165. package/src/scaffold/kiro-generator.js +86 -0
  166. package/src/scaffold/skills-bundle.js +520 -0
  167. package/src/scaffold/templates.js +57 -4
  168. package/src/scaffold/workstations.js +364 -0
  169. package/src/server/server.js +283 -40
  170. package/src/utils/fs-safe.js +168 -0
  171. package/src/utils/markdown-report.js +175 -0
@@ -0,0 +1,175 @@
1
+ /**
2
+ * PIXEL CREW β€” Structured Markdown Report Builder & Persister
3
+ *
4
+ * Generates rich, highly structured GitHub-Flavored Markdown report documents
5
+ * with frontmatter, metric scorecards, squad finding matrices, anti-AI compliance
6
+ * tables, and actionable checklists.
7
+ */
8
+
9
+ import fs from 'node:fs/promises';
10
+ import path from 'node:path';
11
+
12
+ export class MarkdownReportBuilder {
13
+ constructor(options = {}) {
14
+ this.title = options.title || 'PixelCrew Engineering Report';
15
+ this.command = options.command || '/report';
16
+ this.category = options.category || 'General';
17
+ this.agent = options.agent || 'Lead Orchestrator';
18
+ this.project = options.project || 'Project';
19
+ this.timestamp = options.timestamp || Date.now();
20
+ this.summary = options.summary || '';
21
+ this.metrics = options.metrics || [];
22
+ this.sections = options.sections || [];
23
+ this.checklist = options.checklist || [];
24
+ this.actionItems = options.actionItems || [];
25
+ this.antiAiCompliance = options.antiAiCompliance || null;
26
+ this.score = options.score || null;
27
+ this.status = options.status || 'COMPLETED';
28
+ }
29
+
30
+ /**
31
+ * Compiles the full structured Markdown document
32
+ */
33
+ build() {
34
+ const dateObj = new Date(this.timestamp);
35
+ const dateStr = dateObj.toLocaleDateString([], { month: 'short', day: 'numeric', year: 'numeric' });
36
+ const timeStr = dateObj.toLocaleTimeString([], { hour: '2-digit', minute: '2-digit', second: '2-digit' });
37
+ const isoDate = dateObj.toISOString();
38
+
39
+ let md = `---
40
+ title: "${this.title}"
41
+ command: "${this.command}"
42
+ category: "${this.category}"
43
+ agent: "${this.agent}"
44
+ project: "${this.project}"
45
+ date: "${isoDate}"
46
+ status: "${this.status}"
47
+ ${this.score !== null ? `score: ${this.score}\n` : ''}---
48
+
49
+ # 🏒 ${this.title}
50
+
51
+ > **PixelCrew Floor 42 Swarm Report** β€’ Generated on \`${dateStr} at ${timeStr}\` via \`${this.command}\`
52
+
53
+ ---
54
+
55
+ ## πŸ“‹ Report Metadata
56
+
57
+ | Attribute | Details |
58
+ | :--- | :--- |
59
+ | **Project** | \`${this.project}\` |
60
+ | **Command** | \`${this.command}\` |
61
+ | **Squad Persona** | \`${this.agent}\` |
62
+ | **Category** | \`${this.category}\` |
63
+ | **Execution Status** | \`βœ“ ${this.status}\` |
64
+ ${this.score !== null ? `| **Overall Score** | **\`${this.score} / 10.0\`** (β˜… Approved) |\n` : ''}
65
+ `;
66
+
67
+ // 1. Executive Summary
68
+ if (this.summary) {
69
+ md += `## πŸ“Œ Executive Summary\n\n${this.summary}\n\n`;
70
+ }
71
+
72
+ // 2. Metrics & KPI Scorecards
73
+ if (this.metrics && this.metrics.length > 0) {
74
+ md += `## πŸ“Š Key Metrics & Performance Scorecard\n\n`;
75
+ md += `| Benchmark Metric | Target / Budget | Result | Status |\n`;
76
+ md += `| :--- | :--- | :--- | :--- |\n`;
77
+ for (const m of this.metrics) {
78
+ const statusIcon = m.status === 'PASS' || m.status === 'PASSED' || m.status === 'OPTIMIZED' ? 'βœ“' : (m.status === 'WARN' ? '⚠' : '●');
79
+ md += `| **${m.name}** | \`${m.target || 'Standard'}\` | \`${m.value || m.score || 'N/A'}\` | **${statusIcon} ${m.status || 'OK'}** |\n`;
80
+ }
81
+ md += `\n`;
82
+ }
83
+
84
+ // 3. Structured Sections
85
+ for (const sec of this.sections) {
86
+ const icon = sec.icon ? `${sec.icon} ` : '';
87
+ md += `## ${icon}${sec.title}\n\n`;
88
+ if (sec.description) {
89
+ md += `${sec.description}\n\n`;
90
+ }
91
+ if (sec.table && Array.isArray(sec.table.rows)) {
92
+ md += `| ${sec.table.headers.join(' | ')} |\n`;
93
+ md += `| ${sec.table.headers.map(() => ':---').join(' | ')} |\n`;
94
+ for (const row of sec.table.rows) {
95
+ md += `| ${row.join(' | ')} |\n`;
96
+ }
97
+ md += `\n`;
98
+ }
99
+ if (sec.items && sec.items.length > 0) {
100
+ for (const item of sec.items) {
101
+ if (typeof item === 'string') {
102
+ md += `- ${item.startsWith('β€’') ? item.slice(1).trim() : item}\n`;
103
+ } else if (item.label && item.detail) {
104
+ md += `- **${item.label}:** ${item.detail}\n`;
105
+ }
106
+ }
107
+ md += `\n`;
108
+ }
109
+ }
110
+
111
+ // 4. Anti-AI Slop Compliance Checklist
112
+ if (this.antiAiCompliance) {
113
+ md += `## πŸ›‘οΈ Anti-AI 64-Pattern Compliance Matrix\n\n`;
114
+ md += `| Design Dimension | Banned AI Pattern | PixelCrew Status |\n`;
115
+ md += `| :--- | :--- | :--- |\n`;
116
+ md += `| **Visual Details** | Faint gridlines background & purple gradient blobs | \`βœ“ 0 Detected (Clean Solid Tiers)\` |\n`;
117
+ md += `| **Typography** | Tracked pill kickers (\`✨ INTRODUCING\`) & flat scale | \`βœ“ Mathematical fluid clamp() active\` |\n`;
118
+ md += `| **Layout & Grid** | Monotonous 3-card cloned columns | \`βœ“ Asymmetric Bento flow enabled\` |\n`;
119
+ md += `| **Copywriting** | ClichΓ© phrases (*"Elevate your workflow"*) | \`βœ“ Grounded technical value props\` |\n`;
120
+ md += `| **Accessibility** | Low contrast text & missing focus rings | \`βœ“ WCAG 2.1 AA/AAA Compliant\` |\n\n`;
121
+ }
122
+
123
+ // 5. Verification Checklist
124
+ if (this.checklist && this.checklist.length > 0) {
125
+ md += `## βœ… Verification & Hardening Checklist\n\n`;
126
+ for (const item of this.checklist) {
127
+ const isDone = item.done !== false;
128
+ const text = typeof item === 'string' ? item : item.text;
129
+ md += `- [${isDone ? 'x' : ' '}] ${text}\n`;
130
+ }
131
+ md += `\n`;
132
+ }
133
+
134
+ // 6. Action Items & Next Steps
135
+ if (this.actionItems && this.actionItems.length > 0) {
136
+ md += `## πŸš€ Action Items & Next Steps\n\n`;
137
+ for (const action of this.actionItems) {
138
+ md += `- [ ] ${action}\n`;
139
+ }
140
+ md += `\n`;
141
+ }
142
+
143
+ md += `---\n\n*Generated autonomously by PixelCrew Floor 42 Multi-Agent Swarm.* \n`;
144
+
145
+ return md;
146
+ }
147
+
148
+ /**
149
+ * Saves the structured markdown report into .pixel-crew/reports/ and returns file paths
150
+ */
151
+ async save(targetDir = process.cwd(), filenameSlug = null) {
152
+ const slug = filenameSlug || `${this.command.replace(/^\//, '')}-${this.timestamp}`;
153
+ const reportsDir = path.join(targetDir, '.pixel-crew', 'reports');
154
+ const mdContent = this.build();
155
+
156
+ try {
157
+ await fs.mkdir(reportsDir, { recursive: true });
158
+ const filePath = path.join(reportsDir, `${slug}.md`);
159
+ await fs.writeFile(filePath, mdContent, 'utf-8');
160
+
161
+ return {
162
+ success: true,
163
+ filePath,
164
+ fileName: `${slug}.md`,
165
+ markdown: mdContent
166
+ };
167
+ } catch (err) {
168
+ return {
169
+ success: false,
170
+ error: err.message,
171
+ markdown: mdContent
172
+ };
173
+ }
174
+ }
175
+ }