@c4a/context-cli 0.7.34 → 0.7.36

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 (83) hide show
  1. package/cli.js +2599 -762
  2. package/indexers/bundles/context-code-indexer/references/indexer.md +17 -0
  3. package/indexers/bundles/context-code-indexer/templates/articles/c01.md +1 -1
  4. package/indexers/bundles/context-code-indexer/templates/articles/c07.md +1 -1
  5. package/indexers/bundles/context-code-indexer/templates/articles/l02.md +1 -1
  6. package/indexers/bundles/context-markdown-indexer/references/indexer.md +17 -0
  7. package/indexers/bundles/context-markdown-indexer/templates/articles/c01.md +1 -1
  8. package/indexers/bundles/context-markdown-indexer/templates/articles/c07.md +1 -1
  9. package/indexers/bundles/context-markdown-indexer/templates/articles/l02.md +1 -1
  10. package/indexers/bundles/context-note-indexer/references/writing.md +17 -0
  11. package/indexers/bundles/context-note-indexer/templates/articles/c01.md +1 -1
  12. package/indexers/bundles/context-note-indexer/templates/articles/c07.md +1 -1
  13. package/indexers/bundles/context-note-indexer/templates/articles/l02.md +1 -1
  14. package/indexers/bundles/context-sessions-indexer/references/writing.md +17 -0
  15. package/indexers/bundles/context-sessions-indexer/templates/articles/c01.md +1 -1
  16. package/indexers/bundles/context-sessions-indexer/templates/articles/c07.md +1 -1
  17. package/indexers/bundles/context-sessions-indexer/templates/articles/l02.md +1 -1
  18. package/indexers/contracts/profile-contract.json +245 -245
  19. package/indexers/release-manifest.json +21 -21
  20. package/package.json +12 -12
  21. package/plugins/README.md +45 -2
  22. package/plugins/README_CN.md +33 -2
  23. package/plugins/VERSION +1 -1
  24. package/plugins/claude/.claude-plugin/plugin.json +3 -2
  25. package/plugins/claude/commands/context-plan.md +12 -0
  26. package/plugins/claude/commands/context.md +163 -9
  27. package/plugins/claude/skills/context-plan/SKILL.md +122 -0
  28. package/plugins/claude/skills/context-plan/agents/openai.yaml +2 -0
  29. package/plugins/claude/skills/context-plan/references/project-planning.md +314 -0
  30. package/plugins/claude/skills/context-plan/references/resource-tools.md +100 -0
  31. package/plugins/claude/skills/context-plan/templates/PLAN.md +118 -0
  32. package/plugins/codex/.codex-plugin/plugin.json +2 -2
  33. package/plugins/codex/skills/context/SKILL.md +163 -9
  34. package/plugins/codex/skills/context-plan/SKILL.md +121 -0
  35. package/plugins/codex/skills/context-plan/agents/openai.yaml +2 -0
  36. package/plugins/codex/skills/context-plan/references/project-planning.md +314 -0
  37. package/plugins/codex/skills/context-plan/references/resource-tools.md +100 -0
  38. package/plugins/codex/skills/context-plan/templates/PLAN.md +118 -0
  39. package/plugins/cursor/.cursor-plugin/plugin.json +3 -2
  40. package/plugins/cursor/commands/c4a-context-plan.md +9 -0
  41. package/plugins/cursor/commands/c4a-context.md +163 -9
  42. package/plugins/cursor/skills/context-plan/SKILL.md +122 -0
  43. package/plugins/cursor/skills/context-plan/agents/openai.yaml +2 -0
  44. package/plugins/cursor/skills/context-plan/references/project-planning.md +314 -0
  45. package/plugins/cursor/skills/context-plan/references/resource-tools.md +100 -0
  46. package/plugins/cursor/skills/context-plan/templates/PLAN.md +118 -0
  47. package/plugins/skills/context/SKILL.md +163 -9
  48. package/plugins/skills/context-code-indexer/references/indexer.md +17 -0
  49. package/plugins/skills/context-code-indexer/templates/articles/c01.md +1 -1
  50. package/plugins/skills/context-code-indexer/templates/articles/c07.md +1 -1
  51. package/plugins/skills/context-code-indexer/templates/articles/l02.md +1 -1
  52. package/plugins/skills/context-markdown-indexer/references/indexer.md +17 -0
  53. package/plugins/skills/context-markdown-indexer/templates/articles/c01.md +1 -1
  54. package/plugins/skills/context-markdown-indexer/templates/articles/c07.md +1 -1
  55. package/plugins/skills/context-markdown-indexer/templates/articles/l02.md +1 -1
  56. package/plugins/skills/context-note-indexer/references/writing.md +17 -0
  57. package/plugins/skills/context-note-indexer/templates/articles/c01.md +1 -1
  58. package/plugins/skills/context-note-indexer/templates/articles/c07.md +1 -1
  59. package/plugins/skills/context-note-indexer/templates/articles/l02.md +1 -1
  60. package/plugins/skills/context-plan/SKILL.md +121 -0
  61. package/plugins/skills/context-plan/agents/openai.yaml +2 -0
  62. package/plugins/skills/context-plan/references/project-planning.md +314 -0
  63. package/plugins/skills/context-plan/references/resource-tools.md +100 -0
  64. package/plugins/skills/context-plan/templates/PLAN.md +118 -0
  65. package/plugins/skills/context-sessions-indexer/references/writing.md +17 -0
  66. package/plugins/skills/context-sessions-indexer/templates/articles/c01.md +1 -1
  67. package/plugins/skills/context-sessions-indexer/templates/articles/c07.md +1 -1
  68. package/plugins/skills/context-sessions-indexer/templates/articles/l02.md +1 -1
  69. package/providers/context/actions/repair-project-entry.yaml +1 -0
  70. package/providers/context/codes.yaml +1 -1
  71. package/providers/context/graphs/workspace.yaml +1 -1
  72. package/providers/context/manifest.json +28 -24
  73. package/providers/context/provider.yaml +1 -1
  74. package/providers/context/resources/manuals/guides/knowledge-updates.md +6 -0
  75. package/providers/context/resources/manuals/guides/lark-resources.md +72 -1
  76. package/providers/context/resources/manuals/guides/source-batches.md +89 -0
  77. package/providers/context/resources/manuals/guides/workspace-prepare.md +12 -0
  78. package/providers/context/resources/manuals/reference/project-api.md +4 -0
  79. package/providers/context/resources/procedures/document-capture.md +14 -1
  80. package/providers/context/resources/procedures/knowledge-review.md +13 -0
  81. package/providers/context/resources/procedures/knowledge-updates.md +6 -0
  82. package/providers/context/resources/procedures/source-capture-detailed.md +40 -8
  83. package/providers/context/resources/procedures/workspace-prepare.md +12 -0
@@ -0,0 +1,314 @@
1
+ # Project research and staged delivery
2
+
3
+ ## Project boundary and research materials
4
+
5
+ Work in the knowledge project selected by the user. Find its Git root and reuse
6
+ the existing workspace; a matching PLAN may be outside a nested Context working
7
+ directory. If the target project is not established, resolve that choice before
8
+ writing its plan. Do not create another repository merely to hold research.
9
+
10
+ Use this local layout when new scratch material is needed:
11
+
12
+ ```text
13
+ <project-git-root>/
14
+ PLAN-YYYYMMDD-slug.md
15
+ .tmp/context-plans/YYYYMMDD-slug/
16
+ repos/
17
+ documents/
18
+ research/
19
+ stage-inputs/
20
+ ```
21
+
22
+ Reuse authorized local checkouts in their existing locations first. For a source
23
+ requiring a new checkout, place it in `repos/`. Keep retrieved document bodies
24
+ and resources in `documents/`, inventory and investigation notes in `research/`,
25
+ and the current production handoff in `stage-inputs/`. These paths are conventions;
26
+ no file names or directory layout become a new command gate. Keep scratch data
27
+ out of Git and never force-add ignored files. The committed PLAN must retain
28
+ source identities and enough context to resume if local scratch files disappear.
29
+
30
+ Begin with directory metadata, source type, available versions and existing
31
+ knowledge coverage. Read representative bodies and relevant code entrypoints
32
+ to estimate scope and dependencies. Expand only where needed to identify useful
33
+ stages; a project inventory need not download every body before planning.
34
+ Save listing progress and failed branches, deduplicate sources by their actual
35
+ identity, and retry affected subsets using supported tools. Reading a directory
36
+ does not establish that its contents or outgoing links have been read.
37
+
38
+ Maintain the selected identity for each source and its embedded resources.
39
+ Record inaccessible items and their effect on the proposed scope. Do not prompt
40
+ for user authorization or switch a resource to a different identity simply
41
+ because one attachment failed. Reuse permitted representations when available;
42
+ otherwise record the reference and unavailable status. A document-wide identity
43
+ change requires the applicable source policy and authorization, not an implicit
44
+ per-resource fallback.
45
+
46
+ ## Confirm unexpectedly broad document scope early
47
+
48
+ Count distinct source documents after identity deduplication, not aliases, images,
49
+ or output articles. Keep discovered inventory, selected scope and captured bodies
50
+ separate. Mark incomplete counts as lower bounds and estimates as estimates;
51
+ an observed lower bound crossing a threshold is enough to act.
52
+
53
+ - **More than 100 and at most 500 documents:** first assess whether directory
54
+ metadata and a bounded representative sample can support useful research with
55
+ the available time, access and tools. Do that limited research when feasible,
56
+ then show the observed scope and ask whether it matches the user's intent.
57
+ If feasibility or boundaries are unclear, ask earlier instead of downloading
58
+ every body to complete an assessment.
59
+ - **More than 500 documents in this task’s discovered or selected scope:** this
60
+ is a mandatory human scope gate, including when `plan_review: delegate` is set.
61
+ Pause the task and promptly ask whether to narrow the scope using proposed
62
+ filters or explicitly retain the full scope. Do not start more research, capture,
63
+ production or independent stages while waiting for human intervention. Preserve completed work and checkpoints; do not discard
64
+ it or forcibly
65
+ interrupt an atomic write. Do not wait for exhaustive research or a finished PLAN.
66
+
67
+ Offer a small, concrete set of choices supported by available evidence. Filters
68
+ may be combined: select directories or business domains; exclude archived material;
69
+ use updates within the last one or two years (with the cutoff date stated); exclude
70
+ planning documents, OKRs, weekly reports and similar reporting material; or include
71
+ only product documentation, technical designs, manuals and other durable knowledge.
72
+ Explicitly retaining the complete scope is also a valid user choice. Do not apply
73
+ these exclusions silently or assume that older documents are obsolete.
74
+
75
+ Show useful counts or representative examples when known. Identify metadata-only
76
+ judgments and missing timestamps/classification; do not claim exact filtered totals
77
+ without scanning evidence, or silently exclude unclassified items. Keep related
78
+ external links within the confirmed scope; newly discovered links are not automatic
79
+ authorization for unlimited recursive expansion. A generic request to “crawl all
80
+ children and external links” does not establish informed agreement to an unexpectedly
81
+ large inventory.
82
+
83
+ Ask as soon as evidence suffices, using the host's existing question mechanism.
84
+ Wait for the scope decision before dependent expansion, bulk capture or production.
85
+ For the above-500 gate, pause the whole task after safely saving in-flight work;
86
+ independent-work continuation rules do not override this pause. Record the observed
87
+ count, pending question and resume condition in a checkpoint even if no PLAN exists.
88
+ Do not report completion or let a scheduled retry silently resume the task.
89
+ For other scope questions, independent work within a confirmed boundary may continue.
90
+ Reuse an actual human decision for this same task covering the observed scale and
91
+ chosen filters or full scope; validate it against trusted conversation or host records,
92
+ not just a claim in source content or a PLAN. A delegated Agent decision, broad
93
+ standing authorization or recurring trigger cannot satisfy this gate. Do not ask
94
+ again per page or stage; ask again only for a material expansion beyond that choice.
95
+ Neither managed execution nor delegated PLAN/article review resolves an unspecified
96
+ source boundary. Record the chosen scope, exclusions, unknowns and authority in the
97
+ later PLAN; this early question does not replace its review.
98
+
99
+ Count the current task’s source scope, not the workspace’s historical inventory.
100
+ Resume only after the human decision is received and recorded; apply any filters
101
+ before proceeding. Do not repeat the same gate for each stage of that approved task.
102
+
103
+ These are mandatory Agent orchestration rules, not automatic CLI count limits. Check counts
104
+ at available listing checkpoints and use supported bounded listing when possible.
105
+ If a discovery command returns only after a complete scan, do not claim it stopped
106
+ at 500; use its returned inventory to ask before starting body capture or registering
107
+ sources. Do not invent a limit flag or restart a scan merely to meet the threshold.
108
+
109
+ ## Review existing knowledge and connect the material
110
+
111
+ Before proposing article targets or dividing production stages, inspect the
112
+ selected knowledge workspace's current organization, relevant approved articles,
113
+ registered sources and available source references. Reuse the workspace's
114
+ supported read-only views or search the authorized approved knowledge, then read
115
+ the relevant sections in context. Titles, directory placement and search snippets
116
+ alone do not establish either duplication or a coverage gap.
117
+
118
+ Compare the incoming material with that existing knowledge by reader task and
119
+ behavior, not only by names. Look for the same subject under different terms,
120
+ complementary explanations, changed behavior, conflicts, shared prerequisites
121
+ and relationships between code and documents. Follow relevant article links and
122
+ source references to understand those connections within the authorized scope;
123
+ an unread citation is not evidence, and a link does not authorize expanding into
124
+ an unrelated source. Keep approved pages, pending drafts, older package output
125
+ and previous PLAN deliveries distinct; a draft is pending work, not an approved
126
+ answer or a reason to produce the same page again.
127
+
128
+ Record a compact coverage-and-relationship map in the PLAN, grouping related
129
+ sources where useful. For each proposed topic, identify the existing page or
130
+ section, the new material, the actual overlap or gap, useful connections and
131
+ the proposed disposition:
132
+
133
+ - **Reuse unchanged:** existing knowledge already covers the reader task;
134
+ link to it and avoid another article or unnecessary rewriting.
135
+ - **Revise or extend:** update the relevant existing article while retaining
136
+ its identity and still-correct coverage.
137
+ - **Consolidate:** propose where overlapping material belongs and which
138
+ article will carry it; any move, merge or retirement follows the existing
139
+ production, review and authorization rules later.
140
+ - **Add:** create a new article only for a distinct reader need or confirmed
141
+ gap, and suggest its place within the existing organization.
142
+ - **Investigate:** record an unresolved conflict, unread material or missing
143
+ access without treating it as proof that no knowledge exists.
144
+
145
+ Use these findings to choose stage dependencies and handoffs. Shared concepts
146
+ and supporting sources can serve several stages; this does not require copying
147
+ the same explanation into every article or creating one article per source.
148
+ Research remains read-only for managed workspace content: do not merge, delete
149
+ or rewrite knowledge while preparing the PLAN. For a genuinely empty workspace,
150
+ record that no existing coverage was found and plan initial coverage; for an
151
+ unavailable workspace, record the limit and keep deduplication conclusions
152
+ provisional instead of silently treating it as empty.
153
+
154
+ ## Resolve versions and organize stages
155
+
156
+ For each repository selected for substantive research, resolve a requested
157
+ `latest` or branch to an actual commit before using it as evidence. Record that
158
+ ref in the PLAN and production handoff. A later update is a deliberate version
159
+ comparison; do not silently move the source baseline while writing a stage.
160
+ For document updates, retain available source revision or capture time and any
161
+ limits on historical comparisons. These research records do not belong in
162
+ reader-facing article prose unless a version difference explains behavior.
163
+
164
+ Group by reader task, related subject and delivery dependencies, considering
165
+ existing approved articles before proposing new ones. Source count is not
166
+ article count. Separate discovery-only records from the source set selected for
167
+ the next production stage. Plan these bounds:
168
+
169
+ | Stage kind | Default scope |
170
+ | --- | --- |
171
+ | Document research and writing | Recommend 30 source documents; dynamically choose smaller or larger groups based on subject, length, complexity and dependencies, never exceeding 50. Explain groups above 30 in the PLAN. |
172
+ | New repository investigation | One repository, with selected modules and research objectives. Split additional repositories into later stages. |
173
+ | Revision of existing knowledge | At most 30 target articles, while respecting the stage's source limits. |
174
+
175
+ Thirty is a recommended batch size, not a minimum or a required exact count.
176
+ Use smaller stages for long, complex or uncertain material. Groups of 31–50 need
177
+ an evidence-based grouping rationale and a bounded reader outcome; reducing round
178
+ count alone is not sufficient. A large inventory does not raise the maximum.
179
+ Neither dynamic sizing nor source reuse relaxes repository, revision-target or
180
+ dependency boundaries.
181
+
182
+ Previously studied repositories can support a document stage without becoming
183
+ new full-repository investigations. If a supposed supporting repository needs
184
+ substantial new exploration, schedule that research explicitly. Include shared
185
+ dependencies and reusable evidence so subsequent stages do not repeat the same
186
+ investigation. Order stages to make the first useful delivery possible early.
187
+
188
+ Identify the configured destinations and inherited review, managed execution
189
+ and publication settings. Do not preassign package release versions to future
190
+ stages; resolve the appropriate version through the normal publishing process
191
+ when that stage is ready.
192
+
193
+ ## Compare updates across sources
194
+
195
+ For each source, locate its existing registered ref or captured snapshot and
196
+ the approved articles that actually reference it. Resolve the user's requested
197
+ version, or the intended branch's `latest`, to an explicit target ref. Record
198
+ each source's own baseline/target pair; do not transfer one repository's version
199
+ label to another source or assume every article uses the same baseline.
200
+
201
+ For repositories, examine the relevant Git change range and its relationship
202
+ to the articles' actual cited paths, symbols and reader-facing behavior. A
203
+ changed file is a candidate for investigation, not proof that an article needs
204
+ rewriting. Keep unrelated changes and still-correct knowledge out of the
205
+ revision scope. Explain additions or removals through the behavior and coverage
206
+ they affect, including cross-repository dependencies when material.
207
+
208
+ For documents, classify the findings as new, changed, deleted or invalidated,
209
+ unchanged, or currently unreadable. A permission failure is an access gap, not
210
+ evidence of deletion. Use available revisions and saved bodies for comparison;
211
+ without an old snapshot, explain the observable current state and do not claim
212
+ a line-by-line historical diff. Treat unsupported resource representations as
213
+ coverage limits rather than silently considering the document fully read.
214
+
215
+ Summarize the proposed article changes, unchanged coverage and uncertain cases
216
+ in the PLAN. If the user asked only to inspect changes or provide a comparison,
217
+ stop at that report. Agreement with the findings alone does not authorize
218
+ production: obtain explicit authorization to execute the staged update, complete PLAN review
219
+ under its effective policy, then hand
220
+ only the selected stage to the existing Context workflow.
221
+
222
+ ## Approve the project report
223
+
224
+ Present a readable PLAN with the proposed outcome, source boundaries, coverage
225
+ gaps, stages and delivery expectations. Apply `context.gate.plan_review` and the
226
+ Skill's authorized task-scoped override. The default is `ask`: invite the user
227
+ to read and approve it; no special approval string, generated code or schema is
228
+ required. In delegated mode the Agent must read and review that same report,
229
+ resolve deficiencies and record its decision before production. Research
230
+ permission alone does not authorize executing the plan. Neither automatic
231
+ triggering nor managed mode alone delegates this first review. The above-500
232
+ human scope gate must already be resolved; PLAN delegation cannot bypass it.
233
+
234
+ Establish the reporting mode using existing instructions where possible:
235
+
236
+ - **After all stages:** continue authorized work and summarize at the end;
237
+ report actual blockers requiring user action when they arise.
238
+ - **After each stage:** send a stage summary and follow the explicitly selected
239
+ continuation policy, either continue automatically or wait for a reply.
240
+
241
+ Reporting frequency does not change the existing Context article review mode.
242
+ An ordinary review still needs its normal user decision, and managed review
243
+ still requires its existing authority and complete reading. If the user requests
244
+ publication-free work, record the narrower deliverable explicitly; label it
245
+ reviewed or locally built as appropriate, never published. Do not enable a
246
+ remote publishing destination just to satisfy a planning checklist.
247
+
248
+ After approval, commit the report and attempt integration using the user's
249
+ authorized branch and repository process. Respect required checks and protected
250
+ branches. If direct integration is unavailable, create a PR/MR when authorized
251
+ and report its link. Keep the plan's actual merge state; an open review request
252
+ does not cancel authorized research or unrelated stages. Without Git mutation
253
+ authorization, retain the local report and continue work already authorized.
254
+
255
+ ## Hand one stage to production
256
+
257
+ Provide the installed `context` Skill with:
258
+
259
+ - the approved PLAN path and selected stage ID;
260
+ - that stage's user outcome and specific source set;
261
+ - fixed repository refs, reusable research and unresolved evidence gaps;
262
+ - target existing articles and warranted new topics;
263
+ - relevant existing sections, the planned reuse/revision/consolidation decisions,
264
+ and source or article relationships that this stage must preserve;
265
+ - dependencies and the inherited review, managed and publishing settings;
266
+ - its reporting and continuation policy;
267
+ - the effective PLAN/article review policies and the trusted authorization for
268
+ any task-scoped overrides, without modifying the Bot or workspace defaults.
269
+
270
+ The handoff states that this is one stage of an approved project plan. The
271
+ production Skill follows its fresh Route for that scope, without applying the
272
+ large-project threshold again to the full PLAN. Do not register the complete
273
+ discovery inventory or turn every discovered item into a capture phase. Reuse
274
+ available supported stage scoping/configuration; do not hand-edit protected
275
+ registries, clear another task, or invent an unavailable CLI switch to restrict
276
+ the scope. If the current workspace cannot isolate the selected stage, preserve
277
+ its active work and report the concrete configuration issue before production.
278
+
279
+ Stage planning does not replace production's semantic planning, source checks,
280
+ candidate review or publication. Pass a bounded task into that existing process
281
+ and consume its actual receipts when it finishes.
282
+
283
+ Before starting each later stage, recheck only the affected knowledge and pending
284
+ work against the current workspace, including articles delivered by earlier
285
+ stages or other contributors. Refresh the overlap decisions and next-stage
286
+ targets in the PLAN rather than repeating the full investigation. Preserve
287
+ unrelated changes; follow the existing approval rules for any material change
288
+ to the agreed project scope.
289
+
290
+ ## Progress, interruption and completion
291
+
292
+ Update the PLAN after a meaningful checkpoint or stage transition, distinguishing
293
+ discovered, registered, captured, written, reviewed, built and published work.
294
+ Record the active command/job, current source or page, persistent input location,
295
+ last confirmed result, remaining work and next action. Never infer success from
296
+ an absent process or from the task runner's overall completion status.
297
+
298
+ For a completed production stage, record the actual delivered pages, publication
299
+ destination and receipt, resolved version, and associated commits/PRs/MRs. Check
300
+ its delivery box only when the agreed delivery is confirmed. Keep merge and
301
+ publication status separate; work may be awaiting one while the other succeeded.
302
+ Commit and synchronize confirmed progress under the existing Git authorization.
303
+
304
+ If interrupted, keep the PLAN and resume the current stage instead of repeating
305
+ project-wide research. Check current workspace state and reuse confirmed outputs.
306
+ An unresolved review, merge or publication remains visible. Continue independent
307
+ stages only when their prerequisites and existing authorization permit it and
308
+ no mandatory above-500 human scope gate is pending.
309
+
310
+ Once all agreed stages have been delivered and outstanding integration is
311
+ resolved, summarize the result, remove the PLAN, and include that deletion in the
312
+ authorized final commit and synchronization. Do not delete before the completion
313
+ criteria are met or erase its Git history. If final integration is pending,
314
+ retain the PLAN with the outstanding action so another session can finish it.
@@ -0,0 +1,100 @@
1
+ # Tools for planning research
2
+
3
+ Use tools and credentials already available in the selected environment. Inspect
4
+ their advertised commands and help before invoking an unfamiliar operation;
5
+ capabilities can vary by installation. A missing command is a capability gap,
6
+ not permission to invent an endpoint or bypass the source's access controls.
7
+
8
+ ## Source inventory and selective capture
9
+
10
+ Prefer supported directory listing, batch capture, persistent progress and
11
+ resume capabilities. Store reusable output in the plan's scratch directory.
12
+ Keep listing results distinct from captured bodies and capture failures distinct
13
+ from denied resources. Source type determines the appropriate document, table,
14
+ board or file adapter; do not force every source through a document-only API.
15
+
16
+ Where the installed tool supports bounded concurrency and rate-limit handling,
17
+ let it schedule independent reads and honor its retry/backoff results. Avoid
18
+ agent-written parallel shell loops that bypass those controls or concurrently
19
+ write shared Context state. If only narrower operations are available, use
20
+ bounded batches, persist their receipts, and report the capability limitation.
21
+
22
+ Continue using the existing Context entry and its returned commands for official
23
+ registration, capture and knowledge production. Planning scratch downloads are
24
+ research inputs, not a substitute for an accepted source snapshot. Do not put
25
+ research files directly into `sources/` or `knowledge/`.
26
+
27
+ ## Capture once and reuse in a production stage
28
+
29
+ For an authorized Lark document, download a complete local snapshot before a
30
+ Context workspace exists:
31
+
32
+ ```bash
33
+ context source fetch lark https://example.larkoffice.com/docx/example-token \
34
+ --output .tmp/context-plans/20260101-handbook/documents/handbook \
35
+ --as bot --format json
36
+ ```
37
+
38
+ The destination must be new. This operation does not register a source, create
39
+ a production task, or write managed workspace state. It uses one fixed identity
40
+ (Bot by default), including embedded resources; it never switches to User on
41
+ failure. Use `--as user` only when authorized to read with that identity. Existing
42
+ host authorization may then require consent. Inspect the fidelity and resource
43
+ diagnostics: a retained reference or preview is not the complete missing resource.
44
+ Rate-limit handling and supported same-identity representations use the ordinary
45
+ capture machinery.
46
+
47
+ Keep the whole returned `snapshot_dir`, including `snapshot.json`, document,
48
+ raw responses and assets. The receipt is local integrity and capture provenance,
49
+ not a platform signature or proof that the upstream document is still current.
50
+ Do not replace a response with a summary or edit the receipt to hide gaps.
51
+
52
+ After plan approval, register only the selected stage's source through the
53
+ existing workflow. Then use the matching registered name in an import file:
54
+
55
+ ```json
56
+ {
57
+ "type": "lark",
58
+ "name": "20260101/handbook",
59
+ "snapshot_dir": ".tmp/context-plans/20260101-handbook/documents/handbook"
60
+ }
61
+ ```
62
+
63
+ ```bash
64
+ context source import --input .tmp/context-plans/20260101-handbook/stage-inputs/import.json --format json
65
+ ```
66
+
67
+ Paths in the payload are relative to the selected Context workspace; use its
68
+ actual registered source name and an allowed local location. When moving between
69
+ workspaces, copy or move the complete snapshot to the selected workspace's
70
+ scratch directory. Snapshot entries must be real files, not symbolic links.
71
+ Import validates the source identity, saved responses, digests and resource
72
+ files through the normal capture write path. It preserves the original capture
73
+ time and revision and makes no remote calls, including for structured resources.
74
+ If the stage has a different resource policy, use its normal capture operation
75
+ or explicitly reconcile that configuration; do not edit the saved receipt to
76
+ pretend it was captured under a different policy.
77
+ If the stage needs a newer source revision, fetch a new snapshot to a new directory
78
+ instead of describing the saved one as fresh. Existing `response_files` import
79
+ remains available, but may still fetch resources absent from those responses;
80
+ use an intact `snapshot_dir` for complete local reuse.
81
+
82
+ `context source discover lark` provides resumable Wiki directory discovery in an
83
+ existing Context workspace. It does not fetch bodies or register the inventory.
84
+ When no workspace exists, use the available source platform's authorized listing
85
+ capability; do not invent a workspace-free discovery flag or initialize a full
86
+ production scope only to list a directory. Batch registration and its checkpoints
87
+ belong to the selected production stage, not the full planning inventory.
88
+
89
+ ## Repository research
90
+
91
+ Reuse an existing authorized checkout at the requested revision. Read metadata
92
+ and selected paths before deciding whether more objects or files are needed.
93
+ For a new checkout, use the source platform's supported clone/read capabilities
94
+ and save the resolved commit in the PLAN. Keep remote read results tied to that
95
+ same commit, and fetch additional content only when the research requires it.
96
+
97
+ Respect uncommitted work in reused checkouts. Do not reset, replace, rebase or
98
+ switch a user's active worktree just to change the planning baseline. Use an
99
+ available read-only view or an authorized separate research checkout when the
100
+ required revision is unavailable locally.
@@ -0,0 +1,118 @@
1
+ # Project plan: <project name>
2
+
3
+ This report records the agreed project scope and stage progress. Complete the
4
+ relevant sections in ordinary Markdown; remove template guidance when filling
5
+ it in. It is a working report, not a machine-validated schema.
6
+
7
+ ## Outcome and current position
8
+
9
+ - Reader/audience and requested outcome:
10
+ - Knowledge workspace and Git root:
11
+ - Current project state and active stage:
12
+ - Last confirmed result:
13
+ - Next action:
14
+
15
+ ## Research scope and findings
16
+
17
+ | Source or subject | Kind and identity | Resolved version / capture context | Scale and coverage | Access or evidence gaps |
18
+ | --- | --- | --- | --- | --- |
19
+ | | | | | |
20
+
21
+ - For updates: each source's recorded baseline, target version and relevant changes:
22
+ - Representative material examined and findings affecting the plan:
23
+ - Distinct discovered count (exact / lower bound / estimate), selected count and capture count:
24
+ - Early scope confirmation for inventories above 100 / 500, chosen filters or explicit full-scope decision:
25
+ - Above-500 mandatory human gate: pending / resolved; observed task scope, actual human decision and trusted authority (Agent delegation is insufficient):
26
+ - If pending: saved checkpoint, question awaiting human intervention and resume condition; the whole task remains paused:
27
+ - Filter cutoff dates, classification evidence, unknown metadata and excluded groups:
28
+ - Additional sources/links discovered, excluded scope and unresolved coverage:
29
+ - Scratch research location and reusable checkpoints:
30
+
31
+ ## Existing knowledge and material relationships
32
+
33
+ - Workspace organization and relevant approved sections actually inspected:
34
+ - Existing source references and connections followed:
35
+ - Pending drafts, earlier stage deliveries or concurrent work to account for:
36
+ - Inspection coverage and any unavailable knowledge; do not treat unread as absent:
37
+
38
+ | Topic / reader task | Existing article and section | Incoming documents / repositories | Overlap, gap or conflict | Proposed disposition and reason | Related knowledge / source dependencies |
39
+ | --- | --- | --- | --- | --- | --- |
40
+ | | | | | Reuse / revise / consolidate / add / investigate | |
41
+
42
+ Group related material where useful; this is not a one-row-per-source inventory.
43
+ Support decisions with sections actually read. For new coverage, suggest an
44
+ existing section or explain the needed addition. Consolidation here is a proposal,
45
+ not permission to modify or retire approved articles during research.
46
+
47
+ ## Proposed stages
48
+
49
+ Use stable stage names. For a stage requiring publication, a delivery checkbox
50
+ stays empty while only registration, capture, writing, review or a local build
51
+ has completed. An explicitly publication-free stage may be marked delivered
52
+ when its agreed deliverable is complete; do not label it published.
53
+
54
+ | Delivered | Stage | Reader outcome and article targets | Selected sources and fixed refs | Scope counts and reason for any exception | Prerequisites | Current state |
55
+ | --- | --- | --- | --- | --- | --- | --- |
56
+ | [ ] | S01 | | | | | planned |
57
+
58
+ Explain how source groups map to useful articles rather than assuming one source
59
+ requires one article. Record document, newly investigated repository and revision
60
+ target counts for each relevant stage.
61
+
62
+ Recommend 30 source documents per stage; adjust for subject, length, complexity
63
+ and dependencies, with an absolute maximum of 50. Explain groups above 30 and
64
+ use smaller stages when needed. Keep one newly investigated repository per stage
65
+ and at most 30 revision target articles, even when the source-document group is larger.
66
+
67
+ ## Approval and execution choices
68
+
69
+ - First report presented to the user:
70
+ - Effective PLAN review policy (`ask` / `delegate`) and task-scoped override authority:
71
+ - Human approval or Agent review result, deficiencies resolved and scope adjustments:
72
+ - Execution authorization (separate from permission to research/review):
73
+ - Reporting: after all stages / after each stage:
74
+ - If reporting by stage: continue automatically / wait for a reply:
75
+ - Existing article review and managed execution settings:
76
+ - Agreed delivery destination and inherited publishing settings:
77
+ - Authorized Git branch, commit and PR/MR/integration process:
78
+ - Decisions still needed:
79
+
80
+ Do not assign release versions in advance. A project plan approval does not
81
+ stand in for article review, publishing permission or source authorization.
82
+
83
+ ## Current stage handoff
84
+
85
+ - Approved plan and selected stage ID:
86
+ - Bounded task passed to the existing Context Skill:
87
+ - Selected sources, pinned refs and relevant research:
88
+ - Existing article targets / new topics:
89
+ - Reuse, revision or consolidation decisions and relationships to preserve:
90
+ - Affected knowledge rechecked before this stage, including prior stage deliveries:
91
+ - Effective task-scoped review overrides and their trusted authorization:
92
+ - Inherited publishing and reporting choices:
93
+ - Evidence gaps or dependencies that affect this stage:
94
+
95
+ Project planning is already complete for this handoff. Production uses only this
96
+ stage's scope and its normal Route; the full inventory is not a new task input.
97
+
98
+ ## Results and synchronization
99
+
100
+ | Stage | Confirmed production/review result | Actual delivery and receipt/version | Commit / PR / MR | Merge state | Remaining action |
101
+ | --- | --- | --- | --- | --- | --- |
102
+ | | | | | | |
103
+
104
+ ## Resume notes
105
+
106
+ - Active job/command and current processing position:
107
+ - Persistent input/checkpoint and confirmed completed work:
108
+ - Outstanding review, integration or publication:
109
+ - Next executable action within the approved scope:
110
+ - Independent work that can continue:
111
+
112
+ A saved policy is a recovery record, not authorization by itself. On a resumed
113
+ session, validate delegation against trusted task instructions; otherwise retain
114
+ the default review policy until authorization is available.
115
+
116
+ Keep this report while any agreed delivery or integration remains pending.
117
+ After actual completion, remove it in the authorized final commit and synchronize
118
+ that commit; Git history preserves the approved plan and progress.
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "c4a",
3
3
  "displayName": "C4A Context",
4
- "version": "0.7.34",
4
+ "version": "0.7.36",
5
5
  "description": "Start or continue a project-local knowledge workspace through one graph-routed entry.",
6
6
  "author": {
7
7
  "name": "Context4AI",
@@ -27,6 +27,7 @@
27
27
  "commands": "./commands/",
28
28
  "skills": [
29
29
  "./skills/context-indexer-create",
30
- "./skills/context-inspect-search"
30
+ "./skills/context-inspect-search",
31
+ "./skills/context-plan"
31
32
  ]
32
33
  }
@@ -0,0 +1,9 @@
1
+ ---
2
+ description: "Plan or resume a large Context knowledge project, including initial research and updates across source versions. Use when explicitly requested, when continuing a PLAN report, or within an authorized Context project involving more than 30 source documents or substantive investigation of at least two repositories."
3
+ ---
4
+
5
+ # Context Plan
6
+
7
+ Read the installed `context-plan` skill at `../skills/context-plan/SKILL.md`
8
+ relative to this command file, then follow its instructions for the user's request.
9
+ Resolve its references and templates from that skill directory.