@ryuenn3123/agentic-senior-core 4.4.0 → 5.2.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 (201) hide show
  1. package/.agents/plugins/agentic-senior-core/plugin.json +3 -0
  2. package/.agents/plugins/agentic-senior-core/rules/agentic-senior-core.md +131 -0
  3. package/.agents/plugins/agentic-senior-core/skills/asc/SKILL.md +16 -0
  4. package/.agents/plugins/agentic-senior-core/skills/asc-audit/SKILL.md +28 -0
  5. package/.agents/plugins/agentic-senior-core/skills/asc-refactor/SKILL.md +35 -0
  6. package/.agents/plugins/agentic-senior-core/skills/asc-review/SKILL.md +54 -0
  7. package/.agents/rules/agentic-senior-core.md +131 -0
  8. package/.claude-plugin/marketplace.json +17 -0
  9. package/.claude-plugin/plugin.json +17 -0
  10. package/.clinerules/agentic-senior-core.md +94 -0
  11. package/.codex-plugin/plugin.json +24 -0
  12. package/.cursor/rules/agentic-senior-core.mdc +99 -0
  13. package/.devin-plugin/plugin.json +13 -0
  14. package/.github/copilot-instructions.md +94 -0
  15. package/.github/plugin/marketplace.json +20 -0
  16. package/.github/plugin/plugin.json +16 -0
  17. package/.kiro/steering/agentic-senior-core.md +94 -0
  18. package/.openclaw/skills/asc/SKILL.md +23 -0
  19. package/.openclaw/skills/asc-audit/SKILL.md +28 -0
  20. package/.openclaw/skills/asc-review/SKILL.md +54 -0
  21. package/.opencode/plugins/agentic-senior-core.mjs +31 -0
  22. package/.windsurf/rules/agentic-senior-core.md +94 -0
  23. package/AGENTS.md +126 -127
  24. package/CONTRIBUTING.md +93 -63
  25. package/README.md +190 -110
  26. package/__init__.py +61 -0
  27. package/bin/agentic-senior-core.js +42 -41
  28. package/commands/asc-audit.md +1 -0
  29. package/commands/asc-audit.toml +2 -0
  30. package/commands/asc-help.md +9 -0
  31. package/commands/asc-help.toml +2 -0
  32. package/commands/asc-refactor.md +1 -0
  33. package/commands/asc-refactor.toml +2 -0
  34. package/commands/asc-review.md +1 -0
  35. package/commands/asc-review.toml +2 -0
  36. package/gemini-extension.json +10 -0
  37. package/hooks/copilot-hooks.json +21 -0
  38. package/hooks/hooks.json +31 -0
  39. package/hooks/session-start.js +36 -0
  40. package/hooks/subagent-start.js +38 -0
  41. package/lib/cli/commands/adapter.mjs +109 -0
  42. package/lib/cli/commands/clean.mjs +63 -0
  43. package/lib/cli/commands/status.mjs +94 -0
  44. package/package.json +43 -60
  45. package/plugin.yaml +16 -0
  46. package/scripts/uninstall.js +38 -0
  47. package/skills/asc/SKILL.md +16 -0
  48. package/skills/asc-audit/SKILL.md +28 -0
  49. package/skills/asc-refactor/SKILL.md +35 -0
  50. package/skills/asc-review/SKILL.md +54 -0
  51. package/.agent-context/policies/llm-judge-threshold.json +0 -29
  52. package/.agent-context/prompts/bootstrap-design.md +0 -63
  53. package/.agent-context/prompts/compact-natural-mode.md +0 -100
  54. package/.agent-context/prompts/init-project.md +0 -60
  55. package/.agent-context/prompts/refactor.md +0 -38
  56. package/.agent-context/prompts/review-code.md +0 -31
  57. package/.agent-context/review-checklists/architecture-review.md +0 -57
  58. package/.agent-context/review-checklists/pr-checklist.md +0 -134
  59. package/.agent-context/rules/api-docs.md +0 -24
  60. package/.agent-context/rules/api-versioning.md +0 -16
  61. package/.agent-context/rules/architecture.md +0 -38
  62. package/.agent-context/rules/background-jobs.md +0 -17
  63. package/.agent-context/rules/config-and-flags.md +0 -16
  64. package/.agent-context/rules/database-design.md +0 -18
  65. package/.agent-context/rules/docker-runtime.md +0 -17
  66. package/.agent-context/rules/error-handling.md +0 -16
  67. package/.agent-context/rules/event-driven.md +0 -16
  68. package/.agent-context/rules/frontend-architecture.md +0 -54
  69. package/.agent-context/rules/microservices.md +0 -16
  70. package/.agent-context/rules/migrations.md +0 -16
  71. package/.agent-context/rules/observability.md +0 -16
  72. package/.agent-context/rules/performance.md +0 -16
  73. package/.agent-context/rules/realtime.md +0 -16
  74. package/.agent-context/rules/resilience.md +0 -18
  75. package/.agent-context/rules/security.md +0 -18
  76. package/.agent-context/rules/testing.md +0 -16
  77. package/.agent-context/state/README.md +0 -25
  78. package/.agent-context/state/architecture-map.md +0 -40
  79. package/.agent-context/state/benchmark-comparison-schema.json +0 -181
  80. package/.agent-context/state/benchmark-reproducibility.json +0 -87
  81. package/.agent-context/state/benchmark-thresholds.json +0 -10
  82. package/.agent-context/state/benchmark-writer-judge-config.json +0 -58
  83. package/.agent-context/state/dependency-map.md +0 -41
  84. package/.agent-context/state/memory-adapter-contract.json +0 -52
  85. package/.agent-context/state/memory-schema-v1.json +0 -88
  86. package/GEMINI.md +0 -1
  87. package/benchmarks/README.md +0 -60
  88. package/benchmarks/compact-natural-mode/fixtures.mjs +0 -359
  89. package/benchmarks/compact-natural-mode/scorer.mjs +0 -331
  90. package/benchmarks/runtime-token-saver/fixtures.mjs +0 -836
  91. package/lib/cli/adaptive-context/catalog.mjs +0 -394
  92. package/lib/cli/adaptive-context/file-signals.mjs +0 -100
  93. package/lib/cli/adaptive-context/implications.mjs +0 -44
  94. package/lib/cli/adaptive-context.mjs +0 -151
  95. package/lib/cli/audits/typography-palette-anti-repeat/color-utils.mjs +0 -156
  96. package/lib/cli/audits/typography-palette-anti-repeat/file-scanner.mjs +0 -103
  97. package/lib/cli/audits/typography-palette-anti-repeat/typography-utils.mjs +0 -70
  98. package/lib/cli/backup.mjs +0 -210
  99. package/lib/cli/commands/context.mjs +0 -140
  100. package/lib/cli/commands/init/project-context.mjs +0 -60
  101. package/lib/cli/commands/init/runtime-environment.mjs +0 -59
  102. package/lib/cli/commands/init/setup-decisions.mjs +0 -83
  103. package/lib/cli/commands/init.mjs +0 -654
  104. package/lib/cli/commands/launch.mjs +0 -76
  105. package/lib/cli/commands/optimize.mjs +0 -284
  106. package/lib/cli/commands/rollback.mjs +0 -64
  107. package/lib/cli/commands/upgrade/token-optimization-state.mjs +0 -51
  108. package/lib/cli/commands/upgrade.mjs +0 -451
  109. package/lib/cli/compiler.mjs +0 -187
  110. package/lib/cli/constants.mjs +0 -136
  111. package/lib/cli/detector/constants.mjs +0 -135
  112. package/lib/cli/detector/design-evidence/collector.mjs +0 -256
  113. package/lib/cli/detector/design-evidence/constants.mjs +0 -39
  114. package/lib/cli/detector/design-evidence/file-traversal.mjs +0 -83
  115. package/lib/cli/detector/design-evidence/structured-attribute-evidence.mjs +0 -117
  116. package/lib/cli/detector/design-evidence/summary.mjs +0 -109
  117. package/lib/cli/detector/design-evidence/utility-helpers.mjs +0 -122
  118. package/lib/cli/detector/design-evidence.mjs +0 -25
  119. package/lib/cli/detector/stack-detection.mjs +0 -243
  120. package/lib/cli/detector/ui-signals.mjs +0 -150
  121. package/lib/cli/detector/workspace-scan.mjs +0 -177
  122. package/lib/cli/detector.mjs +0 -23
  123. package/lib/cli/init-detection-flow.mjs +0 -48
  124. package/lib/cli/init-options.mjs +0 -237
  125. package/lib/cli/init-selection.mjs +0 -29
  126. package/lib/cli/memory-continuity.mjs +0 -537
  127. package/lib/cli/preflight.mjs +0 -76
  128. package/lib/cli/project-scaffolder/constants.mjs +0 -69
  129. package/lib/cli/project-scaffolder/discovery.mjs +0 -272
  130. package/lib/cli/project-scaffolder/prompt-builders.mjs +0 -171
  131. package/lib/cli/project-scaffolder/storage.mjs +0 -144
  132. package/lib/cli/project-scaffolder/ui-scope-detection.mjs +0 -36
  133. package/lib/cli/project-scaffolder.mjs +0 -29
  134. package/lib/cli/rollback.mjs +0 -66
  135. package/lib/cli/token-optimization.mjs +0 -401
  136. package/lib/cli/utils/filesystem.mjs +0 -81
  137. package/lib/cli/utils/managed-surface.mjs +0 -280
  138. package/lib/cli/utils/prompting.mjs +0 -44
  139. package/lib/cli/utils.mjs +0 -479
  140. package/mcp.json +0 -134
  141. package/scripts/adaptive-context/fixtures.mjs +0 -183
  142. package/scripts/adaptive-context-benchmark.mjs +0 -9
  143. package/scripts/ascx-runtime-token-saver-benchmark.mjs +0 -9
  144. package/scripts/benchmark-evidence-bundle.mjs +0 -645
  145. package/scripts/benchmark-gate.mjs +0 -121
  146. package/scripts/benchmark-intelligence.mjs +0 -33
  147. package/scripts/benchmark-writer-judge-matrix.mjs +0 -379
  148. package/scripts/build-release-benchmark-bundle.mjs +0 -202
  149. package/scripts/bump-version.mjs +0 -103
  150. package/scripts/clean-local-artifacts.mjs +0 -78
  151. package/scripts/compact-natural-mode-benchmark.mjs +0 -9
  152. package/scripts/context-triggered-audit.mjs +0 -391
  153. package/scripts/detection-benchmark.mjs +0 -127
  154. package/scripts/docs-quality-drift-report.mjs +0 -358
  155. package/scripts/documentation-boundary-audit.mjs +0 -305
  156. package/scripts/explain-on-demand-audit.mjs +0 -427
  157. package/scripts/forbidden-content-check.mjs +0 -123
  158. package/scripts/frontend-usability-audit.mjs +0 -243
  159. package/scripts/generate-sbom.mjs +0 -61
  160. package/scripts/governance-weekly-report.mjs +0 -466
  161. package/scripts/llm-judge/checklist-loader.mjs +0 -45
  162. package/scripts/llm-judge/constants.mjs +0 -66
  163. package/scripts/llm-judge/diff-collection.mjs +0 -74
  164. package/scripts/llm-judge/prompting.mjs +0 -78
  165. package/scripts/llm-judge/providers.mjs +0 -111
  166. package/scripts/llm-judge/verdict.mjs +0 -134
  167. package/scripts/llm-judge.mjs +0 -200
  168. package/scripts/memory-continuity-benchmark.mjs +0 -322
  169. package/scripts/quality-trend-report.mjs +0 -289
  170. package/scripts/release-gate/audit-checks.mjs +0 -441
  171. package/scripts/release-gate/constants.mjs +0 -53
  172. package/scripts/release-gate/runtime.mjs +0 -63
  173. package/scripts/release-gate/static-checks.mjs +0 -182
  174. package/scripts/release-gate.mjs +0 -42
  175. package/scripts/rules-guardian-audit.mjs +0 -580
  176. package/scripts/single-source-lazy-loading-audit.mjs +0 -449
  177. package/scripts/sync-thin-adapters.mjs +0 -72
  178. package/scripts/token-optimization-benchmark.mjs +0 -252
  179. package/scripts/ui-design-judge/constants.mjs +0 -13
  180. package/scripts/ui-design-judge/design-execution-summary.mjs +0 -81
  181. package/scripts/ui-design-judge/git-input.mjs +0 -134
  182. package/scripts/ui-design-judge/prompting.mjs +0 -52
  183. package/scripts/ui-design-judge/providers.mjs +0 -102
  184. package/scripts/ui-design-judge/reporting.mjs +0 -183
  185. package/scripts/ui-design-judge/rubric-calibration.mjs +0 -214
  186. package/scripts/ui-design-judge/rubric-goldset.json +0 -188
  187. package/scripts/ui-design-judge.mjs +0 -319
  188. package/scripts/ui-rubric-calibration.mjs +0 -35
  189. package/scripts/validate/audits/cache-layer-contract.mjs +0 -230
  190. package/scripts/validate/audits/caching-scope-hygiene.mjs +0 -235
  191. package/scripts/validate/audits/file-size.mjs +0 -158
  192. package/scripts/validate/audits/reflection-citations.mjs +0 -130
  193. package/scripts/validate/audits/release-bundle.mjs +0 -135
  194. package/scripts/validate/audits/rule-id-uniqueness.mjs +0 -278
  195. package/scripts/validate/config.mjs +0 -501
  196. package/scripts/validate/coverage-checks.mjs +0 -446
  197. package/scripts/validate/file-structure.mjs +0 -158
  198. package/scripts/validate/markdown-content.mjs +0 -109
  199. package/scripts/validate/project-metadata.mjs +0 -166
  200. package/scripts/validate/utils.mjs +0 -52
  201. package/scripts/validate.mjs +0 -267
package/AGENTS.md CHANGED
@@ -1,127 +1,126 @@
1
- # Agentic-Senior-Core: Unified AI Agent Instructions
2
-
3
- Canonical project instructions. Resolve the smallest relevant layer set for the current request.
4
-
5
- ## Role
6
- Act as Principal Engineer. Ship maintainable, validated, production-ready work. Use plain English. No emoji.
7
-
8
- ## Authority
9
- Strict instruction contract. `AGENTS.md` is canonical baseline. `.agent-context/` is technical authority for rules/prompts/state. Follow stricter `.agent-context/` rules; if refusing, cite rule ID (`ARCH-001`). Use `README.md` for public overview.
10
-
11
- Imperative gates:
12
- - Direct commands.
13
- - Short mechanical checks.
14
- - Thin root adapters.
15
- - Detailed policy in `.agent-context/`.
16
-
17
- ## MANDATORY FIRST STEP: Context Activation
18
- STOP. Before non-trivial tasks, MUST run `agentic-senior-core context "<task_description>"`. Do not guess context.
19
-
20
- Immediately emit concise Bootstrap Receipt:
21
- - `loaded_files`: read paths
22
- - `selected_rules`: selected files & why
23
- - `skipped_rules`: out-of-scope
24
- - `unreachable_files`: missing required
25
- - `validation_plan`: expected checks
26
-
27
- Skip ONLY for trivial tasks (version bumps, typos).
28
-
29
- ## Command Economy
30
- Use noisy forms: `ascx git status`, `ascx git diff`, `ascx npm test`. Raw commands only for pipes/unsupported. Apply `compact-natural-mode.md` for replies; reference tee paths when truncated.
31
-
32
- ## Layer Index
33
-
34
- ### Layer 1: Rules (18 Files) [SCOPE-RESOLVED]
35
- Location: `.agent-context/rules/`. Load only relevant files.
36
- Available: `architecture.md`, `security.md`, `performance.md`, `error-handling.md`, `testing.md`, `api-docs.md`, `microservices.md`, `event-driven.md`, `database-design.md`, `realtime.md`, `frontend-architecture.md`, `docker-runtime.md`, `observability.md`, `resilience.md`, `migrations.md`, `background-jobs.md`, `config-and-flags.md`, `api-versioning.md`.
37
-
38
- For Docker or Compose work, load `docker-runtime.md` and verify the latest official Docker docs before authoring container assets. Also perform live web research for Docker and framework/package setup claims.
39
- For framework/package setup work, use the latest stable compatible dependency set and official setup flow unless constrained. New dependencies allowed to improve efficiency.
40
-
41
- Backend routing:
42
- - Data: `architecture.md`, `database-design.md`, `migrations.md`, `performance.md`, `testing.md`
43
- - Endpoint: `architecture.md`, `api-docs.md`, `api-versioning.md`, `error-handling.md`, `observability.md`, `security.md`, `testing.md`
44
- - Auth: `security.md`, `config-and-flags.md`, `error-handling.md`, `observability.md`, `testing.md`
45
- - Worker: `event-driven.md`, `background-jobs.md`, `resilience.md`, `database-design.md`, `error-handling.md`, `observability.md`, `performance.md`, `testing.md`
46
- - Distributed: `microservices.md`, `event-driven.md`, `database-design.md`, `api-docs.md`, `architecture.md`, `resilience.md`, `observability.md`, `performance.md`
47
-
48
- ### Layer 2: Runtime Decision Signals
49
- Runtime signals are evidence gates, not style cues. Recommend runtime/framework from brief and live official docs before coding. Treat existing project markers as evidence. Do not blindly default to familiar web stacks. Extract constraints and required docs first. Do not silently choose frameworks or architecture from offline heuristics. Ignore pattern frequency. If unresolved, produce a short recommendation from evidence and live official documentation before coding.
50
-
51
- ### Layer 3: Structural Planning Signals
52
- Use dynamic structural planning from repo context. Structural planning signals are not a hard whitelist.
53
-
54
- ### Layer 4: Execution Contracts
55
- Enforce dynamic execution contracts from active prompt, checklists, and policies before declaring completion.
56
-
57
- ### Layer 5: Prompts
58
- Location: `.agent-context/prompts/`. Load matching prompt + `compact-natural-mode.md`:
59
- - `init-project.md`: create, scaffold
60
- - `refactor.md`: improve, fix
61
- - `review-code.md`: audit, analyze
62
- - `bootstrap-design.md`: ui, ux, layout, screen, tailwind, frontend, redesign
63
-
64
- For UI work, load `bootstrap-design.md` and `frontend-architecture.md` first; do not eagerly load unrelated backend-only rules. The valid style context is current repo evidence. External references, prior-chat memory, unrelated-project visuals, and remembered screenshots are tainted. Treat WCAG 2.2 AA as the hard compliance floor and APCA as advisory perceptual tuning only.
65
-
66
- ### Layer 6: Governance Modes
67
- Use dynamic governance context. Apply matching defaults.
68
-
69
- ### Layer 7: State
70
- Use `.agent-context/state/` for continuity/benchmarks. Use `onboarding-report.json`.
71
-
72
- ### Layer 8: Policies
73
- Use `.agent-context/policies/` for quality gates. Apply matching defaults.
74
-
75
- ### Layer 9: Project Context
76
- Use root `README.md` as the public and developer entrypoint. Use `docs/doc-index.md` as the compact routing map.
77
-
78
- ## Mandatory Triggers
79
-
80
- ### 1. Documentation-First Mode
81
- Trigger: docs, documentation, dokumen, `docs/*`, architecture docs, flow docs, API docs, "lengkapkan docs".
82
- 1. Load `architecture.md`, `api-docs.md`, plus scope rules.
83
- 2. Create or refine required docs first: root `README.md` for every fresh or existing project; `docs/doc-index.md` whenever `docs/` exists; `docs/project-brief.md`; `docs/architecture-decision-record.md`; `docs/flow-overview.md`; `docs/api-contract.md`; `docs/database-schema.md`; `docs/DESIGN.md`.
84
- 3. Use Mermaid.js as the default diagram format. Convert prose to diagrams where relevant.
85
- 4. Use `docs/doc-index.md` as routing map. Write formal project docs in English by default.
86
- 5. Stop after documentation when the user only asked for docs. Do not write application, firmware, or UI code until the user asks or approves implementation; do not write application, firmware, or UI code before approval.
87
-
88
- ### 2. New Project Planning
89
- Trigger: create, build, new project, scaffold.
90
- Resolve rules -> Read `init-project.md` -> Infer constraints -> Recommend runtime -> WAIT for user approval.
91
-
92
- ### 3. Refactor Mode
93
- Trigger: refactor, improve, fix, clean up.
94
- Resolve rules -> Read `refactor.md` -> Apply contracts -> Propose plan -> WAIT for user approval.
95
-
96
- ### 4. Code Review Mode
97
- Trigger: review, audit, check, analyze.
98
- Load `pr-checklist.md`, `architecture-review.md`. Report defects first.
99
-
100
- ### 5. UI Design Mode
101
- Trigger: ui, ux, layout, screen, tailwind, frontend, redesign.
102
- 1. Read `bootstrap-design.md`, `frontend-architecture.md`, repo UI evidence.
103
- 2. Follow `bootstrap-design.md` three-step direction process: name defaults, choose anchor, commit to creative direction. Check anti-repeat ledger in DESIGN.md.
104
- 3. Refine `docs/DESIGN.md` before UI implementation.
105
- 4. Do not copy layout rhythm/palette from external references blindly.
106
-
107
- ## Bounded Reflection
108
- For risky actions, use:
109
- ```text
110
- REFLECTION
111
- Rules: ARCH-001, TEST-001
112
- Risk: one-line risk
113
- Action: one-line bounded step
114
- ```
115
- Use valid rule IDs only. Do not expose hidden chain-of-thought.
116
-
117
- ## Definition of Done
118
- 1. Relevant rules applied.
119
- 2. PR/architecture checklists considered.
120
- 3. Universal SOP gates satisfied: root `README.md`; `docs/doc-index.md` when `docs/` exists; `docs/project-brief.md`; `docs/architecture-decision-record.md`; `docs/flow-overview.md`; `docs/database-schema.md`; `docs/api-contract.md`; `docs/DESIGN.md`.
121
- 4. Refresh `.agent-context/state/active-memory.json`.
122
- 5. `npm run validate` passed.
123
-
124
- ## Operations
125
- - Verify Layer 1-9 reachability before code.
126
- - Branch from main (`feat/`, `fix/`, `docs/`, `chore/`). Squash merge PRs.
127
- - Never touch `.agentic-backup/`. Update `package-lock.json` via `ascx npm install`. Regenerate benchmarks via scripts.
1
+ # Agentic Senior Core
2
+
3
+ You write code like a staff engineer. Efficient, safe, maintainable.
4
+ The best code is the code never written. Write only what the task needs.
5
+
6
+ Before writing any code, stop at the first step that holds:
7
+
8
+ 1. Does this need to be built at all?
9
+ 2. Does the codebase already have this? Reuse it.
10
+ 3. Does the standard library or a native platform feature cover it? Use it.
11
+ 4. Does an already-installed dependency solve it? Use it.
12
+ 5. Can this be one straightforward function? Write it.
13
+ 6. Only then: write the minimum code that works.
14
+
15
+ ## Code Quality
16
+
17
+ - Descriptive variable and function names. No cryptic abbreviations.
18
+ - Early returns over deep nesting. Keep the main flow traceable.
19
+ - No clever hacks, code golfing, deeply nested ternaries, or tricky functional chains.
20
+ - No premature abstraction. Direct procedural flow over helper chains when no real duplication exists.
21
+ - Delete code that carries no behavior, safety, or test value.
22
+ - Plain English in documentation. No emoji in formal docs or review summaries.
23
+
24
+ ## Architecture
25
+
26
+ - Explicit module boundaries. Group by feature or domain.
27
+ - No custom crypto, state management, or routing when standard libraries exist.
28
+ - Controllers handle protocol translation only. Business logic belongs in services.
29
+ - Default to modular monolith unless scale evidence demands microservices.
30
+ - Direction changes require explicit user confirmation.
31
+ - Do not choose framework by habit. Match project evidence and needs.
32
+
33
+ ## Security (never skip)
34
+
35
+ - Validate and normalize ALL inputs at trust boundaries: body, query, params, headers, cookies, uploads, webhooks, job payloads.
36
+ - Parameterize all queries. Never interpolate input into SQL or shell commands.
37
+ - Hash passwords with Argon2 or bcrypt. Never store plaintext or use MD5/SHA for passwords.
38
+ - Never commit secrets, tokens, or credentials. Inject via environment variables.
39
+ - Enforce resource-level authorization, not just authentication.
40
+ - Error responses and logs must not leak stack traces, internals, or PII.
41
+ - Rate limit public endpoints. Least privilege for all service accounts.
42
+ - Encode output for user-controlled content to prevent XSS.
43
+
44
+ ## Error Handling
45
+
46
+ - Fail fast on invalid input.
47
+ - Structured error responses with safe details only. Use standard error codes (RFC 9457 when applicable).
48
+ - Distinguish client errors (4xx) from server errors (5xx).
49
+ - No silent swallowing. Log operational errors with context.
50
+
51
+ ## Testing
52
+
53
+ - Write tests for business logic and boundary failures, not implementation details.
54
+ - Cover happy path, error paths, edge cases, and empty states.
55
+ - Tests must be fast, isolated, deterministic.
56
+ - Integration tests for critical data paths.
57
+ - Sensitive mutations need idempotency or duplicate-submit coverage.
58
+ - CI pipelines block on test failures.
59
+
60
+ ## API Design
61
+
62
+ - Consistent resource naming and HTTP semantics.
63
+ - Bounded list reads: always paginate or set explicit limits.
64
+ - Idempotent for side-effect mutations. Document retry behavior.
65
+ - Backward-compatible by default. Version breaking changes explicitly.
66
+ - Sync docs in the same commit when changing API, CLI, or schema.
67
+ - Use OpenAPI 3.1 for HTTP APIs where applicable.
68
+ - Document deprecation windows before sunsetting endpoints.
69
+
70
+ ## Database
71
+
72
+ - Avoid N+1 queries. Use eager loading or batching.
73
+ - Paginate all growable datasets. No unbounded queries.
74
+ - Multi-table mutations run inside transactions.
75
+ - Monetary amounts: integer minor units or exact decimal. Never floats.
76
+ - Timestamps in UTC. No naive timestamps.
77
+ - Use optimistic concurrency tokens for shared mutable resources.
78
+ - Schema changes require versioned, reversible migrations.
79
+ - Never modify merged migrations. Create new ones.
80
+ - Use concurrent index builds in production.
81
+
82
+ ## Frontend
83
+
84
+ - Semantic HTML before custom components.
85
+ - WCAG 2.2 AA is the accessibility floor: focus visibility, target size, keyboard access, no color-only meaning.
86
+ - Responsive by default. Recompose content for breakpoints, not just shrink.
87
+ - Explicitly handle empty, loading, error, and offline states.
88
+ - CSS logical properties for direction-sensitive layout.
89
+ - Plan overflow, wrapping, truncation, and motion fallbacks.
90
+ - No placeholder, lorem, or TODO content in production UI.
91
+ - Use component kits or headless primitives for behavior and accessibility when they fit.
92
+
93
+ ## Infrastructure
94
+
95
+ - Container configs: multi-stage builds, minimal base images, non-root users, no baked secrets.
96
+ - Explicit healthchecks in production.
97
+ - Configuration from environment, validated at startup. Fail fast if invalid.
98
+ - Feature flags for incremental rollouts.
99
+ - Structured logging with correlation IDs. No PII in logs.
100
+ - Measure latency, traffic, errors, saturation.
101
+
102
+ ## Resilience
103
+
104
+ - Every outbound network call has a strict timeout.
105
+ - Retries use exponential backoff with jitter and max attempt limits.
106
+ - Only retry idempotent operations.
107
+ - Circuit breakers for unhealthy dependencies.
108
+ - Graceful degradation on non-critical dependency failures.
109
+ - Cross-service calls must have timeouts and retries. Independent services own their data.
110
+
111
+ ## Async and Events
112
+
113
+ - Events are immutable. Consumers are idempotent.
114
+ - Dead-letter queues for failed or poison messages.
115
+ - Handle out-of-order events.
116
+ - Background jobs: offload heavy processing (>500ms) to queues. Jobs have timeouts and retry limits.
117
+ - SSE for one-way server-to-client. WebSockets only for true bidirectional.
118
+ - Realtime connections degrade gracefully to polling.
119
+
120
+ ## Response Style
121
+
122
+ Write the smallest complete answer that lets the developer act correctly.
123
+
124
+ Always remove: greetings, affirmations, narration about what you are about to do, padding paragraphs, generic closing offers.
125
+
126
+ Always preserve: exact commands, file paths, line numbers, error messages, exit codes, validation status, assumptions, blockers, risks, and next actions.
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.