@c4a/context-cli 0.6.0-beta.5 → 0.6.0-beta.7

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.
Files changed (57) hide show
  1. package/README.md +19 -4
  2. package/cli.js +5330 -3154
  3. package/package.json +2 -2
  4. package/plugin/skills/skill-continue-workflow/SKILL.md +26 -2
  5. package/plugin/skills/skill-prose-align/SKILL.md +32 -15
  6. package/plugin/skills/skill-prose-align/references/internal-procedures/structure-planning.md +5 -3
  7. package/plugin/skills/skill-prose-compile/SKILL.md +27 -13
  8. package/plugin/skills/skill-review-gate/SKILL.md +33 -10
  9. package/plugin/skills/skill-source-scope/SKILL.md +165 -105
  10. package/plugin/skills/skill-source-scope/references/capture-source.md +32 -12
  11. package/plugins/VERSION +1 -1
  12. package/plugins/claude/.claude-plugin/plugin.json +1 -1
  13. package/plugins/claude/skills/skill-continue-workflow/SKILL.md +26 -2
  14. package/plugins/claude/skills/skill-prose-align/SKILL.md +32 -15
  15. package/plugins/claude/skills/skill-prose-align/references/internal-procedures/structure-planning.md +5 -3
  16. package/plugins/claude/skills/skill-prose-compile/SKILL.md +27 -13
  17. package/plugins/claude/skills/skill-review-gate/SKILL.md +33 -10
  18. package/plugins/claude/skills/skill-source-scope/SKILL.md +165 -105
  19. package/plugins/claude/skills/skill-source-scope/references/capture-source.md +32 -12
  20. package/plugins/codex/.codex-plugin/plugin.json +2 -2
  21. package/plugins/codex/skills/continue/references/internal-procedures/skill-continue-workflow.md +26 -2
  22. package/plugins/codex/skills/continue/references/internal-procedures/skill-prose-align/references/internal-procedures/structure-planning.md +5 -3
  23. package/plugins/codex/skills/continue/references/internal-procedures/skill-prose-align.md +32 -15
  24. package/plugins/codex/skills/continue/references/internal-procedures/skill-prose-compile.md +27 -13
  25. package/plugins/codex/skills/continue/references/internal-procedures/skill-review-gate.md +33 -10
  26. package/plugins/codex/skills/continue/references/internal-procedures/skill-source-scope/references/capture-source.md +32 -12
  27. package/plugins/codex/skills/continue/references/internal-procedures/skill-source-scope.md +165 -105
  28. package/plugins/codex/skills/init/references/internal-procedures/skill-continue-workflow.md +26 -2
  29. package/plugins/codex/skills/init/references/internal-procedures/skill-prose-align/references/internal-procedures/structure-planning.md +5 -3
  30. package/plugins/codex/skills/init/references/internal-procedures/skill-prose-align.md +32 -15
  31. package/plugins/codex/skills/init/references/internal-procedures/skill-prose-compile.md +27 -13
  32. package/plugins/codex/skills/init/references/internal-procedures/skill-review-gate.md +33 -10
  33. package/plugins/codex/skills/init/references/internal-procedures/skill-source-scope/references/capture-source.md +32 -12
  34. package/plugins/codex/skills/init/references/internal-procedures/skill-source-scope.md +165 -105
  35. package/plugins/cursor/.cursor-plugin/plugin.json +1 -1
  36. package/plugins/cursor/skills/skill-continue-workflow/SKILL.md +26 -2
  37. package/plugins/cursor/skills/skill-prose-align/SKILL.md +32 -15
  38. package/plugins/cursor/skills/skill-prose-align/references/internal-procedures/structure-planning.md +5 -3
  39. package/plugins/cursor/skills/skill-prose-compile/SKILL.md +27 -13
  40. package/plugins/cursor/skills/skill-review-gate/SKILL.md +33 -10
  41. package/plugins/cursor/skills/skill-source-scope/SKILL.md +165 -105
  42. package/plugins/cursor/skills/skill-source-scope/references/capture-source.md +32 -12
  43. package/plugins/skills/context-continue/references/internal-procedures/skill-continue-workflow.md +26 -2
  44. package/plugins/skills/context-continue/references/internal-procedures/skill-prose-align/references/internal-procedures/structure-planning.md +5 -3
  45. package/plugins/skills/context-continue/references/internal-procedures/skill-prose-align.md +32 -15
  46. package/plugins/skills/context-continue/references/internal-procedures/skill-prose-compile.md +27 -13
  47. package/plugins/skills/context-continue/references/internal-procedures/skill-review-gate.md +33 -10
  48. package/plugins/skills/context-continue/references/internal-procedures/skill-source-scope/references/capture-source.md +32 -12
  49. package/plugins/skills/context-continue/references/internal-procedures/skill-source-scope.md +165 -105
  50. package/plugins/skills/context-init/references/internal-procedures/skill-continue-workflow.md +26 -2
  51. package/plugins/skills/context-init/references/internal-procedures/skill-prose-align/references/internal-procedures/structure-planning.md +5 -3
  52. package/plugins/skills/context-init/references/internal-procedures/skill-prose-align.md +32 -15
  53. package/plugins/skills/context-init/references/internal-procedures/skill-prose-compile.md +27 -13
  54. package/plugins/skills/context-init/references/internal-procedures/skill-review-gate.md +33 -10
  55. package/plugins/skills/context-init/references/internal-procedures/skill-source-scope/references/capture-source.md +32 -12
  56. package/plugins/skills/context-init/references/internal-procedures/skill-source-scope.md +165 -105
  57. package/scripts/postinstall.mjs +68 -129
package/README.md CHANGED
@@ -19,8 +19,8 @@ stable protocol text and are not translated.
19
19
  ## Global Plugin + Project Workspace
20
20
 
21
21
  ```bash
22
- # Install or refresh global agent commands/skills.
23
- bunx @c4a/context-cli plugin install
22
+ # Install the CLI and refresh available global agent commands/skills.
23
+ npm install -g @c4a/context-cli
24
24
 
25
25
  # Create a standalone context project.
26
26
  context init context
@@ -30,6 +30,11 @@ bun install
30
30
  /context:continue
31
31
  ```
32
32
 
33
+ Global installation runs `context plugin install` automatically for the
34
+ available Claude and Codex CLIs. Plugin refresh is best-effort and does not
35
+ make the CLI installation fail; rerun `context plugin install` manually after
36
+ installing an agent CLI. Set `CONTEXT_CLI_SKIP_PLUGIN_INSTALL=1` to opt out.
37
+
33
38
  The global plugin calls `context ...` from the current project root.
34
39
  Agent commands follow CLI `next:` hints: they execute safe mechanical steps and
35
40
  stop at `Human gate:` / placeholder next steps, source registration, source scope
@@ -55,7 +60,9 @@ node_modules/@c4a/context/templates/package-templates/
55
60
  Agents should read these files instead of probing `node_modules/@c4a/context/dist`
56
61
  with temporary scripts.
57
62
 
58
- For local checkout development and link installs, see [DEVELOPMENT.md](./DEVELOPMENT.md).
63
+ For the complete source, link, plugin, and npm-mode development workflow, see
64
+ the workspace [DEVELOPMENT.md](../../DEVELOPMENT.md). CLI plugin-specific notes
65
+ remain in this package's [DEVELOPMENT.md](./DEVELOPMENT.md).
59
66
 
60
67
  ## Project-local quick tour
61
68
 
@@ -137,20 +144,28 @@ For project workflows, `context` is a semantic service. Agents should call the C
137
144
  | `context init [project-dir] [--name <name>] [--dev]` | CLI | Create a project-local context workspace. Defaults to `context/`; use `.` to initialize the current directory. Use `--dev` for local checkout testing before `@c4a/context` is published. |
138
145
  | `context source add repo <name> --local <repo-or-subdir> [--remote <url>] [--ref <sha>]` | CLI | Register a repo source and pin it to a commit. Local paths may point at a monorepo subdirectory; the CLI stores the git root plus subpath, and materializes the source view to the subdirectory. Remote and ref are inferred from local origin / HEAD when omitted. Short SHAs are resolved to full commits when the local repo is available. |
139
146
  | `context source ensure [name]` | CLI | Validate and materialize local source symlinks. Missing remotes only produce hints; the CLI does not clone or checkout automatically. |
147
+ | `context source add batch [date] --input <file|->` | CLI | Register multiple repo, file, or Lark modules under one project write lock from YAML/JSON input. Repo modules are explicit; file/Lark modules may be derived when omitted. |
140
148
  | `context source list|get <name>` | CLI | Inspect the repo source registry and readiness metadata. |
141
149
  | `context source inspect [name]` | CLI | Detect module/package boundaries in registered repo sources without extraction. Use this before extracting monorepo roots; it prints package names, paths, versions when available, and suggested source registration commands. |
142
150
  | `context run --list` | CLI | List phases declared by `src/index.ts`. |
143
- | `context run <phase-id> [--dry-run] [--auto-promote]` | CLI | Inspect or run one declared phase. Extract dry-run separates discovered, AST-analyzed, skipped, symbol, and relation counts. Missing/empty entries fail with `NO_ENTRY_DETECTED`; TypeScript aliases come from tsconfig/jsconfig `baseUrl` and `paths`. Codegraph defaults to first-run full Review and later delta-only Review; `--auto-promote` is the verified codegraph-only CI/CD mode. |
151
+ | `context run <phase-id> [--dry-run] [--auto-promote]` | CLI | Inspect or run one declared phase. Extract dry-run separates discovered, AST-analyzed, skipped, symbol, and relation counts. Missing/empty entries fail with `NO_ENTRY_DETECTED`; TypeScript aliases come from tsconfig/jsconfig `baseUrl` and `paths`. Codegraph defaults to first-run full Review and later delta-only Review; `--auto-promote` applies deterministic codegraph deltas, refreshes deterministic close when needed, then verifies. Existing package outputs become stale and remain an explicit downstream build step. |
144
152
  | `context review html [collection] [--open]` | CLI | Render the local self-contained HTML review surface under `.tmp/context-runtime/review/`, emit a clickable `file://` URL, and optionally open it with the system browser. |
145
153
  | `context review list [collection]` | CLI | List draft candidates for CLI-oriented review. |
146
154
  | `context review apply <payload-file>` | CLI | Apply copied review decisions; approved entities materialize to `knowledge/`, rejected entities remain in `unapproved/entities.jsonl`. |
147
155
  | `context review approve|reject <candidate-id> --collection <collection>` / `--all` | CLI | Scoped quick marking for a single draft candidate when the user explicitly authorizes an automated or quick path. |
156
+ | `context review migrate-codegraph-refs` | CLI | Upgrade legacy approved codegraph refs to `src-N#symbol:<file>:<symbol>:<kind>@<digest>`, remove redundant `code_origin`, and verify. Rerun declared codegraph extraction first; this metadata migration does not repeat Review. |
148
157
  | `context build` | CLI | Build declared project packages from approved knowledge into `dist/<package-name>/`. |
149
158
  | `context verify [--format table\|json]` | CLI | Validate the project skeleton, registry, unapproved ledger, approved Markdown, source refs, and package outputs. |
150
159
  | `context status [--format json\|table]` | CLI | Workspace overview + a canonical `next:` hint. Agent plugins expose this workflow as `/context:continue`; do not add or call `context continue`. |
151
160
 
152
161
  Commands that require a project exit with a workspace-not-found error if run outside a directory tree containing a `package.json` `context.project=true` / `context.entry` marker. `context init` is the command that creates one.
153
162
 
163
+ For a beta.5 project that reports `approved-source-ref-ambiguous`, upgrade in
164
+ this order: rerun each declared codegraph extraction phase to create the current
165
+ file-aware symbol index, run `context review migrate-codegraph-refs`, then run
166
+ `context verify`. The migration preserves approved content and review decisions;
167
+ it changes only code evidence identity and removes the old `code_origin` copy.
168
+
154
169
  ## Development
155
170
 
156
171
  Source lives at [`packages/context-cli/`](./src) in this workspace.