declare-cc 0.3.4 → 0.3.5
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/install.js +17 -0
- package/commands/declare/future.md +3 -3
- package/package.json +1 -1
package/bin/install.js
CHANGED
|
@@ -662,10 +662,12 @@ function copyFlattenedCommands(srcDir, destDir, prefix, pathPrefix, runtime) {
|
|
|
662
662
|
const localClaudeRegex = /\.\/\.claude\//g;
|
|
663
663
|
const opencodeDirRegex = /~\/\.opencode\//g;
|
|
664
664
|
const distToolsRegex = /dist\/declare-tools\.cjs/g;
|
|
665
|
+
const workflowsRegex = /@workflows\//g;
|
|
665
666
|
content = content.replace(globalClaudeRegex, pathPrefix);
|
|
666
667
|
content = content.replace(localClaudeRegex, `./${getDirName(runtime)}/`);
|
|
667
668
|
content = content.replace(opencodeDirRegex, pathPrefix);
|
|
668
669
|
content = content.replace(distToolsRegex, `${pathPrefix}declare-tools.cjs`);
|
|
670
|
+
content = content.replace(workflowsRegex, `@${pathPrefix}workflows/`);
|
|
669
671
|
content = processAttribution(content, getCommitAttribution(runtime));
|
|
670
672
|
content = convertClaudeToOpencodeFrontmatter(content);
|
|
671
673
|
|
|
@@ -706,9 +708,11 @@ function copyWithPathReplacement(srcDir, destDir, pathPrefix, runtime) {
|
|
|
706
708
|
const globalClaudeRegex = /~\/\.claude\//g;
|
|
707
709
|
const localClaudeRegex = /\.\/\.claude\//g;
|
|
708
710
|
const distToolsRegex = /dist\/declare-tools\.cjs/g;
|
|
711
|
+
const workflowsRegex = /@workflows\//g;
|
|
709
712
|
content = content.replace(globalClaudeRegex, pathPrefix);
|
|
710
713
|
content = content.replace(localClaudeRegex, `./${dirName}/`);
|
|
711
714
|
content = content.replace(distToolsRegex, `${pathPrefix}declare-tools.cjs`);
|
|
715
|
+
content = content.replace(workflowsRegex, `@${pathPrefix}workflows/`);
|
|
712
716
|
content = processAttribution(content, getCommitAttribution(runtime));
|
|
713
717
|
|
|
714
718
|
// Convert frontmatter for opencode compatibility
|
|
@@ -1448,6 +1452,19 @@ function install(isGlobal, runtime = 'claude') {
|
|
|
1448
1452
|
}
|
|
1449
1453
|
}
|
|
1450
1454
|
|
|
1455
|
+
// Copy workflows/ so @workflows/ references in commands resolve correctly
|
|
1456
|
+
const workflowsSrc = path.join(src, 'workflows');
|
|
1457
|
+
if (fs.existsSync(workflowsSrc)) {
|
|
1458
|
+
const workflowsDest = path.join(targetDir, 'workflows');
|
|
1459
|
+
fs.mkdirSync(workflowsDest, { recursive: true });
|
|
1460
|
+
for (const entry of fs.readdirSync(workflowsSrc, { withFileTypes: true })) {
|
|
1461
|
+
if (entry.isFile()) {
|
|
1462
|
+
fs.copyFileSync(path.join(workflowsSrc, entry.name), path.join(workflowsDest, entry.name));
|
|
1463
|
+
}
|
|
1464
|
+
}
|
|
1465
|
+
console.log(` ${green}✓${reset} Installed workflows/`);
|
|
1466
|
+
}
|
|
1467
|
+
|
|
1451
1468
|
// Copy declare-tools.cjs bundle so commands can run `node {pathPrefix}declare-tools.cjs`
|
|
1452
1469
|
const bundleSrc = path.join(src, 'dist', 'declare-tools.cjs');
|
|
1453
1470
|
const bundleDest = path.join(targetDir, 'declare-tools.cjs');
|
|
@@ -14,7 +14,7 @@ Guide the user through declaring their project's future as present-tense truth s
|
|
|
14
14
|
**Step 1: Load current graph state.**
|
|
15
15
|
|
|
16
16
|
```bash
|
|
17
|
-
node
|
|
17
|
+
node dist/declare-tools.cjs load-graph
|
|
18
18
|
```
|
|
19
19
|
|
|
20
20
|
Parse the JSON output. If the output contains an `error` field (e.g., "No Declare project found"), tell the user to run `/declare:init` first and stop.
|
|
@@ -30,7 +30,7 @@ Note the existing declarations from the graph (if any) -- the workflow needs thi
|
|
|
30
30
|
|
|
31
31
|
Read and follow the full workflow instructions:
|
|
32
32
|
|
|
33
|
-
|
|
33
|
+
@workflows/future.md
|
|
34
34
|
|
|
35
35
|
Pass the loaded graph state into the workflow so it knows about existing declarations.
|
|
36
36
|
|
|
@@ -39,7 +39,7 @@ Pass the loaded graph state into the workflow so it knows about existing declara
|
|
|
39
39
|
After each declaration passes language detection and NSR validation and the user confirms it, persist it:
|
|
40
40
|
|
|
41
41
|
```bash
|
|
42
|
-
node
|
|
42
|
+
node dist/declare-tools.cjs add-declaration --title "Short Title" --statement "Full present-tense declaration statement"
|
|
43
43
|
```
|
|
44
44
|
|
|
45
45
|
Parse the JSON output to confirm the declaration was created and note its assigned ID (e.g., D-01).
|
package/package.json
CHANGED