@weave-tools/weave-it 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.
Files changed (34) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +868 -0
  3. package/dist/cli.d.ts +5 -0
  4. package/dist/cli.js +4538 -0
  5. package/dist/cli.js.map +1 -0
  6. package/package.json +65 -0
  7. package/templates/opencode/commands/weave-architect.md +7 -0
  8. package/templates/opencode/commands/weave-capture.md +7 -0
  9. package/templates/opencode/commands/weave-clarify.md +7 -0
  10. package/templates/opencode/commands/weave-execute.md +7 -0
  11. package/templates/opencode/commands/weave-explore.md +7 -0
  12. package/templates/opencode/commands/weave-issues.md +7 -0
  13. package/templates/opencode/commands/weave-knowledge.md +7 -0
  14. package/templates/opencode/commands/weave-new.md +7 -0
  15. package/templates/opencode/commands/weave-next.md +7 -0
  16. package/templates/opencode/commands/weave-prd.md +7 -0
  17. package/templates/opencode/commands/weave-prepare.md +7 -0
  18. package/templates/skills/weave-architect/SKILL.md +291 -0
  19. package/templates/skills/weave-architect/api-contract-template.md +21 -0
  20. package/templates/skills/weave-architect/frontend-backend-template.md +21 -0
  21. package/templates/skills/weave-architect/index-template.md +24 -0
  22. package/templates/skills/weave-architect/schema-template.md +21 -0
  23. package/templates/skills/weave-capture/SKILL.md +398 -0
  24. package/templates/skills/weave-clarify/SKILL.md +513 -0
  25. package/templates/skills/weave-execute/SKILL.md +215 -0
  26. package/templates/skills/weave-explore/SKILL.md +434 -0
  27. package/templates/skills/weave-issues/SKILL.md +441 -0
  28. package/templates/skills/weave-knowledge/SKILL.md +161 -0
  29. package/templates/skills/weave-knowledge/knowledge-templates.md +63 -0
  30. package/templates/skills/weave-new/SKILL.md +76 -0
  31. package/templates/skills/weave-next/SKILL.md +216 -0
  32. package/templates/skills/weave-prd/SKILL.md +419 -0
  33. package/templates/skills/weave-prd/prd-template.md +186 -0
  34. package/templates/skills/weave-prepare/SKILL.md +94 -0
package/package.json ADDED
@@ -0,0 +1,65 @@
1
+ {
2
+ "name": "@weave-tools/weave-it",
3
+ "version": "0.1.0",
4
+ "description": "SDLC package for AI-assisted software teams working across monorepos and multi-repo workspaces.",
5
+ "type": "module",
6
+ "license": "MIT",
7
+ "author": "Arpit Agarwal <agarwalarpit22@gmail.com>",
8
+ "homepage": "https://github.com/arpit016/weave-it#readme",
9
+ "bugs": {
10
+ "url": "https://github.com/arpit016/weave-it/issues"
11
+ },
12
+ "repository": {
13
+ "type": "git",
14
+ "url": "git+https://github.com/arpit016/weave-it.git"
15
+ },
16
+ "keywords": [
17
+ "weave",
18
+ "cli",
19
+ "ai",
20
+ "agent",
21
+ "claude",
22
+ "cursor",
23
+ "codex",
24
+ "opencode",
25
+ "sdlc",
26
+ "sdd",
27
+ "spec-driven-development",
28
+ "wiki",
29
+ "knowledge-base"
30
+ ],
31
+ "bin": {
32
+ "weave": "dist/cli.js"
33
+ },
34
+ "files": [
35
+ "dist",
36
+ "templates"
37
+ ],
38
+ "publishConfig": {
39
+ "access": "public"
40
+ },
41
+ "scripts": {
42
+ "build": "tsup",
43
+ "dev": "tsx src/cli.ts",
44
+ "test": "vitest run",
45
+ "typecheck": "tsc --noEmit",
46
+ "release:bump-skills": "node scripts/bump-skill-versions.mjs",
47
+ "prepublishOnly": "npm run typecheck && npm run test && npm run build",
48
+ "version": "npm run release:bump-skills && git add -A templates/skills"
49
+ },
50
+ "engines": {
51
+ "node": ">=22.12"
52
+ },
53
+ "dependencies": {
54
+ "@clack/prompts": "^1.4.0",
55
+ "commander": "^14.0.3",
56
+ "yaml": "^2.9.0"
57
+ },
58
+ "devDependencies": {
59
+ "@types/node": "^25.9.0",
60
+ "tsup": "^8.5.1",
61
+ "tsx": "^4.22.2",
62
+ "typescript": "^6.0.3",
63
+ "vitest": "^4.1.6"
64
+ }
65
+ }
@@ -0,0 +1,7 @@
1
+ ---
2
+ description: Generate or revise architecture.md from an active Weave PRD
3
+ ---
4
+
5
+ Load and follow the `weave-architect` skill.
6
+
7
+ Context: $ARGUMENTS
@@ -0,0 +1,7 @@
1
+ ---
2
+ description: Capture the current discussion into a Weave artifact or session-only note
3
+ ---
4
+
5
+ Load and follow the `weave-capture` skill.
6
+
7
+ Context: $ARGUMENTS
@@ -0,0 +1,7 @@
1
+ ---
2
+ description: Clarify an existing Weave change artifact
3
+ ---
4
+
5
+ Load and follow the `weave-clarify` skill.
6
+
7
+ Context: $ARGUMENTS
@@ -0,0 +1,7 @@
1
+ ---
2
+ description: Execute local Weave tasks for an active change
3
+ ---
4
+
5
+ Load and follow the `weave-execute` skill.
6
+
7
+ Context: $ARGUMENTS
@@ -0,0 +1,7 @@
1
+ ---
2
+ description: Explore and draft a PRD using Weave context
3
+ ---
4
+
5
+ Load and follow the `weave-explore` skill.
6
+
7
+ Topic: $ARGUMENTS
@@ -0,0 +1,7 @@
1
+ ---
2
+ description: Break a Weave plan into local tasks.md implementation tasks
3
+ ---
4
+
5
+ Load and follow the `weave-issues` skill.
6
+
7
+ Context: $ARGUMENTS
@@ -0,0 +1,7 @@
1
+ ---
2
+ description: Update current-state Weave knowledge specs for an active change
3
+ ---
4
+
5
+ Load and follow the `weave-knowledge` skill.
6
+
7
+ Context: $ARGUMENTS
@@ -0,0 +1,7 @@
1
+ ---
2
+ description: Start a new Weave change exploration
3
+ ---
4
+
5
+ Load and follow the `weave-new` skill.
6
+
7
+ Topic: $ARGUMENTS
@@ -0,0 +1,7 @@
1
+ ---
2
+ description: Answer what to do next for the active Weave change
3
+ ---
4
+
5
+ Load and follow the `weave-next` skill.
6
+
7
+ Context: $ARGUMENTS
@@ -0,0 +1,7 @@
1
+ ---
2
+ description: Generate or revise a PRD from the active Weave exploration
3
+ ---
4
+
5
+ Load and follow the `weave-prd` skill.
6
+
7
+ Context: $ARGUMENTS
@@ -0,0 +1,7 @@
1
+ ---
2
+ description: Prepare task execution branches for a Weave change
3
+ ---
4
+
5
+ Load and follow the `weave-prepare` skill.
6
+
7
+ Context: $ARGUMENTS
@@ -0,0 +1,291 @@
1
+ ---
2
+ name: weave-architect
3
+ description: Read-only thinking partner for active Weave architecture work. Use when the user wants engineering architecture, technical design, implementation strategy, tradeoff analysis, risk review, or a deep dive into an existing architecture facet.
4
+ last_changed_in: 0.1.0
5
+ ---
6
+
7
+ # Weave Architect
8
+
9
+ This skill is a read-only architecture thinking partner. It gathers context, interviews the user, stress-tests tradeoffs, and produces a clear technical dissection that `weave-capture` can persist later.
10
+
11
+ It never creates, edits, renames, deletes, or progresses repo-tracked artifacts. It may update local Weave session state only to record that the active artifact lane is `architecture` via `weave artifact current set architecture --json`; this local lane commit is not a repo-tracked artifact write.
12
+
13
+ It does not read architecture template resources; templates are writer inputs for `weave-capture` and restructuring inputs for `weave-clarify`.
14
+
15
+ # Plan Mode Guard
16
+
17
+ This skill must run in Plan Mode.
18
+
19
+ If the current environment exposes collaboration mode and it is not Plan Mode, stop immediately and say:
20
+
21
+ `This skill must run in Plan Mode. Switch to Plan Mode, then invoke weave-architect again.`
22
+
23
+ Do not inspect deeply, ask discovery questions, update artifacts, or continue work before this guard passes.
24
+
25
+ Static Weave skill content cannot automatically switch collaboration mode. The host, user, or developer layer must switch modes before this skill continues.
26
+
27
+ In Plan Mode, this skill commits the active artifact lane to local Weave session state via:
28
+
29
+ ```bash
30
+ weave artifact current set architecture --json
31
+ ```
32
+
33
+ This writes local Weave session state only. It does not write repo-tracked artifacts and IS allowed in Plan Mode. Call it after resolving the active Weave change and before any other discovery work.
34
+
35
+ Do not write repo-tracked artifacts directly. Produce the plan, decisions, questions, or proposed artifact changes needed for the user to approve. Actual artifact writes happen only after the user exits Plan Mode and asks to implement the plan.
36
+
37
+ # Operating Principles
38
+
39
+ - Treat `weave-architect` as entering or resuming the architecture lane for the active change.
40
+ - Treat `prd.md` as the preferred product contract when it exists and is useful, but do not require it before architecture thinking.
41
+ - Read enough code, docs, ADRs, knowledge specs, and existing Weave artifacts to understand current implementation patterns before recommending design.
42
+ - In workspace mode, inspect registered repo folders as implementation locations inside one shared change context. In repo mode, keep the resolved repo context as the boundary.
43
+ - Support both legacy `wiki/changes/<change-id>/architecture.md` and folder-mode `wiki/changes/<change-id>/architecture/index.md` plus `architecture/*.md` facets.
44
+ - If both `architecture.md` and `architecture/` exist, call out the conflict and ask the user to resolve it with `weave-clarify` or `weave-capture` before relying on either as canonical.
45
+ - Ask focused product questions only when technical design exposes ambiguity not settled by existing artifacts.
46
+ - Do not create implementation issues; use `weave-issues` after the design is captured and ready.
47
+
48
+ # Resolve Context
49
+
50
+ Start by discovering the current Weave session and committing the architecture lane to local Weave session state:
51
+
52
+ ```bash
53
+ weave workspace --json
54
+ weave change current --json
55
+ weave change status --json
56
+ weave artifact current set architecture --json
57
+ weave artifact current --json
58
+ ```
59
+
60
+ Setting local artifact context with `weave artifact current set architecture --json` is allowed in Plan Mode because it writes local session state, not repo-tracked change artifacts. Run it as part of this initial discovery sequence, not as a conditional follow-up. Then verify the stored lane with `weave artifact current --json`.
61
+
62
+ If the lane verification succeeds, keep successful lane entry silent. If the lane verification fails or the stored lane is still not `architecture`, continue the architecture discussion and show only this warning:
63
+
64
+ ```text
65
+ I could not update the stored artifact lane to `architecture`, so `weave-capture` may ask you to confirm the capture target later.
66
+ ```
67
+
68
+ If `weave change current --json` reports no active change, stop and say:
69
+
70
+ ```text
71
+ No active Weave change found. Run `weave change new` or `weave change switch`, then run `weave-architect` again.
72
+ ```
73
+
74
+ Apply the Silent Weave Command Output policy to the commands above.
75
+
76
+ # Workspace Repo Context Protocol
77
+
78
+ When `weave workspace --json` returns a `workspace` object, treat `workspace.path` as the single Weave change artifact root. Registered entries in `repos[]` are implementation and documentation locations inside that workspace, not separate artifact targets.
79
+
80
+ Do not create, read, or update change artifacts under each sub-repo by default. Durable change artifacts remain under:
81
+
82
+ ```text
83
+ <workspace.path>/wiki/changes/<change-id>/
84
+ ```
85
+
86
+ Before deep inspection, build a lightweight repo context map from `repos[]`:
87
+
88
+ - repo id
89
+ - repo path
90
+ - repo kind
91
+ - remote, when present
92
+ - whether the repo appears relevant to the current user request
93
+ - docs and knowledge surfaces present, such as `README.md`, `CONTEXT.md`, `CONTEXT-MAP.md`, `docs/`, `docs/adr/`, `adr/`, `wiki/knowledge/`, `wiki/changes/`, `specs/`
94
+ - obvious code/test surfaces that may verify current behavior
95
+
96
+ Lightly inventory all registered repos. Deeply inspect only repos that appear relevant from the user's request, active change artifacts, repo names/kinds, docs, knowledge, prior changes, or code references.
97
+
98
+ Prefer current docs, knowledge specs, ADRs, and repo-local Weave wiki content before reading implementation code. Use code and tests to verify important claims from docs or memory.
99
+
100
+ If a repo is skipped, keep the reason simple: unrelated name/kind, no matching docs, no matching code references, or out of scope for the current question.
101
+
102
+ When presenting findings, include a short context note:
103
+
104
+ ```text
105
+ Context loaded:
106
+ - Workspace artifact root: <path>
107
+ - Repos inspected: <repo ids>
108
+ - Repo docs/knowledge read: <paths>
109
+ - Code/test anchors read: <paths>
110
+ - Repos skipped: <repo id> (<reason>)
111
+ ```
112
+
113
+ Do not exhaustively scan every repo unless the user explicitly asks for a workspace-wide audit.
114
+
115
+ # Architecture Context Loading
116
+
117
+ Read live artifacts first, then sessions:
118
+
119
+ ```text
120
+ wiki/changes/<change-id>/status.yml
121
+ wiki/changes/<change-id>/exploration.md
122
+ wiki/changes/<change-id>/prd.md
123
+ wiki/changes/<change-id>/architecture.md
124
+ wiki/changes/<change-id>/architecture/index.md
125
+ wiki/changes/<change-id>/architecture/*.md
126
+ wiki/changes/<change-id>/sessions/*-architecture.md
127
+ wiki/changes/<change-id>/knowledge-delta.md
128
+ wiki/changes/<change-id>/tasks.md
129
+ ```
130
+
131
+ Architecture shape rules:
132
+
133
+ - Legacy file mode: read `architecture.md`.
134
+ - Folder mode: read `architecture/index.md` first when present, then direct child facet files under `architecture/*.md`.
135
+ - Facet-only folder mode is valid context when one or more facet files are substantive even if `index.md` is missing or scaffold-only.
136
+ - Conflict mode exists when both `architecture.md` and `architecture/` exist. Report it explicitly.
137
+
138
+ For session notes, prefer the latest `## Next Resume Point`, unresolved decisions, and explicit user preferences. If session notes contain `facets: [...]` frontmatter, use it to find relevant facet discussions, but do not require it.
139
+
140
+ # Codebase And Docs Context
141
+
142
+ Inspect only context that can materially affect the architecture:
143
+
144
+ - source modules and tests in the affected repo folders
145
+ - existing internal docs, ADRs, and knowledge specs
146
+ - schemas, migrations, API contracts, event contracts, jobs, config, feature flags, and deployment files
147
+ - adjacent integration boundaries across registered workspace repos
148
+
149
+ Use existing architecture, framework conventions, helpers, data models, and ADRs before inventing a new abstraction.
150
+
151
+ # Sub-Repo Architecture Discovery
152
+
153
+ In workspace mode, use registered repos to understand technical boundaries across the workspace.
154
+
155
+ For relevant repos, prioritize reading:
156
+
157
+ ```text
158
+ README.md
159
+ CONTEXT.md
160
+ CONTEXT-MAP.md
161
+ docs/**
162
+ docs/adr/**
163
+ adr/**
164
+ specs/**
165
+ wiki/knowledge/**
166
+ wiki/changes/**
167
+ package manifests and build config
168
+ schema and migration files
169
+ API route or contract files
170
+ event, queue, job, or worker definitions
171
+ deployment and runtime config
172
+ tests around integration boundaries
173
+ ```
174
+
175
+ Use sub-repo context to identify:
176
+
177
+ - affected repos and ownership boundaries
178
+ - cross-repo data flow
179
+ - API, event, job, schema, and deployment contracts
180
+ - shared libraries or duplicated behavior
181
+ - migration and rollout constraints
182
+ - observability, testing, and failure-mode implications
183
+ - architecture decisions already recorded in docs, ADRs, or repo-local wiki content
184
+
185
+ Docs and ADRs are the first pass. Code and tests are the verification pass.
186
+
187
+ When returning an architecture dissection, include repo-aware findings when relevant:
188
+
189
+ ```text
190
+ ## Workspace Context
191
+ - Affected repos:
192
+ - Repos inspected:
193
+ - Important docs/ADRs:
194
+ - Important code/test anchors:
195
+ - Repos skipped:
196
+
197
+ ## Cross-Repo Architecture
198
+ - Boundaries:
199
+ - Contracts:
200
+ - Data flow:
201
+ - Rollout/migration concerns:
202
+ - Risks:
203
+ ```
204
+
205
+ Keep this skill read-only. Do not create, edit, move, rename, delete, or progress artifacts in any sub-repo.
206
+
207
+ # Deep Dive Modes
208
+
209
+ The user may invoke this skill broadly or target a concern:
210
+
211
+ - broad architecture review for the active change
212
+ - deep dive on a facet file such as `architecture/schema.md`
213
+ - deep dive on a proposed concern such as schema design, API contracts, frontend/backend integration, auth, rollout, or observability
214
+ - deep dive on a code area, repo folder, doc, or existing artifact section
215
+
216
+ For a targeted deep dive, still load enough surrounding context to avoid local optimization. Do not write the target file.
217
+
218
+ # Interview Behavior
219
+
220
+ Interview the user relentlessly about the engineering design until shared technical understanding is reached.
221
+
222
+ Ask questions one at a time and wait for the user's response before continuing.
223
+
224
+ For each blocking architecture question:
225
+
226
+ - explain why the question matters
227
+ - provide a likely/default recommendation
228
+ - explain implications of alternative choices
229
+ - explicitly offer: "Explain with an example before deciding"
230
+
231
+ If the user asks for an example or explanation before deciding:
232
+
233
+ - explain the tradeoff with a concrete example grounded in the PRD, architecture context, and codebase
234
+ - restate the original decision question
235
+ - wait for the user's decision before continuing
236
+
237
+ # Output
238
+
239
+ Return a structured, readable architecture dissection instead of writing files. Include only sections that are useful for the current discussion.
240
+
241
+ Recommended shape:
242
+
243
+ ```text
244
+ ## Architecture Dissection
245
+ - Current understanding
246
+ - Decisions and recommendations
247
+ - Facets affected
248
+ - Tradeoffs
249
+ - Risks and mitigations
250
+ - Open questions
251
+ - Capture guidance
252
+ ```
253
+
254
+ When useful, name likely destination facets for `weave-capture`, such as `index`, `schema`, `api-contract`, `frontend-backend`, or a user-named facet. This is guidance, not a command.
255
+
256
+ If the user wants to persist the discussion, recommend:
257
+
258
+ ```text
259
+ Run `weave-capture` to write the architecture discussion into the appropriate architecture artifact files.
260
+ ```
261
+
262
+ # Silent Weave Command Output
263
+
264
+ Weave skills run Weave CLI commands silently by default. Use command results
265
+ as internal context, not response content.
266
+
267
+ Do not show raw stdout, JSON payloads, command echoes, lifecycle payloads,
268
+ internal state-write confirmations, or verbatim notice text unless the user
269
+ explicitly asks for diagnostic output.
270
+
271
+ Surface only information that changes what the user or agent should do next:
272
+ blockers, failures, missing relevant repos, branch or task outcomes,
273
+ lifecycle failures, package-outdated notices, relevant outdated or modified
274
+ skills, and user-required actions.
275
+
276
+ Notice handling:
277
+
278
+ - `package_outdated`: show only when present. Say exactly:
279
+ `A newer Weave version is available. Run \`weave status\` for details, then upgrade Weave when convenient.`
280
+ - `skills_outdated`: suppress unrelated skills. If the invoked skill is outdated, say:
281
+ `The installed \`<skill-name>\` skill appears older than the bundled template. Run \`weave status\` for details, then \`weave agent update --all\` when you want to refresh installed skills.`
282
+ - `skills_outdated`: if multiple skills used in this workflow are outdated, say:
283
+ `Some installed skills used in this workflow appear older than the bundled templates: \`<skill-a>\`, \`<skill-b>\`. Run \`weave status\` for details, then \`weave agent update --all\` when you want to refresh them.`
284
+ - `skills_modified`: suppress unless the invoked skill is modified locally or the user is asking about skill updates. If the invoked skill is modified, say:
285
+ `The installed \`<skill-name>\` skill has local edits, so its behavior may differ from the bundled template. Run \`weave status\` or \`weave agent diff\` if you want to inspect the difference.`
286
+ - `skills_modified`: if the user asks to update skills and installed skills have local edits, say:
287
+ `Some installed skills have local edits. \`weave agent update\` may skip or protect them; run \`weave status\` or \`weave agent diff\` before updating.`
288
+
289
+ Do not say `Notices: ...`, `The command returned notices`, raw
290
+ `notices[].message`, full notice JSON, or full skill lists unless the user
291
+ asks for diagnostics.
@@ -0,0 +1,21 @@
1
+ ---
2
+ facet: api-contract
3
+ description: Request, response, event, and integration contract design.
4
+ ---
5
+
6
+ # API Contract Design
7
+
8
+ ## Consumers And Producers
9
+ - <Callers, owners, services, clients, and external systems involved.>
10
+
11
+ ## Contract Shape
12
+ - <Endpoints, commands, events, payloads, statuses, and errors.>
13
+
14
+ ## Versioning And Compatibility
15
+ - <Rollout, compatibility rules, deprecation, and migration expectations.>
16
+
17
+ ## Authorization And Validation
18
+ - <Permissions, trust boundaries, validation rules, and failure behavior.>
19
+
20
+ ## Observability And Testing
21
+ - <Logs, metrics, contract tests, fixtures, and verification plan.>
@@ -0,0 +1,21 @@
1
+ ---
2
+ facet: frontend-backend
3
+ description: Frontend/backend integration flow and user-facing behavior design.
4
+ ---
5
+
6
+ # Frontend And Backend Integration
7
+
8
+ ## User Flow
9
+ - <User-visible workflow, states, transitions, and error cases.>
10
+
11
+ ## Frontend Responsibilities
12
+ - <UI state, components, routes, client validation, and API usage.>
13
+
14
+ ## Backend Responsibilities
15
+ - <Server behavior, persistence, authorization, background work, and APIs.>
16
+
17
+ ## Integration Contract
18
+ - <Request/response or event flow across the boundary.>
19
+
20
+ ## Rollout And Verification
21
+ - <Feature flags, deployment ordering, telemetry, and test coverage.>
@@ -0,0 +1,24 @@
1
+ ---
2
+ facet: index
3
+ description: Canonical entry point for a folder-based architecture artifact.
4
+ ---
5
+
6
+ # <Change Name> Architecture
7
+
8
+ ## Decision Summary
9
+ - <Key architectural decisions and rationale.>
10
+
11
+ ## System Context
12
+ - <Current systems, repos, modules, docs, and constraints that matter.>
13
+
14
+ ## Architecture Overview
15
+ - <High-level design and how the pieces fit together.>
16
+
17
+ ## Facets
18
+ - `<facet>.md`: <Purpose and current status.>
19
+
20
+ ## Tradeoffs
21
+ - <Important alternatives considered and why they were accepted or rejected.>
22
+
23
+ ## Risks And Open Questions
24
+ - <Unresolved technical risks, decisions, or follow-up investigations.>
@@ -0,0 +1,21 @@
1
+ ---
2
+ facet: schema
3
+ description: Data model, storage, migration, and compatibility design.
4
+ ---
5
+
6
+ # Schema Design
7
+
8
+ ## Current Model
9
+ - <Existing entities, fields, relationships, indexes, and persisted assumptions.>
10
+
11
+ ## Proposed Model
12
+ - <New or changed entities, fields, relationships, indexes, and ownership.>
13
+
14
+ ## Migration Strategy
15
+ - <Backfill, rollout, rollback, and data correction plan.>
16
+
17
+ ## Compatibility
18
+ - <Backward compatibility, read/write transition, and old data handling.>
19
+
20
+ ## Validation And Risks
21
+ - <Invariants, integrity checks, operational risks, and open questions.>