{"_id":"@agent-stack2/context","_rev":"2-e1d847a08972b4e513a440013a624b94","name":"@agent-stack2/context","dist-tags":{"latest":"0.2.0"},"versions":{"0.1.0":{"name":"@agent-stack2/context","version":"0.1.0","keywords":["agent-stack","project-context","mcp","coding-agents"],"author":{"name":"jsalvadorlpz"},"license":"MIT","_id":"@agent-stack2/context@0.1.0","maintainers":[{"name":"josepsalvador","email":"josep100998@gmail.com"}],"homepage":"https://github.com/jsalvadorlpz/agent-stack#readme","bugs":{"url":"https://github.com/jsalvadorlpz/agent-stack/issues"},"bin":{"agent-context":"dist/server.js"},"dist":{"shasum":"622d2228734b5cf2030b06c979525eeaa76690a6","tarball":"https://registry.npmjs.org/@agent-stack2/context/-/context-0.1.0.tgz","fileCount":175,"integrity":"sha512-Qe95ddulFB6SRSzkWEZ2VVYMss/Kc+C+wOVyGCyXrdWIgtYB4IGf+ILkdQjwFuDA9BKzdODYAs7tEwk6og1f5A==","signatures":[{"sig":"MEUCIDIZG35YYTg5ApWHrxVrmtSLoJuD4NF/dWQmjY9tScmzAiEAl09ElREVeoCSX5b7ZhxwhBN9JelHwb/lE5eNxlz+FCs=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":479397},"main":"dist/server.js","type":"module","_from":"file:agent-stack2-context-0.1.0.tgz","types":"./dist/server.d.ts","engines":{"node":">=18.0.0"},"scripts":{"test":"vitest run","build":"tsc","clean":"rm -rf dist","start":"node dist/server.js","typecheck":"tsc --noEmit"},"_npmUser":{"name":"josepsalvador","email":"josep100998@gmail.com"},"_resolved":"/tmp/5e718847d7b519d83a90573def9f17ea/agent-stack2-context-0.1.0.tgz","_integrity":"sha512-Qe95ddulFB6SRSzkWEZ2VVYMss/Kc+C+wOVyGCyXrdWIgtYB4IGf+ILkdQjwFuDA9BKzdODYAs7tEwk6og1f5A==","repository":{"url":"git+https://github.com/jsalvadorlpz/agent-stack.git","type":"git","directory":"packages/context"},"_npmVersion":"10.8.2","description":"Strategic project context MCP server — goals, flows, boundaries, constraints, glossary, conventions, and decisions","directories":{},"_nodeVersion":"20.20.1","dependencies":{"zod":"^3.24.4","@agent-stack2/token-gate":"0.1.0","@modelcontextprotocol/sdk":"^1.12.1"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"vitest":"^3.1.1","typescript":"^5.8.3","@types/node":"^22.15.3"},"_npmOperationalInternal":{"tmp":"tmp/context_0.1.0_1774196702249_0.6880917783393672","host":"s3://npm-registry-packages-npm-production"}},"0.2.0":{"name":"@agent-stack2/context","version":"0.2.0","description":"Strategic project context MCP server — goals, flows, boundaries, constraints, glossary, conventions, and decisions","license":"MIT","author":{"name":"jsalvadorlpz"},"repository":{"type":"git","url":"git+https://github.com/jsalvadorlpz/agent-stack.git","directory":"packages/context"},"homepage":"https://github.com/jsalvadorlpz/agent-stack#readme","bugs":{"url":"https://github.com/jsalvadorlpz/agent-stack/issues"},"keywords":["agent-stack","project-context","mcp","coding-agents"],"type":"module","main":"dist/server.js","bin":{"agent-context":"dist/server.js"},"engines":{"node":">=18.0.0"},"publishConfig":{"access":"public"},"dependencies":{"@modelcontextprotocol/sdk":"^1.12.1","zod":"^3.24.4","@agent-stack2/token-gate":"0.1.0"},"devDependencies":{"@types/node":"^22.15.3","typescript":"^5.8.3","vitest":"^3.1.1"},"scripts":{"build":"tsc","start":"node dist/server.js","test":"vitest run","clean":"rm -rf dist","typecheck":"tsc --noEmit"},"_id":"@agent-stack2/context@0.2.0","types":"./dist/server.d.ts","_integrity":"sha512-LFVkK6RHECFwksA2mDS3uqblLulviAgyTTJOgVmNXruFLjyd0g1T9F9uyLLGjKxRS5ANLnBNsld22Hu+ny09mA==","_resolved":"/tmp/0fd418bd4c626da2867fbc506e7365bf/agent-stack2-context-0.2.0.tgz","_from":"file:agent-stack2-context-0.2.0.tgz","_nodeVersion":"20.20.1","_npmVersion":"10.8.2","dist":{"integrity":"sha512-LFVkK6RHECFwksA2mDS3uqblLulviAgyTTJOgVmNXruFLjyd0g1T9F9uyLLGjKxRS5ANLnBNsld22Hu+ny09mA==","shasum":"b81f2d9aa309d7d5fb3c18f88b71ff89a128d183","tarball":"https://registry.npmjs.org/@agent-stack2/context/-/context-0.2.0.tgz","fileCount":159,"unpackedSize":260076,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEYCIQCdu/HXXQF2ntUvfwiGOiSp0dtFKyWcslPrBBruTyDDSgIhAJXyBrTHxU5cdO+ovjoU2JX97vQlSG3r4mA0AAwqPPUP"}]},"_npmUser":{"name":"josepsalvador","email":"josep100998@gmail.com"},"directories":{},"maintainers":[{"name":"josepsalvador","email":"josep100998@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/context_0.2.0_1774460973797_0.9122058664989918"},"_hasShrinkwrap":false}},"time":{"created":"2026-03-22T16:25:02.143Z","modified":"2026-03-25T17:49:34.077Z","0.1.0":"2026-03-22T16:25:02.410Z","0.2.0":"2026-03-25T17:49:33.949Z"},"bugs":{"url":"https://github.com/jsalvadorlpz/agent-stack/issues"},"author":{"name":"jsalvadorlpz"},"license":"MIT","homepage":"https://github.com/jsalvadorlpz/agent-stack#readme","keywords":["agent-stack","project-context","mcp","coding-agents"],"repository":{"type":"git","url":"git+https://github.com/jsalvadorlpz/agent-stack.git","directory":"packages/context"},"description":"Strategic project context MCP server — goals, flows, boundaries, constraints, glossary, conventions, and decisions","maintainers":[{"name":"josepsalvador","email":"josep100998@gmail.com"}],"readme":"# Agent Project Context\n\nAgent Project Context is the strategic context layer for coding agents in the\nAgent Toolkit portfolio.\n\nIt exists for the information that strong agents still miss after reading code:\n\n- what the product is trying to achieve\n- which users and workflows matter most\n- which architectural boundaries are product-critical\n- which constraints and non-goals must not be violated\n- which domain terms and entities the team uses\n- which conventions, priorities, and decisions should guide execution\n\nThis repo is not trying to become a generic wiki, a chat archive, or a\nreplacement for code search. It should become the smallest durable context\nsurface that helps an agent understand a project faster and make better\ndecisions.\n\n## Product thesis\n\nCode search tells an agent how the system is implemented.\n\nProject context should tell an agent:\n\n- why the system exists\n- who it is for\n- what outcomes matter\n- where the important boundaries are\n- what is intentionally out of scope\n- which decisions are still authoritative\n\nThat is the layer an agent needs before it plans product-sensitive work.\n\n## Current state\n\nThe repo has a structured project-context model (APC-101, done), an\nactive-slice resolver (APC-102, done), and full toolkit integration\n(APC-103, done) with 19 MCP tools.\n\nWhat is built today:\n\n- flat-file storage in `.project-context/` with 12 JSON files\n- a TypeScript MCP server with 19 tools (8 structured context + 1 resolver + 1 memory-aware resolver + 1 coordinator-aware resolver + 1 guardian-aware export + 5 preserved + 2 legacy compat)\n- Zod schemas with SectionMeta on all sections and ItemMeta on most item types\n  (stakeholder and competitor entries use section-level metadata only)\n- context sections: product thesis, goals, non-goals, user flows, boundaries,\n  constraints, glossary/entities, conventions, stakeholders, decisions,\n  competitive context, and roadmap\n- provenance metadata (sourceRefs, memoryRefs, updatedAt, tags, status) on most items;\n  stakeholder and competitor entries rely on section-level provenance\n- `resolve_project_context(...)` for active-slice retrieval with composable filters\n- `resolve_project_context_from_memory(nodeId?, includeAncestorTags?)` for memory-aware context resolution\n- `resolve_guardian_context(nodeIds?, tags?, includeAncestorTags?)` for guardian-aware export of project-specific rules\n- legacy compatibility wrappers for `get_project_brief` and `update_brief`\n- local `agent-memory` wiring via `.mcp.json`\n- seeded project data in `.project-context/` for repo dogfooding\n\nWhat is still missing from the real product:\n\n- import/update workflows from real repo docs instead of manual JSON editing\n- a meaningful demo that proves agents make better decisions with this tool\n\nThe current implementation is MCP-first. There is no real user-facing CLI yet.\n\n## Context sections\n\n| Section | File | Schema | Tool |\n|---------|------|--------|------|\n| Product thesis | `product-thesis.json` | `ProductThesisSchema` | `get_product_thesis` |\n| Goals | `goals.json` | `GoalsSchema` | `get_goals` |\n| Non-goals | `non-goals.json` | `NonGoalsSchema` | `get_non_goals` |\n| User flows | `user-flows.json` | `UserFlowsSchema` | `get_user_flows` |\n| Boundaries | `boundaries.json` | `BoundariesSchema` | `get_boundaries` |\n| Constraints | `constraints.json` | `ConstraintsSchema` | `get_constraints` |\n| Glossary | `glossary.json` | `GlossarySchema` | `get_glossary` |\n| Conventions | `conventions.json` | `ConventionsSchema` | `get_conventions` |\n| Stakeholders | `stakeholders.json` | `StakeholderMapSchema` | `get_stakeholders` |\n| Decisions | `decisions.json` | `DecisionLogSchema` | `get_decisions` / `log_decision` |\n| Competitive | `competitive.json` | `CompetitiveContextSchema` | `get_competitive_context` |\n| Roadmap | `roadmap.json` | `RoadmapStateSchema` | `get_roadmap_status` |\n\nMost collection items carry shared item metadata: `id`, `tags`, `sourceRefs`,\n`memoryRefs`, `updatedAt`, and `status` (active / deprecated / draft).\nStakeholder and competitor entries carry only domain-specific fields and rely\non section-level metadata for provenance.\n\nEvery section wrapper carries `SectionMeta`: `updatedAt`, `sourceRefs`, `tags`,\n`memoryRefs`.\n\n## Provenance: sourceRefs vs memoryRefs\n\nContext items carry two kinds of provenance links:\n\n- **`sourceRefs`** — pointers to docs, files, ADRs, or URLs. These are the\n  human-readable evidence trail: `[\"README.md\", \"ADR-001\"]`.\n- **`memoryRefs`** — explicit links to agent-memory nodes. These connect\n  strategic context to execution history:\n  ```json\n  { \"nodeId\": \"FEAT-001\", \"relation\": \"implemented-by\", \"note\": \"APC-101\" }\n  ```\n  Relations: `derived-from`, `decided-in`, `implemented-by`, `tracked-by`.\n\n`sourceRefs` says where a context item is documented.\n`memoryRefs` says which agent work produced or tracks it.\n\n## Quickstart\n\n```bash\nnpm install\nnpm run build\nnpm test\n```\n\nWire the repo into your MCP client by pointing at\n`dist/server.js` or by using the local `.mcp.json`.\n\nIf `.agent-memory/` is empty on a fresh clone, bootstrap it with:\n\n```powershell\nnpm run bootstrap-memory\n```\n\n## Recommended agent workflow\n\n1. Call `boot_context()`.\n2. If memory is empty or does not resolve an active node, run\n   `npm run bootstrap-memory`.\n3. Read `README.md`, `ROADMAP.md`, `PAIN-POINTS.md`,\n   `docs/IDEAL-PROJECT-CONTEXT.md`, and `docs/BACKLOG.md`.\n4. Use Agent Project Context when the task touches product behavior, naming,\n   user-facing flows, constraints, architecture boundaries, or roadmap\n   prioritization.\n5. Record plan, decisions, and meaningful progress in Agent Memory.\n6. Finish with `finalize_node(summary=\"...\")`.\n\n## Docs\n\n- [ROADMAP.md](ROADMAP.md) - product direction and phases\n- [PAIN-POINTS.md](PAIN-POINTS.md) - failures this module should eliminate\n- [docs/IDEAL-PROJECT-CONTEXT.md](docs/IDEAL-PROJECT-CONTEXT.md) - north-star\n  product shape\n- [docs/BACKLOG.md](docs/BACKLOG.md) - next execution slices in build order\n\n## Relationship to the rest of the toolkit\n\nEach toolkit layer has a distinct role:\n\n- **Agent Memory** = continuity. It remembers what happened across sessions.\n- **Agent Coordinator** = live state. It shows who is active and what they claim.\n- **Agent Project Context** = strategic rules. It supplies the durable product\n  knowledge that code search cannot recover: goals, constraints, conventions,\n  boundaries, decisions, and non-goals.\n- **Agent Guardian** = validation. It checks risk and quality on the change\n  surface using generic heuristics (secrets, deps, complexity) plus\n  project-specific rules exported from Project Context.\n\nThe integration surface:\n\n- `resolve_project_context_from_memory(...)` bridges Memory → Context\n- `resolve_project_context_from_coordinator(...)` bridges Coordinator → Context\n- `resolve_guardian_context(...)` bridges Context → Guardian\n\nThe recommended agent boot sequence:\n\n1. memory for continuity\n2. project context for strategic understanding\n3. coordinator for live situational awareness\n4. guardian for validation before risky changes (informed by project context)\n","readmeFilename":"README.md"}