archgen-mcp 0.0.6 → 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +14 -9
- package/assets/briefs/investigate.md +16 -17
- package/assets/briefs/review.md +41 -29
- package/assets/briefs/survey.md +17 -20
- package/assets/briefs/verifier.md +52 -40
- package/assets/harness-mcp.json +285 -55
- package/assets/platform-capabilities.json +387 -71
- package/assets/references/artifact-templates.md +68 -219
- package/assets/references/interview.md +83 -199
- package/assets/references/mcp-and-skills.md +35 -125
- package/assets/references/orchestration.md +96 -209
- package/assets/references/platforms.md +41 -108
- package/assets/skill-registry.json +10 -1
- package/assets/templates/adr.md +3 -3
- package/assets/templates/architecture.yaml +31 -28
- package/assets/templates/edge-matrix.md +8 -8
- package/assets/templates/mermaid.md +3 -10
- package/assets/templates/prd.md +15 -15
- package/assets/templates/tasks.yaml +25 -18
- package/bin/archgen-mcp.mjs +6 -4
- package/package.json +2 -2
- package/src/cli.mjs +1 -2
- package/src/context.mjs +55 -45
- package/src/core/brief-context.mjs +106 -0
- package/src/core/brief-scope.mjs +218 -0
- package/src/core/briefs.mjs +121 -0
- package/src/core/codegraph-manager.mjs +124 -48
- package/src/core/compat.mjs +13 -3
- package/src/core/doc-navigator.mjs +127 -24
- package/src/core/errors.mjs +1 -1
- package/src/core/fs-safety.mjs +98 -10
- package/src/core/graph.mjs +8 -3
- package/src/core/harness-wiring.mjs +194 -37
- package/src/core/jsonc-config.mjs +706 -0
- package/src/core/mcp-server-manager.mjs +2 -3
- package/src/core/plan-coverage.mjs +43 -6
- package/src/core/plan-grapher.mjs +13 -5
- package/src/core/platform-caps.mjs +9 -2
- package/src/core/resume-snapshot.mjs +16 -4
- package/src/core/scope.mjs +39 -5
- package/src/core/skill-manager.mjs +181 -13
- package/src/core/skill-roots.mjs +92 -0
- package/src/core/status-mutator.mjs +34 -3
- package/src/core/tokens.mjs +78 -0
- package/src/core/validator.mjs +16 -3
- package/src/core/verifier.mjs +3 -9
- package/src/core/worker-contract.mjs +161 -20
- package/src/core/yaml.mjs +31 -6
- package/src/server.mjs +0 -3
- package/src/tools/_register.mjs +5 -4
- package/src/tools/codegraph.mjs +0 -2
- package/src/tools/docs.mjs +6 -6
- package/src/tools/help.mjs +18 -35
- package/src/tools/plan.mjs +58 -7
- package/src/tools/setup.mjs +7 -3
- package/src/tools/skills.mjs +67 -5
- package/src/tools/tasks.mjs +82 -23
- package/src/core/ui-channel.mjs +0 -171
- package/src/tools/ui.mjs +0 -67
package/README.md
CHANGED
|
@@ -4,13 +4,12 @@ The MCP server for [archgen](https://github.com/akashmaurya99/archgen) — it
|
|
|
4
4
|
owns **every** deterministic capability in the archgen workflow.
|
|
5
5
|
|
|
6
6
|
The archgen skill is orchestration guidance for an agent; this server is the
|
|
7
|
-
runtime it drives. One implementation,
|
|
7
|
+
runtime it drives. One implementation, two ways in:
|
|
8
8
|
|
|
9
9
|
| Consumer | How it reaches the server |
|
|
10
10
|
|---|---|
|
|
11
|
-
| Coding agents | MCP over stdio —
|
|
11
|
+
| Coding agents | MCP over stdio — 8 domain tools + `archgen_help` |
|
|
12
12
|
| `archgen-skill init` / `install` | `archgen-mcp bootstrap` |
|
|
13
|
-
| The VS Code extension | `archgen-mcp exec <tool> '<json>'` |
|
|
14
13
|
|
|
15
14
|
## Install
|
|
16
15
|
|
|
@@ -42,9 +41,8 @@ Requires **Node.js >= 20** (the official MCP SDK v2 floor).
|
|
|
42
41
|
| `archgen_tasks` | next wave · set status · list · resume snapshot · **contract** (the assembled worker prompt) |
|
|
43
42
|
| `archgen_docs` | navigate markdown artifacts: section index, one section, token map, reference integrity |
|
|
44
43
|
| `archgen_registry` | refresh / read the AGENTS.md features registry |
|
|
45
|
-
| `archgen_codegraph` | install
|
|
44
|
+
| `archgen_codegraph` | install CodeGraph if it is missing · wire its MCP · index the project |
|
|
46
45
|
| `archgen_setup` | doctor · bootstrap servers · install/remove the MCP · list harnesses · **harness_info** (a platform's capabilities) |
|
|
47
|
-
| `archgen_ui` | drive the VS Code extension in real time |
|
|
48
46
|
| `archgen_skills` | match / install / load external capability skills |
|
|
49
47
|
| `archgen_refs` | load archgen's own protocol documents — section by section |
|
|
50
48
|
| `archgen_help` | the full briefing for one domain |
|
|
@@ -90,7 +88,7 @@ The skill declares the server version it needs:
|
|
|
90
88
|
```yaml
|
|
91
89
|
metadata:
|
|
92
90
|
requires:
|
|
93
|
-
archgen_mcp: ">=
|
|
91
|
+
archgen_mcp: ">=x.y.z"
|
|
94
92
|
```
|
|
95
93
|
|
|
96
94
|
`archgen_setup { action: 'doctor' }` reports a mismatch, `bootstrap` warns
|
|
@@ -112,14 +110,21 @@ implementation of any capability, only a second way to reach it.
|
|
|
112
110
|
|
|
113
111
|
## Safety
|
|
114
112
|
|
|
113
|
+
- The server owns a **boundary**: the directory it was started in. A tool's
|
|
114
|
+
`projectRoot` argument selects a directory *inside* that boundary — it
|
|
115
|
+
cannot redefine it, so a model cannot move the edge by naming a different
|
|
116
|
+
root.
|
|
115
117
|
- Every path argument is resolved against the project root and refused if it
|
|
116
|
-
escapes; symlinked targets are never written through
|
|
118
|
+
escapes; symlinked targets are never written through, and a symlinked
|
|
119
|
+
*parent* is caught by comparing real paths.
|
|
120
|
+
- The artifact space is anchored to the project: a `.archgen` directory
|
|
121
|
+
elsewhere on the machine is not this project's artifacts.
|
|
117
122
|
- MCP-config writes are approval-gated (`approve: true` / `--yes`); without
|
|
118
123
|
approval the tool reports its **plan** and writes nothing.
|
|
119
124
|
- A config file that cannot be parsed is reported, never rewritten.
|
|
120
125
|
- Writes are atomic (temp file + rename): readers see old-or-new, never a
|
|
121
|
-
partial file.
|
|
122
|
-
|
|
126
|
+
partial file. A read-modify-write — a status update, a config merge — runs
|
|
127
|
+
under an exclusive lock, so two workers cannot lose each other's change.
|
|
123
128
|
|
|
124
129
|
## License
|
|
125
130
|
|
|
@@ -1,22 +1,21 @@
|
|
|
1
|
-
TASK: Investigate a recurring
|
|
2
|
-
TRIGGER:
|
|
3
|
-
|
|
1
|
+
TASK: Investigate a recurring post-execution defect in this repository.
|
|
2
|
+
TRIGGER: User reports repetitive/recurring issues AFTER implementation waves completed. This is NOT a patch-fix task.
|
|
3
|
+
SCOPE: Read-only analysis and reporting (unless the brief explicitly authorizes edits).
|
|
4
4
|
|
|
5
|
-
DELIVERABLE
|
|
6
|
-
1. ROOT CAUSE
|
|
7
|
-
2. EVIDENCE
|
|
8
|
-
3. BLAST RADIUS
|
|
9
|
-
|
|
10
|
-
4. REMEDIATION — routed through the NORMAL gates: new fix tasks get fresh ids
|
|
11
|
-
inheriting the affected task's ownership globs.
|
|
5
|
+
DELIVERABLE — all four sections are MANDATORY:
|
|
6
|
+
1. ROOT CAUSE: One sentence identifying the underlying defect (never merely the symptom).
|
|
7
|
+
2. EVIDENCE: Exact file paths, line numbers, and reproduction steps proving the root cause.
|
|
8
|
+
3. BLAST RADIUS: Affected tasks and artifacts computed via `archgen_plan { action: 'impact', tasksYaml: <tasks.yaml>, target: <id-or-path> }`.
|
|
9
|
+
4. REMEDIATION: Proposed fix tasks (new task IDs inheriting affected `file_ownership` globs) routed through normal Verifier, Review, and User gates.
|
|
12
10
|
|
|
13
11
|
SIZING
|
|
14
|
-
- SMALL
|
|
15
|
-
- MEDIUM/LARGE: 1
|
|
12
|
+
- SMALL: Main agent investigates directly.
|
|
13
|
+
- MEDIUM / LARGE: 1 investigator by default. Dispatch a 2nd investigator ONLY when the suspected defect spans disjoint subsystems—split strictly by SUBSYSTEM with zero file overlap.
|
|
16
14
|
|
|
17
15
|
DISCIPLINE
|
|
18
|
-
- Read narrowly around
|
|
19
|
-
-
|
|
20
|
-
- Write
|
|
21
|
-
|
|
22
|
-
|
|
16
|
+
- Read narrowly around evidence paths; avoid whole-repo sweeps.
|
|
17
|
+
- Patch-fixing without a verified root-cause statement is FORBIDDEN.
|
|
18
|
+
- Write working notes to `<slug dir>/.agent/notes/<topic>.md` and final report to `<slug dir>/.agent/reports/investigate-<round>.md`. Never create ad-hoc root directories.
|
|
19
|
+
|
|
20
|
+
REUSE
|
|
21
|
+
For any follow-up question, verification, or fix touching these files, CONTINUE THIS AGENT'S SESSION rather than spawning a new agent.
|
package/assets/briefs/review.md
CHANGED
|
@@ -1,35 +1,47 @@
|
|
|
1
|
-
TASK: Review the plan in
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
TASK: Review the plan in `<slug dir>` READ-ONLY.
|
|
2
|
+
SCOPE: Read-only. NEVER edit files or code; output findings only.
|
|
3
|
+
DELIVERABLE: ONE message in this exact format:
|
|
4
4
|
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
5
|
+
```
|
|
6
|
+
VERDICT: APPROVE
|
|
7
|
+
COVERAGE:
|
|
8
|
+
| area | status | reason |
|
|
9
|
+
| --- | --- | --- |
|
|
10
|
+
| edge cases per module | PASS | matrices cover empty, boundary, authz, concurrency, retry, and i18n states |
|
|
11
|
+
| task ordering & parallelization | N/A | single sequential wave |
|
|
12
|
+
| cross-module contracts | PASS | every shared interface has a single owning task |
|
|
13
|
+
| enhancement opportunities | PASS | none material for this scope |
|
|
14
|
+
| documentation completeness | PASS | every task has a matching plan section |
|
|
15
|
+
```
|
|
11
16
|
|
|
12
|
-
|
|
13
|
-
- `archgen_plan { action: 'graph', tasksYaml: <tasks.yaml>, format: 'mermaid', status: true }`
|
|
14
|
-
— the wave-progress render; reviewer reads it to sanity-check ordering.
|
|
15
|
-
- `archgen_docs { action: 'validate', slugDir: <slug dir> }` — the reference
|
|
16
|
-
integrity result; broken references are findings, not noise.
|
|
17
|
+
or
|
|
17
18
|
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
19
|
+
```
|
|
20
|
+
VERDICT: ISSUES
|
|
21
|
+
COVERAGE:
|
|
22
|
+
| area | status | reason |
|
|
23
|
+
| --- | --- | --- |
|
|
24
|
+
| ... all 5 areas above marked PASS, FAIL, or N/A ... |
|
|
25
|
+
FINDINGS:
|
|
26
|
+
1. plans/demo.md § API — response type named inconsistently — client/server contract mismatch — standardize on ApiResponse
|
|
27
|
+
2. docs/prd.md § Grades — FR-GRADE-02 has no owning task — requirement will not be built — add task owning grade-read endpoint
|
|
28
|
+
```
|
|
25
29
|
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
30
|
+
EXAMINE ALL 5 AREAS EVERY RUN:
|
|
31
|
+
1. `edge cases per module`
|
|
32
|
+
2. `task ordering & parallelization` (waves vs real `depends_on` edges)
|
|
33
|
+
3. `cross-module contracts` (interfaces, paths, `naming_conventions`)
|
|
34
|
+
4. `enhancement opportunities`
|
|
35
|
+
5. `documentation completeness`
|
|
36
|
+
|
|
37
|
+
MANDATORY COVERAGE TABLE: Must appear in every report (even on `APPROVE`). Mark every area `PASS`, `FAIL`, or `N/A` with a 1-line reason. Omitting the table or any row makes the report INCOMPLETE.
|
|
38
|
+
|
|
39
|
+
SIZING & CONTEXT
|
|
40
|
+
- SMALL: Main-agent self-review permitted if no reviewer sub-agent exists.
|
|
41
|
+
- MEDIUM: 1 holistic reviewer.
|
|
42
|
+
- LARGE: 1 top-tier holistic reviewer (2nd allowed ONLY if context limits force splitting `plans/` vs `docs/`; never split by review area).
|
|
43
|
+
- Use the pre-rendered dependency graph and doc-validation results in the `CONTEXT` block below—make zero `archgen_*` tool calls.
|
|
29
44
|
|
|
30
45
|
BOUNDS
|
|
31
|
-
- A "more review" approval
|
|
32
|
-
|
|
33
|
-
explicit user waiver on record.
|
|
34
|
-
- The ORCHESTRATOR fixes the artifacts, re-runs validate + the verifier gate
|
|
35
|
-
after every change, and re-dispatches. Reviewers never fix.
|
|
46
|
+
- A user "more review" approval grants EXACTLY ONE additional pass. The stage exits only on zero findings or an explicit user waiver.
|
|
47
|
+
- The ORCHESTRATOR applies all fixes and re-runs `validate` + Verifier Gate; reviewers never edit files.
|
package/assets/briefs/survey.md
CHANGED
|
@@ -1,22 +1,19 @@
|
|
|
1
|
-
TASK: Survey this repository to prepare a feature plan for:
|
|
2
|
-
|
|
3
|
-
sections:
|
|
4
|
-
## Structure — top-2-levels folder tree w/ one-line purpose each
|
|
5
|
-
## Modules — table: module | responsibility | key entry points
|
|
6
|
-
## Conventions — naming, error-handling, test layout actually observed
|
|
7
|
-
## Affected — files/modules the feature will touch, with evidence paths
|
|
8
|
-
SCOPE: read-only.
|
|
9
|
-
NAVIGATE: use the CodeGraph MCP tools when available — the index is built once
|
|
10
|
-
at bootstrap and kept live by the server's watcher, so never re-index.
|
|
11
|
-
Otherwise Glob+Grep systematically.
|
|
12
|
-
VERIFY: every claim cites a real path; no guessed APIs. A claim without an
|
|
13
|
-
evidence path is a defect, not a detail.
|
|
1
|
+
TASK: Survey this repository to prepare a feature plan for: `<feature request>`
|
|
2
|
+
SCOPE: Read-only exploration, writing ONLY `<slug dir>/codebase-map.md`.
|
|
14
3
|
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
4
|
+
DELIVERABLE: Write `<slug dir>/codebase-map.md` containing EXACTLY these four non-empty sections:
|
|
5
|
+
## Structure — Top 2 directory levels with 1-line purpose per folder
|
|
6
|
+
## Modules — Table: `module | responsibility | key entry points`
|
|
7
|
+
## Conventions — Observed file naming, error handling, and test placement patterns
|
|
8
|
+
## Affected — Files/modules impacted by the feature, citing exact evidence paths
|
|
19
9
|
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
10
|
+
NAVIGATION & VERIFICATION
|
|
11
|
+
- Prefer CodeGraph MCP tools when `.codegraph/` is present (index is kept live by the watcher—never re-index); otherwise use systematic Glob + Grep.
|
|
12
|
+
- Every architectural claim MUST cite a real repository file path. Never guess APIs.
|
|
13
|
+
- Every section must be present and non-empty; document unresolved items as explicit unknowns rather than omitting sections.
|
|
14
|
+
- Downstream rule: The orchestrator will ask the user ONLY what this map could not answer.
|
|
15
|
+
|
|
16
|
+
SIZING & REUSE
|
|
17
|
+
- SMALL: Main agent surveys in one pass.
|
|
18
|
+
- MEDIUM / LARGE: 1–2 survey agents split strictly by disjoint SUBSYSTEM (zero file overlap).
|
|
19
|
+
- Continue this agent's session for any follow-up questions covering the surveyed subsystem.
|
|
@@ -1,44 +1,56 @@
|
|
|
1
|
-
TASK: Verify
|
|
2
|
-
|
|
3
|
-
SCOPE: read-only. You NEVER edit files. You report findings only.
|
|
1
|
+
TASK: Verify the archgen plan in `<slug dir>` before execution.
|
|
2
|
+
SCOPE: Read-only. NEVER edit files; report verdict, coverage table, and findings only.
|
|
4
3
|
|
|
5
|
-
|
|
6
|
-
1. `archgen_plan { action: 'verify', tasksYaml: <tasks.yaml>, planDir: <plans dir> }`
|
|
7
|
-
|
|
8
|
-
ownership overlap, missing acceptance criteria and plan<->task coverage.
|
|
9
|
-
2. `archgen_docs { action: 'validate', slugDir: <slug dir> }` (when markdown
|
|
10
|
-
artifacts exist) — must return valid:true. Broken references BLOCK approval.
|
|
4
|
+
STEP 1 — RUN DETERMINISTIC CHECKS FIRST (both must pass):
|
|
5
|
+
1. `archgen_plan { action: 'verify', tasksYaml: <tasks.yaml>, planDir: <plans dir> }` $\rightarrow$ must return `verdict: 'APPROVE'` (validates DAG, dangling refs, wave ownership disjointness, acceptance presence, and bidirectional plan$\leftrightarrow$task coverage).
|
|
6
|
+
2. `archgen_docs { action: 'validate', slugDir: <slug dir> }` (if markdown artifacts exist) $\rightarrow$ must return `valid: true` (zero broken links or heading anchors).
|
|
11
7
|
|
|
12
|
-
|
|
13
|
-
-
|
|
14
|
-
-
|
|
15
|
-
-
|
|
16
|
-
-
|
|
17
|
-
- CONTRACT-COMPLETENESS
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
8
|
+
STEP 2 — AUDIT JUDGMENT & CONTRACT COMPLETENESS:
|
|
9
|
+
- Wave boundaries match true dependencies without artificial serialization.
|
|
10
|
+
- Acceptance criteria are objectively verifiable (runnable command or observable output).
|
|
11
|
+
- Edge-case coverage satisfies the scope class (`SMALL` / `MEDIUM` / `LARGE`).
|
|
12
|
+
- Planned structure and naming obey `references/code-standards.md`.
|
|
13
|
+
- **CONTRACT-COMPLETENESS SWEEP** (evaluate every dimension; mark `N/A` only when the system genuinely lacks that surface):
|
|
14
|
+
1. `functional coverage`: Every requirement maps to a task + objective acceptance check.
|
|
15
|
+
2. `security & data protection`: Authn/authz flows, session/credential lifecycle, CSRF/replay defense, encryption/privacy boundaries, boundary input validation.
|
|
16
|
+
3. `data integrity`: Schemas, foreign keys/relations, validation rules, migrations & backward compatibility.
|
|
17
|
+
4. `state, lifecycle & recovery`: Checkpointing/resume, idempotency, cleanup/TTL, rollback/compensation for stateful or multi-step flows.
|
|
18
|
+
5. `resource limits & abuse`: Quotas, rate limiting, data retention/deletion, unauthenticated abuse controls.
|
|
19
|
+
6. `operational entrypoints`: Build, test, deploy, and bootstrap entrypoints are each owned by a task.
|
|
20
|
+
7. `metric traceability`: Every PRD success metric maps to a task acceptance check with a reproducible command, sample size, or data source.
|
|
21
|
+
8. `consistency`: Zero contradictions across PRD, `architecture.yaml`, `plans/*.md`, and `tasks.yaml`.
|
|
22
|
+
|
|
23
|
+
DELIVERABLE — ONE message in this exact format:
|
|
24
|
+
|
|
25
|
+
```
|
|
26
|
+
VERDICT: APPROVE
|
|
27
|
+
COVERAGE:
|
|
28
|
+
| dimension | status | reason |
|
|
29
|
+
| --- | --- | --- |
|
|
30
|
+
| functional coverage | PASS | all FR IDs map to tasks with runnable checks |
|
|
31
|
+
| security & data protection | N/A | internal CLI with no auth or sensitive data |
|
|
32
|
+
| data integrity | PASS | schemas and migrations are fully typed and owned |
|
|
33
|
+
| state, lifecycle & recovery | FAIL | TASK-07 mutates state without rollback or idempotency |
|
|
34
|
+
| resource limits & abuse | N/A | no shared or public network surface |
|
|
35
|
+
| operational entrypoints | PASS | build, test, and CLI entrypoints have owning tasks |
|
|
36
|
+
| metric traceability | PASS | PRD latency target verified by benchmark acceptance command |
|
|
37
|
+
| consistency | PASS | all contracts align across architecture.yaml and plans |
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
or
|
|
41
|
+
|
|
42
|
+
```
|
|
43
|
+
VERDICT: ISSUES
|
|
44
|
+
COVERAGE:
|
|
45
|
+
| dimension | status | reason |
|
|
46
|
+
| --- | --- | --- |
|
|
47
|
+
| ... all 8 dimensions above marked PASS, FAIL, or N/A ... |
|
|
48
|
+
FINDINGS:
|
|
49
|
+
1. tasks.yaml § SCAFFOLD — acceptance #2 has no observable check — worker cannot verify completion — replace with "npm run build exits 0"
|
|
50
|
+
2. plans/demo.md § Risks — config-drift risk has no owning task — mitigation never built — assign mitigation to TASK-01
|
|
51
|
+
```
|
|
38
52
|
|
|
39
53
|
RULES
|
|
40
|
-
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
- Every finding names the file and the reason. No vague findings.
|
|
44
|
-
- If everything passes, return exactly `APPROVE` and nothing else.
|
|
54
|
+
- **MANDATORY COVERAGE TABLE:** Every report (even `APPROVE`) must include all 8 dimensions marked `PASS`, `FAIL`, or `N/A` with a 1-line reason. Missing rows = INCOMPLETE report (treated as `ISSUES`).
|
|
55
|
+
- **Top-tier holistic agent:** Run on the strongest reasoning model available (never a quick/explore/cheap tier) as ONE holistic agent across the entire plan.
|
|
56
|
+
- **Exhaustive single pass:** Report EVERY defect found in this pass with exact `file § section — defect — impact — fix`. Never hold findings back for a later round.
|