docspec 0.1.0 → 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/README.docspec.md +180 -0
- package/README.md +127 -31
- package/dist/__tests__/cli.test.js +27 -39
- package/dist/__tests__/cli.test.js.map +1 -1
- package/dist/__tests__/constants.test.js +8 -18
- package/dist/__tests__/constants.test.js.map +1 -1
- package/dist/__tests__/generator.test.js +16 -16
- package/dist/__tests__/generator.test.js.map +1 -1
- package/dist/__tests__/validator.test.js +50 -94
- package/dist/__tests__/validator.test.js.map +1 -1
- package/dist/cli.js +3 -4
- package/dist/cli.js.map +1 -1
- package/dist/constants.d.ts +3 -2
- package/dist/constants.d.ts.map +1 -1
- package/dist/constants.js +52 -40
- package/dist/constants.js.map +1 -1
- package/dist/format-parser.d.ts +23 -0
- package/dist/format-parser.d.ts.map +1 -0
- package/dist/format-parser.js +175 -0
- package/dist/format-parser.js.map +1 -0
- package/dist/generator.d.ts +4 -5
- package/dist/generator.d.ts.map +1 -1
- package/dist/generator.js +9 -20
- package/dist/generator.js.map +1 -1
- package/dist/validator.js +5 -0
- package/dist/validator.js.map +1 -1
- package/docspec-format.md +45 -0
- package/package.json +4 -3
package/dist/constants.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"constants.js","sourceRoot":"","sources":["../src/constants.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"constants.js","sourceRoot":"","sources":["../src/constants.ts"],"names":[],"mappings":";;;AAgDA,gDA0BC;AA1ED,mDAAmF;AAEnF,IAAI,YAAY,GAAwB,IAAI,CAAC;AAE7C;;GAEG;AACH,SAAS,UAAU;IACjB,IAAI,YAAY,EAAE,CAAC;QACjB,OAAO,YAAY,CAAC;IACtB,CAAC;IAED,IAAI,CAAC;QACH,MAAM,UAAU,GAAG,IAAA,iCAAiB,GAAE,CAAC;QACvC,YAAY,GAAG,IAAA,+BAAe,EAAC,UAAU,CAAC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Ac,CAAC,CAAC;QAC9F,wBAAwB,GAAG,4BAA4B,YAAY,MAAM,CAAC;IAC5E,CAAC;IAED,6CAA6C;IAC7C,QAAQ,GAAG,QAAQ,CAAC,OAAO,CAAC,6BAA6B,EAAE,wBAAwB,CAAC,CAAC;IAErF,oBAAoB;IACpB,MAAM,QAAQ,GAAG,MAAM,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,OAAO,EAAE,EAAE;QAC/C,OAAO,MAAM,OAAO,CAAC,MAAM,KAAK,OAAO,CAAC,IAAI,OAAO,OAAO,CAAC,WAAW,EAAE,CAAC;IAC3E,CAAC,CAAC,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;IAEhB,mCAAmC;IACnC,QAAQ,GAAG,QAAQ,CAAC,OAAO,CAAC,mBAAmB,EAAE,QAAQ,CAAC,CAAC;IAE3D,OAAO,QAAQ,CAAC;AAClB,CAAC"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
export interface ParsedSection {
|
|
2
|
+
name: string;
|
|
3
|
+
boilerplate: string;
|
|
4
|
+
number: number;
|
|
5
|
+
}
|
|
6
|
+
export interface ParsedFormat {
|
|
7
|
+
sections: ParsedSection[];
|
|
8
|
+
template: string;
|
|
9
|
+
agentInstructions?: string;
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* Parse the docspec format file
|
|
13
|
+
*/
|
|
14
|
+
export declare function parseFormatFile(formatFilePath: string): ParsedFormat;
|
|
15
|
+
/**
|
|
16
|
+
* Parse format content from a string
|
|
17
|
+
*/
|
|
18
|
+
export declare function parseFormatContent(content: string): ParsedFormat;
|
|
19
|
+
/**
|
|
20
|
+
* Get the path to the format file
|
|
21
|
+
*/
|
|
22
|
+
export declare function getFormatFilePath(): string;
|
|
23
|
+
//# sourceMappingURL=format-parser.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"format-parser.d.ts","sourceRoot":"","sources":["../src/format-parser.ts"],"names":[],"mappings":"AAGA,MAAM,WAAW,aAAa;IAC5B,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,MAAM,CAAC;IACpB,MAAM,EAAE,MAAM,CAAC;CAChB;AAED,MAAM,WAAW,YAAY;IAC3B,QAAQ,EAAE,aAAa,EAAE,CAAC;IAC1B,QAAQ,EAAE,MAAM,CAAC;IACjB,iBAAiB,CAAC,EAAE,MAAM,CAAC;CAC5B;AAED;;GAEG;AACH,wBAAgB,eAAe,CAAC,cAAc,EAAE,MAAM,GAAG,YAAY,CAGpE;AAED;;GAEG;AACH,wBAAgB,kBAAkB,CAAC,OAAO,EAAE,MAAM,GAAG,YAAY,CA2HhE;AAED;;GAEG;AACH,wBAAgB,iBAAiB,IAAI,MAAM,CAkB1C"}
|
|
@@ -0,0 +1,175 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
35
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
|
+
exports.parseFormatFile = parseFormatFile;
|
|
37
|
+
exports.parseFormatContent = parseFormatContent;
|
|
38
|
+
exports.getFormatFilePath = getFormatFilePath;
|
|
39
|
+
const fs = __importStar(require("fs"));
|
|
40
|
+
const path = __importStar(require("path"));
|
|
41
|
+
/**
|
|
42
|
+
* Parse the docspec format file
|
|
43
|
+
*/
|
|
44
|
+
function parseFormatFile(formatFilePath) {
|
|
45
|
+
const content = fs.readFileSync(formatFilePath, "utf-8");
|
|
46
|
+
return parseFormatContent(content);
|
|
47
|
+
}
|
|
48
|
+
/**
|
|
49
|
+
* Parse format content from a string
|
|
50
|
+
*/
|
|
51
|
+
function parseFormatContent(content) {
|
|
52
|
+
const lines = content.split("\n");
|
|
53
|
+
// Look for AGENT INSTRUCTIONS section first
|
|
54
|
+
let agentInstructions;
|
|
55
|
+
let agentInstructionsStart = -1;
|
|
56
|
+
let agentInstructionsEnd = -1;
|
|
57
|
+
for (let i = 0; i < lines.length; i++) {
|
|
58
|
+
if (lines[i].trim() === "## AGENT INSTRUCTIONS") {
|
|
59
|
+
agentInstructionsStart = i;
|
|
60
|
+
break;
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
// If AGENT INSTRUCTIONS section found, extract it
|
|
64
|
+
if (agentInstructionsStart >= 0) {
|
|
65
|
+
// Find the end of the AGENT INSTRUCTIONS section
|
|
66
|
+
// It ends at the next section header (##) or end of file
|
|
67
|
+
for (let i = agentInstructionsStart + 1; i < lines.length; i++) {
|
|
68
|
+
const trimmedLine = lines[i].trim();
|
|
69
|
+
// Check if this is a section header (starts with ##)
|
|
70
|
+
if (trimmedLine.match(/^##\s+/)) {
|
|
71
|
+
agentInstructionsEnd = i;
|
|
72
|
+
break;
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
if (agentInstructionsEnd < 0) {
|
|
76
|
+
agentInstructionsEnd = lines.length;
|
|
77
|
+
}
|
|
78
|
+
// Extract content between header and next section
|
|
79
|
+
const agentLines = lines.slice(agentInstructionsStart + 1, agentInstructionsEnd);
|
|
80
|
+
let agentContent = agentLines.join("\n");
|
|
81
|
+
// Remove separator lines (---) from the content
|
|
82
|
+
agentContent = agentContent
|
|
83
|
+
.split("\n")
|
|
84
|
+
.filter(line => line.trim() !== "---")
|
|
85
|
+
.join("\n")
|
|
86
|
+
.trim();
|
|
87
|
+
if (agentContent) {
|
|
88
|
+
agentInstructions = agentContent;
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
// Find all section headers: ## N. Section Name
|
|
92
|
+
const sectionHeaderRegex = /^##\s+(\d+)\.\s+(.+)$/;
|
|
93
|
+
const sectionHeaders = [];
|
|
94
|
+
for (let i = 0; i < lines.length; i++) {
|
|
95
|
+
// Skip the AGENT INSTRUCTIONS header if it exists
|
|
96
|
+
if (lines[i].trim() === "## AGENT INSTRUCTIONS") {
|
|
97
|
+
continue;
|
|
98
|
+
}
|
|
99
|
+
const match = lines[i].match(sectionHeaderRegex);
|
|
100
|
+
if (match) {
|
|
101
|
+
sectionHeaders.push({
|
|
102
|
+
lineIndex: i,
|
|
103
|
+
number: parseInt(match[1], 10),
|
|
104
|
+
name: match[2].trim(),
|
|
105
|
+
});
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
if (sectionHeaders.length === 0) {
|
|
109
|
+
throw new Error("No section headers found in format file. Expected format: ## N. Section Name");
|
|
110
|
+
}
|
|
111
|
+
// Extract template: everything before the first numbered section header
|
|
112
|
+
// But exclude the AGENT INSTRUCTIONS section if it exists
|
|
113
|
+
const firstSectionLine = sectionHeaders[0].lineIndex;
|
|
114
|
+
let templateBeforeSections;
|
|
115
|
+
if (agentInstructionsStart >= 0 && agentInstructionsStart < firstSectionLine) {
|
|
116
|
+
// AGENT INSTRUCTIONS is between title and first section
|
|
117
|
+
// Template is everything before AGENT INSTRUCTIONS
|
|
118
|
+
templateBeforeSections = lines.slice(0, agentInstructionsStart).join("\n").trim();
|
|
119
|
+
}
|
|
120
|
+
else {
|
|
121
|
+
// No AGENT INSTRUCTIONS, use everything before first section
|
|
122
|
+
templateBeforeSections = lines.slice(0, firstSectionLine).join("\n").trim();
|
|
123
|
+
}
|
|
124
|
+
const template = templateBeforeSections + "\n\n{{AGENT_INSTRUCTIONS}}\n\n{{SECTIONS}}\n";
|
|
125
|
+
// Extract sections
|
|
126
|
+
const sections = [];
|
|
127
|
+
for (let i = 0; i < sectionHeaders.length; i++) {
|
|
128
|
+
const header = sectionHeaders[i];
|
|
129
|
+
const nextHeaderLine = i < sectionHeaders.length - 1
|
|
130
|
+
? sectionHeaders[i + 1].lineIndex
|
|
131
|
+
: lines.length;
|
|
132
|
+
// Extract content between this header and the next header
|
|
133
|
+
const sectionLines = lines.slice(header.lineIndex + 1, nextHeaderLine);
|
|
134
|
+
let sectionContent = sectionLines.join("\n");
|
|
135
|
+
// Remove separator lines (---) from the content
|
|
136
|
+
sectionContent = sectionContent
|
|
137
|
+
.split("\n")
|
|
138
|
+
.filter(line => line.trim() !== "---")
|
|
139
|
+
.join("\n")
|
|
140
|
+
.trim();
|
|
141
|
+
sections.push({
|
|
142
|
+
name: header.name,
|
|
143
|
+
boilerplate: sectionContent,
|
|
144
|
+
number: header.number,
|
|
145
|
+
});
|
|
146
|
+
}
|
|
147
|
+
// Sort sections by number to ensure correct order
|
|
148
|
+
sections.sort((a, b) => a.number - b.number);
|
|
149
|
+
return {
|
|
150
|
+
sections,
|
|
151
|
+
template,
|
|
152
|
+
agentInstructions,
|
|
153
|
+
};
|
|
154
|
+
}
|
|
155
|
+
/**
|
|
156
|
+
* Get the path to the format file
|
|
157
|
+
*/
|
|
158
|
+
function getFormatFilePath() {
|
|
159
|
+
// In development: use src/docspec-format.md
|
|
160
|
+
// In built package: use dist/docspec-format.md or root docspec-format.md
|
|
161
|
+
// Try multiple locations
|
|
162
|
+
const possiblePaths = [
|
|
163
|
+
path.join(__dirname, "..", "docspec-format.md"), // Root of project
|
|
164
|
+
path.join(__dirname, "docspec-format.md"), // In dist/ if copied there
|
|
165
|
+
path.join(process.cwd(), "docspec-format.md"), // Current working directory
|
|
166
|
+
];
|
|
167
|
+
for (const formatPath of possiblePaths) {
|
|
168
|
+
if (fs.existsSync(formatPath)) {
|
|
169
|
+
return formatPath;
|
|
170
|
+
}
|
|
171
|
+
}
|
|
172
|
+
// Default to root if none found (will throw error if file doesn't exist)
|
|
173
|
+
return possiblePaths[0];
|
|
174
|
+
}
|
|
175
|
+
//# sourceMappingURL=format-parser.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"format-parser.js","sourceRoot":"","sources":["../src/format-parser.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAkBA,0CAGC;AAKD,gDA2HC;AAKD,8CAkBC;AA5KD,uCAAyB;AACzB,2CAA6B;AAc7B;;GAEG;AACH,SAAgB,eAAe,CAAC,cAAsB;IACpD,MAAM,OAAO,GAAG,EAAE,CAAC,YAAY,CAAC,cAAc,EAAE,OAAO,CAAC,CAAC;IACzD,OAAO,kBAAkB,CAAC,OAAO,CAAC,CAAC;AACrC,CAAC;AAED;;GAEG;AACH,SAAgB,kBAAkB,CAAC,OAAe;IAChD,MAAM,KAAK,GAAG,OAAO,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;IAElC,4CAA4C;IAC5C,IAAI,iBAAqC,CAAC;IAC1C,I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,CAAC,CAAC,CAAC,MAAM,GAAG,CAAC,CAAC,MAAM,CAAC,CAAC;IAE7C,OAAO;QACL,QAAQ;QACR,QAAQ;QACR,iBAAiB;KAClB,CAAC;AACJ,CAAC;AAED;;GAEG;AACH,SAAgB,iBAAiB;IAC/B,4CAA4C;IAC5C,yEAAyE;IACzE,yBAAyB;IACzB,MAAM,aAAa,GAAG;QACpB,IAAI,CAAC,IAAI,CAAC,SAAS,EAAE,IAAI,EAAE,mBAAmB,CAAC,EAAE,kBAAkB;QACnE,IAAI,CAAC,IAAI,CAAC,SAAS,EAAE,mBAAmB,CAAC,EAAE,2BAA2B;QACtE,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,GAAG,EAAE,EAAE,mBAAmB,CAAC,EAAE,4BAA4B;KAC5E,CAAC;IAEF,KAAK,MAAM,UAAU,IAAI,aAAa,EAAE,CAAC;QACvC,IAAI,EAAE,CAAC,UAAU,CAAC,UAAU,CAAC,EAAE,CAAC;YAC9B,OAAO,UAAU,CAAC;QACpB,CAAC;IACH,CAAC;IAED,yEAAyE;IACzE,OAAO,aAAa,CAAC,CAAC,CAAC,CAAC;AAC1B,CAAC"}
|
package/dist/generator.d.ts
CHANGED
|
@@ -1,12 +1,11 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Generate a new docspec file at the specified path
|
|
3
|
-
* @param filePath Path where the docspec file should be created
|
|
4
|
-
* @param name Name of the document (used in the header)
|
|
3
|
+
* @param filePath Path where the docspec file should be created (must end with .docspec.md)
|
|
5
4
|
*/
|
|
6
|
-
export declare function generateDocspec(filePath: string
|
|
5
|
+
export declare function generateDocspec(filePath: string): Promise<void>;
|
|
7
6
|
/**
|
|
8
7
|
* Generate docspec content as a string (for library use)
|
|
9
|
-
* @param
|
|
8
|
+
* @param targetFilePath Path to the target markdown file (e.g., "README.md")
|
|
10
9
|
*/
|
|
11
|
-
export declare function generateDocspecContent(
|
|
10
|
+
export declare function generateDocspecContent(targetFilePath: string): string;
|
|
12
11
|
//# sourceMappingURL=generator.d.ts.map
|
package/dist/generator.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"generator.d.ts","sourceRoot":"","sources":["../src/generator.ts"],"names":[],"mappings":"AAIA
|
|
1
|
+
{"version":3,"file":"generator.d.ts","sourceRoot":"","sources":["../src/generator.ts"],"names":[],"mappings":"AAIA;;;GAGG;AACH,wBAAsB,eAAe,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAgBrE;AAED;;;GAGG;AACH,wBAAgB,sBAAsB,CAAC,cAAc,EAAE,MAAM,GAAG,MAAM,CAErE"}
|
package/dist/generator.js
CHANGED
|
@@ -40,14 +40,14 @@ const fs = __importStar(require("fs/promises"));
|
|
|
40
40
|
const path = __importStar(require("path"));
|
|
41
41
|
/**
|
|
42
42
|
* Generate a new docspec file at the specified path
|
|
43
|
-
* @param filePath Path where the docspec file should be created
|
|
44
|
-
* @param name Name of the document (used in the header)
|
|
43
|
+
* @param filePath Path where the docspec file should be created (must end with .docspec.md)
|
|
45
44
|
*/
|
|
46
|
-
async function generateDocspec(filePath
|
|
47
|
-
// Extract
|
|
48
|
-
const
|
|
45
|
+
async function generateDocspec(filePath) {
|
|
46
|
+
// Extract target file path (replace .docspec.md with .md)
|
|
47
|
+
const targetFilePath = filePath.replace(/\.docspec\.md$/, ".md");
|
|
48
|
+
const targetFileName = path.basename(targetFilePath);
|
|
49
49
|
// Generate the template content
|
|
50
|
-
const content = (0, constants_1.getDocspecTemplate)(
|
|
50
|
+
const content = (0, constants_1.getDocspecTemplate)(targetFileName);
|
|
51
51
|
// Ensure the directory exists (recursive: true is safe even if dir exists)
|
|
52
52
|
const dir = path.dirname(filePath);
|
|
53
53
|
if (dir !== ".") {
|
|
@@ -58,20 +58,9 @@ async function generateDocspec(filePath, name) {
|
|
|
58
58
|
}
|
|
59
59
|
/**
|
|
60
60
|
* Generate docspec content as a string (for library use)
|
|
61
|
-
* @param
|
|
61
|
+
* @param targetFilePath Path to the target markdown file (e.g., "README.md")
|
|
62
62
|
*/
|
|
63
|
-
function generateDocspecContent(
|
|
64
|
-
return (0, constants_1.getDocspecTemplate)(
|
|
65
|
-
}
|
|
66
|
-
/**
|
|
67
|
-
* Extract a document name from a file path
|
|
68
|
-
*/
|
|
69
|
-
function extractNameFromPath(filePath) {
|
|
70
|
-
const basename = path.basename(filePath, ".docspec.md");
|
|
71
|
-
// Convert kebab-case, snake_case, or camelCase to Title Case
|
|
72
|
-
return basename
|
|
73
|
-
.split(/[-_]/)
|
|
74
|
-
.map(word => word.charAt(0).toUpperCase() + word.slice(1).toLowerCase())
|
|
75
|
-
.join(" ");
|
|
63
|
+
function generateDocspecContent(targetFilePath) {
|
|
64
|
+
return (0, constants_1.getDocspecTemplate)(targetFilePath);
|
|
76
65
|
}
|
|
77
66
|
//# sourceMappingURL=generator.js.map
|
package/dist/generator.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"generator.js","sourceRoot":"","sources":["../src/generator.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"generator.js","sourceRoot":"","sources":["../src/generator.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAQA,0CAgBC;AAMD,wDAEC;AAhCD,2CAAiD;AACjD,gDAAkC;AAClC,2CAA6B;AAE7B;;;GAGG;AACI,KAAK,UAAU,eAAe,CAAC,QAAgB;IACpD,0DAA0D;IAC1D,MAAM,cAAc,GAAG,QAAQ,CAAC,OAAO,CAAC,gBAAgB,EAAE,KAAK,CAAC,CAAC;IACjE,MAAM,cAAc,GAAG,IAAI,CAAC,QAAQ,CAAC,cAAc,CAAC,CAAC;IAErD,gCAAgC;IAChC,MAAM,OAAO,GAAG,IAAA,8BAAkB,EAAC,cAAc,CAAC,CAAC;IAEnD,2EAA2E;IAC3E,MAAM,GAAG,GAAG,IAAI,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC;IACnC,IAAI,GAAG,KAAK,GAAG,EAAE,CAAC;QAChB,MAAM,EAAE,CAAC,KAAK,CAAC,GAAG,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,CAAC;IAC3C,CAAC;IAED,iBAAiB;IACjB,MAAM,EAAE,CAAC,SAAS,CAAC,QAAQ,EAAE,OAAO,EAAE,OAAO,CAAC,CAAC;AACjD,CAAC;AAED;;;GAGG;AACH,SAAgB,sBAAsB,CAAC,cAAsB;IAC3D,OAAO,IAAA,8BAAkB,EAAC,cAAc,CAAC,CAAC;AAC5C,CAAC"}
|
package/dist/validator.js
CHANGED
|
@@ -103,6 +103,11 @@ function parseSections(content) {
|
|
|
103
103
|
}
|
|
104
104
|
// Extract section name (remove section number if present)
|
|
105
105
|
let sectionName = headerMatch[1].trim();
|
|
106
|
+
// Skip AGENT INSTRUCTIONS section - don't validate it
|
|
107
|
+
if (sectionName === "AGENT INSTRUCTIONS") {
|
|
108
|
+
currentSection = null;
|
|
109
|
+
continue;
|
|
110
|
+
}
|
|
106
111
|
// Remove leading number and period (e.g., "1. Purpose" -> "Purpose")
|
|
107
112
|
sectionName = sectionName.replace(/^\d+\.\s*/, "");
|
|
108
113
|
currentSection = {
|
package/dist/validator.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"validator.js","sourceRoot":"","sources":["../src/validator.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAQA,0CA+CC;AAvDD,gDAAkC;AAElC,2CAAqE;AAErE;;;GAGG;AACI,KAAK,UAAU,eAAe,CAAC,QAAgB;IACpD,MAAM,MAAM,GAAa,EAAE,CAAC;IAE5B,IAAI,CAAC;QACH,MAAM,OAAO,GAAG,MAAM,EAAE,CAAC,QAAQ,CAAC,QAAQ,EAAE,OAAO,CAAC,CAAC;QACrD,MAAM,QAAQ,GAAG,aAAa,CAAC,OAAO,CAAC,CA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OAAO,CAAC,MAAM,EAAE,GAAG,CAAC;SACpB,OAAO,CAAC,MAAM,EAAE,IAAI,CAAC;SACrB,IAAI,EAAE,CAAC;AACZ,CAAC"}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
# DOCSPEC: [{{TARGET_FILE}}](/{{TARGET_FILE}})
|
|
2
|
+
|
|
3
|
+
> A specification that defines how the target document should be maintained by agents.
|
|
4
|
+
|
|
5
|
+
## AGENT INSTRUCTIONS
|
|
6
|
+
|
|
7
|
+
**Target document:** `{{TARGET_FILE}}`
|
|
8
|
+
|
|
9
|
+
**Your task:**
|
|
10
|
+
|
|
11
|
+
* Compare the target document against this docspec.
|
|
12
|
+
* Update the target document to satisfy this docspec.
|
|
13
|
+
* Make the smallest changes necessary.
|
|
14
|
+
* Preserve existing content that already complies.
|
|
15
|
+
* Do not invent content, sections, or facts not implied by this docspec or the repository.
|
|
16
|
+
|
|
17
|
+
## 1. Document Purpose
|
|
18
|
+
|
|
19
|
+
What this document exists to explain or enable.
|
|
20
|
+
What questions it must reliably answer.
|
|
21
|
+
What kind of doc it is (overview, agent guide, spec, tutorial, etc.).
|
|
22
|
+
|
|
23
|
+
## 2. Update Triggers
|
|
24
|
+
|
|
25
|
+
What kinds of changes should cause this document to be updated.
|
|
26
|
+
Describe in terms of detectable changes (structure, APIs, workflows, behavior).
|
|
27
|
+
Also note changes that **should not** trigger updates.
|
|
28
|
+
|
|
29
|
+
## 3. Expected Structure
|
|
30
|
+
|
|
31
|
+
The sections this document should contain.
|
|
32
|
+
For each section: what it covers at a high level and any constraints
|
|
33
|
+
(e.g., "high-level only", "no exhaustive lists", "link out instead of duplicating").
|
|
34
|
+
|
|
35
|
+
## 4. Editing Guidelines
|
|
36
|
+
|
|
37
|
+
How edits to this document should be made.
|
|
38
|
+
Local rules for tone, level of detail, and scope.
|
|
39
|
+
Explicit do/don't guidance to avoid drift, speculation, or redundancy.
|
|
40
|
+
|
|
41
|
+
## 5. Intentional Omissions
|
|
42
|
+
|
|
43
|
+
What this document deliberately does not cover.
|
|
44
|
+
Where that information lives instead, if applicable.
|
|
45
|
+
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "docspec",
|
|
3
|
-
"version": "0.
|
|
4
|
-
"description": "
|
|
3
|
+
"version": "0.2.0",
|
|
4
|
+
"description": "Docspec is a specification format and toolchain for documentation that is maintained by agents.",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
7
7
|
"bin": {
|
|
@@ -23,7 +23,8 @@
|
|
|
23
23
|
"license": "MIT",
|
|
24
24
|
"files": [
|
|
25
25
|
"dist",
|
|
26
|
-
"README.md"
|
|
26
|
+
"README.md",
|
|
27
|
+
"docspec-format.md"
|
|
27
28
|
],
|
|
28
29
|
"devDependencies": {
|
|
29
30
|
"@types/jest": "^30.0.0",
|