claudeos-core 2.0.1 → 2.1.0
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/CHANGELOG.md +188 -0
- package/README.de.md +994 -880
- package/README.es.md +993 -880
- package/README.fr.md +993 -880
- package/README.hi.md +993 -880
- package/README.ja.md +993 -880
- package/README.ko.md +159 -47
- package/README.md +159 -46
- package/README.ru.md +993 -880
- package/README.vi.md +161 -48
- package/README.zh-CN.md +992 -880
- package/bin/cli.js +7 -2
- package/bin/commands/init.js +775 -147
- package/bin/commands/memory.js +17 -5
- package/bootstrap.sh +81 -81
- package/lib/expected-outputs.js +6 -7
- package/lib/memory-scaffold.js +84 -46
- package/lib/plan-parser.js +12 -0
- package/manifest-generator/index.js +16 -18
- package/package.json +1 -1
- package/pass-prompts/templates/angular/pass3.md +2 -10
- package/pass-prompts/templates/common/pass3-phase1.md +131 -0
- package/pass-prompts/templates/common/pass3a-facts.md +143 -0
- package/pass-prompts/templates/common/pass3b-core-header.md +58 -0
- package/pass-prompts/templates/common/pass3c-skills-guide-header.md +53 -0
- package/pass-prompts/templates/common/pass3d-plan-aux-header.md +57 -0
- package/pass-prompts/templates/common/pass4.md +4 -19
- package/pass-prompts/templates/java-spring/pass3.md +5 -15
- package/pass-prompts/templates/kotlin-spring/pass3.md +5 -15
- package/pass-prompts/templates/node-express/pass3.md +5 -14
- package/pass-prompts/templates/node-fastify/pass3.md +2 -10
- package/pass-prompts/templates/node-nestjs/pass3.md +5 -13
- package/pass-prompts/templates/node-nextjs/pass3.md +5 -14
- package/pass-prompts/templates/node-vite/pass3.md +95 -103
- package/pass-prompts/templates/python-django/pass3.md +5 -14
- package/pass-prompts/templates/python-fastapi/pass3.md +5 -14
- package/pass-prompts/templates/python-flask/pass3.md +95 -103
- package/pass-prompts/templates/vue-nuxt/pass3.md +2 -10
- package/plan-installer/pass3-context-builder.js +258 -0
- package/plan-installer/prompt-generator.js +9 -1
- package/plan-validator/index.js +23 -8
- package/sync-checker/index.js +44 -0
package/bin/commands/memory.js
CHANGED
|
@@ -177,10 +177,16 @@ function compactFile(filePath, activeRulePaths) {
|
|
|
177
177
|
const metaLines = e.body.filter(l =>
|
|
178
178
|
/^\s*-\s*\*{0,2}\s*(frequency|last\s*seen|importance)\s*\*{0,2}\s*[:=]/i.test(l)
|
|
179
179
|
);
|
|
180
|
-
const fixLine = e.body.find(l => FIX_LINE_RE.test(l)) || "(fix omitted)";
|
|
180
|
+
const fixLine = e.body.find(l => FIX_LINE_RE.test(l)) || "- (fix omitted)";
|
|
181
|
+
// Summary marker formatted as a proper markdown list item so that:
|
|
182
|
+
// 1. parseEntries can re-read it as a body line in future compactions
|
|
183
|
+
// 2. GitHub/IDE markdown renderers format it consistently with the
|
|
184
|
+
// surrounding list (previously an inline italic string broke the
|
|
185
|
+
// list flow visually).
|
|
186
|
+
const summaryLine = `- _Summarized on ${new Date().toISOString().slice(0, 10)} — original body dropped._`;
|
|
181
187
|
e.body = [
|
|
182
188
|
...metaLines,
|
|
183
|
-
|
|
189
|
+
summaryLine,
|
|
184
190
|
fixLine,
|
|
185
191
|
];
|
|
186
192
|
}
|
|
@@ -287,10 +293,16 @@ function cmdScore() {
|
|
|
287
293
|
const ageDays = daysSince(e.meta.lastSeen);
|
|
288
294
|
const recency = ageDays === Infinity ? 0 : Math.max(0, 1 - ageDays / 90);
|
|
289
295
|
const importance = Math.min(10, Math.round((freq * 1.5) + (recency * 5)));
|
|
290
|
-
const newHeading = e.body.findIndex(l => /^-\s*\*\*importance/i.test(l));
|
|
291
296
|
const line = `- **importance**: ${importance} _(auto-scored ${new Date().toISOString().slice(0, 10)}, freq=${freq}, recency=${recency.toFixed(2)})_`;
|
|
292
|
-
|
|
293
|
-
|
|
297
|
+
|
|
298
|
+
// Remove ALL existing importance lines (both the bold auto-scored variant
|
|
299
|
+
// and the plain `- importance: N` variant). Without this, the first score
|
|
300
|
+
// run leaves two importance lines — the auto-scored one at the top and
|
|
301
|
+
// the original user-written one below it — which is confusing and makes
|
|
302
|
+
// the file look like it has conflicting values.
|
|
303
|
+
const IMPORTANCE_LINE_RE = /^\s*-\s*\*{0,2}\s*importance\s*\*{0,2}\s*[:=]/i;
|
|
304
|
+
e.body = e.body.filter(l => !IMPORTANCE_LINE_RE.test(l));
|
|
305
|
+
e.body.unshift(line);
|
|
294
306
|
e.meta.importance = importance;
|
|
295
307
|
scored++;
|
|
296
308
|
}
|
package/bootstrap.sh
CHANGED
|
@@ -1,81 +1,81 @@
|
|
|
1
|
-
#!/bin/bash
|
|
2
|
-
|
|
3
|
-
# ClaudeOS-Core — Bootstrap
|
|
4
|
-
#
|
|
5
|
-
# Thin wrapper that forwards to `node bin/cli.js init`.
|
|
6
|
-
#
|
|
7
|
-
# The full init pipeline (plan-installer, Pass 1 multi-group, Pass 2 merge,
|
|
8
|
-
# Pass 3 file generation, Pass 4 memory scaffolding, verification) is
|
|
9
|
-
# implemented in bin/commands/init.js — this script just ensures Node.js
|
|
10
|
-
# is available, installs npm dependencies on first run, and delegates.
|
|
11
|
-
#
|
|
12
|
-
# Why delegation instead of reimplementing the pipeline in bash:
|
|
13
|
-
# - init.js supports features this script does not (and cannot reasonably
|
|
14
|
-
# reimplement): --lang (10 languages), --resume (interrupted init
|
|
15
|
-
# recovery), Pass 4 memory scaffolding with translated fallback,
|
|
16
|
-
# progress bar with ETA, stale-marker detection, clear error messages.
|
|
17
|
-
# - A single source of truth (init.js) prevents the two code paths from
|
|
18
|
-
# drifting, which was the cause of bug #21's cousin: bootstrap.sh was
|
|
19
|
-
# still advertising "3-Pass" while the CLI had moved to 4-Pass with
|
|
20
|
-
# persistent memory scaffolding.
|
|
21
|
-
#
|
|
22
|
-
# Prerequisites:
|
|
23
|
-
# - bash (this script), node (v18+), claude CLI (for the init pipeline)
|
|
24
|
-
#
|
|
25
|
-
# Usage:
|
|
26
|
-
# bash claudeos-core-tools/bootstrap.sh # interactive lang pick
|
|
27
|
-
# bash claudeos-core-tools/bootstrap.sh --lang ko # Korean
|
|
28
|
-
# bash claudeos-core-tools/bootstrap.sh --lang en --force # fresh English init
|
|
29
|
-
#
|
|
30
|
-
# Cross-platform alternative (recommended):
|
|
31
|
-
# npx claudeos-core init
|
|
32
|
-
# node claudeos-core-tools/bin/cli.js init
|
|
33
|
-
|
|
34
|
-
if [ -z "$BASH_VERSION" ]; then
|
|
35
|
-
echo "❌ This script requires bash. Run with: bash $0" >&2
|
|
36
|
-
exit 1
|
|
37
|
-
fi
|
|
38
|
-
|
|
39
|
-
set -e
|
|
40
|
-
|
|
41
|
-
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
|
42
|
-
PROJECT_ROOT="$(cd "$SCRIPT_DIR/.." && pwd)"
|
|
43
|
-
TOOLS_DIR="$SCRIPT_DIR"
|
|
44
|
-
|
|
45
|
-
cd "$PROJECT_ROOT"
|
|
46
|
-
|
|
47
|
-
# ─── Prerequisites check ──────────────────────────────────────
|
|
48
|
-
if ! command -v node >/dev/null 2>&1; then
|
|
49
|
-
echo "❌ node is required but not found in PATH. Install Node.js 18+ and re-run." >&2
|
|
50
|
-
exit 1
|
|
51
|
-
fi
|
|
52
|
-
|
|
53
|
-
NODE_MAJOR="$(node -p 'process.versions.node.split(".")[0]' 2>/dev/null || echo 0)"
|
|
54
|
-
if [ "$NODE_MAJOR" -lt 18 ]; then
|
|
55
|
-
echo "❌ Node.js 18+ required (found v$(node -v 2>/dev/null))." >&2
|
|
56
|
-
exit 1
|
|
57
|
-
fi
|
|
58
|
-
|
|
59
|
-
if ! command -v claude >/dev/null 2>&1; then
|
|
60
|
-
echo "⚠️ \`claude\` CLI not found in PATH. The init pipeline requires it." >&2
|
|
61
|
-
echo " Install & sign in: https://docs.claude.com/en/docs/claude-code/overview" >&2
|
|
62
|
-
# Don't exit — let init.js surface the exact point of failure with context.
|
|
63
|
-
fi
|
|
64
|
-
|
|
65
|
-
# ─── [1/2] Ensure npm dependencies ────────────────────────────
|
|
66
|
-
# init.js requires glob + gray-matter. If node_modules is missing (first
|
|
67
|
-
# bootstrap run for a freshly-cloned tools directory), install them.
|
|
68
|
-
if [ ! -d "$TOOLS_DIR/node_modules" ]; then
|
|
69
|
-
echo "[1/2] Installing dependencies (first bootstrap run)..."
|
|
70
|
-
(cd "$TOOLS_DIR" && npm install --silent --no-audit --no-fund) || {
|
|
71
|
-
echo "❌ npm install failed. Check network / npm registry access." >&2
|
|
72
|
-
exit 1
|
|
73
|
-
}
|
|
74
|
-
echo " ✅ Dependencies installed"
|
|
75
|
-
echo
|
|
76
|
-
fi
|
|
77
|
-
|
|
78
|
-
# ─── [2/2] Delegate to the CLI ────────────────────────────────
|
|
79
|
-
echo "[2/2] Running ClaudeOS-Core init..."
|
|
80
|
-
echo
|
|
81
|
-
exec node "$TOOLS_DIR/bin/cli.js" init "$@"
|
|
1
|
+
#!/bin/bash
|
|
2
|
+
|
|
3
|
+
# ClaudeOS-Core — Bootstrap
|
|
4
|
+
#
|
|
5
|
+
# Thin wrapper that forwards to `node bin/cli.js init`.
|
|
6
|
+
#
|
|
7
|
+
# The full init pipeline (plan-installer, Pass 1 multi-group, Pass 2 merge,
|
|
8
|
+
# Pass 3 file generation, Pass 4 memory scaffolding, verification) is
|
|
9
|
+
# implemented in bin/commands/init.js — this script just ensures Node.js
|
|
10
|
+
# is available, installs npm dependencies on first run, and delegates.
|
|
11
|
+
#
|
|
12
|
+
# Why delegation instead of reimplementing the pipeline in bash:
|
|
13
|
+
# - init.js supports features this script does not (and cannot reasonably
|
|
14
|
+
# reimplement): --lang (10 languages), --resume (interrupted init
|
|
15
|
+
# recovery), Pass 4 memory scaffolding with translated fallback,
|
|
16
|
+
# progress bar with ETA, stale-marker detection, clear error messages.
|
|
17
|
+
# - A single source of truth (init.js) prevents the two code paths from
|
|
18
|
+
# drifting, which was the cause of bug #21's cousin: bootstrap.sh was
|
|
19
|
+
# still advertising "3-Pass" while the CLI had moved to 4-Pass with
|
|
20
|
+
# persistent memory scaffolding.
|
|
21
|
+
#
|
|
22
|
+
# Prerequisites:
|
|
23
|
+
# - bash (this script), node (v18+), claude CLI (for the init pipeline)
|
|
24
|
+
#
|
|
25
|
+
# Usage:
|
|
26
|
+
# bash claudeos-core-tools/bootstrap.sh # interactive lang pick
|
|
27
|
+
# bash claudeos-core-tools/bootstrap.sh --lang ko # Korean
|
|
28
|
+
# bash claudeos-core-tools/bootstrap.sh --lang en --force # fresh English init
|
|
29
|
+
#
|
|
30
|
+
# Cross-platform alternative (recommended):
|
|
31
|
+
# npx claudeos-core init
|
|
32
|
+
# node claudeos-core-tools/bin/cli.js init
|
|
33
|
+
|
|
34
|
+
if [ -z "$BASH_VERSION" ]; then
|
|
35
|
+
echo "❌ This script requires bash. Run with: bash $0" >&2
|
|
36
|
+
exit 1
|
|
37
|
+
fi
|
|
38
|
+
|
|
39
|
+
set -e
|
|
40
|
+
|
|
41
|
+
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
|
42
|
+
PROJECT_ROOT="$(cd "$SCRIPT_DIR/.." && pwd)"
|
|
43
|
+
TOOLS_DIR="$SCRIPT_DIR"
|
|
44
|
+
|
|
45
|
+
cd "$PROJECT_ROOT"
|
|
46
|
+
|
|
47
|
+
# ─── Prerequisites check ──────────────────────────────────────
|
|
48
|
+
if ! command -v node >/dev/null 2>&1; then
|
|
49
|
+
echo "❌ node is required but not found in PATH. Install Node.js 18+ and re-run." >&2
|
|
50
|
+
exit 1
|
|
51
|
+
fi
|
|
52
|
+
|
|
53
|
+
NODE_MAJOR="$(node -p 'process.versions.node.split(".")[0]' 2>/dev/null || echo 0)"
|
|
54
|
+
if [ "$NODE_MAJOR" -lt 18 ]; then
|
|
55
|
+
echo "❌ Node.js 18+ required (found v$(node -v 2>/dev/null))." >&2
|
|
56
|
+
exit 1
|
|
57
|
+
fi
|
|
58
|
+
|
|
59
|
+
if ! command -v claude >/dev/null 2>&1; then
|
|
60
|
+
echo "⚠️ \`claude\` CLI not found in PATH. The init pipeline requires it." >&2
|
|
61
|
+
echo " Install & sign in: https://docs.claude.com/en/docs/claude-code/overview" >&2
|
|
62
|
+
# Don't exit — let init.js surface the exact point of failure with context.
|
|
63
|
+
fi
|
|
64
|
+
|
|
65
|
+
# ─── [1/2] Ensure npm dependencies ────────────────────────────
|
|
66
|
+
# init.js requires glob + gray-matter. If node_modules is missing (first
|
|
67
|
+
# bootstrap run for a freshly-cloned tools directory), install them.
|
|
68
|
+
if [ ! -d "$TOOLS_DIR/node_modules" ]; then
|
|
69
|
+
echo "[1/2] Installing dependencies (first bootstrap run)..."
|
|
70
|
+
(cd "$TOOLS_DIR" && npm install --silent --no-audit --no-fund) || {
|
|
71
|
+
echo "❌ npm install failed. Check network / npm registry access." >&2
|
|
72
|
+
exit 1
|
|
73
|
+
}
|
|
74
|
+
echo " ✅ Dependencies installed"
|
|
75
|
+
echo
|
|
76
|
+
fi
|
|
77
|
+
|
|
78
|
+
# ─── [2/2] Delegate to the CLI ────────────────────────────────
|
|
79
|
+
echo "[2/2] Running ClaudeOS-Core init..."
|
|
80
|
+
echo
|
|
81
|
+
exec node "$TOOLS_DIR/bin/cli.js" init "$@"
|
package/lib/expected-outputs.js
CHANGED
|
@@ -28,13 +28,12 @@ const EXPECTED_OUTPUTS = [
|
|
|
28
28
|
kind: "dir-has-nonempty-md",
|
|
29
29
|
relPath: "claudeos-core/skills",
|
|
30
30
|
},
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
},
|
|
31
|
+
// Note: claudeos-core/plan/ check was removed in this version because
|
|
32
|
+
// master plan files (10.standard-master.md, 20.rules-master.md, etc.) are
|
|
33
|
+
// no longer generated. Master plans were an internal tool backup not
|
|
34
|
+
// consumed by Claude Code at runtime, and aggregating many files in a
|
|
35
|
+
// single session caused "Prompt is too long" failures on mid-sized
|
|
36
|
+
// projects (confirmed on an 18-domain production run).
|
|
38
37
|
];
|
|
39
38
|
|
|
40
39
|
function readSafe(p) {
|
package/lib/memory-scaffold.js
CHANGED
|
@@ -478,7 +478,7 @@ This project uses the CLAUDE.md → rules → standard 3-layer architecture, plu
|
|
|
478
478
|
|
|
479
479
|
- **Before writing new code, read 2-3 neighboring files in the same directory for existing patterns** — naming conventions, error handling, logging style, import order, return type idioms, test structure. Match what you find rather than introducing new patterns. Greenfield/textbook idioms come second to in-codebase consistency.
|
|
480
480
|
- **Do not guess framework class/type/component shapes — check actual source code.** Backend: base classes, DTOs, entity field naming, repository method signatures. Frontend: component prop interfaces, store/state shapes (Pinia/Redux/Zustand), API response types, route param types, CSS module class names.
|
|
481
|
-
- **When modifying skills/standard/rules/memory documents,
|
|
481
|
+
- **When modifying skills/standard/rules/memory documents, keep related files in sync.** If a standard changes, update its rule file; if a skill changes, update \`MANIFEST.md\`. If CLAUDE.md summary sections cover the same topic, update them together.
|
|
482
482
|
`,
|
|
483
483
|
};
|
|
484
484
|
|
|
@@ -650,12 +650,6 @@ Detailed rules: \`.claude/rules/60.memory/\` (4 rules).
|
|
|
650
650
|
| \`compaction.md\` | 4-stage compaction policy reference | Read-only (edit only to change policy) |
|
|
651
651
|
| \`auto-rule-update.md\` | Rule improvement proposals (freq >= 3) | Review proposals; accept -> edit rule + record in decision-log |
|
|
652
652
|
|
|
653
|
-
### Master plan
|
|
654
|
-
|
|
655
|
-
| File | Purpose |
|
|
656
|
-
|---|---|
|
|
657
|
-
| \`claudeos-core/plan/50.memory-master.md\` | Aggregates all 4 memory files for sync management |
|
|
658
|
-
|
|
659
653
|
### Memory workflow
|
|
660
654
|
|
|
661
655
|
1. Scan \`memory/failure-patterns.md\` at session start -> avoid known pitfalls
|
|
@@ -739,38 +733,22 @@ function appendClaudeMdL4Memory(claudeMdPath, { lang = "en" } = {}) {
|
|
|
739
733
|
}
|
|
740
734
|
|
|
741
735
|
/**
|
|
742
|
-
* Scaffold master plan file for L4 Memory
|
|
743
|
-
*
|
|
744
|
-
*
|
|
745
|
-
*
|
|
746
|
-
*
|
|
747
|
-
*
|
|
736
|
+
* Scaffold master plan file for L4 Memory.
|
|
737
|
+
*
|
|
738
|
+
* DEPRECATED: master plan generation was removed from claudeos-core because
|
|
739
|
+
* master plans are internal tool backup files that are not consumed by Claude
|
|
740
|
+
* Code at runtime, and generating them required aggregating many files in a
|
|
741
|
+
* single session (which could trigger "Prompt is too long" on mid-sized
|
|
742
|
+
* projects). This function is now a no-op that returns an empty result list.
|
|
743
|
+
* Kept as an export for backward compatibility with existing callers.
|
|
744
|
+
*
|
|
745
|
+
* @param {string} planDir - path to claudeos-core/plan/ (unused)
|
|
746
|
+
* @param {string} memoryDir - path to claudeos-core/memory/ (unused)
|
|
747
|
+
* @param {object} [opts] (unused)
|
|
748
|
+
* @returns {Array} always empty (no-op)
|
|
748
749
|
*/
|
|
749
|
-
function scaffoldMasterPlans(
|
|
750
|
-
|
|
751
|
-
const cacheFile = cachePathFor(planDir, lang);
|
|
752
|
-
const results = [];
|
|
753
|
-
|
|
754
|
-
// 50.memory-master.md
|
|
755
|
-
const memoryMaster = path.join(planDir, "50.memory-master.md");
|
|
756
|
-
if (!overwrite && existsSafe(memoryMaster)) {
|
|
757
|
-
results.push({ file: "50.memory-master.md", status: "skipped" });
|
|
758
|
-
} else {
|
|
759
|
-
// Translate only the header text — the <file> blocks wrap actual memory
|
|
760
|
-
// file contents which may already be translated (or will be by scaffoldMemory).
|
|
761
|
-
const headerEn = "# 50. Memory Master Plan\n\nThis plan tracks `claudeos-core/memory/*.md` files.\n\n";
|
|
762
|
-
const header = translateIfNeeded(headerEn, lang, "MASTER_PLAN_32_HEADER", cacheFile);
|
|
763
|
-
let body = header;
|
|
764
|
-
for (const name of Object.keys(MEMORY_FILES)) {
|
|
765
|
-
const filePath = path.join(memoryDir, name);
|
|
766
|
-
const content = existsSafe(filePath) ? readFileSafe(filePath) : MEMORY_FILES[name];
|
|
767
|
-
body += `<file path="claudeos-core/memory/${name}">\n${content.trimEnd()}\n</file>\n\n`;
|
|
768
|
-
}
|
|
769
|
-
const ok = writeFileSafe(memoryMaster, body);
|
|
770
|
-
results.push({ file: "50.memory-master.md", status: ok ? "written" : "error" });
|
|
771
|
-
}
|
|
772
|
-
|
|
773
|
-
return results;
|
|
750
|
+
function scaffoldMasterPlans(_planDir, _memoryDir, _opts = {}) {
|
|
751
|
+
return [];
|
|
774
752
|
}
|
|
775
753
|
|
|
776
754
|
// ─── Standard doc-writing-guide (English static fallback) ───
|
|
@@ -790,14 +768,12 @@ const STANDARD_DOC_WRITING_GUIDE = `# Standard / Rules / Skills Document Writing
|
|
|
790
768
|
| Standard | \`claudeos-core/standard/\` | Detailed guide | Manually Read via Rules \`## Reference\` links |
|
|
791
769
|
| Skills | \`claudeos-core/skills/\` | Scaffolding automation | Registered in MANIFEST.md |
|
|
792
770
|
| Memory | \`claudeos-core/memory/\` | Persistent team knowledge | On-demand Read only |
|
|
793
|
-
| Master Plan | \`claudeos-core/plan/\` | Backup / sync tracking | Not read during coding, used for document sync |
|
|
794
771
|
|
|
795
772
|
### Layer relationships
|
|
796
773
|
|
|
797
774
|
\`\`\`
|
|
798
775
|
CLAUDE.md (overview) → Rules (enforcement) → Standard (detailed)
|
|
799
|
-
|
|
800
|
-
Master Plan ←─────────────┘
|
|
776
|
+
↑ Reference link
|
|
801
777
|
\`\`\`
|
|
802
778
|
|
|
803
779
|
- **CLAUDE.md ↔ Rules ↔ Standard content overlap is NOT duplication.** Each layer has a different role and density.
|
|
@@ -957,12 +933,12 @@ After modifying documents, always synchronize related files:
|
|
|
957
933
|
|
|
958
934
|
| Changed | Sync target |
|
|
959
935
|
|---------|-------------|
|
|
960
|
-
| Standard modified | Corresponding Rules file
|
|
961
|
-
| Rules modified |
|
|
962
|
-
| Skills modified | MANIFEST.md
|
|
963
|
-
| Document added | \`00.standard-reference.md\` list
|
|
936
|
+
| Standard modified | Corresponding Rules file |
|
|
937
|
+
| Rules modified | Corresponding Standard (\`## Reference\` link still valid?) |
|
|
938
|
+
| Skills modified | \`MANIFEST.md\` |
|
|
939
|
+
| Document added | \`00.standard-reference.md\` list |
|
|
964
940
|
|
|
965
|
-
After changes, directly verify related files (Rules ↔ Standard
|
|
941
|
+
After changes, directly verify related files (Rules ↔ Standard) and update consistently.
|
|
966
942
|
`;
|
|
967
943
|
|
|
968
944
|
/**
|
|
@@ -1000,15 +976,77 @@ function scaffoldDocWritingGuide(standardCoreDir, { overwrite = false, lang = "e
|
|
|
1000
976
|
return { file: path.basename(target), status: ok ? "written" : "error" };
|
|
1001
977
|
}
|
|
1002
978
|
|
|
979
|
+
// ─── Skills MANIFEST stub (English static fallback) ────────
|
|
980
|
+
// Pass 3c is expected to generate claudeos-core/skills/00.shared/MANIFEST.md,
|
|
981
|
+
// but the stack pass3.md templates list it among generation targets without
|
|
982
|
+
// marking it REQUIRED. On frontend-only or skill-sparse projects Claude may
|
|
983
|
+
// omit it, leaving .claude/rules/50.sync/03.skills-sync.md (which names
|
|
984
|
+
// MANIFEST.md as the single source of truth for skill registration) pointing
|
|
985
|
+
// at a non-existent file. This gap-fill creates a minimal stub in Pass 4 if
|
|
986
|
+
// the file is missing after Pass 3 completes — same contract as
|
|
987
|
+
// scaffoldDocWritingGuide (skip if exists, write English or translated stub).
|
|
988
|
+
const SKILLS_MANIFEST_STUB = `# Skill Registry
|
|
989
|
+
|
|
990
|
+
_Single source of truth for registered skills in this project._
|
|
991
|
+
_Referenced by: \`.claude/rules/50.sync/03.skills-sync.md\`_
|
|
992
|
+
|
|
993
|
+
## How to register a skill
|
|
994
|
+
|
|
995
|
+
When adding a new skill under \`claudeos-core/skills/\`, append an entry below
|
|
996
|
+
with its path, purpose, and the orchestrator file that invokes it.
|
|
997
|
+
|
|
998
|
+
## Registered skills
|
|
999
|
+
|
|
1000
|
+
| Skill | Orchestrator | Purpose |
|
|
1001
|
+
|-------|-------------|---------|
|
|
1002
|
+
| _(none registered yet)_ | — | — |
|
|
1003
|
+
|
|
1004
|
+
## Sync contract
|
|
1005
|
+
|
|
1006
|
+
- When a skill file is added/renamed/deleted under \`claudeos-core/skills/\`,
|
|
1007
|
+
update this manifest in the same commit.
|
|
1008
|
+
- When this manifest is modified, \`.claude/rules/50.sync/03.skills-sync.md\`
|
|
1009
|
+
is NOT modified — it references this file by path, not by content.
|
|
1010
|
+
`;
|
|
1011
|
+
|
|
1012
|
+
/**
|
|
1013
|
+
* Create claudeos-core/skills/00.shared/MANIFEST.md if absent.
|
|
1014
|
+
* Skip-safe: returns { status: "skipped" } when the file already exists with
|
|
1015
|
+
* any non-trivial content.
|
|
1016
|
+
*
|
|
1017
|
+
* @param {string} skillsSharedDir - absolute path to .../claudeos-core/skills/00.shared
|
|
1018
|
+
* @param {object} [opts]
|
|
1019
|
+
* @param {boolean} [opts.overwrite=false]
|
|
1020
|
+
* @param {string} [opts.lang="en"]
|
|
1021
|
+
* @returns {{ file: string, status: string }}
|
|
1022
|
+
*/
|
|
1023
|
+
function scaffoldSkillsManifest(skillsSharedDir, { overwrite = false, lang = "en" } = {}) {
|
|
1024
|
+
ensureDir(skillsSharedDir);
|
|
1025
|
+
const target = path.join(skillsSharedDir, "MANIFEST.md");
|
|
1026
|
+
if (existsSafe(target) && !overwrite) {
|
|
1027
|
+
// Guard against Pass 3c producing an empty MANIFEST.md — only skip if it
|
|
1028
|
+
// has real content (> 20 chars, trimming BOM/whitespace).
|
|
1029
|
+
const current = readFileSafe(target, "");
|
|
1030
|
+
const stripped = current.replace(/^\uFEFF/, "").trim();
|
|
1031
|
+
if (stripped.length > 20) return { file: "MANIFEST.md", status: "skipped" };
|
|
1032
|
+
}
|
|
1033
|
+
const cacheFile = cachePathFor(skillsSharedDir, lang);
|
|
1034
|
+
const content = translateIfNeeded(SKILLS_MANIFEST_STUB, lang, "SKILLS_MANIFEST_STUB", cacheFile);
|
|
1035
|
+
const ok = writeFileSafe(target, content);
|
|
1036
|
+
return { file: "MANIFEST.md", status: ok ? "written" : "error" };
|
|
1037
|
+
}
|
|
1038
|
+
|
|
1003
1039
|
module.exports = {
|
|
1004
1040
|
MEMORY_FILES,
|
|
1005
1041
|
RULE_FILES_00,
|
|
1006
1042
|
RULE_FILES_60,
|
|
1007
1043
|
CLAUDE_MD_APPEND,
|
|
1008
1044
|
STANDARD_DOC_WRITING_GUIDE,
|
|
1045
|
+
SKILLS_MANIFEST_STUB,
|
|
1009
1046
|
scaffoldMemory,
|
|
1010
1047
|
scaffoldRules,
|
|
1011
1048
|
appendClaudeMdL4Memory,
|
|
1012
1049
|
scaffoldMasterPlans,
|
|
1013
1050
|
scaffoldDocWritingGuide,
|
|
1051
|
+
scaffoldSkillsManifest,
|
|
1014
1052
|
};
|
package/lib/plan-parser.js
CHANGED
|
@@ -20,16 +20,28 @@
|
|
|
20
20
|
*/
|
|
21
21
|
function parseFileBlocks(content, { includeContent = false } = {}) {
|
|
22
22
|
const result = [];
|
|
23
|
+
// Filter out placeholder paths that can appear in prose/documentation inside
|
|
24
|
+
// the plan file (e.g., a sentence like: use <file path="..."> to wrap files).
|
|
25
|
+
// Real paths are any non-empty string; only the literal ellipsis placeholders
|
|
26
|
+
// and angle-bracket templates are rejected.
|
|
27
|
+
const isRealPath = (p) =>
|
|
28
|
+
typeof p === "string" &&
|
|
29
|
+
p.length > 0 &&
|
|
30
|
+
p !== "..." &&
|
|
31
|
+
!p.startsWith("...") &&
|
|
32
|
+
!/^<[^>]+>$/.test(p);
|
|
23
33
|
if (includeContent) {
|
|
24
34
|
const re = /<file\s+path="([^"]+)">\s*\n([\s\S]*?)\n<\/file>/g;
|
|
25
35
|
let m;
|
|
26
36
|
while ((m = re.exec(content)) !== null) {
|
|
37
|
+
if (!isRealPath(m[1])) continue;
|
|
27
38
|
result.push({ path: m[1], content: m[2] });
|
|
28
39
|
}
|
|
29
40
|
} else {
|
|
30
41
|
const re = /<file\s+path="([^"]+)">/g;
|
|
31
42
|
let m;
|
|
32
43
|
while ((m = re.exec(content)) !== null) {
|
|
44
|
+
if (!isRealPath(m[1])) continue;
|
|
33
45
|
result.push({ path: m[1] });
|
|
34
46
|
}
|
|
35
47
|
}
|
|
@@ -6,10 +6,13 @@
|
|
|
6
6
|
* Role: Generate metadata JSON + initialize stale-report
|
|
7
7
|
* Output (claudeos-core/generated/):
|
|
8
8
|
* - rule-manifest.json : rules/standard/skills/guide file list + frontmatter
|
|
9
|
-
* - sync-map.json : plan/ <file> block → file path mapping
|
|
10
|
-
*
|
|
9
|
+
* - sync-map.json : plan/ <file> block → file path mapping (empty since
|
|
10
|
+
* master plan generation was removed in v2.1.0;
|
|
11
|
+
* kept for sync-checker backward compatibility)
|
|
11
12
|
* - stale-report.json : initialized (each verification tool appends results)
|
|
12
13
|
*
|
|
14
|
+
* v2.1.0 removed plan-manifest.json generation (master plan aggregation gone).
|
|
15
|
+
*
|
|
13
16
|
* Usage: npx claudeos-core <cmd> or node claudeos-core-tools/manifest-generator/index.js
|
|
14
17
|
*/
|
|
15
18
|
|
|
@@ -131,6 +134,10 @@ async function main() {
|
|
|
131
134
|
// import-graph.json removed — @import was never a Claude Code feature
|
|
132
135
|
|
|
133
136
|
// ─── sync-map.json ─────────────────────────────────────
|
|
137
|
+
// Master plan aggregation was removed in v2.1.0 (plan/ directory is no longer
|
|
138
|
+
// populated). sync-map.json is still produced with an empty `mappings` array
|
|
139
|
+
// for sync-checker backward compatibility — sync-checker treats an empty map
|
|
140
|
+
// as "nothing to sync" and exits cleanly (see master-plan-removal tests).
|
|
134
141
|
// CODE_BLOCK_PLANS imported from lib/plan-parser.js
|
|
135
142
|
const sm = { generatedAt: new Date().toISOString(), mappings: [] };
|
|
136
143
|
if (fs.existsSync(DIRS.plan)) {
|
|
@@ -147,26 +154,17 @@ async function main() {
|
|
|
147
154
|
fs.writeFileSync(path.join(GEN, "sync-map.json"), JSON.stringify(sm, null, 2));
|
|
148
155
|
console.log(` ✅ sync-map.json — ${sm.summary.totalMappings} mappings`);
|
|
149
156
|
|
|
150
|
-
// ─── plan-manifest.json
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
const bn = path.basename(p);
|
|
157
|
-
const blocks = CODE_BLOCK_PLANS.includes(bn)
|
|
158
|
-
? extractCodeBlockPathsFromFile(p)
|
|
159
|
-
: extractFileBlocksFromFile(p);
|
|
160
|
-
pm.plans.push({ path: r, ...s, fileBlocks: blocks.length, status: "ok" });
|
|
161
|
-
}
|
|
162
|
-
}
|
|
163
|
-
fs.writeFileSync(path.join(GEN, "plan-manifest.json"), JSON.stringify(pm, null, 2));
|
|
164
|
-
console.log(` ✅ plan-manifest.json — ${pm.plans.length} plans`);
|
|
157
|
+
// ─── plan-manifest.json ─ REMOVED in v2.1.0 ─────────────
|
|
158
|
+
// Master plan generation was removed; a plan-manifest with an empty plans
|
|
159
|
+
// array is noise — nothing reads it, nothing validates it. The two-file
|
|
160
|
+
// stale output (62 B plan-manifest + 147 B plan-sync-status) was removed
|
|
161
|
+
// to match the declared v2.1.0 contract "plan/ directory is no longer
|
|
162
|
+
// created during init".
|
|
165
163
|
|
|
166
164
|
// ─── Initialize stale-report.json (preserve existing sub-tool results) ──
|
|
167
165
|
updateStaleReport(GEN, "generatedAt", new Date().toISOString(), { totalIssues: 0, status: "initial" });
|
|
168
166
|
console.log(" ✅ stale-report.json — initialized");
|
|
169
|
-
console.log("\n 📁 Output: claudeos-core/generated/ (
|
|
167
|
+
console.log("\n 📁 Output: claudeos-core/generated/ (3 files)\n");
|
|
170
168
|
}
|
|
171
169
|
|
|
172
170
|
if (require.main === module) {
|
package/package.json
CHANGED
|
@@ -92,16 +92,8 @@ Generation targets:
|
|
|
92
92
|
- 03.troubleshooting/01.troubleshooting.md
|
|
93
93
|
- 04.architecture/01.file-map.md
|
|
94
94
|
- 04.architecture/02.pros-and-cons.md
|
|
95
|
-
|
|
96
|
-
7. claudeos-core/plan/ (Master Plan)
|
|
97
|
-
- 10.standard-master.md
|
|
98
|
-
- 20.rules-master.md
|
|
99
|
-
- 21.sync-rules-master.md
|
|
100
|
-
- 30.frontend-skills-master.md
|
|
101
|
-
- 40.guides-master.md
|
|
102
|
-
|
|
103
|
-
8. claudeos-core/database/
|
|
95
|
+
7. claudeos-core/database/
|
|
104
96
|
- 01.schema-overview.md — API schema description (if applicable)
|
|
105
97
|
|
|
106
|
-
|
|
98
|
+
8. claudeos-core/mcp-guide/
|
|
107
99
|
- 01.mcp-overview.md
|