archgen-skill 0.1.0 → 0.1.1
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/lib/store.js
CHANGED
|
@@ -177,9 +177,26 @@ function realpathWithTail(p) {
|
|
|
177
177
|
* outside `rootAbs`. Catches `.agents -> /elsewhere` style redirects that a
|
|
178
178
|
* final-component lstat cannot see.
|
|
179
179
|
*
|
|
180
|
-
*
|
|
181
|
-
*
|
|
182
|
-
*
|
|
180
|
+
* TWO COMPARISONS, AND THE PATH IS ALLOWED IF EITHER SAYS IT IS INSIDE.
|
|
181
|
+
*
|
|
182
|
+
* 1. LEXICAL — the caller's spelling against the root's spelling.
|
|
183
|
+
* 2. REAL — where the path actually LANDS against where the root actually
|
|
184
|
+
* IS. This is the one that catches a symlinked PARENT.
|
|
185
|
+
*
|
|
186
|
+
* They can disagree, and they DO whenever the root and the path are spelled
|
|
187
|
+
* differently — the NORMAL case on macOS (`/tmp`, `/var`) and for any
|
|
188
|
+
* symlinked project: `process.cwd()` is the REAL path while the caller
|
|
189
|
+
* passes the LOGICAL one.
|
|
190
|
+
*
|
|
191
|
+
* The old guard compared the LEXICAL path against the REAL root and refused
|
|
192
|
+
* on that mismatch, so a perfectly valid path inside the project was
|
|
193
|
+
* reported as an escape — and the two names the SAME place. The real
|
|
194
|
+
* comparison is the one that can actually answer the question, and it must
|
|
195
|
+
* be allowed to.
|
|
196
|
+
*
|
|
197
|
+
* The guard does NOT fail open: when the real comparison cannot be made the
|
|
198
|
+
* lexical one stands alone, and a path outside the root by every measure we
|
|
199
|
+
* could make is always refused.
|
|
183
200
|
*
|
|
184
201
|
* @param {string} rootAbs project/base root
|
|
185
202
|
* @param {string} absPath path that must stay inside the root
|
|
@@ -187,17 +204,20 @@ function realpathWithTail(p) {
|
|
|
187
204
|
export function assertWithinRoot(rootAbs, absPath) {
|
|
188
205
|
const rootLex = resolve(rootAbs);
|
|
189
206
|
const pathLex = resolve(absPath);
|
|
190
|
-
if (pathLex !== rootLex && !pathLex.startsWith(rootLex + sep)) {
|
|
191
|
-
throw new Error(refuseSymlinkMessage(absPath));
|
|
192
|
-
}
|
|
193
207
|
|
|
194
208
|
const rootReal = realpathWithTail(rootLex);
|
|
195
209
|
const pathReal = realpathWithTail(pathLex);
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
210
|
+
|
|
211
|
+
const lexicalInside = pathLex === rootLex || pathLex.startsWith(rootLex + sep);
|
|
212
|
+
const realInside =
|
|
213
|
+
rootReal && pathReal ? pathReal === rootReal || pathReal.startsWith(rootReal + sep) : null;
|
|
214
|
+
|
|
215
|
+
if (realInside === true || (realInside === null && lexicalInside)) return;
|
|
216
|
+
|
|
217
|
+
// Outside by every measure we could make. The refusal WORDING is unchanged
|
|
218
|
+
// from the guard this replaces — it is the CLI's established contract, and
|
|
219
|
+
// a test pins it. Only the COMPARISON changed.
|
|
220
|
+
throw new Error(refuseSymlinkMessage(absPath));
|
|
201
221
|
}
|
|
202
222
|
|
|
203
223
|
/** Version string of this CLI package (used for the in-store stamp). */
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "archgen-skill",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.1",
|
|
4
4
|
"description": "Architecture generation & autonomous task execution for coding agents - conversational requirements in, dependency-ordered tasks out, executed wave-by-wave with verifier gates. Works with Claude Code, OpenCode, Cursor, Codex, Gemini CLI and any agentskills.io harness.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|
|
@@ -4,10 +4,10 @@ description: Architecture generation and autonomous task execution for coding ag
|
|
|
4
4
|
license: MIT
|
|
5
5
|
compatibility: Requires Node.js >= 20. The archgen MCP server (archgen-mcp) provides every deterministic capability; the skill itself ships no code.
|
|
6
6
|
metadata:
|
|
7
|
-
version: 0.1.
|
|
7
|
+
version: 0.1.1
|
|
8
8
|
repo: https://github.com/akashmaurya99/archgen
|
|
9
9
|
requires:
|
|
10
|
-
archgen_mcp: ">=0.1.
|
|
10
|
+
archgen_mcp: ">=0.1.1"
|
|
11
11
|
---
|
|
12
12
|
|
|
13
13
|
# archgen — architecture generation & wave execution
|
|
@@ -59,6 +59,8 @@ All tools return `{ ok, data, error, meta }`. `ok:false` returns a typed `error.
|
|
|
59
59
|
|
|
60
60
|
**Token discipline:** Fetch sections, never full files—use `archgen_docs{action:'digest'}` $\rightarrow$ `{action:'section'}` and `archgen_refs{action:'index'}` $\rightarrow$ `{action:'read'}`.
|
|
61
61
|
|
|
62
|
+
**Batching:** settle every call in a batch (`allSettled`)—one bad argument must not discard the siblings' results.
|
|
63
|
+
|
|
62
64
|
## Loading a reference (§) — MANDATORY
|
|
63
65
|
|
|
64
66
|
Every `§` marker is a mandatory pre-action load from `archgen_refs`:
|
|
@@ -72,7 +74,7 @@ archgen_refs { action: 'search', topic: 'orchestration', token: 'APPROVE' }
|
|
|
72
74
|
|
|
73
75
|
**Rules for `§`:**
|
|
74
76
|
1. **Load BEFORE acting.** Entering a mode requires loading its `§` sections first.
|
|
75
|
-
2. **Load SECTIONS, not topics.**
|
|
77
|
+
2. **Load SECTIONS, not topics.** The `§` name IS a slug prefix — `§artifact-templates/plan-depth` resolves to `plan-depth-by-scope-class`. Call `index` only when a prefix is ambiguous.
|
|
76
78
|
3. **Reload after compaction.** Context compaction drops loaded protocols; reload active mode `§` sections immediately upon re-entry (Hard Rule 9).
|
|
77
79
|
4. **Never guess a protocol.** If an unread `§` covers your next step, load it first.
|
|
78
80
|
|
|
@@ -82,7 +84,7 @@ archgen_refs { action: 'search', topic: 'orchestration', token: 'APPROVE' }
|
|
|
82
84
|
|
|
83
85
|
1. **Workspace isolation:** Write all generated files inside `.archgen/<project-slug>/` at repo root, including all agent/sub-agent state under `.archgen/<slug>/.agent/` (`§artifact-templates/agent-workspace`). *Exceptions:* (a) approved task code/deliverable edits within declared `file_ownership` (`§orchestration/dispatch`); (b) `AGENTS.md` updates via `archgen_registry`.
|
|
84
86
|
2. **Three pre-execution gates:** (a) VERIFIER sub-agent `APPROVE` on plan + tasks, (b) PLAN-REVIEW at zero findings (or explicit user waiver), (c) USER approval. Never skip a gate.
|
|
85
|
-
3. **Right-size depth:** Classify scope (`SMALL`/`MEDIUM`/`LARGE` per `§interview/step-1`) before creating files.
|
|
87
|
+
3. **Right-size depth:** Classify scope (`SMALL`/`MEDIUM`/`LARGE` per `§interview/step-1`) before creating files. `archgen_plan{action:'scaffold', scope, slug}` returns the exact file set AND each file's CONTENT—**it writes nothing**, you write it; adding or omitting files is a defect (`§artifact-templates/plan-depth`). Write dense bullets over prose; never regenerate untouched artifacts.
|
|
86
88
|
4. **Self-containment:** Artifacts must execute cleanly from `.archgen/<slug>/` alone with zero chat history. Every task must use verbatim repo-root-relative paths from `architecture.yaml`/`tasks.yaml`. Forbidden phrases: `"as discussed"`, `"see chat"`, `"same as before"` (`§artifact-templates/self-containment`).
|
|
87
89
|
5. **Completeness:** No partial features ship as done. Acceptance criteria must be objectively verifiable and cover edge-matrix rows. Stubs, TODOs, and mock-only paths count as `failed` tasks even if tests pass. Include a per-feature completeness checklist in the final report.
|
|
88
90
|
6. **Status discipline (PER-TURN, NON-NEGOTIABLE):** Immediately upon EVERY task completion, in the same turn before any other action, execute and verify all three:
|
|
@@ -132,7 +134,7 @@ Select ONE mode matching user intent and **load its required `§` sections BEFOR
|
|
|
132
134
|
1. **Acknowledge & scope:** State planned action + inferred scope (`SMALL`/`MEDIUM`/`LARGE`) in one sentence. Ask to proceed. `[wait for user]`
|
|
133
135
|
2. **Interview:** Follow the loaded `§interview` sections—calibrate (Round 0), record `intent_class` in `answers.yaml`, batch 3–5 recommendation-first decision-fork questions per round. `[wait per round]`
|
|
134
136
|
3. **Generate artifacts** in `.archgen/<slug>/` (on collision, use `<slug>-2`, `<slug>-3`; never overwrite/merge):
|
|
135
|
-
- Call `archgen_plan{action:'scaffold', scope, slug}` FIRST and populate the exact returned artifact skeletons.
|
|
137
|
+
- Call `archgen_plan{action:'scaffold', scope, slug}` FIRST and populate the exact returned artifact skeletons. It returns each file's CONTENT and **writes nothing**—you write them under `.archgen/<slug>/`.
|
|
136
138
|
- Ensure every task specifies `id`, `title`, `depends_on`, disjoint `file_ownership` globs, objective `acceptance` criteria, and leaves `status` unset.
|
|
137
139
|
- Run the **FETCH-SKILL pre-planning scan** before finalizing.
|
|
138
140
|
4. **Validate & register:** Run `archgen_plan{action:'validate', tasksYaml}` and fix errors until `data.valid:true`. Then run `archgen_registry{action:'update', slug, status:'planned'}` (repeat after any subsequent artifact edit).
|