@ryuenn3123/agentic-senior-core 5.4.0 → 5.6.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.
- package/.agents/plugins/agentic-senior-core/rules/agentic-senior-core.md +10 -54
- package/.agents/plugins/agentic-senior-core/skills/asc/SKILL.md +11 -0
- package/.agents/plugins/agentic-senior-core/skills/asc-debt/SKILL.md +64 -0
- package/.agents/plugins/agentic-senior-core/skills/asc-refactor/SKILL.md +1 -1
- package/.agents/plugins/agentic-senior-core/skills/asc-reference/SKILL.md +51 -0
- package/.agents/plugins/agentic-senior-core/skills/asc-review/SKILL.md +4 -3
- package/.agents/rules/agentic-senior-core.md +10 -54
- package/.claude-plugin/plugin.json +1 -1
- package/.clinerules/agentic-senior-core.md +8 -6
- package/.codex-plugin/plugin.json +1 -1
- package/.continue/rules/agentic-senior-core.md +8 -6
- package/.cursor/rules/agentic-senior-core.mdc +8 -6
- package/.devin/rules/agentic-senior-core.md +8 -6
- package/.devin-plugin/plugin.json +1 -1
- package/.github/copilot-instructions.md +8 -6
- package/.github/plugin/plugin.json +1 -1
- package/.kilocode/rules/agentic-senior-core.md +8 -6
- package/.kiro/steering/agentic-senior-core.md +8 -6
- package/.openclaw/skills/asc/SKILL.md +11 -0
- package/.openclaw/skills/asc-debt/SKILL.md +71 -0
- package/.openclaw/skills/asc-reference/SKILL.md +58 -0
- package/.openclaw/skills/asc-review/SKILL.md +4 -3
- package/.openhands/microagents/agentic-senior-core.md +8 -6
- package/.roo/rules/agentic-senior-core.md +8 -6
- package/.windsurf/rules/agentic-senior-core.md +8 -6
- package/.zed/rules/agentic-senior-core.md +8 -6
- package/AGENTS.md +10 -54
- package/CONVENTIONS.md +8 -6
- package/README.md +44 -5
- package/gemini-extension.json +1 -1
- package/hooks/copilot-hooks.json +9 -0
- package/hooks/hooks.json +14 -0
- package/hooks/post-edit-enforce.js +134 -0
- package/package.json +1 -1
- package/plugin.yaml +3 -1
- package/scripts/mcp-server/constants.mjs +2 -9
- package/skills/asc/SKILL.md +11 -0
- package/skills/asc-debt/SKILL.md +64 -0
- package/skills/asc-refactor/SKILL.md +1 -1
- package/skills/asc-reference/SKILL.md +51 -0
- package/skills/asc-review/SKILL.md +4 -3
package/README.md
CHANGED
|
@@ -28,8 +28,18 @@ npm install -g @ryuenn3123/agentic-senior-core
|
|
|
28
28
|
|
|
29
29
|
Rules load automatically via plugin hooks. No per-project files needed.
|
|
30
30
|
|
|
31
|
+
From inside Claude Code, add the marketplace then install:
|
|
32
|
+
|
|
33
|
+
```
|
|
34
|
+
/plugin marketplace add fatidaprilian/Agentic-Senior-Core
|
|
35
|
+
/plugin install agentic-senior-core@agentic-senior-core
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
Or from your terminal shell:
|
|
39
|
+
|
|
31
40
|
```bash
|
|
32
|
-
claude plugin add fatidaprilian/Agentic-Senior-Core
|
|
41
|
+
claude plugin marketplace add fatidaprilian/Agentic-Senior-Core
|
|
42
|
+
claude plugin install agentic-senior-core@agentic-senior-core
|
|
33
43
|
```
|
|
34
44
|
|
|
35
45
|
After install, every Claude Code session injects the rules on startup -- including subagents.
|
|
@@ -220,8 +230,13 @@ Antigravity IDE reads it automatically with `trigger: always_on`.
|
|
|
220
230
|
Copy the plugin bundle to Antigravity's global plugin directory:
|
|
221
231
|
|
|
222
232
|
```powershell
|
|
223
|
-
# Windows
|
|
224
|
-
|
|
233
|
+
# Windows (PowerShell)
|
|
234
|
+
Copy-Item -Recurse -Force "$env:APPDATA\npm\node_modules\@ryuenn3123\agentic-senior-core\.agents\plugins\agentic-senior-core" "$env:USERPROFILE\.gemini\config\plugins\agentic-senior-core"
|
|
235
|
+
```
|
|
236
|
+
|
|
237
|
+
```cmd
|
|
238
|
+
:: Windows (cmd.exe)
|
|
239
|
+
xcopy /E /I /Y "%APPDATA%\npm\node_modules\@ryuenn3123\agentic-senior-core\.agents\plugins\agentic-senior-core" "%USERPROFILE%\.gemini\config\plugins\agentic-senior-core"
|
|
225
240
|
```
|
|
226
241
|
|
|
227
242
|
```bash
|
|
@@ -229,7 +244,9 @@ xcopy /E /I "%APPDATA%\npm\node_modules\@ryuenn3123\agentic-senior-core\.agents\
|
|
|
229
244
|
cp -r "$(npm root -g)/@ryuenn3123/agentic-senior-core/.agents/plugins/agentic-senior-core" ~/.gemini/config/plugins/
|
|
230
245
|
```
|
|
231
246
|
|
|
232
|
-
The plugin bundle includes rules, skills (`/asc-review`, `/asc-audit`, `/asc-refactor`), and `plugin.json`.
|
|
247
|
+
The plugin bundle includes rules, skills (`/asc-review`, `/asc-audit`, `/asc-refactor`, `/asc-reference`, `/asc-debt`), and `plugin.json`.
|
|
248
|
+
|
|
249
|
+
> Note: `npm update -g` refreshes the npm package only. The global plugin copy does not auto-update -- re-run the copy command above after each update.
|
|
233
250
|
|
|
234
251
|
</details>
|
|
235
252
|
|
|
@@ -302,7 +319,7 @@ Input validation at trust boundaries, parameterized queries, auth checks, error
|
|
|
302
319
|
|
|
303
320
|
| Host | Type | Install | Per-project files? |
|
|
304
321
|
|------|------|---------|-------------------|
|
|
305
|
-
| Claude Code | Terminal agent |
|
|
322
|
+
| Claude Code | Terminal agent | `/plugin install` | No |
|
|
306
323
|
| Codex CLI | Terminal agent | `codex plugins install` | No |
|
|
307
324
|
| Gemini CLI | Terminal agent | Auto-detected | No |
|
|
308
325
|
| Copilot CLI | Terminal agent | Plugin registration | No |
|
|
@@ -336,6 +353,8 @@ Available on plugin hosts (Claude Code, Codex, Gemini CLI):
|
|
|
336
353
|
| `/asc-refactor` | Structured refactoring workflow |
|
|
337
354
|
| `/asc-review` | Production-risk code review with severity-ordered findings |
|
|
338
355
|
| `/asc-audit` | Security and architecture audit |
|
|
356
|
+
| `/asc-reference` | Domain-specific rules (testing, API, database, frontend, infra, resilience) |
|
|
357
|
+
| `/asc-debt` | Track deferred enforcement violations (add, list, resolve, summary) |
|
|
339
358
|
| `/asc-help` | Show available commands |
|
|
340
359
|
|
|
341
360
|
---
|
|
@@ -367,6 +386,26 @@ Use them together. No conflicts.
|
|
|
367
386
|
|
|
368
387
|
---
|
|
369
388
|
|
|
389
|
+
## Benchmarks
|
|
390
|
+
|
|
391
|
+
Measured on `claude-opus-4-6` using headless Claude Code sessions against real tasks.
|
|
392
|
+
|
|
393
|
+
| | LOC | Tokens | Cost | Duration | Safety |
|
|
394
|
+
|---|---|---|---|---|---|
|
|
395
|
+
| **Simple tasks** | 0% | -3% to -8% | -1% | -2% to -13% | 100% |
|
|
396
|
+
| **Complex tasks** | **-18%** | **-30%** | **-42%** | **-18%** | 100% |
|
|
397
|
+
|
|
398
|
+
On complex, ambiguous tasks (auth systems, insecure CRUD refactors) — where over-engineering typically occurs — ASC produces **18% less code**, uses **30% fewer tokens**, costs **42% less**, and finishes **18% faster**.
|
|
399
|
+
|
|
400
|
+
On trivial tasks the model is already concise, so gains are marginal.
|
|
401
|
+
|
|
402
|
+
Full methodology and raw data: [`benchmarks/RESULTS.md`](benchmarks/RESULTS.md)
|
|
403
|
+
|
|
404
|
+
> Model: `claude-opus-4-6` · n=1-2 per task · Baseline = Claude without rules (not zero-prompt).
|
|
405
|
+
> Opus is inherently disciplined — gains on more verbose models would likely be larger.
|
|
406
|
+
|
|
407
|
+
---
|
|
408
|
+
|
|
370
409
|
## Migration from v4.x
|
|
371
410
|
|
|
372
411
|
v5.0 is a breaking change. The per-project system (`.agent-context/`, bridge files, project scaffolding) is replaced by the universal plugin system.
|
package/gemini-extension.json
CHANGED
package/hooks/copilot-hooks.json
CHANGED
|
@@ -16,6 +16,15 @@
|
|
|
16
16
|
"powershell": "node \"${PLUGIN_ROOT}\\hooks\\subagent-start.js\"",
|
|
17
17
|
"timeoutSec": 5
|
|
18
18
|
}
|
|
19
|
+
],
|
|
20
|
+
"postToolUse": [
|
|
21
|
+
{
|
|
22
|
+
"type": "command",
|
|
23
|
+
"matcher": "Edit|Write",
|
|
24
|
+
"bash": "node \"${PLUGIN_ROOT}/hooks/post-edit-enforce.js\"",
|
|
25
|
+
"powershell": "node \"${PLUGIN_ROOT}\\hooks\\post-edit-enforce.js\"",
|
|
26
|
+
"timeoutSec": 5
|
|
27
|
+
}
|
|
19
28
|
]
|
|
20
29
|
}
|
|
21
30
|
}
|
package/hooks/hooks.json
CHANGED
|
@@ -26,6 +26,20 @@
|
|
|
26
26
|
}
|
|
27
27
|
]
|
|
28
28
|
}
|
|
29
|
+
],
|
|
30
|
+
"PostToolUse": [
|
|
31
|
+
{
|
|
32
|
+
"matcher": "Edit|Write",
|
|
33
|
+
"hooks": [
|
|
34
|
+
{
|
|
35
|
+
"type": "command",
|
|
36
|
+
"command": "node \"${CLAUDE_PLUGIN_ROOT}/hooks/post-edit-enforce.js\"; exit 0",
|
|
37
|
+
"commandWindows": "if (Get-Command node -ErrorAction SilentlyContinue) { node \"$env:CLAUDE_PLUGIN_ROOT\\hooks\\post-edit-enforce.js\" }",
|
|
38
|
+
"timeout": 5,
|
|
39
|
+
"statusMessage": "ASC ladder check..."
|
|
40
|
+
}
|
|
41
|
+
]
|
|
42
|
+
}
|
|
29
43
|
]
|
|
30
44
|
}
|
|
31
45
|
}
|
|
@@ -0,0 +1,134 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
// Agentic Senior Core — PostToolUse enforcement hook
|
|
3
|
+
// Fires after Edit/Write. Checks for ladder violations and injects a nudge.
|
|
4
|
+
// Supports Claude Code, Codex CLI, and GitHub Copilot CLI.
|
|
5
|
+
|
|
6
|
+
const path = require('path');
|
|
7
|
+
|
|
8
|
+
const STDLIB_DUPLICATES = new Set([
|
|
9
|
+
'lodash', 'lodash-es', 'underscore',
|
|
10
|
+
'moment', 'dayjs',
|
|
11
|
+
'uuid', 'nanoid',
|
|
12
|
+
'chalk', 'kleur', 'colorette',
|
|
13
|
+
'axios', 'got', 'node-fetch', 'superagent',
|
|
14
|
+
'mkdirp', 'rimraf', 'del',
|
|
15
|
+
'glob', 'globby',
|
|
16
|
+
'left-pad', 'pad-left',
|
|
17
|
+
'is-odd', 'is-even', 'is-number', 'is-string',
|
|
18
|
+
'path-exists', 'fs-extra',
|
|
19
|
+
]);
|
|
20
|
+
|
|
21
|
+
const SOURCE_EXTENSIONS = new Set([
|
|
22
|
+
'js', 'ts', 'mjs', 'cjs', 'jsx', 'tsx',
|
|
23
|
+
'py', 'rb', 'go', 'rs', 'java', 'kt', 'swift', 'cs',
|
|
24
|
+
]);
|
|
25
|
+
|
|
26
|
+
const LOC_DELTA_THRESHOLD = 30;
|
|
27
|
+
const NEW_FILE_LINE_THRESHOLD = 50;
|
|
28
|
+
|
|
29
|
+
let inputBuffer = '';
|
|
30
|
+
process.stdin.setEncoding('utf8');
|
|
31
|
+
process.stdin.on('data', function (chunk) { inputBuffer += chunk; });
|
|
32
|
+
process.stdin.on('end', function () {
|
|
33
|
+
try {
|
|
34
|
+
const data = JSON.parse(inputBuffer);
|
|
35
|
+
const toolName = data.tool_name || '';
|
|
36
|
+
const toolInput = data.tool_input || {};
|
|
37
|
+
const filePath = toolInput.file_path || '';
|
|
38
|
+
const findings = [];
|
|
39
|
+
|
|
40
|
+
if (filePath.endsWith('package.json') || filePath.endsWith('package.json5')) {
|
|
41
|
+
checkDependencyAddition(toolName, toolInput, findings);
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
const ext = path.extname(filePath).slice(1);
|
|
45
|
+
if (SOURCE_EXTENSIONS.has(ext)) {
|
|
46
|
+
if (toolName === 'Edit') {
|
|
47
|
+
checkLocDelta(toolInput, filePath, findings);
|
|
48
|
+
} else if (toolName === 'Write') {
|
|
49
|
+
checkNewFileSize(toolInput, filePath, findings);
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
if (findings.length === 0) return;
|
|
54
|
+
|
|
55
|
+
const nudge = '[ASC enforcement] ' + findings.join(' ') + ' Review the decision ladder before continuing.';
|
|
56
|
+
emit(nudge);
|
|
57
|
+
} catch (_) {
|
|
58
|
+
// Silent fail — enforcement must not break the session
|
|
59
|
+
}
|
|
60
|
+
});
|
|
61
|
+
|
|
62
|
+
function checkDependencyAddition(toolName, toolInput, findings) {
|
|
63
|
+
var target = toolName === 'Edit' ? (toolInput.new_string || '') : (toolInput.content || '');
|
|
64
|
+
var baseline = toolName === 'Edit' ? (toolInput.old_string || '') : '';
|
|
65
|
+
|
|
66
|
+
var depPattern = /"([^"]+)"\s*:\s*"[~^>=<*]?\d/g;
|
|
67
|
+
var newDeps = extractDeps(target, depPattern);
|
|
68
|
+
var oldDeps = extractDeps(baseline, depPattern);
|
|
69
|
+
|
|
70
|
+
var added = newDeps.filter(function (d) { return oldDeps.indexOf(d) === -1; });
|
|
71
|
+
if (added.length === 0) return;
|
|
72
|
+
|
|
73
|
+
var stdlibDupes = added.filter(function (d) { return STDLIB_DUPLICATES.has(d); });
|
|
74
|
+
if (stdlibDupes.length > 0) {
|
|
75
|
+
findings.push(
|
|
76
|
+
'Dependency ' + stdlibDupes.join(', ') + ' may duplicate stdlib/platform features. '
|
|
77
|
+
+ 'Ladder step 3: does the standard library cover this?'
|
|
78
|
+
);
|
|
79
|
+
} else {
|
|
80
|
+
findings.push(
|
|
81
|
+
'New dependency added: ' + added.join(', ') + '. '
|
|
82
|
+
+ 'Ladder step 3-4: stdlib or already-installed alternative?'
|
|
83
|
+
);
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
function extractDeps(text, pattern) {
|
|
88
|
+
var matches = [];
|
|
89
|
+
var match;
|
|
90
|
+
while ((match = pattern.exec(text)) !== null) {
|
|
91
|
+
matches.push(match[1]);
|
|
92
|
+
}
|
|
93
|
+
return matches;
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
function checkLocDelta(toolInput, filePath, findings) {
|
|
97
|
+
var newLines = (toolInput.new_string || '').split('\n').length;
|
|
98
|
+
var oldLines = (toolInput.old_string || '').split('\n').length;
|
|
99
|
+
var delta = newLines - oldLines;
|
|
100
|
+
if (delta > LOC_DELTA_THRESHOLD) {
|
|
101
|
+
findings.push(
|
|
102
|
+
'Edit added ' + delta + ' net lines to ' + path.basename(filePath) + '. '
|
|
103
|
+
+ 'Ladder step 5: can this be one straightforward function?'
|
|
104
|
+
);
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
function checkNewFileSize(toolInput, filePath, findings) {
|
|
109
|
+
var lines = (toolInput.content || '').split('\n').length;
|
|
110
|
+
if (lines > NEW_FILE_LINE_THRESHOLD) {
|
|
111
|
+
findings.push(
|
|
112
|
+
'New file ' + path.basename(filePath) + ' created with ' + lines + ' lines. '
|
|
113
|
+
+ 'Ladder step 1-2: does this need to be built? Does the codebase already have this?'
|
|
114
|
+
);
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
function emit(nudge) {
|
|
119
|
+
try {
|
|
120
|
+
var isCopilot = Boolean(process.env.COPILOT_PLUGIN_DATA);
|
|
121
|
+
var output = {
|
|
122
|
+
hookSpecificOutput: {
|
|
123
|
+
hookEventName: 'PostToolUse',
|
|
124
|
+
additionalContext: nudge,
|
|
125
|
+
},
|
|
126
|
+
};
|
|
127
|
+
if (isCopilot) {
|
|
128
|
+
output = { additionalContext: nudge };
|
|
129
|
+
}
|
|
130
|
+
process.stdout.write(JSON.stringify(output));
|
|
131
|
+
} catch (_) {
|
|
132
|
+
// EPIPE — silent
|
|
133
|
+
}
|
|
134
|
+
}
|
package/package.json
CHANGED
package/plugin.yaml
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
name: agentic-senior-core
|
|
2
|
-
version: 5.
|
|
2
|
+
version: 5.6.0
|
|
3
3
|
description: Universal AI coding rules. Write code like a staff engineer.
|
|
4
4
|
author: fatidaprilian
|
|
5
5
|
provides_hooks:
|
|
@@ -14,3 +14,5 @@ provides_skills:
|
|
|
14
14
|
- asc-refactor
|
|
15
15
|
- asc-review
|
|
16
16
|
- asc-audit
|
|
17
|
+
- asc-debt
|
|
18
|
+
- asc-reference
|
|
@@ -37,17 +37,10 @@ function resolvePackageVersion() {
|
|
|
37
37
|
export const PACKAGE_VERSION = resolvePackageVersion();
|
|
38
38
|
|
|
39
39
|
export const TEST_SUITE_ARGS = {
|
|
40
|
-
|
|
41
|
-
cli: ['--test', './tests/cli-smoke.test.mjs'],
|
|
42
|
-
operations: ['--test', './tests/operations.test.mjs'],
|
|
43
|
-
'llm-judge': ['--test', './tests/llm-judge.test.mjs'],
|
|
40
|
+
adapter: ['--test', './tests/adapter.test.mjs'],
|
|
44
41
|
};
|
|
45
42
|
|
|
46
|
-
export const INTERNAL_SCRIPT_PATHS = {
|
|
47
|
-
validate: resolve(REPOSITORY_ROOT, 'scripts', 'validate.mjs'),
|
|
48
|
-
release_gate: resolve(REPOSITORY_ROOT, 'scripts', 'release-gate.mjs'),
|
|
49
|
-
forbidden_content_check: resolve(REPOSITORY_ROOT, 'scripts', 'forbidden-content-check.mjs'),
|
|
50
|
-
};
|
|
43
|
+
export const INTERNAL_SCRIPT_PATHS = {};
|
|
51
44
|
|
|
52
45
|
function getAvailableTestSuites() {
|
|
53
46
|
return Object.entries(TEST_SUITE_ARGS)
|
package/skills/asc/SKILL.md
CHANGED
|
@@ -7,8 +7,19 @@ Universal AI coding rules. Write code like a staff engineer.
|
|
|
7
7
|
- `/asc-refactor` -- Structured refactoring workflow with pre-checks and validation
|
|
8
8
|
- `/asc-review` -- Production-risk code review with severity-ordered findings
|
|
9
9
|
- `/asc-audit` -- Security and architecture audit
|
|
10
|
+
- `/asc-reference` -- Domain-specific rules (testing, API, database, frontend, infra, resilience)
|
|
11
|
+
- `/asc-debt` -- Track deferred enforcement violations (add, list, resolve, summary)
|
|
10
12
|
- `/asc-help` -- Show this help
|
|
11
13
|
|
|
14
|
+
## Enforcement
|
|
15
|
+
|
|
16
|
+
On plugin-tier hosts (Claude Code, Codex CLI, Copilot CLI), a PostToolUse hook fires after every Edit/Write and checks:
|
|
17
|
+
- New dependencies against stdlib duplicates (decision ladder step 3)
|
|
18
|
+
- LOC delta > 30 lines on edits (step 5)
|
|
19
|
+
- New files > 50 lines (steps 1–2)
|
|
20
|
+
|
|
21
|
+
Violations inject a nudge referencing the specific ladder step. The hook is silent when no issues are found.
|
|
22
|
+
|
|
12
23
|
## What It Does
|
|
13
24
|
|
|
14
25
|
Loads universal engineering rules on every session: code quality, architecture, security, error handling, testing, API design, database, frontend, infrastructure, resilience, and async patterns.
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
# Debt Ledger
|
|
2
|
+
|
|
3
|
+
Track deferred enforcement violations. When an ASC ladder nudge fires and the shortcut is accepted rather than fixed, log it here for later resolution.
|
|
4
|
+
|
|
5
|
+
## Storage
|
|
6
|
+
|
|
7
|
+
Entries persist in `.agent-context/state/debt-ledger.json` via MCP `state_read`/`state_write`. The ledger is a JSON array of entry objects.
|
|
8
|
+
|
|
9
|
+
## Entry Format
|
|
10
|
+
|
|
11
|
+
```json
|
|
12
|
+
{
|
|
13
|
+
"id": "sequential integer",
|
|
14
|
+
"file": "path/to/file.ts",
|
|
15
|
+
"ladderStep": "3",
|
|
16
|
+
"violation": "Added axios — stdlib fetch covers this",
|
|
17
|
+
"addedAt": "ISO-8601 timestamp",
|
|
18
|
+
"status": "open | resolved",
|
|
19
|
+
"resolvedAt": "ISO-8601 timestamp or null"
|
|
20
|
+
}
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
## Operations
|
|
24
|
+
|
|
25
|
+
### Add Entry
|
|
26
|
+
|
|
27
|
+
When an enforcement nudge fires and the violation is deferred:
|
|
28
|
+
|
|
29
|
+
1. Read the current ledger via `state_read` (path: `debt-ledger.json`). If missing, start with `[]`.
|
|
30
|
+
2. Append a new entry with the next sequential `id`, the file path, ladder step, and a one-line violation summary.
|
|
31
|
+
3. Write the updated ledger via `state_write` (path: `debt-ledger.json`, mode: `overwrite`).
|
|
32
|
+
4. Confirm: "Logged to debt ledger: [violation summary]"
|
|
33
|
+
|
|
34
|
+
### List Open Debt
|
|
35
|
+
|
|
36
|
+
1. Read the ledger via `state_read`.
|
|
37
|
+
2. Filter to entries where `status` is `"open"`.
|
|
38
|
+
3. Display as a table: ID, file, ladder step, violation, age.
|
|
39
|
+
4. If no open entries, say so explicitly.
|
|
40
|
+
|
|
41
|
+
### Resolve Entry
|
|
42
|
+
|
|
43
|
+
When a deferred violation has been addressed:
|
|
44
|
+
|
|
45
|
+
1. Read the ledger.
|
|
46
|
+
2. Set the matching entry's `status` to `"resolved"` and `resolvedAt` to the current timestamp.
|
|
47
|
+
3. Write the updated ledger.
|
|
48
|
+
4. Confirm: "Resolved debt #[id]: [violation summary]"
|
|
49
|
+
|
|
50
|
+
### Summary
|
|
51
|
+
|
|
52
|
+
1. Read the ledger.
|
|
53
|
+
2. Report: total entries, open count, resolved count, oldest open entry age.
|
|
54
|
+
|
|
55
|
+
## When to Log
|
|
56
|
+
|
|
57
|
+
Log a debt entry when ALL of these are true:
|
|
58
|
+
- The PostToolUse enforcement hook fired a nudge
|
|
59
|
+
- The agent acknowledged the nudge but proceeded without fixing the violation
|
|
60
|
+
- The violation is deferrable (not a security issue — security violations must be fixed immediately)
|
|
61
|
+
|
|
62
|
+
## Integration
|
|
63
|
+
|
|
64
|
+
The `/asc` skill documents the enforcement loop. This ledger captures what enforcement flags but the session defers. Use `/asc-debt` at session end or before commits to review outstanding shortcuts.
|
|
@@ -14,7 +14,7 @@ Structured refactoring workflow. Preserves existing behavior while improving str
|
|
|
14
14
|
- Improve clarity, boundaries, naming, validation, error handling, and tests.
|
|
15
15
|
- Prioritize maintainability over compressed one-liners.
|
|
16
16
|
- Keep the main flow traceable. Use early returns where they reduce nesting.
|
|
17
|
-
-
|
|
17
|
+
- Introduce abstractions only when the repeated pattern is real and visible.
|
|
18
18
|
- Split large files when the split makes the flow easier to understand.
|
|
19
19
|
- Remove code that does not carry behavior, safety, clarity, maintainability, or test value.
|
|
20
20
|
- Prefer the shorter implementation only when it keeps the same guarantees.
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
# ASC Domain Reference
|
|
2
|
+
|
|
3
|
+
Domain-specific coding rules for testing, API design, database queries, frontend components, infrastructure configs, and service resilience. Load this skill when working on any of these domains.
|
|
4
|
+
|
|
5
|
+
## Testing
|
|
6
|
+
|
|
7
|
+
- Write tests for business logic and boundary failures, not implementation details.
|
|
8
|
+
- Cover happy path, error paths, edge cases, and empty states.
|
|
9
|
+
- Tests must be fast, isolated, deterministic.
|
|
10
|
+
- Integration tests for critical data paths.
|
|
11
|
+
- Sensitive mutations need idempotency or duplicate-submit coverage.
|
|
12
|
+
- CI pipelines block on test failures.
|
|
13
|
+
|
|
14
|
+
## API Design
|
|
15
|
+
|
|
16
|
+
- Consistent resource naming and HTTP semantics.
|
|
17
|
+
- Bounded list reads: always paginate or set explicit limits.
|
|
18
|
+
- Idempotent for side-effect mutations. Document retry behavior.
|
|
19
|
+
- Backward-compatible by default. Version breaking changes explicitly.
|
|
20
|
+
- Sync docs in the same commit when changing API, CLI, or schema.
|
|
21
|
+
|
|
22
|
+
## Database
|
|
23
|
+
|
|
24
|
+
- Use eager loading or batching to eliminate N+1 queries.
|
|
25
|
+
- Paginate all growable datasets. No unbounded queries.
|
|
26
|
+
- Multi-table mutations run inside transactions.
|
|
27
|
+
- Monetary amounts: integer minor units or exact decimal. Never floats.
|
|
28
|
+
- Timestamps in UTC. No naive timestamps.
|
|
29
|
+
- Schema changes require versioned, reversible migrations.
|
|
30
|
+
- Never modify merged migrations. Create new ones.
|
|
31
|
+
|
|
32
|
+
## Frontend
|
|
33
|
+
|
|
34
|
+
- Semantic HTML before custom components.
|
|
35
|
+
- WCAG 2.2 AA is the accessibility floor.
|
|
36
|
+
- Responsive by default. Handle empty, loading, error, and offline states.
|
|
37
|
+
- No placeholder, lorem, or TODO content in production UI.
|
|
38
|
+
|
|
39
|
+
## Infrastructure
|
|
40
|
+
|
|
41
|
+
- Container configs: multi-stage builds, minimal base images, non-root users, no baked secrets.
|
|
42
|
+
- Configuration from environment, validated at startup. Fail fast if invalid.
|
|
43
|
+
- Structured logging with correlation IDs. No PII in logs.
|
|
44
|
+
|
|
45
|
+
## Resilience
|
|
46
|
+
|
|
47
|
+
- Every outbound network call has a strict timeout.
|
|
48
|
+
- Retries use exponential backoff with jitter and max attempt limits.
|
|
49
|
+
- Only retry idempotent operations.
|
|
50
|
+
- Circuit breakers for unhealthy dependencies.
|
|
51
|
+
- Graceful degradation on non-critical dependency failure.
|
|
@@ -7,6 +7,7 @@ Production-risk code review. Prioritize findings by severity.
|
|
|
7
7
|
1. Read the changed files and understand the scope.
|
|
8
8
|
2. For UI changes, check accessibility and design consistency.
|
|
9
9
|
3. For API changes, check contract stability and documentation sync.
|
|
10
|
+
4. Walk the decision ladder for each new file or dependency: does this need to exist, could the stdlib or an existing dependency handle it?
|
|
10
11
|
|
|
11
12
|
## Finding Priority Order
|
|
12
13
|
|
|
@@ -33,11 +34,11 @@ Production-risk code review. Prioritize findings by severity.
|
|
|
33
34
|
- External input validated at trust boundaries.
|
|
34
35
|
- Secrets, tokens, credentials not committed or logged.
|
|
35
36
|
- Authorization enforced at a trusted boundary.
|
|
36
|
-
- Error responses
|
|
37
|
+
- Error responses keep internal details out of client responses.
|
|
37
38
|
|
|
38
39
|
### Architecture
|
|
39
|
-
- Layer boundaries clear. Controllers
|
|
40
|
-
-
|
|
40
|
+
- Layer boundaries clear. Controllers handle protocol translation only; business logic stays in services.
|
|
41
|
+
- Abstractions backed by real duplication, not prediction. Straightforward code over clever solutions.
|
|
41
42
|
- Complexity budget applied: fewer moving parts without losing safety.
|
|
42
43
|
|
|
43
44
|
### Testing
|