@ryuenn3123/agentic-senior-core 5.6.0 → 5.8.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 (44) hide show
  1. package/.agents/plugins/agentic-senior-core/skills/asc/SKILL.md +4 -1
  2. package/.agents/plugins/agentic-senior-core/skills/asc-add-feature/SKILL.md +46 -0
  3. package/.agents/plugins/agentic-senior-core/skills/asc-audit/SKILL.md +2 -0
  4. package/.agents/plugins/agentic-senior-core/skills/asc-debt/SKILL.md +2 -0
  5. package/.agents/plugins/agentic-senior-core/skills/asc-new-project/SKILL.md +49 -0
  6. package/.agents/plugins/agentic-senior-core/skills/asc-refactor/SKILL.md +23 -2
  7. package/.agents/plugins/agentic-senior-core/skills/asc-reference/SKILL.md +2 -0
  8. package/.agents/plugins/agentic-senior-core/skills/asc-review/SKILL.md +2 -0
  9. package/.claude-plugin/plugin.json +1 -1
  10. package/.codex-plugin/plugin.json +1 -1
  11. package/.devin-plugin/plugin.json +1 -1
  12. package/.github/plugin/plugin.json +1 -1
  13. package/.openclaw/skills/asc/SKILL.md +4 -8
  14. package/.openclaw/skills/asc-adapter/SKILL.md +37 -0
  15. package/.openclaw/skills/asc-add-feature/SKILL.md +46 -0
  16. package/.openclaw/skills/asc-audit/SKILL.md +2 -0
  17. package/.openclaw/skills/asc-debt/SKILL.md +2 -7
  18. package/.openclaw/skills/asc-new-project/SKILL.md +49 -0
  19. package/.openclaw/skills/asc-refactor/SKILL.md +56 -0
  20. package/.openclaw/skills/asc-reference/SKILL.md +2 -7
  21. package/.openclaw/skills/asc-review/SKILL.md +2 -0
  22. package/README.md +139 -30
  23. package/bin/agentic-senior-core.js +10 -0
  24. package/commands/asc-add-feature.md +1 -0
  25. package/commands/asc-add-feature.toml +6 -0
  26. package/commands/asc-help.md +2 -0
  27. package/commands/asc-help.toml +11 -1
  28. package/commands/asc-new-project.md +1 -0
  29. package/commands/asc-new-project.toml +6 -0
  30. package/gemini-extension.json +1 -1
  31. package/hooks/path-util.cjs +23 -0
  32. package/hooks/post-edit-enforce.js +34 -0
  33. package/lib/cli/commands/global.mjs +196 -0
  34. package/package.json +3 -2
  35. package/plugin.yaml +1 -1
  36. package/scripts/mcp-server/tools.mjs +10 -0
  37. package/skills/asc/SKILL.md +4 -1
  38. package/skills/asc-add-feature/SKILL.md +46 -0
  39. package/skills/asc-audit/SKILL.md +2 -0
  40. package/skills/asc-debt/SKILL.md +2 -0
  41. package/skills/asc-new-project/SKILL.md +49 -0
  42. package/skills/asc-refactor/SKILL.md +23 -2
  43. package/skills/asc-reference/SKILL.md +2 -0
  44. package/skills/asc-review/SKILL.md +2 -0
@@ -0,0 +1,196 @@
1
+ import fs from 'node:fs/promises';
2
+ import path from 'node:path';
3
+ import os from 'node:os';
4
+ import { fileURLToPath } from 'node:url';
5
+
6
+ const currentFilePath = fileURLToPath(import.meta.url);
7
+ const currentDirectoryPath = path.dirname(currentFilePath);
8
+ const REPOSITORY_ROOT = path.resolve(currentDirectoryPath, '..', '..', '..');
9
+ const HOME = os.homedir();
10
+
11
+ const ASC_MARKER = '# Agentic Senior Core';
12
+
13
+ function vscodeUserPromptsDirectory() {
14
+ if (process.platform === 'win32') {
15
+ return path.join(process.env.APPDATA ?? path.join(HOME, 'AppData', 'Roaming'), 'Code', 'User', 'prompts');
16
+ }
17
+ if (process.platform === 'darwin') {
18
+ return path.join(HOME, 'Library', 'Application Support', 'Code', 'User', 'prompts');
19
+ }
20
+ return path.join(HOME, '.config', 'Code', 'User', 'prompts');
21
+ }
22
+
23
+ const GLOBAL_TARGETS = {
24
+ antigravity: {
25
+ label: 'Google Antigravity IDE',
26
+ kind: 'directory',
27
+ sourcePath: '.agents/plugins/agentic-senior-core',
28
+ targetPath: () => path.join(HOME, '.gemini', 'config', 'plugins', 'agentic-senior-core'),
29
+ note: 'Full plugin bundle (rules + skills), always-on in every project.',
30
+ },
31
+ cline: {
32
+ label: 'Cline',
33
+ kind: 'file',
34
+ sourcePath: '.clinerules/agentic-senior-core.md',
35
+ targetPath: () => path.join(HOME, 'Documents', 'Cline', 'Rules', 'agentic-senior-core.md'),
36
+ note: 'Toggleable in the Cline rules panel.',
37
+ },
38
+ roo: {
39
+ label: 'Roo Code',
40
+ kind: 'file',
41
+ sourcePath: '.roo/rules/agentic-senior-core.md',
42
+ targetPath: () => path.join(HOME, '.roo', 'rules', 'agentic-senior-core.md'),
43
+ note: 'Roo Code was discontinued in May 2026; kept for existing installs.',
44
+ },
45
+ kilocode: {
46
+ label: 'Kilo Code',
47
+ kind: 'file',
48
+ sourcePath: '.kilocode/rules/agentic-senior-core.md',
49
+ targetPath: () => path.join(HOME, '.kilocode', 'rules', 'agentic-senior-core.md'),
50
+ note: 'Kilo v7+: prefer adding the file path to the instructions array in ~/.config/kilo/kilo.jsonc (auto-updates with npm).',
51
+ },
52
+ kiro: {
53
+ label: 'Kiro',
54
+ kind: 'file',
55
+ sourcePath: '.kiro/steering/agentic-senior-core.md',
56
+ targetPath: () => path.join(HOME, '.kiro', 'steering', 'agentic-senior-core.md'),
57
+ note: 'Global steering has known loading bugs in some Kiro builds; fall back to asc adapter --kiro if rules are not picked up.',
58
+ },
59
+ openhands: {
60
+ label: 'OpenHands',
61
+ kind: 'file',
62
+ sourcePath: '.openhands/microagents/agentic-senior-core.md',
63
+ targetPath: () => path.join(HOME, '.openhands', 'microagents', 'agentic-senior-core.md'),
64
+ note: 'Works in CLI/headless/dev modes. Docker runs need the directory mounted.',
65
+ },
66
+ windsurf: {
67
+ label: 'Windsurf / Devin Desktop',
68
+ kind: 'guarded-file',
69
+ sourcePath: '.windsurf/rules/agentic-senior-core.md',
70
+ targetPath: () => path.join(HOME, '.codeium', 'windsurf', 'memories', 'global_rules.md'),
71
+ note: 'Single global file (6,000 char limit). Skipped if you already have your own global_rules.md.',
72
+ },
73
+ copilot: {
74
+ label: 'GitHub Copilot (VS Code)',
75
+ kind: 'copilot-user-instructions',
76
+ sourcePath: '.github/copilot-instructions.md',
77
+ targetPath: () => path.join(vscodeUserPromptsDirectory(), 'agentic-senior-core.instructions.md'),
78
+ note: 'Installs into the VS Code default profile. Other profiles need their own copy.',
79
+ },
80
+ };
81
+
82
+ const MANUAL_TARGETS = [
83
+ { label: 'Cursor', hint: 'Settings > Rules > User Rules: paste the contents of AGENTS.md (plain text only, no global rules file support).' },
84
+ { label: 'Zed', hint: 'Rules Library (Agent Panel): create a rule from AGENTS.md and mark it as default (paper clip icon).' },
85
+ { label: 'Continue', hint: 'Global config.yaml: add a rules block referencing AGENTS.md content.' },
86
+ { label: 'Aider', hint: `~/.aider.conf.yml: add "read: ${path.join(REPOSITORY_ROOT, 'CONVENTIONS.md')}" (absolute path auto-updates with npm).` },
87
+ ];
88
+
89
+ async function pathExists(filePath) {
90
+ try {
91
+ await fs.access(filePath);
92
+ return true;
93
+ } catch {
94
+ return false;
95
+ }
96
+ }
97
+
98
+ async function installGlobalTarget(targetKey) {
99
+ const target = GLOBAL_TARGETS[targetKey];
100
+ const sourcePath = path.join(REPOSITORY_ROOT, target.sourcePath);
101
+ const targetPath = target.targetPath();
102
+
103
+ if (!(await pathExists(sourcePath))) {
104
+ console.error(` ${target.label}: source not found (${sourcePath}) ... FAIL`);
105
+ return false;
106
+ }
107
+
108
+ if (target.kind === 'directory') {
109
+ await fs.mkdir(path.dirname(targetPath), { recursive: true });
110
+ await fs.cp(sourcePath, targetPath, { recursive: true, force: true });
111
+ console.log(` ${target.label}: ${targetPath} ... OK`);
112
+ return true;
113
+ }
114
+
115
+ if (target.kind === 'guarded-file') {
116
+ if (await pathExists(targetPath)) {
117
+ const existingContent = await fs.readFile(targetPath, 'utf8');
118
+ if (!existingContent.startsWith(ASC_MARKER)) {
119
+ console.log(` ${target.label}: existing ${path.basename(targetPath)} found (not ASC) ... SKIPPED`);
120
+ console.log(' Append the contents of AGENTS.md manually to keep your own rules.');
121
+ return false;
122
+ }
123
+ }
124
+ await fs.mkdir(path.dirname(targetPath), { recursive: true });
125
+ await fs.copyFile(sourcePath, targetPath);
126
+ console.log(` ${target.label}: ${targetPath} ... OK`);
127
+ return true;
128
+ }
129
+
130
+ if (target.kind === 'copilot-user-instructions') {
131
+ const rulesContent = await fs.readFile(sourcePath, 'utf8');
132
+ const instructionsContent = `---\napplyTo: '**'\n---\n\n${rulesContent}`;
133
+ await fs.mkdir(path.dirname(targetPath), { recursive: true });
134
+ await fs.writeFile(targetPath, instructionsContent);
135
+ console.log(` ${target.label}: ${targetPath} ... OK`);
136
+ return true;
137
+ }
138
+
139
+ await fs.mkdir(path.dirname(targetPath), { recursive: true });
140
+ await fs.copyFile(sourcePath, targetPath);
141
+ console.log(` ${target.label}: ${targetPath} ... OK`);
142
+ return true;
143
+ }
144
+
145
+ function printGlobalUsage() {
146
+ console.log('Agentic Senior Core -- Global Install\n');
147
+ console.log('Installs rules to user-level locations. Applies to ALL projects, zero project files.\n');
148
+ console.log('Usage: asc global [--antigravity] [--cline] [--kilocode] [--kiro] [--openhands] [--windsurf] [--copilot] [--roo] [--all]\n');
149
+ console.log('Available targets:');
150
+ for (const [key, target] of Object.entries(GLOBAL_TARGETS)) {
151
+ console.log(` --${key.padEnd(12)} ${target.label.padEnd(28)} -> ${target.targetPath()}`);
152
+ }
153
+ console.log('\nManual setup (no global rules file support):');
154
+ for (const manual of MANUAL_TARGETS) {
155
+ console.log(` ${manual.label.padEnd(10)} ${manual.hint}`);
156
+ }
157
+ console.log('\nNote: these are static copies. After npm update -g, re-run asc global to refresh.');
158
+ }
159
+
160
+ export async function runGlobalCommand(commandArguments) {
161
+ const requestedTargets = [];
162
+
163
+ for (const argument of commandArguments) {
164
+ if (argument === '--all') {
165
+ requestedTargets.push(...Object.keys(GLOBAL_TARGETS));
166
+ break;
167
+ }
168
+
169
+ const targetKey = argument.replace(/^--/, '');
170
+ if (GLOBAL_TARGETS[targetKey]) {
171
+ requestedTargets.push(targetKey);
172
+ } else if (argument.startsWith('--')) {
173
+ console.error(`Unknown option: ${argument}`);
174
+ console.log(`Available targets: ${Object.keys(GLOBAL_TARGETS).map(k => `--${k}`).join(', ')}, --all`);
175
+ process.exit(1);
176
+ }
177
+ }
178
+
179
+ if (requestedTargets.length === 0) {
180
+ printGlobalUsage();
181
+ return;
182
+ }
183
+
184
+ console.log('Agentic Senior Core -- Installing global rules\n');
185
+
186
+ let successCount = 0;
187
+ for (const targetKey of requestedTargets) {
188
+ const success = await installGlobalTarget(targetKey);
189
+ if (success) successCount++;
190
+ const note = GLOBAL_TARGETS[targetKey].note;
191
+ if (note) console.log(` ${note}`);
192
+ }
193
+
194
+ console.log(`\n${successCount}/${requestedTargets.length} global target(s) installed.`);
195
+ console.log('Static copies do not auto-update: re-run asc global after npm update -g.');
196
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ryuenn3123/agentic-senior-core",
3
- "version": "5.6.0",
3
+ "version": "5.8.0",
4
4
  "type": "module",
5
5
  "description": "Universal AI coding rules. Write code like a staff engineer, not a junior.",
6
6
  "bin": {
@@ -11,6 +11,7 @@
11
11
  "files": [
12
12
  "bin/",
13
13
  "lib/cli/commands/adapter.mjs",
14
+ "lib/cli/commands/global.mjs",
14
15
  "lib/cli/commands/clean.mjs",
15
16
  "lib/cli/commands/uninstall.mjs",
16
17
  "lib/cli/commands/status.mjs",
@@ -87,6 +88,6 @@
87
88
  "agentic"
88
89
  ],
89
90
  "scripts": {
90
- "test": "node --test ./tests/adapter.test.mjs"
91
+ "test": "node --test ./tests/adapter.test.mjs ./tests/path-hash.test.mjs"
91
92
  }
92
93
  }
package/plugin.yaml CHANGED
@@ -1,5 +1,5 @@
1
1
  name: agentic-senior-core
2
- version: 5.6.0
2
+ version: 5.8.0
3
3
  description: Universal AI coding rules. Write code like a staff engineer.
4
4
  author: fatidaprilian
5
5
  provides_hooks:
@@ -5,6 +5,9 @@ import { existsSync } from 'node:fs';
5
5
  import { mkdir, readFile, readdir, writeFile } from 'node:fs/promises';
6
6
  import { spawn } from 'node:child_process';
7
7
  import { dirname, resolve, sep } from 'node:path';
8
+ import { createRequire } from 'node:module';
9
+ const requireCJS = createRequire(import.meta.url);
10
+ const pathUtil = requireCJS('../../hooks/path-util.cjs');
8
11
  import {
9
12
  AVAILABLE_TEST_SUITES,
10
13
  DEFAULT_FETCH_MAX_CHARS,
@@ -377,6 +380,13 @@ function resolveStatePath(relativeStatePath) {
377
380
  throw new Error('path is required and must be relative to .agent-context/state');
378
381
  }
379
382
 
383
+ if (normalizedRelativePath === 'workflow-gate.json') {
384
+ return {
385
+ normalizedRelativePath,
386
+ resolvedStatePath: pathUtil.getWorkflowGatePath(REPOSITORY_ROOT),
387
+ };
388
+ }
389
+
380
390
  const resolvedStatePath = resolve(STATE_DIRECTORY, normalizedRelativePath);
381
391
  const stateRootPrefix = `${STATE_DIRECTORY}${sep}`;
382
392
  if (resolvedStatePath !== STATE_DIRECTORY && !resolvedStatePath.startsWith(stateRootPrefix)) {
@@ -4,6 +4,8 @@ Universal AI coding rules. Write code like a staff engineer.
4
4
 
5
5
  ## Available Commands
6
6
 
7
+ - `/asc-new-project` -- Greenfield workflow (Define -> Spec -> Implement -> Validate)
8
+ - `/asc-add-feature` -- Brownfield workflow (Research -> Plan -> Implement)
7
9
  - `/asc-refactor` -- Structured refactoring workflow with pre-checks and validation
8
10
  - `/asc-review` -- Production-risk code review with severity-ordered findings
9
11
  - `/asc-audit` -- Security and architecture audit
@@ -17,8 +19,9 @@ On plugin-tier hosts (Claude Code, Codex CLI, Copilot CLI), a PostToolUse hook f
17
19
  - New dependencies against stdlib duplicates (decision ladder step 3)
18
20
  - LOC delta > 30 lines on edits (step 5)
19
21
  - New files > 50 lines (steps 1–2)
22
+ - Workflow gate violations: source/config edits during research or plan phases
20
23
 
21
- Violations inject a nudge referencing the specific ladder step. The hook is silent when no issues are found.
24
+ Violations inject a nudge referencing the specific ladder step or workflow phase. The hook is silent when no issues are found. All enforcement is advisory — nudges, not hard blocks.
22
25
 
23
26
  ## What It Does
24
27
 
@@ -0,0 +1,46 @@
1
+ # Add Feature Workflow
2
+
3
+ Structured brownfield workflow. Adapted from QRSPI to prevent context rot and ensure alignment before building.
4
+
5
+ Grounded in: RPI (Dex Horthy, HumanLayer 2025) with corrections from QRSPI 8-stage evolution (Coding Agents Conference, March 2026). Plan-reading illusion fix and instruction budget constraint applied. Stages 2/5/7 adapted; stages 1/3/4/6/8 skipped as too heavyweight for individual-developer workflow.
6
+
7
+ ## Gate Mechanism
8
+
9
+ This workflow nudges the agent to stop at each phase boundary, same enforcement tier as the existing decision ladder — not a hard block. Bypasses are logged to the debt ledger.
10
+
11
+ **Known limitation:** Bypass-to-debt-ledger logging is self-reported by the agent, not enforced by the hook. The PostToolUse hook has no MCP access — it nudges the agent to log, but cannot write the debt entry itself.
12
+
13
+ To track phase, write to `workflow-gate.json` via the `state_write` MCP tool.
14
+ Format:
15
+ ```json
16
+ {
17
+ "workflow": "asc-add-feature",
18
+ "phase": "<current_phase>",
19
+ "updatedAt": "<ISO-timestamp>"
20
+ }
21
+ ```
22
+
23
+ ## Phase 1: Research (No Code Changes)
24
+
25
+ 1. Write `workflow-gate.json` with phase `research`.
26
+ 2. Map existing code: patterns, utilities, dependencies already in use.
27
+ 3. Identify what must NOT be rebuilt (e.g., existing validation helpers).
28
+ 4. Output a factual research summary.
29
+ 5. **STOP and wait for user approval.** Do not plan or implement.
30
+
31
+ ## Phase 2: Plan
32
+
33
+ 1. On approval of Phase 1, update `workflow-gate.json` phase to `plan`.
34
+ 2. Create a numbered, step-by-step implementation plan with specific files, functions, and line references.
35
+ 3. Include a "Don't Build" list from the research phase.
36
+ 4. **Callout: Plan-Reading Illusion.** Ask the user to explicitly verify the plan against the codebase, not just skim it.
37
+ 5. Output the plan.
38
+ 6. **STOP and wait for user approval.** Do not implement.
39
+
40
+ ## Phase 3: Implement
41
+
42
+ 1. On approval of Phase 2, update `workflow-gate.json` phase to `implement`.
43
+ 2. Recommend a fresh context (intentional compaction) if the context window is getting full.
44
+ 3. Execute the approved plan.
45
+ 4. Validate: tests pass, no duplicate code introduced, plan items checked off.
46
+ 5. On completion, clear the state in `workflow-gate.json` by overwriting it with `{}`.
@@ -2,6 +2,8 @@
2
2
 
3
3
  Security and architecture audit. Deeper than review, focused on finding vulnerabilities and structural anti-patterns.
4
4
 
5
+ Grounded in: OWASP Top 10 (2021), OWASP ASVS v4, CVSS vulnerability report structure, CWE classification.
6
+
5
7
  ## Audit Scope
6
8
 
7
9
  1. **Trust boundaries**: Every point where external input enters the system. Validate that inputs are sanitized, normalized, and rejected when invalid.
@@ -2,6 +2,8 @@
2
2
 
3
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
4
 
5
+ Grounded in: Cunningham's technical debt metaphor (1992). Entry format (ladder step + violation + status lifecycle) is an ASC-specific implementation.
6
+
5
7
  ## Storage
6
8
 
7
9
  Entries persist in `.agent-context/state/debt-ledger.json` via MCP `state_read`/`state_write`. The ledger is a JSON array of entry objects.
@@ -0,0 +1,49 @@
1
+ # New Project Workflow
2
+
3
+ Structured greenfield workflow. Prevents building before alignment on what to build.
4
+
5
+ Grounded in: Spec-Driven Development (SDD) with scaffolding-spec approach. Specs guide implementation, then the code becomes the source of truth — specs are not maintained as living documents unless the team explicitly opts in.
6
+
7
+ ## Gate Mechanism
8
+
9
+ This workflow nudges the agent to stop at each phase boundary, same enforcement tier as the existing decision ladder — not a hard block. Bypasses are logged to the debt ledger.
10
+
11
+ **Known limitation:** Bypass-to-debt-ledger logging is self-reported by the agent, not enforced by the hook. The PostToolUse hook has no MCP access — it nudges the agent to log, but cannot write the debt entry itself.
12
+
13
+ To track phase, write to `workflow-gate.json` via the `state_write` MCP tool.
14
+ Format:
15
+ ```json
16
+ {
17
+ "workflow": "asc-new-project",
18
+ "phase": "<current_phase>",
19
+ "updatedAt": "<ISO-timestamp>"
20
+ }
21
+ ```
22
+
23
+ ## Phase 1: Define (No Code)
24
+
25
+ 1. Write `workflow-gate.json` with phase `research`.
26
+ 2. Clarify with the user: tech stack, target platform, constraints, non-goals.
27
+ 3. Propose a directory structure and module boundaries.
28
+ 4. Output a project brief summarizing decisions.
29
+ 5. **STOP and wait for user approval.** Do not write specs or code.
30
+
31
+ ## Phase 2: Spec (No Implementation Code)
32
+
33
+ 1. On approval of Phase 1, update `workflow-gate.json` phase to `plan`.
34
+ 2. Write per-feature specs with acceptance criteria and edge cases.
35
+ 3. Specs are scaffolding — they guide the build, then the code is the source of truth.
36
+ 4. Output specs for review.
37
+ 5. **STOP and wait for user approval.** Do not implement.
38
+
39
+ ## Phase 3: Implement
40
+
41
+ 1. On approval of Phase 2, update `workflow-gate.json` phase to `implement`.
42
+ 2. Build against the approved specs. Apply the ASC decision ladder on every file.
43
+ 3. Run the decision ladder: does this need to exist? Does stdlib cover it? One function or full module?
44
+
45
+ ## Phase 4: Validate
46
+
47
+ 1. Run tests. Check each spec's acceptance criteria.
48
+ 2. Confirm nothing was over-built beyond what the specs required.
49
+ 3. On completion, clear the state in `workflow-gate.json` by overwriting it with `{}`.
@@ -2,12 +2,33 @@
2
2
 
3
3
  Structured refactoring workflow. Preserves existing behavior while improving structure.
4
4
 
5
+ Grounded in: Fowler's Refactoring (read-understand-smallest scope-preserve behavior), Rule of Three (abstraction threshold), YAGNI principle (XP/Kent Beck). Empirical evidence: agents dominate low-level refactors (rename, extract, type changes) but struggle with multi-file architectural changes (arXiv, 15k+ instance study).
6
+
7
+ ## YAGNI Scan (Before Any Restructuring)
8
+
9
+ Before changing structure, scan for speculative code to remove:
10
+ - "Just in case" logic, unused feature flags, dead branches behind config toggles.
11
+ - Abstractions wrapping a single implementation with no second consumer.
12
+ - Premature extension points (plugin hooks, strategy patterns) with one concrete path.
13
+
14
+ Removing speculative code is the highest-value, lowest-risk refactor type.
15
+
16
+ ## Classify Before Proceeding
17
+
18
+ After reading the target code, classify the refactor:
19
+
20
+ - **Low-level** (rename, extract method, type safety, dead code removal): proceed after explaining the change. No approval gate needed.
21
+ - **High-level** (move module, change architecture, redesign abstractions, multi-file structural changes): output a plan with specific files and rationale, then **stop and wait for user approval** before implementing.
22
+
23
+ **Known limitation:** The high-level refactor gate is a skill-text instruction — the agent self-classifies and self-stops. Unlike `/asc-add-feature` and `/asc-new-project`, this gate is not backed by the PostToolUse hook or workflow-gate.json. If the agent bypasses the gate, there is no automated nudge.
24
+
5
25
  ## Before Editing
6
26
 
7
27
  1. Read the target code and understand existing patterns.
8
28
  2. Identify the smallest relevant scope for the refactor.
9
- 3. If the change touches UI, check accessibility and responsive behavior.
10
- 4. If the change touches dependencies, verify current official docs.
29
+ 3. Classify the refactor (see above). If high-level, stop and present a plan.
30
+ 4. If the change touches UI, check accessibility and responsive behavior.
31
+ 5. If the change touches dependencies, verify current official docs.
11
32
 
12
33
  ## Refactor Rules
13
34
 
@@ -2,6 +2,8 @@
2
2
 
3
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
4
 
5
+ Grounded in: WCAG 2.2 AA (accessibility), Fowler's Money Pattern (monetary types), Nygard's Release It! (resilience patterns), AWS Well-Architected Reliability Pillar (backoff/circuit breakers), OWASP Secure Coding Practices (input validation, logging).
6
+
5
7
  ## Testing
6
8
 
7
9
  - Write tests for business logic and boundary failures, not implementation details.
@@ -2,6 +2,8 @@
2
2
 
3
3
  Production-risk code review. Prioritize findings by severity.
4
4
 
5
+ Grounded in: OWASP Risk Rating Methodology, Google Engineering Practices (code review guide), Clean Architecture (transport vs business layer separation).
6
+
5
7
  ## Before Reviewing
6
8
 
7
9
  1. Read the changed files and understand the scope.