@c4a/context-cli 0.7.100 → 0.7.101

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 (75) hide show
  1. package/cli.js +1494 -713
  2. package/indexers/contracts/profile-contract.json +245 -245
  3. package/indexers/release-manifest.json +1 -1
  4. package/package.json +12 -12
  5. package/parserEntryWorker.js +80 -3
  6. package/plugins/VERSION +1 -1
  7. package/plugins/claude/.claude-plugin/plugin.json +1 -1
  8. package/plugins/claude/commands/context.md +4 -2
  9. package/plugins/claude/resources/context/routine-update.md +10 -3
  10. package/plugins/claude/skills/context-plan/SKILL.md +22 -4
  11. package/plugins/claude/skills/context-plan/references/knowledge-migration.md +167 -0
  12. package/plugins/claude/skills/context-plan/references/project-planning.md +5 -0
  13. package/plugins/claude/skills/context-plan/references/quality-audit.md +63 -0
  14. package/plugins/claude/skills/context-plan/references/research-report.md +80 -0
  15. package/plugins/claude/skills/context-plan/references/resource-tools.md +13 -0
  16. package/plugins/claude/skills/context-plan/references/stakeholder-intake.md +38 -0
  17. package/plugins/claude/skills/context-plan/templates/PLAN.md +25 -0
  18. package/plugins/claude/skills/context-plan/templates/research-report/README.md +79 -0
  19. package/plugins/claude/skills/context-plan/templates/research-report/build.mjs +144 -0
  20. package/plugins/claude/skills/context-plan/templates/research-report/example/01-conclusions.md +28 -0
  21. package/plugins/claude/skills/context-plan/templates/research-report/example/A-wiki-a.md +10 -0
  22. package/plugins/codex/.codex-plugin/plugin.json +2 -2
  23. package/plugins/codex/skills/context/SKILL.md +4 -2
  24. package/plugins/codex/skills/context/references/routine-update.md +10 -3
  25. package/plugins/codex/skills/context-plan/SKILL.md +22 -4
  26. package/plugins/codex/skills/context-plan/references/knowledge-migration.md +167 -0
  27. package/plugins/codex/skills/context-plan/references/project-planning.md +5 -0
  28. package/plugins/codex/skills/context-plan/references/quality-audit.md +63 -0
  29. package/plugins/codex/skills/context-plan/references/research-report.md +80 -0
  30. package/plugins/codex/skills/context-plan/references/resource-tools.md +13 -0
  31. package/plugins/codex/skills/context-plan/references/stakeholder-intake.md +38 -0
  32. package/plugins/codex/skills/context-plan/templates/PLAN.md +25 -0
  33. package/plugins/codex/skills/context-plan/templates/research-report/README.md +79 -0
  34. package/plugins/codex/skills/context-plan/templates/research-report/build.mjs +144 -0
  35. package/plugins/codex/skills/context-plan/templates/research-report/example/01-conclusions.md +28 -0
  36. package/plugins/codex/skills/context-plan/templates/research-report/example/A-wiki-a.md +10 -0
  37. package/plugins/cursor/.cursor-plugin/plugin.json +1 -1
  38. package/plugins/cursor/commands/c4a-context.md +4 -2
  39. package/plugins/cursor/resources/context/routine-update.md +10 -3
  40. package/plugins/cursor/skills/context-plan/SKILL.md +22 -4
  41. package/plugins/cursor/skills/context-plan/references/knowledge-migration.md +167 -0
  42. package/plugins/cursor/skills/context-plan/references/project-planning.md +5 -0
  43. package/plugins/cursor/skills/context-plan/references/quality-audit.md +63 -0
  44. package/plugins/cursor/skills/context-plan/references/research-report.md +80 -0
  45. package/plugins/cursor/skills/context-plan/references/resource-tools.md +13 -0
  46. package/plugins/cursor/skills/context-plan/references/stakeholder-intake.md +38 -0
  47. package/plugins/cursor/skills/context-plan/templates/PLAN.md +25 -0
  48. package/plugins/cursor/skills/context-plan/templates/research-report/README.md +79 -0
  49. package/plugins/cursor/skills/context-plan/templates/research-report/build.mjs +144 -0
  50. package/plugins/cursor/skills/context-plan/templates/research-report/example/01-conclusions.md +28 -0
  51. package/plugins/cursor/skills/context-plan/templates/research-report/example/A-wiki-a.md +10 -0
  52. package/plugins/skills/context/SKILL.md +4 -2
  53. package/plugins/skills/context/references/routine-update.md +10 -3
  54. package/plugins/skills/context-plan/SKILL.md +22 -4
  55. package/plugins/skills/context-plan/references/knowledge-migration.md +167 -0
  56. package/plugins/skills/context-plan/references/project-planning.md +5 -0
  57. package/plugins/skills/context-plan/references/quality-audit.md +63 -0
  58. package/plugins/skills/context-plan/references/research-report.md +80 -0
  59. package/plugins/skills/context-plan/references/resource-tools.md +13 -0
  60. package/plugins/skills/context-plan/references/stakeholder-intake.md +38 -0
  61. package/plugins/skills/context-plan/templates/PLAN.md +25 -0
  62. package/plugins/skills/context-plan/templates/research-report/README.md +79 -0
  63. package/plugins/skills/context-plan/templates/research-report/build.mjs +144 -0
  64. package/plugins/skills/context-plan/templates/research-report/example/01-conclusions.md +28 -0
  65. package/plugins/skills/context-plan/templates/research-report/example/A-wiki-a.md +10 -0
  66. package/providers/context/manifest.json +18 -18
  67. package/providers/context/provider.yaml +1 -1
  68. package/providers/context/resources/manuals/guides/knowledge-updates.md +47 -0
  69. package/providers/context/resources/manuals/guides/package-outputs.md +8 -0
  70. package/providers/context/resources/procedures/knowledge-review.md +13 -0
  71. package/providers/context/resources/procedures/knowledge-updates.md +47 -0
  72. package/providers/context/resources/procedures/production-requirements.md +7 -0
  73. package/providers/context/resources/procedures/production-stage-files.md +37 -0
  74. package/providers/context/resources/procedures/source-capture-detailed.md +5 -0
  75. package/providers/context/schemas/indexer-agent-step-result.schema.json +3 -0
@@ -0,0 +1,167 @@
1
+ # Bring existing knowledge collections into a workspace
2
+
3
+ Use when the project covers knowledge that someone already curated: knowledge
4
+ or wiki repositories (including LLM-maintained wikis), documentation
5
+ directories, another Context workspace, or published knowledge packages.
6
+ This is research guidance for the PLAN; registration and production still
7
+ follow the `context` Skill after approval.
8
+
9
+ ## Identify each collection's kind
10
+
11
+ Inspect the structure before reading bodies. Typical kinds and their signals:
12
+
13
+ | Kind | Signals | Where its value is |
14
+ | --- | --- | --- |
15
+ | Mirror plus summary | A raw or mirror directory of copied documents with source metadata (original link, revision), plus a small set of summary pages | The original documents behind it; the summary layer is secondary |
16
+ | Raw archive | Hundreds or thousands of copied documents or code snapshots, a source list, few distilled pages | Coverage of the originals; needs scoping and batches |
17
+ | Code-curated wiki | Pages written from source code, often with evidence tables naming files, symbols and a code revision | The code it cites; the pages show which questions matter |
18
+ | Maintained first-hand wiki | Organized pages, frequent recent commits by a team, often its own skills, checks or evaluations | The pages themselves; the team keeps them current |
19
+ | Published package or skill | A versioned knowledge package or skill from a registry | Its versioned content; follows its publisher's releases |
20
+
21
+ A collection can contain several kinds; classify parts separately when they
22
+ need different treatment. Record commit activity, owners and last update, since
23
+ they decide whether the collection is still maintained.
24
+
25
+ ## Trace the real upstreams
26
+
27
+ For each collection, list the documents, repositories and other sources its
28
+ pages were built from, using source metadata, source lists, frontmatter, links
29
+ and evidence tables. Deduplicate by actual identity and compare with the
30
+ workspace's registered sources. Record how many are already registered, how
31
+ many are new and stable, and how many are research notes, duplicates, archives
32
+ or empty pages. Report unreadable upstreams as access gaps, not as absent.
33
+
34
+ Estimate what is unique to the collection after removing content that the
35
+ existing articles and the traced upstreams already cover: the collection
36
+ author's own judgments, operating procedures, tables or examples that exist
37
+ nowhere else.
38
+
39
+ ## Compare with the existing knowledge
40
+
41
+ Apply the coverage map in [project-planning.md](project-planning.md). For each
42
+ collection also produce:
43
+
44
+ - **Impact on navigation**: a pruned tree of the existing navigation showing
45
+ which existing articles would be revised, which articles would be added and
46
+ which new subsections are needed. Respect structural constraints from the
47
+ intake, such as keeping the top-level sections; place new topics inside the
48
+ existing sections where readers already look for them.
49
+ - **Conflicts**: statements that disagree with existing articles or with code,
50
+ with both sides quoted briefly. Existing articles can be wrong too.
51
+
52
+ ## Choose an integration approach
53
+
54
+ | Approach | What happens | Content rewritten | Errors correctable from code | Original afterwards |
55
+ | --- | --- | --- | --- | --- |
56
+ | Standard production | Produce articles from the collection's own knowledge: register the collection as a document source (a file source keeping its folders, following its repository version as an origin), or the code its evidence cites (a code-curated wiki then guides which questions to answer) | Yes | Yes | Can be archived once the workspace maintains the topic |
57
+ | Register original upstream | Replace a mirror or summary layer with the original documents it copied; keep only the author's unique judgments as notes | Yes, from the originals | Yes | The summary layer can stop being maintained |
58
+ | Keep unchanged | Keep the collection's pages as they are, placed in the existing sections and selected into a package | No | Only flag when cited code changes | Maintained where it is |
59
+ | In-repository knowledge | Leave the collection in its repository for agents working there; not part of the workspace | No | No | Maintained where it is |
60
+ | Mechanical packaging | Package the collection's files unchanged with a script, outside the workspace | No | No | Maintained where it is |
61
+ | External package source | Install a published package or skill at an exact version and register it as a file source with that origin | Yes | Yes, with code sources | Follows the publisher |
62
+
63
+ Choose per collection, or per part of a collection, using the intake answers:
64
+ where the knowledge really comes from, whether its team keeps maintaining it,
65
+ what must stay unchanged, and how much it overlaps existing articles. Score each
66
+ plausible approach for each collection on a 1–5 fit scale against those intake
67
+ criteria (5 fits best), and show feasibility, effort (for example agent days and
68
+ review time) and risk next to the score. Explain the choice together with its
69
+ benefit and its cost. Approaches can be combined, for example registering the
70
+ upstream of a raw archive while keeping a few distilled pages unchanged.
71
+
72
+ Check what the installed Context actually supports before recommending an
73
+ approach. Approaches the installation cannot perform yet are recorded as options
74
+ with their limitation, not presented as ready. In particular:
75
+
76
+ - A repository source currently has one subpath and no exclusion rules, and
77
+ repository sources are processed as code. A repository that contains only
78
+ Markdown does not enter document production when registered as a repository.
79
+ Register it as a file source that keeps its folders, with the repository and
80
+ commit as its origin, so routine updates follow new commits; or register its
81
+ original upstream instead when it mirrors or summarizes other documents.
82
+ - A file source commits its captured snapshot (documents and the images they
83
+ link), so a very large collection grows the workspace repository; select the
84
+ folders articles need with include rules. Installed origin content itself is
85
+ not committed.
86
+ - Package-only content is available: bind the articles under a hidden knowledge
87
+ map category so they stay out of website navigation, select them into their
88
+ package, and link them from an entry article on the main site. Add the paths to
89
+ the website package's `select.exclude` to leave the pages off the website.
90
+ - Keeping pages unchanged goes through production with `preserve_original: true`
91
+ on the requirement: register the collection as a file source that keeps its
92
+ folders (with its repository and commit as origin when it keeps changing), and
93
+ list the code repositories the pages describe in `evidence_source_scope`.
94
+ Writers keep each page's title, sections, order and wording, cite its lines and
95
+ the code it describes, and propose contradictions with the code for review:
96
+ the user accepts them (also proposing the fix upstream), keeps them only
97
+ locally, or keeps the original. Decisions live in the articles and their
98
+ history. Managed and routine runs revise locally. Each
99
+ page still goes through ordinary batches and review; estimate that cost.
100
+
101
+ When the user chooses an approach the installation cannot perform yet, keep the
102
+ choice, mark the affected stage as blocked by that capability, propose an interim
103
+ approach that can run now (for example mechanical packaging outside the workspace),
104
+ and record the capability dependency in the PLAN.
105
+
106
+ ## Scale and stage limits for collections
107
+
108
+ Count documents by their upstream identity: mirrored copies inside a collection
109
+ are the same documents as their originals, not additional sources. Apply the
110
+ planning scope rules to the distinct upstream documents in this task's scope; a
111
+ large mirror can trigger the human scope question, which may be asked early with
112
+ the evidence already available. The one-new-repository-per-stage limit applies to
113
+ code repositories investigated for production; a collection kept unchanged or
114
+ bypassed in favor of its upstream does not count as a new repository.
115
+
116
+ ## Prepare content that is kept unchanged or packaged mechanically
117
+
118
+ Content that will not be rewritten needs a readiness check before it is selected
119
+ into a package: every page reachable from its index, relative links resolving,
120
+ images and attachments actually present (not placeholders or remote-only files),
121
+ no template or placeholder rows in its source lists, and no credentials or private
122
+ data in logs and build files. Report findings to the owning team instead of
123
+ editing their pages.
124
+
125
+ ## Skills and tools inside collections
126
+
127
+ Collections may carry their own skills, agents or scripts. Do not package them as
128
+ knowledge. Recommend publishing them through the host's skill distribution, and
129
+ assess separately any that write data or call production systems.
130
+
131
+ ## Earlier integrations
132
+
133
+ Check whether the workspace already absorbed an earlier version of a collection,
134
+ for example as notes or articles from a previous project. Record what will
135
+ supersede those notes and which articles they support, so earlier material is not
136
+ duplicated or left contradicting the new sources.
137
+
138
+ ## Following an upstream or absorbing once
139
+
140
+ | Mode | What to do | Afterwards |
141
+ | --- | --- | --- |
142
+ | Follow the upstream | Register the collection, its modules or its originals as sources with fixed versions; a versioned collection or package becomes a file source with an origin | Routine updates follow the upstream; the original team keeps maintaining it |
143
+ | Absorb once | Bring the material in one time — original files as a file source keeping its folders, the author's judgments as notes — and produce articles from it; freeze the file source when the original is archived | The original can be archived; maintenance moves to the workspace |
144
+
145
+ Notes carry summaries and supplements: decisions, procedures, comparisons or
146
+ explanations that exist nowhere else. Do not copy whole summary pages into notes
147
+ when their originals can be registered.
148
+
149
+ ## Packages and navigation
150
+
151
+ Navigation and package scope are independent. A package selects approved
152
+ articles by path patterns or explicit lists, so a new package does not need its
153
+ own top-level section. Explicit lists are normal in an existing workspace whose
154
+ paths are organized by article type; path conventions help mainly for new
155
+ subdirectories, where package selection can then follow new articles
156
+ automatically.
157
+
158
+ When the project produces separate packages, list each package's articles
159
+ individually with their navigation location and status (added, revised, kept
160
+ unchanged, unchanged). Include existing unchanged articles from the navigation
161
+ subtrees the package covers and the articles its new or revised articles link to;
162
+ a large unchanged module may be listed as one row with its page count.
163
+ Content that should appear only in a package, not in website navigation, goes
164
+ under a hidden knowledge map category.
165
+
166
+ State the basis of every overlap figure (pages or characters) and use the same
167
+ basis across collections where possible.
@@ -125,6 +125,11 @@ an unrelated source. Keep approved pages, pending drafts, older package output
125
125
  and previous PLAN deliveries distinct; a draft is pending work, not an approved
126
126
  answer or a reason to produce the same page again.
127
127
 
128
+ When the incoming material is an existing knowledge collection (a wiki or
129
+ knowledge repository, documentation directory, another workspace or a published
130
+ package), also identify its kind, real upstreams and quality as described in
131
+ [knowledge-migration.md](knowledge-migration.md) and [quality-audit.md](quality-audit.md).
132
+
128
133
  Record a compact coverage-and-relationship map in the PLAN, grouping related
129
134
  sources where useful. For each proposed topic, identify the existing page or
130
135
  section, the new material, the actual overlap or gap, useful connections and
@@ -0,0 +1,63 @@
1
+ # Audit the accuracy and freshness of existing knowledge
2
+
3
+ Use during research on an existing knowledge collection, and on existing
4
+ workspace articles that the project will revise. The audit gives evidence for
5
+ the integration approach; it does not correct anything during research.
6
+
7
+ ## Sample claims that code can confirm
8
+
9
+ For each collection, pick about ten concrete claims that the pinned code can
10
+ confirm or refute: service or module names, table and field names, interfaces,
11
+ states and transitions, configuration keys, thresholds and time limits, and
12
+ code paths. Spread the sample across the collection's main areas; prefer claims
13
+ readers would act on.
14
+
15
+ Check each claim against code at a fixed revision. Use already registered or
16
+ locally available repositories first; record repositories you could not read
17
+ instead of cloning unrelated ones. Classify each result:
18
+
19
+ | Result | Meaning |
20
+ | --- | --- |
21
+ | Consistent | The code supports the claim |
22
+ | Partly consistent | The core holds but a detail differs or is incomplete |
23
+ | Inconsistent | The code contradicts the claim |
24
+ | Unverifiable | The claim depends on configuration, data or code that was not available |
25
+
26
+ Record for each claim: the statement, where it appears, the code location, the
27
+ result and, for inconsistencies, what the code actually does.
28
+
29
+ ## Check freshness
30
+
31
+ Note how the collection records currency: update dates, verified revisions,
32
+ status labels. Compare them with the upstream's actual changes, for example
33
+ commits to the cited code since the verified revision, or newer document
34
+ revisions. Flag pages that claim to be current but have not been reviewed
35
+ since material changes.
36
+
37
+ ## Classify the problems
38
+
39
+ Group the inconsistencies and stale items into two kinds:
40
+
41
+ - **Written wrong**: inconsistent with code when written — often names, paths,
42
+ formats or omitted branches. Citing specific code lines while writing and
43
+ reviewing exposes these.
44
+ - **Went stale**: correct once, but the code or rules changed and the page did
45
+ not follow. Comparing cited source regions on scheduled updates exposes these.
46
+
47
+ Include problems found in the existing workspace articles too; the comparison
48
+ is about the method, not about whose content is better.
49
+
50
+ ## Decide how much code evidence each collection needs
51
+
52
+ - Mirrors and summaries of documents: regenerate from the originals and code;
53
+ do not cite the summaries as evidence.
54
+ - Code-curated collections: anchor to current code so drift is detected.
55
+ - Maintained first-hand collections with their own checks: code evidence may be
56
+ limited to flagging changes when they are kept unchanged.
57
+
58
+ ## Report
59
+
60
+ Show the totals per collection, a handful of concrete examples with their
61
+ classification and consequence for readers, and which step of the production
62
+ process would catch each kind of problem. State the cost of that process —
63
+ source registration, review and running scheduled updates — next to its benefit.
@@ -0,0 +1,80 @@
1
+ # Write the research report and discuss it
2
+
3
+ Use when stakeholders must choose between approaches or the research covers
4
+ existing knowledge collections. The report is a communication document for
5
+ people; the PLAN remains the working record. Keep both consistent.
6
+
7
+ ## Structure: conclusions first
8
+
9
+ 1. **Conclusions and recommendation**: a one-screen summary of the current
10
+ state, the recommendation per collection and the benefit next to the cost;
11
+ then the reasons, next steps and a short reading guide.
12
+ 2. **Approaches and their trade-offs**: a neutral description of the
13
+ production process and where each candidate approach attaches to it, ending
14
+ with the cross-collection score matrix and each approach's trade-offs.
15
+ 3. **Recommended plan**: target shape including how readers and agents reach
16
+ the packages (installation, query services, repository agent instructions),
17
+ packages, stages, maintenance ownership, a table comparing the current state
18
+ with the recommendation by dimension (coverage, accuracy, freshness,
19
+ maintenance burden, content kept unchanged) together with the cost, decisions
20
+ needed and risks.
21
+ 4. **Impact on the knowledge structure**: an overview tree of navigation
22
+ changes, then per-collection detail. When a constraint or decision changes the
23
+ placement, show the alternatives side by side.
24
+ 5. **Packages and their articles**: each package's articles listed individually
25
+ with navigation location and status.
26
+ 6. **Comparison with existing knowledge**: how each collection is organized,
27
+ overlap, conflicts and upstream registration status.
28
+ 7. **Quality**: audit totals, concrete examples and what would catch them,
29
+ with one example traced over time to show how scheduled source comparison
30
+ would have caught a stale statement.
31
+ 8. **Background**: meeting decisions and action items, proposals, method.
32
+ 9. **Appendices**: one per collection, each opening with a one-picture summary
33
+ (composition, overlap, audit result, approach scores, conclusion).
34
+
35
+ Open each chapter with its own conclusion in one or two sentences.
36
+
37
+ ## Writing rules
38
+
39
+ - Plain language for people new to the subject; define approach names once and
40
+ use them consistently.
41
+ - Objective tone: describe what each collection and team already provides; do
42
+ not present the recommended process as self-evidently superior.
43
+ - Pair every benefit with its execution cost.
44
+ - Name documents by title and repositories by name instead of pasting long
45
+ addresses; long file paths may be shortened in display while keeping the full
46
+ path available to copy.
47
+ - State how numbers were obtained and label estimates.
48
+
49
+ ## Figures
50
+
51
+ Prefer figures over long tables where they help:
52
+
53
+ | Figure | Shows |
54
+ | --- | --- |
55
+ | Collection map | Collections placed by knowledge origin and maintenance activity |
56
+ | Composition | Original copies versus distilled content per collection |
57
+ | Overlap | Share of duplicated, complementary and new content |
58
+ | Upstream registration | Registered versus unregistered upstreams |
59
+ | Audit results | Consistent, partial, inconsistent and unverifiable claims |
60
+ | Approach scores | Each collection scored on each approach, recommendation marked |
61
+ | Production process | Where each approach attaches (as a tree or table) |
62
+ | Navigation impact | Pruned tree marking added, revised, new sections and unchanged content |
63
+
64
+ ## Build and share
65
+
66
+ Write chapters as Markdown files and build a single-page HTML report with
67
+ [the report template](../templates/research-report/README.md): chapter list on the
68
+ left, one chapter at a time in the middle, the chapter's outline on the right.
69
+ Keep chapter sources and figure data under `.tmp/context-plans/<slug>/research/`.
70
+ Share through a channel that keeps the report access-controlled; do not upload
71
+ it to publicly readable storage. Uploading creates an external copy, so confirm
72
+ with the user before publishing it.
73
+
74
+ ## Discuss and record decisions
75
+
76
+ Expect several rounds. After each round, update the report and record each
77
+ decision in the PLAN with its date and who made it; keep open questions visible.
78
+ When an answer is ambiguous, state the interpretation you applied and invite
79
+ correction. A decision on the approach is not approval of the PLAN or of
80
+ production; follow the review policy in the Skill.
@@ -98,3 +98,16 @@ Respect uncommitted work in reused checkouts. Do not reset, replace, rebase or
98
98
  switch a user's active worktree just to change the planning baseline. Use an
99
99
  available read-only view or an authorized separate research checkout when the
100
100
  required revision is unavailable locally.
101
+
102
+ ## Read research material with indexer reading rules
103
+
104
+ Before any source is registered, research may borrow the installed indexers'
105
+ reading methods to explore saved material under `.tmp/context-plans/<slug>/`:
106
+ for documents, start from titles, bounded opening excerpts and the complete
107
+ H2/H3 outline, then read selected full text; for code, start from entry points,
108
+ module boundaries and public interfaces, then read what the quality audit needs.
109
+ This is a reading method only. Do not run indexer production commands, invoke
110
+ indexer Skills as if a production stage were active, register sources, or create
111
+ review candidates during research. Production uses the indexers after the PLAN
112
+ is approved, through the `context` Skill's Route.
113
+
@@ -0,0 +1,38 @@
1
+ # Establish purpose and constraints
2
+
3
+ Use before deep research, and again when a new stakeholder joins the project.
4
+ The answers become the evaluation criteria for the research and the report;
5
+ they do not authorize production, publication or source access.
6
+
7
+ ## Read what already exists first
8
+
9
+ Read the material the user supplied or pointed to: meeting notes, proposals,
10
+ filled source checklists, previous PLANs and the existing workspace's guidance.
11
+ Extract the stated goals, commitments, open questions and the action items
12
+ assigned to each person. When a meeting record is a transcript without a summary,
13
+ derive the decisions and action items from the conversation and label them as
14
+ derived. Ask only about what remains unknown.
15
+
16
+ ## Questions to settle
17
+
18
+ Ask the missing ones together, in one exchange, in the conversation language:
19
+
20
+ | Topic | What to learn | Why it matters |
21
+ | --- | --- | --- |
22
+ | Existing knowledge | Where knowledge already lives (repositories, wikis, documents, packages) and who maintains each | Determines the inventory and who to ask when access fails |
23
+ | Maintenance afterwards | Whether each collection keeps being maintained where it is, or moves into the workspace | Decides between following an upstream and absorbing it once |
24
+ | Content that must not change | Procedures, policies or pages that must keep their original wording | Decides whether an unchanged or reference-only approach is needed |
25
+ | Readers and uses | Who reads the result: coding agents, Q&A, on-call, onboarding | Shapes article boundaries and package split |
26
+ | Package split | Whether different readers need separate packages, and their scope | Decides package selection, independent of navigation |
27
+ | Structural constraints | Limits such as keeping the existing top-level sections | Constrains where new topics may go |
28
+ | Delivery and review | Review mode, reporting rhythm, delivery destination | Inherited by the PLAN and its stages |
29
+
30
+ Accept "not decided yet" as an answer and record it as an open decision; do
31
+ not block research on it. Do not ask about permissions the user cannot grant.
32
+
33
+ ## Record and reuse
34
+
35
+ Write the answers into the PLAN's purpose and decision sections, separating
36
+ facts the user stated, items derived from documents and open questions. Reuse
37
+ them across stages and resumed sessions; ask again only when the scope changes
38
+ materially or a stakeholder contradicts an earlier answer.
@@ -12,6 +12,16 @@ it in. It is a working report, not a machine-validated schema.
12
12
  - Last confirmed result:
13
13
  - Next action:
14
14
 
15
+ ## Purpose, constraints and decisions
16
+
17
+ - Stated purpose, readers and uses (source: user / derived from documents):
18
+ - Where existing knowledge lives, who maintains it, and where it will be maintained afterwards:
19
+ - Content that must not be rewritten; structural constraints (for example keeping top-level sections):
20
+ - Package split and audiences:
21
+ - Decision log (date or "date unknown" with its source, decision, who decided; ambiguous answers record the interpretation applied):
22
+ - Content conflicts awaiting adjudication and who decides:
23
+ - Open decisions:
24
+
15
25
  ## Research scope and findings
16
26
 
17
27
  | Source or subject | Kind and identity | Resolved version / capture context | Scale and coverage | Access or evidence gaps |
@@ -28,6 +38,16 @@ it in. It is a working report, not a machine-validated schema.
28
38
  - Additional sources/links discovered, excluded scope and unresolved coverage:
29
39
  - Scratch research location and reusable checkpoints:
30
40
 
41
+ ## Existing knowledge collections (omit when none)
42
+
43
+ | Collection | Kind and evidence | Maintenance (owner, last update) | Upstreams: registered / new / low value | Unique content estimate | Audit: consistent / partial / inconsistent / unverifiable | Chosen approach, mode (follow / absorb once) and reason |
44
+ | --- | --- | --- | --- | --- | --- | --- |
45
+ | | | | | | | |
46
+
47
+ - Approaches considered per collection with their scores, benefit and cost; capability limits of the installed Context:
48
+ - Quality findings: representative problems, written wrong or went stale, and their consequence for readers:
49
+ - Research report location and the discussion rounds held:
50
+
31
51
  ## Existing knowledge and material relationships
32
52
 
33
53
  - Workspace organization and relevant approved sections actually inspected:
@@ -44,6 +64,11 @@ Support decisions with sections actually read. For new coverage, suggest an
44
64
  existing section or explain the needed addition. Consolidation here is a proposal,
45
65
  not permission to modify or retire approved articles during research.
46
66
 
67
+ ## Target structure and packages
68
+
69
+ - Navigation impact: pruned tree of existing sections with added, revised, new-section and kept-unchanged marks; new topics placed inside existing sections where possible:
70
+ - Packages: name, audience, selection rule (path patterns or explicit list), and each package's article list or the report chapter that holds it:
71
+
47
72
  ## Proposed stages
48
73
 
49
74
  Use stable stage names. For a stage requiring publication, a delivery checkbox
@@ -0,0 +1,79 @@
1
+ # Research report template
2
+
3
+ `build.mjs` turns a directory of Markdown chapters into a single-page HTML report:
4
+ chapter list on the left, one chapter at a time in the middle, the chapter's
5
+ outline on the right. It needs only Node.js and has no package dependencies.
6
+
7
+ ```bash
8
+ node <skill-dir>/templates/research-report/build.mjs \
9
+ .tmp/context-plans/<slug>/research/report \
10
+ .tmp/context-plans/<slug>/research/report.html \
11
+ --title "<report title>" --subtitle "<date · baseline>"
12
+ ```
13
+
14
+ ## Chapters
15
+
16
+ - One file per chapter, ordered by file name: `01-conclusions.md`, `02-approaches.md`, …
17
+ - Files whose name starts with a capital letter and a separator (`A-…`, `B-…`)
18
+ are listed as appendices.
19
+ - Each file starts with `# Title`; `##` and `###` headings form the right-hand outline.
20
+ - Supported Markdown: headings, paragraphs, lists (one nested level), tables,
21
+ block quotes, code, inline code, bold and links. Images and italics are not
22
+ supported. Inline code that looks like a file or directory path (any script)
23
+ is shown shortened and copies the full path on click.
24
+ - `example/` contains a small two-chapter report; build it to see the layout.
25
+
26
+ ## Figures
27
+
28
+ Navigation trees use a `tree` block; end a line with `[add]`, `[mod]`, `[dir]`
29
+ or `[keep]` to mark added articles, revised articles, new sections and content
30
+ kept unchanged. Lines without a marker are unchanged context:
31
+
32
+ ````markdown
33
+ ```tree
34
+ Knowledge base
35
+ ├── Business
36
+ │ └── Billing rules [mod]
37
+ └── Operations
38
+ └── Incident handbook [dir]
39
+ ```
40
+ ````
41
+
42
+ Bar charts and score matrices use a `chart` block with JSON:
43
+
44
+ ````markdown
45
+ ```chart
46
+ {"title": "Code check results", "legend": ["consistent", "partial", "inconsistent", "unverifiable"],
47
+ "rows": [{"label": "Wiki A", "values": [7, 0, 2, 1]}, {"label": "Wiki B", "values": [11, 0, 0, 1]}]}
48
+ ```
49
+ ````
50
+
51
+ ```chart
52
+ {"type": "matrix", "title": "Approach scores", "columns": ["Standard", "Upstream", "Unchanged"],
53
+ "rows": ["Wiki A", "Wiki B"], "values": [[4, 5, 2], [5, 4, 2]], "max": 5}
54
+ ```
55
+
56
+ A matrix marks the row maximum unless `recommend` lists the recommended cells as
57
+ `[[row, column], …]` (zero-based), which also allows combined recommendations.
58
+
59
+ A scatter chart places collections on two axes, for example knowledge origin and
60
+ maintenance activity:
61
+
62
+ ````markdown
63
+ ```chart
64
+ {"type": "scatter", "title": "Collection map", "xlabel": "from documents → from code",
65
+ "ylabel": "maintenance activity", "xmax": 10, "ymax": 10,
66
+ "points": [{"x": 2, "y": 3, "label": "Wiki A", "note": "mirror plus summary"}]}
67
+ ```
68
+ ````
69
+
70
+ Optional `colors`, `unit`, `max`, `segmentLabels` (print each segment's value) and
71
+ per-row `note` adjust a bar chart. Draw process or architecture diagrams as a
72
+ `tree` block or a table. An invalid chart stops the build with the chapter file
73
+ and line.
74
+
75
+ ## Labels
76
+
77
+ Pass `--labels labels.json` to translate interface labels, for example
78
+ `{"add": "新增", "mod": "修订", "dir": "新目录", "keep": "原样", "report": "报告",
79
+ "appendix": "附录", "outline": "本章目录", "prev": "上一章", "next": "下一章", "copied": "已复制"}`.