@ryuenn3123/agentic-senior-core 4.3.15 → 5.1.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 (198) hide show
  1. package/.agents/plugins/marketplace.json +21 -0
  2. package/.agents/rules/agentic-senior-core.md +126 -0
  3. package/.claude-plugin/marketplace.json +17 -0
  4. package/.claude-plugin/plugin.json +17 -0
  5. package/.clinerules/agentic-senior-core.md +94 -0
  6. package/.codex-plugin/plugin.json +24 -0
  7. package/.cursor/rules/agentic-senior-core.mdc +99 -0
  8. package/.devin-plugin/plugin.json +13 -0
  9. package/.github/copilot-instructions.md +94 -0
  10. package/.github/plugin/marketplace.json +20 -0
  11. package/.github/plugin/plugin.json +16 -0
  12. package/.kiro/steering/agentic-senior-core.md +94 -0
  13. package/.openclaw/skills/asc/SKILL.md +23 -0
  14. package/.openclaw/skills/asc-audit/SKILL.md +28 -0
  15. package/.openclaw/skills/asc-review/SKILL.md +54 -0
  16. package/.opencode/plugins/agentic-senior-core.mjs +31 -0
  17. package/.windsurf/rules/agentic-senior-core.md +94 -0
  18. package/AGENTS.md +126 -179
  19. package/CONTRIBUTING.md +93 -63
  20. package/README.md +160 -111
  21. package/__init__.py +61 -0
  22. package/bin/agentic-senior-core.js +41 -43
  23. package/commands/asc-audit.md +1 -0
  24. package/commands/asc-audit.toml +2 -0
  25. package/commands/asc-help.md +9 -0
  26. package/commands/asc-help.toml +2 -0
  27. package/commands/asc-refactor.md +1 -0
  28. package/commands/asc-refactor.toml +2 -0
  29. package/commands/asc-review.md +1 -0
  30. package/commands/asc-review.toml +2 -0
  31. package/gemini-extension.json +10 -0
  32. package/hooks/copilot-hooks.json +21 -0
  33. package/hooks/hooks.json +31 -0
  34. package/hooks/session-start.js +36 -0
  35. package/hooks/subagent-start.js +38 -0
  36. package/lib/cli/commands/adapter.mjs +109 -0
  37. package/lib/cli/commands/clean.mjs +63 -0
  38. package/lib/cli/commands/status.mjs +94 -0
  39. package/package.json +43 -67
  40. package/plugin.yaml +16 -0
  41. package/scripts/uninstall.js +38 -0
  42. package/skills/asc/SKILL.md +16 -0
  43. package/skills/asc-audit/SKILL.md +28 -0
  44. package/skills/asc-refactor/SKILL.md +35 -0
  45. package/skills/asc-review/SKILL.md +54 -0
  46. package/.agent-context/policies/llm-judge-threshold.json +0 -29
  47. package/.agent-context/prompts/bootstrap-design.md +0 -63
  48. package/.agent-context/prompts/compact-natural-mode.md +0 -100
  49. package/.agent-context/prompts/init-project.md +0 -60
  50. package/.agent-context/prompts/refactor.md +0 -38
  51. package/.agent-context/prompts/review-code.md +0 -31
  52. package/.agent-context/review-checklists/architecture-review.md +0 -57
  53. package/.agent-context/review-checklists/pr-checklist.md +0 -136
  54. package/.agent-context/rules/api-docs.md +0 -24
  55. package/.agent-context/rules/api-versioning.md +0 -16
  56. package/.agent-context/rules/architecture.md +0 -33
  57. package/.agent-context/rules/background-jobs.md +0 -17
  58. package/.agent-context/rules/config-and-flags.md +0 -16
  59. package/.agent-context/rules/database-design.md +0 -18
  60. package/.agent-context/rules/docker-runtime.md +0 -17
  61. package/.agent-context/rules/error-handling.md +0 -16
  62. package/.agent-context/rules/event-driven.md +0 -16
  63. package/.agent-context/rules/frontend-architecture.md +0 -54
  64. package/.agent-context/rules/microservices.md +0 -16
  65. package/.agent-context/rules/migrations.md +0 -16
  66. package/.agent-context/rules/observability.md +0 -16
  67. package/.agent-context/rules/performance.md +0 -16
  68. package/.agent-context/rules/realtime.md +0 -16
  69. package/.agent-context/rules/resilience.md +0 -18
  70. package/.agent-context/rules/security.md +0 -18
  71. package/.agent-context/rules/testing.md +0 -16
  72. package/.agent-context/state/README.md +0 -25
  73. package/.agent-context/state/architecture-map.md +0 -40
  74. package/.agent-context/state/benchmark-comparison-schema.json +0 -181
  75. package/.agent-context/state/benchmark-reproducibility.json +0 -87
  76. package/.agent-context/state/benchmark-thresholds.json +0 -10
  77. package/.agent-context/state/benchmark-writer-judge-config.json +0 -58
  78. package/.agent-context/state/dependency-map.md +0 -41
  79. package/.agent-context/state/memory-adapter-contract.json +0 -52
  80. package/.agent-context/state/memory-schema-v1.json +0 -88
  81. package/GEMINI.md +0 -1
  82. package/benchmarks/README.md +0 -60
  83. package/benchmarks/compact-natural-mode/fixtures.mjs +0 -359
  84. package/benchmarks/compact-natural-mode/scorer.mjs +0 -331
  85. package/benchmarks/runtime-token-saver/fixtures.mjs +0 -836
  86. package/lib/cli/adaptive-context/catalog.mjs +0 -390
  87. package/lib/cli/adaptive-context/file-signals.mjs +0 -100
  88. package/lib/cli/adaptive-context/implications.mjs +0 -44
  89. package/lib/cli/adaptive-context.mjs +0 -365
  90. package/lib/cli/audits/typography-palette-anti-repeat/color-utils.mjs +0 -156
  91. package/lib/cli/audits/typography-palette-anti-repeat/file-scanner.mjs +0 -103
  92. package/lib/cli/audits/typography-palette-anti-repeat/typography-utils.mjs +0 -70
  93. package/lib/cli/audits/typography-palette-anti-repeat-audit.mjs +0 -239
  94. package/lib/cli/backup.mjs +0 -210
  95. package/lib/cli/commands/audit-design-anti-repeat.mjs +0 -39
  96. package/lib/cli/commands/context.mjs +0 -140
  97. package/lib/cli/commands/init/project-context.mjs +0 -60
  98. package/lib/cli/commands/init/runtime-environment.mjs +0 -59
  99. package/lib/cli/commands/init/setup-decisions.mjs +0 -83
  100. package/lib/cli/commands/init.mjs +0 -654
  101. package/lib/cli/commands/launch.mjs +0 -76
  102. package/lib/cli/commands/optimize.mjs +0 -284
  103. package/lib/cli/commands/rollback.mjs +0 -64
  104. package/lib/cli/commands/upgrade/token-optimization-state.mjs +0 -51
  105. package/lib/cli/commands/upgrade.mjs +0 -451
  106. package/lib/cli/compiler.mjs +0 -570
  107. package/lib/cli/constants.mjs +0 -136
  108. package/lib/cli/detector/constants.mjs +0 -135
  109. package/lib/cli/detector/design-evidence/collector.mjs +0 -256
  110. package/lib/cli/detector/design-evidence/constants.mjs +0 -39
  111. package/lib/cli/detector/design-evidence/file-traversal.mjs +0 -83
  112. package/lib/cli/detector/design-evidence/structured-attribute-evidence.mjs +0 -117
  113. package/lib/cli/detector/design-evidence/summary.mjs +0 -109
  114. package/lib/cli/detector/design-evidence/utility-helpers.mjs +0 -122
  115. package/lib/cli/detector/design-evidence.mjs +0 -25
  116. package/lib/cli/detector/stack-detection.mjs +0 -243
  117. package/lib/cli/detector/ui-signals.mjs +0 -150
  118. package/lib/cli/detector/workspace-scan.mjs +0 -177
  119. package/lib/cli/detector.mjs +0 -23
  120. package/lib/cli/init-detection-flow.mjs +0 -48
  121. package/lib/cli/init-options.mjs +0 -237
  122. package/lib/cli/init-selection.mjs +0 -29
  123. package/lib/cli/memory-continuity.mjs +0 -537
  124. package/lib/cli/preflight.mjs +0 -76
  125. package/lib/cli/project-scaffolder/constants.mjs +0 -69
  126. package/lib/cli/project-scaffolder/discovery.mjs +0 -272
  127. package/lib/cli/project-scaffolder/prompt-builders.mjs +0 -171
  128. package/lib/cli/project-scaffolder/storage.mjs +0 -144
  129. package/lib/cli/project-scaffolder/ui-scope-detection.mjs +0 -36
  130. package/lib/cli/project-scaffolder.mjs +0 -29
  131. package/lib/cli/rollback.mjs +0 -66
  132. package/lib/cli/token-optimization.mjs +0 -486
  133. package/lib/cli/utils/filesystem.mjs +0 -81
  134. package/lib/cli/utils/managed-surface.mjs +0 -280
  135. package/lib/cli/utils/prompting.mjs +0 -44
  136. package/lib/cli/utils.mjs +0 -479
  137. package/mcp.json +0 -134
  138. package/scripts/adaptive-context/fixtures.mjs +0 -183
  139. package/scripts/adaptive-context-benchmark.mjs +0 -9
  140. package/scripts/ascx-runtime-token-saver-benchmark.mjs +0 -9
  141. package/scripts/audit-cache-layer-contract.mjs +0 -263
  142. package/scripts/audit-caching-scope-hygiene.mjs +0 -268
  143. package/scripts/audit-file-size.mjs +0 -219
  144. package/scripts/audit-reflection-citations.mjs +0 -163
  145. package/scripts/audit-release-bundle.mjs +0 -170
  146. package/scripts/audit-rule-id-uniqueness.mjs +0 -313
  147. package/scripts/audit-typography-palette-anti-repeat.mjs +0 -120
  148. package/scripts/benchmark-evidence-bundle.mjs +0 -645
  149. package/scripts/benchmark-gate.mjs +0 -121
  150. package/scripts/benchmark-intelligence.mjs +0 -33
  151. package/scripts/benchmark-writer-judge-matrix.mjs +0 -379
  152. package/scripts/build-release-benchmark-bundle.mjs +0 -202
  153. package/scripts/bump-version.mjs +0 -103
  154. package/scripts/clean-local-artifacts.mjs +0 -78
  155. package/scripts/compact-natural-mode-benchmark.mjs +0 -9
  156. package/scripts/context-triggered-audit.mjs +0 -391
  157. package/scripts/detection-benchmark.mjs +0 -127
  158. package/scripts/docs-quality-drift-report.mjs +0 -358
  159. package/scripts/documentation-boundary-audit.mjs +0 -305
  160. package/scripts/explain-on-demand-audit.mjs +0 -427
  161. package/scripts/forbidden-content-check.mjs +0 -123
  162. package/scripts/frontend-usability-audit.mjs +0 -243
  163. package/scripts/generate-sbom.mjs +0 -61
  164. package/scripts/governance-weekly-report.mjs +0 -466
  165. package/scripts/llm-judge/checklist-loader.mjs +0 -45
  166. package/scripts/llm-judge/constants.mjs +0 -66
  167. package/scripts/llm-judge/diff-collection.mjs +0 -74
  168. package/scripts/llm-judge/prompting.mjs +0 -78
  169. package/scripts/llm-judge/providers.mjs +0 -111
  170. package/scripts/llm-judge/verdict.mjs +0 -134
  171. package/scripts/llm-judge.mjs +0 -200
  172. package/scripts/memory-continuity-benchmark.mjs +0 -322
  173. package/scripts/quality-trend-report.mjs +0 -289
  174. package/scripts/release-gate/audit-checks.mjs +0 -441
  175. package/scripts/release-gate/constants.mjs +0 -53
  176. package/scripts/release-gate/runtime.mjs +0 -63
  177. package/scripts/release-gate/static-checks.mjs +0 -182
  178. package/scripts/release-gate.mjs +0 -42
  179. package/scripts/rules-guardian-audit.mjs +0 -580
  180. package/scripts/single-source-lazy-loading-audit.mjs +0 -449
  181. package/scripts/sync-thin-adapters.mjs +0 -72
  182. package/scripts/token-optimization-benchmark.mjs +0 -252
  183. package/scripts/ui-design-judge/constants.mjs +0 -13
  184. package/scripts/ui-design-judge/design-execution-summary.mjs +0 -81
  185. package/scripts/ui-design-judge/git-input.mjs +0 -134
  186. package/scripts/ui-design-judge/prompting.mjs +0 -52
  187. package/scripts/ui-design-judge/providers.mjs +0 -102
  188. package/scripts/ui-design-judge/reporting.mjs +0 -183
  189. package/scripts/ui-design-judge/rubric-calibration.mjs +0 -214
  190. package/scripts/ui-design-judge/rubric-goldset.json +0 -188
  191. package/scripts/ui-design-judge.mjs +0 -319
  192. package/scripts/ui-rubric-calibration.mjs +0 -35
  193. package/scripts/validate/config.mjs +0 -519
  194. package/scripts/validate/coverage-checks.mjs +0 -446
  195. package/scripts/validate/file-structure.mjs +0 -162
  196. package/scripts/validate/markdown-content.mjs +0 -109
  197. package/scripts/validate/project-metadata.mjs +0 -166
  198. package/scripts/validate.mjs +0 -338
package/CONTRIBUTING.md CHANGED
@@ -1,93 +1,122 @@
1
1
  # Contributing to Agentic-Senior-Core
2
2
 
3
- Thanks for wanting to make AI agents write better code. Here's how to contribute.
3
+ Thanks for wanting to make AI agents write better code.
4
4
 
5
5
  ---
6
6
 
7
7
  ## What You Can Contribute
8
8
 
9
- | Type | Where | Description |
10
- |------|-------|-------------|
11
- | New rule | `.agent-context/rules/` | Universal engineering standard |
12
- | Stack strategy update | `.agent-context/rules/`, `.agent-context/state/stack-research-snapshot.json` | Dynamic language/runtime guidance and evidence |
13
- | Structural planning guidance update | `.agent-context/prompts/`, `lib/cli/compiler.mjs` | Scope planning, docs bootstrap, and project-context guidance |
14
- | New checklist | `.agent-context/review-checklists/` | Self-audit guide |
15
- | State intelligence update | `.agent-context/state/` | Architecture boundaries and dependency map |
16
- | MCP workflow update | `mcp.json` | Self-healing automation flow |
9
+ | Type | Where | Notes |
10
+ |------|-------|-------|
11
+ | Rule improvement | `AGENTS.md` | All rules live in one file |
12
+ | New skill | `skills/<name>/SKILL.md` | Long-form workflow guidance |
13
+ | New command | `commands/<name>.md` + `.toml` | Claude `.md`, Gemini `.toml` |
14
+ | New host adapter | See adapter guide below | One file per host |
17
15
  | Bug fix | Any file | Typos, broken links, incorrect rules |
18
- | Improvement | Any file | Sharper wording, stricter boundaries |
19
16
 
20
17
  ---
21
18
 
22
19
  ## Content Quality Standard
23
20
 
24
- This is the single most important rule: **every file must be "galak" (strict/fierce).**
21
+ Every rule must be opinionated, specific, and enforceable.
25
22
 
26
- Your contribution MUST be opinionated, specific, and enforceable. We reject generic advice, externally anchored rules, and borrowed-pattern guidance that can become accidental style anchors.
23
+ ### Litmus Test
27
24
 
28
- ### The Litmus Test
29
25
  - Does your rule include concrete BANNED / REQUIRED boundaries?
30
- - Would an AI agent be able to enforce it without ambiguity?
26
+ - Would an AI agent enforce it without ambiguity?
31
27
  - Does it teach the reader WHY, not just WHAT?
32
28
 
33
29
  If all three are "yes", it belongs here.
34
30
 
35
31
  ---
36
32
 
37
- ## How to Add or Adjust Stack Strategy Signals (e.g., Python)
33
+ ## How to Edit Rules
38
34
 
39
- 1. Update relevant universal guidance in `.agent-context/rules/` (typing, validation, architecture constraints).
40
- 2. Add or adjust measurable stack evidence in `.agent-context/state/stack-research-snapshot.json`.
41
- 3. Update stack-facing wording in prompts or CLI output when behavior changes.
42
- 4. Run `npm run validate` to verify references and policy checks.
43
- 5. Open a PR.
35
+ All universal rules live in `AGENTS.md`. This is the single source of truth injected into every host via hooks.
36
+
37
+ 1. Edit `AGENTS.md`
38
+ 2. Run `npm test` to verify structure and size constraints
39
+ 3. Open a PR
40
+
41
+ Keep `AGENTS.md` under 8KB (~1,200 tokens). Every byte is injected on every session start across all hosts. Concise rules with high signal-to-noise ratio.
44
42
 
45
43
  ---
46
44
 
47
- ## How to Add or Adjust Structural Planning Guidance
45
+ ## How to Add a Skill
46
+
47
+ Skills are long-form workflows that users invoke on demand (not always-on). They don't count against the always-on token budget.
48
48
 
49
- 1. Update the planning guidance in `.agent-context/prompts/init-project.md` and related discovery guidance.
50
- 2. Update compiler/init behavior if generated project-context guidance or bootstrap flow changes.
51
- 3. Keep system boundaries, required docs, and validation boundaries explicit without silently recommending a framework from offline heuristics.
52
- 4. Run `npm run validate` and `npm test`.
53
- 5. Open a PR.
49
+ 1. Create `skills/<name>/SKILL.md` with frontmatter:
50
+ ```yaml
51
+ ---
52
+ name: asc-<name>
53
+ description: One-line description
54
+ ---
55
+ ```
56
+ 2. Create matching command files:
57
+ - `commands/<name>.md` (Claude Code format)
58
+ - `commands/<name>.toml` (Gemini format: `description` + `prompt` fields)
59
+ 3. If the skill should be available in OpenClaw, copy `SKILL.md` to `.openclaw/skills/<name>/SKILL.md`
60
+ 4. Run `npm test`
61
+ 5. Open a PR
54
62
 
55
63
  ---
56
64
 
57
- ## How to Add a New Rule
65
+ ## How to Add a Host Adapter
66
+
67
+ ### Plugin-tier hosts (hooks + skills + commands)
68
+
69
+ These hosts support full plugin systems. Create the host's manifest in its standard directory:
70
+
71
+ | Host | Manifest path | Format |
72
+ |------|--------------|--------|
73
+ | Claude Code | `.claude-plugin/plugin.json` | JSON: name, version, skills, commands, hooks |
74
+ | Codex CLI | `.codex-plugin/plugin.json` | JSON: name, skills, hooks, interface |
75
+ | Copilot CLI | `.github/plugin/plugin.json` | JSON |
76
+ | Devin | `.devin-plugin/plugin.json` | JSON minimal |
77
+ | Hermes | `plugin.yaml` + `__init__.py` | YAML + Python |
78
+ | OpenCode | `.opencode/plugins/agentic-senior-core.mjs` | JS module |
79
+
80
+ ### Instruction-tier hosts (single file copy)
81
+
82
+ These hosts read a rules file from a standard path. The adapter file contains the full `AGENTS.md` content with host-specific frontmatter.
83
+
84
+ | Host | Adapter path |
85
+ |------|-------------|
86
+ | Cursor | `.cursor/rules/agentic-senior-core.mdc` |
87
+ | Windsurf | `.windsurf/rules/agentic-senior-core.md` |
88
+ | Cline | `.clinerules/agentic-senior-core.md` |
89
+ | Copilot (VS Code) | `.github/copilot-instructions.md` |
90
+ | Kiro | `.kiro/steering/agentic-senior-core.md` |
58
91
 
59
- 1. Create `.agent-context/rules/<rule-name>.md`
60
- 2. Structure:
61
- - Opening quote (sets the tone)
62
- - Core principle (1-2 sentences)
63
- - BANNED / REQUIRED sections with enforceable boundaries
64
- - Decision tree or quick ruleset when it reduces ambiguity
65
- 3. Update `AGENTS.md` or `.agent-context/` as the source, then verify thin adapters with `npm run check:adapters`
66
- 4. Update `review-checklists/pr-checklist.md` when the rule is part of review scope
67
- 5. Validate and PR
92
+ After adding a new adapter:
93
+ 1. Add the file path to `package.json` `files` array
94
+ 2. Add the adapter to `lib/cli/commands/adapter.mjs` if it's instruction-tier
95
+ 3. Add a test assertion in `tests/adapter.test.mjs`
96
+ 4. Update `README.md` supported hosts table
97
+
98
+ ### Keeping adapter content aligned
99
+
100
+ All instruction-tier adapter files must contain the same rule content as `AGENTS.md`. When you update `AGENTS.md`, update all adapter files. The test suite validates that all adapter files exist.
68
101
 
69
102
  ---
70
103
 
71
104
  ## PR Process
72
105
 
73
106
  1. **Fork** the repository
74
- 2. **Branch** from `main`: `feat/add-python-stack` or `docs/fix-security-typo`
75
- 3. **Write** your content following the quality standard above
76
- 4. **Validate**: `npm run validate` must pass
77
- 5. **Commit** with Conventional Commits: `feat(stacks): add Python profile`
78
- 6. **Open PR** with:
79
- - What you added/changed
80
- - Why it matters
81
- - Which manifest files you updated
107
+ 2. **Branch** from `main`: `feat/add-hermes-adapter` or `fix/security-rule-typo`
108
+ 3. **Write** your content following the quality standard
109
+ 4. **Test**: `npm test` must pass
110
+ 5. **Commit** with Conventional Commits: `feat(adapters): add hermes plugin`
111
+ 6. **Open PR** with what you changed and why
82
112
 
83
113
  ---
84
114
 
85
115
  ## What We Don't Accept
86
116
 
87
- - Generic content that reads like it was auto-generated without thought
117
+ - Generic content that reads like auto-generated filler
88
118
  - Rules without concrete enforcement boundaries
89
- - Stack profiles for languages the author doesn't actually use in production
90
- - PRs that don't update the relevant source files, docs, validators, and checklists
119
+ - PRs that don't update tests for structural changes
91
120
 
92
121
  ---
93
122
 
@@ -95,30 +124,31 @@ If all three are "yes", it belongs here.
95
124
 
96
125
  The npm package is published under `@ryuenn3123`, while the GitHub repository is hosted under `fatidaprilian`.
97
126
 
98
- ### Architecture Boundaries
127
+ ### Architecture (v5.x)
99
128
 
100
- When contributing code to the CLI or the maintenance tools, respect the boundary between `lib/` and `scripts/`:
101
-
102
- - **`lib/`**: Contains the core CLI application logic. These files are executed by the package binary but are **never** copied into target user workspaces.
103
- - **`scripts/`**: Contains standalone tools (like validators, audits, and benchmarks) AND the MCP server (`scripts/mcp-server.mjs`). Code here must not depend on `lib/` because some scripts (like the MCP server) are copied directly to target workspaces where `lib/` does not exist.
129
+ ```
130
+ AGENTS.md <-- single source of truth for rules
131
+ hooks/session-start.js <-- injects AGENTS.md on session start (CommonJS)
132
+ hooks/subagent-start.js <-- injects AGENTS.md into subagents (CommonJS)
133
+ skills/*/SKILL.md <-- on-demand workflow guidance
134
+ commands/*.md <-- Claude Code commands
135
+ commands/*.toml <-- Gemini CLI commands
136
+ .claude-plugin/ <-- Claude Code plugin manifest
137
+ .codex-plugin/ <-- Codex CLI plugin manifest
138
+ .cursor/rules/ <-- Cursor adapter (instruction-tier)
139
+ .windsurf/rules/ <-- Windsurf adapter
140
+ lib/cli/commands/adapter.mjs <-- CLI adapter generator
141
+ tests/adapter.test.mjs <-- structure validation tests
142
+ ```
104
143
 
105
144
  ```bash
106
- # Clone
107
145
  git clone https://github.com/fatidaprilian/Agentic-Senior-Core.git
108
146
  cd Agentic-Senior-Core
109
-
110
- # Validate
111
- npm run validate
112
-
113
- # Clean ignored local reports/backups when the workspace gets noisy
114
- npm run clean:local
115
-
116
- # Test interactive CLI
117
- node ./bin/agentic-senior-core.js init /tmp/test-project
147
+ npm test
118
148
  ```
119
149
 
120
150
  ---
121
151
 
122
152
  ## Questions?
123
153
 
124
- Open an issue. Describe what you want to add and why. We'll help you shape it before you write 500 lines of documentation nobody asked for.
154
+ Open an issue. Describe what you want to add and why.
package/README.md CHANGED
@@ -2,13 +2,12 @@
2
2
 
3
3
  # Agentic-Senior-Core
4
4
 
5
- ### Change your AI Agent to code like a Staff Engineer, not a Junior.
5
+ ### Universal AI coding rules. Write code like a staff engineer, not a junior.
6
6
 
7
7
  [![License: MIT](https://img.shields.io/badge/License-MIT-blue.svg)](LICENSE)
8
8
  [![PRs Welcome](https://img.shields.io/badge/PRs-welcome-brightgreen.svg)](CONTRIBUTING.md)
9
9
 
10
- **Production-grade Rules Engine for AI coding agents.**
11
- Works with Cursor, Windsurf, GitHub Copilot, Claude Code, Gemini, and other LLM-powered IDE workflows.
10
+ **Install once. Works across all projects. Supports 16+ AI coding agents.**
12
11
 
13
12
  </div>
14
13
 
@@ -16,186 +15,236 @@ Works with Cursor, Windsurf, GitHub Copilot, Claude Code, Gemini, and other LLM-
16
15
 
17
16
  ## Install
18
17
 
18
+ ### Step 1: Install the package
19
+
19
20
  ```bash
20
- npx @ryuenn3123/agentic-senior-core init
21
+ npm install -g @ryuenn3123/agentic-senior-core
21
22
  ```
22
23
 
23
- Initializes `AGENTS.md`, native import bridges, checklists, policies, state files, and the lazy `.agent-context/` rule library. Token optimization and Compact Natural Mode are enabled by default.
24
+ ### Step 2: Set up for your AI tool
24
25
 
25
- Options:
26
- - Add `--mcp-template` to generate VS Code MCP workspace config.
27
- - Default init keeps MCP files opt-in.
28
- - Add `--no-token-optimize` only when you do not want ASCX command guidance enabled.
29
- - Add `--local-only` to ignore instructions (AGENTS.md, .agent-context/, and bridges) in .gitignore so they are not pushed to GitHub.
30
- - Local backup snapshots are written under `.agentic-backup/` and excluded from version control.
26
+ <details>
27
+ <summary><b>Claude Code</b> (terminal agent)</summary>
31
28
 
32
- ## Upgrade
29
+ Rules load automatically via plugin hooks. No per-project files needed.
33
30
 
34
31
  ```bash
35
- npx @ryuenn3123/agentic-senior-core upgrade --dry-run
36
- npx @ryuenn3123/agentic-senior-core upgrade --yes
32
+ claude plugin add fatidaprilian/Agentic-Senior-Core
37
33
  ```
38
34
 
39
- Preview changes with `--dry-run`, then apply with `--yes`. Upgrade prunes obsolete managed files by default; use `--no-prune` to keep them. User-owned files without Agentic markers are never overwritten.
35
+ After install, every Claude Code session injects the rules on startup -- including subagents.
40
36
 
41
- ---
37
+ </details>
42
38
 
43
- ## Core Commands
39
+ <details>
40
+ <summary><b>Codex CLI</b> (terminal agent)</summary>
44
41
 
45
- > [!NOTE]
46
- > To run commands directly without `npx` (e.g., `ascx` or `agentic-senior-core`), install the CLI globally: `npm install -g @ryuenn3123/agentic-senior-core`.
42
+ ```bash
43
+ codex plugins install agentic-senior-core
44
+ ```
47
45
 
48
- | Command | Purpose |
49
- |---------|---------|
50
- | `agentic-senior-core init` | Initialize the compact project guidance pack and native agent entrypoints |
51
- | `agentic-senior-core upgrade --dry-run` | Preview managed-surface upgrades |
52
- | `agentic-senior-core context "<request>" --json --file src/app/page.tsx` | Resolve request labels, rules, prompts, docs, file signals, budget status, and fallback status |
53
- | `ascx <command>` | Run a command through the local evidence-preserving output wrapper (safely falls back to passthrough if unsupported) |
54
- | `asc optimize status` | Check ASCX runtime token saver readiness |
55
- | `asc optimize doctor` | Diagnose ASCX availability, tee write safety, and compression conflicts |
56
- | `agentic-senior-core optimize --show` | Show token optimization state |
57
- | `agentic-senior-core mcp` | Start local MCP stdio runtime |
58
- | `npm run clean:local` | Remove ignored local reports, backups, benchmarks, and active-memory state |
46
+ Rules load automatically via plugin hooks on every session.
59
47
 
60
- `ascx` dynamically compresses supported commands with noisy output (e.g., builds, tests, searches, and git logs). Other commands, pipes, redirects, and unsupported shell shapes safely pass through without compression. Compressed output includes a structured footer with command, exit code, filter name, estimated token reduction, and a raw tee path when safety requires it.
48
+ </details>
61
49
 
62
- `asc` is a short alias for the main `agentic-senior-core` CLI. The doctor does not probe localhost services in this phase; `9router` status remains `not-checked`.
50
+ <details>
51
+ <summary><b>Gemini CLI</b> (terminal agent)</summary>
63
52
 
64
- ---
53
+ Auto-detected. Gemini CLI reads `gemini-extension.json` from the installed package and loads `AGENTS.md` as context. Commands available as `.toml` format (`/asc-refactor`, `/asc-review`, `/asc-audit`).
65
54
 
66
- ## What It Does
55
+ </details>
67
56
 
68
- A coding agent that has read every framework tutorial still ships junior-grade work because nothing in its training tells it which trade-off matters in your codebase. This pack is a small set of plain-language rules an agent loads only when the work scope calls for them. The rules are written as invariants and bad habits to reject, not as opinions about which framework is fashionable. You install it with one command, revert with a backup, and it does not depend on any IDE or LLM provider.
57
+ <details>
58
+ <summary><b>Copilot CLI</b> (terminal agent)</summary>
69
59
 
70
- ### How It Works
60
+ Plugin files ship at `.github/plugin/`. After global npm install, register the plugin per your Copilot CLI version. Rules inject via hooks on every session.
71
61
 
72
- 1. Agent reads `AGENTS.md` at the start of each session.
73
- 2. `AGENTS.md` activates the default triad: Adaptive Context for scoped rule selection, ASCX wrappers for supported noisy commands, and Compact Natural Mode for final replies.
74
- 3. For shell commands, the agent uses `ascx` wrappers that compress noisy output while preserving debugging evidence (exit codes, file paths, line numbers, root errors, truncation markers, and raw tee paths).
75
- 4. For final replies, the agent applies `.agent-context/prompts/compact-natural-mode.md` so answers stay concise without losing commands, paths, errors, assumptions, validation status, risks, or next actions.
76
- 5. Detailed rules live under `.agent-context/rules/` and load by scope: 21 rule files covering architecture, security, performance, testing, database, API, frontend, Docker, observability, resilience, migrations, background jobs, configuration, and versioning.
62
+ </details>
77
63
 
78
- ### Instruction Entrypoints
64
+ <details>
65
+ <summary><b>Cursor</b> (IDE)</summary>
79
66
 
80
- The canonical installed source is `AGENTS.md`.
67
+ Run from your project root:
81
68
 
82
- Default init and upgrade keep the project root compact:
83
- - `AGENTS.md`
84
- - `CLAUDE.md`
85
- - `GEMINI.md`
86
- - `.agent-context/`
69
+ ```bash
70
+ asc adapter --cursor
71
+ ```
87
72
 
88
- `CLAUDE.md` and `GEMINI.md` are native import bridges that load `AGENTS.md`. Detailed rules, prompts, checklists, policies, and state stay under `.agent-context/` and load by task scope.
73
+ This copies one file to `.cursor/rules/agentic-senior-core.mdc`. Cursor reads it automatically on every session. Repeat per project.
89
74
 
90
- Deprecated legacy files (`.instructions.md`, `.agent-instructions.md`, `.cursorrules`, `.windsurfrules`, tool-specific rule directories) are no longer generated. Upgrade prunes Agentic-managed copies while preserving user-owned files.
75
+ </details>
91
76
 
92
- ### Long-Term Stability
77
+ <details>
78
+ <summary><b>Windsurf</b> (IDE)</summary>
93
79
 
94
- Rules are written as invariants, outcomes, and freshness criteria, not as named patterns, library prescriptions, or magic-number thresholds. Where a rule cites a specific tool or threshold, the citation block carries a freshness anchor so the next maintainer knows when the technology references were last validated.
80
+ ```bash
81
+ asc adapter --windsurf
82
+ ```
95
83
 
96
- ---
84
+ Copies one file to `.windsurf/rules/agentic-senior-core.md`. Repeat per project.
97
85
 
98
- ## MCP Quick Setup (VS Code)
86
+ </details>
99
87
 
100
- 1. Generate workspace MCP config:
88
+ <details>
89
+ <summary><b>Cline</b> (VS Code extension)</summary>
101
90
 
102
91
  ```bash
103
- npx @ryuenn3123/agentic-senior-core init --mcp-template
92
+ asc adapter --cline
104
93
  ```
105
94
 
106
- 2. Open `MCP: Open Workspace Folder Configuration`.
107
- 3. Confirm `.vscode/mcp.json` points to `node ./scripts/mcp-server.mjs` with `cwd: ${workspaceFolder}`.
108
- 4. Trust and start the server in Chat Customizations > MCP Servers.
95
+ Copies one file to `.clinerules/agentic-senior-core.md`. Repeat per project.
109
96
 
110
- Optional: enable `chat.mcp.autoStart` (Experimental) for auto-restart when MCP config changes.
97
+ </details>
111
98
 
112
- If you see `Property $schema is not allowed`, keep `.vscode/mcp.json` without `$schema` and keep only `servers`.
99
+ <details>
100
+ <summary><b>GitHub Copilot</b> (VS Code extension)</summary>
113
101
 
114
- ---
102
+ ```bash
103
+ asc adapter --copilot
104
+ ```
115
105
 
116
- ## Design Direction
106
+ Copies one file to `.github/copilot-instructions.md`. Repeat per project.
117
107
 
118
- For UI, UX, layout, screen, Tailwind, frontend, or redesign work, the pack routes agents through a compact design bootstrap before code changes. The flow asks the agent to reject generic defaults, choose a concrete interaction anchor, record creative commitments, and write the result into `docs/DESIGN.md`. Existing projects read the real repository and docs first; fresh projects ask the agent to recommend the stack from current evidence instead of hardcoding a framework.
108
+ </details>
119
109
 
120
- See [docs/doc-index.md](docs/doc-index.md) for the full doc routing map.
110
+ <details>
111
+ <summary><b>Kiro</b> (IDE)</summary>
121
112
 
122
- ---
113
+ ```bash
114
+ asc adapter --kiro
115
+ ```
116
+
117
+ Copies one file to `.kiro/steering/agentic-senior-core.md`. Repeat per project.
118
+
119
+ </details>
123
120
 
124
- ## What's New
121
+ <details>
122
+ <summary><b>Devin / Hermes / OpenCode / OpenClaw / Antigravity</b></summary>
125
123
 
126
- ### v4.2
124
+ Plugin manifests ship in the npm package at their standard paths (`.devin-plugin/`, `plugin.yaml`, `.opencode/plugins/`, `.openclaw/skills/`, `.agents/`). After global npm install, each host auto-discovers or manually register per host docs.
127
125
 
128
- Adds `ascx` command wrapper to optimize token usage via high-signal adapters for `git status`, `git diff`, and `npm test` alongside the `Compact Natural Mode` response compression contract to reduce token overhead while retaining high-fidelity reasoning.
126
+ </details>
129
127
 
130
- ### v4.1
128
+ <details>
129
+ <summary><b>All IDE adapters at once</b></summary>
131
130
 
132
- Adds six backend rule files (`OBS-*`, `RES-*`, `MIG-*`, `JOB-*`, `CFG-*`, `VER-*`) and targeted refinements to `frontend-architecture.md`, `security.md`, `database-design.md`, and `api-docs.md`. See [CHANGELOG.md](CHANGELOG.md) for the full list.
131
+ ```bash
132
+ asc adapter --all
133
+ ```
133
134
 
134
- ### v4.0
135
+ Generates adapter files for Cursor, Windsurf, Cline, Copilot, and Kiro in one go.
135
136
 
136
- Numbered Markdown rules with stable section IDs, bounded reflection, provider-free anti-halu benchmark, three-layer prompt caching contract, and per-integration caching scope enforcement. Caching numbers are scoped per integration; IDE wrapper integrations receive prefix stability without a measurable per-pack saving. See [docs/benchmark-reference.md](docs/benchmark-reference.md) for the reporting format and [CHANGELOG.md](CHANGELOG.md) for details.
137
+ </details>
137
138
 
138
- Current package version: 4.3.3. Last published version: 4.3.2.
139
+ **Terminal agents** (Claude Code, Codex, Gemini, Copilot CLI) = install once, always-on, zero per-project files.
140
+ **IDE agents** (Cursor, Windsurf, Cline, Copilot VS Code, Kiro) = one file per project via `asc adapter`.
139
141
 
140
142
  ---
141
143
 
142
- ## Validation
144
+ ## What It Does
143
145
 
144
- ```bash
145
- npm run validate
146
- npm test
147
- npm run gate:release
148
- npm run benchmark:ascx
149
- ```
146
+ AI coding agents over-build by default. Ask for a date picker, the agent installs a library, writes a wrapper component, adds a stylesheet, and opens a timezone discussion.
147
+
148
+ This plugin loads universal engineering rules on every session. Before writing any code, the agent runs a decision ladder:
149
+
150
+ 1. Does this need to be built at all?
151
+ 2. Does the codebase already have this?
152
+ 3. Does the stdlib or a native platform feature cover it?
153
+ 4. Does an already-installed dependency solve it?
154
+ 5. Can this be one straightforward function?
155
+ 6. Only then: write the minimum code that works.
156
+
157
+ The rules also cover security, architecture, testing, error handling, API design, database safety, frontend accessibility, infrastructure, resilience, and async patterns. All universal invariants -- no project-specific configuration needed.
158
+
159
+ ### Not lazy about
160
+
161
+ Input validation at trust boundaries, parameterized queries, auth checks, error handling that prevents data loss, accessibility, anything explicitly requested. These are never skipped.
162
+
163
+ ---
164
+
165
+ ## Supported Hosts
166
+
167
+ | Host | Type | Install | Per-project files? |
168
+ |------|------|---------|-------------------|
169
+ | Claude Code | Terminal agent | `claude plugin add` | No |
170
+ | Codex CLI | Terminal agent | `codex plugins install` | No |
171
+ | Gemini CLI | Terminal agent | Auto-detected | No |
172
+ | Copilot CLI | Terminal agent | Plugin registration | No |
173
+ | Devin | Terminal agent | Auto-detected | No |
174
+ | Hermes | Terminal agent | Plugin registration | No |
175
+ | OpenCode | Terminal agent | Auto-detected | No |
176
+ | OpenClaw | Terminal agent | Auto-detected | No |
177
+ | Antigravity | Terminal agent | Auto-detected | No |
178
+ | Cursor | IDE | `asc adapter --cursor` | Yes (1 file) |
179
+ | Windsurf | IDE | `asc adapter --windsurf` | Yes (1 file) |
180
+ | Cline | VS Code ext | `asc adapter --cline` | Yes (1 file) |
181
+ | GitHub Copilot | VS Code ext | `asc adapter --copilot` | Yes (1 file) |
182
+ | Kiro | IDE | `asc adapter --kiro` | Yes (1 file) |
150
183
 
151
184
  ---
152
185
 
153
- ## Reference Docs
186
+ ## Commands
154
187
 
155
- - FAQ: docs/faq.md
156
- - Deep dive internals: docs/deep-dive.md
157
- - Deep analysis and roadmap: docs/deep-analysis-and-roadmap-backlog.md
158
- - Integration playbook: docs/integration-playbook.md
159
- - Benchmark and stack reference: docs/benchmark-reference.md
160
- - Project history: docs/archive/HISTORY.md
188
+ Available on plugin hosts (Claude Code, Codex, Gemini CLI):
189
+
190
+ | Command | Purpose |
191
+ |---------|---------|
192
+ | `/asc-refactor` | Structured refactoring workflow |
193
+ | `/asc-review` | Production-risk code review with severity-ordered findings |
194
+ | `/asc-audit` | Security and architecture audit |
195
+ | `/asc-help` | Show available commands |
161
196
 
162
197
  ---
163
198
 
164
- ## Release and npm Publish Flow
199
+ ## CLI
200
+
201
+ ```bash
202
+ asc adapter [--cursor|--windsurf|--cline|--copilot|--kiro|--all]
203
+ asc clean [--dry-run]
204
+ asc status
205
+ asc mcp
206
+ asc --version
207
+ asc --help
208
+ ```
165
209
 
166
- This repository publishes to npm through GitHub Actions on push to `main`.
210
+ `ascx` is a token-saving command wrapper that compresses noisy output while preserving debugging evidence. Install globally and use as: `ascx git status`, `ascx npm test`.
167
211
 
168
- Release checklist:
212
+ ---
169
213
 
170
- 1. Run `node scripts/bump-version.mjs <version>`.
171
- 2. Fill the matching release notes in `CHANGELOG.md`.
172
- 3. Run `npm run check:adapters`, `npm run validate`, `npm test`, `npm run gate:release`, and `git diff --check`.
173
- 4. Commit with a Conventional Commit message.
174
- 5. Push to `origin/main`.
214
+ ## Works With Other Plugins
175
215
 
176
- Package scope: `@ryuenn3123`. GitHub owner: `fatidaprilian`.
216
+ ASC covers universal engineering standards (security, architecture, testing, API design, database safety). It is complementary to:
217
+
218
+ - **ponytail** -- YAGNI minimalism and code reduction
219
+ - **awesome-cursorrules** -- Framework-specific context and stack declarations
220
+
221
+ Use them together. No conflicts.
177
222
 
178
223
  ---
179
224
 
180
- ## Terminology Mapping (Final)
225
+ ## Migration from v4.x
181
226
 
182
- | Canonical Term | Developer-Facing Alias | Usage Rule |
183
- |----------------|------------------------|------------|
184
- | Federated Governance | Federated Rules Operations | Use canonical term in formal policy artifacts. |
185
- | Governance Engine | Rules Engine | Use alias in onboarding and day-to-day developer docs. |
186
- | Guardrails | Quality Checks | Use alias in implementation guidance and quickstart docs. |
227
+ v5.0 is a breaking change. The per-project system (`.agent-context/`, bridge files, project scaffolding) is replaced by the universal plugin system.
187
228
 
188
- Rule: on first mention in developer-facing docs, include canonical term in parentheses.
229
+ Clean up v4 artifacts from any project:
230
+ ```bash
231
+ # Preview what will be removed
232
+ asc clean --dry-run
189
233
 
190
- Examples:
191
- - `Federated Rules Operations (Federated Governance)`
192
- - `Rules Engine (Governance Engine)`
193
- - `quality checks (guardrails)`
234
+ # Remove v4 files (.agent-context/, AGENTS.md, CLAUDE.md, GEMINI.md, etc.)
235
+ asc clean
236
+ ```
194
237
 
195
- Compliance boundary: formal policy and audit artifacts must keep canonical terminology for operational traceability.
238
+ This removes `.agent-context/`, `AGENTS.md`, `CLAUDE.md`, `GEMINI.md`, and other v4 bridge files from the current project directory. The global plugin replaces all of them.
196
239
 
197
240
  ---
198
241
 
199
- ## License
242
+ ## Token Budget
243
+
244
+ | Component | Tokens | When loaded |
245
+ |-----------|--------|------------|
246
+ | Rules (`AGENTS.md`) | ~1,200 | Every session + every subagent |
247
+ | Each skill | ~500-800 | On user invocation only |
248
+ | Commands | 0 | Metadata only |
200
249
 
201
- MIT - Use freely, enforce strictly.
250
+ Total always-on cost: ~1,200 tokens per session.
package/__init__.py ADDED
@@ -0,0 +1,61 @@
1
+ """Hermes plugin for Agentic Senior Core."""
2
+
3
+ from __future__ import annotations
4
+
5
+ import os
6
+ from pathlib import Path
7
+ from typing import Any
8
+
9
+ ROOT = Path(__file__).resolve().parent
10
+ SKILLS_DIR = ROOT / "skills"
11
+ AGENTS_MD = ROOT / "AGENTS.md"
12
+
13
+ SKILL_COMMANDS = {
14
+ "asc-refactor": "Structured refactoring workflow with pre-checks and validation.",
15
+ "asc-review": "Production-risk code review with severity-ordered findings.",
16
+ "asc-audit": "Security and architecture audit.",
17
+ "asc-help": "Show available ASC commands.",
18
+ }
19
+
20
+
21
+ def _read_agents_md() -> str:
22
+ try:
23
+ return AGENTS_MD.read_text(encoding="utf-8")
24
+ except OSError:
25
+ return ""
26
+
27
+
28
+ def _pre_llm_call(**_: Any) -> dict[str, str] | None:
29
+ content = _read_agents_md()
30
+ return {"context": content} if content else None
31
+
32
+
33
+ def _make_skill_handler(ctx: Any, command: str):
34
+ def handler(raw_args: str) -> str:
35
+ prompt = f"Load and follow the skill `asc:{command}`. {SKILL_COMMANDS[command]}"
36
+ if raw_args and raw_args.strip():
37
+ prompt += f"\n\nUser arguments: {raw_args.strip()}"
38
+ try:
39
+ if ctx.inject_message(prompt):
40
+ return f"Queued `{command}` for the agent."
41
+ except Exception:
42
+ pass
43
+ return prompt
44
+ return handler
45
+
46
+
47
+ def register(ctx: Any) -> None:
48
+ for child in sorted(SKILLS_DIR.iterdir() if SKILLS_DIR.exists() else []):
49
+ skill_md = child / "SKILL.md"
50
+ if child.is_dir() and skill_md.exists():
51
+ ctx.register_skill(child.name, skill_md)
52
+
53
+ ctx.register_hook("pre_llm_call", _pre_llm_call)
54
+
55
+ for command, description in SKILL_COMMANDS.items():
56
+ ctx.register_command(
57
+ command,
58
+ _make_skill_handler(ctx, command),
59
+ description=description,
60
+ args_hint="[target or notes]",
61
+ )