@hanzlaa/rcode 4.1.0 → 4.1.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/cli/index.js CHANGED
@@ -33,6 +33,7 @@ const COMMANDS = {
33
33
  team: require('./team'),
34
34
  agent: require('./agent'),
35
35
  doctor: require('./doctor'),
36
+ workflow: require('./workflow'), // lifecycle bridge for non-Claude runtimes
36
37
  'set-profile': require('./set-profile'),
37
38
  'set-mode': require('./set-mode'),
38
39
  config: require('./config'),
@@ -68,6 +69,21 @@ Usage:
68
69
  context Memory bank freshness (--check | --refresh | --install-hook)
69
70
  github-sync Sync .rcode/ phases/epics/stories to GitHub (dry-run default)
70
71
 
72
+ 🔄 LIFECYCLE (Codex / Copilot / Grok bridge)
73
+ workflow list List all lifecycle workflow names
74
+ workflow show <name> Print a workflow's full instructions to stdout
75
+ workflow show new-project → project setup + ROADMAP
76
+ workflow show create-prd → write / update the PRD
77
+ workflow show discuss-phase → gather phase context
78
+ workflow show plan → create a SPRINT plan
79
+ workflow show execute-sprint → execute a SPRINT
80
+ workflow show verify-phase → verify phase completion
81
+ workflow show retrospective → retrospective + velocity
82
+ workflow show ship → deploy / release workflow
83
+
84
+ Non-Claude agents: pipe to your agent instead of using slash commands.
85
+ Example: rcode workflow show plan | codex run -
86
+
71
87
  👥 TEAM
72
88
  team List the team roster
73
89
  digest Print compact digests for all agents
package/cli/install.js CHANGED
@@ -847,6 +847,7 @@ function ensureRcodeGitignore(target, options = {}) {
847
847
  '.rcode/brain/best-practices/',
848
848
  '',
849
849
  '# Runtime noise',
850
+ 'node_modules/',
850
851
  '.rcode/state.json.lock',
851
852
  '.planning/debug/',
852
853
  '.planning/_backup/',
@@ -0,0 +1,97 @@
1
+ /**
2
+ * rcode workflow [list|show <name>] — lifecycle bridge for non-Claude runtimes.
3
+ *
4
+ * Codex, Copilot, Grok, and other non-Claude agents cannot invoke slash
5
+ * commands directly. This command exposes rcode's lifecycle workflows as
6
+ * readable markdown so any agent can follow the same process:
7
+ *
8
+ * rcode workflow list → list available workflow names
9
+ * rcode workflow show <name> → print workflow markdown to stdout
10
+ * rcode workflow show plan → print the plan workflow
11
+ *
12
+ * An agent consuming `rcode workflow show <name>` should treat the output
13
+ * as its operative instructions for that lifecycle step (the same content
14
+ * Claude Code loads when a slash command fires).
15
+ */
16
+
17
+ const fs = require('fs');
18
+ const path = require('path');
19
+
20
+ // Canonical lifecycle order shown in help output
21
+ const LIFECYCLE_ORDER = [
22
+ 'new-project',
23
+ 'create-prd',
24
+ 'discuss-phase',
25
+ 'plan',
26
+ 'execute-sprint',
27
+ 'verify-phase',
28
+ 'retrospective',
29
+ 'ship',
30
+ ];
31
+
32
+ module.exports = function workflow(args, { packageRoot }) {
33
+ const workflowsDir = path.join(packageRoot, 'rcode', 'workflows');
34
+
35
+ const subcommand = args[0];
36
+
37
+ if (!subcommand || subcommand === 'list' || subcommand === '--list') {
38
+ return listWorkflows(workflowsDir);
39
+ }
40
+
41
+ if (subcommand === 'show' || subcommand === 'get' || subcommand === 'run') {
42
+ const name = args[1];
43
+ if (!name) {
44
+ console.error('Usage: rcode workflow show <name>');
45
+ console.error(' rcode workflow list');
46
+ process.exit(1);
47
+ }
48
+ return showWorkflow(workflowsDir, name);
49
+ }
50
+
51
+ // Treat bare `rcode workflow <name>` as show
52
+ return showWorkflow(workflowsDir, subcommand);
53
+ };
54
+
55
+ function listWorkflows(workflowsDir) {
56
+ const all = fs.readdirSync(workflowsDir)
57
+ .filter(f => f.endsWith('.md'))
58
+ .map(f => f.replace(/\.md$/, ''))
59
+ .sort();
60
+
61
+ // Show lifecycle commands first, then remaining alphabetically
62
+ const lifecycle = LIFECYCLE_ORDER.filter(n => all.includes(n));
63
+ const rest = all.filter(n => !LIFECYCLE_ORDER.includes(n));
64
+
65
+ console.log('🕌 rcode lifecycle workflows\n');
66
+ console.log('Core lifecycle (in order):');
67
+ lifecycle.forEach(n => console.log(` rcode workflow show ${n}`));
68
+ if (rest.length) {
69
+ console.log('\nOther workflows:');
70
+ rest.forEach(n => console.log(` rcode workflow show ${n}`));
71
+ }
72
+ console.log('\nUsage: rcode workflow show <name> — print the full workflow instructions');
73
+ }
74
+
75
+ function showWorkflow(workflowsDir, name) {
76
+ const candidates = [
77
+ path.join(workflowsDir, `${name}.md`),
78
+ path.join(workflowsDir, `rcode-${name}.md`),
79
+ ];
80
+
81
+ for (const p of candidates) {
82
+ if (fs.existsSync(p)) {
83
+ process.stdout.write(fs.readFileSync(p, 'utf8'));
84
+ return;
85
+ }
86
+ }
87
+
88
+ // Not found — list available and exit non-zero
89
+ const available = fs.readdirSync(workflowsDir)
90
+ .filter(f => f.endsWith('.md'))
91
+ .map(f => f.replace(/\.md$/, ''))
92
+ .sort()
93
+ .join(', ');
94
+ console.error(`Error: workflow '${name}' not found.`);
95
+ console.error(`Available: ${available}`);
96
+ process.exit(1);
97
+ }