compass-st 1.1.2
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/README.md +105 -0
- package/VERSION +1 -0
- package/bin/install +174 -0
- package/bootstrap.sh +95 -0
- package/cli/Cargo.lock +270 -0
- package/cli/Cargo.toml +24 -0
- package/cli/src/cmd/context.rs +59 -0
- package/cli/src/cmd/dag.rs +133 -0
- package/cli/src/cmd/git.rs +148 -0
- package/cli/src/cmd/hook.rs +51 -0
- package/cli/src/cmd/index.rs +363 -0
- package/cli/src/cmd/manifest.rs +34 -0
- package/cli/src/cmd/memory.rs +680 -0
- package/cli/src/cmd/migrate.rs +790 -0
- package/cli/src/cmd/mod.rs +14 -0
- package/cli/src/cmd/progress.rs +107 -0
- package/cli/src/cmd/project.rs +1700 -0
- package/cli/src/cmd/session.rs +64 -0
- package/cli/src/cmd/state.rs +317 -0
- package/cli/src/cmd/validate/mod.rs +506 -0
- package/cli/src/cmd/validate/prd.rs +472 -0
- package/cli/src/cmd/version.rs +89 -0
- package/cli/src/helpers.rs +40 -0
- package/cli/src/main.rs +75 -0
- package/cli/tests/fixtures/plan_empty_pointers.json +60 -0
- package/cli/tests/fixtures/plan_missing_pointers.json +59 -0
- package/cli/tests/fixtures/plan_too_many_pointers.json +92 -0
- package/cli/tests/fixtures/plan_v1_valid.json +64 -0
- package/cli/tests/fixtures/prd_bad_flow_bullet.md +37 -0
- package/cli/tests/fixtures/prd_bad_flow_prose.md +33 -0
- package/cli/tests/fixtures/prd_good_flow.md +41 -0
- package/cli/tests/fixtures/prd_xref_dangling.md +38 -0
- package/cli/tests/fixtures/prd_xref_valid.md +53 -0
- package/cli/tests/fixtures/projects/proj_a/.compass/.state/config.json +12 -0
- package/cli/tests/fixtures/projects/proj_b/.compass/.state/config.json +12 -0
- package/cli/tests/fixtures/projects/proj_c/.compass/.state/config.json +12 -0
- package/cli/tests/fixtures/registry/all_dead.json +18 -0
- package/cli/tests/fixtures/registry/corrupt.json +1 -0
- package/cli/tests/fixtures/registry/empty.json +1 -0
- package/cli/tests/fixtures/registry/last_active_dead.json +24 -0
- package/cli/tests/fixtures/registry/multi_alive.json +24 -0
- package/cli/tests/fixtures/registry/one_alive.json +12 -0
- package/cli/tests/fixtures/v0_project/.compass/.state/config.json +5 -0
- package/cli/tests/fixtures/v0_project/.compass/.state/sessions/onboarding-redesign/plan.json +29 -0
- package/cli/tests/fixtures/v0_project/.compass/.state/sessions/sample-feature/context.json +11 -0
- package/cli/tests/fixtures/v0_project/.compass/.state/sessions/sample-feature/plan.json +49 -0
- package/core/colleagues/base-rules.md +112 -0
- package/core/colleagues/manifest.json +85 -0
- package/core/colleagues/market-analyst.md +50 -0
- package/core/colleagues/prioritizer.md +53 -0
- package/core/colleagues/researcher.md +54 -0
- package/core/colleagues/reviewer.md +55 -0
- package/core/colleagues/stakeholder-comm.md +59 -0
- package/core/colleagues/story-breaker.md +57 -0
- package/core/colleagues/ux-reviewer.md +54 -0
- package/core/colleagues/writer.md +55 -0
- package/core/commands/compass/brief.md +28 -0
- package/core/commands/compass/check.md +27 -0
- package/core/commands/compass/epic.md +32 -0
- package/core/commands/compass/feedback.md +32 -0
- package/core/commands/compass/help.md +24 -0
- package/core/commands/compass/ideate.md +32 -0
- package/core/commands/compass/init.md +30 -0
- package/core/commands/compass/plan.md +27 -0
- package/core/commands/compass/prd.md +39 -0
- package/core/commands/compass/prioritize.md +36 -0
- package/core/commands/compass/prototype.md +28 -0
- package/core/commands/compass/release.md +32 -0
- package/core/commands/compass/research.md +31 -0
- package/core/commands/compass/roadmap.md +32 -0
- package/core/commands/compass/run.md +28 -0
- package/core/commands/compass/setup.md +32 -0
- package/core/commands/compass/sprint.md +32 -0
- package/core/commands/compass/status.md +32 -0
- package/core/commands/compass/story.md +37 -0
- package/core/commands/compass/undo.md +33 -0
- package/core/commands/compass/update.md +29 -0
- package/core/hooks/context-monitor.sh +5 -0
- package/core/hooks/manifest-tracker.sh +62 -0
- package/core/hooks/statusline.sh +12 -0
- package/core/hooks/update-checker.sh +24 -0
- package/core/integrations/confluence.md +267 -0
- package/core/integrations/figma.md +277 -0
- package/core/integrations/jira.md +436 -0
- package/core/integrations/vercel.md +170 -0
- package/core/manifest.json +172 -0
- package/core/shared/SCHEMAS-v1.md +404 -0
- package/core/shared/progress.md +145 -0
- package/core/shared/project-scan.md +293 -0
- package/core/shared/resolve-project.md +136 -0
- package/core/shared/ux-rules.md +52 -0
- package/core/shared/version-backup.md +38 -0
- package/core/templates/prd-template.md +145 -0
- package/core/templates/story-template.md +99 -0
- package/core/workflows/brief.md +184 -0
- package/core/workflows/check.md +436 -0
- package/core/workflows/epic.md +177 -0
- package/core/workflows/feedback.md +164 -0
- package/core/workflows/help.md +79 -0
- package/core/workflows/ideate.md +320 -0
- package/core/workflows/init.md +524 -0
- package/core/workflows/migrate.md +136 -0
- package/core/workflows/plan.md +320 -0
- package/core/workflows/prd.md +632 -0
- package/core/workflows/prioritize.md +301 -0
- package/core/workflows/project.md +177 -0
- package/core/workflows/prototype.md +174 -0
- package/core/workflows/release.md +179 -0
- package/core/workflows/research.md +613 -0
- package/core/workflows/roadmap.md +152 -0
- package/core/workflows/run.md +367 -0
- package/core/workflows/setup.md +294 -0
- package/core/workflows/sprint.md +187 -0
- package/core/workflows/status.md +185 -0
- package/core/workflows/story.md +477 -0
- package/core/workflows/undo.md +42 -0
- package/core/workflows/update.md +127 -0
- package/package.json +37 -0
package/README.md
ADDED
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
# Compass
|
|
2
|
+
|
|
3
|
+
AI-powered toolkit for Product Owners & Product Managers.
|
|
4
|
+
|
|
5
|
+
Tell Compass what you need — it figures out the rest.
|
|
6
|
+
|
|
7
|
+
## Install
|
|
8
|
+
|
|
9
|
+
```bash
|
|
10
|
+
npx compass-st
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
Or via curl:
|
|
14
|
+
|
|
15
|
+
```bash
|
|
16
|
+
curl -fsSL https://raw.githubusercontent.com/mrmandovn/compass/main/bootstrap.sh | bash
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
*macOS / Linux*
|
|
20
|
+
|
|
21
|
+
## Get started
|
|
22
|
+
|
|
23
|
+
```
|
|
24
|
+
/compass:init # one-time setup
|
|
25
|
+
/compass:brief <task> # describe what you need
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
## How it works
|
|
29
|
+
|
|
30
|
+
1. `/compass:brief` — Describe what you need
|
|
31
|
+
2. `/compass:plan` — Review the execution plan
|
|
32
|
+
3. `/compass:run` — Colleagues work in parallel
|
|
33
|
+
4. `/compass:check` — Validate and deliver
|
|
34
|
+
|
|
35
|
+
## Commands
|
|
36
|
+
|
|
37
|
+
### Workflow
|
|
38
|
+
| Command | What it does |
|
|
39
|
+
|---------|-------------|
|
|
40
|
+
| `brief` | Describe what you need — Compass picks Colleagues |
|
|
41
|
+
| `plan` | Review execution plan |
|
|
42
|
+
| `run` | Execute with parallel Colleagues |
|
|
43
|
+
| `check` | Validate outputs, deliver to Jira/Confluence |
|
|
44
|
+
|
|
45
|
+
### Individual
|
|
46
|
+
| Command | What it does |
|
|
47
|
+
|---------|-------------|
|
|
48
|
+
| `prd` | Write a PRD (no code) |
|
|
49
|
+
| `story` | User Story + AC (Given/When/Then) |
|
|
50
|
+
| `research` | Competitive, market, user feedback, tech eval |
|
|
51
|
+
| `ideate` | Brainstorm 5-10 ideas |
|
|
52
|
+
| `prioritize` | Score backlog (RICE / MoSCoW / Kano) |
|
|
53
|
+
| `prototype` | UI prototype with UI/UX Pro Max |
|
|
54
|
+
| `epic` | Create epic from PRD |
|
|
55
|
+
| `feedback` | Quick feedback collection |
|
|
56
|
+
| `roadmap` | Product roadmap with gantt |
|
|
57
|
+
| `sprint` | Sprint planning by capacity |
|
|
58
|
+
| `release` | Generate release notes |
|
|
59
|
+
| `status` | Project dashboard |
|
|
60
|
+
| `undo` | Restore previous version |
|
|
61
|
+
|
|
62
|
+
### Setup
|
|
63
|
+
| Command | What it does |
|
|
64
|
+
|---------|-------------|
|
|
65
|
+
| `init` | Set up project |
|
|
66
|
+
| `setup` | Manage integrations (Jira, Figma, Confluence, Vercel) |
|
|
67
|
+
| `update` | Update Compass |
|
|
68
|
+
| `help` | Show commands |
|
|
69
|
+
|
|
70
|
+
## AI Colleagues
|
|
71
|
+
|
|
72
|
+
| Colleague | Role |
|
|
73
|
+
|-----------|------|
|
|
74
|
+
| Research Aggregator | User feedback, competitive intel |
|
|
75
|
+
| Market Analyst | Market sizing, competitors |
|
|
76
|
+
| Product Writer | Write PRD |
|
|
77
|
+
| Story Breaker | Break PRD into stories |
|
|
78
|
+
| Prioritizer | Score backlog |
|
|
79
|
+
| Consistency Reviewer | Cross-doc validation |
|
|
80
|
+
| UX Reviewer | User flows, UX consistency |
|
|
81
|
+
| Stakeholder Communicator | Executive summaries |
|
|
82
|
+
|
|
83
|
+
## Compatibility
|
|
84
|
+
|
|
85
|
+
Works with any AI model. Install puts commands in `~/.claude/commands/` which both Claude Code and OpenCode read.
|
|
86
|
+
|
|
87
|
+
Paste workflow into any AI: `cat ~/.compass/core/workflows/brief.md`
|
|
88
|
+
|
|
89
|
+
Tested with: Claude, GPT, Gemini, GLM, DeepSeek, Qwen.
|
|
90
|
+
|
|
91
|
+
## Update
|
|
92
|
+
|
|
93
|
+
```bash
|
|
94
|
+
cd ~/.compass && git fetch origin main && git reset --hard origin/main
|
|
95
|
+
```
|
|
96
|
+
|
|
97
|
+
## Uninstall
|
|
98
|
+
|
|
99
|
+
```bash
|
|
100
|
+
rm -rf ~/.compass ~/.claude/commands/compass
|
|
101
|
+
```
|
|
102
|
+
|
|
103
|
+
## License
|
|
104
|
+
|
|
105
|
+
MIT
|
package/VERSION
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
1.1.2
|
package/bin/install
ADDED
|
@@ -0,0 +1,174 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
|
|
3
|
+
// Compass installer — `npx compass-st`
|
|
4
|
+
// Clones/updates ~/.compass and symlinks commands to ~/.claude/commands/compass
|
|
5
|
+
|
|
6
|
+
const fs = require('fs');
|
|
7
|
+
const path = require('path');
|
|
8
|
+
const { execSync, spawnSync } = require('child_process');
|
|
9
|
+
const readline = require('readline');
|
|
10
|
+
|
|
11
|
+
// Colors
|
|
12
|
+
const C = { reset: '\x1b[0m', cyan: '\x1b[36m', green: '\x1b[32m', yellow: '\x1b[33m', red: '\x1b[31m', bold: '\x1b[1m', dim: '\x1b[2m' };
|
|
13
|
+
const cyan = s => `${C.cyan}${s}${C.reset}`;
|
|
14
|
+
const green = s => `${C.green}${s}${C.reset}`;
|
|
15
|
+
const yellow = s => `${C.yellow}${s}${C.reset}`;
|
|
16
|
+
const bold = s => `${C.bold}${s}${C.reset}`;
|
|
17
|
+
const dim = s => `${C.dim}${s}${C.reset}`;
|
|
18
|
+
|
|
19
|
+
const HOME = process.env.HOME;
|
|
20
|
+
const COMPASS_DIR = path.join(HOME, '.compass');
|
|
21
|
+
const CLAUDE_DIR = path.join(HOME, '.claude');
|
|
22
|
+
const SCRIPT_DIR = path.resolve(path.join(__dirname, '..'));
|
|
23
|
+
const REPO_URL = 'https://github.com/mrmandovn/compass.git';
|
|
24
|
+
|
|
25
|
+
function readVersion(dir) {
|
|
26
|
+
try { return fs.readFileSync(path.join(dir || SCRIPT_DIR, 'VERSION'), 'utf8').trim(); }
|
|
27
|
+
catch { return '0.4.0'; }
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
// Banner
|
|
31
|
+
console.log(`
|
|
32
|
+
${cyan(' ╔═══════════════════════╗')}
|
|
33
|
+
${cyan(' ║')} ${bold('COMPASS')} ${yellow(`v${readVersion()}`)} ${cyan('║')}
|
|
34
|
+
${cyan(' ║')} ${dim('PO/PM AI Toolkit')} ${cyan('║')}
|
|
35
|
+
${cyan(' ╚═══════════════════════╝')}
|
|
36
|
+
`);
|
|
37
|
+
|
|
38
|
+
// Parse args
|
|
39
|
+
const args = process.argv.slice(2);
|
|
40
|
+
const hasLocal = args.includes('--local') || args.includes('-l');
|
|
41
|
+
const hasUninstall = args.includes('--uninstall') || args.includes('-u');
|
|
42
|
+
const hasHelp = args.includes('--help') || args.includes('-h');
|
|
43
|
+
|
|
44
|
+
if (hasHelp) {
|
|
45
|
+
console.log(`${bold('USAGE')}
|
|
46
|
+
npx compass-st Install globally
|
|
47
|
+
npx compass-st --local Install to ./.claude/ only
|
|
48
|
+
npx compass-st --uninstall Remove Compass
|
|
49
|
+
npx compass-st --help Show this help
|
|
50
|
+
|
|
51
|
+
${bold('ALTERNATIVE')}
|
|
52
|
+
curl -fsSL https://raw.githubusercontent.com/mrmandovn/compass/main/bootstrap.sh | bash
|
|
53
|
+
`);
|
|
54
|
+
process.exit(0);
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
// Uninstall
|
|
58
|
+
if (hasUninstall) {
|
|
59
|
+
console.log(' Uninstalling Compass...');
|
|
60
|
+
const compassCmd = path.join(CLAUDE_DIR, 'commands', 'compass');
|
|
61
|
+
if (fs.existsSync(compassCmd)) {
|
|
62
|
+
fs.rmSync(compassCmd, { recursive: true });
|
|
63
|
+
console.log(` ${green('✓')} Removed commands`);
|
|
64
|
+
}
|
|
65
|
+
console.log(`\n ${green('Done!')} Source at ~/.compass/ untouched.\n To fully remove: rm -rf ~/.compass\n`);
|
|
66
|
+
process.exit(0);
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
// Copy source to ~/.compass/ (if running from npx temp dir)
|
|
70
|
+
if (SCRIPT_DIR !== COMPASS_DIR) {
|
|
71
|
+
if (fs.existsSync(path.join(COMPASS_DIR, '.git'))) {
|
|
72
|
+
console.log(' Updating via git...');
|
|
73
|
+
const r = spawnSync('git', ['-C', COMPASS_DIR, 'fetch', 'origin', 'main'], { stdio: 'pipe' });
|
|
74
|
+
spawnSync('git', ['-C', COMPASS_DIR, 'reset', '--hard', 'origin/main'], { stdio: 'pipe' });
|
|
75
|
+
if (r.status === 0) console.log(` ${green('✓')} Updated from git`);
|
|
76
|
+
else console.log(` ${yellow('⚠')} git fetch failed — using existing`);
|
|
77
|
+
} else if (fs.existsSync(COMPASS_DIR)) {
|
|
78
|
+
console.log(' Updating ~/.compass/...');
|
|
79
|
+
copyDir(SCRIPT_DIR, COMPASS_DIR);
|
|
80
|
+
console.log(` ${green('✓')} Updated`);
|
|
81
|
+
} else {
|
|
82
|
+
console.log(' Installing to ~/.compass/...');
|
|
83
|
+
copyDir(SCRIPT_DIR, COMPASS_DIR);
|
|
84
|
+
try { execSync(`git -C "${COMPASS_DIR}" init -q && git -C "${COMPASS_DIR}" remote add origin "${REPO_URL}"`, { stdio: 'pipe' }); }
|
|
85
|
+
catch {}
|
|
86
|
+
console.log(` ${green('✓')} Installed`);
|
|
87
|
+
}
|
|
88
|
+
} else {
|
|
89
|
+
console.log(dim(' Running from ~/.compass/ — skipping copy.'));
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
// Symlink commands
|
|
93
|
+
const targetDir = hasLocal ? path.join(process.cwd(), '.claude') : CLAUDE_DIR;
|
|
94
|
+
const compassCmd = path.join(targetDir, 'commands', 'compass');
|
|
95
|
+
|
|
96
|
+
fs.mkdirSync(path.join(targetDir, 'commands'), { recursive: true });
|
|
97
|
+
|
|
98
|
+
// Remove old symlink or dir
|
|
99
|
+
try {
|
|
100
|
+
const stat = fs.lstatSync(compassCmd);
|
|
101
|
+
if (stat.isSymbolicLink()) fs.unlinkSync(compassCmd);
|
|
102
|
+
else fs.rmSync(compassCmd, { recursive: true });
|
|
103
|
+
} catch {}
|
|
104
|
+
|
|
105
|
+
fs.symlinkSync(path.join(COMPASS_DIR, 'core', 'commands', 'compass'), compassCmd);
|
|
106
|
+
const count = fs.readdirSync(path.join(COMPASS_DIR, 'core', 'commands', 'compass')).filter(f => f.endsWith('.md')).length;
|
|
107
|
+
console.log(` ${green('✓')} ${count} commands linked`);
|
|
108
|
+
|
|
109
|
+
// Build Rust CLI if cargo available
|
|
110
|
+
const cliBin = path.join(COMPASS_DIR, 'cli', 'target', 'release', 'compass-cli');
|
|
111
|
+
let cliBuilt = false;
|
|
112
|
+
try {
|
|
113
|
+
execSync('which cargo', { stdio: 'pipe' });
|
|
114
|
+
if (!fs.existsSync(cliBin)) {
|
|
115
|
+
console.log(' Building compass-cli...');
|
|
116
|
+
try {
|
|
117
|
+
execSync(`cd "${path.join(COMPASS_DIR, 'cli')}" && cargo build --release --quiet`, { stdio: 'pipe' });
|
|
118
|
+
console.log(` ${green('✓')} compass-cli built`);
|
|
119
|
+
cliBuilt = true;
|
|
120
|
+
} catch { console.log(` ${yellow('⚠')} Build failed — CLI optional`); }
|
|
121
|
+
} else {
|
|
122
|
+
console.log(` ${green('✓')} compass-cli ready`);
|
|
123
|
+
cliBuilt = true;
|
|
124
|
+
}
|
|
125
|
+
} catch {
|
|
126
|
+
console.log(dim(' Rust not installed — CLI optional'));
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
// Symlink CLI into a PATH-reachable directory so workflows can call `compass-cli`
|
|
130
|
+
if (cliBuilt && fs.existsSync(cliBin)) {
|
|
131
|
+
const linkCandidates = [
|
|
132
|
+
'/opt/homebrew/bin',
|
|
133
|
+
path.join(HOME, '.local/bin'),
|
|
134
|
+
path.join(HOME, 'bin'),
|
|
135
|
+
'/usr/local/bin',
|
|
136
|
+
];
|
|
137
|
+
let linked = false;
|
|
138
|
+
for (const dir of linkCandidates) {
|
|
139
|
+
try {
|
|
140
|
+
if (!fs.existsSync(dir)) continue;
|
|
141
|
+
fs.accessSync(dir, fs.constants.W_OK);
|
|
142
|
+
const linkPath = path.join(dir, 'compass-cli');
|
|
143
|
+
try { fs.unlinkSync(linkPath); } catch {}
|
|
144
|
+
fs.symlinkSync(cliBin, linkPath);
|
|
145
|
+
console.log(` ${green('✓')} compass-cli linked → ${linkPath}`);
|
|
146
|
+
linked = true;
|
|
147
|
+
break;
|
|
148
|
+
} catch {}
|
|
149
|
+
}
|
|
150
|
+
if (!linked) {
|
|
151
|
+
console.log(` ${yellow('⚠')} Could not link compass-cli to PATH — add ${cliBin} manually for full perf`);
|
|
152
|
+
}
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
// Summary
|
|
156
|
+
const v = readVersion(COMPASS_DIR);
|
|
157
|
+
console.log(`
|
|
158
|
+
${green('Done!')} Compass v${v} installed.
|
|
159
|
+
|
|
160
|
+
Run: ${cyan('/compass:init')} to set up your first project.
|
|
161
|
+
`);
|
|
162
|
+
|
|
163
|
+
// Helper: recursive copy (skip .git, target, node_modules)
|
|
164
|
+
function copyDir(src, dst) {
|
|
165
|
+
const skip = ['.git', 'target', 'node_modules', '.DS_Store'];
|
|
166
|
+
fs.mkdirSync(dst, { recursive: true });
|
|
167
|
+
for (const entry of fs.readdirSync(src)) {
|
|
168
|
+
if (skip.includes(entry)) continue;
|
|
169
|
+
const s = path.join(src, entry);
|
|
170
|
+
const d = path.join(dst, entry);
|
|
171
|
+
if (fs.statSync(s).isDirectory()) copyDir(s, d);
|
|
172
|
+
else fs.copyFileSync(s, d);
|
|
173
|
+
}
|
|
174
|
+
}
|
package/bootstrap.sh
ADDED
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
#!/usr/bin/env bash
|
|
2
|
+
# COMPASS bootstrap — clones the repo to ~/.compass and runs install.sh.
|
|
3
|
+
#
|
|
4
|
+
# One-liner:
|
|
5
|
+
# curl -fsSL <repo-url>/raw/main/bootstrap.sh | bash
|
|
6
|
+
#
|
|
7
|
+
# This script is idempotent — safe to re-run for updates.
|
|
8
|
+
|
|
9
|
+
set -euo pipefail
|
|
10
|
+
|
|
11
|
+
# Defaults below; override via env vars before running (e.g. COMPASS_BRANCH=dev bash bootstrap.sh)
|
|
12
|
+
COMPASS_REPO="${COMPASS_REPO:-"https://github.com/mrmandovn/compass.git"}"
|
|
13
|
+
COMPASS_BRANCH="${COMPASS_BRANCH:-"main"}"
|
|
14
|
+
COMPASS_DIR="${HOME}/.compass"
|
|
15
|
+
|
|
16
|
+
bold() { printf "\033[1m%s\033[0m" "$*"; }
|
|
17
|
+
green() { printf "\033[32m%s\033[0m" "$*"; }
|
|
18
|
+
yellow() { printf "\033[33m%s\033[0m" "$*"; }
|
|
19
|
+
red() { printf "\033[31m%s\033[0m" "$*"; }
|
|
20
|
+
|
|
21
|
+
echo "$(bold 'COMPASS bootstrap')"
|
|
22
|
+
echo " repo: ${COMPASS_REPO}"
|
|
23
|
+
echo " branch: ${COMPASS_BRANCH}"
|
|
24
|
+
echo " target: ${COMPASS_DIR}"
|
|
25
|
+
echo
|
|
26
|
+
|
|
27
|
+
# Check git
|
|
28
|
+
if ! command -v git >/dev/null 2>&1; then
|
|
29
|
+
echo "$(red 'ERROR'): git is required but not installed."
|
|
30
|
+
exit 1
|
|
31
|
+
fi
|
|
32
|
+
|
|
33
|
+
# Clone or update
|
|
34
|
+
if [[ -d "${COMPASS_DIR}/.git" ]]; then
|
|
35
|
+
echo "Existing install found, updating..."
|
|
36
|
+
|
|
37
|
+
# Defensive: back up user-level state files before git reset --hard.
|
|
38
|
+
# ~/.compass/ doubles as source clone AND user state dir, so
|
|
39
|
+
# projects.json / global-config.json must survive the reset.
|
|
40
|
+
BACKUP_DIR="$(mktemp -d -t compass-bootstrap-XXXXXX)"
|
|
41
|
+
# Clean up the backup dir no matter how the script exits (success, error,
|
|
42
|
+
# SIGINT) — prevents orphaned tmp dirs on abort.
|
|
43
|
+
trap 'rm -rf "${BACKUP_DIR}"' EXIT INT TERM
|
|
44
|
+
[ -f "${HOME}/.compass/projects.json" ] && cp "${HOME}/.compass/projects.json" "${BACKUP_DIR}/projects.json"
|
|
45
|
+
[ -f "${HOME}/.compass/global-config.json" ] && cp "${HOME}/.compass/global-config.json" "${BACKUP_DIR}/global-config.json"
|
|
46
|
+
|
|
47
|
+
git -C "${COMPASS_DIR}" fetch origin "${COMPASS_BRANCH}"
|
|
48
|
+
git -C "${COMPASS_DIR}" reset --hard "origin/${COMPASS_BRANCH}"
|
|
49
|
+
|
|
50
|
+
# Restore user-level state files after reset.
|
|
51
|
+
[ -f "${BACKUP_DIR}/projects.json" ] && cp "${BACKUP_DIR}/projects.json" "${HOME}/.compass/projects.json"
|
|
52
|
+
[ -f "${BACKUP_DIR}/global-config.json" ] && cp "${BACKUP_DIR}/global-config.json" "${HOME}/.compass/global-config.json"
|
|
53
|
+
elif [[ -d "${COMPASS_DIR}" ]]; then
|
|
54
|
+
echo "$(red 'ERROR'): ${COMPASS_DIR} exists but is not a git repo."
|
|
55
|
+
echo " Move it aside or remove it, then re-run bootstrap."
|
|
56
|
+
exit 1
|
|
57
|
+
else
|
|
58
|
+
echo "Cloning..."
|
|
59
|
+
git clone --branch "${COMPASS_BRANCH}" "${COMPASS_REPO}" "${COMPASS_DIR}"
|
|
60
|
+
fi
|
|
61
|
+
|
|
62
|
+
echo
|
|
63
|
+
echo "$(green 'ok') Source ready at ${COMPASS_DIR}"
|
|
64
|
+
echo
|
|
65
|
+
|
|
66
|
+
# Generate file manifest for update tracking
|
|
67
|
+
"${COMPASS_DIR}/core/hooks/manifest-tracker.sh" generate > "${COMPASS_DIR}/.file-manifest.json" 2>/dev/null || true
|
|
68
|
+
|
|
69
|
+
# Auto-migrate project state if we're running inside an existing Compass project.
|
|
70
|
+
# The CWD here is the user's project directory (NOT ${COMPASS_DIR}). If it has
|
|
71
|
+
# .compass/.state/ and the compass-cli binary already exists, run the migration
|
|
72
|
+
# so any schema upgrades land before the installer wires everything up.
|
|
73
|
+
# On fresh installs the binary won't exist yet — install.sh builds it, and the
|
|
74
|
+
# user can re-run migration later via `/compass:migrate`.
|
|
75
|
+
PROJECT_CWD="$(pwd)"
|
|
76
|
+
COMPASS_CLI_BIN="${COMPASS_DIR}/cli/target/release/compass-cli"
|
|
77
|
+
if [[ "${PROJECT_CWD}" != "${COMPASS_DIR}" && -d "${PROJECT_CWD}/.compass/.state" ]]; then
|
|
78
|
+
if [[ -x "${COMPASS_CLI_BIN}" ]]; then
|
|
79
|
+
echo "Migrating project state at ${PROJECT_CWD}..."
|
|
80
|
+
if ! "${COMPASS_CLI_BIN}" migrate "${PROJECT_CWD}"; then
|
|
81
|
+
echo "$(yellow 'warn') compass-cli migrate returned non-zero — continuing bootstrap." >&2
|
|
82
|
+
echo " Re-run manually with: /compass:migrate" >&2
|
|
83
|
+
else
|
|
84
|
+
echo "$(green 'ok') Project state migrated"
|
|
85
|
+
fi
|
|
86
|
+
echo
|
|
87
|
+
else
|
|
88
|
+
echo "$(yellow 'note') Skipping auto-migration — compass-cli not built yet."
|
|
89
|
+
echo " After install completes, run: /compass:migrate"
|
|
90
|
+
echo
|
|
91
|
+
fi
|
|
92
|
+
fi
|
|
93
|
+
|
|
94
|
+
# Run installer
|
|
95
|
+
exec "${COMPASS_DIR}/bin/install"
|
package/cli/Cargo.lock
ADDED
|
@@ -0,0 +1,270 @@
|
|
|
1
|
+
# This file is automatically @generated by Cargo.
|
|
2
|
+
# It is not intended for manual editing.
|
|
3
|
+
version = 4
|
|
4
|
+
|
|
5
|
+
[[package]]
|
|
6
|
+
name = "aho-corasick"
|
|
7
|
+
version = "1.1.4"
|
|
8
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
9
|
+
checksum = "ddd31a130427c27518df266943a5308ed92d4b226cc639f5a8f1002816174301"
|
|
10
|
+
dependencies = [
|
|
11
|
+
"memchr",
|
|
12
|
+
]
|
|
13
|
+
|
|
14
|
+
[[package]]
|
|
15
|
+
name = "block-buffer"
|
|
16
|
+
version = "0.10.4"
|
|
17
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
18
|
+
checksum = "3078c7629b62d3f0439517fa394996acacc5cbc91c5a20d8c658e77abd503a71"
|
|
19
|
+
dependencies = [
|
|
20
|
+
"generic-array",
|
|
21
|
+
]
|
|
22
|
+
|
|
23
|
+
[[package]]
|
|
24
|
+
name = "cfg-if"
|
|
25
|
+
version = "1.0.4"
|
|
26
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
27
|
+
checksum = "9330f8b2ff13f34540b44e946ef35111825727b38d33286ef986142615121801"
|
|
28
|
+
|
|
29
|
+
[[package]]
|
|
30
|
+
name = "compass-cli"
|
|
31
|
+
version = "1.1.2"
|
|
32
|
+
dependencies = [
|
|
33
|
+
"fs2",
|
|
34
|
+
"hex",
|
|
35
|
+
"regex",
|
|
36
|
+
"serde",
|
|
37
|
+
"serde_json",
|
|
38
|
+
"sha2",
|
|
39
|
+
]
|
|
40
|
+
|
|
41
|
+
[[package]]
|
|
42
|
+
name = "cpufeatures"
|
|
43
|
+
version = "0.2.17"
|
|
44
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
45
|
+
checksum = "59ed5838eebb26a2bb2e58f6d5b5316989ae9d08bab10e0e6d103e656d1b0280"
|
|
46
|
+
dependencies = [
|
|
47
|
+
"libc",
|
|
48
|
+
]
|
|
49
|
+
|
|
50
|
+
[[package]]
|
|
51
|
+
name = "crypto-common"
|
|
52
|
+
version = "0.1.7"
|
|
53
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
54
|
+
checksum = "78c8292055d1c1df0cce5d180393dc8cce0abec0a7102adb6c7b1eef6016d60a"
|
|
55
|
+
dependencies = [
|
|
56
|
+
"generic-array",
|
|
57
|
+
"typenum",
|
|
58
|
+
]
|
|
59
|
+
|
|
60
|
+
[[package]]
|
|
61
|
+
name = "digest"
|
|
62
|
+
version = "0.10.7"
|
|
63
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
64
|
+
checksum = "9ed9a281f7bc9b7576e61468ba615a66a5c8cfdff42420a70aa82701a3b1e292"
|
|
65
|
+
dependencies = [
|
|
66
|
+
"block-buffer",
|
|
67
|
+
"crypto-common",
|
|
68
|
+
]
|
|
69
|
+
|
|
70
|
+
[[package]]
|
|
71
|
+
name = "fs2"
|
|
72
|
+
version = "0.4.3"
|
|
73
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
74
|
+
checksum = "9564fc758e15025b46aa6643b1b77d047d1a56a1aea6e01002ac0c7026876213"
|
|
75
|
+
dependencies = [
|
|
76
|
+
"libc",
|
|
77
|
+
"winapi",
|
|
78
|
+
]
|
|
79
|
+
|
|
80
|
+
[[package]]
|
|
81
|
+
name = "generic-array"
|
|
82
|
+
version = "0.14.7"
|
|
83
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
84
|
+
checksum = "85649ca51fd72272d7821adaf274ad91c288277713d9c18820d8499a7ff69e9a"
|
|
85
|
+
dependencies = [
|
|
86
|
+
"typenum",
|
|
87
|
+
"version_check",
|
|
88
|
+
]
|
|
89
|
+
|
|
90
|
+
[[package]]
|
|
91
|
+
name = "hex"
|
|
92
|
+
version = "0.4.3"
|
|
93
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
94
|
+
checksum = "7f24254aa9a54b5c858eaee2f5bccdb46aaf0e486a595ed5fd8f86ba55232a70"
|
|
95
|
+
|
|
96
|
+
[[package]]
|
|
97
|
+
name = "itoa"
|
|
98
|
+
version = "1.0.18"
|
|
99
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
100
|
+
checksum = "8f42a60cbdf9a97f5d2305f08a87dc4e09308d1276d28c869c684d7777685682"
|
|
101
|
+
|
|
102
|
+
[[package]]
|
|
103
|
+
name = "libc"
|
|
104
|
+
version = "0.2.184"
|
|
105
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
106
|
+
checksum = "48f5d2a454e16a5ea0f4ced81bd44e4cfc7bd3a507b61887c99fd3538b28e4af"
|
|
107
|
+
|
|
108
|
+
[[package]]
|
|
109
|
+
name = "memchr"
|
|
110
|
+
version = "2.8.0"
|
|
111
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
112
|
+
checksum = "f8ca58f447f06ed17d5fc4043ce1b10dd205e060fb3ce5b979b8ed8e59ff3f79"
|
|
113
|
+
|
|
114
|
+
[[package]]
|
|
115
|
+
name = "proc-macro2"
|
|
116
|
+
version = "1.0.106"
|
|
117
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
118
|
+
checksum = "8fd00f0bb2e90d81d1044c2b32617f68fcb9fa3bb7640c23e9c748e53fb30934"
|
|
119
|
+
dependencies = [
|
|
120
|
+
"unicode-ident",
|
|
121
|
+
]
|
|
122
|
+
|
|
123
|
+
[[package]]
|
|
124
|
+
name = "quote"
|
|
125
|
+
version = "1.0.45"
|
|
126
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
127
|
+
checksum = "41f2619966050689382d2b44f664f4bc593e129785a36d6ee376ddf37259b924"
|
|
128
|
+
dependencies = [
|
|
129
|
+
"proc-macro2",
|
|
130
|
+
]
|
|
131
|
+
|
|
132
|
+
[[package]]
|
|
133
|
+
name = "regex"
|
|
134
|
+
version = "1.12.3"
|
|
135
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
136
|
+
checksum = "e10754a14b9137dd7b1e3e5b0493cc9171fdd105e0ab477f51b72e7f3ac0e276"
|
|
137
|
+
dependencies = [
|
|
138
|
+
"aho-corasick",
|
|
139
|
+
"memchr",
|
|
140
|
+
"regex-automata",
|
|
141
|
+
"regex-syntax",
|
|
142
|
+
]
|
|
143
|
+
|
|
144
|
+
[[package]]
|
|
145
|
+
name = "regex-automata"
|
|
146
|
+
version = "0.4.14"
|
|
147
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
148
|
+
checksum = "6e1dd4122fc1595e8162618945476892eefca7b88c52820e74af6262213cae8f"
|
|
149
|
+
dependencies = [
|
|
150
|
+
"aho-corasick",
|
|
151
|
+
"memchr",
|
|
152
|
+
"regex-syntax",
|
|
153
|
+
]
|
|
154
|
+
|
|
155
|
+
[[package]]
|
|
156
|
+
name = "regex-syntax"
|
|
157
|
+
version = "0.8.10"
|
|
158
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
159
|
+
checksum = "dc897dd8d9e8bd1ed8cdad82b5966c3e0ecae09fb1907d58efaa013543185d0a"
|
|
160
|
+
|
|
161
|
+
[[package]]
|
|
162
|
+
name = "serde"
|
|
163
|
+
version = "1.0.228"
|
|
164
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
165
|
+
checksum = "9a8e94ea7f378bd32cbbd37198a4a91436180c5bb472411e48b5ec2e2124ae9e"
|
|
166
|
+
dependencies = [
|
|
167
|
+
"serde_core",
|
|
168
|
+
"serde_derive",
|
|
169
|
+
]
|
|
170
|
+
|
|
171
|
+
[[package]]
|
|
172
|
+
name = "serde_core"
|
|
173
|
+
version = "1.0.228"
|
|
174
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
175
|
+
checksum = "41d385c7d4ca58e59fc732af25c3983b67ac852c1a25000afe1175de458b67ad"
|
|
176
|
+
dependencies = [
|
|
177
|
+
"serde_derive",
|
|
178
|
+
]
|
|
179
|
+
|
|
180
|
+
[[package]]
|
|
181
|
+
name = "serde_derive"
|
|
182
|
+
version = "1.0.228"
|
|
183
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
184
|
+
checksum = "d540f220d3187173da220f885ab66608367b6574e925011a9353e4badda91d79"
|
|
185
|
+
dependencies = [
|
|
186
|
+
"proc-macro2",
|
|
187
|
+
"quote",
|
|
188
|
+
"syn",
|
|
189
|
+
]
|
|
190
|
+
|
|
191
|
+
[[package]]
|
|
192
|
+
name = "serde_json"
|
|
193
|
+
version = "1.0.149"
|
|
194
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
195
|
+
checksum = "83fc039473c5595ace860d8c4fafa220ff474b3fc6bfdb4293327f1a37e94d86"
|
|
196
|
+
dependencies = [
|
|
197
|
+
"itoa",
|
|
198
|
+
"memchr",
|
|
199
|
+
"serde",
|
|
200
|
+
"serde_core",
|
|
201
|
+
"zmij",
|
|
202
|
+
]
|
|
203
|
+
|
|
204
|
+
[[package]]
|
|
205
|
+
name = "sha2"
|
|
206
|
+
version = "0.10.9"
|
|
207
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
208
|
+
checksum = "a7507d819769d01a365ab707794a4084392c824f54a7a6a7862f8c3d0892b283"
|
|
209
|
+
dependencies = [
|
|
210
|
+
"cfg-if",
|
|
211
|
+
"cpufeatures",
|
|
212
|
+
"digest",
|
|
213
|
+
]
|
|
214
|
+
|
|
215
|
+
[[package]]
|
|
216
|
+
name = "syn"
|
|
217
|
+
version = "2.0.117"
|
|
218
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
219
|
+
checksum = "e665b8803e7b1d2a727f4023456bbbbe74da67099c585258af0ad9c5013b9b99"
|
|
220
|
+
dependencies = [
|
|
221
|
+
"proc-macro2",
|
|
222
|
+
"quote",
|
|
223
|
+
"unicode-ident",
|
|
224
|
+
]
|
|
225
|
+
|
|
226
|
+
[[package]]
|
|
227
|
+
name = "typenum"
|
|
228
|
+
version = "1.19.0"
|
|
229
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
230
|
+
checksum = "562d481066bde0658276a35467c4af00bdc6ee726305698a55b86e61d7ad82bb"
|
|
231
|
+
|
|
232
|
+
[[package]]
|
|
233
|
+
name = "unicode-ident"
|
|
234
|
+
version = "1.0.24"
|
|
235
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
236
|
+
checksum = "e6e4313cd5fcd3dad5cafa179702e2b244f760991f45397d14d4ebf38247da75"
|
|
237
|
+
|
|
238
|
+
[[package]]
|
|
239
|
+
name = "version_check"
|
|
240
|
+
version = "0.9.5"
|
|
241
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
242
|
+
checksum = "0b928f33d975fc6ad9f86c8f283853ad26bdd5b10b7f1542aa2fa15e2289105a"
|
|
243
|
+
|
|
244
|
+
[[package]]
|
|
245
|
+
name = "winapi"
|
|
246
|
+
version = "0.3.9"
|
|
247
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
248
|
+
checksum = "5c839a674fcd7a98952e593242ea400abe93992746761e38641405d28b00f419"
|
|
249
|
+
dependencies = [
|
|
250
|
+
"winapi-i686-pc-windows-gnu",
|
|
251
|
+
"winapi-x86_64-pc-windows-gnu",
|
|
252
|
+
]
|
|
253
|
+
|
|
254
|
+
[[package]]
|
|
255
|
+
name = "winapi-i686-pc-windows-gnu"
|
|
256
|
+
version = "0.4.0"
|
|
257
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
258
|
+
checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6"
|
|
259
|
+
|
|
260
|
+
[[package]]
|
|
261
|
+
name = "winapi-x86_64-pc-windows-gnu"
|
|
262
|
+
version = "0.4.0"
|
|
263
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
264
|
+
checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f"
|
|
265
|
+
|
|
266
|
+
[[package]]
|
|
267
|
+
name = "zmij"
|
|
268
|
+
version = "1.0.21"
|
|
269
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
270
|
+
checksum = "b8848ee67ecc8aedbaf3e4122217aff892639231befc6a1b58d29fff4c2cabaa"
|
package/cli/Cargo.toml
ADDED
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
[package]
|
|
2
|
+
name = "compass-cli"
|
|
3
|
+
version = "1.1.2"
|
|
4
|
+
edition = "2021"
|
|
5
|
+
description = "CLI for Compass — PO/PM AI Toolkit"
|
|
6
|
+
license = "MIT"
|
|
7
|
+
repository = "https://github.com/mrmandovn/compass"
|
|
8
|
+
|
|
9
|
+
[dependencies]
|
|
10
|
+
serde = { version = "1", features = ["derive"] }
|
|
11
|
+
serde_json = "1"
|
|
12
|
+
sha2 = "0.10"
|
|
13
|
+
hex = "0.4"
|
|
14
|
+
regex = "1"
|
|
15
|
+
fs2 = "0.4"
|
|
16
|
+
|
|
17
|
+
[[bin]]
|
|
18
|
+
name = "compass-cli"
|
|
19
|
+
path = "src/main.rs"
|
|
20
|
+
|
|
21
|
+
[profile.release]
|
|
22
|
+
opt-level = "z"
|
|
23
|
+
lto = true
|
|
24
|
+
strip = true
|