@smartsoft001/pro-claude-plugins 0.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.
- package/.claude-plugin/marketplace.json +26 -0
- package/README.md +56 -0
- package/package.json +14 -0
- package/plugins/flow/.claude-plugin/README.md +91 -0
- package/plugins/flow/.claude-plugin/merge-permissions.js +115 -0
- package/plugins/flow/.claude-plugin/plugin.json +5 -0
- package/plugins/flow/.claude-plugin/settings.template.json +86 -0
- package/plugins/flow/agents/angular-component-scaffolder.md +176 -0
- package/plugins/flow/agents/angular-directive-builder.md +154 -0
- package/plugins/flow/agents/angular-guard-builder.md +244 -0
- package/plugins/flow/agents/angular-jest-test-writer.md +475 -0
- package/plugins/flow/agents/angular-pipe-builder.md +170 -0
- package/plugins/flow/agents/angular-resolver-builder.md +287 -0
- package/plugins/flow/agents/angular-service-builder.md +162 -0
- package/plugins/flow/agents/angular-signal-state-builder.md +340 -0
- package/plugins/flow/agents/angular-test-diagnostician.md +279 -0
- package/plugins/flow/agents/angular-testbed-configurator.md +315 -0
- package/plugins/flow/agents/arch-scaffolder.md +278 -0
- package/plugins/flow/agents/e2e-data-testid-injector.md +195 -0
- package/plugins/flow/agents/e2e-project-scaffolder.md +194 -0
- package/plugins/flow/agents/e2e-test-writer.md +357 -0
- package/plugins/flow/agents/shared-agent-evolver.md +294 -0
- package/plugins/flow/agents/shared-build-verifier.md +160 -0
- package/plugins/flow/agents/shared-config-updater.md +310 -0
- package/plugins/flow/agents/shared-coverage-enforcer.md +184 -0
- package/plugins/flow/agents/shared-error-handler.md +217 -0
- package/plugins/flow/agents/shared-file-creator.md +344 -0
- package/plugins/flow/agents/shared-impl-orchestrator.md +312 -0
- package/plugins/flow/agents/shared-impl-reporter.md +368 -0
- package/plugins/flow/agents/shared-impl-teammate.md +201 -0
- package/plugins/flow/agents/shared-linear-subtask-iterator.md +337 -0
- package/plugins/flow/agents/shared-logic-implementer.md +244 -0
- package/plugins/flow/agents/shared-maia-api.md +26 -0
- package/plugins/flow/agents/shared-parallelization-analyzer.md +343 -0
- package/plugins/flow/agents/shared-performance-validator.md +168 -0
- package/plugins/flow/agents/shared-plan-perspective.md +271 -0
- package/plugins/flow/agents/shared-project-standardizer.md +205 -0
- package/plugins/flow/agents/shared-report-synthesizer.md +188 -0
- package/plugins/flow/agents/shared-review-teammate.md +189 -0
- package/plugins/flow/agents/shared-security-scanner.md +186 -0
- package/plugins/flow/agents/shared-style-enforcer.md +230 -0
- package/plugins/flow/agents/shared-subtask-dependency-analyzer.md +189 -0
- package/plugins/flow/agents/shared-tdd-developer.md +350 -0
- package/plugins/flow/agents/shared-team-coordinator.md +192 -0
- package/plugins/flow/agents/shared-test-fixer.md +186 -0
- package/plugins/flow/agents/shared-test-runner.md +191 -0
- package/plugins/flow/agents/shared-ui-classifier.md +263 -0
- package/plugins/flow/agents/shared-verification-orchestrator.md +194 -0
- package/plugins/flow/agents/shared-verification-runner.md +140 -0
- package/plugins/flow/agents/ui-a11y-validator.md +305 -0
- package/plugins/flow/agents/ui-screenshot-reporter.md +329 -0
- package/plugins/flow/agents/ui-web-designer.md +214 -0
- package/plugins/flow/scripts/compute-session-tokens.sh +39 -0
- package/plugins/flow/skills/a11y-audit/SKILL.md +214 -0
- package/plugins/flow/skills/angular-patterns/SKILL.md +191 -0
- package/plugins/flow/skills/browser-capture/SKILL.md +238 -0
- package/plugins/flow/skills/commit/SKILL.md +259 -0
- package/plugins/flow/skills/debug-helper/SKILL.md +375 -0
- package/plugins/flow/skills/impl/SKILL.md +992 -0
- package/plugins/flow/skills/karpathy-guidelines/SKILL.md +72 -0
- package/plugins/flow/skills/linear-suggestion/SKILL.md +132 -0
- package/plugins/flow/skills/maia-files-delete/SKILL.md +59 -0
- package/plugins/flow/skills/maia-files-upload/SKILL.md +57 -0
- package/plugins/flow/skills/nx-conventions/SKILL.md +326 -0
- package/plugins/flow/skills/plan/SKILL.md +1033 -0
- package/plugins/flow/skills/push/SKILL.md +759 -0
- package/plugins/flow/skills/review/SKILL.md +443 -0
- package/plugins/flow/skills/test-e2e/SKILL.md +164 -0
- package/plugins/flow/skills/test-unit/SKILL.md +456 -0
- package/plugins/flow-external/.claude-plugin/README.md +146 -0
- package/plugins/flow-external/.claude-plugin/merge-permissions.js +94 -0
- package/plugins/flow-external/.claude-plugin/plugin.json +5 -0
- package/plugins/flow-external/.claude-plugin/settings.template.json +78 -0
- package/plugins/flow-external/agents/angular-component-scaffolder.md +271 -0
- package/plugins/flow-external/agents/angular-directive-builder.md +134 -0
- package/plugins/flow-external/agents/angular-guard-builder.md +73 -0
- package/plugins/flow-external/agents/angular-pipe-builder.md +90 -0
- package/plugins/flow-external/agents/angular-resolver-builder.md +79 -0
- package/plugins/flow-external/agents/angular-service-builder.md +168 -0
- package/plugins/flow-external/agents/angular-state-builder.md +263 -0
- package/plugins/flow-external/agents/shared-build-verifier.md +67 -0
- package/plugins/flow-external/agents/shared-impl-orchestrator.md +90 -0
- package/plugins/flow-external/agents/shared-impl-reporter.md +135 -0
- package/plugins/flow-external/agents/shared-linear-subtask-iterator.md +70 -0
- package/plugins/flow-external/agents/shared-ui-classifier.md +38 -0
- package/plugins/flow-external/agents/ui-web-designer.md +203 -0
- package/plugins/flow-external/scripts/compute-session-tokens.sh +39 -0
- package/plugins/flow-external/skills/a11y-audit/SKILL.md +97 -0
- package/plugins/flow-external/skills/angular-cli-conventions/SKILL.md +268 -0
- package/plugins/flow-external/skills/angular-patterns/SKILL.md +182 -0
- package/plugins/flow-external/skills/browser-capture/SKILL.md +74 -0
- package/plugins/flow-external/skills/commit/SKILL.md +114 -0
- package/plugins/flow-external/skills/debug-helper/SKILL.md +135 -0
- package/plugins/flow-external/skills/impl/SKILL.md +218 -0
- package/plugins/flow-external/skills/karpathy-guidelines/SKILL.md +72 -0
- package/plugins/flow-external/skills/linear-suggestion/SKILL.md +62 -0
- package/plugins/flow-external/skills/maia-files-delete/SKILL.md +34 -0
- package/plugins/flow-external/skills/maia-files-upload/SKILL.md +41 -0
- package/plugins/flow-external/skills/plan/SKILL.md +334 -0
- package/plugins/flow-external/skills/push/SKILL.md +232 -0
- package/plugins/flow-legacy/.claude-plugin/README.md +143 -0
- package/plugins/flow-legacy/.claude-plugin/merge-permissions.js +94 -0
- package/plugins/flow-legacy/.claude-plugin/plugin.json +5 -0
- package/plugins/flow-legacy/.claude-plugin/settings.template.json +79 -0
- package/plugins/flow-legacy/agents/angular-component-scaffolder.md +327 -0
- package/plugins/flow-legacy/agents/angular-directive-builder.md +253 -0
- package/plugins/flow-legacy/agents/angular-guard-builder.md +326 -0
- package/plugins/flow-legacy/agents/angular-pipe-builder.md +238 -0
- package/plugins/flow-legacy/agents/angular-resolver-builder.md +339 -0
- package/plugins/flow-legacy/agents/angular-service-builder.md +271 -0
- package/plugins/flow-legacy/agents/angular-state-builder.md +480 -0
- package/plugins/flow-legacy/agents/shared-impl-orchestrator.md +174 -0
- package/plugins/flow-legacy/agents/shared-impl-reporter.md +232 -0
- package/plugins/flow-legacy/agents/shared-linear-subtask-iterator.md +198 -0
- package/plugins/flow-legacy/agents/shared-tdd-developer.md +307 -0
- package/plugins/flow-legacy/agents/shared-test-runner.md +133 -0
- package/plugins/flow-legacy/agents/shared-ui-classifier.md +145 -0
- package/plugins/flow-legacy/scripts/compute-session-tokens.sh +39 -0
- package/plugins/flow-legacy/skills/a11y-audit/SKILL.md +214 -0
- package/plugins/flow-legacy/skills/angular-patterns/SKILL.md +346 -0
- package/plugins/flow-legacy/skills/browser-capture/SKILL.md +238 -0
- package/plugins/flow-legacy/skills/commit/SKILL.md +215 -0
- package/plugins/flow-legacy/skills/debug-helper/SKILL.md +395 -0
- package/plugins/flow-legacy/skills/impl/SKILL.md +710 -0
- package/plugins/flow-legacy/skills/karpathy-guidelines/SKILL.md +72 -0
- package/plugins/flow-legacy/skills/linear-suggestion/SKILL.md +132 -0
- package/plugins/flow-legacy/skills/maia-files-delete/SKILL.md +59 -0
- package/plugins/flow-legacy/skills/maia-files-upload/SKILL.md +57 -0
- package/plugins/flow-legacy/skills/nx-conventions/SKILL.md +368 -0
- package/plugins/flow-legacy/skills/plan/SKILL.md +742 -0
- package/plugins/flow-legacy/skills/push/SKILL.md +645 -0
- package/plugins/flow-legacy/skills/test-unit/SKILL.md +500 -0
- package/plugins/smart-pro/.claude-plugin/README.md +115 -0
- package/plugins/smart-pro/.claude-plugin/merge-permissions.js +129 -0
- package/plugins/smart-pro/.claude-plugin/plugin.json +5 -0
- package/plugins/smart-pro/.claude-plugin/settings.template.json +94 -0
- package/plugins/smart-pro/agents/angular-components/AGENT.md +214 -0
- package/plugins/smart-pro/hooks/CONFIG.md +198 -0
- package/plugins/smart-pro/hooks/README.md +139 -0
- package/plugins/smart-pro/hooks/audit_logger.py +107 -0
- package/plugins/smart-pro/hooks/auto_format.sh +11 -0
- package/plugins/smart-pro/hooks/hooks.json +79 -0
- package/plugins/smart-pro/hooks/safety_validator.py +129 -0
- package/plugins/smart-pro/hooks/sensitive_file_blocker.py +58 -0
- package/plugins/smart-pro/hooks/skill_validator.py +220 -0
- package/plugins/smart-pro/skills/angular-components-action-panel/SKILL.md +159 -0
- package/plugins/smart-pro/skills/angular-components-avatar/SKILL.md +142 -0
- package/plugins/smart-pro/skills/angular-components-badge/SKILL.md +110 -0
- package/plugins/smart-pro/skills/angular-components-breadcrumbs/SKILL.md +91 -0
- package/plugins/smart-pro/skills/angular-components-button/SKILL.md +146 -0
- package/plugins/smart-pro/skills/angular-components-button-group/SKILL.md +121 -0
- package/plugins/smart-pro/skills/angular-components-calendar/SKILL.md +78 -0
- package/plugins/smart-pro/skills/angular-components-card/SKILL.md +110 -0
- package/plugins/smart-pro/skills/angular-components-card-heading/SKILL.md +105 -0
- package/plugins/smart-pro/skills/angular-components-command-palette/SKILL.md +168 -0
- package/plugins/smart-pro/skills/angular-components-container/SKILL.md +93 -0
- package/plugins/smart-pro/skills/angular-components-description-list/SKILL.md +102 -0
- package/plugins/smart-pro/skills/angular-components-details/SKILL.md +70 -0
- package/plugins/smart-pro/skills/angular-components-divider/SKILL.md +110 -0
- package/plugins/smart-pro/skills/angular-components-drawer/SKILL.md +136 -0
- package/plugins/smart-pro/skills/angular-components-dropdown/SKILL.md +131 -0
- package/plugins/smart-pro/skills/angular-components-empty-state/SKILL.md +103 -0
- package/plugins/smart-pro/skills/angular-components-feed/SKILL.md +110 -0
- package/plugins/smart-pro/skills/angular-components-form/SKILL.md +77 -0
- package/plugins/smart-pro/skills/angular-components-grid-list/SKILL.md +91 -0
- package/plugins/smart-pro/skills/angular-components-input/SKILL.md +118 -0
- package/plugins/smart-pro/skills/angular-components-list/SKILL.md +75 -0
- package/plugins/smart-pro/skills/angular-components-list-container/SKILL.md +106 -0
- package/plugins/smart-pro/skills/angular-components-media-object/SKILL.md +133 -0
- package/plugins/smart-pro/skills/angular-components-modal/SKILL.md +159 -0
- package/plugins/smart-pro/skills/angular-components-multi-column-layout/SKILL.md +84 -0
- package/plugins/smart-pro/skills/angular-components-navbar/SKILL.md +93 -0
- package/plugins/smart-pro/skills/angular-components-notification/SKILL.md +147 -0
- package/plugins/smart-pro/skills/angular-components-page/SKILL.md +162 -0
- package/plugins/smart-pro/skills/angular-components-page-heading/SKILL.md +96 -0
- package/plugins/smart-pro/skills/angular-components-paging/SKILL.md +86 -0
- package/plugins/smart-pro/skills/angular-components-progress-bars/SKILL.md +94 -0
- package/plugins/smart-pro/skills/angular-components-searchbar/SKILL.md +113 -0
- package/plugins/smart-pro/skills/angular-components-section-heading/SKILL.md +156 -0
- package/plugins/smart-pro/skills/angular-components-select-menu/SKILL.md +101 -0
- package/plugins/smart-pro/skills/angular-components-sidebar-layout/SKILL.md +121 -0
- package/plugins/smart-pro/skills/angular-components-sidebar-navigation/SKILL.md +80 -0
- package/plugins/smart-pro/skills/angular-components-sign-in-form/SKILL.md +91 -0
- package/plugins/smart-pro/skills/angular-components-stacked-layout/SKILL.md +114 -0
- package/plugins/smart-pro/skills/angular-components-stacked-list/SKILL.md +93 -0
- package/plugins/smart-pro/skills/angular-components-stats/SKILL.md +87 -0
- package/plugins/smart-pro/skills/angular-components-table/SKILL.md +98 -0
- package/plugins/smart-pro/skills/angular-components-tabs/SKILL.md +99 -0
- package/plugins/smart-pro/skills/angular-components-textarea/SKILL.md +111 -0
- package/plugins/smart-pro/skills/angular-components-toggle/SKILL.md +109 -0
- package/plugins/smart-pro/skills/angular-components-vertical-navigation/SKILL.md +139 -0
- package/plugins/smart-pro/skills/audit-log/SKILL.md +82 -0
- package/plugins/smart-pro/skills/format-code/SKILL.md +46 -0
- package/plugins/smart-pro/skills/project-conventions/SKILL.md +90 -0
- package/plugins/smart-pro/skills/safety-check/SKILL.md +0 -0
- package/src/index.d.ts +6 -0
- package/src/index.js +7 -0
- package/src/index.js.map +1 -0
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
/**
|
|
3
|
+
* Merge flow-legacy plugin permissions into project's .claude/settings.json
|
|
4
|
+
*
|
|
5
|
+
* Usage:
|
|
6
|
+
* npx @smartsoft001/pro-claude-plugins flow-legacy:merge-permissions
|
|
7
|
+
*
|
|
8
|
+
* Or directly:
|
|
9
|
+
* node node_modules/@smartsoft001/pro-claude-plugins/plugins/flow-legacy/.claude-plugin/merge-permissions.js
|
|
10
|
+
*/
|
|
11
|
+
|
|
12
|
+
const fs = require('fs');
|
|
13
|
+
const path = require('path');
|
|
14
|
+
|
|
15
|
+
const SETTINGS_PATH = path.join(process.cwd(), '.claude', 'settings.json');
|
|
16
|
+
const TEMPLATE_PATH = path.join(__dirname, 'settings.template.json');
|
|
17
|
+
|
|
18
|
+
function loadJson(filePath) {
|
|
19
|
+
try {
|
|
20
|
+
return JSON.parse(fs.readFileSync(filePath, 'utf8'));
|
|
21
|
+
} catch (e) {
|
|
22
|
+
return null;
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
function mergeArrays(existing, template) {
|
|
27
|
+
return [...new Set([...existing, ...template])];
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
function main() {
|
|
31
|
+
console.log('Flow-Legacy Plugin - Merge Permissions\n');
|
|
32
|
+
|
|
33
|
+
// Load template
|
|
34
|
+
const template = loadJson(TEMPLATE_PATH);
|
|
35
|
+
if (!template) {
|
|
36
|
+
console.error('ERROR: Could not load template from:', TEMPLATE_PATH);
|
|
37
|
+
process.exit(1);
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
// Load or create settings
|
|
41
|
+
let settings = loadJson(SETTINGS_PATH);
|
|
42
|
+
if (!settings) {
|
|
43
|
+
console.log('Creating new .claude/settings.json...');
|
|
44
|
+
fs.mkdirSync(path.dirname(SETTINGS_PATH), { recursive: true });
|
|
45
|
+
settings = { permissions: { allow: [], deny: [], ask: [] } };
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
// Ensure permissions structure exists
|
|
49
|
+
settings.permissions = settings.permissions || {
|
|
50
|
+
allow: [],
|
|
51
|
+
deny: [],
|
|
52
|
+
ask: [],
|
|
53
|
+
};
|
|
54
|
+
settings.permissions.allow = settings.permissions.allow || [];
|
|
55
|
+
settings.permissions.ask = settings.permissions.ask || [];
|
|
56
|
+
settings.permissions.deny = settings.permissions.deny || [];
|
|
57
|
+
|
|
58
|
+
// Count before
|
|
59
|
+
const beforeAllow = settings.permissions.allow.length;
|
|
60
|
+
const beforeAsk = settings.permissions.ask.length;
|
|
61
|
+
|
|
62
|
+
// Merge permissions
|
|
63
|
+
settings.permissions.allow = mergeArrays(
|
|
64
|
+
settings.permissions.allow,
|
|
65
|
+
template.permissions.allow,
|
|
66
|
+
);
|
|
67
|
+
settings.permissions.ask = mergeArrays(
|
|
68
|
+
settings.permissions.ask,
|
|
69
|
+
template.permissions.ask,
|
|
70
|
+
);
|
|
71
|
+
|
|
72
|
+
// Enable plugin
|
|
73
|
+
settings.enabledPlugins = settings.enabledPlugins || {};
|
|
74
|
+
settings.enabledPlugins['flow-legacy@smart-pro'] = true;
|
|
75
|
+
|
|
76
|
+
// Write back
|
|
77
|
+
fs.writeFileSync(SETTINGS_PATH, JSON.stringify(settings, null, 2) + '\n');
|
|
78
|
+
|
|
79
|
+
// Report
|
|
80
|
+
const addedAllow = settings.permissions.allow.length - beforeAllow;
|
|
81
|
+
const addedAsk = settings.permissions.ask.length - beforeAsk;
|
|
82
|
+
|
|
83
|
+
console.log('Permissions merged successfully!\n');
|
|
84
|
+
console.log(
|
|
85
|
+
` allow: ${beforeAllow} -> ${settings.permissions.allow.length} (+${addedAllow})`,
|
|
86
|
+
);
|
|
87
|
+
console.log(
|
|
88
|
+
` ask: ${beforeAsk} -> ${settings.permissions.ask.length} (+${addedAsk})`,
|
|
89
|
+
);
|
|
90
|
+
console.log(`\nPlugin enabled: flow-legacy@smart-pro`);
|
|
91
|
+
console.log(`\nFile updated: ${SETTINGS_PATH}`);
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
main();
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://raw.githubusercontent.com/anthropics/claude-code/main/schemas/settings.schema.json",
|
|
3
|
+
"_description": "Template permissions for flow-legacy@smart-pro plugin. Merge these into your project's .claude/settings.json",
|
|
4
|
+
"permissions": {
|
|
5
|
+
"allow": [
|
|
6
|
+
"Bash(git status:*)",
|
|
7
|
+
"Bash(git diff:*)",
|
|
8
|
+
"Bash(git log:*)",
|
|
9
|
+
"Bash(git show:*)",
|
|
10
|
+
"Bash(git add:*)",
|
|
11
|
+
"Bash(git fetch:*)",
|
|
12
|
+
"Bash(git pull:*)",
|
|
13
|
+
"Bash(gh run list:*)",
|
|
14
|
+
"Bash(gh run view:*)",
|
|
15
|
+
"Bash(gh pr list:*)",
|
|
16
|
+
"Bash(nx:*)",
|
|
17
|
+
"Bash(npx nx:*)",
|
|
18
|
+
"Bash(npx tsc:*)",
|
|
19
|
+
"Bash(npm start)",
|
|
20
|
+
"Bash(npm run format:*)",
|
|
21
|
+
"Bash(npm audit:*)",
|
|
22
|
+
"Bash(npm install:*)",
|
|
23
|
+
"Bash(source:*)",
|
|
24
|
+
"Bash(nvm use:*)",
|
|
25
|
+
"Bash(curl:*)",
|
|
26
|
+
"Bash(lsof:*)",
|
|
27
|
+
"Bash(ls:*)",
|
|
28
|
+
"Bash(find:*)",
|
|
29
|
+
"Bash(grep:*)",
|
|
30
|
+
"Bash(xargs:*)",
|
|
31
|
+
"Bash(sleep:*)",
|
|
32
|
+
"Bash(rm:*)",
|
|
33
|
+
"Bash(test:*)",
|
|
34
|
+
"Bash(for:*)",
|
|
35
|
+
"Bash(node:*)",
|
|
36
|
+
"Bash(mkdir:*)",
|
|
37
|
+
"mcp__linear__get_issue",
|
|
38
|
+
"mcp__linear__list_issues",
|
|
39
|
+
"mcp__linear__list_comments",
|
|
40
|
+
"mcp__linear__save_comment",
|
|
41
|
+
"mcp__linear__delete_comment",
|
|
42
|
+
"mcp__linear__save_issue",
|
|
43
|
+
"mcp__linear__list_issue_statuses",
|
|
44
|
+
"mcp__linear__create_attachment",
|
|
45
|
+
"mcp__linear__get_attachment",
|
|
46
|
+
"mcp__linear__delete_attachment",
|
|
47
|
+
"mcp__linear__list_issue_labels",
|
|
48
|
+
"mcp__playwright__browser_snapshot",
|
|
49
|
+
"mcp__playwright__browser_take_screenshot",
|
|
50
|
+
"mcp__playwright__browser_navigate",
|
|
51
|
+
"mcp__playwright__browser_close",
|
|
52
|
+
"mcp__playwright__browser_wait_for",
|
|
53
|
+
"mcp__playwright__browser_click",
|
|
54
|
+
"mcp__playwright__browser_resize",
|
|
55
|
+
"mcp__playwright__browser_evaluate",
|
|
56
|
+
"mcp__playwright__browser_console_messages",
|
|
57
|
+
"mcp__playwright__browser_press_key",
|
|
58
|
+
"mcp__playwright__browser_network_requests",
|
|
59
|
+
"Skill(flow-legacy:maia-files-upload)",
|
|
60
|
+
"Skill(flow-legacy:maia-files-delete)",
|
|
61
|
+
"Skill(flow-legacy:browser-capture)",
|
|
62
|
+
"Skill(flow-legacy:linear-suggestion)",
|
|
63
|
+
"Skill(flow-legacy:test-unit)",
|
|
64
|
+
"Skill(flow-legacy:a11y-audit)"
|
|
65
|
+
],
|
|
66
|
+
"ask": [
|
|
67
|
+
"Skill(flow-legacy:commit)",
|
|
68
|
+
"Skill(flow-legacy:impl)",
|
|
69
|
+
"Skill(flow-legacy:plan)",
|
|
70
|
+
"Skill(flow-legacy:push)",
|
|
71
|
+
"Bash(git commit:*)",
|
|
72
|
+
"Bash(git push:*)",
|
|
73
|
+
"Bash(gh pr create:*)"
|
|
74
|
+
]
|
|
75
|
+
},
|
|
76
|
+
"enabledPlugins": {
|
|
77
|
+
"flow-legacy@smart-pro": true
|
|
78
|
+
}
|
|
79
|
+
}
|
|
@@ -0,0 +1,327 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: angular-component-scaffolder
|
|
3
|
+
description: Create Angular 14 components with NgModules and legacy patterns. Use when scaffolding new components following Angular 14 best practices (*ngIf/*ngFor, constructor DI, @Input/@Output).
|
|
4
|
+
tools: Read, Write, Glob, Grep
|
|
5
|
+
skills: karpathy-guidelines
|
|
6
|
+
model: sonnet
|
|
7
|
+
color: '#DD0031'
|
|
8
|
+
---
|
|
9
|
+
|
|
10
|
+
You are an expert at creating Angular 14 components following legacy best practices.
|
|
11
|
+
|
|
12
|
+
## Primary Responsibility
|
|
13
|
+
|
|
14
|
+
Create Angular components using Angular 14 patterns including NgModules, `*ngIf`/`*ngFor`, constructor injection, and `@Input()`/`@Output()` decorators.
|
|
15
|
+
|
|
16
|
+
## When to Use
|
|
17
|
+
|
|
18
|
+
- Creating new Angular components in legacy projects (Angular 14)
|
|
19
|
+
- Scaffolding component structure with template and styles
|
|
20
|
+
- Setting up component with proper constructor DI
|
|
21
|
+
|
|
22
|
+
## CRITICAL: Angular 14 Patterns (MANDATORY)
|
|
23
|
+
|
|
24
|
+
**NEVER use modern Angular 20+ patterns. ALWAYS use these legacy patterns:**
|
|
25
|
+
|
|
26
|
+
| Feature | ✅ CORRECT (Angular 14) | ❌ WRONG (Angular 20+) |
|
|
27
|
+
| --------------- | ------------------------ | ----------------------------- |
|
|
28
|
+
| Control flow | `*ngIf`, `*ngFor` | `@if`, `@for` |
|
|
29
|
+
| DI | Constructor injection | `inject()` |
|
|
30
|
+
| Inputs | `@Input()` decorator | `input()`, `input.required()` |
|
|
31
|
+
| Outputs | `@Output()` decorator | `output()` |
|
|
32
|
+
| Two-way binding | `@Input()` + `@Output()` | `model()` |
|
|
33
|
+
| State | Class properties | `signal()` |
|
|
34
|
+
| Derived state | Getters or manual | `computed()` |
|
|
35
|
+
|
|
36
|
+
## Project-Specific Patterns
|
|
37
|
+
|
|
38
|
+
This project uses:
|
|
39
|
+
|
|
40
|
+
- **NgModules** - components must be declared in modules
|
|
41
|
+
- **`*ngIf` and `*ngFor`** for control flow
|
|
42
|
+
- **Constructor injection** for DI
|
|
43
|
+
- **`@Input()` and `@Output()`** decorators
|
|
44
|
+
- **No signals** - use class properties and BehaviorSubject
|
|
45
|
+
- **Tailwind CSS** with `smart-` prefix (if applicable)
|
|
46
|
+
|
|
47
|
+
## Component Templates
|
|
48
|
+
|
|
49
|
+
### Basic Component
|
|
50
|
+
|
|
51
|
+
```typescript
|
|
52
|
+
import { Component, OnInit, OnDestroy } from '@angular/core';
|
|
53
|
+
import { Subject } from 'rxjs';
|
|
54
|
+
import { takeUntil } from 'rxjs/operators';
|
|
55
|
+
|
|
56
|
+
@Component({
|
|
57
|
+
selector: 'app-feature-name',
|
|
58
|
+
templateUrl: './feature-name.component.html',
|
|
59
|
+
styleUrls: ['./feature-name.component.scss'],
|
|
60
|
+
})
|
|
61
|
+
export class FeatureNameComponent implements OnInit, OnDestroy {
|
|
62
|
+
// Class properties for state (NOT signals)
|
|
63
|
+
isLoading = false;
|
|
64
|
+
data: DataType[] = [];
|
|
65
|
+
error: string | null = null;
|
|
66
|
+
|
|
67
|
+
// Destroy subject for cleanup
|
|
68
|
+
private readonly destroy$ = new Subject<void>();
|
|
69
|
+
|
|
70
|
+
// Constructor injection (NOT inject())
|
|
71
|
+
constructor(
|
|
72
|
+
private readonly dataService: DataService,
|
|
73
|
+
private readonly router: Router,
|
|
74
|
+
) {}
|
|
75
|
+
|
|
76
|
+
ngOnInit(): void {
|
|
77
|
+
this.loadData();
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
ngOnDestroy(): void {
|
|
81
|
+
this.destroy$.next();
|
|
82
|
+
this.destroy$.complete();
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
private loadData(): void {
|
|
86
|
+
this.isLoading = true;
|
|
87
|
+
this.dataService
|
|
88
|
+
.getData()
|
|
89
|
+
.pipe(takeUntil(this.destroy$))
|
|
90
|
+
.subscribe({
|
|
91
|
+
next: (data) => {
|
|
92
|
+
this.data = data;
|
|
93
|
+
this.isLoading = false;
|
|
94
|
+
},
|
|
95
|
+
error: (err) => {
|
|
96
|
+
this.error = err.message;
|
|
97
|
+
this.isLoading = false;
|
|
98
|
+
},
|
|
99
|
+
});
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
// Getter for derived state (NOT computed())
|
|
103
|
+
get itemCount(): number {
|
|
104
|
+
return this.data.length;
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
get hasData(): boolean {
|
|
108
|
+
return this.data.length > 0;
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
```
|
|
112
|
+
|
|
113
|
+
### Component with Inputs/Outputs
|
|
114
|
+
|
|
115
|
+
```typescript
|
|
116
|
+
import {
|
|
117
|
+
Component,
|
|
118
|
+
Input,
|
|
119
|
+
Output,
|
|
120
|
+
EventEmitter,
|
|
121
|
+
OnChanges,
|
|
122
|
+
SimpleChanges,
|
|
123
|
+
} from '@angular/core';
|
|
124
|
+
|
|
125
|
+
@Component({
|
|
126
|
+
selector: 'app-item-card',
|
|
127
|
+
templateUrl: './item-card.component.html',
|
|
128
|
+
styleUrls: ['./item-card.component.scss'],
|
|
129
|
+
})
|
|
130
|
+
export class ItemCardComponent implements OnChanges {
|
|
131
|
+
// Inputs with @Input() decorator (NOT input())
|
|
132
|
+
@Input() label!: string; // Required input
|
|
133
|
+
@Input() item!: Item; // Required input
|
|
134
|
+
@Input() showActions = true; // Optional with default
|
|
135
|
+
|
|
136
|
+
// Outputs with @Output() decorator (NOT output())
|
|
137
|
+
@Output() selected = new EventEmitter<Item>();
|
|
138
|
+
@Output() closed = new EventEmitter<void>();
|
|
139
|
+
|
|
140
|
+
// Internal state (NOT signals)
|
|
141
|
+
isOpen = false;
|
|
142
|
+
|
|
143
|
+
ngOnChanges(changes: SimpleChanges): void {
|
|
144
|
+
if (changes['item']) {
|
|
145
|
+
// React to input changes
|
|
146
|
+
console.log('Item changed:', this.item);
|
|
147
|
+
}
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
onSelect(): void {
|
|
151
|
+
this.selected.emit(this.item);
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
onClose(): void {
|
|
155
|
+
this.closed.emit();
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
toggleDropdown(force?: boolean): void {
|
|
159
|
+
this.isOpen = force ?? !this.isOpen;
|
|
160
|
+
}
|
|
161
|
+
}
|
|
162
|
+
```
|
|
163
|
+
|
|
164
|
+
### Two-Way Binding Component
|
|
165
|
+
|
|
166
|
+
```typescript
|
|
167
|
+
import { Component, Input, Output, EventEmitter } from '@angular/core';
|
|
168
|
+
|
|
169
|
+
@Component({
|
|
170
|
+
selector: 'app-search-input',
|
|
171
|
+
templateUrl: './search-input.component.html',
|
|
172
|
+
})
|
|
173
|
+
export class SearchInputComponent {
|
|
174
|
+
// Two-way binding with @Input + @Output pattern (NOT model())
|
|
175
|
+
@Input() searchText = '';
|
|
176
|
+
@Output() searchTextChange = new EventEmitter<string>();
|
|
177
|
+
|
|
178
|
+
onSearchChange(value: string): void {
|
|
179
|
+
this.searchText = value;
|
|
180
|
+
this.searchTextChange.emit(value);
|
|
181
|
+
}
|
|
182
|
+
}
|
|
183
|
+
```
|
|
184
|
+
|
|
185
|
+
Usage in parent:
|
|
186
|
+
|
|
187
|
+
```html
|
|
188
|
+
<app-search-input [(searchText)]="filterText"></app-search-input>
|
|
189
|
+
```
|
|
190
|
+
|
|
191
|
+
## Template Patterns
|
|
192
|
+
|
|
193
|
+
### Control Flow with *ngIf and *ngFor
|
|
194
|
+
|
|
195
|
+
```html
|
|
196
|
+
<!-- Loading state with *ngIf -->
|
|
197
|
+
<div *ngIf="isLoading" class="loading-spinner">
|
|
198
|
+
<app-spinner></app-spinner>
|
|
199
|
+
</div>
|
|
200
|
+
|
|
201
|
+
<!-- Error state with *ngIf -->
|
|
202
|
+
<div *ngIf="error" class="error-message">
|
|
203
|
+
<app-error [message]="error"></app-error>
|
|
204
|
+
</div>
|
|
205
|
+
|
|
206
|
+
<!-- Content with *ngIf and *ngFor -->
|
|
207
|
+
<div *ngIf="!isLoading && !error" class="content">
|
|
208
|
+
<ul *ngIf="hasData; else emptyTemplate">
|
|
209
|
+
<li *ngFor="let item of data; trackBy: trackByFn">
|
|
210
|
+
<app-item-card
|
|
211
|
+
[item]="item"
|
|
212
|
+
(selected)="onSelect($event)"
|
|
213
|
+
></app-item-card>
|
|
214
|
+
</li>
|
|
215
|
+
</ul>
|
|
216
|
+
|
|
217
|
+
<ng-template #emptyTemplate>
|
|
218
|
+
<p class="empty-message">{{ 'COMMON.noItems' | translate }}</p>
|
|
219
|
+
</ng-template>
|
|
220
|
+
</div>
|
|
221
|
+
```
|
|
222
|
+
|
|
223
|
+
### TrackBy Function
|
|
224
|
+
|
|
225
|
+
```typescript
|
|
226
|
+
// Always provide trackBy for *ngFor
|
|
227
|
+
trackByFn(index: number, item: Item): string {
|
|
228
|
+
return item.id;
|
|
229
|
+
}
|
|
230
|
+
```
|
|
231
|
+
|
|
232
|
+
## Module Declaration
|
|
233
|
+
|
|
234
|
+
Components MUST be declared in a module:
|
|
235
|
+
|
|
236
|
+
```typescript
|
|
237
|
+
import { NgModule } from '@angular/core';
|
|
238
|
+
import { CommonModule } from '@angular/common';
|
|
239
|
+
import { TranslateModule } from '@ngx-translate/core';
|
|
240
|
+
|
|
241
|
+
import { FeatureNameComponent } from './feature-name.component';
|
|
242
|
+
import { ItemCardComponent } from './item-card/item-card.component';
|
|
243
|
+
|
|
244
|
+
@NgModule({
|
|
245
|
+
declarations: [FeatureNameComponent, ItemCardComponent],
|
|
246
|
+
imports: [CommonModule, TranslateModule],
|
|
247
|
+
exports: [FeatureNameComponent, ItemCardComponent],
|
|
248
|
+
})
|
|
249
|
+
export class FeatureModule {}
|
|
250
|
+
```
|
|
251
|
+
|
|
252
|
+
## File Structure
|
|
253
|
+
|
|
254
|
+
```
|
|
255
|
+
feature-name/
|
|
256
|
+
feature-name.component.ts # Component class
|
|
257
|
+
feature-name.component.html # Template
|
|
258
|
+
feature-name.component.scss # Styles
|
|
259
|
+
feature-name.component.spec.ts # Tests
|
|
260
|
+
feature-name.module.ts # Module (if standalone feature)
|
|
261
|
+
```
|
|
262
|
+
|
|
263
|
+
## Scaffolding Checklist
|
|
264
|
+
|
|
265
|
+
- [ ] Uses NgModule (NOT standalone)
|
|
266
|
+
- [ ] Uses constructor injection (NOT `inject()`)
|
|
267
|
+
- [ ] Uses `@Input()` / `@Output()` decorators (NOT `input()` / `output()`)
|
|
268
|
+
- [ ] Uses `*ngIf` / `*ngFor` in template (NOT `@if` / `@for`)
|
|
269
|
+
- [ ] Has `trackBy` function for all `*ngFor` loops
|
|
270
|
+
- [ ] Uses class properties for state (NOT signals)
|
|
271
|
+
- [ ] Uses getters for derived values (NOT `computed()`)
|
|
272
|
+
- [ ] Has `OnDestroy` with Subject for cleanup
|
|
273
|
+
- [ ] Declared in a module
|
|
274
|
+
- [ ] Imports `TranslateModule` if using translations
|
|
275
|
+
- [ ] Has proper TypeScript types
|
|
276
|
+
|
|
277
|
+
## Output Format
|
|
278
|
+
|
|
279
|
+
````markdown
|
|
280
|
+
## Component Scaffolded
|
|
281
|
+
|
|
282
|
+
### Files Created
|
|
283
|
+
|
|
284
|
+
| File | Purpose |
|
|
285
|
+
| -------------------------------- | --------------- |
|
|
286
|
+
| `feature-name.component.ts` | Component class |
|
|
287
|
+
| `feature-name.component.html` | Template |
|
|
288
|
+
| `feature-name.component.scss` | Styles |
|
|
289
|
+
| `feature-name.component.spec.ts` | Unit tests |
|
|
290
|
+
|
|
291
|
+
### Component API
|
|
292
|
+
|
|
293
|
+
**Inputs:**
|
|
294
|
+
|
|
295
|
+
- `@Input() item: Item` (required)
|
|
296
|
+
- `@Input() showActions: boolean` (default: true)
|
|
297
|
+
|
|
298
|
+
**Outputs:**
|
|
299
|
+
|
|
300
|
+
- `@Output() selected: EventEmitter<Item>`
|
|
301
|
+
|
|
302
|
+
### Angular 14 Patterns Used
|
|
303
|
+
|
|
304
|
+
- ✅ Constructor injection
|
|
305
|
+
- ✅ `*ngIf` / `*ngFor` control flow
|
|
306
|
+
- ✅ `@Input()` / `@Output()` decorators
|
|
307
|
+
- ✅ Class properties for state
|
|
308
|
+
- ✅ Getters for derived values
|
|
309
|
+
|
|
310
|
+
### Module Registration
|
|
311
|
+
|
|
312
|
+
Add to module declarations:
|
|
313
|
+
|
|
314
|
+
```typescript
|
|
315
|
+
declarations: [FeatureNameComponent];
|
|
316
|
+
```
|
|
317
|
+
````
|
|
318
|
+
|
|
319
|
+
### Next Steps
|
|
320
|
+
|
|
321
|
+
1. Implement component logic
|
|
322
|
+
2. Add to module declarations
|
|
323
|
+
3. Add to routing or parent component
|
|
324
|
+
|
|
325
|
+
```
|
|
326
|
+
|
|
327
|
+
```
|