agent-method 1.5.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 (52) hide show
  1. package/README.md +256 -0
  2. package/bin/agent-method.js +58 -0
  3. package/docs/internal/feature-registry.yaml +1532 -0
  4. package/lib/cli/check.js +71 -0
  5. package/lib/cli/helpers.js +151 -0
  6. package/lib/cli/init.js +60 -0
  7. package/lib/cli/pipeline.js +163 -0
  8. package/lib/cli/refine.js +202 -0
  9. package/lib/cli/route.js +62 -0
  10. package/lib/cli/scan.js +28 -0
  11. package/lib/cli/status.js +61 -0
  12. package/lib/cli/upgrade.js +146 -0
  13. package/lib/init.js +240 -0
  14. package/lib/pipeline.js +887 -0
  15. package/lib/registry.js +108 -0
  16. package/package.json +39 -0
  17. package/templates/README.md +293 -0
  18. package/templates/entry-points/.cursorrules +109 -0
  19. package/templates/entry-points/AGENT.md +109 -0
  20. package/templates/entry-points/CLAUDE.md +109 -0
  21. package/templates/extensions/MANIFEST.md +110 -0
  22. package/templates/extensions/analytical-system.md +96 -0
  23. package/templates/extensions/code-project.md +77 -0
  24. package/templates/extensions/data-exploration.md +117 -0
  25. package/templates/full/.context/BASE.md +68 -0
  26. package/templates/full/.context/COMPOSITION.md +47 -0
  27. package/templates/full/.context/METHODOLOGY.md +84 -0
  28. package/templates/full/.context/REGISTRY.md +75 -0
  29. package/templates/full/.cursorrules +128 -0
  30. package/templates/full/AGENT.md +128 -0
  31. package/templates/full/CLAUDE.md +128 -0
  32. package/templates/full/PLAN.md +67 -0
  33. package/templates/full/PROJECT-PROFILE.md +61 -0
  34. package/templates/full/PROJECT.md +46 -0
  35. package/templates/full/REQUIREMENTS.md +30 -0
  36. package/templates/full/ROADMAP.md +39 -0
  37. package/templates/full/SESSION-LOG.md +41 -0
  38. package/templates/full/STATE.md +42 -0
  39. package/templates/full/SUMMARY.md +24 -0
  40. package/templates/full/docs/index.md +46 -0
  41. package/templates/full/todos/backlog.md +19 -0
  42. package/templates/starter/.context/BASE.md +66 -0
  43. package/templates/starter/.context/METHODOLOGY.md +70 -0
  44. package/templates/starter/.cursorrules +113 -0
  45. package/templates/starter/AGENT.md +113 -0
  46. package/templates/starter/CLAUDE.md +113 -0
  47. package/templates/starter/PLAN.md +67 -0
  48. package/templates/starter/PROJECT-PROFILE.md +44 -0
  49. package/templates/starter/PROJECT.md +46 -0
  50. package/templates/starter/ROADMAP.md +39 -0
  51. package/templates/starter/SESSION-LOG.md +41 -0
  52. package/templates/starter/STATE.md +42 -0
@@ -0,0 +1,109 @@
1
+ # {Project Name} — Agent Entry Point
2
+
3
+ <!-- INSTRUCTION: Replace {Project Name} and write a 1-2 sentence project description below -->
4
+ {Describe what your project does, its architecture, and key technologies.}
5
+
6
+ ## On every query
7
+
8
+ 1. This file is auto-loaded — read it first
9
+ 2. Read `STATE.md` for current position, decisions, blockers
10
+ 3. Scope based on query type (see table below)
11
+
12
+ ## Scoping rules
13
+
14
+ | Query type | Read before acting | Update after acting |
15
+ |------------|-------------------|-------------------|
16
+ | **Planning / roadmap** | REQUIREMENTS.md, ROADMAP.md | STATE.md, PLAN.md |
17
+ | **Context refresh** | .context/ (all), project structure | .context/, this file (if scoping rules affected) |
18
+ | **{your-domain-type}** | .context/BASE.md + .context/{SPECIALIST}.md | {affected working files} |
19
+ | **Methodology guidance** | .context/METHODOLOGY.md | -- |
20
+ | **Phase completion** | SUMMARY.md | SUMMARY.md, STATE.md, ROADMAP.md |
21
+ | **Backlog / ideas** | todos/backlog.md | todos/backlog.md |
22
+
23
+ <!-- INSTRUCTION: Replace the {your-domain-type} row with project-specific query types.
24
+ Each should pair .context/BASE.md with one specialist. Add as many rows as needed. -->
25
+
26
+ ## Dependency cascade
27
+
28
+ When a file changes, check this table and update dependent files in the same response.
29
+
30
+ | When this changes | Also update |
31
+ |------------------|-------------|
32
+ | Phase completion | SUMMARY.md (add entry), STATE.md (update position), ROADMAP.md (mark done) |
33
+ | Requirements change | REQUIREMENTS.md, ROADMAP.md, PLAN.md (if current task affected) |
34
+ | New decision made | STATE.md (decisions table — record immediately, never defer) |
35
+ | Open question resolved | STATE.md (mark resolved with resolution text, don't delete) |
36
+ | Project structure | .context/BASE.md (codebase map), this file (if new query types needed) |
37
+ | Intelligence layer file exceeds 300 lines | Restructure into index + components subdirectory (keep active content, archive completed sections) |
38
+ | New domain area | .context/BASE.md, consider new .context/ specialist, this file (if new scoping row) |
39
+ | Session close | SESSION-LOG.md (append micro-entry — workflow, features, cascades, friction, findings) |
40
+
41
+ <!-- INSTRUCTION: Add project-specific cascade rules below the universal ones above. -->
42
+
43
+ ## Workflow
44
+
45
+ Select based on query type:
46
+ - **General task** — Review, Plan, Implement, Document, Update
47
+ - **Code change** — Review, Plan, Implement, Context-sync, Update
48
+ - **Context refresh** — Scan, Compare, Update-context, Cascade, Record
49
+ - **First session** — Detect, Initialize, Map, Pair, Ready
50
+
51
+ ## Interaction level
52
+
53
+ mode: checkpoint
54
+ <!-- autonomous | checkpoint | collaborative | supervised -->
55
+ <!-- checkpoint: propose plan, wait for approval, report at completion (default) -->
56
+
57
+ ## Model tier
58
+
59
+ tier: standard
60
+ <!-- lite | standard | full -->
61
+ <!-- lite: minimal rules, STATE.md only, 2 cascade rules — for Haiku or simple projects -->
62
+ <!-- standard: core rules + context pairing, overflow to .context/METHODOLOGY.md — for Sonnet (default) -->
63
+ <!-- full: all rules in entry point, all intelligence layer files — for Opus or complex projects -->
64
+
65
+ ## Method version
66
+
67
+ method_version: 1.5
68
+ <!-- Tracks which methodology version generated this entry point -->
69
+ <!-- Use `agent-method status` to compare against latest -->
70
+
71
+ ## CLI tools (optional)
72
+
73
+ Available via `npx agent-method` (zero-install) or `pip install agent-method-tools`:
74
+
75
+ | When you want to... | Run |
76
+ |---------------------|-----|
77
+ | Validate this entry point | `agent-method check` |
78
+ | See what type of project this is | `agent-method scan` |
79
+ | Test how a query routes | `agent-method route "your question"` |
80
+ | Extract a refinement report | `agent-method refine` |
81
+ | Check methodology version | `agent-method status` |
82
+ | Update methodology files | `agent-method upgrade` |
83
+ | See what an entry point should contain | `agent-method init code` / `context` / `data` / `mix` |
84
+
85
+ <!-- INSTRUCTION: The agent can suggest these commands when the user asks about validation,
86
+ project setup, or methodology updates. All commands auto-detect project type and find
87
+ entry points automatically. Add --json for machine-readable output. -->
88
+
89
+ ## Conventions
90
+
91
+ - Record decisions in STATE.md in the SAME response as the work — never defer
92
+ - Load .context/BASE.md + one specialist per query — never all context files
93
+ - After every file change, check the cascade table — deferred cascades don't happen
94
+ - Every code change is also a context change — update the codebase map
95
+ - Surface uncertainty as open questions in STATE.md — never guess silently
96
+ - Keep intelligence layer files under 300 lines — split into index + components subdirectory when exceeded
97
+ - Propose plans and wait for approval — the human controls direction
98
+ - At session close, append a micro-entry to SESSION-LOG.md — never skip, never read previous entries during normal work
99
+
100
+ ## Do not
101
+
102
+ - Modify project source code, tests, or pre-existing documentation through methodology operations — only create/modify methodology files (STATE.md, .context/, PLAN.md, etc.)
103
+ - Delete existing project files during brownfield integration — methodology is additive only
104
+ - Load files not in the scoping table's read-set for the current query type
105
+ - Defer STATE.md decision recording to end of session
106
+ - Skip cascade checks after file changes
107
+ - Load multiple specialist .context/ files for a single query
108
+
109
+ <!-- INSTRUCTION: Add project-specific "do not" rules as you discover common mistakes -->
@@ -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.4) 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.1) 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.1) 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,68 @@
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 |
@@ -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} |