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,108 @@
1
+ /**
2
+ * Registry loader and structured query interface.
3
+ *
4
+ * Loads feature-registry.yaml and provides typed access to features,
5
+ * workflows, patterns, activation maps, and protocol directives.
6
+ */
7
+
8
+ import { readFileSync } from "node:fs";
9
+ import { resolve, join, dirname } from "node:path";
10
+ import { existsSync } from "node:fs";
11
+ import { fileURLToPath } from "node:url";
12
+ import yaml from "js-yaml";
13
+
14
+ const __filename = fileURLToPath(import.meta.url);
15
+ const __dirname = dirname(__filename);
16
+
17
+ /**
18
+ * Locate feature-registry.yaml by walking upward from start.
19
+ *
20
+ * Search order:
21
+ * 1. docs/internal/feature-registry.yaml relative to package root
22
+ * 2. Walk parent directories looking for docs/internal/feature-registry.yaml
23
+ * 3. feature-registry.yaml in start or its parents
24
+ */
25
+ export function findRegistry(start) {
26
+ if (!start) {
27
+ // Default: package root (one level up from lib/)
28
+ start = resolve(__dirname, "..");
29
+ }
30
+
31
+ // Direct relative paths from the start
32
+ const candidates = [
33
+ join(start, "docs", "internal", "feature-registry.yaml"),
34
+ join(start, "feature-registry.yaml"),
35
+ ];
36
+ for (const p of candidates) {
37
+ if (existsSync(p)) return p;
38
+ }
39
+
40
+ // Walk upward
41
+ let current = resolve(start);
42
+ for (let i = 0; i < 10; i++) {
43
+ const candidate = join(current, "docs", "internal", "feature-registry.yaml");
44
+ if (existsSync(candidate)) return candidate;
45
+ const parent = dirname(current);
46
+ if (parent === current) break;
47
+ current = parent;
48
+ }
49
+
50
+ throw new Error(
51
+ "Cannot find feature-registry.yaml. " +
52
+ "Provide --registry or run from the agent-method repo."
53
+ );
54
+ }
55
+
56
+ /**
57
+ * Load and return the parsed registry.
58
+ * Handles {placeholder} patterns in YAML by quoting them before parsing.
59
+ */
60
+ export function loadRegistry(path) {
61
+ if (!path) path = findRegistry();
62
+ let content = readFileSync(path, "utf-8");
63
+ // The registry uses {placeholder} in flow sequences — replace them.
64
+ content = content.replace(/\{([^}]+)\}/g, "_$1_");
65
+ return yaml.load(content);
66
+ }
67
+
68
+ /** Return a map of feature ID to feature spec. */
69
+ export function getFeatures(registry) {
70
+ const features = {};
71
+ for (const f of registry.features || []) {
72
+ features[f.id] = f;
73
+ }
74
+ return features;
75
+ }
76
+
77
+ /** Return the list of workflow specs. */
78
+ export function getWorkflows(registry) {
79
+ return registry.workflows || [];
80
+ }
81
+
82
+ /** Return a single workflow by ID, or null. */
83
+ export function getWorkflow(registry, workflowId) {
84
+ for (const wf of getWorkflows(registry)) {
85
+ if (wf.id === workflowId) return wf;
86
+ }
87
+ return null;
88
+ }
89
+
90
+ /** Return the list of query pattern specs. */
91
+ export function getQueryPatterns(registry) {
92
+ return registry.query_patterns || [];
93
+ }
94
+
95
+ /** Return the activation map (stage -> feature list). */
96
+ export function getActivation(registry) {
97
+ return registry.activation || {};
98
+ }
99
+
100
+ /** Return the list of protocol directives. */
101
+ export function getDirectives(registry) {
102
+ return (registry.protocol || {}).core_directives || [];
103
+ }
104
+
105
+ /** Return the registry version string. */
106
+ export function getVersion(registry) {
107
+ return String(registry.version || "unknown");
108
+ }
package/package.json ADDED
@@ -0,0 +1,39 @@
1
+ {
2
+ "name": "agent-method",
3
+ "version": "1.5.0",
4
+ "description": "CLI tools for the agent-method methodology — registry-driven routing, validation, and project setup for AI-agent-assisted development",
5
+ "keywords": [
6
+ "ai-agents",
7
+ "prompt-engineering",
8
+ "context-engineering",
9
+ "methodology",
10
+ "developer-tools",
11
+ "cli"
12
+ ],
13
+ "type": "module",
14
+ "license": "MIT",
15
+ "author": "agent-method contributors",
16
+ "bin": {
17
+ "agent-method": "bin/agent-method.js"
18
+ },
19
+ "files": [
20
+ "bin/",
21
+ "lib/",
22
+ "templates/",
23
+ "docs/internal/feature-registry.yaml"
24
+ ],
25
+ "main": "lib/registry.js",
26
+ "engines": {
27
+ "node": ">=18.0.0"
28
+ },
29
+ "dependencies": {
30
+ "chalk": "^5.4.0",
31
+ "commander": "^12.0.0",
32
+ "inquirer": "^9.0.0",
33
+ "js-yaml": "^4.1.0"
34
+ },
35
+ "repository": {
36
+ "type": "git",
37
+ "url": "https://github.com/agent-method/agent-method"
38
+ }
39
+ }
@@ -0,0 +1,293 @@
1
+ # Template Kit
2
+
3
+ Copyable project templates. Pick one, copy it into your project root, fill in PROJECT.md, and start working with your AI agent.
4
+
5
+ ## Starter template (minimum viable)
6
+
7
+ For most projects. Seven files that give you cross-session memory, scoped context loading, persistent codebase understanding, lifecycle tracking, and structured execution.
8
+
9
+ ```
10
+ starter/
11
+ CLAUDE.md # Claude Code entry point (auto-loaded)
12
+ .cursorrules # Cursor entry point (auto-loaded)
13
+ AGENT.md # Generic entry point (manual loading)
14
+ PROJECT.md # Your project vision -- fill this in first
15
+ PROJECT-PROFILE.md # Project type, lifecycle stage, active extensions (agent-maintained)
16
+ STATE.md # Decisions, blockers, current position
17
+ ROADMAP.md # Phase breakdown with gate criteria
18
+ PLAN.md # Current task with verification criteria
19
+ .context/
20
+ BASE.md # Core context -- always loaded with entry point
21
+ ```
22
+
23
+ **Setup**: Delete the two entry point files you don't use. Keep the one that matches your agent runtime.
24
+
25
+ **What you get**: Persistent decisions, scoped file reading, phase-gated execution, atomic task tracking, configurable interaction level, persistent codebase context.
26
+
27
+ **What you don't get**: Specialist context pairing, human-facing docs scaffold, execution history, full communication point structure.
28
+
29
+ ## Full template (complete methodology)
30
+
31
+ For complex or multi-phase projects where context management and dual-audience separation matter.
32
+
33
+ ```
34
+ full/
35
+ CLAUDE.md # Claude Code entry point (auto-loaded)
36
+ .cursorrules # Cursor entry point (auto-loaded)
37
+ AGENT.md # Generic entry point (manual loading)
38
+ PROJECT.md # Vision, audiences, structure
39
+ PROJECT-PROFILE.md # Project type, lifecycle, extensions (agent-maintained)
40
+ STATE.md # Decisions, blockers, position, open questions
41
+ REQUIREMENTS.md # Scoped features with phase traceability
42
+ ROADMAP.md # Phase breakdown with gate criteria
43
+ PLAN.md # Current atomic task
44
+ SUMMARY.md # Execution history (session audit trail)
45
+ .context/
46
+ BASE.md # Core context -- always loaded with entry point
47
+ docs/
48
+ index.md # Human-facing project dashboard (checkpoint records land here)
49
+ todos/
50
+ backlog.md # Captured ideas for future work
51
+ ```
52
+
53
+ **Setup**: Delete the two entry point files you don't use. Keep the one that matches your agent runtime.
54
+
55
+ **What you get**: Everything in starter, plus specialist context pairing, dependency cascade, execution history, human dashboard scaffold, backlog capture, full communication point structure (direction, checkpoint, record).
56
+
57
+ ## Template content: guided, not empty
58
+
59
+ Template files ship with **inline instructions** — structured prompts that show both the user and the agent what goes in each section. The agent can read these instructions and help populate the files.
60
+
61
+ Example from a guided PROJECT.md:
62
+ ```markdown
63
+ # {Your Project Name}
64
+
65
+ <!-- INSTRUCTION: Replace with a 2-3 sentence description of your project -->
66
+ {Describe what your project does and who it's for}
67
+
68
+ ## Problem
69
+ <!-- INSTRUCTION: What problem does this solve? 2-3 bullet points. -->
70
+
71
+ ## Solution
72
+ <!-- INSTRUCTION: How does the project solve the problem? -->
73
+ ```
74
+
75
+ Example from a guided .context/BASE.md:
76
+ ```markdown
77
+ # Base Context — Always Loaded
78
+
79
+ ## What this system is
80
+ <!-- INSTRUCTION: 2-3 sentences describing your project's architecture -->
81
+
82
+ ## Codebase map
83
+ <!-- INSTRUCTION: Table of directories, their purposes, and key patterns -->
84
+ <!-- The agent will help populate this from a codebase scan -->
85
+ | Path | Purpose | Key patterns |
86
+ |------|---------|-------------|
87
+
88
+ ## Pairing protocol
89
+ | Task type | Pair BASE.md with |
90
+ |-----------|-------------------|
91
+ <!-- INSTRUCTION: Add rows as you create specialist .context/ files -->
92
+ ```
93
+
94
+ The inline instructions serve as:
95
+ - **User guidance**: Human sees what to fill in
96
+ - **Agent prompts**: Agent reads the instructions and can help populate
97
+ - **Structure enforcement**: Files have the right sections from day one
98
+
99
+ ## Bootstrapping: new project vs existing codebase
100
+
101
+ ### Greenfield (starting from scratch)
102
+
103
+ 1. Copy template into your project root
104
+ 2. Delete the two entry point files you don't use
105
+ 3. Fill in PROJECT.md with your project vision
106
+ 4. Start a conversation — the agent helps populate .context/BASE.md as you build
107
+
108
+ ### Brownfield (existing codebase)
109
+
110
+ 1. Copy template into your existing project root
111
+ 2. Delete the two entry point files you don't use
112
+ 3. Fill in PROJECT.md with your project vision
113
+ 4. Ask the agent: "Scan the codebase and populate the context files"
114
+ 5. Agent activates the **Discovery workflow (WF-08)**:
115
+ - **Inventory**: Walks entire project structure, maps directories and files
116
+ - **Map**: Traces dependencies (packages, imports, services)
117
+ - **Extract**: Identifies patterns, conventions, and architectural decisions
118
+ - **Assess**: Evaluates technical debt, risks, and improvement opportunities
119
+ - **Bootstrap**: Writes .context/BASE.md, proposes specialists, updates scoping table
120
+ 6. Agent updates PROJECT-PROFILE.md lifecycle stage to "discovery"
121
+ 7. You approve specialist files; agent transitions lifecycle to "development" when ready
122
+
123
+ ### Integration profiles
124
+
125
+ Both templates support three integration profiles that control how much methodology surface area gets installed. This is critical for brownfield projects and lighter models.
126
+
127
+ | Profile | Target model | What's installed | Entry point budget |
128
+ |---------|-------------|-----------------|-------------------|
129
+ | **Lite** | Haiku, GPT-3.5 | STATE.md + .context/METHODOLOGY.md | 25 lines |
130
+ | **Standard** | Sonnet, GPT-4 | STATE.md, PLAN.md, .context/BASE.md, .context/METHODOLOGY.md | 40 lines |
131
+ | **Full** | Opus, o1 | All intelligence layer files | 60 lines |
132
+
133
+ For lite and standard profiles, operational details (workflows, extended conventions, do-not rules) overflow to `.context/METHODOLOGY.md` — loaded on-demand via the scoping table, not every session. This keeps the entry point lean enough for lighter models to process reliably.
134
+
135
+ When setup.sh detects an existing entry point file, it uses the **brownfield merge protocol**: methodology content is appended to the existing file rather than overwriting it.
136
+
137
+ See `docs/architecture/integration-profiles.md` for the full specification.
138
+
139
+ ### Interaction level (in entry point)
140
+
141
+ Both templates include an interaction level setting in the entry point:
142
+
143
+ ```markdown
144
+ ## Interaction level
145
+ mode: checkpoint # autonomous | checkpoint | collaborative | supervised
146
+ ```
147
+
148
+ | Level | Agent behavior |
149
+ |-------|---------------|
150
+ | **autonomous** | Executes full plan, reports at completion |
151
+ | **checkpoint** | Proposes plan, executes after approval, reports at completion |
152
+ | **collaborative** | Back-and-forth at each step |
153
+ | **supervised** | Explains intent before every file change |
154
+
155
+ ## Entry points (all three included)
156
+
157
+ Both templates ship with all three entry point variants. Pick the one that matches your runtime and delete the others:
158
+
159
+ | File | Runtime | Auto-loaded? |
160
+ |------|---------|:------------:|
161
+ | `CLAUDE.md` | Claude Code | Yes |
162
+ | `.cursorrules` | Cursor | Yes |
163
+ | `AGENT.md` | Any agent (manual loading) | No |
164
+
165
+ All three contain identical scoping rules, cascade structure, and conventions — only the filename and auto-loading behavior differ.
166
+
167
+ Standalone entry point files are also available in `entry-points/` for reference or individual use.
168
+
169
+ ## Project-type extensions
170
+
171
+ The starter and full templates ship with **universal** scoping rules, cascade rules, and workflows that work for any project. For project-type-specific capabilities, apply an extension.
172
+
173
+ ```
174
+ extensions/
175
+ MANIFEST.md # Extension composition rules, compatibility matrix
176
+ code-project.md # Code-specific: scoping, cascade, WF-02, specialists
177
+ data-exploration.md # Data-specific: exploration commands, WF-05, specialists
178
+ analytical-system.md # Analytical-specific: chain work, evaluation, WF-06, specialists
179
+ ```
180
+
181
+ ### How to apply an extension
182
+
183
+ 1. Open the extension file (e.g., `extensions/code-project.md`)
184
+ 2. Copy each section's rows into the corresponding section of your entry point
185
+ 3. Create the recommended specialist .context/ files as your project grows
186
+ 4. Delete the extension file — it's a reference, not a runtime artifact
187
+
188
+ ### Extensions are additive
189
+
190
+ Extensions add rows to existing tables — they never override universal content. You can apply multiple extensions for projects that span types:
191
+
192
+ ```
193
+ Base entry point (universal)
194
+ + code-project.md (code scoping, cascade, WF-02)
195
+ + data-exploration.md (exploration scoping, cascade, WF-05)
196
+ + analytical-system.md (chain/evaluation scoping, cascade, WF-06)
197
+ = Mixed project entry point (any combination)
198
+ ```
199
+
200
+ ### Registry-driven derivation
201
+
202
+ Extensions are derived from the feature registry (`docs/internal/feature-registry.yaml`). Each extension's scoping rules trace to registry `query_patterns`, cascade rules trace to registry `dependencies`, and workflows trace to registry `workflows`. See `docs/internal/entry-point-derivation.md` for the derivation specification.
203
+
204
+ ## What the entry point embeds
205
+
206
+ The entry point distills the methodology's behavioral protocol into a dense, table-driven file:
207
+
208
+ - **Scoping rules** — Query-type-to-file mapping. The agent reads the table, loads the right files, and constrains writes. Derived from the 4 universal query types plus project-specific types.
209
+ - **Cascade table** — "When X changes, also update Y." Prevents file drift by making dependencies explicit. The agent checks this after every change.
210
+ - **Workflow selection** — Eight guided workflows: general task (WF-01), code change (WF-02), context refresh (WF-03), bootstrap (WF-04), data exploration (WF-05), analytical system (WF-06), specification project (WF-07), discovery (WF-08). The agent selects based on query type, project type, and lifecycle stage.
211
+ - **Conventions** — Six behavioral rules derived from the agent protocol directives: record decisions immediately, scope to avoid drowning, cascade is not optional, build understanding not just code, surface uncertainty, human controls direction.
212
+ - **Interaction level** — Configurable checkpoint density from autonomous to supervised.
213
+
214
+ An agent reading the entry point can follow the full behavioral protocol without accessing any other methodology documentation.
215
+
216
+ ## Context maintenance
217
+
218
+ Context files are living documents. As your project evolves, the agent keeps them current:
219
+
220
+ - **Code changes** → Agent updates .context/BASE.md codebase map via cascade
221
+ - **New domain areas** → Agent suggests creating specialist .context/ files
222
+ - **Architecture decisions** → Agent records them in relevant .context/ files
223
+ - **Context drift** → Ask the agent "refresh the project context" to resync
224
+
225
+ See `docs/architecture/context-pairing.md` for the full context maintenance lifecycle.
226
+
227
+ ## How to use
228
+
229
+ ### Recommended: npx
230
+
231
+ ```bash
232
+ npx agent-method init code ~/my-project
233
+ ```
234
+
235
+ Replace `code` with: `context`, `data`, `mix`, or `general`.
236
+
237
+ ### Manual
238
+
239
+ 1. Copy `starter/` or `full/` into your project root
240
+ 2. Delete the two entry point files you don't use
241
+ 3. Fill in `PROJECT.md` with your project vision
242
+ 4. Start a conversation with your agent — it reads the entry point and knows what to do
243
+ 5. For existing codebases: ask the agent to scan and populate context files
244
+
245
+ See `docs/guides/quick-start.md` for a detailed walkthrough.
246
+
247
+ ## CLI Tools (optional)
248
+
249
+ The methodology works without any tooling. For teams that want additional validation and automation:
250
+
251
+ ```bash
252
+ npx agent-method # zero-install (Node.js 18+)
253
+ npm install -g agent-method # permanent install
254
+ pip install agent-method-tools # Python alternative
255
+ ```
256
+
257
+ ### Developer commands
258
+
259
+ | Command | Use case |
260
+ |---------|----------|
261
+ | `agent-method check` | Validate entry point (auto-finds CLAUDE.md/.cursorrules/AGENT.md) |
262
+ | `agent-method scan` | Detect project type from directory contents |
263
+ | `agent-method route "<query>"` | Test how a query routes through the pipeline |
264
+ | `agent-method refine` | Extract refinement report (auto-finds SESSION-LOG.md) |
265
+ | `agent-method status` | Check if methodology version is current |
266
+ | `agent-method upgrade` | Brownfield-safe update (adds missing files, updates version) |
267
+ | `agent-method init <type>` | Describe entry point contents for a project type |
268
+
269
+ ### Project types
270
+
271
+ Use friendly names everywhere — all commands accept aliases:
272
+
273
+ ```bash
274
+ agent-method init code # software project
275
+ agent-method init context # analytical/prompt project (e.g. PromptStudy)
276
+ agent-method init data # data index/querying project (e.g. SysMLv2)
277
+ agent-method init mix # multi-type project
278
+ ```
279
+
280
+ ### Advanced: pipeline subcommands
281
+
282
+ For debugging routing logic: `agent-method pipeline classify|select|resolve|cascade|test`.
283
+
284
+ ### Dependencies
285
+
286
+ - Python 3.9+
287
+ - PyYAML >= 6.0
288
+ - Click >= 8.0
289
+
290
+ ### Future enhancements
291
+
292
+ - MCP server: `pip install agent-method-tools[mcp]` — exposes pipeline as agent-callable tools
293
+ - Registry watcher: `pip install agent-method-tools[watch]` — proactive validation on file changes
@@ -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,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 -->