@1aboveio/app-dev-skills 0.1.0 → 0.1.2
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/README.md +2 -0
- package/package.json +7 -6
- package/skills/airflow/SKILL.md +1 -1
- package/skills/android-foundation/SKILL.md +1 -1
- package/skills/app-debug/SKILL.md +1 -1
- package/skills/better-auth/SKILL.md +1 -1
- package/skills/data-catalog/LICENSE +3 -0
- package/skills/data-catalog/SKILL.md +208 -0
- package/skills/data-catalog/agents/openai.yaml +3 -0
- package/skills/data-catalog/references/data-catalog-conventions.md +77 -0
- package/skills/data-catalog/references/field-definitions.md +124 -0
- package/skills/data-catalog/references/format.md +134 -0
- package/skills/data-catalog/release-check.mjs +93 -0
- package/skills/data-catalog/scripts/data-catalog.test.mjs +36 -0
- package/skills/data-catalog/scripts/data_catalog.py +1447 -0
- package/skills/data-catalog/scripts/persist-conventions-core.mjs +117 -0
- package/skills/data-catalog/scripts/persist-conventions.mjs +17 -0
- package/skills/data-catalog/scripts/test_data_catalog.py +618 -0
- package/skills/data-quality/LICENSE +3 -0
- package/skills/data-quality/SKILL.md +96 -0
- package/skills/data-quality/agents/openai.yaml +3 -0
- package/skills/data-quality/references/checks.md +56 -0
- package/skills/data-quality/release-check.mjs +93 -0
- package/skills/data-quality/scripts/data-quality.test.mjs +12 -0
- package/skills/data-quality/scripts/data_quality.py +405 -0
- package/skills/data-quality/scripts/test_data_quality.py +277 -0
- package/skills/ios-foundation/SKILL.md +1 -1
- package/skills/monorepo/SKILL.md +1 -1
- package/skills/nextjs-fullstack/SKILL.md +1 -1
- package/skills/prisma-setup/SKILL.md +1 -1
- package/skills/pyspark/SKILL.md +1 -1
- package/skills/python-backend/SKILL.md +1 -1
- package/skills/shadcn/SKILL.md +1 -1
- package/skills/zod-v4/SKILL.md +1 -1
|
@@ -0,0 +1,117 @@
|
|
|
1
|
+
// persist-conventions-core — write one skill's section into a repo's
|
|
2
|
+
// CONTRIBUTING.md, point AGENTS.md at the file, and make CLAUDE.md a symlink to
|
|
3
|
+
// AGENTS.md (Claude Code reads CLAUDE.md, not AGENTS.md). Import-only: each skill's
|
|
4
|
+
// `persist-conventions.mjs` is the always-running CLI wrapper that names its
|
|
5
|
+
// section, so no main-module guard here.
|
|
6
|
+
//
|
|
7
|
+
// Byte-identical copies live in test-quality (Testing conventions), github-flow
|
|
8
|
+
// (CI conventions, Delivery) and data-catalog (Data catalog conventions);
|
|
9
|
+
// skills/conventions-sections.test.mjs keeps them identical and proves the sections
|
|
10
|
+
// coexist in one file.
|
|
11
|
+
//
|
|
12
|
+
// A section sits between `conventions:<id>` markers, so a re-run replaces only
|
|
13
|
+
// that block and keeps everything else, including other skills' sections.
|
|
14
|
+
// Nothing is written without --write: the user triggers the write, not an agent.
|
|
15
|
+
|
|
16
|
+
import fs from 'node:fs'
|
|
17
|
+
import path from 'node:path'
|
|
18
|
+
|
|
19
|
+
export const CONTRIBUTING_FILE = 'CONTRIBUTING.md'
|
|
20
|
+
const MENTIONS_CONTRIBUTING = /(?:^|[^\w-])CONTRIBUTING\.md/
|
|
21
|
+
|
|
22
|
+
export const AGENTS_SECTION = [
|
|
23
|
+
'## Contributing',
|
|
24
|
+
'',
|
|
25
|
+
`Follow [${CONTRIBUTING_FILE}](${CONTRIBUTING_FILE}) when writing, reviewing, or delivering code: tests, CI, data definitions, and what to do after each commit.`,
|
|
26
|
+
'',
|
|
27
|
+
].join('\n')
|
|
28
|
+
|
|
29
|
+
export function markers(id) {
|
|
30
|
+
return [`<!-- conventions:${id}:start -->`, `<!-- conventions:${id}:end -->`]
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
export function sectionBlock({ id, owner, body }) {
|
|
34
|
+
const [start, end] = markers(id)
|
|
35
|
+
const note = `<!-- Written by the ${owner} skill: re-run its persist-conventions.mjs --write to update; edit outside these markers. -->`
|
|
36
|
+
return `${start}\n${note}\n\n${body.trim()}\n${end}\n`
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
// Pure: the new CONTRIBUTING.md text given the current one (or null).
|
|
40
|
+
export function renderConventions(current, id, block) {
|
|
41
|
+
if (current == null) return `# Contributing\n\n${block}`
|
|
42
|
+
const [start, end] = markers(id)
|
|
43
|
+
const from = current.indexOf(start)
|
|
44
|
+
const to = current.indexOf(end)
|
|
45
|
+
if (from !== -1 && to > from) {
|
|
46
|
+
const after = current.slice(to + end.length).replace(/^\r?\n/, '')
|
|
47
|
+
return current.slice(0, from) + block + after
|
|
48
|
+
}
|
|
49
|
+
return `${current.replace(/\s*$/, '')}\n\n${block}`
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
// Pure: the new AGENTS.md text given the current one (or null).
|
|
53
|
+
export function renderAgents(current) {
|
|
54
|
+
if (current == null) return `# AGENTS.md\n\n${AGENTS_SECTION}`
|
|
55
|
+
if (MENTIONS_CONTRIBUTING.test(current)) return current
|
|
56
|
+
return `${current.replace(/\s*$/, '')}\n\n${AGENTS_SECTION}`
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
// A missing CLAUDE.md becomes a symlink to AGENTS.md.
|
|
60
|
+
export const LINK_TO_AGENTS = Symbol('link CLAUDE.md to AGENTS.md')
|
|
61
|
+
|
|
62
|
+
// Pure: the new CLAUDE.md text given the current one (or null). A missing file
|
|
63
|
+
// becomes LINK_TO_AGENTS; a regular file keeps its content and gains the pointer
|
|
64
|
+
// unless it already names AGENTS.md or CONTRIBUTING.md.
|
|
65
|
+
export function renderClaude(current) {
|
|
66
|
+
if (current == null) return LINK_TO_AGENTS
|
|
67
|
+
if (/(?:^|[^\w-])(?:AGENTS|CONTRIBUTING)\.md/.test(current)) return current
|
|
68
|
+
return `${current.replace(/\s*$/, '')}\n\n${AGENTS_SECTION}`
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
export function persist(repoRoot, section, { write = false } = {}) {
|
|
72
|
+
const block = sectionBlock(section)
|
|
73
|
+
const plan = [
|
|
74
|
+
[CONTRIBUTING_FILE, (text) => renderConventions(text, section.id, block)],
|
|
75
|
+
['AGENTS.md', renderAgents],
|
|
76
|
+
['CLAUDE.md', renderClaude],
|
|
77
|
+
]
|
|
78
|
+
return plan.map(([name, render]) => {
|
|
79
|
+
const file = path.join(repoRoot, name)
|
|
80
|
+
if (fs.lstatSync(file, { throwIfNoEntry: false })?.isSymbolicLink()) return { file: name, action: 'unchanged' }
|
|
81
|
+
const current = fs.existsSync(file) ? fs.readFileSync(file, 'utf8') : null
|
|
82
|
+
const next = render(current)
|
|
83
|
+
const action = current == null ? 'create' : next === current ? 'unchanged' : 'update'
|
|
84
|
+
if (next === LINK_TO_AGENTS) {
|
|
85
|
+
if (write) fs.symlinkSync('AGENTS.md', file)
|
|
86
|
+
return { file: name, action: 'link' }
|
|
87
|
+
}
|
|
88
|
+
if (write && action !== 'unchanged') fs.writeFileSync(file, next)
|
|
89
|
+
return { file: name, action }
|
|
90
|
+
})
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
// `section` = { id, owner, title, body }. Exit 0 on success, 2 on a usage error.
|
|
94
|
+
export function runCli(argv, section, { cwd = process.cwd(), log = console.log } = {}) {
|
|
95
|
+
let repoRoot = cwd
|
|
96
|
+
let write = false
|
|
97
|
+
for (let i = 0; i < argv.length; i++) {
|
|
98
|
+
if (argv[i] === '--write') write = true
|
|
99
|
+
else if (argv[i] === '--repo-root' && argv[i + 1]) repoRoot = path.resolve(cwd, argv[++i])
|
|
100
|
+
else {
|
|
101
|
+
log(`persist-conventions: unknown argument ${argv[i]}`)
|
|
102
|
+
return 2
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
if (!fs.statSync(repoRoot, { throwIfNoEntry: false })?.isDirectory()) {
|
|
106
|
+
log(`persist-conventions: not a directory: ${repoRoot}`)
|
|
107
|
+
return 2
|
|
108
|
+
}
|
|
109
|
+
const results = persist(repoRoot, section, { write })
|
|
110
|
+
const done = { create: 'created', link: 'linked to AGENTS.md', update: 'updated', unchanged: 'unchanged' }
|
|
111
|
+
for (const r of results) log(` ${r.file}: ${write || r.action === 'unchanged' ? done[r.action] : `would ${r.action}`}`)
|
|
112
|
+
const changed = results.filter((r) => r.action !== 'unchanged').length
|
|
113
|
+
log(write
|
|
114
|
+
? `persist-conventions: ${section.title}: ${changed} file(s) written, ${results.length - changed} unchanged`
|
|
115
|
+
: `persist-conventions: ${section.title}: preview only, ${changed} file(s) would change; re-run with --write to write`)
|
|
116
|
+
return 0
|
|
117
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
// persist-conventions — the data catalog conventions as the
|
|
2
|
+
// `## Data catalog conventions` section of a repo's CONTRIBUTING.md (../SKILL.md,
|
|
3
|
+
// First use in a repo). Previews unless --write.
|
|
4
|
+
//
|
|
5
|
+
// node persist-conventions.mjs [--repo-root <dir>] [--write]
|
|
6
|
+
import fs from 'node:fs'
|
|
7
|
+
import { fileURLToPath } from 'node:url'
|
|
8
|
+
import { runCli } from './persist-conventions-core.mjs'
|
|
9
|
+
|
|
10
|
+
const SECTION = {
|
|
11
|
+
id: 'data-catalog',
|
|
12
|
+
owner: 'data-catalog',
|
|
13
|
+
title: 'Data catalog conventions',
|
|
14
|
+
body: fs.readFileSync(fileURLToPath(new URL('../references/data-catalog-conventions.md', import.meta.url)), 'utf8'),
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
process.exitCode = runCli(process.argv.slice(2), SECTION)
|