agent-method 1.5.12

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 (108) hide show
  1. package/README.md +343 -0
  2. package/bin/wwa.js +115 -0
  3. package/docs/internal/cli-commands.yaml +259 -0
  4. package/docs/internal/doc-tokens.yaml +1103 -0
  5. package/docs/internal/feature-registry.yaml +1643 -0
  6. package/lib/boundaries.js +247 -0
  7. package/lib/cli/add.js +170 -0
  8. package/lib/cli/casestudy.js +1000 -0
  9. package/lib/cli/check.js +323 -0
  10. package/lib/cli/close.js +838 -0
  11. package/lib/cli/completion.js +735 -0
  12. package/lib/cli/deps.js +234 -0
  13. package/lib/cli/digest.js +73 -0
  14. package/lib/cli/doc-review.js +486 -0
  15. package/lib/cli/docs.js +315 -0
  16. package/lib/cli/helpers.js +198 -0
  17. package/lib/cli/implement.js +169 -0
  18. package/lib/cli/init.js +280 -0
  19. package/lib/cli/pipeline.js +206 -0
  20. package/lib/cli/plan.js +140 -0
  21. package/lib/cli/record.js +98 -0
  22. package/lib/cli/refine.js +202 -0
  23. package/lib/cli/report-helpers.js +113 -0
  24. package/lib/cli/review.js +76 -0
  25. package/lib/cli/routable.js +109 -0
  26. package/lib/cli/route.js +101 -0
  27. package/lib/cli/scan.js +133 -0
  28. package/lib/cli/serve.js +23 -0
  29. package/lib/cli/status.js +65 -0
  30. package/lib/cli/update-docs.js +574 -0
  31. package/lib/cli/upgrade.js +222 -0
  32. package/lib/cli/watch.js +32 -0
  33. package/lib/dependencies.js +196 -0
  34. package/lib/init.js +692 -0
  35. package/lib/mcp-server.js +612 -0
  36. package/lib/pipeline.js +907 -0
  37. package/lib/registry.js +132 -0
  38. package/lib/watcher.js +165 -0
  39. package/package.json +54 -0
  40. package/templates/README.md +363 -0
  41. package/templates/entry-points/.cursorrules +90 -0
  42. package/templates/entry-points/AGENT.md +90 -0
  43. package/templates/entry-points/CLAUDE.md +88 -0
  44. package/templates/extensions/MANIFEST.md +110 -0
  45. package/templates/extensions/analytical-system.md +96 -0
  46. package/templates/extensions/code-project.md +77 -0
  47. package/templates/extensions/data-exploration.md +117 -0
  48. package/templates/full/.context/BASE.md +101 -0
  49. package/templates/full/.context/COMPOSITION.md +47 -0
  50. package/templates/full/.context/INDEX.yaml +56 -0
  51. package/templates/full/.context/METHODOLOGY.md +246 -0
  52. package/templates/full/.context/PROTOCOL.yaml +169 -0
  53. package/templates/full/.context/REGISTRY.md +75 -0
  54. package/templates/full/.cursorrules +90 -0
  55. package/templates/full/AGENT.md +90 -0
  56. package/templates/full/CLAUDE.md +90 -0
  57. package/templates/full/Management/DIGEST.md +23 -0
  58. package/templates/full/Management/STATUS.md +46 -0
  59. package/templates/full/PLAN.md +67 -0
  60. package/templates/full/PROJECT-PROFILE.md +61 -0
  61. package/templates/full/PROJECT.md +80 -0
  62. package/templates/full/REQUIREMENTS.md +30 -0
  63. package/templates/full/ROADMAP.md +39 -0
  64. package/templates/full/Reviews/INDEX.md +41 -0
  65. package/templates/full/Reviews/backlog.md +52 -0
  66. package/templates/full/Reviews/plan.md +43 -0
  67. package/templates/full/Reviews/project.md +41 -0
  68. package/templates/full/Reviews/requirements.md +42 -0
  69. package/templates/full/Reviews/roadmap.md +41 -0
  70. package/templates/full/Reviews/state.md +56 -0
  71. package/templates/full/SESSION-LOG.md +102 -0
  72. package/templates/full/STATE.md +42 -0
  73. package/templates/full/SUMMARY.md +27 -0
  74. package/templates/full/agentWorkflows/INDEX.md +42 -0
  75. package/templates/full/agentWorkflows/observations.md +65 -0
  76. package/templates/full/agentWorkflows/patterns.md +68 -0
  77. package/templates/full/agentWorkflows/sessions.md +92 -0
  78. package/templates/full/intro/README.md +39 -0
  79. package/templates/full/registry/feature-registry.yaml +25 -0
  80. package/templates/full/registry/features/catalog.yaml +743 -0
  81. package/templates/full/registry/features/protocol.yaml +121 -0
  82. package/templates/full/registry/features/routing.yaml +358 -0
  83. package/templates/full/registry/features/workflows.yaml +404 -0
  84. package/templates/full/todos/backlog.md +19 -0
  85. package/templates/starter/.context/BASE.md +66 -0
  86. package/templates/starter/.context/INDEX.yaml +51 -0
  87. package/templates/starter/.context/METHODOLOGY.md +228 -0
  88. package/templates/starter/.context/PROTOCOL.yaml +165 -0
  89. package/templates/starter/.cursorrules +90 -0
  90. package/templates/starter/AGENT.md +90 -0
  91. package/templates/starter/CLAUDE.md +90 -0
  92. package/templates/starter/Management/DIGEST.md +23 -0
  93. package/templates/starter/Management/STATUS.md +46 -0
  94. package/templates/starter/PLAN.md +67 -0
  95. package/templates/starter/PROJECT-PROFILE.md +44 -0
  96. package/templates/starter/PROJECT.md +80 -0
  97. package/templates/starter/ROADMAP.md +39 -0
  98. package/templates/starter/Reviews/INDEX.md +75 -0
  99. package/templates/starter/SESSION-LOG.md +102 -0
  100. package/templates/starter/STATE.md +42 -0
  101. package/templates/starter/SUMMARY.md +27 -0
  102. package/templates/starter/agentWorkflows/INDEX.md +61 -0
  103. package/templates/starter/intro/README.md +37 -0
  104. package/templates/starter/registry/feature-registry.yaml +25 -0
  105. package/templates/starter/registry/features/catalog.yaml +743 -0
  106. package/templates/starter/registry/features/protocol.yaml +121 -0
  107. package/templates/starter/registry/features/routing.yaml +358 -0
  108. package/templates/starter/registry/features/workflows.yaml +404 -0
@@ -0,0 +1,110 @@
1
+ # Extension Manifest
2
+
3
+ How project-type extensions compose into entry points. This document defines compatibility, merging rules, and the composition algorithm.
4
+
5
+ ## Available extensions
6
+
7
+ | Extension | File | Project types | Workflows | Query patterns added |
8
+ |-----------|------|--------------|-----------|---------------------|
9
+ | **code-project** | code-project.md | code, mixed | WF-02 | 6 (code_change, bug_fix, dependency_update, database_work, api_work, deployment_work) |
10
+ | **data-exploration** | data-exploration.md | data, mixed | WF-05 | 9 (data_ingest, schema_query, explore_entity, relationship_query, quality_check, analytical_query, document_search, dimension_management, add_reference) |
11
+ | **analytical-system** | analytical-system.md | analytical, mixed | WF-06 | 4 (chain_work, evaluation, composition, domain_research) |
12
+
13
+ ## Compatibility matrix
14
+
15
+ Extensions are additive. Any combination is valid — they add rows to different sections without conflict.
16
+
17
+ | Combination | Compatible | Notes |
18
+ |-------------|:----------:|-------|
19
+ | code + data | yes | Common for data-backed applications. Both sets of scoping rules active. |
20
+ | code + analytical | yes | Common for ML/AI applications with code and prompt pipelines. |
21
+ | data + analytical | yes | Common for data analysis with evaluation pipelines. |
22
+ | code + data + analytical | yes | Full mixed project. All scoping rules active. |
23
+ | any + general | yes | General is the base — extensions add to it. |
24
+
25
+ ## Composition algorithm
26
+
27
+ When setup.sh (or manual composition) applies extensions, it follows this algorithm:
28
+
29
+ ### Step 1: Start with the base entry point
30
+
31
+ The base entry point (from starter or full template) provides:
32
+ - Universal scoping rules (planning, context refresh, phase completion, backlog)
33
+ - Universal cascade rules (phase completion, requirements change, decisions, structure)
34
+ - Universal workflow selection
35
+ - Universal conventions and do-not rules
36
+
37
+ ### Step 2: For each selected extension, merge additively
38
+
39
+ For each extension file, extract and inject:
40
+
41
+ | Section | Merge action | Injection point |
42
+ |---------|-------------|-----------------|
43
+ | Scoping rules | Append rows to scoping table | Before the phase completion row |
44
+ | Cascade rules | Append rows to cascade table | After the "New domain area" row |
45
+ | Workflow | Append line to workflow section | After the "First session" line |
46
+ | Conventions | Append items to conventions list | After the "Propose plans" convention |
47
+ | Do-not rules | Append items to do-not list | After the "Load multiple specialist" rule |
48
+
49
+ ### Step 3: Update PROJECT-PROFILE.md
50
+
51
+ Record which extensions were applied and their source (setup.sh or manual).
52
+
53
+ ### Step 4: Remove instruction comments
54
+
55
+ Strip all `<!-- INSTRUCTION: ... -->` comments from the merged entry point.
56
+
57
+ ## Scoping rule composition
58
+
59
+ When multiple extensions are active, the scoping table grows to include all extension rows. The agent classifies queries against ALL rows and routes to the best match.
60
+
61
+ **Priority rules for overlapping patterns:**
62
+ 1. Project-specific scoping table rows take precedence over registry patterns
63
+ 2. More specific query types take precedence over general ones
64
+ 3. If ambiguous between extensions, ask the user (STT-02 flagUncertainty)
65
+
66
+ **Example: code + data project scoping table:**
67
+
68
+ ```markdown
69
+ | Query type | Read before acting | Update after acting |
70
+ |------------|-------------------|-------------------|
71
+ | **Planning / roadmap** | REQUIREMENTS.md, ROADMAP.md | STATE.md, PLAN.md |
72
+ | **Context refresh** | .context/ (all), project structure | .context/, this file |
73
+ | **Code change** | .context/BASE.md + relevant specialist, test files | Source files, test files, .context/BASE.md |
74
+ | **Bug fix** | .context/BASE.md + relevant specialist, test files | Source files, test files |
75
+ | **Data ingest** | .context/BASE.md | .context/BASE.md, specialist stubs |
76
+ | **Schema query** | .context/BASE.md + .context/SCHEMA.md | -- |
77
+ | **Phase completion** | SUMMARY.md | SUMMARY.md, STATE.md, ROADMAP.md |
78
+ | **Backlog / ideas** | todos/backlog.md | todos/backlog.md |
79
+ ```
80
+
81
+ ## Cascade rule composition
82
+
83
+ Cascade rules from multiple extensions coexist. All cascade rules are checked after every file change — there is no conflict between extensions because cascade rules trigger on different file types.
84
+
85
+ **If two cascade rules match the same trigger**: Both propagation sets apply (union of dependent files).
86
+
87
+ ## Manual composition (without setup.sh)
88
+
89
+ To add an extension to an existing project:
90
+
91
+ 1. Read the extension file (e.g., `code-project.md`)
92
+ 2. Copy scoping rules into your entry point's scoping table
93
+ 3. Copy cascade rules into your entry point's cascade table
94
+ 4. Copy the workflow line into your workflow section
95
+ 5. Copy conventions and do-not items into your lists
96
+ 6. Update `PROJECT-PROFILE.md` extension stack table
97
+ 7. Delete instruction comments if present
98
+
99
+ To remove an extension: reverse the process — delete the rows that came from that extension file.
100
+
101
+ ## Adding extensions mid-project
102
+
103
+ Extensions can be added at any time without re-running setup.sh:
104
+
105
+ 1. Follow the manual composition steps above
106
+ 2. Run a context refresh (WF-03) to update .context/ files for the new domain
107
+ 3. Update PROJECT-PROFILE.md with the new extension and current date
108
+ 4. Record the change in STATE.md as a decision
109
+
110
+ The lifecycle stage does not need to change when adding an extension. A project in Evolution that adds data exploration continues in Evolution — it just has more query types available.
@@ -0,0 +1,96 @@
1
+ # Analytical System Extension
2
+
3
+ <!-- INSTRUCTIONS FOR USE:
4
+ This extension adds analytical/prompt-system-specific scoping rules, cascade rules,
5
+ workflow, and conventions to your entry point. To apply:
6
+
7
+ 1. Open your entry point (AGENT.md, CLAUDE.md, or .cursorrules)
8
+ 2. Add the scoping rules below to your existing scoping rules table
9
+ 3. Add the cascade rules below to your existing cascade table
10
+ 4. Add the workflow line to your workflow section
11
+ 5. Add the conventions and do-not items to your existing lists
12
+ 6. Delete this file after merging — it's a reference, not a runtime file
13
+
14
+ Derived from: feature-registry.yaml (v1.5) query_patterns [analytical] + WF-06
15
+ Specialists referenced: COMPOSITION.md, EVALUATION.md, EXECUTION.md, DOMAIN.md, UI_CONTEXT.md
16
+ Key difference: analytical systems iterate — compose, evaluate, refine cycles are the norm
17
+ -->
18
+
19
+ ## Additional scoping rules
20
+
21
+ <!-- Append these rows to your entry point's scoping rules table -->
22
+
23
+ | Query type | Read before acting | Update after acting |
24
+ |------------|-------------------|-------------------|
25
+ | **Chain work** | .context/BASE.md + .context/EXECUTION.md, pipeline config | Pipeline files, .context/EXECUTION.md, .context/BASE.md (if chain structure changed) |
26
+ | **Evaluation** | .context/BASE.md + .context/EVALUATION.md, scoring rubrics | Evaluation results, .context/EVALUATION.md |
27
+ | **Composition** | .context/BASE.md + .context/COMPOSITION.md, existing templates | Prompt templates, .context/COMPOSITION.md |
28
+ | **Domain research** | .context/BASE.md + .context/DOMAIN.md | .context/DOMAIN.md, STATE.md (research findings) |
29
+
30
+ ## Additional cascade rules
31
+
32
+ <!-- Append these rows to your entry point's cascade table -->
33
+
34
+ | When this changes | Also update |
35
+ |------------------|-------------|
36
+ | Pipeline stage added/removed | .context/EXECUTION.md (stage inventory), .context/BASE.md (chain map), downstream stage specs |
37
+ | Evaluation criteria changed | .context/EVALUATION.md (scoring rubric), affected pipeline stage specs |
38
+ | Prompt template modified | .context/COMPOSITION.md (template registry), .context/EVALUATION.md (if scoring affected) |
39
+ | New domain knowledge added | .context/DOMAIN.md (knowledge base), .context/COMPOSITION.md (if templates reference domain) |
40
+ | Chain orchestration config changed | .context/EXECUTION.md (execution flow), .context/BASE.md (if architecture changed) |
41
+
42
+ ## Additional workflow
43
+
44
+ <!-- Add this line to your entry point's workflow section -->
45
+
46
+ - **Analytical system** — Discover (identify chains) → Map chains (build chain model) → Build context (specialist files) → Compose (build artifacts) → Evaluate (score against criteria) → Refine (iterate)
47
+
48
+ ## Additional conventions
49
+
50
+ <!-- Append these to your entry point's conventions list -->
51
+
52
+ - Every prompt template must have evaluation criteria before deployment
53
+ - Chain changes cascade downstream — upstream stage changes require downstream spec review
54
+ - Evaluation results are recorded with version and date for trend tracking
55
+ - Domain knowledge is captured in specialist files, not embedded in prompts
56
+ - Compose-evaluate-refine is iterative — track iteration count in STATE.md
57
+
58
+ ## Additional do-not items
59
+
60
+ <!-- Append these to your entry point's do-not list -->
61
+
62
+ - Deploy prompts without evaluation criteria defined
63
+ - Embed domain knowledge directly in prompt templates — use .context/DOMAIN.md references
64
+
65
+ ## Recommended specialists
66
+
67
+ <!-- Create these .context/ files as your analytical system grows -->
68
+
69
+ | Specialist | Create when | Key sections |
70
+ |---|---|---|
71
+ | .context/COMPOSITION.md | Prompt templates or chain composition exists | Template registry, composition patterns, variable schemas, version history |
72
+ | .context/EVALUATION.md | Evaluation criteria or scoring rubrics exist | Scoring rubrics, evaluation methodology, baseline results, trend data |
73
+ | .context/EXECUTION.md | Pipeline stages or orchestration config exists | Stage inventory, execution flow, input/output contracts, stage dependencies |
74
+ | .context/DOMAIN.md | Domain-specific knowledge drives prompt design | Knowledge base, terminology, constraints, reference materials |
75
+ | .context/UI_CONTEXT.md | User-facing interface exists for the analytical system | UI components, interaction patterns, display conventions, user workflows |
76
+
77
+ ## BASE.md analytical map template
78
+
79
+ <!-- Use this structure for the analytical map section of BASE.md -->
80
+
81
+ ```markdown
82
+ ## Chain architecture
83
+ | Chain | Stages | Input | Output | Evaluation |
84
+ |---|---|---|---|---|
85
+ | {chain_name} | {stage count} | {input type} | {output type} | {evaluation method} |
86
+
87
+ ## Pipeline stages
88
+ | Stage | Chain | Purpose | Input | Output | Dependencies |
89
+ |---|---|---|---|---|---|
90
+ | {stage_name} | {chain} | {what it does} | {input format} | {output format} | {upstream stages} |
91
+
92
+ ## Evaluation criteria
93
+ | Criterion | Target | Current | Method |
94
+ |---|---|---|---|
95
+ | {criterion_name} | {target score/metric} | {latest result} | {how evaluated} |
96
+ ```
@@ -0,0 +1,77 @@
1
+ # Code Project Extension
2
+
3
+ <!-- INSTRUCTIONS FOR USE:
4
+ This extension adds code-specific scoping rules, cascade rules, conventions,
5
+ and workflow to your entry point. To apply:
6
+
7
+ 1. Open your entry point (AGENT.md, CLAUDE.md, or .cursorrules)
8
+ 2. Add the scoping rules below to your existing scoping rules table
9
+ 3. Add the cascade rules below to your existing cascade table
10
+ 4. Add the workflow line to your workflow section
11
+ 5. Add the conventions and do-not items to your existing lists
12
+ 6. Delete this file after merging — it's a reference, not a runtime file
13
+
14
+ Derived from: feature-registry.yaml (v1.5) query_patterns [code] + WF-02
15
+ Specialists referenced: customize the specialist names to match your project
16
+ -->
17
+
18
+ ## Additional scoping rules
19
+
20
+ <!-- Append these rows to your entry point's scoping rules table -->
21
+
22
+ | Query type | Read before acting | Update after acting |
23
+ |------------|-------------------|-------------------|
24
+ | **Code change** | .context/BASE.md + relevant specialist, test files for affected modules | Source files, test files, .context/BASE.md (if structure changed) |
25
+ | **Bug fix** | .context/BASE.md + relevant specialist, test files for affected area | Source files, test files |
26
+ | **Dependency update** | .context/BASE.md, package files | Package manifest, lock file, .context/BASE.md (deps table) |
27
+ | **Database work** | .context/BASE.md + .context/DATABASE.md | Schema files, migrations, models, .context/DATABASE.md |
28
+ | **API work** | .context/BASE.md + .context/API.md | Route files, tests, .context/API.md |
29
+ | **Deployment / infra** | .context/BASE.md + .context/INFRASTRUCTURE.md | Config files, pipeline definitions |
30
+
31
+ ## Additional cascade rules
32
+
33
+ <!-- Append these rows to your entry point's cascade table -->
34
+
35
+ | When this changes | Also update |
36
+ |------------------|-------------|
37
+ | Database schema | Run migration generation, update type imports, run integration tests, update .context/DATABASE.md |
38
+ | API route contract | Update client calls, update API tests, update .context/API.md |
39
+ | New module/directory | Update .context/BASE.md codebase map, consider new .context/ specialist |
40
+ | Package added/removed | Update .context/BASE.md dependencies, verify compatibility |
41
+ | Environment variable added | Update .env.example, update deployment configs, update .context/BASE.md |
42
+
43
+ ## Additional workflow
44
+
45
+ <!-- Add this line to your entry point's workflow section -->
46
+
47
+ - **Code change** — Review (read tests first) → Plan (include cascade impacts) → Implement (test-adjacent) → Context-sync (update .context/) → Update
48
+
49
+ ## Additional conventions
50
+
51
+ <!-- Append these to your entry point's conventions list -->
52
+
53
+ - Write/update tests alongside every code change — never defer
54
+ - All user input validated before processing
55
+ - Follow existing code patterns in adjacent files
56
+ - Atomic commits with conventional commit messages
57
+ - Run affected tests before considering a change complete
58
+
59
+ ## Additional do-not items
60
+
61
+ <!-- Append these to your entry point's do-not list -->
62
+
63
+ - Defer tests to "later" — they are part of the change
64
+ - Commit .env files or include secrets in code
65
+
66
+ ## Recommended specialists
67
+
68
+ <!-- Create these .context/ files as your project grows -->
69
+
70
+ | Specialist | Create when | Key sections |
71
+ |---|---|---|
72
+ | .context/DATABASE.md | Project uses a database | Schema overview, migration conventions, query patterns |
73
+ | .context/API.md | Project has API endpoints | Route inventory, auth conventions, error format |
74
+ | .context/TESTING.md | Complex test infrastructure | Test categories, runner config, coverage targets |
75
+ | .context/SECURITY.md | Auth/authz code exists | Security conventions, OWASP checklist, audit triggers |
76
+ | .context/INFRASTRUCTURE.md | CI/CD pipeline exists | Pipeline stages, build requirements, deploy process |
77
+ | .context/INTEGRATIONS.md | External service integrations | Service inventory, auth methods, contract boundaries |
@@ -0,0 +1,117 @@
1
+ # Data Exploration Extension
2
+
3
+ <!-- INSTRUCTIONS FOR USE:
4
+ This extension adds data-exploration-specific scoping rules, cascade rules,
5
+ workflow, and exploration commands to your entry point. To apply:
6
+
7
+ 1. Open your entry point (AGENT.md, CLAUDE.md, or .cursorrules)
8
+ 2. Add the scoping rules below to your existing scoping rules table
9
+ 3. Add the cascade rules below to your existing cascade table
10
+ 4. Add the workflow line to your workflow section
11
+ 5. Add the conventions and do-not items to your existing lists
12
+ 6. Delete this file after merging — it's a reference, not a runtime file
13
+
14
+ Derived from: feature-registry.yaml (v1.5) query_patterns [data] + WF-05
15
+ Specialists referenced: SCHEMA.md, DOCUMENTS.md, RELATIONSHIPS.md
16
+ Key difference: most exploration queries are READ-ONLY — no file changes, no cascades
17
+ -->
18
+
19
+ ## Additional scoping rules
20
+
21
+ <!-- Append these rows to your entry point's scoping rules table.
22
+ Note: most data queries are read-only (write column is "--") -->
23
+
24
+ | Query type | Read before acting | Update after acting |
25
+ |------------|-------------------|-------------------|
26
+ | **Data ingest** | .context/BASE.md | .context/BASE.md (data inventory), specialist stubs |
27
+ | **Schema query** | .context/BASE.md + .context/SCHEMA.md | -- |
28
+ | **Document search** | .context/BASE.md + .context/DOCUMENTS.md | -- |
29
+ | **Entity exploration** | .context/BASE.md + specialist containing entity | STATE.md (exploration path) |
30
+ | **Relationship query** | .context/BASE.md + .context/RELATIONSHIPS.md | -- |
31
+ | **Analytical query** | .context/BASE.md + .context/SCHEMA.md | -- |
32
+ | **Quality check** | .context/BASE.md + .context/SCHEMA.md | -- |
33
+ | **Add dimension** | .context/BASE.md | .context/BASE.md (queryable dimensions) |
34
+ | **Add reference** | .context/BASE.md + relevant specialist | Specialist file |
35
+
36
+ ## Additional cascade rules
37
+
38
+ <!-- Append these rows to your entry point's cascade table -->
39
+
40
+ | When this changes | Also update |
41
+ |------------------|-------------|
42
+ | New data source added | .context/BASE.md (data inventory), relevant specialist (schema or document index) |
43
+ | Schema change detected | .context/SCHEMA.md (field inventory), .context/BASE.md (if new dimension), .context/RELATIONSHIPS.md (if join paths affected) |
44
+ | New entity discovered | Relevant specialist (entity registry), .context/BASE.md (if new queryable dimension) |
45
+ | New document added | .context/DOCUMENTS.md (index and topics), .context/BASE.md (if new data source) |
46
+ | Derived metric added | .context/SCHEMA.md (metrics section), .context/BASE.md (queryable dimensions) |
47
+ | User corrects a reference | Relevant specialist (update entry), cascade to cross-references |
48
+
49
+ ## Additional workflow
50
+
51
+ <!-- Add this line to your entry point's workflow section -->
52
+
53
+ - **Data exploration** — Ingest (scan sources) → Map (build data model) → Reference (build navigable artifacts) → Explore (interactive querying) → Refine (evolve understanding)
54
+
55
+ ## Exploration commands
56
+
57
+ <!-- These named patterns help users discover available interactions.
58
+ The agent recognizes these and routes to the appropriate specialist. -->
59
+
60
+ | Command pattern | What the agent does | Specialist loaded |
61
+ |---|---|---|
62
+ | `explore {entity}` | Show all references and related data for an entity | Specialist containing entity |
63
+ | `schema {table}` | Show full field inventory for the table | SCHEMA.md |
64
+ | `search {topic}` | Find all documents and data covering this topic | DOCUMENTS.md |
65
+ | `relate {A} to {B}` | Show connection paths between two entities/tables/documents | RELATIONSHIPS.md |
66
+ | `quality {source}` | Show data quality report for the source | SCHEMA.md |
67
+ | `timeline {topic}` | Show chronological progression across sources | DOCUMENTS.md |
68
+ | `dimensions` | List all queryable dimensions | BASE.md |
69
+ | `gaps` | Show known gaps in data coverage | BASE.md + relevant specialist |
70
+ | `summary {scope}` | Generate executive summary for a scope | BASE.md + relevant specialist |
71
+
72
+ ## Additional conventions
73
+
74
+ <!-- Append these to your entry point's conventions list -->
75
+
76
+ - Context files contain understanding, not raw data — use the abstraction ladder
77
+ - Most exploration queries are read-only — don't create unnecessary file changes
78
+ - Progressively reveal available exploration commands as the user explores
79
+ - Every reference entry must be addressable, cross-linked, and source-attributed
80
+
81
+ ## Additional do-not items
82
+
83
+ <!-- Append these to your entry point's do-not list -->
84
+
85
+ - Load raw data into context files — context contains understanding, not data
86
+ - Attempt to hold entire datasets in context — use schema + references instead
87
+
88
+ ## Recommended specialists
89
+
90
+ <!-- Create these .context/ files during the Ingest and Map stages -->
91
+
92
+ | Specialist | Create when | Key sections |
93
+ |---|---|---|
94
+ | .context/SCHEMA.md | Structured data exists (CSV, database, spreadsheets) | Field inventory, derived metrics, data quality notes |
95
+ | .context/DOCUMENTS.md | Document collection exists (PDFs, markdown, wiki) | Document index, topic taxonomy, entity registry, cross-references |
96
+ | .context/RELATIONSHIPS.md | Multiple data sources that connect | Join paths, cross-source links, navigation patterns |
97
+
98
+ ## BASE.md data map template
99
+
100
+ <!-- Use this structure for the data map section of BASE.md -->
101
+
102
+ ```markdown
103
+ ## Data inventory
104
+ | Source | Type | Records | Key columns | Location |
105
+ |---|---|---|---|---|
106
+ | {source_name} | {structured/documents/mixed} | {count} | {key fields} | {file path} |
107
+
108
+ ## Schema overview
109
+ | Table | Primary key | Core dimensions | Joins to |
110
+ |---|---|---|---|
111
+ | {table} | {key} | {dimensions} | {related tables} |
112
+
113
+ ## Queryable dimensions
114
+ | Dimension | What the user can ask | Data source |
115
+ |---|---|---|
116
+ | {dimension_name} | {sample questions} | {tables/documents} |
117
+ ```
@@ -0,0 +1,101 @@
1
+ # Base Context — Always Loaded
2
+
3
+ <!-- INSTRUCTION: This file is loaded EVERY session alongside the entry point.
4
+ Keep it under 100 lines. It gives the agent persistent understanding of
5
+ your project's architecture and structure. -->
6
+
7
+ ## What this system is
8
+
9
+ <!-- INSTRUCTION: 2-3 sentences describing your project's architecture.
10
+ What does it do? What are the main components? What technologies? -->
11
+
12
+ {Describe your project architecture here}
13
+
14
+ ## System model
15
+
16
+ <!-- INSTRUCTION: How do the project's components relate to each other?
17
+ A simple flow or diagram description. For code projects, describe
18
+ the data/control flow. -->
19
+
20
+ {component A} --> {component B} --> {component C}
21
+
22
+ ## Codebase map
23
+
24
+ <!-- INSTRUCTION: Table of directories, their purposes, and key patterns.
25
+ The agent uses this to navigate without re-exploring every session.
26
+ For existing codebases, ask the agent: "Scan the codebase and populate this map" -->
27
+
28
+ | Path | Purpose | Key patterns |
29
+ |------|---------|-------------|
30
+ | {src/} | {Source code} | {language, framework} |
31
+ | {tests/} | {Test suite} | {testing framework} |
32
+
33
+ ## Dependencies
34
+
35
+ <!-- INSTRUCTION: Key external dependencies and their roles.
36
+ Not an exhaustive list — just the ones that affect architecture decisions. -->
37
+
38
+ | Dependency | Role |
39
+ |------------|------|
40
+ | {framework} | {What it provides} |
41
+
42
+ ## Pairing protocol
43
+
44
+ <!-- INSTRUCTION: Maps task types to specialist context files.
45
+ Add rows as you create specialist .context/ files.
46
+ Each query type should pair BASE.md with exactly ONE specialist. -->
47
+
48
+ | Task type | Pair BASE.md with |
49
+ |-----------|-------------------|
50
+ | {domain-work-type} | .context/{SPECIALIST}.md |
51
+
52
+ <!-- INSTRUCTION: To create a specialist file, identify a recurring domain area
53
+ in your project that needs its own deep context. Keep each specialist
54
+ under 150 lines. The agent can help create them during context refresh. -->
55
+
56
+ ## Navigation
57
+
58
+ <!-- INSTRUCTION: Quick reference to key project files and their roles. -->
59
+
60
+ | File | Purpose |
61
+ |------|---------|
62
+ | {AGENT.md / CLAUDE.md} | Agent entry point — scoping, cascade |
63
+ | STATE.md | Current position and decisions |
64
+ | PLAN.md | Current atomic task |
65
+ | ROADMAP.md | Phase breakdown and progress |
66
+ | PROJECT.md | Project vision and structure |
67
+ | REQUIREMENTS.md | What must be achieved, with phase traceability |
68
+ | SUMMARY.md | Execution history — session audit trail |
69
+
70
+ ## Agent onboarding
71
+
72
+ <!-- AGENT: Use these questions to populate this file during the first session.
73
+ Ask the user each question at Stage 2 (Architecture), draft this file from
74
+ the answers, and show the draft at the checkpoint before writing.
75
+ Remove this section after the file is populated — it's scaffolding. -->
76
+
77
+ ### Greenfield
78
+
79
+ Ask the user:
80
+ 1. What are the main components or modules? (populate "What this system is")
81
+ 2. How do they connect? Data flow, API calls, event-driven? (populate System model)
82
+ 3. What is the directory structure and what does each directory do? (populate Codebase map)
83
+ 4. What are the key external dependencies? (populate Dependencies table)
84
+ 5. What recurring task types will you work on? (populate Pairing protocol — helps create specialist context files)
85
+
86
+ ### Brownfield
87
+
88
+ <!-- AGENT: For brownfield projects, auto-populate most of this from the Stage 1 scan.
89
+ Build the codebase map from what you found. Ask targeted questions only for gaps. -->
90
+
91
+ Pre-fill from scan:
92
+ - **What this system is**: infer from README + source structure + config files
93
+ - **System model**: infer from imports, API routes, database connections, event patterns
94
+ - **Codebase map**: build from directory listing + language detection + framework patterns
95
+ - **Dependencies**: extract from lockfiles and config
96
+
97
+ Ask the user only for gaps:
98
+ 1. I found [components]. Are there connections between them I'm missing? (validate System model)
99
+ 2. Which parts of the codebase get the most changes? (helps prioritize Pairing protocol)
100
+ 3. Are there historical patterns or conventions not visible in code? (e.g., "we always use X for Y")
101
+ 4. What types of work will you primarily do? (populate Pairing protocol for specialist files)
@@ -0,0 +1,47 @@
1
+ # Composition Context
2
+
3
+ Pair with: `.context/BASE.md`
4
+ Use when: query type is **composition** (building, combining, or refining composed outputs)
5
+
6
+ ## Template registry
7
+
8
+ <!-- List your composable templates/fragments/prompts here.
9
+ Each entry: name, purpose, inputs, output format, version. -->
10
+
11
+ | Template | Purpose | Inputs | Output | Version |
12
+ |----------|---------|--------|--------|---------|
13
+ | {template-name} | {what it produces} | {what it needs} | {format} | {version} |
14
+
15
+ ## Composition patterns
16
+
17
+ <!-- Document how templates combine into larger outputs.
18
+ Each pattern: which templates, in what order, with what parameters. -->
19
+
20
+ | Pattern | Templates used | Assembly order | Parameters |
21
+ |---------|---------------|----------------|------------|
22
+ | {pattern-name} | {template list} | {sequence} | {key params} |
23
+
24
+ ## Variable schemas
25
+
26
+ <!-- Define the variables/parameters that flow between templates.
27
+ Each variable: name, type, source, used by. -->
28
+
29
+ | Variable | Type | Source | Used by |
30
+ |----------|------|--------|---------|
31
+ | {variable-name} | {type} | {where it comes from} | {which templates} |
32
+
33
+ ## Composition rules
34
+
35
+ <!-- Constraints and validation rules for composition.
36
+ What combinations are valid, what's prohibited, ordering requirements. -->
37
+
38
+ - {rule description}
39
+
40
+ ## Version history
41
+
42
+ <!-- Track changes to the composition system.
43
+ What changed, why, impact on existing compositions. -->
44
+
45
+ | Date | Change | Impact |
46
+ |------|--------|--------|
47
+ | {date} | {what changed} | {what it affects} |
@@ -0,0 +1,56 @@
1
+ # Project Index — file inventory and navigation manifest
2
+ # Read on: every session (with entry point), or on context refresh
3
+ # Updated by: wwa close (metrics), wwa init (creation)
4
+
5
+ project:
6
+ name: "{Project Name}"
7
+ type: general # general | code | data | analytical | mixed
8
+ stage: development # discovery | design | development | evolution
9
+ tier: full # lite | standard | full
10
+
11
+ # What to read per session
12
+ always_load:
13
+ - {path: STATE.md, role: "decisions, position, blockers"}
14
+ - {path: ".context/PROTOCOL.yaml", role: "scoping, cascade, obligations"}
15
+
16
+ # Full file inventory with roles (agents: use this instead of scanning)
17
+ files:
18
+ intelligence_layer:
19
+ - {path: STATE.md, role: decisions/position, audience: both}
20
+ - {path: PLAN.md, role: current task, audience: agent}
21
+ - {path: ROADMAP.md, role: phase breakdown, audience: both}
22
+ - {path: SUMMARY.md, role: audit trail, audience: both}
23
+ - {path: PROJECT.md, role: project vision, audience: human}
24
+ - {path: PROJECT-PROFILE.md, role: type/stage/extensions, audience: agent}
25
+ - {path: SESSION-LOG.md, role: session metrics, audience: agent}
26
+ - {path: REQUIREMENTS.md, role: formal requirements, audience: both}
27
+ context:
28
+ - {path: ".context/BASE.md", role: system model}
29
+ - {path: ".context/PROTOCOL.yaml", role: agent rules}
30
+ - {path: ".context/INDEX.yaml", role: this file}
31
+ - {path: ".context/METHODOLOGY.md", role: overflow/onboarding}
32
+ - {path: ".context/DOCS-MAP.md", role: docs navigation}
33
+ - {path: ".context/REGISTRY.md", role: navigation for split files}
34
+ - {path: ".context/COMPOSITION.md", role: extension composition}
35
+ registries:
36
+ - {path: "registry/doc-tokens.yaml", role: "token values + terminology + doc dependency graph — reference after queries for consistency"}
37
+ - {path: "registry/feature-registry.yaml", role: "feature catalog + workflows + routing — identify activated features"}
38
+ management:
39
+ - {path: "Management/DIGEST.md", role: high-effort task digest}
40
+ - {path: "Management/STATUS.md", role: project health snapshot}
41
+ reporting:
42
+ - {path: "Reviews/INDEX.md", role: review dashboard}
43
+ - {path: "agentWorkflows/INDEX.md", role: workflow analysis}
44
+ todos:
45
+ - {path: "todos/backlog.md", role: future ideas}
46
+ specialists: []
47
+ # CUSTOMIZE: add .context/ specialist files as project evolves
48
+ # - {path: ".context/API.md", role: "API domain context"}
49
+
50
+ # Metrics (updated by wwa close)
51
+ metrics:
52
+ last_close: null
53
+ sessions: 0
54
+ decisions: 0
55
+ files_near_threshold: 0
56
+ files_over_threshold: 0