contextos-agents 2.3.1 → 2.3.2

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 (128) hide show
  1. package/.agents/adapters/cursor/export.js +3 -27
  2. package/.agents/adapters/gemini/export.js +5 -7
  3. package/.agents/adapters/shared.js +14 -1
  4. package/.agents/adapters/zed/export.js +4 -16
  5. package/.agents/compiled/registry.v2.json +33 -33
  6. package/.agents/compiled/registry.v2.sha256 +1 -1
  7. package/.agents/compiler/manifest-compiler.js +8 -5
  8. package/.agents/core/skills/context-manager/EXAMPLES.md +5 -17
  9. package/.agents/core/skills/context-manager/SKILL.md +10 -100
  10. package/.agents/core/skills/context-manager/TROUBLESHOOTING.md +6 -6
  11. package/.agents/core/skills/context-manager/VALIDATION.json +115 -4
  12. package/.agents/core/skills/context-manager/references/context-rules.md +3 -57
  13. package/.agents/core/skills/context-manager/skill.yaml +1 -3
  14. package/.agents/core/skills/context-os/EXAMPLES.md +25 -15
  15. package/.agents/core/skills/context-os/SKILL.md +12 -135
  16. package/.agents/core/skills/context-os/TROUBLESHOOTING.md +11 -6
  17. package/.agents/core/skills/context-os/VALIDATION.json +115 -4
  18. package/.agents/core/skills/context-os/packs.yaml +10 -59
  19. package/.agents/core/skills/context-os/references/context-rules.md +27 -59
  20. package/.agents/core/skills/context-os/references/pipeline.md +14 -119
  21. package/.agents/core/skills/context-os/references/project-graph.md +11 -100
  22. package/.agents/core/skills/context-os/rules.yaml +8 -135
  23. package/.agents/core/skills/engineering-workflow/EXAMPLES.md +15 -50
  24. package/.agents/core/skills/engineering-workflow/SKILL.md +10 -10
  25. package/.agents/core/skills/engineering-workflow/TROUBLESHOOTING.md +11 -19
  26. package/.agents/core/skills/engineering-workflow/VALIDATION.json +115 -4
  27. package/.agents/core/skills/engineering-workflow/references/workflow.md +55 -317
  28. package/.agents/core/skills/gemini-precision/EXAMPLES.md +33 -53
  29. package/.agents/core/skills/gemini-precision/SKILL.md +11 -147
  30. package/.agents/core/skills/gemini-precision/TROUBLESHOOTING.md +12 -25
  31. package/.agents/core/skills/gemini-precision/VALIDATION.json +115 -4
  32. package/.agents/core/skills/gemini-precision/skill.yaml +1 -1
  33. package/.agents/core/skills/gstack-roles/EXAMPLES.md +5 -21
  34. package/.agents/core/skills/gstack-roles/SKILL.md +10 -12
  35. package/.agents/core/skills/gstack-roles/TROUBLESHOOTING.md +6 -12
  36. package/.agents/core/skills/gstack-roles/VALIDATION.json +115 -4
  37. package/.agents/core/skills/gstack-roles/references/roles.md +3 -147
  38. package/.agents/core/skills/ponytail-mindset/EXAMPLES.md +12 -45
  39. package/.agents/core/skills/ponytail-mindset/SKILL.md +10 -13
  40. package/.agents/core/skills/ponytail-mindset/TROUBLESHOOTING.md +10 -19
  41. package/.agents/core/skills/ponytail-mindset/VALIDATION.json +115 -4
  42. package/.agents/core/skills/ponytail-mindset/references/minimalism.md +58 -174
  43. package/.agents/core/skills/security/EXAMPLES.md +19 -55
  44. package/.agents/core/skills/security/SKILL.md +61 -137
  45. package/.agents/core/skills/security/TROUBLESHOOTING.md +13 -19
  46. package/.agents/core/skills/security/VALIDATION.json +115 -4
  47. package/.agents/core/skills/security/skill.yaml +1 -1
  48. package/.agents/generated/claude/skills/context-manager/EXAMPLES.md +5 -17
  49. package/.agents/generated/claude/skills/context-manager/SKILL.md +9 -96
  50. package/.agents/generated/claude/skills/context-manager/TROUBLESHOOTING.md +6 -6
  51. package/.agents/generated/claude/skills/context-manager/VALIDATION.json +115 -4
  52. package/.agents/generated/claude/skills/context-manager/references/context-rules.md +3 -57
  53. package/.agents/generated/claude/skills/context-os/EXAMPLES.md +25 -15
  54. package/.agents/generated/claude/skills/context-os/SKILL.md +11 -133
  55. package/.agents/generated/claude/skills/context-os/TROUBLESHOOTING.md +11 -6
  56. package/.agents/generated/claude/skills/context-os/VALIDATION.json +115 -4
  57. package/.agents/generated/claude/skills/context-os/packs.yaml +10 -59
  58. package/.agents/generated/claude/skills/context-os/references/context-rules.md +27 -59
  59. package/.agents/generated/claude/skills/context-os/references/pipeline.md +14 -119
  60. package/.agents/generated/claude/skills/context-os/references/project-graph.md +11 -100
  61. package/.agents/generated/claude/skills/context-os/rules.yaml +8 -135
  62. package/.agents/generated/claude/skills/engineering-workflow/EXAMPLES.md +15 -50
  63. package/.agents/generated/claude/skills/engineering-workflow/SKILL.md +9 -9
  64. package/.agents/generated/claude/skills/engineering-workflow/TROUBLESHOOTING.md +11 -19
  65. package/.agents/generated/claude/skills/engineering-workflow/VALIDATION.json +115 -4
  66. package/.agents/generated/claude/skills/engineering-workflow/references/workflow.md +55 -317
  67. package/.agents/generated/claude/skills/gemini-precision/EXAMPLES.md +33 -53
  68. package/.agents/generated/claude/skills/gemini-precision/SKILL.md +10 -143
  69. package/.agents/generated/claude/skills/gemini-precision/TROUBLESHOOTING.md +12 -25
  70. package/.agents/generated/claude/skills/gemini-precision/VALIDATION.json +115 -4
  71. package/.agents/generated/claude/skills/gstack-roles/EXAMPLES.md +5 -21
  72. package/.agents/generated/claude/skills/gstack-roles/SKILL.md +9 -11
  73. package/.agents/generated/claude/skills/gstack-roles/TROUBLESHOOTING.md +6 -12
  74. package/.agents/generated/claude/skills/gstack-roles/VALIDATION.json +115 -4
  75. package/.agents/generated/claude/skills/gstack-roles/references/roles.md +3 -147
  76. package/.agents/generated/claude/skills/ponytail-mindset/EXAMPLES.md +12 -45
  77. package/.agents/generated/claude/skills/ponytail-mindset/SKILL.md +9 -12
  78. package/.agents/generated/claude/skills/ponytail-mindset/TROUBLESHOOTING.md +10 -19
  79. package/.agents/generated/claude/skills/ponytail-mindset/VALIDATION.json +115 -4
  80. package/.agents/generated/claude/skills/ponytail-mindset/references/minimalism.md +58 -174
  81. package/.agents/generated/claude/skills/security/EXAMPLES.md +19 -55
  82. package/.agents/generated/claude/skills/security/SKILL.md +60 -134
  83. package/.agents/generated/claude/skills/security/TROUBLESHOOTING.md +13 -19
  84. package/.agents/generated/claude/skills/security/VALIDATION.json +115 -4
  85. package/.agents/generated/gemini/skills/context-manager/EXAMPLES.md +5 -17
  86. package/.agents/generated/gemini/skills/context-manager/SKILL.md +10 -99
  87. package/.agents/generated/gemini/skills/context-manager/TROUBLESHOOTING.md +6 -6
  88. package/.agents/generated/gemini/skills/context-manager/VALIDATION.json +115 -4
  89. package/.agents/generated/gemini/skills/context-manager/references/context-rules.md +3 -57
  90. package/.agents/generated/gemini/skills/context-os/EXAMPLES.md +25 -15
  91. package/.agents/generated/gemini/skills/context-os/SKILL.md +12 -135
  92. package/.agents/generated/gemini/skills/context-os/TROUBLESHOOTING.md +11 -6
  93. package/.agents/generated/gemini/skills/context-os/VALIDATION.json +115 -4
  94. package/.agents/generated/gemini/skills/context-os/packs.yaml +10 -59
  95. package/.agents/generated/gemini/skills/context-os/references/context-rules.md +27 -59
  96. package/.agents/generated/gemini/skills/context-os/references/pipeline.md +14 -119
  97. package/.agents/generated/gemini/skills/context-os/references/project-graph.md +11 -100
  98. package/.agents/generated/gemini/skills/context-os/rules.yaml +8 -135
  99. package/.agents/generated/gemini/skills/engineering-workflow/EXAMPLES.md +15 -50
  100. package/.agents/generated/gemini/skills/engineering-workflow/SKILL.md +10 -11
  101. package/.agents/generated/gemini/skills/engineering-workflow/TROUBLESHOOTING.md +11 -19
  102. package/.agents/generated/gemini/skills/engineering-workflow/VALIDATION.json +115 -4
  103. package/.agents/generated/gemini/skills/engineering-workflow/references/workflow.md +55 -317
  104. package/.agents/generated/gemini/skills/gemini-precision/EXAMPLES.md +33 -53
  105. package/.agents/generated/gemini/skills/gemini-precision/SKILL.md +11 -145
  106. package/.agents/generated/gemini/skills/gemini-precision/TROUBLESHOOTING.md +12 -25
  107. package/.agents/generated/gemini/skills/gemini-precision/VALIDATION.json +115 -4
  108. package/.agents/generated/gemini/skills/gstack-roles/EXAMPLES.md +5 -21
  109. package/.agents/generated/gemini/skills/gstack-roles/SKILL.md +10 -13
  110. package/.agents/generated/gemini/skills/gstack-roles/TROUBLESHOOTING.md +6 -12
  111. package/.agents/generated/gemini/skills/gstack-roles/VALIDATION.json +115 -4
  112. package/.agents/generated/gemini/skills/gstack-roles/references/roles.md +3 -147
  113. package/.agents/generated/gemini/skills/ponytail-mindset/EXAMPLES.md +12 -45
  114. package/.agents/generated/gemini/skills/ponytail-mindset/SKILL.md +10 -14
  115. package/.agents/generated/gemini/skills/ponytail-mindset/TROUBLESHOOTING.md +10 -19
  116. package/.agents/generated/gemini/skills/ponytail-mindset/VALIDATION.json +115 -4
  117. package/.agents/generated/gemini/skills/ponytail-mindset/references/minimalism.md +58 -174
  118. package/.agents/generated/gemini/skills/security/EXAMPLES.md +19 -55
  119. package/.agents/generated/gemini/skills/security/SKILL.md +61 -136
  120. package/.agents/generated/gemini/skills/security/TROUBLESHOOTING.md +13 -19
  121. package/.agents/generated/gemini/skills/security/VALIDATION.json +115 -4
  122. package/.agents/resolver/canonical-resolver.js +34 -21
  123. package/.agents/rules/rule-catalog.js +5 -5
  124. package/.agents/validate.js +9 -2
  125. package/.agents/validation-evidence.js +89 -0
  126. package/README.md +132 -207
  127. package/catalog/skills/typescript/SKILL.md +16 -2
  128. package/package.json +3 -2
@@ -2,117 +2,30 @@
2
2
 
3
3
  ## Overview
4
4
 
5
- Deterministic context window optimizer. Analyzes user task intent and queries project dependency graphs to inject minimal relevant files and skills, preventing LLM attention loss and context pollution.
5
+ Deprecated compatibility identifier. Use [context-os](../context-os/SKILL.md) for the canonical instructions.
6
6
 
7
7
  ## When to Use
8
8
 
9
- Activate during multi-file investigations, large refactorings, or complex tasks where dumping entire directory trees would blow past context budgets.
9
+ An existing configuration or user explicitly names context-manager.
10
10
 
11
11
  ## Rules & Patterns
12
12
 
13
- You are the **Context Manager**. Your job is to prevent context overload.
14
-
15
- ## How It Works
16
-
17
- When given a task:
18
-
19
- ### Step 1: Classify the task
20
-
21
- ```yaml
22
- task:
23
- type: [frontend | backend | fullstack | architecture | bugfix | refactor | deploy | review]
24
- scope: [module | feature | file | project-wide]
25
- module: {{module_name from Project Graph}}
26
- ```
27
-
28
- ### Step 2: Consult the Project Graph
29
-
30
- If `docs/PROJECT_GRAPH.md` or `.graphify/graph.json` exists (or activate `graphify` skill to extract AST dependencies):
31
-
32
- 1. Find the module this task belongs to
33
- 2. Get the module's dependencies
34
- 3. Get the module's required skills
35
- 4. Get the files this task will likely touch
36
-
37
- ### Step 3: Apply Context Rules
38
-
39
- Load `references/context-rules.md` and apply the task type → document mapping.
40
-
41
- ### Step 4: Return Context Package
42
-
43
- Output a context package:
44
-
45
- ```yaml
46
- context:
47
- documents:
48
- required:
49
- - docs/API.md # sections: [appointments]
50
- - docs/ARCHITECTURE.md # sections: [backend, api-layer]
51
- optional:
52
- - docs/decisions/0003-postgres.md
53
- skipped:
54
- - docs/UI.md # reason: backend task
55
- - docs/DATABASE.md # reason: no schema change
56
-
57
- skills:
58
- loaded: [typescript, node, postgres, testing]
59
- skipped: [react, tailwind] # reason: backend task
60
-
61
- project_graph:
62
- module: appointments
63
- dependencies: [auth, patients]
64
- affected_files:
65
- - src/modules/appointments/api/**
66
- - src/modules/appointments/services/**
67
- ```
68
-
69
- ### Step 5: Validate Budget
70
-
71
- Check total token count. If over budget (see context-rules.md):
72
-
73
- 1. Trim Level 1 docs to summaries
74
- 2. Load only affected sections of Level 2 docs
75
- 3. Keep Level 3 (skills) at full detail
76
-
77
- ## Context Caching
78
-
79
- After first compilation for a module, cache the result:
80
-
81
- ```
82
- .cache/
83
- frontend.context.yaml
84
- backend.context.yaml
85
- appointments.context.yaml
86
- ```
87
-
88
- Invalidate cache when:
89
-
90
- - A document is updated
91
- - A skill is added/removed
92
- - The Project Graph changes
93
- - A Decision Record is added
94
-
95
- ## Questions the Context Manager Can Answer
96
-
97
- - "What documents do I need for this task?"
98
- - "Which skills should be loaded?"
99
- - "What modules are affected by this change?"
100
- - "Is this context package within budget?"
101
- - "Why was this document skipped?"
102
-
13
+ Apply the canonical skill without loading a duplicate process. Existing authorization, proportional verification, and optional role declarations carry forward. The resolver redirects this identifier and reports an alias warning.
103
14
 
104
15
  ## Code Examples
105
16
 
106
- See `EXAMPLES.md` for detailed code examples.
17
+ Explicit context-manager selection resolves to context-os; inspect the resolver result rather than assuming both bodies were loaded.
107
18
 
108
19
  ## Validation Checklist
109
20
 
110
- What to verify during the review phase before completing the task.
21
+ - [ ] Canonical guidance is used.
22
+ - [ ] Alias resolution adds no duplicate body.
23
+ - [ ] Evidence scope and limitations are stated.
111
24
 
112
25
  ## Common Mistakes
113
26
 
114
- Anti-patterns and things to explicitly avoid. See `TROUBLESHOOTING.md`.
27
+ Treating this compatibility name as an independent engine or a mandatory ceremony.
115
28
 
116
29
  ## Integration Notes
117
30
 
118
- How this skill interacts with other skills.
31
+ Keep legacy links available. Read [references/context-rules.md](references/context-rules.md) only for compatibility details.
@@ -1,7 +1,7 @@
1
- # context-manager Troubleshooting & Common Mistakes
1
+ # context-manager compatibility troubleshooting
2
2
 
3
- ## 1. Token Budget Blowout
4
-
5
- - **Symptom**: Model performance drops significantly, losing earlier conversational context.
6
- - **Root Cause**: Loading large JSON mocks, lockfiles, or build directories into prompt.
7
- - **Fix**: Never read package-lock.json, dist/, or build artifacts unless explicitly debugging bundle outputs.
3
+ - Duplicate process: load the canonical context-os instructions once.
4
+ - Repeated approval or banners: preserve existing authorization and optional roles.
5
+ - Conflicting legacy guidance: use the canonical skill and update the stale link.
6
+ - Claimed automation: inspect actual CLI results and distinguish instructions
7
+ from runtime enforcement.
@@ -1,12 +1,123 @@
1
1
  {
2
2
  "$schema": "http://json-schema.org/draft-07/schema#",
3
+ "x-contextos-evidence-contract": 1,
4
+ "title": "Scoped verification evidence",
5
+ "description": "Report shape and outcome consistency only; command execution and agent behavior require separate evidence.",
3
6
  "type": "object",
7
+ "additionalProperties": false,
8
+ "required": [
9
+ "status",
10
+ "checks",
11
+ "limitations"
12
+ ],
4
13
  "properties": {
5
- "rules_followed": {
6
- "type": "boolean"
14
+ "status": {
15
+ "enum": [
16
+ "verified",
17
+ "partial",
18
+ "not_run"
19
+ ]
20
+ },
21
+ "checks": {
22
+ "type": "array",
23
+ "items": {
24
+ "type": "object",
25
+ "additionalProperties": false,
26
+ "required": [
27
+ "command",
28
+ "exitCode",
29
+ "scope"
30
+ ],
31
+ "properties": {
32
+ "command": {
33
+ "type": "string",
34
+ "minLength": 1
35
+ },
36
+ "exitCode": {
37
+ "type": [
38
+ "integer",
39
+ "null"
40
+ ]
41
+ },
42
+ "scope": {
43
+ "type": "string",
44
+ "minLength": 1
45
+ }
46
+ }
47
+ }
48
+ },
49
+ "limitations": {
50
+ "type": "array",
51
+ "items": {
52
+ "type": "string",
53
+ "minLength": 1
54
+ }
7
55
  }
8
56
  },
9
- "required": [
10
- "rules_followed"
57
+ "allOf": [
58
+ {
59
+ "if": {
60
+ "properties": {
61
+ "status": {
62
+ "const": "verified"
63
+ }
64
+ }
65
+ },
66
+ "then": {
67
+ "properties": {
68
+ "checks": {
69
+ "minItems": 1,
70
+ "items": {
71
+ "properties": {
72
+ "exitCode": {
73
+ "const": 0
74
+ }
75
+ }
76
+ }
77
+ }
78
+ }
79
+ }
80
+ },
81
+ {
82
+ "if": {
83
+ "properties": {
84
+ "status": {
85
+ "enum": [
86
+ "partial",
87
+ "not_run"
88
+ ]
89
+ }
90
+ }
91
+ },
92
+ "then": {
93
+ "properties": {
94
+ "limitations": {
95
+ "minItems": 1
96
+ }
97
+ }
98
+ }
99
+ },
100
+ {
101
+ "if": {
102
+ "properties": {
103
+ "status": {
104
+ "const": "not_run"
105
+ }
106
+ }
107
+ },
108
+ "then": {
109
+ "properties": {
110
+ "checks": {
111
+ "items": {
112
+ "properties": {
113
+ "exitCode": {
114
+ "type": "null"
115
+ }
116
+ }
117
+ }
118
+ }
119
+ }
120
+ }
121
+ }
11
122
  ]
12
123
  }
@@ -1,59 +1,5 @@
1
- # Context Loading Rules
1
+ # context-manager compatibility reference
2
2
 
3
- Guidelines and deterministic decision tables for selecting, prioritizing, and budgeting context during AI agent execution.
3
+ Canonical guidance: [context-os](../../context-os/SKILL.md).
4
4
 
5
- ## Task Type to Document Mapping
6
-
7
- | Task Type | Level 1 (Always) | Level 2 (If exists) | Level 3 (Per task) |
8
- | --- | --- | --- | --- |
9
- | **New project** | PRD, ROADMAP | ARCHITECTURE, DATABASE, API | UI, TASKS, all relevant skills |
10
- | **New feature** | PRD | ARCHITECTURE, API | PROJECT_GRAPH, relevant skills |
11
- | **Frontend** | — | ARCHITECTURE, API | UI, frontend skills |
12
- | **Backend** | — | ARCHITECTURE, DATABASE, API | backend skills |
13
- | **Database** | — | ARCHITECTURE, DATABASE | — |
14
- | **Bugfix** | — | — | PROJECT_GRAPH (affected module only) |
15
- | **Refactor** | — | ARCHITECTURE | PROJECT_GRAPH, affected skills |
16
- | **Review** | PRD | ARCHITECTURE | TASKS, all loaded skills |
17
- | **Deploy** | — | ARCHITECTURE | DEPLOYMENT, infrastructure skills |
18
-
19
- ## Skill Category to Document Mapping
20
-
21
- | Skill Category | Required Documents | Optional Documents |
22
- | --- | --- | --- |
23
- | `frontend` | UI.md, API.md | ARCHITECTURE.md |
24
- | `backend` | API.md, DATABASE.md | ARCHITECTURE.md |
25
- | `design` | UI.md | PRD.md |
26
- | `architecture` | ARCHITECTURE.md, DATABASE.md | PRD.md, API.md |
27
- | `infrastructure` | ARCHITECTURE.md | — |
28
- | `security` | ARCHITECTURE.md, API.md | DATABASE.md |
29
- | `testing` | API.md | ARCHITECTURE.md |
30
-
31
- ## Context Budgeting
32
-
33
- To prevent context window saturation and retain maximum LLM reasoning capacity, adhere strictly to the following 4-tier token budget:
34
-
35
- | Priority Level | Max Tokens | Contents |
36
- | --- | --- | --- |
37
- | 1 (Critical) | 2,000 | Current task description, active brief, and primary skill rules |
38
- | 2 (Important) | 3,000 | System architecture and API contracts for affected modules |
39
- | 3 (Context) | 2,000 | Architectural Decision Records (ADRs) and relevant graph nodes |
40
- | 4 (Background) | 1,000 | PRD summary and global project conventions |
41
-
42
- **Total target context budget: ~8,000 tokens per subtask.**
43
-
44
- ### Degradation Strategy When Over Budget
45
-
46
- If accumulated context exceeds the 8,000 token limit:
47
-
48
- 1. **Trim Level 1 documents** to high-level executive summaries.
49
- 2. **Slice Level 2 documents** to extract only sections matching touched module signatures.
50
- 3. **Preserve Level 3 skills** at full fidelity, as they contain non-negotiable operational instructions and validation guardrails.
51
-
52
- ## Module-Based Filtering via Dependency Graph
53
-
54
- When `PROJECT_GRAPH.md` or `.graphify/graph.json` is present, traverse dependency edges to filter candidate documents:
55
-
56
- 1. Identify the primary module for the task from the symbol/path mapping.
57
- 2. Resolve immediate inbound and outbound dependencies (`dependencies` and `dependents`).
58
- 3. Include documents solely for the identified module and its immediate dependencies.
59
- 4. Exclude orthogonal domain documents (for example, omit database schemas during purely presentation-layer CSS/layout tasks).
5
+ Use the canonical resolver budget contract and workspace evidence boundaries. Load only relevant documents and source, including callers/tests when necessary. Read lockfiles or generated outputs when dependency, installation, provenance, or build investigations require them. Do not create a separate cache or promise a fixed token saving.
@@ -1,21 +1,31 @@
1
- # context-os Examples — Anti-patterns vs ContextOS Standard
1
+ # ContextOS command examples
2
2
 
3
- ## Example 1: Project Lifecycle Management
3
+ ## Source checkout
4
4
 
5
- ### Anti-pattern: Ad-hoc Unstructured Development
5
+ These commands run in the ContextOS source repository:
6
6
 
7
- ```text
8
- Coding -> Modifying DB -> Debugging -> Redesigning UI -> Changing Architecture
9
- All in one unstructured stream of consciousness.
7
+ ```powershell
8
+ node .agents/ctx.js resolve "Fix IDOR in document deletion" --files src/auth.ts --json
9
+ node .agents/ctx.js compile --check
10
+ node .agents/ctx.js validate
11
+ node .agents/ctx.js export all --check --json
10
12
  ```
11
13
 
12
- ### Best practice: ContextOS Standard (Phase-Gated Development)
14
+ After authorized edits to canonical sources, compile then export before checking
15
+ sync. export --check is read-only; export without --check writes managed outputs.
16
+ The resolver returns skills and package evidence, not an automatic code-file
17
+ context package.
13
18
 
14
- ```text
15
- Phase 1: DEFINE (PRD & Requirements)
16
- Phase 2: PLAN (Atomic Tasks & ADRs)
17
- Phase 3: BUILD (TDD & Minimalist Implementation)
18
- Phase 4: VERIFY (Automated Test Proof)
19
- Phase 5: REVIEW (Design QA & Code Review)
20
- Phase 6: SHIP (Production Release)
21
- ```
19
+ ## Consumer project
20
+
21
+ Use the installed local ContextOS executable, for example through npx when the
22
+ package is already installed. Do not assume a consumer has this repository's bin
23
+ or scripts directories. Inspect its installation and project-specific checks.
24
+ Create overrides through skill override, inspect skill diff, then compile/export.
25
+ Preserve unmanaged user files and existing overrides.
26
+
27
+ ## Evidence interpretation
28
+
29
+ A validator pass means source/configuration checks passed. A scanner pass means
30
+ its specified staged checks passed. Neither result proves a live client loaded
31
+ instructions or a model followed them.
@@ -2,156 +2,34 @@
2
2
 
3
3
  ## Overview
4
4
 
5
- Deterministic context compiler and policy engine for AI coding agents. Governs repository policy configuration, skill dependency graphs, profile management, and multi-agent configuration export.
5
+ Guide configuration of the ContextOS compiler, resolver, profiles, and agent exports. Executable behavior lives in the CLI and modules; this Markdown entrypoint is guidance.
6
6
 
7
7
  ## When to Use
8
8
 
9
- Activate when managing project configuration, resolving skill dependencies, compiling rules for editors, or defining repository-level agent standards. (For task-specific file and context budgeting, use `context-manager`).
9
+ Skill selection, context budgets, manifests, project overrides, profiles, exports, and configuration drift.
10
10
 
11
11
  ## Rules & Patterns
12
12
 
13
- You are the **Context Compiler**. Your job is NOT to know everything. Your job is to **assemble the minimum context** needed for the current task.
13
+ Inspect the active project and installed skills. Canonical sources live in .agents/core/skills; project overrides in .agents/project/skills; plugins provide additional sources. Native .agents/skills contains generated projections. Entrypoint precedence is skill.v2.yaml, skill.yaml, then manifestless SKILL.md. Respect the declared entrypoint and resolve contained resource paths relative to its skill directory.
14
14
 
15
- ## Pipeline
16
-
17
- When a user gives you a task, follow this pipeline:
18
-
19
- ### Stage 1: Intent Analysis
20
-
21
- Analyze the user's prompt and determine:
22
-
23
- ```yaml
24
- intent:
25
- project_type: [webapp, api, mobile, cli, library, saas, crm, ecommerce]
26
- industry: [healthcare, fintech, education, social, general]
27
- layers:
28
- frontend: true/false
29
- backend: true/false
30
- database: true/false
31
- auth: true/false
32
- ai: true/false
33
- payments: true/false
34
- realtime: true/false
35
- scope: [new_project, feature, bugfix, refactor, architecture]
36
- ```
37
-
38
- ### Stage 2: Dependency Resolution
39
-
40
- For each required layer, load the skill graph:
41
-
42
- 1. Read `skill.yaml` from each relevant skill directory
43
- 2. Resolve `requires` - load mandatory dependencies
44
- 3. Check `conflicts` - ensure no incompatible skills are loaded
45
- 4. Apply `optional` - suggest but don't force
46
- 5. Respect project profile (if set) - apply rules from `profiles/`
47
-
48
- **Dependency resolution example:**
49
-
50
- ```
51
- Need: nextjs
52
- → requires: react, typescript
53
- → react requires: typescript (already loaded)
54
- → optional: tailwind, prisma, next-auth
55
-
56
- Loaded: [nextjs, react, typescript]
57
- Suggested: [tailwind, prisma, next-auth]
58
- ```
59
-
60
- ### Stage 3: Context Compilation
61
-
62
- Assemble context from three levels:
63
-
64
- **Level 1 - Vision (always available):**
65
-
66
- - `docs/PRD.md` - what are we building
67
- - `docs/ROADMAP.md` - where are we going
68
- - `docs/PROJECT_GRAPH.md` - project structure
69
- - `docs/API.md` - API specification (optional, when backend API layer is present)
70
- - `docs/UI.md` - UI/UX specification (optional, when UI layer is present)
71
-
72
- **Level 2 - Architecture (load when needed):**
73
-
74
- - `docs/ARCHITECTURE.md` - system design and boundaries
75
- - `docs/decisions/` - architecture decision records (ADRs)
76
- - `docs/PRODUCT_BOUNDARIES.md` - maturity boundaries and non-promises
77
- - `references/context-rules.md` - dynamic context selection and compilation rules
78
-
79
- **Level 3 - Task-Specific Context (load per task):**
80
-
81
- - Relevant skill documents from `.agents/skills/`
82
- - Target code and test files within planned blast radius
83
-
84
- ### Stage 4: Focused Context Selection
85
-
86
- Before sending context to the AI coding assistant:
87
-
88
- 1. Select only skills relevant to the task domain and touched files
89
- 2. Prioritize: task goal > architectural constraints > project conventions
90
- 3. Include active Decision Records that affect the target component
91
- 4. Enforce quality guardrails and verification criteria
92
-
93
- ## Core CLI Commands
94
-
95
- | Command | Action |
96
- | --- | --- |
97
- | `contextos init` | Initialize `.agents/` folder and bootstrap profiles |
98
- | `contextos export <agent>` | Compile skills for target agent (`gemini`, `claude`, `cursor`, `copilot`, `aider`, `zed`, `all`) |
99
- | `contextos resolve "<task>"` | Dynamically resolve relevant skills, rules, and risk level for task |
100
- | `contextos validate` | Validate skill schemas, dependencies, and detect configuration drift |
101
- | `contextos doctor` | Pre-flight diagnostics for skills, profiles, and compiler synchronization |
102
- | `contextos watch` | Background file watcher for continuous auto-compilation |
103
-
104
- ## Project Initialization Flow
105
-
106
- When user says something like "Сделай CRM для стоматологии" or "Build a Trello clone":
107
-
108
- 1. **Analyze intent** (Stage 1)
109
- 2. **Ask clarifying questions:**
110
- - Users and roles?
111
- - Tech stack preference?
112
- - Mobile app needed?
113
- - AI features?
114
- - Authentication type?
115
- - Expected load?
116
- - MVP or Production?
117
- 3. **Select profile** (startup/enterprise/mvp/hackathon)
118
- 4. **Resolve skills** (Stage 2)
119
- 5. **Generate all documents** using `generators/` skill
120
- 6. **Create Project Graph** - the master map of modules -> features -> tasks -> files -> skills
121
- 7. **Output agent config** using `adapters/` skill
122
-
123
- ## Skill Discovery
124
-
125
- Skills are discovered by scanning `.agents/skills/*/skill.yaml`. Each `skill.yaml` defines:
126
-
127
- ```yaml
128
- id: react
129
- name: React
130
- category: frontend
131
- tags: [frontend, spa, jsx, components]
132
- requires: [typescript]
133
- optional: [tailwind, next-auth, react-query]
134
- conflicts: [vue, angular, svelte]
135
- weight: 8
136
- documents:
137
- - react.md
138
- ```
139
-
140
- The compiler builds a dependency graph from all discovered skills and resolves it for each task.
15
+ Use the resolver with the task and affected files; inspect reasons, risk, warnings, missing skills, and soft-budget overflow. Load references only when needed. Existing authorization and proportional engineering-workflow apply.
141
16
 
17
+ Read [references/context-rules.md](references/context-rules.md) for budgeting and [references/project-graph.md](references/project-graph.md) for graph limits.
142
18
 
143
19
  ## Code Examples
144
20
 
145
- See `EXAMPLES.md` for detailed code examples.
21
+ In this source checkout: node .agents/ctx.js resolve "Fix IDOR" --files src/auth.ts --json. See EXAMPLES.md for source and consumer command boundaries.
146
22
 
147
23
  ## Validation Checklist
148
24
 
149
- What to verify during the review phase before completing the task.
25
+ - [ ] The requested outcome and applicable failure cases are checked.
26
+ - [ ] Evidence names commands, results, scope, and limitations.
27
+ - [ ] Unrelated changes and existing authorization are preserved.
150
28
 
151
29
  ## Common Mistakes
152
30
 
153
- Anti-patterns and things to explicitly avoid. See `TROUBLESHOOTING.md`.
31
+ Editing generated projections; assuming catalog skills are installed; treating an estimated budget as total prompt size; expecting AST or document selection from the package graph; claiming schema validation proves agent behavior.
154
32
 
155
33
  ## Integration Notes
156
34
 
157
- How this skill interacts with other skills.
35
+ context-manager is a deprecated compatibility alias. engineering-workflow owns the lifecycle; security owns protected boundaries. packs.yaml and rules.yaml are reference data, not executable policy.
@@ -1,7 +1,12 @@
1
- # context-os Troubleshooting & Common Mistakes
1
+ # ContextOS troubleshooting
2
2
 
3
- ## 1. Stale Compiled Artifacts
4
-
5
- - **Symptom**: Editor rules don't reflect newly updated skills.
6
- - **Root Cause**: Modifying .agents/core/skills/ without recompiling exports.
7
- - **Fix**: Run node .agents/ctx.js export all whenever source skills are updated.
3
+ - Stale projection: inspect edits in core/project sources, compile, export, and
4
+ verify export --check. Do not hand-edit generated artifacts.
5
+ - Missing skill: inspect installed manifests and resolver warnings; install only
6
+ the required catalog skill through supported tooling.
7
+ - Budget overflow: preserve mandatory safety guidance and reduce irrelevant
8
+ context; the budget is soft and entrypoint-only.
9
+ - Wrong risk or selection: supply relevant paths, inspect the actual operation,
10
+ and report a reproducible routing case. A resolver label is not an authority.
11
+ - Missing graph command: use resolve --json for workspace package evidence;
12
+ inspect source callers separately for symbol-level impact.