Skip to content

Commit 5e98602

Browse files
authored
docs: add AGENTS.md, contributing and development skills, issue forms and a concise README (#14)
* docs: add AGENTS.md, contributing and development skills, issue forms and a concise README - AGENTS.md states the repository's rules in their shortest form and links to the full statements: where a fact lives, who owns what (mcpp, backend, plugins, mcppls), the triage before a change (whose problem, core or plugin, fix or workaround), versions, build and test, code and the change workflow. - .agents/skills/mcpp-ide-contributing: triage, issues, branches, commits, pull requests and the rules an AI agent follows besides. - .agents/skills/mcpp-ide-development: the environment, the tests of each component, common changes (protocol, spec/, strings, fixtures, pins), diagnosing and the release procedure. - .github/ISSUE_TEMPLATE: bug, feature and task forms; blank issues are disabled, and questions, problems of mcpp and of mcppls are sent where they belong. A pull-request template. - README.md and README.zh-CN.md: badges, the architecture in one diagram, one table of the editors and one of installs, prompts for agents, and links. What they no longer state is in docs/versions.md (series and tags, the project's mcpp, the test features by mcpp). - .github/components.tsv: the issue and pull-request forms are documentation, so a change of them runs the documentation checks only (test_changes.sh holds the case). * docs: diagrams in mermaid with one palette, and copyable prompts for agents - README.md and README.zh-CN.md draw the layers as a mermaid flowchart in place of the text drawing: mcpp's contract into the backend, the backend into the plugins and agents, mcppls into every editor. - agents/README.md draws a session as a sequence diagram. - docs/architecture.md gains three: a build end to end, a test run end to end (a test session or mcpp test), and the order in which a plugin finds the backend. - Every diagram shares one palette that reads on light and dark backgrounds: indigo for mcpp and the backend, teal for the editors, amber for mcppls and notes, slate for lines and labels. - The agent prompts are code blocks, each copyable, with the documents they rely on beside them. * docs: one prompt for agents, one editors table with its marketplaces, straight diagrams - The README's agent section is one prompt: read AGENTS.md, then only what the task needs (install, understand, report an issue after triage, change the code); with no clear task, the agent says what mcpp-ide is and asks which direction, suggesting a first step for each, and it asks before any outward action. - Editors and installs are one table, linking the Visual Studio Marketplace, Open VSX and the JetBrains Marketplace (plugin 35632), and mcppls's extension and CLion plugin (35609). The JetBrains badge links the plugin's page by its numeric id; its XML id gave 404. mcppls is a dependency of the VS Code extension, not an extension pack. - The layers are one row with straight arrows: mcpp's contract into the backend, LSP both ways between the backend and the clients and between the clients and mcppls. - Every diagram shares one palette: slate for what lies outside, indigo for the backend and the clients, amber for mcppls and notes; flowcharts draw linear edges. * docs: the architecture as layers, each editor its own client - The README's diagram is layered: the clients on top, each editor (VS Code, CLion, Neovim) and agents a node of its own with its own connection; the backend, mcpp-ide serve, as the layer every decision lives in, with its parts (projects, jobs, view models, the rules of mcpp.toml); mcpp at the bottom, which the backend runs and whose contract it reads; mcppls beside it, whose status the backend asks and which reads mcpp's result record. - Colour carries ownership: indigo for mcpp-ide, amber for mcppls, slate for mcpp. Flowcharts draw curves again. * docs: a simpler architecture diagram in GitHub's palette - The README's diagram keeps its layers and drops what repeats: each client (VS Code, CLion, Neovim, agents) an arrow of its own into mcpp-ide serve, which runs mcpp under its contract and asks mcppls its status; the backend's parts and the repeated LSP labels are left to the text. - Every diagram takes GitHub's Primer colours: blue for mcpp-ide (the backend solid), purple for mcppls, grey for mcpp; the sequence diagrams' actors, messages and notes follow them.
1 parent 899013f commit 5e98602

16 files changed

Lines changed: 712 additions & 244 deletions

File tree

Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
---
2+
name: mcpp-ide-contributing
3+
description: Use when contributing to mcpp-ide -- reporting a bug, proposing a feature, opening an issue or a pull request, or making any change as a person or an AI agent. Covers triage (core or plugin, fix or workaround), issue and pull-request conventions, commits, review and merge.
4+
---
5+
6+
# Contributing to mcpp-ide
7+
8+
Read [AGENTS.md](../../../AGENTS.md) first: who owns what, and the rules every change follows. The
9+
flow is **issue → branch → pull request → CI → review → squash merge**. Nothing is pushed to `main`
10+
directly, whatever its size, and that includes a version bump or a change to documentation.
11+
12+
## 1. Triage before anything else
13+
14+
Answer the three questions of AGENTS.md §3 and write the answers into the issue:
15+
16+
| Question | How to decide | Outcome |
17+
|---|---|---|
18+
| Whose problem? | reproduce without the editor: `mcpp-ide self-check --json`, `mcpp-ide serve`, the mock mcpp | mcpp, mcppls or an editor's upstream: report it there and link it here |
19+
| Core or plugin? | would another editor need the same change? | yes → backend (`src/`, `spec/`, `protocol/`); no → `mide-plugins/<editor>` |
20+
| Fix or workaround? | does the cause lie in this repository? | no → no workaround by default; an exception states its cause, the upstream issue, why it cannot wait and when it is removed |
21+
22+
## 2. Issues
23+
24+
Open one with a template (`.github/ISSUE_TEMPLATE/`): **Bug report**, **Feature request** or
25+
**Task**. A blank issue is not offered, and a question goes to the
26+
[forum](https://forum.d2learn.org/category/20).
27+
28+
- Title: `<type>(<component>): <sentence>`, for example `fix(clion): the test tree loses a case's
29+
location after a rebuild`. The type is one of `feat`, `fix`, `refactor`, `perf`, `test`, `docs`,
30+
`ci`, `chore`. The component is `backend`, `vscode`, `clion`, `nvim`, `docs` or `ci`.
31+
- A bug carries the output of `mcpp-ide self-check --json` (backend, mcpp, mcppls, xlings, trust),
32+
the editor and its version, the steps, the expected and actual behaviour, and the triage answers.
33+
The IDE report (**mcpp: Export IDE Report**) is attached when the backend is involved.
34+
- A feature states the motivation, which party it belongs to, the protocol or `spec/` change it
35+
needs, and what each editor shows. A change larger than one pull request gets a design record in
36+
`.agents/docs/` (`YYYY-MM-DD-<subject>.md`, opening with its status) before any code.
37+
38+
## 3. Branches and commits
39+
40+
- Branch from the latest `main`: `<type>/<subject>`, for example `fix/clion-case-location`. A
41+
release is made on `release/X.Y.Z` (see [mcpp-ide-development](../mcpp-ide-development/SKILL.md)).
42+
- A commit is English and declarative, `<type>(<component>): <sentence>` or `X.Y.Z: <sentence>` for
43+
a release, with no emoji. Its body says why, citing the issue, the design record or mcpp's spec
44+
clause where there is one.
45+
46+
## 4. Pull requests
47+
48+
- One pull request does one thing and links the issue it closes (`Closes #N`). The title follows
49+
the commit form, since it becomes the subject of the squash merge.
50+
- The body follows `.github/pull_request_template.md`: summary, triage, the criteria (the test that
51+
fails before and passes after, and where it ran), compatibility and the checklist.
52+
- A change of behaviour updates, in the same pull request: `protocol/protocol.schema.json`, the docs
53+
it touches (README.md and README.zh-CN.md together), `spec/i18n` in both languages, and
54+
CHANGELOG.md under its series.
55+
- The required check is `ci`. It runs the components the change reaches (`.github/components.tsv`),
56+
so a backend change runs every plugin. A red job is fixed, never retried until green.
57+
- The merge is a squash with an explicit subject and body; GitHub's composed message is not used.
58+
59+
## 5. AI agents
60+
61+
An agent contributes under the same rules, plus these:
62+
63+
- **Read before writing:** AGENTS.md, the docs it links for the area, and the neighbouring code. Do
64+
the triage before editing, and say in the pull request which party the problem belongs to.
65+
- **Ask before outward actions:** creating an issue, a pull request, a comment, a tag or a release
66+
needs the person's confirmation. Never push to `main`, force-push a shared branch, merge, tag or
67+
publish unless explicitly asked.
68+
- **Report what ran:** each criterion says whether it ran locally, on which system, or was left to
69+
CI. A test that did not run is not described as passing.
70+
- **Stay in scope:** no drive-by refactors, no new dependency and no workaround for another party's
71+
problem without the person's decision.
72+
- **No attribution trailers:** commits and pull requests carry no `Co-Authored-By` lines or
73+
generated-by footers. The person who submits a change is responsible for it.
Lines changed: 77 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,77 @@
1+
---
2+
name: mcpp-ide-development
3+
description: Use when setting up a development environment for mcpp-ide, building or testing the backend or an editor plugin, changing the protocol, spec/, fixtures or strings, bumping a pinned tool, or preparing a release (a series vX.Y.0 or a plugin patch).
4+
---
5+
6+
# Developing mcpp-ide
7+
8+
## 1. Environment
9+
10+
The pins live in [.github/versions.env](../../../.github/versions.env), which CI reads. A local
11+
setup uses the same versions:
12+
13+
| Tool | Version | For | Install |
14+
|---|---|---|---|
15+
| xlings | `XLINGS_VERSION` | mcpp, toolchains, gradle | [xlings](https://github.com/d2learn/xlings) |
16+
| mcpp | `.xlings.json` (= `MCPP_VERSION`) | the backend; its toolchain comes from `mcpp.toml` | `xlings install` in the repository |
17+
| Node.js | 22 | the VS Code extension, the web UI tests | any Node 22 |
18+
| VS Code | `VSCODE_VERSION` (the oldest supported) | the extension's e2e tests | fetched by `@vscode/test-electron` |
19+
| Gradle and its JDK | xlings's | the CLion plugin | `xlings install gradle` |
20+
| Neovim | 0.10+ | the Neovim plugin | system package |
21+
22+
Check the environment with `mcpp build && mcpp run mcpp-ide -- self-check`.
23+
24+
## 2. Build and test, per component
25+
26+
Run what a change reaches ([.github/components.tsv](../../../.github/components.tsv)). A backend
27+
change reaches every plugin, because each plugin is tested over the backend.
28+
29+
| Component | Paths | Commands |
30+
|---|---|---|
31+
| backend | `src/`, `protocol/`, `spec/`, `webui/`, `tests/`, `testsupport/`, `mcpp.toml` | `mcpp build`, `mcpp test`, `mcpp run mcpp-ide-dev -- check-sources`, `mcpp run mcpp-ide-dev -- check-i18n` |
32+
| vscode | `mide-plugins/vscode/` | `npm ci && npm test`; `npm run test:parity`, `npm run test:webui`, `npm run test:e2e`; `npm run package` |
33+
| clion | `mide-plugins/clion/` | `gradle test buildPlugin verifyPlugin` |
34+
| nvim | `mide-plugins/nvim/` | `nvim --headless --clean -l mide-plugins/nvim/tests/smoke.lua` |
35+
| CI | `.github/` | `bash .github/scripts/test_changes.sh`, `bash .github/scripts/release-plan.sh` |
36+
37+
## 3. Common changes
38+
39+
- **A protocol method or notification:** change `protocol/protocol.schema.json` together with the
40+
backend and every plugin that uses it. The backend's tests check its answers against the schema.
41+
- **A setting, command or editor string:** edit `spec/` (`settings.json`, `commands.json`,
42+
`i18n/*.json`), then run `mcpp run mcpp-ide-dev -- gen vscode` and commit what it rewrites in
43+
`mide-plugins/vscode`. CLion's declarations are generated at build time. Neovim reads the table at
44+
run time. A command that an editor does not offer states why (`omitted`).
45+
- **A runtime string:** pass it through `t(...)` and add its Chinese entry to
46+
`spec/i18n/runtime.zh-cn.json`; `check-i18n` enforces this.
47+
- **What mcpp reports:** run `mcpp run mcpp-ide-dev -- capture` against a real mcpp and review the
48+
diff in `protocol/fixtures`. Update `protocol/mcpp-contract.schema.json` if the contract grew.
49+
The mock mcpp and every plugin's tests replay these fixtures.
50+
- **A feature of a newer mcpp or mcppls:** enable it from what mcpp states (`features`). An earlier
51+
release is described by a table frozen at that release, not by comparing versions.
52+
- **A pinned tool:** change `.github/versions.env`, `.xlings.json` and `mcpp = ">=..."` in
53+
`mcpp.toml` together, and only to versions that are already released and indexed.
54+
55+
## 4. Diagnosing
56+
57+
- `mcpp-ide self-check --json` reports the backend, mcpp and its contract, mcppls, xlings and trust.
58+
- The IDE report (**mcpp: Export IDE Report**, `:Mcpp exportReport`) collects the projects' mcpp,
59+
mcppls's status, the settings in effect, recent jobs and the backend's log.
60+
- `mcpp.backend.logLevel` controls how much the backend writes to the editor's log.
61+
62+
## 5. Release
63+
64+
The rules are in AGENTS.md §4 and [release-plan.sh](../../../.github/scripts/release-plan.sh).
65+
66+
1. Decide the kind. Any backend path changed since `vX.Y.0` means a series release `vX.Y+1.0` (or
67+
`vX+1.0.0`). Otherwise it is a plugin patch, `<vscode|clion|nvim>-vX.Y.Z+1`.
68+
2. On `release/<version>`, bump the version statements (all six for a series, only the plugin's
69+
own for a patch) and add the CHANGELOG.md section under its series, listing each component's
70+
version. Then run `bash .github/scripts/release-plan.sh <tag>`.
71+
3. Open a pull request titled `X.Y.Z: <sentence>` and merge it after `ci` passes.
72+
4. Tag the merge commit and push the tag. `release.yml` runs CI, publishes the GitHub release with
73+
`SHA256SUMS`, then submits the same VSIX to Open VSX and the same ZIP to JetBrains Marketplace.
74+
The Visual Studio Marketplace upload is manual. The secrets are `OPENVSX_TOKEN` and
75+
`JETBRAINS_TOKEN`; Marketplace availability follows JetBrains review.
76+
5. Watch the run until every job passes, then check that the release assets install
77+
(`mcpp-ide self-check` on a project).
Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
name: Bug report
2+
description: mcpp-ide or one of its editor plugins behaves wrongly
3+
title: "fix(<component>): "
4+
labels: [bug]
5+
body:
6+
- type: markdown
7+
attributes:
8+
value: |
9+
Triage first ([AGENTS.md §3](https://github.com/mcpp-community/mcpp-ide/blob/main/AGENTS.md)):
10+
reproduce without the editor where you can, and report problems of mcpp or mcppls in their own repositories.
11+
- type: dropdown
12+
id: component
13+
attributes:
14+
label: Component
15+
options: [backend, vscode, clion, nvim, packaging / install, docs]
16+
validations:
17+
required: true
18+
- type: textarea
19+
id: steps
20+
attributes:
21+
label: Steps to reproduce
22+
description: The smallest project and the actions that show the problem.
23+
placeholder: |
24+
1. mcpp new demo && cd demo
25+
2. ...
26+
validations:
27+
required: true
28+
- type: textarea
29+
id: expected
30+
attributes:
31+
label: Expected and actual behaviour
32+
validations:
33+
required: true
34+
- type: textarea
35+
id: selfcheck
36+
attributes:
37+
label: mcpp-ide self-check --json
38+
description: The backend, mcpp and its contract, mcppls, xlings and trust.
39+
render: json
40+
validations:
41+
required: true
42+
- type: input
43+
id: editor
44+
attributes:
45+
label: Editor and OS
46+
placeholder: VS Code 1.95 / CLion 2026.1 / Neovim 0.11 on Ubuntu 24.04 x86_64
47+
validations:
48+
required: true
49+
- type: dropdown
50+
id: party
51+
attributes:
52+
label: Whose problem is it?
53+
description: Where does it still reproduce once the editor is taken away?
54+
options:
55+
- The backend (every editor shows it)
56+
- One editor plugin only
57+
- Not sure yet
58+
validations:
59+
required: true
60+
- type: textarea
61+
id: logs
62+
attributes:
63+
label: Logs or IDE report
64+
description: "mcpp: Export IDE Report (Neovim :Mcpp exportReport), or the backend's log."

‎.github/ISSUE_TEMPLATE/config.yml‎

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
blank_issues_enabled: false
2+
contact_links:
3+
- name: Question or discussion
4+
url: https://forum.d2learn.org/category/20
5+
about: Usage questions and ideas go to the community forum.
6+
- name: A problem of mcpp itself
7+
url: https://github.com/mcpp-community/mcpp/issues/new/choose
8+
about: Wrong output from mcpp (builds, tests, the machine contract) is reported to mcpp.
9+
- name: A C++ language feature (mcppls)
10+
url: https://github.com/Sunrisepeak/mcpp-language-server/issues
11+
about: Completion, navigation and diagnostics of C++ files come from mcppls.
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
name: Feature request
2+
description: A new capability or a change of behaviour
3+
title: "feat(<component>): "
4+
labels: [enhancement]
5+
body:
6+
- type: textarea
7+
id: motivation
8+
attributes:
9+
label: Motivation
10+
description: The problem it solves, and for whom.
11+
validations:
12+
required: true
13+
- type: dropdown
14+
id: party
15+
attributes:
16+
label: Where does it belong?
17+
description: A decision every editor shares belongs to the backend; plugins only map it onto their UI.
18+
options:
19+
- Backend (protocol / spec), shown by every editor
20+
- One editor plugin's presentation
21+
- Needs mcpp or mcppls to state something new first
22+
validations:
23+
required: true
24+
- type: textarea
25+
id: design
26+
attributes:
27+
label: Design
28+
description: The protocol or spec/ change, what each editor shows, and the mcpp feature it relies on. A change larger than one pull request starts with a record in .agents/docs/.
29+
validations:
30+
required: true
31+
- type: textarea
32+
id: alternatives
33+
attributes:
34+
label: Alternatives considered

‎.github/ISSUE_TEMPLATE/task.yml‎

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
name: Task
2+
description: Maintenance, refactoring, CI, documentation or a release
3+
labels: [task]
4+
body:
5+
- type: dropdown
6+
id: type
7+
attributes:
8+
label: Type
9+
options: [refactor, perf, test, docs, ci, chore, release]
10+
validations:
11+
required: true
12+
- type: textarea
13+
id: what
14+
attributes:
15+
label: What and why
16+
validations:
17+
required: true
18+
- type: textarea
19+
id: done
20+
attributes:
21+
label: Done when
22+
description: The criteria that close this task.

‎.github/components.tsv‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,5 +25,8 @@ docs docs/*
2525
docs agents/*
2626
docs *.md
2727
docs LICENSE
28+
# The forms of issues and pull requests are read by people too, although they live under .github/.
29+
docs .github/ISSUE_TEMPLATE/*
30+
docs .github/pull_request_template.md
2831
# The workflows, the scripts and the pins every job runs with.
2932
all .github/*

‎.github/pull_request_template.md‎

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
## Summary
2+
3+
<!-- What changes and why, in declarative sentences. Closes #N. -->
4+
5+
## Triage
6+
7+
<!-- AGENTS.md §3: which party owns the problem (mcpp, mcppls, backend or one plugin)?
8+
A workaround for another party's problem states its cause, the upstream issue,
9+
why it cannot wait and when it is removed. Write "n/a" for a pure refactor. -->
10+
11+
## Criteria
12+
13+
<!-- For each change: the test that fails before and passes after, and where it ran
14+
(local system or CI job). A criterion left to CI says so. -->
15+
16+
## Compatibility
17+
18+
<!-- What a user or a client observes after the upgrade: a protocol change, a changed
19+
setting or default, a migration, the oldest mcpp or editor still supported. -->
20+
21+
## Checklist
22+
23+
- [ ] One thing; the title is `<type>(<component>): <sentence>` (or `X.Y.Z: <sentence>`).
24+
- [ ] The protocol schema, docs (README in both languages), `spec/i18n` and CHANGELOG.md follow the behaviour.
25+
- [ ] `spec/` is edited, not its output; `mcpp-ide-dev gen vscode` leaves no diff.
26+
- [ ] No commit carries an attribution trailer (`git log origin/main..HEAD -i --grep=Co-Authored-By` is empty).

‎.github/scripts/test_changes.sh‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,8 @@ check "its README is the plugin's" pull_request vscode=true docs=false backend=f
2626
check "documentation alone" pull_request docs=true backend=false vscode=false -- docs/x.md README.md
2727
check "the backend reaches every plugin" pull_request backend=true vscode=true clion=true nvim=true -- src/main.cpp
2828
check "spec/ is the backend's" pull_request backend=true vscode=true -- spec/test-frameworks.json
29+
check "the issue and pull-request forms are documentation" pull_request docs=true backend=false full=false -- .github/ISSUE_TEMPLATE/bug_report.yml .github/pull_request_template.md
30+
check "a skill is documentation" pull_request docs=true backend=false full=false -- .agents/skills/mcpp-ide-development/SKILL.md AGENTS.md
2931
check "a workflow reaches everything" pull_request full=true backend=true -- .github/workflows/ci.yml
3032
check "a path of no component reaches everything" pull_request full=true -- newdir/x
3133
check "a push reaches everything" push full=true backend=true -- docs/x.md

0 commit comments

Comments
 (0)