cairn-work 0.11.0 β 0.11.1
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/bin/cairn.js +8 -0
- package/lib/commands/learn.js +123 -0
- package/lib/commands/my.js +18 -2
- package/lib/schema/task-schema.js +1 -1
- package/package.json +1 -1
package/bin/cairn.js
CHANGED
|
@@ -40,6 +40,7 @@ import note from '../lib/commands/note.js';
|
|
|
40
40
|
import edit from '../lib/commands/edit.js';
|
|
41
41
|
import search from '../lib/commands/search.js';
|
|
42
42
|
import triage from '../lib/commands/triage.js';
|
|
43
|
+
import learn from '../lib/commands/learn.js';
|
|
43
44
|
|
|
44
45
|
// Onboard command - workspace setup with context files
|
|
45
46
|
program
|
|
@@ -213,6 +214,13 @@ program
|
|
|
213
214
|
.option('--assignee <name>', 'Default assignee for created tasks', 'you')
|
|
214
215
|
.action(triage);
|
|
215
216
|
|
|
217
|
+
// Learn command - show system overview and documentation
|
|
218
|
+
program
|
|
219
|
+
.command('learn')
|
|
220
|
+
.description('Show Cairn system overview and available documentation')
|
|
221
|
+
.option('--verbose', 'Show full documentation paths')
|
|
222
|
+
.action(learn);
|
|
223
|
+
|
|
216
224
|
// Parse and handle errors
|
|
217
225
|
program.parseAsync(process.argv).catch((error) => {
|
|
218
226
|
console.error(chalk.red('Error:'), error.message);
|
|
@@ -0,0 +1,123 @@
|
|
|
1
|
+
import { existsSync, readFileSync, readdirSync } from 'fs';
|
|
2
|
+
import { join, dirname } from 'path';
|
|
3
|
+
import { fileURLToPath } from 'url';
|
|
4
|
+
import chalk from 'chalk';
|
|
5
|
+
import { resolveWorkspace } from '../setup/workspace.js';
|
|
6
|
+
|
|
7
|
+
const __filename = fileURLToPath(import.meta.url);
|
|
8
|
+
const __dirname = dirname(__filename);
|
|
9
|
+
|
|
10
|
+
export default async function learn(options) {
|
|
11
|
+
console.log(chalk.cyan.bold('\nπ Cairn System Overview\n'));
|
|
12
|
+
|
|
13
|
+
// 1. Show workspace location
|
|
14
|
+
const workspacePath = resolveWorkspace();
|
|
15
|
+
if (workspacePath) {
|
|
16
|
+
console.log(chalk.green('β'), 'Workspace:', chalk.cyan(workspacePath));
|
|
17
|
+
} else {
|
|
18
|
+
console.log(chalk.yellow('β '), 'No workspace found. Run:', chalk.cyan('cairn init'));
|
|
19
|
+
}
|
|
20
|
+
console.log();
|
|
21
|
+
|
|
22
|
+
// 2. Project structure
|
|
23
|
+
console.log(chalk.bold('π Project Structure'));
|
|
24
|
+
console.log(chalk.dim(' projects/{slug}/charter.md # Project definition'));
|
|
25
|
+
console.log(chalk.dim(' projects/{slug}/tasks/{slug}.md # Individual tasks'));
|
|
26
|
+
console.log(chalk.dim(' inbox/ # Unprocessed items'));
|
|
27
|
+
console.log(chalk.dim(' artifacts/ # Shared documents'));
|
|
28
|
+
console.log(chalk.dim(' .cairn/ # System files'));
|
|
29
|
+
console.log();
|
|
30
|
+
|
|
31
|
+
// 3. Key concepts
|
|
32
|
+
console.log(chalk.bold('π― Key Concepts'));
|
|
33
|
+
console.log();
|
|
34
|
+
|
|
35
|
+
console.log(chalk.cyan(' Statuses:'));
|
|
36
|
+
console.log(chalk.dim(' pending β not started yet'));
|
|
37
|
+
console.log(chalk.dim(' next-up β ready to work on'));
|
|
38
|
+
console.log(chalk.dim(' in_progress β actively working'));
|
|
39
|
+
console.log(chalk.dim(' blocked β waiting for input'));
|
|
40
|
+
console.log(chalk.dim(' review β awaiting approval'));
|
|
41
|
+
console.log(chalk.dim(' done β completed'));
|
|
42
|
+
console.log();
|
|
43
|
+
|
|
44
|
+
console.log(chalk.cyan(' Autonomy Levels:'));
|
|
45
|
+
console.log(chalk.dim(' propose β log approach only, don\'t do work'));
|
|
46
|
+
console.log(chalk.dim(' draft β do work but need review (code changes)'));
|
|
47
|
+
console.log(chalk.dim(' execute β do everything including irreversible actions'));
|
|
48
|
+
console.log();
|
|
49
|
+
|
|
50
|
+
console.log(chalk.cyan(' Priority & Due Dates:'));
|
|
51
|
+
console.log(chalk.dim(' P1 (urgent) β due today'));
|
|
52
|
+
console.log(chalk.dim(' P2+ (less urgent) β due in 7 days'));
|
|
53
|
+
console.log();
|
|
54
|
+
|
|
55
|
+
// 4. Common workflows
|
|
56
|
+
console.log(chalk.bold('π Common Workflows'));
|
|
57
|
+
console.log();
|
|
58
|
+
|
|
59
|
+
console.log(chalk.cyan(' Starting work:'));
|
|
60
|
+
console.log(chalk.dim(' cairn my # See your tasks'));
|
|
61
|
+
console.log(chalk.dim(' cairn start <task-slug> # Move to in_progress'));
|
|
62
|
+
console.log();
|
|
63
|
+
|
|
64
|
+
console.log(chalk.cyan(' While working:'));
|
|
65
|
+
console.log(chalk.dim(' cairn note <task-slug> "message" # Add quick notes'));
|
|
66
|
+
console.log(chalk.dim(' cairn view <task-slug> # View full details'));
|
|
67
|
+
console.log();
|
|
68
|
+
|
|
69
|
+
console.log(chalk.cyan(' Finishing:'));
|
|
70
|
+
console.log(chalk.dim(' cairn done <task-slug> # Auto moves to done/review'));
|
|
71
|
+
console.log(chalk.dim(' cairn block <task-slug> "reason" # When stuck'));
|
|
72
|
+
console.log();
|
|
73
|
+
|
|
74
|
+
console.log(chalk.cyan(' Creating new work:'));
|
|
75
|
+
console.log(chalk.dim(' cairn create task "Name" --project <slug> \\'));
|
|
76
|
+
console.log(chalk.dim(' --description "..." --objective "..."'));
|
|
77
|
+
console.log();
|
|
78
|
+
|
|
79
|
+
// 5. Available documentation
|
|
80
|
+
if (options.verbose) {
|
|
81
|
+
console.log(chalk.bold('π Available Documentation\n'));
|
|
82
|
+
|
|
83
|
+
// Check for CLI skills
|
|
84
|
+
const cliRoot = join(__dirname, '..', '..');
|
|
85
|
+
const skillsDir = join(cliRoot, 'skills');
|
|
86
|
+
if (existsSync(skillsDir)) {
|
|
87
|
+
console.log(chalk.cyan(' CLI Skills:'));
|
|
88
|
+
const skillFiles = readdirSync(skillsDir).filter(f => f.endsWith('.md'));
|
|
89
|
+
skillFiles.forEach(file => {
|
|
90
|
+
console.log(chalk.dim(` ${join(skillsDir, file)}`));
|
|
91
|
+
});
|
|
92
|
+
console.log();
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
// Check for workspace planning docs
|
|
96
|
+
if (workspacePath) {
|
|
97
|
+
const cairnDir = join(workspacePath, '.cairn');
|
|
98
|
+
if (existsSync(cairnDir)) {
|
|
99
|
+
console.log(chalk.cyan(' Workspace Documentation:'));
|
|
100
|
+
const cairnFiles = readdirSync(cairnDir).filter(f => f.endsWith('.md'));
|
|
101
|
+
cairnFiles.forEach(file => {
|
|
102
|
+
console.log(chalk.dim(` ${join(cairnDir, file)}`));
|
|
103
|
+
});
|
|
104
|
+
console.log();
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
} else {
|
|
108
|
+
console.log(chalk.dim('Run with --verbose to see full documentation paths'));
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
// 6. Quick tips
|
|
112
|
+
console.log(chalk.bold('π‘ Quick Tips'));
|
|
113
|
+
console.log();
|
|
114
|
+
console.log(chalk.dim(' β’ Always use CLI to create entities (never edit YAML manually)'));
|
|
115
|
+
console.log(chalk.dim(' β’ Set status immediately when your state changes'));
|
|
116
|
+
console.log(chalk.dim(' β’ Use next-up for queued work, in_progress for active work'));
|
|
117
|
+
console.log(chalk.dim(' β’ Respect autonomy: draftβreview, executeβdone'));
|
|
118
|
+
console.log(chalk.dim(' β’ Check cairn my regularly to see your workload'));
|
|
119
|
+
console.log();
|
|
120
|
+
|
|
121
|
+
console.log(chalk.dim('For detailed help on any command:'), chalk.cyan('cairn <command> --help'));
|
|
122
|
+
console.log();
|
|
123
|
+
}
|
package/lib/commands/my.js
CHANGED
|
@@ -78,6 +78,7 @@ export default async function my(options) {
|
|
|
78
78
|
|
|
79
79
|
const myTasks = {
|
|
80
80
|
in_progress: [],
|
|
81
|
+
next_up: [],
|
|
81
82
|
pending: [],
|
|
82
83
|
blocked: [],
|
|
83
84
|
review: []
|
|
@@ -105,6 +106,8 @@ export default async function my(options) {
|
|
|
105
106
|
|
|
106
107
|
if (task.status === 'in_progress') {
|
|
107
108
|
myTasks.in_progress.push(taskData);
|
|
109
|
+
} else if (task.status === 'next-up' || task.status === 'next_up') {
|
|
110
|
+
myTasks.next_up.push(taskData);
|
|
108
111
|
} else if (task.status === 'pending') {
|
|
109
112
|
myTasks.pending.push(taskData);
|
|
110
113
|
} else if (task.status === 'blocked') {
|
|
@@ -116,8 +119,8 @@ export default async function my(options) {
|
|
|
116
119
|
}
|
|
117
120
|
}
|
|
118
121
|
|
|
119
|
-
const totalTasks = myTasks.in_progress.length + myTasks.
|
|
120
|
-
myTasks.blocked.length + myTasks.review.length;
|
|
122
|
+
const totalTasks = myTasks.in_progress.length + myTasks.next_up.length +
|
|
123
|
+
myTasks.pending.length + myTasks.blocked.length + myTasks.review.length;
|
|
121
124
|
|
|
122
125
|
if (totalTasks === 0) {
|
|
123
126
|
console.log(chalk.dim(`No tasks assigned to ${myName}`));
|
|
@@ -139,6 +142,19 @@ export default async function my(options) {
|
|
|
139
142
|
console.log();
|
|
140
143
|
}
|
|
141
144
|
|
|
145
|
+
// Show next-up (ready to work on)
|
|
146
|
+
if (myTasks.next_up.length > 0) {
|
|
147
|
+
console.log(chalk.cyan.bold('βοΈ Next Up'));
|
|
148
|
+
for (const task of myTasks.next_up) {
|
|
149
|
+
console.log(chalk.bold(` ${task.slug}`));
|
|
150
|
+
console.log(chalk.dim(` ${task.project}`));
|
|
151
|
+
if (task.description) {
|
|
152
|
+
console.log(` ${task.description}`);
|
|
153
|
+
}
|
|
154
|
+
}
|
|
155
|
+
console.log();
|
|
156
|
+
}
|
|
157
|
+
|
|
142
158
|
// Show blocked next (important)
|
|
143
159
|
if (myTasks.blocked.length > 0) {
|
|
144
160
|
console.log(chalk.red.bold('β οΈ Blocked'));
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
// Task and Project schema definitions
|
|
2
2
|
|
|
3
|
-
export const VALID_STATUSES = ['pending', 'in_progress', 'blocked', 'review', 'done', 'completed'];
|
|
3
|
+
export const VALID_STATUSES = ['pending', 'next-up', 'next_up', 'in_progress', 'blocked', 'review', 'done', 'completed'];
|
|
4
4
|
export const VALID_AUTONOMY_LEVELS = ['propose', 'draft', 'execute'];
|
|
5
5
|
|
|
6
6
|
export const TASK_SCHEMA = {
|