knowzcode 0.1.0 → 0.2.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/.claude-plugin/marketplace.json +6 -3
- package/.claude-plugin/plugin.json +1 -1
- package/README.md +132 -73
- package/agents/analyst.md +24 -62
- package/agents/architect.md +34 -43
- package/agents/builder.md +35 -86
- package/agents/closer.md +29 -87
- package/agents/context-scout.md +54 -0
- package/agents/knowledge-migrator.md +7 -7
- package/agents/knowz-scout.md +83 -0
- package/agents/knowz-scribe.md +155 -0
- package/agents/microfix-specialist.md +1 -6
- package/agents/reviewer.md +43 -91
- package/agents/update-coordinator.md +7 -18
- package/bin/knowzcode.mjs +94 -7
- package/commands/audit.md +156 -25
- package/commands/connect-mcp.md +525 -507
- package/commands/fix.md +8 -8
- package/commands/init.md +9 -5
- package/commands/learn.md +327 -308
- package/commands/plan.md +160 -26
- package/commands/register.md +21 -12
- package/commands/status.md +309 -291
- package/commands/telemetry.md +188 -188
- package/commands/work.md +577 -114
- package/knowzcode/automation_manifest.md +59 -59
- package/knowzcode/claude_code_execution.md +228 -22
- package/knowzcode/enterprise/compliance_manifest.md +2 -0
- package/knowzcode/knowzcode_loop.md +111 -45
- package/knowzcode/knowzcode_project.md +48 -233
- package/knowzcode/knowzcode_vaults.md +183 -54
- package/knowzcode/mcp_config.md +72 -47
- package/knowzcode/platform_adapters.md +43 -4
- package/knowzcode/prompts/Execute_Micro_Fix.md +57 -57
- package/knowzcode/prompts/Investigate_Codebase.md +227 -227
- package/knowzcode/prompts/Migrate_Knowledge.md +301 -301
- package/knowzcode/prompts/Refactor_Node.md +72 -72
- package/knowzcode/prompts/Spec_Verification_Checkpoint.md +59 -59
- package/knowzcode/prompts/[LOOP_1A]__Propose_Change_Set.md +52 -52
- package/knowzcode/prompts/[LOOP_1B]__Draft_Specs.md +75 -75
- package/knowzcode/prompts/[LOOP_2A]__Implement_Change_Set.md +55 -55
- package/knowzcode/prompts/[LOOP_2B]__Verify_Implementation.md +72 -72
- package/knowzcode/prompts/[LOOP_3]__Finalize_And_Commit.md +67 -67
- package/package.json +1 -1
- package/skills/alias-resolver.json +1 -1
- package/skills/architecture-diff.json +1 -1
- package/skills/check-installation-status.json +1 -1
- package/skills/continue.md +24 -4
- package/skills/environment-guard.json +1 -1
- package/skills/generate-workgroup-id.json +1 -1
- package/skills/install-knowzcode.json +1 -1
- package/skills/load-core-context.json +1 -1
- package/skills/log-entry-builder.json +1 -1
- package/skills/spec-quality-check.json +1 -1
- package/skills/spec-template.json +1 -1
- package/skills/spec-validator.json +1 -1
- package/skills/tracker-scan.json +1 -1
- package/skills/tracker-update.json +1 -1
- package/skills/validate-installation.json +1 -1
|
@@ -24,7 +24,7 @@
|
|
|
24
24
|
|
|
25
25
|
## 3. The Main Operational Loop
|
|
26
26
|
|
|
27
|
-
### Phase 1A: Impact Analysis
|
|
27
|
+
### 3.1 Phase 1A: Impact Analysis
|
|
28
28
|
|
|
29
29
|
Receive the goal from the user. Identify the **Change Set** — all components affected by this change.
|
|
30
30
|
|
|
@@ -68,7 +68,7 @@ NodeIDs must be **domain concepts**, not tasks.
|
|
|
68
68
|
**Historical Context:** Before proposing the Change Set, scan `knowzcode/workgroups/` for completed WorkGroups that touched similar components. Reference relevant context in your proposal.
|
|
69
69
|
|
|
70
70
|
#### Quality Gate: Change Set Approval
|
|
71
|
-
Present the proposed Change Set to the user. **PAUSE and await user approval.** Do NOT proceed to Phase 1B until the user explicitly approves.
|
|
71
|
+
Present the proposed Change Set to the user. **PAUSE and await user approval.** Do NOT proceed to Phase 1B until the user explicitly approves. In autonomous mode, auto-approve and proceed immediately (see Section 5).
|
|
72
72
|
|
|
73
73
|
Upon approval, generate a unique WorkGroupID and update `knowzcode_tracker.md` for all nodes to `[WIP]`.
|
|
74
74
|
|
|
@@ -79,7 +79,7 @@ Upon approval, generate a unique WorkGroupID and update `knowzcode_tracker.md` f
|
|
|
79
79
|
|
|
80
80
|
---
|
|
81
81
|
|
|
82
|
-
### Phase 1B: Specification
|
|
82
|
+
### 3.2 Phase 1B: Specification
|
|
83
83
|
|
|
84
84
|
Draft or refine `knowzcode/specs/[NodeID].md` for all nodes in the Change Set.
|
|
85
85
|
|
|
@@ -115,13 +115,13 @@ Known limitations and future work.
|
|
|
115
115
|
**Backward compatibility:** Old numbered-section specs remain valid until naturally touched. When finalizing, rewrite in the new format.
|
|
116
116
|
|
|
117
117
|
#### Quality Gate: Spec Approval
|
|
118
|
-
Present drafted specs to the user. **PAUSE and await user approval.** Log "SpecApproved" events.
|
|
118
|
+
Present drafted specs to the user. **PAUSE and await user approval.** Log "SpecApproved" events. In autonomous mode, auto-approve and proceed immediately (see Section 5).
|
|
119
119
|
|
|
120
120
|
**Pre-Implementation Commit:** After specs are approved, commit `knowzcode/` to create a checkpoint before implementation begins.
|
|
121
121
|
|
|
122
122
|
---
|
|
123
123
|
|
|
124
|
-
### Phase 2A: Implementation (TDD MANDATORY)
|
|
124
|
+
### 3.3 Phase 2A: Implementation (TDD MANDATORY)
|
|
125
125
|
|
|
126
126
|
For each NodeID in the approved Change Set:
|
|
127
127
|
|
|
@@ -160,7 +160,7 @@ Report implementation results including test counts, verification iterations, an
|
|
|
160
160
|
|
|
161
161
|
---
|
|
162
162
|
|
|
163
|
-
### Phase 2B: Completeness Audit
|
|
163
|
+
### 3.4 Phase 2B: Completeness Audit
|
|
164
164
|
|
|
165
165
|
An independent, READ-ONLY audit verifying what percentage of specifications were actually implemented.
|
|
166
166
|
|
|
@@ -177,11 +177,11 @@ An independent, READ-ONLY audit verifying what percentage of specifications were
|
|
|
177
177
|
- Cancel the WorkGroup
|
|
178
178
|
|
|
179
179
|
#### Quality Gate: Audit Approval
|
|
180
|
-
Present audit results to the user. **PAUSE for decision.** Only proceed to Phase 3 when the user approves.
|
|
180
|
+
Present audit results to the user. **PAUSE for decision.** Only proceed to Phase 3 when the user approves. In autonomous mode, auto-approve and proceed immediately unless safety exceptions apply (see Section 5).
|
|
181
181
|
|
|
182
182
|
---
|
|
183
183
|
|
|
184
|
-
### Phase 3: Atomic Finalization
|
|
184
|
+
### 3.5 Phase 3: Atomic Finalization
|
|
185
185
|
|
|
186
186
|
Once implementation is verified and approved, execute finalization:
|
|
187
187
|
|
|
@@ -258,28 +258,66 @@ You **MUST** pause and await explicit user approval at:
|
|
|
258
258
|
* If you encounter a critical, unresolvable issue
|
|
259
259
|
* If an architecture discrepancy is too complex to fix autonomously
|
|
260
260
|
|
|
261
|
+
### Autonomous Mode Override
|
|
262
|
+
|
|
263
|
+
When the user conveys intent for autonomous operation — through natural language (e.g., "approve all", "preapprove", "autonomous mode", "just run through", "I trust your judgement") or the `--autonomous` flag — quality gates above are still **presented** for transparency but **auto-approved** without waiting for user input. The workflow runs from start to finalization uninterrupted.
|
|
264
|
+
|
|
265
|
+
The lead should interpret the **spirit** of the user's instruction, not just exact keyword matches. If the user clearly wants the workflow to proceed without stopping, that constitutes autonomous mode activation.
|
|
266
|
+
|
|
267
|
+
**Safety exceptions** — ALWAYS pause even in autonomous mode:
|
|
268
|
+
* Critical, unresolvable blockers (Section 11)
|
|
269
|
+
* Security vulnerabilities rated HIGH or CRITICAL
|
|
270
|
+
* >3 failures on the same phase
|
|
271
|
+
* Architecture discrepancies too complex to fix autonomously
|
|
272
|
+
* >3 gap-fix iterations per partition without resolution
|
|
273
|
+
|
|
274
|
+
Autonomous mode is per-WorkGroup and does not carry over.
|
|
275
|
+
|
|
261
276
|
---
|
|
262
277
|
|
|
263
278
|
## 6. MCP Integration (Optional but Recommended)
|
|
264
279
|
|
|
265
280
|
If KnowzCode MCP server is configured (`knowzcode/mcp_config.md` or `knowzcode/knowzcode_vaults.md`), agents can leverage vault queries to enhance every phase.
|
|
266
281
|
|
|
282
|
+
**Before using MCP, read `knowzcode/knowzcode_vaults.md` to resolve vault IDs by type.** Use the vault's description to confirm the query is appropriate for that vault. If a single vault covers all types, use it for everything. Never hardcode vault names — always resolve from config.
|
|
283
|
+
|
|
284
|
+
### Vault Types
|
|
285
|
+
|
|
286
|
+
| Type | Purpose | Example Queries |
|
|
287
|
+
|------|---------|-----------------|
|
|
288
|
+
| **code** | Reference implementations, code snippets, API patterns | `"authentication middleware pattern"`, `"error handling in {framework}"` |
|
|
289
|
+
| **ecosystem** | Business rules, conventions, decisions, integrations, platform knowledge | `"checkout flow rules"`, `"pricing constraints"`, `"Stripe webhook setup"` |
|
|
290
|
+
| **finalizations** | WorkGroup completion summaries, outcome records | `"past decisions about {component}"`, `"similar WorkGroups"` |
|
|
291
|
+
|
|
292
|
+
A project may configure one vault covering all types (common for small teams) or multiple specialized vaults. Knowz-scribe (or direct MCP calls) writes to vaults; knowz-scout has read access only. The scribe is the primary capture agent that routes writes to the correct vault based on content type.
|
|
293
|
+
|
|
267
294
|
### Phase-Specific Usage
|
|
268
295
|
|
|
269
296
|
| Phase | MCP Tool | Purpose |
|
|
270
297
|
|-------|----------|---------|
|
|
271
|
-
| **1A (Analysis)** | `search_knowledge(
|
|
272
|
-
| **1B (Spec)** | `ask_question(
|
|
273
|
-
| **2A (Build)** | `search_knowledge(
|
|
274
|
-
| **2B (Audit)** | `ask_question(
|
|
275
|
-
| **3 (Close)** | `create_knowledge
|
|
298
|
+
| **1A (Analysis)** | `search_knowledge({vault matching "ecosystem" type}, "past decisions about {domain}")` | Find prior decisions affecting components |
|
|
299
|
+
| **1B (Spec)** | `ask_question({vault matching "ecosystem" type}, "conventions for {component_type}?")` | Check team conventions before drafting |
|
|
300
|
+
| **2A (Build)** | `search_knowledge({vault matching "code" type}, "{similar_feature} implementation")` | Find reference implementations |
|
|
301
|
+
| **2B (Audit)** | `ask_question({vault matching "ecosystem" type}, "standards for {domain}", researchMode=true)` | Comprehensive standards check |
|
|
302
|
+
| **3 (Close)** | Delegate to knowz-scribe (or `create_knowledge` directly if no scribe) | Capture patterns, decisions, workarounds |
|
|
303
|
+
|
|
304
|
+
### Knowz-Scribe (Multi-Agent Platforms)
|
|
305
|
+
|
|
306
|
+
On platforms with multi-agent orchestration (e.g., Claude Code Agent Teams), **knowz-scribe** has full read/write access to MCP vaults, and **knowz-scout** has read access to MCP vaults. Both have read/write access to local knowzcode files:
|
|
307
|
+
|
|
308
|
+
- Both spawned at workflow start (persistent agents, Stage 0 through Phase 3)
|
|
309
|
+
- **Knowz-scribe** is the primary capture agent — receives capture messages from teammates at each quality gate (e.g., `"Capture Phase 1A: {wgid}"`), reads the WorkGroup file, extracts learnings, and writes to the appropriate vault. Handles deduplication, formatting, and routing to the correct vault by type.
|
|
310
|
+
- **Knowz-scout** is the primary research agent — queries vaults for business context, conventions, and past decisions.
|
|
311
|
+
- Both stay alive through the entire workflow, shut down after Phase 3 capture
|
|
312
|
+
|
|
313
|
+
On platforms without multi-agent orchestration, the closer handles vault writes directly (see Section 7).
|
|
276
314
|
|
|
277
315
|
### Enterprise: Team Standards
|
|
278
316
|
|
|
279
|
-
At workflow start, if enterprise vault is configured (`knowzcode/enterprise/compliance_manifest.md`
|
|
317
|
+
At workflow start, if an enterprise-type vault is configured (read `knowzcode/knowzcode_vaults.md` to find vault matching type "enterprise", then check `knowzcode/enterprise/compliance_manifest.md` for `mcp_compliance_enabled: true`):
|
|
280
318
|
- Pull team-wide standards and merge into quality gate criteria
|
|
281
|
-
- Push audit results to enterprise vault after Phase 2B
|
|
282
|
-
- Push completion records to enterprise vault after Phase 3
|
|
319
|
+
- Push audit results to the resolved enterprise vault after Phase 2B
|
|
320
|
+
- Push completion records to the resolved enterprise vault after Phase 3
|
|
283
321
|
|
|
284
322
|
### Graceful Degradation
|
|
285
323
|
|
|
@@ -301,45 +339,48 @@ During finalization, scan the WorkGroup for insight-worthy patterns:
|
|
|
301
339
|
|
|
302
340
|
### Auto-Capture Triggers
|
|
303
341
|
|
|
304
|
-
Learning candidates are detected at each quality gate.
|
|
342
|
+
Learning candidates are detected at each quality gate. Capture is delegated to the knowz-scribe agent on multi-agent platforms, or handled directly via MCP tools on single-agent platforms.
|
|
305
343
|
|
|
306
|
-
**
|
|
307
|
-
```
|
|
308
|
-
If MCP available:
|
|
309
|
-
create_knowledge(research_vault, title="Scope: {goal}",
|
|
310
|
-
content="[NodeIDs] {list}\n[Risk] {assessment}\n[Decision] {user feedback}",
|
|
311
|
-
tags=["scope", "change-set"])
|
|
312
|
-
```
|
|
344
|
+
**Multi-agent platforms (knowz-scribe active):**
|
|
313
345
|
|
|
314
|
-
|
|
315
|
-
-
|
|
346
|
+
At each quality gate, send a message to the knowz-scribe with the phase identifier:
|
|
347
|
+
- After Phase 1A approval: `"Capture Phase 1A: {wgid}"`
|
|
348
|
+
- After Phase 2A completion: `"Capture Phase 2A: {wgid}"`
|
|
349
|
+
- After Phase 2B audit: `"Capture Phase 2B: {wgid}"`
|
|
350
|
+
- After Phase 3 finalization: `"Capture Phase 3: {wgid}"`
|
|
316
351
|
|
|
317
|
-
|
|
318
|
-
```
|
|
319
|
-
If MCP available:
|
|
320
|
-
create_knowledge(research_vault, title="Audit: {wgid} - {score}%",
|
|
321
|
-
content="[Findings] {gaps}\n[Security] {issues}\n[Decision] {user choice}",
|
|
322
|
-
tags=["audit", "quality"])
|
|
323
|
-
If MCP available AND enterprise vault configured:
|
|
324
|
-
create_knowledge(enterprise_vault, title="Audit: {wgid} - {score}%",
|
|
325
|
-
content="[Findings] {gaps}\n[Security] {issues}\n[Decision] {user choice}",
|
|
326
|
-
tags=["audit", "enterprise"])
|
|
327
|
-
```
|
|
352
|
+
The knowz-scribe reads the WorkGroup file, extracts relevant data, checks for duplicates, and writes to the appropriate vault. No other agent should call `create_knowledge` when the scribe is active.
|
|
328
353
|
|
|
329
|
-
**
|
|
330
|
-
|
|
354
|
+
**Single-agent / no scribe (direct MCP writes):**
|
|
355
|
+
|
|
356
|
+
If MCP is available but no knowz-scribe, resolve vault IDs from `knowzcode/knowzcode_vaults.md` before writing:
|
|
357
|
+
|
|
358
|
+
- After Phase 1A: `create_knowledge({ecosystem_vault}, title="Scope: {goal}", content="[NodeIDs] {list}\n[Risk] {assessment}", tags=["scope"])`
|
|
359
|
+
- After Phase 2A: Capture implementation patterns and workarounds discovered during TDD cycles
|
|
360
|
+
- After Phase 2B: `create_knowledge({ecosystem_vault}, title="Audit: {wgid} - {score}%", content="[Findings] {gaps}\n[Security] {issues}", tags=["audit"])`
|
|
361
|
+
- After Phase 2B (enterprise): If enterprise vault configured and compliance enabled, push audit results to enterprise vault
|
|
362
|
+
- After Phase 3: Capture architectural learnings and consolidation decisions (handled by closer agent)
|
|
331
363
|
|
|
332
364
|
### Capture Protocol
|
|
333
365
|
|
|
334
|
-
|
|
335
|
-
1.
|
|
336
|
-
2.
|
|
337
|
-
3.
|
|
338
|
-
|
|
366
|
+
**When knowz-scribe is active (multi-agent platforms):**
|
|
367
|
+
1. Send capture message to knowz-scribe with phase identifier and WorkGroup ID
|
|
368
|
+
2. The scribe handles: vault ID resolution, duplicate checking, user approval prompting, and writing
|
|
369
|
+
3. No other agent should call `create_knowledge` directly
|
|
370
|
+
|
|
371
|
+
**When no knowz-scribe (single-agent / sequential):**
|
|
372
|
+
1. Read `knowzcode/knowzcode_vaults.md` to resolve vault IDs by type
|
|
373
|
+
2. Detect learning candidates from WorkGroup file content
|
|
374
|
+
3. Check for duplicates via `search_knowledge` — skip if substantially similar exists
|
|
375
|
+
4. Prompt user for approval before saving
|
|
376
|
+
5. Only write if the targeted vault is configured — skip gracefully if not
|
|
377
|
+
6. Create learning via `create_knowledge` with appropriate title prefix
|
|
339
378
|
|
|
340
379
|
### Audit Trail (Enterprise)
|
|
341
380
|
|
|
342
|
-
After Phase 3
|
|
381
|
+
After Phase 3:
|
|
382
|
+
1. Read `knowzcode/knowzcode_vaults.md` to find vault matching type "enterprise"
|
|
383
|
+
2. Only push if an enterprise vault is configured
|
|
343
384
|
- Push WorkGroup completion record with goal, NodeIDs, audit score, and decisions
|
|
344
385
|
- Push architecture drift findings if any detected during finalization
|
|
345
386
|
|
|
@@ -378,6 +419,31 @@ When a single AI handles all phases sequentially:
|
|
|
378
419
|
- Pause at each gate for user approval
|
|
379
420
|
- All quality standards apply identically
|
|
380
421
|
|
|
422
|
+
### Parallel Execution (Multi-Agent Platforms)
|
|
423
|
+
|
|
424
|
+
On platforms supporting concurrent agents (Claude Code Agent Teams, future multi-agent runtimes):
|
|
425
|
+
|
|
426
|
+
#### Parallelism Boundaries
|
|
427
|
+
- **Between phases**: Phase 1A must produce Change Set before 1B drafts specs (scope must be approved first)
|
|
428
|
+
- **Within phases**: Independent NodeIDs can be implemented/audited in parallel
|
|
429
|
+
- **Across phases**: Incremental review can start on completed components while other components are still being implemented
|
|
430
|
+
- **Agent persistence**: Agents can stay alive across sub-phases to avoid cold-start overhead (e.g., builder persists through audit gap loop)
|
|
431
|
+
|
|
432
|
+
#### Dependency Map
|
|
433
|
+
The analyst produces a dependency map alongside the Change Set, identifying:
|
|
434
|
+
- Which NodeIDs share affected files (must be implemented sequentially or by same agent)
|
|
435
|
+
- Which NodeIDs are independent (can be implemented in parallel)
|
|
436
|
+
- Sequential dependencies (NodeID-B requires NodeID-A's output)
|
|
437
|
+
|
|
438
|
+
#### Incremental Review
|
|
439
|
+
The reviewer can audit completed NodeIDs before all implementation finishes. Gap findings are routed back to the implementer for targeted fixes, then re-audited. Agents persist through this gap loop — no respawning.
|
|
440
|
+
|
|
441
|
+
#### Context Scouts
|
|
442
|
+
Dedicated context-gathering agents can run in parallel with core analysis:
|
|
443
|
+
- Local context scout: reads project history, specs, workgroups
|
|
444
|
+
- Knowz scout: queries and writes to knowledge management vaults for business context (full read/write access)
|
|
445
|
+
Both broadcast findings to inform analyst and architect work.
|
|
446
|
+
|
|
381
447
|
### Sequential Execution Protocol (for platforms without orchestration)
|
|
382
448
|
|
|
383
449
|
For platforms like Cursor, Copilot, or Windsurf where there is no agent orchestration:
|
|
@@ -1,233 +1,48 @@
|
|
|
1
|
-
#
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
**
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
###
|
|
32
|
-
|
|
33
|
-
*
|
|
34
|
-
*
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
| Testing (E2E/Integ.) | [Agent: e.g., Playwright, Cypress, Postman/Newman, None. Recommend if applicable for MVP.] | [Agent: e.g., Playwright 1.4x.x] | (Agent: Use this for running integration/E2E tests) |
|
|
50
|
-
| Version Control | Git | N/A | Repo hosted on [Agent: e.g., GitHub, GitLab, or local] |
|
|
51
|
-
| Deployment Target | [Agent: e.g., Vercel, Netlify, AWS, Local Docker] | N/A | Primary deployment target. |
|
|
52
|
-
| Key Libraries | [Agent: e.g., axios for HTTP, bcryptjs for hashing. List 1-2 essential libraries and versions.] | [Agent: Specify versions, e.g., axios@1.6.0] | (Agent: Key dependencies to install.) |
|
|
53
|
-
| Other (Specify) | | | |
|
|
54
|
-
|
|
55
|
-
* **Tech Stack Rationale:** [Agent: Briefly explain why the chosen stack (especially language/framework) is suitable for this project. E.g., "Node.js with Express.js offers rapid development for web APIs and has a vast ecosystem of packages."]
|
|
56
|
-
|
|
57
|
-
---
|
|
58
|
-
|
|
59
|
-
### 5. High-Level Architecture
|
|
60
|
-
|
|
61
|
-
* **Architectural Style:** [Agent: Describe the chosen style, e.g., "Monolithic Web Application," "Serverless API with Frontend Client," "Three-Tier Architecture." Suggest a simple, robust architecture.]
|
|
62
|
-
* **Key Components & Interactions (Brief Textual Description):** [Agent: Describe the main pieces and how they generally communicate. This complements `knowzcode_architecture.md`. E.g., "The React frontend client makes API calls to the Express.js backend. The backend handles business logic and interacts with the PostgreSQL database via Prisma ORM."]
|
|
63
|
-
* **Diagram (Mermaid - Agent to Generate):**
|
|
64
|
-
```mermaid
|
|
65
|
-
graph TD
|
|
66
|
-
A[User via Browser/Client] --> B(Frontend SPA - [Agent: e.g., React]);
|
|
67
|
-
B --> C{Backend API - [Agent: e.g., Express.js]};
|
|
68
|
-
C --> D[(Database - [Agent: e.g., PostgreSQL])];
|
|
69
|
-
C --> E{{External Service API (Optional - [Agent: e.g., Stripe])}};
|
|
70
|
-
|
|
71
|
-
%% Agent: Define main components and primary interaction flows based on UserProjectIdea and chosen style. Keep it simple (2-5 components).
|
|
72
|
-
%% Example Subgraph for services
|
|
73
|
-
subgraph Backend Logic
|
|
74
|
-
direction LR
|
|
75
|
-
C --- S1[Auth Service (Handles Login/Signup)];
|
|
76
|
-
C --- S2[Core Feature Service (Manages [Primary Feature])];
|
|
77
|
-
end
|
|
78
|
-
```
|
|
79
|
-
*(Agent: Generate a SIMPLE Mermaid diagram showing 2-5 main components and their primary interactions. The main detailed flowchart is in `knowzcode_architecture.md`.)*
|
|
80
|
-
|
|
81
|
-
---
|
|
82
|
-
|
|
83
|
-
### 6. Core Components/Modules (Logical Breakdown)
|
|
84
|
-
|
|
85
|
-
* `[Component/Module 1 Name - Agent: e.g., User Authentication Module]`: [Agent: Brief responsibility. E.g., "Handles user registration, login, session management, password hashing."]
|
|
86
|
-
* `[Component/Module 2 Name - Agent: e.g., Main Feature X Logic]`: [Agent: Brief responsibility. E.g., "Manages core logic for Feature X, including data processing and interactions with Y."]
|
|
87
|
-
* `[Component/Module 3 Name - Agent: e.g., Primary UI View Components]`: [Agent: Brief responsibility. E.g., "Set of React components for rendering the main dashboard, forms, and user interactions."]
|
|
88
|
-
* *(Agent: List 2-4 primary logical components based on the architecture and `UserProjectIdea`.)*
|
|
89
|
-
|
|
90
|
-
---
|
|
91
|
-
|
|
92
|
-
### 7. Key UI/UX Considerations
|
|
93
|
-
|
|
94
|
-
* **Overall Feel:** [Agent: Describe the desired user experience. E.g., "Simple and intuitive," "Modern and professional," "Fast and responsive." Infer from `UserProjectIdea` or suggest a sensible default.]
|
|
95
|
-
* **Key Principles:**
|
|
96
|
-
* `[Principle 1]`: [Agent: e.g., "Clarity: Ensure clear navigation and unambiguous calls to action."]
|
|
97
|
-
* `[Principle 2]`: [Agent: e.g., "Efficiency: Minimize clicks and streamline common workflows."]
|
|
98
|
-
* `[Principle 3]`: [Agent: e.g., "Responsiveness: Basic usability on common screen sizes (desktop primary, mobile secondary consideration for MVP)."]
|
|
99
|
-
|
|
100
|
-
---
|
|
101
|
-
|
|
102
|
-
### 8. Coding Standards & Conventions
|
|
103
|
-
|
|
104
|
-
* **Primary Style Guide:** [Agent: e.g., "Airbnb JavaScript Style Guide (with Prettier for formatting)," "PEP 8 for Python (with Black for formatting)"]
|
|
105
|
-
* **Formatter:** [Agent: e.g., "Prettier (config in `.prettierrc` - use default if not specified)," "Black (Python)"] (Agent: You will apply this during ARC-Based Verification)
|
|
106
|
-
* **Linter:** [Agent: e.g., "ESLint (config in `.eslintrc.js` - use default if not specified)," "Flake8 (Python)"] (Agent: You will apply this during ARC-Based Verification)
|
|
107
|
-
* **File Naming Conventions:** [Agent: e.g., `kebab-case.js` for files, `PascalCase.jsx` for React components, `snake_case.py` for Python files]
|
|
108
|
-
* **Commit Message Convention:** [Agent: e.g., "Conventional Commits (e.g., `feat: add login button`, `fix: correct validation logic`)"]
|
|
109
|
-
* **Code Commenting Style:** [Agent: e.g., "JSDoc for public functions/methods," "Python docstrings (Google style)," "Use comments sparingly only for complex, non-obvious logic."]
|
|
110
|
-
* **Other Key Standards:**
|
|
111
|
-
* [Agent: e.g., "Avoid magic numbers/strings; use named constants."]
|
|
112
|
-
* [Agent: e.g., "All API endpoints must have basic input validation on the server-side."]
|
|
113
|
-
* [Agent: e.g., "Relative imports for intra-project modules."]
|
|
114
|
-
|
|
115
|
-
### 8.1 Component Classification Criteria
|
|
116
|
-
|
|
117
|
-
* **Standard**: Simple components with clear inputs/outputs, minimal business logic
|
|
118
|
-
* **Complex**: Components with significant business logic, multiple dependencies, or state management
|
|
119
|
-
* **Critical**: Components handling security, payments, user data, or system stability
|
|
120
|
-
|
|
121
|
-
---
|
|
122
|
-
|
|
123
|
-
### 9. Key Quality Criteria Focus (Priorities from `knowzcode/knowzcode_log.md`)
|
|
124
|
-
* This project will prioritize the following **Top 3-5 quality criteria** from the "Reference Quality Criteria" section of `knowzcode/knowzcode_log.md`. Agent, you should pay special attention to these during ARC-Based Verification.
|
|
125
|
-
1. [Agent: Suggest Priority 1 Quality Criterion - e.g., Reliability (Robust error handling)]
|
|
126
|
-
2. [Agent: Suggest Priority 2 Quality Criterion - e.g., Maintainability (Clear, modular code)]
|
|
127
|
-
3. [Agent: Suggest Priority 3 Quality Criterion - e.g., Security (Secure auth practices, input validation)]
|
|
128
|
-
4. [Agent: Suggest Optional Priority 4, if applicable]
|
|
129
|
-
5. [Agent: Suggest Optional Priority 5, if applicable]
|
|
130
|
-
* **Rationale for Priorities:** [Agent: Briefly explain why these priorities are important for this specific project based on `UserProjectIdea`.]
|
|
131
|
-
|
|
132
|
-
---
|
|
133
|
-
|
|
134
|
-
### 10. Testing Strategy
|
|
135
|
-
|
|
136
|
-
* **Required Test Types for MVP:**
|
|
137
|
-
* `Unit Tests`: [Agent: e.g., "Required for all core business logic functions/modules and critical utility functions."]
|
|
138
|
-
* `Integration Tests`: [Agent: e.g., "Required for API endpoint interactions and key service-to-service integrations."]
|
|
139
|
-
* `E2E Tests (Optional for MVP)`: [Agent: e.g., "Minimal set for 1-2 primary user flows (e.g., signup-login-perform core action)."]
|
|
140
|
-
* **Testing Framework(s) & Version(s):** [Agent: Refer to Technology Stack, e.g., "Jest 29.x for unit/integration (JavaScript)", "PyTest 7.x for Python".]
|
|
141
|
-
* **Test File Location & Naming:** [Agent: e.g., "Test files located adjacent to source files (`module.test.js`) or in a dedicated `__tests__`/`tests/` directory. Test names should be descriptive: `it('should return sum of two numbers')`."]
|
|
142
|
-
* **Minimum Code Coverage Target (Conceptual Goal):** [Agent: e.g., "Aim for >70% for unit-tested core logic." State as an aim, not a strict CI blocker for MVP unless specified by user.]
|
|
143
|
-
|
|
144
|
-
---
|
|
145
|
-
|
|
146
|
-
### 11. Initial Setup Steps (Conceptual for a new developer/environment)
|
|
147
|
-
|
|
148
|
-
1. **Clone Repository:** `git clone [repository_url]`
|
|
149
|
-
2. **Install Language/Tools:** (Agent: Check versions against Tech Stack; use `knowzcode/EnvironmentContext.md` for specific commands).
|
|
150
|
-
3. **Install Dependencies:** (Agent: Use the dependency manager defined in `knowzcode/EnvironmentContext.md`, e.g., `npm install`).
|
|
151
|
-
4. **Environment Variables & Secrets:**
|
|
152
|
-
* [Agent: List any anticipated required environment variables based on common app needs or `UserProjectIdea`, e.g., `DATABASE_URL`, `SESSION_SECRET`, `ANY_EXTERNAL_API_KEY`].
|
|
153
|
-
* (Agent: Secrets must be stored securely, e.g., in a `.env` file loaded at runtime, and never committed to version control).
|
|
154
|
-
5. **Database Setup (If applicable):**
|
|
155
|
-
* [Agent: e.g., "Run database migrations using the command specified in `knowzcode/EnvironmentContext.md`, such as `npx prisma migrate dev`."]
|
|
156
|
-
6. **Run Development Server:**
|
|
157
|
-
* [Agent: Specify the typical run command for the chosen stack, e.g., `npm run dev`, `python main.py`.]
|
|
158
|
-
* (Agent: The server must bind to the host and port specified in `knowzcode/EnvironmentContext.md`).
|
|
159
|
-
|
|
160
|
-
---
|
|
161
|
-
|
|
162
|
-
### 12. Key Architectural Decisions & Rationale
|
|
163
|
-
|
|
164
|
-
* **Decision 1: [Agent: e.g., Choice of Primary Language/Framework - e.g., Node.js with Express.js]**
|
|
165
|
-
* **Rationale:** [Agent: e.g., "Chosen for its non-blocking I/O suitable for web applications and its large ecosystem of packages." If user specified, use their rationale or infer and confirm.]
|
|
166
|
-
* **Decision 2: [Agent: e.g., Database Choice - e.g., PostgreSQL]**
|
|
167
|
-
* **Rationale:** [Agent: e.g., "Selected for its robustness, SQL capabilities, and wide support from ORMs and cloud providers."]
|
|
168
|
-
* **(Optional) Decision 3: [Agent: e.g., Architectural Style - e.g., Monolithic App for MVP]**
|
|
169
|
-
* **Rationale:** [Agent: e.g., "A monolithic approach was chosen for the MVP to simplify initial development and deployment, reducing complexity. Microservices can be considered for future scaling if needed."]
|
|
170
|
-
|
|
171
|
-
---
|
|
172
|
-
|
|
173
|
-
### 13. Repository Link
|
|
174
|
-
|
|
175
|
-
* `[Agent: Link to Git Repository. User/Orchestrator will confirm/update.]` (Can be placeholder initially: "[To be confirmed/updated]")
|
|
176
|
-
|
|
177
|
-
---
|
|
178
|
-
|
|
179
|
-
### 14. Dependencies & Third-Party Services (Key Ones for MVP)
|
|
180
|
-
|
|
181
|
-
* **[Service 1 Name - Agent: e.g., PostgreSQL Database]:**
|
|
182
|
-
* Purpose: Primary data storage.
|
|
183
|
-
* Integration: Via `DATABASE_URL` environment variable.
|
|
184
|
-
* **(Optional) [External API Name - Agent: e.g., Stripe API]:**
|
|
185
|
-
* Purpose: [Agent: e.g., "To handle payments."]
|
|
186
|
-
* Integration: [Agent: e.g., "Via HTTP POST requests to their API endpoint. Requires API key."]
|
|
187
|
-
* Required Credentials: `[Agent: e.g., STRIPE_API_KEY]` (To be stored as an environment variable).
|
|
188
|
-
* *(Agent: List only essential external services for the MVP based on `UserProjectIdea`.)*
|
|
189
|
-
|
|
190
|
-
---
|
|
191
|
-
|
|
192
|
-
### 15. Security Considerations (Initial High-Level)
|
|
193
|
-
|
|
194
|
-
* **Authentication:** [Agent: e.g., "Session-based authentication using secure, HTTP-only cookies and a `SESSION_SECRET` stored as an environment variable / JWT-based authentication for APIs." Passwords **MUST** be hashed (e.g., using bcrypt or argon2).]
|
|
195
|
-
* **Authorization:** [Agent: e.g., "Basic role-based access control if multiple user types exist. Check authorization on the server-side for all sensitive operations."]
|
|
196
|
-
* **Input Validation:** [Agent: e.g., "All user inputs (forms, API request bodies/params) MUST be validated on the server-side to prevent common injection attacks (XSS, SQLi - though ORM mitigates SQLi largely)."]
|
|
197
|
-
* **Data Protection:**
|
|
198
|
-
* "Sensitive data (e.g., PII, passwords) handled with care. Avoid logging sensitive data."
|
|
199
|
-
* "Use HTTPS in production environments."
|
|
200
|
-
* **Dependency Management:** [Agent: e.g., "Dependencies will be kept updated. Use `npm audit` / `pip-audit` or similar tools periodically."]
|
|
201
|
-
* **Secrets Management:** "All API keys, database credentials, and other secrets **MUST** be stored as environment variables and not hardcoded."
|
|
202
|
-
|
|
203
|
-
---
|
|
204
|
-
|
|
205
|
-
### 16. Performance Requirements (Initial Qualitative Goals)
|
|
206
|
-
|
|
207
|
-
* **Response Time:** [Agent: e.g., "Web pages and API responses should generally feel responsive, aiming for <500ms for common operations under typical load." Suggest sensible defaults.]
|
|
208
|
-
* **Load Capacity (Conceptual for MVP):** [Agent: e.g., "Application should handle a small number of concurrent users smoothly (e.g., 10-50)."]
|
|
209
|
-
* **Scalability Approach (Future Consideration):** [Agent: e.g., "For MVP, vertical scaling is the primary approach. Horizontal scaling or more complex strategies are future considerations."]
|
|
210
|
-
|
|
211
|
-
---
|
|
212
|
-
|
|
213
|
-
### 17. Monitoring & Observability (Basic for MVP)
|
|
214
|
-
|
|
215
|
-
* **Logging Strategy (Application-level):**
|
|
216
|
-
* [Agent: e.g., "Structured JSON logging to console for key application events, errors, and requests (e.g., using a library like Pino for Node.js or standard Python logging module)."]
|
|
217
|
-
* "Include timestamps, log levels (INFO, WARN, ERROR), and relevant context (e.g., request ID)."
|
|
218
|
-
* **Monitoring Tools:** [Agent: e.g., "For MVP, rely on standard console/file logs. No complex external tools unless user specifies."]
|
|
219
|
-
* **Key Metrics to Observe (Qualitative):** Error rates in logs, general application responsiveness.
|
|
220
|
-
* **Alerting Criteria (Manual for MVP):** [Agent: e.g., "Monitor logs for frequent errors or performance degradation manually."]
|
|
221
|
-
|
|
222
|
-
---
|
|
223
|
-
|
|
224
|
-
### 18. Links to Other KnowzCode Artifacts
|
|
225
|
-
* **Agent Main Loop & Protocol:** `knowzcode/knowzcode_loop.md`
|
|
226
|
-
* **Operational Record & Quality Criteria:** `knowzcode/knowzcode_log.md`
|
|
227
|
-
* **Architectural Flowchart (This Project):** `knowzcode/knowzcode_architecture.md`
|
|
228
|
-
* **Status Map (This Project):** `knowzcode/knowzcode_tracker.md`
|
|
229
|
-
* **Component Specifications Directory:** `knowzcode/specs/`
|
|
230
|
-
* **Environment Protocol:** `knowzcode/environment_context.md` (or equivalent)
|
|
231
|
-
|
|
232
|
-
---
|
|
233
|
-
*(Agent: This document, once populated by you based on user input and sensible defaults, will become the single source of truth for high-level project information and guidelines. It will be kept up-to-date if major project parameters change.)*
|
|
1
|
+
# Project Overview
|
|
2
|
+
|
|
3
|
+
## Goal
|
|
4
|
+
* **Goal:** [concise project objective — 1-2 sentences]
|
|
5
|
+
* **Core Problem:** [specific user problem this solves — 1-2 sentences]
|
|
6
|
+
|
|
7
|
+
## Stack
|
|
8
|
+
|
|
9
|
+
| Category | Technology | Version |
|
|
10
|
+
|:---------|:-----------|:--------|
|
|
11
|
+
| Language | | |
|
|
12
|
+
| Backend Framework | | |
|
|
13
|
+
| Frontend Framework | | |
|
|
14
|
+
| Database | | |
|
|
15
|
+
| ORM/ODM | | |
|
|
16
|
+
| Testing (Unit) | | |
|
|
17
|
+
| Testing (E2E) | | |
|
|
18
|
+
| Key Libraries | | |
|
|
19
|
+
|
|
20
|
+
## Architecture
|
|
21
|
+
* **Style:** [e.g., Monolithic, Microservices, Serverless]
|
|
22
|
+
* **Key Components:** [2-3 sentence description of main components and interactions]
|
|
23
|
+
|
|
24
|
+
## Standards
|
|
25
|
+
* **Formatter:** [e.g., Prettier, Black]
|
|
26
|
+
* **Linter:** [e.g., ESLint, Flake8]
|
|
27
|
+
* **Test Framework:** [e.g., Jest, PyTest]
|
|
28
|
+
* **Commit Convention:** [e.g., Conventional Commits]
|
|
29
|
+
* **File Naming:** [e.g., kebab-case.js, PascalCase.tsx]
|
|
30
|
+
|
|
31
|
+
### Component Classification
|
|
32
|
+
* **Standard**: Simple components, clear inputs/outputs, minimal business logic
|
|
33
|
+
* **Complex**: Significant business logic, multiple dependencies, state management
|
|
34
|
+
* **Critical**: Security, payments, user data, system stability
|
|
35
|
+
|
|
36
|
+
## Testing
|
|
37
|
+
* **Unit Tests:** Required for core business logic and utilities
|
|
38
|
+
* **Integration Tests:** Required for API endpoints and service interactions
|
|
39
|
+
* **E2E Tests:** [Optional for MVP — describe scope if applicable]
|
|
40
|
+
* **Coverage Target:** [e.g., >70% for core logic]
|
|
41
|
+
* **Test Location:** [e.g., adjacent `*.test.js` or `tests/` directory]
|
|
42
|
+
|
|
43
|
+
## Security Priorities
|
|
44
|
+
* **Authentication:** [method — session-based, JWT, etc. Passwords MUST be hashed]
|
|
45
|
+
* **Authorization:** [approach — RBAC, ownership checks, etc.]
|
|
46
|
+
* **Input Validation:** All user inputs validated server-side
|
|
47
|
+
* **Secrets:** Environment variables only, never hardcoded
|
|
48
|
+
* **Dependencies:** Regular `npm audit` / `pip-audit` checks
|